ATLAS Offline Software
Loading...
Searching...
No Matches
SkimmingToolHIGG1.cxx
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration
3*/
4
6// SkimmingToolHIGG1.cxx, (c) ATLAS Detector software
8// Based on DerivationFramework::SkimmingToolExample
9
11#include <vector>
12#include <string>
13
14#include "CLHEP/Units/SystemOfUnits.h"
15
20
21// Constructor
23 const std::string& n,
24 const IInterface* p) :
25 base_class(t, n, p),
26 m_trigDecisionTool("Trig::TrigDecisionTool/TrigDecisionTool"),
28{
29
30
31 declareProperty("RequireGRL", m_reqGRL = true);
32 declareProperty("ReqireLArError", m_reqLArError = true);
33 declareProperty("RequireTrigger", m_reqTrigger = true);
34 declareProperty("RequirePreselection", m_reqPreselection = true);
35 declareProperty("IncludeSingleMergedElectronPreselection", m_incMergedElectron = false);
36 declareProperty("IncludeSingleElectronPreselection", m_incSingleElectron = true);
37 declareProperty("IncludeDoubleElectronPreselection", m_incDoubleElectron = false);
38 declareProperty("IncludeSingleMuonPreselection", m_incSingleMuon = true);
39 declareProperty("IncludeDoubleMuonPreselection", m_incDoubleMuon = false);
40 declareProperty("IncludePhotonDoubleElectronPreselection", m_incDoubleElectronPhoton = false);
41 declareProperty("IncludePhotonMergedElectronPreselection", m_incMergedElectronPhoton = false);
42 declareProperty("IncludeHighPtPhotonElectronPreselection", m_incHighPtElectronPhoton = false);
43 declareProperty("IncludeDoublePhotonPreselection", m_incTwoPhotons = true);
44
45 declareProperty("RequireKinematic", m_reqKinematic = true);
46 declareProperty("RequireQuality", m_reqQuality = true);
47 declareProperty("RequireIsolation", m_reqIsolation = true);
48 declareProperty("RequireInvariantMass", m_reqInvariantMass = true);
49
50 declareProperty("GoodRunList", m_goodRunList = "");
51
52 declareProperty("DefaultTrigger", m_defaultTrigger = "EF_g35_loose_g25_loose");
53 declareProperty("Triggers", m_triggers = std::vector<std::string>());
54 declareProperty("MergedElectronTriggers",m_mergedtriggers = std::vector<std::string>() );
55
56 declareProperty("MinimumPhotonPt", m_minPhotonPt = 20*CLHEP::GeV);
57 declareProperty("MinimumElectronPt", m_minElectronPt = 20*CLHEP::GeV);
58 declareProperty("MinimumMergedElectronPt", m_minMergedElectronPt = 18*CLHEP::GeV);
59
60 declareProperty("MinimumMuonPt", m_minMuonPt = 20*CLHEP::GeV);
61 declareProperty("MaxMuonEta", m_maxMuonEta = 2.7);
62 declareProperty("RemoveCrack", m_removeCrack = true);
63 declareProperty("MaxEta", m_maxEta = 2.47);
64
65 declareProperty("RelativePtCuts", m_relativePtCuts = true);
66 declareProperty("LeadingPhotonPtCut", m_leadingPhotonPt = 0.35);
67 declareProperty("SubleadingPhotonPtCut", m_subleadingPhotonPt = 0.25);
68
69 declareProperty("MinInvariantMass", m_minInvariantMass = 105*CLHEP::GeV);
70 declareProperty("MaxInvariantMass", m_maxInvariantMass = 160*CLHEP::GeV);
71
72 declareProperty("MergedElectronCutTool", m_mergedCutTools);
73
74}
75
76// Destructor
79
80// Athena initialize and finalize
82{
83 ATH_MSG_VERBOSE("INITIALIZING HSG1 SELECTOR TOOL");
84
86 // trigger decision tool
87 if(m_trigDecisionTool.retrieve(DisableTool{!m_reqTrigger}).isFailure()) {
88 ATH_MSG_FATAL("Failed to retrieve tool: " << m_trigDecisionTool);
89 return StatusCode::FAILURE;
90 }
91 if (m_triggers.empty()) m_triggers.push_back(m_defaultTrigger);
92 ATH_MSG_INFO("Retrieved tool: " << m_trigDecisionTool);
94 //
96 if( m_mergedCutTools.retrieve().isFailure() )
97 {
98 ATH_MSG_FATAL("Failed to retrieve tool: ElectronPhotonSelectorTools");
99 return StatusCode::FAILURE;
100 }
101 }
102
103 ATH_CHECK( m_eventInfoKey.initialize() );
104
105 ATH_CHECK( m_photonKey.initialize() );
106
107 ATH_CHECK( m_electronKey.initialize() );
108
109 ATH_CHECK( m_muonKey.initialize() );
110
112 return StatusCode::SUCCESS;
113}
114
116{
117 ATH_MSG_VERBOSE("finalize() ...");
118 ATH_MSG_INFO("Processed " << m_n_tot << " events, " << m_n_pass << " events passed filter ");
119
120
121 ATH_MSG_INFO("GRL :: " << m_n_passGRL);
122 ATH_MSG_INFO("lar :: " << m_n_passLArError);
123 ATH_MSG_INFO("trig :: " << m_n_passTrigger);
124 ATH_MSG_INFO("----------------------------");
141
142 if(m_incTwoPhotons){
143 ATH_MSG_INFO("2y :: " << m_n_passPreselect);
144 ATH_MSG_INFO("----------------------------");
145 ATH_MSG_INFO("2y - kin :: " << m_n_passKinematic);
146 ATH_MSG_INFO("2y - qual :: " << m_n_passQuality);
147 ATH_MSG_INFO("2y - iso :: " << m_n_passIsolation);
148 ATH_MSG_INFO("2y - inv :: " << m_n_passInvariantMass);
149 }
150 ATH_MSG_INFO("----------------------------");
151 ATH_MSG_INFO("passed :: " << m_n_pass);
152
153 return StatusCode::SUCCESS;
154}
155
156// The filter itself
158{
159
160 m_n_tot++;
161
162 bool writeEvent(false);
164
165 if (m_reqGRL && !SubcutGoodRunList() ) return false;
166 if (m_reqLArError && !SubcutLArError(*eventInfo) ) return false;
167 if (m_reqTrigger && !SubcutTrigger() ) return false;
168
169 const auto leadingPhotons = SubcutPreselect();
170 if (m_incTwoPhotons && !m_reqPreselection) writeEvent = true;
171
172 // ey, ee, muy events
173 if (m_incSingleElectron && SubcutOnePhotonOneElectron() ) writeEvent = true;
174 if (m_incDoubleElectron && SubcutTwoElectrons() ) writeEvent = true;
175 if (m_incSingleMuon && SubcutOnePhotonOneMuon() ) writeEvent = true;
176
177 // eey, mumuy events
178 if (m_incMergedElectronPhoton && SubcutOnePhotonMergedElectrons(*eventInfo)) writeEvent = true;
179 if (m_incDoubleMuon && SubcutOnePhotonTwoMuons() ) writeEvent = true;
180 if (m_incDoubleElectronPhoton && SubcutOnePhotonTwoElectrons() ) writeEvent = true;
182
183 if (m_incMergedElectron && SubcutOneMergedElectron() ) writeEvent = true;
184 // There *must* be two photons for the remaining
185 // pieces, but you can still save the event...
186 if (m_incTwoPhotons && leadingPhotons) {
188 const double mass = CalculateInvariantMass(leadingPhotons.value());
189
190 bool passTwoPhotonCuts(true);
191 if (m_reqQuality && !SubcutQuality(leadingPhotons.value())) passTwoPhotonCuts = false;
192 if (m_reqKinematic && !SubcutKinematic(leadingPhotons.value(), mass)) passTwoPhotonCuts = false;
193 if (m_reqIsolation && !SubcutIsolation()) passTwoPhotonCuts = false;
194 if (m_reqInvariantMass && !SubcutInvariantMass(mass)) passTwoPhotonCuts = false;
195 // yy events
196 if (passTwoPhotonCuts) writeEvent = true;
197
198 }
199
200
201 if (!writeEvent) return false;
202
203 m_n_pass++;
204 return true;
205}
206
208
209 // Placeholder
210 m_n_passGRL++;
211 return true;
212}
213
214
216
219 return true;
220 }
221 else return false;
222}
223
224
226
227 //just for counting purposes
228 bool passTrigger = !m_reqTrigger;
229
230 if(m_triggers.empty()) passTrigger = true;
231
232 for (unsigned int i = 0; i < m_triggers.size(); i++) {
233 ATH_MSG_DEBUG("TRIGGER = " << m_triggers.at(i));
234 if(m_trigDecisionTool->isPassed(m_triggers.at(i)))
235 passTrigger = true;
236 }
237
238 if (passTrigger) m_n_passTrigger++;
239 return passTrigger;
240
241}
242
243
244std::optional<DerivationFramework::SkimmingToolHIGG1::LeadingPhotons_t>
246
248
249 xAOD::PhotonContainer::const_iterator ph_itr(photons->begin());
250 xAOD::PhotonContainer::const_iterator ph_end(photons->end());
251
252 int ph_pos_lead = -1;
253 int ph_pos_subl = -1;
254 int ph_pt_lead = 0;
255 int ph_pt_subl = 0;
256
257 for(int i = 0; ph_itr != ph_end; ++ph_itr, ++i) {
258
259 if (PhotonPreselect(*ph_itr)) {
260
261 if ((*ph_itr)->pt() > ph_pt_lead) {
262
263 ph_pos_subl = ph_pos_lead; ph_pos_lead = i;
264 ph_pt_subl = ph_pt_lead;
265 ph_pt_lead = (*ph_itr)->pt();
266
267 } else if ((*ph_itr)->pt() > ph_pt_subl) {
268 ph_pos_subl = i;
269 ph_pt_subl = (*ph_itr)->pt();
270 }
271 }
272 }
273
274 // save this for the derivation.
275 //std::vector<int> *leadingV = new std::vector<int>();
276 //leadingV->push_back(m_ph_pos_lead);
277 //leadingV->push_back(m_ph_pos_subl);
278 //if (!evtStore()->contains<std::vector<int> >("leadingV")) CHECK(evtStore()->record(leadingV, "leadingV"));
279
280 // save this for this code.
281 if (ph_pos_subl != -1) {
282 const xAOD::Photon* ph_lead = *(photons->begin() + ph_pos_lead);
283 const xAOD::Photon* ph_subl = *(photons->begin() + ph_pos_subl);
285
286 return LeadingPhotons_t{ph_lead,ph_subl};
287 }
288
289 return {};
290}
291
292
294
295 if (!ph) return false;
296
297 if (!ph->isGoodOQ(34214)) return false;
298
299 bool val(false);
300 bool defined(false);
301
302 static const SG::ConstAccessor<char> DFCommonPhotonsIsEMLooseAcc("DFCommonPhotonsIsEMLoose");
303 if(DFCommonPhotonsIsEMLooseAcc.isAvailable(*ph)){
304 defined = true;
305 val = static_cast<bool>(DFCommonPhotonsIsEMLooseAcc(*ph));
306 }
307 else{
308 defined = ph->passSelection(val, "Loose");
309 }
310
311 if(!defined || !val) return false;
312
313
314 // veto topo-seeded clusters
315 // uint16_t author = 0;
316 // author = ph->author();
317 // if (author & xAOD::EgammaParameters::AuthorCaloTopo35) return false;
318
319 // Check which variable versions are best...
320 const xAOD::CaloCluster *caloCluster(ph->caloCluster());
321 double eta = std::abs(caloCluster->etaBE(2));
322
323 if (eta > m_maxEta) return false;
324 if (m_removeCrack &&
325 1.37 <= eta && eta <= 1.52) return false;
326 if (caloCluster->e()/cosh(eta) < m_minPhotonPt) return false;
327
328 return true;
329
330}
331
332bool DerivationFramework::SkimmingToolHIGG1::SubcutKinematic(const LeadingPhotons_t& leadingPhotons, double invariantMass) const {
333
334 bool passKinematic;
335 if (m_relativePtCuts) {
336 passKinematic = (leadingPhotons[0]->pt() > invariantMass * m_leadingPhotonPt);
337 passKinematic &= (leadingPhotons[1]->pt() > invariantMass * m_subleadingPhotonPt);
338 } else {
339 passKinematic = (leadingPhotons[0]->pt() > m_leadingPhotonPt);
340 passKinematic &= (leadingPhotons[1]->pt() > m_subleadingPhotonPt);
341 }
342
343 if (passKinematic) m_n_passKinematic++;
344 return passKinematic;
345
346}
347
349
350 bool val(0);
351 bool passQuality = false;
352 leadingPhotons[0]->passSelection(val, "Tight");
353 const int ph_tight_lead = val;
354
355 leadingPhotons[1]->passSelection(val, "Tight");
356 const int ph_tight_subl = val;
357
358 passQuality = (ph_tight_lead && ph_tight_subl);
359
360 if (passQuality) m_n_passQuality++;
361 return passQuality;
362
363}
364
366
367 // PLACEHOLDER!!!
369 return true;
370}
371
372
374
375 bool passInvariantMass = (!m_minInvariantMass ||
376 m_minInvariantMass < invariantMass);
377
378 passInvariantMass &= (!m_maxInvariantMass ||
379 invariantMass < m_maxInvariantMass);
380
381 if (passInvariantMass) m_n_passInvariantMass++;
382 return passInvariantMass;
383
384}
385
387
389 const double ph_e_lead = CorrectedEnergy(leadingPhotons[0]);
390 const double ph_e_subl = CorrectedEnergy(leadingPhotons[1]);
391
393 const double ph_eta_lead = CorrectedEta(leadingPhotons[0]);
394 const double ph_eta_subl = CorrectedEta(leadingPhotons[1]);
395
396 const double ph_phi_lead = leadingPhotons[0]->phi();
397 const double ph_phi_subl = leadingPhotons[1]->phi();
398
399 const double ph_pt_lead = ph_e_lead / cosh(ph_eta_lead);
400 const double ph_pt_subl = ph_e_subl / cosh(ph_eta_subl);
401
402 TLorentzVector leadPhotonLV;
403 TLorentzVector sublPhotonLV;
404 leadPhotonLV.SetPtEtaPhiM(ph_pt_lead, ph_eta_lead, ph_phi_lead, 0.);
405 sublPhotonLV.SetPtEtaPhiM(ph_pt_subl, ph_eta_subl, ph_phi_subl, 0.);
406
407 return (leadPhotonLV + sublPhotonLV).M();
408
409}
410
411
412
414
415 return 0;
416
417}
418
421
422 return ph->e();
423
424}
425
426
430
431 double eta1 = ph->caloCluster()->etaBE(1);
432
433 double R_photom_n_front, Z_photom_n_front;
434 if (std::abs(eta1) < 1.5) { // barrel
435 R_photom_n_front = ReturnRZ_1stSampling_cscopt2(eta1);
436 Z_photom_n_front = R_photom_n_front*sinh(eta1);
437 } else { // endcap
438 Z_photom_n_front = ReturnRZ_1stSampling_cscopt2(eta1);
439 R_photom_n_front = Z_photom_n_front/sinh(eta1);
440 }
441
442 return asinh((Z_photom_n_front - GetDiphotonVertex())/R_photom_n_front);
443
444}
445
446
448
449 float abs_eta1 = std::abs(eta1);
450
451 double radius = -99999;
452 if (abs_eta1 < 0.8) {
453 radius = 1558.859292 - 4.990838 * abs_eta1 - 21.144279 * abs_eta1 * abs_eta1;
454 } else if (abs_eta1 < 1.5) {
455 radius = 1522.775373 + 27.970192 * abs_eta1 - 21.104108 * abs_eta1 * abs_eta1;
456 } else { //endcap
457 radius = 3790.671754;
458 if (eta1 < 0.) radius = -radius;
459 }
460
461 return radius;
462
463}
464
466
468
469 xAOD::PhotonContainer::const_iterator ph_itr(photons->begin());
470 xAOD::PhotonContainer::const_iterator ph_end(photons->end());
471
473
474 xAOD::ElectronContainer::const_iterator el_itr(electrons->begin());
475 xAOD::ElectronContainer::const_iterator el_end(electrons->end());
476
477 bool passSingleElectronPreselect = false;
478
479 for( ; ph_itr != ph_end; ++ph_itr){
480 if(PhotonPreselect(*ph_itr)){
481 for( ; el_itr != el_end; ++el_itr){
482 if(ElectronPreselect(*el_itr)){
483 passSingleElectronPreselect = true;
484 }
485 }
486 }
487 }
488
489
490 if(passSingleElectronPreselect) m_n_passSingleElectronPreselect++;
491 return passSingleElectronPreselect;
492}
493
494
496
498
499 int nEle(0);
500 for(const auto *const el: *electrons){
501 if( el->pt() < m_minElectronPt)
502 continue;
503 //Count the number of Si tracks matching the electron
504 int nSiTrack(0);
505 int z0_1 = 1;
506 for( unsigned int trk_i(0); trk_i < el->nTrackParticles(); ++trk_i){
507 const auto *ele_tp = el->trackParticle(trk_i);
508 if(!ele_tp){
509 continue;
510 }
511 uint8_t nPixHits(0), nPixDead(0), nSCTHits(0), nSCTDead(0);
512 bool allFound = true;
513 allFound = allFound && ele_tp->summaryValue(nPixHits, xAOD::numberOfPixelHits);
514 allFound = allFound && ele_tp->summaryValue(nPixDead, xAOD::numberOfPixelDeadSensors);
515 allFound = allFound && ele_tp->summaryValue(nSCTHits, xAOD::numberOfSCTHits);
516 allFound = allFound && ele_tp->summaryValue(nSCTDead, xAOD::numberOfSCTDeadSensors);
517
518 // Require that the track be a reasonble silicon track
519 int nSiHitsPlusDeadSensors = nPixHits + nPixDead + nSCTHits + nSCTDead;
520 if(nSiHitsPlusDeadSensors >= 7)
521 {
522 //Ensure that the tracks come from roughly the same region of the detector
523 if(nSiTrack == 0)
524 z0_1 = ele_tp->z0();
525 else if( std::abs(z0_1 - ele_tp->z0()) > 10 )
526 continue;
527 ++nSiTrack;
528 }
529 }
530 //If 2 or more the electron is selected
531 if(nSiTrack>1)
532 ++nEle;
533 }
534 if(nEle>0){
536 return true;
537 }
538 return false;
539}
540
542
544
545 xAOD::ElectronContainer::const_iterator el_itr(electrons->begin());
546 xAOD::ElectronContainer::const_iterator el_end(electrons->end());
547
548 int nEle(0);
549 bool passDoubleElectronPreselect = false;
550
551 for( ; el_itr != el_end; ++el_itr){
552 if(ElectronPreselect(*el_itr))
553 nEle++;
554 }
555
556 if(nEle >=2) passDoubleElectronPreselect = true;
557
558 if(passDoubleElectronPreselect) m_n_passDoubleElectronPreselect++;
559 return passDoubleElectronPreselect;
560}
561
562
564
566
567 xAOD::PhotonContainer::const_iterator ph_itr(photons->begin());
568 xAOD::PhotonContainer::const_iterator ph_end(photons->end());
569
571
572 xAOD::MuonContainer::const_iterator mu_itr(muons->begin());
573 xAOD::MuonContainer::const_iterator mu_end(muons->end());
574
575 bool passSingleMuonPreselect = false;
576
577 for( ; ph_itr != ph_end; ++ph_itr){
578 if(PhotonPreselect(*ph_itr)){
579 for( ; mu_itr != mu_end; ++mu_itr){
580 if(MuonPreselect(*mu_itr)){
581 passSingleMuonPreselect = true;
582 }
583 }
584 }
585 }
586
587
588 if(passSingleMuonPreselect) m_n_passSingleMuonPreselect++;
589 return passSingleMuonPreselect;
590}
591
593{
595
596 xAOD::PhotonContainer::const_iterator ph_itr(photons->begin());
597 xAOD::PhotonContainer::const_iterator ph_end(photons->end());
598
600
601 xAOD::MuonContainer::const_iterator mu_itr(muons->begin());
602 xAOD::MuonContainer::const_iterator mu_end(muons->end());
603
604 int nPhoton = 0;
605 int nMuon = 0;
606
607 for( ; ph_itr != ph_end; ++ph_itr){
608 if(PhotonPreselect(*ph_itr)){
609 ++nPhoton;
610 }
611 }
612
613 for( ; mu_itr != mu_end; ++mu_itr){
614 if(MuonPreselect(*mu_itr)){
615 ++nMuon;
616 }
617 }
618
619
620 if(nPhoton >= 1 && nMuon >= 2){
621 ATH_MSG_DEBUG("Event selected with " << nPhoton << " photons and " << nMuon << " muons");
623 return true;
624 } else {
625 return false;
626 }
627}
628
629
631{
633
634 xAOD::PhotonContainer::const_iterator ph_itr(photons->begin());
635 xAOD::PhotonContainer::const_iterator ph_end(photons->end());
636
638
639 xAOD::ElectronContainer::const_iterator el_itr(electrons->begin());
640 xAOD::ElectronContainer::const_iterator el_end(electrons->end());
641
642 int nPhoton = 0;
643 int nElectron = 0;
644
645 for( ; ph_itr != ph_end; ++ph_itr){
646 if(PhotonPreselect(*ph_itr)){
647 ++nPhoton;
648 }
649 }
650
651 for( ; el_itr != el_end; ++el_itr){
652 if(ElectronPreselect(*el_itr)){
653 ++nElectron;
654 }
655 }
656
657 if(nPhoton >= 1 && nElectron >= 2){
658 ATH_MSG_DEBUG("Event selected with " << nPhoton << " photons and " << nElectron << " electrons");
660 return true;
661 } else {
662 return false;
663 }
664
665}
666
668{
669
670
671 bool passTrigger=false;
672 if(!m_mergedtriggers.empty()) {
673 for (unsigned int i = 0; i < m_mergedtriggers.size(); i++) {
674 ATH_MSG_DEBUG("TRIGGER = " << m_mergedtriggers.at(i));
675 if(m_trigDecisionTool->isPassed(m_mergedtriggers.at(i)))
676 passTrigger = true;
677 }
678 } else {
680 ATH_MSG_WARNING("Selecting Merged electrons but no Merged Triggers Selected ! -- was that intentional?");
681 passTrigger = true;
682 }
683 if(!passTrigger)
684 return false;
685
686
688
690
691 bool passSelection = false;
692
693 for(const auto *el : *electrons){
695 for(const auto *ph: *photons){
696 if(PhotonPreselect(ph)){
697 passSelection = true;
698 auto eph = ph->p4() + el->p4();
699 if(eph.M() > 90 * CLHEP::GeV)
700 {
701 break;
702 }
703 }
704 }
705 }
706 if(passSelection)
707 {
708 break;
709 }
710 }
711
712 if(passSelection){
713 ATH_MSG_DEBUG("Event selected with a photons and a merged electron");
715 return true;
716 } else {
717 return false;
718 }
719
720}
721
722
724{
725
726
728
729 xAOD::PhotonContainer::const_iterator ph_itr(photons->begin());
730 xAOD::PhotonContainer::const_iterator ph_end(photons->end());
731
733
734 xAOD::ElectronContainer::const_iterator el_itr(electrons->begin());
735 xAOD::ElectronContainer::const_iterator el_end(electrons->end());
736
737 int nPhoton = 0;
738 int nElectron = 0;
739
740 for( ; ph_itr != ph_end; ++ph_itr){
741 if(PhotonPreselect(*ph_itr) && (*ph_itr)->pt() > 500*CLHEP::GeV){
742 ++nPhoton;
743 }
744 }
745
746 for( ; el_itr != el_end; ++el_itr){
747 if( std::abs((*el_itr)->eta()) <= m_maxEta && (*el_itr)->pt() > m_minElectronPt){
748 ++nElectron;
749 }
750 }
751
752 if(nPhoton >= 1 && nElectron >= 1 ){
753 ATH_MSG_DEBUG("Event selected with " << nPhoton << " high pt photons and " << nElectron << " merged electron");
755 return true;
756 } else {
757 return false;
758 }
759
760}
761
762
763
765
766 if (!el) return false;
767
768 bool val(false);
769 bool defined(false);
770
771 static const SG::ConstAccessor<char> DFCommonElectronsLooseAcc("DFCommonElectronsLoose");
772 if(DFCommonElectronsLooseAcc.isAvailable(*el)){
773 defined = true;
774 val = val || static_cast<bool>(DFCommonElectronsLooseAcc(*el));
775 }else{
776 defined = el->passSelection(val, "Loose");
777 }
778
779 static const SG::ConstAccessor<char> DFCommonElectronsLHLooseAcc("DFCommonElectronsLHLoose");
780 if(DFCommonElectronsLHLooseAcc.isAvailable(*el)){
781 defined = true;
782 val = val || static_cast<bool>(DFCommonElectronsLHLooseAcc(*el));
783 }
784
785 if(!defined || !val) return false;
786
787 double eta = std::abs(el->eta());
788 double pt = el->pt();
789
790 if (eta > m_maxEta) return false;
791 if (m_removeCrack && 1.37 <= eta && eta <= 1.52) return false;
792 if (pt <= m_minElectronPt) return false;
793
794 return true;
795
796}
797
799
800 if (!el) return false;
801
802 double eta = std::abs(el->eta());
803 double pt = el->pt();
804
805 if (eta > m_maxEta) return false;
806 if (m_removeCrack && 1.37 <= eta && eta <= 1.52) return false;
807 if (pt <= m_minMergedElectronPt) return false;
808
809 return m_mergedCutTools->accept(el) || ElectronPreselect(el);
810
811}
812
814
815 if (!mu) return false;
816
817 static const SG::ConstAccessor<char> DFCommonGoodMuonAcc("DFCommonGoodMuon");
818 if(DFCommonGoodMuonAcc.isAvailable(*mu))
819 if( !static_cast<bool>(DFCommonGoodMuonAcc(*mu)) )
820 return false;
821
822 static const SG::ConstAccessor<char> DFCommonMuonsPreselectionAcc("DFCommonMuonsPreselection");
823 if(DFCommonMuonsPreselectionAcc.isAvailable(*mu))
824 if( !static_cast<bool>(DFCommonMuonsPreselectionAcc(*mu)) )
825 return false;
826
827 double eta = std::abs(mu->eta());
828 double pt = mu->pt();
829
830 if (eta > m_maxMuonEta) return false;
831 if (pt <= m_minMuonPt) return false;
832
833 return true;
834
835}
836
837const double DerivationFramework::SkimmingToolHIGG1::s_MZ = 91187.6*CLHEP::MeV;
838
839
840
Scalar eta() const
pseudorapidity method
#define ATH_CHECK
Evaluate an expression and check for errors.
#define ATH_MSG_FATAL(x)
#define ATH_MSG_INFO(x)
#define ATH_MSG_VERBOSE(x)
#define ATH_MSG_WARNING(x)
#define ATH_MSG_DEBUG(x)
Helper class to provide constant type-safe access to aux data.
DataModel_detail::const_iterator< DataVector > const_iterator
Definition DataVector.h:838
std::atomic< unsigned int > m_n_passTrigger
SG::ReadHandleKey< xAOD::PhotonContainer > m_photonKey
std::atomic< unsigned int > m_n_passSingleElectronPreselect
virtual bool eventPassesFilter(const EventContext &ctx) const override
Check that the current event passes this filter.
bool MuonPreselect(const xAOD::Muon *mu) const
bool SubcutInvariantMass(double invariantMass) const
double CalculateInvariantMass(const LeadingPhotons_t &leadingPhotons) const
virtual StatusCode initialize() override
bool SubcutQuality(const LeadingPhotons_t &leadingPhotons) const
static double ReturnRZ_1stSampling_cscopt2(double eta1)
virtual StatusCode finalize() override
std::vector< std::string > m_triggers
std::atomic< unsigned int > m_n_passInvariantMass
std::atomic< unsigned int > m_n_passSinglePhotonMergedElectronPreselect
std::atomic< unsigned int > m_n_passDoubleElectronPreselect
SG::ReadHandleKey< xAOD::MuonContainer > m_muonKey
std::atomic< unsigned int > m_n_passHighPtPhotonMergedElectronPreselect
std::optional< LeadingPhotons_t > SubcutPreselect() const
std::atomic< unsigned int > m_n_passSingleMergedElectronPreselect
static double CorrectedEnergy(const xAOD::Photon *ph)
SkimmingToolHIGG1(const std::string &t, const std::string &n, const IInterface *p)
Constructor with parameters.
std::atomic< unsigned int > m_n_passSinglePhotonDoubleMuonPreselect
std::vector< std::string > m_mergedtriggers
std::atomic< unsigned int > m_n_passSingleMuonPreselect
std::atomic< unsigned int > m_n_passSinglePhotonDoubleElectronPreselect
ToolHandle< Trig::TrigDecisionTool > m_trigDecisionTool
std::array< const xAOD::Photon *, 2 > LeadingPhotons_t
Leading and sub-leading photon (in that order).
SG::ReadHandleKey< xAOD::EventInfo > m_eventInfoKey
bool SubcutKinematic(const LeadingPhotons_t &leadingPhotons, double invariantMass) const
bool ElectronPreselect(const xAOD::Electron *el) const
bool SubcutLArError(const xAOD::EventInfo &eventInfo) const
std::atomic< unsigned int > m_n_passKinematic
SG::ReadHandleKey< xAOD::ElectronContainer > m_electronKey
std::atomic< unsigned int > m_n_passGRL
std::atomic< unsigned int > m_n_passPreselect
bool PhotonPreselect(const xAOD::Photon *ph) const
bool MergedElectronPreselect(const xAOD::Electron *el) const
std::atomic< unsigned int > m_n_passQuality
std::atomic< unsigned int > m_n_passLArError
double CorrectedEta(const xAOD::Photon *ph) const
std::atomic< unsigned int > m_n_passIsolation
ToolHandle< IAsgElectronIsEMSelector > m_mergedCutTools
bool SubcutOnePhotonMergedElectrons(const xAOD::EventInfo &eventInfo) const
Helper class to provide constant type-safe access to aux data.
bool isAvailable(const ELT &e) const
Test to see if this variable exists in the store.
virtual double e() const
The total energy of the particle.
float etaBE(const unsigned layer) const
Get the eta in one layer of the EM Calo.
bool isGoodOQ(uint32_t mask) const
Check object quality. Return True is it is Good Object Quality.
bool passSelection(bool &value, const std::string &menu) const
Check if the egamma object pass a selection menu (using the name) If the menu decision is stored in t...
const xAOD::CaloCluster * caloCluster(size_t index=0) const
Pointer to the xAOD::CaloCluster/s that define the electron candidate.
bool eventType(EventType type) const
Check for one particular bitmask value.
@ LAr
The LAr calorimeter.
@ Error
The sub-detector issued an error.
@ IS_SIMULATION
true: simulation, false: data
EventFlagErrorState errorState(EventFlagSubDet subDet) const
Get the error state for a particular sub-detector.
virtual double e() const override final
The total energy of the particle.
Definition Photon_v1.cxx:46
EventInfo_v1 EventInfo
Definition of the latest event info version.
CaloCluster_v1 CaloCluster
Define the latest version of the calorimeter cluster class.
Muon_v1 Muon
Reference the current persistent version:
Photon_v1 Photon
Definition of the current "egamma version".
@ numberOfSCTDeadSensors
number of dead SCT sensors crossed [unit8_t].
@ numberOfSCTHits
number of hits in SCT [unit8_t].
@ numberOfPixelHits
these are the pixel hits, including the b-layer [unit8_t].
@ numberOfPixelDeadSensors
number of dead pixel sensors crossed [unit8_t].
Electron_v1 Electron
Definition of the current "egamma version".