ATLAS Offline Software
Public Types | Public Member Functions | Static Public Member Functions | Private Member Functions | Static Private Member Functions | Private Attributes | Static Private Attributes | List of all members
egammaLayerRecalibTool Class Reference

#include <egammaLayerRecalibTool.h>

Inheritance diagram for egammaLayerRecalibTool:
Collaboration diagram for egammaLayerRecalibTool:

Public Types

typedef std::vector< std::pair< InputModifier *, GetAmountBase * > > ModifiersList
 

Public Member Functions

 egammaLayerRecalibTool (const std::string &name, const std::string &tune, int SaccEnable=1)
 
 egammaLayerRecalibTool (const std::string &tune, int SaccEnable=1)
 
 ~egammaLayerRecalibTool ()
 
CP::CorrectionCode applyCorrection (xAOD::Egamma &, const xAOD::EventInfo &event_info) const
 
CP::CorrectionCode scale_inputs (StdCalibrationInputs &inputs) const
 apply layer calibration to the More...
 
void add_scale (InputModifier *modifier, GetAmountBase *amount)
 add custom layer scale correction. More...
 
void add_scale (const std::string &scale)
 add scale correction from string. More...
 
void clear_corrections ()
 remove all the scale corrections More...
 
void fixForMissingCells (bool fix=true)
 
void scaleMC (bool scaleMC=true)
 
void disable_PSCorrections ()
 
void disable_S12Corrections ()
 
void disable_SaccCorrections ()
 
void setLevel (MSG::Level lvl)
 Change the current logging level. More...
 

Static Public Member Functions

static std::pair< std::string, egammaLayerRecalibTool * > create (const std::string &type, const std::string &args)
 helper to create a tool from a string (useful for command line arguments) More...
 

Private Member Functions

const std::string resolve_path (std::string filename) const
 
void initMessaging () const
 Initialize our message level and MessageSvc. More...
 

Static Private Member Functions

static std::string resolve_alias (const std::string &tune)
 

Private Attributes

std::string m_tune
 
bool m_doPSCorrections = true
 
bool m_doS12Corrections = true
 
bool m_doSaccCorrections = true
 
ModifiersList m_modifiers
 
corr_pileupShiftm_pileup_tool = nullptr
 
bool m_aodFixMissingCells = false
 
bool m_scaleMC = false
 
std::string m_nm
 Message source name. More...
 
boost::thread_specific_ptr< MsgStream > m_msg_tls
 MsgStream instance (a std::cout like with print-out levels) More...
 
std::atomic< IMessageSvc * > m_imsg { nullptr }
 MessageSvc pointer. More...
 
std::atomic< MSG::Level > m_lvl { MSG::NIL }
 Current logging level. More...
 
std::atomic_flag m_initialized ATLAS_THREAD_SAFE = ATOMIC_FLAG_INIT
 Messaging initialized (initMessaging) More...
 

Static Private Attributes

static const unsigned int m_Run2Run3runNumberTransition = 400000
 

Detailed Description

Definition at line 282 of file egammaLayerRecalibTool.h.

Member Typedef Documentation

◆ ModifiersList

Definition at line 285 of file egammaLayerRecalibTool.h.

Constructor & Destructor Documentation

◆ egammaLayerRecalibTool() [1/2]

egammaLayerRecalibTool::egammaLayerRecalibTool ( const std::string &  name,
const std::string &  tune,
int  SaccEnable = 1 
)
Parameters
tunestring to configure the tuning
  • "" the tool has no effect
  • as default it is "current_default"
  • "test1" just for testing

Definition at line 947 of file egammaLayerRecalibTool.cxx.

949 {
950  add_scale(tune);
951 }

◆ egammaLayerRecalibTool() [2/2]

egammaLayerRecalibTool::egammaLayerRecalibTool ( const std::string &  tune,
int  SaccEnable = 1 
)

Definition at line 954 of file egammaLayerRecalibTool.cxx.

955  : egammaLayerRecalibTool("egammaLayerRecalibTool", tune, SaccEnable) { }

◆ ~egammaLayerRecalibTool()

egammaLayerRecalibTool::~egammaLayerRecalibTool ( )
inline

Definition at line 294 of file egammaLayerRecalibTool.h.

294 { clear_corrections(); delete m_pileup_tool; }

Member Function Documentation

◆ add_scale() [1/2]

void egammaLayerRecalibTool::add_scale ( const std::string &  scale)

add scale correction from string.

Can be called multiple times. The list of valid values is on the twiki

Definition at line 245 of file egammaLayerRecalibTool.cxx.

