ATLAS Offline Software
Loading...
Searching...
No Matches
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
void add_scale (InputModifier *modifier, GetAmountBase *amount)
 add custom layer scale correction.
void add_scale (const std::string &scale)
 add scale correction from string.
void clear_corrections ()
 remove all the scale corrections
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.
Functions providing the same interface as AthMessaging
bool msgLvl (const MSG::Level lvl) const
 Test the output level of the object.
MsgStream & msg () const
 The standard message stream.
MsgStream & msg (const MSG::Level lvl) const
 The standard message stream.

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)

Private Member Functions

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

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.
boost::thread_specific_ptr< MsgStream > m_msg_tls
 MsgStream instance (a std::cout like with print-out levels)
std::atomic< IMessageSvc * > m_imsg { nullptr }
 MessageSvc pointer.
std::atomic< MSG::Level > m_lvl { MSG::NIL }
 Current logging level.
std::atomic_flag m_initialized ATLAS_THREAD_SAFE = ATOMIC_FLAG_INIT
 Messaging initialized (initMessaging)

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 980 of file egammaLayerRecalibTool.cxx.

981 : asg::AsgMessaging(name), m_tune(tune), m_doSaccCorrections(SaccEnable)
982{
983 add_scale(tune);
984}
void add_scale(InputModifier *modifier, GetAmountBase *amount)
add custom layer scale correction.

◆ egammaLayerRecalibTool() [2/2]

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

Definition at line 987 of file egammaLayerRecalibTool.cxx.

988 : egammaLayerRecalibTool("egammaLayerRecalibTool", tune, SaccEnable) { }
egammaLayerRecalibTool(const std::string &name, const std::string &tune, int SaccEnable=1)

◆ ~egammaLayerRecalibTool()

egammaLayerRecalibTool::~egammaLayerRecalibTool ( )
inline

Definition at line 294 of file egammaLayerRecalibTool.h.

