ATLAS Offline Software
Loading...
Searching...
No Matches
Rivet_i Class Reference

Interface to the Rivet analysis package. More...

#include <Rivet_i.h>

Inheritance diagram for Rivet_i:
Collaboration diagram for Rivet_i:

Public Member Functions

 Rivet_i (const std::string &name, ISvcLocator *pSvcLocator)
 Standard algorithm constructor.
virtual StatusCode initialize ATLAS_NOT_THREAD_SAFE () override
 Initialise the Rivet interface and Athena services.
virtual StatusCode execute (const EventContext &ctx) override
 Run the Rivet analyses on one event, which is retrieved from StoreGate.
virtual StatusCode finalize () override
 Finalise each analysis and commit the plots to the YODA tree and the THistSvc ROOT tree.
virtual StatusCode sysInitialize () override
 Override sysInitialize.
virtual bool isClonable () const override
 Specify if the algorithm is clonable.
virtual StatusCode sysExecute (const EventContext &ctx) override
 Execute an algorithm.
virtual const DataObjIDColl & extraOutputDeps () const override
 Return the list of extra output dependencies.
virtual bool filterPassed (const EventContext &ctx) const
 Get filter decision:
virtual void setFilterPassed (bool state, const EventContext &ctx) const
 Set filter decision:
ServiceHandle< StoreGateSvc > & evtStore ()
 The standard StoreGateSvc (event store) Returns (kind of) a pointer to the StoreGateSvc.
const ServiceHandle< StoreGateSvc > & detStore () const
 The standard StoreGateSvc/DetectorStore Returns (kind of) a pointer to the StoreGateSvc.
virtual StatusCode sysStart () override
 Handle START transition.
virtual std::vector< Gaudi::DataHandle * > inputHandles () const override
 Return this algorithm's input handles.
virtual std::vector< Gaudi::DataHandle * > outputHandles () const override
 Return this algorithm's output handles.
Gaudi::Details::PropertyBase & declareProperty (Gaudi::Property< T, V, H > &t)
void updateVHKA (Gaudi::Details::PropertyBase &)
MsgStream & msg () const
bool msgLvl (const MSG::Level lvl) const

Protected Member Functions

virtual bool isReEntrant () const override final
 Legacy algorithms are not thread-safe.
void renounceArray (SG::VarHandleKeyArray &handlesArray)
 remove all handles from I/O resolution
std::enable_if_t< std::is_void_v< std::result_of_t< decltype(&T::renounce)(T)> > &&!std::is_base_of_v< SG::VarHandleKeyArray, T > &&std::is_base_of_v< Gaudi::DataHandle, T >, void > renounce (T &h)
void extraDeps_update_handler (Gaudi::Details::PropertyBase &ExtraDeps)
 Add StoreName to extra input/output deps as needed.

Private Types

typedef ServiceHandle< StoreGateSvcStoreGateSvc_t

Private Member Functions

std::unique_ptr< HepMC::GenEventcheckEvent (const HepMC::GenEvent &event, const EventContext &ctx)
void MeV2GeV (HepMC::GenEvent &event)
Gaudi::Details::PropertyBase & declareGaudiProperty (Gaudi::Property< T, V, H > &hndl, const SG::VarHandleKeyType &)
 specialization for handling Gaudi::Property<SG::VarHandleKey>

Private Attributes

std::string m_stream
 A pointer to the THistSvc.
std::string m_file
 The base file name to write results to.
std::string m_preload
std::string m_anapath
 The analysis plugin search path.
bool m_ignorebeams
 Whether to avoid the beam consistency checks.
bool m_needsConversion
 Do we need to convert xAOD::Truth back to HepMC::GenEvemt?
bool m_patchBeams
 Flag to insert beam protons when they are unavailable in the event.
ToolHandle< IxAODtoHepMCToolm_xAODtoHepMCTool {this, "HepMCTool", "xAODtoHepMCTool"}
 A tool to convert xAOD::Truth to HepMC::GenEvent.
bool m_doRootHistos
 Will we convert Rivet's internal histo format into a ROOT histo for streaming with THistSvc?
std::string m_runname
 The name of the run (prepended to plot paths).
std::string m_genEventKey
 The GenEvent StoreGate key (default "GEN_EVENT").
Rivet::AnalysisHandler * m_analysisHandler
 A Rivet analysis handler.
std::vector< std::string > m_analysisNames
 A list of names of the analyses to run (set from the job properties).
double m_crossSection
 The cross section for this run of events, set from the job properties.
