#include <ObjectCounter.h>
Public Member Functions | |
void | endJob () |
end-of-job processing | |
ObjectCounter (const edm::ParameterSet &) | |
constructor from parameter set | |
Private Member Functions | |
virtual void | analyze (const edm::Event &, const edm::EventSetup &) |
event processing | |
Private Attributes | |
unsigned long | n2Sum_ |
unsigned long | n_ |
partial statistics | |
unsigned long | nSum_ |
std::string | src_ |
label of source collection | |
bool | verbose_ |
verbosity flag |
Counts the number of objects in a collection and prints a summary report at the end of a job.
Template parameters:
Definition at line 26 of file ObjectCounter.h.
ObjectCounter< C >::ObjectCounter | ( | const edm::ParameterSet & | par | ) | [explicit] |
void ObjectCounter< C >::analyze | ( | const edm::Event & | evt, |
const edm::EventSetup & | |||
) | [private, virtual] |
event processing
Implements edm::EDAnalyzer.
Definition at line 68 of file ObjectCounter.h.
References benchmark_cfg::cerr, edm::Event::getByLabel(), h, edm::HandleBase::isValid(), and n.
void ObjectCounter< C >::endJob | ( | void | ) | [virtual] |
end-of-job processing
Reimplemented from edm::EDAnalyzer.
Definition at line 52 of file ObjectCounter.h.
References gather_cfg::cout, n, asciidump::s, and mathSSE::sqrt().
{ double n = 0, n2 = 0, s; if ( n_!= 0 ) { n = double( nSum_ ) / n_; n2 = double ( n2Sum_ ) / n_; } s = sqrt( n2 - n * n ); if ( verbose_ ) { edm::TypeID id( typeid( typename C::value_type ) ); std::cout << ">>> collection \"" << src_ << "\" contains (" << n << " +/- " << s << ") " << id.friendlyClassName() << " objects" << std::endl; } }
unsigned long ObjectCounter< C >::n2Sum_ [private] |
Definition at line 41 of file ObjectCounter.h.
unsigned long ObjectCounter< C >::n_ [private] |
partial statistics
Definition at line 41 of file ObjectCounter.h.
unsigned long ObjectCounter< C >::nSum_ [private] |
Definition at line 41 of file ObjectCounter.h.
std::string ObjectCounter< C >::src_ [private] |
label of source collection
Definition at line 37 of file ObjectCounter.h.
bool ObjectCounter< C >::verbose_ [private] |
verbosity flag
Definition at line 39 of file ObjectCounter.h.