ATLAS Offline Software
ALFA_GloRec.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 //
8 // ALFA_GloRec class implementation
9 //
10 //
12 //
13 //
14 // PURPOSE:
15 // - reconstruction of global tracks in ALFA
16 //
17 //
18 // INPUT JOB OPTIONS:
19 // - data type: DataType
20 // - patterns of tracks through detectors: TrackPathPatterns
21 // - analysis root file: AnalysisFile
22 // - name of input collection: InputLocRecCollectionName
23 // - name of output collection: InputGloRecCollectionName
24 // - name of truth info collection: TruthEventCollectionName
25 //
26 // OUTPUT:
27 // - GloRecEvCollection of ALFA_GloRecEvent
28 // - some analysis histograms
29 //
30 // OTHER INFO:
31 // Uses aux. classes
32 // 1) AlfaLocalHit
33 // - stores one local hit
34 // x, y, z, pot name, pot number, pointer to ALFA_LocRecCorrEvent
35 //
36 // 2) AlfaLocalHits
37 // - stores stl vector of AlfaLocalHit
38 // - may contain stl vector of itself to define path of the track
39 // ... the path is defined as pattern string
40 // ... string = names of detectors separated by _ or X for any possibility
41 // ... there's one pattern at a time for the object, it can be reset
42 // - if the pattern is applied m_paths (of AlfaLocalHits) is filled
43 // ... there may be more paths for one pattern
44 // (if there were more local hit combinations)
45 // - in job options the TrackPathPatterns may contain multiple patterns
46 // separated by comas (without spaces), it is then looped over all
47 // patterns
48 // - detector names are ALFA standard names:
49 // B7L1U A7L1U B7L1L A7L1L B7R1U A7R1U B7R1L A7R1L
50 //
51 // 3) AlfaTrackCand
52 // - is declared with ONE path from AlfaLocalHits object
53 // - contains x and y halfway between the pots and slope x' and y' of the gloabl track
54 // - contains two pointers of ALFA_LocRecEvent the track is constructed from
55 //
56 // There many methods of the above aux. classes not described at the moment.
57 // Things are under development.
58 //
59 //
61 
62 
63 #include "ALFA_GloRec.h"
64 #include <algorithm>
65 #include <functional>
66 
67 
69 //
70 // ALFA_GloRec constructor
71 //
73 ALFA_GloRec::ALFA_GloRec(const std::string& name, ISvcLocator* pSvcLocator) :
74 AthAlgorithm(name, pSvcLocator)
75 //,m_digitsStore("StoreGateSvc", name)
76 {
77 
78  MsgStream LogStream(Athena::getMessageSvc(), "ALFA_GloRec::ALFA_GloRec");
79  LogStream << MSG::DEBUG << "begin ALFA_GloRec::ALFA_GloRec" << endmsg;
80 
82  // ... steerable job options
84  declareProperty("DataType", m_iDataType);
85  declareProperty("TrackPathPatterns", m_strTrackPathPatterns);
87 
88  declareProperty("OutputGloRecCollectionName",m_strGloRecCollectionName);
89  declareProperty("InputLocRecCollectionName",m_strLocRecCorrCollectionName);
90  declareProperty("TruthEventCollectionName",m_TruthCollectionName);
91 
93  m_pGloRecEvCollection=nullptr;
94 
95  m_px_g_pos = 0.0;
96  m_py_g_pos = 0.0;
97  m_pz_g_pos = 0.0;
98  m_x_g_pos = 0.0;
99  m_y_g_pos = 0.0;
100  m_z_g_pos = 0.0;
101  m_px_g_neg = 0.0;
102  m_py_g_neg = 0.0;
103  m_pz_g_neg = 0.0;
104  m_x_g_neg = 0.0;
105  m_y_g_neg = 0.0;
106  m_z_g_neg = 0.0;
107 
108  m_th1_x_g = nullptr;
109  m_th1_y_g = nullptr;
110  m_th1_xslope_g = nullptr;
111  m_th1_yslope_g = nullptr;
112  m_th1_xnearuppotresiduals = nullptr;
113  m_th1_ynearuppotresiduals = nullptr;
114  m_th1_xfaruppotresiduals = nullptr;
115  m_th1_yfaruppotresiduals = nullptr;
116  m_th1_xnearlwpotresiduals = nullptr;
117  m_th1_ynearlwpotresiduals = nullptr;
118  m_th1_xfarlwpotresiduals = nullptr;
119  m_th1_yfarlwpotresiduals = nullptr;
120  m_th2_truexvsrecx = nullptr;
121  m_th2_trueyvsrecy = nullptr;
122  m_th2_truexslopevsrecxslope = nullptr;
123  m_th2_trueyslopevsrecyslope = nullptr;
124  m_th1_recxovertruex = nullptr;
125  m_th1_recyovertruey = nullptr;
128  m_th1_recxminustruex = nullptr;
129  m_th1_recyminustruey = nullptr;
132  m_th2_extrapxvsrecxnearpot = nullptr;
133  m_th2_extrapyvsrecynearpot = nullptr;
138  m_th2_extrapxvsrecxfarpot = nullptr;
139  m_th2_extrapyvsrecyfarpot = nullptr;
140  m_th1_recxoverextrapxfarpot = nullptr;
141  m_th1_recyoverextrapyfarpot = nullptr;
144 
145 }
146 
148 //
149 // ALFA_GloRec destructor
150 //
153  MsgStream LogStream(Athena::getMessageSvc(), "ALFA_GloRec::~ALFA_GloRec");
154  LogStream << MSG::DEBUG << "begin ALFA_GloRec::~ALFA_GloRec" << endmsg;
155  LogStream << MSG::DEBUG << "end ALFA_GloRec::~ALFA_GloRec" << endmsg;
156 }
157 
159 //
160 // initialize method
161 //
164  MsgStream LogStream(Athena::getMessageSvc(), "ALFA_GloRec::initialize()");
165  LogStream << MSG::DEBUG << "begin ALFA_GloRec::initialize()" << endmsg;
166 
167  msg(MSG::DEBUG) << "======================================" << endmsg;
168  msg(MSG::DEBUG) << "ALFA_GloRec::initialize - data type " << endmsg;
169  msg(MSG::DEBUG) << "======================================" << endmsg;
170  msg(MSG::DEBUG) << "DataType = " << m_iDataType << endmsg;
171 
172  TString l_strtmp(m_strTrackPathPatterns);
174  msg(MSG::DEBUG) << "==========================================================" << endmsg;
175  msg(MSG::DEBUG) << "ALFA_GloRec::initialize - Path patterns from job options " << endmsg;
176  msg(MSG::DEBUG) << "==========================================================" << endmsg;
177  m_TObjArrTrackPathPatterns = *(l_strtmp.Tokenize(","));
178  for(int i = 0; i < m_TObjArrTrackPathPatterns.GetEntries(); i++){
179  msg(MSG::DEBUG) << "pattern[" << i << "] = " << ((TObjString*) m_TObjArrTrackPathPatterns.At(i))->GetString().Data() << endmsg;
180  }
181 
182 
184  // ... declare histograms for some analysis
186  InitHistos();
187 
188 
189  return StatusCode::SUCCESS;
190 }
191 
193 //
194 // execute method
195 //
198 
199  MsgStream LogStream(Athena::getMessageSvc(), "ALFA_GloRec::execute()");
200  LogStream << MSG::DEBUG << "begin ALFA_GloRec::execute()" << endmsg;
201  StatusCode sc = StatusCode::SUCCESS;
202 
203 
204 
205 
206 
208  // get truth information
210  if(m_iDataType == 0){
211  LogStream << MSG::DEBUG << "truth info()" << endmsg;
212  sc = Truth_info();
213  if (sc.isFailure()) {
214  LogStream << MSG::WARNING << "ALFA digi, Truth_info failed" << endmsg;
215  return StatusCode::SUCCESS;
216  }
217  }
218 
220  // ... record output collection
223  sc = evtStore()->record(m_pGloRecEvCollection, "ALFA_GloRecEvCollection");
224  if (sc.isFailure()) {
225  msg(MSG::ERROR) << "Could not create the empty LocRecEv collection in StoreGate" << endmsg;
226  }
227 
228 
230  // ... get LocRecCorr data
232  const ALFA_LocRecCorrEvCollection* pLocRecCorrCol = nullptr;
233  sc = evtStore()->retrieve(pLocRecCorrCol, m_strLocRecCorrCollectionName);
234  if(sc.isFailure() || !pLocRecCorrCol)
235  {
236  msg(MSG::ERROR) << "Container "<< m_strLocRecCorrCollectionName <<" NOT FOUND !!!!!!!" << endmsg;
237  return sc;
238  }
239 
240 
242  // ... collect the local hits and contain them in an auxiliary hit collection
244  ALFA_LocRecCorrEvCollection::const_iterator mcColBeg = pLocRecCorrCol->begin();
245  ALFA_LocRecCorrEvCollection::const_iterator mcColEnd = pLocRecCorrCol->end();
247  for(; mcColBeg!=mcColEnd; ++mcColBeg) {
248  HepGeom::Point3D<double> PointInAtlasCS;
249  const ALFA_LocRecCorrEvent* pLocRecCorr_tmp = static_cast<const ALFA_LocRecCorrEvent*> (*mcColBeg);
250  AlfaLocalHit l_hit(pLocRecCorr_tmp);
251  hits.AddHit(l_hit);
252  //PointInAtlasCS = m_pGeometryReader->GetDetPointInAtlas((eRPotName)(iRPot+1), Point3D<double>(fRecPosX, fRecPosY, 10.0));
253  }
254  //hits.Dump();
255 
256 
257 
259  // ... apply path pattern
261  for(int i = 0; i < m_TObjArrTrackPathPatterns.GetEntries(); i++){
262  TString l_pathpattern(((TObjString*) m_TObjArrTrackPathPatterns.At(i))->GetString());
263  hits.ApplyPathPattern(l_pathpattern.Data());
264  //hits.DumpPaths();
265  for(int i = 0 ; i < hits.GetNpaths() ; i++){
266  AlfaTrackCand trkcand(hits.GetPathHits(i));
267  if(trkcand.IsValidTrack()){
268  m_pGloRecEvCollection->push_back(new ALFA_GloRecEvent(trkcand.GetArmNum(),trkcand.GetX(),trkcand.GetY(),trkcand.GetXslope(),trkcand.GetXslope(),trkcand.GetNearLocRecCorr(),trkcand.GetFarLocRecCorr()));
269  FillTrackCandHistos(&trkcand);
270  }
271  }
272  hits.ResetPaths();
273  }
274 
275 
276 
277 
278  return sc;
279 }
280 
281 
282 
283 
285 //
286 // finalize method
287 //
290 
291  MsgStream LogStream(Athena::getMessageSvc(), "ALFA_GloRec::finalize()");
292  LogStream << MSG::DEBUG << "begin ALFA_GloRec::finalize()" << endmsg;
293 
294  WriteHistos();
295 
296  return StatusCode::SUCCESS;
297 }
298 
299 
300 
301 
303 //
304 // Returns truth info
305 //
306 // - this may be specific to the way the sample was
307 // generated, i.e. part. gun, full MC etc.
308 // - the user needs to consider how to retrieve
309 // the information he/she wants
310 //
313 
314  const McEventCollection* mcTru = nullptr;
315  StatusCode sc = evtStore()->retrieve(mcTru,m_TruthCollectionName);
316  if(sc.isFailure() || !mcTru){
317  msg(MSG::DEBUG) << "Container "<< m_TruthCollectionName <<" NOT FOUND !!!!!!!" << endmsg;
318  return StatusCode::FAILURE;
319  }
320 
321 
322  //int VertexFoundInFrontOfALFA = 0;
323 
324 
325  McEventCollection::const_iterator mcTruBeg = mcTru->begin();
326  McEventCollection::const_iterator mcTruEnd = mcTru->end();
327 
328  //loop over collection (container) with hits (i.e. over 1 event)
329  for(;mcTruBeg!=mcTruEnd;++mcTruBeg){
330 
331  //loop over one event
332  m_z_g_pos = -1.e10;
333  m_z_g_neg = 1.e10;
334  for(const HepMC::ConstGenParticlePtr& begGen: (**mcTruBeg)){
335  if(((std::abs(begGen->pdg_id())==2212)||(std::abs(begGen->pdg_id())==211))){
336  double px, py, pz;
337  double x, y, z;
338  px = begGen->momentum().px();
339  py = begGen->momentum().py();
340  pz = begGen->momentum().pz();
341  HepMC::ConstGenVertexPtr l_prodvert = begGen->production_vertex();
342  x = l_prodvert->position().x();
343  y = l_prodvert->position().y();
344  z = l_prodvert->position().z();
345  if(z > 236000.){
346  m_px_g_pos = px;
347  m_py_g_pos = py;
348  m_pz_g_pos = pz;
349  m_x_g_pos = x;
350  m_y_g_pos = y;
351  m_z_g_pos = z;
352  continue;
353  }else if(z < -236000.){
354  m_px_g_neg = px;
355  m_py_g_neg = py;
356  m_pz_g_neg = pz;
357  m_x_g_neg = x;
358  m_y_g_neg = y;
359  m_z_g_neg = z;
360  continue;
361  }
362 
363  // ... break the loop if both suitable vertices were found
364  if (m_z_g_pos > 0. && m_z_g_neg < 0.){
365  msg(MSG::DEBUG) << "gen px, py, pz = " << m_px_g_pos << " " << m_py_g_pos << " " << m_pz_g_pos << endmsg;
366  msg(MSG::DEBUG) << "prod x, y, z = " << m_x_g_pos << " " << m_y_g_pos << " " << m_z_g_pos << endmsg;
367  msg(MSG::DEBUG) << "gen px, py, pz = " << m_px_g_neg << " " << m_py_g_neg << " " << m_pz_g_neg << endmsg;
368  msg(MSG::DEBUG) << "prod x, y, z = " << m_x_g_neg << " " << m_y_g_neg << " " << m_z_g_neg << endmsg;
369  break;
370  }
371  }
372  }
373  }
374  return StatusCode::SUCCESS;
375 }
376 
377 
379 //
380 // Declare histograms for user analysis
381 //
384  m_th1_x_g = new TH1F("x_g","x^{vertex}_{gen}", 100, -5,5);
385  m_th1_y_g = new TH1F("y_g","y^{vertex}_{gen}", 100, -5,5);
386  m_th1_xslope_g = new TH1F("xslope_g","x'^{vertex}_{gen}", 100, -1.e-3,1.e3);
387  m_th1_yslope_g = new TH1F("yslope_g","y'^{vertex}_{gen}", 100, -1.e-3,1.e3);
388 
389  m_th1_xnearuppotresiduals = new TH1F("xnearuppotresiduals","trk x extrap. minus near IP U loc hit",100, -10., 10.);
390  m_th1_ynearuppotresiduals = new TH1F("ynearuppotresiduals","trk y extrap. minus near IP U loc hit",100, -10., 10.);
391  m_th1_xfaruppotresiduals = new TH1F("xfaruppotresiduals","trk x extrap. minus far IP U loc hit",100, -10., 10.);
392  m_th1_yfaruppotresiduals = new TH1F("yfaruppotresiduals","trk y extrap. minus far IP U loc hit",100, -10., 10.);
393  m_th1_xnearlwpotresiduals = new TH1F("xnearlwpotresiduals","trk x extrap. minus near IP L loc hit",100, -10., 10.);
394  m_th1_ynearlwpotresiduals = new TH1F("ynearlwpotresiduals","trk y extrap. minus near IP L loc hit",100, -10., 10.);
395  m_th1_xfarlwpotresiduals = new TH1F("xfarlwpotresiduals","trk x extrap. minus far IP L loc hit",100, -10., 10.);
396  m_th1_yfarlwpotresiduals = new TH1F("yfarlwpotresiduals","trk y extrap. minus far IP L loc hit",100, -10., 10.);
397 
398  m_th2_truexvsrecx = new TH2F("truexvsrecx","gen x vs rec x", 100, -50, 50, 100, -50, 50);
399  m_th2_trueyvsrecy = new TH2F("trueyvsrecy","gen y vs rec y", 100, -50, 50, 100, -50, 50);
400  m_th2_truexslopevsrecxslope = new TH2F("truexslopevsrecxslope","gen xslope vs rec xslope", 100,-0.002,0.002,100,-0.002,0.002);
401  m_th2_trueyslopevsrecyslope = new TH2F("trueyslopevsrecyslope","gen yslope vs rec yslope", 100,-0.002,0.002,100,-0.002,0.002);
402  m_th1_recxovertruex = new TH1F("recxovertruex","rec x over true x", 100, -2, 2);
403  m_th1_recyovertruey = new TH1F("recyovertruey","rec y over true y", 100, -2, 2);
404  m_th1_recxslopeovertruexslope = new TH1F("recxslopeovertruexslope","rec xslope over true xslope", 100,-2,2);
405  m_th1_recyslopeovertrueyslope = new TH1F("recyslopeovertrueyslope","rec yslope over true yslope", 100,-2,2);
406  m_th1_recxminustruex = new TH1F("recxminustruex","rec x minus true x", 100, -10, 10);
407  m_th1_recyminustruey = new TH1F("recyminustruey","rec y minus true y", 100, -10, 10);
408  m_th1_recxslopeminustruexslope = new TH1F("recxslopeminustruexslope","rec xslope minus true xslope", 100,-0.001,0.001);
409  m_th1_recyslopeminustrueyslope = new TH1F("recyslopeminustrueyslope","rec yslope minus true yslope", 100,-0.001,0.001);
410 
411  m_th2_extrapxvsrecxnearpot = new TH2F("extrapxvsrecxnearpot","extrapolated gen x vs rec x nearpot", 100, -50, 50, 100, -50, 50);
412  m_th2_extrapyvsrecynearpot = new TH2F("extrapyvsrecynearpot","extrapolated gen y vs rec y nearpot", 100, -50, 50, 100, -50, 50);
413  m_th1_recxoverextrapxnearpot = new TH1F("recxoverextrapxnearpot","rec x over extrap x nearpot", 100, 1.-0.2, 1.+0.2);
414  m_th1_recyoverextrapynearpot = new TH1F("recyoverextrapynearpot","rec y over extrap y nearpot", 100, 1.-0.2, 1.+0.2);
415  m_th1_recxminusextrapxnearpot = new TH1F("recxminusextrapxnearpot","rec x minus extrap x nearpot", 100, -0.5, 0.5);
416  m_th1_recyminusextrapynearpot = new TH1F("recyminusextrapynearpot","rec y minus extrap y nearpot", 100, -0.5, 0.5);
417 
418  m_th2_extrapxvsrecxfarpot = new TH2F("extrapxvsrecxfarpot","extrapolated gen x vs rec x farpot", 100, -50, 50, 100, -50, 50);
419  m_th2_extrapyvsrecyfarpot = new TH2F("extrapyvsrecyfarpot","extrapolated gen y vs rec y farpot", 100, -50, 50, 100, -50, 50);
420  m_th1_recxoverextrapxfarpot = new TH1F("recxoverextrapxfarpot","rec x over extrap x farpot", 100, 1.-0.2, 1.+0.2);
421  m_th1_recyoverextrapyfarpot = new TH1F("recyoverextrapyfarpot","rec y over extrap y farpot", 100, 1.-0.2, 1.+0.2);
422  m_th1_recxminusextrapxfarpot = new TH1F("recxminusextrapxfarpot","rec x minus extrap x farpot", 100, -0.5, 0.5);
423  m_th1_recyminusextrapyfarpot = new TH1F("recyminusextrapyfarpot","rec y minus extrap y farpot", 100, -0.5, 0.5);
424 }
425 
426 
428 //
429 // Fill histograms in user analysis
430 //
433 
434  if(m_iDataType==0){
435  double x_g, y_g, z_g, px_g, py_g, pz_g;
436  if(trkcand->IsLeftTrack()){ // left is positive
437  x_g = m_x_g_pos;
438  y_g = m_y_g_pos;
439  z_g = m_z_g_pos;
440  px_g = m_px_g_pos;
441  py_g = m_py_g_pos;
442  pz_g = m_pz_g_pos;
443  }else if(trkcand->IsRightTrack()){ // right is negative
444  x_g = m_x_g_neg;
445  y_g = m_y_g_neg;
446  z_g = m_z_g_neg;
447  px_g = m_px_g_neg;
448  py_g = m_py_g_neg;
449  pz_g = m_pz_g_neg;
450  }else{
451  ATH_MSG_ERROR("ALFA_GloRec::FillTrackCandHistos : Track candidate neither left nor right !!!");
452  return;
453  }
454  m_th1_xnearuppotresiduals -> Fill(trkcand->GetNearImpactPoint()->x()-trkcand->GetNearLocalHit()->GetX(),1.);
455  m_th1_ynearuppotresiduals -> Fill(trkcand->GetNearImpactPoint()->y()-trkcand->GetNearLocalHit()->GetY(),1.);
456  m_th1_xfaruppotresiduals -> Fill(trkcand->GetFarImpactPoint()->x()-trkcand->GetFarLocalHit()->GetX(),1.);
457  m_th1_yfaruppotresiduals -> Fill(trkcand->GetFarImpactPoint()->y()-trkcand->GetFarLocalHit()->GetY(),1.);
458  m_th2_truexvsrecx -> Fill(x_g, trkcand->GetX(), 1.);
459  m_th2_trueyvsrecy -> Fill(y_g, trkcand->GetY(), 1.);
460  m_th1_recxovertruex -> Fill(trkcand->GetX()/x_g, 1.);
461  m_th1_recyovertruey -> Fill(trkcand->GetY()/y_g, 1.);
462  //double p_gen = TMath::Sqrt(px_g*px_g+px_g*px_g+py_g*pz_g);
463  double px_norm = px_g / pz_g;//p_gen;
464  double py_norm = py_g / pz_g;//p_gen;
465  m_th2_truexslopevsrecxslope -> Fill(px_norm, trkcand->GetXslope(), 1.);
466  m_th2_trueyslopevsrecyslope -> Fill(py_norm, trkcand->GetYslope(), 1.);
467  m_th1_recxovertruex -> Fill(trkcand->GetX()/x_g, 1.);
468  m_th1_recyovertruey -> Fill(trkcand->GetY()/y_g, 1.);
469  m_th1_recxslopeovertruexslope -> Fill(trkcand->GetXslope()/px_norm, 1.);
470  m_th1_recyslopeovertrueyslope -> Fill(trkcand->GetYslope()/py_norm, 1.);
471  m_th1_recxminustruex -> Fill(trkcand->GetX()-x_g, 1.);
472  m_th1_recyminustruey -> Fill(trkcand->GetY()-y_g, 1.);
473  m_th1_recxslopeminustruexslope -> Fill(trkcand->GetXslope()-px_norm, 1.);
474  m_th1_recyslopeminustrueyslope -> Fill(trkcand->GetYslope()-py_norm, 1.);
475  // ... extrapolate x any of gen track to near pot
476  double nearhitx = trkcand->GetNearLocalHit()->GetX();
477  double nearhity = trkcand->GetNearLocalHit()->GetY();
478  double nearhitz = trkcand->GetNearLocalHit()->GetZ();
479  double genxextrtonearpot = x_g + px_norm * (nearhitz - z_g);
480  double genyextrtonearpot = y_g + py_norm * (nearhitz - z_g);
481  //double genzextrtonearpot = nearhitz;
482  m_th2_extrapxvsrecxnearpot -> Fill(genxextrtonearpot, nearhitx,1.);
483  m_th2_extrapyvsrecynearpot -> Fill(genyextrtonearpot, nearhity,1.);
484  m_th1_recxoverextrapxnearpot -> Fill(nearhitx / genxextrtonearpot, 1.);
485  m_th1_recyoverextrapynearpot -> Fill(nearhity / genyextrtonearpot, 1.);
486  m_th1_recxminusextrapxnearpot -> Fill(nearhitx - genxextrtonearpot, 1.);
487  m_th1_recyminusextrapynearpot -> Fill(nearhity - genyextrtonearpot, 1.);
488  // ... extrapolate x any of gen track to far pot
489  double farhitx = trkcand->GetFarLocalHit()->GetX();
490  double farhity = trkcand->GetFarLocalHit()->GetY();
491  double farhitz = trkcand->GetFarLocalHit()->GetZ();
492  double genxextrtofarpot = x_g + px_norm * (farhitz - z_g);
493  double genyextrtofarpot = y_g + py_norm * (farhitz - z_g);
494  //double genzextrtofarpot = farhitz;
495  m_th2_extrapxvsrecxfarpot -> Fill(genxextrtofarpot, farhitx,1.);
496  m_th2_extrapyvsrecyfarpot -> Fill(genyextrtofarpot, farhity,1.);
497  m_th1_recxoverextrapxfarpot -> Fill(farhitx / genxextrtofarpot, 1.);
498  m_th1_recyoverextrapyfarpot -> Fill(farhity / genyextrtofarpot, 1.);
499  m_th1_recxminusextrapxfarpot -> Fill(farhitx - genxextrtofarpot, 1.);
500  m_th1_recyminusextrapyfarpot -> Fill(farhity - genyextrtofarpot, 1.);
501  }
502 }
503 
504 
505 
506 
508 //
509 // Write histograms into file
510 //
514  // ... write the histograms into a root file
516  TFile fw_glorecanalysis(m_strGloRecAnalysisFile.data(), "RECREATE", m_strGloRecAnalysisFile.data(), 0);
517  m_th1_xnearuppotresiduals -> Write();
518  m_th1_ynearuppotresiduals -> Write();
519  m_th1_xfaruppotresiduals -> Write();
520  m_th1_yfaruppotresiduals -> Write();
521  m_th1_xnearlwpotresiduals -> Write();
522  m_th1_ynearlwpotresiduals -> Write();
523  m_th1_xfarlwpotresiduals -> Write();
524  m_th1_yfarlwpotresiduals -> Write();
525  m_th2_truexvsrecx -> Write();
526  m_th2_trueyvsrecy -> Write();
527  m_th2_truexslopevsrecxslope -> Write();
528  m_th2_trueyslopevsrecyslope -> Write();
529  m_th1_recxovertruex -> Write();
530  m_th1_recyovertruey -> Write();
531  m_th1_recxslopeovertruexslope -> Write();
532  m_th1_recyslopeovertrueyslope -> Write();
533  m_th1_recxminustruex -> Write();
534  m_th1_recyminustruey -> Write();
535  m_th1_recxslopeminustruexslope -> Write();
536  m_th1_recyslopeminustrueyslope -> Write();
537  m_th2_extrapxvsrecxnearpot -> Write();
538  m_th2_extrapyvsrecynearpot -> Write();
539  m_th1_recxoverextrapxnearpot -> Write();
540  m_th1_recyoverextrapynearpot -> Write();
543  m_th2_extrapxvsrecxfarpot -> Write();
544  m_th2_extrapyvsrecyfarpot -> Write();
545  m_th1_recxoverextrapxfarpot -> Write();
546  m_th1_recyoverextrapyfarpot -> Write();
547  m_th1_recxminusextrapxfarpot -> Write();
548  m_th1_recyminusextrapyfarpot -> Write();
549 
550  fw_glorecanalysis.Write();
551  fw_glorecanalysis.Close();
552 }
553 
554 
ALFA_GloRec::m_th1_recxslopeovertruexslope
TH1F * m_th1_recxslopeovertruexslope
Definition: ALFA_GloRec.h:154
AllowedVariables::e
e
Definition: AsgElectronSelectorTool.cxx:37
ALFA_GloRec::FillTrackCandHistos
void FillTrackCandHistos(AlfaTrackCand *trkcand)
Definition: ALFA_GloRec.cxx:432
ALFA_GloRec::m_th1_recxminusextrapxfarpot
TH1F * m_th1_recxminusextrapxfarpot
Definition: ALFA_GloRec.h:172
ALFA_GloRec::m_TruthCollectionName
std::string m_TruthCollectionName
Definition: ALFA_GloRec.h:99
ALFA_GloRec::m_z_g_neg
double m_z_g_neg
Definition: ALFA_GloRec.h:129
DataModel_detail::const_iterator
Const iterator class for DataVector/DataList.
Definition: DVLIterator.h:82
ALFA_GloRec::m_TObjArrTrackPathPatterns
TObjArray m_TObjArrTrackPathPatterns
Definition: ALFA_GloRec.h:95
ALFA_GloRec::m_x_g_neg
double m_x_g_neg
Definition: ALFA_GloRec.h:127
ALFA_GloRec::m_pz_g_pos
double m_pz_g_pos
Definition: ALFA_GloRec.h:119
TRTCalib_Extractor.hits
hits
Definition: TRTCalib_Extractor.py:35
test_pyathena.px
px
Definition: test_pyathena.py:18
AlfaTrackCand::GetFarLocalHit
AlfaLocalHit * GetFarLocalHit()
Definition: AlfaLocalHits.h:126
AlfaTrackCand::GetNearLocRecCorr
const ALFA_LocRecCorrEvent * GetNearLocRecCorr() const
Definition: AlfaLocalHits.h:127
AlfaTrackCand::GetY
float GetY()
Definition: AlfaLocalHits.h:121
AthCommonDataStore< AthCommonMsg< Algorithm > >::declareProperty
Gaudi::Details::PropertyBase & declareProperty(Gaudi::Property< T > &t)
Definition: AthCommonDataStore.h:145
ALFA_GloRec::m_py_g_neg
double m_py_g_neg
Definition: ALFA_GloRec.h:125
ALFA_GloRec::m_x_g_pos
double m_x_g_pos
Definition: ALFA_GloRec.h:120
ALFA_GloRec::m_th2_extrapyvsrecynearpot
TH2F * m_th2_extrapyvsrecynearpot
Definition: ALFA_GloRec.h:162
ALFA_GloRec::m_th1_xslope_g
TH1F * m_th1_xslope_g
Definition: ALFA_GloRec.h:136
ALFA_GloRec::Truth_info
StatusCode Truth_info()
Definition: ALFA_GloRec.cxx:312
ALFA_GloRec::m_th2_extrapxvsrecxfarpot
TH2F * m_th2_extrapxvsrecxfarpot
Definition: ALFA_GloRec.h:168
ALFA_GloRec::m_th1_xfaruppotresiduals
TH1F * m_th1_xfaruppotresiduals
Definition: ALFA_GloRec.h:141
ALFA_GloRec::m_th1_recyslopeminustrueyslope
TH1F * m_th1_recyslopeminustrueyslope
Definition: ALFA_GloRec.h:159
ALFA_GloRec::ALFA_GloRec
ALFA_GloRec(const std::string &name, ISvcLocator *pSvcLocator)
Definition: ALFA_GloRec.cxx:73
ALFA_GloRec::m_th1_recyslopeovertrueyslope
TH1F * m_th1_recyslopeovertrueyslope
Definition: ALFA_GloRec.h:155
ALFA_GloRec::m_th1_recxslopeminustruexslope
TH1F * m_th1_recxslopeminustruexslope
Definition: ALFA_GloRec.h:158
ALFA_GloRec::~ALFA_GloRec
~ALFA_GloRec()
Definition: ALFA_GloRec.cxx:152
ALFA_LocRecCorrEvCollection
Definition: ALFA_LocRecCorrEvCollection.h:13
ALFA_GloRec::m_strGloRecCollectionName
std::string m_strGloRecCollectionName
Definition: ALFA_GloRec.h:97
AlfaLocalHits
Definition: AlfaLocalHits.h:67
AlfaTrackCand::GetXslope
float GetXslope()
Definition: AlfaLocalHits.h:123
ALFA_GloRec::m_th1_xfarlwpotresiduals
TH1F * m_th1_xfarlwpotresiduals
Definition: ALFA_GloRec.h:145
python.TrigEgammaMonitorHelper.TH2F
def TH2F(name, title, nxbins, bins_par2, bins_par3, bins_par4, bins_par5=None, bins_par6=None, path='', **kwargs)
Definition: TrigEgammaMonitorHelper.py:45
x
#define x
ALFA_GloRec::m_th1_yslope_g
TH1F * m_th1_yslope_g
Definition: ALFA_GloRec.h:137
AlfaTrackCand::GetFarLocRecCorr
const ALFA_LocRecCorrEvent * GetFarLocRecCorr() const
Definition: AlfaLocalHits.h:128
ALFA_GloRec::m_th1_yfarlwpotresiduals
TH1F * m_th1_yfarlwpotresiduals
Definition: ALFA_GloRec.h:146
AlfaTrackCand::IsLeftTrack
int IsLeftTrack()
Definition: AlfaLocalHits.cxx:297
ALFA_GloRec::m_th1_recxminusextrapxnearpot
TH1F * m_th1_recxminusextrapxnearpot
Definition: ALFA_GloRec.h:165
Athena::getMessageSvc
IMessageSvc * getMessageSvc(bool quiet=false)
Definition: getMessageSvc.cxx:20
ALFA_GloRec::m_y_g_neg
double m_y_g_neg
Definition: ALFA_GloRec.h:128
AthenaPoolTestRead.sc
sc
Definition: AthenaPoolTestRead.py:27
ALFA_GloRecEvCollection
Definition: ALFA_GloRecEvCollection.h:13
ALFA_GloRec::m_th1_recyminusextrapynearpot
TH1F * m_th1_recyminusextrapynearpot
Definition: ALFA_GloRec.h:166
ALFA_GloRec::m_iDataType
int m_iDataType
Definition: ALFA_GloRec.h:93
ALFA_GloRec::m_th1_y_g
TH1F * m_th1_y_g
Definition: ALFA_GloRec.h:135
AthCommonDataStore< AthCommonMsg< Algorithm > >::evtStore
ServiceHandle< StoreGateSvc > & evtStore()
The standard StoreGateSvc (event store) Returns (kind of) a pointer to the StoreGateSvc.
Definition: AthCommonDataStore.h:85
ALFA_GloRec::m_y_g_pos
double m_y_g_pos
Definition: ALFA_GloRec.h:121
ALFA_GloRecEvent
Definition: ALFA_GloRecEvent.h:12
ALFA_GloRec::m_th2_trueyvsrecy
TH2F * m_th2_trueyvsrecy
Definition: ALFA_GloRec.h:149
ALFA_GloRec::m_pz_g_neg
double m_pz_g_neg
Definition: ALFA_GloRec.h:126
ATH_MSG_ERROR
#define ATH_MSG_ERROR(x)
Definition: AthMsgStreamMacros.h:33
CheckAppliedSFs.e3
e3
Definition: CheckAppliedSFs.py:264
ALFA_GloRec::m_th2_extrapxvsrecxnearpot
TH2F * m_th2_extrapxvsrecxnearpot
Definition: ALFA_GloRec.h:161
lumiFormat.i
int i
Definition: lumiFormat.py:85
z
#define z
ALFA_GloRec::m_strLocRecCorrCollectionName
std::string m_strLocRecCorrCollectionName
Definition: ALFA_GloRec.h:98
ALFA_GloRec::m_th2_extrapyvsrecyfarpot
TH2F * m_th2_extrapyvsrecyfarpot
Definition: ALFA_GloRec.h:169
ALFA_GloRec::finalize
StatusCode finalize()
Definition: ALFA_GloRec.cxx:289
endmsg
#define endmsg
Definition: AnalysisConfig_Ntuple.cxx:63
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition: PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22
AlfaLocalHit::GetY
float GetY() const
Definition: AlfaLocalHits.h:47
AlfaTrackCand::GetYslope
float GetYslope()
Definition: AlfaLocalHits.h:124
ALFA_GloRec::m_th1_recyoverextrapyfarpot
TH1F * m_th1_recyoverextrapyfarpot
Definition: ALFA_GloRec.h:171
ALFA_GloRec::m_strTrackPathPatterns
std::string m_strTrackPathPatterns
Definition: ALFA_GloRec.h:94
ALFA_LocRecCorrEvent
Definition: ALFA_LocRecCorrEvent.h:8
Amg::pz
@ pz
Definition: GeoPrimitives.h:40
AlfaTrackCand::GetFarImpactPoint
HepGeom::Point3D< double > * GetFarImpactPoint()
Definition: AlfaLocalHits.h:131
AlfaTrackCand::GetNearLocalHit
AlfaLocalHit * GetNearLocalHit()
Definition: AlfaLocalHits.h:125
AlfaLocalHit::GetZ
float GetZ() const
Definition: AlfaLocalHits.h:48
ALFA_GloRec::m_th1_xnearuppotresiduals
TH1F * m_th1_xnearuppotresiduals
Definition: ALFA_GloRec.h:139
ALFA_GloRec::InitHistos
void InitHistos()
Definition: ALFA_GloRec.cxx:383
ALFA_GloRec::m_th1_yfaruppotresiduals
TH1F * m_th1_yfaruppotresiduals
Definition: ALFA_GloRec.h:142
McEventCollection
This defines the McEventCollection, which is really just an ObjectVector of McEvent objects.
Definition: McEventCollection.h:33
ALFA_GloRec::execute
StatusCode execute()
Definition: ALFA_GloRec.cxx:197
ALFA_GloRec::m_th2_truexslopevsrecxslope
TH2F * m_th2_truexslopevsrecxslope
Definition: ALFA_GloRec.h:150
ALFA_GloRec::m_th1_recxminustruex
TH1F * m_th1_recxminustruex
Definition: ALFA_GloRec.h:156
AthAlgorithm
Definition: AthAlgorithm.h:47
ALFA_GloRec::m_th1_recyoverextrapynearpot
TH1F * m_th1_recyoverextrapynearpot
Definition: ALFA_GloRec.h:164
AlfaTrackCand::GetX
float GetX()
Definition: AlfaLocalHits.h:120
HepMC::ConstGenParticlePtr
const GenParticle * ConstGenParticlePtr
Definition: GenParticle.h:38
Amg::py
@ py
Definition: GeoPrimitives.h:39
ALFA_GloRec::m_th1_recxovertruex
TH1F * m_th1_recxovertruex
Definition: ALFA_GloRec.h:152
ALFA_GloRec::m_th2_trueyslopevsrecyslope
TH2F * m_th2_trueyslopevsrecyslope
Definition: ALFA_GloRec.h:151
ALFA_GloRec::initialize
StatusCode initialize()
Definition: ALFA_GloRec.cxx:163
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:221
ALFA_GloRec::m_px_g_pos
double m_px_g_pos
Definition: ALFA_GloRec.h:117
DataVector::push_back
value_type push_back(value_type pElem)
Add an element to the end of the collection.
ALFA_GloRec::m_th1_recyovertruey
TH1F * m_th1_recyovertruey
Definition: ALFA_GloRec.h:153
AlfaTrackCand::IsValidTrack
int IsValidTrack()
Definition: AlfaLocalHits.h:115
ALFA_GloRec::m_th2_truexvsrecx
TH2F * m_th2_truexvsrecx
Definition: ALFA_GloRec.h:148
DataVector::end
const_iterator end() const noexcept
Return a const_iterator pointing past the end of the collection.
ALFA_GloRec::m_th1_recxoverextrapxnearpot
TH1F * m_th1_recxoverextrapxnearpot
Definition: ALFA_GloRec.h:163
ALFA_GloRec::m_th1_recyminusextrapyfarpot
TH1F * m_th1_recyminusextrapyfarpot
Definition: ALFA_GloRec.h:173
y
#define y
AlfaLocalHit
Definition: AlfaLocalHits.h:32
ALFA_GloRec::m_th1_xnearlwpotresiduals
TH1F * m_th1_xnearlwpotresiduals
Definition: ALFA_GloRec.h:143
ALFA_GloRec::m_th1_x_g
TH1F * m_th1_x_g
Definition: ALFA_GloRec.h:134
ALFA_GloRec.h
DEBUG
#define DEBUG
Definition: page_access.h:11
ALFA_GloRec::WriteHistos
void WriteHistos()
Definition: ALFA_GloRec.cxx:512
AthCommonMsg< Algorithm >::msg
MsgStream & msg() const
Definition: AthCommonMsg.h:24
ALFA_GloRec::m_strGloRecAnalysisFile
std::string m_strGloRecAnalysisFile
Definition: ALFA_GloRec.h:96
ALFA_GloRec::m_py_g_pos
double m_py_g_pos
Definition: ALFA_GloRec.h:118
ALFA_GloRec::m_th1_ynearuppotresiduals
TH1F * m_th1_ynearuppotresiduals
Definition: ALFA_GloRec.h:140
ALFA_GloRec::m_th1_recxoverextrapxfarpot
TH1F * m_th1_recxoverextrapxfarpot
Definition: ALFA_GloRec.h:170
ALFA_GloRec::m_th1_recyminustruey
TH1F * m_th1_recyminustruey
Definition: ALFA_GloRec.h:157
AlfaLocalHit::GetX
float GetX() const
Definition: AlfaLocalHits.h:46
AlfaTrackCand::GetArmNum
int GetArmNum()
Definition: AlfaLocalHits.h:119
AlfaTrackCand::IsRightTrack
int IsRightTrack()
Definition: AlfaLocalHits.cxx:311
ALFA_GloRec::m_z_g_pos
double m_z_g_pos
Definition: ALFA_GloRec.h:122
HepMC::ConstGenVertexPtr
const HepMC::GenVertex * ConstGenVertexPtr
Definition: GenVertex.h:60
python.TrigEgammaMonitorHelper.TH1F
def TH1F(name, title, nxbins, bins_par2, bins_par3=None, path='', **kwargs)
Definition: TrigEgammaMonitorHelper.py:24
ALFA_GloRec::m_px_g_neg
double m_px_g_neg
Definition: ALFA_GloRec.h:124
AlfaTrackCand::GetNearImpactPoint
HepGeom::Point3D< double > * GetNearImpactPoint()
Definition: AlfaLocalHits.h:130
AlfaTrackCand
Definition: AlfaLocalHits.h:99
DataVector::begin
const_iterator begin() const noexcept
Return a const_iterator pointing at the beginning of the collection.
ALFA_GloRec::m_pGloRecEvCollection
ALFA_GloRecEvCollection * m_pGloRecEvCollection
Definition: ALFA_GloRec.h:87
ALFA_GloRec::m_th1_ynearlwpotresiduals
TH1F * m_th1_ynearlwpotresiduals
Definition: ALFA_GloRec.h:144