1#ifndef FRAMEWORK_EVENT_EVENTFILE_H_
2#define FRAMEWORK_EVENT_EVENTFILE_H_
10#include "Framework/Configure/Parameters.h"
43 const std::string &filename,
EventFile *parent,
bool isOutputFile,
44 bool isSingleOutput,
bool isLoopable);
59 const std::string &fileName,
bool isLoopable);
74 const std::string &fileName,
EventFile *parent,
75 bool isSingleOutput =
false);
89 const std::string &fileName);
157 void addDrop(
const std::string &rule);
212 bool nextEvent(
bool storeCurrentEvent =
true);
337 std::map<int, std::pair<bool, ldmx::RunHeader *>>
runMap_;
Class implementing an event buffer system for storing event data.
This class manages all ROOT file input/output operations.
void updateParent(EventFile *parent)
Change pointer to different parent file.
const std::string & getFileName()
bool isSingleOutput_
True if there is only one output file.
TFile * file_
The backing TFile for this EventFile.
void addDrop(const std::string &rule)
Add a rule for dropping collections from the output.
std::string fileName_
The file name.
bool isLoopable_
True if this is an input file with pileup overlay events */.
std::map< int, std::pair< bool, ldmx::RunHeader * > > runMap_
Map of run numbers to RunHeader objects.
void setupEvent(Event *evt)
Set an Event object containing the event data to work with this file.
Long64_t entries_
The number of entries in the tree.
std::vector< std::string > reactivateRules_
Vector of drop rules that have been parsed and need to be used to reactivate these branches on the in...
std::vector< std::pair< std::string, bool > > preCloneRules_
Pre-clone rules.
void writeRunTree()
Write the map of run headers to the file as a TTree of RunHeader.
bool nextEvent(bool storeCurrentEvent=true)
Prepare the next event.
Event * getEvent()
Get the Event object containing the event data.
bool isOutputFile_
True if file is an output file being written to disk.
ldmx::RunHeader * getRunHeaderPtr(int runNumber)
Update the RunHeader for a given run, if it exists in the input file.
Long64_t ientry_
The current entry in the tree.
void writeRunHeader(ldmx::RunHeader &runHeader)
Write the run header into the run map.
void importRunHeaders()
Fill the internal map of run numbers to RunHeader objects from the input file.
int skipToEvent(int offset)
Skip events using an offset.
ldmx::RunHeader & getRunHeader(int runNumber)
Get the RunHeader for a given run, if it exists in the input file.
EventFile * parent_
A parent file containing event data.
TTree * tree_
The tree with event data.
Event * event_
The object containing the actual event data (trees and branches).
bool isCorrupted() const
Check if the file we have is corrupted.
Implements an event buffer system for storing event data.
Class encapsulating parameters for configuring a processor.
All classes in the ldmx-sw project use this namespace.