ATLAS Offline Software
Loading...
Searching...
No Matches
PFOCalibHitClusterMomentPlots.cxx
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration
3*/
4
6
7namespace PFO {
8PFOCalibHitClusterMomentPlots::PFOCalibHitClusterMomentPlots(PlotBase* pParent, const std::string & sDir, const std::string & sPFOContainerName, const std::string & sFEContainerName) : PlotBase(pParent, sDir), m_sPFOContainerName(sPFOContainerName), m_sFEContainerName(sFEContainerName){
9 }
10
12 if(!m_sPFOContainerName.empty()){
13 m_PFO_ENG_CALIB_FRAC_EM = Book1D("_ENG_CALIB_FRAC_EM",m_sPFOContainerName + "_ENG_CALIB_FRAC_EM",22,0,1.1);
14 m_PFO_ENG_CALIB_FRAC_HAD = Book1D("_ENG_CALIB_FRAC_HAD",m_sPFOContainerName + "_ENG_CALIB_FRAC_HAD",22,0,1.1);
15 m_PFO_ENG_CALIB_FRAC_REST = Book1D("_ENG_CALIB_FRAC_REST",m_sPFOContainerName + "_ENG_CALIB_FRAC_REST",22,0,1.1);
16
17 m_PFO_ENG_CALIB_FRAC_EM_etaBinA = Book1D("_ENG_CALIB_FRAC_EM_A",m_sPFOContainerName + "_ENG_CALIB_FRAC_EM (|eta| < 1.5)",22,0,1.1);
18 m_PFO_ENG_CALIB_FRAC_HAD_etaBinA = Book1D("_ENG_CALIB_FRAC_HAD_A",m_sPFOContainerName + "_ENG_CALIB_FRAC_HAD (|eta| < 1.5)",22,0,1.1);
19 m_PFO_ENG_CALIB_FRAC_REST_etaBinA = Book1D("_ENG_CALIB_FRAC_REST_A",m_sPFOContainerName + "_ENG_CALIB_FRAC_REST (|eta| < 1.5)",22,0,1.1);
20
21 m_PFO_ENG_CALIB_FRAC_EM_etaBinB = Book1D("_ENG_CALIB_FRAC_EM_B",m_sPFOContainerName + "_ENG_CALIB_FRAC_EM (1.5 <= |eta| < 2.5)",22,0,1.1);
22 m_PFO_ENG_CALIB_FRAC_HAD_etaBinB = Book1D("_ENG_CALIB_FRAC_HAD_B",m_sPFOContainerName + "_ENG_CALIB_FRAC_HAD (1.5 <= |eta| < 2.5)",22,0,1.1);
23 m_PFO_ENG_CALIB_FRAC_REST_etaBinB = Book1D("_ENG_CALIB_FRAC_REST_B",m_sPFOContainerName + "_ENG_CALIB_FRAC_REST (1.5 <= |eta| < 2.5)",22,0,1.1);
24
25 m_PFO_ENG_CALIB_FRAC_EM_etaBinC = Book1D("_ENG_CALIB_FRAC_EM_C",m_sPFOContainerName + "_ENG_CALIB_FRAC_EM (2.5 <= |eta| < 3.2)",22,0,1.1);
26 m_PFO_ENG_CALIB_FRAC_HAD_etaBinC = Book1D("_ENG_CALIB_FRAC_HAD_C",m_sPFOContainerName + "_ENG_CALIB_FRAC_HAD (2.5 <= |eta| < 3.2)",22,0,1.1);
27 m_PFO_ENG_CALIB_FRAC_REST_etaBinC = Book1D("_ENG_CALIB_FRAC_REST_C",m_sPFOContainerName + "_ENG_CALIB_FRAC_REST (2.5 <= |eta| < 3.2)",22,0,1.1);
28
29 m_PFO_ENG_CALIB_FRAC_EM_etaBinD = Book1D("_ENG_CALIB_FRAC_EM_D",m_sPFOContainerName + "_ENG_CALIB_FRAC_EM (|eta| >= 3.2)",22,0,1.1);
30 m_PFO_ENG_CALIB_FRAC_HAD_etaBinD = Book1D("_ENG_CALIB_FRAC_HAD_D",m_sPFOContainerName + "_ENG_CALIB_FRAC_HAD (|eta| >= 3.2)",22,0,1.1);
31 m_PFO_ENG_CALIB_FRAC_REST_etaBinD = Book1D("_ENG_CALIB_FRAC_REST_D",m_sPFOContainerName + "_ENG_CALIB_FRAC_REST (|eta| >= 3.2)",22,0,1.1);
32 }
33if(!m_sFEContainerName.empty()){
34 std::cout<<"PFOCalibHitClusterMomentPlots: You're trying to book histograms for flow elements based on calibration hits which are not available in most MC samples - sorry"<<std::endl;
35 }
36 }
37
39
40 float moment_ENG_CALIB_FRAC_EM = -1.0;
41 PFO.getClusterMoment(moment_ENG_CALIB_FRAC_EM,xAOD::CaloCluster::ENG_CALIB_FRAC_EM);
42 m_PFO_ENG_CALIB_FRAC_EM->Fill(moment_ENG_CALIB_FRAC_EM,eventInfo.beamSpotWeight());
43
44 float moment_ENG_CALIB_FRAC_HAD = -1.0;
45 PFO.getClusterMoment(moment_ENG_CALIB_FRAC_HAD,xAOD::CaloCluster::ENG_CALIB_FRAC_HAD);
46 m_PFO_ENG_CALIB_FRAC_HAD->Fill(moment_ENG_CALIB_FRAC_HAD,eventInfo.beamSpotWeight());
47
48 float moment_ENG_CALIB_FRAC_REST = -1.0;
49 PFO.getClusterMoment(moment_ENG_CALIB_FRAC_REST,xAOD::CaloCluster::ENG_CALIB_FRAC_REST);
50 m_PFO_ENG_CALIB_FRAC_REST->Fill(moment_ENG_CALIB_FRAC_REST,eventInfo.beamSpotWeight());
51
52 float PFOEta = PFO.eta();
53
54 if (fabs(PFOEta) < 1.5){
55 m_PFO_ENG_CALIB_FRAC_EM_etaBinA->Fill(moment_ENG_CALIB_FRAC_EM,eventInfo.beamSpotWeight());
56 m_PFO_ENG_CALIB_FRAC_HAD_etaBinA->Fill(moment_ENG_CALIB_FRAC_HAD,eventInfo.beamSpotWeight());
57 m_PFO_ENG_CALIB_FRAC_REST_etaBinA->Fill(moment_ENG_CALIB_FRAC_REST),eventInfo.beamSpotWeight();
58 }//|eta| < 1.5
59 else if (fabs(PFOEta) < 2.5){
60 m_PFO_ENG_CALIB_FRAC_EM_etaBinB->Fill(moment_ENG_CALIB_FRAC_EM,eventInfo.beamSpotWeight());
61 m_PFO_ENG_CALIB_FRAC_HAD_etaBinB->Fill(moment_ENG_CALIB_FRAC_HAD,eventInfo.beamSpotWeight());
62 m_PFO_ENG_CALIB_FRAC_REST_etaBinB->Fill(moment_ENG_CALIB_FRAC_REST,eventInfo.beamSpotWeight());
63 }
64 else if (fabs(PFOEta) < 3.2){
65 m_PFO_ENG_CALIB_FRAC_EM_etaBinC->Fill(moment_ENG_CALIB_FRAC_EM,eventInfo.beamSpotWeight());
66 m_PFO_ENG_CALIB_FRAC_HAD_etaBinC->Fill(moment_ENG_CALIB_FRAC_HAD,eventInfo.beamSpotWeight());
67 m_PFO_ENG_CALIB_FRAC_REST_etaBinC->Fill(moment_ENG_CALIB_FRAC_REST,eventInfo.beamSpotWeight());
68 }
69 else{
70 m_PFO_ENG_CALIB_FRAC_EM_etaBinD->Fill(moment_ENG_CALIB_FRAC_EM,eventInfo.beamSpotWeight());
71 m_PFO_ENG_CALIB_FRAC_HAD_etaBinD->Fill(moment_ENG_CALIB_FRAC_HAD,eventInfo.beamSpotWeight());
72 m_PFO_ENG_CALIB_FRAC_REST_etaBinD->Fill(moment_ENG_CALIB_FRAC_REST,eventInfo.beamSpotWeight());
73 }
74
75 }
76}
void fill(const xAOD::PFO &PFO, const xAOD::EventInfo &eventInfo)
TH1 * m_PFO_ENG_CALIB_FRAC_EM
Histograms inclusive in eta.
PFOCalibHitClusterMomentPlots(PlotBase *pParent, const std::string &sDir, const std::string &sPFOContainerName, const std::string &sFEContainerName)
TH1 * m_PFO_ENG_CALIB_FRAC_EM_etaBinA
Same histograms binned in eta regions.
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
@ ENG_CALIB_FRAC_REST
Calibration Hit energy inside the cluster caused by other particles.
@ ENG_CALIB_FRAC_EM
Calibration Hit energy inside the cluster caused by e/gamma/pi0.
@ ENG_CALIB_FRAC_HAD
Calibration Hit energy inside the cluster caused by charged pi+ and pi-.
float beamSpotWeight() const
Weight for beam spot size reweighting.
PFO_v1 PFO
Definition of the current "pfo version".
Definition PFO.h:17
EventInfo_v1 EventInfo
Definition of the latest event info version.