CMS 3D CMS Logo

List of all members | Public Member Functions | Protected Attributes
fwlite::AnalyzerWrapper< T > Class Template Reference

#include <FWLiteAnalyzerWrapper.h>

Public Member Functions

virtual void analyze ()
 everything which has to be done during the event loop. NOTE: the event will be looped inside this function More...
 
 AnalyzerWrapper (const edm::ParameterSet &cfg, std::string analyzerName, std::string directory="")
 default constructor More...
 
virtual void beginJob ()
 everything which has to be done before the event loop More...
 
virtual void endJob ()
 everything which has to be done after the event loop More...
 
virtual ~AnalyzerWrapper ()
 default destructor More...
 

Protected Attributes

boost::shared_ptr< Tanalyzer_
 derived class of type BasicAnalyzer More...
 
fwlite::TFileService fileService_
 TFileService for histogram management. More...
 
fwlite::InputSource inputHandler_
 helper class for input parameter handling More...
 
int maxEvents_
 maximal number of events to be processed (-1 means to loop over all event) More...
 
fwlite::OutputFiles outputHandler_
 helper class for output file handling More...
 
unsigned int reportAfter_
 number of events after which the progress will be reported (0 means no report) More...
 

Detailed Description

template<class T>
class fwlite::AnalyzerWrapper< T >

Definition at line 103 of file FWLiteAnalyzerWrapper.h.

Constructor & Destructor Documentation

template<class T >
fwlite::AnalyzerWrapper< T >::AnalyzerWrapper ( const edm::ParameterSet cfg,
std::string  analyzerName,
std::string  directory = "" 
)

default constructor

default contructor

Definition at line 134 of file FWLiteAnalyzerWrapper.h.

References fwlite::AnalyzerWrapper< T >::analyzer_, dir, fwlite::AnalyzerWrapper< T >::fileService_, edm::ParameterSet::getParameter(), and TFileDirectory::mkdir().

134  :
137  {
138  // analysis specific parameters
140  if(directory.empty()){
141  // create analysis class of type BasicAnalyzer
142  analyzer_ = boost::shared_ptr<T>( new T( ana, fileService_) );
143  }
144  else{
145  // create a directory in the file if directory string is non empty
147  analyzer_ = boost::shared_ptr<T>( new T( ana, dir ) );
148  }
149  }
T getParameter(std::string const &) const
fwlite::OutputFiles outputHandler_
helper class for output file handling
fwlite::TFileService fileService_
TFileService for histogram management.
fwlite::InputSource inputHandler_
helper class for input parameter handling
TFileDirectory mkdir(const std::string &dir, const std::string &descr="")
create a new subdirectory
int maxEvents() const
return maxEvetns_
Definition: InputSource.h:43
int maxEvents_
maximal number of events to be processed (-1 means to loop over all event)
dbl *** dir
Definition: mlp_gen.cc:35
long double T
unsigned int reportAfter() const
return reportAfter_
Definition: InputSource.h:45
unsigned int reportAfter_
number of events after which the progress will be reported (0 means no report)
boost::shared_ptr< T > analyzer_
derived class of type BasicAnalyzer
std::string const & file() const
return output fuke name
Definition: OutputFiles.h:30
template<class T >
virtual fwlite::AnalyzerWrapper< T >::~AnalyzerWrapper ( )
inlinevirtual

default destructor

Definition at line 109 of file FWLiteAnalyzerWrapper.h.

109 {};

Member Function Documentation

template<class T >
void fwlite::AnalyzerWrapper< T >::analyze ( )
virtual

everything which has to be done during the event loop. NOTE: the event will be looped inside this function

Definition at line 153 of file FWLiteAnalyzerWrapper.h.

References fwlite::AnalyzerWrapper< T >::analyzer_, fwlite::ChainEvent::atEnd(), gather_cfg::cout, event(), fwlite::InputSource::files(), merge::inputFiles, fwlite::AnalyzerWrapper< T >::inputHandler_, fwlite::AnalyzerWrapper< T >::maxEvents_, fwlite::AnalyzerWrapper< T >::reportAfter_, and fwlite::ChainEvent::toBegin().

Referenced by fwlite::AnalyzerWrapper< T >::beginJob(), and main().

