ATLAS Offline Software
Loading...
Searching...
No Matches
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
15
17ISF::ValidationTruthStrategy::ValidationTruthStrategy(const std::string& t, const std::string& n, const IInterface* p) :
18 base_class(t,n,p),
20{
21 // parent particle minimum momentum
22 declareProperty("ParentMinP" , m_minParentP2 );
23 declareProperty("Regions" , m_regionListProperty );
24}
25
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
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
64bool ISF::ValidationTruthStrategy::appliesToRegion(unsigned short geoID) const
65{
66 return std::find( m_regionListProperty.begin(),
68 geoID ) != m_regionListProperty.end();
69}
#define ATH_MSG_ERROR(x)
#define ATH_MSG_VERBOSE(x)
ISF interface class for TruthIncidents.
virtual double parentP2() const =0
Return p^2 of the parent particle.
virtual bool pass(ITruthIncident &incident) const override
true if the ITruthStrategy implementation applies to the given ITruthIncident
virtual StatusCode finalize() override
IntegerArrayProperty m_regionListProperty
double m_minParentP2
cuts on the parent particle
virtual bool appliesToRegion(unsigned short geoID) const override
virtual StatusCode initialize() override
ValidationTruthStrategy(const std::string &t, const std::string &n, const IInterface *p)
Constructor with parameters.