GENIEGenerator
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
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:
Inheritance graph
[legend]
Collaboration diagram for genie::NtpMCTreeHeader:
Collaboration graph
[legend]

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 <c.andreopoulos cern.ch> University of Liverpool
Created:
October 1, 2004
License:
Copyright (c) 2003-2024, 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.

References Init().

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.

References Copy().

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.

References genie::NtpMCDTime::Copy(), customDirs, cvstag, datime, format, runnu, runseed, tune, and tuneDir.

Referenced by NtpMCTreeHeader().

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.

References customDirs, cvstag, datime, format, genie::kNFUndefined, LOG, genie::NtpMCDTime::Now(), pERROR, runnu, runseed, tune, and tuneDir.

Referenced by NtpMCTreeHeader().

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.
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.

References genie::NtpMCFormat::AsString(), customDirs, cvstag, datime, format, runnu, runseed, tune, and tuneDir.

Referenced by genie::operator<<().

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.

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.

Referenced by Copy(), Init(), genie::NtpWriter::Initialize(), and PrintToStream().

TObjString genie::NtpMCTreeHeader::cvstag

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

Definition at line 57 of file NtpMCTreeHeader.h.

Referenced by Copy(), Init(), and PrintToStream().

NtpMCDTime genie::NtpMCTreeHeader::datime

Date and Time that the event ntuple was generated.

Definition at line 58 of file NtpMCTreeHeader.h.

Referenced by Copy(), Init(), and PrintToStream().

NtpMCFormat_t genie::NtpMCTreeHeader::format

Event Record format (GENIE support multiple formats)

Definition at line 56 of file NtpMCTreeHeader.h.

Referenced by Copy(), genie::NtpWriter::CreateTreeHeader(), Init(), and PrintToStream().

Long_t genie::NtpMCTreeHeader::runnu

MC Job run number.

Definition at line 59 of file NtpMCTreeHeader.h.

Referenced by Copy(), genie::NtpWriter::CreateTreeHeader(), Init(), and PrintToStream().

Long_t genie::NtpMCTreeHeader::runseed

Random seed used in the MC run.

Definition at line 60 of file NtpMCTreeHeader.h.

Referenced by Copy(), genie::NtpWriter::CreateTreeHeader(), Init(), and PrintToStream().

TObjString genie::NtpMCTreeHeader::tune

GENIE Tune Name.

Definition at line 61 of file NtpMCTreeHeader.h.

Referenced by Copy(), Init(), genie::NtpWriter::Initialize(), and PrintToStream().

TObjString genie::NtpMCTreeHeader::tuneDir

directory from when tune config came

Definition at line 62 of file NtpMCTreeHeader.h.

Referenced by Copy(), Init(), genie::NtpWriter::Initialize(), and PrintToStream().


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