ATLAS Offline Software
Loading...
Searching...
No Matches
InDet::InDetTrackBiasingTool Class Referenceabstract

This class biases tracks to emulate systematic distortions of the tracking geometry. More...

#include <InDetTrackBiasingTool.h>

Inheritance diagram for InDet::InDetTrackBiasingTool:
Collaboration diagram for InDet::InDetTrackBiasingTool:

Public Types

typedef xAOD::TrackParticleContainer xAODContainerType
 description: the type of xAOD container used
typedef xAODContainerType::base_value_type xAODObjectType
 description: the type of xAOD object used

Public Member Functions

virtual void print () const
 Print the state of the tool.
ServiceHandle< StoreGateSvc > & evtStore ()
 The standard StoreGateSvc (event store) Returns (kind of) a pointer to the StoreGateSvc.
const ServiceHandle< StoreGateSvc > & detStore () const
 The standard StoreGateSvc/DetectorStore Returns (kind of) a pointer to the StoreGateSvc.
virtual StatusCode sysInitialize () override
 Perform system initialization for an algorithm.
virtual StatusCode sysStart () override
 Handle START transition.
virtual std::vector< Gaudi::DataHandle * > inputHandles () const override
 Return this algorithm's input handles.
virtual std::vector< Gaudi::DataHandle * > outputHandles () const override
 Return this algorithm's output handles.
Gaudi::Details::PropertyBase & declareProperty (Gaudi::Property< T, V, H > &t)
void updateVHKA (Gaudi::Details::PropertyBase &)
MsgStream & msg () const
bool msgLvl (const MSG::Level lvl) const
virtual CorrectionCode applyCorrection (xAODObjectType &inputObject)=0
 effects: apply the correction and store the output in the object returns: success
CorrectionCode correctedCopy (const xAODObjectType &inputObject, xAODObjectType *&outputObject)
 effects: make a clone of the input object, apply the correction to it and store the output in the object returns: success rationale: the interface class provides a default implementation in terms of applyCorrection, that the derived classes can override for efficiency
CorrectionCode applyContainerCorrection (xAODContainerType &inputContainer)
 effects: apply the correction to all the members of the container returns: overall success rationale: this will apply the correction to every single member (even if some members fail) rationale: the interface class provides a default implementation in terms of applyCorrection, that the derived classes can override for efficiency
Additional helper functions, not directly mimicking Athena
template<class T>
const T * getProperty (const std::string &name) const
 Get one of the tool's properties.
const std::string & msg_level_name () const __attribute__((deprecated))
 A deprecated function for getting the message level's name.
const std::string & getName (const void *ptr) const
 Get the name of an object that is / should be in the event store.
SG::sgkey_t getKey (const void *ptr) const
 Get the (hashed) key of an object that is in the event store.

Protected Member Functions

StatusCode initHistograms ()
float readHistogram (float fDefault, TH2 *histogram, float phi, float eta) const
std::unique_ptr< TFile > getFile (const std::string &) const
 open and return a file with the given name.
template<class T>
StatusCode initObject (std::unique_ptr< T > &obj, const std::string &rootFileName, const std::string &objName) const
 a function to initialize an object from a root file
bool isActive (TrackSystematic) const
void renounceArray (SG::VarHandleKeyArray &handlesArray)
 remove all handles from I/O resolution
std::enable_if_t< std::is_void_v< std::result_of_t< decltype(&T::renounce)(T)> > &&!std::is_base_of_v< SG::VarHandleKeyArray, T > &&std::is_base_of_v< Gaudi::DataHandle, T >, void > renounce (T &h)
void extraDeps_update_handler (Gaudi::Details::PropertyBase &ExtraDeps)
 Add StoreName to extra input/output deps as needed.

Protected Attributes

std::vector< std::unique_ptr< TH2 > > m_biasD0Histograms
std::vector< std::unique_ptr< TH2 > > m_biasZ0Histograms
std::vector< std::unique_ptr< TH2 > > m_biasQoverPsagittaHistograms
std::string m_d0_nominal_histName = "d0/d0_theNominal"
std::string m_z0_nominal_histName = "z0/z0_theNominal"
std::string m_sagitta_nominal_histName = "sagitta/sagitta_theNominal"
Gaudi::Property< float > m_biasD0 {this, "biasD0", 0.f, "Overall d0 bias (mm)."}
Gaudi::Property< float > m_biasZ0 {this, "biasZ0", 0.f, "Overall z0 bias (mm)."}
Gaudi::Property< float > m_biasQoverPsagitta {this, "biasQoverPsagitta", 0.f, "Overall QoverP sagitta bias (TeV^-1)."}
Gaudi::Property< bool > m_applyD0Bias {this, "applyD0Bias", true, "Whether to apply the d0 bias from the calibration map."}
Gaudi::Property< bool > m_applyZ0Bias {this, "applyZ0Bias", true, "Whether to apply the z0 bias from the calibration map."}
Gaudi::Property< bool > m_applyQoverPBias {this, "applyQoverPBias", true, "Whether to apply the q/p sagitta bias from the calibration map."}
Gaudi::Property< bool > m_isMC {this, "isMC", true}
Gaudi::Property< uint32_t > m_runNumber {this, "runNumber", 0, "Manually override the run number used to select the calibration period."}
Gaudi::Property< std::vector< std::string > > m_calibFiles {this, "calibFiles", {}, "Calibration files, one per run period."}
Gaudi::Property< std::vector< unsigned int > > m_runNumberBounds {this, "runNumberBounds", {}, "Run number boundaries: {lower0, upper0, upper1, ...}. May be omitted when only one calibration file is configured."}
SG::ReadHandleKey< xAOD::EventInfom_evtInfoKey {this, "EvtInfo", "EventInfo", "EventInfo name"}
std::unordered_map< CP::SystematicSet, CP::SystematicSetm_sysFilterMap
const CP::SystematicSetm_activeSysts = nullptr