153  {
154  int ievt=0;
155  std::vector<std::string> const & inputFiles = inputHandler_.files();
156  // loop the vector of input files
157  fwlite::ChainEvent event( inputFiles );
158  for(event.toBegin(); !event.atEnd(); ++event, ++ievt){
159  // break loop if maximal number of events is reached
160  if(maxEvents_>0 ? ievt+1>maxEvents_ : false) break;
161  // simple event counter
162  if(reportAfter_!=0 ? (ievt>0 && ievt%reportAfter_==0) : false)
163  std::cout << " processing event: " << ievt << std::endl;
164  // analyze event
165  analyzer_->analyze(event);
166  }
167  }
fwlite::InputSource inputHandler_
helper class for input parameter handling
How EventSelector::AcceptEvent() decides whether to accept an event for output otherwise it is excluding the probing of A single or multiple positive and the trigger will pass if any such matching triggers are PASS or EXCEPTION[A criterion thatmatches no triggers at all is detected and causes a throw.] A single negative with an expectation of appropriate bit checking in the decision and the trigger will pass if any such matching triggers are FAIL or EXCEPTION A wildcarded negative criterion that matches more than one trigger in the trigger but the state exists so we define the behavior If all triggers are the negative crieriion will lead to accepting the event(this again matches the behavior of"!*"before the partial wildcard feature was incorporated).The per-event"cost"of each negative criterion with multiple relevant triggers is about the same as!*was in the past
inputFiles
Definition: merge.py:6
int maxEvents_
maximal number of events to be processed (-1 means to loop over all event)
const std::vector< std::string > & files() const
return vector of files_
Definition: InputSource.h:41
Definition: event.py:1
unsigned int reportAfter_
number of events after which the progress will be reported (0 means no report)
boost::shared_ptr< T > analyzer_
derived class of type BasicAnalyzer
template<class T >
virtual void fwlite::AnalyzerWrapper< T >::beginJob ( void  )
inlinevirtual

everything which has to be done before the event loop

Definition at line 111 of file FWLiteAnalyzerWrapper.h.

References fwlite::AnalyzerWrapper< T >::analyze(), and fwlite::AnalyzerWrapper< T >::analyzer_.

Referenced by main().

111 { analyzer_->beginJob(); }
boost::shared_ptr< T > analyzer_
derived class of type BasicAnalyzer
template<class T >
virtual void fwlite::AnalyzerWrapper< T >::endJob ( void  )
inlinevirtual

everything which has to be done after the event loop

Definition at line 115 of file FWLiteAnalyzerWrapper.h.

References fwlite::AnalyzerWrapper< T >::analyzer_.

Referenced by main().

115 { analyzer_->endJob(); }
boost::shared_ptr< T > analyzer_
derived class of type BasicAnalyzer

Member Data Documentation

template<class T >
boost::shared_ptr<T> fwlite::AnalyzerWrapper< T >::analyzer_
protected
template<class T >
fwlite::TFileService fwlite::AnalyzerWrapper< T >::fileService_
protected

TFileService for histogram management.

Definition at line 127 of file FWLiteAnalyzerWrapper.h.

Referenced by fwlite::AnalyzerWrapper< T >::AnalyzerWrapper().

template<class T >
fwlite::InputSource fwlite::AnalyzerWrapper< T >::inputHandler_
protected

helper class for input parameter handling

Definition at line 119 of file FWLiteAnalyzerWrapper.h.

Referenced by fwlite::AnalyzerWrapper< T >::analyze().

template<class T >
int fwlite::AnalyzerWrapper< T >::maxEvents_
protected

maximal number of events to be processed (-1 means to loop over all event)

Definition at line 123 of file FWLiteAnalyzerWrapper.h.

Referenced by fwlite::AnalyzerWrapper< T >::analyze().

template<class T >
fwlite::OutputFiles fwlite::AnalyzerWrapper< T >::outputHandler_
protected

helper class for output file handling

Definition at line 121 of file FWLiteAnalyzerWrapper.h.

template<class T >
unsigned int fwlite::AnalyzerWrapper< T >::reportAfter_
protected

number of events after which the progress will be reported (0 means no report)

Definition at line 125 of file FWLiteAnalyzerWrapper.h.

Referenced by fwlite::AnalyzerWrapper< T >::analyze().