double m_crossSection_uncert
 The uncertainity of the cross section for this run of events, set from the job properties.
bool m_init
 Flag to determine whether Rivet init has already happened (in execute()).
bool m_skipweights
 Skip variation weights and only run nominal.
std::string m_matchWeights
 String of weight names (or regex) to select multiweights.
std::string m_unmatchWeights
 String of weight names (or regex) to veto multiweights.
std::string m_nominalWeightName
 String to specify non-standard nominal weight.
double m_weightcap
 Weight cap to set allowed maximum for weights.
SG::ReadHandleKey< xAOD::EventInfom_evtInfoKey
DataObjIDColl m_extendedExtraObjects
 Extra output dependency collection, extended by AthAlgorithmDHUpdate to add symlinks.
StoreGateSvc_t m_evtStore
 Pointer to StoreGate (event store by default).
StoreGateSvc_t m_detStore
 Pointer to StoreGate (detector store by default).
std::vector< SG::VarHandleKeyArray * > m_vhka
bool m_varHandleArraysDeclared

Detailed Description

Interface to the Rivet analysis package.

Author
James Monk jmonk.nosp@m.@cer.nosp@m.n.ch
Andy Buckley andy..nosp@m.buck.nosp@m.ley@c.nosp@m.ern..nosp@m.ch
Christian Gutschow chris.nosp@m..g@c.nosp@m.ern.c.nosp@m.h

Definition at line 31 of file Rivet_i.h.

Member Typedef Documentation

◆ StoreGateSvc_t

typedef ServiceHandle<StoreGateSvc> AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::StoreGateSvc_t
privateinherited

Definition at line 388 of file AthCommonDataStore.h.

Constructor & Destructor Documentation

◆ Rivet_i()

Rivet_i::Rivet_i ( const std::string & name,
ISvcLocator * pSvcLocator )

Standard algorithm constructor.

Convert to inherit from GenBase, now we're developing Rivet 2 interfacing for R19+ only.

Definition at line 35 of file Rivet_i.cxx.

35 :
36 AthAlgorithm(name, pSvcLocator),
37 m_needsConversion(false),
39 m_init(false)
40{
41 // Options
42 declareProperty("McEventKey", m_genEventKey="GEN_EVENT");
44 declareProperty("CrossSection", m_crossSection=0.0);
45 declareProperty("CrossSectionUncertainty", m_crossSection_uncert=0.0);
46 declareProperty("Stream", m_stream="/Rivet");
47 declareProperty("RunName", m_runname="");
48 declareProperty("HistoFile", m_file="Rivet.yoda.gz");
49 declareProperty("HistoPreload", m_preload="");
50 declareProperty("AnalysisPath", m_anapath="");
51 declareProperty("IgnoreBeamCheck", m_ignorebeams=false);
52 declareProperty("DoRootHistos", m_doRootHistos=false);
53 declareProperty("SkipWeights", m_skipweights=false);
54 declareProperty("MatchWeights", m_matchWeights="");
55 declareProperty("UnmatchWeights", m_unmatchWeights="");
56 declareProperty("NominalWeightName", m_nominalWeightName="");
57 declareProperty("WeightCap", m_weightcap=-1.0);
58 declareProperty("AddMissingBeamParticles",m_patchBeams=false);
59}
AthAlgorithm(const std::string &name, ISvcLocator *pSvcLocator)
Constructor.
Gaudi::Details::PropertyBase & declareProperty(Gaudi::Property< T, V, H > &t)
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
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
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
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
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
std::string m_runname
The name of the run (prepended to plot paths).
Definition Rivet_i.h:101

Member Function Documentation

◆ ATLAS_NOT_THREAD_SAFE()

virtual StatusCode initialize Rivet_i::ATLAS_NOT_THREAD_SAFE ( )
overridevirtual

Initialise the Rivet interface and Athena services.

Pass a list of analyses to the Rivet AnalysisHandler, which dynamically loads the necessary libraries (including user-written analyses).

◆ checkEvent()

std::unique_ptr< HepMC::GenEvent > Rivet_i::checkEvent ( const HepMC::GenEvent & event,
const EventContext & ctx )
private

Definition at line 261 of file Rivet_i.cxx.

