Loading [MathJax]/extensions/tex2jax.js
ATLAS Offline Software
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Modules Pages
DumpObjects.cxx
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2025 CERN for the benefit of the ATLAS collaboration
3 */
4 
5 #include "DumpObjects.h"
6 #include "AtlasHepMC/GenEvent.h"
15 #include "xAODTruth/TruthVertex.h"
16 
17 #include "HepPDT/ParticleDataTable.hh"
18 
24 #include "TrkTrack/TrackInfo.h"
25 
26 #include "EventInfo/EventID.h"
27 #include "EventInfo/EventInfo.h"
28 
29 #include "GaudiKernel/ITHistSvc.h"
30 #include "TTree.h"
31 
34 
35 #include <fstream>
36 
37 int InDet::compute_overlap_SP_flag(const int& eta_module_cl1,const int& phi_module_cl1,
38  const int& eta_module_cl2,const int& phi_module_cl2){
39  int flag=-999;
40 
41  if( (eta_module_cl1==eta_module_cl2) && (phi_module_cl1==phi_module_cl2) ){
42  flag=0; // not an overlap Space Point
43  }
44  else if((eta_module_cl1!=eta_module_cl2) && (phi_module_cl1==phi_module_cl2) ){
45  flag=1; // overlap Space Point in eta only
46  }
47  else if((eta_module_cl1==eta_module_cl2) && (phi_module_cl1!=phi_module_cl2) ){
48  flag=2; // overlap Space Point in phi only
49  }
50  else{
51  flag=3; // "overlap" Space Point in eta and phi (not sure we can call it overlap)
52  }
53  return flag;
54 }
55 
56 //-------------------------------------------------------------------------
57 InDet::DumpObjects::DumpObjects(const std::string &name, ISvcLocator *pSvcLocator)
58  //-------------------------------------------------------------------------
59  : AthAlgorithm(name, pSvcLocator),
60  m_particlePropSvc("PartPropSvc", name) {
61  declareProperty("Offset", m_offset);
62  declareProperty("FileName", m_name = "");
63  //
64  declareProperty("NtupleFileName", m_ntupleFileName);
65  declareProperty("NtupleDirectoryName", m_ntupleDirName);
66  declareProperty("NtupleTreeName", m_ntupleTreeName);
67  declareProperty("maxCL", m_maxCL = 1500000);
68  declareProperty("maxPart", m_maxPart = 1500000);
69  declareProperty("maxSP", m_maxSP = 1500000);
70  declareProperty("maxTRK", m_maxTRK = 1500000);
71  declareProperty("maxDTT", m_maxDTT = 1500000);
72 
73  declareProperty("rootFile", m_rootFile);
74 }
75 
76 //-------------------------------------------
78 //-------------------------------------------
79  m_event = m_offset;
80 
81  // ReadHandle keys
91 
92  ATH_CHECK(m_tracksKey.initialize());
95 
96 
97 
98 
99  // Grab PixelID helper
100  ATH_CHECK (detStore()->retrieve(m_pixelID, "PixelID") );
101 
102  if (!detStore()->contains<InDetDD::PixelDetectorManager>("Pixel") ||
103  detStore()->retrieve(m_pixelManager, "Pixel").isFailure()) {
104  // if Pixel retrieval fails, try ITkPixel
105  if (!detStore()->contains<InDetDD::PixelDetectorManager>("ITkPixel") ||
106  detStore()->retrieve(m_pixelManager, "ITkPixel").isFailure()) {
107  return StatusCode::FAILURE;
108  }
109  }
110 
111  // Grab SCT_ID helper
112  ATH_CHECK (detStore()->retrieve(m_SCT_ID,"SCT_ID") );
113 
114  if (!detStore()->contains<InDetDD::SCT_DetectorManager>("SCT") ||
115  detStore()->retrieve(m_SCT_Manager, "SCT").isFailure()) {
116  // if SCT retrieval fails, try ITkStrip
117  if (!detStore()->contains<InDetDD::SCT_DetectorManager>("ITkStrip") ||
118  detStore()->retrieve(m_SCT_Manager, "ITkStrip").isFailure()) {
119  return StatusCode::FAILURE;
120  }
121  }
122 
123  // particle property service
124  ATH_CHECK (m_particlePropSvc.retrieve());
125 
126  // and the particle data table
128  if (m_particleDataTable == 0) {
129  ATH_MSG_ERROR("Could not get ParticleDataTable! Cannot associate pdg code with charge. Aborting. ");
130  return StatusCode::FAILURE;
131  }
132 
133  // Define the TTree
134  //
135  SmartIF<ITHistSvc> tHistSvc{Gaudi::svcLocator()->service("THistSvc")};
136  ATH_CHECK(tHistSvc.isValid());
137  m_nt = new TTree(TString(m_ntupleTreeName), "Athena Dump for GNN4ITk");
138  // NB: we must not delete the tree, this is done by THistSvc
139  std::string fullNtupleName = m_ntupleFileName + m_ntupleDirName + m_ntupleTreeName;
140  StatusCode sc = tHistSvc->regTree(fullNtupleName, m_nt);
141  if (sc.isFailure()) {
142  ATH_MSG_ERROR("Unable to register TTree: " << fullNtupleName);
143  return sc;
144  }
145 
146  if (m_rootFile) {
147  m_SEID = new int[m_maxCL];
148 
149  m_CLindex = new int[m_maxCL];
150  m_CLhardware = new std::vector<std::string>;
151  m_CLx = new double[m_maxCL];
152  m_CLy = new double[m_maxCL];
153  m_CLz = new double[m_maxCL];
154  m_CLbarrel_endcap = new int[m_maxCL];
155  m_CLlayer_disk = new int[m_maxCL];
156  m_CLeta_module = new int[m_maxCL];
157  m_CLphi_module = new int[m_maxCL];
158  m_CLside = new int[m_maxCL];
160  m_CLparticleLink_eventIndex = new std::vector<std::vector<int>>;
161  m_CLparticleLink_barcode = new std::vector<std::vector<int>>;
162  m_CLbarcodesLinked = new std::vector<std::vector<bool>>;
163  m_CLparticle_charge = new std::vector<std::vector<float>>;
164  m_CLphis = new std::vector<std::vector<int>>;
165  m_CLetas = new std::vector<std::vector<int>>;
166  m_CLtots = new std::vector<std::vector<int>>;
167  m_CLloc_direction1 = new double[m_maxCL];
168  m_CLloc_direction2 = new double[m_maxCL];
169  m_CLloc_direction3 = new double[m_maxCL];
170  m_CLJan_loc_direction1 = new double[m_maxCL];
171  m_CLJan_loc_direction2 = new double[m_maxCL];
172  m_CLJan_loc_direction3 = new double[m_maxCL];
173  m_CLpixel_count = new int[m_maxCL];
174  m_CLcharge_count = new float[m_maxCL];
175  m_CLloc_eta = new float[m_maxCL];
176  m_CLloc_phi = new float[m_maxCL];
177  m_CLglob_eta = new float[m_maxCL];
178  m_CLglob_phi = new float[m_maxCL];
179  m_CLeta_angle = new double[m_maxCL];
180  m_CLphi_angle = new double[m_maxCL];
181  m_CLnorm_x = new float[m_maxCL];
182  m_CLnorm_y = new float[m_maxCL];
183  m_CLnorm_z = new float[m_maxCL];
184  m_CLlocal_cov = new std::vector<std::vector<double>>;
185 
186  m_Part_event_number = new int[m_maxPart];
187  m_Part_barcode = new int[m_maxPart];
188  m_Part_px = new float[m_maxPart];
189  m_Part_py = new float[m_maxPart];
190  m_Part_pz = new float[m_maxPart];
191  m_Part_pt = new float[m_maxPart];
192  m_Part_eta = new float[m_maxPart];
193  m_Part_vx = new float[m_maxPart];
194  m_Part_vy = new float[m_maxPart];
195  m_Part_vz = new float[m_maxPart];
196  m_Part_radius = new float[m_maxPart];
197  m_Part_status = new float[m_maxPart];
198  m_Part_charge = new float[m_maxPart];
199  m_Part_pdg_id = new int[m_maxPart];
200  m_Part_passed = new int[m_maxPart];
201  m_Part_vProdNin = new int[m_maxPart];
202  m_Part_vProdNout = new int[m_maxPart];
203  m_Part_vProdStatus = new int[m_maxPart];
204  m_Part_vProdBarcode = new int[m_maxPart];
205  m_Part_vParentID = new std::vector<std::vector<int>>;
206  m_Part_vParentBarcode = new std::vector<std::vector<int>>;
207 
208  m_SPindex = new int[m_maxSP];
209  m_SPx = new double[m_maxSP];
210  m_SPy = new double[m_maxSP];
211  m_SPz = new double[m_maxSP];
212  m_SPCL1_index = new int[m_maxSP];
213  m_SPCL2_index = new int[m_maxSP];
214  m_SPisOverlap = new int[m_maxSP];
215 
216  m_SPradius = new double[m_maxSP];
217  m_SPcovr = new double[m_maxSP];
218  m_SPcovz = new double[m_maxSP];
219  m_SPhl_topstrip = new float[m_maxSP];
220  m_SPhl_botstrip = new float[m_maxSP];
221  m_SPtopStripDirection = new std::vector<std::vector<float>>;
222  m_SPbottomStripDirection = new std::vector<std::vector<float>>;
223  m_SPstripCenterDistance = new std::vector<std::vector<float>>;
224  m_SPtopStripCenterPosition = new std::vector<std::vector<float>>;
225 
226  m_TRKindex = new int[m_maxTRK];
227  m_TRKtrack_fitter = new int[m_maxTRK];
229  m_TRKproperties = new std::vector<std::vector<int>>;
230  m_TRKpattern = new std::vector<std::vector<int>>;
231  m_TRKndof = new int[m_maxTRK];
232  m_TRKmot = new int[m_maxTRK];
233  m_TRKoot = new int[m_maxTRK];
234  m_TRKchiSq = new float[m_maxTRK];
235  m_TRKmeasurementsOnTrack_pixcl_sctcl_index = new std::vector<std::vector<int>>;
236  m_TRKoutliersOnTrack_pixcl_sctcl_index = new std::vector<std::vector<int>>;
237  m_TRKcharge = new int[m_maxTRK];
238  m_TRKperigee_position = new std::vector<std::vector<double>>;
239  m_TRKperigee_momentum = new std::vector<std::vector<double>>;
240  m_TTCindex = new int[m_maxTRK];
241  m_TTCevent_index = new int[m_maxTRK];
242  m_TTCparticle_link = new int[m_maxTRK];
243  m_TTCprobability = new float[m_maxTRK];
244 
245  m_DTTindex = new int[m_maxDTT];
246  m_DTTsize = new int[m_maxDTT];
247  m_DTTtrajectory_eventindex = new std::vector<std::vector<int>>;
248  m_DTTtrajectory_barcode = new std::vector<std::vector<int>>;
249  m_DTTstTruth_subDetType = new std::vector<std::vector<int>>;
250  m_DTTstTrack_subDetType = new std::vector<std::vector<int>>;
251  m_DTTstCommon_subDetType = new std::vector<std::vector<int>>;
252 
253  m_nt->Branch("run_number", &m_run_number, "run_number/i");
254  m_nt->Branch("event_number", &m_event_number, "event_number/l");
255 
256  m_nt->Branch("nSE", &m_nSE, "nSE/I");
257  m_nt->Branch("SEID", m_SEID, "SEID[nSE]/I");
258 
259  m_nt->Branch("nCL", &m_nCL, "nCL/I");
260  m_nt->Branch("CLindex", m_CLindex, "CLindex[nCL]/I");
261  m_nt->Branch("CLhardware", &m_CLhardware);
262  m_nt->Branch("CLx", m_CLx, "CLx[nCL]/D");
263  m_nt->Branch("CLy", m_CLy, "CLy[nCL]/D");
264  m_nt->Branch("CLz", m_CLz, "CLz[nCL]/D");
265  m_nt->Branch("CLbarrel_endcap", m_CLbarrel_endcap, "CLbarrel_endcap[nCL]/I");
266  m_nt->Branch("CLlayer_disk", m_CLlayer_disk, "CLlayer_disk[nCL]/I");
267  m_nt->Branch("CLeta_module", m_CLeta_module, "CLeta_module[nCL]/I");
268  m_nt->Branch("CLphi_module", m_CLphi_module, "CLphi_module[nCL]/I");
269  m_nt->Branch("CLside", m_CLside, "CLside[nCL]/I");
270  m_nt->Branch("CLmoduleID", m_CLmoduleID, "CLmoduleID[nCL]/l");
271  m_nt->Branch("CLparticleLink_eventIndex", &m_CLparticleLink_eventIndex);
272  m_nt->Branch("CLparticleLink_barcode", &m_CLparticleLink_barcode);
273  m_nt->Branch("CLbarcodesLinked", &m_CLbarcodesLinked);
274  m_nt->Branch("CLparticle_charge", &m_CLparticle_charge);
275  m_nt->Branch("CLphis", &m_CLphis);
276  m_nt->Branch("CLetas", &m_CLetas);
277  m_nt->Branch("CLtots", &m_CLtots);
278  m_nt->Branch("CLloc_direction1", m_CLloc_direction1, "CLloc_direction1[nCL]/D");
279  m_nt->Branch("CLloc_direction2", m_CLloc_direction2, "CLloc_direction2[nCL]/D");
280  m_nt->Branch("CLloc_direction3", m_CLloc_direction3, "CLloc_direction3[nCL]/D");
281  m_nt->Branch("CLJan_loc_direction1", m_CLJan_loc_direction1, "CLJan_loc_direction1[nCL]/D");
282  m_nt->Branch("CLJan_loc_direction2", m_CLJan_loc_direction2, "CLJan_loc_direction2[nCL]/D");
283  m_nt->Branch("CLJan_loc_direction3", m_CLJan_loc_direction3, "CLJan_loc_direction3[nCL]/D");
284  m_nt->Branch("CLpixel_count", m_CLpixel_count, "CLpixel_count[nCL]/I");
285  m_nt->Branch("CLcharge_count", m_CLcharge_count, "CLcharge_count[nCL]/F");
286  m_nt->Branch("CLloc_eta", m_CLloc_eta, "CLloc_eta[nCL]/F");
287  m_nt->Branch("CLloc_phi", m_CLloc_phi, "CLloc_phi[nCL]/F");
288  m_nt->Branch("CLglob_eta", m_CLglob_eta, "CLglob_eta[nCL]/F");
289  m_nt->Branch("CLglob_phi", m_CLglob_phi, "CLglob_phi[nCL]/F");
290  m_nt->Branch("CLeta_angle", m_CLeta_angle, "CLeta_angle[nCL]/D");
291  m_nt->Branch("CLphi_angle", m_CLphi_angle, "CLphi_angle[nCL]/D");
292  m_nt->Branch("CLnorm_x", m_CLnorm_x, "CLnorm_x[nCL]/F");
293  m_nt->Branch("CLnorm_y", m_CLnorm_y, "CLnorm_y[nCL]/F");
294  m_nt->Branch("CLnorm_z", m_CLnorm_z, "CLnorm_z[nCL]/F");
295  m_nt->Branch("CLlocal_cov", &m_CLlocal_cov);
296 
297  m_nt->Branch("nPartEVT", &m_nPartEVT, "nPartEVT/I");
298  m_nt->Branch("Part_event_number", m_Part_event_number, "Part_event_number[nPartEVT]/I");
299  m_nt->Branch("Part_barcode", m_Part_barcode, "Part_barcode[nPartEVT]/I");
300  m_nt->Branch("Part_px", m_Part_px, "Part_px[nPartEVT]/F");
301  m_nt->Branch("Part_py", m_Part_py, "Part_py[nPartEVT]/F");
302  m_nt->Branch("Part_pz", m_Part_pz, "Part_pz[nPartEVT]/F");
303  m_nt->Branch("Part_pt", m_Part_pt, "Part_pt[nPartEVT]/F");
304  m_nt->Branch("Part_eta", m_Part_eta, "Part_eta[nPartEVT]/F");
305  m_nt->Branch("Part_vx", m_Part_vx, "Part_vx[nPartEVT]/F");
306  m_nt->Branch("Part_vy", m_Part_vy, "Part_vy[nPartEVT]/F");
307  m_nt->Branch("Part_vz", m_Part_vz, "Part_vz[nPartEVT]/F");
308  m_nt->Branch("Part_radius", m_Part_radius, "Part_radius[nPartEVT]/F");
309  m_nt->Branch("Part_status", m_Part_status, "Part_status[nPartEVT]/F");
310  m_nt->Branch("Part_charge", m_Part_charge, "Part_charge[nPartEVT]/F");
311  m_nt->Branch("Part_pdg_id", m_Part_pdg_id, "Part_pdg_id[nPartEVT]/I");
312  m_nt->Branch("Part_passed", m_Part_passed, "Part_passed[nPartEVT]/I");
313  m_nt->Branch("Part_vProdNin", m_Part_vProdNin, "Part_vProdNin[nPartEVT]/I");
314  m_nt->Branch("Part_vProdNout", m_Part_vProdNout, "Part_vProdNout[nPartEVT]/I");
315  m_nt->Branch("Part_vProdStatus", m_Part_vProdStatus, "Part_vProdStatus[nPartEVT]/I");
316  m_nt->Branch("Part_vProdBarcode", m_Part_vProdBarcode, "Part_vProdBarcode[nPartEVT]/I");
317  m_nt->Branch("Part_vParentID", &m_Part_vParentID);
318  m_nt->Branch("Part_vParentBarcode", &m_Part_vParentBarcode);
319 
320  m_nt->Branch("nSP", &m_nSP, "nSP/I");
321  m_nt->Branch("SPindex", m_SPindex, "SPindex[nSP]/I");
322  m_nt->Branch("SPx", m_SPx, "SPx[nSP]/D");
323  m_nt->Branch("SPy", m_SPy, "SPy[nSP]/D");
324  m_nt->Branch("SPz", m_SPz, "SPz[nSP]/D");
325  m_nt->Branch("SPCL1_index", m_SPCL1_index, "SPCL1_index[nSP]/I");
326  m_nt->Branch("SPCL2_index", m_SPCL2_index, "SPCL2_index[nSP]/I");
327  m_nt->Branch("SPisOverlap", m_SPisOverlap, "SPisOverlap[nSP]/I");
328  m_nt->Branch("SPradius",m_SPradius, "SPradius[nSP]/D");
329  m_nt->Branch("SPcovr",m_SPcovr, "SPradius[nSP]/D");
330  m_nt->Branch("SPcovz",m_SPcovz, "SPradius[nSP]/D");
331  m_nt->Branch("SPhl_topstrip",m_SPhl_topstrip, "SPhl_topstrip[nSP]/F");
332  m_nt->Branch("SPhl_botstrip",m_SPhl_botstrip, "SPhl_botstrip[nSP]/F");
333  m_nt->Branch("SPtopStripDirection",&m_SPtopStripDirection);
334  m_nt->Branch("SPbottomStripDirection",&m_SPbottomStripDirection);
335  m_nt->Branch("SPstripCenterDistance",&m_SPstripCenterDistance);
336  m_nt->Branch("SPtopStripCenterPosition",m_SPtopStripCenterPosition);
337 
338  m_nt->Branch("nTRK", &m_nTRK, "nTRK/I");
339  m_nt->Branch("TRKindex", m_TRKindex, "TRKindex[nTRK]/I");
340  m_nt->Branch("TRKtrack_fitter", m_TRKtrack_fitter, "TRKtrack_fitter[nTRK]/I");
341  m_nt->Branch("TRKparticle_hypothesis", m_TRKparticle_hypothesis, "TRKparticle_hypothesis[nTRK]/I");
342  m_nt->Branch("TRKproperties", &m_TRKproperties);
343  m_nt->Branch("TRKpattern", &m_TRKpattern);
344  m_nt->Branch("TRKndof", m_TRKndof, "TRKndof[nTRK]/I");
345  m_nt->Branch("TRKmot", m_TRKmot, "TRKmot[nTRK]/I");
346  m_nt->Branch("TRKoot", m_TRKoot, "TRKoot[nTRK]/I");
347  m_nt->Branch("TRKchiSq", m_TRKchiSq, "TRKchiSq[nTRK]/F");
348  m_nt->Branch("TRKmeasurementsOnTrack_pixcl_sctcl_index", &m_TRKmeasurementsOnTrack_pixcl_sctcl_index);
349  m_nt->Branch("TRKoutliersOnTrack_pixcl_sctcl_index", &m_TRKoutliersOnTrack_pixcl_sctcl_index);
350  m_nt->Branch("TRKcharge", m_TRKcharge, "TRKcharge[nTRK]/I");
351  m_nt->Branch("TRKperigee_position", &m_TRKperigee_position);
352  m_nt->Branch("TRKperigee_momentum", &m_TRKperigee_momentum);
353  m_nt->Branch("TTCindex", m_TTCindex, "TTCindex[nTRK]/I");
354  m_nt->Branch("TTCevent_index", m_TTCevent_index, "TTCevent_index[nTRK]/I");
355  m_nt->Branch("TTCparticle_link", m_TTCparticle_link, "TTCparticle_link[nTRK]/I");
356  m_nt->Branch("TTCprobability", m_TTCprobability, "TTCprobability[nTRK]/F");
357 
358  m_nt->Branch("nDTT", &m_nDTT, "nDTT/I");
359  m_nt->Branch("DTTindex", m_DTTindex, "DTTindex[nDTT]/I");
360  m_nt->Branch("DTTsize", m_DTTsize, "DTTsize[nDTT]/I");
361  m_nt->Branch("DTTtrajectory_eventindex", &m_DTTtrajectory_eventindex);
362  m_nt->Branch("DTTtrajectory_barcode", &m_DTTtrajectory_barcode);
363  m_nt->Branch("DTTstTruth_subDetType", &m_DTTstTruth_subDetType);
364  m_nt->Branch("DTTstTrack_subDetType", &m_DTTstTrack_subDetType);
365  m_nt->Branch("DTTstCommon_subDetType", &m_DTTstCommon_subDetType);
366  }
367 
368  return StatusCode::SUCCESS;
369 }
370 
371 //-------------------------------
373  //-------------------------------
374  //
375  const EventContext &ctx = Gaudi::Hive::currentContext();
376 
377  m_event++;
378 
379  // map cluster ID to an index
380  // in order to connect the cluster to spacepoints
381  std::map<Identifier, long int> clusterIDMapIdx;
382  m_selected = 0; // global indices for clusters
383 
384  std::map<Identifier, long int> clusterIDMapSpacePointIdx; // key: cluster indentifier, value: spacepoint index
385 
386  // create a container with HepMcParticleLink and list of clusters
387  // particle barcode --> is accepted and number of clusters
388  std::map<std::pair<int, int>, std::pair<bool, int>> allTruthParticles;
389 
390  const McEventCollection *mcCollptr = nullptr;
391  SG::ReadHandle<McEventCollection> mcEventCollectionHandle{m_mcEventCollectionKey, ctx};
392  if (not mcEventCollectionHandle.isValid()) {
393  ATH_MSG_WARNING(" McEventCollection not found: " << m_mcEventCollectionKey.key());
394  return StatusCode::FAILURE;
395  }
396  mcCollptr = mcEventCollectionHandle.cptr();
397 
398  // dump out event ID
399  const xAOD::EventInfo *eventInfo = nullptr;
400  SG::ReadHandle<xAOD::EventInfo> eventInfoHandle(m_eventInfoKey, ctx);
401  if (not eventInfoHandle.isValid()) {
402  ATH_MSG_WARNING(" EventInfo not found: " << m_eventInfoKey.key());
403  return StatusCode::FAILURE;
404  }
405  eventInfo = eventInfoHandle.cptr();
406 
407  m_run_number = eventInfo->runNumber();
408  m_event_number = eventInfo->eventNumber();
409 
410  std::map<int, int> allSubEvents;
411 
412  m_nSE = 0;
413 
414  bool duplicateSubeventID = false;
415  for (unsigned int cntr = 0; cntr < mcCollptr->size(); ++cntr) {
416  int ID = mcCollptr->at(cntr)->event_number();
417  if (m_rootFile)
418  m_SEID[m_nSE++] = ID;
419 
420  if (m_nSE == m_maxCL) {
421  ATH_MSG_WARNING("DUMP : hit max number of subevent ID");
422  break;
423  }
424  std::map<int, int>::iterator it = allSubEvents.find(ID);
425  if (it == allSubEvents.end())
426  allSubEvents.insert(std::make_pair(ID, 1));
427  else {
428  it->second++;
429  duplicateSubeventID = true;
430  }
431  }
432 
433  if (duplicateSubeventID) {
434  ATH_MSG_WARNING("Duplicate subevent ID in event " << m_event);
435  }
436 
437  m_nPartEVT = 0;
438 
439  if (m_rootFile) {
440  (*m_Part_vParentID).clear();
441  (*m_Part_vParentBarcode).clear();
442  }
443 
444  for (unsigned int cntr = 0; cntr < mcCollptr->size(); ++cntr) {
445  const HepMC::GenEvent *genEvt = (mcCollptr->at(cntr));
446 
447  // for ( HepMC::GenEvent::particle_const_iterator p = genEvt->particles_begin(); p != genEvt->particles_end(); ++p )
448  // {
449 
453 
454  for (auto p : *genEvt) {
455  //*p is a GenParticle
456  float px, py, pz, pt, eta, vx, vy, vz, radius, status, charge = 0.;
457  std::vector<int> vParentID;
458  std::vector<int> vParentBarcode;
459 
460  int vProdNin, vProdNout, vProdStatus, vProdBarcode;
461  bool passed = isPassed(p, px, py, pz, pt, eta, vx, vy, vz, radius, status, charge, vParentID, vParentBarcode,
462  vProdNin, vProdNout, vProdStatus, vProdBarcode);
463  allTruthParticles.insert(std::make_pair(std::make_pair(genEvt->event_number(), HepMC::barcode(p)),
464  std::make_pair(passed, 0))); // JB: HEPMC3 barcode() -> HepMC::barcode(p)
465  // subevent, barcode, px, py, pz, pt, eta, vx, vy, vz, radius, status, charge
466  if (m_rootFile) {
467  m_Part_event_number[m_nPartEVT] = genEvt->event_number();
468  m_Part_barcode[m_nPartEVT] = HepMC::barcode(p); // JB: HEPMC3 barcode() -> HepMC::barcode(p)
473  m_Part_eta[m_nPartEVT] = eta;
474  m_Part_vx[m_nPartEVT] = vx;
475  m_Part_vy[m_nPartEVT] = vy;
476  m_Part_vz[m_nPartEVT] = vz;
480  m_Part_pdg_id[m_nPartEVT] = p->pdg_id();
481  m_Part_passed[m_nPartEVT] = (passed ? true : false);
482  m_Part_vProdNin[m_nPartEVT] = vProdNin;
483  m_Part_vProdNout[m_nPartEVT] = vProdNout;
484  m_Part_vProdStatus[m_nPartEVT] = vProdStatus;
485  m_Part_vProdBarcode[m_nPartEVT] = vProdBarcode;
486  (*m_Part_vParentID).push_back(vParentID);
487  (*m_Part_vParentBarcode).push_back(vParentBarcode);
488  }
489 
490  m_nPartEVT++;
491  if (m_nPartEVT == m_maxPart) {
492  ATH_MSG_WARNING("DUMP : hit max number of particle events");
493  break;
494  }
495  }
496  }
497 
499  SG::ReadHandle<InDet::PixelClusterContainer> pixelClusterContainerHandle{m_pixelClusterKey, ctx};
500  if (not pixelClusterContainerHandle.isValid()) {
501  ATH_MSG_WARNING(" PixelClusterContainer not found: " << m_pixelClusterKey.key());
502  return StatusCode::FAILURE;
503  }
504  PixelClusterContainer = pixelClusterContainerHandle.cptr();
505 
507  SG::ReadHandle<InDet::SCT_ClusterContainer> stripClusterContainerHandle{m_stripClusterKey, ctx};
508  if (not stripClusterContainerHandle.isValid()) {
509  ATH_MSG_WARNING(" SCT_ClusterContainer not found: " << m_stripClusterKey.key());
510  return StatusCode::FAILURE;
511  }
512  SCT_ClusterContainer = stripClusterContainerHandle.cptr();
513 
514  auto cartesion_to_spherical = [](const Amg::Vector3D &xyzVec, float &eta_, float &phi_) {
515  float r3 = 0;
516  for (int idx = 0; idx < 3; ++idx) {
517  r3 += xyzVec[idx] * xyzVec[idx];
518  }
519  r3 = sqrt(r3);
520  phi_ = atan2(xyzVec[1], xyzVec[0]);
521  float theta_ = acos(xyzVec[2] / r3);
522  eta_ = log(tan(0.5 * theta_));
523  };
524 
528 
529  m_nCL = 0;
530  if (m_rootFile) {
531  (*m_CLhardware).clear();
532  (*m_CLparticleLink_eventIndex).clear();
533  (*m_CLparticleLink_barcode).clear();
534  (*m_CLbarcodesLinked).clear();
535  (*m_CLparticle_charge).clear();
536  (*m_CLphis).clear();
537  (*m_CLetas).clear();
538  (*m_CLtots).clear();
539  (*m_CLlocal_cov).clear();
540  }
541 
542  if (PixelClusterContainer->size() > 0) {
543 
544  const InDetSimDataCollection *sdoCollection = 0;
545  SG::ReadHandle<InDetSimDataCollection> sdoCollectionHandle{m_pixelSDOKey, ctx};
546  if (not sdoCollectionHandle.isValid()) {
547  ATH_MSG_WARNING(" InDetSimDataCollection not found: " << m_pixelSDOKey.key());
548  return StatusCode::FAILURE;
549  }
550  sdoCollection = sdoCollectionHandle.cptr();
551 
552  for (const auto clusterCollection : *PixelClusterContainer) {
553  // skip empty collections
554  if (clusterCollection->empty())
555  continue;
556 
557  int barrel_endcap = m_pixelID->barrel_ec(clusterCollection->identify());
558  int layer_disk = m_pixelID->layer_disk(clusterCollection->identify());
559  int eta_module = m_pixelID->eta_module(clusterCollection->identify());
560  int phi_module = m_pixelID->phi_module(clusterCollection->identify());
561 
562  InDetDD::SiDetectorElement *element = m_pixelManager->getDetectorElement(clusterCollection->identify());
563 
564  Amg::Vector3D my_normal = element->normal();
565  float norm_x = fabs(my_normal.x()) > 1e-5 ? my_normal.x() : 0.;
566  float norm_y = fabs(my_normal.y()) > 1e-5 ? my_normal.y() : 0.;
567  float norm_z = fabs(my_normal.z()) > 1e-5 ? my_normal.z() : 0.;
568 
569  const InDetDD::PixelModuleDesign *design(dynamic_cast<const InDetDD::PixelModuleDesign *>(&element->design()));
570 
571  if (not design) {
572  ATH_MSG_ERROR("Dynamic cast failed at " << __LINE__ << " of MergedPixelsTool.cxx.");
573  return StatusCode::FAILURE;
574  }
575 
576  // loop over collection
577  for (const auto cluster : *clusterCollection) {
578  Identifier clusterId = cluster->identify();
579  if (!clusterId.is_valid()) {
580  ATH_MSG_WARNING("Pixel cluster identifier is not valid");
581  }
582 
583  const Amg::MatrixX &local_cov = cluster->localCovariance();
584 
585  std::vector<std::pair<int, int>> barcodes = {};
586  std::vector<int> particleLink_eventIndex = {};
587  std::vector<int> particleLink_barcode = {};
588  std::vector<bool> barcodesLinked = {};
589  std::vector<float> charge = {};
590  std::vector<int> phis = {};
591  std::vector<int> etas = {};
592  std::vector<int> tots = {};
593  int min_eta = 999;
594  int min_phi = 999;
595  int max_eta = -999;
596  int max_phi = -999;
597 
598  float charge_count = 0;
599  int pixel_count = 0;
600 
601  for (unsigned int rdo = 0; rdo < cluster->rdoList().size(); rdo++) {
602  const auto &rdoID = cluster->rdoList().at(rdo);
603  int phi = m_pixelID->phi_index(rdoID);
604  int eta = m_pixelID->eta_index(rdoID);
605  if (min_eta > eta)
606  min_eta = eta;
607  if (min_phi > phi)
608  min_phi = phi;
609  if (max_eta < eta)
610  max_eta = eta;
611  if (max_phi < phi)
612  max_phi = phi;
613 
614  ++pixel_count;
615  charge_count += cluster->totList().at(rdo);
616 
617  phis.push_back(phi);
618  etas.push_back(eta);
619  tots.push_back(cluster->totList().at(rdo));
620 
621  auto pos = sdoCollection->find(rdoID);
622  if (pos != sdoCollection->end()) {
623  for (auto deposit : pos->second.getdeposits()) {
624  const HepMcParticleLink &particleLink = deposit.first;
625  std::pair<int, int> barcode(particleLink.eventIndex(), particleLink.barcode());
626  // if (particleLink.isValid()) allTruthParticles.at(barcode).second++; // JB comment this out
627  if (std::find(barcodes.begin(), barcodes.end(), barcode) == barcodes.end()) {
628  barcodes.push_back(barcode);
629  particleLink_eventIndex.push_back(particleLink.eventIndex());
630  particleLink_barcode.push_back(particleLink.barcode());
631  charge.push_back(deposit.second);
632  barcodesLinked.push_back(particleLink.isValid());
633  }
634  }
635  }
636  }
637 
638  InDetDD::SiLocalPosition localPos_entry = design->localPositionOfCell(InDetDD::SiCellId(min_phi, min_eta));
639  InDetDD::SiLocalPosition localPos_exit = design->localPositionOfCell(InDetDD::SiCellId(max_phi, max_eta));
640 
641  Amg::Vector3D localStartPosition(localPos_entry.xEta() - 0.5 * element->etaPitch(),
642  localPos_entry.xPhi() - 0.5 * element->phiPitch(),
643  -0.5 * element->thickness());
644  Amg::Vector3D localEndPosition(localPos_exit.xEta() + 0.5 * element->etaPitch(),
645  localPos_exit.xPhi() + 0.5 * element->phiPitch(), 0.5 * element->thickness());
646 
647  // local direction in local coordinates
648  // clusterShape: [lx, ly, lz]
649  Amg::Vector3D localDirection = localEndPosition - localStartPosition;
650 
651  float loc_eta = 0, loc_phi = 0; // clusterShape: [leta, lphi]
652  cartesion_to_spherical(localDirection, loc_eta, loc_phi);
653 
654  Amg::Vector3D globalStartPosition = element->globalPosition(localStartPosition);
655  Amg::Vector3D globalEndPosition = element->globalPosition(localEndPosition);
656 
657  Amg::Vector3D direction = globalEndPosition - globalStartPosition;
658  float glob_eta = 0, glob_phi = 0; // clusterShape: [geta, gphi]
659  cartesion_to_spherical(direction, glob_eta, glob_phi);
660 
661  Amg::Vector3D my_phiax = element->phiAxis();
662  Amg::Vector3D my_etaax = element->etaAxis();
663 
664  float trkphicomp = direction.dot(my_phiax);
665  float trketacomp = direction.dot(my_etaax);
666  float trknormcomp = direction.dot(my_normal);
667  double phi_angle = atan2(trknormcomp, trkphicomp);
668  double eta_angle = atan2(trknormcomp, trketacomp);
669  // now dumping all the values now
670  clusterIDMapIdx[cluster->identify()] = m_selected;
671  std::vector<double> v_local_cov;
672  if (local_cov.size() > 0) {
673  for (size_t i = 0, nRows = local_cov.rows(), nCols = local_cov.cols(); i < nRows; i++) {
674  for (size_t j = 0; j < nCols; ++j) {
675  v_local_cov.push_back(local_cov(i, j));
676  }
677  }
678  }
679  if (m_rootFile) {
680  // fill TTree
682  (*m_CLhardware).push_back("PIXEL");
683  m_CLx[m_nCL] = cluster->globalPosition().x();
684  m_CLy[m_nCL] = cluster->globalPosition().y();
685  m_CLz[m_nCL] = cluster->globalPosition().z();
686  m_CLbarrel_endcap[m_nCL] = barrel_endcap;
687  m_CLlayer_disk[m_nCL] = layer_disk;
688  m_CLeta_module[m_nCL] = eta_module;
689  m_CLphi_module[m_nCL] = phi_module;
690  m_CLside[m_nCL] = 0;
691  m_CLmoduleID[m_nCL] = clusterCollection->identify().get_compact();
692  (*m_CLparticleLink_eventIndex).push_back(particleLink_eventIndex);
693  (*m_CLparticleLink_barcode).push_back(particleLink_barcode);
694  (*m_CLbarcodesLinked).push_back(barcodesLinked);
695  (*m_CLparticle_charge).push_back(charge);
696  (*m_CLetas).push_back(etas);
697  (*m_CLphis).push_back(phis);
698  (*m_CLtots).push_back(tots);
699  m_CLloc_direction1[m_nCL] = localDirection[0];
700  m_CLloc_direction2[m_nCL] = localDirection[1];
701  m_CLloc_direction3[m_nCL] = localDirection[2];
705  m_CLpixel_count[m_nCL] = pixel_count;
706  m_CLcharge_count[m_nCL] = charge_count;
707  m_CLloc_eta[m_nCL] = loc_eta;
708  m_CLloc_phi[m_nCL] = loc_phi;
709  m_CLglob_eta[m_nCL] = glob_eta;
710  m_CLglob_phi[m_nCL] = glob_phi;
711  m_CLeta_angle[m_nCL] = eta_angle;
712  m_CLphi_angle[m_nCL] = phi_angle;
713  m_CLnorm_x[m_nCL] = norm_x;
714  m_CLnorm_y[m_nCL] = norm_y;
715  m_CLnorm_z[m_nCL] = norm_z;
716  (*m_CLlocal_cov).push_back(v_local_cov);
717  }
718  m_nCL++;
719  m_selected++;
720  if (m_nCL == m_maxCL) {
721  ATH_MSG_WARNING("DUMP : hit max number of clusters");
722  break;
723  }
724  }
725  }
726  }
727 
731 
732  if (SCT_ClusterContainer->size() > 0) {
733  const InDetSimDataCollection *sdoCollection = 0;
734  SG::ReadHandle<InDetSimDataCollection> sdoCollectionHandle{m_stripSDOKey, ctx};
735  if (not sdoCollectionHandle.isValid()) {
736  ATH_MSG_WARNING(" InDetSimDataCollection not found: " << m_stripSDOKey.key());
737  return StatusCode::FAILURE;
738  }
739  sdoCollection = sdoCollectionHandle.cptr();
740 
741  for (const auto clusterCollection : *SCT_ClusterContainer) {
742  // skip empty collections
743  if (clusterCollection->empty())
744  continue;
745 
746  int barrel_endcap = m_SCT_ID->barrel_ec(clusterCollection->identify());
747  int layer_disk = m_SCT_ID->layer_disk(clusterCollection->identify());
748  int eta_module = m_SCT_ID->eta_module(clusterCollection->identify());
749  int phi_module = m_SCT_ID->phi_module(clusterCollection->identify());
750  int side = m_SCT_ID->side(clusterCollection->identify());
751 
752  InDetDD::SiDetectorElement *element = m_SCT_Manager->getDetectorElement(clusterCollection->identify());
753 
754  Amg::Vector3D my_normal = element->normal();
755  float norm_x = fabs(my_normal.x()) > 1e-5 ? my_normal.x() : 0.;
756  float norm_y = fabs(my_normal.y()) > 1e-5 ? my_normal.y() : 0.;
757  float norm_z = fabs(my_normal.z()) > 1e-5 ? my_normal.z() : 0.;
758 
759  // loop over collection
760  for (const auto cluster : *clusterCollection) {
761  Identifier clusterId = cluster->identify();
762  if (!clusterId.is_valid()) {
763  ATH_MSG_WARNING("SCT cluster identifier is not valid");
764  }
765 
766  const Amg::MatrixX &local_cov = cluster->localCovariance();
767 
768  std::vector<std::pair<int, int>> barcodes = {};
769  std::vector<int> particleLink_eventIndex = {};
770  std::vector<int> particleLink_barcode = {};
771  std::vector<bool> barcodesLinked = {};
772  std::vector<float> charge = {};
773 
774  std::vector<int> tots = {};
775  std::vector<int> strip_ids = {};
776  int min_strip = 999;
777  int max_strip = -999;
778 
779  float charge_count = 0;
780  int pixel_count = 0;
781 
782  for (unsigned int rdo = 0; rdo < cluster->rdoList().size(); rdo++) {
783  const auto &rdoID = cluster->rdoList().at(rdo);
784 
785  int strip = m_SCT_ID->strip(rdoID);
786 
787  if (min_strip > strip)
788  min_strip = strip;
789  if (max_strip < strip)
790  max_strip = strip;
791  strip_ids.push_back(strip);
792  // tots.push_back(cluster->totList().at(rdo));
793  tots.push_back(0); // FIXME
794  ++pixel_count;
795  // find barcodes of the truth particles
796  auto pos = sdoCollection->find(rdoID);
797  if (pos != sdoCollection->end()) {
798  for (auto deposit : pos->second.getdeposits()) {
799  const HepMcParticleLink &particleLink = deposit.first;
800  std::pair<int, int> barcode(particleLink.eventIndex(), particleLink.barcode());
801  // note that we are not filling the map allTruthParticles here - OK, we are not using this map for
802  // anything
803  if (std::find(barcodes.begin(), barcodes.end(), barcode) == barcodes.end()) {
804  barcodes.push_back(barcode);
805  particleLink_eventIndex.push_back(particleLink.eventIndex());
806  particleLink_barcode.push_back(particleLink.barcode());
807  charge.push_back(deposit.second);
808  barcodesLinked.push_back(particleLink.isValid());
809  }
810  }
811  }
812  }
813 
814  // retrieve cluster shape
815  const InDetDD::SCT_ModuleSideDesign *design(
816  dynamic_cast<const InDetDD::SCT_ModuleSideDesign *>(&element->design()));
817  if (not design) {
818  ATH_MSG_ERROR("Failed at " << __LINE__ << " of accessing SCT ModuleSide Design");
819  return StatusCode::FAILURE;
820  }
821 
822  Amg::Vector2D locpos = cluster->localPosition();
823  std::pair<Amg::Vector3D, Amg::Vector3D> ends(
824  element->endsOfStrip(InDetDD::SiLocalPosition(locpos.y(), locpos.x(), 0)));
825 
826  Amg::Vector3D JanDirection = ends.second - ends.first;
827 
828  InDetDD::SiLocalPosition localPos_entry = design->localPositionOfCell(InDetDD::SiCellId(min_strip));
829  InDetDD::SiLocalPosition localPos_exit = design->localPositionOfCell(InDetDD::SiCellId(max_strip));
830 
831  Amg::Vector3D localStartPosition(localPos_entry.xEta() - 0.5 * element->etaPitch(),
832  localPos_entry.xPhi() - 0.5 * element->phiPitch(),
833  -0.5 * element->thickness());
834  Amg::Vector3D localEndPosition(localPos_exit.xEta() + 0.5 * element->etaPitch(),
835  localPos_exit.xPhi() + 0.5 * element->phiPitch(), 0.5 * element->thickness());
836 
837  Amg::Vector3D localDirection = localEndPosition - localStartPosition;
838  float loc_eta = 0, loc_phi = 0; // clusterShape: [leta, lphi]
839  cartesion_to_spherical(localDirection, loc_eta, loc_phi);
840 
841  Amg::Vector3D globalStartPosition = element->globalPosition(localStartPosition);
842  Amg::Vector3D globalEndPosition = element->globalPosition(localEndPosition);
843 
844  Amg::Vector3D direction = globalEndPosition - globalStartPosition;
845  float glob_eta = 0, glob_phi = 0; // clusterShape: [geta, gphi]
846  cartesion_to_spherical(direction, glob_eta, glob_phi);
847 
848  Amg::Vector3D my_phiax = element->phiAxis();
849  Amg::Vector3D my_etaax = element->etaAxis();
850 
851  float trkphicomp = direction.dot(my_phiax);
852  float trketacomp = direction.dot(my_etaax);
853  float trknormcomp = direction.dot(my_normal);
854  double phi_angle = atan2(trknormcomp, trkphicomp);
855  double eta_angle = atan2(trknormcomp, trketacomp);
856 
857  // now dumping all the values now
858  clusterIDMapIdx[cluster->identify()] = m_selected;
859  // cluster shape
860  std::vector<int> cst;
861  for (unsigned strip = 0; strip < strip_ids.size(); strip++) {
862  cst.push_back(-1);
863  }
864  std::vector<double> v_local_cov;
865  if (local_cov.size() > 0) {
866  for (size_t i = 0, nRows = local_cov.rows(), nCols = local_cov.cols(); i < nRows; i++) {
867  for (size_t j = 0; j < nCols; ++j) {
868  v_local_cov.push_back(local_cov(i, j));
869  }
870  }
871  }
872  if (m_rootFile) {
874  (*m_CLhardware).push_back("STRIP");
875  m_CLx[m_nCL] = cluster->globalPosition().x();
876  m_CLy[m_nCL] = cluster->globalPosition().y();
877  m_CLz[m_nCL] = cluster->globalPosition().z();
878  m_CLbarrel_endcap[m_nCL] = barrel_endcap;
879  m_CLlayer_disk[m_nCL] = layer_disk;
880  m_CLeta_module[m_nCL] = eta_module;
881  m_CLphi_module[m_nCL] = phi_module;
882  m_CLside[m_nCL] = side;
883  m_CLmoduleID[m_nCL] = clusterCollection->identify().get_compact();
884  (*m_CLparticleLink_eventIndex).push_back(particleLink_eventIndex);
885  (*m_CLparticleLink_barcode).push_back(particleLink_barcode);
886  (*m_CLbarcodesLinked).push_back(barcodesLinked);
887  (*m_CLparticle_charge).push_back(charge);
888  (*m_CLetas).push_back(strip_ids);
889  (*m_CLphis).push_back(cst);
890  (*m_CLtots).push_back(tots);
891  m_CLloc_direction1[m_nCL] = localDirection[0];
892  m_CLloc_direction2[m_nCL] = localDirection[1];
893  m_CLloc_direction3[m_nCL] = localDirection[2];
894  m_CLJan_loc_direction1[m_nCL] = JanDirection[0];
895  m_CLJan_loc_direction2[m_nCL] = JanDirection[1];
896  m_CLJan_loc_direction3[m_nCL] = JanDirection[2];
897  m_CLpixel_count[m_nCL] = pixel_count;
898  m_CLcharge_count[m_nCL] = charge_count;
899  m_CLloc_eta[m_nCL] = loc_eta;
900  m_CLloc_phi[m_nCL] = loc_phi;
901  m_CLglob_eta[m_nCL] = glob_eta;
902  m_CLglob_phi[m_nCL] = glob_phi;
903  m_CLeta_angle[m_nCL] = eta_angle;
904  m_CLphi_angle[m_nCL] = phi_angle;
905  m_CLnorm_x[m_nCL] = norm_x;
906  m_CLnorm_y[m_nCL] = norm_y;
907  m_CLnorm_z[m_nCL] = norm_z;
908  (*m_CLlocal_cov).push_back(v_local_cov);
909  }
910 
911  m_nCL++;
912  m_selected++;
913  if (m_nCL == m_maxCL) {
914  ATH_MSG_WARNING("DUMP : hit max number of clusters");
915  break;
916  }
917  }
918  }
919  }
920 
921 
925 
926  static const SG::Accessor< ElementLink<SpacePointCollection> > linkAcc("pixelSpacePointLink");
927  static const SG::Accessor< ElementLink< ::SpacePointCollection > > striplinkAcc("sctSpacePointLink");
928  static const SG::Accessor< ElementLink< ::SpacePointOverlapCollection > > stripOverlaplinkAcc("stripOverlapSpacePointLink");
929 
930  // xAOD Containers
931  const xAOD::SpacePointContainer *xAODPixelSPContainer = nullptr;
932 
934 
935  if (not xAODPixelSpacePointContainerHandle.isValid()) {
936  ATH_MSG_ERROR(" SpacePointContainer not found: " << m_xaodPixelSpacePointContainerKey.key());
937  return StatusCode::FAILURE;
938  }
939 
940  xAODPixelSPContainer = xAODPixelSpacePointContainerHandle.cptr();
941 
942 
943  const xAOD::SpacePointContainer *xAODStripSPContainer = 0;
944  SG::ReadHandle<xAOD::SpacePointContainer> xAODStripSpacePointContainerHandle{m_xaodStripSpacePointContainerKey, ctx};
945  if (not xAODStripSpacePointContainerHandle.isValid()) {
946  ATH_MSG_ERROR(" SpacePointContainer not found: " << m_xaodStripSpacePointContainerKey.key());
947  return StatusCode::FAILURE;
948  }
949  xAODStripSPContainer = xAODStripSpacePointContainerHandle.cptr();
950 
951 
952  const xAOD::SpacePointContainer *xAODStripSPOverlapContainer = 0;
953  SG::ReadHandle<xAOD::SpacePointContainer> xAODStripSpacePointOverlapContainerHandle{m_xaodStripSpacePointOverlapContainerKey, ctx};
954  if (not xAODStripSpacePointOverlapContainerHandle.isValid()) {
955  ATH_MSG_ERROR(" SpacePointContainer not found: " << m_xaodStripSpacePointOverlapContainerKey.key());
956  return StatusCode::FAILURE;
957  }
958  xAODStripSPOverlapContainer = xAODStripSpacePointOverlapContainerHandle.cptr();
959 
960  int sp_index = 0;
961  m_nSP = 0;
962 
963  if (xAODPixelSPContainer && xAODPixelSPContainer->size() > 0) {
964  for (const auto sp : *xAODPixelSPContainer) {
965 
966  if (not linkAcc.isAvailable(*sp))
967  ATH_MSG_FATAL("no pixel SpacePoint link for xAOD::SpacePoint");
968 
969 
970  auto trk_sp = *linkAcc(*sp);
971  const InDet::SiCluster *cl = static_cast<const InDet::SiCluster*>(trk_sp->clusterList().first);
972 
973  if (m_rootFile) {
974  m_SPindex[m_nSP] = sp_index;
975  m_SPx[m_nSP] = sp->globalPosition().x();
976  m_SPy[m_nSP] = sp->globalPosition().y();
977  m_SPz[m_nSP] = sp->globalPosition().z();
978  m_SPradius[m_nSP] = sp->radius();
979  m_SPcovr[m_nSP] = sp->varianceR();
980  m_SPcovz[m_nSP] = sp->varianceZ();
981  m_SPCL1_index[m_nSP] = clusterIDMapIdx[cl->identify()];
982  m_SPCL2_index[m_nSP] = -1;
983  m_SPisOverlap[m_nSP] = -1;
984  }
985 
986  sp_index++;
987  m_nSP++;
988  if (m_nSP == m_maxSP) {
989  ATH_MSG_WARNING("DUMP : hit max number of space points");
990  break;
991  }
992  } // loop on container
993  } // container not empty
994 
995  if (xAODStripSPContainer && xAODStripSPContainer->size() > 0) {
996 
997  //loop over collection
998  for (const auto sp : *xAODStripSPContainer) {
999 
1000  ATH_CHECK(striplinkAcc.isAvailable(*sp));
1001 
1002  auto trk_sp = *striplinkAcc(*sp);
1003  const InDet::SiCluster *cl_1 = static_cast<const InDet::SiCluster *>(trk_sp->clusterList().first);
1004  const InDet::SiCluster *cl_2 = static_cast<const InDet::SiCluster *>(trk_sp->clusterList().second);
1005 
1006  if (m_rootFile) {
1007 
1008  m_SPindex[m_nSP] = sp_index;
1009  m_SPx[m_nSP] = sp->globalPosition().x();
1010  m_SPy[m_nSP] = sp->globalPosition().y();
1011  m_SPz[m_nSP] = sp->globalPosition().z();
1012  m_SPradius[m_nSP] = sp->radius();
1013  m_SPcovr[m_nSP] = sp->varianceR();
1014  m_SPcovz[m_nSP] = sp->varianceZ();
1015  m_SPCL1_index[m_nSP] = clusterIDMapIdx[cl_1->identify()];
1016  m_SPCL2_index[m_nSP] = clusterIDMapIdx[cl_2->identify()];
1017  m_SPisOverlap[m_nSP] = 0;
1018  m_SPhl_topstrip[m_nSP] = sp->topHalfStripLength();
1019  m_SPhl_botstrip[m_nSP] = sp->bottomHalfStripLength();
1020 
1021 
1022  std::vector<float> topstripDir(sp->topStripDirection().data(),
1023  sp->topStripDirection().data() +
1024  sp->topStripDirection().size());
1025 
1026  std::vector<float> botstripDir(sp->bottomStripDirection().data(),
1027  sp->bottomStripDirection().data() +
1028  sp->bottomStripDirection().size());
1029 
1030  std::vector<float> DstripCnt(sp->stripCenterDistance().data(),
1031  sp->stripCenterDistance().data() +
1032  sp->stripCenterDistance().size());
1033 
1034  std::vector<float> topstripCnt(sp->topStripCenter().data(),
1035  sp->topStripCenter().data() +
1036  sp->topStripCenter().size());
1037 
1038  (*m_SPtopStripDirection).push_back(topstripDir);
1039  (*m_SPbottomStripDirection).push_back(botstripDir);
1040  (*m_SPstripCenterDistance).push_back(DstripCnt);
1041  (*m_SPtopStripCenterPosition).push_back(topstripCnt);
1042 
1043  }
1044 
1045  sp_index++;
1046  m_nSP++;
1047 
1048  if (m_nSP == m_maxSP) {
1049  ATH_MSG_WARNING("DUMP : hit max number of space points");
1050  break;
1051  }
1052  }
1053  }
1054 
1055 
1056  if (xAODStripSPOverlapContainer && xAODStripSPOverlapContainer->size() > 0) {
1057 
1058  //loop over collection
1059  for (const auto sp : *xAODStripSPOverlapContainer) {
1060 
1061  ATH_CHECK(stripOverlaplinkAcc.isAvailable(*sp));
1062 
1063  auto trk_sp = *stripOverlaplinkAcc(*sp);
1064  const InDet::SiCluster *cl_1 = static_cast<const InDet::SiCluster *>(trk_sp->clusterList().first);
1065  const InDet::SiCluster *cl_2 = static_cast<const InDet::SiCluster *>(trk_sp->clusterList().second);
1066 
1067  if (m_rootFile) {
1068 
1069  m_SPindex[m_nSP] = sp_index;
1070  m_SPx[m_nSP] = sp->globalPosition().x();
1071  m_SPy[m_nSP] = sp->globalPosition().y();
1072  m_SPz[m_nSP] = sp->globalPosition().z();
1073  m_SPradius[m_nSP] = sp->radius();
1074  m_SPcovr[m_nSP] = sp->varianceR();
1075  m_SPcovz[m_nSP] = sp->varianceZ();
1076  m_SPCL1_index[m_nSP] = clusterIDMapIdx[cl_1->identify()];
1077  m_SPCL2_index[m_nSP] = clusterIDMapIdx[cl_2->identify()];
1078 
1079  int flag = compute_overlap_SP_flag(m_CLeta_module[clusterIDMapIdx[cl_1->identify()]],
1080  m_CLphi_module[clusterIDMapIdx[cl_1->identify()]],
1081  m_CLeta_module[clusterIDMapIdx[cl_2->identify()]],
1082  m_CLphi_module[clusterIDMapIdx[cl_2->identify()]]);
1083 
1084  if ( flag<1 || flag > 3 )
1085  ATH_MSG_WARNING("Unexpected overlap SP flag: "<<flag);
1086 
1087 
1089  m_SPhl_topstrip[m_nSP] = sp->topHalfStripLength();
1090  m_SPhl_botstrip[m_nSP] = sp->bottomHalfStripLength();
1091 
1092 
1093  std::vector<float> topstripDir(sp->topStripDirection().data(),
1094  sp->topStripDirection().data() +
1095  sp->topStripDirection().size());
1096 
1097  std::vector<float> botstripDir(sp->bottomStripDirection().data(),
1098  sp->bottomStripDirection().data() +
1099  sp->bottomStripDirection().size());
1100 
1101  std::vector<float> DstripCnt(sp->stripCenterDistance().data(),
1102  sp->stripCenterDistance().data() +
1103  sp->stripCenterDistance().size());
1104 
1105  std::vector<float> topstripCnt(sp->topStripCenter().data(),
1106  sp->topStripCenter().data() +
1107  sp->topStripCenter().size());
1108 
1109  (*m_SPtopStripDirection).push_back(topstripDir);
1110  (*m_SPbottomStripDirection).push_back(botstripDir);
1111  (*m_SPstripCenterDistance).push_back(DstripCnt);
1112  (*m_SPtopStripCenterPosition).push_back(topstripCnt);
1113 
1114  }
1115 
1116  sp_index++;
1117  m_nSP++;
1118  if (m_nSP == m_maxSP) {
1119  ATH_MSG_WARNING("DUMP : hit max number of space points");
1120  break;
1121  }
1122  } // loop on container
1123  } // container not empty
1124 
1125 
1129 
1130  const TrackCollection *trackCollection = 0;
1131  SG::ReadHandle<TrackCollection> trackCollectionHandle{m_tracksKey, ctx};
1132  if (not trackCollectionHandle.isValid()) {
1133  ATH_MSG_WARNING(" TrackCollection not found: " << m_tracksKey.key());
1134  return StatusCode::FAILURE;
1135  }
1136  trackCollection = trackCollectionHandle.cptr();
1137 
1138  const TrackTruthCollection *trackTruthCollection = 0;
1139  SG::ReadHandle<TrackTruthCollection> trackTruthCollectionHandle{m_tracksTruthKey, ctx};
1140  if (not trackTruthCollectionHandle.isValid()) {
1141  ATH_MSG_WARNING(" TrackTruthCollection not found: " << m_tracksTruthKey.key());
1142  return StatusCode::FAILURE;
1143  }
1144  trackTruthCollection = trackTruthCollectionHandle.cptr();
1145 
1146  int trk_index = 0;
1147 
1148  // loop over tracks (and track truth) objects
1149  TrackCollection::const_iterator trackIterator = (*trackCollection).begin();
1150  m_nTRK = 0;
1151  if (m_rootFile) {
1152  (*m_TRKproperties).clear();
1153  (*m_TRKpattern).clear();
1154  (*m_TRKperigee_position).clear();
1155  (*m_TRKperigee_momentum).clear();
1156  (*m_TRKmeasurementsOnTrack_pixcl_sctcl_index).clear();
1157  (*m_TRKoutliersOnTrack_pixcl_sctcl_index).clear();
1158  }
1159 
1160  for (; trackIterator < (*trackCollection).end(); ++trackIterator) {
1161  if (!((*trackIterator))) {
1162  ATH_MSG_WARNING("TrackCollection contains empty entries");
1163  continue;
1164  }
1165  const Trk::TrackInfo &info = (*trackIterator)->info();
1166  const Trk::FitQuality *fitQuality = (*trackIterator)->fitQuality();
1167  const Trk::Perigee *perigeeParameters = (*trackIterator)->perigeeParameters();
1168  const DataVector<const Trk::MeasurementBase> *measurementsOnTrack = (*trackIterator)->measurementsOnTrack();
1169  const DataVector<const Trk::MeasurementBase> *outliersOnTrack = (*trackIterator)->outliersOnTrack();
1170 
1171  ElementLink<TrackCollection> tracklink;
1172  tracklink.setElement(const_cast<Trk::Track *>(*trackIterator));
1173  tracklink.setStorableObject(*trackCollection);
1174  const ElementLink<TrackCollection> tracklink2 = tracklink;
1175  TrackTruthCollection::const_iterator found = trackTruthCollection->find(tracklink2);
1176 
1177  const std::bitset<Trk::TrackInfo::NumberOfTrackProperties> &properties = info.properties();
1178  std::vector<int> v_properties;
1179  for (std::size_t i = 0; i < properties.size(); i++) {
1180  if (properties[i]) {
1181  v_properties.push_back(i);
1182  }
1183  }
1184 
1185  const std::bitset<Trk::TrackInfo::NumberOfTrackRecoInfo> &pattern = info.patternRecognition();
1186  std::vector<int> v_pattern;
1187  for (std::size_t i = 0; i < pattern.size(); i++) {
1188  if (pattern[i]) {
1189  v_pattern.push_back(i);
1190  }
1191  }
1192 
1193  int ndof = -1;
1194  float chiSq = 0;
1195  if (fitQuality) {
1196  ndof = fitQuality->numberDoF();
1197  chiSq = fitQuality->chiSquared();
1198  }
1199  std::vector<double> position, momentum;
1200  int charge = 0;
1201  if (perigeeParameters) {
1202  position.push_back(perigeeParameters->position()[0]);
1203  position.push_back(perigeeParameters->position()[1]);
1204  position.push_back(perigeeParameters->position()[2]);
1205  momentum.push_back(perigeeParameters->momentum()[0]);
1206  momentum.push_back(perigeeParameters->momentum()[1]);
1207  momentum.push_back(perigeeParameters->momentum()[2]);
1208  charge = perigeeParameters->charge();
1209  } else {
1210  position.push_back(0);
1211  position.push_back(0);
1212  position.push_back(0);
1213  momentum.push_back(0);
1214  momentum.push_back(0);
1215  momentum.push_back(0);
1216  }
1217  int mot = 0;
1218  int oot = 0;
1219  if (measurementsOnTrack)
1220  mot = measurementsOnTrack->size();
1221  if (outliersOnTrack)
1222  oot = outliersOnTrack->size();
1223  std::vector<int> measurementsOnTrack_pixcl_sctcl_index, outliersOnTrack_pixcl_sctcl_index;
1224  int TTCindex, TTCevent_index, TTCparticle_link;
1225  float TTCprobability;
1226  if (measurementsOnTrack) {
1227  for (size_t i = 0; i < measurementsOnTrack->size(); i++) {
1228  const Trk::MeasurementBase *mb = (*measurementsOnTrack)[i];
1229  const InDet::PixelClusterOnTrack *pixcl = dynamic_cast<const InDet::PixelClusterOnTrack *>(mb);
1230  const InDet::SCT_ClusterOnTrack *sctcl = dynamic_cast<const InDet::SCT_ClusterOnTrack *>(mb);
1231  if (pixcl) {
1232  measurementsOnTrack_pixcl_sctcl_index.push_back(clusterIDMapIdx[pixcl->prepRawData()->identify()]);
1233  }
1234  else if (sctcl) {
1235  measurementsOnTrack_pixcl_sctcl_index.push_back(clusterIDMapIdx[sctcl->prepRawData()->identify()]);
1236  } else {
1237  measurementsOnTrack_pixcl_sctcl_index.push_back(-1);
1238  }
1239  }
1240  }
1241  if (outliersOnTrack) {
1242  for (size_t i = 0; i < outliersOnTrack->size(); i++) {
1243  const Trk::MeasurementBase *mb = (*outliersOnTrack)[i];
1244  const InDet::PixelClusterOnTrack *pixcl = dynamic_cast<const InDet::PixelClusterOnTrack *>(mb);
1245  const InDet::SCT_ClusterOnTrack *sctcl = dynamic_cast<const InDet::SCT_ClusterOnTrack *>(mb);
1246  if (pixcl) {
1247  outliersOnTrack_pixcl_sctcl_index.push_back(clusterIDMapIdx[pixcl->prepRawData()->identify()]);
1248  } else if (sctcl) {
1249  outliersOnTrack_pixcl_sctcl_index.push_back(clusterIDMapIdx[sctcl->prepRawData()->identify()]);
1250  } else {
1251  outliersOnTrack_pixcl_sctcl_index.push_back(-1);
1252  }
1253  }
1254  }
1255  if (found != trackTruthCollection->end()) {
1256  TTCindex = found->first.index();
1257  TTCevent_index = found->second.particleLink().eventIndex();
1258  TTCparticle_link = found->second.particleLink().barcode();
1259  TTCprobability = found->second.probability();
1260  } else {
1261  TTCindex = TTCevent_index = TTCparticle_link = -999;
1262  TTCprobability = -1;
1263  }
1264 
1265  if (m_rootFile) {
1266  m_TRKindex[m_nTRK] = trk_index;
1267  m_TRKtrack_fitter[m_nTRK] = info.trackFitter();
1268  m_TRKndof[m_nTRK] = info.trackFitter();
1269  m_TRKparticle_hypothesis[m_nTRK] = info.particleHypothesis();
1270  (*m_TRKproperties).push_back(v_properties);
1271  (*m_TRKpattern).push_back(v_pattern);
1272  m_TRKndof[m_nTRK] = ndof;
1273  m_TRKchiSq[m_nTRK] = chiSq;
1274  (*m_TRKmeasurementsOnTrack_pixcl_sctcl_index).push_back(measurementsOnTrack_pixcl_sctcl_index);
1275  (*m_TRKoutliersOnTrack_pixcl_sctcl_index).push_back(outliersOnTrack_pixcl_sctcl_index);
1277  (*m_TRKperigee_position).push_back(position);
1278  (*m_TRKperigee_momentum).push_back(momentum);
1279  m_TRKmot[m_nTRK] = mot;
1280  m_TRKoot[m_nTRK] = oot;
1281  m_TTCindex[m_nTRK] = TTCindex;
1282  m_TTCevent_index[m_nTRK] = TTCevent_index;
1283  m_TTCparticle_link[m_nTRK] = TTCparticle_link;
1284  m_TTCprobability[m_nTRK] = TTCprobability;
1285  }
1286 
1287  trk_index++;
1288  // index
1289  m_nTRK++;
1290  if (m_nTRK == m_maxTRK) {
1291  ATH_MSG_WARNING("DUMP : hit max number of track events");
1292  break;
1293  }
1294  }
1295 
1296  const DetailedTrackTruthCollection *detailedTrackTruthCollection = 0;
1297  SG::ReadHandle<DetailedTrackTruthCollection> detailedTrackTruthCollectionHandle{m_detailedTracksTruthKey, ctx};
1298  if (not detailedTrackTruthCollectionHandle.isValid()) {
1299  ATH_MSG_WARNING(" DetailedTrackTruthCollection not found: " << m_detailedTracksTruthKey.key());
1300  return StatusCode::FAILURE;
1301  }
1302  detailedTrackTruthCollection = detailedTrackTruthCollectionHandle.cptr();
1303 
1304  m_nDTT = 0;
1305  if (m_rootFile) {
1306  (*m_DTTtrajectory_eventindex).clear();
1307  (*m_DTTtrajectory_barcode).clear();
1308  (*m_DTTstTruth_subDetType).clear();
1309  (*m_DTTstTrack_subDetType).clear();
1310  (*m_DTTstCommon_subDetType).clear();
1311  }
1312 
1313  // loop over DetailedTrackTruth objects
1314  DetailedTrackTruthCollection::const_iterator detailedTrackTruthIterator = (*detailedTrackTruthCollection).begin();
1315  for (; detailedTrackTruthIterator != (*detailedTrackTruthCollection).end(); ++detailedTrackTruthIterator) {
1316  std::vector<int> DTTtrajectory_eventindex, DTTtrajectory_barcode, DTTstTruth_subDetType, DTTstTrack_subDetType,
1317  DTTstCommon_subDetType;
1318  const TruthTrajectory &traj = detailedTrackTruthIterator->second.trajectory();
1319  for (size_t j = 0; j < traj.size(); j++) {
1320  DTTtrajectory_eventindex.push_back(traj[j].eventIndex());
1321  DTTtrajectory_barcode.push_back(traj[j].barcode());
1322  }
1323  const SubDetHitStatistics &stTruth = detailedTrackTruthIterator->second.statsTruth();
1324  const SubDetHitStatistics &stTrack = detailedTrackTruthIterator->second.statsTrack();
1325  const SubDetHitStatistics &stCommon = detailedTrackTruthIterator->second.statsCommon();
1326  for (unsigned j = 0; j < SubDetHitStatistics::NUM_SUBDETECTORS; j++) {
1327  DTTstTruth_subDetType.push_back(stTruth[SubDetHitStatistics::SubDetType(j)]);
1328  }
1329  for (unsigned j = 0; j < SubDetHitStatistics::NUM_SUBDETECTORS; j++) {
1330  DTTstTrack_subDetType.push_back(stTrack[SubDetHitStatistics::SubDetType(j)]);
1331  }
1332  for (unsigned j = 0; j < SubDetHitStatistics::NUM_SUBDETECTORS; j++) {
1333  DTTstCommon_subDetType.push_back(stCommon[SubDetHitStatistics::SubDetType(j)]);
1334  }
1335 
1336  if (m_rootFile) {
1337  m_DTTindex[m_nDTT] = detailedTrackTruthIterator->first.index();
1338  m_DTTsize[m_nDTT] = traj.size();
1339  (*m_DTTtrajectory_eventindex).push_back(DTTtrajectory_eventindex);
1340  (*m_DTTtrajectory_barcode).push_back(DTTtrajectory_barcode);
1341  (*m_DTTstTruth_subDetType).push_back(DTTstTruth_subDetType);
1342  (*m_DTTstTrack_subDetType).push_back(DTTstTrack_subDetType);
1343  (*m_DTTstCommon_subDetType).push_back(DTTstCommon_subDetType);
1344  }
1345 
1346  m_nDTT++;
1347  }
1348 
1349  // Once all the information for this event has been filled in the arrays,
1350  // copy content of the arrays to the TTree
1351  if (m_rootFile)
1352  m_nt->Fill();
1353 
1354  return StatusCode::SUCCESS;
1355 }
1356 
1357 //--------------------------------
1359  //--------------------------------
1360  if (m_rootFile) {
1361  delete[] m_SEID;
1362 
1363  delete[] m_CLindex;
1364  delete m_CLhardware;
1365  delete[] m_CLx;
1366  delete[] m_CLy;
1367  delete[] m_CLz;
1368  delete[] m_CLbarrel_endcap;
1369  delete[] m_CLlayer_disk;
1370  delete[] m_CLeta_module;
1371  delete[] m_CLphi_module;
1372  delete[] m_CLside;
1373  delete[] m_CLmoduleID;
1375  delete m_CLparticleLink_barcode;
1376  delete m_CLbarcodesLinked;
1377  delete m_CLparticle_charge;
1378  delete m_CLphis;
1379  delete m_CLetas;
1380  delete m_CLtots;
1381  delete[] m_CLloc_direction1;
1382  delete[] m_CLloc_direction2;
1383  delete[] m_CLloc_direction3;
1384  delete[] m_CLJan_loc_direction1;
1385  delete[] m_CLJan_loc_direction2;
1386  delete[] m_CLJan_loc_direction3;
1387  delete[] m_CLpixel_count;
1388  delete[] m_CLcharge_count;
1389  delete[] m_CLloc_eta;
1390  delete[] m_CLloc_phi;
1391  delete[] m_CLglob_eta;
1392  delete[] m_CLglob_phi;
1393  delete[] m_CLeta_angle;
1394  delete[] m_CLphi_angle;
1395  delete[] m_CLnorm_x;
1396  delete[] m_CLnorm_y;
1397  delete[] m_CLnorm_z;
1398  delete m_CLlocal_cov;
1399 
1400  delete[] m_Part_event_number;
1401  delete[] m_Part_barcode;
1402  delete[] m_Part_px;
1403  delete[] m_Part_py;
1404  delete[] m_Part_pz;
1405  delete[] m_Part_pt;
1406  delete[] m_Part_eta;
1407  delete[] m_Part_vx;
1408  delete[] m_Part_vy;
1409  delete[] m_Part_vz;
1410  delete[] m_Part_radius;
1411  delete[] m_Part_status;
1412  delete[] m_Part_charge;
1413  delete[] m_Part_pdg_id;
1414  delete[] m_Part_passed;
1415 
1416  delete[] m_Part_vProdNin;
1417  delete[] m_Part_vProdNout;
1418  delete[] m_Part_vProdStatus;
1419  delete[] m_Part_vProdBarcode;
1420  delete m_Part_vParentID;
1421  delete m_Part_vParentBarcode;
1422 
1423  delete[] m_SPindex;
1424  delete[] m_SPx;
1425  delete[] m_SPy;
1426  delete[] m_SPz;
1427  delete[] m_SPCL1_index;
1428  delete[] m_SPCL2_index;
1429  delete[] m_SPisOverlap;
1430  delete[] m_SPradius;
1431  delete[] m_SPcovr;
1432  delete[] m_SPcovz;
1433  delete[] m_SPhl_topstrip;
1434  delete[] m_SPhl_botstrip;
1435  delete m_SPtopStripDirection;
1436  delete m_SPbottomStripDirection;
1437  delete m_SPstripCenterDistance;
1439 
1440  delete[] m_TRKindex;
1441  delete[] m_TRKtrack_fitter;
1442  delete[] m_TRKparticle_hypothesis;
1443  delete m_TRKproperties;
1444  delete m_TRKpattern;
1445  delete[] m_TRKndof;
1446  delete[] m_TRKmot;
1447  delete[] m_TRKoot;
1448  delete[] m_TRKchiSq;
1451  delete[] m_TRKcharge;
1452  delete m_TRKperigee_position;
1453  delete m_TRKperigee_momentum;
1454  delete[] m_TTCindex;
1455  delete[] m_TTCevent_index;
1456  delete[] m_TTCparticle_link;
1457  delete[] m_TTCprobability;
1458 
1459  delete[] m_DTTindex;
1460  delete[] m_DTTsize;
1462  delete m_DTTtrajectory_barcode;
1463  delete m_DTTstTruth_subDetType;
1464  delete m_DTTstTrack_subDetType;
1465  delete m_DTTstCommon_subDetType;
1466  }
1467 
1468  return StatusCode::SUCCESS;
1469 }
1470 
1471 //--------------------------------------------------------------------------------------------
1472 bool InDet::DumpObjects::isPassed(HepMC::ConstGenParticlePtr particle, float &px, float &py, float &pz,
1473  float &pt, float &eta, float &vx, float &vy, float &vz, float &radius, float &status,
1474  float &charge, std::vector<int> &vParentID, std::vector<int> &vParentBarcode,
1475  int &vProdNin, int &vProdNout, int &vProdStatus, int &vProdBarcode) {
1476  //--------------------------------------------------------------------------------------------
1477 
1478  px = particle->momentum().px();
1479  py = particle->momentum().py();
1480  pz = particle->momentum().pz();
1481 
1482  pt = std::sqrt(px * px + py * py);
1483  eta = particle->momentum().eta();
1484 
1485  int pdgCode = particle->pdg_id();
1486 
1487  int absPdgCode = std::abs(pdgCode);
1488  // get the charge: ap->charge() is used later, DOES NOT WORK RIGHT NOW
1489  const HepPDT::ParticleData *ap = m_particleDataTable->particle(absPdgCode);
1490  charge = 1.;
1491  if (ap)
1492  charge = ap->charge();
1493  // since the PDT table only has abs(PID) values for the charge
1494  charge *= (pdgCode > 0.) ? 1. : -1.;
1495 
1496  status = particle->status();
1497 
1498  if (particle->production_vertex()) {
1499  vx = particle->production_vertex()->position().x();
1500  vy = particle->production_vertex()->position().y();
1501  vz = particle->production_vertex()->position().z();
1502  radius = particle->production_vertex()->position().perp();
1503  } else {
1504  vx = vy = vz = -1;
1505  radius = 999;
1506  if (status == 1)
1507  ATH_MSG_WARNING("no vertex for particle with status 1");
1508  }
1509 
1510  if (particle->production_vertex()) {
1511  vProdNin = particle->production_vertex()->particles_in_size();
1512  vProdNout = particle->production_vertex()->particles_out_size();
1513  vProdStatus = particle->production_vertex()->id();
1514  vProdBarcode = HepMC::barcode(particle->production_vertex()); // JB: HEPMC3 barcode() -> HepMC::barcode(p)
1515 #ifdef HEPMC3
1516  for (const auto &p : particle->production_vertex()->particles_in()) {
1517  vParentID.push_back(p->pdg_id());
1518  vParentBarcode.push_back(HepMC::barcode(p)); // JB: HEPMC3 barcode() -> HepMC::barcode(p)
1519  }
1520 #else
1521  for (auto ip = particle->production_vertex()->particles_in_const_begin();
1522  ip != particle->production_vertex()->particles_in_const_end();
1523  ++ip)
1524  {
1525  vParentID.push_back((*ip)->pdg_id());
1526  vParentBarcode.push_back(HepMC::barcode(*ip)); // JB: HEPMC3 barcode() -> HepMC::barcode(p)
1527  }
1528 #endif
1529  } else {
1530  vProdNin = 0;
1531  vProdNout = 0;
1532  vProdStatus = -999;
1533  vProdBarcode = 999;
1534  }
1535 
1536  bool passEta = (pt > 0.1) ? (std::abs(eta) < m_max_eta) : false;
1537  if (not passEta)
1538  return false;
1539 
1540  bool passPt = (pt > m_min_pt);
1541  if (not passPt)
1542  return false;
1543 
1544  bool passBarcode = (HepMC::barcode(particle) < m_max_barcode); // JB: HEPMC3 barcode() -> HepMC::barcode(p)
1545  if (not passBarcode)
1546  return false;
1547 
1548  bool passCharge = not(charge == 0.);
1549  if (not passCharge)
1550  return false;
1551 
1552  bool passStatus = (status == 1);
1553  if (not passStatus)
1554  return false;
1555 
1556  bool passProdRadius = (radius < m_maxProdVertex);
1557  if (not passProdRadius)
1558  return false;
1559 
1560  return true;
1561 }
grepfile.info
info
Definition: grepfile.py:38
python.PyKernel.retrieve
def retrieve(aClass, aKey=None)
Definition: PyKernel.py:110
xAOD::iterator
JetConstituentVector::iterator iterator
Definition: JetConstituentVector.cxx:68
InDet::DumpObjects::m_nPartEVT
int m_nPartEVT
Definition: DumpObjects.h:153
InDet::DumpObjects::m_TRKperigee_momentum
std::vector< std::vector< double > > * m_TRKperigee_momentum
Definition: DumpObjects.h:195
InDet::DumpObjects::m_pixelManager
const InDetDD::PixelDetectorManager * m_pixelManager
Definition: DumpObjects.h:70
mergePhysValFiles.pattern
pattern
Definition: DataQuality/DataQualityUtils/scripts/mergePhysValFiles.py:26
AllowedVariables::e
e
Definition: AsgElectronSelectorTool.cxx:37
InDet::DumpObjects::m_CLnorm_z
float * m_CLnorm_z
Definition: DumpObjects.h:150
DumpObjects.h
InDet::DumpObjects::m_CLeta_angle
double * m_CLeta_angle
Definition: DumpObjects.h:149
IDTPM::ndof
float ndof(const U &p)
Definition: TrackParametersHelper.h:134
UncalibratedMeasurement.h
SCT_ClusterOnTrack.h
InDet::DumpObjects::m_SPtopStripCenterPosition
std::vector< std::vector< float > > * m_SPtopStripCenterPosition
Definition: DumpObjects.h:185
InDet::DumpObjects::execute
virtual StatusCode execute() override final
Definition: DumpObjects.cxx:372
SubDetHitStatistics::SubDetType
SubDetType
Definition: SubDetHitStatistics.h:74
Trk::TrackInfo
Contains information about the 'fitter' of this track.
Definition: Tracking/TrkEvent/TrkTrack/TrkTrack/TrackInfo.h:32
InDet::DumpObjects::m_CLtots
std::vector< std::vector< int > > * m_CLtots
Definition: DumpObjects.h:142
InDet::DumpObjects::m_TRKchiSq
float * m_TRKchiSq
Definition: DumpObjects.h:192
InDet::DumpObjects::m_TRKoot
int * m_TRKoot
Definition: DumpObjects.h:191
ATH_MSG_FATAL
#define ATH_MSG_FATAL(x)
Definition: AthMsgStreamMacros.h:34
DataModel_detail::const_iterator
Const iterator class for DataVector/DataList.
Definition: DVLIterator.h:82
PixelID::phi_index
int phi_index(const Identifier &id) const
Definition: PixelID.h:658
GenEvent.h
Amg::MatrixX
Eigen::Matrix< double, Eigen::Dynamic, Eigen::Dynamic > MatrixX
Dynamic Matrix - dynamic allocation.
Definition: EventPrimitives.h:27
InDet::DumpObjects::m_Part_vProdNin
int * m_Part_vProdNin
Definition: DumpObjects.h:165
test_pyathena.px
px
Definition: test_pyathena.py:18
InDet::DumpObjects::m_maxDTT
int m_maxDTT
Definition: DumpObjects.h:116
perigeeParameters
Definition: ExtrapolatorComparisonTest.h:43
TrigCompositeUtils::passed
bool passed(DecisionID id, const DecisionIDContainer &idSet)
checks if required decision ID is in the set of IDs in the container
Definition: TrigCompositeUtilsRoot.cxx:117
python.TestDriveDummies.properties
dictionary properties
Definition: TestDriveDummies.py:14
ID
std::vector< Identifier > ID
Definition: CalibHitIDCheck.h:24
find
std::string find(const std::string &s)
return a remapped string
Definition: hcg.cxx:135
InDetDD::PixelModuleDesign
Definition: PixelModuleDesign.h:48
InDet::DumpObjects::m_CLside
int * m_CLside
Definition: DumpObjects.h:136
SG::ReadHandle::cptr
const_pointer_type cptr()
Dereference the pointer.
Trk::Track
The ATLAS Track class.
Definition: Tracking/TrkEvent/TrkTrack/TrkTrack/Track.h:73
InDet::DumpObjects::m_TRKproperties
std::vector< std::vector< int > > * m_TRKproperties
Definition: DumpObjects.h:190
InDet::DumpObjects::m_CLloc_direction2
double * m_CLloc_direction2
Definition: DumpObjects.h:143
SG::Accessor
Helper class to provide type-safe access to aux data.
Definition: Control/AthContainers/AthContainers/Accessor.h:68
InDet::DumpObjects::m_nt
TTree * m_nt
Definition: DumpObjects.h:118
PixelID::barrel_ec
int barrel_ec(const Identifier &id) const
Values of different levels (failure returns 0)
Definition: PixelID.h:619
SCT_ModuleSideDesign.h
Amg::Vector2D
Eigen::Matrix< double, 2, 1 > Vector2D
Definition: GeoPrimitives.h:48
SG::ReadHandle< McEventCollection >
InDet::DumpObjects::m_pixelSDOKey
SG::ReadHandleKey< InDetSimDataCollection > m_pixelSDOKey
Definition: DumpObjects.h:85
InDetDD::SCT_ModuleSideDesign
Definition: SCT_ModuleSideDesign.h:40
AthCommonDataStore< AthCommonMsg< Algorithm > >::declareProperty
Gaudi::Details::PropertyBase & declareProperty(Gaudi::Property< T > &t)
Definition: AthCommonDataStore.h:145
InDet::DumpObjects::m_CLnorm_x
float * m_CLnorm_x
Definition: DumpObjects.h:150
Trk::ParametersT
Dummy class used to allow special convertors to be called for surfaces owned by a detector element.
Definition: EMErrorDetail.h:25
SubDetHitStatistics::NUM_SUBDETECTORS
@ NUM_SUBDETECTORS
Definition: SubDetHitStatistics.h:74
InDet::DumpObjects::m_SPradius
double * m_SPradius
Definition: DumpObjects.h:174
SubDetHitStatistics
Definition: SubDetHitStatistics.h:34
InDet::DumpObjects::m_nCL
int m_nCL
Definition: DumpObjects.h:126
InDet::DumpObjects::m_Part_eta
float * m_Part_eta
Definition: DumpObjects.h:158
InDet::DumpObjects::m_CLloc_direction1
double * m_CLloc_direction1
Definition: DumpObjects.h:143
InDetDD::SolidStateDetectorElementBase::etaAxis
const Amg::Vector3D & etaAxis() const
Definition: SolidStateDetectorElementBase.cxx:88
InDet::DumpObjects::m_Part_vz
float * m_Part_vz
Definition: DumpObjects.h:159
skel.it
it
Definition: skel.GENtoEVGEN.py:407
InDet::DumpObjects::m_Part_pt
float * m_Part_pt
Definition: DumpObjects.h:157
test_pyathena.pt
pt
Definition: test_pyathena.py:11
InDet::DumpObjects::m_DTTindex
int * m_DTTindex
Definition: DumpObjects.h:200
InDet::DumpObjects::m_xaodStripSpacePointOverlapContainerKey
SG::ReadHandleKey< xAOD::SpacePointContainer > m_xaodStripSpacePointOverlapContainerKey
Definition: DumpObjects.h:92
InDet::SCT_ClusterContainer
Trk::PrepRawDataContainer< SCT_ClusterCollection > SCT_ClusterContainer
Definition: SCT_ClusterContainer.h:27
InDet::DumpObjects::m_CLbarrel_endcap
int * m_CLbarrel_endcap
Definition: DumpObjects.h:132
InDetSimDataCollection
Definition: InDetSimDataCollection.h:25
InDet::DumpObjects::m_CLparticleLink_eventIndex
std::vector< std::vector< int > > * m_CLparticleLink_eventIndex
Definition: DumpObjects.h:138
InDet::DumpObjects::m_CLy
double * m_CLy
Definition: DumpObjects.h:130
InDet::DumpObjects::m_DTTtrajectory_eventindex
std::vector< std::vector< int > > * m_DTTtrajectory_eventindex
Definition: DumpObjects.h:201
InDet::DumpObjects::m_SCT_ID
const SCT_ID * m_SCT_ID
Definition: DumpObjects.h:69
InDet::DumpObjects::m_CLlocal_cov
std::vector< std::vector< double > > * m_CLlocal_cov
Definition: DumpObjects.h:151
SiClusterOnTrack.h
InDet::SCT_ClusterOnTrack::prepRawData
virtual const InDet::SCT_Cluster * prepRawData() const override final
returns the PrepRawData - is a SCT_Cluster in this scope
Definition: SCT_ClusterOnTrack.h:145
SCT_ID::barrel_ec
int barrel_ec(const Identifier &id) const
Values of different levels (failure returns 0)
Definition: SCT_ID.h:728
InDet::DumpObjects::m_SPindex
int * m_SPindex
Definition: DumpObjects.h:169
InDet::DumpObjects::m_min_pt
float m_min_pt
Definition: DumpObjects.h:103
InDet::PixelClusterContainer
Trk::PrepRawDataContainer< PixelClusterCollection > PixelClusterContainer
Definition: InnerDetector/InDetRecEvent/InDetPrepRawData/InDetPrepRawData/PixelClusterContainer.h:28
SCT_ID::phi_module
int phi_module(const Identifier &id) const
Definition: SCT_ID.h:740
InDet::DumpObjects::m_offset
int m_offset
Definition: DumpObjects.h:99
SG::VarHandleKey::key
const std::string & key() const
Return the StoreGate ID for the referenced object.
Definition: AthToolSupport/AsgDataHandles/Root/VarHandleKey.cxx:141
InDet::DumpObjects::m_SCT_Manager
const InDetDD::SCT_DetectorManager * m_SCT_Manager
Definition: DumpObjects.h:71
InDet::DumpObjects::m_CLcharge_count
float * m_CLcharge_count
Definition: DumpObjects.h:146
InDet::DumpObjects::m_SPCL1_index
int * m_SPCL1_index
Definition: DumpObjects.h:171
InDet::DumpObjects::m_Part_passed
int * m_Part_passed
Definition: DumpObjects.h:164
InDet::DumpObjects::m_CLetas
std::vector< std::vector< int > > * m_CLetas
Definition: DumpObjects.h:142
InDetDD::SCT_DetectorManager::getDetectorElement
virtual SiDetectorElement * getDetectorElement(const Identifier &id) const override
access to individual elements via Identifier
Definition: SCT_DetectorManager.cxx:66
Identifier::is_valid
bool is_valid() const
Check if id is in a valid state.
InDet::DumpObjects::m_Part_vProdNout
int * m_Part_vProdNout
Definition: DumpObjects.h:165
InDetDD::SolidStateDetectorElementBase::etaPitch
double etaPitch() const
Pitch (inline methods)
python.AtlRunQueryParser.ap
ap
Definition: AtlRunQueryParser.py:826
InDet::DumpObjects::m_Part_status
float * m_Part_status
Definition: DumpObjects.h:161
GenParticle.h
InDet::DumpObjects::m_Part_event_number
int * m_Part_event_number
Definition: DumpObjects.h:154
InDet::DumpObjects::m_CLJan_loc_direction3
double * m_CLJan_loc_direction3
Definition: DumpObjects.h:144
InDet::DumpObjects::m_TTCparticle_link
int * m_TTCparticle_link
Definition: DumpObjects.h:196
InDet::DumpObjects::m_TTCprobability
float * m_TTCprobability
Definition: DumpObjects.h:197
InDet::DumpObjects::isPassed
bool isPassed(HepMC::ConstGenParticlePtr particle, float &px, float &py, float &pz, float &pt, float &eta, float &vx, float &vy, float &vz, float &radius, float &status, float &charge, std::vector< int > &vParentID, std::vector< int > &vParentBarcode, int &vProdNin, int &vProdNout, int &vProdStatus, int &vProdBarcode)
Definition: DumpObjects.cxx:1472
InDet::DumpObjects::m_SPcovz
double * m_SPcovz
Definition: DumpObjects.h:176
InDet::DumpObjects::m_maxProdVertex
float m_maxProdVertex
Definition: DumpObjects.h:105
AthenaPoolTestRead.sc
sc
Definition: AthenaPoolTestRead.py:27
InDet::DumpObjects::m_xaodStripSpacePointContainerKey
SG::ReadHandleKey< xAOD::SpacePointContainer > m_xaodStripSpacePointContainerKey
Definition: DumpObjects.h:90
InDet::DumpObjects::m_TRKperigee_position
std::vector< std::vector< double > > * m_TRKperigee_position
Definition: DumpObjects.h:195
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
InDet::DumpObjects::m_run_number
unsigned int m_run_number
Definition: DumpObjects.h:120
InDet::DumpObjects::m_rootFile
bool m_rootFile
jobOption: save data in root format
Definition: DumpObjects.h:117
TRT::Hit::side
@ side
Definition: HitInfo.h:83
InDet::DumpObjects::m_CLbarcodesLinked
std::vector< std::vector< bool > > * m_CLbarcodesLinked
Definition: DumpObjects.h:140
InDet::DumpObjects::m_SPbottomStripDirection
std::vector< std::vector< float > > * m_SPbottomStripDirection
Definition: DumpObjects.h:183
InDetDD::SiLocalPosition
Definition: SiLocalPosition.h:31
InDet::DumpObjects::m_CLparticle_charge
std::vector< std::vector< float > > * m_CLparticle_charge
Definition: DumpObjects.h:141
InDet::DumpObjects::m_selected
int m_selected
Definition: DumpObjects.h:73
InDetDD::SiLocalPosition::xPhi
double xPhi() const
position along phi direction:
Definition: SiLocalPosition.h:123
InDet::DumpObjects::m_DTTstTrack_subDetType
std::vector< std::vector< int > > * m_DTTstTrack_subDetType
Definition: DumpObjects.h:202
InDet::DumpObjects::m_eventInfoKey
SG::ReadHandleKey< xAOD::EventInfo > m_eventInfoKey
Definition: DumpObjects.h:79
InDet::DumpObjects::m_name
std::string m_name
Definition: DumpObjects.h:76
python.setupRTTAlg.size
int size
Definition: setupRTTAlg.py:39
InDet::DumpObjects::m_CLhardware
std::vector< std::string > * m_CLhardware
Definition: DumpObjects.h:128
InDetDD::SiDetectorElement::phiPitch
double phiPitch() const
Pitch (inline methods)
EventID.h
This class provides a unique identification for each event, in terms of run/event number and/or a tim...
InDet::DumpObjects::m_DTTtrajectory_barcode
std::vector< std::vector< int > > * m_DTTtrajectory_barcode
Definition: DumpObjects.h:201
TrackTruthCollection
Definition: TrackTruthCollection.h:21
python.utils.AtlRunQueryDQUtils.p
p
Definition: AtlRunQueryDQUtils.py:210
InDet::DumpObjects::m_tracksKey
SG::ReadHandleKey< TrackCollection > m_tracksKey
Definition: DumpObjects.h:94
PixelDetectorManager.h
InDet::DumpObjects::m_SPtopStripDirection
std::vector< std::vector< float > > * m_SPtopStripDirection
Definition: DumpObjects.h:182
ATH_MSG_ERROR
#define ATH_MSG_ERROR(x)
Definition: AthMsgStreamMacros.h:33
InDet::DumpObjects::m_CLloc_eta
float * m_CLloc_eta
Definition: DumpObjects.h:147
InDet::DumpObjects::m_CLphis
std::vector< std::vector< int > > * m_CLphis
Definition: DumpObjects.h:142
ParticleGun_EoverP_Config.momentum
momentum
Definition: ParticleGun_EoverP_Config.py:63
InDet::DumpObjects::m_Part_vParentID
std::vector< std::vector< int > > * m_Part_vParentID
Definition: DumpObjects.h:166
python.Dumpers.barcodes
def barcodes(beg, end, sz)
Definition: Dumpers.py:2800
lumiFormat.i
int i
Definition: lumiFormat.py:85
InDet::DumpObjects::m_ntupleTreeName
std::string m_ntupleTreeName
jobOption: Ntuple tree name
Definition: DumpObjects.h:111
InDetDD::SolidStateDetectorElementBase::thickness
double thickness() const
InDetDD::SiLocalPosition::xEta
double xEta() const
position along eta direction:
Definition: SiLocalPosition.h:118
perigeeParameters::perigeeParameters
perigeeParameters(double d0, double z0, double phi, double eta, double pt, double charge)
Definition: ExtrapolatorComparisonTest.h:50
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition: PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22
InDet::DumpObjects::m_pixelID
const PixelID * m_pixelID
Definition: DumpObjects.h:68
HepMC::barcode
int barcode(const T *p)
Definition: Barcode.h:16
InDet::DumpObjects::m_TTCevent_index
int * m_TTCevent_index
Definition: DumpObjects.h:196
InDet::DumpObjects::m_Part_radius
float * m_Part_radius
Definition: DumpObjects.h:160
master.flag
bool flag
Definition: master.py:29
InDet::DumpObjects::m_CLeta_module
int * m_CLeta_module
Definition: DumpObjects.h:134
Amg::pz
@ pz
Definition: GeoPrimitives.h:40
InDet::DumpObjects::m_SPy
double * m_SPy
Definition: DumpObjects.h:170
find_tgc_unfilled_channelids.ip
ip
Definition: find_tgc_unfilled_channelids.py:3
PixelID::eta_index
int eta_index(const Identifier &id) const
Definition: PixelID.h:664
InDet::DumpObjects::m_CLphi_angle
double * m_CLphi_angle
Definition: DumpObjects.h:149
xAOD::uint64_t
uint64_t
Definition: EventInfo_v1.cxx:123
ATH_CHECK
#define ATH_CHECK
Definition: AthCheckMacros.h:40
InDet::DumpObjects::m_TRKndof
int * m_TRKndof
Definition: DumpObjects.h:191
InDet::DumpObjects::m_Part_vy
float * m_Part_vy
Definition: DumpObjects.h:159
InDet::DumpObjects::m_ntupleDirName
std::string m_ntupleDirName
jobOption: Ntuple directory name
Definition: DumpObjects.h:110
InDet::DumpObjects::m_SPstripCenterDistance
std::vector< std::vector< float > > * m_SPstripCenterDistance
Definition: DumpObjects.h:184
InDet::DumpObjects::m_SPhl_topstrip
float * m_SPhl_topstrip
Definition: DumpObjects.h:178
drawFromPickle.tan
tan
Definition: drawFromPickle.py:36
Trk::FitQuality
Class to represent and store fit qualities from track reconstruction in terms of and number of degre...
Definition: FitQuality.h:97
InDet::DumpObjects::m_Part_vx
float * m_Part_vx
Definition: DumpObjects.h:159
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
InDet::DumpObjects::m_DTTsize
int * m_DTTsize
Definition: DumpObjects.h:200
InDet::DumpObjects::m_Part_charge
float * m_Part_charge
Definition: DumpObjects.h:162
InDet::DumpObjects::m_CLglob_phi
float * m_CLglob_phi
Definition: DumpObjects.h:148
Trk::FitQualityOnSurface::numberDoF
int numberDoF() const
returns the number of degrees of freedom of the overall track or vertex fit as integer
Definition: FitQuality.h:60
McEventCollection
This defines the McEventCollection, which is really just an ObjectVector of McEvent objects.
Definition: McEventCollection.h:33
InDet::DumpObjects::m_nDTT
int m_nDTT
Definition: DumpObjects.h:199
InDet::DumpObjects::m_Part_barcode
int * m_Part_barcode
Definition: DumpObjects.h:155
MeasurementDefs.h
DataVector
Derived DataVector<T>.
Definition: DataVector.h:794
SiLocalPosition.h
module_driven_slicing.max_eta
max_eta
Definition: module_driven_slicing.py:166
InDetDD::SolidStateDetectorElementBase::normal
virtual const Amg::Vector3D & normal() const override final
Get reconstruction local normal axes in global frame.
AthAlgorithm
Definition: AthAlgorithm.h:47
SG::ReadHandle::isValid
virtual bool isValid() override final
Can the handle be successfully dereferenced?
TruthVertex.h
RPDUtils::nCols
unsigned constexpr int nCols
Definition: RPDUtils.h:25
InDet::DumpObjects::m_SPx
double * m_SPx
Definition: DumpObjects.h:170
InDet::DumpObjects::m_TRKparticle_hypothesis
int * m_TRKparticle_hypothesis
Definition: DumpObjects.h:189
Trk::MeasurementBase
Definition: MeasurementBase.h:58
InDet::DumpObjects::m_CLglob_eta
float * m_CLglob_eta
Definition: DumpObjects.h:148
Trk::PrepRawData::identify
Identifier identify() const
return the identifier
InDet::DumpObjects::m_event_number
unsigned long long m_event_number
Definition: DumpObjects.h:121
PixelID::layer_disk
int layer_disk(const Identifier &id) const
Definition: PixelID.h:626
InDetDD::SiDetectorElement::endsOfStrip
std::pair< Amg::Vector3D, Amg::Vector3D > endsOfStrip(const Amg::Vector2D &position) const
Special method for SCT to retrieve the two ends of a "strip" Returned coordinates are in global frame...
Definition: SiDetectorElement.cxx:339
HepMC::ConstGenParticlePtr
const GenParticle * ConstGenParticlePtr
Definition: GenParticle.h:38
PixelID::eta_module
int eta_module(const Identifier &id) const
Definition: PixelID.h:651
TruthTrajectory
Definition: TruthTrajectory.h:26
Amg::py
@ py
Definition: GeoPrimitives.h:39
InDet::DumpObjects::m_CLmoduleID
uint64_t * m_CLmoduleID
Definition: DumpObjects.h:137
InDet::DumpObjects::m_SPisOverlap
int * m_SPisOverlap
Definition: DumpObjects.h:172
InDet::DumpObjects::m_Part_py
float * m_Part_py
Definition: DumpObjects.h:156
InDet::DumpObjects::m_maxPart
int m_maxPart
jobOption: maximum number of particles
Definition: DumpObjects.h:113
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:240
TrackInfo.h
RIO_OnTrack.h
InDet::DumpObjects::m_SPhl_botstrip
float * m_SPhl_botstrip
Definition: DumpObjects.h:180
InDet::DumpObjects::m_TRKmeasurementsOnTrack_pixcl_sctcl_index
std::vector< std::vector< int > > * m_TRKmeasurementsOnTrack_pixcl_sctcl_index
Definition: DumpObjects.h:193
InDet::DumpObjects::m_CLindex
int * m_CLindex
Definition: DumpObjects.h:127
charge
double charge(const T &p)
Definition: AtlasPID.h:931
InDet::DumpObjects::m_CLloc_direction3
double * m_CLloc_direction3
Definition: DumpObjects.h:143
SCT_ID::layer_disk
int layer_disk(const Identifier &id) const
Definition: SCT_ID.h:734
InDet::DumpObjects::m_SPz
double * m_SPz
Definition: DumpObjects.h:170
SiCluster.h
InDet::DumpObjects::m_CLparticleLink_barcode
std::vector< std::vector< int > > * m_CLparticleLink_barcode
Definition: DumpObjects.h:139
InDet::DumpObjects::m_CLpixel_count
int * m_CLpixel_count
Definition: DumpObjects.h:145
InDetDD::SiDetectorElement
Definition: SiDetectorElement.h:109
checkTriggerxAOD.found
found
Definition: checkTriggerxAOD.py:328
InDet::DumpObjects::m_pixelClusterKey
SG::ReadHandleKey< InDet::PixelClusterContainer > m_pixelClusterKey
Definition: DumpObjects.h:82
InDet::DumpObjects::m_particleDataTable
const HepPDT::ParticleDataTable * m_particleDataTable
Definition: DumpObjects.h:75
InDet::DumpObjects::m_mcEventCollectionKey
SG::ReadHandleKey< McEventCollection > m_mcEventCollectionKey
Definition: DumpObjects.h:80
Amg::Vector3D
Eigen::Matrix< double, 3, 1 > Vector3D
Definition: GeoPrimitives.h:47
InDet::DumpObjects::m_stripSDOKey
SG::ReadHandleKey< InDetSimDataCollection > m_stripSDOKey
Definition: DumpObjects.h:86
InDet::DumpObjects::m_max_eta
float m_max_eta
Definition: DumpObjects.h:102
InDet::DumpObjects::m_particlePropSvc
ServiceHandle< IPartPropSvc > m_particlePropSvc
Definition: DumpObjects.h:74
ParticleGun_SamplingFraction.radius
radius
Definition: ParticleGun_SamplingFraction.py:96
SiDetectorElement.h
python.LumiBlobConversion.pos
pos
Definition: LumiBlobConversion.py:18
InDet::DumpObjects::m_TTCindex
int * m_TTCindex
Definition: DumpObjects.h:196
xAOD::EventInfo_v1
Class describing the basic event information.
Definition: EventInfo_v1.h:43
InDet::DumpObjects::initialize
virtual StatusCode initialize() override final
Definition: DumpObjects.cxx:77
Trk::GsfMeasurementUpdator::fitQuality
FitQualityOnSurface fitQuality(const MultiComponentState &, const MeasurementBase &)
Method for determining the chi2 of the multi-component state and the number of degrees of freedom.
Definition: GsfMeasurementUpdator.cxx:845
InDetDD::SiCellId
Definition: SiCellId.h:29
InDet::DumpObjects::m_Part_pz
float * m_Part_pz
Definition: DumpObjects.h:156
InDet::PixelClusterOnTrack::prepRawData
virtual const PixelCluster * prepRawData() const override final
returns the PrepRawData - is a SiCluster in this scope
Definition: PixelClusterOnTrack.h:179
InDet::DumpObjects::m_DTTstTruth_subDetType
std::vector< std::vector< int > > * m_DTTstTruth_subDetType
Definition: DumpObjects.h:201
InDet::DumpObjects::m_Part_vProdStatus
int * m_Part_vProdStatus
Definition: DumpObjects.h:165
InDet::DumpObjects::m_stripClusterKey
SG::ReadHandleKey< InDet::SCT_ClusterContainer > m_stripClusterKey
Definition: DumpObjects.h:83
InDet::DumpObjects::m_SPCL2_index
int * m_SPCL2_index
Definition: DumpObjects.h:171
InDet::PixelClusterOnTrack
Definition: PixelClusterOnTrack.h:51
ATH_MSG_WARNING
#define ATH_MSG_WARNING(x)
Definition: AthMsgStreamMacros.h:32
SCT_ID::strip
int strip(const Identifier &id) const
Definition: SCT_ID.h:764
InDet::compute_overlap_SP_flag
int compute_overlap_SP_flag(const int &eta_module_cl1, const int &phi_module_cl1, const int &eta_module_cl2, const int &phi_module_cl2)
PixelModuleDesign.h
TRT_PAI_physicsConstants::mb
const double mb
1mb to cm2
Definition: TRT_PAI_physicsConstants.h:15
InDetDD::SolidStateDetectorElementBase::globalPosition
HepGeom::Point3D< double > globalPosition(const HepGeom::Point3D< double > &localPos) const
transform a reconstruction local position into a global position (inline):
InDetDD::SolidStateDetectorElementBase::phiAxis
const Amg::Vector3D & phiAxis() const
Definition: SolidStateDetectorElementBase.cxx:74
SCT_ID::eta_module
int eta_module(const Identifier &id) const
Definition: SCT_ID.h:746
InDet::DumpObjects::m_ntupleFileName
std::string m_ntupleFileName
jobOption: Ntuple file name
Definition: DumpObjects.h:109
python.CaloCondTools.log
log
Definition: CaloCondTools.py:20
InDet::DumpObjects::m_TRKoutliersOnTrack_pixcl_sctcl_index
std::vector< std::vector< int > > * m_TRKoutliersOnTrack_pixcl_sctcl_index
Definition: DumpObjects.h:193
InDet::DumpObjects::m_event
int m_event
Definition: DumpObjects.h:72
LArNewCalib_DelayDump_OFC_Cali.idx
idx
Definition: LArNewCalib_DelayDump_OFC_Cali.py:69
InDet::DumpObjects::m_CLloc_phi
float * m_CLloc_phi
Definition: DumpObjects.h:147
InDet::DumpObjects::m_detailedTracksTruthKey
SG::ReadHandleKey< DetailedTrackTruthCollection > m_detailedTracksTruthKey
Definition: DumpObjects.h:96
InDet::DumpObjects::m_nTRK
int m_nTRK
Definition: DumpObjects.h:187
InDet::DumpObjects::m_SEID
int * m_SEID
Definition: DumpObjects.h:124
InDet::DumpObjects::m_TRKtrack_fitter
int * m_TRKtrack_fitter
Definition: DumpObjects.h:189
module_driven_slicing.min_eta
min_eta
Definition: module_driven_slicing.py:166
InDet::DumpObjects::m_CLJan_loc_direction1
double * m_CLJan_loc_direction1
Definition: DumpObjects.h:144
SCT_ID::side
int side(const Identifier &id) const
Definition: SCT_ID.h:752
SG::ConstAccessor< T, AuxAllocator_t< T > >::isAvailable
bool isAvailable(const ELT &e) const
Test to see if this variable exists in the store.
InDet::DumpObjects::m_CLz
double * m_CLz
Definition: DumpObjects.h:131
DetailedTrackTruthCollection
Definition: DetailedTrackTruthCollection.h:20
merge.status
status
Definition: merge.py:17
InDet::DumpObjects::m_Part_pdg_id
int * m_Part_pdg_id
Definition: DumpObjects.h:163
RPDUtils::nRows
unsigned constexpr int nRows
Definition: RPDUtils.h:24
DataVector::at
const T * at(size_type n) const
Access an element, as an rvalue.
InDet::DumpObjects::m_xaodPixelSpacePointContainerKey
SG::ReadHandleKey< xAOD::SpacePointContainer > m_xaodPixelSpacePointContainerKey
Definition: DumpObjects.h:88
InDet::DumpObjects::m_CLnorm_y
float * m_CLnorm_y
Definition: DumpObjects.h:150
FitQuality.h
PixelClusterOnTrack.h
InDet::DumpObjects::m_Part_px
float * m_Part_px
Definition: DumpObjects.h:156
InDetDD::SiDetectorElement::design
virtual const SiDetectorDesign & design() const override final
access to the local description (inline):
PixelID::phi_module
int phi_module(const Identifier &id) const
Definition: PixelID.h:644
InDet::DumpObjects::m_TRKpattern
std::vector< std::vector< int > > * m_TRKpattern
Definition: DumpObjects.h:190
InDet::DumpObjects::m_Part_vParentBarcode
std::vector< std::vector< int > > * m_Part_vParentBarcode
Definition: DumpObjects.h:166
dq_make_web_display.cl
cl
print [x.__class__ for x in toList(dqregion.getSubRegions()) ]
Definition: dq_make_web_display.py:26
InDet::DumpObjects::DumpObjects
DumpObjects(const std::string &name, ISvcLocator *pSvcLocator)
Definition: DumpObjects.cxx:57
InDet::DumpObjects::m_max_barcode
int m_max_barcode
Definition: DumpObjects.h:104
InDet::DumpObjects::m_CLx
double * m_CLx
Definition: DumpObjects.h:129
DataVector::size
size_type size() const noexcept
Returns the number of elements in the collection.
InDet::DumpObjects::m_TRKcharge
int * m_TRKcharge
Definition: DumpObjects.h:194
InDet::DumpObjects::m_CLphi_module
int * m_CLphi_module
Definition: DumpObjects.h:135
EgEfficiencyCorr_testFixedInput.etas
list etas
Definition: EgEfficiencyCorr_testFixedInput.py:9
InDet::SiCluster
Definition: InnerDetector/InDetRecEvent/InDetPrepRawData/InDetPrepRawData/SiCluster.h:40
InDet::DumpObjects::m_maxCL
int m_maxCL
jobOption: maximum number of clusters
Definition: DumpObjects.h:112
Trk::FitQualityOnSurface::chiSquared
double chiSquared() const
returns the of the overall track fit
Definition: FitQuality.h:56
InDet::DumpObjects::finalize
virtual StatusCode finalize() override final
Definition: DumpObjects.cxx:1358
InDet::DumpObjects::m_nSE
int m_nSE
Definition: DumpObjects.h:123
InDet::DumpObjects::m_TRKmot
int * m_TRKmot
Definition: DumpObjects.h:191
InDet::DumpObjects::m_TRKindex
int * m_TRKindex
Definition: DumpObjects.h:188
InDet::DumpObjects::m_DTTstCommon_subDetType
std::vector< std::vector< int > > * m_DTTstCommon_subDetType
Definition: DumpObjects.h:202
InDet::DumpObjects::m_tracksTruthKey
SG::ReadHandleKey< TrackTruthCollection > m_tracksTruthKey
Definition: DumpObjects.h:95
InDet::DumpObjects::m_nSP
int m_nSP
Definition: DumpObjects.h:168
InDet::SCT_ClusterOnTrack
Definition: SCT_ClusterOnTrack.h:44
InDet::DumpObjects::m_Part_vProdBarcode
int * m_Part_vProdBarcode
Definition: DumpObjects.h:165
InDetDD::PixelDetectorManager::getDetectorElement
virtual SiDetectorElement * getDetectorElement(const Identifier &id) const override
access to individual elements : via Identifier
Definition: PixelDetectorManager.cxx:80
InDet::DumpObjects::m_CLJan_loc_direction2
double * m_CLJan_loc_direction2
Definition: DumpObjects.h:144
InDet::DumpObjects::m_SPcovr
double * m_SPcovr
Definition: DumpObjects.h:175
InDet::DumpObjects::m_maxTRK
int m_maxTRK
Definition: DumpObjects.h:115
InDet::DumpObjects::m_CLlayer_disk
int * m_CLlayer_disk
Definition: DumpObjects.h:133
InDet::DumpObjects::m_maxSP
int m_maxSP
jobOption: maximum number of space points
Definition: DumpObjects.h:114
Identifier
Definition: IdentifierFieldParser.cxx:14
EventInfoCnvParams::eventIndex
thread_local event_number_t eventIndex
Definition: IEvtIdModifierSvc.h:34