EgammaMonitoring.cxx 57.1 KB
Newer Older
Marco Scodeggio's avatar
Marco Scodeggio committed
1
/*
2
  Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
3
4
*/
/*
Marco Scodeggio's avatar
Marco Scodeggio committed
5
6
 */

7
#include "EgammaMonitoring.h"
8
#include "MCTruthClassifier/IMCTruthClassifier.h"
9
#include "GaudiKernel/SystemOfUnits.h"
10
#include "IHistograms.h"
11

12
13
14
15

EgammaMonitoring::EgammaMonitoring(const std::string &name, ISvcLocator *pSvcLocator) :
  AthAlgorithm(name, pSvcLocator),
  m_LooseLH("AsgElectronLikelihoodTool/LooseLH"),
Marco Scodeggio's avatar
Marco Scodeggio committed
16
  m_MediumLH("AsgElectronLikelihoodTool/MediumLH"),
17
  m_TightLH("AsgElectronLikelihoodTool/TightLH"),
18
19
  m_LooseLH_Photon("AsgPhotonIsEMSelector/photonLooseIsEMSelector"),
  m_TightLH_Photon("AsgPhotonIsEMSelector/photonTightIsEMSelector"),
20
21
22
23
  m_IsoFixedCutTight("CP::IsolationSelectionTool/IsoFixedCutTight"),
  m_IsoFixedCutTightTrackOnly("CP::IsolationSelectionTool/IsoFixedCutTightTrackOnly"),
  m_IsoFixedCutTightCaloOnly("CP::IsolationSelectionTool/IsoFixedCutTightCaloOnly"),
  m_IsoFixedCutLoose("CP::IsolationSelectionTool/IsoFixedCutLoose"),
24
25
  m_mcTruthClassifier("MCTruthClassifier/MCTruthClassifier") {
  declareProperty("sampleType", m_sampleType = "Unknown", "Descriptive name for the processed type of particle");
Marco Scodeggio's avatar
Marco Scodeggio committed
26
}
27
28
29

// ******

