ATLAS Offline Software
DiObjectHistograms.cxx
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2023 CERN for the benefit of the ATLAS collaboration
3 */
4 #include "DiObjectHistograms.h"
5 #include "xAODBase/IParticle.h"
6 #include "GaudiKernel/ITHistSvc.h"
7 #include "AsgMessaging/Check.h"
8 #include "TH1D.h"
9 #include "TH2D.h"
10 
11 namespace egammaMonitoring {
12 
14 
15  const char* fN = m_name.c_str();
16 
17  histoMap["mass"] = new TH1D(Form("%s_mass",fN),";m [GeV]; Events",300,50,200);
18  ATH_CHECK(m_rootHistSvc->regHist(m_folder+"mass", histoMap["mass"]));
19 
20  histoMap["massvsmu"] = new TH2D(Form("%s_massvsmu",fN),";#mu;m [GeV]",100,0,100,150,50,200);
21  ATH_CHECK(m_rootHistSvc->regHist(m_folder+"massvsmu", histoMap["massvsmu"]));
22 
23  histoMap["massvspT"] = new TH2D(Form("%s_massvspT",fN),";p_{T} [GeV];m [GeV]",20,0,100,150,50,200);
24  ATH_CHECK(m_rootHistSvc->regHist(m_folder+"massvspT", histoMap["massvspT"]));
25  return StatusCode::SUCCESS;
26  }
27 
29  fill(eg1,eg2,0.);
30  }
31 
32  void DiObjectHistograms::fill(const xAOD::IParticle& eg1, const xAOD::IParticle& eg2, float mu) {
33 
34  xAOD::IParticle::FourMom_t di = eg1.p4()+eg2.p4();
35  double m = di.M()*1e-3;
36  histoMap["mass"]->Fill(m);
37  histoMap["massvsmu"]->Fill(mu,m);
38  histoMap["massvspT"]->Fill(di.Pt()*1e-3,m);
39 
40  }
41 
42 }
AllowedVariables::e
e
Definition: AsgElectronSelectorTool.cxx:37
egammaMonitoring::DiObjectHistograms::m_rootHistSvc
SmartIF< ITHistSvc > m_rootHistSvc
Definition: DiObjectHistograms.h:45
Check.h
python.SystemOfUnits.m
int m
Definition: SystemOfUnits.py:91
IParticle.h
xAOD::IParticle
Class providing the definition of the 4-vector interface.
Definition: Event/xAOD/xAODBase/xAODBase/IParticle.h:41
egammaMonitoring::DiObjectHistograms::initializePlots
StatusCode initializePlots()
Definition: DiObjectHistograms.cxx:13
xAOD::IParticle::FourMom_t
TLorentzVector FourMom_t
Definition of the 4-momentum type.
Definition: Event/xAOD/xAODBase/xAODBase/IParticle.h:69
egammaMonitoring::DiObjectHistograms::m_name
std::string m_name
Definition: DiObjectHistograms.h:42
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition: PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22
ATH_CHECK
#define ATH_CHECK
Definition: AthCheckMacros.h:40
DiObjectHistograms.h
egammaMonitoring
Definition: ClusterHistograms.h:19
xAOD::IParticle::p4
virtual FourMom_t p4() const =0
The full 4-momentum of the particle.
egammaMonitoring::DiObjectHistograms::fill
void fill(const xAOD::IParticle &eg1, const xAOD::IParticle &eg2)
Definition: DiObjectHistograms.cxx:28
egammaMonitoring::DiObjectHistograms::m_folder
std::string m_folder
Definition: DiObjectHistograms.h:44
CaloNoise_fillDB.mu
mu
Definition: CaloNoise_fillDB.py:53
egammaMonitoring::DiObjectHistograms::histoMap
std::map< std::string, TH1 * > histoMap
Definition: DiObjectHistograms.h:39