1 #ifndef UtilAlgos_ObjectCounter_h
2 #define UtilAlgos_ObjectCounter_h
21 #include "FWCore/Framework/interface/TypeID.h"
46 src_( par.
template getParameter<std::string>(
"src" ) ),
47 verbose_( par.
template getUntrackedParameter<bool>(
"verbose",
true ) ),
48 n_( 0 ), nSum_( 0 ), n2Sum_( 0 ) {
53 double n = 0, n2 = 0,
s;
55 n = double( nSum_ ) / n_;
56 n2 = double ( n2Sum_ ) / n_;
58 s =
sqrt( n2 - n * n );
61 std::cout <<
">>> collection \"" << src_ <<
"\" contains ("
62 << n <<
" +/- " <<
s <<
") "
63 <<
id.friendlyClassName() <<
" objects" << std::endl;
72 std::cerr <<
">>> product: " << src_ <<
" not found" << std::endl;
ObjectCounter(const edm::ParameterSet &)
constructor from parameter set
unsigned long n_
partial statistics
bool verbose_
verbosity flag
virtual void analyze(const edm::Event &, const edm::EventSetup &)
event processing
void endJob()
end-of-job processing
Container::value_type value_type
bool getByLabel(InputTag const &tag, Handle< PROD > &result) const
The Signals That Services Can Subscribe To This is based on ActivityRegistry h
Helper function to determine trigger accepts.
std::string src_
label of source collection