30
31
StatusCode EgammaMonitoring::initialize() {
  ATH_MSG_INFO("********************  Running over " << m_sampleType << " ******************");
32
  ATH_CHECK(service("THistSvc", rootHistSvc));
33

34
35
  showerShapesAll = std::make_unique<egammaMonitoring::ShowerShapesHistograms>(
    "showerShapesAll","Shower Shapes ", "/MONITORING/showerShapesAll/", rootHistSvc);
36

37
38
  showerShapes10GeV = std::make_unique<egammaMonitoring::ShowerShapesHistograms>(
    "showerShapes10GeV","Shower Shapes - 10 GeV", "/MONITORING/showerShapes10GeV/", rootHistSvc);
39

40
41
  clusterAll = std::make_unique<egammaMonitoring::ClusterHistograms>(
    "clustersAll","Clusters", "/MONITORING/clusterAll/", rootHistSvc);
42

43
44
  cluster10GeV= std::make_unique<egammaMonitoring::ClusterHistograms>(
    "clusters10GeV","Clusters - 10 GeV", "/MONITORING/cluster10GeV/", rootHistSvc);
45

46
47
  clusterPromptAll = std::make_unique<egammaMonitoring::ClusterHistograms>(
    "clustersPromptAll","Clusters from Prompt", "/MONITORING/clusterPromptAll/", rootHistSvc);
48

49
50
  clusterPrompt10GeV = std::make_unique<egammaMonitoring::ClusterHistograms>(
    "clustersPrompt10GeV","Clusters from Prompt - 10 GeV", "/MONITORING/clusterPrompt10GeV/", rootHistSvc);
51

52
53
  isolationAll = std::make_unique<egammaMonitoring::IsolationHistograms>(
    "isolationAll","Isolation ", "/MONITORING/isolationAll/", rootHistSvc);
54
55
56

  ATH_CHECK(showerShapesAll->initializePlots());
  ATH_CHECK(showerShapes10GeV->initializePlots());
57
58
59
60
  ATH_CHECK(clusterAll->initializePlots());
  ATH_CHECK(cluster10GeV->initializePlots());
  ATH_CHECK(clusterPromptAll->initializePlots());
  ATH_CHECK(clusterPrompt10GeV->initializePlots());
61
  ATH_CHECK(isolationAll->initializePlots(m_sampleType == "electron"));
62
63

  if ("electron" == m_sampleType) {
64
65
    truthElectronAll = std::make_unique<egammaMonitoring::TruthElectronHistograms>(
        "truthElectronAll","All Truth Electrons", "/MONITORING/truthElectronAll/", rootHistSvc);
66

67
68
    truthPromptElectronAll = std::make_unique<egammaMonitoring::TruthElectronHistograms>(
        "truthPromptElectronAll","All Truth Prompt Electrons", "/MONITORING/truthPromptElectronAll/", rootHistSvc);
69

70
71
    truthElectronRecoElectronAll = std::make_unique<egammaMonitoring::TruthElectronHistograms>(
        "truthElectronRecoElectronAll","Truth Electrons Reco Electron", "/MONITORING/truthElectronRecoElectronAll/", rootHistSvc);
72

73
74
    truthPromptElectronWithTrack = std::make_unique<egammaMonitoring::TruthElectronHistograms>(
        "truthPromptElectronWithTrack","Truth Prompt Electrons With Track", "/MONITORING/truthPromptElectronWithTrack/", rootHistSvc);
75

76
77
    truthPromptElectronWithGSFTrack = std::make_unique<egammaMonitoring::TruthElectronHistograms>(
        "truthPromptElectronWithGSFTrack","Truth Prompt Electrons With GSFTrack", "/MONITORING/truthPromptElectronWithGSFTrack/", rootHistSvc);
78

79
80
    truthPromptElectronWithReco = std::make_unique<egammaMonitoring::TruthElectronHistograms>(
        "truthPromptElectronWithReco","Truth Prompt Electrons With GSFTrack", "/MONITORING/truthPromptElectronWithReco/", rootHistSvc);
81

82
83
    recoElectronAll = std::unique_ptr<egammaMonitoring::IHistograms>(new egammaMonitoring::RecoElectronHistograms(
      "recoElectronAll","Electrons Reco Electron", "/MONITORING/recoElectronAll/", rootHistSvc));
84

85
86
    truthRecoElectronLooseLH = std::make_unique<egammaMonitoring::TruthElectronHistograms>(
      "truthRecoElectronLooseLH","LLH Electrons Reco Electron", "/MONITORING/truthRecoElectronLooseLH/", rootHistSvc);
87

88
89
    truthRecoElectronMediumLH = std::make_unique<egammaMonitoring::TruthElectronHistograms>(
        "truthRecoElectronMediumLH","MLH Electrons Reco Electron", "/MONITORING/truthRecoElectronMediumLH/", rootHistSvc);
90

91
92
    truthRecoElectronTightLH = std::make_unique<egammaMonitoring::TruthElectronHistograms>(
      "truthRecoElectronTightLH","TLH Electrons Reco Electron", "/MONITORING/truthRecoElectronTightLH/", rootHistSvc);
93

94
95
    recoElectronIsoFixedCutTightTrackOnly = std::make_unique<egammaMonitoring::TruthElectronHistograms>(
      "recoElectronIsoFixedCutTightTrackOnly","Isolation Fixed Cut Tight Track Only Electrons Reco Electron", "/MONITORING/recoElectronIsoFixedCutTightTrackOnly/", rootHistSvc);
96
97

    ATH_CHECK(recoElectronAll->initializePlots());
98
99
100
101
102
103
104
105
106
107
    ATH_CHECK(truthRecoElectronLooseLH->initializePlots(false));
    ATH_CHECK(truthRecoElectronMediumLH->initializePlots(false));
    ATH_CHECK(truthRecoElectronTightLH->initializePlots(false));
    ATH_CHECK(truthElectronAll->initializePlots(true));
    ATH_CHECK(truthPromptElectronAll->initializePlots(true));
    ATH_CHECK(truthElectronRecoElectronAll->initializePlots(false));
    ATH_CHECK(truthPromptElectronWithTrack->initializePlots(true));
    ATH_CHECK(truthPromptElectronWithGSFTrack->initializePlots(true));
    ATH_CHECK(truthPromptElectronWithReco->initializePlots(false));
    ATH_CHECK(recoElectronIsoFixedCutTightTrackOnly->initializePlots(false));
108

Marco Scodeggio's avatar
Marco Scodeggio committed
109
110
  } // electron Hists

111
112
113
  if ("gamma" == m_sampleType) {


114
115
    recoPhotonAll = std::unique_ptr<egammaMonitoring::IHistograms>(new egammaMonitoring::RecoPhotonHistograms(
        "recoPhotonAll","Reco Photon", "/MONITORING/recoPhotonAll/", rootHistSvc));
116

117
118
    clusterConvPhoton = std::make_unique<egammaMonitoring::ClusterHistograms>(
    "clusterConvPhoton","Clusters from Converted Photons", "/MONITORING/clusterConvPhoton/", rootHistSvc);
119

120
121
    clusterConvPhotonSi = std::make_unique<egammaMonitoring::ClusterHistograms>(
    "clusterConvPhotonSi","Clusters from Converted Photons - Si", "/MONITORING/clusterConvPhotonSi/", rootHistSvc);
122

123
124
    clusterConvPhotonSiSi = std::make_unique<egammaMonitoring::ClusterHistograms>(
    "clusterConvPhotonSiSi","Clusters from Converted Photons - SiSi", "/MONITORING/clusterConvPhotonSiSi/", rootHistSvc);
125
   
126
127
    clusterConvPhotonTRT = std::make_unique<egammaMonitoring::ClusterHistograms>(
    "clusterConvPhotonTRT","Clusters from Converted Photons - TRT", "/MONITORING/clusterConvPhotonTRT/", rootHistSvc);
128

129
130
    clusterConvPhotonTRTTRT = std::make_unique<egammaMonitoring::ClusterHistograms>(
    "clusterConvPhotonTRTTRT","Clusters from Converted Photons - TRTTRT", "/MONITORING/clusterConvPhotonTRTTRT/", rootHistSvc);
131
 
132
133
    clusterConvPhotonSiTRT = std::make_unique<egammaMonitoring::ClusterHistograms>(
    "clusterConvPhotonSiTRT","Clusters from Converted Photons - SiTRT", "/MONITORING/clusterConvPhotonSiTRT/", rootHistSvc);
134
135
    
    
136
137
138
139
140
141
142
143
144
    clusterUnconvPhoton = std::make_unique<egammaMonitoring::ClusterHistograms>(
    "clusterUnconvPhoton","Clusters from Converted Photons", "/MONITORING/clusterUnconvPhoton/", rootHistSvc);


    truthPhotonAll = std::unique_ptr<egammaMonitoring::IHistograms>(new egammaMonitoring::TruthPhotonHistograms(
        "truthPhotonAll","truthPhotonAll", "/MONITORING/truthPhotonAll/", rootHistSvc));

    truthPhotonAllUnconv = std::unique_ptr<egammaMonitoring::IHistograms>(new egammaMonitoring::TruthPhotonHistograms(
        "truthPhotonAllUnconv","truthPhotonAllUnconv", "/MONITORING/truthPhotonAllUnconv/", rootHistSvc));
145

146
147
    truthPhotonAllConv = std::unique_ptr<egammaMonitoring::IHistograms>(new egammaMonitoring::TruthPhotonHistograms(
        "truthPhotonAllConv","truthPhotonAllConv", "/MONITORING/truthPhotonAllConv/", rootHistSvc));
148

149
150
    truthPhotonRecoPhoton = std::unique_ptr<egammaMonitoring::IHistograms>(new egammaMonitoring::TruthPhotonHistograms(
        "truthPhotonRecoPhoton","truthPhotonRecoPhoton", "/MONITORING/truthPhotonRecoPhoton/", rootHistSvc));
151

152
153
154
    truthPhotonRecoPhotonOrElectron = std::unique_ptr<egammaMonitoring::IHistograms>(new egammaMonitoring::TruthPhotonHistograms(
        "truthPhotonRecoPhotonOrElectron","truthPhotonRecoPhotonOrElectron", "/MONITORING/truthPhotonRecoPhotonOrElectron/", rootHistSvc));

155
156
    truthPhotonConvPhoton = std::unique_ptr<egammaMonitoring::IHistograms>(new egammaMonitoring::TruthPhotonHistograms(
        "truthConvPhoton","truthConvPhoton", "/MONITORING/truthConvPhoton/", rootHistSvc));
157

158
159
    truthPhotonConvRecoConv = std::unique_ptr<egammaMonitoring::IHistograms>(new egammaMonitoring::TruthPhotonHistograms(
        "truthConvRecoConv","truthConvRecoConv", "/MONITORING/truthConvRecoConv/", rootHistSvc));
160

161
162
    truthPhotonConvRecoConv1Si = std::unique_ptr<egammaMonitoring::IHistograms>(new egammaMonitoring::TruthPhotonHistograms(
        "truthConvRecoConv1Si","truthConvRecoConv1Si", "/MONITORING/truthConvRecoConv1Si/", rootHistSvc));
163

164
165
    truthPhotonConvRecoConv1TRT = std::unique_ptr<egammaMonitoring::IHistograms>(new egammaMonitoring::TruthPhotonHistograms(
        "truthConvRecoConv1TRT","truthConvRecoConv1TRT", "/MONITORING/truthConvRecoConv1TRT/", rootHistSvc));
166

167
168
    truthPhotonConvRecoConv2Si = std::unique_ptr<egammaMonitoring::IHistograms>(new egammaMonitoring::TruthPhotonHistograms(
        "truthConvRecoConv2Si","truthConvRecoConv2Si", "/MONITORING/truthConvRecoConv2Si/", rootHistSvc));
169

170
171
    truthPhotonConvRecoConv2TRT = std::unique_ptr<egammaMonitoring::IHistograms>(new egammaMonitoring::TruthPhotonHistograms(
        "truthConvRecoConv2TRT","truthConvRecoConv2TRT", "/MONITORING/truthConvRecoConv2TRT/", rootHistSvc));
172

173
174
    truthPhotonConvRecoConv2SiTRT = std::unique_ptr<egammaMonitoring::IHistograms>(new egammaMonitoring::TruthPhotonHistograms(
        "truthConvRecoConv2SiTRT","truthConvRecoConv2SiTRT", "/MONITORING/truthConvRecoConv2SiTRT/", rootHistSvc));
175

176
177
    truthPhotonConvRecoUnconv= std::unique_ptr<egammaMonitoring::IHistograms>(new egammaMonitoring::TruthPhotonHistograms(
        "truthConvRecoUnconv","truthConvRecoUnconv", "/MONITORING/truthConvRecoUnconv/", rootHistSvc));
178

179
180
    truthPhotonUnconvPhoton= std::unique_ptr<egammaMonitoring::IHistograms>(new egammaMonitoring::TruthPhotonHistograms(
        "truthUnconvPhoton","truthUnconvPhoton", "/MONITORING/truthUnconvPhoton/", rootHistSvc));
181

182
183
    truthPhotonUnconvRecoConv= std::unique_ptr<egammaMonitoring::IHistograms>(new egammaMonitoring::TruthPhotonHistograms(
        "truthUnconvRecoConv","truthUnconvRecoConv", "/MONITORING/truthUnconvRecoConv/", rootHistSvc));
184

185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
    truthPhotonUnconvRecoConv1Si = std::unique_ptr<egammaMonitoring::IHistograms>(new egammaMonitoring::TruthPhotonHistograms(
        "truthUnconvRecoConv1Si","truthUnconvRecoConv1Si", "/MONITORING/truthUnconvRecoConv1Si/", rootHistSvc));

    truthPhotonUnconvRecoConv1TRT = std::unique_ptr<egammaMonitoring::IHistograms>(new egammaMonitoring::TruthPhotonHistograms(
        "truthUnconvRecoConv1TRT","truthUnconvRecoConv1TRT", "/MONITORING/truthUnconvRecoConv1TRT/", rootHistSvc));

    truthPhotonUnconvRecoConv2Si = std::unique_ptr<egammaMonitoring::IHistograms>(new egammaMonitoring::TruthPhotonHistograms(
        "truthUnconvRecoConv2Si","truthUnconvRecoConv2Si", "/MONITORING/truthUnconvRecoConv2Si/", rootHistSvc));

    truthPhotonUnconvRecoConv2TRT = std::unique_ptr<egammaMonitoring::IHistograms>(new egammaMonitoring::TruthPhotonHistograms(
        "truthUnconvRecoConv2TRT","truthUnconvRecoConv2TRT", "/MONITORING/truthUnconvRecoConv2TRT/", rootHistSvc));

    truthPhotonUnconvRecoConv2SiTRT = std::unique_ptr<egammaMonitoring::IHistograms>(new egammaMonitoring::TruthPhotonHistograms(
        "truthUnconvRecoConv2SiTRT","truthUnconvRecoConv2SiTRT", "/MONITORING/truthUnconvRecoConv2SiTRT/", rootHistSvc));

200
201
    truthPhotonUnconvRecoUnconv = std::unique_ptr<egammaMonitoring::IHistograms>(new egammaMonitoring::TruthPhotonHistograms(
        "truthUnconvRecoUnconv","truthUnconvRecoUnconv", "/MONITORING/truthUnconvRecoUnconv/", rootHistSvc));
202

203
204
205
206
207
208
209
210
211
212
213
214
    recoPhotonUnconvLooseLH = std::unique_ptr<egammaMonitoring::IHistograms>(new egammaMonitoring::TruthPhotonHistograms(
      "recoPhotonUnconvLooseLH","LLH Photons Reco Photon", "/MONITORING/recoPhotonUnconvLooseLH/", rootHistSvc));

    recoPhotonUnconvTightLH = std::unique_ptr<egammaMonitoring::IHistograms>(new egammaMonitoring::TruthPhotonHistograms(
      "recoPhotonUnconvTightLH","TLH Photons Reco Photon", "/MONITORING/recoPhotonUnconvTightLH/", rootHistSvc));

    recoPhotonConvLooseLH = std::unique_ptr<egammaMonitoring::IHistograms>(new egammaMonitoring::TruthPhotonHistograms(
      "recoPhotonConvLooseLH","LLH Photons Reco Photon", "/MONITORING/recoPhotonConvLooseLH/", rootHistSvc));

    recoPhotonConvTightLH = std::unique_ptr<egammaMonitoring::IHistograms>(new egammaMonitoring::TruthPhotonHistograms(
      "recoPhotonConvTightLH","LLH Photons Reco Photon", "/MONITORING/recoPhotonConvTightLH/", rootHistSvc));

215
216
    recoPhotonUnconvIsoFixedCutTight = std::unique_ptr<egammaMonitoring::IHistograms>(new egammaMonitoring::TruthPhotonHistograms(
    "recoPhotonUnconvIsoFixedCutTight","Isolation Fixed Cut Tight Photons Reco Photon", "/MONITORING/recoPhotonUnconvIsoFixedCutTight/", rootHistSvc));
217

218
219
    recoPhotonUnconvIsoFixedCutTightCaloOnly = std::unique_ptr<egammaMonitoring::IHistograms>(new egammaMonitoring::TruthPhotonHistograms(
    "recoPhotonUnconvIsoFixedCutTightCaloOnly","Isolation Fixed Cut Tight Calo Only Photons Reco Photon", "/MONITORING/recoPhotonUnconvIsoFixedCutTightCaloOnly/", rootHistSvc));
220

221
222
    recoPhotonUnconvIsoFixedCutLoose = std::unique_ptr<egammaMonitoring::IHistograms>(new egammaMonitoring::TruthPhotonHistograms(
    "recoPhotonUnconvIsoFixedCutLoose","Isolation Fixed Cut Loose Photons Reco Photon", "/MONITORING/recoPhotonUnconvIsoFixedCutLoose/", rootHistSvc));
223

224
225
    recoPhotonConvIsoFixedCutTight = std::unique_ptr<egammaMonitoring::IHistograms>(new egammaMonitoring::TruthPhotonHistograms(
    "recoPhotonConvIsoFixedCutTight","Isolation Fixed Cut Tight Photons Reco Photon", "/MONITORING/recoPhotonConvIsoFixedCutTight/", rootHistSvc));
226

227
228
    recoPhotonConvIsoFixedCutTightCaloOnly = std::unique_ptr<egammaMonitoring::IHistograms>(new egammaMonitoring::TruthPhotonHistograms(
    "recoPhotonConvIsoFixedCutTightCaloOnly","Isolation Fixed Cut Tight Calo Only Photons Reco Photon", "/MONITORING/recoPhotonConvIsoFixedCutTightCaloOnly/", rootHistSvc));
229

230
231
    recoPhotonConvIsoFixedCutLoose = std::unique_ptr<egammaMonitoring::IHistograms>(new egammaMonitoring::TruthPhotonHistograms(
    "recoPhotonConvIsoFixedCutLoose","Isolation Fixed Cut Loose Photons Reco Photon", "/MONITORING/recoPhotonConvIsoFixedCutLoose/", rootHistSvc));
232

233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
    InDetTracks = std::unique_ptr<egammaMonitoring::IHistograms>(new egammaMonitoring::TrackHistograms(
    "InDetTracks","InDet Tracks", "/MONITORING/InDetTracks/", rootHistSvc));

    InDetTracksMatchElectron = std::unique_ptr<egammaMonitoring::IHistograms>(new egammaMonitoring::TrackHistograms(
    "InDetTracksMatchElectron","InDet Tracks matched to electrons", "/MONITORING/InDetTracksMatchElectron/", rootHistSvc));

    InDetTracksNotElectron = std::unique_ptr<egammaMonitoring::IHistograms>(new egammaMonitoring::TrackHistograms(
    "InDetTracksNotElectron","InDet Tracks not matched to electrons", "/MONITORING/InDetTracksNotElectron/", rootHistSvc));

    InDetTracksMatchPion = std::unique_ptr<egammaMonitoring::IHistograms>(new egammaMonitoring::TrackHistograms(
    "InDetTracksMatchPion","InDet Tracks matched to pions", "/MONITORING/InDetTracksMatchPion/", rootHistSvc));

    InDetTracksNotMatched = std::unique_ptr<egammaMonitoring::IHistograms>(new egammaMonitoring::TrackHistograms(
    "InDetTracksNotMatched","InDet Tracks not matched", "/MONITORING/InDetTracksNotMatched/", rootHistSvc));

    InDetTracksTRT = std::unique_ptr<egammaMonitoring::IHistograms>(new egammaMonitoring::TrackHistograms(
    "InDetTracksTRT","InDet Tracks TRTSA", "/MONITORING/InDetTracksTRT/", rootHistSvc));

    InDetTracksTRTMatchElectron = std::unique_ptr<egammaMonitoring::IHistograms>(new egammaMonitoring::TrackHistograms(
    "InDetTracksTRTMatchElectron","InDet Tracks TRTSA matched to electrons", "/MONITORING/InDetTracksTRTMatchElectron/", rootHistSvc));

    InDetTracksTRTNotElectron = std::unique_ptr<egammaMonitoring::IHistograms>(new egammaMonitoring::TrackHistograms(
    "InDetTracksTRTNotElectron","InDet Tracks TRTSA not matched to electrons", "/MONITORING/InDetTracksTRTNotElectron/", rootHistSvc));

    InDetTracksTRTMatchPion = std::unique_ptr<egammaMonitoring::IHistograms>(new egammaMonitoring::TrackHistograms(
    "InDetTracksTRTMatchPion","InDet Tracks TRTSA matched to pions", "/MONITORING/InDetTracksTRTMatchPion/", rootHistSvc));

    InDetTracksTRTNotMatched = std::unique_ptr<egammaMonitoring::IHistograms>(new egammaMonitoring::TrackHistograms(
    "InDetTracksTRTNotMatched","InDet Tracks TRTSA not matched", "/MONITORING/InDetTracksTRTNotMatched/", rootHistSvc));

    InDetTrackshighpT = std::unique_ptr<egammaMonitoring::IHistograms>(new egammaMonitoring::TrackHistograms(
    "InDetTrackshighpT","InDet Tracks pT > 3 GeV", "/MONITORING/InDetTrackshighpT/", rootHistSvc));

    InDetTracksMatchElectronhighpT = std::unique_ptr<egammaMonitoring::IHistograms>(new egammaMonitoring::TrackHistograms(
    "InDetTracksMatchElectronhighpT","InDet Tracks matched to electrons pT > 3 GeV", "/MONITORING/InDetTracksMatchElectronhighpT/", rootHistSvc));

    InDetTracksNotElectronhighpT = std::unique_ptr<egammaMonitoring::IHistograms>(new egammaMonitoring::TrackHistograms(
    "InDetTracksNotElectronhighpT","InDet Tracks not matched to electrons pT > 3 GeV", "/MONITORING/InDetTracksNotElectronhighpT/", rootHistSvc));

    InDetTracksMatchPionhighpT = std::unique_ptr<egammaMonitoring::IHistograms>(new egammaMonitoring::TrackHistograms(
    "InDetTracksMatchPionhighpT","InDet Tracks matched to pions pT > 3 GeV", "/MONITORING/InDetTracksMatchPionhighpT/", rootHistSvc));

    InDetTracksNotMatchedhighpT = std::unique_ptr<egammaMonitoring::IHistograms>(new egammaMonitoring::TrackHistograms(
    "InDetTracksNotMatchedhighpT","InDet Tracks not matched pT > 3 GeV", "/MONITORING/InDetTracksNotMatchedhighpT/", rootHistSvc));

    InDetTracksTRThighpT = std::unique_ptr<egammaMonitoring::IHistograms>(new egammaMonitoring::TrackHistograms(
    "InDetTracksTRThighpT","InDet Tracks TRTSA pT > 3 GeV", "/MONITORING/InDetTracksTRThighpT/", rootHistSvc));

    InDetTracksTRTMatchElectronhighpT = std::unique_ptr<egammaMonitoring::IHistograms>(new egammaMonitoring::TrackHistograms(
    "InDetTracksTRTMatchElectronhighpT","InDet Tracks TRTSA matched to electrons pT > 3 GeV", "/MONITORING/InDetTracksTRTMatchElectronhighpT/", rootHistSvc));

    InDetTracksTRTNotElectronhighpT = std::unique_ptr<egammaMonitoring::IHistograms>(new egammaMonitoring::TrackHistograms(
    "InDetTracksTRTNotElectronhighpT","InDet Tracks TRTSA not matched to electrons pT > 3 GeV", "/MONITORING/InDetTracksTRTNotElectronhighpT/", rootHistSvc));

    InDetTracksTRTMatchPionhighpT = std::unique_ptr<egammaMonitoring::IHistograms>(new egammaMonitoring::TrackHistograms(
    "InDetTracksTRTMatchPionhighpT","InDet Tracks TRTSA matched to pions pT > 3 GeV", "/MONITORING/InDetTracksTRTMatchPionhighpT/", rootHistSvc));

    InDetTracksTRTNotMatchedhighpT = std::unique_ptr<egammaMonitoring::IHistograms>(new egammaMonitoring::TrackHistograms(
    "InDetTracksTRTNotMatchedhighpT","InDet Tracks TRTSA not matched pT > 3 GeV", "/MONITORING/InDetTracksTRTNotMatchedhighpT/", rootHistSvc));

293
294

    ATH_CHECK(recoPhotonAll->initializePlots());
295
296
297
    ATH_CHECK(truthPhotonAll->initializePlots());
    ATH_CHECK(truthPhotonAllUnconv->initializePlots());
    ATH_CHECK(truthPhotonAllConv->initializePlots());
298
    ATH_CHECK(truthPhotonRecoPhoton->initializePlots());
299
    ATH_CHECK(truthPhotonRecoPhotonOrElectron->initializePlots());
300
301
302
303
304
305
306
307
308
309
    ATH_CHECK(truthPhotonConvPhoton->initializePlots());
    ATH_CHECK(truthPhotonConvRecoConv->initializePlots());
    ATH_CHECK(truthPhotonConvRecoConv1Si->initializePlots());
    ATH_CHECK(truthPhotonConvRecoConv1TRT->initializePlots());
    ATH_CHECK(truthPhotonConvRecoConv2Si->initializePlots());
    ATH_CHECK(truthPhotonConvRecoConv2TRT->initializePlots());
    ATH_CHECK(truthPhotonConvRecoConv2SiTRT->initializePlots());
    ATH_CHECK(truthPhotonConvRecoUnconv->initializePlots());
    ATH_CHECK(truthPhotonUnconvPhoton->initializePlots());
    ATH_CHECK(truthPhotonUnconvRecoConv->initializePlots());
310
311
312
313
314
    ATH_CHECK(truthPhotonUnconvRecoConv1Si->initializePlots());
    ATH_CHECK(truthPhotonUnconvRecoConv1TRT->initializePlots());
    ATH_CHECK(truthPhotonUnconvRecoConv2Si->initializePlots());
    ATH_CHECK(truthPhotonUnconvRecoConv2TRT->initializePlots());
    ATH_CHECK(truthPhotonUnconvRecoConv2SiTRT->initializePlots());
315
    ATH_CHECK(truthPhotonUnconvRecoUnconv->initializePlots());
316
317
318
319
    ATH_CHECK(recoPhotonUnconvLooseLH->initializePlots());
    ATH_CHECK(recoPhotonUnconvTightLH->initializePlots());
    ATH_CHECK(recoPhotonConvLooseLH->initializePlots());
    ATH_CHECK(recoPhotonConvTightLH->initializePlots());
320
321
322
323
324
325
    ATH_CHECK(recoPhotonUnconvIsoFixedCutTight->initializePlots());
    ATH_CHECK(recoPhotonUnconvIsoFixedCutTightCaloOnly->initializePlots());
    ATH_CHECK(recoPhotonUnconvIsoFixedCutLoose->initializePlots());
    ATH_CHECK(recoPhotonConvIsoFixedCutTight->initializePlots());
    ATH_CHECK(recoPhotonConvIsoFixedCutTightCaloOnly->initializePlots());
    ATH_CHECK(recoPhotonConvIsoFixedCutLoose->initializePlots());
326

327
328
329
330
331
332
333
334
    ATH_CHECK(clusterConvPhoton->initializePlots());
    ATH_CHECK(clusterConvPhotonSi->initializePlots());
    ATH_CHECK(clusterConvPhotonSiSi->initializePlots());
    ATH_CHECK(clusterConvPhotonTRT->initializePlots());
    ATH_CHECK(clusterConvPhotonTRTTRT->initializePlots());
    ATH_CHECK(clusterConvPhotonSiTRT->initializePlots());
    ATH_CHECK(clusterUnconvPhoton->initializePlots());

335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
    ATH_CHECK(InDetTracks->initializePlots());
    ATH_CHECK(InDetTracksMatchElectron->initializePlots());
    ATH_CHECK(InDetTracksNotElectron->initializePlots());
    ATH_CHECK(InDetTracksMatchPion->initializePlots());
    ATH_CHECK(InDetTracksNotMatched->initializePlots());
    ATH_CHECK(InDetTracksTRT->initializePlots());
    ATH_CHECK(InDetTracksTRTMatchElectron->initializePlots());
    ATH_CHECK(InDetTracksTRTNotElectron->initializePlots());
    ATH_CHECK(InDetTracksTRTMatchPion->initializePlots());
    ATH_CHECK(InDetTracksTRTNotMatched->initializePlots());
    ATH_CHECK(InDetTrackshighpT->initializePlots());
    ATH_CHECK(InDetTracksMatchElectronhighpT->initializePlots());
    ATH_CHECK(InDetTracksNotElectronhighpT->initializePlots());
    ATH_CHECK(InDetTracksMatchPionhighpT->initializePlots());
    ATH_CHECK(InDetTracksNotMatchedhighpT->initializePlots());
    ATH_CHECK(InDetTracksTRThighpT->initializePlots());
    ATH_CHECK(InDetTracksTRTMatchElectronhighpT->initializePlots());
    ATH_CHECK(InDetTracksTRTNotElectronhighpT->initializePlots());
    ATH_CHECK(InDetTracksTRTMatchPionhighpT->initializePlots());
    ATH_CHECK(InDetTracksTRTNotMatchedhighpT->initializePlots());



358

Marco Scodeggio's avatar
Marco Scodeggio committed
359
360
  } // gamma Hists

361
  //*****************LLH Requirement********************
362
363
  ATH_CHECK(m_LooseLH.setProperty("WorkingPoint", "LooseLHElectron"));
  ATH_CHECK(m_LooseLH.initialize());
364
  //*****************MLH Requirement********************
365
366
  ATH_CHECK(m_MediumLH.setProperty("WorkingPoint", "MediumLHElectron"));
  ATH_CHECK(m_MediumLH.initialize());
367
  //*****************TLH Requirement********************
368
369
  ATH_CHECK(m_TightLH.setProperty("WorkingPoint", "TightLHElectron"));
  ATH_CHECK(m_TightLH.initialize());
370

371
372
373
374
375
376
377
378
  //*****************LLH Requirement********************
  ANA_CHECK(m_LooseLH_Photon.setProperty("WorkingPoint", "LoosePhoton"));
  ANA_CHECK(m_LooseLH_Photon.initialize());
  //*****************TLH Requirement********************
  ANA_CHECK(m_TightLH_Photon.setProperty("WorkingPoint", "TightPhoton"));
  ANA_CHECK(m_TightLH_Photon.initialize());


379
380
381
382
383
384
385
386
387
  //*****************Iso Requirements********************
  ATH_CHECK(m_IsoFixedCutTight.setProperty("PhotonWP", "FixedCutTight"));
  ATH_CHECK(m_IsoFixedCutTight.initialize());
  ATH_CHECK(m_IsoFixedCutTightTrackOnly.setProperty("ElectronWP", "FixedCutTightTrackOnly"));
  ATH_CHECK(m_IsoFixedCutTightTrackOnly.initialize());
  ATH_CHECK(m_IsoFixedCutTightCaloOnly.setProperty("PhotonWP", "FixedCutTightCaloOnly"));
  ATH_CHECK(m_IsoFixedCutTightCaloOnly.initialize());
  ATH_CHECK(m_IsoFixedCutLoose.setProperty("PhotonWP", "FixedCutLoose"));
  ATH_CHECK(m_IsoFixedCutLoose.initialize());
388
389
  //*****************MC Truth Classifier Requirement********************
  ATH_CHECK(m_mcTruthClassifier.retrieve());
Marco Scodeggio's avatar
Marco Scodeggio committed
390

391
392
393
394
395
  return StatusCode::SUCCESS;
}