246 {
247  ATH_MSG_INFO("using scale " << tuneIn);
248  std::string tune = resolve_alias(tuneIn);
249 
250  if (tune.empty()) { }
251  // R22 layer tune with fixed E1E2 and repeated acc
252  else if ("es2022_22.0_Precision_v1" == tune) {
253  add_scale("run2_alt_with_layer2_r22_Precision_v1");
254  }
255  else if ("es2022_22.0_Precision" == tune) {
256  add_scale("run2_alt_with_layer2_r22_Precision");
257  }
258  else if ("es2018_21.0_v0" == tune) {
259  add_scale("run2_alt_with_layer2_r21_v1");
260  }
261  else if ("es2017_21.0_v0" == tune) {
262  add_scale("run2_alt_with_layer2_r21_v0");
263  }
264  else if ("es2017_20.7_final" == tune) {
265  add_scale("pileup_20.7");
266  add_scale("run2_alt_with_layer2_modif");
267  }
268  else if ("es2017_20.7_improved" == tune) {
269  add_scale("pileup_20.7"); // new pileup correction Guillaume for 20.7
270  //TEMPORARY HACK REMOVED (two intermediate tags with this ES model use different layer corrections)
271  add_scale("2012_alt_with_layer2_modif"); // temporary old corrections from run1 + EMECPS HV
272  }
273  else if ("pileup_20.7" == tune) {
279  }
280  //Run 2 release 22 with fixed E1E2 and repeated acc
281  else if ("run2_alt_with_layer2_r22_Precision_v1"==tune) {
282  add_scale("layer2_alt_el_mu_comb_r21_v0_fix");
283  add_scale("ps_mu_r21_v0");
284  if(m_doSaccCorrections) add_scale("acc_zee_r22_v1");
285  }
286  //Run 2 release 22
287  else if ("run2_alt_with_layer2_r22_Precision"==tune) {
288  add_scale("layer2_alt_el_mu_comb_r21_v0");
289  add_scale("ps_mu_r21_v0");
290  if(m_doSaccCorrections) add_scale("acc_zee_r22_v0");
291  }
292  else if ("run2_alt_with_layer2_r21_v1"==tune) {
293  add_scale("layer2_alt_run2_r21_v1");
294  add_scale("ps_2016_r21_v0");
295  }
296  else if ("run2_alt_with_layer2_r21_v0"==tune) {
297  add_scale("layer2_alt_run2_r21_v0");
298  add_scale("ps_2016_r21_v0");
299  }
300  else if("run2_alt_with_layer2_modif" == tune) {
301  add_scale("ps_EMECHV1");
302  add_scale("layer2_alt_run2_v1");
303  add_scale("ps_2016");
304  }
305  // 2012
306  else if ("2012" == tune) {
307  add_scale("ps_HV1");
308  add_scale("layer1_2012");
309  add_scale("ps_2012");
310  }
311  else if("2012_with_layer2" == tune) {
312  add_scale("ps_HV1");
313  add_scale("layer2_2012_v5");
314  add_scale("ps_2012");
315  }
316  else if ("2012_alt" == tune) {
317  add_scale("ps_HV1");
318  add_scale("layer1_alt_2012");
319  add_scale("ps_2012");
320  }
321  else if("2012_alt_with_layer2" == tune) {
322  add_scale("ps_HV1");
323  add_scale("layer2_alt_2012_v5");
324  add_scale("ps_2012");
325  }
326  else if("2012_alt_with_layer2_modif" == tune) {
327  add_scale("ps_HV1");
328  add_scale("ps_EMECHV1");
329  add_scale("layer2_alt_2012_v5");
330  add_scale("ps_2012");
331  }
332  else if("2010_with_layer2" == tune) {
333  add_scale("layer2_2010_v5");
334  add_scale("ps_2010");
335  }
336  else if ("2012_layer1_up" == tune) {
337  add_scale("ps_HV1");
338  add_scale("layer1_2012_up");
339  add_scale("ps_2012");
340  }
341  else if ("2012_layer1_down" == tune) {
342  add_scale("ps_HV1");
343  add_scale("layer1_2012_down");
344  add_scale("ps_2012");
345  }
346  else if ("2012_layer1_errup" == tune) {
347  add_scale("layer1_2012_errup");
348  }
349  else if ("2012_layer1_errdown" == tune) {
350  add_scale("layer1_2012_errdown");
351  }
352  else if ("2012_ps_down" == tune) {
353  add_scale("ps_HV1");
354  add_scale("layer1_2012");
355  add_scale("ps_2012_down");
356  }
357  else if ("2012_ps_up" == tune) {
358  add_scale("ps_HV1");
359  add_scale("layer1_2012");
360  add_scale("ps_2012_up");
361  }
362  else if ("2012_ps_errdown" == tune) {
363  add_scale("ps_2012_errdown");
364  }
365  else if ("2012_ps_errup" == tune) {
366  add_scale("ps_2012_errup");
367  }
368  else if ("2012_up" == tune) {
369  add_scale("ps_HV1");
370  add_scale("layer1_2012_up");
371  add_scale("ps_2012_up");
372  }
373  else if ("2012_down" == tune) {
374  add_scale("ps_HV1");
375  add_scale("layer1_2012_down");
376  add_scale("ps_2012_down");
377  }
378  else if ("2012_errup" == tune) {
379  add_scale("layer1_2012_errup");
380  add_scale("ps_2012_errup");
381  }
382  else if ("2012_errdown" == tune) {
383  add_scale("layer1_2012_errdown");
384  add_scale("ps_2012_errdown");
385  }
386  // 2011
387  else if ("2011" == tune) {
388  add_scale("layer1_2011");
389  add_scale("ps_2011");
390  }
391  else if("2011_with_layer2" == tune) {
392  add_scale("layer2_2011_v5");
393  add_scale("ps_2011");
394  }
395  else if ("2011_alt" == tune) {
396  add_scale("layer1_alt_2011");
397  add_scale("ps_2011");
398  }
399  else if("2011_alt_with_layer2" == tune) {
400  add_scale("layer2_alt_2011_v5");
401  add_scale("ps_2011");
402  }
403  else if ("2011_layer1_up" == tune) {
404  add_scale("layer1_2011_up");
405  add_scale("ps_2011");
406  }
407  else if ("2011_layer1_down" == tune) {
408  add_scale("layer1_2011_down");
409  add_scale("ps_2011");
410  }
411  else if ("2011_layer1_errup" == tune) {
412  add_scale("layer1_2011_errup");
413  }
414  else if ("2011_layer1_errdown" == tune) {
415  add_scale("layer1_2011_errdown");
416  }
417  else if ("2011_ps_down" == tune) {
418  add_scale("layer1_2011");
419  add_scale("ps_2011_down");
420  }
421  else if ("2011_ps_up" == tune) {
422  add_scale("layer1_2011");
423  add_scale("ps_2011_up");
424  }
425  else if ("2011_ps_errdown" == tune) {
426  add_scale("ps_2011_errdown");
427  }
428  else if ("2011_ps_errup" == tune) {
429  add_scale("ps_2011_errup");
430  }
431  else if ("2011_up" == tune) {
432  add_scale("layer1_2011_up");
433  add_scale("ps_2011_up");
434  }
435  else if ("2011_down" == tune) {
436  add_scale("layer1_2011_down");
437  add_scale("ps_2011_down");
438  }
439  else if ("2011_errup" == tune) {
440  add_scale("layer1_2011_errup");
441  add_scale("ps_2011_errup");
442  }
443  else if ("2011_errdown" == tune) {
444  add_scale("layer1_2011_errdown");
445  add_scale("ps_2011_errdown");
446  }
447  // 2010
448  else if ("2010" == tune) {
449  add_scale("layer1_2010");
450  add_scale("ps_2010");
451  }
452  else if ("2010_layer1_up" == tune) {
453  add_scale("layer1_2010_up");
454  add_scale("ps_2010");
455  }
456  else if ("2010_layer1_down" == tune) {
457  add_scale("layer1_2010_down");
458  add_scale("ps_2010");
459  }
460  else if ("2010_layer1_errup" == tune) {
461  add_scale("layer1_2010_errup");
462  }
463  else if ("2010_layer1_errdown" == tune) {
464  add_scale("layer1_2010_errdown");
465  }
466  else if ("2010_ps_down" == tune) {
467  add_scale("layer1_2010");
468  add_scale("ps_2010_down");
469  }
470  else if ("2010_ps_up" == tune) {
471  add_scale("layer1_2010");
472  add_scale("ps_2010_up");
473  }
474  else if ("2010_ps_errdown" == tune) {
475  add_scale("ps_2010_errdown");
476  }
477  else if ("2010_ps_errup" == tune) {
478  add_scale("ps_2010_errup");
479  }
480  else if ("2010_up" == tune) {
481  add_scale("layer1_2010_up");
482  add_scale("ps_2010_up");
483  }
484  else if ("2010_down" == tune) {
485  add_scale("layer1_2010_down");
486  add_scale("ps_2010_down");
487  }
488  else if ("2010_errup" == tune) {
489  add_scale("layer1_2010_errup");
490  add_scale("ps_2010_errup");
491  }
492  else if ("2010_errdown" == tune) {
493  add_scale("layer1_2010_errdown");
494  add_scale("ps_2010_errdown");
495  }
496  else if ("ps_HV1" == tune) {
498  }
499  else if ("ps_EMECHV1" == tune) {
501  }
502  else if ("test1" == tune) {
503  TH1F h_presampler("h_presampler", "h_presampler", 10, -2.5, 2.5);
504  // just as an example, correct E0 by 0.1 * sign(eta)
505  // and E1 by 1%
506  for (int ibin = 1; ibin <= 5; ++ibin) {
507  h_presampler.SetBinContent(ibin, -0.1);
508  h_presampler.SetBinContent(ibin + 5, 0.1);
509  }
512  }
513  // repeated acc scale based on layer2_alt_el_mu_comb_r21_v0_fix
514  else if ("acc_zee_r22_v1" == tune) {
515  const std::string file = PathResolverFindCalibFile("egammaLayerRecalibTool/v12/egammaLayerRecalibTunes.root");
516  TFile f(file.c_str());
517  TH2F* histo_acc = static_cast<TH2F*>(f.Get("hACC_Zee_rel22"));
518  assert(histo_acc);
520  new GetAmountHisto2DEtaCaloRunNumber(*histo_acc));
521  }
522  else if ("acc_zee_r22_v0" == tune) {
523  const std::string file = PathResolverFindCalibFile("egammaLayerRecalibTool/v11/egammaLayerRecalibTunes.root");
524  TFile f(file.c_str());
525  TH2F* histo_acc = static_cast<TH2F*>(f.Get("hACC_Zee_rel22"));
526  assert(histo_acc);
528  new GetAmountHisto2DEtaCaloRunNumber(*histo_acc));
529  }
530  else if ("layer1_1" == tune) {
531  TFormula f("formula_layer1_1", "(abs(x)<1.425) ? 0.97 : 1");
533  }
534  else if ("layer1_2" == tune) {
535  TFormula f("formula_layer1_2", "(abs(x)<1.425) ? 0.97 : 1.05");
537  }
538  else if ("layer1_alt_2012_v5" == tune) {
539  const std::string file = PathResolverFindCalibFile("egammaLayerRecalibTool/v1/egammaLayerRecalibTunes.root");
540  TFile f(file.c_str());
541  TH1* histo = checked_cast<TH1*>(f.Get("hE1E2ave_alt_2012"));
543  new GetAmountHisto1D(*histo));
544  }
545  else if ("layer1_2012_v5" == tune) {
546  const std::string file = PathResolverFindCalibFile("egammaLayerRecalibTool/v1/egammaLayerRecalibTunes.root");
547  TFile f(file.c_str());
548  TH1* histo = checked_cast<TH1*>(f.Get("hE1E2ave_2012"));
550  new GetAmountHisto1D(*histo));
551  }
552  else if ("layer1_2012_v5_down" == tune) {
553  const std::string file = PathResolverFindCalibFile("egammaLayerRecalibTool/v1/egammaLayerRecalibTunes.root");
554  TFile f(file.c_str());
555  TH1* histo = checked_cast<TH1*>(f.Get("hE1E2ave_2012"));
557  new GetAmountHisto1DUp(*histo));
558  }
559  else if ("layer1_2012_v5_up" == tune) {
560  const std::string file = PathResolverFindCalibFile("egammaLayerRecalibTool/v1/egammaLayerRecalibTunes.root");
561  TFile f(file.c_str());
562  TH1* histo = checked_cast<TH1*>(f.Get("hE1E2ave_2012"));
565  }
566  else if ("layer1_2012_v5_errdown" == tune) {
567  const std::string file = PathResolverFindCalibFile("egammaLayerRecalibTool/v1/egammaLayerRecalibTunes.root");
568  TFile f(file.c_str());
569  TH1* histo = checked_cast<TH1*>(f.Get("hE1E2ave_2012"));
572  }
573  else if ("layer1_2012_v5_errup" == tune) {
574  const std::string file = PathResolverFindCalibFile("egammaLayerRecalibTool/v1/egammaLayerRecalibTunes.root");
575  TFile f(file.c_str());
576  TH1* histo = checked_cast<TH1*>(f.Get("hE1E2ave_2012"));
579  }
580  else if ("layer1_alt_2011_v5" == tune) {
581  const std::string file = PathResolverFindCalibFile("egammaLayerRecalibTool/v1/egammaLayerRecalibTunes.root");
582  TFile f(file.c_str());
583  TH1* histo = checked_cast<TH1*>(f.Get("hE1E2ave_alt_2011"));
585  new GetAmountHisto1D(*histo));
586  }
587  else if ("layer1_2011_v5" == tune) {
588  const std::string file = PathResolverFindCalibFile("egammaLayerRecalibTool/v1/egammaLayerRecalibTunes.root");
589  TFile f(file.c_str());
590  TH1* histo = checked_cast<TH1*>(f.Get("hE1E2ave_2011"));
592  new GetAmountHisto1D(*histo));
593  }
594  else if ("layer1_2011_v5_down" == tune) {
595  const std::string file = PathResolverFindCalibFile("egammaLayerRecalibTool/v1/egammaLayerRecalibTunes.root");
596  TFile f(file.c_str());
597  TH1* histo = checked_cast<TH1*>(f.Get("hE1E2ave_2011"));
599  new GetAmountHisto1DUp(*histo));
600  }
601  else if ("layer1_2011_v5_up" == tune) {
602  const std::string file = PathResolverFindCalibFile("egammaLayerRecalibTool/v1/egammaLayerRecalibTunes.root");
603  TFile f(file.c_str());
604  TH1* histo = checked_cast<TH1*>(f.Get("hE1E2ave_2011"));
607  }
608  else if ("layer1_2011_v5_errdown" == tune) {
609  const std::string file = PathResolverFindCalibFile("egammaLayerRecalibTool/v1/egammaLayerRecalibTunes.root");
610  TFile f(file.c_str());
611  TH1* histo = checked_cast<TH1*>(f.Get("hE1E2ave_2011"));
614  }
615  else if ("layer1_2011_v5_errup" == tune) {
616  const std::string file = PathResolverFindCalibFile("egammaLayerRecalibTool/v1/egammaLayerRecalibTunes.root");
617  TFile f(file.c_str());
618  TH1* histo = checked_cast<TH1*>(f.Get("hE1E2ave_2011"));
621  }
622  else if ("layer1_2010_v5" == tune) {
623  const std::string file = PathResolverFindCalibFile("egammaLayerRecalibTool/v1/egammaLayerRecalibTunes.root");
624  TFile f(file.c_str());
625  TH1* histo = checked_cast<TH1*>(f.Get("hE1E2ave_2010"));
627  new GetAmountHisto1D(*histo));
628  }
629  else if ("layer1_2010_v5_down" == tune) {
630  const std::string file = PathResolverFindCalibFile("egammaLayerRecalibTool/v1/egammaLayerRecalibTunes.root");
631  TFile f(file.c_str());
632  TH1* histo = checked_cast<TH1*>(f.Get("hE1E2ave_2010"));
634  new GetAmountHisto1DUp(*histo));
635  }
636  else if ("layer1_2010_v5_up" == tune) {
637  const std::string file = PathResolverFindCalibFile("egammaLayerRecalibTool/v1/egammaLayerRecalibTunes.root");
638  TFile f(file.c_str());
639  TH1* histo = checked_cast<TH1*>(f.Get("hE1E2ave_2010"));
642  }
643  else if ("layer1_2010_v5_errdown" == tune) {
644  const std::string file = PathResolverFindCalibFile("egammaLayerRecalibTool/v1/egammaLayerRecalibTunes.root");
645  TFile f(file.c_str());
646  TH1* histo = checked_cast<TH1*>(f.Get("hE1E2ave_2010"));
649  }
650  else if ("layer1_2010_v5_errup" == tune) {
651  const std::string file = PathResolverFindCalibFile("egammaLayerRecalibTool/v1/egammaLayerRecalibTunes.root");
652  TFile f(file.c_str());
653  TH1* histo = checked_cast<TH1*>(f.Get("hE1E2ave_2010"));
656  }
657  // fix E1E2 scale from R21 precision model
658  else if("layer2_alt_el_mu_comb_r21_v0_fix"==tune) {
659  const std::string file = PathResolverFindCalibFile("egammaLayerRecalibTool/v12/egammaLayerRecalibTunes.root");
660  TFile f(file.c_str());
661  TH1D* histo = static_cast<TH1D*>(f.Get("hE1E2_emu_run2_rel21_v0_fix"));
662  assert(histo);
664  new GetAmountHisto1D(*histo));
665  }
666  else if("layer2_alt_el_mu_comb_r21_v0"==tune) {
667  const std::string file = PathResolverFindCalibFile("egammaLayerRecalibTool/v11/egammaLayerRecalibTunes.root");
668  TFile f(file.c_str());
669  TH1D* histo = static_cast<TH1D*>(f.Get("hE1E2_emu_run2_rel21_v0"));
670  assert(histo);
672  new GetAmountHisto1D(*histo));
673  }
674  else if("layer2_alt_run2_r21_v1"==tune) {
675  const std::string file = PathResolverFindCalibFile("egammaLayerRecalibTool/v6/egammaLayerRecalibTunes.root");
676  TFile f(file.c_str());
677  TH1* histo = checked_cast<TH1*>(f.Get("hE1E2_mu_run2_rel21_v1"));
679  new GetAmountHisto1D(*histo));
680  }
681  else if("layer2_alt_run2_r21_v0"==tune) {
682  const std::string file = PathResolverFindCalibFile("egammaLayerRecalibTool/v5/egammaLayerRecalibTunes.root");
683  TFile f(file.c_str());
684  TH1* histo = checked_cast<TH1*>(f.Get("hE1E2mu_2016_rel21_v1"));
686  new GetAmountHisto1D(*histo));
687  }
688  else if("layer2_alt_run2_v1" == tune) {
689  const std::string file = PathResolverFindCalibFile("egammaLayerRecalibTool/v3/egammaLayerRecalibTunes.root");
690  TFile f(file.c_str());
691  TH1* histo = checked_cast<TH1*>(f.Get("hE1E2mu_2016_v1"));
693  new GetAmountHisto1D(*histo));
694  }
695  else if("layer2_alt_2012_v5" == tune) {
696  const std::string file = PathResolverFindCalibFile("egammaLayerRecalibTool/v1/egammaLayerRecalibTunes.root");
697  TFile f(file.c_str());
698  TH1* histo = checked_cast<TH1*>(f.Get("hE1E2ave_alt_2012"));
700  new GetAmountHisto1D(*histo));
701  }
702  else if("layer2_2012_v5" == tune) {
703  const std::string file = PathResolverFindCalibFile("egammaLayerRecalibTool/v1/egammaLayerRecalibTunes.root");
704  TFile f(file.c_str());
705  TH1* histo = checked_cast<TH1*>(f.Get("hE1E2ave_2012"));
707  new GetAmountHisto1D(*histo));
708  }
709  else if("layer2_2012_v5_down" == tune) {
710  const std::string file = PathResolverFindCalibFile("egammaLayerRecalibTool/v1/egammaLayerRecalibTunes.root");
711  TFile f(file.c_str());
712  TH1* histo = checked_cast<TH1*>(f.Get("hE1E2ave_2012"));
715  }
716  else if("layer2_2012_v5_up" == tune) {
717  const std::string file = PathResolverFindCalibFile("egammaLayerRecalibTool/v1/egammaLayerRecalibTunes.root");
718  TFile f(file.c_str());
719  TH1* histo = checked_cast<TH1*>(f.Get("hE1E2ave_2012"));
721  new GetAmountHisto1DUp(*histo));
722  }
723  else if ("layer2_2012_v5_errdown" == tune) {
724  const std::string file = PathResolverFindCalibFile("egammaLayerRecalibTool/v1/egammaLayerRecalibTunes.root");
725  TFile f(file.c_str());
726  TH1* histo = checked_cast<TH1*>(f.Get("hE1E2ave_2012"));
729  }
730  else if ("layer2_2012_v5_errup" == tune) {
731  const std::string file = PathResolverFindCalibFile("egammaLayerRecalibTool/v1/egammaLayerRecalibTunes.root");
732  TFile f(file.c_str());
733  TH1* histo = checked_cast<TH1*>(f.Get("hE1E2ave_2012"));
736  }
737  else if("layer2_alt_2011_v5" == tune) {
738  const std::string file = PathResolverFindCalibFile("egammaLayerRecalibTool/v1/egammaLayerRecalibTunes.root");
739  TFile f(file.c_str());
740  TH1* histo = checked_cast<TH1*>(f.Get("hE1E2ave_alt_2011"));
742  new GetAmountHisto1D(*histo));
743  }
744  else if("layer2_2011_v5" == tune) {
745  const std::string file = PathResolverFindCalibFile("egammaLayerRecalibTool/v1/egammaLayerRecalibTunes.root");
746  TFile f(file.c_str());
747  TH1* histo = checked_cast<TH1*>(f.Get("hE1E2ave_2011"));
749  new GetAmountHisto1D(*histo));
750  }
751  else if("layer2_2011_v5_down" == tune) {
752  const std::string file = PathResolverFindCalibFile("egammaLayerRecalibTool/v1/egammaLayerRecalibTunes.root");
753  TFile f(file.c_str());
754  TH1* histo = checked_cast<TH1*>(f.Get("hE1E2ave_2011"));
757  }
758  else if("layer2_2011_v5_up" == tune) {
759  const std::string file = PathResolverFindCalibFile("egammaLayerRecalibTool/v1/egammaLayerRecalibTunes.root");
760  TFile f(file.c_str());
761  TH1* histo = checked_cast<TH1*>(f.Get("hE1E2ave_2011"));
763  new GetAmountHisto1DUp(*histo));
764  }
765  else if ("layer2_2011_v5_errdown" == tune) {
766  const std::string file = PathResolverFindCalibFile("egammaLayerRecalibTool/v1/egammaLayerRecalibTunes.root");
767  TFile f(file.c_str());
768  TH1* histo = checked_cast<TH1*>(f.Get("hE1E2ave_2011"));
771  }
772  else if ("layer2_2011_v5_errup" == tune) {
773  const std::string file = PathResolverFindCalibFile("egammaLayerRecalibTool/v1/egammaLayerRecalibTunes.root");
774  TFile f(file.c_str());
775  TH1* histo = checked_cast<TH1*>(f.Get("hE1E2ave_2011"));
778  }
779  else if("layer2_2010_v5" == tune) {
780  const std::string file = PathResolverFindCalibFile("egammaLayerRecalibTool/v1/egammaLayerRecalibTunes.root");
781  TFile f(file.c_str());
782  TH1* histo = checked_cast<TH1*>(f.Get("hE1E2ave_2010"));
784  new GetAmountHisto1D(*histo));
785  }
786  else if("layer2_2010_v5_down" == tune) {
787  const std::string file = PathResolverFindCalibFile("egammaLayerRecalibTool/v1/egammaLayerRecalibTunes.root");
788  TFile f(file.c_str());
789  TH1* histo = checked_cast<TH1*>(f.Get("hE1E2ave_2010"));
792  }
793  else if("layer2_2010_v5_up" == tune) {
794  const std::string file = PathResolverFindCalibFile("egammaLayerRecalibTool/v1/egammaLayerRecalibTunes.root");
795  TFile f(file.c_str());
796  TH1* histo = checked_cast<TH1*>(f.Get("hE1E2ave_2010"));
798  new GetAmountHisto1DUp(*histo));
799  }
800  else if ("layer2_2010_v5_errdown" == tune) {
801  const std::string file = PathResolverFindCalibFile("egammaLayerRecalibTool/v1/egammaLayerRecalibTunes.root");
802  TFile f(file.c_str());
803  TH1* histo = checked_cast<TH1*>(f.Get("hE1E2ave_2010"));
806  }
807  else if ("layer2_2010_v5_errup" == tune) {
808  const std::string file = PathResolverFindCalibFile("egammaLayerRecalibTool/v1/egammaLayerRecalibTunes.root");
809  TFile f(file.c_str());
810  TH1* histo = checked_cast<TH1*>(f.Get("hE1E2ave_2010"));
813  }
814  else if ("ps_2016_r21_v0" == tune) {
815  const std::string file = PathResolverFindCalibFile("egammaLayerRecalibTool/v5/egammaLayerRecalibTunes.root");
816  TFile f(file.c_str());
817  TH1* histo_ps_tot_error = checked_cast<TH1*>(f.Get("hPS_2016_rel21"));
819  new GetAmountHisto1D(*histo_ps_tot_error));
820  }
821  else if ("ps_mu_r21_v0" == tune) {
822  const std::string file = PathResolverFindCalibFile("egammaLayerRecalibTool/v11/egammaLayerRecalibTunes.root");
823  TFile f(file.c_str());
824  TH1F* histo_ps_tot_error = static_cast<TH1F*>(f.Get("hPS_MuonLowMu_rel21"));
825  assert(histo_ps_tot_error);
827  new GetAmountHisto1D(*histo_ps_tot_error));
828  }
829  else if ("ps_2016_v1" == tune) {
830  const std::string file = PathResolverFindCalibFile("egammaLayerRecalibTool/v4/egammaLayerRecalibTunes.root");
831  TFile f(file.c_str());
832  TH1* histo_ps_tot_error = checked_cast<TH1*>(f.Get("hPS_2016"));
834  new GetAmountHisto1D(*histo_ps_tot_error));
835  }
836  else if ("ps_2012_v3" == tune) {
837  const std::string file = PathResolverFindCalibFile("egammaLayerRecalibTool/v1/egammaLayerRecalibTunes.root");
838  TFile f(file.c_str());
839  TH1* histo_ps_tot_error = checked_cast<TH1*>(f.Get("hPS_2012"));
841  new GetAmountHisto1D(*histo_ps_tot_error));
842  }
843  else if ("ps_2012_v3_down" == tune) {
844  const std::string file = PathResolverFindCalibFile("egammaLayerRecalibTool/v1/egammaLayerRecalibTunes.root");
845  TFile f(file.c_str());
846  TH1* histo_ps_tot_error = checked_cast<TH1*>(f.Get("hPS_2012"));
848  new GetAmountHisto1DUp(*histo_ps_tot_error));
849  }
850  else if ("ps_2012_v3_up" == tune){
851  const std::string file = PathResolverFindCalibFile("egammaLayerRecalibTool/v1/egammaLayerRecalibTunes.root");
852  TFile f(file.c_str());
853  TH1* histo_ps_tot_error = checked_cast<TH1*>(f.Get("hPS_2012"));
855  new GetAmountHisto1DDown(*histo_ps_tot_error));
856  }
857  else if ("ps_2012_v3_errdown" == tune){
858  const std::string file = PathResolverFindCalibFile("egammaLayerRecalibTool/v1/egammaLayerRecalibTunes.root");
859  TFile f(file.c_str());
860  TH1* histo_ps_tot_error = checked_cast<TH1*>(f.Get("hPS_2012"));
862  new GetAmountHisto1DErrorUp(*histo_ps_tot_error));
863  }
864  else if ("ps_2012_v3_errup" == tune){
865  const std::string file = PathResolverFindCalibFile("egammaLayerRecalibTool/v1/egammaLayerRecalibTunes.root");
866  TFile f(file.c_str());
867  TH1* histo_ps_tot_error = checked_cast<TH1*>(f.Get("hPS_2012"));
869  new GetAmountHisto1DErrorDown(*histo_ps_tot_error));
870  }
871  else if ("ps_2011_v3" == tune) {
872  const std::string file = PathResolverFindCalibFile("egammaLayerRecalibTool/v1/egammaLayerRecalibTunes.root");
873  TFile f(file.c_str());
874  TH1* histo_ps_tot_error = checked_cast<TH1*>(f.Get("hPS_2011"));
876  new GetAmountHisto1D(*histo_ps_tot_error));
877  }
878  else if ("ps_2011_v3_down" == tune) {
879  const std::string file = PathResolverFindCalibFile("egammaLayerRecalibTool/v1/egammaLayerRecalibTunes.root");
880  TFile f(file.c_str());
881  TH1* histo_ps_tot_error = checked_cast<TH1*>(f.Get("hPS_2011"));
883  new GetAmountHisto1DUp(*histo_ps_tot_error));
884  }
885  else if ("ps_2011_v3_up" == tune){
886  const std::string file = PathResolverFindCalibFile("egammaLayerRecalibTool/v1/egammaLayerRecalibTunes.root");
887  TFile f(file.c_str());
888  TH1* histo_ps_tot_error = checked_cast<TH1*>(f.Get("hPS_2011"));
890  new GetAmountHisto1DDown(*histo_ps_tot_error));
891  }
892  else if ("ps_2011_v3_errdown" == tune){
893  const std::string file = PathResolverFindCalibFile("egammaLayerRecalibTool/v1/egammaLayerRecalibTunes.root");
894  TFile f(file.c_str());
895  TH1* histo_ps_tot_error = checked_cast<TH1*>(f.Get("hPS_2011"));
897  new GetAmountHisto1DErrorUp(*histo_ps_tot_error));
898  }
899  else if ("ps_2011_v3_errup" == tune){
900  const std::string file = PathResolverFindCalibFile("egammaLayerRecalibTool/v1/egammaLayerRecalibTunes.root");
901  TFile f(file.c_str());
902  TH1* histo_ps_tot_error = checked_cast<TH1*>(f.Get("hPS_2011"));
904  new GetAmountHisto1DErrorDown(*histo_ps_tot_error));
905  }
906  // 2010
907  else if ("ps_2010_v3" == tune) {
908  const std::string file = PathResolverFindCalibFile("egammaLayerRecalibTool/v1/egammaLayerRecalibTunes.root");
909  TFile f(file.c_str());
910  TH1* histo_ps_tot_error = checked_cast<TH1*>(f.Get("hPS_2010"));
912  new GetAmountHisto1D(*histo_ps_tot_error));
913  }
914  else if ("ps_2010_v3_down" == tune) {
915  const std::string file = PathResolverFindCalibFile("egammaLayerRecalibTool/v1/egammaLayerRecalibTunes.root");
916  TFile f(file.c_str());
917  TH1* histo_ps_tot_error = checked_cast<TH1*>(f.Get("hPS_2010"));
919  new GetAmountHisto1DUp(*histo_ps_tot_error));
920  }
921  else if ("ps_2010_v3_up" == tune) {
922  const std::string file = PathResolverFindCalibFile("egammaLayerRecalibTool/v1/egammaLayerRecalibTunes.root");
923  TFile f(file.c_str());
924  TH1* histo_ps_tot_error = checked_cast<TH1*>(f.Get("hPS_2010"));
926  new GetAmountHisto1DDown(*histo_ps_tot_error));
927  }
928  else if ("ps_2010_v3_errdown" == tune){
929  const std::string file = PathResolverFindCalibFile("egammaLayerRecalibTool/v1/egammaLayerRecalibTunes.root");
930  TFile f(file.c_str());
931  TH1* histo_ps_tot_error = checked_cast<TH1*>(f.Get("hPS_2010"));
933  new GetAmountHisto1DErrorUp(*histo_ps_tot_error));
934  }
935  else if ("ps_2010_v3_errup" == tune){
936  const std::string file = PathResolverFindCalibFile("egammaLayerRecalibTool/v1/egammaLayerRecalibTunes.root");
937  TFile f(file.c_str());
938  TH1* histo_ps_tot_error = checked_cast<TH1*>(f.Get("hPS_2010"));
940  new GetAmountHisto1DErrorDown(*histo_ps_tot_error));
941  }
942  else {
943  throw std::runtime_error(tune+" is not a valid tune");
944  }
945 }