261 {
262 auto modEvent = std::make_unique<HepMC::GenEvent>(event);
263
264 if (!m_needsConversion) {
265 // overwrite the HEPMC dummy event number with the proper ATLAS event number
266 SG::ReadHandle<xAOD::EventInfo> evtInfo(m_evtInfoKey, ctx);
267 modEvent->set_event_number(static_cast<int>(evtInfo->eventNumber()));
268 }
269
270 // weight-name cleaning
271 std::shared_ptr<HepMC3::GenRunInfo> modRunInfo;
272 if (event.run_info()) {
273 modRunInfo = std::make_shared<HepMC3::GenRunInfo>(*(event.run_info().get()));
274 if (event.run_info()->weight_names().empty() && event.weights().size() == 1) {
275 modRunInfo->set_weight_names({"Default"});
276 }
277 }
278 else {
279 ATH_MSG_DEBUG("No run info, event weights size is " << event.weights().size() );
280 modRunInfo = std::make_shared<HepMC3::GenRunInfo>();
281 std::vector<std::string> w_names;
282 for (size_t i = 0; i < event.weights().size(); i++) { w_names.push_back(std::string("badweight") + std::to_string(i)); }
283 modRunInfo->set_weight_names(w_names);
284 }
285 modEvent->set_run_info(std::move(modRunInfo));
286 std::vector<std::string> w_names = modEvent->weight_names();
287 if (w_names.size()) {
288 std::vector<std::pair<std::string,std::string> > w_subs = {
289 {" nominal ",""},
290 {" set = ","_"},
291 {" = ","_"},
292 {"=",""},
293 {",",""},
294 {".",""},
295 {":",""},
296 {" ","_"},
297 {"#","num"},
298 {"\n","_"},
299 {"/","over"}
300 };
301 for (std::string& wname : w_names) {
302 for (const auto& sub : w_subs) {
303 size_t start_pos = wname.find(sub.first);
304 while (start_pos != std::string::npos) {
305 wname.replace(start_pos, sub.first.length(), sub.second);
306 start_pos = wname.find(sub.first);
307 }
308 }
309 }
310 modEvent->run_info()->set_weight_names(w_names);
311 }
312
313 modEvent->set_units(HepMC3::Units::GEV, HepMC3::Units::MM);
314 if (modEvent->particles().size() == 1) modEvent->set_beam_particles(modEvent->particles().front(), modEvent->particles().front());
315 if (m_patchBeams) {
316 // workaround in case beam particles were missing in xAOD::Truth
317 // first work out centre-of-mass energy
318 double etotal = 0;
319 for (const auto& p : modEvent->particles()) {
320 if (!MC::isStable(p)) continue;
321 etotal += p->momentum().e();
322 }
323 const double ebeam = 0.5*etotal;
324 // create dummy beam particles
325 HepMC::GenParticlePtr b1 = std::make_shared<HepMC::GenParticle>(HepMC::FourVector(0,0,ebeam,ebeam),2212,4);
326 HepMC::GenParticlePtr b2 = std::make_shared<HepMC::GenParticle>(HepMC::FourVector(0,0,-1*ebeam,ebeam),2212,4);
327 // remove particles incorrectly labelled as beam particles
328 std::vector<HepMC::GenParticlePtr> notBeams;
329 for (const HepMC::GenParticlePtr& p : modEvent->beams()) {
330 if (!MC::isBeam(p)) notBeams.push_back(p);
331 }
332 //AV: the loop is over shared pointers! Should be const auto&
333 for (const auto& bp : notBeams) bp->production_vertex()->remove_particle_out(bp);
334 // add dummy beam particles
335 modEvent->set_beam_particles(std::move(b1), std::move(b2));
336 }
337 if (modEvent->beams().front()->momentum().e() > 50000.0) {
338 MeV2GeV(*modEvent);
339 }
340
341 return modEvent;
342}
#define ATH_MSG_DEBUG(x)
size_t size() const
Number of registered mappings.
SG::ReadHandleKey< xAOD::EventInfo > m_evtInfoKey
Definition Rivet_i.h:136
void MeV2GeV(HepMC::GenEvent &event)
Definition Rivet_i.cxx:344
HepMC3::FourVector FourVector
HepMC3::GenParticlePtr GenParticlePtr
Definition GenParticle.h:19
bool isStable(const T &p)
Identify if the particle is stable, i.e. has not decayed.
bool isBeam(const T &p)
Identify if the particle is beam particle.

◆ declareGaudiProperty()

Gaudi::Details::PropertyBase & AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::declareGaudiProperty ( Gaudi::Property< T, V, H > & hndl,
const SG::VarHandleKeyType &  )
inlineprivateinherited

specialization for handling Gaudi::Property<SG::VarHandleKey>

