ATLAS Offline Software
FEMuonHelper.cxx
Go to the documentation of this file.
2 
3 FEMuonHelper::FEMuonHelper() : AsgMessaging("FEMuonHelper") {};
4 
5 bool FEMuonHelper::checkMuonLinks(const std::vector < ElementLink< xAOD::MuonContainer > >& FE_MuonLinks, const std::string& qualityString) const{
6 
7  for (const ElementLink<xAOD::MuonContainer>& MuonLink: FE_MuonLinks){
8  if (!MuonLink.isValid()){
9  ATH_MSG_WARNING("JetPFlowSelectionAlg encountered an invalid muon element link. Skipping. ");
10  continue;
11  }
12 
13  //Details of muon working points are here:
14  //https://twiki.cern.ch/twiki/bin/view/Atlas/MuonSelectionTool
15  const xAOD::Muon* muon = *MuonLink;
16  xAOD::Muon::Quality quality = xAOD::Muon::VeryLoose;
17 
18  if (qualityString == "Loose") quality = xAOD::Muon::Loose;
19  else if (qualityString == "Medium") quality = xAOD::Muon::Medium;
20  else if (qualityString == "Tight") quality = xAOD::Muon::Tight;
21 
22  if ( muon->quality() <= quality && muon->muonType() == xAOD::Muon::Combined ){
23  return true;
24  }
25  }
26 
27  return false;
28 }
29 
30 TLorentzVector FEMuonHelper::adjustNeutralCaloEnergy(const std::vector<double>& clusterMuonEnergyFracs,const xAOD::FlowElement& theFE) const{
31 
32  double totalMuonCaloEnergy = 0.0;
33  for (auto energy : clusterMuonEnergyFracs ) totalMuonCaloEnergy += energy;
34 
35  TLorentzVector newP4;
36  newP4.SetPxPyPzE(theFE.p4().Px(),theFE.p4().Py(),theFE.p4().Pz(),theFE.e() - totalMuonCaloEnergy);
37  return newP4;
38 
39 }
FEMuonHelper::adjustNeutralCaloEnergy
TLorentzVector adjustNeutralCaloEnergy(const std::vector< double > &clusterMuonEnergyFracs, const xAOD::FlowElement &theFE) const
Definition: FEMuonHelper.cxx:30
LikeEnum::Loose
@ Loose
Definition: LikelihoodEnums.h:12
xAOD::muon
@ muon
Definition: TrackingPrimitives.h:195
MuonLink
ElementLink< xAOD::MuonContainer > MuonLink
Definition: BPhysHelper.cxx:21
FEMuonHelper.h
LikeEnum::VeryLoose
@ VeryLoose
Definition: LikelihoodEnums.h:11
xAOD::Muon_v1
Class describing a Muon.
Definition: Muon_v1.h:38
ParticleGun_FastCalo_ChargeFlip_Config.energy
energy
Definition: ParticleGun_FastCalo_ChargeFlip_Config.py:78
FEMuonHelper::FEMuonHelper
FEMuonHelper()
Definition: FEMuonHelper.cxx:3
Trk::Combined
@ Combined
Definition: TrackSummaryTool.h:32
LikeEnum::Tight
@ Tight
Definition: LikelihoodEnums.h:15
xAOD::FlowElement_v1::e
virtual double e() const override
The total energy of the particle.
Definition: FlowElement_v1.cxx:25
xAOD::FlowElement_v1::p4
virtual FourMom_t p4() const override
The full 4-momentum of the particle.
Definition: FlowElement_v1.cxx:33
FEMuonHelper::checkMuonLinks
bool checkMuonLinks(const std::vector< ElementLink< xAOD::MuonContainer > > &FE_MuonLinks, const std::string &qualityString) const
Verify if at least one combined muon in a list passes the relevant quality criteria Details of muon w...
Definition: FEMuonHelper.cxx:5
LikeEnum::Medium
@ Medium
Definition: LikelihoodEnums.h:14
ATH_MSG_WARNING
#define ATH_MSG_WARNING(x)
Definition: AthMsgStreamMacros.h:32
xAOD::FlowElement_v1
A detector object made of other lower level object(s)
Definition: FlowElement_v1.h:25