ATLAS Offline Software
Loading...
Searching...
No Matches
OfflineObjectSelection.cxx
Go to the documentation of this file.
1
9
12
13
14// xAOD offline electron selection
15// selection: 0 take all; 1,4 tight; 2,5 medium; 3,6 loose; <4 cut based, >3 likelihood
16bool TIDA::isGoodOffline(const xAOD::Electron& elec, const unsigned int selection, double ETOffline ) {
17
18 double sintheta = std::sin( 2*std::atan(std::exp(-elec.eta())) );
19 double et = elec.e()*sintheta;
20 if ( std::fabs(et)<ETOffline ) return false;
21
22 // if ( std::fabs(elec.e())<ETOffline ) return false;
23 if (selection == 1) return elec.passSelection("Tight");
24 else if (selection == 2) return elec.passSelection("Medium");
25 else if (selection == 3) return elec.passSelection("Loose");
26 else if (selection == 4) return elec.passSelection("LHTight");
27 else if (selection == 5) return elec.passSelection("LHMedium");
28 else if (selection == 6) return elec.passSelection("LHLoose");
29 return true;
30}
31
32// Currently no xAOD offline muon selection implemented
33bool TIDA::isGoodOffline(const xAOD::Muon& muon, const unsigned int selection, double ) {
34
36 if ( muon.muonType() != xAOD::Muon::MuonType::Combined ) return false;
37
38 bool good_muon = false;
39
43
44 if ( selection == 1 ) good_muon = (muon.quality()<=xAOD::Muon::Quality::Tight);
45 else if ( selection == 2 ) good_muon = (muon.quality()<=xAOD::Muon::Quality::Medium);
46 else if ( selection == 3 ) good_muon = (muon.quality()<=xAOD::Muon::Quality::Loose);
47 else if ( selection == 4 ) good_muon = (muon.quality()<=xAOD::Muon::Quality::VeryLoose);
48 else good_muon = true;
49
50 return good_muon;
51}
52
53
54// xAOD offline tau selection
55// selection: 0 = take all, 1 = tight, 2 = medium, 3 = loose, any other unsigned int = no JetBDTSig requirement
56bool TIDA::isGoodOffline(const xAOD::TauJet& tau, const unsigned int selection, int requireNtracks, double EtCutOffline ) {
57
58 // still require the ET threshold and the track multiplicity
59 // if ( selection==0) return true;
60
62 TLorentzVector TauTLV = tau.p4();
63 double eta_Tau = TauTLV.Eta();
64 double et_Tau = TauTLV.Et();
65
66 if ( std::fabs(eta_Tau)>2.47 ) return false;
67 if ( std::fabs(et_Tau)<EtCutOffline ) return false;
68
69 // int ntrack_Tau = tau.nTracks();
70
71#ifdef XAODTRACKING_TRACKPARTICLE_H
72#ifndef XAODTAU_VERSIONS_TAUJET_V3_H
73 int Ntracks = tau.nTracks();
74 // std::cout << "SUTT no tau detail " << Ntracks << "\t(isGood)" << std::endl;
75#else
76 int Ntracks=0;
77 tau.detail( xAOD::TauJetParameters::nChargedTracks, Ntracks );
78 // std::cout << "SUTT tau detail: N " << Ntracks << "\t(isGood)" << std::endl;
79#endif
80#else
81 int Ntracks = tau.numTrack();
82#endif
83
84 // Could this selection just be replaced by a string that is passed in? Or an enumerate if the function is needed to be called when incrementing an int for the selection?
85 bool good_tau = false;
86
87#if 0
89 if ( selection == 1 ) good_tau = tau.isTau(xAOD::TauJetParameters::JetBDTSigTight);
90 else if ( selection == 2 ) good_tau = tau.isTau(xAOD::TauJetParameters::JetBDTSigMedium);
91 else if ( selection == 3 ) good_tau = tau.isTau(xAOD::TauJetParameters::JetBDTSigLoose);
92 else good_tau = true;
93#else
95 if ( selection == 1 ) good_tau = tau.isTau(xAOD::TauJetParameters::JetRNNSigTight);
96 else if ( selection == 2 ) good_tau = tau.isTau(xAOD::TauJetParameters::JetRNNSigMedium);
97 else if ( selection == 3 ) good_tau = tau.isTau(xAOD::TauJetParameters::JetRNNSigLoose);
98 else good_tau = true;
99#endif
100
101
104 // if ( doThreeProng==false && Ntracks!=1 ) return false;
105 // if ( doThreeProng==true && Ntracks!=3 ) return false;
106 if ( requireNtracks>0 && Ntracks!=requireNtracks ) return false;
107
108 //bool not_a_electron = !( tauisTau(xAOD::TauJetParameters::EleBDTMedium) );
109 //bool not_a_muon = !( tauisTau(xAOD::TauJetParameters::MuonVeto) );
110 //bool best_tau = good_tau && not_a_electron && not_a_muon;
111
112 return good_tau;
113}
virtual double e() const override
The total energy of the particle.
Definition Egamma_v1.cxx:86
virtual double eta() const override final
The pseudorapidity ( ) of the particle.
Definition Egamma_v1.cxx:71
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 std::string selection
bool isGoodOffline(const xAOD::Electron &elec, const unsigned int selection=0, double ETOffline=0)
TauJet_v3 TauJet
Definition of the current "tau version".
Definition TauJet.h:17
Muon_v1 Muon
Reference the current persistent version:
Definition Muon.h:13
Electron_v1 Electron
Definition of the current "egamma version".
Definition Electron.h:17
Extra patterns decribing particle interation process.