Private Types

typedef ServiceHandle< StoreGateSvcStoreGateSvc_t

Private Member Functions

virtual ASG_TOOL_CLASS(InDetTrackBiasingTool, InDet::IInDetTrackBiasingTool) public ~InDetTrackBiasingTool ()
virtual StatusCode initialize () override
virtual void prepare () override
virtual CP::CorrectionCode applyCorrection (xAOD::TrackParticle &track) override
 Computes the tracks origin.
virtual CP::CorrectionCode correctedCopy (const xAOD::TrackParticle &in, xAOD::TrackParticle *&out) override
virtual CP::CorrectionCode applyContainerCorrection (xAOD::TrackParticleContainer &cont) override
virtual bool isAffectedBySystematic (const CP::SystematicVariation &) const override
 returns: whether the tool is affected by the systematic
virtual CP::SystematicSet affectingSystematics () const override
 returns: list of systematics this tool can be affected by
virtual CP::SystematicSet recommendedSystematics () const override
 returns: list of recommended systematics to use with this tool
virtual StatusCode applySystematicVariation (const CP::SystematicSet &) override
 configure the tool to apply a given list of systematic variations
Gaudi::Details::PropertyBase & declareGaudiProperty (Gaudi::Property< T, V, H > &hndl, const SG::VarHandleKeyType &)
 specialization for handling Gaudi::Property<SG::VarHandleKey>

Private Attributes

StoreGateSvc_t m_evtStore
 Pointer to StoreGate (event store by default)
StoreGateSvc_t m_detStore
 Pointer to StoreGate (detector store by default)
std::vector< SG::VarHandleKeyArray * > m_vhka
bool m_varHandleArraysDeclared

Detailed Description

This class biases tracks to emulate systematic distortions of the tracking geometry.

Author
Pawel Bruckman (pawel.nosp@m..bru.nosp@m.ckman.nosp@m..de..nosp@m.renst.nosp@m.rom@.nosp@m.cern..nosp@m.ch)
Felix Clark (micha.nosp@m.el.r.nosp@m.yan.c.nosp@m.lark.nosp@m.@cern.nosp@m..ch)

In data, it corrects the biases. In simulation, it applys the biases in the same direction they are observed in the data.

Author
Pawel Bruckman (pawel.nosp@m..bru.nosp@m.ckman.nosp@m..de..nosp@m.renst.nosp@m.rom@.nosp@m.cern..nosp@m.ch)
Felix Clark (micha.nosp@m.el.r.nosp@m.yan.c.nosp@m.lark.nosp@m.@cern.nosp@m..ch)

Definition at line 39 of file InDetTrackBiasingTool.h.

Member Typedef Documentation

◆ StoreGateSvc_t

typedef ServiceHandle<StoreGateSvc> AthCommonDataStore< AthCommonMsg< AlgTool > >::StoreGateSvc_t
privateinherited

Definition at line 388 of file AthCommonDataStore.h.

◆ xAODContainerType

description: the type of xAOD container used

Definition at line 46 of file CorrectionTool.h.

◆ xAODObjectType

description: the type of xAOD object used

Definition at line 48 of file CorrectionTool.h.

Member Function Documentation

◆ affectingSystematics()

CP::SystematicSet InDet::InDetTrackBiasingTool::affectingSystematics ( ) const
overrideprivatevirtual

returns: list of systematics this tool can be affected by

Implements InDet::IInDetTrackBiasingTool.

Definition at line 219 of file InDetTrackBiasingTool.cxx.

220 {
221 CP::SystematicSet result;
222 if (m_applyD0Bias) result.insert(InDet::TrackSystematicMap.at(TRK_BIAS_D0_WM));
223 if (m_applyZ0Bias) result.insert(InDet::TrackSystematicMap.at(TRK_BIAS_Z0_WM));
224 if (m_applyQoverPBias) result.insert(InDet::TrackSystematicMap.at(TRK_BIAS_QOVERP_SAGITTA_WM));
225 return result;
226 }
Gaudi::Property< bool > m_applyQoverPBias
Gaudi::Property< bool > m_applyZ0Bias
Gaudi::Property< bool > m_applyD0Bias

◆ applyContainerCorrection() [1/2]

CorrectionCode CP::CorrectionTool< xAOD::TrackParticleContainer >::applyContainerCorrection ( xAODContainerType & inputContainer)
inherited

effects: apply the correction to all the members of the container returns: overall success rationale: this will apply the correction to every single member (even if some members fail) rationale: the interface class provides a default implementation in terms of applyCorrection, that the derived classes can override for efficiency

◆ applyContainerCorrection() [2/2]

CP::CorrectionCode InDet::InDetTrackBiasingTool::applyContainerCorrection ( xAOD::TrackParticleContainer & cont)
overrideprivatevirtual

