rivet is hosted by Hepforge, IPPP Durham
Rivet 4.0.2
AnalysisHandler.hh
1// -*- C++ -*-
2#ifndef RIVET_RivetHandler_HH
3#define RIVET_RivetHandler_HH
4
5#include "Rivet/Config/RivetCommon.hh"
6#include "Rivet/Particle.hh"
7#include "Rivet/AnalysisLoader.hh"
8#include "Rivet/Tools/RivetYODA.hh"
9#include "Rivet/Tools/Utils.hh"
10#include "Rivet/ProjectionHandler.hh"
11#include "YODA/ReaderYODA.h"
12
13#include <fstream>
14#include <unordered_map>
15
16namespace Rivet {
17
18
19 // Forward declaration and smart pointer for Analysis
20 class Analysis;
21 using AnaHandle = std::shared_ptr<Analysis>;
22
23
30
31 using TypeHandlePtr = std::shared_ptr<TypeBaseHandle>;
32 using TypeRegister = std::unordered_map<string, TypeHandlePtr>;
33 using TypeRegisterItr = typename TypeRegister::const_iterator;
34
35 public:
36
37 using Annotations = std::map<std::string, std::string>;
38
40 AnalysisHandler([[deprecated]]const string& runname="");
41
44
47
50
51
54
56 string runName() const;
57
63 size_t numEvents() const {
64 const double N = _eventCounter.get()->persistent(defaultWeightIndex())->numEntries();
65 return size_t(N + 0.5 - (N<0)); // round to nearest integer
66 }
67
73 double effNumEvents() const {
74 if ((bool)_eventCounter) { return _eventCounter->effNumEntries(); }
75 return _eventCounter.get()->persistent(defaultWeightIndex())->effNumEntries();
76 }
77
82 double sumW() const {
83 if ((bool)_eventCounter) { return _eventCounter->sumW(); }
84 return _eventCounter.get()->persistent(defaultWeightIndex())->sumW();
85 }
87 double sumW2() const {
88 if ((bool)_eventCounter) { return _eventCounter->sumW2(); }
89 return _eventCounter.get()->persistent(defaultWeightIndex())->sumW2();
90 }
91
93
94
97
99 const vector<string>& weightNames() const { return _weightNames; }
100
102 size_t numWeights() const { return _weightNames.size(); }
103
105 bool haveNamedWeights() const;
106
108 void setWeightNames(const GenEvent& ge);
109
111 void setWeightNames(const vector<string>& weightNames);
112
114 size_t defaultWeightIndex() const { return _rivetDefaultWeightIdx; }
115
117 vector<double> weightSumWs() const;
118
120 void setWeightCap(const double maxWeight) { _weightCap = maxWeight; }
121
123 void setNominalWeightName(const std::string& name) { _nominalWeightName = name; }
124
126 void skipMultiWeights(bool skip=false) { _skipMultiWeights = skip; }
127
129 void matchWeightNames(const std::string& patterns) { _matchWeightNames = patterns; }
130
132 void unmatchWeightNames(const std::string& patterns) { _unmatchWeightNames = patterns; }
133
135 void setNLOSmearing(double frac) { _NLOSmearing = frac; }
136
138
139
142
144 Estimate0DPtr crossSection() const { return _xs; }
145
147 void setCrossSection(const vector<pair<double,double>>& xsecs, bool isUserSupplied = false);
148
150 void setCrossSection(const pair<double, double>& xsec, bool isUserSupplied=false);
151
153 void setCrossSection(double xsec, double xsecerr, bool isUserSupplied=false) {
154 setCrossSection({xsec, xsecerr}, isUserSupplied);
155 }
156
161
163 void notifyEndOfFile() { _isEndOfFile = true; }
164
166 double nominalCrossSection() const;
167
170
172
173
176
179
181 const ParticlePair& runBeams() const { return _beams; }
182
184 PdgIdPair runBeamIDs() const;
185
187 pair<double,double> runBeamEnergies() const;
188
190 double runSqrtS() const;
191
193 void setCheckBeams(bool check=true) { _checkBeams = check; }
194
196 // void setCheckConsistency(bool check=true) { _checkConsistency = check; }
197 // Check event consistency with the run, usually determined from the first event
198 // bool consistentWithRun(Event& event) {
199
201
202
205
206 // Get all the annotation names
207 std::vector<std::string> annotations() const {
208 return _beaminfo->annotations();
209 }
210
212 bool hasAnnotation(const std::string& name) const {
213 return _beaminfo->hasAnnotation(name);
214 }
215
217 const std::string& annotation(const std::string& name) const {
218 return _beaminfo->annotation(name);
219 }
220
222 const std::string& annotation(const std::string& name, const std::string& defaultreturn) const {
223 return _beaminfo->annotation(name, defaultreturn);
224 }
225
229 template <typename T>
230 const T annotation(const std::string& name) const {
231 return _beaminfo->annotation<T>(name);
232 }
233
237 template <typename T>
238 const T annotation(const std::string& name, T&& defaultreturn) const {
239 return _beaminfo->annotation<T>(name, std::forward<T>(defaultreturn));
240 }
241
245 template <typename T>
246 void setAnnotation(const std::string& name, T&& value) {
247 _beaminfo->annotation<T>(name, std::forward<T>(value));
248 }
249
250
252 void setAnnotations(const Annotations& anns) {
253 _beaminfo->setAnnotations(anns);
254 }
255
257 void rmAnnotation(const std::string& name) {
258 _beaminfo->rmAnnotation(name);
259 }
260
261
264 _beaminfo->clearAnnotations();
265 }
266
268
269
272
274 template<typename T>
276 const std::string name = T().type();
277 const TypeRegisterItr& res = _register.find(name);
278 if (res == _register.end()) {
279 _register[name] = make_shared<TypeHandle<T>>();
280 }
281 _reader.registerType<T>(); // also let YODA know
282 }
283
286 bool copyAO(YODA::AnalysisObjectPtr src, YODA::AnalysisObjectPtr dst, const double scale=1.0);
287
290 bool addAO(YODA::AnalysisObjectPtr src, YODA::AnalysisObjectPtr& dst, const double scale);
291
293
294
297
299 std::vector<std::string> analysisNames() const;
300
302 std::vector<std::string> stdAnalysisNames() const;
303
305 const std::map<std::string, AnaHandle>& analysesMap() const {
306 return _analyses;
307 }
308
310 std::vector<AnaHandle> analyses() const {
311 std::vector<AnaHandle> rtn;
312 rtn.reserve(_analyses.size());
313 for (const auto& apair : _analyses) rtn.push_back(apair.second);
314 return rtn;
315 }
316
318 AnaHandle analysis(const std::string& analysisname) {
319 if ( _analyses.find(analysisname) == _analyses.end() )
320 throw LookupError("No analysis named '" + analysisname + "' registered in AnalysisHandler");
321 try {
322 return _analyses[analysisname];
323 } catch (...) {
324 throw LookupError("No analysis named '" + analysisname + "' registered in AnalysisHandler");
325 }
326 }
327
330
336 AnalysisHandler& addAnalysis(const std::string& analysisname);
337
339 AnalysisHandler& addAnalysis(const std::string& analysisname, std::map<string, string> pars);
340
347 AnalysisHandler& addAnalyses(const std::vector<std::string>& analysisnames);
348
349
351 AnalysisHandler& removeAnalysis(const std::string& analysisname);
352
354 AnalysisHandler& removeAnalyses(const std::vector<std::string>& analysisnames);
355
357
358
361
363 void init(const GenEvent& event);
364
371 void analyze(GenEvent& event);
372
377 void analyze(GenEvent* event);
378
381 void finalize();
382
384
385
388
392
396 void readData(std::istream& istr, const string& fmt, bool preload = true);
397
399 void readData(const std::string& filename, bool preload = true);
400
404 vector<YODA::AnalysisObjectPtr> getYodaAOs(const bool includeraw=false, const bool mkinert=true) const;
405
407 vector<YODA::AnalysisObjectPtr> getRawAOs() const;
408
410 vector<std::string> getRawAOPaths() const;
411
414 const YODA::AnalysisObjectPtr getPreload(const string& path) const {
415 auto it = _preloads.find(path);
416 if ( it == _preloads.end() ) return nullptr;
417 return it->second;
418 }
419
423 void writeData(std::ostream& ostr, const string& fmt) const;
424
426 void writeData(const string& filename) const;
427
433 void setFinalizePeriod(const string& dumpfile, int period) {
434 _dumpPeriod = period;
435 _dumpFile = dumpfile;
436 }
439 setFinalizePeriod("DUMMY", -1);
440 }
441
443 void setBootstrapFilename(const string& filename) {
444 _bootstrapfilename = filename;
445 }
446
448 vector<pair<string,size_t>> fillLayout() const;
449
451 vector<bool> fillOutcomes() const;
452
454 vector<double> fillFractions() const;
455
470
471 void mergeYODAs(const vector<string>& aofiles,
472 const vector<string>& delopts=vector<string>(),
473 const vector<string>& addopts=vector<string>(),
474 const vector<string>& matches=vector<string>(),
475 const vector<string>& unmatches=vector<string>(),
476 const bool equiv=false, const bool reentrantOnly = true);
477
479 void merge(AnalysisHandler &other);
480
486 void loadAOs(const vector<string>& aoPaths, const vector<double>& aoData);
487
489
492
493 vector<double> serializeContent(bool fixed_length = false) {
494 if (!_initialised)
495 throw Error("AnalysisHandler has not been initialised!");
496
498
499 // Loop over raw AOs and work out the size of the content data
500 const vector<YODA::AnalysisObjectPtr> raos = getRawAOs();
501 size_t total = 0;
502 for (size_t i = 0; i < raos.size(); ++i) {
503 total += raos[i]->lengthContent(fixed_length)+1;
504 }
505 total += _beaminfo->numBins()+1;
506
507 // Loop over raw AOs and retrieve the content data
508 std::vector<double> data; // serialized data vector
509 data.reserve(total); // pre-allocate enough memory
510 // Add beam IDs
511 data.push_back(_beaminfo->numBins());
512 for (const string& beamID : _beaminfo->xEdges()) {
513 data.push_back(_beamInfoLabelToID(beamID));
514 }
515 // Add raw YODA AO content
516 for (size_t i = 0; i < raos.size(); ++i) {
517 vector<double> tmp = raos[i]->serializeContent(fixed_length);
518 data.push_back(tmp.size()); // length of the AO
519 data.insert(std::end(data),
520 std::make_move_iterator(std::begin(tmp)),
521 std::make_move_iterator(std::end(tmp)));
522 }
523 return data;
524 }
525
526 void deserializeContent(const vector<double>& data, size_t nprocs = 0) {
527 if (!_initialised)
528 throw Error("AnalysisHandler has not been initialised!");
529
531
532 // get Rivet AOs for access to raw AO pointers
533 vector<MultiplexAOPtr> raos = getRivetAOs();
534
535
536 // beam info first
537 size_t iAO = 0, iW = 0, nBeams = data[0], offset = 1;
538 if (nprocs) nBeams /= nprocs;
539 const auto itr = data.cbegin();
540 // set beam IDs
541 vector<int> edges{itr+offset, itr+offset+nBeams};
542 vector<string> labels; labels.reserve(edges.size());
543 size_t id = 0;
544 for (int edge : edges) {
545 if (nprocs >= 2) edge /= nprocs;
546 labels.push_back(_mkBeamInfoLabel(++id, edge));
547 }
548
549 _beaminfo = make_shared<YODA::BinnedEstimate<string>>(labels, "/TMP/_BEAMPZ");
550 offset += nBeams;
551 // set beam momenta
552 size_t beamLen = *(itr + offset); ++offset;
553 if (nprocs) beamLen /= nprocs;
554 std::vector<double> energies{itr+offset, itr+offset+beamLen};
555 if (nprocs >= 2) {
556 for (double& e : energies) { e /= nprocs; }
557 }
558 _beaminfo->deserializeContent(energies);
559 for (auto& b : _beaminfo->bins(true)) b.rmErrs();
560 offset += beamLen;
561
562 // then the multiweighted AOs
563 while (offset < data.size()) {
564 if (iW < numWeights()) raos[iAO].get()->setActiveWeightIdx(iW);
565 else {
566 raos[iAO].get()->unsetActiveWeight();
567 iW = 0; ++iAO; // move on to next AO
568 raos[iAO].get()->setActiveWeightIdx(iW);
569 }
570
571 // obtain content length and set content iterators
572 size_t aoLen = *(itr + offset); ++offset;
573 if (nprocs) aoLen /= nprocs;
574 auto first = itr + offset;
575 auto last = first + aoLen;
576 // load data into AO
577 raos[iAO].get()->activeAO()->deserializeContent(std::vector<double>{first, last});
578
579 ++iW; offset += aoLen; // increment offset
580 }
581 raos[iAO].get()->unsetActiveWeight();
582 // Reset cross-section bookkeeping
583 _ntrials = 0.0;
584 _fileCounter = CounterPtr(weightNames(), Counter("_FILECOUNT"));
585 _xserr = CounterPtr(weightNames(), Counter("XSECERR"));
586 if (nprocs >= 2) {
587 for (size_t iW = 0; iW < numWeights(); ++iW) {
588 *_fileCounter.get()->persistent(iW) = *_eventCounter.get()->persistent(iW);
589 _xs.get()->persistent(iW)->scale(1.0/nprocs);
590 }
591 }
592 }
593
595
596
599
602 enum class Stage { OTHER, INIT, FINALIZE };
603
605 Stage stage() const { return _stage; }
606
608
609 private:
610
613
615 Log& getLog() const;
616
618 vector<MultiplexAOPtr> getRivetAOs() const;
619
621 void stripOptions(YODA::AnalysisObjectPtr ao, const vector<string>& delopts) const;
622
624 void mergeAOS(map<string, YODA::AnalysisObjectPtr> &allaos,
625 const map<string, YODA::AnalysisObjectPtr> &newaos,
626 map<string, std::array<double,4>> &allxsecs,
627 const vector<string>& delopts=vector<string>(),
628 const vector<string>& optAnas=vector<string>(),
629 const vector<string>& optKeys=vector<string>(),
630 const vector<string>& optVals=vector<string>(),
631 const bool equiv=false,
632 const bool overwrite_xsec = false,
633 const double user_xsec = 1.0);
634
635
640 void loadAOs(const map<string, YODA::AnalysisObjectPtr>& allAOs,
641 const bool unscale = false, const bool reentrantOnly = true);
642
644 void _setRunBeamInfo(const ParticlePair& beams);
645
647 void _setRunBeamInfo(YODA::AnalysisObjectPtr ao);
648
650 string _mkBeamInfoLabel(size_t n, PdgId id) {
651 return "BEAM"+std::to_string(n)+"("+std::to_string(id)+")";
652 }
653
655 PdgId _beamInfoLabelToID(const string& label) {
656 size_t pos = label.find("(");
657 string beamID = label.substr(pos+1, label.size()-pos-2);
658 return std::stoi(beamID);
659 }
660
661
663
664
665 private:
666
668 Stage _stage = Stage::OTHER;
669
671 std::map<std::string, AnaHandle> _analyses;
672
676 map<string,YODA::AnalysisObjectPtr> _preloads;
677
679 vector<YODA::AnalysisObjectPtr> _finalizedAOs;
680
682 template<typename... Args>
683 void registerDefaultTypes();
684
686 TypeRegister _register;
687
689 YODA::Reader& _reader = YODA::ReaderYODA::create();
690
691
694
696 std::vector<std::string> _weightNames;
697 std::vector<std::valarray<double> > _subEventWeights;
698 //size_t _numWeightTypes; // always == WeightVector.size()
699
701 std::vector<size_t> _weightIndices;
702
704 std::string _runname;
705
707 CounterPtr _eventCounter;
708
710 Estimate0DPtr _xs;
711
713 CounterPtr _xserr;
714
716 YODA::BinnedEstimatePtr<string> _beaminfo;
717
719 double _ntrials;
720
722 CounterPtr _fileCounter;
723
725 bool _isEndOfFile;
726
728 std::pair<double,double> _userxs;
729
731 ParticlePair _beams;
732
734 bool _initialised;
735
737 bool _checkBeams;
738
740 bool _skipMultiWeights;
741
743 std::string _matchWeightNames;
744
746 std::string _unmatchWeightNames;
747
749 std::string _nominalWeightName;
750
752 double _weightCap;
753
757 double _NLOSmearing;
758
760 int _eventNumber;
761
763 size_t _defaultWeightIdx;
764
766 size_t _rivetDefaultWeightIdx;
767
769 int _customDefaultWeightIdx;
770
772 int _dumpPeriod;
773
775 string _dumpFile;
776
778 bool _dumping;
779
781 ofstream _fbootstrap;
782
784 std::string _bootstrapfilename;
785
787 ProjectionHandler _projHandler;
788
790
791 };
792
793
794}
795
796#endif
The key class for coordination of Analysis objects and the event loop.
Definition AnalysisHandler.hh:29
Estimate0DPtr crossSection() const
Get the cross-section known to the handler.
Definition AnalysisHandler.hh:144
const T annotation(const std::string &name, T &&defaultreturn) const
Get an annotation by name (copied to another type) with a default in case the annotation is not found...
Definition AnalysisHandler.hh:238
AnalysisHandler & addAnalysis(const std::string &analysisname, std::map< string, string > pars)
Add an analysis with a map of analysis options.
void setNLOSmearing(double frac)
Set the relative width of the NLO smearing window.
Definition AnalysisHandler.hh:135
void matchWeightNames(const std::string &patterns)
Specify weight-name patterns to accept.
Definition AnalysisHandler.hh:129
std::vector< std::string > stdAnalysisNames() const
Get a list of the official analysis names for this release.
vector< bool > fillOutcomes() const
Return a vector of the binary fill outcome (was/wasn't filled) at each fill position.
size_t defaultWeightIndex() const
Get the index of the nominal weight-stream.
Definition AnalysisHandler.hh:114
void mergeYODAs(const vector< string > &aofiles, const vector< string > &delopts=vector< string >(), const vector< string > &addopts=vector< string >(), const vector< string > &matches=vector< string >(), const vector< string > &unmatches=vector< string >(), const bool equiv=false, const bool reentrantOnly=true)
Merge the vector of YODA files, using the cross-section and weight information provided in each.
void setNominalWeightName(const std::string &name)
Set the name of the nominal weight stream.
Definition AnalysisHandler.hh:123
void writeData(const string &filename) const
Write all analyses' plots (via getData) to the named file.
AnalysisHandler & setRunBeams(const ParticlePair &beams)
Set the beam particles for this run.
void setCrossSection(double xsec, double xsecerr, bool isUserSupplied=false)
Set the cross-section for the process being generated (alternative signature)
Definition AnalysisHandler.hh:153
void init(const GenEvent &event)
Initialize a run, with the run beams taken from the example event.
AnalysisHandler & addAnalyses(const std::vector< std::string > &analysisnames)
Add analyses to the run list using their names.
AnalysisHandler & removeAnalyses(const std::vector< std::string > &analysisnames)
Remove analyses from the run list using their names.
size_t numWeights() const
Are any of the weights non-numeric?
Definition AnalysisHandler.hh:102
void setAnnotation(const std::string &name, T &&value)
Add or set an annotation by name (templated for remaining types)
Definition AnalysisHandler.hh:246
void analyze(GenEvent &event)
Analyze the given event by reference.
vector< YODA::AnalysisObjectPtr > getYodaAOs(const bool includeraw=false, const bool mkinert=true) const
vector< double > fillFractions() const
Return a vector of the fill fraction at each fill position.
void setCrossSection(const pair< double, double > &xsec, bool isUserSupplied=false)
Set all cross-sections for the process being generated, based on nominal weight.
string runName() const
Get the name of this run.
void registerType()
Register an AO type handle into type map and YODA reader.
Definition AnalysisHandler.hh:275
AnalysisHandler(const string &runname="")
Preferred constructor, with optional run name.
pair< double, double > runBeamEnergies() const
Get beam IDs for this run, usually determined from the first event.
const YODA::AnalysisObjectPtr getPreload(const string &path) const
Definition AnalysisHandler.hh:414
void analyze(GenEvent *event)
Analyze the given event by pointer.
const std::string & annotation(const std::string &name, const std::string &defaultreturn) const
Get an annotation by name (as a string) with a default in case the annotation is not found.
Definition AnalysisHandler.hh:222
~AnalysisHandler()
The destructor is not virtual, as this class should not be inherited from.
void merge(AnalysisHandler &other)
A method to merge another AnalysisHandler into the current one.
void readData(const std::string &filename, bool preload=true)
Read analysis plots into the histo collection (via addData) from the named file.
bool copyAO(YODA::AnalysisObjectPtr src, YODA::AnalysisObjectPtr dst, const double scale=1.0)
const vector< string > & weightNames() const
Names of event weight categories.
Definition AnalysisHandler.hh:99
void setFinalizePeriod(const string &dumpfile, int period)
Configure the AnalysisObject dump rate and destination.
Definition AnalysisHandler.hh:433
void setCrossSection(const vector< pair< double, double > > &xsecs, bool isUserSupplied=false)
Set all cross-sections for the process being generated specifically (preferred)
double nominalCrossSectionError() const
Get the nominal cross-section.
void readData(std::istream &istr, const string &fmt, bool preload=true)
Read analysis plots into the histo collection from the given stream.
void notifyEndOfFile()
Toggle to signal a change in HepMC input file.
Definition AnalysisHandler.hh:163
void clearAnnotations()
Delete an annotation by name.
Definition AnalysisHandler.hh:263
Stage stage() const
Return the current processing stage.
Definition AnalysisHandler.hh:605
const T annotation(const std::string &name) const
Get an annotation by name (copied to another type)
Definition AnalysisHandler.hh:230
double sumW2() const
Access to the sum of squared-weights.
Definition AnalysisHandler.hh:87
AnalysisHandler & addAnalysis(Analysis *analysis)
Add an analysis to the run list by object.
PdgIdPair runBeamIDs() const
Get beam IDs for this run, usually determined from the first event.
bool addAO(YODA::AnalysisObjectPtr src, YODA::AnalysisObjectPtr &dst, const double scale)
double runSqrtS() const
Get energy for this run, usually determined from the first event.
bool haveNamedWeights() const
Are any of the weights non-numeric?
void setCheckBeams(bool check=true)
Option to disable analysis-compatibility checks.
Definition AnalysisHandler.hh:193
void setWeightNames(const GenEvent &ge)
Set the weight names from a GenEvent.
size_t numEvents() const
Definition AnalysisHandler.hh:63
void loadAOs(const vector< string > &aoPaths, const vector< double > &aoData)
A method to prepare a re-entrant run for a given set of AO paths and serialized AO data.
void rmAnnotation(const std::string &name)
Delete an annotation by name.
Definition AnalysisHandler.hh:257
vector< double > weightSumWs() const
Access the array of sum of the event weights seen.
std::vector< AnaHandle > analyses() const
Get the collection of currently registered analyses.
Definition AnalysisHandler.hh:310
const std::string & annotation(const std::string &name) const
Get an annotation by name (as a string)
Definition AnalysisHandler.hh:217
void setWeightCap(const double maxWeight)
Set the weight cap.
Definition AnalysisHandler.hh:120
AnaHandle analysis(const std::string &analysisname)
Get a registered analysis by name.
Definition AnalysisHandler.hh:318
void writeData(std::ostream &ostr, const string &fmt) const
Write all analyses' plots (via getData) to the given stream.
const std::map< std::string, AnaHandle > & analysesMap() const
Get the collection of currently registered analyses.
Definition AnalysisHandler.hh:305
AnalysisHandler & addAnalysis(const std::string &analysisname)
Add an analysis to the run list using its name.
Stage
Definition AnalysisHandler.hh:602
AnalysisHandler & removeAnalysis(const std::string &analysisname)
Remove an analysis from the run list using its name.
vector< pair< string, size_t > > fillLayout() const
Return a vector of (AO path, AO numBins) pairs to decode the fills layout.
AnalysisHandler(const AnalysisHandler &)=delete
The copy constructor is deleted, so it can never be called.
void skipMultiWeights(bool skip=false)
Ignore all weight streams other than the nominal.
Definition AnalysisHandler.hh:126
const ParticlePair & runBeams() const
Get the beam particles for this run, usually determined from the first event.
Definition AnalysisHandler.hh:181
vector< std::string > getRawAOPaths() const
Get all raw YODA analysis object paths (across all weights)
double effNumEvents() const
Definition AnalysisHandler.hh:73
vector< YODA::AnalysisObjectPtr > getRawAOs() const
Get all raw YODA analysis objects (across all weights)
void unmatchWeightNames(const std::string &patterns)
Specify weight-name patterns to reject.
Definition AnalysisHandler.hh:132
void setWeightNames(const vector< string > &weightNames)
Set the weight names from a vector<string>
void setBootstrapFilename(const string &filename)
Set filename of the bootstrap file.
Definition AnalysisHandler.hh:443
double nominalCrossSection() const
Get the nominal cross-section.
bool hasAnnotation(const std::string &name) const
Check if an annotation is defined.
Definition AnalysisHandler.hh:212
void setNoFinalizePeriod()
Configure the AnalysisObject dump rate and destination.
Definition AnalysisHandler.hh:438
void setAnnotations(const Annotations &anns)
Set all annotations at once.
Definition AnalysisHandler.hh:252
double sumW() const
Access the sum of the event weights seen.
Definition AnalysisHandler.hh:82
AnalysisHandler & operator=(const AnalysisHandler &)=delete
The assignment operator is deleted, so it can never be called.
std::vector< std::string > analysisNames() const
Get a list of the currently registered analyses' names.
This is the base class of all analysis classes in Rivet.
Definition Analysis.hh:69
Logging system for controlled & formatted writing to stdout.
Definition Logging.hh:10
Definition RivetYODA.hh:1330
ParticlePair beams(const Event &e)
Get beam particles from an event.
Definition MC_CENT_PPB_Projections.hh:10
std::pair< Particle, Particle > ParticlePair
Typedef for a pair of Particle objects.
Definition Particle.hh:38
Generic runtime Rivet error.
Definition Exceptions.hh:12
Error relating to looking up analysis objects in the register.
Definition Exceptions.hh:67