Definition at line 156 of file AthCommonDataStore.h.

158 {
160 hndl.value(),
161 hndl.documentation());
162
163 }

◆ declareProperty()

Gaudi::Details::PropertyBase & AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::declareProperty ( Gaudi::Property< T, V, H > & t)
inlineinherited

Definition at line 145 of file AthCommonDataStore.h.

145 {
146 typedef typename SG::HandleClassifier<T>::type htype;
148 }
Gaudi::Details::PropertyBase & declareGaudiProperty(Gaudi::Property< T, V, H > &hndl, const SG::VarHandleKeyType &)
specialization for handling Gaudi::Property<SG::VarHandleKey>

◆ detStore()

const ServiceHandle< StoreGateSvc > & AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::detStore ( ) const
inlineinherited

The standard StoreGateSvc/DetectorStore Returns (kind of) a pointer to the StoreGateSvc.

Definition at line 95 of file AthCommonDataStore.h.

◆ evtStore()

ServiceHandle< StoreGateSvc > & AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::evtStore ( )
inlineinherited

The standard StoreGateSvc (event store) Returns (kind of) a pointer to the StoreGateSvc.

Definition at line 85 of file AthCommonDataStore.h.

◆ execute()

StatusCode Rivet_i::execute ( const EventContext & ctx)
overridevirtual

Run the Rivet analyses on one event, which is retrieved from StoreGate.

Todo
Replace with new GenBase functionality
Todo
Actually use back(), for the most recent event, or throw an exception if more than one event found?
Todo
Todo
Replace with new GenBase const_event() functionality

Implements AthAlgorithm.

Definition at line 141 of file Rivet_i.cxx.

141 {
142 ATH_MSG_DEBUG("Rivet_i execute");
143
144
146 ATH_MSG_DEBUG("Rivet_i needs xAOD::Truth to HepMC::GenEvent conversion? " << m_needsConversion);
147
148 std::unique_ptr<HepMC::GenEvent> checkedEvent;
149 if (m_needsConversion) {
150 const xAOD::TruthEventContainer* truthCollection = nullptr;
151 if (evtStore()->retrieve(truthCollection, "TruthEvents").isFailure()) {
152 ATH_MSG_ERROR("Could not retrieve TruthEvents collection, aborting.");
153 return StatusCode::FAILURE;
154 }
155
156 SG::ReadHandle<xAOD::EventInfo> eventInfo(m_evtInfoKey, ctx);
157 ATH_MSG_DEBUG("Attempt xAOD::Truth to HepMC::GenEvent conversion.");
158 std::vector<HepMC::GenEvent>&& hepmc_evts = m_xAODtoHepMCTool->getHepMCEvents(truthCollection, eventInfo.cptr());
159
160 if (hepmc_evts.empty()) {
161 ATH_MSG_ERROR("Conversion didn't yield HepMC::GenEvent, aborting.");
162 return StatusCode::FAILURE;
163 }
164 checkedEvent = checkEvent(std::move(hepmc_evts[0]), ctx);
165 }
166 else {
167 // Get the event collection
169 const McEventCollection* eventCollection = nullptr;
170 StatusCode sc = evtStore()->retrieve(eventCollection, m_genEventKey);
171 if (sc.isFailure() || eventCollection == 0) {
172 ATH_MSG_ERROR("Unable to retrieve event collection from StoreGate with key " << m_genEventKey);
173 return StatusCode::FAILURE;
174 } else {
175 ATH_MSG_DEBUG("Retrieved event collection from StoreGate with key " << m_genEventKey);
176 }
177
178 // Get the first event in the event collection
181 const HepMC::GenEvent* event = eventCollection->front();
182 if (event == nullptr) {
183 ATH_MSG_ERROR("Rivet_i received a null HepMC event");
184 return StatusCode::FAILURE;
185 }
186
187 // Modify the event units etc. if necessary
188 checkedEvent = checkEvent(*event, ctx);
189 }
190
191 if(!checkedEvent) {
192 ATH_MSG_ERROR("Check on HepMC event failed!");
193 return StatusCode::FAILURE;
194 }
195
196 // Initialize Rivet (on the first event only)
197 if (!m_init) {
198 m_analysisHandler->init(*checkedEvent);
199 m_init = true;
200 }
201
202 // Analyse the event
203 m_analysisHandler->analyze(*checkedEvent);
204
205 return StatusCode::SUCCESS;
206}
#define ATH_MSG_ERROR(x)
static Double_t sc
ServiceHandle< StoreGateSvc > & evtStore()
const T * front() const
Access the first element in the collection as an rvalue.
ToolHandle< IxAODtoHepMCTool > m_xAODtoHepMCTool
A tool to convert xAOD::Truth to HepMC::GenEvent.
Definition Rivet_i.h:91
std::unique_ptr< HepMC::GenEvent > checkEvent(const HepMC::GenEvent &event, const EventContext &ctx)
Definition Rivet_i.cxx:261
::StatusCode StatusCode
StatusCode definition for legacy code.
HepMC3::GenEvent GenEvent
Definition GenEvent.h:39
TruthEventContainer_v1 TruthEventContainer
Declare the latest version of the truth event container.

