ATLAS Offline Software
Loading...
Searching...
No Matches
RecoPhotonHistograms.cxx
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
3*/
4
6
8#include "GaudiKernel/ITHistSvc.h"
12
13#include "TH1D.h"
14
15using namespace egammaMonitoring;
16
18
20
21 const char* fN = m_name.c_str();
22
23 histoMap["convRadius"] = new TH1D(Form("%s_convRadius",fN), ";Conversion Radius [mm]; Events", 14, m_cR_bins);
24 histoMap["truthType"] = new TH1D(Form("%s_truthType",fN), ";truth type; Events", 41,-1,40);
25 histoMap["truthOrigin"] = new TH1D(Form("%s_truthOrigin",fN), ";truth origin; Events",51,-1,50);
26
27 ATH_CHECK(m_rootHistSvc->regHist(m_folder+"convRadius", histoMap["convRadius"]));
28 ATH_CHECK(m_rootHistSvc->regHist(m_folder+"truthType", histoMap["truthType"]));
29 ATH_CHECK(m_rootHistSvc->regHist(m_folder+"truthOrigin", histoMap["truthOrigin"]));
30
31 return StatusCode::SUCCESS;
32}
33
35
37
38 static const SG::AuxElement::ConstAccessor<int> accType("truthType");
39 static const SG::AuxElement::ConstAccessor<int> accOrigin("truthOrigin");
40 if (accOrigin.isAvailable(phrec))
41 histoMap["truthOrigin"]->Fill(accOrigin(phrec));
42 else
43 histoMap["truthOrigin"]->Fill(-1);
44 if (accType.isAvailable(phrec))
45 histoMap["truthType"]->Fill(accType(phrec));
46 else
47 histoMap["truthType"]->Fill(-1);
48
49 double trueR(-999);
51 if (tmp) {
52 if (tmp->pdgId() == 22 && tmp->hasDecayVtx()) {
53
54 float x = tmp->decayVtx()->x();
55 float y = tmp->decayVtx()->y();
56 trueR = std::sqrt( x*x + y*y );
57
58 }
59 }
60 histoMap["convRadius"]->Fill(trueR);
61
62
63} // fill
#define ATH_CHECK
Evaluate an expression and check for errors.
#define y
#define x
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.
SmartIF< ITHistSvc > m_rootHistSvc
Definition IHistograms.h:48
std::map< std::string, TH1D * > histoMap
Definition IHistograms.h:42
void fill(const xAOD::IParticle &egamma)
const xAOD::TruthParticle * getTruthParticle(const xAOD::IParticle &p)
Return the truthParticle associated to the given IParticle (if any)
TruthParticle_v1 TruthParticle
Typedef to implementation.
Photon_v1 Photon
Definition of the current "egamma version".