ATLAS Offline Software
Loading...
Searching...
No Matches
Rivet_i.h
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration
3*/
4
5#ifndef RIVET_I_H
6#define RIVET_I_H
7
11#include "GaudiKernel/ToolHandle.h"
13
14#include "Rivet/AnalysisHandler.hh"
15
16#include "AtlasHepMC/GenEvent.h"
17
18#include <vector>
19#include <string>
20#include <memory>
21
22class ISvcLocator;
24//class ITHistSvc;
25
26
31class Rivet_i : public AthAlgorithm {
32public:
33
35 Rivet_i(const std::string &name, ISvcLocator *pSvcLocator);
36
41 virtual StatusCode initialize ATLAS_NOT_THREAD_SAFE () override;
42
44 virtual StatusCode execute(const EventContext& ctx) override;
45
48 virtual StatusCode finalize() override;
49
50
51private:
52
53 // Check and potentially modify events for correct units, beam particles, ...
54 std::unique_ptr<HepMC::GenEvent> checkEvent(const HepMC::GenEvent& event, const EventContext& ctx);
55
56 // Utility method to convert units of the event
57 void MeV2GeV(HepMC::GenEvent& event);
58
60 //ServiceHandle<ITHistSvc> m_histSvc;
61
63 std::string m_stream;
64
66 std::string m_file;
67
68 //specify a pre-existing yoda file to initialize from
69 std::string m_preload;
70
74 std::string m_anapath;
75
81
86
89
91 ToolHandle<IxAODtoHepMCTool> m_xAODtoHepMCTool{this, "HepMCTool", "xAODtoHepMCTool"};
92
99
101 std::string m_runname;
102
104 std::string m_genEventKey;
105
107 Rivet::AnalysisHandler* m_analysisHandler;
108
110 std::vector<std::string> m_analysisNames;
111
114
117
119 bool m_init;
120
123
125 std::string m_matchWeights;
126
128 std::string m_unmatchWeights;
129
132
135
137 , "EventInfo"
138 , "EventInfo"
139 , "ReadHandleKey for xAOD::EventInfo" };
140};
141
142#endif
Define macros for attributes used to control the static checker.
AthAlgorithm(const std::string &name, ISvcLocator *pSvcLocator)
Constructor.
bool m_skipweights
Skip variation weights and only run nominal.
Definition Rivet_i.h:122
double m_weightcap
Weight cap to set allowed maximum for weights.
Definition Rivet_i.h:134
std::vector< std::string > m_analysisNames
A list of names of the analyses to run (set from the job properties).
Definition Rivet_i.h:110
bool m_ignorebeams
Whether to avoid the beam consistency checks.
Definition Rivet_i.h:80
double m_crossSection
The cross section for this run of events, set from the job properties.
Definition Rivet_i.h:113
bool m_patchBeams
Flag to insert beam protons when they are unavailable in the event.
Definition Rivet_i.h:88
virtual StatusCode finalize() override
Finalise each analysis and commit the plots to the YODA tree and the THistSvc ROOT tree.
Definition Rivet_i.cxx:209
virtual StatusCode execute(const EventContext &ctx) override
Run the Rivet analyses on one event, which is retrieved from StoreGate.
Definition Rivet_i.cxx:141
std::string m_anapath
The analysis plugin search path.
Definition Rivet_i.h:74
bool m_init
Flag to determine whether Rivet init has already happened (in execute()).
Definition Rivet_i.h:119
ToolHandle< IxAODtoHepMCTool > m_xAODtoHepMCTool
A tool to convert xAOD::Truth to HepMC::GenEvent.
Definition Rivet_i.h:91
std::string m_file
The base file name to write results to.
Definition Rivet_i.h:66
std::string m_unmatchWeights
String of weight names (or regex) to veto multiweights.
Definition Rivet_i.h:128
std::string m_matchWeights
String of weight names (or regex) to select multiweights.
Definition Rivet_i.h:125
SG::ReadHandleKey< xAOD::EventInfo > m_evtInfoKey
Definition Rivet_i.h:136
double m_crossSection_uncert
The uncertainity of the cross section for this run of events, set from the job properties.
Definition Rivet_i.h:116
bool m_needsConversion
Do we need to convert xAOD::Truth back to HepMC::GenEvemt?
Definition Rivet_i.h:85
Rivet::AnalysisHandler * m_analysisHandler
A Rivet analysis handler.
Definition Rivet_i.h:107
bool m_doRootHistos
Will we convert Rivet's internal histo format into a ROOT histo for streaming with THistSvc?
Definition Rivet_i.h:98
std::string m_stream
A pointer to the THistSvc.
Definition Rivet_i.h:63
std::string m_preload
Definition Rivet_i.h:69
Rivet_i(const std::string &name, ISvcLocator *pSvcLocator)
Standard algorithm constructor.
Definition Rivet_i.cxx:35
std::unique_ptr< HepMC::GenEvent > checkEvent(const HepMC::GenEvent &event, const EventContext &ctx)
Definition Rivet_i.cxx:261
std::string m_genEventKey
The GenEvent StoreGate key (default "GEN_EVENT").
Definition Rivet_i.h:104
std::string m_nominalWeightName
String to specify non-standard nominal weight.
Definition Rivet_i.h:131
void MeV2GeV(HepMC::GenEvent &event)
Definition Rivet_i.cxx:344
virtual StatusCode initialize ATLAS_NOT_THREAD_SAFE() override
Initialise the Rivet interface and Athena services.
std::string m_runname
The name of the run (prepended to plot paths).
Definition Rivet_i.h:101
Property holding a SG store/key/clid from which a ReadHandle is made.
HepMC3::GenEvent GenEvent
Definition GenEvent.h:39
void initialize()