GENIEGenerator
Loading...
Searching...
No Matches
genie::NtpMCTreeHeader Class Reference

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

#include <NtpMCTreeHeader.h>

Inheritance diagram for genie::NtpMCTreeHeader:
[legend]
Collaboration diagram for genie::NtpMCTreeHeader:
[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)
TObjString cvstag
 GENIE CVS Tag (to keep track of GENIE's version)
NtpMCDTime datime
 Date and Time that the event ntuple was generated.
Long_t runnu
 MC Job run number.
Long_t runseed
 Random seed used in the MC run.
TObjString tune
 GENIE Tune Name.
TObjString tuneDir
 directory from when tune config came
TObjString customDirs
 any custom directories

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 \at cern.ch> University of Liverpool
Created:\n October 1, 2004
License:\n Copyright (c) 2003-2025, 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() [1/2]

NtpMCTreeHeader::NtpMCTreeHeader ( )

Definition at line 36 of file NtpMCTreeHeader.cxx.

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

References Init().

Referenced by Copy(), NtpMCTreeHeader(), and operator<<.

◆ NtpMCTreeHeader() [2/2]

NtpMCTreeHeader::NtpMCTreeHeader ( const NtpMCTreeHeader & hdr)

Definition at line 42 of file NtpMCTreeHeader.cxx.

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

References Copy(), and NtpMCTreeHeader().

◆ ~NtpMCTreeHeader()

NtpMCTreeHeader::~NtpMCTreeHeader ( )
virtual

Definition at line 48 of file NtpMCTreeHeader.cxx.

49{
50
51}

Member Function Documentation

◆ Copy()

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

References customDirs, cvstag, datime, format, NtpMCTreeHeader(), runnu, runseed, tune, and tuneDir.

Referenced by NtpMCTreeHeader().

◆ Init()

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
#define LOG(stream, priority)
A macro that returns the requested log4cpp::Category appending a string (using the FILE,...
Definition Messenger.h:96
@ kNFUndefined
Definition NtpMCFormat.h:29

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

Referenced by NtpMCTreeHeader().

◆ PrintToStream()

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}
static const char * AsString(NtpMCFormat_t fmt)
Definition NtpMCFormat.h:36

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

Referenced by operator<<.

◆ operator<<

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

References NtpMCTreeHeader(), and PrintToStream().

Member Data Documentation

◆ customDirs

TObjString genie::NtpMCTreeHeader::customDirs

any custom directories

Definition at line 63 of file NtpMCTreeHeader.h.

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

◆ cvstag

TObjString genie::NtpMCTreeHeader::cvstag

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

Definition at line 57 of file NtpMCTreeHeader.h.

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

◆ datime

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

◆ format

NtpMCFormat_t genie::NtpMCTreeHeader::format

Event Record format (GENIE support multiple formats)

Definition at line 56 of file NtpMCTreeHeader.h.

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

◆ runnu

Long_t genie::NtpMCTreeHeader::runnu

MC Job run number.

Definition at line 59 of file NtpMCTreeHeader.h.

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

◆ runseed

Long_t genie::NtpMCTreeHeader::runseed

Random seed used in the MC run.

Definition at line 60 of file NtpMCTreeHeader.h.

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

◆ tune

TObjString genie::NtpMCTreeHeader::tune

GENIE Tune Name.

Definition at line 61 of file NtpMCTreeHeader.h.

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

◆ tuneDir

TObjString genie::NtpMCTreeHeader::tuneDir

directory from when tune config came

Definition at line 62 of file NtpMCTreeHeader.h.

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


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