ATLAS Offline Software
Loading...
Searching...
No Matches
LLPTruthStrategy.cxx
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2026 CERN for the benefit of the ATLAS collaboration
3*/
4
5// class header include
6#include "LLPTruthStrategy.h"
7
8// ISF includes
11
13
15ISF::LLPTruthStrategy::LLPTruthStrategy(const std::string& t, const std::string& n, const IInterface* p) :
16 base_class(t,n,p)
17{
18}
19
20// Athena algtool's Hooks
22{
23 ATH_MSG_VERBOSE("Initializing ...");
24 for (auto region : m_regionListProperty.value()) {
25 if (region < AtlasDetDescr::fFirstAtlasRegion || region >= AtlasDetDescr::fNumAtlasRegions) {
26 ATH_MSG_ERROR("Unknown Region (" << region << ") specified. Please check your configuration.");
27 return StatusCode::FAILURE;
28 }
29 }
30 ATH_MSG_VERBOSE("Initialization successful.");
31 return StatusCode::SUCCESS;
32}
33
34
36{
37 const int processCode = ti.physicsProcessCode(); // == G4ProcessSubType
38 if( (processCode>m_passProcessCodeRangeLow && processCode<m_passProcessCodeRangeHigh) ){ // All kinds of decay processes are included here...
39 // Check if this is a sparticle - if not, return
40 if ( !MC::isSUSY(ti.parentPdgCode()) ) {
41 // not passed!
42 return false;
43 }
44 ATH_MSG_VERBOSE("ACHLLP: saved a truth vertex for pdg "<< ti.parentPdgCode());
45 // passed!
46 return true;
47 }
48 const int processCategory = ti.physicsProcessCategory(); // == G4ProcessType
49 if ( processCategory==m_passProcessCategory ){//save all interactions for user-defined processes, like rhadron interactions
50 ATH_MSG_VERBOSE("ACHLLP: saved a truth interaction fUserDefined for pdg " << ti.parentPdgCode());
51 // passed!
52 return true;
53 }
54 // not passed!
55 return false;
56}
57
58
59bool ISF::LLPTruthStrategy::appliesToRegion(unsigned short geoID) const
60{
61 return std::find( m_regionListProperty.begin(),
63 geoID ) != m_regionListProperty.end();
64}
#define ATH_MSG_ERROR(x)
#define ATH_MSG_VERBOSE(x)
ATLAS-specific HepMC functions.
ISF interface class for TruthIncidents.
virtual int physicsProcessCategory() const =0
Return category of the physics process represented by the truth incident (eg hadronic,...
virtual int physicsProcessCode() const =0
Return specific physics process code of the truth incident (eg ionisation, bremsstrahlung,...
virtual int parentPdgCode() const =0
Return the PDG Code of the parent particle.
Gaudi::Property< int > m_passProcessCategory
virtual bool pass(ITruthIncident &incident) const override final
True if the ITruthStrategy implementationapplies to the given ITruthIncident.
virtual StatusCode initialize() override final
LLPTruthStrategy(const std::string &t, const std::string &n, const IInterface *p)
Constructor with parameters.
Gaudi::Property< int > m_passProcessCodeRangeLow
The process code range (low-high) and the category of processes that should pass this strategy.
IntegerArrayProperty m_regionListProperty
Gaudi::Property< int > m_passProcessCodeRangeHigh
virtual bool appliesToRegion(unsigned short geoID) const override final
bool isSUSY(const T &p)