◆ extraDeps_update_handler()

void AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::extraDeps_update_handler ( Gaudi::Details::PropertyBase & ExtraDeps)
protectedinherited

Add StoreName to extra input/output deps as needed.

use the logic of the VarHandleKey to parse the DataObjID keys supplied via the ExtraInputs and ExtraOuputs Properties to add the StoreName if it's not explicitly given

◆ extraOutputDeps()

const DataObjIDColl & AthCommonAlgorithm< Gaudi::Algorithm >::extraOutputDeps ( ) const
overridevirtualinherited

Return the list of extra output dependencies.

This list is extended to include symlinks implied by inheritance relations.

Definition at line 89 of file AthCommonAlgorithm.cxx.

54{
55 // If we didn't find any symlinks to add, just return the collection
56 // from the base class. Otherwise, return the extended collection.
57 if (!m_extendedExtraObjects.empty()) {
59 }
61}
Common base class for algorithms.

◆ filterPassed()

virtual bool AthCommonAlgorithm< Gaudi::Algorithm >::filterPassed ( const EventContext & ctx) const
inlinevirtualinherited

Get filter decision:

Definition at line 93 of file AthCommonAlgorithm.h.

93 {
94 return execState( ctx ).filterPassed();
95 }
virtual bool filterPassed(const EventContext &ctx) const
Get filter decision:

◆ finalize()

StatusCode Rivet_i::finalize ( )
overridevirtual

Finalise each analysis and commit the plots to the YODA tree and the THistSvc ROOT tree.

Definition at line 209 of file Rivet_i.cxx.

209 {
210 ATH_MSG_INFO("Rivet_i finalizing");
211
212 // Setting cross-section in Rivet
213 // If no user-specified cross-section available,
214 // take whatever is in the GenEvent
216
217 // Call Rivet finalize
218 m_analysisHandler->finalize();
219
220
221
222 // Write out YODA file (add .yoda suffix if missing)
223 if (m_file.find(".yoda") == std::string::npos) m_file += ".yoda.gz";
224 auto pos = m_file.find(".gz.");
225 if (pos == std::string::npos) {
226 m_analysisHandler->writeData(m_file);
227 }
228 else {//filename is e.g. something.yoda.gz.1
229 //write to output file name without the ".1"
230 m_analysisHandler->writeData(m_file.substr(0, pos)+".gz");
231 // then rename it as the requested output filename
232 if (std::rename((m_file.substr(0, pos)+".gz").c_str(), m_file.c_str()) !=0) {
233 std::string error_msg = "Impossible to rename ";
234 error_msg += m_file.substr(0, pos)+".gz";
235 error_msg += " as ";
236 error_msg += m_file;
237 ATH_MSG_ERROR(error_msg.c_str());
238 return StatusCode::FAILURE;
239 }
240 }
241
242 return StatusCode::SUCCESS;
243}
#define ATH_MSG_INFO(x)

◆ inputHandles()

virtual std::vector< Gaudi::DataHandle * > AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::inputHandles ( ) const
overridevirtualinherited

Return this algorithm's input handles.

We override this to include handle instances from key arrays if they have not yet been declared. See comments on updateVHKA.

◆ isClonable()

virtual bool AthCommonAlgorithm< Gaudi::Algorithm >::isClonable ( ) const
inlineoverridevirtualinherited

Specify if the algorithm is clonable.

Only relevant for non-reentrant algorithms. Actual number of clones needs to be set via the "Cardinality" property.