// ******

396
StatusCode EgammaMonitoring::beginInputFile() {
397
398
399
400
401
  return StatusCode::SUCCESS;
}

// ******

402
StatusCode EgammaMonitoring::firstExecute() {
403
404
405
406
407
  return StatusCode::SUCCESS;
}

// ******

408
409
StatusCode EgammaMonitoring::execute() {

Marco Scodeggio's avatar
Marco Scodeggio committed
410
  // Retrieve things from the event store
411
  const xAOD::EventInfo *eventInfo = nullptr;
412
  ANA_CHECK(evtStore()->retrieve(eventInfo, "EventInfo"));
413
414
  const float mu = eventInfo->averageInteractionsPerCrossing();

415
  // Retrieve egamma truth particles
416
417
  const xAOD::TruthParticleContainer *egTruthParticles = nullptr;
  if (!evtStore()->retrieve(egTruthParticles, "egammaTruthParticles").isSuccess()) {
418
419
420
421
    ATH_MSG_ERROR("Failed to retrieve egamma truth particle container. Exiting.");
    return StatusCode::FAILURE;
  }

422
423
424
425
426
427
428
429
430
  const xAOD::TruthParticleContainer *truthParticles = nullptr;
  if (!evtStore()->retrieve(truthParticles,
                            "TruthParticles").isSuccess()) { // retrieve arguments: container type, container key
    Error("execute()", "Failed to retrieve Truth Particle container. Exiting.");
    return StatusCode::FAILURE;
  }


  if ("electron" == m_sampleType) {
431

432
    // Retrieve electrons
433
434
    const xAOD::ElectronContainer *RecoEl = nullptr;
    if (!evtStore()->retrieve(RecoEl, "Electrons").isSuccess()) {
Marco Scodeggio's avatar
Marco Scodeggio committed
435
      ATH_MSG_ERROR("Failed to retrieve electron container. Exiting.");
Marco Scodeggio's avatar
Marco Scodeggio committed
436
437
      return StatusCode::FAILURE;
    }
438

439
    // InDet track particles:
440
    const xAOD::TrackParticleContainer *InDetTracks = nullptr;
441
442
443
444
    if (!evtStore()->retrieve(InDetTracks, "InDetTrackParticles").isSuccess()) {
      ATH_MSG_ERROR( "Failed to retrieve InDetTrackParticles. Exiting.");
      return StatusCode::FAILURE;
    }
445

446
    //  track particles:
447
    const xAOD::TrackParticleContainer *GSFTracks = nullptr;
448
449
450
451
452
453
    if (!evtStore()->retrieve(GSFTracks, "GSFTrackParticles").isSuccess()) {
      ATH_MSG_ERROR( "Failed to retrieve GSFTrackParticles. Exiting.");
      return StatusCode::FAILURE;
    }


454
455
456
457
458
459
460
461
462
    ATH_MSG_DEBUG( "------------ Truth Egamma Container ---------------" );
    for (auto egtruth : *egTruthParticles) {

      if (!egtruth) continue;

      const xAOD::Electron *electron = xAOD::EgammaHelpers::getRecoElectron(egtruth);

      if (!electron) continue;

463
      clusterPromptAll->fill(*electron,mu);
464
      if (egtruth->pt() > 10*Gaudi::Units::GeV) {
465
        clusterPrompt10GeV->fill(*electron,mu);
466
467
468
469
470
471
472
      }
     

      

    }

473
474
475
476
    ATH_MSG_DEBUG( "------------ Truth Particles Container ---------------" );
    unsigned int promtpElectronTruthIndex = - 9;
    for (auto truth : *truthParticles) {

477
      if (!truth) continue;
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
      if (fabs(truth->pdgId()) != 11) continue;

      auto res = m_mcTruthClassifier->particleTruthClassifier(truth);
      MCTruthPartClassifier::ParticleOrigin TO = res.second;
      MCTruthPartClassifier::ParticleType TT = res.first;

      ATH_MSG_DEBUG( " ******** Truth particle associated to Electron Found: "
                << " STATUS  " << truth->status()
                << " type  " << truth->type()
                << " barcode  " << truth->barcode()
                << " PDG id   " << truth->pdgId()
                << " index    " << truth->index()
                << " TO  " << TO
                << " TT   " << TT
                << " eventNumber  " << eventInfo->eventNumber() );
493
494
495
496

      // Check if it is the prompt electron
      if (TO == MCTruthPartClassifier::SingleElec &&
          TT == MCTruthPartClassifier::IsoElectron && truth->barcode() == 10001) {
497
        truthPromptElectronAll->fill(truth);
498
499
500
501
        promtpElectronTruthIndex = truth->index();

      }

502

503
      // Check that it is not from geant4
504
      if ( TT != MCTruthPartClassifier::NonPrimary) truthElectronAll->fill(truth);
505
506
507
508
509
510

    }

    ATH_MSG_DEBUG( "------------ InDetTracks ---------------" );

    bool foundPromptElectron = false;
511

512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
    for (auto tp : *InDetTracks) {

      if (!tp) continue;

      uint8_t nPi = 0;

      uint8_t nSCT = 0;

      tp->summaryValue(nPi, xAOD::numberOfPixelHits);

      tp->summaryValue(nSCT, xAOD::numberOfSCTHits);

      if ((nPi + nSCT) < 7) continue;

      const xAOD::TruthParticle *truth = xAOD::TruthHelpers::getTruthParticle(*tp);

      if (!truth || fabs(truth->pdgId()) != 11) continue;


      auto res2 = m_mcTruthClassifier->particleTruthClassifier(truth);
      MCTruthPartClassifier::ParticleOrigin TO = res2.second;
      MCTruthPartClassifier::ParticleType TT = res2.first;
534
535
536
      if (TO == MCTruthPartClassifier::SingleElec &&
          TT == MCTruthPartClassifier::IsoElectron &&
          truth->index() == promtpElectronTruthIndex && !foundPromptElectron ) {
537
538
539

        // we found the track from the prompt electron
        // let's count it
540
        truthPromptElectronWithTrack->fill(truth);
541
542
543
544
545
546
547
548
549
550
        foundPromptElectron = true;


      } else {
        const xAOD::TruthParticle *firstElTruth = xAOD::EgammaHelpers::getBkgElectronMother(truth);
        if (!firstElTruth) continue;
        // this is not a prompt electron, we need to check the parents
        // but we need to make sure that we double count if already found the track
        // foundPromptElectron will check that

551
        if ((firstElTruth->index() == promtpElectronTruthIndex) &&
552
            (!foundPromptElectron)) {
553
          truthPromptElectronWithTrack->fill(firstElTruth);
554
555
556
557
558
559
560
561
562
563
          foundPromptElectron = true;
        }

      }

    }

    ATH_MSG_DEBUG( "------------ GSFTracks ---------------" );

    foundPromptElectron = false;
564

565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
    for (auto gsf : *GSFTracks) {

      if (!gsf) continue;

      const xAOD::TruthParticle *truth = xAOD::TruthHelpers::getTruthParticle(*gsf);

      if (!truth) continue;

      uint8_t nPi = 0;

      uint8_t nSCT = 0;

      gsf->summaryValue(nPi, xAOD::numberOfPixelHits);

      gsf->summaryValue(nSCT, xAOD::numberOfSCTHits);

      if ((nPi + nSCT) < 7) continue;

      auto res2 = m_mcTruthClassifier->particleTruthClassifier(truth);
      MCTruthPartClassifier::ParticleOrigin TO = res2.second;
      MCTruthPartClassifier::ParticleType TT = res2.first;
      auto res = m_mcTruthClassifier->checkOrigOfBkgElec(truth);
      MCTruthPartClassifier::ParticleOrigin bkgTO = res.second;
      MCTruthPartClassifier::ParticleType bkgTT = res.first;
      ATH_MSG_DEBUG(" ** Truth particle associated to track Found: "
                << " STATUS  " << truth->status()
                << " type  " << truth->type()
                << " barcode  " << truth->barcode()
                << " PDG id   " << truth->pdgId()
                << " index    " << truth->index()
                << " bkg T0  " << bkgTO
                << " bkg TT   " << bkgTT
                << " T0  " << TO
                << " TT   " << TT
                << " eventNumber  " << eventInfo->eventNumber() );

601
602
603
      if (TO == MCTruthPartClassifier::SingleElec &&
          TT == MCTruthPartClassifier::IsoElectron &&
          truth->index() == promtpElectronTruthIndex && !foundPromptElectron ) {
604
605
606

        // we found the track from the prompt electron
        // let's count it
607
        truthPromptElectronWithGSFTrack->fill(truth);
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
        foundPromptElectron = true;


      } else {
        const xAOD::TruthParticle *firstElTruth = xAOD::EgammaHelpers::getBkgElectronMother(truth);
        if (!firstElTruth) continue;
        ATH_MSG_DEBUG( "********----- Getting Mother-----********" );
        ATH_MSG_DEBUG( " STATUS  " << firstElTruth->status()
                << " type  " << firstElTruth->type()
                << " barcode  " << firstElTruth->barcode()
                << " PDG id   " << firstElTruth->pdgId()
                << " index    " << firstElTruth->index() );
        // this is not a prompt electron, we need to check the parents
        // but we need to make sure that we double count if already found the track
        // foundPromptElectron will check that
623
        if ((firstElTruth->index() == promtpElectronTruthIndex) &&
624
            (!foundPromptElectron)) {
625
          truthPromptElectronWithGSFTrack->fill(firstElTruth);
626
627
628
629
630
631
632
633
634
635
636
637
638
639
          foundPromptElectron = true;
        }

      }


    }


    foundPromptElectron = false;

    for (auto elrec : *RecoEl) {

      if (!elrec) continue;
640
      clusterAll->fill(*elrec,mu);
641
      if (elrec->pt() > 10*Gaudi::Units::GeV) {
642
        cluster10GeV->fill(*elrec,mu);
643
      }
644
645
      recoElectronAll->fill(*elrec);
      showerShapesAll->fill(*elrec);
646
      isolationAll->fill(*elrec);
647
648
649
      if (elrec->pt() > 10*Gaudi::Units::GeV) {
        showerShapes10GeV->fill(*elrec);
      }
650
651
652

      const xAOD::TruthParticle *truth = xAOD::TruthHelpers::getTruthParticle(*elrec);
      if (!truth ) continue;
653
      truthElectronRecoElectronAll->fill(truth, elrec);
654
      if (fabs(truth->pdgId()) != 11) continue;
655
656
657
658
      auto res2 = m_mcTruthClassifier->particleTruthClassifier(truth);
      MCTruthPartClassifier::ParticleOrigin TO = res2.second;
      MCTruthPartClassifier::ParticleType TT = res2.first;

659
660
661
      if (TO == MCTruthPartClassifier::SingleElec &&
          TT == MCTruthPartClassifier::IsoElectron &&
          truth->index() == promtpElectronTruthIndex && !foundPromptElectron ) {
662
663
664

        // we found the track from the prompt electron
        // let's count it
665
        truthPromptElectronWithReco->fill(truth, elrec);
666
        foundPromptElectron = true;
667
668
669
670
        if (m_LooseLH->accept(elrec)) truthRecoElectronLooseLH->fill(truth,elrec);
        if (m_MediumLH->accept(elrec)) truthRecoElectronMediumLH->fill(truth,elrec);
        if (m_TightLH->accept(elrec)) truthRecoElectronTightLH->fill(truth,elrec);
        if (m_IsoFixedCutTightTrackOnly->accept(*elrec)) recoElectronIsoFixedCutTightTrackOnly->fill(truth,elrec);
671
672
673
674
675
676
677
678
679
680

      } else {
        const xAOD::TruthParticle *firstElTruth = xAOD::EgammaHelpers::getBkgElectronMother(truth);
        if (!firstElTruth) continue;
        // this is not a prompt electron, we need to check the parents
        // but we need to make sure that we double count if already found the track
        // foundPromptElectron will check that
        if ((firstElTruth->index() == promtpElectronTruthIndex)) {
          if  (!foundPromptElectron) {
            foundPromptElectron = true;
681
682
683
684
685
            truthPromptElectronWithReco->fill(firstElTruth,elrec);
            if (m_LooseLH->accept(elrec)) truthRecoElectronLooseLH->fill(firstElTruth,elrec);
            if (m_MediumLH->accept(elrec)) truthRecoElectronMediumLH->fill(firstElTruth,elrec);
            if (m_TightLH->accept(elrec)) truthRecoElectronTightLH->fill(firstElTruth,elrec);
            if (m_IsoFixedCutTightTrackOnly->accept(*elrec)) recoElectronIsoFixedCutTightTrackOnly->fill(firstElTruth,elrec);
686
687
688
689
690
691
          }

        }

      }

Marco Scodeggio's avatar
Marco Scodeggio committed
692
    } // RecoEl Loop
693

694

695
  } // if electron
Marco Scodeggio's avatar
Marco Scodeggio committed
696

697
698
699
700
701

  if ("gamma" == m_sampleType) {

    const xAOD::PhotonContainer *RecoPh = nullptr;
    if (!evtStore()->retrieve(RecoPh, "Photons").isSuccess()) {
Marco Scodeggio's avatar
Marco Scodeggio committed
702
      ATH_MSG_ERROR("Failed to retrieve photon container. Exiting.");
Marco Scodeggio's avatar
Marco Scodeggio committed
703
      return StatusCode::FAILURE;
704
    }
705

706
707
708
709
710
    for (auto phrec : *RecoPh) {

      if (!phrec) continue;

      recoPhotonAll->fill(*phrec);
711
      isolationAll->fill(*phrec);
712
      showerShapesAll->fill(*phrec);
713
      clusterAll->fill(*phrec,mu);
714
      if (phrec->pt() > 10*Gaudi::Units::GeV) {
715
        cluster10GeV->fill(*phrec,mu);
716
717
718
719
      }
      if (phrec->pt() > 10*Gaudi::Units::GeV){ 
        showerShapes10GeV->fill(*phrec);
      }
720

Marco Scodeggio's avatar
Marco Scodeggio committed
721
722
    } // RecoPh Loop

723
724
    for (auto egtruth : *egTruthParticles) {

725
726
      if (!egtruth) continue;

727
728
      truthPhotonAll->fill(*egtruth, mu);

729
730
731
      bool isTrueConv = xAOD::EgammaHelpers::isTrueConvertedPhoton(egtruth);
      bool isTrueLateConv = xAOD::EgammaHelpers::isTrueConvertedPhoton(egtruth, 1200) and !isTrueConv;
      const xAOD::Photon *photon = xAOD::EgammaHelpers::getRecoPhoton(egtruth);
732
733
734
735
736
737
738
      const xAOD::Electron *electron = xAOD::EgammaHelpers::getRecoElectron(egtruth);

      if(isTrueConv) truthPhotonAllConv->fill(*egtruth, mu);
      if(!isTrueConv && !isTrueLateConv) truthPhotonAllUnconv->fill(*egtruth, mu);

      if(photon || electron)
	truthPhotonRecoPhotonOrElectron->fill(*egtruth, mu);
739
740
741

      if (!photon) continue;

742
      truthPhotonRecoPhoton->fill(*egtruth, mu);
743
      clusterPromptAll->fill(*photon,mu);
744
      if (egtruth->pt() > 10*Gaudi::Units::GeV) {
745
        clusterPrompt10GeV->fill(*photon,mu);
746
      }
747
748
749
750
751
752

      bool isRecoConv = xAOD::EgammaHelpers::isConvertedPhoton(photon);
      xAOD::EgammaParameters::ConversionType convType = xAOD::EgammaHelpers::conversionType(photon);

      if (isTrueConv) {

753
        truthPhotonConvPhoton->fill(*egtruth, mu);
754
755
756

        if (isRecoConv) {

757
          truthPhotonConvRecoConv->fill(*egtruth, mu);
758

759
          clusterConvPhoton->fill(*photon,mu);
760
761

          if (convType == xAOD::EgammaParameters::singleSi) {
762
            truthPhotonConvRecoConv1Si->fill(*egtruth, mu);
763
            clusterConvPhotonSi->fill(*photon,mu);
764
          } else if (convType == xAOD::EgammaParameters::singleTRT) {
765
            truthPhotonConvRecoConv1TRT->fill(*egtruth, mu);
766
            clusterConvPhotonTRT->fill(*photon,mu);
767
          } else if (convType == xAOD::EgammaParameters::doubleSi) {
768
            truthPhotonConvRecoConv2Si->fill(*egtruth, mu);
769
            clusterConvPhotonSiSi->fill(*photon,mu);
770
          } else if (convType == xAOD::EgammaParameters::doubleTRT) {
771
            truthPhotonConvRecoConv2TRT->fill(*egtruth, mu);
772
            clusterConvPhotonTRTTRT->fill(*photon,mu);
773
          } else if (convType == xAOD::EgammaParameters::doubleSiTRT) {
774
            truthPhotonConvRecoConv2SiTRT->fill(*egtruth, mu);
775
            clusterConvPhotonSiTRT->fill(*photon,mu); 
776
          }
777

778
779
780
          if (m_IsoFixedCutTight->accept(*photon)) recoPhotonConvIsoFixedCutTight->fill(*egtruth, mu);
          if (m_IsoFixedCutTightCaloOnly->accept(*photon)) recoPhotonConvIsoFixedCutTightCaloOnly->fill(*egtruth, mu);
          if (m_IsoFixedCutLoose->accept(*photon)) recoPhotonConvIsoFixedCutLoose->fill(*egtruth, mu);
781
782
783
          if (m_LooseLH_Photon->accept(photon)) recoPhotonConvLooseLH->fill(*egtruth, mu);
          if (m_TightLH_Photon->accept(photon)) recoPhotonConvTightLH->fill(*egtruth, mu);

784
        } // isRecoConv
785
        else {
786
          truthPhotonConvRecoUnconv->fill(*egtruth, mu);
787
          clusterUnconvPhoton->fill(*photon,mu); 
788
        } 
789

790
      } //isTrueConv
791
792
      else if (!isTrueLateConv) {

793
        truthPhotonUnconvPhoton->fill(*egtruth, mu);
794

795
796
        if (isRecoConv) {
	  truthPhotonUnconvRecoConv->fill(*egtruth, mu);
797

798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
          if (convType == xAOD::EgammaParameters::singleSi) {
            truthPhotonUnconvRecoConv1Si->fill(*egtruth, mu);
            clusterConvPhotonSi->fill(*photon,mu);
          } else if (convType == xAOD::EgammaParameters::singleTRT) {
            truthPhotonUnconvRecoConv1TRT->fill(*egtruth, mu);
            clusterConvPhotonTRT->fill(*photon,mu);
          } else if (convType == xAOD::EgammaParameters::doubleSi) {
            truthPhotonUnconvRecoConv2Si->fill(*egtruth, mu);
            clusterConvPhotonSiSi->fill(*photon,mu);
          } else if (convType == xAOD::EgammaParameters::doubleTRT) {
            truthPhotonUnconvRecoConv2TRT->fill(*egtruth, mu);
            clusterConvPhotonTRTTRT->fill(*photon,mu);
          } else if (convType == xAOD::EgammaParameters::doubleSiTRT) {
            truthPhotonUnconvRecoConv2SiTRT->fill(*egtruth, mu);
            clusterConvPhotonSiTRT->fill(*photon,mu); 
          }
	}
        else           truthPhotonUnconvRecoUnconv->fill(*egtruth, mu);

        if (m_IsoFixedCutTight->accept(*photon)) recoPhotonUnconvIsoFixedCutTight->fill(*egtruth, mu);
        if (m_IsoFixedCutTightCaloOnly->accept(*photon)) recoPhotonUnconvIsoFixedCutTightCaloOnly->fill(*egtruth, mu);
        if (m_IsoFixedCutLoose->accept(*photon)) recoPhotonUnconvIsoFixedCutLoose->fill(*egtruth, mu);
820
821
822
        if (m_LooseLH_Photon->accept(photon)) recoPhotonUnconvLooseLH->fill(*egtruth, mu);
        if (m_TightLH_Photon->accept(photon)) recoPhotonUnconvTightLH->fill(*egtruth, mu);

823
824
      } // !isTrueLateConv
    } //egtruth Loop
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866

    //loop over InDetTrackParticles

    const xAOD::TrackParticleContainer* InDetTPs = 0;
    if(!evtStore()->retrieve(InDetTPs, "InDetTrackParticles").isSuccess()) {
      Error("execute()", "Failed to retrieve InDetTrackParticles. Exiting.");
      return StatusCode::FAILURE;
    }

    for(auto tp : *InDetTPs) {

      InDetTracks->fill(*tp, mu);
      if(matchedToElectron(*tp)) InDetTracksMatchElectron->fill(*tp, mu);
      if(!matchedToElectron(*tp)) InDetTracksNotElectron->fill(*tp, mu);
      if(matchedToPion(*tp)) InDetTracksMatchPion->fill(*tp, mu);
      if(notMatchedToTruth(*tp)) InDetTracksNotMatched->fill(*tp, mu);

      if(tp->pt() > 3000.){
	InDetTrackshighpT->fill(*tp, mu);
	if(matchedToElectron(*tp)) InDetTracksMatchElectronhighpT->fill(*tp, mu);
	if(!matchedToElectron(*tp)) InDetTracksNotElectronhighpT->fill(*tp, mu);
	if(matchedToPion(*tp)) InDetTracksMatchPionhighpT->fill(*tp, mu);
	if(notMatchedToTruth(*tp)) InDetTracksNotMatchedhighpT->fill(*tp, mu);
      }

	 if(xAOD::EgammaHelpers::numberOfSiHits(tp)==0) { //TRTSA tracks
	   InDetTracksTRT->fill(*tp, mu);
	   if(matchedToElectron(*tp)) InDetTracksTRTMatchElectron->fill(*tp, mu);
	   if(!matchedToElectron(*tp)) InDetTracksTRTNotElectron->fill(*tp, mu);
	   if(matchedToPion(*tp)) InDetTracksTRTMatchPion->fill(*tp, mu);
	   if(notMatchedToTruth(*tp)) InDetTracksTRTNotMatched->fill(*tp, mu);
	   if(tp->pt() > 3000.){
	     InDetTracksTRThighpT->fill(*tp, mu);
	     if(matchedToElectron(*tp)) InDetTracksTRTMatchElectronhighpT->fill(*tp, mu);
	     if(!matchedToElectron(*tp)) InDetTracksTRTNotElectronhighpT->fill(*tp, mu);
	     if(matchedToPion(*tp)) InDetTracksTRTMatchPionhighpT->fill(*tp, mu);
	     if(notMatchedToTruth(*tp)) InDetTracksTRTNotMatchedhighpT->fill(*tp, mu);
	   }
	 }

    }//loop over InDetTPs

Marco Scodeggio's avatar
Marco Scodeggio committed
867
868
  } // if gamma

869
870
871
872
873
  return StatusCode::SUCCESS;
}

