1 #ifndef UtilAlgos_ObjectCounter_h
2 #define UtilAlgos_ObjectCounter_h
21 #include "FWCore/Framework/interface/TypeID.h"
46 srcToken_( consumes<
C>( edm::InputTag( 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 \"" << srcToken_ <<
"\" contains ("
62 << n <<
" +/- " <<
s <<
") "
63 <<
id.friendlyClassName() <<
" objects" << std::endl;
72 std::cerr <<
">>> product: " << srcToken_ <<
" not found" << std::endl;
ObjectCounter(const edm::ParameterSet &)
constructor from parameter set
bool getByToken(EDGetToken token, Handle< PROD > &result) const
unsigned long n_
partial statistics
bool verbose_
verbosity flag
edm::EDGetTokenT< C > srcToken_
label of source collection
virtual void analyze(const edm::Event &, const edm::EventSetup &) override
event processing
void endJob()
end-of-job processing
Container::value_type value_type
The Signals That Services Can Subscribe To This is based on ActivityRegistry h
Helper function to determine trigger accepts.