◆ add_scale() [2/2]

void egammaLayerRecalibTool::add_scale ( InputModifier modifier,
GetAmountBase amount 
)

add custom layer scale correction.

Can be called multiple times.

Definition at line 958 of file egammaLayerRecalibTool.cxx.

959 {
960  m_modifiers.emplace_back(modifier, amount);
961 }

◆ applyCorrection()

CP::CorrectionCode egammaLayerRecalibTool::applyCorrection ( xAOD::Egamma particle,
const xAOD::EventInfo event_info 
) const

Definition at line 977 of file egammaLayerRecalibTool.cxx.

978 {
979  const xAOD::CaloCluster* cluster = particle.caloCluster();
980  if (!cluster) {
981  ATH_MSG_ERROR("egamma particle without CaloCluster");
983  }
984 
985  std::string fixT = "";
986  double addE2 = 0, addE3 = 0;
987  if (m_aodFixMissingCells &&
988  event_info.runNumber() > m_Run2Run3runNumberTransition) {
989  fixT = "_egFixForTopoTimingCut";
990  unsigned short stat =
992  if (stat) {
993  ATH_MSG_WARNING("Fix for missing cells required"
994  " but some layer info is not available,"
995  " from L2 : " << stat%2 << " from L3 : " << stat/2);
996  }
997  }
998 
999  double eta_calo;
1000  static const SG::AuxElement::Accessor<float> accEtaCalo("etaCalo");
1002  eta_calo = cluster->eta();
1003  }
1004  else if (cluster->retrieveMoment(xAOD::CaloCluster::ETACALOFRAME, eta_calo)){
1005 
1006  }
1007  else if (accEtaCalo.isAvailable(*cluster)) {
1008  eta_calo = accEtaCalo(*cluster);
1009  }
1010  else{
1011  ATH_MSG_ERROR("etaCalo not available as auxilliary variable,"
1012  " using cluster eta as eta calo!");
1013  eta_calo=cluster->eta();
1014  }
1015 
1017  event_info.averageInteractionsPerCrossing(),
1018  event_info.runNumber(),
1019  cluster->eta(),
1020  cluster->phi(),
1021  cluster->energyBE(0),
1022  cluster->energyBE(1),
1023  cluster->energyBE(2) + addE2,
1024  cluster->energyBE(3) + addE3,
1025  eta_calo };
1026 
1027  bool isData = !event_info.eventType(xAOD::EventInfo::IS_SIMULATION);
1029  if (isData || m_scaleMC)
1031 
1032  static const SG::AuxElement::Decorator<double> deco_E0("correctedcl_Es0");
1033  static const SG::AuxElement::Decorator<double> deco_E1("correctedcl_Es1");
1034  static const SG::AuxElement::Decorator<double> deco_E2("correctedcl_Es2");
1035  static const SG::AuxElement::Decorator<double> deco_E3("correctedcl_Es3");
1037  deco_layer_correction("layer_correction");
1038 
1039  if (status == CP::CorrectionCode::Ok) {
1040  ATH_MSG_DEBUG("decorating cluster with corrected layer energies");
1041  deco_E0(*cluster) = m_doPSCorrections ?
1042  inputs.E0raw : cluster->energyBE(0);
1043  deco_E1(*cluster) = m_doS12Corrections or m_doSaccCorrections ?
1044  inputs.E1raw : cluster->energyBE(1);
1045  deco_E2(*cluster) = m_doS12Corrections or m_doSaccCorrections ?
1046  inputs.E2raw : cluster->energyBE(2) + addE2;
1047  deco_E3(*cluster) = m_doSaccCorrections ?
1048  inputs.E3raw : cluster->energyBE(3) + addE3;
1049  deco_layer_correction(*cluster) = isData ? m_tune+fixT : fixT;
1050  return status;
1051  }
1052 
1053  ATH_MSG_DEBUG("cannot correct layer energies:"
1054  " decorating particle with non-corrected layer energies");
1055  // this is done for safety, since when a particle is decorated
1056  // all the particle in the container are decorated
1057  // it is not possible to distinguish between decorated / non-decorated
1058  // since all are decorated
1059  deco_E0(*cluster) = cluster->energyBE(0);
1060  deco_E1(*cluster) = cluster->energyBE(1);
1061  deco_E2(*cluster) = cluster->energyBE(2) + addE2;
1062  deco_E3(*cluster) = cluster->energyBE(3) + addE3;
1063  deco_layer_correction(*cluster) = isData ? m_tune + "_Err" + fixT : fixT;
1064  return status;
1065 
1066 }