// ******

874
875
876
877
878
StatusCode EgammaMonitoring::finalize() {

  if ("electron" == m_sampleType) {

    egammaMonitoring::EfficiencyPlot trackEfficiency("trackingEfficiency", "/MONITORING/trackingEfficiency/", rootHistSvc );
879
    ATH_CHECK(trackEfficiency.divide(truthPromptElectronWithTrack.get(), truthPromptElectronAll.get()));
880
    egammaMonitoring::EfficiencyPlot GSFEfficiency("GSFEfficiency", "/MONITORING/GSFEfficiency/", rootHistSvc );
881
    ATH_CHECK(GSFEfficiency.divide(truthPromptElectronWithGSFTrack.get(),truthPromptElectronWithTrack.get()));
882
    egammaMonitoring::EfficiencyPlot matchingEfficiency("matchingEfficiency", "/MONITORING/matchingEfficiency/", rootHistSvc );
883
    ATH_CHECK(matchingEfficiency.divide(truthPromptElectronWithReco.get(), truthPromptElectronWithGSFTrack.get()));
884
    egammaMonitoring::EfficiencyPlot reconstructionEfficiency("reconstructionEfficiency", "/MONITORING/reconstructionEfficiency/", rootHistSvc );
885
    ATH_CHECK(reconstructionEfficiency.divide(truthPromptElectronWithReco.get(), truthPromptElectronAll.get()));
886
    egammaMonitoring::EfficiencyPlot recoElectronLooseLHEfficiency("recoElectronLooseLHEfficiency", "/MONITORING/recoElectronLooseLHEfficiency/", rootHistSvc );
887
    ATH_CHECK(recoElectronLooseLHEfficiency.divide(truthRecoElectronLooseLH.get(), truthPromptElectronAll.get()));
888
    egammaMonitoring::EfficiencyPlot recoElectronMediumLHEfficiency("recoElectronMediumLHEfficiency", "/MONITORING/recoElectronMediumLHEfficiency/", rootHistSvc );
889
    ATH_CHECK(recoElectronMediumLHEfficiency.divide(truthRecoElectronMediumLH.get(), truthPromptElectronAll.get()));
890
    egammaMonitoring::EfficiencyPlot recoElectronTightLHEfficiency("recoElectronTightLHEfficiency", "/MONITORING/recoElectronTightLHEfficiency/", rootHistSvc );
891
    ATH_CHECK(recoElectronTightLHEfficiency.divide( truthRecoElectronTightLH.get(), truthPromptElectronAll.get()));
892
    egammaMonitoring::EfficiencyPlot recoElectronIsoFixedCutTightTrackOnlyEfficiency("recoElectronIsoFixedCutTightTrackOnlyEfficiency", "/MONITORING/recoElectronIsoFixedCutTightTrackOnlyEfficiency/", rootHistSvc );
893
    ATH_CHECK(recoElectronIsoFixedCutTightTrackOnlyEfficiency.divide( recoElectronIsoFixedCutTightTrackOnly.get(), truthPromptElectronWithReco.get()));
894
  }
895
896
897

  if ("gamma" == m_sampleType) {

898
899
900
901
902
903
904
905
    egammaMonitoring::EfficiencyPlot truthPhotonRecoPhotonEfficiency("truthPhotonRecoPhotonEfficiency", "/MONITORING/truthPhotonRecoPhotonEfficiency/", rootHistSvc );
    ATH_CHECK(truthPhotonRecoPhotonEfficiency.divide(truthPhotonRecoPhoton.get(),truthPhotonAll.get()));
    egammaMonitoring::EfficiencyPlot truthPhotonRecoPhotonOrElectronEfficiency("truthPhotonRecoPhotonOrElectronEfficiency", "/MONITORING/truthPhotonRecoPhotonOrElectronEfficiency/", rootHistSvc );
    ATH_CHECK(truthPhotonRecoPhotonOrElectronEfficiency.divide(truthPhotonRecoPhotonOrElectron.get(),truthPhotonAll.get()));
    egammaMonitoring::EfficiencyPlot truthPhotonConvRecoEfficiency("truthPhotonConvRecoEfficiency", "/MONITORING/truthPhotonConvRecoEfficiency/", rootHistSvc );
    ATH_CHECK(truthPhotonConvRecoEfficiency.divide(truthPhotonConvPhoton.get(),truthPhotonAllConv.get()));
    egammaMonitoring::EfficiencyPlot truthPhotonUnconvRecoEfficiency("truthPhotonUnconvRecoEfficiency", "/MONITORING/truthPhotonUnconvRecoEfficiency/", rootHistSvc );
    ATH_CHECK(truthPhotonUnconvRecoEfficiency.divide(truthPhotonUnconvPhoton.get(),truthPhotonAllUnconv.get()));
906
    egammaMonitoring::EfficiencyPlot truthPhotonConvRecoConvEfficiency("truthPhotonConvRecoConvEfficiency", "/MONITORING/truthPhotonConvRecoConvEfficiency/", rootHistSvc );
907
    ATH_CHECK(truthPhotonConvRecoConvEfficiency.divide(truthPhotonConvRecoConv.get(),truthPhotonConvPhoton.get()));
908
    egammaMonitoring::EfficiencyPlot truthPhotonConvRecoConv1SiEfficiency("truthPhotonConvRecoConv1SiEfficiency", "/MONITORING/truthPhotonConvRecoConv1SiEfficiency/", rootHistSvc );
909
    ATH_CHECK(truthPhotonConvRecoConv1SiEfficiency.divide( truthPhotonConvRecoConv1Si.get()   , truthPhotonConvPhoton.get()));
910
    egammaMonitoring::EfficiencyPlot truthPhotonConvRecoConv1TRTEfficiency("truthPhotonConvRecoConv1TRTEfficiency", "/MONITORING/truthPhotonConvRecoConv1TRTEfficiency/", rootHistSvc );
911
    ATH_CHECK(truthPhotonConvRecoConv1TRTEfficiency.divide(truthPhotonConvRecoConv1TRT.get()  , truthPhotonConvPhoton.get()));
912
    egammaMonitoring::EfficiencyPlot truthPhotonConvRecoConv2SiEfficiency("truthPhotonConvRecoConv2SiEfficiency", "/MONITORING/truthPhotonConvRecoConv2SiEfficiency/", rootHistSvc );
913
    ATH_CHECK(truthPhotonConvRecoConv2SiEfficiency.divide(truthPhotonConvRecoConv2Si.get()   , truthPhotonConvPhoton.get()));
914
    egammaMonitoring::EfficiencyPlot truthPhotonConvRecoConv2TRTEfficiency("truthPhotonConvRecoConv2TRTEfficiency", "/MONITORING/truthPhotonConvRecoConv2TRTEfficiency/", rootHistSvc );
915
    ATH_CHECK(truthPhotonConvRecoConv2TRTEfficiency.divide(truthPhotonConvRecoConv2TRT.get()  , truthPhotonConvPhoton.get()));
916
    egammaMonitoring::EfficiencyPlot truthPhotonConvRecoConv2SiTRTEfficiency("truthPhotonConvRecoConv2SiTRTEfficiency", "/MONITORING/truthPhotonConvRecoConv2SiTRTEfficiency/", rootHistSvc );
917
    ATH_CHECK(truthPhotonConvRecoConv2SiTRTEfficiency.divide(truthPhotonConvRecoConv2SiTRT.get(), truthPhotonConvPhoton.get()));
918
    egammaMonitoring::EfficiencyPlot truthPhotonConvRecoUnconvEfficiency("truthPhotonConvRecoUnconvEfficiency", "/MONITORING/truthPhotonConvRecoUnconvEfficiency/", rootHistSvc );
919
    ATH_CHECK(truthPhotonConvRecoUnconvEfficiency.divide(truthPhotonConvRecoUnconv.get(), truthPhotonConvPhoton.get()));
920
921
922
923
924
925
926
927
928
929
930
931
    egammaMonitoring::EfficiencyPlot truthPhotonUnconvRecoConvEfficiency("truthPhotonUnconvRecoConvEfficiency", "/MONITORING/truthPhotonUnconvRecoConvEfficiency/", rootHistSvc );
    ATH_CHECK(truthPhotonUnconvRecoConvEfficiency.divide(truthPhotonUnconvRecoConv.get(),truthPhotonUnconvPhoton.get()));
    egammaMonitoring::EfficiencyPlot truthPhotonUnconvRecoConv1SiEfficiency("truthPhotonUnconvRecoConv1SiEfficiency", "/MONITORING/truthPhotonUnconvRecoConv1SiEfficiency/", rootHistSvc );
    ATH_CHECK(truthPhotonUnconvRecoConv1SiEfficiency.divide( truthPhotonUnconvRecoConv1Si.get()   , truthPhotonUnconvPhoton.get()));
    egammaMonitoring::EfficiencyPlot truthPhotonUnconvRecoConv1TRTEfficiency("truthPhotonUnconvRecoConv1TRTEfficiency", "/MONITORING/truthPhotonUnconvRecoConv1TRTEfficiency/", rootHistSvc );
    ATH_CHECK(truthPhotonUnconvRecoConv1TRTEfficiency.divide(truthPhotonUnconvRecoConv1TRT.get()  , truthPhotonUnconvPhoton.get()));
    egammaMonitoring::EfficiencyPlot truthPhotonUnconvRecoConv2SiEfficiency("truthPhotonUnconvRecoConv2SiEfficiency", "/MONITORING/truthPhotonUnconvRecoConv2SiEfficiency/", rootHistSvc );
    ATH_CHECK(truthPhotonUnconvRecoConv2SiEfficiency.divide(truthPhotonUnconvRecoConv2Si.get()   , truthPhotonUnconvPhoton.get()));
    egammaMonitoring::EfficiencyPlot truthPhotonUnconvRecoConv2TRTEfficiency("truthPhotonUnconvRecoConv2TRTEfficiency", "/MONITORING/truthPhotonUnconvRecoConv2TRTEfficiency/", rootHistSvc );
    ATH_CHECK(truthPhotonUnconvRecoConv2TRTEfficiency.divide(truthPhotonUnconvRecoConv2TRT.get()  , truthPhotonUnconvPhoton.get()));
    egammaMonitoring::EfficiencyPlot truthPhotonUnconvRecoConv2SiTRTEfficiency("truthPhotonUnconvRecoConv2SiTRTEfficiency", "/MONITORING/truthPhotonUnconvRecoConv2SiTRTEfficiency/", rootHistSvc );
    ATH_CHECK(truthPhotonUnconvRecoConv2SiTRTEfficiency.divide(truthPhotonUnconvRecoConv2SiTRT.get(), truthPhotonUnconvPhoton.get()));
932
    egammaMonitoring::EfficiencyPlot truthPhotonUnconvRecoUnconvEfficiency("truthPhotonUnconvRecoUnconvEfficiency", "/MONITORING/truthPhotonUnconvRecoUnconvEfficiency/", rootHistSvc );
933
    ATH_CHECK(truthPhotonUnconvRecoUnconvEfficiency.divide(truthPhotonUnconvRecoUnconv.get(), truthPhotonUnconvPhoton.get()));
934
    egammaMonitoring::EfficiencyPlot truthPhotonRecoConvEfficiency("truthPhotonRecoConvEfficiency", "/MONITORING/truthPhotonRecoConvEfficiency/", rootHistSvc );
935
    ATH_CHECK(truthPhotonRecoConvEfficiency.divide(truthPhotonConvRecoConv.get(), truthPhotonRecoPhoton.get()));
936
    egammaMonitoring::EfficiencyPlot truthPhotonRecoUnconvEfficiency("truthPhotonRecoUnconvEfficiency", "/MONITORING/truthPhotonRecoUnconvEfficiency/", rootHistSvc );
937
    ATH_CHECK(truthPhotonRecoUnconvEfficiency.divide(truthPhotonUnconvRecoUnconv.get(), truthPhotonRecoPhoton.get()));
938
    egammaMonitoring::EfficiencyPlot recoPhotonUnconvIsoFixedCutTightEfficiency("recoPhotonUnconvIsoFixedCutTightEfficiency", "/MONITORING/recoPhotonUnconvIsoFixedCutTightEfficiency/", rootHistSvc );
939
    ATH_CHECK(recoPhotonUnconvIsoFixedCutTightEfficiency.divide( recoPhotonUnconvIsoFixedCutTight.get(), truthPhotonUnconvRecoUnconv.get()));
940
    egammaMonitoring::EfficiencyPlot recoPhotonUnconvIsoFixedCutTightCaloOnlyEfficiency("recoPhotonUnconvIsoFixedCutTightCaloOnlyEfficiency", "/MONITORING/recoPhotonUnconvIsoFixedCutTightCaloOnlyEfficiency/", rootHistSvc );
941
    ATH_CHECK(recoPhotonUnconvIsoFixedCutTightCaloOnlyEfficiency.divide( recoPhotonUnconvIsoFixedCutTightCaloOnly.get(), truthPhotonUnconvRecoUnconv.get()));
942
    egammaMonitoring::EfficiencyPlot recoPhotonUnconvIsoFixedCutLooseEfficiency("recoPhotonUnconvIsoFixedCutLooseEfficiency", "/MONITORING/recoPhotonUnconvIsoFixedCutLooseEfficiency/", rootHistSvc );
943
    ATH_CHECK(recoPhotonUnconvIsoFixedCutLooseEfficiency.divide( recoPhotonUnconvIsoFixedCutLoose.get(), truthPhotonUnconvRecoUnconv.get()));
944
    egammaMonitoring::EfficiencyPlot recoPhotonConvIsoFixedCutTightEfficiency("recoPhotonConvIsoFixedCutTightEfficiency", "/MONITORING/recoPhotonConvIsoFixedCutTightEfficiency/", rootHistSvc );
945
    ATH_CHECK(recoPhotonConvIsoFixedCutTightEfficiency.divide( recoPhotonConvIsoFixedCutTight.get(), truthPhotonConvRecoConv.get()));
946
    egammaMonitoring::EfficiencyPlot recoPhotonConvIsoFixedCutTightCaloOnlyEfficiency("recoPhotonConvIsoFixedCutTightCaloOnlyEfficiency", "/MONITORING/recoPhotonConvIsoFixedCutTightCaloOnlyEfficiency/", rootHistSvc );
947
    ATH_CHECK(recoPhotonConvIsoFixedCutTightCaloOnlyEfficiency.divide( recoPhotonConvIsoFixedCutTightCaloOnly.get(), truthPhotonConvRecoConv.get()));
948
    egammaMonitoring::EfficiencyPlot recoPhotonConvIsoFixedCutLooseEfficiency("recoPhotonConvIsoFixedCutLooseEfficiency", "/MONITORING/recoPhotonConvIsoFixedCutLooseEfficiency/", rootHistSvc );
949
    ATH_CHECK(recoPhotonConvIsoFixedCutLooseEfficiency.divide( recoPhotonConvIsoFixedCutLoose.get(), truthPhotonConvRecoConv.get()));
950
  
951
952
953
954
955
956
957
958
959
960
    egammaMonitoring::EfficiencyPlot recoPhotonConvLooseLHEfficiency("recoPhotonConvLooseLHEfficiency", "/MONITORING/recoPhotonConvLooseLHEfficiency/", rootHistSvc );
    ATH_CHECK(recoPhotonConvLooseLHEfficiency.divide( recoPhotonConvLooseLH.get(), truthPhotonConvRecoConv.get()));
    egammaMonitoring::EfficiencyPlot recoPhotonConvTightLHEfficiency("recoPhotonConvTightLHEfficiency", "/MONITORING/recoPhotonConvTightLHEfficiency/", rootHistSvc );
    ATH_CHECK(recoPhotonConvTightLHEfficiency.divide( recoPhotonConvTightLH.get(), truthPhotonConvRecoConv.get()));
    egammaMonitoring::EfficiencyPlot recoPhotonUnconvLooseLHEfficiency("recoPhotonUnconvLooseLHEfficiency", "/MONITORING/recoPhotonUnconvLooseLHEfficiency/", rootHistSvc );
    ATH_CHECK(recoPhotonUnconvLooseLHEfficiency.divide( recoPhotonUnconvLooseLH.get(), truthPhotonUnconvRecoUnconv.get()));
    egammaMonitoring::EfficiencyPlot recoPhotonUnconvTightLHEfficiency("recoPhotonUnconvTightLHEfficiency", "/MONITORING/recoPhotonUnconvTightLHEfficiency/", rootHistSvc );
    ATH_CHECK(recoPhotonUnconvTightLHEfficiency.divide( recoPhotonUnconvTightLH.get(), truthPhotonUnconvRecoUnconv.get()));


961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
    egammaMonitoring::WidthPlot truthPhotonRecoPhotonWidth("truthPhotonRecoPhotonWidth", "/MONITORING/truthPhotonRecoPhotonWidth/", rootHistSvc);
    ATH_CHECK(truthPhotonRecoPhotonWidth.fill(truthPhotonRecoPhoton.get()));
    egammaMonitoring::WidthPlot truthPhotonConvPhotonWidth("truthPhotonConvPhotonWidth", "/MONITORING/truthPhotonConvPhotonWidth/", rootHistSvc);
    ATH_CHECK(truthPhotonConvPhotonWidth.fill(truthPhotonConvPhoton.get()));
    egammaMonitoring::WidthPlot truthPhotonConvRecoConvWidth("truthPhotonConvRecoConvWidth", "/MONITORING/truthPhotonConvRecoConvWidth/", rootHistSvc);
    ATH_CHECK(truthPhotonConvRecoConvWidth.fill(truthPhotonConvRecoConv.get()));
    egammaMonitoring::WidthPlot truthPhotonConvRecoConv1SiWidth("truthPhotonConvRecoConv1SiWidth", "/MONITORING/truthPhotonConvRecoConv1SiWidth/", rootHistSvc);
    ATH_CHECK(truthPhotonConvRecoConv1SiWidth.fill(truthPhotonConvRecoConv1Si.get()));
    egammaMonitoring::WidthPlot truthPhotonConvRecoConv1TRTWidth("truthPhotonConvRecoConv1TRTWidth", "/MONITORING/truthPhotonConvRecoConv1TRTWidth/", rootHistSvc);
    ATH_CHECK(truthPhotonConvRecoConv1TRTWidth.fill(truthPhotonConvRecoConv1TRT.get()));
    egammaMonitoring::WidthPlot truthPhotonConvRecoConv2SiWidth("truthPhotonConvRecoConv2SiWidth", "/MONITORING/truthPhotonConvRecoConv2SiWidth/", rootHistSvc);
    ATH_CHECK(truthPhotonConvRecoConv2SiWidth.fill(truthPhotonConvRecoConv2Si.get()));
    egammaMonitoring::WidthPlot truthPhotonConvRecoConv2TRTWidth("truthPhotonConvRecoConv2TRTWidth", "/MONITORING/truthPhotonConvRecoConv2TRTWidth/", rootHistSvc);
    ATH_CHECK(truthPhotonConvRecoConv2TRTWidth.fill(truthPhotonConvRecoConv2TRT.get()));
    egammaMonitoring::WidthPlot truthPhotonConvRecoConv2SiTRTWidth("truthPhotonConvRecoConv2SiTRTWidth", "/MONITORING/truthPhotonConvRecoConv2SiTRTWidth/", rootHistSvc);
    ATH_CHECK(truthPhotonConvRecoConv2SiTRTWidth.fill(truthPhotonConvRecoConv2SiTRT.get()));
    egammaMonitoring::WidthPlot truthPhotonConvRecoUnconvWidth("truthPhotonConvRecoUnconvWidth", "/MONITORING/truthPhotonConvRecoUnconvWidth/", rootHistSvc);
    ATH_CHECK(truthPhotonConvRecoUnconvWidth.fill(truthPhotonConvRecoUnconv.get()));
    egammaMonitoring::WidthPlot truthPhotonUnconvPhotonWidth("truthPhotonUnconvPhotonWidth", "/MONITORING/truthPhotonUnconvPhotonWidth/", rootHistSvc);
    ATH_CHECK(truthPhotonUnconvPhotonWidth.fill(truthPhotonUnconvPhoton.get()));
    egammaMonitoring::WidthPlot truthPhotonUnconvRecoConvWidth("truthPhotonUnconvRecoConvWidth", "/MONITORING/truthPhotonUnconvRecoConvWidth/", rootHistSvc);
    ATH_CHECK(truthPhotonUnconvRecoConvWidth.fill(truthPhotonUnconvRecoConv.get()));
    egammaMonitoring::WidthPlot truthPhotonUnconvRecoUnconvWidth("truthPhotonUnconvRecoUnconvWidth", "/MONITORING/truthPhotonUnconvRecoUnconvWidth/", rootHistSvc);
    ATH_CHECK(truthPhotonUnconvRecoUnconvWidth.fill(truthPhotonUnconvRecoUnconv.get()));
985
  }
986

987
988
  return StatusCode::SUCCESS;
}
989
990
991
992
993