Rivet API documentation

Rivet 4.1.3
AnalysisHandler.hh
1// -*- C++ -*-
2#ifndef RIVET_RivetHandler_HH
3#define RIVET_RivetHandler_HH
4
5#include "Rivet/AnalysisLoader.hh"
6#include "Rivet/Particle.hh"
7#include "Rivet/ProjectionHandler.hh"
8#include "Rivet/Config/RivetCommon.hh"
9#include "Rivet/Tools/RivetYODA.hh"
10#include "Rivet/Tools/Utils.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
41
44
47
50
51
54
60 size_t numEvents() const {
61 const double N = _eventCounter.get()->persistent(defaultWeightIndex())->numEntries();
62 return size_t(N + 0.5 - (N < 0)); // round to nearest integer
63 }
64
70 double effNumEvents() const {
71 if ((bool)_eventCounter) {
72 return _eventCounter->effNumEntries();
73 }
74 return _eventCounter.get()->persistent(defaultWeightIndex())->effNumEntries();
75 }
76
81 double sumW() const {
82 if ((bool)_eventCounter) {
83 return _eventCounter->sumW();
84 }
85 return _eventCounter.get()->persistent(defaultWeightIndex())->sumW();
86 }
87
88 double sumW2() const {
89 if ((bool)_eventCounter) {
90 return _eventCounter->sumW2();
91 }
92 return _eventCounter.get()->persistent(defaultWeightIndex())->sumW2();
93 }
94
96
97
100
102 const vector<string>& weightNames() const {
103 return _weightNames;
104 }
105
107 size_t numWeights() const {
108 return _weightNames.size();
109 }
110
112 bool haveNamedWeights() const;
113
115 void setWeightNames(const GenEvent& ge);
116
118 void setWeightNames(const vector<string>& weightNames);
119
121 size_t defaultWeightIndex() const {
122 return _rivetDefaultWeightIdx;
123 }
124
126 vector<double> weightSumWs() const;
127
129 void setWeightCap(const double maxWeight) {
130 _weightCap = maxWeight;
131 }
132
134 void setNominalWeightName(const std::string& name) {
135 _nominalWeightName = name;
136 }
137
139 void skipMultiWeights(bool skip = false) {
140 _skipMultiWeights = skip;
141 }
142
144 void matchWeightNames(const std::string& patterns) {
145 _matchWeightNames = patterns;
146 }
147
149 void unmatchWeightNames(const std::string& patterns) {
150 _unmatchWeightNames = patterns;
151 }
152
154 void setNLOSmearing(double frac) {
155 _NLOSmearing = frac;
156 }
157
159
160
163
165 Estimate0DPtr crossSection() const {
166 return _xs;
167 }
168
170 void setCrossSection(const vector<pair<double, double>>& xsecs, bool isUserSupplied = false);
171
173 void setCrossSection(const pair<double, double>& xsec, bool isUserSupplied = false);
174
176 void setCrossSection(double xsec, double xsecerr, bool isUserSupplied = false) {
177 setCrossSection({xsec, xsecerr}, isUserSupplied);
178 }
179
184
187 _isEndOfFile = true;
188 }
189
191 double nominalCrossSection() const;
192
195
197
198
201
204
206 const ParticlePair& runBeams() const {
207 return _beams;
208 }
209
211 PdgIdPair runBeamIDs() const;
212
214 pair<double, double> runBeamEnergies() const;
215
217 double runSqrtS() const;
218
220 void setCheckBeams(bool check = true) {
221 _checkBeams = check;
222 }
223
225 // void setCheckConsistency(bool check=true) { _checkConsistency = check; }
226 // Check event consistency with the run, usually determined from the first event
227 // bool consistentWithRun(Event& event) {
228
230
231
234
235 // Get all the annotation names
236 std::vector<std::string> annotations() const {
237 return _beaminfo->annotations();
238 }
239
241 bool hasAnnotation(const std::string& name) const {
242 return _beaminfo->hasAnnotation(name);
243 }
244
246 const std::string& annotation(const std::string& name) const {
247 return _beaminfo->annotation(name);
248 }
249
251 const std::string& annotation(const std::string& name, const std::string& defaultreturn) const {
252 return _beaminfo->annotation(name, defaultreturn);
253 }
254
258 template <typename T>
259 const T annotation(const std::string& name) const {
260 return _beaminfo->annotation<T>(name);
261 }
262
266 template <typename T>
267 const T annotation(const std::string& name, T&& defaultreturn) const {
268 return _beaminfo->annotation<T>(name, std::forward<T>(defaultreturn));
269 }
270
274 template <typename T>
275 void setAnnotation(const std::string& name, T&& value) {
276 _beaminfo->setAnnotation<T>(name, std::forward<T>(value));
277 }
278
279
281 void setAnnotations(const Annotations& anns) {
282 _beaminfo->setAnnotations(anns);
283 }
284
286 void rmAnnotation(const std::string& name) {
287 _beaminfo->rmAnnotation(name);
288 }
289
290
293 _beaminfo->clearAnnotations();
294 }
295
297
298
301
303 template <typename T>
305 const std::string name = T().type();
306 const TypeRegisterItr& res = _register.find(name);
307 if (res == _register.end()) {
308 _register[name] = make_shared<TypeHandle<T>>();
309 }
310 _reader.registerType<T>(); // also let YODA know
311 }
312
315 bool copyAO(YODA::AnalysisObjectPtr src, YODA::AnalysisObjectPtr dst, const double scale = 1.0);
316
319 bool addAO(YODA::AnalysisObjectPtr src, YODA::AnalysisObjectPtr& dst, const double scale);
320
322
323
326
328 std::vector<std::string> analysisNames() const;
329
331 std::vector<std::string> stdAnalysisNames() const;
332
334 const std::map<std::string, AnaHandle>& analysesMap() const {
335 return _analyses;
336 }
337
339 std::vector<AnaHandle> analyses() const {
340 std::vector<AnaHandle> rtn;
341 rtn.reserve(_analyses.size());
342 for (const auto& apair : _analyses) rtn.push_back(apair.second);
343 return rtn;
344 }
345
347 AnaHandle analysis(const std::string& analysisname) {
348 if (_analyses.find(analysisname) == _analyses.end())
349 throw LookupError("No analysis named '" + analysisname + "' registered in AnalysisHandler");
350 try {
351 return _analyses[analysisname];
352 }
353 catch (...) {
354 throw LookupError("No analysis named '" + analysisname + "' registered in AnalysisHandler");
355 }
356 }
357
360
366 AnalysisHandler& addAnalysis(const std::string& analysisname);
367
371 AnalysisHandler& addAnalysis(const std::string& analysisname, std::map<string, string> pars);
372
379 AnalysisHandler& addAnalyses(const std::vector<std::string>& analysisnames);
380
381
383 AnalysisHandler& removeAnalysis(const std::string& analysisname);
384
386 AnalysisHandler& removeAnalyses(const std::vector<std::string>& analysisnames);
387
389
390
393
395 void init(const GenEvent& event);
396
403 void analyze(GenEvent& event);
404
409 void analyze(GenEvent* event);
410
413 void finalize();
414
416
417
420
424
428 void readData(std::istream& istr, const string& fmt, bool preload = true);
429
431 void readData(const std::string& filename, bool preload = true);
432
436 vector<YODA::AnalysisObjectPtr> getYodaAOs(const bool includeraw = false,
437 const bool mkinert = true) const;
438
440 vector<YODA::AnalysisObjectPtr> getRawAOs() const;
441
443 vector<std::string> getRawAOPaths() const;
444
447 const YODA::AnalysisObjectPtr getPreload(const string& path) const {
448 auto it = _preloads.find(path);
449 if (it == _preloads.end()) return nullptr;
450 return it->second;
451 }
452
456 void writeData(std::ostream& ostr, const string& fmt) const;
457
459 void writeData(const string& filename) const;
460
466 void setFinalizePeriod(const string& dumpfile, int period) {
467 _dumpPeriod = period;
468 _dumpFile = dumpfile;
469 }
470
472 setFinalizePeriod("DUMMY", -1);
473 }
474
476 void setBootstrapFilename(const string& filename) {
477 _bootstrapfilename = filename;
478 }
479
481 vector<pair<string, size_t>> fillLayout() const;
482
484 vector<bool> fillOutcomes() const;
485
487 vector<double> fillFractions() const;
488
503
504 void mergeYODAs(const vector<string>& aofiles,
505 const vector<string>& delopts = vector<string>(),
506 const vector<string>& addopts = vector<string>(),
507 const vector<string>& matches = vector<string>(),
508 const vector<string>& unmatches = vector<string>(),
509 const bool equiv = false,
510 const bool reentrantOnly = true,
511 const bool checkbeams = true);
512
514 void merge(AnalysisHandler& other);
515
521 void loadAOs(const vector<string>& aoPaths, const vector<double>& aoData);
522
524
527
528 vector<double> serializeContent(bool fixed_length = false) {
529 if (!_initialised) throw Error("AnalysisHandler has not been initialised!");
530
532
533 // Loop over raw AOs and work out the size of the content data
534 const vector<YODA::AnalysisObjectPtr> raos = getRawAOs();
535 size_t total = 0;
536 for (size_t i = 0; i < raos.size(); ++i) {
537 total += raos[i]->lengthContent(fixed_length) + 1;
538 }
539 total += _beaminfo->numBins() + 1;
540
541 // Loop over raw AOs and retrieve the content data
542 std::vector<double> data; // serialized data vector
543 data.reserve(total); // pre-allocate enough memory
544 // Add beam IDs
545 data.push_back(_beaminfo->numBins());
546 for (const string& beamID : _beaminfo->xEdges()) {
547 data.push_back(_beamInfoLabelToID(beamID));
548 }
549 // Add raw YODA AO content
550 for (size_t i = 0; i < raos.size(); ++i) {
551 vector<double> tmp = raos[i]->serializeContent(fixed_length);
552 data.push_back(tmp.size()); // length of the AO
553 data.insert(std::end(data), std::make_move_iterator(std::begin(tmp)),
554 std::make_move_iterator(std::end(tmp)));
555 }
556 return data;
557 }
558
559 void deserializeContent(const vector<double>& data, size_t nprocs = 0) {
560 if (!_initialised) throw Error("AnalysisHandler has not been initialised!");
561
563
564 // get Rivet AOs for access to raw AO pointers
565 vector<MultiplexAOPtr> raos = getRivetAOs();
566
567
568 // beam info first
569 size_t iAO = 0, iW = 0, nBeams = data[0], offset = 1;
570 if (nprocs) nBeams /= nprocs;
571 const auto itr = data.cbegin();
572 // set beam IDs
573 vector<int> edges{itr + offset, itr + offset + nBeams};
574 vector<string> labels;
575 labels.reserve(edges.size());
576 size_t id = 0;
577 for (int edge : edges) {
578 if (nprocs >= 2) edge /= nprocs;
579 labels.push_back(_mkBeamInfoLabel(++id, edge));
580 }
581
582 _beaminfo = make_shared<YODA::BinnedEstimate<string>>(labels, "/TMP/_BEAMPZ");
583 offset += nBeams;
584 // set beam momenta
585 size_t beamLen = *(itr + offset);
586 ++offset;
587 if (nprocs) beamLen /= nprocs;
588 std::vector<double> energies{itr + offset, itr + offset + beamLen};
589 if (nprocs >= 2) {
590 for (double& e : energies) {
591 e /= nprocs;
592 }
593 }
594 _beaminfo->deserializeContent(energies);
595 for (auto& b : _beaminfo->bins(true)) b.rmErrs();
596 offset += beamLen;
597
598 // then the multiweighted AOs
599 while (offset < data.size()) {
600 if (iW < numWeights())
601 raos[iAO].get()->setActiveWeightIdx(iW);
602 else {
603 raos[iAO].get()->unsetActiveWeight();
604 iW = 0;
605 ++iAO; // move on to next AO
606 raos[iAO].get()->setActiveWeightIdx(iW);
607 }
608
609 // obtain content length and set content iterators
610 size_t aoLen = *(itr + offset);
611 ++offset;
612 if (nprocs) aoLen /= nprocs;
613 auto first = itr + offset;
614 auto last = first + aoLen;
615 // load data into AO
616 raos[iAO].get()->activeAO()->deserializeContent(std::vector<double>{first, last});
617
618 ++iW;
619 offset += aoLen; // increment offset
620 }
621 raos[iAO].get()->unsetActiveWeight();
622 // Reset cross-section bookkeeping
623 _ntrials = 0.0;
624 _fileCounter = CounterPtr(weightNames(), Counter("_FILECOUNT"));
625 _xserr = CounterPtr(weightNames(), Counter("XSECERR"));
626 if (nprocs >= 2) {
627 for (size_t iW = 0; iW < numWeights(); ++iW) {
628 *_fileCounter.get()->persistent(iW) = *_eventCounter.get()->persistent(iW);
629 _xs.get()->persistent(iW)->scale(1.0 / nprocs);
630 }
631 }
632 }
633
635
636
639
642 enum class Stage { OTHER, INIT, FINALIZE };
643
645 Stage stage() const {
646 return _stage;
647 }
648
650
651 private:
652
655
657 Log& getLog() const;
658
660 vector<MultiplexAOPtr> getRivetAOs() const;
661
663 void stripOptions(YODA::AnalysisObjectPtr ao, const vector<string>& delopts) const;
664
666 void mergeAOS(map<string, YODA::AnalysisObjectPtr>& allaos,
667 const map<string, YODA::AnalysisObjectPtr>& newaos,
668 map<string, std::array<double, 4>>& allxsecs,
669 const vector<string>& delopts = vector<string>(),
670 const vector<string>& optAnas = vector<string>(),
671 const vector<string>& optKeys = vector<string>(),
672 const vector<string>& optVals = vector<string>(),
673 const bool equiv = false,
674 const bool overwrite_xsec = false,
675 const double user_xsec = 1.0);
676
677
682 void loadAOs(const map<string, YODA::AnalysisObjectPtr>& allAOs,
683 const bool unscale = false,
684 const bool reentrantOnly = true);
685
687 void _setRunBeamInfo(const ParticlePair& beams);
688
690 string _mkBeamInfoLabel(size_t n, PdgId id) {
691 return "BEAM" + std::to_string(n) + "(" + std::to_string(id) + ")";
692 }
693
695 PdgId _beamInfoLabelToID(const string& label) {
696 size_t pos = label.find("(");
697 string beamID = label.substr(pos + 1, label.size() - pos - 2);
698 return std::stoi(beamID);
699 }
700
701
703
704
705 private:
706
708 Stage _stage = Stage::OTHER;
709
711 std::map<std::string, AnaHandle> _analyses;
712
716 map<string, YODA::AnalysisObjectPtr> _preloads;
717
719 vector<YODA::AnalysisObjectPtr> _finalizedAOs;
720
722 template <typename... Args>
723 void registerDefaultTypes();
724
726 TypeRegister _register;
727
729 YODA::Reader& _reader = YODA::ReaderYODA::create();
730
731
734
736 std::vector<std::string> _weightNames;
737 std::vector<std::valarray<double>> _subEventWeights;
738 //size_t _numWeightTypes; // always == WeightVector.size()
739
741 std::vector<size_t> _weightIndices;
742
744 CounterPtr _eventCounter;
745
747 Estimate0DPtr _xs;
748
750 CounterPtr _xserr;
751
753 YODA::BinnedEstimatePtr<string> _beaminfo;
754
756 double _ntrials;
757
759 CounterPtr _fileCounter;
760
762 bool _isEndOfFile;
763
765 bool _subeventWarning;
766
768 std::pair<double, double> _userxs;
769
771 ParticlePair _beams;
772
774 bool _initialised;
775
777 bool _checkBeams{true};
778
782 bool _ignoreEventGroups{false};
783
785 bool _skipMultiWeights{false};
786
788 std::string _matchWeightNames;
789
791 std::string _unmatchWeightNames;
792
794 std::string _nominalWeightName;
795
797 double _weightCap;
798
802 double _NLOSmearing;
803
805 int _eventNumber;
806
808 size_t _defaultWeightIdx;
809
811 size_t _rivetDefaultWeightIdx;
812
814 int _customDefaultWeightIdx;
815
817 int _dumpPeriod;
818
820 string _dumpFile;
821
823 bool _dumping;
824
826 ofstream _fbootstrap;
827
829 std::string _bootstrapfilename;
830
832 ProjectionHandler _projHandler;
833
835 };
836
837
838}
839
840#endif
Estimate0DPtr crossSection() const
Get the cross-section known to the handler.
Definition AnalysisHandler.hh:165
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:267
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:154
void matchWeightNames(const std::string &patterns)
Specify weight-name patterns to accept.
Definition AnalysisHandler.hh:144
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:121
void setNominalWeightName(const std::string &name)
Set the name of the nominal weight stream.
Definition AnalysisHandler.hh:134
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:176
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:107
void setAnnotation(const std::string &name, T &&value)
Add or set an annotation by name (templated for remaining types).
Definition AnalysisHandler.hh:275
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.
void registerType()
Register an AO type handle into type map and YODA reader.
Definition AnalysisHandler.hh:304
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:447
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:251
~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:102
void setFinalizePeriod(const string &dumpfile, int period)
Configure the AnalysisObject dump rate and destination.
Definition AnalysisHandler.hh:466
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 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, const bool checkbeams=true)
Merge the vector of YODA files, using the cross-section and weight information provided in each.
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:186
void clearAnnotations()
Delete an annotation by name.
Definition AnalysisHandler.hh:292
Stage stage() const
Return the current processing stage.
Definition AnalysisHandler.hh:645
const T annotation(const std::string &name) const
Get an annotation by name (copied to another type).
Definition AnalysisHandler.hh:259
double sumW2() const
Access to the sum of squared-weights.
Definition AnalysisHandler.hh:88
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:220
void setWeightNames(const GenEvent &ge)
Set the weight names from a GenEvent.
size_t numEvents() const
Definition AnalysisHandler.hh:60
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:286
vector< double > weightSumWs() const
Access the array of sum of the event weights seen.
AnalysisHandler()
Preferred / default constructor.
std::vector< AnaHandle > analyses() const
Get the collection of currently registered analyses.
Definition AnalysisHandler.hh:339
const std::string & annotation(const std::string &name) const
Get an annotation by name (as a string).
Definition AnalysisHandler.hh:246
void setWeightCap(const double maxWeight)
Set the weight cap.
Definition AnalysisHandler.hh:129
AnaHandle analysis(const std::string &analysisname)
Get a registered analysis by name.
Definition AnalysisHandler.hh:347
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:334
AnalysisHandler & addAnalysis(const std::string &analysisname)
Add an analysis to the run list using its name.
Stage
Definition AnalysisHandler.hh:642
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:139
const ParticlePair & runBeams() const
Get the beam particles for this run, usually determined from the first event.
Definition AnalysisHandler.hh:206
vector< std::string > getRawAOPaths() const
Get all raw YODA analysis object paths (across all weights).
double effNumEvents() const
Definition AnalysisHandler.hh:70
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:149
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:476
double nominalCrossSection() const
Get the nominal cross-section.
bool hasAnnotation(const std::string &name) const
Check if an annotation is defined.
Definition AnalysisHandler.hh:241
void setNoFinalizePeriod()
Configure the AnalysisObject dump rate and destination.
Definition AnalysisHandler.hh:471
void setAnnotations(const Annotations &anns)
Set all annotations at once.
Definition AnalysisHandler.hh:281
double sumW() const
Access the sum of the event weights seen.
Definition AnalysisHandler.hh:81
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
STL class.
ParticlePair beams(const Event &e)
Get beam particles from an event.
Definition LHCbCommon.hh:9
std::pair< Particle, Particle > ParticlePair
Typedef for a pair of Particle objects.
Definition Particle.hh:43
Generic runtime Rivet error.
Definition Exceptions.hh:12
Error relating to looking up analysis objects in the register.
Definition Exceptions.hh:82