ATLAS Offline Software
ValidationTruthStrategy.cxx
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
3 */
4 
6 // ValidationTruthStrategy.cxx, (c) ATLAS Detector software
8 
9 // class header include
11 
12 // ISF includes
14 #include "ISF_Event/ISFParticle.h"
15 
17 ISF::ValidationTruthStrategy::ValidationTruthStrategy(const std::string& t, const std::string& n, const IInterface* p) :
18  base_class(t,n,p),
19  m_minParentP2(0.)
20 {
21  // parent particle minimum momentum
22  declareProperty("ParentMinP" , m_minParentP2 );
23  declareProperty("Regions" , m_regionListProperty );
24 }
25 
28 {
29 }
30 
31 // Athena algtool's Hooks
33 {
34  ATH_MSG_VERBOSE("Initializing ...");
35 
36  // (*) setup parent particle cuts
37  // -> compute p^2 for fast comparison
38  m_minParentP2 *= m_minParentP2;
39 
40  for(auto region : m_regionListProperty.value()) {
41  if(region < AtlasDetDescr::fFirstAtlasRegion || region >= AtlasDetDescr::fNumAtlasRegions) {
42  ATH_MSG_ERROR("Unknown Region (" << region << ") specified. Please check your configuration.");
43  return StatusCode::FAILURE;
44  }
45  }
46 
47  return StatusCode::SUCCESS;
48 }
49 
51 {
52  ATH_MSG_VERBOSE("Finalizing ...");
53  return StatusCode::SUCCESS;
54 }
55 
57 
58  // parent particle check
59  bool pass = ( ti.parentP2() >= m_minParentP2 );
60 
61  return pass;
62 }
63 
64 bool ISF::ValidationTruthStrategy::appliesToRegion(unsigned short geoID) const
65 {
66  return std::find( m_regionListProperty.begin(),
67  m_regionListProperty.end(),
68  geoID ) != m_regionListProperty.end();
69 }
AtlasDetDescr::fNumAtlasRegions
@ fNumAtlasRegions
Definition: AtlasRegion.h:39
ISF::ValidationTruthStrategy::pass
virtual bool pass(ITruthIncident &incident) const override
true if the ITruthStrategy implementation applies to the given ITruthIncident
Definition: ValidationTruthStrategy.cxx:56
find
std::string find(const std::string &s)
return a remapped string
Definition: hcg.cxx:135
read_hist_ntuple.t
t
Definition: read_hist_ntuple.py:5
ATH_MSG_VERBOSE
#define ATH_MSG_VERBOSE(x)
Definition: AthMsgStreamMacros.h:28
ISF::ValidationTruthStrategy::appliesToRegion
virtual bool appliesToRegion(unsigned short geoID) const override
Definition: ValidationTruthStrategy.cxx:64
ISF::ValidationTruthStrategy::m_minParentP2
double m_minParentP2
cuts on the parent particle
Definition: ValidationTruthStrategy.h:49
ISFParticle.h
python.utils.AtlRunQueryDQUtils.p
p
Definition: AtlRunQueryDQUtils.py:210
ATH_MSG_ERROR
#define ATH_MSG_ERROR(x)
Definition: AthMsgStreamMacros.h:33
ITruthIncident.h
ValidationTruthStrategy.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::ValidationTruthStrategy::initialize
virtual StatusCode initialize() override
Definition: ValidationTruthStrategy.cxx:32
ISF::ITruthIncident
Definition: ITruthIncident.h:45
ISF::ValidationTruthStrategy::~ValidationTruthStrategy
~ValidationTruthStrategy()
Destructor.
Definition: ValidationTruthStrategy.cxx:27
ISF::ValidationTruthStrategy::finalize
virtual StatusCode finalize() override
Definition: ValidationTruthStrategy.cxx:50
ISF::ValidationTruthStrategy::m_regionListProperty
IntegerArrayProperty m_regionListProperty
Definition: ValidationTruthStrategy.h:51
ISF::ValidationTruthStrategy::ValidationTruthStrategy
ValidationTruthStrategy(const std::string &t, const std::string &n, const IInterface *p)
Constructor with parameters.
Definition: ValidationTruthStrategy.cxx:17
ISF::ITruthIncident::parentP2
virtual double parentP2() const =0
Return p^2 of the parent particle.