Reimplemented in AFP_DigiTop, AlgB, AlgT, BCM_Digitization, CscDigitBuilder, CscDigitToCscRDO, G4AtlasAlg, G4RunAlg, HGTD_Digitization, HiveAlgBase, InDet::GNNSeedingTrackMaker, InDet::SCT_Clusterization, InDet::SiSPGNNTrackMaker, InDet::SiSPSeededTrackFinder, InDet::SiTrackerSpacePointFinder, ISF::SimKernelMT, ITk::StripDigitization, ITkPixelCablingAlg, ITkStripCablingAlg, LArHitEMapMaker, LArTTL1Maker, LUCID_DigiTop, LVL1::L1TopoSimulation, MergeCalibHits, MergeGenericMuonSimHitColl, MergeHijingPars, MergeMcEventCollection, MergeTrackRecordCollection, MergeTruthJets, MergeTruthParticles, MuonDigitizer, PileUpMTAlg, PixelDigitization, RoIBResultToxAOD, SCT_ByteStreamErrorsTestAlg, SCT_CablingCondAlgFromCoraCool, SCT_CablingCondAlgFromText, SCT_ConditionsParameterTestAlg, SCT_ConditionsSummaryTestAlg, SCT_ConfigurationConditionsTestAlg, SCT_Digitization, SCT_FlaggedConditionTestAlg, SCT_LinkMaskingTestAlg, SCT_MajorityConditionsTestAlg, SCT_ModuleVetoTestAlg, SCT_MonitorConditionsTestAlg, SCT_PrepDataToxAOD, SCT_RawDataToxAOD, SCT_ReadCalibChipDataTestAlg, SCT_ReadCalibDataTestAlg, SCT_RODVetoTestAlg, SCT_SensorsTestAlg, SCT_SiliconConditionsTestAlg, SCT_StripVetoTestAlg, SCT_TdaqEnabledTestAlg, SCT_TestCablingAlg, SCTEventFlagWriter, SCTRawDataProvider, SCTSiLorentzAngleTestAlg, SCTSiPropertiesTestAlg, SGInputLoader, Simulation::BeamEffectsAlg, TileHitVecToCnt, TileMuonFitter, TilePulseForTileMuonReceiver, TileRawChannelMaker, TRTDigitization, and ZDC_DigiTop.

Definition at line 68 of file AthCommonAlgorithm.h.

68 {
69 return true;
70 }

◆ isReEntrant()

virtual bool AthAlgorithm::isReEntrant ( ) const
inlinefinaloverrideprotectedvirtualinherited

Legacy algorithms are not thread-safe.

Definition at line 47 of file AthAlgorithm.h.

47{ return false; }

◆ MeV2GeV()

void Rivet_i::MeV2GeV ( HepMC::GenEvent & event)
private

Definition at line 344 of file Rivet_i.cxx.

344 {
345 for (auto& p: evt.particles()) {
346 p->set_momentum(p->momentum()*0.001);
347 p->set_generated_mass(p->generated_mass()*0.001);
348 }
349}

◆ msg()

MsgStream & AthCommonMsg< Gaudi::Algorithm >::msg ( ) const
inlineinherited

Definition at line 24 of file AthCommonMsg.h.

24 {
25 return this->msgStream();
26 }

◆ msgLvl()

bool AthCommonMsg< Gaudi::Algorithm >::msgLvl ( const MSG::Level lvl) const
inlineinherited

Definition at line 30 of file AthCommonMsg.h.

30 {
31 return this->msgLevel(lvl);
32 }

◆ outputHandles()

virtual std::vector< Gaudi::DataHandle * > AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::outputHandles ( ) const
overridevirtualinherited

Return this algorithm's output handles.

We override this to include handle instances from key arrays if they have not yet been declared. See comments on updateVHKA.

◆ renounce()

std::enable_if_t< std::is_void_v< std::result_of_t< decltype(&T::renounce)(T)> > &&!std::is_base_of_v< SG::VarHandleKeyArray, T > &&std::is_base_of_v< Gaudi::DataHandle, T >, void > AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::renounce ( T & h)
inlineprotectedinherited

Definition at line 380 of file AthCommonDataStore.h.

381 {
382 h.renounce();
384 }
std::enable_if_t< std::is_void_v< std::result_of_t< decltype(&T::renounce)(T)> > &&!std::is_base_of_v< SG::VarHandleKeyArray, T > &&std::is_base_of_v< Gaudi::DataHandle, T >, void > renounce(T &h)

◆ renounceArray()

void AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::renounceArray ( SG::VarHandleKeyArray & handlesArray)
inlineprotectedinherited

remove all handles from I/O resolution

Definition at line 364 of file AthCommonDataStore.h.

364 {
366 }

◆ setFilterPassed()