294{ clear_corrections(); delete m_pileup_tool; }
void clear_corrections()
remove all the scale corrections

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 else if ("es2024_run3_extrapolate_v0" == tune) {
252 add_scale("run3_partial_ofc_extrapolate_v0");
253 }
254 // R22 layer tune with fixed E1E2 and repeated acc
255 else if ("es2022_22.0_Precision_v1" == tune) {
256 add_scale("run2_alt_with_layer2_r22_Precision_v1");
257 }
258 else if ("es2022_22.0_Precision" == tune) {
259 add_scale("run2_alt_with_layer2_r22_Precision");
260 }
261 else if ("es2018_21.0_v0" == tune) {
262 add_scale("run2_alt_with_layer2_r21_v1");
263 }
264 else if ("es2017_21.0_v0" == tune) {
265 add_scale("run2_alt_with_layer2_r21_v0");
266 }
267 else if ("es2017_20.7_final" == tune) {
268 add_scale("pileup_20.7");
269 add_scale("run2_alt_with_layer2_modif");
270 }
271 else if ("es2017_20.7_improved" == tune) {
272 add_scale("pileup_20.7"); // new pileup correction Guillaume for 20.7
273 //TEMPORARY HACK REMOVED (two intermediate tags with this ES model use different layer corrections)
274 add_scale("2012_alt_with_layer2_modif"); // temporary old corrections from run1 + EMECPS HV
275 }
276 else if ("pileup_20.7" == tune) {
277 m_pileup_tool = new corr_pileupShift();
278 add_scale(new ScaleE0(InputModifier::SUBTRACT), new GetAmountPileupE0(m_pileup_tool));
279 add_scale(new ScaleE1(InputModifier::SUBTRACT), new GetAmountPileupE1(m_pileup_tool));
280 add_scale(new ScaleE2(InputModifier::SUBTRACT), new GetAmountPileupE2(m_pileup_tool));
281 add_scale(new ScaleE3(InputModifier::SUBTRACT), new GetAmountPileupE3(m_pileup_tool));
282 }
283 // Run3 2022+2023
284 else if ("run3_partial_ofc_extrapolate_v0" == tune) {
285 add_scale("layer2_run3_ofc_extrapolate_v0");
286 add_scale("ps_run3_ofc_extrapolate_v0");
287 if(m_doSaccCorrections) add_scale("acc_zee_run3_v0");
288 }
289 //Run 2 release 22 with fixed E1E2 and repeated acc
290 else if ("run2_alt_with_layer2_r22_Precision_v1"==tune) {
291 add_scale("layer2_alt_el_mu_comb_r21_v0_fix");
292 add_scale("ps_mu_r21_v0");
293 if(m_doSaccCorrections) add_scale("acc_zee_r22_v1");
294 }
295 //Run 2 release 22
296 else if ("run2_alt_with_layer2_r22_Precision"==tune) {
297 add_scale("layer2_alt_el_mu_comb_r21_v0");
298 add_scale("ps_mu_r21_v0");
299 if(m_doSaccCorrections) add_scale("acc_zee_r22_v0");
300 }
301 else if ("run2_alt_with_layer2_r21_v1"==tune) {
302 add_scale("layer2_alt_run2_r21_v1");
303 add_scale("ps_2016_r21_v0");
304 }
305 else if ("run2_alt_with_layer2_r21_v0"==tune) {
306 add_scale("layer2_alt_run2_r21_v0");
307 add_scale("ps_2016_r21_v0");
308 }
309 else if("run2_alt_with_layer2_modif" == tune) {
310 add_scale("ps_EMECHV1");
311 add_scale("layer2_alt_run2_v1");
312 add_scale("ps_2016");
313 }
314 // 2012
315 else if ("2012" == tune) {
316 add_scale("ps_HV1");
317 add_scale("layer1_2012");
318 add_scale("ps_2012");
319 }
320 else if("2012_with_layer2" == tune) {
321 add_scale("ps_HV1");
322 add_scale("layer2_2012_v5");
323 add_scale("ps_2012");
324 }
325 else if ("2012_alt" == tune) {
326 add_scale("ps_HV1");
327 add_scale("layer1_alt_2012");
328 add_scale("ps_2012");
329 }
330 else if("2012_alt_with_layer2" == tune) {
331 add_scale("ps_HV1");
332 add_scale("layer2_alt_2012_v5");
333 add_scale("ps_2012");
334 }
335 else if("2012_alt_with_layer2_modif" == tune) {
336 add_scale("ps_HV1");
337 add_scale("ps_EMECHV1");
338 add_scale("layer2_alt_2012_v5");
339 add_scale("ps_2012");
340 }
341 else if("2010_with_layer2" == tune) {
342 add_scale("layer2_2010_v5");
343 add_scale("ps_2010");
344 }
345 else if ("2012_layer1_up" == tune) {
346 add_scale("ps_HV1");
347 add_scale("layer1_2012_up");
348 add_scale("ps_2012");
349 }
350 else if ("2012_layer1_down" == tune) {
351 add_scale("ps_HV1");
352 add_scale("layer1_2012_down");
353 add_scale("ps_2012");
354 }
355 else if ("2012_layer1_errup" == tune) {
356 add_scale("layer1_2012_errup");
357 }
358 else if ("2012_layer1_errdown" == tune) {
359 add_scale("layer1_2012_errdown");
360 }
361 else if ("2012_ps_down" == tune) {
362 add_scale("ps_HV1");
363 add_scale("layer1_2012");
364 add_scale("ps_2012_down");
365 }
366 else if ("2012_ps_up" == tune) {
367 add_scale("ps_HV1");
368 add_scale("layer1_2012");
369 add_scale("ps_2012_up");
370 }
371 else if ("2012_ps_errdown" == tune) {
372 add_scale("ps_2012_errdown");
373 }
374 else if ("2012_ps_errup" == tune) {
375 add_scale("ps_2012_errup");
376 }
377 else if ("2012_up" == tune) {
378 add_scale("ps_HV1");
379 add_scale("layer1_2012_up");
380 add_scale("ps_2012_up");
381 }
382 else if ("2012_down" == tune) {
383 add_scale("ps_HV1");
384 add_scale("layer1_2012_down");
385 add_scale("ps_2012_down");
386 }
387 else if ("2012_errup" == tune) {
388 add_scale("layer1_2012_errup");
389 add_scale("ps_2012_errup");
390 }
391 else if ("2012_errdown" == tune) {
392 add_scale("layer1_2012_errdown");
393 add_scale("ps_2012_errdown");
394 }
395 // 2011
396 else if ("2011" == tune) {
397 add_scale("layer1_2011");
398 add_scale("ps_2011");
399 }
400 else if("2011_with_layer2" == tune) {
401 add_scale("layer2_2011_v5");
402 add_scale("ps_2011");
403 }
404 else if ("2011_alt" == tune) {
405 add_scale("layer1_alt_2011");
406 add_scale("ps_2011");
407 }
408 else if("2011_alt_with_layer2" == tune) {
409 add_scale("layer2_alt_2011_v5");
410 add_scale("ps_2011");
411 }
412 else if ("2011_layer1_up" == tune) {
413 add_scale("layer1_2011_up");
414 add_scale("ps_2011");
415 }
416 else if ("2011_layer1_down" == tune) {
417 add_scale("layer1_2011_down");
418 add_scale("ps_2011");
419 }
420 else if ("2011_layer1_errup" == tune) {
421 add_scale("layer1_2011_errup");
422 }
423 else if ("2011_layer1_errdown" == tune) {
424 add_scale("layer1_2011_errdown");
425 }
426 else if ("2011_ps_down" == tune) {
427 add_scale("layer1_2011");
428 add_scale("ps_2011_down");
429 }
430 else if ("2011_ps_up" == tune) {
431 add_scale("layer1_2011");
432 add_scale("ps_2011_up");
433 }
434 else if ("2011_ps_errdown" == tune) {
435 add_scale("ps_2011_errdown");
436 }
437 else if ("2011_ps_errup" == tune) {
438 add_scale("ps_2011_errup");
439 }
440 else if ("2011_up" == tune) {
441 add_scale("layer1_2011_up");
442 add_scale("ps_2011_up");
443 }
444 else if ("2011_down" == tune) {
445 add_scale("layer1_2011_down");
446 add_scale("ps_2011_down");
447 }
448 else if ("2011_errup" == tune) {
449 add_scale("layer1_2011_errup");
450 add_scale("ps_2011_errup");
451 }
452 else if ("2011_errdown" == tune) {
453 add_scale("layer1_2011_errdown");
454 add_scale("ps_2011_errdown");
455 }
456 // 2010
457 else if ("2010" == tune) {
458 add_scale("layer1_2010");
459 add_scale("ps_2010");
460 }
461 else if ("2010_layer1_up" == tune) {
462 add_scale("layer1_2010_up");
463 add_scale("ps_2010");
464 }
465 else if ("2010_layer1_down" == tune) {
466 add_scale("layer1_2010_down");
467 add_scale("ps_2010");
468 }
469 else if ("2010_layer1_errup" == tune) {
470 add_scale("layer1_2010_errup");
471 }
472 else if ("2010_layer1_errdown" == tune) {
473 add_scale("layer1_2010_errdown");
474 }
475 else if ("2010_ps_down" == tune) {
476 add_scale("layer1_2010");
477 add_scale("ps_2010_down");
478 }
479 else if ("2010_ps_up" == tune) {
480 add_scale("layer1_2010");
481 add_scale("ps_2010_up");
482 }
483 else if ("2010_ps_errdown" == tune) {
484 add_scale("ps_2010_errdown");
485 }
486 else if ("2010_ps_errup" == tune) {
487 add_scale("ps_2010_errup");
488 }
489 else if ("2010_up" == tune) {
490 add_scale("layer1_2010_up");
491 add_scale("ps_2010_up");
492 }
493 else if ("2010_down" == tune) {
494 add_scale("layer1_2010_down");
495 add_scale("ps_2010_down");
496 }
497 else if ("2010_errup" == tune) {
498 add_scale("layer1_2010_errup");
499 add_scale("ps_2010_errup");
500 }
501 else if ("2010_errdown" == tune) {
502 add_scale("layer1_2010_errdown");
503 add_scale("ps_2010_errdown");
504 }
505 else if ("ps_HV1" == tune) {
506 add_scale(new ScaleE0(InputModifier::ONEBASED), new GetAmountHVPSGuillaume());
507 }
508 else if ("ps_EMECHV1" == tune) {
509 add_scale(new ScaleE0(InputModifier::ONEBASED), new GetAmountHVEMECPS207());
510 }
511 else if ("test1" == tune) {
512 TH1F h_presampler("h_presampler", "h_presampler", 10, -2.5, 2.5);
513 // just as an example, correct E0 by 0.1 * sign(eta)
514 // and E1 by 1%
515 for (int ibin = 1; ibin <= 5; ++ibin) {
516 h_presampler.SetBinContent(ibin, -0.1);
517 h_presampler.SetBinContent(ibin + 5, 0.1);
518 }
519 add_scale(new ScaleE0(InputModifier::ZEROBASED), new GetAmountHisto1D(h_presampler));
520 add_scale(new ScaleE1(InputModifier::ZEROBASED), new GetAmountFixed(0.01));
521 }
522 else if ("acc_zee_run3_v0" == tune){
523 const std::string file = PathResolverFindCalibFile("egammaLayerRecalibTool/v13/egammaLayerRecalibTunes.root");
524 TFile f(file.c_str());
525 TH2F* histo_acc = static_cast<TH2F*>(f.Get("hACC_Zee_rel23"));
526 assert(histo_acc);
527 add_scale(new ScaleEaccordion(InputModifier::ZEROBASED_ALPHA),
528 new GetAmountHisto2DEtaCaloRunNumber(*histo_acc));
529 }
530 // repeated acc scale based on layer2_alt_el_mu_comb_r21_v0_fix
531 else if ("acc_zee_r22_v1" == tune) {
532 const std::string file = PathResolverFindCalibFile("egammaLayerRecalibTool/v12/egammaLayerRecalibTunes.root");
533 TFile f(file.c_str());
534 TH2F* histo_acc = static_cast<TH2F*>(f.Get("hACC_Zee_rel22"));
535 assert(histo_acc);
536 add_scale(new ScaleEaccordion(InputModifier::ZEROBASED_ALPHA),
537 new GetAmountHisto2DEtaCaloRunNumber(*histo_acc));
538 }
539 else if ("acc_zee_r22_v0" == tune) {
540 const std::string file = PathResolverFindCalibFile("egammaLayerRecalibTool/v11/egammaLayerRecalibTunes.root");
541 TFile f(file.c_str());
542 TH2F* histo_acc = static_cast<TH2F*>(f.Get("hACC_Zee_rel22"));
543 assert(histo_acc);
544 add_scale(new ScaleEaccordion(InputModifier::ZEROBASED_ALPHA),
545 new GetAmountHisto2DEtaCaloRunNumber(*histo_acc));
546 }
547 else if ("layer1_1" == tune) {
548 TFormula f("formula_layer1_1", "(abs(x)<1.425) ? 0.97 : 1");
549 add_scale(new ScaleE1(InputModifier::ONEBASED_ALPHA), new GetAmountFormula(f));
550 }
551 else if ("layer1_2" == tune) {
552 TFormula f("formula_layer1_2", "(abs(x)<1.425) ? 0.97 : 1.05");
553 add_scale(new ScaleE1(InputModifier::ONEBASED_ALPHA), new GetAmountFormula(f));
554 }
555 else if ("layer1_alt_2012_v5" == tune) {
556 const std::string file = PathResolverFindCalibFile("egammaLayerRecalibTool/v1/egammaLayerRecalibTunes.root");
557 TFile f(file.c_str());
558 TH1* histo = checked_cast<TH1*>(f.Get("hE1E2ave_alt_2012"));
560 new GetAmountHisto1D(*histo));
561 }
562 else if ("layer1_2012_v5" == tune) {
563 const std::string file = PathResolverFindCalibFile("egammaLayerRecalibTool/v1/egammaLayerRecalibTunes.root");
564 TFile f(file.c_str());
565 TH1* histo = checked_cast<TH1*>(f.Get("hE1E2ave_2012"));
567 new GetAmountHisto1D(*histo));
568 }
569 else if ("layer1_2012_v5_down" == tune) {
570 const std::string file = PathResolverFindCalibFile("egammaLayerRecalibTool/v1/egammaLayerRecalibTunes.root");
571 TFile f(file.c_str());
572 TH1* histo = checked_cast<TH1*>(f.Get("hE1E2ave_2012"));
574 new GetAmountHisto1DUp(*histo));
575 }
576 else if ("layer1_2012_v5_up" == tune) {
577 const std::string file = PathResolverFindCalibFile("egammaLayerRecalibTool/v1/egammaLayerRecalibTunes.root");
578 TFile f(file.c_str());
579 TH1* histo = checked_cast<TH1*>(f.Get("hE1E2ave_2012"));
581 new GetAmountHisto1DDown(*histo));
582 }
583 else if ("layer1_2012_v5_errdown" == tune) {
584 const std::string file = PathResolverFindCalibFile("egammaLayerRecalibTool/v1/egammaLayerRecalibTunes.root");
585 TFile f(file.c_str());
586 TH1* histo = checked_cast<TH1*>(f.Get("hE1E2ave_2012"));
588 new GetAmountHisto1DErrorUp(*histo));
589 }
590 else if ("layer1_2012_v5_errup" == tune) {
591 const std::string file = PathResolverFindCalibFile("egammaLayerRecalibTool/v1/egammaLayerRecalibTunes.root");
592 TFile f(file.c_str());
593 TH1* histo = checked_cast<TH1*>(f.Get("hE1E2ave_2012"));
595 new GetAmountHisto1DErrorDown(*histo));
596 }
597 else if ("layer1_alt_2011_v5" == tune) {
598 const std::string file = PathResolverFindCalibFile("egammaLayerRecalibTool/v1/egammaLayerRecalibTunes.root");
599 TFile f(file.c_str());
600 TH1* histo = checked_cast<TH1*>(f.Get("hE1E2ave_alt_2011"));
602 new GetAmountHisto1D(*histo));
603 }
604 else if ("layer1_2011_v5" == tune) {
605 const std::string file = PathResolverFindCalibFile("egammaLayerRecalibTool/v1/egammaLayerRecalibTunes.root");
606 TFile f(file.c_str());
607 TH1* histo = checked_cast<TH1*>(f.Get("hE1E2ave_2011"));
609 new GetAmountHisto1D(*histo));
610 }
611 else if ("layer1_2011_v5_down" == tune) {
612 const std::string file = PathResolverFindCalibFile("egammaLayerRecalibTool/v1/egammaLayerRecalibTunes.root");
613 TFile f(file.c_str());
614 TH1* histo = checked_cast<TH1*>(f.Get("hE1E2ave_2011"));
616 new GetAmountHisto1DUp(*histo));
617 }
618 else if ("layer1_2011_v5_up" == tune) {
619 const std::string file = PathResolverFindCalibFile("egammaLayerRecalibTool/v1/egammaLayerRecalibTunes.root");
620 TFile f(file.c_str());
621 TH1* histo = checked_cast<TH1*>(f.Get("hE1E2ave_2011"));
623 new GetAmountHisto1DDown(*histo));
624 }
625 else if ("layer1_2011_v5_errdown" == tune) {
626 const std::string file = PathResolverFindCalibFile("egammaLayerRecalibTool/v1/egammaLayerRecalibTunes.root");
627 TFile f(file.c_str());
628 TH1* histo = checked_cast<TH1*>(f.Get("hE1E2ave_2011"));
630 new GetAmountHisto1DErrorUp(*histo));
631 }
632 else if ("layer1_2011_v5_errup" == tune) {
633 const std::string file = PathResolverFindCalibFile("egammaLayerRecalibTool/v1/egammaLayerRecalibTunes.root");
634 TFile f(file.c_str());
635 TH1* histo = checked_cast<TH1*>(f.Get("hE1E2ave_2011"));
637 new GetAmountHisto1DErrorDown(*histo));
638 }
639 else if ("layer1_2010_v5" == tune) {
640 const std::string file = PathResolverFindCalibFile("egammaLayerRecalibTool/v1/egammaLayerRecalibTunes.root");
641 TFile f(file.c_str());
642 TH1* histo = checked_cast<TH1*>(f.Get("hE1E2ave_2010"));
644 new GetAmountHisto1D(*histo));
645 }
646 else if ("layer1_2010_v5_down" == tune) {
647 const std::string file = PathResolverFindCalibFile("egammaLayerRecalibTool/v1/egammaLayerRecalibTunes.root");
648 TFile f(file.c_str());
649 TH1* histo = checked_cast<TH1*>(f.Get("hE1E2ave_2010"));
651 new GetAmountHisto1DUp(*histo));
652 }
653 else if ("layer1_2010_v5_up" == tune) {
654 const std::string file = PathResolverFindCalibFile("egammaLayerRecalibTool/v1/egammaLayerRecalibTunes.root");
655 TFile f(file.c_str());
656 TH1* histo = checked_cast<TH1*>(f.Get("hE1E2ave_2010"));
658 new GetAmountHisto1DDown(*histo));
659 }
660 else if ("layer1_2010_v5_errdown" == tune) {
661 const std::string file = PathResolverFindCalibFile("egammaLayerRecalibTool/v1/egammaLayerRecalibTunes.root");
662 TFile f(file.c_str());
663 TH1* histo = checked_cast<TH1*>(f.Get("hE1E2ave_2010"));
665 new GetAmountHisto1DErrorUp(*histo));
666 }
667 else if ("layer1_2010_v5_errup" == tune) {
668 const std::string file = PathResolverFindCalibFile("egammaLayerRecalibTool/v1/egammaLayerRecalibTunes.root");
669 TFile f(file.c_str());
670 TH1* histo = checked_cast<TH1*>(f.Get("hE1E2ave_2010"));
672 new GetAmountHisto1DErrorDown(*histo));
673 }
674 else if ("layer2_run3_ofc_extrapolate_v0"==tune){
675 const std::string file = PathResolverFindCalibFile("egammaLayerRecalibTool/v12/egammaLayerRecalibTunes.root");
676 TFile f(file.c_str());
677 TH1D* histo = static_cast<TH1D*>(f.Get("hE1E2_emu_run2_rel21_v1_run3ofc"));
678 assert(histo);
680 new GetAmountHisto1D(*histo));
681 }
682 // fix E1E2 scale from R21 precision model
683 else if("layer2_alt_el_mu_comb_r21_v0_fix"==tune) {
684 const std::string file = PathResolverFindCalibFile("egammaLayerRecalibTool/v12/egammaLayerRecalibTunes.root");
685 TFile f(file.c_str());
686 TH1D* histo = static_cast<TH1D*>(f.Get("hE1E2_emu_run2_rel21_v0_fix"));
687 assert(histo);
689 new GetAmountHisto1D(*histo));
690 }
691 else if("layer2_alt_el_mu_comb_r21_v0"==tune) {
692 const std::string file = PathResolverFindCalibFile("egammaLayerRecalibTool/v11/egammaLayerRecalibTunes.root");
693 TFile f(file.c_str());
694 TH1D* histo = static_cast<TH1D*>(f.Get("hE1E2_emu_run2_rel21_v0"));
695 assert(histo);
697 new GetAmountHisto1D(*histo));
698 }
699 else if("layer2_alt_run2_r21_v1"==tune) {
700 const std::string file = PathResolverFindCalibFile("egammaLayerRecalibTool/v6/egammaLayerRecalibTunes.root");
701 TFile f(file.c_str());
702 TH1* histo = checked_cast<TH1*>(f.Get("hE1E2_mu_run2_rel21_v1"));
704 new GetAmountHisto1D(*histo));
705 }
706 else if("layer2_alt_run2_r21_v0"==tune) {
707 const std::string file = PathResolverFindCalibFile("egammaLayerRecalibTool/v5/egammaLayerRecalibTunes.root");
708 TFile f(file.c_str());
709 TH1* histo = checked_cast<TH1*>(f.Get("hE1E2mu_2016_rel21_v1"));
711 new GetAmountHisto1D(*histo));
712 }
713 else if("layer2_alt_run2_v1" == tune) {
714 const std::string file = PathResolverFindCalibFile("egammaLayerRecalibTool/v3/egammaLayerRecalibTunes.root");
715 TFile f(file.c_str());
716 TH1* histo = checked_cast<TH1*>(f.Get("hE1E2mu_2016_v1"));
718 new GetAmountHisto1D(*histo));
719 }
720 else if("layer2_alt_2012_v5" == tune) {
721 const std::string file = PathResolverFindCalibFile("egammaLayerRecalibTool/v1/egammaLayerRecalibTunes.root");
722 TFile f(file.c_str());
723 TH1* histo = checked_cast<TH1*>(f.Get("hE1E2ave_alt_2012"));
725 new GetAmountHisto1D(*histo));
726 }
727 else if("layer2_2012_v5" == tune) {
728 const std::string file = PathResolverFindCalibFile("egammaLayerRecalibTool/v1/egammaLayerRecalibTunes.root");
729 TFile f(file.c_str());
730 TH1* histo = checked_cast<TH1*>(f.Get("hE1E2ave_2012"));
732 new GetAmountHisto1D(*histo));
733 }
734 else if("layer2_2012_v5_down" == tune) {
735 const std::string file = PathResolverFindCalibFile("egammaLayerRecalibTool/v1/egammaLayerRecalibTunes.root");
736 TFile f(file.c_str());
737 TH1* histo = checked_cast<TH1*>(f.Get("hE1E2ave_2012"));
739 new GetAmountHisto1DDown(*histo));
740 }
741 else if("layer2_2012_v5_up" == tune) {
742 const std::string file = PathResolverFindCalibFile("egammaLayerRecalibTool/v1/egammaLayerRecalibTunes.root");
743 TFile f(file.c_str());
744 TH1* histo = checked_cast<TH1*>(f.Get("hE1E2ave_2012"));
746 new GetAmountHisto1DUp(*histo));
747 }
748 else if ("layer2_2012_v5_errdown" == tune) {
749 const std::string file = PathResolverFindCalibFile("egammaLayerRecalibTool/v1/egammaLayerRecalibTunes.root");
750 TFile f(file.c_str());
751 TH1* histo = checked_cast<TH1*>(f.Get("hE1E2ave_2012"));
753 new GetAmountHisto1DErrorDown(*histo));
754 }
755 else if ("layer2_2012_v5_errup" == tune) {
756 const std::string file = PathResolverFindCalibFile("egammaLayerRecalibTool/v1/egammaLayerRecalibTunes.root");
757 TFile f(file.c_str());
758 TH1* histo = checked_cast<TH1*>(f.Get("hE1E2ave_2012"));
760 new GetAmountHisto1DErrorUp(*histo));
761 }
762 else if("layer2_alt_2011_v5" == tune) {
763 const std::string file = PathResolverFindCalibFile("egammaLayerRecalibTool/v1/egammaLayerRecalibTunes.root");
764 TFile f(file.c_str());
765 TH1* histo = checked_cast<TH1*>(f.Get("hE1E2ave_alt_2011"));
767 new GetAmountHisto1D(*histo));
768 }
769 else if("layer2_2011_v5" == tune) {
770 const std::string file = PathResolverFindCalibFile("egammaLayerRecalibTool/v1/egammaLayerRecalibTunes.root");
771 TFile f(file.c_str());
772 TH1* histo = checked_cast<TH1*>(f.Get("hE1E2ave_2011"));
774 new GetAmountHisto1D(*histo));
775 }
776 else if("layer2_2011_v5_down" == tune) {
777 const std::string file = PathResolverFindCalibFile("egammaLayerRecalibTool/v1/egammaLayerRecalibTunes.root");
778 TFile f(file.c_str());
779 TH1* histo = checked_cast<TH1*>(f.Get("hE1E2ave_2011"));
781 new GetAmountHisto1DDown(*histo));
782 }
783 else if("layer2_2011_v5_up" == tune) {
784 const std::string file = PathResolverFindCalibFile("egammaLayerRecalibTool/v1/egammaLayerRecalibTunes.root");
785 TFile f(file.c_str());
786 TH1* histo = checked_cast<TH1*>(f.Get("hE1E2ave_2011"));
788 new GetAmountHisto1DUp(*histo));
789 }
790 else if ("layer2_2011_v5_errdown" == tune) {
791 const std::string file = PathResolverFindCalibFile("egammaLayerRecalibTool/v1/egammaLayerRecalibTunes.root");
792 TFile f(file.c_str());
793 TH1* histo = checked_cast<TH1*>(f.Get("hE1E2ave_2011"));
795 new GetAmountHisto1DErrorDown(*histo));
796 }
797 else if ("layer2_2011_v5_errup" == tune) {
798 const std::string file = PathResolverFindCalibFile("egammaLayerRecalibTool/v1/egammaLayerRecalibTunes.root");
799 TFile f(file.c_str());
800 TH1* histo = checked_cast<TH1*>(f.Get("hE1E2ave_2011"));
802 new GetAmountHisto1DErrorUp(*histo));
803 }
804 else if("layer2_2010_v5" == tune) {
805 const std::string file = PathResolverFindCalibFile("egammaLayerRecalibTool/v1/egammaLayerRecalibTunes.root");
806 TFile f(file.c_str());
807 TH1* histo = checked_cast<TH1*>(f.Get("hE1E2ave_2010"));
809 new GetAmountHisto1D(*histo));
810 }
811 else if("layer2_2010_v5_down" == tune) {
812 const std::string file = PathResolverFindCalibFile("egammaLayerRecalibTool/v1/egammaLayerRecalibTunes.root");
813 TFile f(file.c_str());
814 TH1* histo = checked_cast<TH1*>(f.Get("hE1E2ave_2010"));
816 new GetAmountHisto1DDown(*histo));
817 }
818 else if("layer2_2010_v5_up" == tune) {
819 const std::string file = PathResolverFindCalibFile("egammaLayerRecalibTool/v1/egammaLayerRecalibTunes.root");
820 TFile f(file.c_str());
821 TH1* histo = checked_cast<TH1*>(f.Get("hE1E2ave_2010"));
823 new GetAmountHisto1DUp(*histo));
824 }
825 else if ("layer2_2010_v5_errdown" == tune) {
826 const std::string file = PathResolverFindCalibFile("egammaLayerRecalibTool/v1/egammaLayerRecalibTunes.root");
827 TFile f(file.c_str());
828 TH1* histo = checked_cast<TH1*>(f.Get("hE1E2ave_2010"));
830 new GetAmountHisto1DErrorDown(*histo));
831 }
832 else if ("layer2_2010_v5_errup" == tune) {
833 const std::string file = PathResolverFindCalibFile("egammaLayerRecalibTool/v1/egammaLayerRecalibTunes.root");
834 TFile f(file.c_str());
835 TH1* histo = checked_cast<TH1*>(f.Get("hE1E2ave_2010"));
837 new GetAmountHisto1DErrorUp(*histo));
838 }
839 else if ("ps_2016_r21_v0" == tune) {
840 const std::string file = PathResolverFindCalibFile("egammaLayerRecalibTool/v5/egammaLayerRecalibTunes.root");
841 TFile f(file.c_str());
842 TH1* histo_ps_tot_error = checked_cast<TH1*>(f.Get("hPS_2016_rel21"));
844 new GetAmountHisto1D(*histo_ps_tot_error));
845 }
846 else if ("ps_run3_ofc_extrapolate_v0" == tune){
847 const std::string file = PathResolverFindCalibFile("egammaLayerRecalibTool/v12/egammaLayerRecalibTunes.root");
848 TFile f(file.c_str());
849 TH1F* histo_ps_tot_error = static_cast<TH1F*>(f.Get("hPS_MuonLowMu_rel21_run3ofc"));
850 assert(histo_ps_tot_error);
852 new GetAmountHisto1D(*histo_ps_tot_error));
853 }
854 else if ("ps_mu_r21_v0" == tune) {
855 const std::string file = PathResolverFindCalibFile("egammaLayerRecalibTool/v11/egammaLayerRecalibTunes.root");
856 TFile f(file.c_str());
857 TH1F* histo_ps_tot_error = static_cast<TH1F*>(f.Get("hPS_MuonLowMu_rel21"));
858 assert(histo_ps_tot_error);
860 new GetAmountHisto1D(*histo_ps_tot_error));
861 }
862 else if ("ps_2016_v1" == tune) {
863 const std::string file = PathResolverFindCalibFile("egammaLayerRecalibTool/v4/egammaLayerRecalibTunes.root");
864 TFile f(file.c_str());
865 TH1* histo_ps_tot_error = checked_cast<TH1*>(f.Get("hPS_2016"));
867 new GetAmountHisto1D(*histo_ps_tot_error));
868 }
869 else if ("ps_2012_v3" == tune) {
870 const std::string file = PathResolverFindCalibFile("egammaLayerRecalibTool/v1/egammaLayerRecalibTunes.root");
871 TFile f(file.c_str());
872 TH1* histo_ps_tot_error = checked_cast<TH1*>(f.Get("hPS_2012"));
874 new GetAmountHisto1D(*histo_ps_tot_error));
875 }
876 else if ("ps_2012_v3_down" == tune) {
877 const std::string file = PathResolverFindCalibFile("egammaLayerRecalibTool/v1/egammaLayerRecalibTunes.root");
878 TFile f(file.c_str());
879 TH1* histo_ps_tot_error = checked_cast<TH1*>(f.Get("hPS_2012"));
881 new GetAmountHisto1DUp(*histo_ps_tot_error));
882 }
883 else if ("ps_2012_v3_up" == tune){
884 const std::string file = PathResolverFindCalibFile("egammaLayerRecalibTool/v1/egammaLayerRecalibTunes.root");
885 TFile f(file.c_str());
886 TH1* histo_ps_tot_error = checked_cast<TH1*>(f.Get("hPS_2012"));
888 new GetAmountHisto1DDown(*histo_ps_tot_error));
889 }
890 else if ("ps_2012_v3_errdown" == tune){
891 const std::string file = PathResolverFindCalibFile("egammaLayerRecalibTool/v1/egammaLayerRecalibTunes.root");
892 TFile f(file.c_str());
893 TH1* histo_ps_tot_error = checked_cast<TH1*>(f.Get("hPS_2012"));
895 new GetAmountHisto1DErrorUp(*histo_ps_tot_error));
896 }
897 else if ("ps_2012_v3_errup" == tune){
898 const std::string file = PathResolverFindCalibFile("egammaLayerRecalibTool/v1/egammaLayerRecalibTunes.root");
899 TFile f(file.c_str());
900 TH1* histo_ps_tot_error = checked_cast<TH1*>(f.Get("hPS_2012"));
902 new GetAmountHisto1DErrorDown(*histo_ps_tot_error));
903 }
904 else if ("ps_2011_v3" == tune) {
905 const std::string file = PathResolverFindCalibFile("egammaLayerRecalibTool/v1/egammaLayerRecalibTunes.root");
906 TFile f(file.c_str());
907 TH1* histo_ps_tot_error = checked_cast<TH1*>(f.Get("hPS_2011"));
909 new GetAmountHisto1D(*histo_ps_tot_error));
910 }
911 else if ("ps_2011_v3_down" == tune) {
912 const std::string file = PathResolverFindCalibFile("egammaLayerRecalibTool/v1/egammaLayerRecalibTunes.root");
913 TFile f(file.c_str());
914 TH1* histo_ps_tot_error = checked_cast<TH1*>(f.Get("hPS_2011"));
916 new GetAmountHisto1DUp(*histo_ps_tot_error));
917 }
918 else if ("ps_2011_v3_up" == tune){
919 const std::string file = PathResolverFindCalibFile("egammaLayerRecalibTool/v1/egammaLayerRecalibTunes.root");
920 TFile f(file.c_str());
921 TH1* histo_ps_tot_error = checked_cast<TH1*>(f.Get("hPS_2011"));
923 new GetAmountHisto1DDown(*histo_ps_tot_error));
924 }
925 else if ("ps_2011_v3_errdown" == tune){
926 const std::string file = PathResolverFindCalibFile("egammaLayerRecalibTool/v1/egammaLayerRecalibTunes.root");
927 TFile f(file.c_str());
928 TH1* histo_ps_tot_error = checked_cast<TH1*>(f.Get("hPS_2011"));
930 new GetAmountHisto1DErrorUp(*histo_ps_tot_error));
931 }
932 else if ("ps_2011_v3_errup" == tune){
933 const std::string file = PathResolverFindCalibFile("egammaLayerRecalibTool/v1/egammaLayerRecalibTunes.root");
934 TFile f(file.c_str());
935 TH1* histo_ps_tot_error = checked_cast<TH1*>(f.Get("hPS_2011"));
937 new GetAmountHisto1DErrorDown(*histo_ps_tot_error));
938 }
939 // 2010
940 else if ("ps_2010_v3" == tune) {
941 const std::string file = PathResolverFindCalibFile("egammaLayerRecalibTool/v1/egammaLayerRecalibTunes.root");
942 TFile f(file.c_str());
943 TH1* histo_ps_tot_error = checked_cast<TH1*>(f.Get("hPS_2010"));
945 new GetAmountHisto1D(*histo_ps_tot_error));
946 }
947 else if ("ps_2010_v3_down" == tune) {
948 const std::string file = PathResolverFindCalibFile("egammaLayerRecalibTool/v1/egammaLayerRecalibTunes.root");
949 TFile f(file.c_str());
950 TH1* histo_ps_tot_error = checked_cast<TH1*>(f.Get("hPS_2010"));
952 new GetAmountHisto1DUp(*histo_ps_tot_error));
953 }
954 else if ("ps_2010_v3_up" == tune) {
955 const std::string file = PathResolverFindCalibFile("egammaLayerRecalibTool/v1/egammaLayerRecalibTunes.root");
956 TFile f(file.c_str());
957 TH1* histo_ps_tot_error = checked_cast<TH1*>(f.Get("hPS_2010"));
959 new GetAmountHisto1DDown(*histo_ps_tot_error));
960 }
961 else if ("ps_2010_v3_errdown" == tune){
962 const std::string file = PathResolverFindCalibFile("egammaLayerRecalibTool/v1/egammaLayerRecalibTunes.root");
963 TFile f(file.c_str());
964 TH1* histo_ps_tot_error = checked_cast<TH1*>(f.Get("hPS_2010"));
966 new GetAmountHisto1DErrorUp(*histo_ps_tot_error));
967 }
968 else if ("ps_2010_v3_errup" == tune){
969 const std::string file = PathResolverFindCalibFile("egammaLayerRecalibTool/v1/egammaLayerRecalibTunes.root");
970 TFile f(file.c_str());
971 TH1* histo_ps_tot_error = checked_cast<TH1*>(f.Get("hPS_2010"));
973 new GetAmountHisto1DErrorDown(*histo_ps_tot_error));
974 }
975 else {
976 throw std::runtime_error(tune+" is not a valid tune");
977 }
978}
#define ATH_MSG_INFO(x)
std::string PathResolverFindCalibFile(const std::string &logical_file_name)
static std::string resolve_alias(const std::string &tune)
TH2F(name, title, nxbins, bins_par2, bins_par3, bins_par4, bins_par5=None, bins_par6=None, path='', **kwargs)
TH1F(name, title, nxbins, bins_par2, bins_par3=None, path='', **kwargs)
TFile * file

