Public Member Functions | Public Attributes | Friends | List of all members
genie::NtpMCTreeHeader Class Reference

MINOS-style Ntuple Class to hold an output MC Tree Header. More...

#include <NtpMCTreeHeader.h>

Inheritance diagram for genie::NtpMCTreeHeader:

Public Member Functions

 NtpMCTreeHeader ()
 
 NtpMCTreeHeader (const NtpMCTreeHeader &hdr)
 
virtual ~NtpMCTreeHeader ()
 
void Init (void)
 
void Copy (const NtpMCTreeHeader &hdr)
 
void PrintToStream (ostream &stream) const
 

Public Attributes

NtpMCFormat_t format
 Event Record format (GENIE support multiple formats) More...
 
TObjString cvstag
 GENIE CVS Tag (to keep track of GENIE's version) More...
 
NtpMCDTime datime
 Date and Time that the event ntuple was generated. More...
 
Long_t runnu
 MC Job run number. More...
 
Long_t runseed
 Random seed used in the MC run. More...
 
TObjString tune
 GENIE Tune Name. More...
 
TObjString tuneDir
 directory from when tune config came More...
 
TObjString customDirs
 any custom directories More...
 

Friends

ostream & operator<< (ostream &stream, const NtpMCTreeHeader &hdr)
 

Detailed Description

MINOS-style Ntuple Class to hold an output MC Tree Header.

Author
Costas Andreopoulos <constantinos.andreopoulos cern.ch> University of Liverpool & STFC Rutherford Appleton Laboratory

October 1, 2004

Copyright (c) 2003-2020, The GENIE Collaboration For the full text of the license visit http://copyright.genie-mc.org

Definition at line 37 of file NtpMCTreeHeader.h.

Constructor & Destructor Documentation

NtpMCTreeHeader::NtpMCTreeHeader ( )

Definition at line 36 of file NtpMCTreeHeader.cxx.

36  :
37 TNamed("header","GENIE output tree header")
38 {
39  this->Init();
40 }
NtpMCTreeHeader::NtpMCTreeHeader ( const NtpMCTreeHeader hdr)

Definition at line 42 of file NtpMCTreeHeader.cxx.

42  :
43 TNamed("header","GENIE output tree header")
44 {
45  this->Copy(hdr);
46 }
void Copy(const NtpMCTreeHeader &hdr)
NtpMCTreeHeader::~NtpMCTreeHeader ( )
virtual

Definition at line 48 of file NtpMCTreeHeader.cxx.

49 {
50 
51 }

Member Function Documentation

void NtpMCTreeHeader::Copy ( const NtpMCTreeHeader hdr)

Definition at line 72 of file NtpMCTreeHeader.cxx.

73 {
74  this->format = hdr.format;
75  this->cvstag.SetString(hdr.cvstag.GetString().Data());
76  this->datime.Copy(hdr.datime);
77  this->runnu = hdr.runnu;
78  this->runseed = hdr.runseed;
79  this->tune.SetString(hdr.tune.GetString().Data());
80  this->tuneDir.SetString(hdr.tuneDir.GetString().Data());
81  this->customDirs.SetString(hdr.customDirs.GetString().Data());
82 }
TObjString tune
GENIE Tune Name.
NtpMCDTime datime
Date and Time that the event ntuple was generated.
TObjString tuneDir
directory from when tune config came
TObjString cvstag
GENIE CVS Tag (to keep track of GENIE&#39;s version)
Long_t runnu
MC Job run number.
void Copy(const NtpMCDTime &dt)
Definition: NtpMCDTime.cxx:54
TObjString customDirs
any custom directories
NtpMCFormat_t format
Event Record format (GENIE support multiple formats)
Long_t runseed
Random seed used in the MC run.
void NtpMCTreeHeader::Init ( void  )

Definition at line 84 of file NtpMCTreeHeader.cxx.

85 {
86  string version;
87  string genie_path = gSystem->Getenv("GENIE");
88  string filename = genie_path + "/VERSION";
89  bool vrs_file_found = ! (gSystem->AccessPathName(filename.c_str()));
90  if (!vrs_file_found) {
91  LOG("Ntp", pERROR)
92  << "The GENIE version file [" << filename << "] is not accessible";
93  version = "NO CVS version number was specified";
94  } else {
95  ifstream gvinp(filename.c_str(), ios::in);
96  gvinp >> version;
97  gvinp.close();
98  }
99 
100  string tunename("unknown");
101  string tuneDir("unknown");
102  string customDirs("");
103 
104  this->format = kNFUndefined;
105  this->cvstag.SetString(version.c_str());
106  this->datime.Now();
107  this->runnu = 0;
108  this->runseed = 0;
109  this->tune.SetString(tunename.c_str());
110  this->tuneDir.SetString(tuneDir.c_str());
111  this->customDirs.SetString(customDirs.c_str());
112 }
#define pERROR
Definition: Messenger.h:59
TObjString tune
GENIE Tune Name.
NtpMCDTime datime
Date and Time that the event ntuple was generated.
string filename
Definition: train.py:213
TObjString tuneDir
directory from when tune config came
TObjString cvstag
GENIE CVS Tag (to keep track of GENIE&#39;s version)
#define LOG(stream, priority)
A macro that returns the requested log4cpp::Category appending a string (using the FILE...
Definition: Messenger.h:96
Long_t runnu
MC Job run number.
TObjString customDirs
any custom directories
void Now(void)
Definition: NtpMCDTime.cxx:76
NtpMCFormat_t format
Event Record format (GENIE support multiple formats)
Long_t runseed
Random seed used in the MC run.
void NtpMCTreeHeader::PrintToStream ( ostream &  stream) const

Definition at line 53 of file NtpMCTreeHeader.cxx.

54 {
55  string sformat = NtpMCFormat::AsString(this->format);
56  string scvstag = this->cvstag.GetString().Data();
57  string stune = this->tune.GetString().Data();
58  string stuneDir = this->tuneDir.GetString().Data();
59  string scustomDirs = this->customDirs.GetString().Data();
60 
61  stream << "Tree Header Info:" << endl
62  << "MC run number -> " << this->runnu << endl
63  << "MC run seed -> " << this->runseed << endl
64  << "NtpRecord Format -> " << sformat << endl
65  << "GENIE CVS Vrs Nu -> " << scvstag << endl
66  << "GENIE tune name -> " << stune << endl
67  << "tune directory -> " << stuneDir << endl
68  << "custom directories-> " << scustomDirs << endl
69  << "File generated at -> " << this->datime << endl;
70 }
TObjString tune
GENIE Tune Name.
NtpMCDTime datime
Date and Time that the event ntuple was generated.
TObjString tuneDir
directory from when tune config came
TObjString cvstag
GENIE CVS Tag (to keep track of GENIE&#39;s version)
Long_t runnu
MC Job run number.
static const char * AsString(NtpMCFormat_t fmt)
Definition: NtpMCFormat.h:36
TObjString customDirs
any custom directories
NtpMCFormat_t format
Event Record format (GENIE support multiple formats)
Long_t runseed
Random seed used in the MC run.
QTextStream & endl(QTextStream &s)

Friends And Related Function Documentation

ostream& operator<< ( ostream &  stream,
const NtpMCTreeHeader hdr 
)
friend

Definition at line 29 of file NtpMCTreeHeader.cxx.

30  {
31  hdr.PrintToStream(stream);
32  return stream;
33  }
void PrintToStream(ostream &stream) const

Member Data Documentation

TObjString genie::NtpMCTreeHeader::customDirs

any custom directories

Definition at line 63 of file NtpMCTreeHeader.h.

TObjString genie::NtpMCTreeHeader::cvstag

GENIE CVS Tag (to keep track of GENIE's version)

Definition at line 57 of file NtpMCTreeHeader.h.

NtpMCDTime genie::NtpMCTreeHeader::datime

Date and Time that the event ntuple was generated.

Definition at line 58 of file NtpMCTreeHeader.h.

NtpMCFormat_t genie::NtpMCTreeHeader::format

Event Record format (GENIE support multiple formats)

Definition at line 56 of file NtpMCTreeHeader.h.

Long_t genie::NtpMCTreeHeader::runnu

MC Job run number.

Definition at line 59 of file NtpMCTreeHeader.h.

Long_t genie::NtpMCTreeHeader::runseed

Random seed used in the MC run.

Definition at line 60 of file NtpMCTreeHeader.h.

TObjString genie::NtpMCTreeHeader::tune

GENIE Tune Name.

Definition at line 61 of file NtpMCTreeHeader.h.

TObjString genie::NtpMCTreeHeader::tuneDir

directory from when tune config came

Definition at line 62 of file NtpMCTreeHeader.h.


The documentation for this class was generated from the following files: