22 std::cout <<
"Processing file " << ifile << std::endl;
25 module->initialize(ifile, output_files_[cfile]);
33 }
catch (std::exception& e) {
34 std::cerr<<
"Error:"<<e.what()<<std::endl;
40 int n_events_processed = 0;
42 TH1D * event_h =
new TH1D(
"event_h",
"Number of Events Processed;;Events", 21, -10.5, 10.5);
45 std::cout<<
"Processing file "<<ifile<<std::endl;
52 module->initialize(event.getTree());
53 module->setFile(file->getOutputFile());
56 if (n_events_processed%1000 == 0)
57 std::cout<<
"Event:"<<n_events_processed<<std::endl;
61 module->process(&event);
87 }
catch (std::exception& e) {
88 std::cerr<<
"Error:"<<e.what()<<std::endl;
96 int n_events_processed = 0;
97 TH1D * event_h =
new TH1D(
"event_h",
"Number of Events Processed;;Events", 21, -10.5, 10.5);
100 throw std::runtime_error(
"Please specify files to process.");
108 std::cout <<
"---- [ hpstr ][ Process ]: Processing file "
109 << ifile << std::endl;
121 TTree* tree =
new TTree(
"HPS_Event",
"HPS event tree");
125 module->initialize(tree);
133 if (n_events_processed%1000 == 0)
134 std::cout <<
"---- [ hpstr ][ Process ]: Event: " << n_events_processed << std::endl;
136 bool passEvent =
true;
139 passEvent = passEvent && module->process(&event);
144 ++n_events_processed;
170 }
catch (std::exception& e) {
171 std::cerr <<
"---- [ hpstr ][ Process ]: Error! " << e.what() << std::endl;
Class for managing io files.
Class which represents the process under execution.
virtual bool nextEvent()
Load the next event in the file.
void resetOutputFileDir()
virtual void FillEvent()
Persists the event.
void setupEvent(IEvent *ievent)
Setup the event object that will be used by this file.
virtual bool nextEvent()
description
void resetOutputFileDir()
description
void setupEvent(IEvent *ievent)
description
void addFileToProcess(const std::string &filename)
Add an input file name to the list.
void addOutputFileName(const std::string &output_filename)
Add an output file name to the list.
std::vector< std::string > output_files_
std::vector< Processor * > sequence_
void addToSequence(Processor *event_proc)
Add an event processor to the linear sequence of processors to run in this job.
Process()
Class constructor.
std::vector< std::string > input_files_
Base class for all event processing components.