ATLAS Offline Software
JetTileCorrectionTool.cxx
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration
3 */
4 
5 // ROOT include(s):
6 
7 // EDM include(s):
9 
10 // Local include(s):
12 
13 #ifndef XAOD_STANDALONE // For now metadata is Athena-only
15 #endif
16 
18 #include "AsgMessaging/StatusCode.h"
22 
23 #include <iostream>
24 #include <fstream>
25 #include <sstream>
26 #include "stdlib.h"
27 #include <cmath>
28 
29 const double width=2.*M_PI/64.;
30 
31 //Validity ranges
32 const float iov_pt_min = 20000.; //pt_min > 20GeV
33 const float iov_pt_max = 3000000.; //pt_max > 3TeV
34 const float iov_aeta_max = 2.8; //|eta| < 2.8
35 
36 namespace CP {
37 
38  using namespace JTC;
39 
40  static SG::AuxElement::Decorator<unsigned int> dec_status("TileStatus");
41  static SG::AuxElement::Decorator<float> dec_ptraw("Ptraw");
42 
43 
45  : asg::AsgMetadataTool( name ),
46  m_appliedSystematics(nullptr)
47  {
48  declareProperty("CorrectionFileName", m_rootFileName="JetTileCorrection/JetTile_pFile_010216.root", "Parametrization file");
49  declareProperty("MaskedRegionsMap", m_bd_dead_mapFile="JetTileCorrection/Tile_maskedDB_Run2.conf", "Masked regions DB file");
50  declareProperty("UserMaskedRegions", m_v_user_dead, "List of (ad-hoc) TileCal dead modules"); //array of extra dead modules
51  }
52 
54  {
55  if ( m_rootFile ){
56  delete m_rootFile;
57  m_rootFile = nullptr;
58  }
59  }
60 
62 
63  // Greet the user:
64  ATH_MSG_INFO( "Initialising..." );
65 
66 #ifdef XAOD_STANDALONE
67  // Retrieve the event information (check if MC or data)
68  const xAOD::EventInfo* ei(nullptr);
69  ATH_CHECK( evtStore()->retrieve( ei, "EventInfo" ) );
70 
72 #else
73  // Retrieve the metadata (check if MC or data)
74  std::string projectName = "";
75  ATH_CHECK( AthAnalysisHelper::retrieveMetadata("/TagInfo", "project_name", projectName, inputMetaStore() ) );
76  if ( projectName == "IS_SIMULATION" ) m_isMC = true;
77  else if (projectName.compare(0, 4, "data") == 0 ) m_isMC = false;
78  ATH_MSG_INFO("Set up JetTileCorrectionTool -- this is MC? " << m_isMC);
79 #endif
80 
81 
82  //set RJET
83  setRJET( (float) RJET );
84 
85  //Load user dead regions map
86  loadDeadUser();
87 
88  //Load dead regions in DB map
89  loadDeadDB();
90 
91  // Load the ROOT file
93  m_rootFile = TFile::Open( fname.c_str(), "READ" );
94 
95  if ( !m_rootFile ) {
96  ATH_MSG_ERROR("Parametrization file " << m_rootFileName << "not found!");
97  return StatusCode::FAILURE;
98  }
99 
100  //Load parametrizations
101  TString sub="";
102 
103  m_pars_LB={};
104  m_pars_EB={};
105 
106 
107  for(unsigned int ieta=0; ieta < Pix_eta ; ieta++){
108  for(unsigned int iphi=0; iphi < Pix_phi ; iphi++){
109  sub = Form("_%d_%d",ieta,iphi);
110 
111  //flatten 2D-etaphi-to-1D
112  m_pars_LB[ieta+iphi*Pix_eta]=(TH1F*)m_rootFile->Get("param_LB_fit"+sub);
113  m_pars_EB[ieta+iphi*Pix_eta]=(TH1F*)m_rootFile->Get("param_EB_fit"+sub);
114  m_pars_LB[ieta+iphi*Pix_eta]->SetDirectory(nullptr);
115  m_pars_EB[ieta+iphi*Pix_eta]->SetDirectory(nullptr);
116  }
117  }
118 
119  //***
120  m_core_sys_LB=(TH1F*)m_rootFile->Get("sys_LB");
121  m_core_sys_EB=(TH1F*)m_rootFile->Get("sys_EB");
122  //***
123 
124  //book number of pt bins in parametrization for later
125  m_NbinsPt = m_pars_LB[0]->GetNbinsX();
126 
127 
128  // set up for default running without systematics
130  ATH_MSG_ERROR("Loading the central value systematic set failed.");
131  return StatusCode::FAILURE;
132  }
133  // Add the affecting systematics to the global registry
135  if (registry.registerSystematics(*this) != StatusCode::SUCCESS){
136  ATH_MSG_ERROR("Unable to register the systematics");
137  return StatusCode::FAILURE;
138  }
139 
140  ATH_MSG_DEBUG("Successfully initialized! ");
141 
142  // Return gracefully:
143  return StatusCode::SUCCESS;
144  }
145 
146 
148 
149  //init decorations
150  dec_ptraw(jet) = jet.pt();
151  dec_status(jet) = (unsigned int) TS::UNKNOWN;
152 
153  //check validity range of the correction
154  if( std::abs(jet.eta()) > iov_aeta_max ) return CorrectionCode::OutOfValidityRange;
155  if( jet.pt() < iov_pt_min || jet.pt() > iov_pt_max ) return CorrectionCode::OutOfValidityRange;
156 
158  if( loadAllModules(jet, status) != StatusCode::SUCCESS )
159  return CorrectionCode::Error;
160 
161  dec_status(jet) = (unsigned int) status; //save status decoration
162 
163  // Nothing to do, return gracefully:
164  if(status == TS::GOOD) return CorrectionCode::Ok;
165 
166  //get relative-pt factor to correct for
167  std::vector<float> cfactors = getCorrections(jet);
168 
169  //if not correction need it, just leave
170  if(cfactors.empty()) return CorrectionCode::Ok;
171 
172  // Redefine the jet 4vector by scaling both pt and mass
173  float newPt = jet.pt();
174  float newM = jet.m();
175 
176  for(auto cf : cfactors){
177 
178  newPt /= cf;
179  newM /= cf;
180  }
181 
182  // Set the new jet 4vector
183  xAOD::JetFourMom_t newp4;
184  newp4.SetCoordinates(newPt, jet.eta(), jet.phi(), newM);
185 
186  jet.setJetP4( newp4 );
187 
188  ATH_MSG_DEBUG("JetTileCorrection applied.");
189 
190  // Return gracefully:
191  return CorrectionCode::Ok;
192  }
193 
195 
196  // A sanity check:
197  if( output ) {
198  ATH_MSG_WARNING( "Non-null pointer received. "
199  "There's a possible memory leak!" );
200  }
201 
202  ATH_MSG_DEBUG("making the copy");
203 
204  // Create the copy:
205  std::unique_ptr< xAOD::Jet > newobj( new xAOD::Jet( input ) );
206 
207  // Apply the correction to it:
208  const CorrectionCode result = this->applyCorrection( *newobj );
209  if( result == CorrectionCode::Error ) {
210  ATH_MSG_ERROR( "Failed to apply correction to jet" );
211  } else {
212  output = newobj.release();
213  }
214 
215  // Return the value from applyCorrection:
216  return result;
217  }
218 
220  {
222  return sys.find (systematic) != sys.end ();
223  }
224 
225 
227  {
229 
230  result.insert(CP::SystematicVariation("JET_TILECORR_Uncertainty", 1));
231  result.insert(CP::SystematicVariation("JET_TILECORR_Uncertainty", -1));
232 
233  return result;
234  }
235 
237  {
238  return affectingSystematics();
239  }
240 
241 
243 
244  // First, check if we already know this systematic configuration
245  auto itr = m_systFilter.find(systConfig);
246 
247  // If it's a new input set, we need to filter it
248  if( itr == m_systFilter.end() ){
249 
250  // New systematic. We need to parse it.
251  static CP::SystematicSet affectingSys = affectingSystematics();
252  CP::SystematicSet filteredSys;
253  if (!CP::SystematicSet::filterForAffectingSystematics(systConfig, affectingSys, filteredSys)){
254  ATH_MSG_ERROR("Unsupported combination of systematics passed to the tool!");
255  return StatusCode::FAILURE;
256  }
257 
258  // Insert filtered set into the map
259  itr = m_systFilter.insert(std::make_pair(systConfig, filteredSys)).first;
260  }
261 
262  CP::SystematicSet& mySysConf = itr->second;
263  m_appliedSystematics = &mySysConf;
264  return StatusCode::SUCCESS;
265  }
266 
267 
269 
270  double phisize = region.phi2-region.phi1;
271  double phicenter = (region.phi1+region.phi2)/2.;
272  float jet_eta = j.jetP4(xAOD::JetConstitScaleMomentum).eta();
274 
275  // GOOD?
276  if( region.eta2 < (jet_eta-m_RJET) ) return TS::GOOD;
277  if( region.eta1 > (jet_eta+m_RJET) ) return TS::GOOD;
278  if( std::abs(TVector2::Phi_mpi_pi(jet_phi-phicenter)) > m_RJET+phisize/2.) return TS::GOOD;
279 
280  // CORE-BAD?
281  if( inHole(jet_eta, jet_phi, region) ) return TS::CORE;
282 
283  // CORE-EDGE? (elsewhere)
284  return TS::EDGE;
285  }
286 
288 
289  m_user_dead_LB = {};
290  m_user_dead_EB = {};
291 
292  //Format accepted for module input: "LBA 10" == "0 9"
293  for(auto& r : m_v_user_dead){
294 
295  std::stringstream ss(r);
296  std::string s;
297 
298  std::vector<std::string> tokens;
299  while (getline(ss, s, ' ')) {
300  tokens.push_back(s);
301  }
302 
303  if(tokens.size() < 2){
304  ATH_MSG_ERROR("Part-Module pair " << r << " not known! Please use \"PART MOD\" format ");
305  continue;
306  }
307 
308  int i_part = 0;
309  int i_mod = std::atoi((tokens.at(1)).c_str());
310  if (tokens.at(0).find('B') != std::string::npos)
311  i_mod -= 1; // substract 1 from second coor if given in format "LBA 4"
312 
313  if(tokens.at(0)=="LBA" || tokens.at(0)== "0"){
314  i_part = 0;
315  }else if (tokens.at(0)=="LBC" || tokens.at(0)== "1"){
316  i_part = 1;
317  }else if (tokens.at(0)=="EBA" || tokens.at(0)== "2"){
318  i_part = 2;
319  }else if (tokens.at(0)=="EBC" || tokens.at(0)== "3"){
320  i_part = 3;
321  }else{
322  ATH_MSG_ERROR("Part-Module pair " << r << " not known! Please use \"PART MOD\" format ");
323  continue;
324  }
325 
326  //Classify into long and extended barrel modules
327  Hole rdead = partModToHole(i_part, i_mod);
328 
329  if( i_part < 2 )
330  m_user_dead_LB[r] = rdead; //LBA, LBC
331  else
332  m_user_dead_EB[r] = rdead; //EBA, EBC
333 
334  }
335  }
336 
337  //Load dead regions from DB file
339 
340  m_db_dead_LB = {};
341  m_db_dead_EB = {};
342 
343  std::vector<Hole> dbholes={};
344 
345  //Simulation
346  if(m_isMC){
347 
348  //-- MC15c : no dead modules
349  //COOLOFL_TILE/OFLP200 /TILE/OFL02/STATUS/ADC TileOfl02StatusAdc-IOVDEP-05
350  //COOLOFL_TILE/OFLP200 /TILE/OFL02/NOISE/CELL TileOfl02NoiseCell-OF2-07
351  //
352 
353  //TODO: add RunNumber check and add these below if running on MC15b //M.T.
354 
355  //-- MC15b : two dead modules
356  //COOLOFL_TILE/OFLP200 /TILE/OFL02/STATUS/ADC TileOfl02StatusAdc-IOVDEP-05
357  //COOLOFL_TILE/OFLP200 /TILE/OFL02/NOISE/CELL TileOfl02NoiseCell-OF2-07
358  //
359  // //LBA10
360  // Hole rdead = partModToHole(0, 9);
361  // rdead.iov = make_pair(0,1000000); //no range
362  // dbholes.push_back( rdead );
363 
364  // //EBC21
365  // rdead = partModToHole(3, 20);
366  // rdead.iov = make_pair(0,1000000); //no range
367  // dbholes.push_back( rdead );
368 
369  }
370  else{ //DATA
371 
372  //read map file
373  std::string mapFilename = PathResolverFindCalibFile(m_bd_dead_mapFile);
374  std::ifstream mapFile;
375  mapFile.open(mapFilename);
376 
377  std::string line;
378  while (std::getline(mapFile, line)){
379 
380  if(line[0]=='#') continue;
381 
382  std::istringstream iss(line);
383  int part,mod, irun, erun;
384  std::string modname;
385 
386  if (!(iss >> part >> mod >> irun >> erun >> modname)) { break; } // error
387 
388  Hole rdead = partModToHole(part, mod);
389  rdead.iov = std::make_pair(irun,erun);
390  dbholes.push_back( rdead );
391 
392  }
393  }
394 
395  int dbh=1;
396  for(const auto& h : dbholes){
397  if(std::abs(h.eta1)>1 || std::abs(h.eta2)>1){
398  m_db_dead_EB[Form("DB%d",dbh)] = h;
399  }
400  else{
401  m_db_dead_LB[Form("DB%d",dbh)] = h;
402  }
403 
404  dbh++;
405 
406  // ATH_MSG_INFO("Adding DB dead module at (eta1,phi1)=(" << h.eta1 << "," << h.phi1 << ")");
407  ATH_MSG_DEBUG("Adding DB dead module at (eta1,phi1)=(" << h.eta1 << "," << h.phi1 << ")");
408  }
409  }
410 
411 
413 
414  float eta = (mod.eta1+mod.eta2)/2.;
415  float phi = (mod.phi1+mod.phi2)/2.;
416 
417  float jet_eta = jet.jetP4(xAOD::JetConstitScaleMomentum).eta();
418  float jet_phi = jet.jetP4(xAOD::JetConstitScaleMomentum).phi();
419 
420  float eta_dist = jet_eta-eta;
421  float phi_dist = TVector2::Phi_mpi_pi((double)jet_phi - (double)phi);
422 
423  int inphi;
424 
425  if(std::abs(phi_dist)<0.05){ inphi=0; }
426  else if(std::abs(phi_dist)<0.1){ inphi=1; }
427  else if(std::abs(phi_dist)<0.2){ inphi=2; }
428  else if(std::abs(phi_dist)<0.3){ inphi=3; }
429  else if(std::abs(phi_dist)<0.4){ inphi=4; }
430  else { inphi=5;}
431 
432  float ieta = eta_dist/PIXWIDTH;
433  int ineta = (int)ieta;
434 
435 
436  //get parametrization from positive side always!
437  if(mod.eta1 < -0.1) ineta = -ineta;
438 
439  return std::make_pair(ineta+8, inphi);
440  }
441 
442  void JetTileCorrectionTool :: loadModulesFromMap(const xAOD::Jet& jet, JTC::TS &status, const std::map<std::string,Hole>& hmap, PART part, TYPE type){
443 
444  float cfactor(0.);
445  IPair mpos;
446  JTC::TS cstatus = TS::GOOD;
447 
448  for (const auto& mod : hmap){
449 
450  //check IOV for DB defined modules
451  if(!m_isMC && type == TYPE::DB && !inIOV(mod.second, m_current_run)) continue;
452 
453  cstatus = overlap(jet,mod.second);
454  if(cstatus != TS::GOOD){
455 
456  //get eta-phi position (relative to jet axis)
457  mpos = getModulePosition(jet,mod.second);
458 
459  //get correction (1D-array)
460  if(part == PART::LB)
461  cfactor = m_pars_LB[mpos.first + Pix_eta * mpos.second]->GetBinContent(getPtBin(jet.pt()));
462  else
463  cfactor = m_pars_EB[mpos.first + Pix_eta * mpos.second]->GetBinContent(getPtBin(jet.pt()));
464 
465  //overwrite global status with worst case
466  if(cstatus > status) status = cstatus;
467 
468  //create new d-region and add it to the list
469  m_position_masked.emplace_back( mod.second,mpos,part,cfactor,cstatus,type );
470 
471  }
472  }
473 
474  }
475 
476 
479  if( loadAllModules(jet, status) != StatusCode::SUCCESS ){
480  ATH_MSG_ERROR( "Something went wrong while loading/checking the modules!");
481  return TS::UNKNOWN;
482  }
483  return status;
484  }
485 
486 
489  dec_status(jet) = (unsigned int) status; //save status decoration
490  return StatusCode::SUCCESS;
491  }
492 
494  m_RJET = r;
495  }
496 
497 
499 
500  m_position_masked.clear();
501 
502  //Read dead regions DB if we change run/LB
503  if(!m_isMC){
504 
505  const xAOD::EventInfo* ei = nullptr;
506  if( evtStore()->retrieve( ei, "EventInfo" ).isFailure() ) {
507  ATH_MSG_WARNING( "No EventInfo object could be retrieved" );
508  }
509 
510  if (!ei) {
511  ATH_MSG_ERROR( "Cannot retrieve the EventInfo" );
512  return StatusCode::FAILURE;
513  }
514 
515  m_current_run = ei->runNumber();
516 
517  }
518 
519  //load DB-defined modules in LB
521  //load DB-defined modules in EB
523 
524  //load user-defined modules in LB
526  //load user-defined modules in EB
528 
529  //sort modules by correction size (in decreasing order)
530  std::sort(m_position_masked.begin(), m_position_masked.end(), std::greater<Region>());
531 
532  return StatusCode::SUCCESS;
533  }
534 
536 
537  float ptlast = jet.pt();
538  int ptbin = getPtBin(ptlast);
539 
540  //***
541  int ptbin_sys=m_core_sys_LB->FindBin(ptlast);
542  //***
543 
544  std::vector<float> corrections = {};
545 
546  if (ptbin < 0) return corrections; // no correction below 20GeV
547 
548  //***
549  if (ptlast < 40000) return corrections;
550  //***
551 
552  float clast = 1.;
553  float sigma = 0.;
554 
555  if(m_appliedSystematics!=nullptr){ //nomimal value
556  sigma = m_appliedSystematics->getParameterByBaseName("JET_TILECORR_Uncertainty");
557  }
558 
559  for(const auto& region : m_position_masked){
560 
561  ptlast *= clast;
562  ptbin = getPtBin( ptlast );
563 
564  if(region.part == PART::LB) {
565 
566  //***
567  if (region.status == TS::CORE) clast = m_pars_LB[region.ep.first + Pix_eta * region.ep.second]->GetBinContent(ptbin) + sigma * m_core_sys_LB->GetBinContent(ptbin_sys); //systematics are bigger if we are in the core
568  else clast = m_pars_LB[region.ep.first + Pix_eta * region.ep.second]->GetBinContent(ptbin) + sigma * m_pars_LB[region.ep.first + Pix_eta * region.ep.second]->GetBinError(ptbin);
569  //***
570 
571  }else{
572 
573  //***
574  if (region.status == TS::CORE) clast = m_pars_EB[region.ep.first + Pix_eta * region.ep.second]->GetBinContent(ptbin) + sigma * m_core_sys_EB->GetBinContent(ptbin_sys); //systematics are bigger if we are in the core
575  else clast = m_pars_EB[region.ep.first + Pix_eta * region.ep.second]->GetBinContent(ptbin) + sigma * m_pars_EB[region.ep.first + Pix_eta * region.ep.second]->GetBinError(ptbin);
576  //***
577 
578 
579  }
580  corrections.push_back(clast);
581  }
582 
583  return corrections;
584  }
585 
586 
588 
589  if(pt < 20000.) return -1;
590 
591  int ptbin = m_pars_LB[0]->FindBin(pt*0.001); // no correction below 20GeV
592 
593  //adjust under/overflows
594  if (ptbin < 1) ptbin = 1;
595  if (ptbin > m_NbinsPt) ptbin = m_NbinsPt;
596 
597  return ptbin;
598  }
599 
601  if( region.iov.first>=0 && (run < region.iov.first) ) return false;
602  if( region.iov.second>=0 && (run > region.iov.second) ) return false;
603  return true;
604  }
605 
607  return inHole(jet.eta(), jet.phi(), rdead);
608  }
609 
610 
611  bool JetTileCorrectionTool :: inHole(float eta, float phi, Hole rdead){
612 
613  if(rdead.eta1==rdead.eta2 || rdead.phi1==rdead.phi2) return false;
614  if((eta > rdead.eta1) && (eta < rdead.eta2) && (phi > rdead.phi1) && (phi < rdead.phi2)) return true;
615 
616  return false;
617  }
618 
620 
621  Hole region;
622  region.iov = std::make_pair(0,1000000); //a dummy full IOV is set by default
623 
624  switch(part){
625  case 0: //LBA
626  region.eta1=0;
627  region.eta2=0.9;
628  break;
629  case 1: //LBC
630  region.eta1=-0.9;
631  region.eta2=0;
632  break;
633  case 2: //EBA
634  region.eta1=0.8;
635  region.eta2=1.7;
636  break;
637  case 3: //EBC
638  region.eta1=-1.7;
639  region.eta2=-0.8;
640  break;
641  default:
642  std::cout<<"Bad partition value passed!\n";
643  region.eta1=-999;
644  region.eta2=-999;
645  region.phi1=-999;
646  region.phi2=-999;
647  return region;
648  }
649  if(mod<32){
650  region.phi1=((double)mod)*width;
651  region.phi2=region.phi1+width;
652  }
653  else if(mod<64){
654  region.phi1=((double)mod)*width-2.*M_PI;
655  region.phi2=region.phi1+width;
656  }
657  else{
658  std::cout<<"Bad module value passed!\n";
659  region.eta1=-999;
660  region.eta2=-999;
661  region.phi1=-999;
662  region.phi2=-999;
663  return region;
664  }
665  return region;
666  }
667 
668 
669 } // namespace CP
CP::JetTileCorrectionTool::getPtBin
int getPtBin(float pt)
Definition: JetTileCorrectionTool.cxx:587
LArG4FSStartPointFilter.part
part
Definition: LArG4FSStartPointFilter.py:21
python.PyKernel.retrieve
def retrieve(aClass, aKey=None)
Definition: PyKernel.py:110
python.Dso.registry
registry
Definition: Control/AthenaServices/python/Dso.py:159
JTC::TS
TS
Definition: IJetTileCorrectionTool.h:27
JTC::Hole::iov
std::pair< int, int > iov
Definition: IJetTileCorrectionTool.h:36
CorrectionTool.h
CP::JetTileCorrectionTool::m_pars_LB
std::map< int, TH1F * > m_pars_LB
Definition: JetTileCorrectionTool.h:147
beamspotman.r
def r
Definition: beamspotman.py:676
iov_pt_max
const float iov_pt_max
Definition: JetTileCorrectionTool.cxx:33
checkFileSG.line
line
Definition: checkFileSG.py:75
pdg_comparison.sigma
sigma
Definition: pdg_comparison.py:324
python.SystemOfUnits.s
int s
Definition: SystemOfUnits.py:131
get_generator_info.result
result
Definition: get_generator_info.py:21
PowhegControl_ttHplus_NLO.ss
ss
Definition: PowhegControl_ttHplus_NLO.py:83
JetTileCorrectionTool.h
ATH_MSG_INFO
#define ATH_MSG_INFO(x)
Definition: AthMsgStreamMacros.h:31
CP::JetTileCorrectionTool::inIOV
bool inIOV(JTC::Hole region, int run)
Definition: JetTileCorrectionTool.cxx:600
CaloCellPos2Ntuple.int
int
Definition: CaloCellPos2Ntuple.py:24
CP::JetTileCorrectionTool::m_RJET
float m_RJET
Definition: JetTileCorrectionTool.h:154
CP::JetTileCorrectionTool::isAffectedBySystematic
virtual bool isAffectedBySystematic(const SystematicVariation &systematic) const
returns: whether this tool is affected by the given systematic
Definition: JetTileCorrectionTool.cxx:219
RJET
#define RJET
Definition: JetTileCorrectionTool.h:33
AthCommonDataStore< AthCommonMsg< AlgTool > >::declareProperty
Gaudi::Details::PropertyBase & declareProperty(Gaudi::Property< T > &t)
Definition: AthCommonDataStore.h:145
CP::JetTileCorrectionTool::m_user_dead_EB
std::map< std::string, JTC::Hole > m_user_dead_EB
Definition: JetTileCorrectionTool.h:152
JTC::TS::UNKNOWN
@ UNKNOWN
JTC::Hole::phi1
double phi1
Definition: IJetTileCorrectionTool.h:34
CP::JetTileCorrectionTool::JetTileCorrectionTool
JetTileCorrectionTool(const std::string &name)
Create a proper constructor for Athena.
Definition: JetTileCorrectionTool.cxx:44
JTC::TYPE::User
@ User
iov_aeta_max
const float iov_aeta_max
Definition: JetTileCorrectionTool.cxx:34
width
const double width
Definition: JetTileCorrectionTool.cxx:29
JTC::TYPE
TYPE
Definition: IJetTileCorrectionTool.h:29
asg
Definition: DataHandleTestTool.h:28
test_pyathena.pt
pt
Definition: test_pyathena.py:11
CP::SystematicSet
Class to wrap a set of SystematicVariations.
Definition: SystematicSet.h:31
M_PI
#define M_PI
Definition: ActiveFraction.h:11
CP::JetTileCorrectionTool::correctedCopy
virtual CorrectionCode correctedCopy(const xAOD::Jet &input, xAOD::Jet *&output)
Create a corrected copy from a constant jet.
Definition: JetTileCorrectionTool.cxx:194
asg::AsgMetadataTool::inputMetaStore
MetaStorePtr_t inputMetaStore() const
Accessor for the input metadata store.
Definition: AsgMetadataTool.cxx:88
CP::JetTileCorrectionTool::m_v_user_dead
std::vector< std::string > m_v_user_dead
Definition: JetTileCorrectionTool.h:133
xAOD::Jet_v1::jetP4
JetFourMom_t jetP4() const
The full 4-momentum of the particle : internal jet type.
Definition: Jet_v1.cxx:76
CP::JetTileCorrectionTool::m_db_dead_EB
std::map< std::string, JTC::Hole > m_db_dead_EB
Definition: JetTileCorrectionTool.h:150
CP::JetTileCorrectionTool::loadAllModules
StatusCode loadAllModules(const xAOD::Jet &jet, JTC::TS &status)
Definition: JetTileCorrectionTool.cxx:498
beamspotman.tokens
tokens
Definition: beamspotman.py:1284
CP::SystematicVariation
Definition: SystematicVariation.h:47
IPair
std::pair< int, int > IPair
Definition: IJetTileCorrectionTool.h:21
CP::JetTileCorrectionTool::m_appliedSystematics
CP::SystematicSet * m_appliedSystematics
Currently applied systematics.
Definition: JetTileCorrectionTool.h:160
Phi_mpi_pi
__HOSTDEV__ double Phi_mpi_pi(double)
Definition: GeoRegion.cxx:7
xAOD::EventInfo_v1::IS_SIMULATION
@ IS_SIMULATION
true: simulation, false: data
Definition: EventInfo_v1.h:151
CP::JetTileCorrectionTool::partModToHole
JTC::Hole partModToHole(int part, int mod)
Definition: JetTileCorrectionTool.cxx:619
CP::JetTileCorrectionTool::getCorrections
std::vector< float > getCorrections(const xAOD::Jet &j)
Definition: JetTileCorrectionTool.cxx:535
CP
Select isolated Photons, Electrons and Muons.
Definition: Control/xAODRootAccess/xAODRootAccess/TEvent.h:48
CP::SystematicSet::getParameterByBaseName
float getParameterByBaseName(const std::string &basename) const
returns: the parameter value for the given basename
Definition: SystematicSet.cxx:193
python.PyAthena.modname
modname
print (" ==> moduletype")
Definition: PyAthena.py:130
mapkey::sys
@ sys
Definition: TElectronEfficiencyCorrectionTool.cxx:42
xAOD::EventInfo_v1::runNumber
uint32_t runNumber() const
The current event's run number.
CP::JetTileCorrectionTool::m_pars_EB
std::map< int, TH1F * > m_pars_EB
Definition: JetTileCorrectionTool.h:148
xAOD::phi
setEt phi
Definition: TrigEMCluster_v1.cxx:29
xAOD::JetConstitScaleMomentum
@ JetConstitScaleMomentum
Definition: JetTypes.h:29
CP::JetTileCorrectionTool::~JetTileCorrectionTool
virtual ~JetTileCorrectionTool()
Destructor:
Definition: JetTileCorrectionTool.cxx:53
JTC::Hole::phi2
double phi2
Definition: IJetTileCorrectionTool.h:35
CP::JetTileCorrectionTool::m_bd_dead_mapFile
std::string m_bd_dead_mapFile
Definition: JetTileCorrectionTool.h:138
AthCommonDataStore< AthCommonMsg< AlgTool > >::evtStore
ServiceHandle< StoreGateSvc > & evtStore()
The standard StoreGateSvc (event store) Returns (kind of) a pointer to the StoreGateSvc.
Definition: AthCommonDataStore.h:85
CP::JetTileCorrectionTool::m_db_dead_LB
std::map< std::string, JTC::Hole > m_db_dead_LB
Definition: JetTileCorrectionTool.h:149
CP::CorrectionCode::OutOfValidityRange
@ OutOfValidityRange
Input object is out of validity range.
Definition: CorrectionCode.h:37
CP::CorrectionCode::Error
@ Error
Some error happened during the object correction.
Definition: CorrectionCode.h:36
EDGE
#define EDGE
Definition: BooleanProcessor.h:96
Pix_eta
#define Pix_eta
Definition: JetTileCorrectionTool.h:36
CP::JetTileCorrectionTool::recommendedSystematics
virtual SystematicSet recommendedSystematics() const
returns: the list of all systematics this tool recommends to use
Definition: JetTileCorrectionTool.cxx:236
CP::JetTileCorrectionTool::getModulePosition
IPair getModulePosition(const xAOD::Jet &jet, JTC::Hole module)
Definition: JetTileCorrectionTool.cxx:412
jet
Definition: JetCalibTools_PlotJESFactors.cxx:23
ATH_MSG_ERROR
#define ATH_MSG_ERROR(x)
Definition: AthMsgStreamMacros.h:33
maskDeadModules.mod
mod
Definition: maskDeadModules.py:36
SG::Decorator
Helper class to provide type-safe access to aux data.
Definition: Decorator.h:59
SystematicRegistry.h
h
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition: PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22
extractSporadic.h
list h
Definition: extractSporadic.py:97
ATH_MSG_DEBUG
#define ATH_MSG_DEBUG(x)
Definition: AthMsgStreamMacros.h:29
PlotPulseshapeFromCool.input
input
Definition: PlotPulseshapeFromCool.py:106
CP::JetTileCorrectionTool::m_rootFileName
std::string m_rootFileName
Definition: JetTileCorrectionTool.h:136
ATH_CHECK
#define ATH_CHECK
Definition: AthCheckMacros.h:40
run
Definition: run.py:1
CP::JetTileCorrectionTool::inHole
bool inHole(const xAOD::Jet &j, JTC::Hole rdead)
Definition: JetTileCorrectionTool.cxx:606
xAOD::double
double
Definition: CompositeParticle_v1.cxx:159
JTC::TYPE::DB
@ DB
CP::JetTileCorrectionTool::getTileStatus
JTC::TS getTileStatus(const xAOD::Jet &jet)
Definition: JetTileCorrectionTool.cxx:477
StatusCode.h
CP::JetTileCorrectionTool::m_current_run
int m_current_run
Definition: JetTileCorrectionTool.h:128
merge.output
output
Definition: merge.py:17
PIXWIDTH
#define PIXWIDTH
Definition: JetTileCorrectionTool.h:31
xAOD::JetFourMom_t
ROOT::Math::LorentzVector< ROOT::Math::PtEtaPhiM4D< double > > JetFourMom_t
Base 4 Momentum type for Jet.
Definition: JetTypes.h:17
CP::JetTileCorrectionTool::applyCorrection
virtual CorrectionCode applyCorrection(xAOD::Jet &object)
Apply the correction on a modifyable object.
Definition: JetTileCorrectionTool.cxx:147
PathResolver.h
CP::JetTileCorrectionTool::m_systFilter
std::unordered_map< CP::SystematicSet, CP::SystematicSet > m_systFilter
Systematics filter map.
Definition: JetTileCorrectionTool.h:157
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:228
CP::JetTileCorrectionTool::initialize
virtual StatusCode initialize()
Function initialising the tool.
Definition: JetTileCorrectionTool.cxx:61
iov_pt_min
const float iov_pt_min
Definition: JetTileCorrectionTool.cxx:32
CP::JetTileCorrectionTool::m_NbinsPt
int m_NbinsPt
Definition: JetTileCorrectionTool.h:131
CP::JetTileCorrectionTool::m_rootFile
TFile * m_rootFile
Definition: JetTileCorrectionTool.h:135
EventInfo.h
xAOD::EventInfo_v1
Class describing the basic event information.
Definition: EventInfo_v1.h:43
JTC::Hole
Definition: IJetTileCorrectionTool.h:31
PathResolverFindCalibFile
std::string PathResolverFindCalibFile(const std::string &logical_file_name)
Definition: PathResolver.cxx:431
JTC
Definition: IJetTileCorrectionTool.h:23
AthAnalysisHelper.h
python.AthDsoLogger.fname
string fname
Definition: AthDsoLogger.py:67
xAOD::Jet_v1
Class describing a jet.
Definition: Jet_v1.h:57
CP::CorrectionCode::Ok
@ Ok
The correction was done successfully.
Definition: CorrectionCode.h:38
CP::JetTileCorrectionTool::loadDeadDB
void loadDeadDB()
Definition: JetTileCorrectionTool.cxx:338
JTC::Hole::eta1
double eta1
Definition: IJetTileCorrectionTool.h:32
CP::JetTileCorrectionTool::m_user_dead_LB
std::map< std::string, JTC::Hole > m_user_dead_LB
Definition: JetTileCorrectionTool.h:151
ATH_MSG_WARNING
#define ATH_MSG_WARNING(x)
Definition: AthMsgStreamMacros.h:32
CP::SystematicRegistry
This module implements the central registry for handling systematic uncertainties with CP tools.
Definition: SystematicRegistry.h:25
python.CaloScaleNoiseConfig.type
type
Definition: CaloScaleNoiseConfig.py:78
Pix_phi
#define Pix_phi
Definition: JetTileCorrectionTool.h:37
CP::CorrectionCode
Return value from object correction CP tools.
Definition: CorrectionCode.h:31
JTC::PART
PART
Definition: IJetTileCorrectionTool.h:25
CP::JetTileCorrectionTool::m_position_masked
std::vector< JTC::Region > m_position_masked
Definition: JetTileCorrectionTool.h:140
CP::JetTileCorrectionTool::m_core_sys_LB
TH1F * m_core_sys_LB
//needs to be transient!
Definition: JetTileCorrectionTool.h:143
CxxUtils::atoi
int atoi(std::string_view str)
Helper functions to unpack numbers decoded in string into integers and doubles The strings are requir...
Definition: Control/CxxUtils/Root/StringUtils.cxx:85
JTC::TS::GOOD
@ GOOD
JTC::Hole::eta2
double eta2
Definition: IJetTileCorrectionTool.h:33
CP::JetTileCorrectionTool::loadDeadUser
void loadDeadUser()
Definition: JetTileCorrectionTool.cxx:287
Trk::jet_phi
@ jet_phi
Definition: JetVtxParamDefs.h:28
merge.status
status
Definition: merge.py:17
python.TrigEgammaMonitorHelper.TH1F
def TH1F(name, title, nxbins, bins_par2, bins_par3=None, path='', **kwargs)
Definition: TrigEgammaMonitorHelper.py:24
CP::JetTileCorrectionTool::addTileStatus
StatusCode addTileStatus(const xAOD::Jet &jet)
Definition: JetTileCorrectionTool.cxx:487
CP::JetTileCorrectionTool::overlap
JTC::TS overlap(const xAOD::Jet &j, JTC::Hole region)
Definition: JetTileCorrectionTool.cxx:268
CP::JetTileCorrectionTool::m_core_sys_EB
TH1F * m_core_sys_EB
Definition: JetTileCorrectionTool.h:144
CP::JetTileCorrectionTool::applySystematicVariation
virtual StatusCode applySystematicVariation(const SystematicSet &systConfig)
effects: configure this tool for the given list of systematic variations.
Definition: JetTileCorrectionTool.cxx:242
CP::JetTileCorrectionTool::affectingSystematics
virtual SystematicSet affectingSystematics() const
returns: the list of all systematics this tool can be affected by
Definition: JetTileCorrectionTool.cxx:226
JTC::PART::LB
@ LB
CP::JetTileCorrectionTool::m_isMC
bool m_isMC
Definition: JetTileCorrectionTool.h:126
SystematicVariation.h
CP::SystematicSet::filterForAffectingSystematics
static StatusCode filterForAffectingSystematics(const SystematicSet &systConfig, const SystematicSet &affectingSystematics, SystematicSet &filteredSystematics)
description: filter the systematics for the affected systematics returns: success guarantee: strong f...
Definition: SystematicSet.cxx:213
xAOD::EventInfo_v1::eventType
bool eventType(EventType type) const
Check for one particular bitmask value.
CP::JetTileCorrectionTool::setRJET
void setRJET(float r)
Definition: JetTileCorrectionTool.cxx:493
CP::SystematicRegistry::getInstance
static SystematicRegistry & getInstance()
Get the singleton instance of the registry for the curren thread.
Definition: SystematicRegistry.cxx:25
AthAnalysisHelper::retrieveMetadata
static std::string retrieveMetadata(const std::string &folder, const std::string &key, const ServiceHandle< StoreGateSvc > &inputMetaStore)
method that always returns as a string you can use from, e.g, pyROOT with evt = ROOT....
Definition: AthAnalysisHelper.h:254
CP::JetTileCorrectionTool::loadModulesFromMap
void loadModulesFromMap(const xAOD::Jet &jet, JTC::TS &status, const std::map< std::string, JTC::Hole > &hmap, JTC::PART part=JTC::PART::LB, JTC::TYPE type=JTC::TYPE::DB)
Definition: JetTileCorrectionTool.cxx:442