1 #ifndef GeneratorInterface_RivetInterface_RivetAnalyzer
2 #define GeneratorInterface_RivetInterface_RivetAnalyzer
6 #include "Rivet/RivetAIDA.fhh"
7 #include "Rivet/AnalysisHandler.hh"
14 #include "Rivet/RivetAIDA.hh"
15 #include "LWH/AIHistogramFactory.h"
16 #include "LWH/VariAxis.h"
48 template<
class AIDATYPE,
class ROOTTYPE> ROOTTYPE*
prebook(
const AIDATYPE*,
const std::string&);
49 template<
class AIDATYPE,
class ROOTTYPE> ROOTTYPE*
aida2root(
const AIDATYPE*,
const std::string&);
62 std::vector<MonitorElement *>
_mes;
65 template<
class AIDATYPE,
class ROOTTYPE>
69 if (aidah->axis().isFixedBinning() ) {
70 int nbins = aidah->axis().bins();
71 h =
new ROOTTYPE(name.c_str(), name.c_str(),
nbins, aidah->axis().lowerEdge(), aidah->axis().upperEdge());
73 int nbins = aidah->axis().bins();
75 const LWH::VariAxis* vax =
dynamic_cast<const LWH::VariAxis*
>(&aidah->axis());
77 throw cms::Exception(
"RivetAnalyzer") <<
"Cannot dynamix cast an AIDA axis to VariAxis ";
79 double*
bins =
new double[nbins+1];
81 bins[
i] = vax->binEdges(
i).first;
83 bins[
nbins] = vax->binEdges(nbins-1).second;
84 h =
new ROOTTYPE(name.c_str(), name.c_str(),
nbins,
bins);
112 TH1F*
h = prebook<AIDA::IHistogram1D, TH1F>(aidah,
name);
113 for (
int i = 0;
i < aidah->axis().bins(); ++
i){
114 h->SetBinContent(
i+1, aidah->binHeight(
i));
115 h->SetBinError(
i+1, aidah->binError(
i));
122 TProfile*
h = prebook<AIDA::IProfile1D, TProfile>(aidah,
name);
123 for (
int i = 0;
i < aidah->axis().bins(); ++
i){
124 h->SetBinContent(
i+1, aidah->binMean(
i));
125 h->SetBinError(
i+1, aidah->binRms(
i));
virtual void beginRun(const edm::Run &, const edm::EventSetup &)
virtual void endRun(const edm::Run &, const edm::EventSetup &)
virtual void analyze(const edm::Event &, const edm::EventSetup &)
ROOTTYPE * prebook(const AIDATYPE *, const std::string &)
edm::InputTag _hepmcCollection
ROOTTYPE * aida2root(const AIDATYPE *, const std::string &)
Rivet::AnalysisHandler _analysisHandler
RivetAnalyzer(const edm::ParameterSet &)
The Signals That Services Can Subscribe To This is based on ActivityRegistry h
Helper function to determine trigger accepts.
void normalizeTree(AIDA::ITree &tree)
edm::InputTag _genEventInfoCollection
std::vector< MonitorElement * > _mes