ATLAS Offline Software
Loading...
Searching...
No Matches
FEMuonHelper.cxx
Go to the documentation of this file.
2
4
5bool 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
30TLorentzVector 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}
#define ATH_MSG_WARNING(x)
ElementLink< xAOD::MuonContainer > MuonLink
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...
TLorentzVector adjustNeutralCaloEnergy(const std::vector< double > &clusterMuonEnergyFracs, const xAOD::FlowElement &theFE) const
AsgMessaging(const std::string &name)
Constructor with a name.
virtual double e() const override
The total energy of the particle.
virtual FourMom_t p4() const override
The full 4-momentum of the particle.
FlowElement_v1 FlowElement
Definition of the current "pfo version".
Definition FlowElement.h:16
Muon_v1 Muon
Reference the current persistent version: