GENIEGenerator
|
A utility class to facilitate creating the GENIE MC Ntuple from the output GENIE GHEP event records. More...
#include <NtpWriter.h>
Public Member Functions | |
NtpWriter (NtpMCFormat_t fmt=kNFGHEP, Long_t runnu=0, Long_t runseed=-1) | |
~NtpWriter () | |
initialize the ntuple writer More... | |
void | Initialize (void) |
add event More... | |
void | AddEventRecord (int ievent, const EventRecord *ev_rec) |
save the event tree More... | |
void | Save (void) |
get the even tree More... | |
TTree * | EventTree (void) |
void | CustomizeFilename (string filename) |
void | CustomizeFilenamePrefix (string prefix) |
Private Member Functions | |
void | SetDefaultFilename (string filename_prefix="gntp") |
void | OpenFile (string filename) |
void | CreateTree (void) |
void | CreateTreeHeader (void) |
void | CreateEventBranch (void) |
void | CreateGHEPEventBranch (void) |
Private Attributes | |
NtpMCFormat_t | fNtpFormat |
enumeration of event formats More... | |
Long_t | fRunNu |
run nu More... | |
Long_t | fRunSeed |
run seed More... | |
string | fOutFilename |
output filename More... | |
TFile * | fOutFile |
output file More... | |
TTree * | fOutTree |
output tree More... | |
TBranch * | fEventBranch |
the generated event branch More... | |
NtpMCEventRecord * | fNtpMCEventRecord |
NtpMCTreeHeader * | fNtpMCTreeHeader |
A utility class to facilitate creating the GENIE MC Ntuple from the output GENIE GHEP event records.
Definition at line 39 of file NtpWriter.h.
NtpWriter::NtpWriter | ( | NtpMCFormat_t | fmt = kNFGHEP , |
Long_t | runnu = 0 , |
||
Long_t | runseed = -1 |
||
) |
Definition at line 35 of file NtpWriter.cxx.
References genie::NtpMCFormat::AsString(), fNtpFormat, LOG, pNOTICE, and SetDefaultFilename().
NtpWriter::~NtpWriter | ( | ) |
void NtpWriter::AddEventRecord | ( | int | ievent, |
const EventRecord * | ev_rec | ||
) |
save the event tree
Definition at line 57 of file NtpWriter.cxx.
References genie::NtpMCEventRecord::Fill(), fNtpFormat, fNtpMCEventRecord, fOutTree, genie::kNFGHEP, LOG, pERROR, and pINFO.
Referenced by ConvertToGHepMock(), GenerateEventsAtFixedInitState(), main(), and RunCherryPicker().
|
private |
Definition at line 175 of file NtpWriter.cxx.
References CreateGHEPEventBranch(), fEventBranch, fNtpFormat, genie::kNFGHEP, LOG, and pERROR.
Referenced by Initialize().
|
private |
Definition at line 190 of file NtpWriter.cxx.
References fEventBranch, fNtpMCEventRecord, fOutTree, LOG, and pINFO.
Referenced by CreateEventBranch().
|
private |
Definition at line 161 of file NtpWriter.cxx.
References genie::NtpMCFormat::AsString(), fNtpFormat, fOutTree, LOG, and pINFO.
Referenced by Initialize().
|
private |
Definition at line 210 of file NtpWriter.cxx.
References fNtpFormat, fNtpMCTreeHeader, genie::NtpMCTreeHeader::format, fRunNu, fRunSeed, LOG, pINFO, genie::NtpMCTreeHeader::runnu, and genie::NtpMCTreeHeader::runseed.
Referenced by Initialize().
void NtpWriter::CustomizeFilename | ( | string | filename | ) |
Definition at line 128 of file NtpWriter.cxx.
References fOutFilename.
Referenced by ConvertToGHepMock(), GenerateEventsAtFixedInitState(), and RunCherryPicker().
void NtpWriter::CustomizeFilenamePrefix | ( | string | prefix | ) |
Definition at line 133 of file NtpWriter.cxx.
References SetDefaultFilename().
Referenced by main().
|
inline |
use before Initialize() only if you wish to override the default filename, or the default filename prefix
Definition at line 55 of file NtpWriter.h.
References fOutTree.
Referenced by main(), and RunCherryPicker().
void NtpWriter::Initialize | ( | void | ) |
add event
Definition at line 83 of file NtpWriter.cxx.
References CreateEventBranch(), CreateTree(), CreateTreeHeader(), genie::NtpMCTreeHeader::customDirs, genie::TuneId::CustomSource(), fNtpMCTreeHeader, fOutFilename, genie::RunOpt::Instance(), genie::TuneId::IsCustom(), genie::NtpMCJobConfig::Load(), LOG, genie::TuneId::Name(), OpenFile(), pERROR, pINFO, genie::NtpMCJobEnv::TakeSnapshot(), genie::RunOpt::Tune(), genie::NtpMCTreeHeader::tune, genie::NtpMCTreeHeader::tuneDir, and genie::TuneId::TuneDirectory().
Referenced by ConvertToGHepMock(), GenerateEventsAtFixedInitState(), main(), and RunCherryPicker().
|
private |
Definition at line 149 of file NtpWriter.cxx.
References fOutFile, LOG, and pINFO.
Referenced by Initialize().
void NtpWriter::Save | ( | void | ) |
get the even tree
Definition at line 225 of file NtpWriter.cxx.
References fOutFile, LOG, pERROR, and pINFO.
Referenced by ConvertToGHepMock(), GenerateEventsAtFixedInitState(), main(), and RunCherryPicker().
|
private |
Definition at line 138 of file NtpWriter.cxx.
References genie::NtpMCFormat::FilenameTag(), fNtpFormat, fOutFilename, and fRunNu.
Referenced by CustomizeFilenamePrefix(), and NtpWriter().
|
private |
the generated event branch
Definition at line 77 of file NtpWriter.h.
Referenced by CreateEventBranch(), and CreateGHEPEventBranch().
|
private |
enumeration of event formats
Definition at line 71 of file NtpWriter.h.
Referenced by AddEventRecord(), CreateEventBranch(), CreateTree(), CreateTreeHeader(), NtpWriter(), and SetDefaultFilename().
|
private |
Definition at line 78 of file NtpWriter.h.
Referenced by AddEventRecord(), and CreateGHEPEventBranch().
|
private |
Definition at line 79 of file NtpWriter.h.
Referenced by CreateTreeHeader(), and Initialize().
|
private |
|
private |
output filename
Definition at line 74 of file NtpWriter.h.
Referenced by CustomizeFilename(), Initialize(), and SetDefaultFilename().
|
private |
output tree
Definition at line 76 of file NtpWriter.h.
Referenced by AddEventRecord(), CreateGHEPEventBranch(), CreateTree(), and EventTree().
|
private |
run nu
Definition at line 72 of file NtpWriter.h.
Referenced by CreateTreeHeader(), and SetDefaultFilename().
|
private |