ATLAS Offline Software
Loading...
Searching...
No Matches
EventReaderBaseAlg.cxx
Go to the documentation of this file.
1// Copyright (C) 2002-2025 CERN for the benefit of the ATLAS collaboration
2
4
6#include "CLHEP/Units/PhysicalConstants.h"
7#include "CLHEP/Units/SystemOfUnits.h"
8
9#include <TTree.h>
10
11
12using CLHEP::GeV;
13using CLHEP::pi;
14using CLHEP::twopi;
15
16EventReaderBaseAlg::EventReaderBaseAlg( const std::string& name, ISvcLocator* pSvcLocator ) :
17 AthAlgorithm(name, pSvcLocator) {}
18
20
22 return StatusCode::SUCCESS;
23}
25 return StatusCode::SUCCESS;
26}
28 return StatusCode::SUCCESS;
29}
30
32 // the E/p is calculated here based on Electron caloCluster and its associated trackParticle
33 // E_cluster/p_track
34 float eoverp = 0.;
35 float track_p = (electron->trackParticle())->pt()*std::cosh((electron->trackParticle())->eta());
36 if (track_p != 0.) eoverp = (electron->caloCluster())->e()/track_p;
37 else{
38 ATH_MSG_WARNING ("(eOverP) Track_p == 0");
39 return false;
40 }
41 if ((fabs(eoverp) < 0.7) || (fabs(eoverp) > 1.5) ){
42 ATH_MSG_DEBUG ("(eOverP) E/p is out of range! (eoverp="<<eoverp<<").");
43 return false;
44 }
45 else{
46 ATH_MSG_DEBUG ("(eOverP) Passed: E/p="<<eoverp);
47 return true;
48 }
49}
50
51// create a new electrons container with the electrons that fullfill the list of criteria below
53
54 const xAOD::TrackParticle *trackElectron = electron->trackParticle();
55 const xAOD::CaloCluster *elClus = electron->caloCluster();
56
57 if (!trackElectron) { //is there track?
58 ATH_MSG_DEBUG ("(trackSelectionElectrons) No track particle for Tag check.");
59 return false;
60 }
61 // caloCluster
62 if (!elClus){ //is there a calo cluster associated to this electron?
63 ATH_MSG_DEBUG ("(trackSelectionElectrons) No caloCluster associated for Tag check.");
64 return false;
65 }
66
67 // track_pt > 7 GeV
68 if (! ( (trackElectron->pt() * GeV ) > 7) ){
69 ATH_MSG_DEBUG ("(trackSelectionElectrons) Pt_Track of the electron is below 7 GeV. Electron rejected.");
70 return false;
71 }
72 // |eta| < 2.47
73 if (! (fabs(trackElectron->eta()) < 2.47 )){
74 ATH_MSG_DEBUG ("(trackSelectionElectrons) Electron track_eta is above 2.47. Electron rejected.");
75 return false;
76 }
77
78 // check for primary vertex in the event
79 // *************** Primary vertex check ***************
80 //loop over vertices and look for good primary vertex
81 bool isPrimVtx = false;
82 bool passDeltaZ0sin = false;
83 // for (xAOD::VertexContainer::const_iterator vxIter = primVertexCnt->begin(); vxIter != primVertexCnt->end(); ++vxIter) {
84 for ( const xAOD::Vertex *vertex : *primVertexCnt){
85 // Select good primary vertex
86 float delta_z0 = fabs(trackElectron->z0() + trackElectron->vz() - vertex->z()); //where trk.vz() represents the point of reference for the z0 calculation (in this case, the beamspot position along the z axis).
87 float delta_z0_sin = delta_z0 * sin(trackElectron->theta()); //where sin(trk.theta()) parameterises the uncertainty of the z0 measurement.
88
89 if ((vertex->vertexType() == xAOD::VxType::PriVtx) && ( delta_z0_sin < m_z0Tag)){
90 isPrimVtx = true; //check for primary vertex in each vertex of the event.
91 passDeltaZ0sin = true; // and check if the longitudinal impact parameter difference for electron-to-vertex association.
92
93 ATH_MSG_DEBUG ("(trackSelectionElectrons) delta_z0_sin < 0.5 mm ("<< delta_z0_sin << ")");
94 ATH_MSG_DEBUG ("(trackSelectionElectrons) There is a primary vertex in the event.");
95 break;
96 }
97 }
98
99 // delta_z0_sin <= 0.5 mm
100 if (!( isPrimVtx && passDeltaZ0sin)){
101 ATH_MSG_DEBUG ("(trackSelectionElectrons) For this Tag, delta_z0_sin > 0.5mm, and there is NO primary vertices in the event. Rejecting electron.");
102 return false;
103 }
104
105 // d0_sig - transverse impact parameter significance
106 double d0sig = fabs (xAOD::TrackingHelpers::d0significance( trackElectron, ei->beamPosSigmaX(), ei->beamPosSigmaY(), ei->beamPosSigmaXY() ));
107 if ( !( d0sig < m_d0TagSig)){
108 ATH_MSG_DEBUG("(trackSelectionElectrons) Electron rejected. |d0sig| > " << m_d0TagSig << " ("<< d0sig <<")");
109 return false;
110 }
111
112 ATH_MSG_DEBUG("(trackSelectionElectrons) Electron accepted.");
113 return true; // if true, add electron to electronSelectionCnt container.
114}
115
117 // |eta| < 1.475
118 if ( fabs(el->eta()) > 1.475 ){ // EM Barrel
119 ATH_MSG_DEBUG ("(isTagElectron) Electron |eta| > 1.475 (" << fabs(el->eta()) << ").");
120 return false;
121 }
122
123 // LAr crack region
124 // ATH_MSG_DEBUG ("(isTagElectron) Selecting Tag Electron Eta outside crack region...");
125 float absEta = fabs(el->caloCluster()->etaBE(2));
126 if ( !isEtaOutsideLArCrack(absEta) ){
127 ATH_MSG_DEBUG ("(isTagElectron) Selecting Tag Electron Eta is inside crack region.");
128 return false;
129 }
130
131 // Tag electron PID verify if is tight
132 bool isGood;
133 if (! el->passSelection(isGood, m_offTagTightness) ) {
134 ATH_MSG_DEBUG("(isTagElectron) Misconfiguration: " << m_offTagTightness << " is not a valid working point for electrons");
135 return false; // no point in continuing
136 }
137 ATH_MSG_DEBUG("(isTagElectron) Trigger " << m_offTagTightness << " is OK");
138
139 // Et > 25 (or 15) GeV && Et < 180
140 float elTagEt = el->e()/(cosh(el->trackParticle()->eta()));
141 float elTagPt = el->pt();
142 if ( elTagPt < (m_etMinTag * GeV) ){
143 ATH_MSG_DEBUG ("(isTagElectron) Tag Electron Et/pT: "<< elTagEt << "/"<< elTagPt << ", threshold =" << m_etMinTag * GeV << ".");
144 return false;
145 }
146
147 // electron object quality
148 ATH_MSG_DEBUG ("(isTagElectron) Checking electron object quality...");
149 if ( !el->isGoodOQ(xAOD::EgammaParameters::BADCLUSELECTRON)){
150 ATH_MSG_DEBUG ("(isTagElectron) \tTag Electron is a BADCLUSELECTRON.");
151 return false;
152 }
153
154 return true;
155}
156
158 // |eta| < 1.475
159 if ( fabs(el->eta()) > 1.475 ){ // EM Barrel
160 ATH_MSG_DEBUG ("(isGoodProbeElectron) Electron |eta| > 1.475 (" << fabs(el->eta()) << ").");
161 return false;
162 }
163
164 // electron object quality
165 ATH_MSG_DEBUG (" (isGoodProbeElectron) Checking Probe electron object quality...");
166 if ( !el->isGoodOQ(xAOD::EgammaParameters::BADCLUSELECTRON)){
167 ATH_MSG_DEBUG (" (isGoodProbeElectron) \tProbe Electron is a BADCLUSELECTRON.");
168 return false;
169 }
170
171 // Et > 15 GeV
172 float electronPt = el->pt();
173 if (electronPt * GeV < m_etMinProbe ){
174 ATH_MSG_DEBUG ("(isGoodProbeElectron) Electron Et/pT < " << m_etMinProbe << " GeV (pT="<< electronPt * GeV<<")");
175 return false;
176 }
177
178 // is outside the crack
179 float absEta = fabs(el->caloCluster()->etaBE(2));
180 if ( !isEtaOutsideLArCrack(absEta) ){
181 ATH_MSG_DEBUG ("(isGoodProbeElectron) Electron Eta inside LAr crack region...");
182 return false;
183 }
184
185 // loose ID Cut
186 bool isGood;
187 if (! el->passSelection(isGood, m_offProbeTightness)){
188 ATH_MSG_DEBUG("(isGoodProbeElectron) Misconfiguration: " << m_offProbeTightness << " is not a valid working point for electrons");
189 return false;
190 }
191
192 ATH_MSG_DEBUG ("(isGoodProbeElectron) Electron is a good probe!");
193 return true;
194}
195
197 if ( (absEta > 1.37 && absEta < 1.52) || (absEta > 2.47) ){
198 return false;
199 }
200 else{
201 return true;
202 }
203}
204
206 if (cell->caloDDE()->is_tile()) return 0; //belongs to Tile
207 else if (cell->caloDDE()->is_lar_em_barrel()) return 1; //belongs to EM barrel
208 else if (cell->caloDDE()->is_lar_em_endcap_inner()) return 2; //belongs to the inner wheel of EM end cap
209 else if (cell->caloDDE()->is_lar_em_endcap_outer()) return 3; //belongs to the outer wheel of EM end cap
210 else if (cell->caloDDE()->is_lar_hec()) return 4; //belongs to HEC
211 else if (cell->caloDDE()->is_lar_fcal()) return 5; //belongs to FCAL
212
213 ATH_MSG_ERROR (" #### Region not found for cell offline ID "<< cell->ID() <<" ! Returning -999.");
214 return -999; //region not found
215}
216
218 // Verify the phi value, if its in -pi,pi interval, then shifts 2pi in the correct direction.
219 if (phi < -1*pi) return (phi + 2*pi);
220 if (phi > 1*pi) return (phi - 2*pi);
221 return phi;
222}
223
224double EventReaderBaseAlg::deltaPhi(double phi1, double phi2){
225 // Fix phi value for delta_phi calculation, to -pi,+pi interval.
226 double deltaPhi = fixPhi(phi1) - fixPhi(phi2);
227 return fixPhi(deltaPhi);
228}
229
230double EventReaderBaseAlg::deltaR( double deta, double dphi){
231 return sqrt( deta*deta + fixPhi(dphi)*fixPhi(dphi) );
232}
233
234
235
236
238 // ## BCID/Luminosity vector
239 tree->Branch ("lb_lumiblock",&m_lb_lumiblock);
240 if (!m_isMC){
241 tree->Branch ("lb_bcidLuminosity",&m_lb_bcidLuminosity);
242 }
243}
244
246 m_lb_lumiblock->clear();
247 if (!m_isMC){
248 m_lb_bcidLuminosity->clear();
249 }
250}
251
252
254 // ## Event info
255 tree->Branch ("event_RunNumber", &m_e_runNumber);
256 tree->Branch ("event_EventNumber", &m_e_eventNumber);
257 tree->Branch ("event_BCID", &m_e_bcid);
258 tree->Branch ("event_Lumiblock",&m_e_lumiBlock);
259 tree->Branch ("event_avg_mu_inTimePU", &m_e_inTimePileup);
260 tree->Branch ("event_avg_mu_OOTimePU", &m_e_outOfTimePileUp);
261 // #############
262
263 // ## Cluster
264 tree->Branch ("cluster_index",&m_c_clusterIndex);
265 tree->Branch ("c_electronIndex_clusterLvl",&m_c_electronIndex_clusterLvl);
266 tree->Branch ("cluster_et",&m_c_clusterEnergy);
267 tree->Branch ("cluster_time",&m_c_clusterTime);
268 tree->Branch ("cluster_pt",&m_c_clusterPt);
269 tree->Branch ("cluster_eta",&m_c_clusterEta);
270 tree->Branch ("cluster_phi",&m_c_clusterPhi);
271 // Cluster cell
272 tree->Branch ("cluster_index_cellLvl",&m_c_clusterIndex_cellLvl);
273 tree->Branch ("cluster_cell_index",&m_c_clusterCellIndex);
274 tree->Branch ("cluster_cell_caloGain",&m_c_cellGain);
275 tree->Branch ("cluster_cell_layer",&m_c_cellLayer);
276 tree->Branch ("cluster_cell_region",&m_c_cellRegion);
277 tree->Branch ("cluster_cell_energy",&m_c_cellEnergy);
278 tree->Branch ("cluster_cell_time",&m_c_cellTime);
279 tree->Branch ("cluster_cell_eta",&m_c_cellEta);
280 tree->Branch ("cluster_cell_phi",&m_c_cellPhi);
281 tree->Branch ("cluster_cell_deta",&m_c_cellDEta);
282 tree->Branch ("cluster_cell_dphi",&m_c_cellDPhi);
283 tree->Branch ("cluster_cellsDist_dphi",&m_c_cellToClusterDPhi);
284 tree->Branch ("cluster_cellsDist_deta",&m_c_cellToClusterDEta);
285 // Cluster channel (digits and cell ch)
286 tree->Branch ("cluster_index_chLvl",&m_c_clusterIndex_chLvl);
287 tree->Branch ("cluster_channel_index",&m_c_clusterChannelIndex);
288 tree->Branch ("cluster_channel_digits",&m_c_channelDigits);
289 tree->Branch ("cluster_channel_energy",&m_c_channelEnergy);
290 tree->Branch ("cluster_channel_time",&m_c_channelTime);
291 tree->Branch ("cluster_channel_layer",&m_c_channelLayer);
292 if (!m_noBadCells) tree->Branch ("cluster_channel_bad",&m_c_channelBad);
293 tree->Branch ("cluster_channel_chInfo", &m_c_channelChInfo);
294 tree->Branch ("cluster_channel_hash",&m_c_channelHashMap);
295 tree->Branch ("cluster_channel_id",&m_c_channelChannelIdMap);
297 tree->Branch ("cluster_channel_effSigma",&m_c_channelEffectiveSigma);
298 tree->Branch ("cluster_channel_noise",&m_c_channelNoise);
299 tree->Branch ("cluster_channel_DSPThreshold",&m_c_channelDSPThreshold);
300 tree->Branch ("cluster_channel_OFCTimeOffset",&m_c_channelOFCTimeOffset);
301 tree->Branch ("cluster_channel_ADC2MeV0",&m_c_channelADC2MEV0);
302 tree->Branch ("cluster_channel_ADC2MeV1",&m_c_channelADC2MEV1);
303 tree->Branch ("cluster_channel_pedestal",&m_c_channelPed);
304 tree->Branch ("cluster_channel_OFCa",&m_c_channelOFCa);
305 tree->Branch ("cluster_channel_OFCb",&m_c_channelOFCb);
306 tree->Branch ("cluster_channel_MinBiasAvg",&m_c_channelMinBiasAvg);
307
308 if (!m_isMC){
309 tree->Branch ("cluster_channel_OfflineEnergyRescaler",&m_c_channelOfflEneRescaler);
310 tree->Branch ("cluster_channel_OfflineHVScale",&m_c_channelOfflHVScale);
311 tree->Branch ("cluster_channel_shape",&m_c_channelShape);
312 tree->Branch ("cluster_channel_shapeDer",&m_c_channelShapeDer);
313 }
314 }
315
316 // Cluster raw channel
317 tree->Branch ("cluster_index_rawChLvl",&m_c_clusterIndex_rawChLvl);
318 tree->Branch ("cluster_rawChannel_index",&m_c_clusterRawChannelIndex);
319 tree->Branch ("cluster_rawChannel_id",&m_c_rawChannelIdMap);
320 tree->Branch ("cluster_rawChannel_amplitude",&m_c_rawChannelAmplitude);
321 tree->Branch ("cluster_rawChannel_time",&m_c_rawChannelTime);
322 tree->Branch ("cluster_rawChannel_layer",&m_c_rawChannelLayer);
323 tree->Branch ("cluster_rawChannel_Ped",&m_c_rawChannelPed);
324 tree->Branch ("cluster_rawChannel_Prov",&m_c_rawChannelProv);
325 tree->Branch ("cluster_rawChannel_qual",&m_c_rawChannelQuality);
326 tree->Branch ("cluster_rawChannel_chInfo",&m_c_rawChannelChInfo); // tree->Branch ("cluster_cell_caloGain",&c_cellGain); //modify
327 if (!m_isMC){
328 tree->Branch ("cluster_rawChannel_DSPThreshold",&m_c_rawChannelDSPThreshold);
329 }
330
331 // ## Cluster EMB2 7_11
333 tree->Branch ("cluster711_index",&m_c711_clusterIndex);
334 tree->Branch ("c711_electronIndex_clusterLvl",&m_c711_electronIndex_clusterLvl);
335 tree->Branch ("cluster711_et",&m_c711_clusterEnergy);
336 tree->Branch ("cluster711_pt",&m_c711_clusterPt);
337 tree->Branch ("cluster711_time",&m_c711_clusterTime);
338 tree->Branch ("cluster711_eta",&m_c711_clusterEta);
339 tree->Branch ("cluster711_phi",&m_c711_clusterPhi);
340 // Cluster cell
341 tree->Branch ("cluster711_index_cellLvl",&m_c711_clusterIndex_cellLvl);
342 tree->Branch ("cluster711_cell_index",&m_c711_clusterCellIndex);
343 tree->Branch ("cluster711_cell_caloGain",&m_c711_cellGain);
344 tree->Branch ("cluster711_cell_layer",&m_c711_cellLayer);
345 tree->Branch ("cluster711_cell_region",&m_c711_cellRegion);
346 tree->Branch ("cluster711_cell_energy",&m_c711_cellEnergy);
347 tree->Branch ("cluster711_cell_time",&m_c711_cellTime);
348 tree->Branch ("cluster711_cell_eta",&m_c711_cellEta);
349 tree->Branch ("cluster711_cell_phi",&m_c711_cellPhi);
350 tree->Branch ("cluster711_cell_deta",&m_c711_cellDEta);
351 tree->Branch ("cluster711_cell_dphi",&m_c711_cellDPhi);
352 tree->Branch ("cluster711_cellsDist_dphi",&m_c711_cellToClusterDPhi);
353 tree->Branch ("cluster711_cellsDist_deta",&m_c711_cellToClusterDEta);
354 // Cluster channel (digits and cell ch)
355 tree->Branch ("cluster711_index_chLvl",&m_c711_clusterIndex_chLvl);
356 tree->Branch ("cluster711_channel_index",&m_c711_clusterChannelIndex);
357 tree->Branch ("cluster711_channel_digits",&m_c711_channelDigits);
358 tree->Branch ("cluster711_channel_energy",&m_c711_channelEnergy);
359 tree->Branch ("cluster711_channel_time",&m_c711_channelTime);
360 tree->Branch ("cluster711_channel_layer", &m_c711_channelLayer);
361 if (!m_noBadCells) tree->Branch ("cluster711_channel_bad",&m_c711_channelBad);
362 tree->Branch ("cluster711_channel_chInfo", &m_c711_channelChInfo);
363 tree->Branch ("cluster711_channel_hash",&m_c711_channelHashMap);
364 tree->Branch ("cluster711_channel_id",&m_c711_channelChannelIdMap);
366 tree->Branch ("cluster711_channel_effSigma",&m_c711_channelEffectiveSigma);
367 tree->Branch ("cluster711_channel_noise",&m_c711_channelNoise);
368 tree->Branch ("cluster711_channel_DSPThreshold",&m_c711_channelDSPThreshold);
369 tree->Branch ("cluster711_channel_OFCTimeOffset",&m_c711_channelOFCTimeOffset);
370 tree->Branch ("cluster711_channel_ADC2MeV0",&m_c711_channelADC2MEV0);
371 tree->Branch ("cluster711_channel_ADC2MeV1",&m_c711_channelADC2MEV1);
372 tree->Branch ("cluster711_channel_pedestal",&m_c711_channelPed);
373 tree->Branch ("cluster711_channel_OFCa",&m_c711_channelOFCa);
374 tree->Branch ("cluster711_channel_OFCb",&m_c711_channelOFCb);
375 tree->Branch ("cluster711_channel_MinBiasAvg",&m_c711_channelMinBiasAvg);
376
377 if (!m_isMC){
378 tree->Branch ("cluster711_channel_OfflineEnergyRescaler",&m_c711_channelOfflEneRescaler);
379 tree->Branch ("cluster711_channel_OfflineHVScale",&m_c711_channelOfflHVScale);
380 tree->Branch ("cluster711_channel_shape",&m_c711_channelShape);
381 tree->Branch ("cluster711_channel_shapeDer",&m_c711_channelShapeDer);
382 }
383 }
384 // Cluster raw channel
385 tree->Branch ("cluster711_index_rawChLvl",&m_c711_clusterIndex_rawChLvl);
386 tree->Branch ("cluster711_rawChannel_index",&m_c711_clusterRawChannelIndex);
387 tree->Branch ("cluster711_rawChannel_id",&m_c711_rawChannelIdMap);
388 tree->Branch ("cluster711_rawChannel_amplitude",&m_c711_rawChannelAmplitude);
389 tree->Branch ("cluster711_rawChannel_time",&m_c711_rawChannelTime);
390 tree->Branch ("cluster711_rawChannel_layer",&m_c711_rawChannelLayer);
391 tree->Branch ("cluster711_rawChannel_Ped",&m_c711_rawChannelPed);
392 tree->Branch ("cluster711_rawChannel_Prov",&m_c711_rawChannelProv);
393 tree->Branch ("cluster711_rawChannel_qual",&m_c711_rawChannelQuality);
394 tree->Branch ("cluster711_rawChannel_chInfo",&m_c711_rawChannelChInfo);
395 if (!m_isMC){
396 tree->Branch ("cluster711_rawChannel_DSPThreshold",&m_c711_rawChannelDSPThreshold);
397 }
398 }
399 // #############
400
401 // ## Particle Truth ##
402 if (m_isMC){
404 tree->Branch("hits_sampling", &m_hits_sampling);
405 tree->Branch("hits_clusterIndex_chLvl", &m_hits_clusterIndex_chLvl);
406 tree->Branch("hits_clusterChannelIndex", &m_hits_clusterChannelIndex);
407 tree->Branch("hits_hash", &m_hits_hash);
408 tree->Branch("hits_energy", &m_hits_energy);
409 tree->Branch("hits_time", &m_hits_time);
410 tree->Branch("hits_sampFrac", &m_hits_sampFrac);
411 tree->Branch("hits_energyConv", &m_hits_energyConv);
412 tree->Branch("hits_cellEta", &m_hits_cellEta);
413 tree->Branch("hits_cellPhi", &m_hits_cellPhi);
414 }
415
417 tree->Branch("mc_part_energy",&m_mc_part_energy);
418 tree->Branch("mc_part_pt",&m_mc_part_pt);
419 tree->Branch("mc_part_m",&m_mc_part_m);
420 tree->Branch("mc_part_eta",&m_mc_part_eta);
421 tree->Branch("mc_part_phi",&m_mc_part_phi);
422 tree->Branch("mc_part_pdgId",&m_mc_part_pdgId);
423 tree->Branch("mc_part_status", &m_mc_part_status);
424 tree->Branch("mc_part_barcode", &m_mc_part_uniqueID); // TODO Rename variable name to be consistent?
425 }
426 // ## Vertex Truth ##
428 tree->Branch("mc_vert_x", &m_mc_vert_x);
429 tree->Branch("mc_vert_y", &m_mc_vert_y);
430 tree->Branch("mc_vert_z", &m_mc_vert_z);
431 tree->Branch("mc_vert_time", &m_mc_vert_time);
432 tree->Branch("mc_vert_perp", &m_mc_vert_perp);
433 tree->Branch("mc_vert_eta", &m_mc_vert_eta);
434 tree->Branch("mc_vert_phi", &m_mc_vert_phi);
435 tree->Branch("mc_vert_barcode", &m_mc_vert_uniqueID); // TODO Rename variable name to be consistent?
436 tree->Branch("mc_vert_status", &m_mc_vert_status);
437 }
438 }
439
440 // ## Photons ##
441 if (m_doPhotonDump){
442 tree->Branch("ph_energy",&m_ph_energy);
443 tree->Branch("ph_pt",&m_ph_pt);
444 tree->Branch("ph_eta",&m_ph_eta);
445 tree->Branch("ph_phi",&m_ph_phi);
446 tree->Branch("ph_m",&m_ph_m);
447 }
448 // ## Primary Vertex
449 tree->Branch("vtx_x",&m_vtx_x);
450 tree->Branch("vtx_y",&m_vtx_y);
451 tree->Branch("vtx_z",&m_vtx_z);
452 tree->Branch("vtx_deltaZ0",&m_vtx_deltaZ0);
453 tree->Branch("vtx_delta_z0_sin",&m_vtx_delta_z0_sin);
454 tree->Branch("vtx_d0sig",&m_vtx_d0sig);
455
456 // ## Electrons ##
457 tree->Branch("el_index",&m_el_index);
458 tree->Branch("el_Pt",&m_el_Pt);
459 tree->Branch("el_et",&m_el_et);
460 tree->Branch("el_Eta",&m_el_Eta);
461 tree->Branch("el_Phi",&m_el_Phi);
462 tree->Branch("el_m",&m_el_m);
463 tree->Branch("el_eoverp",&m_el_eoverp);
464 tree->Branch("el_f1",&m_el_f1);
465 tree->Branch("el_f3",&m_el_f3);
466 tree->Branch("el_eratio",&m_el_eratio);
467 tree->Branch("el_weta1",&m_el_weta1);
468 tree->Branch("el_weta2",&m_el_weta2);
469 tree->Branch("el_fracs1",&m_el_fracs1);
470 tree->Branch("el_wtots1",&m_el_wtots1);
471 tree->Branch("el_e277",&m_el_e277);
472 tree->Branch("el_reta",&m_el_reta);
473 tree->Branch("el_rphi",&m_el_rphi);
474 tree->Branch("el_deltae",&m_el_deltae);
475 tree->Branch("el_rhad",&m_el_rhad);
476 tree->Branch("el_rhad1",&m_el_rhad1);
477
478 // ## Tag and Probe ##
479 // zee
481 tree->Branch("zee_M", &m_zee_M);
482 tree->Branch("zee_E", &m_zee_E);
483 tree->Branch("zee_pt", &m_zee_pt);
484 tree->Branch("zee_px", &m_zee_px);
485 tree->Branch("zee_py", &m_zee_py);
486 tree->Branch("zee_pz", &m_zee_pz);
487 tree->Branch("zee_T", &m_zee_T);
488 tree->Branch("zee_deltaR", &m_zee_deltaR);
489 }
490}
491
493 // ## Event info
494 m_e_runNumber = 9999;
495 m_e_eventNumber = 9999;
496 m_e_bcid = 9999;
497 m_e_lumiBlock = 999;
498 m_e_inTimePileup = -999;
499 m_e_outOfTimePileUp = -999;
500 // ############
501
502 ATH_MSG_DEBUG("Clear Clusters..");
503 // ## Cluster (TOPOCLUSTER or SUPERCLUSTER)
505 m_c_clusterIndex->clear();
507 m_c_clusterEnergy->clear();
508 m_c_clusterTime->clear();
509 m_c_clusterPt->clear();
510 m_c_clusterEta->clear();
511 m_c_clusterPhi->clear();
512 // Cluster cell
513 ATH_MSG_DEBUG("Clear Clusters cell..");
516 m_c_clusterCellIndex->clear();
517 m_c_cellGain->clear();
518 m_c_cellLayer->clear();
519 m_c_cellRegion->clear();
520 m_c_cellEnergy->clear();
521 m_c_cellTime->clear();
522 m_c_cellEta->clear();
523 m_c_cellPhi->clear();
524 m_c_cellDEta->clear();
525 m_c_cellDPhi->clear();
526 m_c_cellToClusterDPhi->clear();
527 m_c_cellToClusterDEta->clear();
528 // Cluster channel
529 ATH_MSG_DEBUG("Clear Clusters channel..");
530 m_c_clusterIndex_chLvl->clear();
532 m_c_channelHashMap->clear(); //
534 m_c_channelDigits->clear();
535 m_c_channelEnergy->clear();
536 m_c_channelTime->clear();
537 m_c_channelLayer->clear();
538 if (!m_noBadCells) m_c_channelBad->clear();
539 m_c_channelChInfo->clear();
541 ATH_MSG_DEBUG("Clear calib. constants..");
543 m_c_channelNoise->clear();
546 m_c_channelADC2MEV0->clear();
547 m_c_channelADC2MEV1->clear();
548 m_c_channelPed->clear();
549 m_c_channelOFCa->clear();
550 m_c_channelOFCb->clear();
551 m_c_channelMinBiasAvg->clear();
552 if (!m_isMC){
554 m_c_channelOfflHVScale->clear();
555 m_c_channelShapeDer->clear();
556 m_c_channelShape->clear();
557 }
558 }
559 // Cluster raw channel
560 ATH_MSG_DEBUG("Clear Clusters rawch..");
561 m_c_rawChannelIdMap->clear();
562 m_c_rawChannelChInfo->clear();
564 m_c_rawChannelTime->clear();
565 m_c_rawChannelLayer->clear();
566 m_c_rawChannelPed->clear();// raw channel estimated pedestal
567 m_c_rawChannelProv->clear();// raw channel LAr provenance (tile masked)
568 m_c_rawChannelQuality->clear();
571 if (!m_isMC){
573 }
574 // ############
575
576 // ## Cluster EMB2_711
579 m_c711_clusterIndex->clear();
581 m_c711_clusterEnergy->clear();
582 m_c711_clusterPt->clear();
583 m_c711_clusterTime->clear();
584 m_c711_clusterEta->clear();
585 m_c711_clusterPhi->clear();
586 // Cluster cell
587 ATH_MSG_DEBUG("Clear Clusters 7x11 cell..");
591 m_c711_cellGain->clear();
592 m_c711_cellLayer->clear();
593 m_c711_cellRegion->clear();
594 m_c711_cellEnergy->clear();
595 m_c711_cellTime->clear();
596 m_c711_cellEta->clear();
597 m_c711_cellPhi->clear();
598 m_c711_cellDEta->clear();
599 m_c711_cellDPhi->clear();
601 m_c711_cellToClusterDEta->clear();
602 // Cluster channel
603 ATH_MSG_DEBUG("Clear Clusters 7x11 channel..");
606 m_c711_channelHashMap->clear(); //
608 m_c711_channelDigits->clear();
609 m_c711_channelEnergy->clear();
610 m_c711_channelTime->clear();
611 m_c711_channelLayer->clear();
612 if (!m_noBadCells) m_c711_channelBad->clear();
613 m_c711_channelChInfo->clear();
616 m_c711_channelNoise->clear();
619 m_c711_channelADC2MEV0->clear();
620 m_c711_channelADC2MEV1->clear();
621 m_c711_channelPed->clear();
622 m_c711_channelOFCa->clear();
623 m_c711_channelOFCb->clear();
624 m_c711_channelMinBiasAvg->clear();
625 if (!m_isMC){
628 m_c711_channelShapeDer->clear();
629 m_c711_channelShape->clear();
630 }
631 }
632 // Cluster raw channel
633 ATH_MSG_DEBUG("Clear Clusters 7x11 rawch..");
634 m_c711_rawChannelIdMap->clear();
637 m_c711_rawChannelTime->clear();
638 m_c711_rawChannelLayer->clear();
639 m_c711_rawChannelPed->clear();// raw channel estimated pedestal
640 m_c711_rawChannelProv->clear();// raw channel LAr provenance (tile masked)
644 if (!m_isMC){
646 }
647}
648
649 // ## Particle Truth ##
650 if (m_isMC){
652 m_hits_sampling->clear();
655 m_hits_hash->clear();
656 m_hits_energy->clear();
657 m_hits_time->clear();
658 m_hits_sampFrac->clear();
659 m_hits_energyConv->clear();
660 m_hits_cellEta->clear();
661 m_hits_cellPhi->clear();
662 }
663
665 ATH_MSG_DEBUG("particle truth..");
666 m_mc_part_energy->clear();
667 m_mc_part_pt->clear();
668 m_mc_part_m->clear();
669 m_mc_part_eta->clear();
670 m_mc_part_phi->clear();
671 m_mc_part_pdgId->clear();
672 m_mc_part_status->clear();
673 m_mc_part_uniqueID->clear();
674 }
675 // ## Vertex Truth ##
677 m_mc_vert_x->clear();
678 m_mc_vert_y->clear();
679 m_mc_vert_z->clear();
680 m_mc_vert_time->clear();
681 m_mc_vert_perp->clear();
682 m_mc_vert_eta->clear();
683 m_mc_vert_phi->clear();
684 m_mc_vert_uniqueID->clear();
685 m_mc_vert_status->clear();
686 }
687 }
688 // ## Photons ##
689 if (m_doPhotonDump){
690 ATH_MSG_DEBUG("Clear Photons");
691 m_ph_energy->clear();
692 m_ph_eta->clear();
693 m_ph_phi->clear();
694 m_ph_pt->clear();
695 m_ph_m->clear();
696 }
697
698 ATH_MSG_DEBUG("Clear: Vertexes");
699 m_vtx_x->clear();
700 m_vtx_y->clear();
701 m_vtx_z->clear();
702 m_vtx_deltaZ0->clear();
703 m_vtx_delta_z0_sin->clear();
704 m_vtx_d0sig->clear();
705
706 // ## Electrons ##
707 ATH_MSG_DEBUG("Clear: Electrons");
708 m_el_index->clear();
709 m_el_Pt->clear();
710 m_el_et->clear();
711 m_el_Eta->clear();
712 m_el_Phi->clear();
713 m_el_m->clear();
714 m_el_eoverp->clear();
715
716 // offline shower shapes
717 m_el_f1->clear();
718 m_el_f3->clear();
719 m_el_eratio->clear();
720 m_el_weta1->clear();
721 m_el_weta2->clear();
722 m_el_fracs1->clear();
723 m_el_wtots1->clear();
724 m_el_e277->clear();
725 m_el_reta->clear();
726 m_el_rphi->clear();
727 m_el_deltae->clear();
728 m_el_rhad->clear();
729 m_el_rhad1->clear();
730
731 // ## Tag and Probe ##
732 //zee
734 ATH_MSG_DEBUG("Clear: T&P");
735 m_zee_M->clear();
736 m_zee_E->clear();
737 m_zee_pt->clear();
738 m_zee_px->clear();
739 m_zee_py->clear();
740 m_zee_pz->clear();
741 m_zee_T->clear();
742 m_zee_deltaR->clear();
743 }
744}
Scalar phi() const
phi method
#define ATH_MSG_ERROR(x)
#define ATH_MSG_WARNING(x)
#define ATH_MSG_DEBUG(x)
#define pi
AthAlgorithm(const std::string &name, ISvcLocator *pSvcLocator)
Constructor with parameters:
Data object for each calorimeter readout cell.
Definition CaloCell.h:57
std::vector< float > * m_vtx_x
Gaudi::Property< bool > m_doTruthEventDump
std::vector< std::vector< double > > * m_c_channelShape
std::vector< float > * m_el_deltae
std::vector< float > * m_c_channelPed
Gaudi::Property< bool > m_doAssocTopoCluster711Dump
std::vector< int > * m_c_clusterIndex_rawChLvl
Gaudi::Property< float > m_d0TagSig
std::vector< double > * m_c_clusterEnergy
unsigned long long m_e_eventNumber
std::vector< double > * m_c711_cellEnergy
std::vector< float > * m_c_rawChannelQuality
std::vector< int > * m_c711_cellRegion
std::vector< float > * m_el_fracs1
std::vector< double > * m_c711_channelTime
std::vector< int > * m_c_cellRegion
std::vector< unsigned int > * m_c_channelChannelIdMap
std::vector< float > * m_ph_energy
std::vector< double > * m_zee_py
std::vector< float > * m_el_wtots1
std::vector< double > * m_hits_cellPhi
std::vector< int > * m_c711_cellLayer
virtual StatusCode initialize() override
std::vector< double > * m_c711_cellToClusterDEta
std::vector< float > * m_el_Phi
std::vector< std::vector< double > > * m_c_channelShapeDer
Gaudi::Property< bool > m_doLArEMBHitsDump
std::vector< int > * m_c_clusterChannelIndex
Gaudi::Property< float > m_z0Tag
void bookDatabaseBranches(TTree *tree)
std::vector< double > * m_zee_px
std::vector< float > * m_ph_eta
std::vector< double > * m_zee_deltaR
std::vector< int > * m_c711_clusterCellIndex
std::vector< std::vector< float > > * m_lb_bcidLuminosity
std::vector< bool > * m_c_channelBad
std::vector< int > * m_c711_rawChannelLayer
std::vector< float > * m_c711_channelOfflHVScale
std::vector< double > * m_hits_energyConv
std::vector< double > * m_c_cellTime
std::vector< float > * m_c711_rawChannelAmplitude
std::vector< int > * m_c711_clusterIndex
std::vector< float > * m_c_rawChannelProv
std::vector< float > * m_el_e277
std::vector< int > * m_c711_cellGain
std::vector< float > * m_el_rhad
std::vector< double > * m_c711_clusterTime
std::vector< float > * m_c711_rawChannelQuality
std::vector< double > * m_vtx_d0sig
std::vector< int > * m_mc_vert_status
std::vector< std::vector< double > > * m_c_channelOFCb
std::vector< int > * m_c711_clusterIndex_rawChLvl
std::vector< float > * m_mc_vert_phi
std::vector< std::vector< double > > * m_c_channelOFCa
std::vector< int > * m_mc_part_pdgId
std::vector< float > * m_c711_clusterRawChannelIndex
std::vector< float > * m_c_rawChannelAmplitude
std::vector< float > * m_mc_vert_z
std::vector< float > * m_c711_rawChannelPed
std::vector< double > * m_c_cellPhi
std::vector< int > * m_c711_electronIndex_clusterLvl
std::vector< float > * m_vtx_delta_z0_sin
std::vector< double > * m_c_cellEnergy
std::vector< std::vector< float > > * m_c711_channelDigits
int getCaloRegionIndex(const CaloCell *cell)
std::vector< double > * m_c711_channelOFCTimeOffset
std::vector< int > * m_c_clusterIndex_chLvl
std::vector< float > * m_mc_vert_y
std::vector< double > * m_zee_pt
std::vector< float > * m_hits_sampFrac
std::vector< int > * m_c_cellLayer
std::vector< double > * m_c_clusterPt
bool isGoodProbeElectron(const xAOD::Electron *el)
std::vector< float > * m_c_rawChannelPed
std::vector< float > * m_mc_part_pt
std::vector< int > * m_c_clusterIndex
std::vector< double > * m_c_cellToClusterDPhi
std::vector< float > * m_c_channelNoise
std::vector< int > * m_hits_clusterChannelIndex
std::vector< float > * m_c711_channelPed
double deltaPhi(double phi1, double phi2)
std::vector< double > * m_c711_clusterEta
std::vector< float > * m_el_f1
std::vector< float > * m_c_clusterRawChannelIndex
std::vector< float > * m_el_Pt
std::vector< float > * m_c711_channelEffectiveSigma
std::vector< int > * m_c_clusterCellIndex
bool isTagElectron(const xAOD::Electron *electron)
std::vector< float > * m_ph_pt
std::vector< float > * m_c_channelEffectiveSigma
std::vector< unsigned int > * m_c_channelHashMap
bool trackSelectionElectrons(const xAOD::Electron *electron, SG::ReadHandle< xAOD::VertexContainer > &primVertexCnt, SG::ReadHandle< xAOD::EventInfo > &ei)
std::vector< int > * m_c711_clusterChannelIndex
std::vector< int > * m_c_rawChannelLayer
std::vector< double > * m_c711_cellDPhi
std::vector< int > * m_c711_channelLayer
std::vector< std::vector< float > > * m_c_channelDigits
std::vector< double > * m_c_cellEta
std::vector< double > * m_c_cellDEta
std::vector< float > * m_c711_channelMinBiasAvg
std::vector< float > * m_c711_rawChannelTime
std::vector< double > * m_c711_cellTime
std::vector< std::vector< double > > * m_c711_channelShapeDer
std::vector< float > * m_ph_phi
std::vector< double > * m_hits_cellEta
Gaudi::Property< bool > m_doTruthPartDump
std::vector< float > * m_c_channelOfflEneRescaler
std::vector< double > * m_zee_M
std::vector< float > * m_c711_channelDSPThreshold
std::vector< double > * m_zee_pz
std::vector< double > * m_c711_clusterPhi
std::vector< std::vector< int > > * m_c711_rawChannelChInfo
std::vector< double > * m_c_cellDPhi
std::vector< float > * m_el_rhad1
std::vector< float > * m_el_weta1
std::vector< bool > * m_c711_channelBad
EventReaderBaseAlg(const std::string &name, ISvcLocator *pSvcLocator)
std::vector< float > * m_el_et
std::vector< double > * m_c711_clusterPt
bool isEtaOutsideLArCrack(float absEta)
std::vector< std::vector< int > > * m_c711_channelChInfo
std::vector< float > * m_vtx_z
std::vector< int > * m_lb_lumiblock
std::vector< int > * m_c_channelLayer
std::vector< double > * m_zee_T
std::vector< int > * m_c711_clusterIndex_cellLvl
std::vector< double > * m_c_clusterPhi
std::vector< double > * m_c711_clusterEnergy
std::vector< int > * m_el_index
std::vector< std::vector< int > > * m_c_rawChannelChInfo
std::vector< double > * m_c711_cellPhi
std::vector< double > * m_c711_cellEta
std::vector< int > * m_mc_part_status
Gaudi::Property< bool > m_doTagAndProbe
std::vector< std::vector< double > > * m_c711_channelOFCa
Gaudi::Property< float > m_etMinTag
Gaudi::Property< bool > m_isMC
std::vector< int > * m_mc_vert_uniqueID
std::vector< double > * m_hits_energy
std::vector< float > * m_c_channelADC2MEV1
std::vector< float > * m_mc_part_eta
std::vector< float > * m_mc_part_energy
std::vector< std::vector< double > > * m_c711_channelShape
std::vector< float > * m_el_Eta
std::vector< float > * m_c_channelOfflHVScale
std::vector< double > * m_c_channelTime
std::vector< double > * m_c711_cellDEta
Gaudi::Property< bool > m_getLArCalibConstants
std::vector< int > * m_c_clusterIndex_cellLvl
std::vector< double > * m_c_clusterTime
void bookBranches(TTree *tree)
Gaudi::Property< std::string > m_offProbeTightness
Define the PID for tag electron.
virtual StatusCode finalize() override
std::vector< float > * m_c_channelMinBiasAvg
std::vector< float > * m_mc_vert_time
std::vector< int > * m_c711_clusterIndex_chLvl
std::vector< float > * m_c_channelDSPThreshold
std::vector< float > * m_c711_channelNoise
std::vector< double > * m_c_clusterEta
std::vector< int > * m_c_cellGain
std::vector< float > * m_mc_part_phi
std::vector< double > * m_c711_channelEnergy
std::vector< float > * m_c_channelADC2MEV0
std::vector< int > * m_c_electronIndex_clusterLvl
std::vector< float > * m_mc_part_m
std::vector< double > * m_zee_E
std::vector< std::vector< double > > * m_c711_channelOFCb
std::vector< float > * m_mc_vert_x
std::vector< float > * m_c711_channelADC2MEV0
std::vector< float > * m_c711_channelOfflEneRescaler
std::vector< float > * m_vtx_deltaZ0
std::vector< double > * m_c711_cellToClusterDPhi
std::vector< int > * m_hits_sampling
std::vector< std::vector< int > > * m_c_channelChInfo
std::vector< float > * m_c_rawChannelDSPThreshold
std::vector< float > * m_vtx_y
std::vector< double > * m_c_channelEnergy
std::vector< float > * m_el_rphi
Gaudi::Property< bool > m_doElecSelectByTrackOnly
Gaudi::Property< bool > m_doPhotonDump
std::vector< double > * m_c_channelOFCTimeOffset
std::vector< unsigned int > * m_c711_rawChannelIdMap
std::vector< float > * m_el_eratio
Gaudi::Property< float > m_etMinProbe
define the Pid of Probe from the user
std::vector< unsigned int > * m_hits_hash
std::vector< float > * m_c_rawChannelTime
Gaudi::Property< bool > m_noBadCells
std::vector< float > * m_ph_m
std::vector< float > * m_c711_rawChannelDSPThreshold
std::vector< float > * m_mc_vert_eta
std::vector< float > * m_c711_rawChannelProv
std::vector< int > * m_mc_part_uniqueID
std::vector< float > * m_el_f3
std::vector< float > * m_el_reta
std::vector< unsigned int > * m_c711_channelChannelIdMap
std::vector< int > * m_hits_clusterIndex_chLvl
std::vector< float > * m_mc_vert_perp
std::vector< float > * m_c711_channelADC2MEV1
Gaudi::Property< std::string > m_offTagTightness
virtual StatusCode execute() override
double deltaR(double eta, double phi)
bool eOverPElectron(const xAOD::Electron *electron)
std::vector< float > * m_el_weta2
std::vector< float > * m_el_eoverp
std::vector< float > * m_el_m
std::vector< double > * m_c_cellToClusterDEta
std::vector< unsigned int > * m_c_rawChannelIdMap
std::vector< double > * m_hits_time
double fixPhi(double phi)
std::vector< unsigned int > * m_c711_channelHashMap
virtual ~EventReaderBaseAlg() override
float z0() const
Returns the parameter.
float theta() const
Returns the parameter, which has range 0 to .
float vz() const
The z origin for the parameters.
virtual double pt() const override final
The transverse momentum ( ) of the particle.
virtual double eta() const override final
The pseudorapidity ( ) of the particle.
const uint32_t BADCLUSELECTRON
Definition EgammaDefs.h:116
double d0significance(const xAOD::TrackParticle *tp, double d0_uncert_beam_spot_2)
@ PriVtx
Primary vertex.
CaloCluster_v1 CaloCluster
Define the latest version of the calorimeter cluster class.
TrackParticle_v1 TrackParticle
Reference the current persistent version:
Vertex_v1 Vertex
Define the latest version of the vertex class.
Electron_v1 Electron
Definition of the current "egamma version".
TChain * tree