◆ clear_corrections()

void egammaLayerRecalibTool::clear_corrections ( )

remove all the scale corrections

Definition at line 1069 of file egammaLayerRecalibTool.cxx.

1070 {
1071  for (auto modifier : m_modifiers) {
1072  delete modifier.first;
1073  delete modifier.second;
1074  }
1075  m_modifiers.clear();
1076 }

◆ create()

std::pair< std::string, egammaLayerRecalibTool * > egammaLayerRecalibTool::create ( const std::string &  type,
const std::string &  args 
)
static

helper to create a tool from a string (useful for command line arguments)

Definition at line 1114 of file egammaLayerRecalibTool.cxx.

1115 {
1116  std::map<std::string, std::string> args_map = parse(args);
1117  egammaLayerRecalibTool* tool = new egammaLayerRecalibTool("egammaLayerRecalibTool", "");
1118  std::string name = "";
1119  std::string amount_name = "";
1120  std::string type_name = "";
1121 
1122  GetAmountBase* amount_getter = nullptr;
1123  InputModifier* modifier = nullptr;
1124 
1125  if (args_map.find("amount") != args_map.end()) {
1126  std::string amount_str = args_map["amount"];
1127  bool perc = false;
1128  if (amount_str.back()=='%') {
1129  perc = true;
1130  amount_str.pop_back();
1131  }
1132  const float amount = TString(amount_str).Atof() * (perc ? 0.01 : 1);
1133 
1134  amount_getter = new GetAmountFixed(amount);
1135  std::stringstream amount_stream;
1136  amount_stream << amount;
1137  amount_name = amount_stream.str();
1138  std::replace(amount_name.begin(), amount_name.end(), '-', 'n');
1139  std::replace(amount_name.begin(), amount_name.end(), '.', 'p');
1140  }
1141  else if (args_map.find("name") != args_map.end()) {
1142  name = args_map["name"];
1143  }
1144  else if (args_map.find("histo") != args_map.end()) {
1145  int dim = 0;
1146  if (args_map.find("file") == args_map.end()) {
1147  std::cerr << "with histo you must specify file" << std::endl;
1148  assert(false);
1149  }
1150  if (args_map.find("formulax") != args_map.end()) dim = 1;
1151 
1152  if (dim == 0)
1153  {
1154  std::cerr << "with histo you must specify formulax" << std::endl;
1155  assert(false);
1156  }
1157  if (dim == 1) {
1158  TFile f(args_map["file"].c_str());
1159  std::cout << "opening histo " << args_map["histo"] << " from file " << args_map["file"] << std::endl;
1160  TH1F* histo = dynamic_cast<TH1F*>(f.Get(args_map["histo"].c_str()));
1161 
1162  if(histo){
1163  histo->SetDirectory(nullptr);
1164  amount_getter = new GetAmountHisto1D(*histo);
1165  }
1166  else{assert(false); }
1167  }
1168  else { assert(false); }
1169  }
1170  else {
1171  std::cerr << "cannot understand argument " << args << std::endl;
1172  assert(false);
1173  }
1174 
1175  if ("bias-E0" == type) { modifier = new ScaleE0(InputModifier::ZEROBASED); type_name = "E0"; }
1176  else if ("bias-E1" == type) { modifier = new ScaleE1(InputModifier::ZEROBASED); type_name = "E1"; }
1177  else if ("bias-E2" == type) { modifier = new ScaleE2(InputModifier::ZEROBASED); type_name = "E2"; }
1178  else if ("bias-E3" == type) { modifier = new ScaleE3(InputModifier::ZEROBASED); type_name = "E3"; }
1179  else if ("bias-E1overE2" == type) { modifier = new ScaleE1overE2(InputModifier::ZEROBASED); type_name = "E1overE2"; }
1180  else if ("bias-Eaccordion" == type) { modifier = new ScaleEaccordion(InputModifier::ZEROBASED); type_name = "Eaccordion"; }
1181  else if ("bias-Ecalorimeter" == type) { modifier = new ScaleEcalorimeter(InputModifier::ZEROBASED); type_name = "Ecalorimeter"; }
1182 
1183  if (not type_name.empty() and not amount_name.empty()) {
1184  name = type_name + "_" + amount_name;
1185  }
1186 
1187  if (name.empty()) {
1188  std::cerr << "you need to specify a name for the bias with type " << type << std::endl;
1189  }
1190 
1191  if (modifier and amount_getter) {
1192  tool->add_scale(modifier, amount_getter);
1193  }
1194  else{
1195  tool->add_scale(type);
1196  //release resources, if modifier false need to release amount_getter and vice versa
1197  //since they are not passed to the tool
1198  if(modifier) delete modifier;
1199  if(amount_getter) delete amount_getter;
1200  }
1201 
1202  return {name, tool};
1203 }

