2 #ifndef RIVET_RivetHandler_HH
3 #define RIVET_RivetHandler_HH
5 #include "Rivet/Rivet.hh"
6 #include "Rivet/RivetBoost.hh"
7 #include "Rivet/Tools/Logging.fhh"
8 #include "Rivet/AnalysisHandler.fhh"
9 #include "Rivet/Analysis.fhh"
10 #include "Rivet/Event.fhh"
11 #include "Rivet/AnalysisLoader.hh"
20 bool operator()(
const AnaHandle& a,
const AnaHandle& b) {
21 return a.get() < b.get();
65 void _setupFactories(
const string& basefilename,
HistoFormat storetype);
69 void _setupFactories();
73 void _normalizeTree(AIDA::ITree&
tree);
121 MSG_DEBUG(
"Setting run beams = " << beams <<
" @ " <<
sqrtS()/GeV <<
" GeV");
134 double sqrtS()
const;
149 const std::set<AnaHandle, AnaHandleLess>&
analyses()
const {
188 void init(
const GenEvent& event);
193 void analyze(
const GenEvent& event);
221 void writeData(
const std::string& filename);
244 set<AnaHandle, AnaHandleLess> _analyses;
251 std::string _runname;
257 double _sumOfWeights;
279 shared_ptr<AIDA::IAnalysisFactory> _theAnalysisFactory;
282 AIDA::ITreeFactory* _theTreeFactory;
285 AIDA::ITree* _theTree;
288 AIDA::IHistogramFactory* _theHistogramFactory;
291 AIDA::IDataPointSetFactory* _theDataPointSetFactory;
AnalysisHandler & addAnalyses(const std::vector< std::string > &analysisnames)
Definition: AnalysisHandler.cc:328
Definition: MC_JetAnalysis.hh:9
HistoFormat
Enumeration of available histogram output formats.
Definition: HistoFormat.hh:11
double crossSection() const
Get the cross-section known to the handler.
Definition: AnalysisHandler.hh:110
double sqrtS() const
Get energy for this run, usually determined from the first event.
Definition: AnalysisHandler.cc:402
bool needCrossSection() const
Is cross-section information required by at least one child analysis?
Definition: AnalysisHandler.cc:366
const std::set< AnaHandle, AnaHandleLess > & analyses() const
Get the collection of currently registered analyses.
Definition: AnalysisHandler.hh:149
AIDA::IDataPointSetFactory & datapointsetFactory()
Definition: AnalysisHandler.cc:361
AIDA::ITree & tree()
Definition: AnalysisHandler.cc:351
const ParticlePair & beams() const
Get beam IDs for this run, usually determined from the first event.
Definition: AnalysisHandler.hh:126
void analyze(const GenEvent &event)
Definition: AnalysisHandler.cc:106
void setSumOfWeights(const double &sum)
Definition: AnalysisHandler.cc:314
Definition: AnalysisHandler.hh:19
AnalysisHandler(const string &runname="")
Preferred constructor, with optional run name.
Definition: AnalysisHandler.cc:17
bool hasCrossSection() const
Whether the handler knows about a cross-section.
Definition: AnalysisHandler.cc:385
AnalysisHandler & setCrossSection(double xs)
Set the cross-section for the process being generated.
Definition: AnalysisHandler.cc:376
void finalize()
Definition: AnalysisHandler.cc:150
~AnalysisHandler()
Destructor The destructor is not virtual, as this class should not be inherited from.
Definition: AnalysisHandler.cc:40
string runName() const
Get the name of this run.
Definition: AnalysisHandler.cc:309
This is the base class of all analysis classes in Rivet.
Definition: Analysis.hh:51
AnalysisHandler & removeAnalyses(const std::vector< std::string > &analysisnames)
Remove analyses from the run list using their names.
Definition: AnalysisHandler.cc:337
void writeData(const std::string &filename)
Definition: AnalysisHandler.cc:252
std::vector< std::string > analysisNames() const
Get a list of the currently registered analyses' names.
Definition: AnalysisHandler.cc:319
void init()
Definition: AnalysisHandler.hh:184
double sumOfWeights() const
Definition: AnalysisHandler.cc:311
Definition: AnalysisHandler.hh:29
size_t numEvents() const
Definition: AnalysisHandler.cc:310
AnalysisHandler & addAnalysis(const std::string &analysisname)
Definition: AnalysisHandler.cc:182
AnalysisHandler & removeAnalysis(const std::string &analysisname)
Remove an analysis from the run list using its name.
Definition: AnalysisHandler.cc:204
AIDA::IHistogramFactory & histogramFactory()
Definition: AnalysisHandler.cc:356
shared_ptr< Analysis > AnaHandle
Typedef for Analysis (smart) pointer.
Definition: AnalysisHandler.hh:16
void setIgnoreBeams(bool ignore=true)
Setter for _ignoreBeams.
Definition: AnalysisHandler.cc:406
void commitData()
Definition: AnalysisHandler.cc:247
AIDA::IAnalysisFactory & analysisFactory()
Definition: AnalysisHandler.cc:346
PdgIdPair beamIds() const
Get beam IDs for this run, usually determined from the first event.
Definition: AnalysisHandler.cc:397
AnalysisHandler & setRunBeams(const ParticlePair &beams)
Set beams for this run.
Definition: AnalysisHandler.hh:119