ATLAS Offline Software
LArFCalSamplingFraction.cxx
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration
3 */
4 
6 
7 // C++ stdlib
8 #include <algorithm>
9 #include <functional>
10 #include <iostream>
11 #include <cmath>
12 
13 // Root
14 #include "TTree.h"
15 
16 // ATLAS Software
17 #include "GaudiKernel/IToolSvc.h"
18 #include "GaudiKernel/ITHistSvc.h"
19 
20 // ID classes
21 #include "CaloDetDescr/CaloDetDescrElement.h"
25 #include "Identifier/Identifier.h"
26 
27 // Hits and hit collections
28 #include "LArSimEvent/LArHit.h"
34 
35 // For Cryostat Positions
37 
38 // Other useful tools for particle/event/beam info
40 #include "AtlasHepMC/GenEvent.h"
41 #include "AtlasHepMC/GenVertex.h"
42 #include "AtlasHepMC/GenParticle.h"
44 #include "CLHEP/Vector/LorentzVector.h"
45 #include "CLHEP/Vector/ThreeVector.h"
46 #include "CLHEP/Geometry/Point3D.h"
47 
48 
51 
52 LArFCalSamplingFraction::LArFCalSamplingFraction(const std::string &name, ISvcLocator *pSvcLocator)
53  : AthAlgorithm(name, pSvcLocator),
54  m_calibrationRun(false),
55  m_cx1(0.0), m_cx2(0.0), m_cx3(0.0),
56  m_cy1(0.0), m_cy2(0.0), m_cy3(0.0)
57 {
58  declareProperty("Calibration", m_calibrationRun);
59 }
60 
61 
64 
66 
67 
72 
74 {
75  ATH_MSG_INFO("Initializing LArFCalSamplingFraction");
76 
77  // Get a handle on the NTuple and histogramming service
78  ServiceHandle<ITHistSvc> histSvc("THistSvc", name());
79  CHECK(histSvc.retrieve());
80  ATH_MSG_DEBUG(" retrieved THistSvc");
81 
82  const CaloIdManager *caloIdManager = nullptr;
83  ATH_CHECK(detStore()->retrieve(caloIdManager));
84 
85  // Use just for now for Calibration... change later to GeoCalibHit
86  m_larFCalID = caloIdManager->getFCAL_ID();
87 
88  if (m_larFCalID == 0)
89  throw GaudiException("Invalid LAr FCAL ID helper", "LArHitAnalysis", StatusCode::FAILURE);
90 
91  // Use for now... soon change to GeoCalibHit
92  m_caloCellID = caloIdManager->getCaloCell_ID();
93 
94  if (m_caloCellID == 0)
95  throw GaudiException("Invalid Calo Cell ID helper", "LArHitAnalysis", StatusCode::FAILURE);
96 
99 
100  m_pdg_id = new std::vector<int>; // particle id
101 
102  m_hit_x1 = new std::vector<double>; // hit positions of cells
103  m_hit_y1 = new std::vector<double>;
104 
105  m_hit_x2 = new std::vector<double>;
106  m_hit_y2 = new std::vector<double>;
107 
108  m_hit_x3 = new std::vector<double>;
109  m_hit_y3 = new std::vector<double>;
110 
111  m_hit_ieta1 = new std::vector<double>; // hit indices of cells
112  m_hit_iphi1 = new std::vector<double>;
113  m_hit_ieta2 = new std::vector<double>;
114  m_hit_iphi2 = new std::vector<double>;
115  m_hit_ieta3 = new std::vector<double>;
116  m_hit_iphi3 = new std::vector<double>;
117 
118  m_cell1_E = new std::vector<double>; // Energy in cells
119  m_cell2_E = new std::vector<double>;
120  m_cell3_E = new std::vector<double>;
121 
122  // Now add branches and leaves to the AAN tree
123  m_tree_AS = new TTree("tree_AS", "TTree of AnalysisSkleton");
124 
125  // Event info
126  m_tree_AS->Branch("Run", &m_runNumber, "Run/I"); // run number
127  m_tree_AS->Branch("Event", &m_eventNumber, "Event/I"); // event number
128  m_tree_AS->Branch("Time", &m_eventTime, "Time/I"); // time stamp
129  m_tree_AS->Branch("LumiBlock", &m_lumiBlock, "LumiBlock/I"); // lumi block num
130  m_tree_AS->Branch("BCID", &m_bCID, "BCID/I"); // bunch crossing ID
131  m_tree_AS->Branch("Weight", &m_eventWeight, "Weight/D"); // weight
132 
133  // FCal-specific and other variables
134  m_tree_AS->Branch("EFCal", &m_totalFCalEnergy, "EFCal/D");
135  m_tree_AS->Branch("NHitsFCal", &m_numHitsFCal, "NhitsFCal/I");
136 
137  m_tree_AS->Branch("Vertex_Eta", &m_vertex_eta, "Vertex_Eta/D");
138  m_tree_AS->Branch("Vertex_Phi", &m_vertex_phi, "Vertex_Phi/D");
139 
140  m_tree_AS->Branch("Pt", &m_pt, "Pt/D");
141  m_tree_AS->Branch("px", &m_px, "px/D");
142  m_tree_AS->Branch("py", &m_py, "py/D");
143  m_tree_AS->Branch("pz", &m_pz, "pz/D");
144  m_tree_AS->Branch("E", &m_E, "E/D");
145 
146  m_tree_AS->Branch("VertexX", &m_vertx, "VertexX/D");
147  m_tree_AS->Branch("VertexY", &m_verty, "VertexY/D");
148  m_tree_AS->Branch("VertexZ", &m_vertz, "VertexZ/D");
149 
150  m_tree_AS->Branch("MC_CCX1", &m_x_mc_cc1, "MC_CCX1/D");
151  m_tree_AS->Branch("MC_CCY1", &m_y_mc_cc1, "MC_CCY1/D");
152 
153  m_tree_AS->Branch("MC_CCX2", &m_x_mc_cc2, "MC_CCX2/D");
154  m_tree_AS->Branch("MC_CCY2", &m_y_mc_cc2, "MC_CCY2/D");
155 
156  m_tree_AS->Branch("MC_CCX3", &m_x_mc_cc3, "MC_CCX3/D");
157  m_tree_AS->Branch("MC_CCY3", &m_y_mc_cc3, "MC_CCY3/D");
158 
159  m_tree_AS->Branch("CCX1", &m_x_cc1, "CCX1/D");
160  m_tree_AS->Branch("CCY1", &m_y_cc1, "CCY1/D");
161 
162  m_tree_AS->Branch("CCX2", &m_x_cc2, "CCX2/D");
163  m_tree_AS->Branch("CCY2", &m_y_cc2, "CCY2/D");
164 
165  m_tree_AS->Branch("CCX3", &m_x_cc3, "CCX3/D");
166  m_tree_AS->Branch("CCY3", &m_y_cc3, "CCY3/D");
167 
168  m_tree_AS->Branch("NCell_1", &m_NCell1, "NCell1_1/I");
169  m_tree_AS->Branch("NCell_2", &m_NCell2, "NCell1_2/I");
170  m_tree_AS->Branch("NCell_3", &m_NCell3, "NCell1_3/I");
171 
172  m_tree_AS->Branch("ParticleID", &m_pdg_id);
173 
174  m_tree_AS->Branch("Hit_X1", &m_hit_x1);
175  m_tree_AS->Branch("Hit_Y1", &m_hit_y1);
176 
177  m_tree_AS->Branch("Hit_X2", &m_hit_x2);
178  m_tree_AS->Branch("Hit_Y2", &m_hit_y2);
179 
180  m_tree_AS->Branch("Hit_X3", &m_hit_x3);
181  m_tree_AS->Branch("Hit_Y3", &m_hit_y3);
182 
183  m_tree_AS->Branch("Hit_eta1", &m_hit_ieta1);
184  m_tree_AS->Branch("Hit_phi1", &m_hit_iphi1);
185  m_tree_AS->Branch("Hit_eta2", &m_hit_ieta2);
186  m_tree_AS->Branch("Hit_phi2", &m_hit_iphi2);
187  m_tree_AS->Branch("Hit_eta3", &m_hit_ieta3);
188  m_tree_AS->Branch("Hit_phi3", &m_hit_iphi3);
189 
190  m_tree_AS->Branch("Cell1_E", &m_cell1_E);
191  m_tree_AS->Branch("Cell2_E", &m_cell2_E);
192  m_tree_AS->Branch("Cell3_E", &m_cell3_E);
193 
194  m_tree_AS->Branch("FCal1_E", &m_FCal1_SumE, "FCal1_E/D");
195  m_tree_AS->Branch("FCal2_E", &m_FCal2_SumE, "FCal2_E/D");
196  m_tree_AS->Branch("FCal3_E", &m_FCal3_SumE, "FCal3_E/D");
197 
198  if (m_calibrationRun) {
199  m_caloDmID = caloIdManager->getDM_ID();
200 
201  if (m_caloDmID == 0)
202  throw GaudiException("Invalid Calo DM ID helper", "LArFCalTB_MC_CBNT_AA", StatusCode::FAILURE);
203 
204  // Define the hit containers that we'll analyze in this program.
205  // For now, initialize the pointers to the containers to NULL (zero).
206  m_calibHitMap["LArCalibrationHitActive"] = 0;
207  m_calibHitMap["LArCalibrationHitInactive"] = 0;
208  m_calibHitMap["LArCalibrationHitDeadMaterial"] = 0;
209 
210  m_tree_AS->Branch("Calib_TotalEnergy", &m_totalCalibrationEnergy, "Calib_TotalEnergy/D");
211  m_tree_AS->Branch("Calib_TotalEm", &m_totalEmEnergy, "Calib_TotalEm/D");
212  m_tree_AS->Branch("Calib_TotalNonEm", &m_totalNonEmEnergy, "Calib_TotalNonEm/D");
213  m_tree_AS->Branch("Calib_TotalInvisible", &m_totalInvisibleEnergy, "Calib_TotalInvisible/D");
214  m_tree_AS->Branch("Calib_TotalEscaped", &m_totalEscapedEnergy, "Calib_TotalEscaped/D");
215  m_tree_AS->Branch("Calib_FCalEnergy", &m_totalFCalCalibrationEnergy, "Calib_FCalEnergy/D");
216  m_tree_AS->Branch("Calib_TotalActive", &m_totalActiveEnergy, "Calib_TotalActive/D");
217  m_tree_AS->Branch("Calib_TotalInactive", &m_totalInactiveEnergy, "Calib_TotalInactive/D");
218  m_tree_AS->Branch("Calib_DeadEnergy", &m_totalDeadMaterialEnergy, "Calib_DeadEnergy/D");
219  m_tree_AS->Branch("Calib_NHitsInactive", &m_numHitsInactive, "Calib_NHitsInactive/I");
220  m_tree_AS->Branch("Calib_NHitsDead", &m_numHitsDead, "Calib_NHitsDead/I");
221  m_tree_AS->Branch("Calib_FCal1Energy", &m_totalFCal1CalibrationEnergy, "Calib_FCal1Energy/D");
222  m_tree_AS->Branch("Calib_FCal2Energy", &m_totalFCal2CalibrationEnergy, "Calib_FCal2Energy/D");
223  m_tree_AS->Branch("Calib_FCal3Energy", &m_totalFCal3CalibrationEnergy, "Calib_FCal3Energy/D");
224 
225  m_tree_AS->Branch("Calib_FCalActive", &m_FCalActive, "Calib_FCalActive/D");
226  m_tree_AS->Branch("Calib_FCalInactive", &m_FCalInactive, "Calib_FCalInactive/D");
227  m_tree_AS->Branch("Calib_FCalDead", &m_FCalDead, "Calib_FCalDead/D");
228  m_tree_AS->Branch("Calib_FCalEm", &m_FCalEm, "Calib_FCalEm/D");
229  m_tree_AS->Branch("Calib_FCal1Em", &m_FCal1Em, "Calib_FCal1Em/D");
230  m_tree_AS->Branch("Calib_FCal2Em", &m_FCal2Em, "Calib_FCal2Em/D");
231  m_tree_AS->Branch("Calib_FCal3Em", &m_FCal3Em, "Calib_FCal3Em/D");
232  m_tree_AS->Branch("Calib_FCalNonEm", &m_FCalNonEm, "Calib_FCalNonEm/D");
233  m_tree_AS->Branch("Calib_FCal1NonEm", &m_FCal1NonEm, "Calib_FCal1NonEm/D");
234  m_tree_AS->Branch("Calib_FCal2NonEm", &m_FCal2NonEm, "Calib_FCal2NonEm/D");
235  m_tree_AS->Branch("Calib_FCal3NonEm", &m_FCal3NonEm, "Calib_FCal3NonEm/D");
236  m_tree_AS->Branch("Calib_FCalInvisible", &m_FCalInvisible, "Calib_FCalInvisible/D");
237  m_tree_AS->Branch("Calib_FCal1Invisible", &m_FCal1Invisible, "Calib_FCal1Invisible/D");
238  m_tree_AS->Branch("Calib_FCal2Invisible", &m_FCal2Invisible, "Calib_FCal2Invisible/D");
239  m_tree_AS->Branch("Calib_FCal3Invisible", &m_FCal3Invisible, "Calib_FCal3Invisible/D");
240  m_tree_AS->Branch("Calib_FCalEscaped", &m_FCalEscaped, "Calib_FCalEscaped/D");
241  m_tree_AS->Branch("Calib_FCal1Escaped", &m_FCal1Escaped, "Calib_FCal1Escaped/D");
242  m_tree_AS->Branch("Calib_FCal2Escaped", &m_FCal2Escaped, "Calib_FCal2Escaped/D");
243  m_tree_AS->Branch("Calib_FCal3Escaped", &m_FCal3Escaped, "Calib_FCal3Escaped/D");
244  m_tree_AS->Branch("Calib_FCal1Active", &m_FCal1Active, "Calib_FCal1Active/D");
245  m_tree_AS->Branch("Calib_FCal2Active", &m_FCal2Active, "Calib_FCal2Active/D");
246  m_tree_AS->Branch("Calib_FCal3Active", &m_FCal3Active, "Calib_FCal3Active/D");
247  m_tree_AS->Branch("Calib_FCal1Inactive", &m_FCal1Inactive, "Calib_FCal1Inactive/D");
248  m_tree_AS->Branch("Calib_FCal2Inactive", &m_FCal2Inactive, "Calib_FCal2Inactive/D");
249  m_tree_AS->Branch("Calib_FCal3Inactive", &m_FCal3Inactive, "Calib_FCal3Inactive/D");
250  m_tree_AS->Branch("Calib_FCalActiveEm", &m_FCalActiveEm, "Calib_FCalActiveEm/D");
251  m_tree_AS->Branch("Calib_FCalActiveNonEm", &m_FCalActiveNonEm, "Calib_FCalActiveNonEm/D");
252  m_tree_AS->Branch("Calib_FCalActiveInvisible", &m_FCalActiveInvisible, "Calib_FCalActiveInvisible/D");
253  m_tree_AS->Branch("Calib_FCalActiveEscaped", &m_FCalActiveEscaped, "Calib_FCalActiveEscaped/D");
254  }
255 
256  CHECK(histSvc->regTree("/AANT/tree_AS", m_tree_AS));
257 
258  m_eventNumber = 0;
259 
260  return StatusCode::SUCCESS;
261 }
262 
263 
267 
269 {
270  return StatusCode::SUCCESS;
271 }
272 
273 
277 
279 {
281 
282  ATH_MSG_INFO("Initializing event, clearing variables");
283 
284  m_vertx = 0; // x-position for vertex generated particle (beam)
285  m_verty = 0;
286  m_vertz = 0;
287 
288  m_vertex_eta = 0; // eta value of generated particle
289  m_vertex_phi = 0;
290 
291  m_pt = 0; // Momentum of generated particle
292  m_px = 0;
293  m_py = 0;
294  m_pz = 0;
295 
296  m_E = 0; // Energy of generated particle
297 
298  m_NCell1 = 0; // Number of cells hit
299  m_NCell2 = 0;
300  m_NCell3 = 0;
301 
302  m_x_mc_cc1 = 0; // Center of cluster in x (FCal1, extrapolated)
303  m_y_mc_cc1 = 0;
304 
305  m_x_mc_cc2 = 0; // Center of cluster in x (FCal2, extrapolated)
306  m_y_mc_cc2 = 0;
307 
308  m_x_mc_cc3 = 0; // Center of cluster in x (FCal3, extrapolated)
309  m_y_mc_cc3 = 0;
310 
311  m_x_cc1 = 0; // Center of cluster in x (FCal1, c of g)
312  m_y_cc1 = 0;
313 
314  m_x_cc2 = 0; // Center of cluster in x (FCal2, c of g)
315  m_y_cc2 = 0;
316 
317  m_x_cc3 = 0; // Center of cluster in x (FCal3, c of g)
318  m_y_cc3 = 0;
319 
320  m_pdg_id->clear(); // particle id
321 
322  m_hit_x1->clear(); // hit positions of cells
323  m_hit_y1->clear();
324 
325  m_hit_x2->clear();
326  m_hit_y2->clear();
327 
328  m_hit_x3->clear();
329  m_hit_y3->clear();
330 
331  m_hit_ieta1->clear(); // hit indices of cells
332  m_hit_iphi1->clear();
333  m_hit_ieta2->clear();
334  m_hit_iphi2->clear();
335  m_hit_ieta3->clear();
336  m_hit_iphi3->clear();
337 
338  m_cell1_E->clear(); // Energy in cells
339  m_cell2_E->clear();
340  m_cell3_E->clear();
341 
342  m_FCal1_SumE = 0; // Energy in individual FCal modules
343  m_FCal2_SumE = 0;
344  m_FCal3_SumE = 0;
345  m_TCScint_E = 0;
346  m_TCIron_E = 0;
347 
348  m_totalFCalEnergy = 0;
349  m_numHitsFCal = 0;
350 
351  m_totalCalibrationEnergy = 0; // Total energy
352 
353  // Physic Processes
354  m_totalEmEnergy = 0;
355  m_totalNonEmEnergy = 0;
358 
359  // Energy deposited in different material categories
363 
364  // Number of hits in different material categories
365  m_numHitsActive = 0;
366  m_numHitsInactive = 0;
367  m_numHitsDead = 0;
368 
369  // Total energy deposited in the different FCal Modules
370  m_totalFCalCalibrationEnergy = 0; // Energy in all FCal
374 
375  m_FCalActive = 0;
376  m_FCalInactive = 0;
377  m_FCalDead = 0;
378  m_FCalActiveEm = 0;
379  m_FCalActiveNonEm = 0;
382  m_FCalEm = 0;
383  m_FCal1Em = 0;
384  m_FCal2Em = 0;
385  m_FCal3Em = 0;
386  m_FCalNonEm = 0;
387  m_FCal1NonEm = 0;
388  m_FCal2NonEm = 0;
389  m_FCal3NonEm = 0;
390  m_FCalInvisible = 0;
391  m_FCal1Invisible = 0;
392  m_FCal2Invisible = 0;
393  m_FCal3Invisible = 0;
394  m_FCalEscaped = 0;
395  m_FCal1Escaped = 0;
396  m_FCal2Escaped = 0;
397  m_FCal3Escaped = 0;
398  m_PhysTotE = 0;
399  m_FCal1Active = 0;
400  m_FCal2Active = 0;
401  m_FCal3Active = 0;
402  m_FCal1Inactive = 0;
403  m_FCal2Inactive = 0;
404  m_FCal3Inactive = 0;
405 
406  return StatusCode::SUCCESS;
407 }
408 
409 
412 
414  , const CaloDetDescrManager* caloMgr)
415 {
416  double max1 = 0.0;
417  double max2 = 0.0;
418  double max3 = 0.0;
419 
420  // Loop over hits in container
421  for (const LArHit* hit : *container) {
422 
423  const CaloDetDescrElement* caloDDE = caloMgr->get_element(hit->cellID());
424  if(!caloDDE->is_lar_fcal()) {
425  ATH_MSG_WARNING("Hit in LarHitContainer does not belong to FCAL");
426  continue;
427  }
428 
429  double energy = hit->energy();
430 
431  int module_index = caloDDE->getLayer();
432 
433  double x = caloDDE->x();
434  double y = caloDDE->y();
435 
436  // Determine the center of the cluster for each FCal module
437  if (module_index == 1) {
438  // FCal1
439  if (max1 < energy) {
440  max1 = energy;
441  m_cx1 = x;
442  m_cy1 = y;
443  }
444  }
445  else if (module_index == 2) {
446  // FCal2
447  if (max2 < energy) {
448  max2 = energy;
449  m_cx2 = x;
450  m_cy2 = y;
451  }
452  }
453  else if (module_index == 3) {
454  // FCal3
455  if (max3 < energy) {
456  max3 = energy;
457  m_cx3 = x;
458  m_cy3 = y;
459  }
460  }
461 
462  } // End loop over hits in container
463 }
464 
465 
468 
470  , const CaloDetDescrManager* caloMgr)
471 {
472  float xNumer1 = 0.0, xNumer2 = 0.0, xNumer3 = 0.0;
473  float yNumer1 = 0.0, yNumer2 = 0.0, yNumer3 = 0.0;
474  float Denom1 = 0.0, Denom2 = 0.0, Denom3 = 0.0;
475 
476  double subClusterSize = 30.0; // [mm]
477  double thisCG_R = 0.0;
478 
479  // Loop over hits in container
480  for (const LArHit* hit : *container) {
481 
482  const CaloDetDescrElement* caloDDE = caloMgr->get_element(hit->cellID());
483  if(!caloDDE->is_lar_fcal()) {
484  ATH_MSG_WARNING("Hit in LarHitContainer is not a GeoFCalHit");
485  continue;
486  }
487 
488  double energy = hit->energy();
489 
490  int module_index = caloDDE->getLayer();
491 
492  double x = caloDDE->x();
493  double y = caloDDE->y();
494 
495 
496  // Determine center of cluster
497  if (module_index == 1) {
498  // FCal1
499  double x_subcheck1 = m_cx1 - x;
500  double y_subcheck1 = m_cy1 - y;
501  thisCG_R = sqrt(x_subcheck1 * x_subcheck1 + y_subcheck1 * y_subcheck1);
502 
503  if (thisCG_R <= subClusterSize) {
504  xNumer1 += x * energy;
505  yNumer1 += y * energy;
506  Denom1 += energy;
507  }
508  }
509  else if (module_index == 2) {
510  // FCal2
511  double x_subcheck2 = m_cx2 - x;
512  double y_subcheck2 = m_cy2 - y;
513  thisCG_R = sqrt(x_subcheck2 * x_subcheck2 + y_subcheck2 * y_subcheck2);
514 
515  if (thisCG_R <= subClusterSize) {
516  xNumer2 += x * energy;
517  yNumer2 += y * energy;
518  Denom2 += energy;
519  }
520  }
521  else if (module_index == 3) {
522  // FCal3
523  double x_subcheck3 = m_cx3 - x;
524  double y_subcheck3 = m_cy3 - y;
525  thisCG_R = sqrt(x_subcheck3 * x_subcheck3 + y_subcheck3 * y_subcheck3);
526 
527  if (thisCG_R <= subClusterSize) {
528  xNumer3 += x * energy;
529  yNumer3 += y * energy;
530  Denom3 += energy;
531  }
532  }
533 
534  } // End loop over hits in container
535 
536  if (fabs(Denom1) > 0.0) {
537  m_x_cc1 = xNumer1 / Denom1;
538  m_y_cc1 = yNumer1 / Denom1;
539  }
540 
541  if (fabs(Denom2) > 0.0) {
542  m_x_cc2 = xNumer2 / Denom2;
543  m_y_cc2 = yNumer2 / Denom2;
544  }
545 
546  if (fabs(Denom3) > 0.0) {
547  m_x_cc3 = xNumer3 / Denom3;
548  m_y_cc3 = yNumer3 / Denom3;
549  }
550 }
551 
552 
555 
557 {
558  StatusCode sc;
559 
560  ATH_MSG_DEBUG("Starting FCal Calibration Analysis");
561 
562  // Get the calibration hit containers (if any)
563  for (auto& kv : m_calibHitMap)
564  {
565  std::string name = kv.first;
566  const CaloCalibrationHitContainer *container{};
567  sc = evtStore()->retrieve(container, name);
568 
569  if (sc.isFailure() || container == 0) {
570  ATH_MSG_ERROR("CaloCalibrationHit container was not found");
571  m_numHitsActive = 0;
572  m_numHitsInactive = 0;
573  m_numHitsDead = 0;
574  kv.second = 0;
575 
576  return StatusCode::FAILURE;
577  }
578 
579  ATH_MSG_DEBUG("CaloCalibrationHit container successfully retrieved");
580 
581  kv.second = container;
582  }
583 
584  // Get the number of hits in each container
585  // (The braces let us re-use the name 'container')
586  {
587  const CaloCalibrationHitContainer *container = m_calibHitMap["LArCalibrationHitActive"];
588 
589  if (container != 0)
590  m_numHitsActive = container->Size();
591  else
592  m_numHitsActive = 0;
593  }
594  {
595  const CaloCalibrationHitContainer *container = m_calibHitMap["LArCalibrationHitInactive"];
596 
597  if (container != 0)
598  m_numHitsInactive = container->Size();
599  else
600  m_numHitsInactive = 0;
601  }
602  {
603  const CaloCalibrationHitContainer *container = m_calibHitMap["LArCalibrationHitDeadMaterial"];
604 
605  if (container != 0)
606  m_numHitsDead = container->Size();
607  else
608  m_numHitsDead = 0;
609  }
610 
611  // Loop over all the hit containers, inspecting each hit within the collection
612  for (const auto& kv : m_calibHitMap)
613  {
614  std::string name = kv.first;
615  const CaloCalibrationHitContainer *container = kv.second;
616 
617  // Skip rest of loop if it's a null container.
618  if (container == 0)
619  continue;
620 
621  // Loop over calibration hits in container
622  for (const CaloCalibrationHit* calibhit : *container) {
623 
624  Identifier identifier = calibhit->cellID();
625  double energy = calibhit->energyTotal();
626 
627  // Accumulate energy sums. Use the ID helpers to determine in which
628  // detector the hit took place.
629 
631  m_totalEmEnergy += calibhit->energyEM();
632  m_totalNonEmEnergy += calibhit->energyNonEM();
633  m_totalInvisibleEnergy += calibhit->energyInvisible();
634  m_totalEscapedEnergy += calibhit->energyEscaped();
635 
636  if (name == "LArCalibrationHitActive")
638 
639  if (name == "LArCalibrationHitInactive")
641 
642  if (name == "LArCalibrationHitDeadMaterial") {
644 
646  m_FCalDead += energy;
647  }
648 
650  FCalCalibAnalysis(name, calibhit);
651 
652  } // End loop over calibration hits in container
653  } // End loop over containers
654 
655  // Execution completed
656 
657  ATH_MSG_DEBUG("doCalib() completed successfully");
658  return sc;
659 }
660 
661 
665 
666 void LArFCalSamplingFraction::FCalCalibAnalysis(const std::string& name, const CaloCalibrationHit *CalibHit)
667 {
668  Identifier id = CalibHit->cellID();
669  double energy = CalibHit->energyTotal();
670 
673  m_FCalEm += CalibHit->energyEM();
674  m_FCalNonEm += CalibHit->energyNonEM();
675  m_FCalInvisible += CalibHit->energyInvisible();
676  m_FCalEscaped += CalibHit->energyEscaped();
677 
678  if (m_larFCalID->module(id) == 1) {
679  // FCal1
681  m_FCal1Em += CalibHit->energyEM();
682  m_FCal1NonEm += CalibHit->energyNonEM();
683  m_FCal1Invisible += CalibHit->energyInvisible();
684  m_FCal1Escaped += CalibHit->energyEscaped();
685  }
686  else if (m_larFCalID->module(id) == 2) {
687  // FCal2
689  m_FCal2Em += CalibHit->energyEM();
690  m_FCal2NonEm += CalibHit->energyNonEM();
691  m_FCal2Invisible += CalibHit->energyInvisible();
692  m_FCal2Escaped += CalibHit->energyEscaped();
693  }
694  else if (m_larFCalID->module(id) == 3) {
695  // FCal3
697  m_FCal3Em += CalibHit->energyEM();
698  m_FCal3NonEm += CalibHit->energyNonEM();
699  m_FCal3Invisible += CalibHit->energyInvisible();
700  m_FCal3Escaped += CalibHit->energyEscaped();
701  }
702 
703  if (name == "LArCalibrationHitActive") {
704  m_FCalActive += energy;
705  m_FCalActiveEm += CalibHit->energyEM();
706  m_FCalActiveNonEm += CalibHit->energyNonEM();
707  m_FCalActiveInvisible += CalibHit->energyInvisible();
708  m_FCalActiveEscaped += CalibHit->energyEscaped();
709 
710  if (m_larFCalID->module(id) == 1)
712 
713  if (m_larFCalID->module(id) == 2)
715 
716  if (m_larFCalID->module(id) == 3)
718  }
719 
720  if (name == "LArCalibrationHitInactive") {
722 
723  if (m_larFCalID->module(id) == 1)
725 
726  if (m_larFCalID->module(id) == 2)
728 
729  if (m_larFCalID->module(id) == 3)
731  }
732 }
733 
734 
737 
739 {
740  for (const auto& theParticle: *e)
741  {
742  // Note: old GenParticles used HepLorentzVectors, now they use HepMC::FourVectors
743 
744  // Get the kinematic variables
745  const HepMC::FourVector& HMCmom = theParticle->momentum();
746  CLHEP::HepLorentzVector momentum(CLHEP::Hep3Vector(HMCmom.px(), HMCmom.py(), HMCmom.pz()), HMCmom.e());
747 
748  HepMC::FourVector HMC3vec(0.0,0.0,0.0,0.0);
749  if (theParticle->production_vertex()) HMC3vec = theParticle->production_vertex()->position();
750  HepGeom::Point3D<double> origin = HepGeom::Point3D<double>(HMC3vec.x(), HMC3vec.y(), HMC3vec.z());
751 
752  // Put VEta and VPhi into the Ntuple
753  m_vertex_phi = momentum.vect().phi();
754  m_vertex_eta = -log(tan(momentum.vect().theta() / 2));
755 
756  if (!finite(m_vertex_eta))
757  m_vertex_eta = 0;
758 
759  m_pt = momentum.vect().perp();
760 
761  m_px = momentum.px();
762  m_py = momentum.py();
763  m_pz = momentum.pz();
764 
765  m_E = momentum.e();
766 
767  m_vertx = theParticle->production_vertex()->position().x();
768  m_verty = theParticle->production_vertex()->position().y();
769  m_vertz = theParticle->production_vertex()->position().z();
770 
771  // Must get x-offset depending on TB position. The 90.0 mm is from the
772  // initial x-offset of FCal in cryostat. The -15.0 mm is from the
773  // initial y-offset of FCal in cryostat. The second number changes
774  // between different positions (these numbers will be in database soon)
775 
776  std::string nickname;
777  double xoffset = 0;
778  double sinangle = 0;
779  double yoffset = 0;
780  const double z1 = -32668.5 * CLHEP::mm; // This is 4668.5 (z=0 to FCal1 Face) + 28000 (B9 to z=0)
781  const double z2 = -33128.3 * CLHEP::mm; // This is 5128.3 (z=0 to FCal1 Face) + 28000 (B9 to z=0)
782  const double z3 = -33602.8 * CLHEP::mm; // This is 5602.8 (z=0 to FCal1 Face) + 28000 (B9 to z=0)
783 
784  double shift2 = sinangle * (5128.3 - 4668.5) * CLHEP::mm;
785  double shift3 = sinangle * (5602.8 - 4668.5) * CLHEP::mm;
786 
787  // Accounts for rotation of Fcal + cryostat.
788  m_x_mc_cc1 = origin.x() + m_px * z1 / m_pz + xoffset;
789  m_y_mc_cc1 = origin.y() + m_py * z1 / m_pz + yoffset;
790 
791  m_x_mc_cc2 = origin.x() + m_px * z2 / m_pz + shift2 + xoffset;
792  m_y_mc_cc2 = origin.y() + m_py * z2 / m_pz + yoffset;
793 
794  m_x_mc_cc3 = origin.x() + m_px * z3 / m_pz + shift3 + xoffset;
795  m_y_mc_cc3 = origin.y() + m_py * z3 / m_pz + yoffset;
796 
797  } // particles
798 }
799 
800 
803 
805 {
806  ATH_MSG_INFO("Starting main FCal analysis");
807 
808  ATH_MSG_DEBUG("LArFCalSamplingFraction parameters are:");
809  ATH_MSG_DEBUG("Calibration: " << m_calibrationRun);
810 
811  StatusCode sc;
812 
813  // ACCESSING EVENT INFORMATION
814  // Get the basic event information (run number, event number).
815  SG::ReadHandle<xAOD::EventInfo> eventInfo(m_eventInfoKey,getContext());
816  ATH_CHECK(eventInfo.isValid());
817  m_runNumber = eventInfo->runNumber();
818  m_eventNumber = eventInfo->eventNumber();
819 
820  ATH_MSG_INFO("Run " << m_runNumber << ", event " << m_eventNumber);
821 
822  // How to access MC Truth information:
823  const McEventCollection *mcEventCollection{};
824  sc = evtStore()->retrieve(mcEventCollection, "TruthEvent");
825 
826  if (sc.isSuccess()) {
827  // There can potentially be more than one MC event in the collection.
829  for (const HepMC::GenEvent * mcEvent : *mcEventCollection) {
830  TruthImpactPosition(mcEvent);
831  }
832  } // retrieved MC event collection
833  else {
834  ATH_MSG_DEBUG("Run " << m_runNumber << ", event " << m_eventNumber
835  << ": could not fetch MC event collection");
836  }
837 
838  // Accessing Hits
839  // Regular hits
840  std::string FCalContainerName = "LArHitFCAL";
841  const LArHitContainer *container = 0;
842  sc = evtStore()->retrieve(container, FCalContainerName);
843 
844  if (sc.isFailure() || container == 0) {
845  ATH_MSG_ERROR("LArHitFCAL container was not found");
846  m_numHitsFCal = 0;
847  return StatusCode::FAILURE;
848  }
849 
850  ATH_MSG_DEBUG("LArHitFCAL container successfully retrieved");
851 
853  ATH_CHECK(caloMgrHandle.isValid());
854  const CaloDetDescrManager* caloMgr = *caloMgrHandle;
855 
856 
857  // Get the number of hits in the LArHitFCAL container
858  m_numHitsFCal = container->size();
859  ATH_MSG_INFO("NumHitsFCal = " << m_numHitsFCal);
860 
861  if (m_numHitsFCal > 0) {
862  // Calculate the center of gravity
863  FCalHitCenter(container,caloMgr);
864  FCalClusterCenter(container,caloMgr);
865  }
866 
867  // Loop over hits in container
868  for (const LArHit* hit : *container) {
869 
870  // Added by JPA to get particle id for each hit
871  const McEventCollection *mcEventCollection{};
872  sc = evtStore()->retrieve(mcEventCollection, "TruthEvent");
873 
874  if (sc.isSuccess()) {
875  // There can potentially be more than one MC event in the collection
877 
878  for (const HepMC::GenEvent * mcEvent : *mcEventCollection)
879  {
880  // There may be many particles per event
881  for (auto theParticle: *mcEvent)
882  {
883  m_pdg_id->push_back(theParticle->pdg_id());
884  }
885  }
886  } // retrieved MC event collection
887 
888  // End JPA particle id
889 
890  const CaloDetDescrElement* caloDDE = caloMgr->get_element(hit->cellID());
891  if(!caloDDE->is_lar_fcal()) {
892  ATH_MSG_ERROR("LArHit does not belong to FCAL");
893  }
894 
895  double energy = hit->energy();
896  int module_index = caloDDE->getLayer();
898 
899  if (module_index == 1) {
900  m_FCal1_SumE += energy;
902  }
903  else if (module_index == 2) {
904  m_FCal2_SumE += energy;
906  }
907  else if (module_index == 3) {
908  m_FCal3_SumE += energy;
910  }
911  } // End loop over hits in container
912 
913  // Calibration hit analysis.
914  if (m_calibrationRun)
915  CHECK(doCalib());
916 
917  ATH_MSG_DEBUG("doFCal() completed successfully");
918 
919  return StatusCode::SUCCESS;
920 }
921 
922 
925 
926 void LArFCalSamplingFraction::FillCellInfo(const CaloDetDescrElement* caloDDE, double energy, std::vector<double> *cell_E,
927  std::vector<double> *hit_x, std::vector<double> *hit_y,
928  std::vector<double> *hit_ieta, std::vector<double> *hit_iphi,
929  int &NCell)
930 {
931  const double hitx = caloDDE->x(); //tile->getX();
932  const double hity = caloDDE->y(); //tile->getY();
933  const double hiteta = 7; //tile->getIndexI();
934  const double hitphi = 7; //tile->getIndexJ();
935 
936  bool cellHit = true;
937 
938  if (NCell != 0) {
939  for (int icell = 0; icell < NCell; icell++) {
940  if ((hitx == hit_x->at(icell)) && (hity == hit_y->at(icell))) {
941  cellHit = false;
942  cell_E->at(icell) += energy;
943  break;
944  }
945  }
946  }
947 
948  if (cellHit) {
949  cell_E->push_back(energy);
950  hit_x->push_back(hitx);
951  hit_y->push_back(hity);
952  hit_ieta->push_back(hiteta);
953  hit_iphi->push_back(hitphi);
954  NCell += 1;
955  }
956 }
957 
958 
961 
963 {
964  ATH_MSG_DEBUG(" in execute()");
965 
966  m_eventNumber++;
967 
968  // Initialize first before processing each event
969  StatusCode sc = initEvent();
970 
971  if (sc.isFailure())
972  ATH_MSG_WARNING("initEvent failed. Continue");
973 
974  sc = doFCal();
975 
976  sc = addEventInfo();
977 
978  if (sc.isFailure()) {
979  ATH_MSG_WARNING("Failure in getEventInfo() ");
980  return StatusCode::SUCCESS;
981  }
982 
983  m_tree_AS->Fill();
984 
985  return StatusCode::SUCCESS;
986 }
987 
988 
990 {
991  ATH_MSG_DEBUG("in addEventInfo()");
992 
993  // This code has been taken from AnalysisExamples/VFitZmmOnAOD
994  // I have the actual EventNumber, but skipped the sequential count of event #
995 
996  // Get EventInfo for run and event number
997  SG::ReadHandle<xAOD::EventInfo> eventInfo(m_eventInfoKey,getContext());
998  ATH_CHECK(eventInfo.isValid());
999  m_runNumber = eventInfo->runNumber();
1000  m_eventNumber = eventInfo->eventNumber();
1001 
1002  ATH_MSG_DEBUG("event " << m_eventNumber);
1003 
1004  m_eventTime = eventInfo->timeStamp();
1005  m_lumiBlock = eventInfo->lumiBlock();
1006  m_bCID = eventInfo->bcid();
1007  m_eventWeight = eventInfo->mcEventWeight();
1008 
1009  return StatusCode::SUCCESS;
1010 }
LArFCalSamplingFraction::m_FCal3Em
double m_FCal3Em
Definition: LArFCalSamplingFraction.h:189
LArFCalSamplingFraction::m_larFCalID
const LArFCAL_ID * m_larFCalID
Definition: LArFCalSamplingFraction.h:212
python.PyKernel.retrieve
def retrieve(aClass, aKey=None)
Definition: PyKernel.py:110
LArFCalSamplingFraction::m_FCal2Invisible
double m_FCal2Invisible
Definition: LArFCalSamplingFraction.h:196
CaloCalibrationHitContainer
Definition: CaloCalibrationHitContainer.h:25
LArFCalSamplingFraction::execute
virtual StatusCode execute() override
Execute (event by event)
Definition: LArFCalSamplingFraction.cxx:962
LArFCalSamplingFraction::m_caloMgrKey
SG::ReadCondHandleKey< CaloDetDescrManager > m_caloMgrKey
Definition: LArFCalSamplingFraction.h:71
LArFCalSamplingFraction::m_totalDeadMaterialEnergy
double m_totalDeadMaterialEnergy
Definition: LArFCalSamplingFraction.h:166
CaloDM_ID::dmat
int dmat(const Identifier &id) const
return DMtype according to :
Definition: CaloDM_ID.h:669
DataModel_detail::const_iterator
Const iterator class for DataVector/DataList.
Definition: DVLIterator.h:82
LArFCalSamplingFraction::m_x_mc_cc3
double m_x_mc_cc3
Definition: LArFCalSamplingFraction.h:111
LArFCalSamplingFraction::m_numHitsFCal
int m_numHitsFCal
Definition: LArFCalSamplingFraction.h:152
LArFCalSamplingFraction::m_FCalDead
double m_FCalDead
Definition: LArFCalSamplingFraction.h:181
GenEvent.h
LArFCalSamplingFraction::m_x_mc_cc1
double m_x_mc_cc1
Definition: LArFCalSamplingFraction.h:105
CaloCalibrationHit.h
LArFCalSamplingFraction::m_FCal3Active
double m_FCal3Active
Definition: LArFCalSamplingFraction.h:205
TileDCSDataPlotter.max1
max1
Definition: TileDCSDataPlotter.py:884
LArFCalSamplingFraction::m_hit_y2
std::vector< double > * m_hit_y2
Definition: LArFCalSamplingFraction.h:129
CaloCalibrationHit::energyNonEM
double energyNonEM() const
Definition: CaloCalibrationHit.h:110
LArFCalSamplingFraction::m_y_mc_cc2
double m_y_mc_cc2
Definition: LArFCalSamplingFraction.h:109
LArFCalSamplingFraction::m_FCalNonEm
double m_FCalNonEm
Definition: LArFCalSamplingFraction.h:190
WriteCellNoiseToCool.icell
icell
Definition: WriteCellNoiseToCool.py:339
LArFCalSamplingFraction::m_FCal2Active
double m_FCal2Active
Definition: LArFCalSamplingFraction.h:204
SG::ReadCondHandle
Definition: ReadCondHandle.h:44
ATH_MSG_INFO
#define ATH_MSG_INFO(x)
Definition: AthMsgStreamMacros.h:31
xAOD::EventInfo_v1::eventNumber
uint64_t eventNumber() const
The current event's event number.
CaloDetDescrElement::y
float y() const
cell y
Definition: Calorimeter/CaloDetDescr/CaloDetDescr/CaloDetDescrElement.h:365
AtlasDetectorID::is_lar_fcal
bool is_lar_fcal(Identifier id) const
Definition: AtlasDetectorID.h:839
LArFCalSamplingFraction::m_FCal1Active
double m_FCal1Active
Definition: LArFCalSamplingFraction.h:203
LArFCalSamplingFraction::m_hit_ieta2
std::vector< double > * m_hit_ieta2
Definition: LArFCalSamplingFraction.h:136
SG::ReadHandle
Definition: StoreGate/StoreGate/ReadHandle.h:70
AthCommonDataStore< AthCommonMsg< Algorithm > >::declareProperty
Gaudi::Details::PropertyBase & declareProperty(Gaudi::Property< T > &t)
Definition: AthCommonDataStore.h:145
LArFCalSamplingFraction::m_totalInvisibleEnergy
double m_totalInvisibleEnergy
Definition: LArFCalSamplingFraction.h:160
GenVertex.h
CaloDetDescrElement
This class groups all DetDescr information related to a CaloCell. Provides a generic interface for al...
Definition: Calorimeter/CaloDetDescr/CaloDetDescr/CaloDetDescrElement.h:66
LArFCalSamplingFraction::m_FCalEscaped
double m_FCalEscaped
Definition: LArFCalSamplingFraction.h:198
CaloDetDescrManager_Base::get_element
const CaloDetDescrElement * get_element(const Identifier &cellId) const
get element by its identifier
Definition: CaloDetDescrManager.cxx:159
LArFCalSamplingFraction::m_FCal2Inactive
double m_FCal2Inactive
Definition: LArFCalSamplingFraction.h:207
LArFCalSamplingFraction::doFCal
StatusCode doFCal()
The main FCal analysis method.
Definition: LArFCalSamplingFraction.cxx:804
LArFCalSamplingFraction::m_E
double m_E
Definition: LArFCalSamplingFraction.h:99
LArFCalSamplingFraction::m_FCal1Inactive
double m_FCal1Inactive
Definition: LArFCalSamplingFraction.h:206
LArFCalSamplingFraction::FCalCalibAnalysis
void FCalCalibAnalysis(const std::string &name, const CaloCalibrationHit *CalibHit)
FCal Analysis with Calibration Hits on Added by JPA, June 2005.
Definition: LArFCalSamplingFraction.cxx:666
LArFCAL_Base_ID::module
int module(const Identifier id) const
module [1,3]
LArHitContainer
Hit collection.
Definition: LArHitContainer.h:26
CaloCalibrationHit::energyEM
double energyEM() const
Definition: CaloCalibrationHit.h:107
LArFCalSamplingFraction::m_eventTime
unsigned int m_eventTime
Definition: LArFCalSamplingFraction.h:81
LArFCalSamplingFraction::m_FCal3_SumE
double m_FCal3_SumE
Definition: LArFCalSamplingFraction.h:147
LArFCalSamplingFraction::m_cx3
double m_cx3
Definition: LArFCalSamplingFraction.h:224
CaloIdManager::getDM_ID
const CaloDM_ID * getDM_ID(void) const
Definition: CaloIdManager.cxx:69
CaloCalibrationHit::energyTotal
double energyTotal() const
Definition: CaloCalibrationHit.h:119
LArFCalSamplingFraction::m_pt
double m_pt
Definition: LArFCalSamplingFraction.h:94
LArFCalSamplingFraction::m_FCal2_SumE
double m_FCal2_SumE
Definition: LArFCalSamplingFraction.h:146
xAOD::identifier
identifier
Definition: UncalibratedMeasurement_v1.cxx:15
x
#define x
LArFCalSamplingFraction::LArFCalSamplingFraction
LArFCalSamplingFraction(const std::string &name, ISvcLocator *pSvcLocator)
Constructor.
Definition: LArFCalSamplingFraction.cxx:52
GenParticle.h
LArFCalSamplingFraction::TruthImpactPosition
void TruthImpactPosition(const HepMC::GenEvent *e)
Calculate truth impact position.
Definition: LArFCalSamplingFraction.cxx:738
LArFCalSamplingFraction::m_FCalEm
double m_FCalEm
Definition: LArFCalSamplingFraction.h:186
LArFCalSamplingFraction::m_NCell2
int m_NCell2
Definition: LArFCalSamplingFraction.h:102
CaloCalibrationHitContainer.h
xAOD::EventInfo_v1::runNumber
uint32_t runNumber() const
The current event's run number.
LArFCalSamplingFraction::m_hit_x1
std::vector< double > * m_hit_x1
Definition: LArFCalSamplingFraction.h:125
AthenaPoolTestRead.sc
sc
Definition: AthenaPoolTestRead.py:27
LArFCalSamplingFraction::~LArFCalSamplingFraction
~LArFCalSamplingFraction()
Destructor.
Definition: LArFCalSamplingFraction.cxx:65
LArFCalSamplingFraction::m_y_cc1
double m_y_cc1
Definition: LArFCalSamplingFraction.h:115
CaloCell_ID.h
LArFCalSamplingFraction::m_NCell3
int m_NCell3
Definition: LArFCalSamplingFraction.h:103
AthCommonDataStore< AthCommonMsg< Algorithm > >::detStore
const ServiceHandle< StoreGateSvc > & detStore() const
The standard StoreGateSvc/DetectorStore Returns (kind of) a pointer to the StoreGateSvc.
Definition: AthCommonDataStore.h:95
LArFCalSamplingFraction::m_vertex_phi
double m_vertex_phi
Definition: LArFCalSamplingFraction.h:92
LArFCalSamplingFraction::m_FCal1Escaped
double m_FCal1Escaped
Definition: LArFCalSamplingFraction.h:199
LArFCalSamplingFraction::m_numHitsActive
int m_numHitsActive
Definition: LArFCalSamplingFraction.h:169
LArG4TBPosOptions.h
LArFCalSamplingFraction::m_hit_y1
std::vector< double > * m_hit_y1
Definition: LArFCalSamplingFraction.h:126
LArFCalSamplingFraction::FCalClusterCenter
void FCalClusterCenter(const LArHitContainer *container, const CaloDetDescrManager *caloMgr)
Calculate FCal cluster center.
Definition: LArFCalSamplingFraction.cxx:469
AthCommonDataStore< AthCommonMsg< Algorithm > >::evtStore
ServiceHandle< StoreGateSvc > & evtStore()
The standard StoreGateSvc (event store) Returns (kind of) a pointer to the StoreGateSvc.
Definition: AthCommonDataStore.h:85
LArFCalSamplingFraction::initialize
virtual StatusCode initialize() override
Initialize.
Definition: LArFCalSamplingFraction.cxx:73
LArFCalSamplingFraction::m_numHitsInactive
int m_numHitsInactive
Definition: LArFCalSamplingFraction.h:170
LArFCalSamplingFraction::m_totalFCal2CalibrationEnergy
double m_totalFCal2CalibrationEnergy
Definition: LArFCalSamplingFraction.h:176
LArFCalSamplingFraction::m_totalEmEnergy
double m_totalEmEnergy
Definition: LArFCalSamplingFraction.h:158
SimpleVector.h
LArFCalSamplingFraction::m_x_cc2
double m_x_cc2
Definition: LArFCalSamplingFraction.h:117
ATH_MSG_ERROR
#define ATH_MSG_ERROR(x)
Definition: AthMsgStreamMacros.h:33
LArFCalSamplingFraction::m_totalFCalCalibrationEnergy
double m_totalFCalCalibrationEnergy
Definition: LArFCalSamplingFraction.h:174
LArFCalSamplingFraction::FillCellInfo
void FillCellInfo(const CaloDetDescrElement *caloDDE, double energy, std::vector< double > *cell_E, std::vector< double > *hit_x, std::vector< double > *hit_y, std::vector< double > *hit_ieta, std::vector< double > *hit_iphi, int &NCell)
Fill FCal cell information.
Definition: LArFCalSamplingFraction.cxx:926
ParticleGun_FastCalo_ChargeFlip_Config.energy
energy
Definition: ParticleGun_FastCalo_ChargeFlip_Config.py:78
CaloIdManager
This class initializes the Calo (LAr and Tile) offline identifiers.
Definition: CaloIdManager.h:45
LArFCalSamplingFraction::m_hit_x3
std::vector< double > * m_hit_x3
Definition: LArFCalSamplingFraction.h:131
LArFCalSamplingFraction::m_FCal3Inactive
double m_FCal3Inactive
Definition: LArFCalSamplingFraction.h:208
ParticleGun_EoverP_Config.momentum
momentum
Definition: ParticleGun_EoverP_Config.py:63
LArFCalSamplingFraction::m_pz
double m_pz
Definition: LArFCalSamplingFraction.h:97
LArFCalSamplingFraction::m_FCal1Em
double m_FCal1Em
Definition: LArFCalSamplingFraction.h:187
McEventCollection.h
LArFCalSamplingFraction::m_totalFCalEnergy
double m_totalFCalEnergy
Definition: LArFCalSamplingFraction.h:151
LArFCalSamplingFraction::m_FCalActive
double m_FCalActive
Definition: LArFCalSamplingFraction.h:179
LArFCalSamplingFraction::m_TCIron_E
double m_TCIron_E
Definition: LArFCalSamplingFraction.h:149
LArFCalSamplingFraction::m_eventWeight
double m_eventWeight
Definition: LArFCalSamplingFraction.h:84
Identifier
Definition: DetectorDescription/Identifier/Identifier/Identifier.h:32
FCALTile.h
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition: PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22
LArFCalSamplingFraction::m_cell1_E
std::vector< double > * m_cell1_E
Definition: LArFCalSamplingFraction.h:141
ATH_MSG_DEBUG
#define ATH_MSG_DEBUG(x)
Definition: AthMsgStreamMacros.h:29
LArFCalSamplingFraction::m_totalInactiveEnergy
double m_totalInactiveEnergy
Definition: LArFCalSamplingFraction.h:165
LArFCalSamplingFraction::m_FCalInactive
double m_FCalInactive
Definition: LArFCalSamplingFraction.h:180
LArFCalSamplingFraction::m_y_mc_cc3
double m_y_mc_cc3
Definition: LArFCalSamplingFraction.h:112
CaloIdManager::getFCAL_ID
const LArFCAL_ID * getFCAL_ID(void) const
Definition: CaloIdManager.cxx:85
LArFCalSamplingFraction::addEventInfo
StatusCode addEventInfo()
methods called by execute()
Definition: LArFCalSamplingFraction.cxx:989
LArFCalSamplingFraction::m_caloCellID
const CaloCell_ID * m_caloCellID
Definition: LArFCalSamplingFraction.h:211
LArFCalSamplingFraction::m_FCal3Escaped
double m_FCal3Escaped
Definition: LArFCalSamplingFraction.h:201
MuonSegmentReaderConfig.histSvc
histSvc
Definition: MuonSegmentReaderConfig.py:96
LArFCalSamplingFraction::m_TCScint_E
double m_TCScint_E
Definition: LArFCalSamplingFraction.h:148
CaloDM_ID::is_lar
bool is_lar(const Identifier &zoneId) const
to disentangle between LAr and Tile dead material
Definition: CaloDM_ID.h:496
LArFCalSamplingFraction::m_FCal2Em
double m_FCal2Em
Definition: LArFCalSamplingFraction.h:188
LArFCalSamplingFraction::m_hit_iphi3
std::vector< double > * m_hit_iphi3
Definition: LArFCalSamplingFraction.h:139
LArFCalSamplingFraction::m_FCalActiveEm
double m_FCalActiveEm
Definition: LArFCalSamplingFraction.h:182
ATH_CHECK
#define ATH_CHECK
Definition: AthCheckMacros.h:40
LArFCalSamplingFraction::m_numHitsDead
int m_numHitsDead
Definition: LArFCalSamplingFraction.h:171
CaloCalibrationHit::energyInvisible
double energyInvisible() const
Definition: CaloCalibrationHit.h:113
CHECK
#define CHECK(...)
Evaluate an expression and check for errors.
Definition: Control/AthenaKernel/AthenaKernel/errorcheck.h:422
LArFCalSamplingFraction::m_totalNonEmEnergy
double m_totalNonEmEnergy
Definition: LArFCalSamplingFraction.h:159
LArFCalSamplingFraction::m_totalFCal3CalibrationEnergy
double m_totalFCal3CalibrationEnergy
Definition: LArFCalSamplingFraction.h:177
LArFCalSamplingFraction::m_cx1
double m_cx1
Definition: LArFCalSamplingFraction.h:224
drawFromPickle.tan
tan
Definition: drawFromPickle.py:36
SG::VarHandleKey::initialize
StatusCode initialize(bool used=true)
If this object is used as a property, then this should be called during the initialize phase.
Definition: AthToolSupport/AsgDataHandles/Root/VarHandleKey.cxx:103
McEventCollection
This defines the McEventCollection, which is really just an ObjectVector of McEvent objects.
Definition: McEventCollection.h:33
CaloDetDescrElement::is_lar_fcal
bool is_lar_fcal() const
cell belongs to FCAL
Definition: CaloDetDescrElement.cxx:138
LArFCalSamplingFraction::m_x_cc1
double m_x_cc1
Definition: LArFCalSamplingFraction.h:114
LArFCalSamplingFraction::m_runNumber
unsigned int m_runNumber
Definition: LArFCalSamplingFraction.h:79
xAOD::EventInfo_v1::lumiBlock
uint32_t lumiBlock() const
The current event's luminosity block number.
CaloDM_ID.h
LArFCalSamplingFraction::m_FCal1NonEm
double m_FCal1NonEm
Definition: LArFCalSamplingFraction.h:191
CaloCalibrationHit::cellID
Identifier cellID() const
Definition: CaloCalibrationHit.h:104
AthAlgorithm
Definition: AthAlgorithm.h:47
SG::ReadHandle::isValid
virtual bool isValid() override final
Can the handle be successfully dereferenced?
LArFCalSamplingFraction::m_cy3
double m_cy3
Definition: LArFCalSamplingFraction.h:225
LArFCalSamplingFraction::m_eventNumber
unsigned int m_eventNumber
Definition: LArFCalSamplingFraction.h:80
LArFCalSamplingFraction::m_cy2
double m_cy2
Definition: LArFCalSamplingFraction.h:225
LArFCalSamplingFraction::m_vertx
double m_vertx
Definition: LArFCalSamplingFraction.h:87
LArFCalSamplingFraction::m_hit_ieta3
std::vector< double > * m_hit_ieta3
Definition: LArFCalSamplingFraction.h:138
LArFCalSamplingFraction::m_y_cc3
double m_y_cc3
Definition: LArFCalSamplingFraction.h:121
LArFCalSamplingFraction::m_calibrationRun
bool m_calibrationRun
Definition: LArFCalSamplingFraction.h:215
CaloCalibrationHit
Class to store calorimeter calibration hit.
Definition: CaloCalibrationHit.h:21
LArFCalSamplingFraction::m_FCalActiveEscaped
double m_FCalActiveEscaped
Definition: LArFCalSamplingFraction.h:185
LArFCalSamplingFraction::m_FCal1_SumE
double m_FCal1_SumE
Definition: LArFCalSamplingFraction.h:145
LArFCalSamplingFraction::m_FCalActiveNonEm
double m_FCalActiveNonEm
Definition: LArFCalSamplingFraction.h:183
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:195
CaloIdManager::getCaloCell_ID
const CaloCell_ID * getCaloCell_ID(void) const
Access to IdHelper.
Definition: CaloIdManager.cxx:63
LArFCalSamplingFraction::m_y_cc2
double m_y_cc2
Definition: LArFCalSamplingFraction.h:118
LArFCalSamplingFraction::FCalHitCenter
void FCalHitCenter(const LArHitContainer *container, const CaloDetDescrManager *caloMgr)
Calculate FCal hit center.
Definition: LArFCalSamplingFraction.cxx:413
SG::CondHandleKey::initialize
StatusCode initialize(bool used=true)
LArFCalSamplingFraction::m_x_mc_cc2
double m_x_mc_cc2
Definition: LArFCalSamplingFraction.h:108
CaloDM_ID::sampling
int sampling(const Identifier &id) const
return sampling according to :
Definition: CaloDM_ID.h:645
LArFCalSamplingFraction::m_verty
double m_verty
Definition: LArFCalSamplingFraction.h:88
LArHit
Class to store hit energy and time in LAr cell from G4 simulation.
Definition: LArHit.h:25
LArFCalSamplingFraction::m_x_cc3
double m_x_cc3
Definition: LArFCalSamplingFraction.h:120
LArFCalSamplingFraction::finalize
virtual StatusCode finalize() override
Finalize.
Definition: LArFCalSamplingFraction.cxx:268
CaloDetDescrElement::x
float x() const
cell x
Definition: Calorimeter/CaloDetDescr/CaloDetDescr/CaloDetDescrElement.h:363
LArFCalSamplingFraction::m_lumiBlock
unsigned int m_lumiBlock
Definition: LArFCalSamplingFraction.h:82
python.SystemOfUnits.mm
int mm
Definition: SystemOfUnits.py:83
LArHit.h
LArFCalSamplingFraction::initEvent
virtual StatusCode initEvent()
Init event.
Definition: LArFCalSamplingFraction.cxx:278
LArFCalSamplingFraction::m_py
double m_py
Definition: LArFCalSamplingFraction.h:96
LArFCalSamplingFraction::m_FCal1Invisible
double m_FCal1Invisible
Definition: LArFCalSamplingFraction.h:195
DiTauMassTools::MaxHistStrategyV2::e
e
Definition: PhysicsAnalysis/TauID/DiTauMassTools/DiTauMassTools/HelperFunctions.h:26
LArFCalSamplingFraction::m_eventInfoKey
SG::ReadHandleKey< xAOD::EventInfo > m_eventInfoKey
Definition: LArFCalSamplingFraction.h:69
LArFCalSamplingFraction::m_y_mc_cc1
double m_y_mc_cc1
Definition: LArFCalSamplingFraction.h:106
CaloDetDescrElement::getLayer
virtual int getLayer() const
cell layer
Definition: CaloDetDescrElement.cxx:85
LArFCalSamplingFraction::m_hit_ieta1
std::vector< double > * m_hit_ieta1
Definition: LArFCalSamplingFraction.h:134
y
#define y
CaloDetDescrManager
This class provides the client interface for accessing the detector description information common to...
Definition: CaloDetDescrManager.h:473
AthenaHitsVector::Size
int Size() const
Definition: AthenaHitsVector.h:96
LArFCalSamplingFraction::m_vertex_eta
double m_vertex_eta
Definition: LArFCalSamplingFraction.h:91
LArFCalSamplingFraction::m_hit_y3
std::vector< double > * m_hit_y3
Definition: LArFCalSamplingFraction.h:132
LArFCalSamplingFraction::doCalib
StatusCode doCalib()
Calibration hit analysis.
Definition: LArFCalSamplingFraction.cxx:556
LArFCalSamplingFraction::m_cx2
double m_cx2
Definition: LArFCalSamplingFraction.h:224
LArFCalSamplingFraction::m_hit_iphi2
std::vector< double > * m_hit_iphi2
Definition: LArFCalSamplingFraction.h:137
ATH_MSG_WARNING
#define ATH_MSG_WARNING(x)
Definition: AthMsgStreamMacros.h:32
LArFCalSamplingFraction::m_FCal2Escaped
double m_FCal2Escaped
Definition: LArFCalSamplingFraction.h:200
LArHitContainer.h
LArFCalSamplingFraction::m_totalFCal1CalibrationEnergy
double m_totalFCal1CalibrationEnergy
Definition: LArFCalSamplingFraction.h:175
LArFCalSamplingFraction::m_bCID
unsigned int m_bCID
Definition: LArFCalSamplingFraction.h:83
LArFCalSamplingFraction::m_caloDmID
const CaloDM_ID * m_caloDmID
Definition: LArFCalSamplingFraction.h:210
python.CaloCondTools.log
log
Definition: CaloCondTools.py:20
LArFCalSamplingFraction::m_px
double m_px
Definition: LArFCalSamplingFraction.h:95
LArFCalSamplingFraction::m_totalEscapedEnergy
double m_totalEscapedEnergy
Definition: LArFCalSamplingFraction.h:161
LArFCalSamplingFraction::m_hit_iphi1
std::vector< double > * m_hit_iphi1
Definition: LArFCalSamplingFraction.h:135
xAOD::EventInfo_v1::timeStamp
uint32_t timeStamp() const
POSIX time in seconds from 1970. January 1st.
AthenaHitsVector::size
size_type size() const
Definition: AthenaHitsVector.h:151
CaloIdManager.h
LArFCalSamplingFraction::m_pdg_id
std::vector< int > * m_pdg_id
Definition: LArFCalSamplingFraction.h:123
LArFCalSamplingFraction::m_FCal3Invisible
double m_FCal3Invisible
Definition: LArFCalSamplingFraction.h:197
xAOD::EventInfo_v1::mcEventWeight
float mcEventWeight(size_t i=0) const
The weight of one specific MC event used in the simulation.
Definition: EventInfo_v1.cxx:203
LArFCalSamplingFraction::m_vertz
double m_vertz
Definition: LArFCalSamplingFraction.h:89
LArFCalSamplingFraction::m_FCal2NonEm
double m_FCal2NonEm
Definition: LArFCalSamplingFraction.h:192
LArFCalSamplingFraction::m_FCalActiveInvisible
double m_FCalActiveInvisible
Definition: LArFCalSamplingFraction.h:184
LArFCalSamplingFraction::m_hit_x2
std::vector< double > * m_hit_x2
Definition: LArFCalSamplingFraction.h:128
LArFCalSamplingFraction::m_FCalInvisible
double m_FCalInvisible
Definition: LArFCalSamplingFraction.h:194
LArFCalSamplingFraction::m_totalActiveEnergy
double m_totalActiveEnergy
Definition: LArFCalSamplingFraction.h:164
xAOD::EventInfo_v1::bcid
uint32_t bcid() const
The bunch crossing ID of the event.
LArFCalSamplingFraction::m_totalCalibrationEnergy
double m_totalCalibrationEnergy
Definition: LArFCalSamplingFraction.h:155
LArFCalSamplingFraction::m_NCell1
int m_NCell1
Definition: LArFCalSamplingFraction.h:101
LArFCalSamplingFraction::m_cy1
double m_cy1
Definition: LArFCalSamplingFraction.h:225
LArFCalSamplingFraction::m_cell3_E
std::vector< double > * m_cell3_E
Definition: LArFCalSamplingFraction.h:143
LArFCalSamplingFraction::m_PhysTotE
double m_PhysTotE
Definition: LArFCalSamplingFraction.h:202
LArFCalSamplingFraction::m_calibHitMap
m_calibHitMap_t m_calibHitMap
Definition: LArFCalSamplingFraction.h:221
CaloCalibrationHit::energyEscaped
double energyEscaped() const
Definition: CaloCalibrationHit.h:116
LArFCalSamplingFraction::m_tree_AS
TTree * m_tree_AS
Athena-Aware Ntuple (AAN) variables - branches of the AAN TTree.
Definition: LArFCalSamplingFraction.h:77
FCALModule.h
LArFCalSamplingFraction::m_FCal3NonEm
double m_FCal3NonEm
Definition: LArFCalSamplingFraction.h:193
ServiceHandle< ITHistSvc >
LArFCalSamplingFraction::m_cell2_E
std::vector< double > * m_cell2_E
Definition: LArFCalSamplingFraction.h:142
LArFCalSamplingFraction.h