virtual void AthCommonAlgorithm< Gaudi::Algorithm >::setFilterPassed ( bool state,
const EventContext & ctx ) const
inlinevirtualinherited

Set filter decision:

Reimplemented in AthFilterAlgorithm.

Definition at line 99 of file AthCommonAlgorithm.h.

99 {
101 }
virtual void setFilterPassed(bool state, const EventContext &ctx) const
Set filter decision:

◆ sysExecute()

StatusCode AthCommonAlgorithm< Gaudi::Algorithm >::sysExecute ( const EventContext & ctx)
overridevirtualinherited

Execute an algorithm.

We override this in order to work around an issue with the Algorithm base class storing the event context in a member variable that can cause crashes in MT jobs.

Reimplemented in AthAnalysisAlgorithm.

Definition at line 80 of file AthCommonAlgorithm.cxx.

41{
42 return BaseAlg::sysExecute (ctx);
43}

◆ sysInitialize()

StatusCode AthCommonAlgorithm< Gaudi::Algorithm >::sysInitialize ( )
overridevirtualinherited

Override sysInitialize.

Override sysInitialize from the base class.

Loop through all output handles, and if they're WriteCondHandles, automatically register them and this Algorithm with the CondSvc

Scan through all outputHandles, and if they're WriteCondHandles, register them with the CondSvc

Reimplemented from AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >.

Reimplemented in AthAnalysisAlgorithm, AthFilterAlgorithm, AthHistogramAlgorithm, HypoBase, InputMakerBase, and PyAthena::Alg.

Definition at line 60 of file AthCommonAlgorithm.cxx.

71 {
73
74 if (sc.isFailure()) {
75 return sc;
76 }
77
78 ServiceHandle<ICondSvc> cs("CondSvc",name());
79 for (auto h : outputHandles()) {
80 if (h->isCondition() && h->mode() == Gaudi::DataHandle::Writer) {
81 // do this inside the loop so we don't create the CondSvc until needed
82 if ( cs.retrieve().isFailure() ) {
83 ATH_MSG_WARNING("no CondSvc found: won't autoreg WriteCondHandles");
85 }
86 if (cs->regHandle(this,*h).isFailure()) {
88 ATH_MSG_ERROR("unable to register WriteCondHandle " << h->fullKey()
89 << " with CondSvc");
90 }
91 }
92 }
93 return sc;
94}
#define ATH_MSG_WARNING(x)
virtual StatusCode sysInitialize() override
virtual std::vector< Gaudi::DataHandle * > outputHandles() const override

◆ sysStart()

virtual StatusCode AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::sysStart ( )
overridevirtualinherited

Handle START transition.

We override this in order to make sure that conditions handle keys can cache a pointer to the conditions container.

◆ updateVHKA()

void AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::updateVHKA ( Gaudi::Details::PropertyBase & )
inlineinherited

Definition at line 308 of file AthCommonDataStore.h.

308 {
309 // debug() << "updateVHKA for property " << p.name() << " " << p.toString()
310 // << " size: " << m_vhka.size() << endmsg;
311 for (auto &a : m_vhka) {
313 for (auto k : keys) {
314 k->setOwner(this);
315 }
316 }
317 }

Member Data Documentation

◆ m_analysisHandler

Rivet::AnalysisHandler* Rivet_i::m_analysisHandler
private

A Rivet analysis handler.

Definition at line 107 of file Rivet_i.h.

◆ m_analysisNames

std::vector<std::string> Rivet_i::m_analysisNames
private

A list of names of the analyses to run (set from the job properties).

Definition at line 110 of file Rivet_i.h.

◆ m_anapath

std::string Rivet_i::m_anapath
private

The analysis plugin search path.

This will be used to internally set RIVET_ANALYSIS_PATH, if not already set in the environment.

Definition at line 74 of file Rivet_i.h.

◆ m_crossSection

double Rivet_i::m_crossSection
private

The cross section for this run of events, set from the job properties.

Definition at line 113 of file Rivet_i.h.

◆ m_crossSection_uncert

double Rivet_i::m_crossSection_uncert
private

The uncertainity of the cross section for this run of events, set from the job properties.

Definition at line 116 of file Rivet_i.h.

◆ m_detStore

StoreGateSvc_t AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::m_detStore
privateinherited

Pointer to StoreGate (detector store by default).

Definition at line 393 of file AthCommonDataStore.h.

◆ m_doRootHistos

bool Rivet_i::m_doRootHistos
private