◆ disable_PSCorrections()

void egammaLayerRecalibTool::disable_PSCorrections ( )
inline

Definition at line 324 of file egammaLayerRecalibTool.h.

324 {m_doPSCorrections=false;}

◆ disable_S12Corrections()

void egammaLayerRecalibTool::disable_S12Corrections ( )
inline

Definition at line 325 of file egammaLayerRecalibTool.h.

325 {m_doS12Corrections=false;}

◆ disable_SaccCorrections()

void egammaLayerRecalibTool::disable_SaccCorrections ( )
inline

Definition at line 326 of file egammaLayerRecalibTool.h.

326 {m_doSaccCorrections=false;}

◆ fixForMissingCells()

void egammaLayerRecalibTool::fixForMissingCells ( bool  fix = true)
inline

Definition at line 322 of file egammaLayerRecalibTool.h.

322 { m_aodFixMissingCells = fix; }

◆ initMessaging()

void AthMessaging::initMessaging ( ) const
privateinherited

Initialize our message level and MessageSvc.

This method should only be called once.

Definition at line 39 of file AthMessaging.cxx.

40 {
42  m_lvl = m_imsg ?
43  static_cast<MSG::Level>( m_imsg.load()->outputLevel(m_nm) ) :
44  MSG::INFO;
45 }

