ATLAS Offline Software
FPGATrackSimConstGenAlgo.cxx
Go to the documentation of this file.
1 // Copyright (C) 2002-2023 CERN for the benefit of the ATLAS collaboration
2 
11 #include "GaudiKernel/MsgStream.h"
12 #include "GaudiKernel/ITHistSvc.h"
13 
16 
18 #include "FPGATrackSimMatrixIO.h"
19 
20 #include "TTree.h"
21 #include "TFile.h"
22 #include "TMath.h"
23 #include "TROOT.h"
24 
25 #include <sstream>
26 #include <iostream>
27 #include <fstream>
28 #include <cmath>
29 #include <string>
30 #include <stdio.h>
31 #include <math.h>
32 #include <stdlib.h>
33 #include <cassert>
34 
35 #include <TVectorD.h>
36 #include <TDecompLU.h>
37 
38 #define MIN_TRACK_SEC 50 // min number of tracks per sector
39 
40 using namespace std;
41 
42 
44 // Initialize
46 
47 FPGATrackSimConstGenAlgo::FPGATrackSimConstGenAlgo(const std::string& name, ISvcLocator* pSvcLocator) :
48  AthAlgorithm(name, pSvcLocator)
49 {
50 }
51 
52 
54 {
55  ATH_MSG_DEBUG("initialize()");
56  ATH_MSG_DEBUG("Are we going to dump missing hist constants? " << m_dumpMissingHitsConstants);
57  ATH_CHECK(m_FPGATrackSimMapping.retrieve());
58  m_pmap = (m_isSecondStage ? m_FPGATrackSimMapping->PlaneMap_2nd() : m_FPGATrackSimMapping->PlaneMap_1st() );
59 
60  ATH_CHECK(m_tHistSvc.retrieve());
62 
63  // Input file
64  ATH_MSG_DEBUG("reading " << m_cfpath.value());
65  m_mafile = TFile::Open(m_cfpath.value().c_str());
66  gROOT->cd();
67  // Copy the slice tree
69 
70  // Read sizing
71  m_matrix_tree = (TTree*)m_mafile->Get(("am" + std::to_string(0)).c_str());
72  m_matrix_tree->SetBranchAddress("ndim", &m_nCoords);
73  m_matrix_tree->SetBranchAddress("nplanes", &m_nLayers);
74  m_matrix_tree->GetEntry(0);
78 
79  if (static_cast<size_t>(m_nLayers) == m_FPGATrackSimMapping->PlaneMap_2nd()->getNLogiLayers())
80  m_pmap = m_FPGATrackSimMapping->PlaneMap_2nd();
81  else if (static_cast<size_t>(m_nLayers) == m_FPGATrackSimMapping->PlaneMap_1st()->getNLogiLayers())
82  m_pmap = m_FPGATrackSimMapping->PlaneMap_1st();
83  else
84  ATH_MSG_ERROR("nLayers " << m_nLayers << " doesn't match any pmap");
85 
87 
88  // Read skip list
89  if (!m_skipFile.empty()) readSkipList(m_matrix_tree->GetEntries());
90 
91  // Prepare output contstants tree
93 
94  // Create the good tree
95  std::string tree_name = "am" + std::to_string(0);
96  std::string tree_title = "Ambank " + std::to_string(0) + " matrices";
97  m_good_tree = new TTree(tree_name.c_str(), tree_title.c_str());
98  ATH_CHECK(m_tHistSvc->regTree(("/TRIGFPGATrackSimTREEGOODOUT/"+tree_name).c_str(), m_good_tree));
99 
100  // Run the constant generation
102 
103  return StatusCode::SUCCESS;
104 }
105 
106 
108 {
109  m_h_vc = new TH1F("h_vc","h_vc",500,-1e-4,1e-4);
110  m_h_vd = new TH1F("h_vd","h_vd",500,-1e-2,1e-2);
111  m_h_vf = new TH1F("h_vf","h_vf",500,-1e-2,1e-2);
112  m_h_vz = new TH1F("h_vz","h_vz",500,-1e-2,1e-2);
113  m_h_veta = new TH1F("h_veta","h_veta",500,-1e-2,1e-2);
114  ATH_CHECK(m_tHistSvc->regHist("/TRIGFPGATrackSimTREEGOODOUT/h_vc",m_h_vc));
115  ATH_CHECK(m_tHistSvc->regHist("/TRIGFPGATrackSimTREEGOODOUT/h_vd",m_h_vd));
116  ATH_CHECK(m_tHistSvc->regHist("/TRIGFPGATrackSimTREEGOODOUT/h_vf",m_h_vf));
117  ATH_CHECK(m_tHistSvc->regHist("/TRIGFPGATrackSimTREEGOODOUT/h_vz",m_h_vz));
118  ATH_CHECK(m_tHistSvc->regHist("/TRIGFPGATrackSimTREEGOODOUT/h_veta",m_h_veta));
119 
120  return StatusCode::SUCCESS;
121 }
122 
123 
125 {
126  // Read old tree
127  TTree *old_tree = (TTree*)file->Get("slice");
128  old_tree->SetBranchAddress("c_max", &m_sliceMax.qOverPt);
129  old_tree->SetBranchAddress("c_min", &m_sliceMin.qOverPt);
130  old_tree->SetBranchAddress("c_slices", &m_sliceNBins.qOverPt);
131 
132  old_tree->SetBranchAddress("phi_max", &m_sliceMax.phi);
133  old_tree->SetBranchAddress("phi_min", &m_sliceMin.phi);
134  old_tree->SetBranchAddress("phi_slices", &m_sliceNBins.phi);
135 
136  old_tree->SetBranchAddress("d0_max", &m_sliceMax.d0);
137  old_tree->SetBranchAddress("d0_min", &m_sliceMin.d0);
138  old_tree->SetBranchAddress("d0_slices", &m_sliceNBins.d0);
139 
140  old_tree->SetBranchAddress("z0_max", &m_sliceMax.z0);
141  old_tree->SetBranchAddress("z0_min", &m_sliceMin.z0);
142  old_tree->SetBranchAddress("z0_slices", &m_sliceNBins.z0);
143 
144  old_tree->SetBranchAddress("eta_max", &m_sliceMax.eta);
145  old_tree->SetBranchAddress("eta_min", &m_sliceMin.eta);
146  old_tree->SetBranchAddress("eta_slices", &m_sliceNBins.eta);
147 
148  old_tree->GetEntry(0);
149 
150  // Write new tree
151  TTree *new_tree = new TTree("slice", "Slice boundaries");
152  ATH_CHECK(m_tHistSvc->regTree("/TRIGFPGATrackSimTREEGOODOUT/slice", new_tree));
153 
154  new_tree->Branch("c_max", &m_sliceMax.qOverPt);
155  new_tree->Branch("c_min", &m_sliceMin.qOverPt);
156  new_tree->Branch("c_slices", &m_sliceNBins.qOverPt);
157 
158  new_tree->Branch("phi_max", &m_sliceMax.phi);
159  new_tree->Branch("phi_min", &m_sliceMin.phi);
160  new_tree->Branch("phi_slices", &m_sliceNBins.phi);
161 
162  new_tree->Branch("d0_max", &m_sliceMax.d0);
163  new_tree->Branch("d0_min", &m_sliceMin.d0);
164  new_tree->Branch("d0_slices", &m_sliceNBins.d0);
165 
166  new_tree->Branch("z0_max", &m_sliceMax.z0);
167  new_tree->Branch("z0_min", &m_sliceMin.z0);
168  new_tree->Branch("z0_slices", &m_sliceNBins.z0);
169 
170  new_tree->Branch("eta_max", &m_sliceMax.eta);
171  new_tree->Branch("eta_min", &m_sliceMin.eta);
172  new_tree->Branch("eta_slices", &m_sliceNBins.eta);
173 
174  new_tree->Fill();
175 
176  return StatusCode::SUCCESS;
177 }
178 
179 
181 {
182  // Dummy variables for typing
183  int anInt;
184  float aFloat;
185  double aDouble;
186 
187  std::string tree_name = "am" + std::to_string(0);
188  std::string tree_title = "Ambank " + std::to_string(0) + " constants";
189  m_ctree = new TTree(tree_name.c_str(), tree_title.c_str());
190 
191  m_ctree->Branch("ndim", &m_nCoords, "ndim/I");
192  m_ctree->Branch("ndim2", &m_nCoords_2, "ndim2/I");
193  m_ctree->Branch("nkernel", &m_nKernel, "nkernel/I");
194  m_ctree->Branch("nkaverages", &m_nKAverages, "nkaverages/I");
195  m_ctree->Branch("nplane", &m_nLayers, "nplane/I");
196 
197  m_ctree->Branch("sectorID", &anInt, "sectorID[nplane]/I");
198  m_ctree->Branch("hashID", &anInt, "hashID[nplane]/I");
199  m_ctree->Branch("nhit", &aFloat, "nhit/F");
200 
201  m_ctree->Branch("Cd", &aDouble, "Cd/D");
202  m_ctree->Branch("Cc", &aDouble, "Cc/D");
203  m_ctree->Branch("Cf", &aDouble, "Cf/D");
204  m_ctree->Branch("Cz0", &aDouble, "Cz0/D");
205  m_ctree->Branch("Co", &aDouble, "Co/D");
206 
207  m_ctree->Branch("Vc", &aDouble, "Vc[ndim]/D");
208  m_ctree->Branch("Vd", &aDouble, "Vd[ndim]/D");
209  m_ctree->Branch("Vf", &aDouble, "Vf[ndim]/D");
210  m_ctree->Branch("Vz0", &aDouble, "Vz0[ndim]/D");
211  m_ctree->Branch("Vo", &aDouble, "Vo[ndim]/D");
212 
213  m_ctree->Branch("kernel", &aDouble, "kernel[nkernel]/D");
214  m_ctree->Branch("kaverages", &aDouble, "kaverages[nkaverages]/D");
215 
216  ATH_CHECK(m_tHistSvc->regTree(("/TRIGFPGATrackSimCTREEOUT/"+tree_name).c_str(), m_ctree));
217  return StatusCode::SUCCESS;
218 }
219 
220 
222 {
223  m_skipList.resize(nSectors);
224 
225  std::ifstream file(m_skipFile);
226  if (!file.is_open()) return;
227 
228  size_t count = 0;
229  size_t sector;
230  while (file >> sector)
231  {
232  if (sector >= nSectors)
233  {
234  ATH_MSG_ERROR("Bad sector " << sector << "/" << nSectors);
235  return;
236  }
237  m_skipList[sector] = true;
238  count++;
239  }
240  ATH_MSG_INFO("Skipping " << count << " sectors out of " << nSectors);
241  file.close();
242 }
243 
244 
245 
246 // Main function. Generates constants into m_geo_consts, and copies the good matrices into m_good_tree.
248 {
251  for (size_t entry = 0; entry < (size_t)m_matrix_tree->GetEntries(); entry++)
252  {
253  // Read the entry
254  if (!m_skipList.empty() && m_skipList[entry]) continue;
255  reader.readEntry(entry);
256  std::vector<module_t> & modules = reader.getModules();
257  FPGATrackSimMatrixAccumulator & acc = reader.getAccumulator();
258 
259  // Check for sufficient statistics
260  if (acc.track_bins.size() < MIN_TRACK_SEC)
261  {
262  ATH_MSG_DEBUG("Insufficient tracks in sector " << reader.getEntry());
263  continue;
264  }
265 
266  // Scale and normalize the accumulated variables
268 
269  // Create the constants
271  bool success = GetConstants(acc_norm, geo, entry);
272  if (!success) continue;
273 
274  // Fill the constant tree and good matrix tree
275  fillConstTree(modules, acc, geo);
276  writer.fill(modules, acc);
277  m_geo_consts.push_back(geo);
278 
279  // If needed, we generate the same as above but dropping/ignoring each potential hit
281  }
282 }
283 
285 {
286  for (int ip = 0; ip < m_nLayers; ip++)
287  {
288  int missing = m_pmap->getCoordOffset(ip); // this is the coordinate we are missing
289  if (!acc_norm.coords_usable[missing]) // just skip ahead if we aren't using this coordinate already
290  {
291  geo_constants emptyGeo(m_nCoords);
292  m_geo_consts_with_missinghit[ip].push_back(emptyGeo);
293  continue;
294  }
295 
296  unsigned int nusable = acc_norm.nusable() - 1;
297  std::vector<bool> coordsToUse = acc_norm.coords_usable;
298  coordsToUse[missing] = false;
299 
300  if (m_pmap->getDim(ip) == 2)
301  {
302  coordsToUse[missing+1] = false;
303  nusable--;
304  }
305 
306 
308  bool success = GetConstants(acc_norm, geo, entry, coordsToUse, nusable);
309  if (!success)
310  {
311  // push this back to keep the order correct (ie same numbering as nominal constants)
312  geo_constants emptyGeo(m_nCoords);
313  m_geo_consts_with_missinghit[ip].push_back(emptyGeo);
314  }
315  else
316  {
317  m_geo_consts_with_missinghit[ip].push_back(geo);
318  }
319  }
320 }
321 
323 {
324  return GetConstants(acc_norm, geo, entryNumber, acc_norm.coords_usable, acc_norm.nusable());
325 }
326 
327 bool FPGATrackSimConstGenAlgo::GetConstants(FPGATrackSimMatrixAccumulator const &acc_norm, geo_constants &geo, int entryNumber, std::vector<bool> const &coordsToUse, unsigned int nusable)
328 {
329  // Get the reduced matrix and invert it
330  TMatrixD mtx_reduced = getReducedMatrix(m_nCoords, acc_norm.covariance, coordsToUse, nusable);
331  if (isSingular(mtx_reduced))
332  {
333  ATH_MSG_DEBUG("Singular matrix in sector " << entryNumber);
334  return false;
335  }
336  std::vector<double> inv_covariance = invert(m_nCoords, mtx_reduced, coordsToUse);
337 
338  // Calculate the eigen system
339  std::vector<double> eigvals;
340  vector2D<double> eigvecs;
341 
342  eigen(nusable, m_nCoords, mtx_reduced, coordsToUse, eigvals, eigvecs);
343 
344  // Calculate the constants
345  geo = makeConsts(acc_norm, coordsToUse, inv_covariance, eigvals, eigvecs);
346 
347  if (failedConstants(geo, coordsToUse))
348  {
349  ATH_MSG_DEBUG("Failed constants in sector " << entryNumber);
350  return false;
351  }
352 
353  return true;
354 }
355 
357 {
358  float coverage = static_cast<float>(acc.track_bins.size());
359  m_ctree->SetBranchAddress("sectorID", acc.FTK_modules.data());
360  m_ctree->SetBranchAddress("hashID", modules.data());
361  m_ctree->SetBranchAddress("nhit", &coverage);
362 
363  m_ctree->SetBranchAddress("Cc", &geo.pars.qOverPt);
364  m_ctree->SetBranchAddress("Cd", &geo.pars.d0);
365  m_ctree->SetBranchAddress("Cf", &geo.pars.phi);
366  m_ctree->SetBranchAddress("Cz0", &geo.pars.z0);
367  m_ctree->SetBranchAddress("Co", &geo.pars.eta);
368 
369  m_ctree->SetBranchAddress("Vc", geo.Vcurvature.data());
370  m_ctree->SetBranchAddress("Vd", geo.Vd0.data());
371  m_ctree->SetBranchAddress("Vf", geo.Vphi.data());
372  m_ctree->SetBranchAddress("Vz0", geo.Vz0.data());
373  m_ctree->SetBranchAddress("Vo", geo.Veta.data());
374 
375  m_ctree->SetBranchAddress("kaverages", geo.kaverages.data());
376  m_ctree->SetBranchAddress("kernel", geo.kernel.data());
377 
378  m_ctree->Fill();
379 
380  if (m_Monitor)
381  {
382  for (int i = 0; i < m_nCoords; i++)
383  {
384  m_h_vc->Fill(geo.Vcurvature[i]);
385  m_h_vd->Fill(geo.Vd0[i]);
386  m_h_vf->Fill(geo.Vphi[i]);
387  m_h_vz->Fill(geo.Vz0[i]);
388  m_h_veta->Fill(geo.Veta[i]);
389  }
390  }
391 }
392 
393 
394 bool FPGATrackSimConstGenAlgo::isNAN(double value, const char* name)
395 {
396  if (TMath::IsNaN(value))
397  {
398  ATH_MSG_WARNING("NaN found in " << name);
399  return true;
400  }
401  return false;
402 }
403 
404 #define CHECK_NAN(var) (isNAN((var), #var))
405 
406 // Check if constants are bad (eg, contain "nan")
407 bool FPGATrackSimConstGenAlgo::failedConstants(geo_constants const & geo, std::vector<bool> const & usable)
408 {
410 
411  if (CHECK_NAN(gco.pars.qOverPt)) return true;
412  if (CHECK_NAN(geo.pars.qOverPt)) return true;
413  if (CHECK_NAN(gco.pars.d0)) return true;
414  if (CHECK_NAN(geo.pars.d0)) return true;
415  if (CHECK_NAN(gco.pars.phi)) return true;
416  if (CHECK_NAN(geo.pars.phi)) return true;
417  if (CHECK_NAN(gco.pars.z0)) return true;
418  if (CHECK_NAN(geo.pars.z0)) return true;
419  if (CHECK_NAN(gco.pars.eta)) return true;
420  if (CHECK_NAN(geo.pars.eta)) return true;
421 
422  for (int i = 0; i < m_nCoords; i++)
423  {
424  if (CHECK_NAN(gco.Vcurvature[i])) return true;
425  if (CHECK_NAN(geo.Vcurvature[i])) return true;
426  if (CHECK_NAN(gco.Vd0[i])) return true;
427  if (CHECK_NAN(geo.Vd0[i])) return true;
428  if (CHECK_NAN(gco.Vphi[i])) return true;
429  if (CHECK_NAN(geo.Vphi[i])) return true;
430  if (CHECK_NAN(gco.Vz0[i])) return true;
431  if (CHECK_NAN(geo.Vz0[i])) return true;
432  if (CHECK_NAN(gco.Veta[i])) return true;
433  if (CHECK_NAN(geo.Veta[i])) return true;
434  }
435 
436  for (int i = 0; i < m_nCoords - FPGATrackSimTrackPars::NPARS; i++)
437  {
438  if (CHECK_NAN(geo.kaverages[i])) return true;
439  for (int j = 0; j < m_nCoords; j++)
440  if (CHECK_NAN(geo.kernel(i,j))) return true;
441  }
442 
443  return false;
444 }
445 
446 
448 // Arithmetic Functions
450 
451 /*
452  * This function normalizes the accumulated variables in acc_raw into the actual
453  * averages needed for constant generation. The pars and hit_coords are averaged
454  * using the coverage. The covariance field, which currently stores sum(x_i x_j),
455  * is converted into the actual covariance matrix. The hix_x_par fields are
456  * converted from sum(x_k p_i) to <x_k p_i> - <x_k> <p_i>.
457  */
459 {
461  double coverage = static_cast<double>(acc.track_bins.size());
462  size_t nCoords = acc.hit_coords.size();
463 
464  for (unsigned i = 0; i < FPGATrackSimTrackPars::NPARS; i++)
465  acc.pars[i] /= coverage;
466 
467  for (unsigned i = 0; i < nCoords; i++)
468  {
469  acc.hit_coords[i] /= coverage;
470  if (std::abs(acc.hit_coords[i]) < MTX_TOLERANCE) acc.coords_usable[i] = false;
471  else acc.coords_usable[i] = true;
472  }
473 
474  // Divide by n-1 for the sample variance (Bessel's correction)
475  for (unsigned i = 0; i < nCoords; i++)
476  {
477  acc.hit_x_QoP[i] = (acc.hit_x_QoP[i] - acc.hit_coords[i] * acc.pars.qOverPt * coverage) / (coverage-1);
478  acc.hit_x_d0[i] = (acc.hit_x_d0[i] - acc.hit_coords[i] * acc.pars.d0 * coverage) / (coverage-1);
479  acc.hit_x_z0[i] = (acc.hit_x_z0[i] - acc.hit_coords[i] * acc.pars.z0 * coverage) / (coverage-1);
480  acc.hit_x_phi[i] = (acc.hit_x_phi[i] - acc.hit_coords[i] * acc.pars.phi * coverage) / (coverage-1);
481  acc.hit_x_eta[i] = (acc.hit_x_eta[i] - acc.hit_coords[i] * acc.pars.eta * coverage) / (coverage-1);
482 
483  // Covariance (and symmetrize)
484  for (unsigned j = i ; j < nCoords; ++j)
485  {
486  acc.covariance[j * nCoords + i] = acc.covariance[i * nCoords + j] =
487  (acc.covariance[i * nCoords + j] - acc.hit_coords[i] * acc.hit_coords[j] * coverage) / (coverage-1);
488  }
489  }
490 
491  return acc;
492 }
493 
494 
496  std::vector<double> const & inv_covariance,
497  std::vector<double> const & eigvals, vector2D<double> const & eigvecs)
498 {
499  size_t nCoords = acc.hit_coords.size();
500  geo_constants geo(nCoords);
501 
502  geo.Vcurvature = matrix_multiply(inv_covariance, acc.hit_x_QoP);
503  geo.Vd0 = matrix_multiply(inv_covariance, acc.hit_x_d0);
504  geo.Vphi = matrix_multiply(inv_covariance, acc.hit_x_phi);
505  geo.Vz0 = matrix_multiply(inv_covariance, acc.hit_x_z0);
506  geo.Veta = matrix_multiply(inv_covariance, acc.hit_x_eta);
507 
508  for (size_t i = 0; i < nCoords - FPGATrackSimTrackPars::NPARS; i++)
509  {
510  if (!usable[i]) continue; // vectors are filled with 0's by default
511  for (size_t j = 0; j < nCoords; j++)
512  {
513  if (!usable[j]) continue;
514  if (eigvals[i] > 0)
515  geo.kernel(i, j) = eigvecs(i, j) / sqrt(eigvals[i]);
516 
517  geo.kaverages[i] += -geo.kernel(i, j) * acc.hit_coords[j];
518  }
519  }
520 
521  geo.pars = acc.pars;
522  for (size_t i = 0; i < nCoords; i++)
523  {
524  geo.pars.d0 += -geo.Vd0[i] * acc.hit_coords[i];
525  geo.pars.qOverPt += -geo.Vcurvature[i] * acc.hit_coords[i];
526  geo.pars.phi += -geo.Vphi[i] * acc.hit_coords[i];
527  geo.pars.z0 += -geo.Vz0[i] * acc.hit_coords[i];
528  geo.pars.eta += -geo.Veta[i] * acc.hit_coords[i];
529  }
530 
531  geo.real = static_cast<int>(acc.track_bins.size());
532  return geo;
533 }
534 
535 
536 /*
537  * Calculates matrix multiplication x = A * b;
538  *
539  * @param A - (n*n) matrix
540  * @param b - length-n vector
541  * @return A * b (length-n vector)
542  */
543 std::vector<double> FPGATrackSimConstGenAlgo::matrix_multiply(std::vector<double> const & A, std::vector<double> const & b)
544 {
545  size_t n = b.size();
546  std::vector<double> x(n);
547 
548  for (size_t i = 0; i < n; i++)
549  for (size_t j = 0; j < n; j++)
550  x[i] += A[i * n + j] * b[j];
551 
552  return x;
553 }
554 
555 
557 {
558  TDecompLU dc(mtx); // note mtx is a copy
559  bool ok = dc.InvertLU(mtx, MTX_TOLERANCE);
560  return !ok;
561 }
562 
563 
572 TMatrixD FPGATrackSimConstGenAlgo::getReducedMatrix(size_t n, std::vector<double> const & mtx_v, std::vector<bool> const & usable, size_t nDimToUse)
573 {
574  TMatrixD mtx(n, n, mtx_v.data());
575  TMatrixD newmtx(nDimToUse, nDimToUse);
576 
577  size_t counteri = 0;
578  for (size_t i = 0; i < n; i++)
579  {
580  if (!usable[i]) continue;
581 
582  size_t counterj = 0;
583  for (size_t j = 0; j < n; j++)
584  {
585  if (!usable[j]) continue;
586  newmtx[counteri][counterj] = mtx[i][j]; // if we use this coordinate, copy it over
587  counterj++; // iterate counter
588  }
589  assert(counterj == nDimToUse);
590  counteri++;
591  }
592  assert(counteri == nDimToUse);
593 
594  return newmtx;
595 }
596 
597 
605 std::vector<double> FPGATrackSimConstGenAlgo::invert(size_t n_full, TMatrixD mtx, std::vector<bool> const & usable)
606 {
607  // Output
608  std::vector<double> inv(n_full * n_full); // filled with 0s
609 
610  mtx.Invert();
611 
612  size_t counteri = 0;
613  for (size_t i = 0; i < n_full; i++)
614  {
615  if (!usable[i]) continue;
616 
617  size_t counterj = 0;
618  for (size_t j = 0; j < n_full; j++)
619  {
620  if (!usable[j]) continue;
621  inv[i*n_full + j] = mtx[counteri][counterj];
622  counterj++;
623  }
624  counteri++;
625  }
626 
627  return inv;
628 }
629 
630 
631 /*
632  * Calculates the eigensystem of mtx_v, storing it into eigvals_v and eigvecs_v.
633  * This functions accepts a reduced matrix (0 rows and columns removed) but
634  * returns the full-size eigensystem (padding with 0s as defined by usable).
635  * The eigensystem is sorted by increasing |eigenvalue|.
636  *
637  * @param n_redu - Size of reduced system
638  * @param n_full - Size of full system
639  * @param mtx_v - Input matrix (n_redu * n_redu)
640  * @param usable - List of usable rows/columns in the full matrix (n_full)
641  * @param eigvals_v - Output eigenvalues (n_full), with !usable indices filled with 0
642  * @param eigvecs_v - Output eigenvectors (n_full * n_full, ROW! oriented), with !usable rows & columns filled with 0
643  */
644 void FPGATrackSimConstGenAlgo::eigen(size_t n_redu, size_t n_full, TMatrixD &mtx, std::vector<bool> const & usable, std::vector<double> & eigvals_full, vector2D<double> & eigvecs_full)
645 {
646 
647  // Reduced system (these are sorted by decreasing |eigenvalue|)
648  TVectorD eigvals_redu;
649  TMatrixD eigvecs_redu = mtx.EigenVectors(eigvals_redu);
650 
651  // Full system (to be copied into)
652  eigvals_full.resize(n_full, 0);
653  eigvecs_full.resize(n_full, n_full, 0);
654 
655  // Reverse order AND transpose. First row in eigvecs_full = last column in eigvecs_redu.
656  // Here, i = row index, j = column index.
657  size_t j_redu = n_redu - 1;
658  for (size_t i_full = 0; i_full < n_full; i_full++)
659  {
660  if (!usable[i_full]) continue;
661 
662  size_t i_redu = 0;
663  for (size_t j_full = 0; j_full < n_full; j_full++)
664  {
665  if (!usable[j_full]) continue;
666  eigvecs_full(i_full, j_full) = eigvecs_redu[i_redu][j_redu];
667  i_redu++;
668  }
669  eigvals_full[i_full] = eigvals_redu[j_redu];
670  j_redu--;
671  }
672 }
673 
674 
675 double FPGATrackSimConstGenAlgo::dot(const double* vec1, const double* vec2, size_t size)
676 {
677  double total = 0;
678  for (size_t i = 0; i < size; i++)
679  total += vec1[i] * vec2[i];
680  return total;
681 }
682 
683 
684 geo_constants FPGATrackSimConstGenAlgo::calculate_gcorth(geo_constants geo, int nCoords, std::vector<bool> const & usable)
685 {
686  for (int i = 0; i < nCoords - FPGATrackSimTrackPars::NPARS;i++)
687  {
688  if (!usable[i]) continue;
689  double norm = dot(geo.kernel[i], geo.kernel[i], nCoords);
690 
691  auto project = [&](std::vector<double> & hit_x_par, double & par)
692  {
693  double pr = dot(hit_x_par.data(), geo.kernel[i], nCoords) / norm;
694  for (int j = 0; j < nCoords; j++) hit_x_par[j] += -geo.kernel(i,j) * pr;
695  par += -geo.kaverages[i] * pr;
696  };
697 
698  project(geo.Vd0, geo.pars.d0);
699  project(geo.Vcurvature, geo.pars.qOverPt);
700  project(geo.Vphi, geo.pars.phi);
701  project(geo.Vz0, geo.pars.z0);
702  project(geo.Veta, geo.pars.eta);
703  }
704 
705  return geo;
706 }
707 
708 
710 {
711  // Do nothing; this class does not process events. The main algorithm is
712  // called in initialize() and finalize().
713  return StatusCode::SUCCESS;
714 }
715 
716 
718 // Finalize
720 
721 
723 {
724  ATH_MSG_DEBUG("finalize()");
725 
726  std::string filename = "corrgen_raw_" + std::to_string(m_nLayers) + "L_reg" + std::to_string(m_region) + "_checkGood" + std::to_string(m_CheckGood2ndStage) + ".gcon";
727 
729 
731  for (int missing = 0; missing < m_nLayers; missing++) {
732  filename = "corrgen_raw_" + std::to_string(m_nLayers) + "L_reg" + std::to_string(m_region) + "_checkGood" + std::to_string(m_CheckGood2ndStage) + "_skipPlane" + std::to_string(missing) + ".gcon";
733  // pick up only the ones for this missing plane
735  }
736  }
737 
738  writeSectors();
739 
740  ATH_CHECK(m_tHistSvc->finalize());
741  m_mafile->Close();
742 
743  return StatusCode::SUCCESS;
744 }
745 
746 
748 {
749  // Create FPGATrackSimSectorSlice
752  FPGATrackSimSectorSlice slice(m_geo_consts.size(), m_sliceNBins, copymin, copymax);
753 
754  // Open files
755  std::string sector_filename = "sectors_raw_" + std::to_string(m_nLayers) + "L_reg" + std::to_string(m_region) + "_checkGood" + std::to_string(m_CheckGood2ndStage) + ".patt";
756  std::string sectorHW_filename = "sectorsHW_raw_" + std::to_string(m_nLayers) + "L_reg" + std::to_string(m_region) + "_checkGood" + std::to_string(m_CheckGood2ndStage) + ".patt";
757  FILE *sector_file = fopen(sector_filename.c_str(),"w");
758  FILE *sectorHW_file = fopen(sectorHW_filename.c_str(),"w");
759 
760  fprintf(sector_file,"%zu %d\n",m_geo_consts.size(),m_nLayers);
761  fprintf(sectorHW_file,"%zu %d\n",m_geo_consts.size(),m_nLayers);
762 
763  // Write sectors
765  while (reader.nextEntry())
766  {
767  FPGATrackSimMatrixAccumulator const & acc = reader.getAccumulator();
768  size_t sector = reader.getEntry();
769 
770  fprintf(sector_file,"%zu ", sector);
771  fprintf(sectorHW_file,"%zu ", sector);
772  for(int i=0;i<m_nLayers;i++)
773  {
774  fprintf(sector_file,"%d ", acc.FTK_modules[i]);
775  fprintf(sectorHW_file,"%d ", reader.getModules()[i]);
776  }
777  fprintf(sector_file,"0 %zu", acc.track_bins.size());
778  fprintf(sector_file,"\n");
779  fprintf(sectorHW_file,"0 %zu", acc.track_bins.size());
780  fprintf(sectorHW_file,"\n");
781 
782  for (FPGATrackSimTrackParsI const & pars : acc.track_bins)
783  slice.addSectorToSlice(sector, pars);
784  }
785 
786  fclose(sector_file);
787  fclose(sectorHW_file);
788  std::string slice_filename = "slices_" + std::to_string(m_nLayers) + "L_reg" + std::to_string(m_region) + ".root";
789  slice.saveSlices(slice_filename);
790 }
791 
792 
793 // ASCII file writeout
794 void FPGATrackSimConstGenAlgo::DumpConstants(std::vector<geo_constants> &geo_consts, std::string & filename)
795 {
796  FILE *const_file = fopen(filename.c_str(),"w");
797 
798  fprintf(const_file,"! *** RECONSTRUCTION GEOMETRY CONSTANTS ***\n");
799  fprintf(const_file,"\n");
800  fprintf(const_file,"Version 2 ! File format version number\n");
801  fprintf(const_file,"\n");
802  fprintf(const_file,"! *** PHI is now in GLOBAL coordinate system ***\n");
803  fprintf(const_file," NPLANES\n");
804  fprintf(const_file," %d\n",m_nLayers);
805  fprintf(const_file," NSECTORS\n");
806  fprintf(const_file,"%zu\n",geo_consts.size());
807  fprintf(const_file," NDIM\n");
808  fprintf(const_file," 2\n");
809 
810  std::string str_hex;
811 
812  for (size_t sector = 0; sector < geo_consts.size(); sector++)
813  {
814  //gcon file
815  fprintf(const_file,"sector\n");
816  fprintf(const_file,"%zu\n", sector);
817 
818  fprintf(const_file," Vc \n");
819  for(int i=0;i<m_nCoords;i++){
820  fprintf(const_file,"%e\n",geo_consts[sector].Vcurvature[i]);
821  }
822 
823  fprintf(const_file," Vd \n");
824  for(int i=0;i<m_nCoords;i++){
825  fprintf(const_file,"%e\n",geo_consts[sector].Vd0[i]);
826  }
827 
828  fprintf(const_file," Vf \n");
829  for(int i=0;i<m_nCoords;i++){
830  fprintf(const_file,"%e\n",geo_consts[sector].Vphi[i]);
831  }
832 
833  fprintf(const_file," Vz0 \n");
834  for(int i=0;i<m_nCoords;i++){
835  fprintf(const_file,"%e\n",geo_consts[sector].Vz0[i]);
836  }
837 
838  fprintf(const_file," Vo \n");
839  for(int i=0;i<m_nCoords;i++){
840  fprintf(const_file,"%e\n",geo_consts[sector].Veta[i]);
841  }
842 
843  fprintf(const_file,"kaverages\n");
845  fprintf(const_file,"%e\n",m_geo_consts[sector].kaverages[i]);
846  }
847 
848  fprintf(const_file,"kernel\n");
850  for(int j=0;j<m_nCoords;j++){
851  fprintf(const_file,"%e\n",geo_consts[sector].kernel(i, j));
852  }
853  }
854 
855  fprintf(const_file,"Cc\n");
856  fprintf(const_file,"%e\n",geo_consts[sector].pars.qOverPt);
857 
858  fprintf(const_file,"Cd\n");
859  fprintf(const_file,"%e\n",geo_consts[sector].pars.d0);
860 
861  fprintf(const_file,"Cf\n");
862  fprintf(const_file,"%e\n",geo_consts[sector].pars.phi);
863 
864  fprintf(const_file,"Cz0\n");
865  fprintf(const_file,"%e\n",geo_consts[sector].pars.z0);
866 
867  fprintf(const_file,"Co\n");
868  fprintf(const_file,"%e\n",geo_consts[sector].pars.eta);
869  }
870 
871  fclose(const_file);
872 
873 }
874 
FPGATrackSimConstGenAlgo.h
Algorithm to generate fit constants.
AllowedVariables::e
e
Definition: AsgElectronSelectorTool.cxx:37
make_hlt_rep.pars
pars
Definition: make_hlt_rep.py:90
FPGATrackSimConstGenAlgo::m_good_tree
TTree * m_good_tree
Definition: FPGATrackSimConstGenAlgo.h:122
FPGATrackSimConstGenAlgo::m_mafile
TFile * m_mafile
Definition: FPGATrackSimConstGenAlgo.h:119
FPGATrackSimConstGenAlgo::generate_constants
void generate_constants()
Definition: FPGATrackSimConstGenAlgo.cxx:247
D3PDMakerTestInstan::vec2
std::vector< D3PDTest::MyVec2 > vec2
Definition: D3PDMakerTestDict.h:14
PlotCalibFromCool.norm
norm
Definition: PlotCalibFromCool.py:100
FPGATrackSimConstGenAlgo::m_CheckGood2ndStage
Gaudi::Property< bool > m_CheckGood2ndStage
Definition: FPGATrackSimConstGenAlgo.h:111
FPGATrackSimTrackPars::phi
double phi
Definition: FPGATrackSimTrackPars.h:24
FPGATrackSimConstGenAlgo::calculate_gcorth
geo_constants calculate_gcorth(geo_constants geo, int nCoords, std::vector< bool > const &usable)
Definition: FPGATrackSimConstGenAlgo.cxx:684
FPGATrackSimConstGenAlgo::eigen
void eigen(size_t n_redu, size_t n_full, TMatrixD &mtx, std::vector< bool > const &usable, std::vector< double > &eigvals_v, vector2D< double > &eigvecs_v)
Definition: FPGATrackSimConstGenAlgo.cxx:644
ATH_MSG_INFO
#define ATH_MSG_INFO(x)
Definition: AthMsgStreamMacros.h:31
FPGATrackSimTrackParsI::eta
int eta
Definition: FPGATrackSimTrackPars.h:62
FPGATrackSimMatrixAccumulator::coords_usable
std::vector< bool > coords_usable
Definition: FPGATrackSimMatrixAccumulator.h:57
FPGATrackSimConstGenAlgo::isNAN
bool isNAN(double value, const char *name)
Definition: FPGATrackSimConstGenAlgo.cxx:394
FPGATrackSimTrackPars
Definition: FPGATrackSimTrackPars.h:22
FPGATrackSimTrackPars::qOverPt
double qOverPt
Definition: FPGATrackSimTrackPars.h:25
FPGATrackSimConstGenAlgo::m_skipFile
Gaudi::Property< std::string > m_skipFile
Definition: FPGATrackSimConstGenAlgo.h:108
FPGATrackSimConstGenAlgo::dot
double dot(const double *vec1, const double *vec2, size_t size)
Definition: FPGATrackSimConstGenAlgo.cxx:675
FPGATrackSimConstGenAlgo::execute
StatusCode execute() override
Definition: FPGATrackSimConstGenAlgo.cxx:709
FPGATrackSimConstGenAlgo::m_nCoords
int m_nCoords
Definition: FPGATrackSimConstGenAlgo.h:143
FPGATrackSimMatrixWriter
Definition: FPGATrackSimMatrixIO.h:87
FPGATrackSimConstGenAlgo::m_Monitor
Gaudi::Property< bool > m_Monitor
Definition: FPGATrackSimConstGenAlgo.h:109
FPGATrackSimConstGenAlgo::m_h_veta
TH1F * m_h_veta
Definition: FPGATrackSimConstGenAlgo.h:128
FPGATrackSimTrackPars::d0
double d0
Definition: FPGATrackSimTrackPars.h:26
FPGATrackSimSectorSlice.h
Stores the range of eta/phi/etc. of each sector.
FPGATrackSimConstGenAlgo::DumpConstants
void DumpConstants(std::vector< geo_constants > &geo_consts, std::string &filename)
Definition: FPGATrackSimConstGenAlgo.cxx:794
FPGATrackSimConstGenAlgo::m_sliceMax
FPGATrackSimTrackPars m_sliceMax
Definition: FPGATrackSimConstGenAlgo.h:135
FPGATrackSimConstGenAlgo::m_tHistSvc
ServiceHandle< ITHistSvc > m_tHistSvc
Definition: FPGATrackSimConstGenAlgo.h:99
athena.value
value
Definition: athena.py:124
FPGATrackSimTrackParsI::d0
int d0
Definition: FPGATrackSimTrackPars.h:60
CHECK_NAN
#define CHECK_NAN(var)
Definition: FPGATrackSimConstGenAlgo.cxx:404
FPGATrackSimConstGenAlgo::initialize
StatusCode initialize() override
Definition: FPGATrackSimConstGenAlgo.cxx:53
FPGATrackSimConstGenAlgo::m_region
Gaudi::Property< int > m_region
Definition: FPGATrackSimConstGenAlgo.h:110
FPGATrackSimConstGenAlgo::GetConstants
bool GetConstants(FPGATrackSimMatrixAccumulator const &acc_norm, geo_constants &geo, int entryNumber)
Definition: FPGATrackSimConstGenAlgo.cxx:322
FPGATrackSimConstGenAlgo::m_skipList
std::vector< bool > m_skipList
Definition: FPGATrackSimConstGenAlgo.h:158
FPGATrackSimConstGenAlgo::m_pmap
const FPGATrackSimPlaneMap * m_pmap
Definition: FPGATrackSimConstGenAlgo.h:101
FPGATrackSimConstGenAlgo::m_isSecondStage
Gaudi::Property< bool > m_isSecondStage
Definition: FPGATrackSimConstGenAlgo.h:113
FPGATrackSimTrackPars::eta
double eta
Definition: FPGATrackSimTrackPars.h:28
x
#define x
XMLtoHeader.count
count
Definition: XMLtoHeader.py:85
FPGATrackSimConstGenAlgo::m_nCoords_2
int m_nCoords_2
Definition: FPGATrackSimConstGenAlgo.h:144
FPGATrackSimConstants.h
FPGATrackSimConstGenAlgo::matrix_multiply
std::vector< double > matrix_multiply(std::vector< double > const &A, std::vector< double > const &b)
Definition: FPGATrackSimConstGenAlgo.cxx:543
FPGATrackSimPlaneMap::getDim
uint32_t getDim(size_t logiLayer) const
Definition: FPGATrackSimPlaneMap.h:81
FPGATrackSimConstGenAlgo::m_nLayers
int m_nLayers
Definition: FPGATrackSimConstGenAlgo.h:140
FPGATrackSimConstGenAlgo::getReducedMatrix
TMatrixD getReducedMatrix(size_t n, std::vector< double > const &mtx_v, std::vector< bool > const &usable, size_t nDimToUse)
Removes the rows/columns specified by !usable.
Definition: FPGATrackSimConstGenAlgo.cxx:572
FPGATrackSimPlaneMap::getCoordOffset
uint32_t getCoordOffset(size_t logiLayer) const
Definition: FPGATrackSimPlaneMap.h:95
FPGATrackSimConstGenAlgo::normalize
FPGATrackSimMatrixAccumulator normalize(FPGATrackSimMatrixAccumulator const &acc_raw)
Definition: FPGATrackSimConstGenAlgo.cxx:458
FPGATrackSimConstGenAlgo::finalize
StatusCode finalize() override
Definition: FPGATrackSimConstGenAlgo.cxx:722
python.setupRTTAlg.size
int size
Definition: setupRTTAlg.py:39
A
FPGATrackSimMatrixIO.h
Classes to read/write matrix files event by event.
vector2D< double >
FPGATrackSimConstGenAlgo::m_nKAverages
int m_nKAverages
Definition: FPGATrackSimConstGenAlgo.h:142
FPGATrackSimMatrixAccumulator::covariance
std::vector< double > covariance
Definition: FPGATrackSimMatrixAccumulator.h:84
ATH_MSG_ERROR
#define ATH_MSG_ERROR(x)
Definition: AthMsgStreamMacros.h:33
perfmonmt-refit.slice
slice
Definition: perfmonmt-refit.py:52
lumiFormat.i
int i
Definition: lumiFormat.py:85
FPGATrackSimSectorSlice
Definition: FPGATrackSimSectorSlice.h:32
beamspotman.n
n
Definition: beamspotman.py:731
FPGATrackSimConstGenAlgo::m_sliceNBins
FPGATrackSimTrackParsI m_sliceNBins
Definition: FPGATrackSimConstGenAlgo.h:133
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition: PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22
geo_constants::Vcurvature
std::vector< double > Vcurvature
Definition: FPGATrackSimConstGenAlgo.h:52
ATH_MSG_DEBUG
#define ATH_MSG_DEBUG(x)
Definition: AthMsgStreamMacros.h:29
FPGATrackSimMatrixAccumulator
Definition: FPGATrackSimMatrixAccumulator.h:36
FPGATrackSimConstGenAlgo::m_geo_consts_with_missinghit
std::vector< std::vector< geo_constants > > m_geo_consts_with_missinghit
Definition: FPGATrackSimConstGenAlgo.h:155
geo_constants::Vd0
std::vector< double > Vd0
Definition: FPGATrackSimConstGenAlgo.h:51
TileDCSDataPlotter.pr
pr
Definition: TileDCSDataPlotter.py:922
file
TFile * file
Definition: tile_monitor.h:29
FPGATrackSimConstGenAlgo::m_h_vf
TH1F * m_h_vf
Definition: FPGATrackSimConstGenAlgo.h:126
FPGATrackSimConstGenAlgo::m_geo_consts
std::vector< geo_constants > m_geo_consts
Definition: FPGATrackSimConstGenAlgo.h:151
find_tgc_unfilled_channelids.ip
ip
Definition: find_tgc_unfilled_channelids.py:3
AthenaPoolTestRead.acc
acc
Definition: AthenaPoolTestRead.py:16
ATH_CHECK
#define ATH_CHECK
Definition: AthCheckMacros.h:40
FPGATrackSimConstGenAlgo::FPGATrackSimConstGenAlgo
FPGATrackSimConstGenAlgo(const std::string &name, ISvcLocator *pSvcLocator)
Definition: FPGATrackSimConstGenAlgo.cxx:47
geo_constants::pars
FPGATrackSimTrackPars pars
Definition: FPGATrackSimConstGenAlgo.h:60
FPGATrackSimMatrixReader
Definition: FPGATrackSimMatrixIO.h:41
FPGATrackSimConstGenAlgo::failedConstants
bool failedConstants(geo_constants const &geo, std::vector< bool > const &usable)
Definition: FPGATrackSimConstGenAlgo.cxx:407
AthAlgorithm
Definition: AthAlgorithm.h:47
GetAllXsec.entry
list entry
Definition: GetAllXsec.py:132
FPGATrackSimConstGenAlgo::m_sliceMin
FPGATrackSimTrackPars m_sliceMin
Definition: FPGATrackSimConstGenAlgo.h:134
MIN_TRACK_SEC
#define MIN_TRACK_SEC
Definition: FPGATrackSimConstGenAlgo.cxx:38
MTX_TOLERANCE
#define MTX_TOLERANCE
Definition: FPGATrackSimConstants.h:10
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:221
createCoolChannelIdFile.par
par
Definition: createCoolChannelIdFile.py:29
FPGATrackSimConstGenAlgo::isSingular
bool isSingular(TMatrixD mtx)
Definition: FPGATrackSimConstGenAlgo.cxx:556
ActsTrk::to_string
std::string to_string(const DetectorType &type)
Definition: GeometryDefs.h:34
plotBeamSpotMon.b
b
Definition: plotBeamSpotMon.py:77
geo_constants::Vz0
std::vector< double > Vz0
Definition: FPGATrackSimConstGenAlgo.h:54
FPGATrackSimConstGenAlgo::m_ctree
TTree * m_ctree
Definition: FPGATrackSimConstGenAlgo.h:120
FPGATrackSimConstGenAlgo::createMissingHitsConstants
void createMissingHitsConstants(FPGATrackSimMatrixAccumulator const &acc_norm, size_t entry)
Definition: FPGATrackSimConstGenAlgo.cxx:284
FPGATrackSimConstGenAlgo::m_matrix_tree
TTree * m_matrix_tree
Definition: FPGATrackSimConstGenAlgo.h:121
project
T_ResultType project(ParameterMapping::type< N > parameter_map, const T_Matrix &matrix)
Definition: MeasurementSelector.h:142
FPGATrackSimConstGenAlgo::makeConsts
geo_constants makeConsts(FPGATrackSimMatrixAccumulator const &acc, std::vector< bool > const &usable, std::vector< double > const &inv_covariance, std::vector< double > const &eigvals, vector2D< double > const &eigvecs)
Definition: FPGATrackSimConstGenAlgo.cxx:495
FPGATrackSimTrackParsI::phi
int phi
Definition: FPGATrackSimTrackPars.h:58
geo_constants::Veta
std::vector< double > Veta
Definition: FPGATrackSimConstGenAlgo.h:55
FPGATrackSimConstGenAlgo::m_nKernel
int m_nKernel
Definition: FPGATrackSimConstGenAlgo.h:141
FPGATrackSimConstGenAlgo::m_h_vz
TH1F * m_h_vz
Definition: FPGATrackSimConstGenAlgo.h:127
FPGATrackSimConstGenAlgo::invert
std::vector< double > invert(size_t n_full, TMatrixD mtx, std::vector< bool > const &usable)
Inverts a reduced matrix, then pads with zeros to recover a full-sized matrix.
Definition: FPGATrackSimConstGenAlgo.cxx:605
FPGATrackSimConstGenAlgo::bookHistograms
StatusCode bookHistograms()
Definition: FPGATrackSimConstGenAlgo.cxx:107
FPGATrackSimConstGenAlgo::m_FPGATrackSimMapping
ServiceHandle< IFPGATrackSimMappingSvc > m_FPGATrackSimMapping
Definition: FPGATrackSimConstGenAlgo.h:98
ATH_MSG_WARNING
#define ATH_MSG_WARNING(x)
Definition: AthMsgStreamMacros.h:32
FPGATrackSimConstGenAlgo::m_h_vd
TH1F * m_h_vd
Definition: FPGATrackSimConstGenAlgo.h:125
LArCellConditions.geo
bool geo
Definition: LArCellConditions.py:46
geo_constants
Definition: FPGATrackSimConstGenAlgo.h:49
FPGATrackSimTrackPars::z0
double z0
Definition: FPGATrackSimTrackPars.h:27
vector2D::resize
void resize(size_t x1, size_t x2, T const &t=T())
Definition: FPGATrackSimVectors.h:51
FPGATrackSimTrackPars::NPARS
@ NPARS
Definition: FPGATrackSimTrackPars.h:49
CaloCellTimeCorrFiller.filename
filename
Definition: CaloCellTimeCorrFiller.py:24
FPGATrackSimTrackParsI::z0
int z0
Definition: FPGATrackSimTrackPars.h:61
FPGATrackSimConstGenAlgo::m_h_vc
TH1F * m_h_vc
Definition: FPGATrackSimConstGenAlgo.h:124
FPGATrackSimConstGenAlgo::writeSectors
void writeSectors()
Definition: FPGATrackSimConstGenAlgo.cxx:747
python.TrigEgammaMonitorHelper.TH1F
def TH1F(name, title, nxbins, bins_par2, bins_par3=None, path='', **kwargs)
Definition: TrigEgammaMonitorHelper.py:24
collisions.reader
reader
read the goodrunslist xml file(s)
Definition: collisions.py:22
FPGATrackSimTrackParsI::qOverPt
int qOverPt
Definition: FPGATrackSimTrackPars.h:59
FPGATrackSimTrackParsI
Definition: FPGATrackSimTrackPars.h:56
FPGATrackSimConstGenAlgo::readSkipList
void readSkipList(size_t nEntries)
Definition: FPGATrackSimConstGenAlgo.cxx:221
example.writer
writer
show summary of content
Definition: example.py:36
FPGATrackSimConstGenAlgo::m_dumpMissingHitsConstants
Gaudi::Property< bool > m_dumpMissingHitsConstants
Definition: FPGATrackSimConstGenAlgo.h:114
geo_constants::Vphi
std::vector< double > Vphi
Definition: FPGATrackSimConstGenAlgo.h:53
FPGATrackSimConstGenAlgo::prepareOutputTree
StatusCode prepareOutputTree()
Definition: FPGATrackSimConstGenAlgo.cxx:180
FPGATrackSimConstGenAlgo::copySliceTree
StatusCode copySliceTree(TFile *file)
Definition: FPGATrackSimConstGenAlgo.cxx:124
FPGATrackSimConstGenAlgo::m_cfpath
Gaudi::Property< std::string > m_cfpath
Definition: FPGATrackSimConstGenAlgo.h:107
FPGATrackSimMatrixAccumulator::nusable
size_t nusable() const
Definition: FPGATrackSimMatrixAccumulator.h:58
FPGATrackSimConstGenAlgo::fillConstTree
void fillConstTree(std::vector< module_t > &modules, FPGATrackSimMatrixAccumulator &acc, geo_constants &geo)
Definition: FPGATrackSimConstGenAlgo.cxx:356