ATLAS Offline Software
Loading...
Searching...
No Matches
IDPerfMonZee.cxx
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration
3*/
4
5// **********************************************************************
6// IDPerfMonZee.cxx
7// AUTHORS: Beate Heinemann, Tobias Golling, Sara Strandberg
8// **********************************************************************
9
10#include <cmath>
11#include "TH1.h"
12#include "TH2.h"
13#include "TH1F.h"
14#include "TH2F.h"
15#include "TProfile.h"
16#include "TLorentzVector.h"
17
19
25
29
32
33#include "GaudiKernel/SystemOfUnits.h"
34#include "GaudiKernel/PhysicalConstants.h"
35
38
41
44
45
46#include <stdexcept>
47
48namespace{
49template <class T>
50 const T *
51 getCollectionWithCheck(const ServiceHandle<StoreGateSvc> & evtStore,const std::string &contName){
52 const T * container{};
53 if (evtStore->contains<T>(contName)){
54 //retrieve
55 if(evtStore->retrieve(container,contName).isFailure()) return nullptr;
56 }
57 return container;
58 }
59}
60
61// *********************************************************************
62// Public Methods
63// *********************************************************************
64
65IDPerfMonZee::IDPerfMonZee( const std::string & type, const std::string & name, const IInterface* parent )
66 :ManagedMonitorToolBase( type, name, parent ),
67 m_triggerChainName("NoTriggerSelection")
68{
69 declareProperty("tracksName",m_tracksName);
70 declareProperty("electronsName",m_electronsName="Electrons");
71 declareProperty("photonsName",m_photonsName="Photons");
72 declareProperty("VxPrimContainerName",m_VxPrimContainerName="PrimaryVertices");
73 declareProperty("emclustersName",m_emclustersName="LArClusterEM");
74 declareProperty("metName",m_metName="MET_Reference_AntiKt4LCTopo");
75 declareProperty("METFinalName", m_metRefFinalName= "FinalClus");
76 declareProperty("eoverp_standard_min",m_eoverp_standard_min=0.5);
77 declareProperty("eoverp_standard_max",m_eoverp_standard_max=4.0);
78 declareProperty("eoverp_tight_min",m_eoverp_tight_min=0.7);
79 declareProperty("eoverp_tight_max",m_eoverp_tight_max=1.3);
80 declareProperty("CheckRate",m_checkrate=1000);
81 declareProperty("triggerChainName",m_triggerChainName);
82 declareProperty("electronIDLevel",m_electronIDLevel = "Tight");
83
84 m_region_strings.emplace_back("incl");
85 m_region_strings.emplace_back("barrel");
86 m_region_strings.emplace_back("eca");
87 m_region_strings.emplace_back("ecc");
88
89}
90
91
93
94
96{
98 if (m_tracksName.empty()) ATH_MSG_WARNING( " no track collection given" );
100 if (sc.isFailure()) ATH_MSG_WARNING( "Could not initialize ManagedMonitorToolBase" );
101 //---Electron Likelihood tool---
102 m_doIDCuts = true;
103 ATH_MSG_INFO("IDPerfMonWenu::Initialize() -- Setting up electron LH tool.");
104 m_LHTool2015 = new AsgElectronLikelihoodTool ("m_LHTool2015");
105 if((m_LHTool2015->setProperty("primaryVertexContainer",m_VxPrimContainerName)).isFailure())
106 ATH_MSG_WARNING("Failure setting primary vertex container " << m_VxPrimContainerName << "in electron likelihood tool");
107
108 //Set up electron LH level
109 std::string confDir = "ElectronPhotonSelectorTools/offline/mc15_20150712/";
110 if(m_electronIDLevel.empty()){
111 ATH_MSG_WARNING("electronIDLevel is set to empty! No electron ID cuts will be applied.");
112 m_doIDCuts = false;
113 }
114 else{
115 if((m_electronIDLevel != "Loose") && (m_electronIDLevel != "Medium") && (m_electronIDLevel != "Tight")){
116 ATH_MSG_WARNING("Unknown electronIDLevel!! (Accepted values: Loose, Medium, Tight)");
117 m_doIDCuts = false;
118 }
119 else{
120 std::string configFile = confDir+"ElectronLikelihood"+m_electronIDLevel+"OfflineConfig2015.conf";
121 ATH_MSG_INFO("Likelihood configuration file: " << configFile);
122 if((m_LHTool2015->setProperty("ConfigFile",configFile)).isFailure()) ATH_MSG_WARNING("Failure loading ConfigFile in electron likelihood tool.");
123 }
124 }
125 StatusCode lh = m_LHTool2015->initialize();
126 if(lh.isFailure()){
127 ATH_MSG_WARNING("Electron likelihood tool initialize() failed! Turning off electron LH cuts!");
128 m_doIDCuts = false;
129 }
130 return StatusCode::SUCCESS;
131}
132
134{
135 MonGroup al_Zee_mon ( this, "IDPerfMon/Zee/" + m_triggerChainName, run);
136 if( newRunFlag() ) {
137 //if user environment specified we don't want to book new histograms at every run boundary
138 //we instead want one histogram per job
139 if(m_histosBooked!=0 && AthenaMonManager::environment()==AthenaMonManager::user) return StatusCode::SUCCESS;
140 // ***********************
141 // Book event histograms
142 // ***********************
143 m_Nevents = new TH1F("Nevents", "Number of events processed", 1, -.5, 0.5);
144 RegisterHisto(al_Zee_mon,m_Nevents);
145 m_Check = new TH1F("Check","", 4, 0,4);
146 RegisterHisto(al_Zee_mon,m_Check);
147 m_Zee_invmass = new TH1F("Zee_invmass","Invariant mass of the two leading em clusters", 90, 0.,180.);
148 RegisterHisto(al_Zee_mon,m_Zee_invmass);
149 m_Zee_invmass_sel = new TH1F("Zee_invmass_sel","Invariant mass of the two leading em clusters after Zee selection", 80, 50.,130.);
151 m_Zee_trk_invmass = new TH1F("Zee_trk_invmass","Invariant mass of the two tracks", 90, 0.,180.);
153 m_Zee_trk_invmass_scaled = new TH1F("Zee_trk_invmass_scaled","Invariant mass of the two tracks scaled to per event", 90, 0.,180.);
155 m_Zee_trk_invmass_sel = new TH1F("Zee_trk_invmass_sel","Invariant mass of the two tracks after Zee selection", 90, 0.,180.);
157 m_Zee_Eopasym_perevent = new TH1F("Zee_Eopasym_perevent", "E/p difference (pos-neg)/(pos+neg) per Z event for Zee EM-clusters", 60, -1.5, 1.5);
159 m_Zee_Eopasym_perevent_central = new TH1F("Zee_Eopasym_perevent_central", "E/p difference (pos-neg)/(pos+neg) per Z event for Zee EM-clusters with E/p between 0.7 and 1.3", 60, -1.5, 1.5);
161
162 // ***********************
163 // Book cluster histograms
164 // ***********************
165
166 // first take care to clear all histogram vectors
167 m_Zee_Eop.clear();
168 m_Zee_Eopdiff.clear();
169 m_Zee_Eop_plus.clear();
170 m_Zee_Eop_minus.clear();
171 m_Zee_eta.clear();
172 m_Zee_phi.clear();
173 m_Zee_deta.clear();
174 m_Zee_deta_vs_eta.clear();
175 m_Zee_deta_vs_phi.clear();
176 m_Zee_absdeta_vs_eta.clear();
177 m_Zee_absdeta_vs_phi.clear();
178 m_Zee_dphi.clear();
179 m_Zee_dphi_vs_eta.clear();
180 m_Zee_dphi_vs_phi.clear();
181 m_Zee_absdphi_vs_eta.clear();
182 m_Zee_absdphi_vs_phi.clear();
183 m_Zee_dphi_vs_phi_2d.clear();
184 m_Zee_deta_vs_phi_2d.clear();
185 m_Zee_dphi_vs_eta_2d.clear();
186 m_Zee_deta_vs_eta_2d.clear();
199 m_Zee_meanEop_vs_p.clear();
200 m_Zee_meanEop_vs_invp.clear();
201 m_Zee_meanEop_vs_E.clear();
204 m_Zee_meanEop_vs_phi.clear();
205 m_Zee_meanEop_vs_eta.clear();
216 m_Zee_Eop_lt1_gt1.clear();
217 m_Zee_Eopdiff_vs_p.clear();
218 m_Zee_Eopdiff_vs_invp.clear();
219 m_Zee_Eopdiff_vs_E.clear();
220 m_Zee_Eopdiff_vs_phi.clear();
221 m_Zee_Eopdiff_vs_eta.clear();
222 m_Zee_Eop_lt1_vs_eta.clear();
223 m_Zee_Eop_lt1_vs_phi.clear();
224 m_Zee_Eop_gt1_vs_eta.clear();
225 m_Zee_Eop_gt1_vs_phi.clear();
228 m_Zee_Eop_05_25.clear();
229 m_Zee_Eop_15_25.clear();
231
232 for (int region=0; region!=Nregions; ++region) {
233 std::string title;
234 std::string name;
235 name = "Zee_Eop_" + m_region_strings[region];
236 title = "E/p for Zee EM-clusters in " + m_region_strings[region];
237 m_Zee_Eop.push_back(new TH1F(name.c_str(),title.c_str(), 60, 0., 10.));
238 RegisterHisto(al_Zee_mon,m_Zee_Eop[region]);
239 name = "Zee_Eopdiff_" + m_region_strings[region];
240 title = "E/p difference (pos-neg) for Zee EM-clusters in " + m_region_strings[region];
241 m_Zee_Eopdiff.push_back(new TH1F(name.c_str(),title.c_str(), 10, 0., 2.));
242 RegisterHisto(al_Zee_mon,m_Zee_Eopdiff[region],true);
243 name = "Zee_Eop_plus_" + m_region_strings[region];
244 title = "E/p for pos. charged Zee EM-clusters in " + m_region_strings[region];
245 m_Zee_Eop_plus.push_back(new TH1F(name.c_str(),title.c_str(), 10, 0., 2.));
246 RegisterHisto(al_Zee_mon,m_Zee_Eop_plus[region],true);
247 name = "Zee_Eop_minus_" + m_region_strings[region];
248 title = "E/p for neg. charged Zee EM-clusters in " + m_region_strings[region];
249 m_Zee_Eop_minus.push_back(new TH1F(name.c_str(),title.c_str(), 10, 0., 2.));
250 RegisterHisto(al_Zee_mon,m_Zee_Eop_minus[region],true);
251 if (region != incl) continue;
252 m_Zee_eta.push_back(new TH1F("Zee_eta","Eta of Zee EM-clusters", 15, -3., 3.));
253 RegisterHisto(al_Zee_mon,m_Zee_eta[region]);
254 m_Zee_phi.push_back(new TH1F("Zee_phi","Phi of Zee EM-clusters", 15, -3.15, 3.15));
255 RegisterHisto(al_Zee_mon,m_Zee_phi[region]);
256 m_Zee_deta.push_back(new TH1F("Zee_deta","deltaEta(EM-cluster,track) in Zee events", 50, -0.5, 0.5));
257 RegisterHisto(al_Zee_mon,m_Zee_deta[region]);
258 m_Zee_deta_vs_eta.push_back(new TProfile("Zee_deta_vs_eta","deltaEta(EM-cluster,track) vs. eta in Zee events", 15, -3., 3.));
259 RegisterHisto(al_Zee_mon,m_Zee_deta_vs_eta[region]);
260 m_Zee_deta_vs_phi.push_back(new TProfile("Zee_deta_vs_phi","deltaEta(EM-cluster,track) vs. phi in Zee events", 15, -3.15, 3.15));
261 RegisterHisto(al_Zee_mon,m_Zee_deta_vs_phi[region]);
262 m_Zee_absdeta_vs_eta.push_back(new TProfile("Zee_absdeta_vs_eta","Abs(deltaEta(EM-cluster,track)) vs. eta in Zee events", 15, -3., 3.));
263 RegisterHisto(al_Zee_mon,m_Zee_absdeta_vs_eta[region]);
264 m_Zee_absdeta_vs_phi.push_back(new TProfile("Zee_absdeta_vs_phi","Abs(deltaEta(EM-cluster,track)) vs. phi in Zee events", 15, -3.15, 3.15));
265 RegisterHisto(al_Zee_mon,m_Zee_absdeta_vs_phi[region]);
266 m_Zee_dphi.push_back(new TH1F("Zee_dphi","deltaPhi(EM-cluster,track) in Zee events", 50, -0.5, 0.5));
267 RegisterHisto(al_Zee_mon,m_Zee_dphi[region]);
268 m_Zee_dphi_vs_eta.push_back(new TProfile("Zee_dphi_vs_eta","deltaPhi(EM-cluster,track) vs. eta in Zee events", 15, -3., 3.));
269 RegisterHisto(al_Zee_mon,m_Zee_dphi_vs_eta[region]);
270 m_Zee_dphi_vs_phi.push_back(new TProfile("Zee_dphi_vs_phi","deltaPhi(EM-cluster,track) vs. phi in Zee events", 15, -3.15, 3.15));
271 RegisterHisto(al_Zee_mon,m_Zee_dphi_vs_phi[region]);
272 m_Zee_absdphi_vs_eta.push_back(new TProfile("Zee_absdphi_vs_eta","Abs(deltaPhi(EM-cluster,track)) vs. eta in Zee events", 15, -3., 3.));
273 RegisterHisto(al_Zee_mon,m_Zee_absdphi_vs_eta[region]);
274 m_Zee_absdphi_vs_phi.push_back(new TProfile("Zee_absdphi_vs_phi","Abs(deltaPhi(EM-cluster,track)) vs. phi in Zee events", 15, -3.15, 3.15));
275 RegisterHisto(al_Zee_mon,m_Zee_absdphi_vs_phi[region]);
276
277 m_Zee_dphi_vs_phi_2d.push_back(new TH2F("Zee_dphi_vs_phi_2d","deltaPhi(EM-cluster,track) vs. phi in Zee events", 15, -3.15, 3.15 , 64, -0.1, 0.1));
278 RegisterHisto(al_Zee_mon,m_Zee_dphi_vs_phi_2d[region]);
279 m_Zee_deta_vs_phi_2d.push_back(new TH2F("Zee_deta_vs_phi_2d","deltaPhi(EM-cluster,track) vs. phi in Zee events", 15, -3.15, 3.15 , 64, -0.1, 0.1));
280 RegisterHisto(al_Zee_mon,m_Zee_deta_vs_phi_2d[region]);
281 m_Zee_dphi_vs_eta_2d.push_back(new TH2F("Zee_dphi_vs_eta_2d","deltaPhi(EM-cluster,track) vs. eta in Zee events", 15, -3., 3. , 64, -0.1, 0.1));
282 RegisterHisto(al_Zee_mon,m_Zee_dphi_vs_eta_2d[region]);
283 m_Zee_deta_vs_eta_2d.push_back(new TH2F("Zee_deta_vs_eta_2d","deltaPhi(EM-cluster,track) vs. eta in Zee events", 15, -3., 3. , 64, -0.1, 0.1));
284 RegisterHisto(al_Zee_mon,m_Zee_deta_vs_eta_2d[region]);
285
286 m_Zee_trackmatched_eta.push_back(new TH1F("Zee_trackmatched_eta","Eta of track-matched Zee EM-clusters", 15, -3., 3.));
287 RegisterHisto(al_Zee_mon,m_Zee_trackmatched_eta[region]);
288 m_Zee_trackmatched_phi.push_back(new TH1F("Zee_trackmatched_phi","Phi of track-matched Zee EM-clusters", 15, -3.15, 3.15));
289 RegisterHisto(al_Zee_mon,m_Zee_trackmatched_phi[region]);
290 m_Zee_trackmatched_Eopmatched_eta.push_back(new TH1F("Zee_trackmatched_Eopmatched_eta","Eta of track-matched and E/p-matched Zee EM-clusters", 15, -3., 3.));
292 m_Zee_trackmatched_Eopmatched_phi.push_back(new TH1F("Zee_trackmatched_Eopmatched_phi","Phi of track-matched and E/p-matched Zee EM-clusters", 15, -3.15, 3.15));
294 m_Zee_trackmatched_tightEopmatched_eta.push_back(new TH1F("Zee_trackmatched_tightEopmatched_eta","Eta of track-matched and tight E/p-matched Zee EM-clusters", 15, -3., 3.));
296 m_Zee_trackmatched_tightEopmatched_phi.push_back(new TH1F("Zee_trackmatched_tightEopmatched_phi","Phi of track-matched and tight E/p-matched Zee EM-clusters", 15, -3.15, 3.15));
298
299 m_Zee_trackmatch_eff_vs_eta.push_back(new TH1F("Zee_trackmatch_eff_vs_eta","Track-match efficiency for Zee EM-clusters vs. eta", 15, -3., 3.));
300 RegisterHisto(al_Zee_mon,m_Zee_trackmatch_eff_vs_eta[region],1);
301 m_Zee_trackmatch_eff_vs_phi.push_back(new TH1F("Zee_trackmatch_eff_vs_phi","Track-match efficiency for Zee EM-clusters vs. phi", 15, -3.15, 3.15));
302 RegisterHisto(al_Zee_mon,m_Zee_trackmatch_eff_vs_phi[region],1);
303 m_Zee_Eopmatch_eff_vs_eta.push_back(new TH1F("Zee_Eopmatch_eff_vs_eta","E/p-match efficiency for Zee EM-clusters vs. eta", 15, -3., 3.));
304 RegisterHisto(al_Zee_mon,m_Zee_Eopmatch_eff_vs_eta[region],1);
305 m_Zee_Eopmatch_eff_vs_phi.push_back(new TH1F("Zee_Eopmatch_eff_vs_phi","E/p-match efficiency for Zee EM-clusters vs. phi", 15, -3.15, 3.15));
306 RegisterHisto(al_Zee_mon,m_Zee_Eopmatch_eff_vs_phi[region],1);
307 m_Zee_tightEopmatch_eff_vs_eta.push_back(new TH1F("Zee_tightEopmatch_eff_vs_eta","Tight E/p-match efficiency for Zee EM-clusters vs. eta", 15, -3., 3.));
308 RegisterHisto(al_Zee_mon,m_Zee_tightEopmatch_eff_vs_eta[region],1);
309 m_Zee_tightEopmatch_eff_vs_phi.push_back(new TH1F("Zee_tightEopmatch_eff_vs_phi","Tight E/p-match efficiency for Zee EM-clusters vs. phi", 15, -3.15, 3.15));
310 RegisterHisto(al_Zee_mon,m_Zee_tightEopmatch_eff_vs_phi[region],1);
311
312 m_Zee_meanEop_vs_p.push_back(new TProfile("Zee_meanEop_vs_p", "Mean E/p vs p for Zee EM-clusters", 15, 0., 300.));
313 RegisterHisto(al_Zee_mon,m_Zee_meanEop_vs_p[region]);
314 m_Zee_meanEop_vs_invp.push_back(new TProfile("Zee_meanEop_vs_invp", "Mean E/p vs 1/p for Zee EM-clusters", 15, 0., 0.05));
315 RegisterHisto(al_Zee_mon,m_Zee_meanEop_vs_invp[region]);
316 m_Zee_meanEop_vs_E.push_back(new TProfile("Zee_meanEop_vs_E", "Mean E/p vs E for Zee EM-clusters", 15, 0., 300.));
317 RegisterHisto(al_Zee_mon,m_Zee_meanEop_vs_E[region]);
318 m_Zee_meanEop_vs_chargedp.push_back(new TProfile("Zee_meanEop_vs_chargedp", "Mean E/p vs charge*p for Zee EM-clusters", 30, -300., 300.));
319 RegisterHisto(al_Zee_mon,m_Zee_meanEop_vs_chargedp[region]);
320 m_Zee_meanEop_vs_chargedE.push_back(new TProfile("Zee_meanEop_vs_chargedE", "Mean E/p vs charge*E for Zee EM-clusters", 30, -300., 300.));
321 RegisterHisto(al_Zee_mon,m_Zee_meanEop_vs_chargedE[region]);
322 m_Zee_meanEop_vs_phi.push_back(new TProfile("Zee_meanEop_vs_phi", "Mean E/p vs phi for Zee EM-clusters", 15, -3.15, 3.15));
323 RegisterHisto(al_Zee_mon,m_Zee_meanEop_vs_phi[region]);
324 m_Zee_meanEop_vs_eta.push_back(new TProfile("Zee_meanEop_vs_eta", "Mean E/p vs eta for Zee EM-clusters", 15, -3., 3.));
325 RegisterHisto(al_Zee_mon,m_Zee_meanEop_vs_eta[region]);
326
327 m_Zee_meanEop_vs_p_plus.push_back(new TProfile("Zee_meanEop_vs_p_plus", "Mean E/p vs p for pos. charged Zee EM-clusters", 15, 0., 300.));
328 RegisterHisto(al_Zee_mon,m_Zee_meanEop_vs_p_plus[region]);
329 m_Zee_meanEop_vs_invp_plus.push_back(new TProfile("Zee_meanEop_vs_invp_plus", "Mean E/p vs 1/p for pos. charged Zee EM-clusters", 15, 0., 0.05));
330 RegisterHisto(al_Zee_mon,m_Zee_meanEop_vs_invp_plus[region]);
331 m_Zee_meanEop_vs_E_plus.push_back(new TProfile("Zee_meanEop_vs_E_plus", "Mean E/p vs E for pos. charged Zee EM-clusters", 15, 0., 300.));
332 RegisterHisto(al_Zee_mon,m_Zee_meanEop_vs_E_plus[region]);
333 m_Zee_meanEop_vs_phi_plus.push_back(new TProfile("Zee_meanEop_vs_phi_plus", "Mean E/p vs phi for pos. charged Zee EM-clusters", 15, -3.15, 3.15));
334 RegisterHisto(al_Zee_mon,m_Zee_meanEop_vs_phi_plus[region]);
335 m_Zee_meanEop_vs_eta_plus.push_back(new TProfile("Zee_meanEop_vs_eta_plus", "Mean E/p vs eta for pos. charged Zee EM-clusters", 15, -3., 3.));
336 RegisterHisto(al_Zee_mon,m_Zee_meanEop_vs_eta_plus[region]);
337
338 m_Zee_meanEop_vs_p_minus.push_back(new TProfile("Zee_meanEop_vs_p_minus", "Mean E/p vs p for neg. charged Zee EM-clusters", 15, 0., 300.));
339 RegisterHisto(al_Zee_mon,m_Zee_meanEop_vs_p_minus[region]);
340 m_Zee_meanEop_vs_invp_minus.push_back(new TProfile("Zee_meanEop_vs_invp_minus", "Mean E/p vs 1/p for neg. charged Zee EM-clusters", 15, 0., 0.05));
341 RegisterHisto(al_Zee_mon,m_Zee_meanEop_vs_invp_minus[region]);
342 m_Zee_meanEop_vs_E_minus.push_back(new TProfile("Zee_meanEop_vs_E_minus", "Mean E/p vs E for neg. charged Zee EM-clusters", 15, 0., 300.));
343 RegisterHisto(al_Zee_mon,m_Zee_meanEop_vs_E_minus[region]);
344 m_Zee_meanEop_vs_phi_minus.push_back(new TProfile("Zee_meanEop_vs_phi_minus", "Mean E/p vs phi for neg. charged Zee EM-clusters", 15, -3.15, 3.15));
345 RegisterHisto(al_Zee_mon,m_Zee_meanEop_vs_phi_minus[region]);
346 m_Zee_meanEop_vs_eta_minus.push_back(new TProfile("Zee_meanEop_vs_eta_minus", "Mean E/p vs eta for neg. charged Zee EM-clusters", 15, -3., 3.));
347 RegisterHisto(al_Zee_mon,m_Zee_meanEop_vs_eta_minus[region]);
348
349 m_Zee_Eop_lt1_gt1.push_back(new TH1F("Zee_Eop_lt1_gt1", "E/p below/above 1 for Zee EM-clusters", 2, 0.5, 1.5));
350 RegisterHisto(al_Zee_mon,m_Zee_Eop_lt1_gt1[region]);
351
352 m_Zee_Eopdiff_vs_p.push_back(new TProfile("Zee_Eopdiff_vs_p", "E/p difference (pos-neg) vs p for Zee EM-clusters", 15, 0., 300.));
353 RegisterHisto(al_Zee_mon,m_Zee_Eopdiff_vs_p[region]);
354 m_Zee_Eopdiff_vs_invp.push_back(new TProfile("Zee_Eopdiff_vs_invp", "E/p difference (pos-neg) vs 1/p for Zee EM-clusters", 15, 0., 0.05));
355 RegisterHisto(al_Zee_mon,m_Zee_Eopdiff_vs_invp[region]);
356 m_Zee_Eopdiff_vs_E.push_back(new TProfile("Zee_Eopdiff_vs_E", "E/p difference (pos-neg) vs E for Zee EM-clusters", 15, 0., 300.));
357 RegisterHisto(al_Zee_mon,m_Zee_Eopdiff_vs_E[region]);
358 m_Zee_Eopdiff_vs_phi.push_back(new TProfile("Zee_Eopdiff_vs_phi", "E/p difference (pos-neg) vs phi for Zee EM-clusters", 15, -3.15, 3.15));
359 RegisterHisto(al_Zee_mon,m_Zee_Eopdiff_vs_phi[region]);
360 m_Zee_Eopdiff_vs_eta.push_back(new TProfile("Zee_Eopdiff_vs_eta", "E/p difference (pos-neg) vs eta for Zee EM-clusters", 15, -3., 3.));
361 RegisterHisto(al_Zee_mon,m_Zee_Eopdiff_vs_eta[region]);
362
363 m_Zee_Eop_lt1_vs_eta.push_back(new TH1F("Zee_Eop_lt1_vs_eta","Eta of Zee EM-clusters with E/p < 1 (not incl. small E/p)", 15, -3., 3.));
364 RegisterHisto(al_Zee_mon,m_Zee_Eop_lt1_vs_eta[region]);
365 m_Zee_Eop_lt1_vs_phi.push_back(new TH1F("Zee_Eop_lt1_vs_phi","Phi of Zee EM-clusters with E/p < 1 (not incl. small E/p)", 15, -3.15, 3.15));
366 RegisterHisto(al_Zee_mon,m_Zee_Eop_lt1_vs_phi[region]);
367 m_Zee_Eop_gt1_vs_eta.push_back(new TH1F("Zee_Eop_gt1_vs_eta","Eta of Zee EM-clusters with E/p < 1 (not incl. small E/p)", 15, -3., 3.));
368 RegisterHisto(al_Zee_mon,m_Zee_Eop_gt1_vs_eta[region]);
369 m_Zee_Eop_gt1_vs_phi.push_back(new TH1F("Zee_Eop_gt1_vs_phi","Phi of Zee EM-clusters with E/p < 1 (not incl. small E/p)", 15, -3.15, 3.15));
370 RegisterHisto(al_Zee_mon,m_Zee_Eop_gt1_vs_phi[region]);
371 m_Zee_frac_Eop_lt1_vs_eta.push_back(new TH1F("Zee_frac_Eop_lt1_vs_eta","Fraction of Zee EM-clusters with E/p < 1 (not incl. small E/p) vs Eta", 15, -3., 3.));
372 RegisterHisto(al_Zee_mon,m_Zee_frac_Eop_lt1_vs_eta[region],1);
373 m_Zee_frac_Eop_lt1_vs_phi.push_back(new TH1F("Zee_frac_Eop_lt1_vs_phi","Fraction of Zee EM-clusters with E/p < 1 (not incl. small E/p) vs Phi", 15, -3.15, 3.15));
374 RegisterHisto(al_Zee_mon,m_Zee_frac_Eop_lt1_vs_phi[region],1);
375
376 m_Zee_Eop_05_25.push_back(new TH1F("Zee_Eop_05_25","Number of Zee events with 0.5 < E/p 2.5", 1, 0., 1.));
377 RegisterHisto(al_Zee_mon,m_Zee_Eop_05_25[region]);
378 m_Zee_Eop_15_25.push_back(new TH1F("Zee_Eop_15_25","Number of Zee events with 1.5 < E/p 2.5", 1, 0., 1.));
379 RegisterHisto(al_Zee_mon,m_Zee_Eop_15_25[region]);
380 m_Zee_frac_Eop_05_25_15_25.push_back(new TH1F("Zee_frac_Eop_05_25_15_25","Fraction of Zee EM-clusters with 1.5 < E/p < 2.5 and 0.5 < E/p < 2.5", 1, 0., 1.));
381 RegisterHisto(al_Zee_mon,m_Zee_frac_Eop_05_25_15_25[region],1);
382 }
383
385 }
386 return StatusCode::SUCCESS;
387}
388
389void IDPerfMonZee::RegisterHisto(MonGroup& mon, TH1* histo, bool doSumw2) {
390 if (doSumw2) histo->Sumw2();
391 if (mon.regHist(histo).isFailure() ) {
392 ATH_MSG_DEBUG( "Cannot book TH1 Histogram:" );
393 }
394}
395
396void IDPerfMonZee::RegisterHisto(MonGroup& mon, TProfile* histo) {
397 if (mon.regHist(histo).isFailure() ) {
398 ATH_MSG_DEBUG( "Cannot book TProfile Histogram:" );
399 }
400}
401
402void IDPerfMonZee::RegisterHisto(MonGroup& mon, TH2* histo, bool doSumw2) {
403 if (doSumw2) histo->Sumw2();
404 if (mon.regHist(histo).isFailure() ) {
405 ATH_MSG_DEBUG( "Cannot book TH2 Histogram:" );
406 }
407}
408
410{
411 ATH_MSG_VERBOSE("In fillHistograms()");
412 int nevents = (int) m_Nevents->GetEntries();
413 const bool firstEvent{nevents == 1};
414 // get electron container from storegate
415 auto formErrorMessage = [] (const std::string & contName)->std::string {
416 return std::string(std::string("No Collection with name ") + contName + std::string(" found in StoreGate"));
417 };
418 // get electron container from storegate
420
421 if (not electrons){
422 const std::string & errMsg=formErrorMessage(m_electronsName);
423 if (firstEvent) ATH_MSG_WARNING( errMsg );
424 else ATH_MSG_DEBUG(errMsg);
425 return StatusCode::RECOVERABLE;
426 }
427 ATH_MSG_VERBOSE("This event contains " << electrons->size() << " electrons.");
428
429 // get photon container from storegate
430 const xAOD::PhotonContainer* photons = getCollectionWithCheck<xAOD::PhotonContainer>(evtStore(),m_photonsName);
431 if (not photons){
432 const std::string & errMsg = formErrorMessage(m_photonsName);
433 if (firstEvent) ATH_MSG_WARNING( errMsg );
434 else ATH_MSG_DEBUG(errMsg);
435 return StatusCode::RECOVERABLE;
436 }
437
438 // get emcluster container from storegate
439 const xAOD::CaloClusterContainer* emclusters = getCollectionWithCheck<xAOD::CaloClusterContainer>(evtStore(),m_emclustersName);
440 if (not emclusters){
441 const std::string & errMsg = formErrorMessage(m_emclustersName);
442 if (firstEvent) ATH_MSG_WARNING( errMsg );
443 else ATH_MSG_DEBUG(errMsg);
444 return StatusCode::RECOVERABLE;
445 }
446
447 // get track container from storegate
448 const xAOD::TrackParticleContainer* tracks = getCollectionWithCheck<xAOD::TrackParticleContainer>(evtStore(),m_tracksName);
449 if (not tracks){
450 const std::string & errMsg = formErrorMessage(m_tracksName);
451 if (firstEvent) ATH_MSG_WARNING( errMsg );
452 else ATH_MSG_DEBUG(errMsg);
453 return StatusCode::RECOVERABLE;
454 }
455
456 // get met container from storegate
457 const xAOD::MissingETContainer* final_met = getCollectionWithCheck<xAOD::MissingETContainer>(evtStore(),m_metName);
458 if (not final_met){
459 const std::string & errMsg = formErrorMessage(m_metName);
460 if (firstEvent) ATH_MSG_WARNING( errMsg );
461 else ATH_MSG_DEBUG(errMsg);
462 return StatusCode::RECOVERABLE;
463 }
464 const xAOD::MissingET *met{};
465 met = (*final_met)[m_metRefFinalName];
466 if (met) {
467 ATH_MSG_DEBUG( "MET = " << met->met() );
468 }
469 m_Nevents->Fill(0.);
470
471 // *******************
472 // Look at EM clusters
473 // *******************
474
475 const xAOD::CaloCluster* LeadingEMcluster = getLeadingEMcluster(photons, electrons);
476 const xAOD::CaloCluster* SecondLeadingEMcluster = getLeadingEMcluster(photons, electrons, LeadingEMcluster);
477
478 if((LeadingEMcluster) and (SecondLeadingEMcluster))
479 ATH_MSG_DEBUG("Event has a leading and second leading EM cluster!");
480
481 if (LeadingEMcluster and SecondLeadingEMcluster) {
482 int leading_eta_region = etaRegion(LeadingEMcluster->etaBE(2));
483 int second_leading_eta_region = etaRegion(SecondLeadingEMcluster->etaBE(2));
484 double leading_dPhi = electronTrackMatchEta(tracks,LeadingEMcluster);
485 double leading_dEta = electronTrackMatchPhi(tracks,LeadingEMcluster);
486 double second_leading_dPhi = electronTrackMatchEta(tracks,SecondLeadingEMcluster);
487 double second_leading_dEta = electronTrackMatchPhi(tracks,SecondLeadingEMcluster);
488 const xAOD::TrackParticle* track_leading_emcluster = electronTrackMatch(tracks,LeadingEMcluster);
489 const xAOD::TrackParticle* track_second_leading_emcluster = electronTrackMatch(tracks,SecondLeadingEMcluster);
490
491 if( track_leading_emcluster and track_second_leading_emcluster) ATH_MSG_DEBUG("Event has a tracks matched to both clusters!");
492 //
493 // *********************
494 // Fill event histograms
495 // *********************
496 // get cluster, track invariant masses and fill pre-selection histograms
497 double cluster_invmass = InvMass(LeadingEMcluster,SecondLeadingEMcluster);
498 ATH_MSG_DEBUG("Cluster invariant mass: " << cluster_invmass);
499 if (cluster_invmass > 0.) m_Zee_invmass->Fill(cluster_invmass);
500 double track_invmass = 0.;
501 if (track_leading_emcluster and track_second_leading_emcluster) {
502 track_invmass = InvMass(track_leading_emcluster,track_second_leading_emcluster);
503 ATH_MSG_DEBUG("Track invariant mass: " << track_invmass);
504 if (track_invmass > 0.) m_Zee_trk_invmass->Fill(track_invmass);
505 }
506 // does the event pass the Zee selection?
507 int selected = isZee(LeadingEMcluster,SecondLeadingEMcluster,tracks);
508 ATH_MSG_DEBUG("Event passed " << 3-selected << "/3 Zee cuts");
509
510 // fill histograms only with selected events
511 if(selected == 0){
512 ATH_MSG_DEBUG("Event passed selection -- filling histograms");
513 if (cluster_invmass > 0.) m_Zee_invmass_sel->Fill(cluster_invmass);
514 if (track_invmass > 0.) m_Zee_trk_invmass_sel->Fill(track_invmass);
515 // fill e/p histos from SELECTED Zee events
516 if (track_leading_emcluster && track_second_leading_emcluster) {
517 double eoverp_pos = -99.;
518 double eoverp_neg = -99.;
519 double track_leading_emcluster_p = track_leading_emcluster->pt()*cosh(track_leading_emcluster->eta());
520 double track_second_leading_emcluster_p = track_second_leading_emcluster->pt()*std::cosh(track_second_leading_emcluster->eta());
521
522 if (track_leading_emcluster->charge() == 1. && track_second_leading_emcluster->charge() == -1.) {
523 eoverp_pos = LeadingEMcluster->e()/track_leading_emcluster_p;
524 eoverp_neg = SecondLeadingEMcluster->e()/track_second_leading_emcluster_p;
525 } else if (track_leading_emcluster->charge() == -1. && track_second_leading_emcluster->charge() == 1.) {
526 eoverp_neg = LeadingEMcluster->e()/track_leading_emcluster_p;
527 eoverp_pos = SecondLeadingEMcluster->e()/track_second_leading_emcluster_p;
528 }
529 double eoverpasym = -99.;
530 if (eoverp_pos+eoverp_neg != 0.) {
531 eoverpasym = (eoverp_pos-eoverp_neg) / (eoverp_pos+eoverp_neg);
532 m_Zee_Eopasym_perevent->Fill(eoverpasym);
533 if ( (eoverp_pos > m_eoverp_tight_min) && (eoverp_pos < m_eoverp_tight_max) && (eoverp_neg > m_eoverp_tight_min) && (eoverp_neg < m_eoverp_tight_max) ) {
534 m_Zee_Eopasym_perevent_central->Fill(eoverpasym);
535 }
536 }
537 }
538 }
539 // ***********************
540 // Fill cluster histograms
541 // ***********************
542 if (selected == 0) {
543 // ************************
544 // Fill for leading cluster
545 // ************************
546 FillHistosPerCluster(LeadingEMcluster, track_leading_emcluster, leading_eta_region, leading_dEta, leading_dPhi);
547 FillHistosPerCluster(LeadingEMcluster, track_leading_emcluster, incl, leading_dEta, leading_dPhi);
548 // *******************************
549 // Fill for second leading cluster
550 // *******************************
551 FillHistosPerCluster(SecondLeadingEMcluster, track_second_leading_emcluster, second_leading_eta_region, second_leading_dEta, second_leading_dPhi);
552 FillHistosPerCluster(SecondLeadingEMcluster, track_second_leading_emcluster, incl, second_leading_dEta, second_leading_dPhi);
553 }
554 }
555 return StatusCode::SUCCESS;
556}
557
558void IDPerfMonZee::makeEffHisto(TH1F* h_num, TH1F* h_denom, TH1F* h_eff) {
559 h_eff->Divide(h_num,h_denom,1.,1.,"B");
560}
561
563{
564 if( endOfRunFlag() ) {
565 // PostProcess Zee histograms
566 for (int region=0; region!=1; ++region) {
573 // these were commented out
574 m_Zee_Eopdiff[region]->Add(m_Zee_Eop_plus[region],m_Zee_Eop_minus[region],1.,-1);
575 m_Zee_Eopdiff_vs_p[region]->Add(m_Zee_meanEop_vs_p_plus[region],m_Zee_meanEop_vs_p_minus[region],1.,-1);
577 m_Zee_Eopdiff_vs_E[region]->Add(m_Zee_meanEop_vs_E_plus[region],m_Zee_meanEop_vs_E_minus[region],1.,-1);
580
584 }
585
586 }
587 return StatusCode::SUCCESS;
588}
589
590
592 const xAOD::CaloCluster* leading_emcluster{};
593 float max_pt = 0.;
594 for (const auto cl: *clusters) {
595 if (cl == omitCluster) continue;
596 double deltaR = std::sqrt(std::pow(std::abs(cl->phi() - omitCluster->phi()),2) + std::pow(std::abs(cl->eta() - omitCluster->eta()),2));
597 if(deltaR < 0.005) continue;
598 if (cl->pt()/Gaudi::Units::GeV < 10.) continue;
599 if (cl->pt() > max_pt) {
600 leading_emcluster = cl;
601 max_pt = cl->pt();
602 }
603 }
604 return leading_emcluster;
605}
606
607const xAOD::CaloCluster* IDPerfMonZee::getLeadingEMcluster(const xAOD::PhotonContainer* /*photons*/, const xAOD::ElectronContainer* electrons, const xAOD::CaloCluster* omitCluster) const {
608 const xAOD::CaloCluster* leading_emcluster{};
609 bool LHSel;
610 float max_pt = 0.;
611 for (const auto em: *electrons) {
612 ATH_MSG_DEBUG("Checking likelihood");
613 // check ID
614 if(m_doIDCuts){
615 LHSel = false;
616 LHSel = (bool) m_LHTool2015->accept(em);
617 if(!LHSel) continue;
618 ATH_MSG_DEBUG("Electron passes " << m_electronIDLevel << " likelihood selection");
619 }
620 const xAOD::CaloCluster* cl = em->caloCluster();
621 if (cl == omitCluster) continue;
622 double deltaR = !omitCluster ? 1.0 : std::sqrt(std::pow(std::abs(cl->phi() - omitCluster->phi()),2) + std::pow(std::abs(cl->eta() - omitCluster->eta()),2));
623 if(deltaR < 0.005) continue;
624 if (cl->pt()/Gaudi::Units::GeV < 20.) continue;
625 if (cl->pt() > max_pt) {
626 leading_emcluster = cl;
627 max_pt = cl->pt();
628 }
629 }
630 ATH_MSG_DEBUG("leading_emcluster: " << leading_emcluster);
631 return leading_emcluster;
632}
633
634
635const xAOD::TrackParticle* IDPerfMonZee::electronTrackMatch(const xAOD::TrackParticleContainer* tracks, const xAOD::CaloCluster* cluster, double dEta, double dPhi) const {
636 const xAOD::TrackParticle* matched_track{};
637 double min_dR = 1.0e+20;
638 for (const auto track: *tracks){
639 double deta = cluster->etaBE(2)-track->eta();
640 double dphi = cluster->phi()-track->phi();
641 double dr = std::sqrt(deta*deta + dphi*dphi);
642 if (dr < min_dR && std::abs(deta) < dEta && std::abs(dphi) < dPhi) {
643 min_dR = dr;
644 matched_track = track;
645 }
646 }
647 return matched_track;
648}
649
650double IDPerfMonZee::electronTrackMatchEta(const xAOD::TrackParticleContainer* tracks, const xAOD::CaloCluster* cluster, double dEta) const {
651 const xAOD::TrackParticle* matched_track{};
652 double min_dEta = 1.0e+20;
653 for (const auto track : *tracks){
654 double deta = std::abs(cluster->etaBE(2)-track->eta());
655 if (deta < min_dEta && deta < dEta) {
656 min_dEta = deta;
657 matched_track = track;
658 }
659 }
660 double dPhi = 1.0e+20;
661 if (matched_track != nullptr) dPhi = signedDeltaPhi(cluster->phi(),matched_track->phi());
662 return dPhi;
663}
664
665double IDPerfMonZee::electronTrackMatchPhi(const xAOD::TrackParticleContainer* tracks, const xAOD::CaloCluster* cluster, double dPhi) const {
666 const xAOD::TrackParticle* matched_track{};
667 double min_dPhi = 1.0e+20;
668 for (const auto track : *tracks){
669 double dphi = std::abs(signedDeltaPhi(cluster->phi(),track->phi()));
670 if (dphi < min_dPhi && dphi < dPhi) {
671 min_dPhi = dphi;
672 matched_track = track;
673 }
674 }
675 double dEta = 1.0e+20;
676 if (matched_track ) dEta = cluster->etaBE(2)-matched_track->eta();
677 return dEta;
678}
679
680double IDPerfMonZee::InvMass(const xAOD::CaloCluster* EM1, const xAOD::CaloCluster* EM2) const {
681 if (EM1 == nullptr || EM2 == nullptr) return -99.;
682 double invmass = 0.;
683 if (EM1->pt() != 0 && EM2->pt() != 0.) {
684 TLorentzVector particle1;
685 TLorentzVector particle2;
686 particle1.SetPtEtaPhiE(EM1->pt()/Gaudi::Units::GeV,EM1->eta(),EM1->phi(),EM1->e()/Gaudi::Units::GeV);
687 particle2.SetPtEtaPhiE(EM2->pt()/Gaudi::Units::GeV,EM2->eta(),EM2->phi(),EM2->e()/Gaudi::Units::GeV);
688 invmass = (particle1+particle2).Mag();
689 }
690 return invmass;
691}
692
693double IDPerfMonZee::InvMass(const xAOD::TrackParticle* trk1, const xAOD::TrackParticle* trk2) const {
694 if (trk1 == nullptr || trk2 == nullptr) return -99.;
695 double invmass = 0.;
696 if (trk1->pt() != 0 && trk2->pt() != 0.) {
697 TLorentzVector particle1;
698 TLorentzVector particle2;
699 particle1.SetPtEtaPhiE(trk1->pt()/Gaudi::Units::GeV,trk1->eta(),trk1->phi(),trk1->e()/Gaudi::Units::GeV);
700 particle2.SetPtEtaPhiE(trk2->pt()/Gaudi::Units::GeV,trk2->eta(),trk2->phi(),trk2->e()/Gaudi::Units::GeV);
701 invmass = (particle1+particle2).Mag();
702 }
703 return invmass;
704}
705
707 if (EM == nullptr || met == nullptr) return -99.;
708 double transmass = 0.;
709 float dphi = signedDeltaPhi(EM->phi(),met->phi());
710 transmass = std::sqrt(2.*EM->et()*met->met()*(1.-std::cos(dphi)));
711 return transmass;
712}
713
714double IDPerfMonZee::deltaR(const xAOD::CaloCluster* cluster, const xAOD::TrackParticle* track) const {
715 double dr =-999.;
716 if (cluster == nullptr || track == nullptr) return dr;
717 double deta = cluster->etaBE(2)-track->eta();
718 double dphi = cluster->phi()-track->phi();
719 dr = std::sqrt(deta*deta + dphi*dphi);
720 return dr;
721}
722
724 int selected = 3;
725 //are the two electrons oppositely charged?
726 const xAOD::TrackParticle* track_leading_emcluster = electronTrackMatch(tracks,em1);
727 const xAOD::TrackParticle* track_second_leading_emcluster = electronTrackMatch(tracks,em2);
728 if(!track_leading_emcluster || !track_second_leading_emcluster){
729 ATH_MSG_DEBUG("Don't have 2 matched tracks! Skipping charge check...");
730 --selected;
731 }
732 else if(track_leading_emcluster->charge() != track_second_leading_emcluster->charge())
733 --selected;
734 double invmass = InvMass(em1,em2); // given in GeV
735 if (em1->pt()/Gaudi::Units::GeV > 20. &&
736 em2->pt()/Gaudi::Units::GeV > 20.) --selected;
737 if (invmass > 70. &&
738 invmass < 110.) --selected;
739 return selected;
740}
741
742double IDPerfMonZee::signedDeltaPhi(double phi1, double phi2) const {
743 double phia=phi1;
744 if(phi1>Gaudi::Units::pi) phia=phi1-2.*Gaudi::Units::pi;
745 double phib=phi2;
746 if(phi2>Gaudi::Units::pi) phib=phi2-2.*Gaudi::Units::pi;
747 double dphi=phia-phib;
748 if(dphi>Gaudi::Units::pi) dphi-=2.*Gaudi::Units::pi;
749 if(dphi<-Gaudi::Units::pi) dphi+=2.*Gaudi::Units::pi;
750 return dphi;
751}
752
754 int region = -99;
755 if (std::abs(eta) <= 1.) region = barrel;
756 else if (eta > 1.) region = eca; // eca
757 else if (eta < -1.) region = ecc; // ecc
758 return region;
759
760}
761
762void IDPerfMonZee::FillHistosPerCluster(const xAOD::CaloCluster* cluster, const xAOD::TrackParticle* track, int region, float dEta, float dPhi) {
763 if (cluster == nullptr) return;
764 if (region<0){
765 throw(std::out_of_range("Region index has negative value in IDPerfMonZee::FillHistosPerCluster"));
766 }
767 // THERE IS A CLUSTER
768 if (region == incl) { // inclusive only
769 m_Zee_eta[region]->Fill(cluster->etaBE(2));
770 m_Zee_phi[region]->Fill(cluster->phi());
771 // match in eta and phi separately and make dEta and dPhi plots
772 if (dEta < 1.0e+20) {
773 m_Zee_deta[region]->Fill(dEta);
774 if (std::abs(dEta) < 0.05) { // calculate mean only for those in matching window
775 m_Zee_deta_vs_eta[region]->Fill(cluster->etaBE(2),dEta);
776 m_Zee_deta_vs_phi[region]->Fill(cluster->phi(),dEta);
777 m_Zee_deta_vs_eta_2d[region]->Fill(cluster->etaBE(2),dEta);
778 m_Zee_deta_vs_phi_2d[region]->Fill(cluster->phi(),dEta);
779 m_Zee_absdeta_vs_eta[region]->Fill(cluster->etaBE(2),std::abs(dEta));
780 m_Zee_absdeta_vs_phi[region]->Fill(cluster->phi(),std::abs(dEta));
781 }
782 }
783 if (dPhi < 1.0e+20) {
784 m_Zee_dphi[region]->Fill(dPhi);
785 if (std::abs(dPhi) < 0.1) { // calculate mean only for those in matching window
786 m_Zee_dphi_vs_eta[region]->Fill(cluster->etaBE(2),dPhi);
787 m_Zee_dphi_vs_phi[region]->Fill(cluster->phi(),dPhi);
788 m_Zee_dphi_vs_eta_2d[region]->Fill(cluster->etaBE(2),dPhi);
789 m_Zee_dphi_vs_phi_2d[region]->Fill(cluster->phi(),dPhi);
790 m_Zee_absdphi_vs_eta[region]->Fill(cluster->etaBE(2),std::abs(dPhi));
791 m_Zee_absdphi_vs_phi[region]->Fill(cluster->phi(),std::abs(dPhi));
792 }
793 }
794
795 } // end inclusive only
796 if (not track) return;
797 // TRACK-MATCHED
798 float eoverp = 0.;
799 float track_p = track->pt()*std::cosh(track->eta());
800 if (track_p != 0.) eoverp = cluster->e()/track_p;
801 m_Zee_Eop[region]->Fill(eoverp);
802 if (track->charge() == 1.) {
803 m_Zee_Eop_plus[region]->Fill(eoverp);
804 }
805 else if (track->charge() == -1.) {
806 m_Zee_Eop_minus[region]->Fill(eoverp);
807 }
808 if (region == incl) { // inclusive only
809 m_Zee_trackmatched_eta[region]->Fill(cluster->etaBE(2));
810 m_Zee_trackmatched_phi[region]->Fill(cluster->phi());
811 if (eoverp > m_eoverp_tight_min && eoverp < m_eoverp_tight_max) {
812 m_Zee_meanEop_vs_p[region]->Fill(track_p/Gaudi::Units::GeV,eoverp);
813 m_Zee_meanEop_vs_invp[region]->Fill(1./(track_p/Gaudi::Units::GeV),eoverp);
814 m_Zee_meanEop_vs_E[region]->Fill(cluster->e()/Gaudi::Units::GeV,eoverp);
815 m_Zee_meanEop_vs_chargedp[region]->Fill(double(track->charge())*track_p/Gaudi::Units::GeV,eoverp);
816 m_Zee_meanEop_vs_chargedE[region]->Fill(double(track->charge())*cluster->e()/Gaudi::Units::GeV,eoverp);
817 m_Zee_meanEop_vs_phi[region]->Fill(track->phi(),eoverp);
818 m_Zee_meanEop_vs_eta[region]->Fill(track->eta(),eoverp);
819 }
820 if (track->charge() == 1.) {
821 if (eoverp > m_eoverp_tight_min && eoverp < m_eoverp_tight_max) {
822 m_Zee_meanEop_vs_p_plus[region]->Fill(track_p/Gaudi::Units::GeV,eoverp);
823 m_Zee_meanEop_vs_invp_plus[region]->Fill(1./(track_p/Gaudi::Units::GeV),eoverp);
824 m_Zee_meanEop_vs_E_plus[region]->Fill(cluster->e()/Gaudi::Units::GeV,eoverp);
825 m_Zee_meanEop_vs_phi_plus[region]->Fill(track->phi(),eoverp);
826 m_Zee_meanEop_vs_eta_plus[region]->Fill(track->eta(),eoverp);
827 }
828 }else if (track->charge() == -1.) {
829 if (eoverp > m_eoverp_tight_min && eoverp < m_eoverp_tight_max) {
830 m_Zee_meanEop_vs_p_minus[region]->Fill(track_p/Gaudi::Units::GeV,eoverp);
831 m_Zee_meanEop_vs_invp_minus[region]->Fill(1./(track_p/Gaudi::Units::GeV),eoverp);
832 m_Zee_meanEop_vs_E_minus[region]->Fill(cluster->e()/Gaudi::Units::GeV,eoverp);
833 m_Zee_meanEop_vs_phi_minus[region]->Fill(track->phi(),eoverp);
834 m_Zee_meanEop_vs_eta_minus[region]->Fill(track->eta(),eoverp);
835 }
836 }
837 if (eoverp < m_eoverp_standard_max && eoverp > m_eoverp_standard_min) {
838 m_Zee_trackmatched_Eopmatched_eta[region]->Fill(cluster->etaBE(2));
839 m_Zee_trackmatched_Eopmatched_phi[region]->Fill(cluster->phi());
840 }
841 if (eoverp < m_eoverp_tight_max && eoverp > m_eoverp_tight_min) {
842 m_Zee_trackmatched_tightEopmatched_eta[region]->Fill(cluster->etaBE(2));
843 m_Zee_trackmatched_tightEopmatched_phi[region]->Fill(cluster->phi());
844 }
845 if (eoverp > m_eoverp_tight_min && eoverp < 1.) {
846 m_Zee_Eop_lt1_vs_eta[region]->Fill(cluster->etaBE(2));
847 m_Zee_Eop_lt1_vs_phi[region]->Fill(cluster->phi());
848 m_Zee_Eop_lt1_gt1[region]->Fill(0.75);
849 }
850 else if (eoverp > 1. && eoverp < m_eoverp_tight_max) {
851 m_Zee_Eop_gt1_vs_eta[region]->Fill(cluster->etaBE(2));
852 m_Zee_Eop_gt1_vs_phi[region]->Fill(cluster->phi());
853 m_Zee_Eop_lt1_gt1[region]->Fill(1.25);
854 }
855 if (eoverp > 0.5 && eoverp < 2.5) m_Zee_Eop_05_25[region]->Fill(0.5);
856 if (eoverp > 1.5 && eoverp < 2.5) m_Zee_Eop_15_25[region]->Fill(0.5);
857 } // end inclusive only
858
859}
Scalar eta() const
pseudorapidity method
#define ATH_MSG_INFO(x)
#define ATH_MSG_VERBOSE(x)
#define ATH_MSG_WARNING(x)
#define ATH_MSG_DEBUG(x)
static Double_t sc
This is an Identifier helper class for the Pixel subdetector.
This is an Identifier helper class for the SCT subdetector.
This is an Identifier helper class for the TRT subdetector.
Electron selector tool to select objects in Athena using an underlying pure ROOT tool.
Gaudi::Details::PropertyBase & declareProperty(Gaudi::Property< T, V, H > &t)
ServiceHandle< StoreGateSvc > & evtStore()
static Environment_t environment()
Returns the running environment of the monitoring application to help ManagedMonitorToolBase objects ...
std::vector< TH2F * > m_Zee_dphi_vs_eta_2d
double electronTrackMatchPhi(const xAOD::TrackParticleContainer *tracks, const xAOD::CaloCluster *cluster, double dPhi=0.1) const
double deltaR(const xAOD::CaloCluster *cluster, const xAOD::TrackParticle *track) const
double InvMass(const xAOD::CaloCluster *EM1, const xAOD::CaloCluster *EM2) const
const xAOD::CaloCluster * getLeadingEMcluster(const xAOD::CaloClusterContainer *clusters, const xAOD::CaloCluster *omitCluster=0) const
std::vector< TProfile * > m_Zee_meanEop_vs_invp_minus
std::vector< TProfile * > m_Zee_deta_vs_eta
std::vector< TProfile * > m_Zee_absdphi_vs_eta
std::vector< TProfile * > m_Zee_meanEop_vs_phi_plus
double signedDeltaPhi(double phi1, double phi2) const
double TransMass(const xAOD::CaloCluster *EM, const xAOD::MissingET *met) const
std::vector< TProfile * > m_Zee_Eopdiff_vs_p
std::vector< TH1F * > m_Zee_trackmatched_tightEopmatched_phi
double m_eoverp_tight_min
std::vector< TProfile * > m_Zee_meanEop_vs_eta
std::vector< TProfile * > m_Zee_meanEop_vs_p_minus
double electronTrackMatchEta(const xAOD::TrackParticleContainer *tracks, const xAOD::CaloCluster *cluster, double dEta=0.05) const
std::vector< TH1F * > m_Zee_Eopmatch_eff_vs_eta
std::vector< std::string > m_region_strings
std::vector< TProfile * > m_Zee_meanEop_vs_phi
std::vector< TProfile * > m_Zee_dphi_vs_eta
virtual StatusCode fillHistograms()
An inheriting class should either override this function or fillHists().
std::vector< TH1F * > m_Zee_frac_Eop_lt1_vs_phi
virtual StatusCode bookHistograms()
An inheriting class should either override this function or bookHists().
AsgElectronLikelihoodTool * m_LHTool2015
std::vector< TH1F * > m_Zee_frac_Eop_lt1_vs_eta
std::vector< TProfile * > m_Zee_meanEop_vs_p
void makeEffHisto(TH1F *h_num, TH1F *h_denom, TH1F *h_eff)
std::vector< TProfile * > m_Zee_meanEop_vs_chargedp
TH1F * m_Zee_trk_invmass_scaled
std::vector< TProfile * > m_Zee_Eopdiff_vs_E
std::vector< TH1F * > m_Zee_Eop_gt1_vs_eta
std::vector< TH1F * > m_Zee_trackmatch_eff_vs_phi
std::vector< TH2F * > m_Zee_deta_vs_eta_2d
std::vector< TProfile * > m_Zee_Eopdiff_vs_phi
std::vector< TH2F * > m_Zee_dphi_vs_phi_2d
std::string m_VxPrimContainerName
std::string m_triggerChainName
TH1F * m_Zee_trk_invmass_sel
std::vector< TH1F * > m_Zee_tightEopmatch_eff_vs_phi
std::vector< TProfile * > m_Zee_meanEop_vs_eta_plus
std::vector< TH1F * > m_Zee_Eopdiff
std::vector< TH1F * > m_Zee_trackmatched_Eopmatched_phi
void FillHistosPerCluster(const xAOD::CaloCluster *cluster, const xAOD::TrackParticle *track, int region, float dEta, float dPhi)
std::string m_metRefFinalName
std::vector< TProfile * > m_Zee_meanEop_vs_phi_minus
std::vector< TH1F * > m_Zee_trackmatched_Eopmatched_eta
std::vector< TH1F * > m_Zee_Eop
std::vector< TH1F * > m_Zee_trackmatched_eta
std::string m_tracksName
std::string m_metName
std::vector< TProfile * > m_Zee_deta_vs_phi
TH1F * m_Zee_Eopasym_perevent_central
std::vector< TH1F * > m_Zee_Eop_lt1_gt1
TH1F * m_Zee_Eopasym_perevent
const xAOD::TrackParticle * electronTrackMatch(const xAOD::TrackParticleContainer *tracks, const xAOD::CaloCluster *cluster, double dEta=0.05, double dPhi=0.1) const
std::vector< TProfile * > m_Zee_absdeta_vs_eta
std::vector< TH1F * > m_Zee_trackmatched_tightEopmatched_eta
std::vector< TH1F * > m_Zee_eta
std::vector< TProfile * > m_Zee_absdphi_vs_phi
TH1F * m_Nevents
std::vector< TH2F * > m_Zee_deta_vs_phi_2d
std::vector< TProfile * > m_Zee_meanEop_vs_p_plus
std::vector< TH1F * > m_Zee_Eop_lt1_vs_phi
std::vector< TProfile * > m_Zee_meanEop_vs_invp
std::vector< TH1F * > m_Zee_Eop_minus
std::vector< TH1F * > m_Zee_trackmatch_eff_vs_eta
std::vector< TProfile * > m_Zee_meanEop_vs_E_minus
std::string m_emclustersName
double m_eoverp_tight_max
std::vector< TProfile * > m_Zee_meanEop_vs_invp_plus
std::vector< TProfile * > m_Zee_dphi_vs_phi
virtual StatusCode initialize()
double m_eoverp_standard_max
std::string m_photonsName
std::vector< TH1F * > m_Zee_Eop_15_25
IDPerfMonZee(const std::string &type, const std::string &name, const IInterface *parent)
std::vector< TH1F * > m_Zee_Eop_plus
std::vector< TProfile * > m_Zee_meanEop_vs_E
std::vector< TH1F * > m_Zee_Eopmatch_eff_vs_phi
std::vector< TProfile * > m_Zee_meanEop_vs_eta_minus
std::vector< TH1F * > m_Zee_phi
std::string m_electronsName
std::vector< TProfile * > m_Zee_Eopdiff_vs_eta
std::vector< TProfile * > m_Zee_meanEop_vs_E_plus
std::vector< TH1F * > m_Zee_dphi
int isZee(const xAOD::CaloCluster *em1, const xAOD::CaloCluster *em2, const xAOD::TrackParticleContainer *tracks=0) const
TH1F * m_Zee_invmass_sel
std::vector< TH1F * > m_Zee_Eop_lt1_vs_eta
std::vector< TProfile * > m_Zee_absdeta_vs_phi
std::vector< TH1F * > m_Zee_tightEopmatch_eff_vs_eta
std::vector< TH1F * > m_Zee_Eop_05_25
std::vector< TH1F * > m_Zee_Eop_gt1_vs_phi
std::vector< TH1F * > m_Zee_frac_Eop_05_25_15_25
std::string m_electronIDLevel
TH1F * m_Zee_trk_invmass
virtual ~IDPerfMonZee()
double m_eoverp_standard_min
virtual StatusCode procHistograms()
An inheriting class should either override this function or finalHists().
TH1F * m_Zee_invmass
std::vector< TH1F * > m_Zee_trackmatched_phi
std::vector< TProfile * > m_Zee_Eopdiff_vs_invp
int etaRegion(double eta)
std::vector< TProfile * > m_Zee_meanEop_vs_chargedE
std::vector< TH1F * > m_Zee_deta
void RegisterHisto(MonGroup &mon, TH1 *histo, bool doSumw2=false)
A container of information describing a monitoring object.
ManagedMonitorToolBase(const std::string &type, const std::string &name, const IInterface *parent)
static const T * getContainer(CONTAINERS eContainer)
virtual double pt() const
The transverse momentum ( ) of the particle (negative for negative-energy clusters)
virtual double eta() const
The pseudorapidity ( ) of the particle.
virtual double e() const
The total energy of the particle.
virtual double phi() const
The azimuthal angle ( ) of the particle.
float etaBE(const unsigned layer) const
Get the eta in one layer of the EM Calo.
virtual double phi() const override final
The azimuthal angle ( ) of the particle (has range to .)
virtual double pt() const override final
The transverse momentum ( ) of the particle.
virtual double eta() const override final
The pseudorapidity ( ) of the particle.
float charge() const
Returns the charge.
virtual double e() const override final
The total energy of the particle.
Definition run.py:1
PhotonContainer_v1 PhotonContainer
Definition of the current "photon container version".
ElectronContainer_v1 ElectronContainer
Definition of the current "electron container version".
MissingET_v1 MissingET
Version control by type defintion.
CaloCluster_v1 CaloCluster
Define the latest version of the calorimeter cluster class.
TrackParticle_v1 TrackParticle
Reference the current persistent version:
TrackParticleContainer_v1 TrackParticleContainer
Definition of the current "TrackParticle container version".
CaloClusterContainer_v1 CaloClusterContainer
Define the latest version of the calorimeter cluster container.