ATLAS Offline Software
MMHitAnalysis.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 #include "MMHitAnalysis.h"
6 
7 
8 /*Includes specific to Micromegas*/
14 #include "MuonSimEvent/MMSimHit.h"
15 #include "CLHEP/Vector/LorentzVector.h"
16 
17 #include "TH1.h"
18 #include "TTree.h"
19 #include "TString.h"
20 
21 #include <algorithm>
22 #include <math.h>
23 #include <functional>
24 #include <iostream>
25 #include <stdio.h>
26 
27 using namespace std;
28 
29 MMHitAnalysis::MMHitAnalysis(const std::string& name, ISvcLocator* pSvcLocator)
30  : AthAlgorithm(name, pSvcLocator)
31  , m_h_S1_xy_A(0)
32  , m_h_S1_rz_A(0)
33  , m_h_S1_r_A(0)
34  , m_h_S1_xy_C(0)
35  , m_h_S1_rz_C(0)
36  , m_h_S1_r_C(0)
37  , m_h_S2_xy_A(0)
38  , m_h_S2_rz_A(0)
39  , m_h_S2_r_A(0)
40  , m_h_S2_xy_C(0)
41  , m_h_S2_rz_C(0)
42  , m_h_S2_r_C(0)
43  , m_h_S_xy_A(0)
44  , m_h_S_xy_C(0)
45  , m_h_S_rz_A(0)
46  , m_h_S_rz_C(0)
47  , m_h_xy_A(0)
48  , m_h_xy_C(0)
49  , m_h_rz_A(0)
50  , m_h_rz_C(0)
51  , m_h_L1_xy_A(0)
52  , m_h_L1_rz_A(0)
53  , m_h_L1_r_A(0)
54  , m_h_L1_xy_C(0)
55  , m_h_L1_rz_C(0)
56  , m_h_L1_r_C(0)
57  , m_h_L2_xy_A(0)
58  , m_h_L2_rz_A(0)
59  , m_h_L2_r_A(0)
60  , m_h_L2_xy_C(0)
61  , m_h_L2_rz_C(0)
62  , m_h_L2_r_C(0)
63  , m_h_L_xy_A(0)
64  , m_h_L_xy_C(0)
65  , m_h_L_rz_A(0)
66  , m_h_L_rz_C(0)
67  , m_hits_x(0)
68  , m_ntupleFileName("MMHitAnalysis/ntuple/")
69  , m_path("/MMHitAnalysis/histos/")
70  , m_thistSvc("THistSvc", name)
71 {
72  declareProperty("NtupleFileName", m_ntupleFileName);
73  declareProperty("HistPath", m_path);
74 
75 }
76 
78  ATH_MSG_DEBUG( "Initializing MMHitAnalysis" );
79 
80 // Grab the Ntuple and histogramming service for the tree
81  CHECK(m_thistSvc.retrieve());
82 
83 
86 /*-----------------------------------Small sector Wedge 1 histos begin--------------------------------------*/
87  m_h_S1_xy_A = new TH2D("h_mm_S1_xy_A","S1_xy_A", 1200,-6000., 6000., 1200, -6000., 6000.);
88  m_h_S1_xy_A->StatOverflows();
89  CHECK(m_thistSvc->regHist(m_path + m_h_S1_xy_A->GetName(), m_h_S1_xy_A));
90 
91  m_h_S1_rz_A = new TH2D("h_mm_S1_rz_A","S1_rz_A", 1000,7000., 8000., 5000, 0., 5000.);
92  m_h_S1_rz_A->StatOverflows();
93  CHECK(m_thistSvc->regHist(m_path + m_h_S1_rz_A->GetName(), m_h_S1_rz_A));
94 
95  m_h_S1_r_A = new TH1D("h_mm_S1_r_A","S1_r_A", 1000,0., 14000.);
96  m_h_S1_r_A->StatOverflows();
97  CHECK(m_thistSvc->regHist(m_path + m_h_S1_r_A->GetName(), m_h_S1_r_A));
98 
99  m_h_S1_xy_C = new TH2D("h_mm_S1_xy_C","S1_xy_C", 1200,-6000., 6000., 1200, -6000., 6000.);
100  m_h_S1_xy_C->StatOverflows();
101  CHECK(m_thistSvc->regHist(m_path + m_h_S1_xy_C->GetName(), m_h_S1_xy_C));
102 
103  m_h_S1_rz_C = new TH2D("h_mm_S1_rz_C","S1_rz_C", 1000,-8000., -7000., 5000, 0., 5000.);
104  m_h_S1_rz_C->StatOverflows();
105  CHECK(m_thistSvc->regHist(m_path + m_h_S1_rz_C->GetName(), m_h_S1_rz_C));
106 
107  m_h_S1_r_C = new TH1D("h_mm_S1_r_C","S1_r_C", 1000,0., 14000.);
108  m_h_S1_r_C->StatOverflows();
109  CHECK(m_thistSvc->regHist(m_path + m_h_S1_r_C->GetName(), m_h_S1_r_C));
110  /*-----------------------------------Small sector Wedge 1 histos end--------------------------------------*/
111 
112  /*-----------------------------------Small sector Wedge 2 histos begin--------------------------------------*/
113  m_h_S2_xy_A = new TH2D("h_mm_S2_xy_A","S2_xy_A", 1200,-6000., 6000., 1200, -6000., 6000.);
114  m_h_S2_xy_A->StatOverflows();
115  CHECK(m_thistSvc->regHist(m_path + m_h_S2_xy_A->GetName(), m_h_S2_xy_A));
116 
117  m_h_S2_rz_A = new TH2D("h_mm_S2_rz_A","S2_rz_A", 1000,7000., 8000., 5000, 0., 5000.);
118  m_h_S2_rz_A->StatOverflows();
119  CHECK(m_thistSvc->regHist(m_path + m_h_S2_rz_A->GetName(), m_h_S2_rz_A));
120 
121  m_h_S2_r_A = new TH1D("h_mm_S2_r_A","S2_r_A", 1000,0., 14000.);
122  m_h_S2_r_A->StatOverflows();
123  CHECK(m_thistSvc->regHist(m_path + m_h_S2_r_A->GetName(), m_h_S2_r_A));
124 
125  m_h_S2_xy_C = new TH2D("h_mm_S2_xy_C","S2_xy_C", 1200,-6000., 6000., 1200, -6000., 6000.);
126  m_h_S2_xy_C->StatOverflows();
127  CHECK(m_thistSvc->regHist(m_path + m_h_S2_xy_C->GetName(), m_h_S2_xy_C));
128 
129  m_h_S2_rz_C = new TH2D("h_mm_S2_rz_C","S2_rz_C", 1000,-8000., -7000., 5000, 0., 5000.);
130  m_h_S2_rz_C->StatOverflows();
131  CHECK(m_thistSvc->regHist(m_path + m_h_S2_rz_C->GetName(), m_h_S2_rz_C));
132 
133  m_h_S2_r_C = new TH1D("h_mm_S2_r_C","S2_r_C", 1000,0., 14000.);
134  m_h_S2_r_C->StatOverflows();
135  CHECK(m_thistSvc->regHist(m_path + m_h_S2_r_C->GetName(), m_h_S2_r_C));
136 /*---------------------------------Small sector Wedge 2 histos end--------------------------------------*/
137 
138 /*-----------------------------------Small sector both Wedges histos begin--------------------------------------*/
139  m_h_S_xy_A = new TH2D("h_mm_S_xy_A","S_xy_A", 1200,-6000., 6000., 1200, -6000., 6000.);
140  m_h_S_xy_A->StatOverflows();
141  CHECK(m_thistSvc->regHist(m_path + m_h_S_xy_A->GetName(), m_h_S_xy_A));
142 
143  m_h_S_xy_C = new TH2D("h_mm_S_xy_C","S_xy_C", 1200,-6000., 6000., 1200, -6000., 6000.);
144  m_h_S_xy_C->StatOverflows();
145  CHECK(m_thistSvc->regHist(m_path + m_h_S_xy_C->GetName(), m_h_S_xy_C));
146 
147  m_h_S_rz_A = new TH2D("h_mm_S_rz_A","S_rz_A", 1000,7000., 8000., 5000, 0., 5000.);
148  m_h_S_rz_A->StatOverflows();
149  CHECK(m_thistSvc->regHist(m_path + m_h_S_rz_A->GetName(), m_h_S_rz_A));
150 
151  m_h_S_rz_C = new TH2D("h_mm_S_rz_C","S_rz_C", 1000,-8000., -7000., 5000, 0., 5000.);
152  m_h_S_rz_C->StatOverflows();
153  CHECK(m_thistSvc->regHist(m_path + m_h_S_rz_C->GetName(), m_h_S_rz_C));
154  /*---------------------------------Small sector both Wedges histos end--------------------------------------*/
155 
156  /*-----------------------------------All sector histos begin--------------------------------------*/
157  m_h_xy_A = new TH2D("h_mm_xy_A","xy_A", 1200,-6000., 6000., 1200, -6000., 6000.);
158  m_h_xy_A->StatOverflows();
159  CHECK(m_thistSvc->regHist(m_path + m_h_xy_A->GetName(), m_h_xy_A));
160 
161  m_h_xy_C = new TH2D("h_mm_xy_C","xy_C", 1200,-6000., 6000., 1200, -6000., 6000.);
162  m_h_xy_C->StatOverflows();
163  CHECK(m_thistSvc->regHist(m_path + m_h_xy_C->GetName(), m_h_xy_C));
164 
165  m_h_rz_A = new TH2D("h_mm_rz_A","rz_A", 1000,7000., 8000., 5000, 0., 5000.);
166  m_h_rz_A->StatOverflows();
167  CHECK(m_thistSvc->regHist(m_path + m_h_rz_A->GetName(), m_h_rz_A));
168 
169  m_h_rz_C = new TH2D("h_mm_rz_C","rz_C", 1000,-8000., -7000., 5000, 0., 5000.);
170  m_h_rz_C->StatOverflows();
171  CHECK(m_thistSvc->regHist(m_path + m_h_rz_C->GetName(), m_h_rz_C));
172  /*---------------------------------All sector histos end-------------------------------------------*/
173 
174  /*-----------------------------------Large sector Wedge 1 histos begin--------------------------------------*/
175  m_h_L1_xy_A = new TH2D("h_mm_L1_xy_A","L1_xy_A", 1200,-6000., 6000., 1200, -6000., 6000.);
176  m_h_L1_xy_A->StatOverflows();
177  CHECK(m_thistSvc->regHist(m_path + m_h_L1_xy_A->GetName(), m_h_L1_xy_A));
178 
179  m_h_L1_rz_A = new TH2D("h_mm_L1_rz_A","L1_rz_A", 1000,7000., 8000., 5000, 0., 5000.);
180  m_h_L1_rz_A->StatOverflows();
181  CHECK(m_thistSvc->regHist(m_path + m_h_L1_rz_A->GetName(), m_h_L1_rz_A));
182 
183  m_h_L1_r_A = new TH1D("h_mm_L1_r_A","L1_r_A", 1000,0., 14000.);
184  m_h_L1_r_A->StatOverflows();
185  CHECK(m_thistSvc->regHist(m_path + m_h_L1_r_A->GetName(), m_h_L1_r_A));
186 
187  m_h_L1_xy_C = new TH2D("h_mm_L1_xy_C","L1_xy_C", 1200,-6000., 6000., 1200, -6000., 6000.);
188  m_h_L1_xy_C->StatOverflows();
189  CHECK(m_thistSvc->regHist(m_path + m_h_L1_xy_C->GetName(), m_h_L1_xy_C));
190 
191  m_h_L1_rz_C = new TH2D("h_mm_L1_rz_C","L1_rz_C", 1000,-8000., -7000., 5000, 0., 5000.);
192  m_h_L1_rz_C->StatOverflows();
193  CHECK(m_thistSvc->regHist(m_path + m_h_L1_rz_C->GetName(), m_h_L1_rz_C));
194 
195  m_h_L1_r_C = new TH1D("h_mm_L1_r_C","L1_r_C", 1000,0., 14000.);
196  m_h_L1_r_C->StatOverflows();
197  CHECK(m_thistSvc->regHist(m_path + m_h_L1_r_C->GetName(), m_h_L1_r_C));
198  /*-----------------------------------Large sector Wedge 1 histos end--------------------------------------*/
199 
200  /*-----------------------------------Large sector Wedge 2 histos begin--------------------------------------*/
201  m_h_L2_xy_A = new TH2D("h_mm_L2_xy_A","L2_xy_A", 1200,-6000., 6000., 1200, -6000., 6000.);
202  m_h_L2_xy_A->StatOverflows();
203  CHECK(m_thistSvc->regHist(m_path + m_h_L2_xy_A->GetName(), m_h_L2_xy_A));
204 
205  m_h_L2_rz_A = new TH2D("h_mm_L2_rz_A","L2_rz_A", 1000,7000., 8000., 5000, 0., 5000.);
206  m_h_L2_rz_A->StatOverflows();
207  CHECK(m_thistSvc->regHist(m_path + m_h_L2_rz_A->GetName(), m_h_L2_rz_A));
208 
209  m_h_L2_r_A = new TH1D("h_mm_L2_r_A","L2_r_A", 1000,0., 14000.);
210  m_h_L2_r_A->StatOverflows();
211  CHECK(m_thistSvc->regHist(m_path + m_h_L2_r_A->GetName(), m_h_L2_r_A));
212 
213  m_h_L2_xy_C = new TH2D("h_mm_L2_xy_C","L2_xy_C", 1200,-6000., 6000., 1200, -6000., 6000.);
214  m_h_L2_xy_C->StatOverflows();
215  CHECK(m_thistSvc->regHist(m_path + m_h_L2_xy_C->GetName(), m_h_L2_xy_C));
216 
217  m_h_L2_rz_C = new TH2D("h_mm_L2_rz_C","L2_rz_C", 1000,-8000., -7000., 5000, 0., 5000.);
218  m_h_L2_rz_C->StatOverflows();
219  CHECK(m_thistSvc->regHist(m_path + m_h_L2_rz_C->GetName(), m_h_L2_rz_C));
220 
221  m_h_L2_r_C = new TH1D("h_mm_L2_r_C","L2_r_C", 1000,0., 14000.);
222  m_h_L2_r_C->StatOverflows();
223  CHECK(m_thistSvc->regHist(m_path + m_h_L2_r_C->GetName(), m_h_L2_r_C));
224  /*-----------------------------------Large sector Wedge 1 histos end--------------------------------------*/
225 
226  /*-----------------------------------Large sector both Wedge histos begin--------------------------------------*/
227  m_h_L_xy_A = new TH2D("h_mm_L_xy_A","L_xy_A", 1200,-6000., 6000., 1200, -6000., 6000.);
228  m_h_L_xy_A->StatOverflows();
229  CHECK(m_thistSvc->regHist(m_path + m_h_L_xy_A->GetName(), m_h_L_xy_A));
230 
231  m_h_L_rz_A = new TH2D("h_mm_L_rz_A","L_rz_A", 1000,7000., 8000., 5000, 0., 5000.);
232  m_h_L_rz_A->StatOverflows();
233  CHECK(m_thistSvc->regHist(m_path + m_h_L_rz_A->GetName(), m_h_L_rz_A));
234 
235  m_h_L_xy_C = new TH2D("h_mm_L_xy_C","L_xy_C", 1200,-6000., 6000., 1200, -6000., 6000.);
236  m_h_L_xy_C->StatOverflows();
237  CHECK(m_thistSvc->regHist(m_path + m_h_L_xy_C->GetName(), m_h_L_xy_C));
238 
239  m_h_L_rz_C = new TH2D("h_mm_L_rz_C","L_rz_C", 1000,-8000., -7000., 5000, 0., 5000.);
240  m_h_L_rz_C->StatOverflows();
241  CHECK(m_thistSvc->regHist(m_path + m_h_L_rz_C->GetName(), m_h_L_rz_C));
242  /*-----------------------------------Large sector both Wedge histos end--------------------------------------*/
243 
244  m_tree= new TTree("NtupleMMHitAnalysis","MMHitAna");
245  std::string fullNtupleName = "/"+m_ntupleFileName+"/";
246  CHECK(m_thistSvc->regTree(fullNtupleName,m_tree));
247 
248 
251  if (m_tree){
252  m_tree->Branch("x", &m_hits_x);
253  }
254  else{
255  ATH_MSG_ERROR("No tree found!");
256  }
257 
258  return StatusCode::SUCCESS;
259 }
260 
262  ATH_MSG_DEBUG( "In MMHitAnalysis::execute()" );
263 
264  m_hits_x->clear();
265 
266  const MMSimHitCollection* p_collection;;
267  if ((evtStore()->retrieve(p_collection,"MM_Hits"))==StatusCode::SUCCESS) {
268  for (MMSimHitCollection::const_iterator i_hit = p_collection->begin(); i_hit != p_collection->end(); ++i_hit){
269 
270  Amg::Vector3D p = (*i_hit).globalPosition();
271  //Get station names and make plots for each sector
273  int simId = (*i_hit).MMId();
274  std::string sim_stationName = hitHelper->GetStationName(simId);
275  int sim_side = hitHelper->GetSide(simId);
276  //Declare station name strings
277  static const std::string s_m1s1("M1S1");
278  static const std::string s_m2s1("M2S1");
279  static const std::string s_m1s2("M1S2");
280  static const std::string s_m2s2("M2S2");
281  static const std::string s_m1l1("M1L1");
282  static const std::string s_m2l1("M2L1");
283  static const std::string s_m1l2("M1L2");
284  static const std::string s_m2l2("M2L2");
285 
286  //Small sectors
287  /*-------------------------Wedge 1 Fill histos begin-------------------------*/
288  //M1S1 (Note: M1->Module 1, S1->Small sector wedge 1)
289 
290  //Small sectors at +ve Z (A-Side)
291  if ((sim_stationName==s_m1s1 || sim_stationName==s_m2s1) && sim_side==1){
292  double r_S1_A = sqrt(p.x()*p.x()+p.y()*p.y()); //Evaluate r
293  m_h_S1_xy_A->Fill(p.x(),p.y());
294  m_h_S1_rz_A->Fill(p.z(), r_S1_A);
295  m_h_S1_r_A->Fill(r_S1_A);
296  }
297 
298  //Small sectors at -ve Z (C-Side)
299  if ((sim_stationName==s_m1s1 || sim_stationName==s_m2s1) && sim_side==-1){
300  double r_S1_C = sqrt(p.x()*p.x()+p.y()*p.y()); //Evaluate r
301  m_h_S1_xy_C->Fill(p.x(),p.y());
302  m_h_S1_rz_C->Fill(p.z(), r_S1_C);
303  m_h_S1_r_C->Fill(r_S1_C);
304  }
305 
306  /*------------------------Wedge 1 Fill histos end---------------------------*/
307 
308  /*------------------------- Wedge 2 Fill histos begin-------------------------*/
309  //Small sectors at +ve Z (A-Side)
310  if ((sim_stationName==s_m1s2 || sim_stationName==s_m2s2) && sim_side==1){
311  double r_S2_A = sqrt(p.x()*p.x()+p.y()*p.y()); //Evaluate r
312  m_h_S2_xy_A->Fill(p.x(),p.y());
313  m_h_S2_rz_A->Fill(p.z(), r_S2_A);
314  m_h_S2_r_A->Fill(r_S2_A);
315  }
316 
317  //Small sectors at -ve Z (C-Side)
318  if ((sim_stationName==s_m1s2 || sim_stationName==s_m2s2) && sim_side==-1){
319  double r_S2_C = sqrt(p.x()*p.x()+p.y()*p.y()); //Evaluate r
320  m_h_S2_xy_C->Fill(p.x(),p.y());
321  m_h_S2_rz_C->Fill(p.z(), r_S2_C);
322  m_h_S2_r_C->Fill(r_S2_C);
323  }
324 
325  /*------------------------Wedge 2 Fill histos end---------------------------*/
326 
327  /*------------------------- Small sectors both wedges Fill histos begin-------------------------*/
328  //Small sectors at +ve Z (A-Side)
329  if ((sim_stationName==s_m1s2 || sim_stationName==s_m2s2 || sim_stationName==s_m1s1 || sim_stationName==s_m2s1) && sim_side==1){
330  double r_S_A = sqrt(p.x()*p.x()+p.y()*p.y()); //Evaluate r
331  m_h_S_xy_A->Fill(p.x(),p.y());
332  m_h_S_rz_A->Fill(p.z(), r_S_A);
333  }
334 
335  //Small sectors at -ve Z (C-Side)
336  if ((sim_stationName==s_m1s2 || sim_stationName==s_m2s2 || sim_stationName==s_m1s1 || sim_stationName==s_m2s1) && sim_side==-1){
337  double r_S_C = sqrt(p.x()*p.x()+p.y()*p.y()); //Evaluate r
338  m_h_S_xy_C->Fill(p.x(),p.y());
339  m_h_S_rz_C->Fill(p.z(), r_S_C);
340  }
341  /*------------------------Small sectors both wedges Fill histos end---------------------------*/
342 
343  //All sectors
344  /*-------------------------All sectors Fill histos begin-------------------------*/
345  //Sectors at +ve Z (A-Side)
346  if (sim_side==1){
347  double r_A = sqrt(p.x()*p.x()+p.y()*p.y()); //Evaluate r
348  m_h_xy_A->Fill(p.x(),p.y());
349  m_h_rz_A->Fill(p.z(), r_A);
350  }
351 
352  //Sectors at -ve Z (C-Side)
353  if (sim_side==-1){
354  double r_C = sqrt(p.x()*p.x()+p.y()*p.y()); //Evaluate r
355  m_h_xy_C->Fill(p.x(),p.y());
356  m_h_rz_C->Fill(p.z(), r_C);
357  }
358  /*------------------------All sectors Fill histos end---------------------------*/
359 
360  //Large sectors
361  /*-------------------------Wedge 1 Fill histos begin-------------------------*/
362  //M1L1 (Note: M1->Module 1, L1->Large sector wedge 1)
363 
364  //Large sectors at +ve Z (A-Side)
365  if ((sim_stationName==s_m1l1 || sim_stationName==s_m2l1) && sim_side==1){
366  double r_L1_A = sqrt(p.x()*p.x()+p.y()*p.y()); //Evaluate r
367  m_h_L1_xy_A->Fill(p.x(),p.y());
368  m_h_L1_rz_A->Fill(p.z(), r_L1_A);
369  m_h_L1_r_A->Fill(r_L1_A);
370  }
371 
372  //Large sectors at -ve Z (C-Side)
373  if ((sim_stationName==s_m1l1 || sim_stationName==s_m2l1) && sim_side==-1){
374  double r_L1_C = sqrt(p.x()*p.x()+p.y()*p.y()); //Evaluate r
375  m_h_L1_xy_C->Fill(p.x(),p.y());
376  m_h_L1_rz_C->Fill(p.z(), r_L1_C);
377  m_h_L1_r_C->Fill(r_L1_C);
378  }
379 
380  /*------------------------Wedge 1 Fill histos end---------------------------*/
381 
382  /*-------------------------Wedge 2 Fill histos begin-------------------------*/
383  //M1L1 (Note: M1->Module 1, L1->Large sector wedge 1)
384 
385  //Large sectors at +ve Z (A-Side)
386  if ((sim_stationName==s_m1l2 || sim_stationName==s_m2l2) && sim_side==1){
387  double r_L2_A = sqrt(p.x()*p.x()+p.y()*p.y()); //Evaluate r
388  m_h_L2_xy_A->Fill(p.x(),p.y());
389  m_h_L2_rz_A->Fill(p.z(), r_L2_A);
390  m_h_L2_r_A->Fill(r_L2_A);
391  }
392 
393  //Large sectors at -ve Z (C-Side)
394  if ((sim_stationName==s_m1l2 || sim_stationName==s_m2l2) && sim_side==-1){
395  double r_L2_C = sqrt(p.x()*p.x()+p.y()*p.y()); //Evaluate r
396  m_h_L2_xy_C->Fill(p.x(),p.y());
397  m_h_L2_rz_C->Fill(p.z(), r_L2_C);
398  m_h_L2_r_C->Fill(r_L2_C);
399  }
400 
401  /*------------------------Wedge 2 Fill histos end---------------------------*/
402 
403  /*------------------------- Large sectors both wedges Fill histos begin-------------------------*/
404  //Large sectors at +ve Z (A-Side)
405  if ((sim_stationName==s_m1l2 || sim_stationName==s_m2l2 || sim_stationName==s_m1l1 || sim_stationName==s_m2l1) && sim_side==1){
406  double r_L_A = sqrt(p.x()*p.x()+p.y()*p.y()); //Evaluate r
407  m_h_L_xy_A->Fill(p.x(),p.y());
408  m_h_L_rz_A->Fill(p.z(), r_L_A);
409  }
410 
411  //Large sectors at -ve Z (C-Side)
412  if ((sim_stationName==s_m1l2 || sim_stationName==s_m2l2 || sim_stationName==s_m1l1 || sim_stationName==s_m2l1) && sim_side==-1){
413  double r_L_C = sqrt(p.x()*p.x()+p.y()*p.y()); //Evaluate r
414  m_h_L_xy_C->Fill(p.x(),p.y());
415  m_h_L_rz_C->Fill(p.z(), r_L_C);
416  }
417  /*------------------------Large sectors both wedges Fill histos end---------------------------*/
418 
419  m_hits_x->push_back(p.x());
420  }
421  } // End while hits
422 
423  if (m_tree) m_tree->Fill();
424 
425  return StatusCode::SUCCESS;
426 }
python.PyKernel.retrieve
def retrieve(aClass, aKey=None)
Definition: PyKernel.py:110
MicromegasHitIdHelper::GetSide
int GetSide(const int &hid) const
Definition: MicromegasHitIdHelper.cxx:94
MMHitAnalysis::m_h_S1_xy_C
TH2 * m_h_S1_xy_C
Definition: MMHitAnalysis.h:41
MMHitAnalysis::m_h_L2_rz_A
TH2 * m_h_L2_rz_A
Definition: MMHitAnalysis.h:67
MicromegasHitIdHelper::GetStationName
std::string GetStationName(const int &hid) const
Definition: MicromegasHitIdHelper.cxx:61
MMHitAnalysis::m_h_S1_xy_A
TH2 * m_h_S1_xy_A
Some variables.
Definition: MMHitAnalysis.h:38
MMHitAnalysis::m_h_xy_A
TH2 * m_h_xy_A
Definition: MMHitAnalysis.h:55
MMHitAnalysis::m_h_L_rz_A
TH2 * m_h_L_rz_A
Definition: MMHitAnalysis.h:75
MicromegasHitIdHelper.h
AthCommonDataStore< AthCommonMsg< Algorithm > >::declareProperty
Gaudi::Details::PropertyBase & declareProperty(Gaudi::Property< T > &t)
Definition: AthCommonDataStore.h:145
MMHitAnalysis::m_h_S2_xy_A
TH2 * m_h_S2_xy_A
Definition: MMHitAnalysis.h:44
MMHitAnalysis::m_h_L1_r_A
TH1 * m_h_L1_r_A
Definition: MMHitAnalysis.h:62
AtlasHitsVector
Definition: AtlasHitsVector.h:33
MMHitAnalysis::m_h_S2_xy_C
TH2 * m_h_S2_xy_C
Definition: MMHitAnalysis.h:47
GeoMuonHits.h
MMHitAnalysis.h
MMHitAnalysis::m_thistSvc
ServiceHandle< ITHistSvc > m_thistSvc
Definition: MMHitAnalysis.h:84
MMHitAnalysis::m_h_S1_rz_C
TH2 * m_h_S1_rz_C
Definition: MMHitAnalysis.h:42
MMHitAnalysis::m_h_L_xy_A
TH2 * m_h_L_xy_A
Definition: MMHitAnalysis.h:73
AtlasHitsVector::begin
const_iterator begin() const
Definition: AtlasHitsVector.h:131
AtlasHitsVector::const_iterator
CONT::const_iterator const_iterator
Definition: AtlasHitsVector.h:43
AthCommonDataStore< AthCommonMsg< Algorithm > >::evtStore
ServiceHandle< StoreGateSvc > & evtStore()
The standard StoreGateSvc (event store) Returns (kind of) a pointer to the StoreGateSvc.
Definition: AthCommonDataStore.h:85
MMReadoutElement.h
MMSimHit.h
python.utils.AtlRunQueryDQUtils.p
p
Definition: AtlRunQueryDQUtils.py:210
MMHitAnalysis::m_h_L1_rz_C
TH2 * m_h_L1_rz_C
Definition: MMHitAnalysis.h:64
ATH_MSG_ERROR
#define ATH_MSG_ERROR(x)
Definition: AthMsgStreamMacros.h:33
MMHitAnalysis::m_h_L1_xy_C
TH2 * m_h_L1_xy_C
Definition: MMHitAnalysis.h:63
MMHitAnalysis::m_h_S2_rz_A
TH2 * m_h_S2_rz_A
Definition: MMHitAnalysis.h:45
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition: PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22
ATH_MSG_DEBUG
#define ATH_MSG_DEBUG(x)
Definition: AthMsgStreamMacros.h:29
m_path
std::string m_path
the path being used
Definition: OutputStreamData.cxx:88
MMHitAnalysis::m_tree
TTree * m_tree
Definition: MMHitAnalysis.h:80
MMHitAnalysis::m_h_S_rz_A
TH2 * m_h_S_rz_A
Definition: MMHitAnalysis.h:52
CHECK
#define CHECK(...)
Evaluate an expression and check for errors.
Definition: Control/AthenaKernel/AthenaKernel/errorcheck.h:422
MMHitAnalysis::m_h_L2_xy_A
TH2 * m_h_L2_xy_A
Definition: MMHitAnalysis.h:66
MMHitAnalysis::m_h_S2_r_C
TH1 * m_h_S2_r_C
Definition: MMHitAnalysis.h:49
MMHitAnalysis::m_h_S1_r_C
TH1 * m_h_S1_r_C
Definition: MMHitAnalysis.h:43
MicromegasHitIdHelper
Definition: MicromegasHitIdHelper.h:13
MMHitAnalysis::m_path
std::string m_path
Definition: MMHitAnalysis.h:83
AthAlgorithm
Definition: AthAlgorithm.h:47
MMHitAnalysis::m_h_L1_xy_A
TH2 * m_h_L1_xy_A
Definition: MMHitAnalysis.h:60
MMHitAnalysis::m_h_L1_rz_A
TH2 * m_h_L1_rz_A
Definition: MMHitAnalysis.h:61
MMHitAnalysis::m_h_xy_C
TH2 * m_h_xy_C
Definition: MMHitAnalysis.h:56
MMHitAnalysis::m_h_L2_rz_C
TH2 * m_h_L2_rz_C
Definition: MMHitAnalysis.h:70
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:221
MMSimHitCollection.h
MMHitAnalysis::m_ntupleFileName
std::string m_ntupleFileName
Definition: MMHitAnalysis.h:81
MMHitAnalysis::m_h_S_xy_C
TH2 * m_h_S_xy_C
Definition: MMHitAnalysis.h:51
MMHitAnalysis::m_h_S2_rz_C
TH2 * m_h_S2_rz_C
Definition: MMHitAnalysis.h:48
Amg::Vector3D
Eigen::Matrix< double, 3, 1 > Vector3D
Definition: GeoPrimitives.h:47
MuonDetectorManager.h
MicromegasHitIdHelper::GetHelper
static const MicromegasHitIdHelper * GetHelper()
Definition: MicromegasHitIdHelper.cxx:25
MMHitAnalysis::m_h_S2_r_A
TH1 * m_h_S2_r_A
Definition: MMHitAnalysis.h:46
MMHitAnalysis::m_h_L_xy_C
TH2 * m_h_L_xy_C
Definition: MMHitAnalysis.h:74
MMHitAnalysis::m_h_L_rz_C
TH2 * m_h_L_rz_C
Definition: MMHitAnalysis.h:76
AtlasHitsVector::end
const_iterator end() const
Definition: AtlasHitsVector.h:134
MMHitAnalysis::m_h_S1_r_A
TH1 * m_h_S1_r_A
Definition: MMHitAnalysis.h:40
MMHitAnalysis::m_h_S_rz_C
TH2 * m_h_S_rz_C
Definition: MMHitAnalysis.h:53
MMHitAnalysis::MMHitAnalysis
MMHitAnalysis(const std::string &name, ISvcLocator *pSvcLocator)
Definition: MMHitAnalysis.cxx:29
MMHitAnalysis::m_h_rz_C
TH2 * m_h_rz_C
Definition: MMHitAnalysis.h:58
MMHitAnalysis::m_h_L1_r_C
TH1 * m_h_L1_r_C
Definition: MMHitAnalysis.h:65
MMHitAnalysis::m_h_S1_rz_A
TH2 * m_h_S1_rz_A
Definition: MMHitAnalysis.h:39
MMHitAnalysis::m_h_L2_r_A
TH1 * m_h_L2_r_A
Definition: MMHitAnalysis.h:68
MMHitAnalysis::m_hits_x
std::vector< float > * m_hits_x
Definition: MMHitAnalysis.h:78
MMHitAnalysis::initialize
virtual StatusCode initialize()
Definition: MMHitAnalysis.cxx:77
MMHitAnalysis::execute
virtual StatusCode execute()
Definition: MMHitAnalysis.cxx:261
MMHitAnalysis::m_h_S_xy_A
TH2 * m_h_S_xy_A
Definition: MMHitAnalysis.h:50
MMHitAnalysis::m_h_rz_A
TH2 * m_h_rz_A
Definition: MMHitAnalysis.h:57
MMHitAnalysis::m_h_L2_r_C
TH1 * m_h_L2_r_C
Definition: MMHitAnalysis.h:71
MMHitAnalysis::m_h_L2_xy_C
TH2 * m_h_L2_xy_C
Definition: MMHitAnalysis.h:69