ATLAS Offline Software
Loading...
Searching...
No Matches
ElectronChargeEfficiencyCorrectionTool.cxx
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2026 CERN for the benefit of the ATLAS collaboration
3*/
4
13// Include this class's header
16// xAOD includes
18#include "xAODEgamma/Electron.h"
21
22// ROOT includes
23#include "TFile.h"
24
25// STL includes
26#include <cstdlib> /* atoi */
27
28// =============================================================================
29// Standard constructor
30// =============================================================================
31CP::ElectronChargeEfficiencyCorrectionTool::
32 ElectronChargeEfficiencyCorrectionTool(const std::string& name)
33 : AsgTool(name)
34 , m_dataTypeOverwrite(-1)
35 , m_eventInfoCollectionName("EventInfo")
36 , m_SF_SS()
37 , m_SF_OS()
38 , m_RunNumbers()
39 , m_useRandomRunNumber(true)
40 , m_defaultRandomRunNumber(999999)
41 , m_filename("")
42 , m_workingPoint("")
43 , m_eta_lowlimit(0.0)
44 , m_eta_uplimit(0.0)
45 , m_pt_lowlimit(0.0)
46 , m_pt_uplimit(0.0)
47 , m_gevmev(0.0)
48 , m_filtered_sys_sets()
49 , m_mySysConf()
50 , m_affectingSys()
51 , m_appliedSystematics(nullptr)
52 , m_sf_decoration_name("chargeIDEffiSF")
53 , m_sfDec(nullptr)
54{
55 // Declare the needed properties
56 declareProperty("CorrectionFileName",
57 m_filename,
58 "Name of the file with charge flipping rates");
59 declareProperty(
60 "WorkingPoint", m_workingPoint, "Name of working point folder in the file");
61 declareProperty("ScaleFactorDecorationName", m_sf_decoration_name);
62 declareProperty("ForceDataType",
63 m_dataTypeOverwrite,
64 "Force the DataType of the electron to specified value (to "
65 "circumvent problem of incorrect DataType for forward "
66 "electrons in some old releases)");
67 declareProperty("EventInfoCollectionName",
68 m_eventInfoCollectionName,
69 "The EventInfo Collection Name");
70 declareProperty("UseRandomRunNumber", m_useRandomRunNumber);
71 declareProperty("DefaultRandomRunNumber", m_defaultRandomRunNumber);
72}
73
74// =============================================================================
75// Standard destructor
76// =============================================================================
83
84// =============================================================================
85// Athena initialize method
86// =============================================================================
87StatusCode
89{
90 ATH_MSG_DEBUG("initializing");
91
92 // initialize the random number generator (used in case of charge flip
93 // approach)
94 // m_Rndm = new TRandom3(1);
95
96 if (m_sfDec)
97 delete m_sfDec;
98 m_sfDec = new SG::AuxElement::Decorator<float>(m_sf_decoration_name); // xxxx
99
100 // Resolve the path to the input file for the charge flip rates
101 const std::string rootfilename = PathResolverFindCalibFile(m_filename);
102 if (m_filename.empty()) {
103 ATH_MSG_ERROR(" PathResolver was not able to find the file ... aborting");
104 return StatusCode::FAILURE;
105 }
106
107 // Getting the root file and histograms
108 TFile* rootFile = TFile::Open(rootfilename.c_str());
109
110 // protection against bad file
111 if (rootFile == nullptr) {
112 ATH_MSG_ERROR(" Was not able to open file: " << rootfilename
113 << " ...... aborting");
114 return StatusCode::FAILURE;
115 }
116
118 //
119 // explanation: attempt to loop generally over a file
120 // -- if certain SINGALWORD is present -- then this is taken as a signal,
121 // that this is another dimension... can be dynamically added.
122 // e.g.
123 // SFSyst<number>_RunNumber<minRN>-<maxRN>_Nvtx<minNvtx>-<maxNvtx>
124 // SFStat_RunNumber<minRN>-<maxRN>_Nvtx<minNvtx>-<maxNvtx>
125 // SFCentral_RunNumber<minRN>-<maxRN>_Nvtx<minNvtx>-<maxNvtx>
126
127 // Then can create a key that will dynamically give us access to a map:
128 // std::map<std::string key, std::vector<TH2 *>> m_SF_SS; // keys (e.g.
129 // RunNumber223333_319200_Nvtx0_10_Phi1.5_1.6) mapping to vector of SF
130 // histograms --> vector m_SF: 0=nominal, 1=stat, 2,3,4...n=syst
131 // std::map<std::string key, std::vector<TH2 *>> m_SF_OS; // keys
132 // (e.g. RunNumber223333_319200_Nvtx0_10_Phi1.5_1.6) mapping to vector of
133 // SF histograms --> vector m_SF: 0=nominal, 1=stat, 2,3,4...n=syst
134 // TFile* data/ChMisIDSF_TightLL_FixedCutTight.root
135 // KEY: TH2F SFCentral_RunNumber296939_311481_SS;1
136 // SFCentral_RunNumber296939_311481_SS KEY: TH2F
137 // SFCentral_RunNumber296939_311481_OS;1 SFCentral_RunNumber296939_311481_OS
138 // KEY: TH2F STAT_RunNumber296939_311481_SS;1
139 // STAT_RunNumber296939_311481_SS KEY: TH2F STAT_RunNumber296939_311481_OS;1
140 // STAT_RunNumber296939_311481_OS KEY: TH2F
141 // SYST_RunNumber296939_311481_total_SS;1 SYST_RunNumber296939_311481_SS:
142 // total KEY: TH2F SYST_RunNumber296939_311481_total_OS;1
143 // SYST_RunNumber296939_311481_OS: total
144
145 m_SF_SS.clear();
146 m_SF_OS.clear();
147 TList* keyListfolder = rootFile->GetListOfKeys();
148 std::vector<std::string> names;
149 std::set<std::string> set_systematics;
150
151 names.reserve(keyListfolder->GetEntries());
152 for (int j = 0; j < keyListfolder->GetEntries(); j++) {
153 names.emplace_back((keyListfolder->At(j)->GetName()));
154 }
155 std::sort(names.begin(), names.end());
156
157 for (const std::string & name : names) {
158
159 ATH_MSG_DEBUG("Got ROOT object with name: " << name);
160 if (name.contains("SFCentral_")) {
161 ATH_MSG_VERBOSE("Found name 'SFCentral_' in ROOT object name");
162 // Check for opposite-sign (=opposite-charge)
163 bool isOS = false;
164 if (name.contains("_OS")) {
165 isOS = true;
166 ATH_MSG_VERBOSE("Found name '_OS' in ROOT object name");
167 }
168 if (isOS) {
169 std::string histid = (name);
170 histid.erase(0, 10);
171 histid.erase(histid.size() - 3, 3); // remove _SS, _OS
172 ATH_MSG_VERBOSE("Using histid: " << histid);
173
174 if (histid.contains("RunNumber")) {
175 ATH_MSG_VERBOSE("Found name 'RunNumber' in histid");
176 std::string runlow = histid;
177 runlow.erase(histid.find("RunNumber"), 9);
178 runlow.erase(runlow.find('_'), runlow.size());
179 m_RunNumbers.push_back(
180 static_cast<unsigned int>(atoi(runlow.c_str())));
181 std::string runhigh = histid;
182 runhigh.erase(histid.find("RunNumber"), 9);
183 runhigh.erase(0, runhigh.find('_') + 1);
184 m_RunNumbers.push_back(
185 static_cast<unsigned int>(atoi(runhigh.c_str())));
186 }
187 ATH_MSG_VERBOSE("Using histid (OS hid): " << histid);
188 m_SF_OS[histid].push_back(static_cast<TH2*>(rootFile->Get(name.c_str())));
189 } else {
190 std::string histid = (name);
191 histid.erase(0, 10);
192 histid.erase(histid.size() - 3, 3); // remove _SS, _OS
193 ATH_MSG_VERBOSE("Using histid (do we this in ? SS): " << histid);
194 m_SF_SS[histid].push_back(static_cast<TH2*>(rootFile->Get(name.c_str())));
195 }
196 }
197
199 if (name.contains("STAT_")) {
200 ATH_MSG_VERBOSE("Found name 'STAT_' in ROOT object name");
201 bool isOS = false;
202 if (name.contains("_OS")) {
203 isOS = true;
204 ATH_MSG_VERBOSE("Found name '_OS' in ROOT object name");
205 }
206 if (isOS) {
207 std::string histid = (name);
208 histid.erase(0, 5);
209 histid.erase(histid.size() - 3, 3); // remove _SS, _OS
210 ATH_MSG_VERBOSE("Using histid: " << histid);
211 ATH_MSG_VERBOSE("Using histid (OS hid): " << histid);
212 m_SF_OS[histid].push_back(static_cast<TH2*>(rootFile->Get(name.c_str())));
213 } else {
214 std::string histid = (name);
215 ATH_MSG_VERBOSE("Found histid: " << histid);
216 histid.erase(0, 5);
217 histid.erase(histid.size() - 3, 3); // remove _SS, _OS
218 ATH_MSG_VERBOSE("Using histid (do we this in ? SS): " << histid);
219 m_SF_SS[histid].push_back(static_cast<TH2*>(rootFile->Get(name.c_str())));
220 }
221
222 }
223
225 if (name.contains("SYST")) {
226 ATH_MSG_VERBOSE("Found name 'SYST' in ROOT object name");
227 bool isOS = false;
228 if (name.contains("_OS")) {
229 isOS = true;
230 ATH_MSG_VERBOSE("Found name '_OS' in ROOT object name");
231 }
232 if (isOS) {
233 std::string histid = (name);
234 histid.erase(0, 4);
235 histid.erase(histid.size() - 3, 3); // remove _SS, _OS
236
237 std::string sysname = histid;
238 sysname.erase(sysname.find('_'), sysname.size());
239 set_systematics.insert(std::move(sysname));
240
241 histid.erase(0, histid.find('_') + 1); // remove _SS, _OS
242 ATH_MSG_VERBOSE("Using syst histid: " << histid);
243 ATH_MSG_VERBOSE("Using histid (OS hid): " << histid);
244 m_SF_OS[histid].push_back(static_cast<TH2*>(rootFile->Get(name.c_str())));
245 } else {
246 std::string histid = (name);
247 histid.erase(0, 4);
248 histid.erase(histid.size() - 3, 3); // remove _SS, _OS
249 histid.erase(0, histid.find('_') + 1); // remove _SS, _OS
250 ATH_MSG_VERBOSE("Using histid (sys ? SS): " << histid);
251 m_SF_SS[histid].push_back(static_cast<TH2*>(rootFile->Get(name.c_str())));
252 }
253
254 }
255 }
256
258
259 if (m_SF_OS.empty() || m_SF_SS.empty() || m_SF_SS.size() != m_SF_OS.size()) {
261 "OS/SS SF vectors not filled or of different size. -- Problem with "
262 "files. -- Report to <hn-atlas-EGammaWG@cern.ch>");
263 return StatusCode::FAILURE;
264 }
265
266 m_systematics.insert(m_systematics.end(), set_systematics.begin(), set_systematics.end());
267
268 std::sort(m_RunNumbers.begin(), m_RunNumbers.end());
270 // Determine the limits of validity
271
273 ATH_MSG_DEBUG("Having m_SF_OS.size() = " << m_SF_OS.size());
274 std::map<std::string, std::vector<TH2*>>::iterator it = m_SF_OS.begin();
275
276 // Get the kinematic limits
277 m_eta_lowlimit = (*it).second.at(0)->GetYaxis()->GetXmin();
278 m_eta_uplimit = (*it).second.at(0)->GetYaxis()->GetXmax();
279 ATH_MSG_VERBOSE("|eta| limits " << m_eta_lowlimit << ", " << m_eta_uplimit);
280
281 m_pt_lowlimit = (*it).second.at(0)->GetXaxis()->GetXmin();
282 m_pt_uplimit = (*it).second.at(0)->GetXaxis()->GetXmax();
283 ATH_MSG_VERBOSE("pt limits " << m_pt_lowlimit << ", " << m_pt_uplimit);
284
285 ATH_MSG_VERBOSE("Rates in input file are in GeV");
286 m_gevmev = 0.001;
287
288 // Systematics // dynamic too?
290
291 // Add the recommended systematics to the registry
292 if (registerSystematics() != StatusCode::SUCCESS) {
293 ATH_MSG_ERROR("(registerSystematics() != CP::SystematicCode::Ok)");
294 return StatusCode::FAILURE;
295 }
296
297 return StatusCode::SUCCESS;
298}
299
300
301//---------------------------------------------------------------------------------------
302// Get the scale factor for the electron
303//---------------------------------------------------------------------------------------
304
305//
306
309 const xAOD::Electron& ele,
310 double& sf) const
311{
312
313 // initialize the SF at 1
314 sf = 1.0;
315
316 // checking on the truth electron: up to now if this is not a good ele it's
317 // returning
318 bool goodEle = false;
319 CP::CorrectionCode goodEle_result =
321 if (goodEle_result != CP::CorrectionCode::Ok) {
322 sf = -999.0;
323 ATH_MSG_DEBUG("This is the check of goodeleCC in getscalefactor. Scale "
324 "factor set to -999");
325 return goodEle_result;
326 }
327
328 if (!goodEle) {
329 // electron is background electron and should not be corrected
331 ATH_MSG_DEBUG("Here goodele is false but CC ok");
332 }
333
334 // taking reconstructed variables
335 int reco_ele_charge = ele.charge();
336 const double ele_pt = ele.pt() * m_gevmev;
337 const double ele_eta = std::abs(ele.caloCluster()->etaBE(2));
338
339 // getting the truth charge
340 int truth_ele_charge = 9999;
341 CP::CorrectionCode charge_result =
342 ElectronEfficiencyHelpers::getEleTruthCharge( ele, truth_ele_charge);
343 if (charge_result != CP::CorrectionCode::Ok) {
344 sf = -9999.0;
345 ATH_MSG_VERBOSE("This is check of geteletruthchargeCC in getscalefactor. "
346 "Scale factor set to -9999");
347 return charge_result;
348 }
349
350 if (truth_ele_charge == 0) {
351 ATH_MSG_DEBUG("Here truth charge is =0!!");
353 }
354
355 ATH_MSG_DEBUG("Reco charge = " << reco_ele_charge
356 << "; Truth charge = " << truth_ele_charge);
357
358 // getting the rates from file....
359 float retVal(0.0);
360
362 // here determine, WHICH of the [histid] to choose (after cuuts on runnumber
363 // etc....)
364 std::string cutRunNumber = "all";
365
366 if (!m_RunNumbers.empty()) {
367 unsigned int runnumber = m_defaultRandomRunNumber;
368 ATH_MSG_DEBUG("RandomRunNumber: " << runnumber << " "
371 const xAOD::EventInfo* eventInfo =
373 if (!eventInfo) {
374 ATH_MSG_ERROR("Could not retrieve EventInfo object!");
375 sf = 1.0;
377 }
378 static const SG::AuxElement::Accessor<unsigned int> randomrunnumber(
379 "RandomRunNumber");
380 if (!randomrunnumber.isAvailable(*eventInfo)) {
381 sf = 1.0;
383 "Pileup tool not run before using ElectronEfficiencyTool! SFs do not "
384 "reflect PU distribution in data");
386 }
387 runnumber = randomrunnumber(*(eventInfo));
388 }
389 ATH_MSG_DEBUG("Number of RunNumbers in file: " << m_RunNumbers.size());
390 for (std::size_t r = 0; r < m_RunNumbers.size(); r++) {
391 ATH_MSG_DEBUG( " - " << m_RunNumbers.at(r));
392 }
393 ATH_MSG_VERBOSE("DONE");
394
395 bool isInRunNumberRange = false;
396 for ( std::size_t r=0; r<m_RunNumbers.size()-1; r+=2 ){
397 // increment by two, run numbers always come in pairs (upper and lower bound specified in the histogram name)
398
399 if ( runnumber >= (unsigned int)m_RunNumbers.at(r) &&
400 runnumber <= (unsigned int)m_RunNumbers.at(r+1) ) {
401 cutRunNumber.clear();
402 cutRunNumber =
403 Form("RunNumber%d_%d", m_RunNumbers.at(r), m_RunNumbers.at(r + 1));
404 ATH_MSG_DEBUG("Random run number lies in range " << m_RunNumbers.at(r) << " " << m_RunNumbers.at(r+1));
405 isInRunNumberRange = true;
406 }
407 }
408
409 if (runnumber < m_RunNumbers.at(0) ||
410 (runnumber > m_RunNumbers.at(m_RunNumbers.size() - 1))) {
411 ATH_MSG_DEBUG("RunNumber " << runnumber << " is not in valid RunNumber Range ");
412 sf = 1.0;
414 }
415
416 if ( !isInRunNumberRange ) {
418 }
419 }
420
421 // check if electron is within recommendations in eta/Et
422 if ( ele_eta < m_eta_lowlimit || ele_eta > m_eta_uplimit ) {
423
424 ATH_MSG_DEBUG("Got an electron outside of the range of eta validity " << ele_eta);
426 }
427
428 if ( ele_pt < m_pt_lowlimit ) {
429
430 ATH_MSG_DEBUG("Got an electron outside of the range of pt validity: pt lower than lower limit");
432 }
433
434 // Determine WHICH histograms to use here
435 const std::vector<TH2*>& SShistograms = m_SF_SS.at(cutRunNumber.c_str());
436 const std::vector<TH2*>& OShistograms = m_SF_OS.at(cutRunNumber.c_str());
437
438 // here check OS or SS
439 bool isOS = false;
440
441 if (truth_ele_charge * reco_ele_charge > 0)
442 isOS = true;
443
444 if (isOS) {
445 retVal = this->getChargeFlipRate(ele_eta, ele_pt, OShistograms.at(0), sf);
446 if (retVal != 0) {
447 sf = -9999.0;
449 }
450 } else {
451 ATH_MSG_DEBUG("Get SS his");
452 retVal = this->getChargeFlipRate(ele_eta, ele_pt, SShistograms.at(0), sf);
453 if (retVal != 0) {
454 sf = -9999.0;
456 }
457 }
458
459 ATH_MSG_DEBUG("eta: " << ele_eta << " pt: " << ele_pt);
460 ATH_MSG_DEBUG("SF Rates---- . SF: " << sf);
461
462 // Systematics
463 // ------------------------------------------------------------------------------------------------------
464 double val_stat;
465
467 if (isOS) {
468 retVal =
469 this->getChargeFlipRate(ele_eta, ele_pt, OShistograms.at(1), val_stat);
470 if (retVal != 0) {
471 sf = -9999.0;
473 }
474 } else {
475 ATH_MSG_DEBUG("Get SS his");
476 retVal =
477 this->getChargeFlipRate(ele_eta, ele_pt, SShistograms.at(1), val_stat);
478 if (retVal != 0) {
479 sf = -9999.0;
481 }
482 }
483
484 std::vector<float> systs;
485 double val_sys{ 0.0 };
487 for (unsigned int s = 2; s < OShistograms.size(); s++) {
488 if (isOS) {
489 retVal =
490 this->getChargeFlipRate(ele_eta, ele_pt, OShistograms.at(s), val_sys);
491 if (retVal != 0) {
492 val_sys = -9999.0;
494 }
495 } else {
496 ATH_MSG_DEBUG("Get SS his");
497 retVal =
498 this->getChargeFlipRate(ele_eta, ele_pt, SShistograms.at(s), val_sys);
499 if (retVal != 0) {
500 val_sys = -9999.0;
502 }
503 }
504 systs.push_back(static_cast<float>(val_sys));
505 }
506
507 ATH_MSG_DEBUG(" ... nominal SF: " << sf);
508
509 if (m_mySysConf.empty()) {
510 ATH_MSG_DEBUG(" ... nominal SF: " << sf);
511 } else if (*(m_mySysConf.begin()) ==
512 SystematicVariation("EL_CHARGEID_STAT", 1)) {
513 sf = (sf + (val_stat));
514 ATH_MSG_DEBUG("SF after STATup = " << sf);
515 } else if (*(m_mySysConf.begin()) ==
516 SystematicVariation("EL_CHARGEID_STAT", -1)) {
517 sf = (sf - (val_stat));
518 ATH_MSG_DEBUG("SF after STATdown = " << sf);
519 } else {
520
521 for (unsigned int i = 0; i < m_systematics.size(); i++) {
522 if (*(m_mySysConf.begin()) ==
524 Form("EL_CHARGEID_SYS%s", m_systematics.at(i).c_str()), 1)) {
525 sf = (sf + (val_sys));
526 ATH_MSG_DEBUG("SF after SYSup = " << sf);
527 }
528
529 if (*(m_mySysConf.begin()) ==
531 Form("EL_CHARGEID_SYS%s", m_systematics.at(i).c_str()), -1)) {
532 sf = (sf - (val_sys));
533 ATH_MSG_DEBUG("SF after SYSdown = " << sf);
534 }
535 }
536
537 }
538
540}
541
542//---------------------------------------------------------------------------------------
543// Decorate the electron with the scale factor
544//---------------------------------------------------------------------------------------
545
548 const xAOD::Electron& part) const
549{
551 "In "
552 "CP::ElectronChargeEfficiencyCorrectionTool::applyEfficiencyScaleFactor("
553 "const xAOD::IParticle& part) const");
554 double sf = 0.0;
555 CP::CorrectionCode result = this->getEfficiencyScaleFactor(part, sf);
556 // Decorate the electron
557 (*m_sfDec)(part) = static_cast<float>(sf);
558 return result;
559}
560
561// Get the correction rate given pt (E), eta, histogram
562float
564 double eta,
565 double pt,
566 TH2* hrates,
567 double& flipRate) const
568{
569 ATH_MSG_VERBOSE(" -> in: getChargeFlipRate(" << pt << ", " << eta
570 << " TH2, double&)");
571
572 if (pt > m_pt_uplimit)
573 pt = m_pt_uplimit * 0.999;
574
575 int bin2D = hrates->FindBin(pt, eta);
576 flipRate = hrates->GetBinContent(bin2D);
577
578 ATH_MSG_VERBOSE(" -> flipRate is " << flipRate << ", for histogram "
579 << hrates->GetName());
580
581 return 0;
582}
583
585// returns whether this tool is affected by the given systematics
586bool
588 const SystematicVariation& systematic) const
589{
590
592 return sys.find(systematic) != sys.end();
593}
594
596// returns the list of all systematics this tool can be affected by
597
600{
601 CP::SystematicSet result;
602 result.insert(SystematicVariation("EL_CHARGEID_STAT", 1));
603 result.insert(SystematicVariation("EL_CHARGEID_STAT", -1));
604
605 for (unsigned int i = 0; i < m_systematics.size(); i++) {
606 result.insert(SystematicVariation(
607 Form("EL_CHARGEID_SYS%s", m_systematics.at(i).c_str()), 1));
608 result.insert(SystematicVariation(
609 Form("EL_CHARGEID_SYS%s", m_systematics.at(i).c_str()), -1));
610 }
611 return result;
612}
613
615// returns the list of all systematics this tool recommends to use
622
624// Gets a SystematicSet and filters it
625StatusCode
627 const SystematicSet& systConfig)
628{
629
631 systConfig, m_affectingSys, m_mySysConf)) {
633 "Unsupported combination of systematics passed to the tool! ");
634 return StatusCode::FAILURE;
635 }
636
637 return StatusCode::SUCCESS;
638}
639
640// Register the systematics with the registry and add them to the recommended list
643
644 if (registry.registerSystematics(*this) != StatusCode::SUCCESS) {
645 ATH_MSG_ERROR("Failed to add systematic to list of recommended systematics.");
646 return StatusCode::FAILURE;
647 }
648
649 return StatusCode::SUCCESS;
650}
651
Scalar eta() const
pseudorapidity method
#define ATH_MSG_DEBUG(x,...)
#define ATH_MSG_ERROR(x,...)
#define ATH_MSG_WARNING(x,...)
#define ATH_MSG_VERBOSE(x,...)
std::string PathResolverFindCalibFile(const std::string &logical_file_name)
ServiceHandle< StoreGateSvc > & evtStore()
Return value from object correction CP tools.
@ Error
Some error happened during the object correction.
@ OutOfValidityRange
Input object is out of validity range.
@ Ok
The correction was done successfully.
std::map< std::string, std::vector< TH2 * > > m_SF_OS
std::string m_filename
The name of the input file that contains the histograms.
virtual ASG_TOOL_CLASS(ElectronChargeEfficiencyCorrectionTool, IAsgElectronEfficiencyCorrectionTool) public ~ElectronChargeEfficiencyCorrectionTool()
Standard destructor.
double m_pt_lowlimit
Lower limit of pt range where corrections are available; taken from histogram.
std::map< std::string, std::vector< TH2 * > > m_SF_SS
Histogram that holds the correction rates for Monte Carlo.
virtual bool isAffectedBySystematic(const SystematicVariation &systematic) const override final
Returns whether this tool is affected by the given systematics.
virtual CP::SystematicSet recommendedSystematics() const override final
Returns the list of all systematics this tool recommends to use.
double m_eta_uplimit
Upper limit of eta range where corrections are available; taken from histogram.
virtual CP::CorrectionCode applyEfficiencyScaleFactor(const xAOD::Electron &inputObject) const override final
Decorate the electron.
float getChargeFlipRate(double eta, double pt, TH2 *hrates, double &flipRate) const
Get the charge flip rate rate given pt, eta, histogram.
virtual StatusCode initialize() override final
Gaudi Service Interface method implementations.
std::string m_eventInfoCollectionName
The Event info collection name.
virtual StatusCode applySystematicVariation(const SystematicSet &systConfig) override final
effects: configure this tool for the given list of systematic variations.
double m_eta_lowlimit
Lower limit of eta range where corrections are available; taken from histogram.
virtual CP::CorrectionCode getEfficiencyScaleFactor(const xAOD::Electron &inputObject, double &sf) const override final
Retrieve the Scale factor.
double m_pt_uplimit
Upper limit of pt range where corrections are available; taken from histogram.
virtual SystematicSet affectingSystematics() const override final
Returns the list of all systematics this tool can be affected by.
This module implements the central registry for handling systematic uncertainties with CP tools.
static SystematicRegistry & getInstance()
Get the singleton instance of the registry for the curren thread.
Class to wrap a set of SystematicVariations.
static StatusCode filterForAffectingSystematics(const SystematicSet &systConfig, const SystematicSet &affectingSystematics, SystematicSet &filteredSystematics)
description: filter the systematics for the affected systematics returns: success guarantee: strong f...
float etaBE(const unsigned layer) const
Get the eta in one layer of the EM Calo.
virtual double pt() const override final
The transverse momentum ( ) of the particle.
Definition Egamma_v1.cxx:66
const xAOD::CaloCluster * caloCluster(size_t index=0) const
Pointer to the xAOD::CaloCluster/s that define the electron candidate.
float charge() const
Obtain the charge of the object.
int r
Definition globals.cxx:22
static std::vector< uint32_t > runnumber
Definition iLumiCalc.h:37
CP::CorrectionCode getEleTruthCharge(const xAOD::Electron &ele, int &truthcharge)
Get the charge of the original electron.
CP::CorrectionCode isGoodEle(const xAOD::Electron &ele, bool &goodEle)
Return true if it's good ele for charge flip measurements.
void sort(typename DataModel_detail::iterator< DVL > beg, typename DataModel_detail::iterator< DVL > end)
Specialization of sort for DataVector/List.
setRcore setEtHad setFside pt
EventInfo_v1 EventInfo
Definition of the latest event info version.
static const EventInfo_v1::Accessor< std::vector< std::string > > names("streamTagNames")
JetConstituentVector::iterator iterator
Electron_v1 Electron
Definition of the current "egamma version".