Implements InDet::IInDetTrackBiasingTool.

Definition at line 209 of file InDetTrackBiasingTool.cxx.

210 {
211 return TrackCorrTool_t::applyContainerCorrection(cont);
212 }

◆ applyCorrection() [1/2]

virtual CorrectionCode CP::CorrectionTool< xAOD::TrackParticleContainer >::applyCorrection ( xAODObjectType & inputObject)
pure virtualinherited

effects: apply the correction and store the output in the object returns: success

◆ applyCorrection() [2/2]

CP::CorrectionCode InDet::InDetTrackBiasingTool::applyCorrection ( xAOD::TrackParticle & track)
overrideprivatevirtual

Computes the tracks origin.

Implements InDet::IInDetTrackBiasingTool.

Definition at line 61 of file InDetTrackBiasingTool.cxx.

61 {
62
63 if ( !m_isMC ) {
64 ATH_MSG_ERROR( "InDetTrackBiasingTool should only be run on MC." );
66 }
67
68 // determine which run number to use
69 SG::ReadHandle<xAOD::EventInfo> eventInfo(m_evtInfoKey);
70 static const SG::AuxElement::Accessor<unsigned int> randomRunNumber("RandomRunNumber");
71 auto runNumber = randomRunNumber(*eventInfo);
72
73 if (runNumber <= 0) {
74 ATH_MSG_WARNING( "Run number not set." );
75 }
76 // 5 TeV and heavy-ion runs have no biasing maps
77 if (runNumber >= 286282 && runNumber <= 287931) {
78 ATH_MSG_ERROR( "The 5 TeV and heavy ion runs do not have biasing maps for release 22. "
79 "Contact the tracking CP group to discuss the derivation of these maps." );
81 }
82
83 // find which configured period this run belongs to
84 size_t periodIdx = m_calibFiles.size(); // sentinel: no match
85 if (m_runNumberBounds.empty()) {
86 periodIdx = 0; // single period, accept all run numbers
87 } else {
88 for (size_t i = 0; i + 1 < m_runNumberBounds.size(); ++i) {
89 if (runNumber > m_runNumberBounds[i] && runNumber <= m_runNumberBounds[i+1]) {
90 periodIdx = i;
91 break;
92 }
93 }
94 }
95 if (periodIdx >= m_calibFiles.size()) {
96 ATH_MSG_ERROR( "Run number = " << runNumber << " does not fall within any configured calibration period." );
98 }
99
100 // select histograms for the matched period
101 TH2* biasD0Histogram = m_biasD0Histograms[periodIdx].get();
102 TH2* biasZ0Histogram = m_biasZ0Histograms[periodIdx].get();
103 TH2* biasQoverPsagittaHistogram = m_biasQoverPsagittaHistograms[periodIdx].get();
104
105 bool doD0Bias = m_applyD0Bias && biasD0Histogram != nullptr;
106 bool doZ0Bias = m_applyZ0Bias && biasZ0Histogram != nullptr;
107 bool doQoverPBias = m_applyQoverPBias && biasQoverPsagittaHistogram != nullptr;
108
109 if (m_applyD0Bias && !biasD0Histogram) ATH_MSG_WARNING( "d0 bias histogram is nullptr. Will not perform d0 bias." );
110 if (m_applyZ0Bias && !biasZ0Histogram) ATH_MSG_WARNING( "z0 bias histogram is nullptr. Will not perform z0 bias." );
111 if (m_applyQoverPBias && !biasQoverPsagittaHistogram) ATH_MSG_WARNING( "q/p bias histogram is nullptr. Will not perform q/p sagitta bias." );
112
113 // declare static accessors to avoid repeating string lookups
114 static const SG::AuxElement::Accessor< float > accD0( "d0" );
115 static const SG::AuxElement::Accessor< float > accZ0( "z0" );
116 static const SG::AuxElement::Accessor< float > accQOverP( "qOverP" );
117
118 const float phi = track.phi0();
119 const float eta = track.eta();
120
121 // do the biasing
122 // Always apply the correction to the nominal; undo it for systematic variations
123 if ( doD0Bias ) {
124 const float d0Corr = readHistogram(m_biasD0, biasD0Histogram, phi, eta);
125 accD0( track ) += d0Corr;
126 if ( isActive( TRK_BIAS_D0_WM ) ) {
127 accD0( track ) -= d0Corr;
128 }
129 }
130 if ( doZ0Bias ) {
131 const float z0Corr = readHistogram(m_biasZ0, biasZ0Histogram, phi, eta);
132 accZ0( track ) += z0Corr;
133 if ( isActive( TRK_BIAS_Z0_WM ) ) {
134 accZ0( track ) -= z0Corr;
135 }
136 }
137 if ( doQoverPBias ) {
138 auto sinTheta = 1.0 / std::cosh(eta);
139 const float qOverPCorr = 1.e-6*sinTheta*readHistogram(m_biasQoverPsagitta, biasQoverPsagittaHistogram, phi, eta);
140 accQOverP( track ) += qOverPCorr;
141 if ( isActive( TRK_BIAS_QOVERP_SAGITTA_WM ) ) {
142 accQOverP( track ) -= qOverPCorr;
143 }
144 }
145
147 }
Scalar eta() const
pseudorapidity method
Scalar phi() const
phi method
#define ATH_MSG_ERROR(x)
#define ATH_MSG_WARNING(x)
@ Error
Some error happened during the object correction.
@ Ok
The correction was done successfully.
float readHistogram(float fDefault, TH2 *histogram, float phi, float eta) const
Gaudi::Property< float > m_biasQoverPsagitta
SG::ReadHandleKey< xAOD::EventInfo > m_evtInfoKey
std::vector< std::unique_ptr< TH2 > > m_biasD0Histograms
Gaudi::Property< std::vector< std::string > > m_calibFiles
Gaudi::Property< float > m_biasZ0
Gaudi::Property< float > m_biasD0
Gaudi::Property< std::vector< unsigned int > > m_runNumberBounds
std::vector< std::unique_ptr< TH2 > > m_biasQoverPsagittaHistograms
std::vector< std::unique_ptr< TH2 > > m_biasZ0Histograms
SG::Accessor< T, ALLOC > Accessor
Definition AuxElement.h:573

◆ applySystematicVariation()

StatusCode InDet::InDetTrackBiasingTool::applySystematicVariation ( const CP::SystematicSet & systs)
overrideprivatevirtual

configure the tool to apply a given list of systematic variations

Implements InDet::IInDetTrackBiasingTool.

Definition at line 233 of file InDetTrackBiasingTool.cxx.

234 {
236 }
virtual StatusCode applySystematicVariation(const CP::SystematicSet &) override
configure the tool to apply a given list of systematic variations

◆ correctedCopy() [1/2]

CorrectionCode CP::CorrectionTool< xAOD::TrackParticleContainer >::correctedCopy ( const xAODObjectType & inputObject,
xAODObjectType *& outputObject )
inherited

effects: make a clone of the input object, apply the correction to it and store the output in the object returns: success rationale: the interface class provides a default implementation in terms of applyCorrection, that the derived classes can override for efficiency

◆ correctedCopy() [2/2]

CP::CorrectionCode InDet::InDetTrackBiasingTool::correctedCopy ( const xAOD::TrackParticle & in,
xAOD::TrackParticle *& out )
overrideprivatevirtual

Implements InDet::IInDetTrackBiasingTool.

Definition at line 203 of file InDetTrackBiasingTool.cxx.

205 {
206 return TrackCorrTool_t::correctedCopy(in, out);
207 }

◆ declareGaudiProperty()

Gaudi::Details::PropertyBase & AthCommonDataStore< AthCommonMsg< AlgTool > >::declareGaudiProperty ( Gaudi::Property< T, V, H > & hndl,
const SG::VarHandleKeyType &  )
inlineprivateinherited

specialization for handling Gaudi::Property<SG::VarHandleKey>

Definition at line 156 of file AthCommonDataStore.h.

158 {
160 hndl.value(),
161 hndl.documentation());
162
163 }
Gaudi::Details::PropertyBase & declareProperty(Gaudi::Property< T, V, H > &t)

◆ declareProperty()

Gaudi::Details::PropertyBase & AthCommonDataStore< AthCommonMsg< AlgTool > >::declareProperty ( Gaudi::Property< T, V, H > & t)
inlineinherited

Definition at line 145 of file AthCommonDataStore.h.

145 {
146 typedef typename SG::HandleClassifier<T>::type htype;
148 }
Gaudi::Details::PropertyBase & declareGaudiProperty(Gaudi::Property< T, V, H > &hndl, const SG::VarHandleKeyType &)
specialization for handling Gaudi::Property<SG::VarHandleKey>

◆ detStore()

const ServiceHandle< StoreGateSvc > & AthCommonDataStore< AthCommonMsg< AlgTool > >::detStore ( ) const
inlineinherited

The standard StoreGateSvc/DetectorStore Returns (kind of) a pointer to the StoreGateSvc.

Definition at line 95 of file AthCommonDataStore.h.

◆ evtStore()

ServiceHandle< StoreGateSvc > & AthCommonDataStore< AthCommonMsg< AlgTool > >::evtStore ( )
inlineinherited

The standard StoreGateSvc (event store) Returns (kind of) a pointer to the StoreGateSvc.

Definition at line 85 of file AthCommonDataStore.h.

◆ extraDeps_update_handler()

void AthCommonDataStore< AthCommonMsg< AlgTool > >::extraDeps_update_handler ( Gaudi::Details::PropertyBase & ExtraDeps)
protectedinherited

Add StoreName to extra input/output deps as needed.

use the logic of the VarHandleKey to parse the DataObjID keys supplied via the ExtraInputs and ExtraOuputs Properties to add the StoreName if it's not explicitly given

◆ getFile()

std::unique_ptr< TFile > InDet::InDetTrackSystematicsTool::getFile ( const std::string & filename) const
protectedinherited

open and return a file with the given name.

Definition at line 99 of file InDetTrackSystematicsTool.cxx.

100 {
101 // now the files are stored in the calibration area
102 // filename is configurable in each tool and should include the path starting from the package name
103 // but defaults to recommendation for current release
104 std::string filenameWithFullPath = PathResolverFindCalibFile(filename);
105
106 return std::unique_ptr<TFile>(TFile::Open(filenameWithFullPath.data(), "READ"));;
107 }
std::string PathResolverFindCalibFile(const std::string &logical_file_name)

◆ getKey()

