Go to the documentation of this file. 1 #ifndef PhysicsTools_FWLite_interface_FWLiteAnalyzerWrapper_h
2 #define PhysicsTools_FWLite_interface_FWLiteAnalyzerWrapper_h
132 : inputHandler_(
cfg),
135 reportAfter_(inputHandler_.reportAfter()),
136 fileService_(outputHandler_.
file()) {
153 std::vector<std::string>
const&
inputFiles = inputHandler_.files();
156 for (
event.toBegin(); !
event.atEnd(); ++
event, ++ievt) {
158 if (maxEvents_ > 0 ? ievt + 1 > maxEvents_ :
false)
161 if (reportAfter_ != 0 ? (ievt > 0 && ievt % reportAfter_ == 0) :
false)
162 std::cout <<
" processing event: " << ievt << std::endl;
164 analyzer_->analyze(
event);
int maxEvents_
maximal number of events to be processed (-1 means to loop over all event)
TFileDirectory mkdir(const std::string &dir, const std::string &descr="")
create a new subdirectory
fwlite::TFileService fileService_
TFileService for histogram management.
virtual ~AnalyzerWrapper()
default destructor
fwlite::InputSource inputHandler_
helper class for input parameter handling
std::shared_ptr< T > analyzer_
derived class of type BasicAnalyzer
virtual void beginJob()
everything which has to be done before the event loop
fwlite::OutputFiles outputHandler_
helper class for output file handling
AnalyzerWrapper(const edm::ParameterSet &cfg, std::string analyzerName, std::string directory="")
default constructor
unsigned int reportAfter_
number of events after which the progress will be reported (0 means no report)
virtual void analyze()
everything which has to be done during the event loop. NOTE: the event will be looped inside this fun...
virtual void endJob()
everything which has to be done after the event loop