◆ msg() [1/2]

MsgStream & asg::AsgMessaging::msg ( ) const
inherited

The standard message stream.

Returns
A reference to the default message stream of this object.

Definition at line 49 of file AsgMessaging.cxx.

49  {
50 #ifndef XAOD_STANDALONE
52 #else // not XAOD_STANDALONE
53  return m_msg;
54 #endif // not XAOD_STANDALONE
55  }

◆ msg() [2/2]

MsgStream & asg::AsgMessaging::msg ( const MSG::Level  lvl) const
inherited

The standard message stream.

Parameters
lvlThe message level to set the stream to
Returns
A reference to the default message stream, set to level "lvl"

Definition at line 57 of file AsgMessaging.cxx.

57  {
58 #ifndef XAOD_STANDALONE
60 #else // not XAOD_STANDALONE
61  m_msg << lvl;
62  return m_msg;
63 #endif // not XAOD_STANDALONE
64  }

◆ msgLvl()

bool asg::AsgMessaging::msgLvl ( const MSG::Level  lvl) const
inherited

Test the output level of the object.

Parameters
lvlThe message level to test against
Returns
boolean Indicting if messages at given level will be printed
true If messages at level "lvl" will be printed

Definition at line 41 of file AsgMessaging.cxx.

41  {
42 #ifndef XAOD_STANDALONE
43  return ::AthMessaging::msgLvl( lvl );
44 #else // not XAOD_STANDALONE
45  return m_msg.msgLevel( lvl );
46 #endif // not XAOD_STANDALONE
47  }

◆ resolve_alias()

std::string egammaLayerRecalibTool::resolve_alias ( const std::string &  tune)
staticprivate

Definition at line 207 of file egammaLayerRecalibTool.cxx.