Will we convert Rivet's internal histo format into a ROOT histo for streaming with THistSvc?

The default is yes Currently (03.01.12) there is no conversion for 2D distributions, in which case you want to set this to False

Definition at line 98 of file Rivet_i.h.

◆ m_evtInfoKey

SG::ReadHandleKey<xAOD::EventInfo> Rivet_i::m_evtInfoKey
private
Initial value:
{this
, "EventInfo"
, "EventInfo"
, "ReadHandleKey for xAOD::EventInfo" }

Definition at line 136 of file Rivet_i.h.

136 {this
137 , "EventInfo"
138 , "EventInfo"
139 , "ReadHandleKey for xAOD::EventInfo" };

◆ m_evtStore

StoreGateSvc_t AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::m_evtStore
privateinherited

Pointer to StoreGate (event store by default).

Definition at line 390 of file AthCommonDataStore.h.

◆ m_extendedExtraObjects

DataObjIDColl AthCommonAlgorithm< Gaudi::Algorithm >::m_extendedExtraObjects
privateinherited

Extra output dependency collection, extended by AthAlgorithmDHUpdate to add symlinks.

Empty if no symlinks were found.

Definition at line 108 of file AthCommonAlgorithm.h.

◆ m_file

std::string Rivet_i::m_file
private

The base file name to write results to.

Definition at line 66 of file Rivet_i.h.

◆ m_genEventKey

std::string Rivet_i::m_genEventKey
private

The GenEvent StoreGate key (default "GEN_EVENT").

Definition at line 104 of file Rivet_i.h.

◆ m_ignorebeams

bool Rivet_i::m_ignorebeams
private

Whether to avoid the beam consistency checks.

Default is false: checks will be made to ensure that the supplied events have beams of the sort that the analysis was written to expect.

Definition at line 80 of file Rivet_i.h.

◆ m_init

bool Rivet_i::m_init
private

Flag to determine whether Rivet init has already happened (in execute()).

Definition at line 119 of file Rivet_i.h.

◆ m_matchWeights

std::string Rivet_i::m_matchWeights
private

String of weight names (or regex) to select multiweights.

Definition at line 125 of file Rivet_i.h.

◆ m_needsConversion

bool Rivet_i::m_needsConversion
private

Do we need to convert xAOD::Truth back to HepMC::GenEvemt?

Default is false: assume user runs on EVNT files

Definition at line 85 of file Rivet_i.h.

◆ m_nominalWeightName

std::string Rivet_i::m_nominalWeightName
private

String to specify non-standard nominal weight.

Definition at line 131 of file Rivet_i.h.

◆ m_patchBeams

bool Rivet_i::m_patchBeams
private

Flag to insert beam protons when they are unavailable in the event.

Definition at line 88 of file Rivet_i.h.

◆ m_preload

std::string Rivet_i::m_preload
private

Definition at line 69 of file Rivet_i.h.

◆ m_runname

std::string Rivet_i::m_runname
private

The name of the run (prepended to plot paths).

Definition at line 101 of file Rivet_i.h.

◆ m_skipweights

bool Rivet_i::m_skipweights
private

Skip variation weights and only run nominal.

Definition at line 122 of file Rivet_i.h.

◆ m_stream

std::string Rivet_i::m_stream
private

A pointer to the THistSvc.

The stream name for storing the output plots under (default "/Rivet")

Definition at line 63 of file Rivet_i.h.

◆ m_unmatchWeights

std::string Rivet_i::m_unmatchWeights
private

String of weight names (or regex) to veto multiweights.

Definition at line 128 of file Rivet_i.h.

◆ m_varHandleArraysDeclared

bool AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::m_varHandleArraysDeclared
privateinherited

Definition at line 399 of file AthCommonDataStore.h.

◆ m_vhka

std::vector<SG::VarHandleKeyArray*> AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::m_vhka
privateinherited

Definition at line 398 of file AthCommonDataStore.h.

◆ m_weightcap

double Rivet_i::m_weightcap
private

Weight cap to set allowed maximum for weights.

Definition at line 134 of file Rivet_i.h.

◆ m_xAODtoHepMCTool

ToolHandle<IxAODtoHepMCTool> Rivet_i::m_xAODtoHepMCTool {this, "HepMCTool", "xAODtoHepMCTool"}
private

A tool to convert xAOD::Truth to HepMC::GenEvent.

Definition at line 91 of file Rivet_i.h.

91{this, "HepMCTool", "xAODtoHepMCTool"};

The documentation for this class was generated from the following files: