19 InDetTrackBiasingTool::InDetTrackBiasingTool(
const std::string& name) :
23#ifndef XAOD_STANDALONE
24 declareInterface<IInDetTrackBiasingTool>(
this);
33 <<
" mm (not part of an official recommendation)" );
37 <<
" mm (not part of an official recommendation)" );
41 <<
" TeV^-1 (not part of an official recommendation)" );
54 return StatusCode::SUCCESS;
63 ATH_MSG_ERROR(
"applySystematicVariation() was not called before applyCorrection()." );
81 ATH_MSG_ERROR(
"InDetTrackBiasingTool should only be run on MC." );
87 static const SG::AuxElement::Accessor<unsigned int> randomRunNumber(
"RandomRunNumber");
88 auto runNumber = randomRunNumber(*eventInfo);
94 if (runNumber >= 286282 && runNumber <= 287931) {
95 ATH_MSG_ERROR(
"The 5 TeV and heavy ion runs do not have biasing maps for release 22. "
96 "Contact the tracking CP group to discuss the derivation of these maps." );
113 ATH_MSG_ERROR(
"Run number = " << runNumber <<
" does not fall within any configured calibration period." );
131 static const SG::AuxElement::Accessor< float > accD0(
"d0" );
132 static const SG::AuxElement::Accessor< float > accZ0(
"z0" );
133 static const SG::AuxElement::Accessor< float > accQOverP(
"qOverP" );
135 const float phi = track.phi0();
136 const float eta = track.eta();
142 accD0( track ) += d0Corr;
143 if (
isActive( TRK_BIAS_D0_WM, filtered ) ) {
144 accD0( track ) -= d0Corr;
149 accZ0( track ) += z0Corr;
150 if (
isActive( TRK_BIAS_Z0_WM, filtered ) ) {
151 accZ0( track ) -= z0Corr;
154 if ( doQoverPBias ) {
155 auto sinTheta = 1.0 / std::cosh(
eta);
157 accQOverP( track ) += qOverPCorr;
158 if (
isActive( TRK_BIAS_QOVERP_SAGITTA_WM, filtered ) ) {
159 accQOverP( track ) -= qOverPCorr;
170 ATH_MSG_ERROR(
"No calibration files configured. Set 'calibFiles' and (for multiple periods) "
171 "'runNumberBounds' for the relevant MC campaign via the python configuration." );
172 return StatusCode::FAILURE;
176 "calibFiles.size() + 1 = " << (
m_calibFiles.size() + 1) <<
" entries." );
177 return StatusCode::FAILURE;
180 ATH_MSG_ERROR(
"'runNumberBounds' must be set when multiple calibration files are configured." );
181 return StatusCode::FAILURE;
186 ATH_MSG_INFO(
"Calibration period 0 (all run numbers): file: "
189 ATH_MSG_INFO(
"Calibration period " << i <<
": run range ["
201 return StatusCode::SUCCESS;
206 ATH_MSG_ERROR(
"Configuration histogram is invalid. Check the run number and systematic configuration combination.");
207 throw std::runtime_error(
"invalid configuration" );
211 if(
eta>2.499 )
eta= 2.499;
212 if(
eta<-2.499 )
eta=-2.499;
223 return TrackCorrTool_t::correctedCopy(in, out);
228 return TrackCorrTool_t::applyContainerCorrection(cont);
239 if (
m_applyD0Bias) result.insert(InDet::TrackSystematicMap.at(TRK_BIAS_D0_WM));
240 if (
m_applyZ0Bias) result.insert(InDet::TrackSystematicMap.at(TRK_BIAS_Z0_WM));
241 if (
m_applyQoverPBias) result.insert(InDet::TrackSystematicMap.at(TRK_BIAS_QOVERP_SAGITTA_WM));
Scalar eta() const
pseudorapidity method
Scalar phi() const
phi method
#define ATH_CHECK
Evaluate an expression and check for errors.
#define ATH_MSG_WARNING(x)
std::string PathResolverFindCalibFile(const std::string &logical_file_name)
Return value from object correction CP tools.
@ Error
Some error happened during the object correction.
@ Ok
The correction was done successfully.
Class to wrap a set of SystematicVariations.
TrackParticle_v1 TrackParticle
Reference the current persistent version:
TrackParticleContainer_v1 TrackParticleContainer
Definition of the current "TrackParticle container version".