1 #ifndef UtilAlgos_HistoAnalyzer_h
2 #define UtilAlgos_HistoAnalyzer_h
41 std::vector<ExpressionHisto<typename C::value_type>* >
vhistograms;
47 usingWeights_(par.exists(
"weights")),
48 weightsToken_(mayConsume<double>(par.
template getUntrackedParameter<edm::
InputTag>(
"weights", edm::
InputTag(
"fake"))))
52 par.template getParameter<std::vector<edm::ParameterSet> >(
"histograms");
53 std::vector<edm::ParameterSet>::const_iterator it = histograms.begin();
54 std::vector<edm::ParameterSet>::const_iterator
end = histograms.end();
70 typename std::vector<ExpressionHisto<typename C::value_type>* >::iterator it = vhistograms.begin();
71 typename std::vector<ExpressionHisto<typename C::value_type>* >::iterator
end = vhistograms.end();
86 iEvent.
getByToken( weightsToken_, weightColl );
90 typename std::vector<ExpressionHisto<typename C::value_type>* >::iterator it = vhistograms.begin();
91 typename std::vector<ExpressionHisto<typename C::value_type>* >::iterator
end = vhistograms.end();
95 for(
typename C::const_iterator
elem=coll->begin();
elem!=coll->end(); ++
elem, ++
i ) {
96 if (!(*it)->fill( *
elem, weight, i )) {
edm::EDGetTokenT< C > srcToken_
label of the collection to be read in
bool getByToken(EDGetToken token, Handle< PROD > &result) const
std::vector< ExpressionHisto< typename C::value_type > * > vhistograms
vector of the histograms
TFileDirectory & tFileDirectory()
Container::value_type value_type
~HistoAnalyzer()
destructor
edm::EDGetTokenT< double > weightsToken_
label of the weight collection (can be null for weights = 1)
virtual void analyze(const edm::Event &, const edm::EventSetup &) override
process an event
void initialize(TFileDirectory &fs)
HistoAnalyzer(const edm::ParameterSet &)
constructor from parameter set
bool usingWeights_
Do we weight events?