1 #ifndef UtilAlgos_HistoAnalyzer_h 2 #define UtilAlgos_HistoAnalyzer_h 41 std::vector<ExpressionHisto<typename C::value_type>*>
vhistograms;
47 usingWeights_(par.exists(
"weights")),
52 std::vector<edm::ParameterSet>
histograms = 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();
57 for (; it !=
end; ++it) {
59 hist->initialize(
fs->tFileDirectory());
67 typename std::vector<ExpressionHisto<typename C::value_type>*>::iterator it = vhistograms.begin();
68 typename std::vector<ExpressionHisto<typename C::value_type>*>::iterator
end = vhistograms.end();
69 for (; it !=
end; ++it) {
78 iEvent.getByToken(srcToken_, coll);
82 iEvent.getByToken(weightsToken_, weightColl);
86 typename std::vector<ExpressionHisto<typename C::value_type>*>::iterator it = vhistograms.begin();
87 typename std::vector<ExpressionHisto<typename C::value_type>*>::iterator
end = vhistograms.end();
89 for (; it !=
end; ++it) {
91 for (
typename C::const_iterator elem = coll->begin(); elem != coll->end(); ++elem, ++
i) {
92 if (!(*it)->fill(*elem,
weight,
i)) {
static const std::string kSharedResource
edm::EDGetTokenT< C > srcToken_
label of the collection to be read in
std::vector< ExpressionHisto< typename C::value_type > * > vhistograms
vector of the histograms
Container::value_type value_type
def template(fileName, svg, replaceme="REPLACEME")
~HistoAnalyzer() override
destructor
edm::EDGetTokenT< double > weightsToken_
label of the weight collection (can be null for weights = 1)
void analyze(const edm::Event &, const edm::EventSetup &) override
process an event
HistoAnalyzer(const edm::ParameterSet &)
constructor from parameter set
bool usingWeights_
Do we weight events?