207  {
208 
209  if ("layer1_2012" == tune) return "layer1_2012_v5";
210  if ("layer1_alt_2012" == tune) return "layer1_alt_2012_v5";
211  if ("layer1_2011" == tune) return "layer1_2011_v5";
212  if ("layer1_alt_2011" == tune) return "layer1_alt_2011_v5";
213  if ("layer1_2010" == tune) return "layer1_2010_v5";
214  if ("ps_2012" == tune) return "ps_2012_v3";
215  if ("ps_2011" == tune) return "ps_2011_v3";
216  if ("ps_2010" == tune) return "ps_2010_v3";
217  if ("layer1_2012_up" == tune) return "layer1_2012_v5_up";
218  if ("layer1_2012_down" == tune) return "layer1_2012_v5_down";
219  if ("layer1_2012_errup" == tune) return "layer1_2012_v5_errup";
220  if ("layer1_2012_errdown" == tune) return "layer1_2012_v5_errdown";
221  if ("layer1_2011_up" == tune) return "layer1_2011_v5_up";
222  if ("layer1_2011_down" == tune) return "layer1_2011_v5_down";
223  if ("layer1_2011_errup" == tune) return "layer1_2011_v5_errup";
224  if ("layer1_2011_errdown" == tune) return "layer1_2011_v5_errdown";
225  if ("layer1_2010_up" == tune) return "layer1_2010_v5_up";
226  if ("layer1_2010_down" == tune) return "layer1_2010_v5_down";
227  if ("layer1_2010_errup" == tune) return "layer1_2010_v5_errup";
228  if ("layer1_2010_errdown" == tune) return "layer1_2010_v5_errdown";
229  if ("ps_2012_up" == tune) return "ps_2012_v3_up";
230  if ("ps_2012_down" == tune) return "ps_2012_v3_down";
231  if ("ps_2012_errup" == tune) return "ps_2012_v3_errup";
232  if ("ps_2012_errdown" == tune) return "ps_2012_v3_errdown";
233  if ("ps_2011_up" == tune) return "ps_2011_v3_up";
234  if ("ps_2011_down" == tune) return "ps_2011_v3_down";
235  if ("ps_2011_errup" == tune) return "ps_2011_v3_errup";
236  if ("ps_2011_errdown" == tune) return "ps_2011_v3_errdown";
237  if ("ps_2010_up" == tune) return "ps_2010_v3_up";
238  if ("ps_2010_down" == tune) return "ps_2010_v3_down";
239  if ("ps_2010_errup" == tune) return "ps_2010_v3_errup";
240  if ("ps_2010_errdown" == tune) return "ps_2010_v3_errdown";
241 
242  return tune;
243 }

◆ resolve_path()

const std::string egammaLayerRecalibTool::resolve_path ( std::string  filename) const
private

◆ scale_inputs()

CP::CorrectionCode egammaLayerRecalibTool::scale_inputs ( StdCalibrationInputs inputs) const

apply layer calibration to the

Parameters
inputs

Definition at line 963 of file egammaLayerRecalibTool.cxx.

964 {
966  for (const auto& modifier : m_modifiers) {
967  const float amount = (*modifier.second)(inputs);
968  const auto s = (*modifier.first)(inputs, amount);
969  ATH_MSG_DEBUG(" after E0|E1|E2|E3 = " << inputs.E0raw << "|" << inputs.E1raw << "|" << inputs.E2raw << "|" << inputs.E3raw);
970  if (s != CP::CorrectionCode::Ok) {
972  }
973  }
974  return status;
975 }

◆ scaleMC()

void egammaLayerRecalibTool::scaleMC ( bool  scaleMC = true)
inline

Definition at line 323 of file egammaLayerRecalibTool.h.

323 { m_scaleMC = scaleMC; }

◆ setLevel()

void AthMessaging::setLevel ( MSG::Level  lvl)
inherited

Change the current logging level.

Use this rather than msg().setLevel() for proper operation with MT.

Definition at line 28 of file AthMessaging.cxx.

29 {
30  m_lvl = lvl;
31 }

Member Data Documentation

◆ ATLAS_THREAD_SAFE

std::atomic_flag m_initialized AthMessaging::ATLAS_THREAD_SAFE = ATOMIC_FLAG_INIT
mutableprivateinherited

Messaging initialized (initMessaging)

Definition at line 141 of file AthMessaging.h.

◆ m_aodFixMissingCells

bool egammaLayerRecalibTool::m_aodFixMissingCells = false
private

Definition at line 342 of file egammaLayerRecalibTool.h.

◆ m_doPSCorrections

bool egammaLayerRecalibTool::m_doPSCorrections = true
private

Definition at line 333 of file egammaLayerRecalibTool.h.

◆ m_doS12Corrections

bool egammaLayerRecalibTool::m_doS12Corrections = true
private

Definition at line 334 of file egammaLayerRecalibTool.h.

◆ m_doSaccCorrections

bool egammaLayerRecalibTool::m_doSaccCorrections = true
private

Definition at line 335 of file egammaLayerRecalibTool.h.

◆ m_imsg

std::atomic<IMessageSvc*> AthMessaging::m_imsg { nullptr }
mutableprivateinherited

MessageSvc pointer.

Definition at line 135 of file AthMessaging.h.

◆ m_lvl

std::atomic<MSG::Level> AthMessaging::m_lvl { MSG::NIL }
mutableprivateinherited

Current logging level.

Definition at line 138 of file AthMessaging.h.

◆ m_modifiers

ModifiersList egammaLayerRecalibTool::m_modifiers
private

Definition at line 338 of file egammaLayerRecalibTool.h.

◆ m_msg_tls

boost::thread_specific_ptr<MsgStream> AthMessaging::m_msg_tls
mutableprivateinherited

MsgStream instance (a std::cout like with print-out levels)

Definition at line 132 of file AthMessaging.h.

◆ m_nm

std::string AthMessaging::m_nm
privateinherited

Message source name.

Definition at line 129 of file AthMessaging.h.

◆ m_pileup_tool

corr_pileupShift* egammaLayerRecalibTool::m_pileup_tool = nullptr
private

Definition at line 340 of file egammaLayerRecalibTool.h.

◆ m_Run2Run3runNumberTransition

const unsigned int egammaLayerRecalibTool::m_Run2Run3runNumberTransition = 400000
staticprivate

Definition at line 330 of file egammaLayerRecalibTool.h.

◆ m_scaleMC

bool egammaLayerRecalibTool::m_scaleMC = false
private

Definition at line 343 of file egammaLayerRecalibTool.h.

◆ m_tune

std::string egammaLayerRecalibTool::m_tune
private

Definition at line 332 of file egammaLayerRecalibTool.h.


