ATLAS Offline Software
JetCalibrationTool.cxx
Go to the documentation of this file.
1 
3 /*
4  Copyright (C) 2002-2025 CERN for the benefit of the ATLAS collaboration
5 */
6 
7 // JetCalibrationTool.cxx
8 // Implementation file for class JetCalibrationTool
9 // Author: Joe Taenzer <joseph.taenzer@cern.ch>
11 
27 
30 
32  : asg::AsgMetadataTool( name )
33 {
34  declareProperty( "JetCollection", m_jetAlgo = "AntiKt4LCTopo" );
35  declareProperty( "ConfigFile", m_config = "" );
36  declareProperty( "CalibSequence", m_calibSeq = "JetArea_Offset_AbsoluteEtaJES_Insitu" );
37  declareProperty( "IsData", m_isData = true );
38  declareProperty( "ForceCampaign", m_forceCampaign = "");
39  declareProperty( "ConfigDir", m_dir = "JetCalibTools/CalibrationConfigs/" );
40  declareProperty( "EventInfoName", m_eInfoName = "EventInfo");
41  declareProperty( "DEVmode", m_devMode = false);
42  declareProperty( "OriginScale", m_originScale = "JetOriginConstitScaleMomentum");
43  declareProperty( "CalibArea", m_calibAreaTag = "00-04-82");
44  declareProperty( "GSCDepth", m_gscDepth);
45  declareProperty( "useOriginVertex", m_useOriginVertex = false);
46  // Options to force files for metadata-dependent calibration in case metadata is not available
47  declareProperty( "ForceCalibFilePtResidual", m_forceCalibFile_PtResidual = "");
48  declareProperty( "ForceCalibFileFastSim", m_forceCalibFile_FastSim = "");
49  declareProperty( "ForceCalibFileMC2MC", m_forceCalibFile_MC2MC = "");
50 }
51 
53  if(m_globalConfig) delete m_globalConfig;
54  for(TEnv* config : m_globalTimeDependentConfigs) delete config;
55  for(TEnv* config : m_globalInsituCombMassConfig) delete config;
56 }
57 
58 
60 // Public methods:
62 
64  ATH_MSG_INFO ("Initializing " << name() << " to calibrate " << m_jetAlgo << " jets. ");
65 
66  TString jetAlgo = m_jetAlgo;
67  TString calibSeq = m_calibSeq;
68  std::string dir = m_dir;
69 
70  //Make sure the necessary properties were set via the constructor or python configuration
71  if ( jetAlgo.EqualTo("") || calibSeq.EqualTo("") ) {
72  ATH_MSG_FATAL("JetCalibrationTool::initialize : At least one of your constructor arguments is not set. Did you use the copy constructor?");
73  return StatusCode::FAILURE;
74  }
75 
76  if ( m_config.empty() ) { ATH_MSG_FATAL("No configuration file specified."); return StatusCode::FAILURE; }
77  // The calibration area tag is a property of the tool
78  const std::string calibPath = "CalibArea-" + m_calibAreaTag + "/";
79  if(m_devMode){
80  ATH_MSG_WARNING("Dev Mode is ON!!!");
81  ATH_MSG_WARNING("Dev Mode is NOT RECOMMENDED!!!");
82  dir = "JetCalibTools/";
83  }
84  else{dir.insert(14,calibPath);} // Obtaining the path of the configuration file
85  std::string configPath=dir+m_config; // Full path
86  TString fn = PathResolverFindCalibFile(configPath);
87  if(fn=="") {
88  ATH_MSG_FATAL( "Couldn't find ConfigFile " << configPath ); return StatusCode::FAILURE;
89  } else {
90  ATH_MSG_INFO("Reading global JES settings from: " << configPath);
91  ATH_MSG_INFO("resolved in: " << fn);
92  }
93 
94  m_globalConfig = new TEnv();
95  int status=m_globalConfig->ReadFile(fn ,EEnvLevel(0));
96  if (status!=0) { ATH_MSG_FATAL("Cannot read config file " << fn ); return StatusCode::FAILURE; }
97 
98  //Make sure that one of the standard jet collections is being used
99  if ( calibSeq.Contains("JetArea") ) {
100  if ( jetAlgo.Contains("PFlow") ) m_jetScale = PFLOW;
101  else if ( jetAlgo.Contains("EM") ) m_jetScale = EM;
102  else if ( jetAlgo.Contains("LC") ) m_jetScale = LC;
103  else { ATH_MSG_FATAL("jetAlgo " << jetAlgo << " not recognized."); return StatusCode::FAILURE; }
104  }
105 
106  // Settings for R21/2.5.X
107  m_originCorrectedClusters = m_globalConfig->GetValue("OriginCorrectedClusters",false);
108  m_doSetDetectorEta = m_globalConfig->GetValue("SetDetectorEta",true);
109 
110  // Rho key specified in the config file?
111  std::string rhoKey_config = m_globalConfig->GetValue("RhoKey", "None");
112 
113  bool requireRhoInput = false;
114 
115  //Make sure the residual correction is turned on if requested
116  if ( !calibSeq.Contains("JetArea") && !calibSeq.Contains("Residual") ) {
117  m_doJetArea = false;
118  m_doResidual = false;
119  } else if ( calibSeq.Contains("JetArea") ) {
120  if ( m_rhoKey.key().compare("auto") == 0 && rhoKey_config.compare("None") == 0) {
122  if ( m_jetScale == EM ) m_rhoKey = "Kt4EMTopoEventShape";
123  else if ( m_jetScale == LC ) m_rhoKey = "Kt4LCTopoEventShape";
124  else if ( m_jetScale == PFLOW ) m_rhoKey = "Kt4EMPFlowEventShape";
125  } else{
126  if ( m_jetScale == EM ) m_rhoKey = "Kt4EMTopoOriginEventShape";
127  else if ( m_jetScale == LC ) m_rhoKey = "Kt4LCTopoOriginEventShape";
128  else if ( m_jetScale == PFLOW ) m_rhoKey = "Kt4EMPFlowEventShape";
129  }
130  }
131  else if(rhoKey_config.compare("None") != 0 && m_rhoKey.key().compare("auto") == 0){
132  m_rhoKey = rhoKey_config;
133  }
134  requireRhoInput = true;
135  if ( !calibSeq.Contains("Residual") ) m_doResidual = false;
136  } else if ( !calibSeq.Contains("JetArea") && calibSeq.Contains("Residual") ) {
137  m_doJetArea = false;
138  ATH_MSG_INFO("ApplyOnlyResidual should be true if only Residual pile up correction wants to be applied. Need to specify pile up starting scale in the configuration file.");
139  }
140  // get nJet threshold and name
141  m_useNjetInResidual = m_globalConfig->GetValue("OffsetCorrection.UseNjet", false);
142  m_nJetThreshold = m_globalConfig->GetValue("OffsetCorrection.nJetThreshold", 20);
143  m_nJetContainerName = m_globalConfig->GetValue("OffsetCorrection.nJetContainerName",
144  "HLT_xAOD__JetContainer_a4tcemsubjesISFS");
145 
146  if ( !calibSeq.Contains("Origin") ) m_doOrigin = false;
147  if ( !calibSeq.Contains("GSC") && !calibSeq.Contains("GNNC")) m_doGSC = false;
148  if ( !calibSeq.Contains("Bcid") ) m_doBcid = false;
149  if ( calibSeq.Contains("DNN") ) m_doDNNCal = true;
150 
151  //Protect against the in-situ calibration being requested when isData is false
152  if ( calibSeq.Contains("Insitu") && !m_isData ) {
153  ATH_MSG_FATAL("JetCalibrationTool::initialize : calibSeq string contains Insitu with isData set to false. Can't apply in-situ correction to MC!!");
154  return StatusCode::FAILURE;
155  }
156 
157  // Time-Dependent Insitu Calibration
158  m_timeDependentCalib = m_globalConfig->GetValue("TimeDependentInsituCalibration",false);
159  if(m_timeDependentCalib && calibSeq.Contains("Insitu")){ // Read Insitu Configs
160  m_timeDependentInsituConfigs = JetCalibUtils::Vectorize( m_globalConfig->GetValue("InsituTimeDependentConfigs","") );
161  if(m_timeDependentInsituConfigs.empty()) ATH_MSG_ERROR("Please check there are at least two insitu configs");
162  m_runBins = JetCalibUtils::VectorizeD( m_globalConfig->GetValue("InsituRunBins","") );
163  if(m_runBins.size()!=m_timeDependentInsituConfigs.size()+1) ATH_MSG_ERROR("Please check the insitu run bins");
164  for(unsigned int i=0;i<m_timeDependentInsituConfigs.size();++i){
165 
166  std::string configPath_insitu = dir+m_timeDependentInsituConfigs.at(i).Data(); // Full path
167  TString fn_insitu = PathResolverFindCalibFile(configPath_insitu);
168 
169  ATH_MSG_INFO("Reading time-dependent insitu settings from: " << m_timeDependentInsituConfigs.at(i));
170  ATH_MSG_INFO("resolved in: " << fn_insitu);
171 
172  TEnv *globalConfig_insitu = new TEnv();
173  int status = globalConfig_insitu->ReadFile(fn_insitu ,EEnvLevel(0));
174  if (status!=0) { ATH_MSG_FATAL("Cannot read config file " << fn_insitu ); return StatusCode::FAILURE; }
175  m_globalTimeDependentConfigs.push_back(globalConfig_insitu);
176  }
177  }
178 
179  //Combined Mass Calibration:
180  m_insituCombMassCalib = m_globalConfig->GetValue("InsituCombinedMassCorrection",false);
181  if(m_insituCombMassCalib && calibSeq.Contains("InsituCombinedMass")){ // Read Combination Config
182  m_insituCombMassConfig = JetCalibUtils::Vectorize( m_globalConfig->GetValue("InsituCombinedMassCorrectionFile","") );
183  if(m_insituCombMassConfig.empty()) ATH_MSG_ERROR("Please check there is a combination config");
184  for(unsigned int i=0;i<m_insituCombMassConfig.size();++i){
185 
186  std::string configPath_comb = dir+m_insituCombMassConfig.at(i).Data(); // Full path
187  TString fn_comb = PathResolverFindCalibFile(configPath_comb);
188 
189  ATH_MSG_INFO("Reading combination settings from: " << m_insituCombMassConfig.at(i));
190  ATH_MSG_INFO("resolved in: " << fn_comb);
191 
192  TEnv *globalInsituCombMass = new TEnv();
193  int status = globalInsituCombMass->ReadFile(fn_comb ,EEnvLevel(0));
194  if (status!=0) { ATH_MSG_FATAL("Cannot read config file " << fn_comb ); return StatusCode::FAILURE; }
195  m_globalInsituCombMassConfig.push_back(globalInsituCombMass);
196  }
197  }
198 
199  //Loop over the request calib sequence
200  //Initialize derived classes for applying the requested calibrations and add them to a vector
201  std::vector<TString> vecCalibSeq = JetCalibUtils::Vectorize(calibSeq,"_");
202  for ( unsigned int i=0; i<vecCalibSeq.size(); ++i) {
203  if ( vecCalibSeq[i].EqualTo("Origin") || vecCalibSeq[i].EqualTo("DEV") ) continue;
204  if ( vecCalibSeq[i].EqualTo("Residual") && m_doJetArea ) continue;
205  ATH_CHECK( getCalibClass(vecCalibSeq[i] ));
206  }
207 
208  // Initialise ReadHandle(s)
210  ATH_CHECK( m_muKey.initialize() );
211  ATH_CHECK( m_actualMuKey.initialize() );
212  ATH_CHECK( m_rhoKey.initialize(requireRhoInput) );
213  if(m_pvKey.empty()) {
214  // No PV key: -- check if it is required
215  if(m_doResidual) {
216  // May require modification in case of residual that does not require NPV
217  ATH_MSG_ERROR("Residual calibration requested but no primary vertex container specified!");
218  return StatusCode::FAILURE;
219  }
220  else if(m_doGSC) {
221  if(m_jetAlgo.find("PFlow")!=std::string::npos) {
222  ATH_MSG_ERROR("GSC calibration for PFlow requested but no primary vertex container specified!");
223  return StatusCode::FAILURE;
224  }
225  else if((m_gscDepth!="Tile0" && m_gscDepth!="EM3")) {
226  ATH_MSG_ERROR("GSC calibration with tracks requested but no primary vertex container specified!");
227  return StatusCode::FAILURE;
228  }
229  }
230  } else {
231  // Received a PV key, declare the data dependency
232  ATH_CHECK( m_pvKey.initialize() );
233  }
234 
235  return StatusCode::SUCCESS;
236 }
237 
238 //Method for initializing the requested calibration derived classes
239 StatusCode JetCalibrationTool::getCalibClass(const TString& calibration) {
240  TString jetAlgo = m_jetAlgo;
241  const TString calibPath = "CalibArea-" + m_calibAreaTag + "/";
242 
243  // Metadata needed to configure some corrections
244  TString generatorsInfo{};
245  TString simFlavour{};
246  float mcDSID{-1.0};
247  TString mcCampaign{};
248  if ( inputMetaStore()->contains<xAOD::FileMetaData>("FileMetaData") ) {
249  const xAOD::FileMetaData *fmd = nullptr;
250  ATH_CHECK(inputMetaStore()->retrieve(fmd,"FileMetaData") );
251 
252  if(m_isData){
253  UInt_t dataYear = 0;
254  fmd->value(xAOD::FileMetaData::dataYear, dataYear);
255  if (dataYear >= 2015 && dataYear <= 2018) {
256  mcCampaign = "MC20";
257  } else if (dataYear >= 2022 && dataYear <= 2024) {
258  mcCampaign = "MC23";
259  } else {
260  ATH_MSG_WARNING("Data year " << dataYear << " not recognized from file metadata. The corresponding mcCampaign will not be known.");
261  }
262 
263  } else { // is MC
264  std::string str_generatorsInfo;
265  fmd->value(xAOD::FileMetaData::generatorsInfo, str_generatorsInfo);
266  generatorsInfo = str_generatorsInfo;
267 
268  std::string str_simFlavour;
269  fmd->value(xAOD::FileMetaData::simFlavour, str_simFlavour);
270  simFlavour = str_simFlavour;
271 
272  fmd->value(xAOD::FileMetaData::mcProcID, mcDSID);
273 
274  std::string str_mcCampaign;
275  fmd->value(xAOD::FileMetaData::mcCampaign, str_mcCampaign);
276  str_mcCampaign.resize(4); //Only keep top-level of campaign (e.g. mc20 or mc23)
277  mcCampaign = str_mcCampaign;
278  mcCampaign.ToUpper();
279 
280  ATH_MSG_INFO("Have loaded metadata mcDSID:" << mcDSID << ", generatorsInfo: " << generatorsInfo << ", mcCampaign: " << mcCampaign << ", simFlavour: " << simFlavour);
281  }
282  }
283  // Force the MCCamapign (or data equivalent) for missing Metadata or tests
284  if( m_forceCampaign != "" ){
286  }
287 
288  if ( calibration.EqualTo("Bcid") ){
289  m_globalConfig->SetValue("PileupStartingScale","JetBcidScaleMomentum");
290  std::unique_ptr<JetCalibrationStep> bcidCorr = std::make_unique<BcidOffsetCorrection>(this->name()+"_Bcid", m_globalConfig, jetAlgo, calibPath, m_isData);
291  ATH_CHECK(bcidCorr->initialize());
292  m_calibSteps.push_back(std::move(bcidCorr));
293  return StatusCode::SUCCESS;
294  }
295  else if ( calibration.EqualTo("JetArea") || calibration.EqualTo("Residual") ) {
296  std::unique_ptr<JetCalibrationStep> puCorr = std::make_unique<JetPileupCorrection>(this->name()+"_Pileup", m_globalConfig, jetAlgo, calibPath,
298  puCorr->msg().setLevel( this->msg().level() );
299  ATH_CHECK(puCorr->initialize());
300  m_calibSteps.push_back(std::move(puCorr));
301  return StatusCode::SUCCESS;
302  }
303  else if ( calibration.EqualTo("EtaJES") || calibration.EqualTo("AbsoluteEtaJES") ) {
304  std::unique_ptr<JetCalibrationStep> etaJESCorr = std::make_unique<EtaJESCorrection>(this->name()+"_EtaJES", m_globalConfig, jetAlgo, calibPath, false, m_devMode);
305  etaJESCorr->msg().setLevel( this->msg().level() );
306  ATH_CHECK(etaJESCorr->initialize());
307  m_calibSteps.push_back(std::move(etaJESCorr));
308  return StatusCode::SUCCESS;
309  }
310  else if ( calibration.EqualTo("EtaMassJES") ) {
311  std::unique_ptr<JetCalibrationStep> etaJESCorr = std::make_unique<EtaJESCorrection>(this->name()+"_EtaMassJES", m_globalConfig, jetAlgo, calibPath, true, m_devMode);
312  etaJESCorr->msg().setLevel( this->msg().level() );
313  ATH_CHECK(etaJESCorr->initialize());
314  m_calibSteps.push_back(std::move(etaJESCorr));
315  return StatusCode::SUCCESS;
316  }
317  else if ( calibration.EqualTo("GSC") ) {
318  std::unique_ptr<JetCalibrationStep> gsc = std::make_unique<GlobalSequentialCorrection>(this->name()+"_GSC", m_globalConfig, jetAlgo, m_gscDepth, calibPath, m_useOriginVertex, m_devMode);
319  gsc->msg().setLevel( this->msg().level() );
320  ATH_CHECK(gsc->initialize());
321  m_calibSteps.push_back(std::move(gsc));
322 
323  // Set devMode paths for the following corrections
324  TString actualCalibPath;
325  if(m_devMode){
326  actualCalibPath = "JetCalibTools/";
327  } else {
328  actualCalibPath = "JetCalibTool/CalibArea-" + m_calibAreaTag + "/";
329  }
330  // Additional FastSim and PtResidual patches happen after GSC
331  bool do_FastSim = m_globalConfig->GetValue("JPS_FastSim.doCalibration", false) || (m_forceCalibFile_FastSim != "");
332  if(m_isData and do_FastSim){
333  ATH_MSG_WARNING("JPS_FastSim.doCalibration is set in JetCalibrationTool config but isData is set to true. Will turn off FastSim calibration.");
334  do_FastSim = false;
335  }
336  if(do_FastSim){
337  if ( (m_forceCalibFile_FastSim == "") && !inputMetaStore()->contains<xAOD::FileMetaData>("FileMetaData") ) {
338  ATH_MSG_FATAL("JPS_FastSim.doCalibration is set in JetCalibrationTool config but file has no FileMetaData. Please fix the sample or configuration.");
339  return StatusCode::FAILURE;
340  }
341  std::unique_ptr<JetCalibrationStep> JPS_FastSim = std::make_unique<Generic4VecCorrection>(this->name()+"_FastSim", m_globalConfig, jetAlgo, actualCalibPath, m_forceCalibFile_FastSim, Generic4VecCorrection::JET_CORRTYPE::FASTSIM, mcCampaign, simFlavour);
342  JPS_FastSim->msg().setLevel( this->msg().level() );
343  ATH_CHECK(JPS_FastSim->initialize());
344  m_calibSteps.push_back(std::move(JPS_FastSim));
345  }
346  bool do_PtResidual = m_globalConfig->GetValue("JPS_PtResidual.doCalibration", false) || (m_forceCalibFile_PtResidual != "");
347  if(do_PtResidual){
348  std::unique_ptr<JetCalibrationStep> JPS_PtResidual = std::make_unique<Generic4VecCorrection>(this->name()+"_PtResidual", m_globalConfig, jetAlgo, actualCalibPath, m_forceCalibFile_PtResidual, Generic4VecCorrection::JET_CORRTYPE::PTRESIDUAL, mcCampaign);
349  JPS_PtResidual->msg().setLevel( this->msg().level() );
350  ATH_CHECK(JPS_PtResidual->initialize());
351  m_calibSteps.push_back(std::move(JPS_PtResidual));
352  }
353  return StatusCode::SUCCESS;
354  }
355  else if ( calibration.EqualTo("GNNC") ) {
356  std::unique_ptr<JetCalibrationStep> gnnc = std::make_unique<GlobalNNCalibration>(this->name()+"_GNNC",m_globalConfig,jetAlgo,calibPath,m_devMode);
357  gnnc->msg().setLevel( this->msg().level() );
358  ATH_CHECK(gnnc->initialize());
359  m_calibSteps.push_back(std::move(gnnc));
360  return StatusCode::SUCCESS;
361  }
362  else if ( calibration.EqualTo("MC2MC") ) {
363  // Set devMode paths for this correction
364  TString actualCalibPath;
365  if(m_devMode){
366  actualCalibPath = "JetCalibTools/";
367  } else {
368  actualCalibPath = "JetCalibTool/CalibArea-" + m_calibAreaTag + "/";
369  }
370  if ( !inputMetaStore()->contains<xAOD::FileMetaData>("FileMetaData") && (m_forceCalibFile_MC2MC == "") ) {
371  ATH_MSG_FATAL("MC2MC step of jet calibration is requested but file has no FileMetaData. Please fix the sample or configuration.");
372  return StatusCode::FAILURE;
373  }
374  std::unique_ptr<JetCalibrationStep> JPS_MC2MC = std::make_unique<Generic4VecCorrection>(this->name()+"_MC2MC", m_globalConfig, jetAlgo, actualCalibPath, m_forceCalibFile_MC2MC, Generic4VecCorrection::JET_CORRTYPE::MC2MC, mcCampaign, simFlavour, (int) mcDSID, generatorsInfo);
375  JPS_MC2MC->msg().setLevel( this->msg().level() );
376  ATH_CHECK(JPS_MC2MC->initialize());
377  m_calibSteps.push_back(std::move(JPS_MC2MC));
378  return StatusCode::SUCCESS;
379  }
380  else if ( calibration.EqualTo("JMS") ) {
381  std::unique_ptr<JetCalibrationStep> jetMassCorr = std::make_unique<JMSCorrection>(this->name()+"_JMS", m_globalConfig, jetAlgo, calibPath, m_devMode);
382  jetMassCorr->msg().setLevel( this->msg().level() );
383  ATH_CHECK(jetMassCorr->initialize());
384  m_calibSteps.push_back(std::move(jetMassCorr));
385  return StatusCode::SUCCESS;
386  }
387  else if ( calibration.EqualTo("InsituCombinedMass") ){
388  for(unsigned int i=0;i<m_insituCombMassConfig.size();++i){
389  std::unique_ptr<JetCalibrationStep> jetMassCorr = std::make_unique<JMSCorrection>(this->name()+"_InsituCombinedMass", m_globalInsituCombMassConfig.at(i), jetAlgo, calibPath, m_devMode);
390  jetMassCorr->msg().setLevel( this->msg().level() );
391  ATH_CHECK(jetMassCorr->initialize());
392  m_calibSteps.push_back(std::move(jetMassCorr));
393  }
394  return StatusCode::SUCCESS;
395  }
396  else if ( calibration.EqualTo("Insitu") ) {
398  std::unique_ptr<JetCalibrationStep> insituDataCorr = std::make_unique<InsituDataCorrection>(this->name()+"_Insitu", m_globalConfig, jetAlgo, calibPath, m_devMode);
399  insituDataCorr->msg().setLevel( this->msg().level() );
400  ATH_CHECK(insituDataCorr->initialize());
401  m_calibSteps.push_back(std::move(insituDataCorr));
402  return StatusCode::SUCCESS;
403  }
404  else{
405  ATH_MSG_INFO("Initializing Time-Dependent Insitu Corrections");
406  for(unsigned int i=0;i<m_timeDependentInsituConfigs.size();++i){
407  // Add 0.5 before casting to avoid floating-point precision issues
408  unsigned int firstRun = static_cast<unsigned int>(m_runBins.at(i)+1.5);
409  unsigned int lastRun = static_cast<unsigned int>(m_runBins.at(i+1)+0.5);
410  std::unique_ptr<JetCalibrationStep> insituDataCorr = std::make_unique<InsituDataCorrection>(this->name()+"_Insitu_"+std::to_string(i), m_globalTimeDependentConfigs.at(i), jetAlgo,
411  calibPath, m_devMode, firstRun, lastRun);
412  insituDataCorr->msg().setLevel( this->msg().level() );
413  ATH_CHECK(insituDataCorr->initialize());
414  m_calibSteps.push_back(std::move(insituDataCorr));
415  }
416  return StatusCode::SUCCESS;
417  }
418  }
419  else if ( calibration.EqualTo("Smear") ) {
420  if(m_isData){
421  ATH_MSG_FATAL("Asked for smearing of data, which is not supported. Aborting.");
422  return StatusCode::FAILURE;
423  }
424  std::unique_ptr<JetCalibrationStep> jetSmearCorr = std::make_unique<JetSmearingCorrection>(this->name()+"_Smear", m_globalConfig,jetAlgo,calibPath,m_devMode);
425  jetSmearCorr->msg().setLevel(this->msg().level());
426  ATH_CHECK(jetSmearCorr->initialize());
427  m_calibSteps.push_back(std::move(jetSmearCorr));
428  m_smearIndex = m_calibSteps.size() - 1;
429  return StatusCode::SUCCESS;
430  }
431  else if ( calibration.EqualTo("LargeRDNN") ) {
432  std::unique_ptr<JetCalibrationStep> largeR_dnn = std::make_unique<GlobalLargeRDNNCalibration>(this->name()+"_R10DNN", m_globalConfig,calibPath,m_devMode);
433  largeR_dnn->msg().setLevel(this->msg().level());
434  ATH_CHECK(largeR_dnn->initialize());
435  m_calibSteps.push_back(std::move(largeR_dnn));
436  return StatusCode::SUCCESS;
437  }
438  ATH_MSG_FATAL("Calibration string not recognized: " << calibration << ", aborting.");
439  return StatusCode::FAILURE;
440 }
441 
443  //Grab necessary event info for pile up correction and store it in a JetEventInfo class object
444  ATH_MSG_VERBOSE("Modifying jet collection.");
445  JetEventInfo jetEventInfo;
446  ATH_CHECK( initializeEvent(jetEventInfo) );
447  for (xAOD::Jet* jet : jets) ATH_CHECK( calibrate(*jet, jetEventInfo) );
448  return StatusCode::SUCCESS;
449 }
450 
451 // Private/Protected Methods
453 
455 
456  // Check if the tool was initialized
457  if( m_calibSteps.empty() ){
458  ATH_MSG_FATAL(" JetCalibrationTool::initializeEvent : The tool was not initialized.");
459  return StatusCode::FAILURE;
460  }
461 
462  // static accessor for PV index access
463  static const SG::AuxElement::ConstAccessor<int> PVIndexAccessor("PVIndex");
464 
465  ATH_MSG_VERBOSE("Initializing event.");
466 
467  if( m_doJetArea ) {
468  //Determine the rho value to use for the jet area subtraction
469  //Should be determined using EventShape object, use hard coded values if EventShape doesn't exist
470  double rho=0;
471  const xAOD::EventShape * eventShape = nullptr;
472 
474 
475  if ( rhRhoKey.isValid() ) {
476  ATH_MSG_VERBOSE(" Found event density container " << m_rhoKey.key());
477  eventShape = rhRhoKey.cptr();
478  if ( !rhRhoKey.isValid() ) {
479  ATH_MSG_VERBOSE(" Event shape container not found.");
480  ATH_MSG_FATAL("Could not retrieve the xAOD::EventShape container " << m_rhoKey.key() << " from the input file");
481  return StatusCode::FAILURE;
482  } else if ( !eventShape->getDensity( xAOD::EventShape::Density, rho ) ) {
483  ATH_MSG_VERBOSE(" Event density not found in container.");
484  ATH_MSG_FATAL("Could not retrieve the xAOD::EventShape::Density variable from " << m_rhoKey.key());
485  return StatusCode::FAILURE;
486  } else {
487  ATH_MSG_VERBOSE(" Event density retrieved.");
488  }
489  } else if ( m_doJetArea && !rhRhoKey.isValid() ) {
490  ATH_MSG_VERBOSE(" Rho container not found: " << m_rhoKey.key());
491  ATH_MSG_FATAL("Could not retrieve xAOD::EventShape container " << m_rhoKey.key() << " from the input file");
492  return StatusCode::FAILURE;
493  }
494  jetEventInfo.setRho(rho);
495  ATH_MSG_VERBOSE(" Rho = " << 0.001*rho << " GeV");
496 
497  // Necessary retrieval and calculation for use of nJetX instead of NPV
498  if(m_useNjetInResidual) {
499  // retrieve the container
500  const xAOD::JetContainer * jets = nullptr;
501  if (evtStore()->contains<xAOD::JetContainer>(m_nJetContainerName) ) {
502  ATH_MSG_VERBOSE(" Found jet container " << m_nJetContainerName);
503  if ( evtStore()->retrieve(jets, m_nJetContainerName).isFailure() || !jets ) {
504  ATH_MSG_FATAL("Could not retrieve xAOD::JetContainer " << m_nJetContainerName << " from evtStore");
505  return StatusCode::FAILURE;
506  }
507  } else {
508  ATH_MSG_FATAL("Could not find jet container " << m_nJetContainerName << " in the evtStore");
509  return StatusCode::FAILURE;
510  }
511 
512  // count jets above threshold
513  int nJets = 0;
514  for (const auto *jet : *jets) {
515  if(jet->pt()/1000. > m_nJetThreshold)
516  nJets += 1;
517  }
518  jetEventInfo.setNjet(nJets);
519  }
520  }
521 
522  // Retrieve EventInfo object, which now has multiple uses
524  const xAOD::EventInfo * eventObj = nullptr;
525  static std::atomic<unsigned int> eventInfoWarnings = 0;
527  if ( rhEvtInfo.isValid() ) {
528  eventObj = rhEvtInfo.cptr();
529  } else {
530  ++eventInfoWarnings;
531  if ( eventInfoWarnings < 20 )
532  ATH_MSG_ERROR(" JetCalibrationTool::initializeEvent : Failed to retrieve event information.");
533  jetEventInfo.setMu(0); //Hard coded value mu = 0 in case of failure (to prevent seg faults later).
534  jetEventInfo.setPVIndex(0);
535  return StatusCode::SUCCESS; //error is recoverable, so return SUCCESS
536  }
537  jetEventInfo.setRunNumber( eventObj->runNumber() );
538 
539  // If we are applying the reisdual, then store mu
540  if (m_doResidual || m_doBcid) {
542  if(!eventInfoDecor.isPresent()) {
543  ATH_MSG_ERROR("EventInfo decoration not available!");
544  return StatusCode::FAILURE;
545  }
546  jetEventInfo.setMu( eventInfoDecor(0) );
547  }
548 
549  // If this is GSC, we need EventInfo to determine the PV to use
550  // This is support for groups where PV0 is not the vertex of interest (H->gamgam, etc)
551  if (m_doGSC)
552  {
553  // First retrieve the PVIndex if specified
554  // Default is to not specify this, so no warning if it doesn't exist
555  // However, if specified, it should be a sane value - fail if not
556  if ( m_doGSC && PVIndexAccessor.isAvailable(*eventObj) )
557  jetEventInfo.setPVIndex( PVIndexAccessor(*eventObj) );
558  else{
559  if(!m_pvKey.empty()){
560  const xAOD::VertexContainer * vertices = nullptr;
562  if (rhPV.isValid()) {
563  vertices = rhPV.cptr();
564  xAOD::VertexContainer::const_iterator vtx_itr = vertices->begin();
565  xAOD::VertexContainer::const_iterator vtx_end = vertices->end();
566  for ( ; vtx_itr != vtx_end; ++vtx_itr ){
567  if ( (*vtx_itr)->vertexType() == xAOD::VxType::PriVtx ){
568  jetEventInfo.setPVIndex((*vtx_itr)->index());
569  break;
570  }
571  }
572  }
573  else{
574  jetEventInfo.setPVIndex(0);
575  }
576  }
577  else{
578  jetEventInfo.setPVIndex(0);
579  }
580  }
581  }
582 
583  // Extract the BCID information for the BCID correction
584  if (m_doBcid)
585  {
586  static const SG::ConstAccessor<int> BCIDDistanceFromFrontAcc ("DFCommonJets_BCIDDistanceFromFront");
587  static const SG::ConstAccessor<int> BCIDGapBeforeTrainAcc ("DFCommonJets_BCIDGapBeforeTrain");
588  static const SG::ConstAccessor<int> BCIDGapBeforeTrainMinus12Acc ("DFCommonJets_BCIDGapBeforeTrainMinus12");
589 
590  jetEventInfo.setBcidDistanceFromFront( BCIDDistanceFromFrontAcc (*eventObj) );
591  jetEventInfo.setBcidGapBeforeTrain( BCIDGapBeforeTrainAcc (*eventObj) );
592  jetEventInfo.setBcidGapBeforeTrainMinus12( BCIDGapBeforeTrainMinus12Acc (*eventObj) );
593  }
594 
595  // If PV index is not zero, we need to confirm it's a reasonable value
596  // To do this, we need the primary vertices
597  // However, other users of the GSC may not have the PV collection (in particular: trigger GSC in 2016)
598  // So only retrieve vertices if needed for NPV (residual) or a non-zero PV index was specified (GSC)
599  if ((m_doResidual && !m_useNjetInResidual) || (m_doGSC && jetEventInfo.PVIndex()))
600  {
601  //Retrieve VertexContainer object, use it to obtain NPV for the residual correction or check validity of GSC non-PV0 usage
602  const xAOD::VertexContainer * vertices = nullptr;
603 
605  if (rhPV.isValid()) {
606  vertices = rhPV.cptr();
607  } else {
608  ATH_MSG_WARNING(" JetCalibrationTool::initializeEvent : Failed to retrieve primary vertices.");
609  jetEventInfo.setNPV(0); //Hard coded value NPV = 0 in case of failure (to prevent seg faults later).
610  return StatusCode::SUCCESS; //error is recoverable, so return SUCCESS
611  }
612 
613  // Calculate and set NPV if this is residual
614  if (m_doResidual)
615  {
616  int eventNPV = 0;
617  eventNPV = std::count_if(vertices->begin(), vertices->end(), [](const xAOD::Vertex* vtx){ return vtx->vertexType() == xAOD::VxType::PileUp || vtx->vertexType() == xAOD::VxType::PriVtx;});
618  jetEventInfo.setNPV(eventNPV);
619  }
620 
621  // Validate value of non-standard PV index usage
622  if (m_doGSC && jetEventInfo.PVIndex())
623  {
624  static std::atomic<unsigned int> vertexIndexWarnings = 0;
625  if (jetEventInfo.PVIndex() < 0 || static_cast<size_t>(jetEventInfo.PVIndex()) >= vertices->size())
626  {
627  ++vertexIndexWarnings;
628  if (vertexIndexWarnings < 20)
629  ATH_MSG_WARNING(" JetCalibrationTool::initializeEvent : PV index is out of bounds.");
630  jetEventInfo.setPVIndex(0); // Hard coded value PVIndex = 0 in case of failure (to prevent seg faults later).
631  return StatusCode::SUCCESS; // error is recoverable, so return SUCCESS
632  }
633  }
634  }
635  } else if (m_doDNNCal) {
636  // retrieve mu and NPV only from eventInfo
637  static std::atomic<unsigned int> eventInfoWarningsMu = 0;
639  if ( rhEvtInfo.isValid() ) {
641  jetEventInfo.setMu(eventInfoDecor(0));
642  } else {
643  ++eventInfoWarningsMu;
644  if ( eventInfoWarningsMu < 20 ) ATH_MSG_WARNING(" JetCalibrationTool::initializeEvent : Failed to retrieve event information.");
645  jetEventInfo.setMu(0); //Hard coded value mu = 0 in case of failure (to prevent seg faults later).
646  }
647 
648  static std::atomic<unsigned int> eventInfoWarningsPV = 0;
649  const xAOD::VertexContainer * vertices = nullptr;
651  if (rhPV.isValid()) {
652  vertices = rhPV.cptr();
653  int eventNPV = 0;
654  eventNPV = std::count_if(vertices->begin(), vertices->end(), [](const xAOD::Vertex* vtx){ return vtx->vertexType() == xAOD::VxType::PileUp || vtx->vertexType() == xAOD::VxType::PriVtx;});
655  jetEventInfo.setNPV(eventNPV);
656  } else {
657  ++eventInfoWarningsPV;
658  if ( eventInfoWarningsPV < 20 ) ATH_MSG_WARNING(" JetCalibrationTool::initializeEvent : Failed to retrieve primary vertices.");
659  jetEventInfo.setNPV(0); //Hard coded value NPV = 0 in case of failure (to prevent seg faults later).
660  }
661  }
662  return StatusCode::SUCCESS;
663 }
664 
666 
667  //Check for OriginCorrected and PileupCorrected attributes, assume they are false if not found
668  int tmp = 0; //temporary int for checking getAttribute
669  if ( !jet.getAttribute<int>("OriginCorrected",tmp) )
670  jet.setAttribute<int>("OriginCorrected",false);
671  if ( !jet.getAttribute<int>("PileupCorrected",tmp) )
672  jet.setAttribute<int>("PileupCorrected",false);
673 
674  ATH_MSG_VERBOSE("Calibrating jet " << jet.index());
675  if(m_doSetDetectorEta) {
676  xAOD::JetFourMom_t jetconstitP4 = jet.getAttribute<xAOD::JetFourMom_t>("JetConstitScaleMomentum");
677  jet.setAttribute<float>("DetectorEta",jetconstitP4.eta()); //saving constituent scale eta for later use
678  }
679 
680  for (unsigned int i=0; i<m_calibSteps.size(); ++i) ATH_CHECK(m_calibSteps[i]->calibrate(jet, jetEventInfo));
681 
682  return StatusCode::SUCCESS;
683 }
684 
685 
687 
688  if(m_smearIndex < 0){
689  ATH_MSG_ERROR("Cannot retrieve the nominal data resolution - smearing was not configured during initialization");
690  return StatusCode::FAILURE;
691  }
692  return m_calibSteps.at(m_smearIndex)->getNominalResolutionData(jet, resolution);
693 }
694 
696 
697  if(m_smearIndex < 0){
698  ATH_MSG_ERROR("Cannot retrieve the nominal MC resolution - smearing was not configured during initialization");
699  return StatusCode::FAILURE;
700  }
701  return m_calibSteps.at(m_smearIndex)->getNominalResolutionMC(jet, resolution);
702 }
703 
python.PyKernel.retrieve
def retrieve(aClass, aKey=None)
Definition: PyKernel.py:110
xAOD::EventShape_v1::getDensity
bool getDensity(EventDensityID id, double &v) const
Get a density variable from the object.
Definition: EventShape_v1.cxx:135
Generic4VecCorrection.h
JetEventInfo::setBcidDistanceFromFront
void setBcidDistanceFromFront(Int_t BcidDistanceFromFront)
Definition: JetEventInfo.h:21
JetCalibrationTool::m_doResidual
bool m_doResidual
Definition: JetCalibrationTool.h:106
JMSCorrection.h
ATH_MSG_FATAL
#define ATH_MSG_FATAL(x)
Definition: AthMsgStreamMacros.h:34
DataModel_detail::const_iterator
Const iterator class for DataVector/DataList.
Definition: DVLIterator.h:82
JetCalibrationTool::m_smearIndex
int m_smearIndex
Definition: JetCalibrationTool.h:114
GlobalSequentialCorrection.h
JetCalibrationTool::m_originCorrectedClusters
bool m_originCorrectedClusters
Definition: JetCalibrationTool.h:82
ATH_MSG_INFO
#define ATH_MSG_INFO(x)
Definition: AthMsgStreamMacros.h:31
JetEventInfo::PVIndex
int PVIndex()
Definition: JetEventInfo.h:30
SG::ReadHandle::cptr
const_pointer_type cptr()
Dereference the pointer.
JetCalibrationTool::m_jetAlgo
std::string m_jetAlgo
Definition: JetCalibrationTool.h:73
JetCalibrationTool::LC
@ LC
Definition: JetCalibrationTool.h:45
SG::ReadHandle
Definition: StoreGate/StoreGate/ReadHandle.h:67
JetCalibrationTool::m_timeDependentInsituConfigs
std::vector< TString > m_timeDependentInsituConfigs
Definition: JetCalibrationTool.h:88
JetCalibrationTool::m_muKey
SG::ReadDecorHandleKey< xAOD::EventInfo > m_muKey
Definition: JetCalibrationTool.h:67
JetCalibrationTool::m_isData
bool m_isData
Definition: JetCalibrationTool.h:79
GlobalNNCalibration.h
python.base_data.config
config
Definition: base_data.py:20
JetCalibrationTool::EM
@ EM
Definition: JetCalibrationTool.h:45
asg
Definition: DataHandleTestTool.h:28
SG::ReadDecorHandle::isPresent
bool isPresent() const
Is the referenced container present in SG?
defineDB.jets
jets
Definition: JetTagCalibration/share/defineDB.py:24
JetEventInfo::setRho
void setRho(double rho)
Definition: JetEventInfo.h:15
asg::AsgMetadataTool::inputMetaStore
MetaStorePtr_t inputMetaStore() const
Accessor for the input metadata store.
Definition: AsgMetadataTool.cxx:93
JetCalibrationTool::m_gscDepth
std::string m_gscDepth
Definition: JetCalibrationTool.h:111
JetCalibrationTool::initialize
StatusCode initialize() override
Dummy implementation of the initialisation function.
Definition: JetCalibrationTool.cxx:63
JetCalibrationTool::getCalibClass
StatusCode getCalibClass(const TString &calibration)
Definition: JetCalibrationTool.cxx:239
JetCalibrationTool::m_forceCampaign
std::string m_forceCampaign
Definition: JetCalibrationTool.h:80
JetCalibrationTool::m_rhoKey
SG::ReadHandleKey< xAOD::EventShape > m_rhoKey
Definition: JetCalibrationTool.h:65
JetCalibrationTool::calibrate
StatusCode calibrate(xAOD::Jet &jet, JetEventInfo &jetEventInfo) const
Definition: JetCalibrationTool.cxx:665
GlobalLargeRDNNCalibration.h
JetCalibrationTool::m_devMode
bool m_devMode
Definition: JetCalibrationTool.h:78
SG::ConstAccessor
Helper class to provide constant type-safe access to aux data.
Definition: ConstAccessor.h:55
JetEventInfo::setBcidGapBeforeTrain
void setBcidGapBeforeTrain(Int_t BcidGapBeforeTrain)
Definition: JetEventInfo.h:22
ATH_MSG_VERBOSE
#define ATH_MSG_VERBOSE(x)
Definition: AthMsgStreamMacros.h:28
Dedxcorrection::resolution
double resolution[nGasTypes][nParametersResolution]
Definition: TRT_ToT_Corrections.h:46
JetCalibrationTool::m_runBins
std::vector< double > m_runBins
Definition: JetCalibrationTool.h:89
JetCalibUtils::Vectorize
StrV Vectorize(const TString &str, const TString &sep=" ")
Definition: JetCalibUtils.cxx:14
xAOD::EventInfo_v1::runNumber
uint32_t runNumber() const
The current event's run number.
config
Definition: PhysicsAnalysis/AnalysisCommon/AssociationUtils/python/config.py:1
JetSmearingCorrection.h
python.iconfTool.models.loaders.level
level
Definition: loaders.py:20
JetCalibrationTool::m_doJetArea
bool m_doJetArea
Definition: JetCalibrationTool.h:105
JetCalibrationStep::initialize
virtual StatusCode initialize()=0
xAOD::FileMetaData_v1::value
bool value(MetaDataType type, std::string &val) const
Get a pre-defined string value out of the object.
Definition: FileMetaData_v1.cxx:195
JetCalibrationTool::m_pvKey
SG::ReadHandleKey< xAOD::VertexContainer > m_pvKey
Definition: JetCalibrationTool.h:66
xAOD::FileMetaData_v1::simFlavour
@ simFlavour
Fast or Full sim [string].
Definition: FileMetaData_v1.h:76
JetEventInfo::setBcidGapBeforeTrainMinus12
void setBcidGapBeforeTrainMinus12(Int_t BcidGapBeforeTrainMinus12)
Definition: JetEventInfo.h:23
JetCalibrationTool::initializeEvent
StatusCode initializeEvent(JetEventInfo &jetEventInfo) const
Definition: JetCalibrationTool.cxx:454
JetCalibrationTool::m_globalConfig
TEnv * m_globalConfig
Definition: JetCalibrationTool.h:98
BcidOffsetCorrection.h
JetCalibrationTool::m_insituCombMassConfig
std::vector< TString > m_insituCombMassConfig
Definition: JetCalibrationTool.h:92
xAOD::EventShape_v1::Density
@ Density
Definition: EventShape_v1.h:47
JetEventInfo::setNjet
void setNjet(double nJet)
Definition: JetEventInfo.h:18
JetEventInfo
Definition: JetEventInfo.h:8
xAOD::FileMetaData_v1::mcCampaign
@ mcCampaign
MC campaign [string].
Definition: FileMetaData_v1.h:80
AthCommonDataStore< AthCommonMsg< AlgTool > >::evtStore
ServiceHandle< StoreGateSvc > & evtStore()
The standard StoreGateSvc (event store) Returns (kind of) a pointer to the StoreGateSvc.
Definition: AthCommonDataStore.h:85
JetCalibrationTool::PFLOW
@ PFLOW
Definition: JetCalibrationTool.h:45
JetCalibrationTool::m_nJetThreshold
float m_nJetThreshold
Definition: JetCalibrationTool.h:84
JetCalibrationTool::getNominalResolutionMC
StatusCode getNominalResolutionMC(const xAOD::Jet &jet, double &resolution) const override
Definition: JetCalibrationTool.cxx:695
jet
Definition: JetCalibTools_PlotJESFactors.cxx:23
python.getCurrentFolderTag.fn
fn
Definition: getCurrentFolderTag.py:79
JetCalibrationTool.h
ATH_MSG_ERROR
#define ATH_MSG_ERROR(x)
Definition: AthMsgStreamMacros.h:33
SG::ReadDecorHandle
Handle class for reading a decoration on an object.
Definition: StoreGate/StoreGate/ReadDecorHandle.h:94
JetCalibrationTool::m_dir
std::string m_dir
Definition: JetCalibrationTool.h:86
lumiFormat.i
int i
Definition: lumiFormat.py:85
JetCalibrationTool::m_calibAreaTag
std::string m_calibAreaTag
Definition: JetCalibrationTool.h:76
JetCalibrationTool::m_forceCalibFile_FastSim
std::string m_forceCalibFile_FastSim
Definition: JetCalibrationTool.h:94
JetCalibrationTool::m_eInfoName
std::string m_eInfoName
Definition: JetCalibrationTool.h:87
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition: PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22
AthCommonDataStore< AthCommonMsg< AlgTool > >::declareProperty
Gaudi::Details::PropertyBase & declareProperty(Gaudi::Property< T, V, H > &t)
Definition: AthCommonDataStore.h:145
TestSUSYToolsAlg.mcCampaign
mcCampaign
Definition: TestSUSYToolsAlg.py:134
JetCalibrationTool::m_nJetContainerName
std::string m_nJetContainerName
Definition: JetCalibrationTool.h:85
xAOD::VxType::PriVtx
@ PriVtx
Primary vertex.
Definition: TrackingPrimitives.h:572
asg::AsgMessaging::msg
MsgStream & msg() const
The standard message stream.
Definition: AsgMessaging.cxx:49
JetCalibrationTool::m_evtInfoKey
SG::ReadHandleKey< xAOD::EventInfo > m_evtInfoKey
Definition: JetCalibrationTool.h:64
ATH_CHECK
#define ATH_CHECK
Definition: AthCheckMacros.h:40
JetCalibrationTool::m_doSetDetectorEta
bool m_doSetDetectorEta
Definition: JetCalibrationTool.h:90
JetCalibrationTool::m_originScale
std::string m_originScale
Definition: JetCalibrationTool.h:77
xAOD::FileMetaData_v1::mcProcID
@ mcProcID
Same as mc_channel_number [float].
Definition: FileMetaData_v1.h:74
SG::VarHandleKey::initialize
StatusCode initialize(bool used=true)
If this object is used as a property, then this should be called during the initialize phase.
Definition: AthToolSupport/AsgDataHandles/Root/VarHandleKey.cxx:103
DeMoUpdate.tmp
string tmp
Definition: DeMoUpdate.py:1167
JetEventInfo::setNPV
void setNPV(double NPV)
Definition: JetEventInfo.h:17
DataVector
Derived DataVector<T>.
Definition: DataVector.h:794
JetCalibrationTool::m_forceCalibFile_MC2MC
std::string m_forceCalibFile_MC2MC
Definition: JetCalibrationTool.h:95
xAOD::FileMetaData_v1
Class holding file-level metadata about an xAOD file.
Definition: FileMetaData_v1.h:34
SG::ReadHandle::isValid
virtual bool isValid() override final
Can the handle be successfully dereferenced?
xAOD::EventShape_v1
Data class for event shapes.
Definition: EventShape_v1.h:28
beamspotman.dir
string dir
Definition: beamspotman.py:621
xAOD::JetFourMom_t
ROOT::Math::LorentzVector< ROOT::Math::PtEtaPhiM4D< double > > JetFourMom_t
Base 4 Momentum type for Jet.
Definition: JetTypes.h:17
JetEventInfo::setPVIndex
void setPVIndex(int PVindex)
Definition: JetEventInfo.h:19
PathResolver.h
InsituDataCorrection.h
JetCalibrationTool::m_actualMuKey
SG::ReadDecorHandleKey< xAOD::EventInfo > m_actualMuKey
Definition: JetCalibrationTool.h:69
JetCalibrationTool::m_jetScale
jetScale m_jetScale
Definition: JetCalibrationTool.h:103
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:240
ActsTrk::to_string
std::string to_string(const DetectorType &type)
Definition: GeometryDefs.h:34
JetCalibrationTool::JetCalibrationTool
JetCalibrationTool(const std::string &name="JetCalibrationTool")
Constructor with parameters:
Definition: JetCalibrationTool.cxx:31
JetCalibrationTool::m_config
std::string m_config
Definition: JetCalibrationTool.h:74
JetCalibrationTool::getNominalResolutionData
StatusCode getNominalResolutionData(const xAOD::Jet &jet, double &resolution) const override
Definition: JetCalibrationTool.cxx:686
JetCalibrationTool::m_globalTimeDependentConfigs
std::vector< TEnv * > m_globalTimeDependentConfigs
Definition: JetCalibrationTool.h:99
JetCalibrationTool::applyCalibration
StatusCode applyCalibration(xAOD::JetContainer &) const override
Apply calibration to a jet container.
Definition: JetCalibrationTool.cxx:442
xAOD::EventInfo_v1
Class describing the basic event information.
Definition: EventInfo_v1.h:43
PathResolverFindCalibFile
std::string PathResolverFindCalibFile(const std::string &logical_file_name)
Definition: PathResolver.cxx:283
DataVector::end
const_iterator end() const noexcept
Return a const_iterator pointing past the end of the collection.
xAOD::Jet_v1
Class describing a jet.
Definition: Jet_v1.h:57
FileMetaData.h
xAOD::Vertex_v1
Class describing a Vertex.
Definition: Vertex_v1.h:42
JetCalibrationTool::m_globalInsituCombMassConfig
std::vector< TEnv * > m_globalInsituCombMassConfig
Definition: JetCalibrationTool.h:100
ATH_MSG_WARNING
#define ATH_MSG_WARNING(x)
Definition: AthMsgStreamMacros.h:32
EtaJESCorrection.h
JetCalibrationTool::m_doGSC
bool m_doGSC
Definition: JetCalibrationTool.h:108
xAOD::FileMetaData_v1::generatorsInfo
@ generatorsInfo
Generators information [string].
Definition: FileMetaData_v1.h:82
AsgMetadataTool.h
AthCommonMsg< AlgTool >::msg
MsgStream & msg() const
Definition: AthCommonMsg.h:24
JetCalibrationTool::m_doBcid
bool m_doBcid
Definition: JetCalibrationTool.h:104
ReadDecorHandle.h
Handle class for reading a decoration on an object.
JetCalibrationTool::m_timeDependentCalib
bool m_timeDependentCalib
Definition: JetCalibrationTool.h:81
ReadBchFromCool.lastRun
lastRun
Definition: ReadBchFromCool.py:278
ResidualOffsetCorrection.h
JetPileupCorrection.h
SG::ConstAccessor::isAvailable
bool isAvailable(const ELT &e) const
Test to see if this variable exists in the store.
JetCalibrationTool::m_calibSeq
std::string m_calibSeq
Definition: JetCalibrationTool.h:75
merge.status
status
Definition: merge.py:16
JetCalibUtils::VectorizeD
VecD VectorizeD(const TString &str, const TString &sep=" ")
Definition: JetCalibUtils.cxx:25
JetEventInfo::setRunNumber
void setRunNumber(UInt_t RunNumber)
Definition: JetEventInfo.h:20
xAOD::FileMetaData_v1::dataYear
@ dataYear
Data year [uint32_t].
Definition: FileMetaData_v1.h:84
JetCalibrationTool::m_useNjetInResidual
bool m_useNjetInResidual
Definition: JetCalibrationTool.h:83
ConstAccessor.h
Helper class to provide constant type-safe access to aux data.
JetCalibrationTool::m_useOriginVertex
bool m_useOriginVertex
Definition: JetCalibrationTool.h:117
JetCalibrationTool::m_doDNNCal
bool m_doDNNCal
Definition: JetCalibrationTool.h:109
JetCalibrationTool::m_forceCalibFile_PtResidual
std::string m_forceCalibFile_PtResidual
Definition: JetCalibrationTool.h:93
DataVector::size
size_type size() const noexcept
Returns the number of elements in the collection.
JetCalibrationTool::m_doOrigin
bool m_doOrigin
Definition: JetCalibrationTool.h:107
JetEventInfo::setMu
void setMu(double mu)
Definition: JetEventInfo.h:16
JetCalibrationTool::~JetCalibrationTool
~JetCalibrationTool()
Destructor:
Definition: JetCalibrationTool.cxx:52
fitman.rho
rho
Definition: fitman.py:532
DataVector::begin
const_iterator begin() const noexcept
Return a const_iterator pointing at the beginning of the collection.
JetCalibrationTool::m_calibSteps
std::vector< std::unique_ptr< JetCalibrationStep > > m_calibSteps
Definition: JetCalibrationTool.h:113
JetCalibrationTool::m_insituCombMassCalib
bool m_insituCombMassCalib
Definition: JetCalibrationTool.h:91