SG::sgkey_t asg::AsgTool::getKey ( const void * ptr) const
inherited

Get the (hashed) key of an object that is in the event store.

This is a bit of a special one. StoreGateSvc and xAOD::TEvent both provide ways for getting the SG::sgkey_t key for an object that is in the store, based on a bare pointer. But they provide different interfaces for doing so.

In order to allow tools to efficiently perform this operation, they can use this helper function.

See also
asg::AsgTool::getName
Parameters
ptrThe bare pointer to the object that the event store should know about
Returns
The hashed key of the object in the store. If not found, an invalid (zero) key.

Definition at line 119 of file AsgTool.cxx.

119 {
120
121#ifdef XAOD_STANDALONE
122 // In case we use @c xAOD::TEvent, we have a direct function call
123 // for this.
124 return evtStore()->event()->getKey( ptr );
125#else
126 const SG::DataProxy* proxy = evtStore()->proxy( ptr );
127 return ( proxy == nullptr ? 0 : proxy->sgkey() );
128#endif // XAOD_STANDALONE
129 }
ServiceHandle< StoreGateSvc > & evtStore()

◆ getName()

const std::string & asg::AsgTool::getName ( const void * ptr) const
inherited

Get the name of an object that is / should be in the event store.

This is a bit of a special one. StoreGateSvc and xAOD::TEvent both provide ways for getting the std::string name for an object that is in the store, based on a bare pointer. But they provide different interfaces for doing so.

In order to allow tools to efficiently perform this operation, they can use this helper function.

See also
asg::AsgTool::getKey
Parameters
ptrThe bare pointer to the object that the event store should know about
Returns
The string name of the object in the store. If not found, an empty string.

Definition at line 106 of file AsgTool.cxx.

106 {
107
108#ifdef XAOD_STANDALONE
109 // In case we use @c xAOD::TEvent, we have a direct function call
110 // for this.
111 return evtStore()->event()->getName( ptr );
112#else
113 const SG::DataProxy* proxy = evtStore()->proxy( ptr );
114 static const std::string dummy = "";
115 return ( proxy == nullptr ? dummy : proxy->name() );
116#endif // XAOD_STANDALONE
117 }

◆ getProperty()

template<class T>
const T * asg::AsgTool::getProperty ( const std::string & name) const
inherited

Get one of the tool's properties.

◆ initHistograms()

StatusCode InDet::InDetTrackBiasingTool::initHistograms ( )
protected

Definition at line 149 of file InDetTrackBiasingTool.cxx.

