rivet is hosted by Hepforge, IPPP Durham
Rivet 4.1.0
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
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) { return _eventCounter->effNumEntries(); }
72 return _eventCounter.get()->persistent(defaultWeightIndex())->effNumEntries();
73 }
74
79 double sumW() const {
80 if ((bool)_eventCounter) { return _eventCounter->sumW(); }
81 return _eventCounter.get()->persistent(defaultWeightIndex())->sumW();
82 }
84 double sumW2() const {
85 if ((bool)_eventCounter) { return _eventCounter->sumW2(); }
86 return _eventCounter.get()->persistent(defaultWeightIndex())->sumW2();
87 }
88
90
91
94
96 const vector<string>& weightNames() const { return _weightNames; }
97
99 size_t numWeights() const { return _weightNames.size(); }
100
102 bool haveNamedWeights() const;
103
105 void setWeightNames(const GenEvent& ge);
106
108 void setWeightNames(const vector<string>& weightNames);
109
111 size_t defaultWeightIndex() const { return _rivetDefaultWeightIdx; }
112
114 vector<double> weightSumWs() const;
115
117 void setWeightCap(const double maxWeight) { _weightCap = maxWeight; }
118
120 void setNominalWeightName(const std::string& name) { _nominalWeightName = name; }
121
123 void skipMultiWeights(bool skip=false) { _skipMultiWeights = skip; }
124
126 void matchWeightNames(const std::string& patterns) { _matchWeightNames = patterns; }
127
129 void unmatchWeightNames(const std::string& patterns) { _unmatchWeightNames = patterns; }
130
132 void setNLOSmearing(double frac) { _NLOSmearing = frac; }
133
135
136
139
141 Estimate0DPtr crossSection() const { return _xs; }
142
144 void setCrossSection(const vector<pair<double,double>>& xsecs, bool isUserSupplied = false);
145
147 void setCrossSection(const pair<double, double>& xsec, bool isUserSupplied=false);
148
150 void setCrossSection(double xsec, double xsecerr, bool isUserSupplied=false) {
151 setCrossSection({xsec, xsecerr}, isUserSupplied);
152 }
153
158
160 void notifyEndOfFile() { _isEndOfFile = true; }
161
163 double nominalCrossSection() const;
164
167
169
170
173
176
178 const ParticlePair& runBeams() const { return _beams; }
179
181 PdgIdPair runBeamIDs() const;
182
184 pair<double,double> runBeamEnergies() const;
185
187 double runSqrtS() const;
188
190 void setCheckBeams(bool check=true) { _checkBeams = check; }
191
193 // void setCheckConsistency(bool check=true) { _checkConsistency = check; }
194 // Check event consistency with the run, usually determined from the first event
195 // bool consistentWithRun(Event& event) {
196
198
199
202
203 // Get all the annotation names
204 std::vector<std::string> annotations() const {
205 return _beaminfo->annotations();
206 }
207
209 bool hasAnnotation(const std::string& name) const {
210 return _beaminfo->hasAnnotation(name);
211 }
212
214 const std::string& annotation(const std::string& name) const {
215 return _beaminfo->annotation(name);
216 }
217
219 const std::string& annotation(const std::string& name, const std::string& defaultreturn) const {
220 return _beaminfo->annotation(name, defaultreturn);
221 }
222
226 template <typename T>
227 const T annotation(const std::string& name) const {
228 return _beaminfo->annotation<T>(name);
229 }
230
234 template <typename T>
235 const T annotation(const std::string& name, T&& defaultreturn) const {
236 return _beaminfo->annotation<T>(name, std::forward<T>(defaultreturn));
237 }
238
242 template <typename T>
243 void setAnnotation(const std::string& name, T&& value) {
244 _beaminfo->annotation<T>(name, std::forward<T>(value));
245 }
246
247
249 void setAnnotations(const Annotations& anns) {
250 _beaminfo->setAnnotations(anns);
251 }
252
254 void rmAnnotation(const std::string& name) {
255 _beaminfo->rmAnnotation(name);
256 }
257
258
261 _beaminfo->clearAnnotations();
262 }
263
265
266
269
271 template<typename T>
273 const std::string name = T().type();
274 const TypeRegisterItr& res = _register.find(name);
275 if (res == _register.end()) {
276 _register[name] = make_shared<TypeHandle<T>>();
277 }
278 _reader.registerType<T>(); // also let YODA know
279 }
280
283 bool copyAO(YODA::AnalysisObjectPtr src, YODA::AnalysisObjectPtr dst, const double scale=1.0);
284
287 bool addAO(YODA::AnalysisObjectPtr src, YODA::AnalysisObjectPtr& dst, const double scale);
288
290
291
294
296 std::vector<std::string> analysisNames() const;
297
299 std::vector<std::string> stdAnalysisNames() const;
300
302 const std::map<std::string, AnaHandle>& analysesMap() const {
303 return _analyses;
304 }
305
307 std::vector<AnaHandle> analyses() const {
308 std::vector<AnaHandle> rtn;
309 rtn.reserve(_analyses.size());
310 for (const auto& apair : _analyses) rtn.push_back(apair.second);
311 return rtn;
312 }
313
315 AnaHandle analysis(const std::string& analysisname) {
316 if ( _analyses.find(analysisname) == _analyses.end() )
317 throw LookupError("No analysis named '" + analysisname + "' registered in AnalysisHandler");
318 try {
319 return _analyses[analysisname];
320 } catch (...) {
321 throw LookupError("No analysis named '" + analysisname + "' registered in AnalysisHandler");
322 }
323 }
324
327
333 AnalysisHandler& addAnalysis(const std::string& analysisname);
334
336 AnalysisHandler& addAnalysis(const std::string& analysisname, std::map<string, string> pars);
337
344 AnalysisHandler& addAnalyses(const std::vector<std::string>& analysisnames);
345
346
348 AnalysisHandler& removeAnalysis(const std::string& analysisname);
349
351 AnalysisHandler& removeAnalyses(const std::vector<std::string>& analysisnames);
352
354
355
358
360 void init(const GenEvent& event);
361
368 void analyze(GenEvent& event);
369
374 void analyze(GenEvent* event);
375
378 void finalize();
379
381
382
385
389
393 void readData(std::istream& istr, const string& fmt, bool preload = true);
394
396 void readData(const std::string& filename, bool preload = true);
397
401 vector<YODA::AnalysisObjectPtr> getYodaAOs(const bool includeraw=false, const bool mkinert=true) const;
402
404 vector<YODA::AnalysisObjectPtr> getRawAOs() const;
405
407 vector<std::string> getRawAOPaths() const;
408
411 const YODA::AnalysisObjectPtr getPreload(const string& path) const {
412 auto it = _preloads.find(path);
413 if ( it == _preloads.end() ) return nullptr;
414 return it->second;
415 }
416
420 void writeData(std::ostream& ostr, const string& fmt) const;
421
423 void writeData(const string& filename) const;
424
430 void setFinalizePeriod(const string& dumpfile, int period) {
431 _dumpPeriod = period;
432 _dumpFile = dumpfile;
433 }
436 setFinalizePeriod("DUMMY", -1);
437 }
438
440 void setBootstrapFilename(const string& filename) {
441 _bootstrapfilename = filename;
442 }
443
445 vector<pair<string,size_t>> fillLayout() const;
446
448 vector<bool> fillOutcomes() const;
449
451 vector<double> fillFractions() const;
452
467
468 void mergeYODAs(const vector<string>& aofiles,
469 const vector<string>& delopts=vector<string>(),
470 const vector<string>& addopts=vector<string>(),
471 const vector<string>& matches=vector<string>(),
472 const vector<string>& unmatches=vector<string>(),
473 const bool equiv=false, const bool reentrantOnly = true);
474
476 void merge(AnalysisHandler &other);
477
483 void loadAOs(const vector<string>& aoPaths, const vector<double>& aoData);
484
486
489
490 vector<double> serializeContent(bool fixed_length = false) {
491 if (!_initialised)
492 throw Error("AnalysisHandler has not been initialised!");
493
495
496 // Loop over raw AOs and work out the size of the content data
497 const vector<YODA::AnalysisObjectPtr> raos = getRawAOs();
498 size_t total = 0;
499 for (size_t i = 0; i < raos.size(); ++i) {
500 total += raos[i]->lengthContent(fixed_length)+1;
501 }
502 total += _beaminfo->numBins()+1;
503
504 // Loop over raw AOs and retrieve the content data
505 std::vector<double> data; // serialized data vector
506 data.reserve(total); // pre-allocate enough memory
507 // Add beam IDs
508 data.push_back(_beaminfo->numBins());
509 for (const string& beamID : _beaminfo->xEdges()) {
510 data.push_back(_beamInfoLabelToID(beamID));
511 }
512 // Add raw YODA AO content
513 for (size_t i = 0; i < raos.size(); ++i) {
514 vector<double> tmp = raos[i]->serializeContent(fixed_length);
515 data.push_back(tmp.size()); // length of the AO
516 data.insert(std::end(data),
517 std::make_move_iterator(std::begin(tmp)),
518 std::make_move_iterator(std::end(tmp)));
519 }
520 return data;
521 }
522
523 void deserializeContent(const vector<double>& data, size_t nprocs = 0) {
524 if (!_initialised)
525 throw Error("AnalysisHandler has not been initialised!");
526
528
529 // get Rivet AOs for access to raw AO pointers
530 vector<MultiplexAOPtr> raos = getRivetAOs();
531
532
533 // beam info first
534 size_t iAO = 0, iW = 0, nBeams = data[0], offset = 1;
535 if (nprocs) nBeams /= nprocs;
536 const auto itr = data.cbegin();
537 // set beam IDs
538 vector<int> edges{itr+offset, itr+offset+nBeams};
539 vector<string> labels; labels.reserve(edges.size());
540 size_t id = 0;
541 for (int edge : edges) {
542 if (nprocs >= 2) edge /= nprocs;
543 labels.push_back(_mkBeamInfoLabel(++id, edge));
544 }
545
546 _beaminfo = make_shared<YODA::BinnedEstimate<string>>(labels, "/TMP/_BEAMPZ");
547 offset += nBeams;
548 // set beam momenta
549 size_t beamLen = *(itr + offset); ++offset;
550 if (nprocs) beamLen /= nprocs;
551 std::vector<double> energies{itr+offset, itr+offset+beamLen};
552 if (nprocs >= 2) {
553 for (double& e : energies) { e /= nprocs; }
554 }
555 _beaminfo->deserializeContent(energies);
556 for (auto& b : _beaminfo->bins(true)) b.rmErrs();
557 offset += beamLen;
558
559 // then the multiweighted AOs
560 while (offset < data.size()) {
561 if (iW < numWeights()) raos[iAO].get()->setActiveWeightIdx(iW);
562 else {
563 raos[iAO].get()->unsetActiveWeight();
564 iW = 0; ++iAO; // move on to next AO
565 raos[iAO].get()->setActiveWeightIdx(iW);
566 }
567
568 // obtain content length and set content iterators
569 size_t aoLen = *(itr + offset); ++offset;
570 if (nprocs) aoLen /= nprocs;
571 auto first = itr + offset;
572 auto last = first + aoLen;
573 // load data into AO
574 raos[iAO].get()->activeAO()->deserializeContent(std::vector<double>{first, last});
575
576 ++iW; offset += aoLen; // increment offset
577 }
578 raos[iAO].get()->unsetActiveWeight();
579 // Reset cross-section bookkeeping
580 _ntrials = 0.0;
581 _fileCounter = CounterPtr(weightNames(), Counter("_FILECOUNT"));
582 _xserr = CounterPtr(weightNames(), Counter("XSECERR"));
583 if (nprocs >= 2) {
584 for (size_t iW = 0; iW < numWeights(); ++iW) {
585 *_fileCounter.get()->persistent(iW) = *_eventCounter.get()->persistent(iW);
586 _xs.get()->persistent(iW)->scale(1.0/nprocs);
587 }
588 }
589 }
590
592
593
596
599 enum class Stage { OTHER, INIT, FINALIZE };
600
602 Stage stage() const { return _stage; }
603
605
606 private:
607
610
612 Log& getLog() const;
613
615 vector<MultiplexAOPtr> getRivetAOs() const;
616
618 void stripOptions(YODA::AnalysisObjectPtr ao, const vector<string>& delopts) const;
619
621 void mergeAOS(map<string, YODA::AnalysisObjectPtr> &allaos,
622 const map<string, YODA::AnalysisObjectPtr> &newaos,
623 map<string, std::array<double,4>> &allxsecs,
624 const vector<string>& delopts=vector<string>(),
625 const vector<string>& optAnas=vector<string>(),
626 const vector<string>& optKeys=vector<string>(),
627 const vector<string>& optVals=vector<string>(),
628 const bool equiv=false,
629 const bool overwrite_xsec = false,
630 const double user_xsec = 1.0);
631
632
637 void loadAOs(const map<string, YODA::AnalysisObjectPtr>& allAOs,
638 const bool unscale = false, const bool reentrantOnly = true);
639
641 void _setRunBeamInfo(const ParticlePair& beams);
642
644 void _setRunBeamInfo(YODA::AnalysisObjectPtr ao);
645
647 string _mkBeamInfoLabel(size_t n, PdgId id) {
648 return "BEAM"+std::to_string(n)+"("+std::to_string(id)+")";
649 }
650
652 PdgId _beamInfoLabelToID(const string& label) {
653 size_t pos = label.find("(");
654 string beamID = label.substr(pos+1, label.size()-pos-2);
655 return std::stoi(beamID);
656 }
657
658
660
661
662 private:
663
665 Stage _stage = Stage::OTHER;
666
668 std::map<std::string, AnaHandle> _analyses;
669
673 map<string,YODA::AnalysisObjectPtr> _preloads;
674
676 vector<YODA::AnalysisObjectPtr> _finalizedAOs;
677
679 template<typename... Args>
680 void registerDefaultTypes();
681
683 TypeRegister _register;
684
686 YODA::Reader& _reader = YODA::ReaderYODA::create();
687
688
691
693 std::vector<std::string> _weightNames;
694 std::vector<std::valarray<double> > _subEventWeights;
695 //size_t _numWeightTypes; // always == WeightVector.size()
696
698 std::vector<size_t> _weightIndices;
699
701 CounterPtr _eventCounter;
702
704 Estimate0DPtr _xs;
705
707 CounterPtr _xserr;
708
710 YODA::BinnedEstimatePtr<string> _beaminfo;
711
713 double _ntrials;
714
716 CounterPtr _fileCounter;
717
719 bool _isEndOfFile;
720
722 std::pair<double,double> _userxs;
723
725 ParticlePair _beams;
726
728 bool _initialised;
729
731 bool _checkBeams;
732
734 bool _skipMultiWeights;
735
737 std::string _matchWeightNames;
738
740 std::string _unmatchWeightNames;
741
743 std::string _nominalWeightName;
744
746 double _weightCap;
747
751 double _NLOSmearing;
752
754 int _eventNumber;
755
757 size_t _defaultWeightIdx;
758
760 size_t _rivetDefaultWeightIdx;
761
763 int _customDefaultWeightIdx;
764
766 int _dumpPeriod;
767
769 string _dumpFile;
770
772 bool _dumping;
773
775 ofstream _fbootstrap;
776
778 std::string _bootstrapfilename;
779
781 ProjectionHandler _projHandler;
782
784
785 };
786
787
788}
789
790#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:141
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:235
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:132
void matchWeightNames(const std::string &patterns)
Specify weight-name patterns to accept.
Definition AnalysisHandler.hh:126
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:111
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:120
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:150
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:99
void setAnnotation(const std::string &name, T &&value)
Add or set an annotation by name (templated for remaining types)
Definition AnalysisHandler.hh:243
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:272
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:411
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:219
~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:96
void setFinalizePeriod(const string &dumpfile, int period)
Configure the AnalysisObject dump rate and destination.
Definition AnalysisHandler.hh:430
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:160
void clearAnnotations()
Delete an annotation by name.
Definition AnalysisHandler.hh:260
Stage stage() const
Return the current processing stage.
Definition AnalysisHandler.hh:602
const T annotation(const std::string &name) const
Get an annotation by name (copied to another type)
Definition AnalysisHandler.hh:227
double sumW2() const
Access to the sum of squared-weights.
Definition AnalysisHandler.hh:84
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:190
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:254
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:307
const std::string & annotation(const std::string &name) const
Get an annotation by name (as a string)
Definition AnalysisHandler.hh:214
void setWeightCap(const double maxWeight)
Set the weight cap.
Definition AnalysisHandler.hh:117
AnaHandle analysis(const std::string &analysisname)
Get a registered analysis by name.
Definition AnalysisHandler.hh:315
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:302
AnalysisHandler & addAnalysis(const std::string &analysisname)
Add an analysis to the run list using its name.
Stage
Definition AnalysisHandler.hh:599
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:123
const ParticlePair & runBeams() const
Get the beam particles for this run, usually determined from the first event.
Definition AnalysisHandler.hh:178
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:129
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:440
double nominalCrossSection() const
Get the nominal cross-section.
bool hasAnnotation(const std::string &name) const
Check if an annotation is defined.
Definition AnalysisHandler.hh:209
void setNoFinalizePeriod()
Configure the AnalysisObject dump rate and destination.
Definition AnalysisHandler.hh:435
void setAnnotations(const Annotations &anns)
Set all annotations at once.
Definition AnalysisHandler.hh:249
double sumW() const
Access the sum of the event weights seen.
Definition AnalysisHandler.hh:79
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:70
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:73