The documentation for this class was generated from the following files:
AthMessaging::m_lvl
std::atomic< MSG::Level > m_lvl
Current logging level.
Definition: AthMessaging.h:138
replace
std::string replace(std::string s, const std::string &s2, const std::string &s3)
Definition: hcg.cxx:307
GetAmountHVPSGuillaume
Definition: egammaLayerRecalibTool.h:68
xAOD::EgammaHelpers::energyInMissingCells
unsigned short energyInMissingCells(const xAOD::Egamma &eg, double &e2, double &e3)
Get the energies in sampling 2 and 3 that are in cells rejected by the topo-cluster timing cut but th...
Definition: EgammaxAODHelpers.cxx:176
GetAmountPileupE3
Definition: egammaLayerRecalibTool.h:106
Trk::ParticleSwitcher::particle
constexpr ParticleHypothesis particle[PARTICLEHYPOTHESES]
the array of masses
Definition: ParticleHypothesis.h:76
python.SystemOfUnits.s
int s
Definition: SystemOfUnits.py:131
yodamerge_tmp.dim
dim
Definition: yodamerge_tmp.py:239
egammaLayerRecalibTool::m_aodFixMissingCells
bool m_aodFixMissingCells
Definition: egammaLayerRecalibTool.h:342
InputModifier::ZEROBASED
@ ZEROBASED
Definition: egammaLayerRecalibTool.h:205
egammaLayerRecalibTool::m_pileup_tool
corr_pileupShift * m_pileup_tool
Definition: egammaLayerRecalibTool.h:340
ATH_MSG_INFO
#define ATH_MSG_INFO(x)
Definition: AthMsgStreamMacros.h:31
python.CaloAddPedShiftConfig.args
args
Definition: CaloAddPedShiftConfig.py:47
SG::Accessor
Helper class to provide type-safe access to aux data.
Definition: Control/AthContainers/AthContainers/Accessor.h:68
GetAmountBase
Definition: egammaLayerRecalibTool.h:60
NNPDF30NNLO.tune
tune
Definition: GeneratorFilters/share/common/NNPDF30NNLO.py:1
parse
std::map< std::string, std::string > parse(const std::string &list)
Definition: egammaLayerRecalibTool.cxx:1080
egammaLayerRecalibTool::scale_inputs
CP::CorrectionCode scale_inputs(StdCalibrationInputs &inputs) const
apply layer calibration to the
Definition: egammaLayerRecalibTool.cxx:963
GetAmountPileupE2
Definition: egammaLayerRecalibTool.h:98
xAOD::EgammaParameters::AuthorFwdElectron
const uint16_t AuthorFwdElectron
Electron reconstructed by the Forward cluster-based algorithm.
Definition: EgammaDefs.h:30
corr_pileupShift
Correction for pileup induced energy shit as function of mu per layer for 2016 data.
Definition: corr_pileupShift.h:13
xAOD::EventInfo_v1::IS_SIMULATION
@ IS_SIMULATION
true: simulation, false: data
Definition: EventInfo_v1.h:151
ScaleE3
Definition: egammaLayerRecalibTool.h:247
python.TrigEgammaMonitorHelper.TH2F
def TH2F(name, title, nxbins, bins_par2, bins_par3, bins_par4, bins_par5=None, bins_par6=None, path='', **kwargs)
Definition: TrigEgammaMonitorHelper.py:45
AthMessaging::m_imsg
std::atomic< IMessageSvc * > m_imsg
MessageSvc pointer.
Definition: AthMessaging.h:135
GetAmountHisto2DEtaCaloRunNumber
Definition: egammaLayerRecalibTool.h:173
InputModifier::SUBTRACT
@ SUBTRACT
Definition: egammaLayerRecalibTool.h:205
postInclude.inputs
inputs
Definition: postInclude.SortInput.py:15
python.CaloAddPedShiftConfig.type
type
Definition: CaloAddPedShiftConfig.py:42
Athena::getMessageSvc
IMessageSvc * getMessageSvc(bool quiet=false)
Definition: getMessageSvc.cxx:20
xAOD::EventInfo_v1::runNumber
uint32_t runNumber() const
The current event's run number.
InputModifier::ONEBASED_ALPHA
@ ONEBASED_ALPHA
Definition: egammaLayerRecalibTool.h:205
GetAmountHisto1DErrorDown
Definition: egammaLayerRecalibTool.h:158
ScaleE0
Definition: egammaLayerRecalibTool.h:220
CP::CorrectionCode::Error
@ Error
Some error happened during the object correction.
Definition: CorrectionCode.h:36
ScaleEcalorimeter
Definition: egammaLayerRecalibTool.h:274
xAOD::CaloCluster_v1
Description of a calorimeter cluster.
Definition: CaloCluster_v1.h:62
egammaLayerRecalibTool::m_modifiers
ModifiersList m_modifiers
Definition: egammaLayerRecalibTool.h:338
TrigConf::MSGTC::Level
Level
Definition: Trigger/TrigConfiguration/TrigConfBase/TrigConfBase/MsgStream.h:21
ATH_MSG_ERROR
#define ATH_MSG_ERROR(x)
Definition: AthMsgStreamMacros.h:33
InputModifier::ONEBASED
@ ONEBASED
Definition: egammaLayerRecalibTool.h:205
columnar::ContainerId::cluster
@ cluster
SG::Decorator
Helper class to provide type-safe access to aux data.
Definition: Decorator.h:59
GetAmountPileupE1
Definition: egammaLayerRecalibTool.h:90
egammaLayerRecalibTool::egammaLayerRecalibTool
egammaLayerRecalibTool(const std::string &name, const std::string &tune, int SaccEnable=1)
Definition: egammaLayerRecalibTool.cxx:947
ATH_MSG_DEBUG
#define ATH_MSG_DEBUG(x)
Definition: AthMsgStreamMacros.h:29
GetAmountFormula
Definition: egammaLayerRecalibTool.h:116
GetAmountFixed
Definition: egammaLayerRecalibTool.h:182
egammaLayerRecalibTool::clear_corrections
void clear_corrections()
remove all the scale corrections
Definition: egammaLayerRecalibTool.cxx:1069
file
TFile * file
Definition: tile_monitor.h:29
hist_file_dump.f
f
Definition: hist_file_dump.py:141
egammaLayerRecalibTool::m_scaleMC
bool m_scaleMC
Definition: egammaLayerRecalibTool.h:343
InputModifier::ZEROBASED_ALPHA
@ ZEROBASED_ALPHA
Definition: egammaLayerRecalibTool.h:205
GetAmountHVEMECPS207
Definition: egammaLayerRecalibTool.h:75
beamspotman.stat
stat
Definition: beamspotman.py:266
ScaleE1
Definition: egammaLayerRecalibTool.h:229
egammaLayerRecalibTool::m_doPSCorrections
bool m_doPSCorrections
Definition: egammaLayerRecalibTool.h:333
egammaLayerRecalibTool::m_doSaccCorrections
bool m_doSaccCorrections
Definition: egammaLayerRecalibTool.h:335
egammaLayerRecalibTool::m_Run2Run3runNumberTransition
static const unsigned int m_Run2Run3runNumberTransition
Definition: egammaLayerRecalibTool.h:330
xAOD::EventInfo_v1::averageInteractionsPerCrossing
float averageInteractionsPerCrossing() const
Average interactions per crossing for all BCIDs - for out-of-time pile-up.
Definition: EventInfo_v1.cxx:397
InputModifier
Definition: egammaLayerRecalibTool.h:204
egammaLayerRecalibTool::add_scale
void add_scale(InputModifier *modifier, GetAmountBase *amount)
add custom layer scale correction.
Definition: egammaLayerRecalibTool.cxx:958
egammaLayerRecalibTool::scaleMC
void scaleMC(bool scaleMC=true)
Definition: egammaLayerRecalibTool.h:323
GetAmountHisto1DErrorUp
Definition: egammaLayerRecalibTool.h:151
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:240
asg::AsgMessaging
Class mimicking the AthMessaging class from the offline software.
Definition: AsgMessaging.h:40
AtlCoolConsole.tool
tool
Definition: AtlCoolConsole.py:453
GetAmountPileupE0
Definition: egammaLayerRecalibTool.h:82
GetAmountHisto1D
Definition: egammaLayerRecalibTool.h:125
make_hlt_rep.modifier
string modifier
Definition: make_hlt_rep.py:14
PathResolverFindCalibFile
std::string PathResolverFindCalibFile(const std::string &logical_file_name)
Definition: PathResolver.cxx:431
egammaLayerRecalibTool
Definition: egammaLayerRecalibTool.h:283
CP::CorrectionCode::Ok
@ Ok
The correction was done successfully.
Definition: CorrectionCode.h:38
ScaleEaccordion
Definition: egammaLayerRecalibTool.h:265
StdCalibrationInputs
Name : egammaLayerRecalibTool.h Package : egammaLayerRecalibTool Author : R.
Definition: egammaLayerRecalibTool.h:45
ScaleE1overE2
Definition: egammaLayerRecalibTool.h:256
ATH_MSG_WARNING
#define ATH_MSG_WARNING(x)
Definition: AthMsgStreamMacros.h:32
egammaLayerRecalibTool::resolve_alias
static std::string resolve_alias(const std::string &tune)
Definition: egammaLayerRecalibTool.cxx:207
AthMessaging::m_nm
std::string m_nm
Message source name.
Definition: AthMessaging.h:129
ScaleE2
Definition: egammaLayerRecalibTool.h:238
CP::CorrectionCode
Return value from object correction CP tools.
Definition: CorrectionCode.h:31
egammaLayerRecalibTool::m_doS12Corrections
bool m_doS12Corrections
Definition: egammaLayerRecalibTool.h:334
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
GetAmountHisto1DDown
Definition: egammaLayerRecalibTool.h:144
GetAmountHisto1DUp
Definition: egammaLayerRecalibTool.h:137
egammaLayerRecalibTool::m_tune
std::string m_tune
Definition: egammaLayerRecalibTool.h:332
xAOD::CaloCluster_v1::ETACALOFRAME
@ ETACALOFRAME
Eta in the calo frame (for egamma)
Definition: CaloCluster_v1.h:190
plotBeamSpotCompare.histo
histo
Definition: plotBeamSpotCompare.py:415
python.AutoConfigFlags.msg
msg
Definition: AutoConfigFlags.py:7
keylayer_zslicemap.perc
perc
Definition: keylayer_zslicemap.py:62
xAOD::EventInfo_v1::eventType
bool eventType(EventType type) const
Check for one particular bitmask value.