150 {
151
152 if (m_calibFiles.empty()) {
153 ATH_MSG_ERROR( "No calibration files configured. Set 'calibFiles' and (for multiple periods) "
154 "'runNumberBounds' for the relevant MC campaign via the python configuration." );
155 return StatusCode::FAILURE;
156 }
157 if (!m_runNumberBounds.empty() && m_runNumberBounds.size() != m_calibFiles.size() + 1) {
158 ATH_MSG_ERROR( "'runNumberBounds' (size " << m_runNumberBounds.size() << ") must have "
159 "calibFiles.size() + 1 = " << (m_calibFiles.size() + 1) << " entries." );
160 return StatusCode::FAILURE;
161 }
162 if (m_runNumberBounds.empty() && m_calibFiles.size() > 1) {
163 ATH_MSG_ERROR( "'runNumberBounds' must be set when multiple calibration files are configured." );
164 return StatusCode::FAILURE;
165 }
166
167 for (size_t i = 0; i < m_calibFiles.size(); ++i) {
168 if (m_runNumberBounds.empty()) {
169 ATH_MSG_INFO( "Calibration period 0 (all run numbers): file: "
171 } else {
172 ATH_MSG_INFO( "Calibration period " << i << ": run range ["
173 << m_runNumberBounds[i] << ", " << m_runNumberBounds[i+1]
174 << "], file: " << PathResolverFindCalibFile(m_calibFiles[i]) );
175 }
176 m_biasD0Histograms.emplace_back(nullptr);
178 m_biasZ0Histograms.emplace_back(nullptr);
180 m_biasQoverPsagittaHistograms.emplace_back(nullptr);
182 }
183
184 return StatusCode::SUCCESS;
185 }
#define ATH_CHECK
Evaluate an expression and check for errors.
#define ATH_MSG_INFO(x)
StatusCode initObject(std::unique_ptr< T > &obj, const std::string &rootFileName, const std::string &objName) const
a function to initialize an object from a root file

◆ initialize()

StatusCode InDet::InDetTrackBiasingTool::initialize ( void )
overrideprivatevirtual

Implements InDet::IInDetTrackBiasingTool.

Definition at line 29 of file InDetTrackBiasingTool.cxx.

30 {
31 if (m_biasD0 != 0.) {
32 ATH_MSG_INFO( "overall d0 bias added = " << m_biasD0
33 << " mm (not part of an official recommendation)" );
34 }
35 if (m_biasZ0 != 0.) {
36 ATH_MSG_INFO( "overall z0 bias added = " << m_biasZ0
37 << " mm (not part of an official recommendation)" );
38 }
39 if (m_biasQoverPsagitta != 0.) {
40 ATH_MSG_INFO( "overall QoverP sagitta bias added = " << m_biasQoverPsagitta
41 << " TeV^-1 (not part of an official recommendation)" );
42 }
43
44 if (m_runNumber > 0) {
45 ATH_MSG_WARNING( "Using manually-set run number (" << m_runNumber << ") to determine which calibration file to use." );
46 }
47
49
50 ATH_CHECK(m_evtInfoKey.initialize());
51
53
54 return StatusCode::SUCCESS;
55 }
Gaudi::Property< uint32_t > m_runNumber
virtual StatusCode initialize() override
Dummy implementation of the initialisation function.

◆ initObject()

template<class T>
StatusCode InDet::InDetTrackSystematicsTool::initObject ( std::unique_ptr< T > & obj,
const std::string & rootFileName,
const std::string & objName ) const
protectedinherited

a function to initialize an object from a root file

Definition at line 64 of file InDetTrackSystematicsTool.h.

65{
66 if (obj != nullptr) ATH_MSG_WARNING( obj->GetName() << " is not null, yet we are now attempting to initialize from " << rootFileName );
67 std::unique_ptr<TFile> F = getFile(rootFileName);
68 if(!F || F->IsZombie()) {
69 ATH_MSG_ERROR( "Could not open file " << rootFileName );
70 return StatusCode::FAILURE;
71 }
72 T* tempObj = nullptr;
73 F->GetObject(objName.data(), tempObj);
74 if(tempObj==nullptr) {
75 ATH_MSG_ERROR( "Could not retrieve " << objName << " from file " << rootFileName );
76 return StatusCode::FAILURE;
77 }
78 obj = std::unique_ptr<T>(static_cast<T*>(tempObj->Clone()));
79 obj->SetDirectory(0);
80 F->Clear();
81 F->Close();
82 return StatusCode::SUCCESS;
83}
#define F(x, y, z)
Definition MD5.cxx:112
std::unique_ptr< TFile > getFile(const std::string &) const
open and return a file with the given name.
unsigned long long T

◆ inputHandles()

virtual std::vector< Gaudi::DataHandle * > AthCommonDataStore< AthCommonMsg< AlgTool > >::inputHandles ( ) const
overridevirtualinherited

Return this algorithm's input handles.

We override this to include handle instances from key arrays if they have not yet been declared. See comments on updateVHKA.

◆ isActive()

bool InDet::InDetTrackSystematicsTool::isActive ( TrackSystematic syst) const
protectedinherited

Definition at line 89 of file InDetTrackSystematicsTool.cxx.

90 {
91 if (m_activeSysts == nullptr) {
92 ATH_MSG_DEBUG( "applySystematicsVariation() has not been successfully called." );
93 return false;
94 }
95 const auto it_syst = m_activeSysts->find(InDet::TrackSystematicMap.at(syst));
96 return it_syst != m_activeSysts->end();
97 }
#define ATH_MSG_DEBUG(x)

◆ isAffectedBySystematic()

bool InDet::InDetTrackBiasingTool::isAffectedBySystematic ( const CP::SystematicVariation & syst) const
overrideprivatevirtual

returns: whether the tool is affected by the systematic

Implements InDet::IInDetTrackBiasingTool.

Definition at line 214 of file InDetTrackBiasingTool.cxx.

215 {
217 }
virtual bool isAffectedBySystematic(const CP::SystematicVariation &) const override
returns: whether the tool is affected by the systematic

◆ msg()

MsgStream & AthCommonMsg< AlgTool >::msg ( ) const
inlineinherited

Definition at line 24 of file AthCommonMsg.h.

24 {
25 return this->msgStream();
26 }

◆ msg_level_name()

const std::string & asg::AsgTool::msg_level_name ( ) const
inherited

A deprecated function for getting the message level's name.

Instead of using this, weirdly named function, user code should get the string name of the current minimum message level (in case they really need it...), with:

MSG::name( msg().level() )

This function's name doesn't follow the ATLAS coding rules, and as such will be removed in the not too distant future.

Returns
The string name of the current minimum message level that's printed

Definition at line 101 of file AsgTool.cxx.

101 {
102
103 return MSG::name( msg().level() );
104 }
MsgStream & msg() const
const std::string & name(Level lvl)
Convenience function for translating message levels to strings.
Definition MsgLevel.cxx:19

◆ msgLvl()

bool AthCommonMsg< AlgTool >::msgLvl ( const MSG::Level lvl) const
inlineinherited

Definition at line 30 of file AthCommonMsg.h.

30 {
31 return this->msgLevel(lvl);
32 }

◆ outputHandles()

virtual std::vector< Gaudi::DataHandle * > AthCommonDataStore< AthCommonMsg< AlgTool > >::outputHandles ( ) const
overridevirtualinherited

Return this algorithm's output handles.

We override this to include handle instances from key arrays if they have not yet been declared. See comments on updateVHKA.

◆ prepare()

virtual void InDet::InDetTrackBiasingTool::prepare ( )
inlineoverrideprivatevirtual

Implements InDet::IInDetTrackBiasingTool.

Definition at line 54 of file InDetTrackBiasingTool.h.

54{};

◆ print()

◆ readHistogram()

float InDet::InDetTrackBiasingTool::readHistogram ( float fDefault,
TH2 * histogram,
float phi,
float eta ) const
protected

Definition at line 187 of file InDetTrackBiasingTool.cxx.

187 {
188 if (histogram == nullptr) {
189 ATH_MSG_ERROR( "Configuration histogram is invalid. Check the run number and systematic configuration combination.");
190 throw std::runtime_error( "invalid configuration" );
191 }
192
193 // safety measure:
194 if( eta>2.499 ) eta= 2.499;
195 if( eta<-2.499 ) eta=-2.499;
196
197 float f = histogram->GetBinContent(histogram->FindBin(eta, phi));
198 f += fDefault; // should be zero unless a manual override is provided
199
200 return f;
201 }
std::string histogram
Definition chains.cxx:52

◆ recommendedSystematics()

CP::SystematicSet InDet::InDetTrackBiasingTool::recommendedSystematics ( ) const
overrideprivatevirtual

returns: list of recommended systematics to use with this tool

Implements InDet::IInDetTrackBiasingTool.

Definition at line 228 of file InDetTrackBiasingTool.cxx.

229 {
231 }
virtual CP::SystematicSet recommendedSystematics() const override
returns: list of recommended systematics to use with this tool

◆ renounce()

std::enable_if_t< std::is_void_v< std::result_of_t< decltype(&T::renounce)(T)> > &&!std::is_base_of_v< SG::VarHandleKeyArray, T > &&std::is_base_of_v< Gaudi::DataHandle, T >, void > AthCommonDataStore< AthCommonMsg< AlgTool > >::renounce ( T & h)
inlineprotectedinherited

Definition at line 380 of file AthCommonDataStore.h.

381 {
382 h.renounce();
384 }
std::enable_if_t< std::is_void_v< std::result_of_t< decltype(&T::renounce)(T)> > &&!std::is_base_of_v< SG::VarHandleKeyArray, T > &&std::is_base_of_v< Gaudi::DataHandle, T >, void > renounce(T &h)

◆ renounceArray()

void AthCommonDataStore< AthCommonMsg< AlgTool > >::renounceArray ( SG::VarHandleKeyArray & handlesArray)
inlineprotectedinherited

remove all handles from I/O resolution

Definition at line 364 of file AthCommonDataStore.h.

364 {
366 }

◆ sysInitialize()

virtual StatusCode AthCommonDataStore< AthCommonMsg< AlgTool > >::sysInitialize ( )
overridevirtualinherited

Perform system initialization for an algorithm.

We override this to declare all the elements of handle key arrays at the end of initialization. See comments on updateVHKA.

Reimplemented in asg::AsgMetadataTool, AthCheckedComponent< AthAlgTool >, AthCheckedComponent<::AthAlgTool >, and DerivationFramework::CfAthAlgTool.

◆ sysStart()

virtual StatusCode AthCommonDataStore< AthCommonMsg< AlgTool > >::sysStart ( )
overridevirtualinherited

Handle START transition.

We override this in order to make sure that conditions handle keys can cache a pointer to the conditions container.

◆ updateVHKA()

void AthCommonDataStore< AthCommonMsg< AlgTool > >::updateVHKA ( Gaudi::Details::PropertyBase & )
inlineinherited

Definition at line 308 of file AthCommonDataStore.h.

308 {
309 // debug() << "updateVHKA for property " << p.name() << " " << p.toString()
310 // << " size: " << m_vhka.size() << endmsg;
311 for (auto &a : m_vhka) {
313 for (auto k : keys) {
314 k->setOwner(this);
315 }
316 }
317 }
std::vector< SG::VarHandleKeyArray * > m_vhka

◆ ~InDetTrackBiasingTool()

InDet::InDetTrackBiasingTool::~InDetTrackBiasingTool ( )
privatevirtual

Definition at line 57 of file InDetTrackBiasingTool.cxx.

57 {
58 m_runNumber = -1;
59 }

Member Data Documentation

◆ m_activeSysts

const CP::SystematicSet* InDet::InDetTrackSystematicsTool::m_activeSysts = nullptr
protectedinherited

Definition at line 54 of file InDetTrackSystematicsTool.h.

◆ m_applyD0Bias

Gaudi::Property<bool> InDet::InDetTrackBiasingTool::m_applyD0Bias {this, "applyD0Bias", true, "Whether to apply the d0 bias from the calibration map."}
protected

Definition at line 92 of file InDetTrackBiasingTool.h.

92{this, "applyD0Bias", true, "Whether to apply the d0 bias from the calibration map."};

◆ m_applyQoverPBias

Gaudi::Property<bool> InDet::InDetTrackBiasingTool::m_applyQoverPBias {this, "applyQoverPBias", true, "Whether to apply the q/p sagitta bias from the calibration map."}
protected

Definition at line 94 of file InDetTrackBiasingTool.h.

94{this, "applyQoverPBias", true, "Whether to apply the q/p sagitta bias from the calibration map."};

◆ m_applyZ0Bias

Gaudi::Property<bool> InDet::InDetTrackBiasingTool::m_applyZ0Bias {this, "applyZ0Bias", true, "Whether to apply the z0 bias from the calibration map."}
protected

Definition at line 93 of file InDetTrackBiasingTool.h.

93{this, "applyZ0Bias", true, "Whether to apply the z0 bias from the calibration map."};

◆ m_biasD0

Gaudi::Property<float> InDet::InDetTrackBiasingTool::m_biasD0 {this, "biasD0", 0.f, "Overall d0 bias (mm)."}
protected

Definition at line 88 of file InDetTrackBiasingTool.h.

88{this, "biasD0", 0.f, "Overall d0 bias (mm)."};

◆ m_biasD0Histograms

std::vector<std::unique_ptr<TH2> > InDet::InDetTrackBiasingTool::m_biasD0Histograms
protected

Definition at line 79 of file InDetTrackBiasingTool.h.

◆ m_biasQoverPsagitta

Gaudi::Property<float> InDet::InDetTrackBiasingTool::m_biasQoverPsagitta {this, "biasQoverPsagitta", 0.f, "Overall QoverP sagitta bias (TeV^-1)."}
protected

Definition at line 90 of file InDetTrackBiasingTool.h.

90{this, "biasQoverPsagitta", 0.f, "Overall QoverP sagitta bias (TeV^-1)."};

◆ m_biasQoverPsagittaHistograms

std::vector<std::unique_ptr<TH2> > InDet::InDetTrackBiasingTool::m_biasQoverPsagittaHistograms
protected

Definition at line 81 of file InDetTrackBiasingTool.h.

◆ m_biasZ0

Gaudi::Property<float> InDet::InDetTrackBiasingTool::m_biasZ0 {this, "biasZ0", 0.f, "Overall z0 bias (mm)."}
protected

Definition at line 89 of file InDetTrackBiasingTool.h.

89{this, "biasZ0", 0.f, "Overall z0 bias (mm)."};

◆ m_biasZ0Histograms

std::vector<std::unique_ptr<TH2> > InDet::InDetTrackBiasingTool::m_biasZ0Histograms
protected

Definition at line 80 of file InDetTrackBiasingTool.h.

◆ m_calibFiles

Gaudi::Property<std::vector<std::string> > InDet::InDetTrackBiasingTool::m_calibFiles {this, "calibFiles", {}, "Calibration files, one per run period."}
protected

Definition at line 103 of file InDetTrackBiasingTool.h.

103{this, "calibFiles", {}, "Calibration files, one per run period."};

◆ m_d0_nominal_histName

std::string InDet::InDetTrackBiasingTool::m_d0_nominal_histName = "d0/d0_theNominal"
protected

Definition at line 84 of file InDetTrackBiasingTool.h.

◆ m_detStore

StoreGateSvc_t AthCommonDataStore< AthCommonMsg< AlgTool > >::m_detStore
privateinherited

Pointer to StoreGate (detector store by default)

Definition at line 393 of file AthCommonDataStore.h.

◆ m_evtInfoKey

SG::ReadHandleKey<xAOD::EventInfo> InDet::InDetTrackBiasingTool::m_evtInfoKey {this, "EvtInfo", "EventInfo", "EventInfo name"}
protected

Definition at line 106 of file InDetTrackBiasingTool.h.

106{this, "EvtInfo", "EventInfo", "EventInfo name"};

◆ m_evtStore

StoreGateSvc_t AthCommonDataStore< AthCommonMsg< AlgTool > >::m_evtStore
privateinherited

Pointer to StoreGate (event store by default)

Definition at line 390 of file AthCommonDataStore.h.

◆ m_isMC

Gaudi::Property<bool> InDet::InDetTrackBiasingTool::m_isMC {this, "isMC", true}
protected

Definition at line 96 of file InDetTrackBiasingTool.h.

96{this, "isMC", true};

◆ m_runNumber

Gaudi::Property<uint32_t> InDet::InDetTrackBiasingTool::m_runNumber {this, "runNumber", 0, "Manually override the run number used to select the calibration period."}
protected

Definition at line 97 of file InDetTrackBiasingTool.h.

97{this, "runNumber", 0, "Manually override the run number used to select the calibration period."};

◆ m_runNumberBounds

Gaudi::Property<std::vector<unsigned int> > InDet::InDetTrackBiasingTool::m_runNumberBounds {this, "runNumberBounds", {}, "Run number boundaries: {lower0, upper0, upper1, ...}. May be omitted when only one calibration file is configured."}
protected

Definition at line 104 of file InDetTrackBiasingTool.h.

104{this, "runNumberBounds", {}, "Run number boundaries: {lower0, upper0, upper1, ...}. May be omitted when only one calibration file is configured."};

◆ m_sagitta_nominal_histName

std::string InDet::InDetTrackBiasingTool::m_sagitta_nominal_histName = "sagitta/sagitta_theNominal"
protected

Definition at line 86 of file InDetTrackBiasingTool.h.

◆ m_sysFilterMap

std::unordered_map< CP::SystematicSet, CP::SystematicSet > InDet::InDetTrackSystematicsTool::m_sysFilterMap
protectedinherited

Definition at line 52 of file InDetTrackSystematicsTool.h.

◆ m_varHandleArraysDeclared

bool AthCommonDataStore< AthCommonMsg< AlgTool > >::m_varHandleArraysDeclared
privateinherited

Definition at line 399 of file AthCommonDataStore.h.

◆ m_vhka

std::vector<SG::VarHandleKeyArray*> AthCommonDataStore< AthCommonMsg< AlgTool > >::m_vhka
privateinherited

Definition at line 398 of file AthCommonDataStore.h.

◆ m_z0_nominal_histName

std::string InDet::InDetTrackBiasingTool::m_z0_nominal_histName = "z0/z0_theNominal"
protected

Definition at line 85 of file InDetTrackBiasingTool.h.


The documentation for this class was generated from the following files: