ATLAS Offline Software
Loading...
Searching...
No Matches
LLPTruthStrategy.cxx
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2024 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),
20{
21 declareProperty("PassProcessCodeRangeLow" , m_passProcessCodeRangeLow=200);
22 declareProperty("PassProcessCodeRangeHigh", m_passProcessCodeRangeHigh=299);
23 declareProperty("PassProcessCategory" , m_passProcessCategory=9);
24 declareProperty("Regions" , m_regionListProperty );
25}
26
27
28// Athena algtool's Hooks
30{
31 ATH_MSG_VERBOSE("Initializing ...");
32 for (auto region : m_regionListProperty.value()) {
33 if (region < AtlasDetDescr::fFirstAtlasRegion || region >= AtlasDetDescr::fNumAtlasRegions) {
34 ATH_MSG_ERROR("Unknown Region (" << region << ") specified. Please check your configuration.");
35 return StatusCode::FAILURE;
36 }
37 }
38 ATH_MSG_VERBOSE("Initialization successful.");
39 return StatusCode::SUCCESS;
40}
41
42
44{
45 const int processCode = ti.physicsProcessCode(); // == G4ProcessSubType
46 if( (processCode>m_passProcessCodeRangeLow && processCode<m_passProcessCodeRangeHigh) ){ // All kinds of decay processes are included here...
47 // Check if this is a sparticle - if not, return
48 if ( !MC::isSUSY(ti.parentPdgCode()) ) {
49 // not passed!
50 return false;
51 }
52 ATH_MSG_VERBOSE("ACHLLP: saved a truth vertex for pdg "<< ti.parentPdgCode());
53 // passed!
54 return true;
55 }
56 const int processCategory = ti.physicsProcessCategory(); // == G4ProcessType
57 if ( processCategory==m_passProcessCategory ){//save all interactions for user-defined processes, like rhadron interactions
58 ATH_MSG_VERBOSE("ACHLLP: saved a truth interaction fUserDefined for pdg " << ti.parentPdgCode());
59 // passed!
60 return true;
61 }
62 // not passed!
63 return false;
64}
65
66
67bool ISF::LLPTruthStrategy::appliesToRegion(unsigned short geoID) const
68{
69 return std::find( m_regionListProperty.begin(),
71 geoID ) != m_regionListProperty.end();
72}
#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.
virtual StatusCode initialize() override
int m_passProcessCodeRangeLow
The process code range (low-high) and the category of processes that should pass this strategy.
LLPTruthStrategy(const std::string &t, const std::string &n, const IInterface *p)
Constructor with parameters.
virtual bool appliesToRegion(unsigned short geoID) const override
IntegerArrayProperty m_regionListProperty
virtual bool pass(ITruthIncident &incident) const override
True if the ITruthStrategy implementationapplies to the given ITruthIncident.
bool isSUSY(const T &p)