12 #define PASSTHRUDIR "DetSimPassThru" 49 "Have called the EDepSim::KinemPassThrough constructor.");
54 "Get pointer to EDepSim::KinemPassThrough instance.");
62 const char * inputFileName,
63 const char* generatorName) {
65 "Adding a generator mc-truth input" 66 " tree to the list of input trees that can be used.");
75 if (inputTreePtr == NULL) {
76 EDepSimError(
"NULL input tree pointer. TTree not saved.");
90 " All pass-through trees must have same name.");
118 - inputTreePtr->GetEntries());
137 <<
" tree from the input file "<< inputFileName);
145 TIter
files(gROOT->GetListOfFiles());
147 while ((
object =
files.Next())) {
148 TFile*
file =
dynamic_cast<TFile*
>(object);
150 if (!file->IsOpen())
continue;
152 if (fileOption.find(
"CREATE") != std::string::npos) {
166 output->mkdir(
PASSTHRUDIR,
"DETSIM Pass-Through Information");
178 "Map kinematics with input files");
202 "since fPersistentTree is NULL.");
214 EDepSimError(
"Cannot copy entry from tree not in list of input trees.");
219 int first_event_in_chain = firstentry_iter->second;
229 "Copied entry " << origEntry
237 EDepSimError(
"Cannot copy entry " << origEntry+first_event_in_chain
238 <<
" from TChained Tree. Make sure entry is in input tree!");
255 std::string::size_type start_pos = name.rfind(
"/");
256 if (start_pos == std::string::npos) start_pos = 0;
else ++start_pos;
char fInputFileTreeName[128]
Used to fill the name of the tree for this file.
TTree * fInputKinemTree
Tree relating all events in the persistent tree to an input file.
std::string fFirstTreeName
Store the first tree name.
TChain * fInputTreeChain
TChain to store input trees.
TreeToInt fFirstEntryMap
for relating input tree to first entry in TChain.
static EDepSim::KinemPassThrough * fKinemPassThrough
Static pointer to singleton instance.
#define EDepSimNamedDebug(trace, outStream)
std::vector< std::string > fFileList
Used to store list of files before they are written to tree.
void CleanUp()
Clean up all of the allocated pointers.
void CreateInternalTrees()
double fInputFilePOT
Used to fill input file list tree "filePOT" field.
std::string SetInputFileName(std::string name)
Set the name of the input file being read.
KinemPassThrough()
Private constructor.
char fInputFileName[1024]
Used to fill input file list tree with input file name.
bool AddEntry(const TTree *inputTreePtr, const int origEntry)
static EDepSim::KinemPassThrough * GetInstance()
#define EDepSimNamedTrace(trace, outStream)
TreeToInt fInputTreeMap
for relating input tree pointers to the input file.
TTree * fInputFilesTree
Tree containing list of input files.
bool AddInputTree(const TTree *inputTreePtr, const char *inputFileName, const char *generatorName)
char fInputFileGenerator[128]
Used to fill the name of the generator for this file.
void Init()
Set default values for all fields.
#define EDepSimError(outStream)
TTree * fPersistentTree
Persistent tree that stores entries from multiple temp trees.