ATLAS Offline Software
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
10 #include "ISF_Event/ISFParticle.h"
11 
13 
15 ISF::LLPTruthStrategy::LLPTruthStrategy(const std::string& t, const std::string& n, const IInterface* p) :
16  base_class(t,n,p),
17  m_passProcessCodeRangeLow(0),
18  m_passProcessCodeRangeHigh(0),
19  m_passProcessCategory(0)
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 
67 bool ISF::LLPTruthStrategy::appliesToRegion(unsigned short geoID) const
68 {
69  return std::find( m_regionListProperty.begin(),
70  m_regionListProperty.end(),
71  geoID ) != m_regionListProperty.end();
72 }
AtlasDetDescr::fNumAtlasRegions
@ fNumAtlasRegions
Definition: AtlasRegion.h:39
ISF::LLPTruthStrategy::pass
virtual bool pass(ITruthIncident &incident) const override
True if the ITruthStrategy implementationapplies to the given ITruthIncident.
Definition: LLPTruthStrategy.cxx:43
find
std::string find(const std::string &s)
return a remapped string
Definition: hcg.cxx:135
ISF::ITruthIncident::physicsProcessCode
virtual int physicsProcessCode() const =0
Return specific physics process code of the truth incident (eg ionisation, bremsstrahlung,...
ISF::ITruthIncident::parentPdgCode
virtual int parentPdgCode() const =0
Return the PDG Code of the parent particle.
ISF::LLPTruthStrategy::m_passProcessCodeRangeLow
int m_passProcessCodeRangeLow
The process code range (low-high) and the category of processes that should pass this strategy.
Definition: LLPTruthStrategy.h:48
read_hist_ntuple.t
t
Definition: read_hist_ntuple.py:5
ATH_MSG_VERBOSE
#define ATH_MSG_VERBOSE(x)
Definition: AthMsgStreamMacros.h:28
ISF::LLPTruthStrategy::m_passProcessCategory
int m_passProcessCategory
Definition: LLPTruthStrategy.h:50
ISF::LLPTruthStrategy::LLPTruthStrategy
LLPTruthStrategy(const std::string &t, const std::string &n, const IInterface *p)
Constructor with parameters.
Definition: LLPTruthStrategy.cxx:15
ISFParticle.h
python.utils.AtlRunQueryDQUtils.p
p
Definition: AtlRunQueryDQUtils.py:210
ATH_MSG_ERROR
#define ATH_MSG_ERROR(x)
Definition: AthMsgStreamMacros.h:33
ISF::LLPTruthStrategy::m_passProcessCodeRangeHigh
int m_passProcessCodeRangeHigh
Definition: LLPTruthStrategy.h:49
ITruthIncident.h
beamspotman.n
n
Definition: beamspotman.py:731
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition: PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22
ISF::LLPTruthStrategy::initialize
virtual StatusCode initialize() override
Definition: LLPTruthStrategy.cxx:29
ISF::ITruthIncident
Definition: ITruthIncident.h:45
isSUSY
bool isSUSY(const T &p)
PDG rule 11d Fundamental supersymmetric particles are identified by adding a nonzero n to the particl...
Definition: AtlasPID.h:388
ISF::LLPTruthStrategy::m_regionListProperty
IntegerArrayProperty m_regionListProperty
Definition: LLPTruthStrategy.h:52
ISF::LLPTruthStrategy::appliesToRegion
virtual bool appliesToRegion(unsigned short geoID) const override
Definition: LLPTruthStrategy.cxx:67
LLPTruthStrategy.h
ISF::ITruthIncident::physicsProcessCategory
virtual int physicsProcessCategory() const =0
Return category of the physics process represented by the truth incident (eg hadronic,...
HepMCHelpers.h