ATLAS Offline Software
EventTools.h
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
3  */
4 
5 #ifndef EVENTTOOLS_H_
6 #define EVENTTOOLS_H_
7 
8 #include <string>
9 #include <vector>
10 
12 
22 namespace xAOD {
23  class IParticle;
24 }
25 
26 namespace top {
27  class Event;
28 
33  enum class LepPartonOriginFlag{
46  FromHiggsToHF=9,
47  FromHiggs=10,
48  FromBSM=1000,
51  FromBSMToHF=1003,
52  Unknown=9999,
53  };
54 
59  FromPhoton=22,
60  FromPhotonToTau=2215,
61  FromLeptonicZ=23,
62  FromLeptonicZToTau=2315,
63  FromLeptonicW=24,
64  FromLeptonicWToTau=2415,
65  FromHiggs=25,
66  FromHiggsToTau=2515,
67  FromB=5,
68  FromBtoTau=515,
69  FromBtoC=54,
70  FromBtoCtoTau=5415,
71  FromC=4,
72  FromCtoTau=415,
73  FromTau=15,
74  FromLightHadron=100,
75  FromBSM=1000,
76  FromBSMToTau=1001,
77  Unknown=9999,
78  };
79 
91  void check(bool thingToCheck, const std::string& usefulFailureMessage);
92 
104  double deltaR(const xAOD::IParticle& p1, const xAOD::IParticle& p2);
105 
114  double deltaPhi(const xAOD::IParticle& p1, const xAOD::IParticle& p2);
115 
124  double mwt(const xAOD::IParticle& lepton, const xAOD::MissingET& met);
125 
134  double ht(const top::Event& event);
135 
147  double invariantMass(const xAOD::IParticle& p1, const xAOD::IParticle& p2);
148 
154  bool isSimulation(const top::Event& event);
155 
166  bool descendingPtSorter(const xAOD::IParticle* p0, const xAOD::IParticle* p1);
167 
175  std::vector<int> calculateBootstrapWeights(int nreplicas, int eventNumber, int mcChannelNumber);
176 }
177 
178 #endif
top::LepPartonOriginFlag::FromAntiTopViaLeptonicBoson
@ FromAntiTopViaLeptonicBoson
tipically means that the muon is coming from tbar->W->...->muon in some way (or any tbar->W/Z/gamma*‍...
top::LepParticleOriginFlag::FromB
@ FromB
Higgs->tau->mu.
top::LepParticleOriginFlag::Unknown
@ Unknown
BSMparticle->tau->muon.
top::LepPartonOriginFlag::FromAntiTopViaQuarkToHF
@ FromAntiTopViaQuarkToHF
tipically means that the muon is coming from tbar->bbar->...->muon in some way (or any tbar->qbar->....
top::LepPartonOriginFlag::FromAntiTopViaHadronicBosonToHF
@ FromAntiTopViaHadronicBosonToHF
tipically means that the muon is coming from tbar->W->...->muon in some way (or any tbar->W/Z/gamma*‍...
top
TopConfig A simple configuration that is NOT a singleton.
Definition: AnalysisTrackingHelper.cxx:58
top::invariantMass
double invariantMass(const xAOD::IParticle &p1, const xAOD::IParticle &p2)
Calculate the invariant mass of two particles.
Definition: EventTools.cxx:48
top::LepParticleOriginFlag::FromBtoTau
@ FromBtoTau
from B-hadron to tau to mu decay
top::LepParticleOriginFlag::FromLeptonicW
@ FromLeptonicW
from W with leptonic decay (note: this will not work for Sherpa)
top::LepPartonOriginFlag::FromHiggs
@ FromHiggs
H->HF->muon, not sure if this can happen in some generators.
top::LepParticleOriginFlag
LepParticleOriginFlag
this enum defines a flag used to understand the particle origin of a lepton (tipically a soft muon),...
Definition: EventTools.h:57
top::LepParticleOriginFlag::FromLeptonicZToTau
@ FromLeptonicZToTau
from Z->tau->lep (note: this will not work for Sherpa)
top::LepPartonOriginFlag::MissingTruthInfo
@ MissingTruthInfo
e.g. this can mean the muon is coming from light hadrons and there is no truth history,...
Event
Definition: trigbs_orderedMerge.cxx:42
top::LepPartonOriginFlag::FromHiggsViaHadronicBosonToHF
@ FromHiggsViaHadronicBosonToHF
H->VV->muon.
top::LepPartonOriginFlag::FromTopViaLeptonicBoson
@ FromTopViaLeptonicBoson
tipically means that the muon is coming from t->W->...->muon in some way (or any t->W/Z/gamma*‍/H->....
top::LepParticleOriginFlag::FromHiggs
@ FromHiggs
xAOD
ICaloAffectedTool is abstract interface for tools checking if 4 mom is in calo affected region.
Definition: ICaloAffectedTool.h:24
top::deltaR
double deltaR(const xAOD::IParticle &p1, const xAOD::IParticle &p2)
Calculate the delta-r distance between two particles (e.g.
Definition: EventTools.cxx:21
top::LepParticleOriginFlag::FromLightHadron
@ FromLightHadron
often these muons are Unknown, but in some cases we have the truth record and we can verify they are ...
xAOD::IParticle
Class providing the definition of the 4-vector interface.
Definition: Event/xAOD/xAODBase/xAODBase/IParticle.h:40
xAOD::mcChannelNumber
mcChannelNumber
Definition: EventInfo_v1.cxx:197
top::LepPartonOriginFlag::FromTopViaHadronicBosonToHF
@ FromTopViaHadronicBosonToHF
tipically means that the muon is coming from t->W->...->muon in some way (or any t->W/Z/gamma*‍/H->....
top::LepParticleOriginFlag::FromTau
@ FromTau
from Tau leptonic (not coming from W or HF-hadron, so not sure this can really happen)
top::LepPartonOriginFlag::FromBSM
@ FromBSM
direct H->muon
top::LepPartonOriginFlag::FromHiggsViaLeptonicBosonToHF
@ FromHiggsViaLeptonicBosonToHF
top::LepPartonOriginFlag::FromTopViaQuarkToHF
@ FromTopViaQuarkToHF
tipically means that the muon is coming from t->b->...->muon in some way (or any t->q->....
met
Definition: IMETSignificance.h:24
event
POOL::TEvent event(POOL::TEvent::kClassAccess)
top::LepParticleOriginFlag::FromBSM
@ FromBSM
top::LepPartonOriginFlag::FromLeptonicBoson
@ FromLeptonicBoson
general case of W/Z/gamma*‍/H->muon or W/Z/gamma*‍/H->tau->muon
top::LepParticleOriginFlag::MissingTruthInfo
@ MissingTruthInfo
no associated truth muon tipically this happens for muon from light-hadrons
top::LepPartonOriginFlag::Unknown
@ Unknown
BSMparticle->HF->muon.
xAOD::MissingET_v1
Principal data object for Missing ET.
Definition: MissingET_v1.h:25
top::check
void check(bool thingToCheck, const std::string &usefulFailureMessage)
Print an error message and terminate if thingToCheck is false.
Definition: EventTools.cxx:15
top::LepParticleOriginFlag::FromCtoTau
@ FromCtoTau
from C-hadron (with no B-hadron parent) to tau to mu decay
top::LepParticleOriginFlag::FromBtoC
@ FromBtoC
from B-hadron to C-hadron to muon decay
top::LepParticleOriginFlag::FromBtoCtoTau
@ FromBtoCtoTau
from B-hadron to C-hadron to tau to muon decay
xAOD::eventNumber
eventNumber
Definition: EventInfo_v1.cxx:124
top::isSimulation
bool isSimulation(const top::Event &event)
Is this event MC simulation (True) or data (False)?
Definition: EventTools.cxx:52
MissingET.h
top::LepPartonOriginFlag::FromBSMToHF
@ FromBSMToHF
BSMparticle->V->HF->muon.
top::LepPartonOriginFlag::FromHiggsToHF
@ FromHiggsToHF
H->VV->HF->muon.
top::deltaPhi
double deltaPhi(const xAOD::IParticle &p1, const xAOD::IParticle &p2)
Calculate delta-phi between two particles (e.g.
Definition: EventTools.cxx:25
top::LepParticleOriginFlag::FromLeptonicWToTau
@ FromLeptonicWToTau
from W->tau->lep (note: this will not work for Sherpa)
top::LepParticleOriginFlag::FromPhotonToTau
@ FromPhotonToTau
gamma*->muonmuon
top::LepParticleOriginFlag::FromPhoton
@ FromPhoton
top::LepPartonOriginFlag::FromBSMViaHadronicBosonToHF
@ FromBSMViaHadronicBosonToHF
BSMparticle->V->muon.
top::LepParticleOriginFlag::FromLeptonicZ
@ FromLeptonicZ
gamma*->tautau and tau->muon
top::LepParticleOriginFlag::FromBSMToTau
@ FromBSMToTau
BSMparticle->muon.
top::LepPartonOriginFlag::FromHFHadronOfUnkownOrigin
@ FromHFHadronOfUnkownOrigin
HF hadron->muon or HF hadron->tau->muon, we're not sure where the HF hadron is coming from (maybe a g...
top::Event
Very simple class to hold event data after reading from a file.
Definition: Event.h:49
top::LepPartonOriginFlag::FromHadronicBosonToHF
@ FromHadronicBosonToHF
general case of W/Z/gamma*‍/H->HF hadrons->muon
top::ht
double ht(const top::Event &event)
HT calculation.
Definition: EventTools.cxx:33
top::LepParticleOriginFlag::FromC
@ FromC
from direct C-hadron (with no B-hadron parent) decay
top::LepPartonOriginFlag::FromBSMViaLeptonicBosonToHF
@ FromBSMViaLeptonicBosonToHF
BSMparticle->muon.
top::descendingPtSorter
bool descendingPtSorter(const xAOD::IParticle *p1, const xAOD::IParticle *p2)
Used when sorting the e, mu, jet, tau containers after CP corrections.
Definition: EventTools.cxx:56
IParticle
Definition: Event/EventKernel/EventKernel/IParticle.h:43
top::LepPartonOriginFlag
LepPartonOriginFlag
this enum defines a flag used to understand the partonic origin of a lepton (tipically a soft muon),...
Definition: EventTools.h:33
top::calculateBootstrapWeights
std::vector< int > calculateBootstrapWeights(int nreplicas, int eventNumber, int mcChannelNumber)
Function used to create poisson weights (mean of 1) for bootstrapping.
Definition: EventTools.cxx:60
top::LepParticleOriginFlag::FromHiggsToTau
@ FromHiggsToTau
Higgs->muon.
top::mwt
double mwt(const xAOD::IParticle &lepton, const xAOD::MissingET &met)
Calculate the transverse mass of the W from the charged lepton and the missing ET.
Definition: EventTools.cxx:29