27 InDetTrackBiasingTool::InDetTrackBiasingTool(
const std::string& name) :
28 InDetTrackSystematicsTool(name)
31#ifndef XAOD_STANDALONE
32 declareInterface<IInDetTrackBiasingTool>(
this);
35 declareProperty(
"biasD0", m_biasD0);
36 declareProperty(
"biasZ0", m_biasZ0);
37 declareProperty(
"biasQoverPsagitta", m_biasQoverPsagitta);
38 declareProperty(
"runNumber", m_runNumber);
39 declareProperty(
"isData", m_isData);
40 declareProperty(
"isSimulation", m_isSimulation);
42 declareProperty(
"calibFileData15", m_calibFileData15 =
"InDetTrackSystematicsTools/CalibData_22.0_2022-v00/REL22_REPRO_2015.root");
43 declareProperty(
"calibFileData16_1stPart", m_calibFileData16_1stPart =
"InDetTrackSystematicsTools/CalibData_22.0_2022-v00/REL22_REPRO_2016_1stPart.root");
44 declareProperty(
"calibFileData16_2ndPart", m_calibFileData16_2ndPart =
"InDetTrackSystematicsTools/CalibData_22.0_2022-v00/REL22_REPRO_2016_2ndPart.root");
45 declareProperty(
"calibFileData17_1stPart", m_calibFileData17_1stPart =
"InDetTrackSystematicsTools/CalibData_22.0_2022-v00/REL22_REPRO_2017_1stPart.root");
46 declareProperty(
"calibFileData17_2ndPart", m_calibFileData17_2ndPart =
"InDetTrackSystematicsTools/CalibData_22.0_2022-v00/REL22_REPRO_2017_2ndPart.root");
47 declareProperty(
"calibFileData18_1stPart", m_calibFileData18_1stPart =
"InDetTrackSystematicsTools/CalibData_22.0_2022-v00/REL22_REPRO_2018_1stPart.root");
48 declareProperty(
"calibFileData18_2stPart", m_calibFileData18_2ndPart =
"InDetTrackSystematicsTools/CalibData_22.0_2022-v00/REL22_REPRO_2018_2ndPart.root");
57 ATH_MSG_ERROR(
"Cannot manually set for both data and simulation!" );
58 return StatusCode::FAILURE;
63 <<
" mm (not part of an official recommendation)" );
67 <<
" mm (not part of an official recommendation)" );
71 <<
" TeV^-1 (not part of an official recommendation)" );
82 return StatusCode::SUCCESS;
91 [[maybe_unused]]
static const bool firstTime = [&]() {
93 throw std::runtime_error(
"Error calling InDetTrackBiasingTool::firstCall");
99 TH2* biasD0Histogram =
nullptr;
100 TH2* biasZ0Histogram =
nullptr;
101 TH2* biasQoverPsagittaHistogram =
nullptr;
102 TH2* biasD0HistError =
nullptr;
103 TH2* biasZ0HistError =
nullptr;
104 TH2* biasQoverPsagittaHistError =
nullptr;
117 runNumber = randomRunNumber(*(eventInfo));
122 if (runNumber <= 0) {
125 if (runNumber >= 286282 && runNumber <= 287931) {
126 ATH_MSG_INFO(
"Calibrating for 2015 HI and 5 TeV pp runs (286282 to 287931)." );
127 ATH_MSG_ERROR(
"The 5 TeV and heavy ion runs do not have biasing maps for release 22. "
128 "Contact the tracking CP group to discuss the derivation of these maps." );
130 }
else if (runNumber <= 364485) {
131 if (runNumber < 296939) {
138 }
else if (runNumber <= 301912) {
145 }
else if (runNumber <= 312649) {
152 }
else if (runNumber <= 334842) {
159 }
else if (runNumber <= 348197) {
166 }
else if (runNumber <= 353000) {
182 ATH_MSG_ERROR(
"Run number = " << runNumber <<
" not in recognized range (< 364485)." );
200 const float phi = track.phi0();
201 const float eta = track.eta();
205 bool d0WmActive =
isActive( TRK_BIAS_D0_WM );
214 bool z0WmActive =
isActive( TRK_BIAS_Z0_WM );
223 bool qOverPWmActive =
isActive( TRK_BIAS_QOVERP_SAGITTA_WM );
225 auto sinTheta = 1.0/cosh(
eta);
229 accQOverP( track ) += 1.e-6*sinTheta*
readHistogram(0., biasQoverPsagittaHistError,
phi,
eta);
296 return StatusCode::SUCCESS;
304 auto sc =
evtStore()->retrieve( ei,
"EventInfo" );
305 if ( !
sc.isSuccess() ) {
307 ATH_MSG_ERROR(
"Unable to retrieve from event store. Manually set data/simulation and/or run number." );
308 return StatusCode::FAILURE;
314 ATH_MSG_WARNING(
"Manually set to data setting, but the type is detected as simulation." );
321 ATH_MSG_WARNING(
"Manually set to simulation setting, but the type is detected as data." );
328 if (
m_isData)
ATH_MSG_INFO(
"Set to data. Will apply biases to correct those observed in data." );
334 ATH_MSG_WARNING(
"Set to simulation with no run number provided, but RandomRunNumber not available. Will use default run number from EventInfo, "
335 "but biasing won't accurately reflect intervals of validity throughout the year. Run PileupReweightingTool first to pick up RandomRunNumber decorations.");
337 return StatusCode::SUCCESS;
342 ATH_MSG_ERROR(
"Configuration histogram is invalid. Check the run number and systematic configuration combination.");
343 throw std::runtime_error(
"invalid configuration" );
347 if(
eta>2.499 )
eta= 2.499;
348 if(
eta<-2.499 )
eta=-2.499;
361 return TrackCorrTool_t::correctedCopy(in, out);
366 return TrackCorrTool_t::applyContainerCorrection(cont);
376 return BiasSystematics;
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)
ServiceHandle< StoreGateSvc > & evtStore()
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.
static const CP::SystematicSet BiasSystematics
@ TRK_BIAS_QOVERP_SAGITTA_WM
static const std::unordered_map< InDet::TrackSystematic, CP::SystematicVariation, std::hash< int > > TrackSystematicMap
SG::Accessor< T, ALLOC > Accessor
bool isAvailable(const ELT &e) const
Test to see if this variable exists in the store.
bool eventType(EventType type) const
Check for one particular bitmask value.
@ IS_SIMULATION
true: simulation, false: data
uint32_t runNumber() const
The current event's run number.
EventInfo_v1 EventInfo
Definition of the latest event info version.
TrackParticle_v1 TrackParticle
Reference the current persistent version:
TrackParticleContainer_v1 TrackParticleContainer
Definition of the current "TrackParticle container version".