◆ 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 991 of file egammaLayerRecalibTool.cxx.

992{
993 m_modifiers.emplace_back(modifier, amount);
994}

◆ applyCorrection()

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

Definition at line 1010 of file egammaLayerRecalibTool.cxx.

1011{
1012 const xAOD::CaloCluster* cluster = particle.caloCluster();
1013 if (!cluster) {
1014 ATH_MSG_ERROR("egamma particle without CaloCluster");
1016 }
1017
1018 std::string fixT = "";
1019 double addE2 = 0, addE3 = 0;
1022 fixT = "_egFixForTopoTimingCut";
1023 unsigned short stat =
1024 xAOD::EgammaHelpers::energyInMissingCells(particle,addE2,addE3);
1025 if (stat) {
1026 ATH_MSG_WARNING("Fix for missing cells required"
1027 " but some layer info is not available,"
1028 " from L2 : " << stat%2 << " from L3 : " << stat/2);
1029 }
1030 }
1031
1032 double eta_calo;
1033 static const SG::AuxElement::Accessor<float> accEtaCalo("etaCalo");
1035 eta_calo = cluster->eta();
1036 }
1037 else if (cluster->retrieveMoment(xAOD::CaloCluster::ETACALOFRAME, eta_calo)){
1038
1039 }
1040 else if (accEtaCalo.isAvailable(*cluster)) {
1041 eta_calo = accEtaCalo(*cluster);
1042 }
1043 else{
1044 ATH_MSG_ERROR("etaCalo not available as auxilliary variable,"
1045 " using cluster eta as eta calo!");
1046 eta_calo=cluster->eta();
1047 }
1048
1049 StdCalibrationInputs inputs {
1050 event_info.averageInteractionsPerCrossing(),
1051 event_info.runNumber(),
1052 cluster->eta(),
1053 cluster->phi(),
1054 cluster->energyBE(0),
1055 cluster->energyBE(1),
1056 cluster->energyBE(2) + addE2,
1057 cluster->energyBE(3) + addE3,
1058 eta_calo };
1059
1060 bool isData = !event_info.eventType(xAOD::EventInfo::IS_SIMULATION);
1061 CP::CorrectionCode status = CP::CorrectionCode::Ok;
1062 if (isData || m_scaleMC)
1063 status = scale_inputs(inputs);
1064
1065 static const SG::AuxElement::Decorator<double> deco_E0("correctedcl_Es0");
1066 static const SG::AuxElement::Decorator<double> deco_E1("correctedcl_Es1");
1067 static const SG::AuxElement::Decorator<double> deco_E2("correctedcl_Es2");
1068 static const SG::AuxElement::Decorator<double> deco_E3("correctedcl_Es3");
1070 deco_layer_correction("layer_correction");
1071
1072 if (status == CP::CorrectionCode::Ok) {
1073 ATH_MSG_DEBUG("decorating cluster with corrected layer energies");
1074 deco_E0(*cluster) = m_doPSCorrections ?
1075 inputs.E0raw : cluster->energyBE(0);
1076 deco_E1(*cluster) = m_doS12Corrections or m_doSaccCorrections ?
1077 inputs.E1raw : cluster->energyBE(1);
1078 deco_E2(*cluster) = m_doS12Corrections or m_doSaccCorrections ?
1079 inputs.E2raw : cluster->energyBE(2) + addE2;
1080 deco_E3(*cluster) = m_doSaccCorrections ?
1081 inputs.E3raw : cluster->energyBE(3) + addE3;
1082 deco_layer_correction(*cluster) = isData ? m_tune+fixT : fixT;
1083 return status;
1084 }
1085
1086 ATH_MSG_DEBUG("cannot correct layer energies:"
1087 " decorating particle with non-corrected layer energies");
1088 // this is done for safety, since when a particle is decorated
1089 // all the particle in the container are decorated
1090 // it is not possible to distinguish between decorated / non-decorated
1091 // since all are decorated
1092 deco_E0(*cluster) = cluster->energyBE(0);
1093 deco_E1(*cluster) = cluster->energyBE(1);
1094 deco_E2(*cluster) = cluster->energyBE(2) + addE2;
1095 deco_E3(*cluster) = cluster->energyBE(3) + addE3;
1096 deco_layer_correction(*cluster) = isData ? m_tune + "_Err" + fixT : fixT;
1097 return status;
1098
1099}
#define ATH_MSG_ERROR(x)
#define ATH_MSG_WARNING(x)
#define ATH_MSG_DEBUG(x)
@ Error
Some error happened during the object correction.
@ Ok
The correction was done successfully.
SG::Decorator< T, ALLOC > Decorator
Definition AuxElement.h:575
static const unsigned int m_Run2Run3runNumberTransition
CP::CorrectionCode scale_inputs(StdCalibrationInputs &inputs) const
apply layer calibration to the
bool retrieveMoment(MomentType type, double &value) const
Retrieve individual moment.
virtual double eta() const
The pseudorapidity ( ) of the particle.
float energyBE(const unsigned layer) const
Get the energy in one layer of the EM Calo.
virtual double phi() const
The azimuthal angle ( ) of the particle.
@ ETACALOFRAME
Eta in the calo frame (for egamma)
bool eventType(EventType type) const
Check for one particular bitmask value.
float averageInteractionsPerCrossing() const
Average interactions per crossing for all BCIDs - for out-of-time pile-up.
@ IS_SIMULATION
true: simulation, false: data
uint32_t runNumber() const
The current event's run number.
constexpr ParticleHypothesis particle[PARTICLEHYPOTHESES]
the array of masses
status
Definition merge.py:16
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...
const uint16_t AuthorFwdElectron
Electron reconstructed by the Forward cluster-based algorithm.
Definition EgammaDefs.h:30
CaloCluster_v1 CaloCluster
Define the latest version of the calorimeter cluster class.

