ATLAS Offline Software
Loading...
Searching...
No Matches
LeptonFELinkerPlots.cxx
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration
3*/
4
11#include "AthLinks/ElementLink.h"
12
13namespace PFO {
14 LeptonFELinkerPlots::LeptonFELinkerPlots(PlotBase* pParent,const std::string & sDir, const std::string & LeptonContainerName,const bool& doNeutralFE,const int& PID):
15 PlotBase(pParent, sDir),
16 m_LeptonContainerName(LeptonContainerName),
17 m_doNeutralFE(doNeutralFE),
18 m_LeptonID(PID)
19 {
22
23 m_muon_NMatchedCFE=nullptr;
24 m_muon_NMatchedNFE=nullptr;
25
26 m_tau_NMatchedCFE=nullptr;
27 m_tau_NMatchedNFE=nullptr;
28
31 }
32
35 {
36 if(m_LeptonID==11)
37 m_electron_NMatchedNFE=Book1D("_electron_NMatchedNFE",m_LeptonContainerName+"_elecron_NMatchedNFE",20,0,20);
38 else if (m_LeptonID==13)
39 m_muon_NMatchedNFE=Book1D("_muon_NMatchedNFE",m_LeptonContainerName+"_muon_NMatchedNFE",20,0,20);
40 else if (m_LeptonID==17)
41 m_tau_NMatchedNFE=Book1D("_tau_NMatchedNFE",m_LeptonContainerName+"_tau_NMatchedNFE",20,0,20);
42 else
43 m_photon_NMatchedNFE=Book1D("_photon_NMatchedNFE",m_LeptonContainerName+"_photon_NMatchedNFE",20,0,20);
44 }
45 else{
46 if(m_LeptonID==11)
47 m_electron_NMatchedCFE=Book1D("_electron_NMatchedCFE",m_LeptonContainerName+"_elecron_NMatchedCFE",20,0,20);
48 else if (m_LeptonID==13)
49 m_muon_NMatchedCFE=Book1D("_muon_NMatchedCFE",m_LeptonContainerName+"_muon_NMatchedCFE",20,0,20);
50 else if(m_LeptonID==17)
51 m_tau_NMatchedCFE=Book1D("_tau_NMatchedCFE",m_LeptonContainerName+"_tau_NMatchedCFE",20,0,20);
52 else
53 m_photon_NMatchedCFE=Book1D("_photon_NMatchedCFE",m_LeptonContainerName+"_photon_NMatchedCFE",20,0,20);
54 };
55 }
56
57 void LeptonFELinkerPlots::fill(const xAOD::Photon& phot, const xAOD::EventInfo& eventInfo){
58 int nMatched_FE=0;
61 if(acc_FE_phot_link_NFE.isAvailable(phot) and m_doNeutralFE){
62 nMatched_FE=(acc_FE_phot_link_NFE(phot)).size();
63 m_photon_NMatchedNFE->Fill(nMatched_FE,eventInfo.beamSpotWeight());
64 }
65 else if (acc_FE_phot_link_CFE.isAvailable(phot) and !m_doNeutralFE){
66 nMatched_FE=(acc_FE_phot_link_CFE(phot)).size();
67 m_photon_NMatchedCFE->Fill(nMatched_FE,eventInfo.beamSpotWeight());
68 }
69 }
70 void LeptonFELinkerPlots::fill(const xAOD::Electron& el, const xAOD::EventInfo& eventInfo){
71 int nMatched_FE=0;
74
75 if(acc_FE_el_link_NFE.isAvailable(el) and m_doNeutralFE){
76 nMatched_FE=(acc_FE_el_link_NFE(el)).size();
77 m_electron_NMatchedNFE->Fill(nMatched_FE,eventInfo.beamSpotWeight());
78 }
79 else if(acc_FE_el_link_CFE.isAvailable(el) and !m_doNeutralFE){
80 nMatched_FE=(acc_FE_el_link_CFE(el)).size();
81 m_electron_NMatchedCFE->Fill(nMatched_FE,eventInfo.beamSpotWeight());
82 }
83 }
84
85 void LeptonFELinkerPlots::fill(const xAOD::Muon& mu, const xAOD::EventInfo& eventInfo){
86 int nMatched_FE=0;
89 if(acc_FE_mu_link_NFE.isAvailable(mu) and m_doNeutralFE){
90 nMatched_FE=(acc_FE_mu_link_NFE(mu)).size();
91 m_muon_NMatchedNFE->Fill(nMatched_FE,eventInfo.beamSpotWeight());
92 }
93 else if(acc_FE_mu_link_CFE.isAvailable(mu) and !m_doNeutralFE){
94 nMatched_FE=(acc_FE_mu_link_CFE(mu)).size();
95 m_muon_NMatchedCFE->Fill(nMatched_FE,eventInfo.beamSpotWeight());
96 }
97 }
98
99 void LeptonFELinkerPlots::fill(const xAOD::TauJet& tau, const xAOD::EventInfo& eventInfo){
100 int nMatched_FE=0;
103 if(acc_FE_tau_link_NFE.isAvailable(tau) and m_doNeutralFE){
104
105 nMatched_FE=(acc_FE_tau_link_NFE(tau)).size();
106 m_tau_NMatchedNFE->Fill(nMatched_FE,eventInfo.beamSpotWeight());
107 }
108 else if(acc_FE_tau_link_NFE.isAvailable(tau) and !m_doNeutralFE){
109 nMatched_FE=(acc_FE_tau_link_CFE(tau)).size();
110 m_tau_NMatchedCFE->Fill(nMatched_FE,eventInfo.beamSpotWeight());
111 }
112
113 }
114
115
116
117} // end of PFO namespace
void fill(const xAOD::Electron &el, const xAOD::EventInfo &eventInfo)
LeptonFELinkerPlots(PlotBase *pParent, const std::string &sDir, const std::string &LeptonContainerName, const bool &m_doNeutralFE, const int &m_LeptonID)
TH1D * Book1D(const std::string &name, const std::string &labels, int nBins, float start, float end, bool prependDir=true)
Book a TH1D histogram.
Definition PlotBase.cxx:94
PlotBase(PlotBase *parent, const std::string &sDir)
Definition PlotBase.cxx:29
SG::ConstAccessor< T, ALLOC > ConstAccessor
Definition AuxElement.h:569
bool isAvailable(const ELT &e) const
Test to see if this variable exists in the store.
float beamSpotWeight() const
Weight for beam spot size reweighting.
EventInfo_v1 EventInfo
Definition of the latest event info version.
TauJet_v3 TauJet
Definition of the current "tau version".
Muon_v1 Muon
Reference the current persistent version:
Photon_v1 Photon
Definition of the current "egamma version".
Electron_v1 Electron
Definition of the current "egamma version".