◆ clear_corrections()

void egammaLayerRecalibTool::clear_corrections ( )

remove all the scale corrections

Definition at line 1102 of file egammaLayerRecalibTool.cxx.

1103{
1104 for (auto modifier : m_modifiers) {
1105 delete modifier.first;
1106 delete modifier.second;
1107 }
1108 m_modifiers.clear();
1109}

◆ 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 1147 of file egammaLayerRecalibTool.cxx.

1148{
1149 std::map<std::string, std::string> args_map = parse(args);
1150 egammaLayerRecalibTool* tool = new egammaLayerRecalibTool("egammaLayerRecalibTool", "");
1151 std::string name = "";
1152 std::string amount_name = "";
1153 std::string type_name = "";
1154
1155 GetAmountBase* amount_getter = nullptr;
1156 InputModifier* modifier = nullptr;
1157
1158 if (args_map.find("amount") != args_map.end()) {
1159 std::string amount_str = args_map["amount"];
1160 bool perc = false;
1161 if (amount_str.back()=='%') {
1162 perc = true;
1163 amount_str.pop_back();
1164 }
1165 const float amount = TString(amount_str).Atof() * (perc ? 0.01 : 1);
1166
1167 amount_getter = new GetAmountFixed(amount);
1168 std::stringstream amount_stream;
1169 amount_stream << amount;
1170 amount_name = amount_stream.str();
1171 std::replace(amount_name.begin(), amount_name.end(), '-', 'n');
1172 std::replace(amount_name.begin(), amount_name.end(), '.', 'p');
1173 }
1174 else if (args_map.find("name") != args_map.end()) {
1175 name = args_map["name"];
1176 }
1177 else if (args_map.find("histo") != args_map.end()) {
1178 int dim = 0;
1179 if (args_map.find("file") == args_map.end()) {
1180 std::cerr << "with histo you must specify file" << std::endl;
1181 assert(false);
1182 }
1183 if (args_map.find("formulax") != args_map.end()) dim = 1;
1184
1185 if (dim == 0)
1186 {
1187 std::cerr << "with histo you must specify formulax" << std::endl;
1188 assert(false);
1189 }
1190 if (dim == 1) {
1191 TFile f(args_map["file"].c_str());
1192 std::cout << "opening histo " << args_map["histo"] << " from file " << args_map["file"] << std::endl;
1193 TH1F* histo = dynamic_cast<TH1F*>(f.Get(args_map["histo"].c_str()));
1194
1195 if(histo){
1196 histo->SetDirectory(nullptr);
1197 amount_getter = new GetAmountHisto1D(*histo);
1198 }
1199 else{assert(false); }
1200 }
1201 else { assert(false); }
1202 }
1203 else {
1204 std::cerr << "cannot understand argument " << args << std::endl;
1205 assert(false);
1206 }
1207
1208 if ("bias-E0" == type) { modifier = new ScaleE0(InputModifier::ZEROBASED); type_name = "E0"; }
1209 else if ("bias-E1" == type) { modifier = new ScaleE1(InputModifier::ZEROBASED); type_name = "E1"; }
1210 else if ("bias-E2" == type) { modifier = new ScaleE2(InputModifier::ZEROBASED); type_name = "E2"; }
1211 else if ("bias-E3" == type) { modifier = new ScaleE3(InputModifier::ZEROBASED); type_name = "E3"; }
1212 else if ("bias-E1overE2" == type) { modifier = new ScaleE1overE2(InputModifier::ZEROBASED); type_name = "E1overE2"; }
1213 else if ("bias-Eaccordion" == type) { modifier = new ScaleEaccordion(InputModifier::ZEROBASED); type_name = "Eaccordion"; }
1214 else if ("bias-Ecalorimeter" == type) { modifier = new ScaleEcalorimeter(InputModifier::ZEROBASED); type_name = "Ecalorimeter"; }
1215
1216 if (not type_name.empty() and not amount_name.empty()) {
1217 name = type_name + "_" + amount_name;
1218 }
1219
1220 if (name.empty()) {
1221 std::cerr << "you need to specify a name for the bias with type " << type << std::endl;
1222 }
1223
1224 if (modifier and amount_getter) {
1225 tool->add_scale(modifier, amount_getter);
1226 }
1227 else{
1228 tool->add_scale(type);
1229 //release resources, if modifier false need to release amount_getter and vice versa
1230 //since they are not passed to the tool
1231 if(modifier) delete modifier;
1232 if(amount_getter) delete amount_getter;
1233 }
1234
1235 return {name, tool};
1236}
std::map< std::string, std::string > parse(const std::string &list)

◆ 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 // If user did not set an explicit level, set a default
43 if (m_lvl == MSG::NIL) {
44 m_lvl = m_imsg ?
45 static_cast<MSG::Level>( m_imsg.load()->outputLevel(m_nm) ) :
46 MSG::INFO;
47 }
48}
std::string m_nm
Message source name.
std::atomic< IMessageSvc * > m_imsg
MessageSvc pointer.
std::atomic< MSG::Level > m_lvl
Current logging level.
IMessageSvc * getMessageSvc(bool quiet=false)

◆ 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
51 return ::AthMessaging::msg();
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
59 return ::AthMessaging::msg( lvl );
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 996 of file egammaLayerRecalibTool.cxx.

997{
998 CP::CorrectionCode status = CP::CorrectionCode::Ok;
999 for (const auto& modifier : m_modifiers) {
1000 const float amount = (*modifier.second)(inputs);
1001 const auto s = (*modifier.first)(inputs, amount);
1002 ATH_MSG_DEBUG(" after E0|E1|E2|E3 = " << inputs.E0raw << "|" << inputs.E1raw << "|" << inputs.E2raw << "|" << inputs.E3raw);
1003 if (s != CP::CorrectionCode::Ok) {
1004 if (status != CP::CorrectionCode::Error) { status = s; }
1005 }
1006 }
1007 return status;
1008}

◆ scaleMC()

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

Definition at line 323 of file egammaLayerRecalibTool.h.

323{ m_scaleMC = scaleMC; }
void scaleMC(bool scaleMC=true)

◆ 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.

135{ nullptr };

◆ m_lvl

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

Current logging level.

Definition at line 138 of file AthMessaging.h.

138{ MSG::NIL };

◆ 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: