PandaRoot
PndLmdDim.h
Go to the documentation of this file.
1 /*
2  * PndLmdDim.h
3  *
4  * this class gives you methods to retrieve parameters of the geometry
5  * dimensions are in cm and radian. this is a singleton and must be called
6  * with PndLmdDim::Instance()
7  *
8  * Global comments:
9  *
10  * TODO
11  *
12  *
13  * Created on: Oct 5, 2012
14  * Author: promme
15  *
16  * To use transformation functions you have to call Read_Transformation_matrices
17  *
18  * as of 2015 maintained by Roman Klasen, klasen@kph.uni-mainz.de
19 
20  */
21 
22 #ifndef PNDLMDDIM_H_
23 #define PNDLMDDIM_H_
24 
25 #include <cmath>
26 #include <TRandom.h>
27 #include <map>
28 #include <string>
29 #include <sstream>
30 #include <vector>
31 #include <iostream>
32 #include <TGeoManager.h>
33 #include <TGeoVolume.h>
34 #include <TGeoMatrix.h>
35 #include <TVector3.h>
36 #include <TMatrixT.h>
37 #include <TH2Poly.h>
38 #include <TMultiGraph.h>
39 #include <TGraph.h>
40 #include <stdlib.h>
41 #include <cctype>
42 
43 // work with DB
44 /* #include<PndLmdContFact.h> */
45 /* #include<TList.h> */
47 #include <TPolyLine.h>
48 /* #include "FairRuntimeDb.h" */
49 /* #include "FairRunAna.h" */
50 /* #include "FairRun.h" */
51 
52 typedef TMatrixT<double> TMatrixD; // hmm funny, should be declared in TMatrixT.h
53 
54 using namespace std;
55 
56 // simple class used for a fast particle track propagation
57 // based on a matrix fit to simulated data
58 // the representation of the basis is
59 // x, y, z, w, px/pz, py/pz, pw
60 // w und pw are weights in order to
61 // provide homogeneous coordinates
63  public:
64  double mom;
65  double M[7][7];
67  {
68  mom = 0;
69  for (int i = 0; i < 7; i++) {
70  for (int j = 0; j < 7; j++) {
71  M[i][j] = 0;
72  }
73  }
74  }
75  // set a matrix which is given as an array
76  void Set(const double *matrix)
77  {
78  for (int i = 0; i < 7 * 7; i++) {
79  M[i / 7][i % 7] = matrix[i];
80  }
81  }
82  // set a matrix with fitted hardcoded values
83  // up to now only 1.5 GeV/c and 15 GeV/c are available
84  // to produce more, please modify and use trafo_matrix_fit.C
85  PndLmdDimPropMat(double mom_init)
86  {
87  mom = mom_init;
88  if (mom == 1.5) {
89  double matrix_init[49] = {1.012, 1.22, 5.216e-05, 0.2599, 1.096, -0.1589, -0.0001459, -0.5851, 1.042, 0.001092,
90  -3.991e-06, 0.3103, 1.064, -3.991e-06, -0.04447, -0.04501, 0.001764, 11.24, -0.04385, 0.007135,
91  0.0001733, -1.36e-15, 1.816e-14, 3.031e-15, 1, 1.513e-16, -2.272e-16, 7.904e-17, 0.006668, 1.356,
92  -0.0001811, 0.000127, 0.9794, -0.1215, 0.4001, -0.6638, 0.04068, 0.001168, -7.627e-06, 0.2952,
93  0.9388, -7.627e-06, -1.003e-15, -3.248e-15, 9.487e-17, 5.594e-18, 2.41e-16, -1.086e-16, 1};
94  Set(matrix_init);
95  } else {
96  if (mom == 15) {
97  double matrix_init[49] = {0.9633, 0.2086, -0.01173, 0.2598, 1.123, -0.03217, -0.0002463, -0.104, 0.97, -0.006443,
98  5.119e-06, 0.06427, 1.12, 5.119e-06, -0.03828, 0.005853, 0.004478, 11.24, -0.0447, 0.001794,
99  2.613e-06, 2.376e-06, -0.0003806, -2.583e-07, 1, -1.647e-05, -1.871e-05, -3.862e-07, -0.01744, 0.1777,
100  -0.01384, 0.0001758, 0.9997, -0.02581, 0.4002, -0.09394, -0.05056, -0.002047, 3.624e-05, 0.06091,
101  0.994, 3.624e-05, 2.376e-06, -0.0003806, -2.583e-07, -3.862e-07, -1.647e-05, -1.871e-05, 1};
102  Set(matrix_init);
103  } else { // identity matrix
104  cout << " Warning in PndLmdDimPropMat: loading identity matrix only " << endl;
105  double matrix_init[49] = {1, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 1,
106  0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 1};
107  Set(matrix_init);
108  }
109  }
110  }
111  // transform the position and momentum at the IP
112  // to a position and momentum at the first plane of the LMD
113  void Propagate(TVector3 &pos, TVector3 &momdir)
114  {
115  // TVector3 dir = mom.Unit();
116  double mommag = momdir.Mag();
117  // position transformation was evaluated for meter and angles * 10.
118  double xip[7] = {pos.X() / 100., pos.Y() / 100., pos.Z() / 100., 1, momdir.X() / momdir.Z() * 10., momdir.Y() / momdir.Z() * 10., 1};
119  double xlmd[7] = {0, 0, 0, 0, 0, 0, 0};
120  for (int i = 0; i < 7; i++) {
121  for (int j = 0; j < 7; j++) {
122  xlmd[i] += M[i][j] * xip[j];
123  }
124  }
125  pos.SetXYZ(xlmd[0] * 100., xlmd[1] * 100., xlmd[2] * 100.);
126  momdir.SetXYZ(xlmd[4] / 10., xlmd[5] / 10., 1.); // not an exact calculation ;)
127  momdir = momdir.Unit() * mommag;
128  }
129 };
130 
131 class Tkey {
132  public:
133  signed char half;
134  signed char plane;
135  signed char module;
136  signed char side;
137  signed char die;
138  signed char sensor;
139  bool operator<(const Tkey &comp) const
140  {
141  if (half < comp.half)
142  return true;
143  if (half > comp.half)
144  return false;
145  if (plane < comp.plane)
146  return true;
147  if (plane > comp.plane)
148  return false;
149  if (module < comp.module)
150  return true;
151  if (module > comp.module)
152  return false;
153  if (side < comp.side)
154  return true;
155  if (side > comp.side)
156  return false;
157  if (die < comp.die)
158  return true;
159  if (die > comp.die)
160  return false;
161  if (sensor < comp.sensor)
162  return true;
163  if (sensor >= comp.sensor)
164  return false;
165  return false;
166  }
167 
168  bool operator==(const Tkey &comp) const
169  {
170  return (half == comp.half) && (plane == comp.plane) && (module == comp.module) && (side == comp.side) && (die == comp.die) && (sensor == comp.sensor);
171  }
172 
173  Tkey(const Tkey &copy)
174  {
175  half = copy.half;
176  plane = copy.plane;
177  module = copy.module;
178  side = copy.side;
179  die = copy.die;
180  sensor = copy.sensor;
181  }
182 
183  Tkey(int ihalf, int iplane, int imodule, int iside, int idie, int isensor)
184  {
185  half = ihalf;
186  plane = iplane;
187  module = imodule;
188  side = iside;
189  die = idie;
190  sensor = isensor;
191  }
192 
193  Tkey(string key)
194  {
195  int sign(1);
196  int ikey(0); // 0,1,2,3,4,5 = ihalf, iplane, imodule, iside, idie, isensor
197  int number;
198  for (unsigned int ichar = 0; ichar < key.size(); ichar++) {
199  if (key[ichar] == '-') {
200  sign = -1;
201  }
202  if (isdigit(key[ichar])) {
203  number = (key[ichar] - '0') * sign;
204  sign = 1;
205  if (ikey == 0)
206  half = number;
207  if (ikey == 1)
208  plane = number;
209  if (ikey == 2)
210  module = number;
211  if (ikey == 3)
212  side = number;
213  if (ikey == 4)
214  die = number;
215  if (ikey == 5)
216  sensor = number;
217  ikey++;
218  }
219  }
220  if (ikey != 6)
221  cout << " Error in Generate_Tkey: key string " << key << " is not valid " << endl;
222  }
223  Tkey() {}
224 };
225 
226 class PndLmdDim {
227  private:
228  // in case you change anything in the geometry
229  // you must increase this version number in the corresponding .cxx file!
230  // it may affect the consistency between the geometry and the transformation matrices
231  static int geometry_version;
232 
233  static PndLmdDim *pinstance;
234  TGeoManager *fgGeoMan;
235  PndLmdDim();
236  PndLmdDim(const PndLmdDim &instance);
237  PndLmdDim &operator=(const PndLmdDim &instance)
238  {
239  this->box_size_x = instance.box_size_x; // to get rid from pedantic warnings
240  return *this;
241  }
242  ~PndLmdDim();
243  // the navigation paths for the detector geometry are stored here
244  vector<string> nav_paths;
245 
246  public:
247  static PndLmdDim &Get_instance();
248  static PndLmdDim *Instance();
249 
250  // this offset in the sensor id is introduced by
251  // pandaroot when assembling several detector components
252  // the lmd alone would have a sensor id range between 0 and n total sensors
253  // A detector loaded before the lmd will introduce an offset in
254  // that ID which can be determined from a loaded root geometry by calling
255  // Set_sensIDoffset(-1);
256  // TODO: add everywhere that sensID offset
257  unsigned int sensIDoffset;
258 
259  // set the sensIDoffset
260  // in case offset is < 0 the offset is
261  // tried to be determined from a possibly loaded root geometry
262  bool Set_sensIDoffset(int offset = -1);
263 
264  // FairRun* ana;
265  // FairRuntimeDb* rtdb;
266  // pi
267  double pi;
268  // number of detector planes
269  unsigned int n_planes;
270  // number of modules per plane half
271  unsigned int nmodules;
272  // position of planes where the first plane defines the origin
273  double *plane_pos_z;
274  // ****************************** plane half array *****************************
275  // x in lmd reference frame
277  // y in lmd reference frame
279  // z in lmd reference frame
281  // phi rotation in lmd reference frame
283  // theta rotation in lmd reference frame
285  // psi rotation in lmd reference frame
287  // ****************************** plane half supports ******************************
288  // x in the detector half reference frame
290  // y in the detector half reference frame
292  // z in the detector half reference frame
294  // phi rotation in the detector half reference frame
296  // theta rotation in the detector half reference frame
298  // psi rotation in the detector half reference frame
300 
301  // ****************************** cvd cooling support discs ************************
302  // cvd_diamond is cut out of 79.5 mm discs of 200 micron thickness
303  // inner min. radius due to beam pipe + a safety margin
304  double inner_rad;
305  // not used yet but should be the outer acceptance
306  double outer_rad;
307  // number of CVD diamond discs per plane
309  // radius of a CVD diamond disc
310  double cvd_disc_rad;
311  // the half of the diamond thickness
313  // even and odd discs in a plane will be shifted in z in order to prevent
314  // mechanical damage during assembly
316  // angle from the division of a circle into n_cvd_discs
317  double delta_phi;
318  // a polygon of n_cvd_discs sides fitting a radius of inner_rad
319  // has a side length pol_side_lg of
321  // the minimum distance to the center of the polygone is given by
323  // the cvd disc has to be placed such that the disc crosses
324  // the inner ring at an angle of 0 and delta_phi
325  // this defines the distance to the center according to pythagoras
327 
328  // the mechanical alignment precision is defined as an offset of and tilt around
329  // the middle of the cvd diamond.
330  // Values are standard deviation.
331  // first comes translation than rotation
332 
333  // x is radial to the beam pipe when support is aligned
334  double cvd_offset_x;
335  // y is tangent to the beam pipe when support is aligned
336  double cvd_offset_y;
337  // z is along the beam pipe when support is aligned
338  double cvd_offset_z;
339  // phi rotation in the reference frame of the plane half support
340  double cvd_tilt_phi;
341  // theta rotation in the reference frame of the plane half support
343  // psi rotation in the reference frame of the plane half support
344  double cvd_tilt_psi;
345  // thickness of the kapton flexible circuits to the sensors
346  // (chosen to be thicker to simulate also the influence of the
347  // printed circuits themselves)
349  // *********************************** one side on a CVD disc *************************************
350  // x is radial to the beam pipe when cvd is aligned
352  // y is tangent to the beam pipe when cvd is aligned
354  // z is along the beam pipe when cvd is aligned
355  double side_offset_z; // should not be used due to clashing volumes with the support!
356  // phi rotation in the reference frame of the cvd support
357  double side_tilt_phi; // should not be used due to clashing volumes with the support!
358  // theta rotation in the reference frame of the cvd support
360  // psi rotation in the reference frame of the cvd support
361  double side_tilt_psi; // should not be used due to clashing volumes with the support!
362  // *********************************** HV-MAPS *************************************
363  //
364  // left right
365  //
366  // |---------|----------|----------| top
367  // ||------|-||-------|-||-------|-|
368  // || | || | || | |
369  // || 1 | || 2 | || 3 | | row 1
370  // || | || active| || | |
371  // ||------|-||-------|-||-------|-|
372  // | | passive | |
373  // |---------|----------|----------| bottom
374  // gap
375  // |----------|----------| top
376  // | passive | |
377  // ||-------|-||-------|-|
378  // || | || | |
379  // || 2 | || 3 | | row 2
380  // || active| || | |
381  // ||-------|-||-------|-|
382  // |----------|----------| bottom
383  //
384  // left right
385  //
386  // A y; maps_n_row; height
387  // |
388  // |
389  // --> x; maps_n_col; width
390  //
391  // the current design foresees a rotation of the first parameters
392 
393  // even when several maps are placed on one die
394  // those will be placed in the simulation next to
395  // each other as separate detectors
396  // assumption: sensor 1 and 2 are on one die, the rest is separated
399  // enabled [row][col]
400  bool **enabled;
401  // number of sensors per side
403  // NOTE: MOST of the following VARIABLES are HALF of it
404  // due to geometry construction in GEANT
412 
413  double maps_active_pixel_size; // pixel size NOT half of it
414 
415  double maps_width;
416  double maps_height;
417 
420 
421  double die_gap; // (cm)
422 
425 
426  // the mechanical alignment precision is defined as an offset of and tilt around
427  // the middle of the cvd diamond.
428  // Values are standard deviation.
429  // first comes translation than rotation
430  // translations along z as well as rotations around x and y are
431  // negligible for dies glued on a cvd diamond
432  // rotation around z is not working yet
433 
434  // x is along the edge of the cvd disc
435  double die_offset_x;
436  // y is orthogonal to the edge of the cvd disc
437  double die_offset_y;
438  // z is along the beam pipe
439  double die_offset_z; // should not be used -> crashing volumes;
440  // x is a rotation around the edge of the cvd disc
441  double die_tilt_phi; // please do not use yet
442  // y is a rotation around the orthogonal component of the edge of the cvd disc
443  double die_tilt_theta; // please do not use yet
444  // z is a rotation around an axis parallel to the along the beam pipe
445  double die_tilt_psi; // please do not use yet;
446  // *********************************** one sensor *************************************
447  // x is mostly radial to the beam pipe
449  // y is mostly tangent to the beam pipe
451  // z is along the beam pipe
452  double sensor_offset_z; // should not be used due to clashing volumes with cvd and flex prints
453  // phi rotation in the reference frame of the sensor
455  // theta rotation in the reference frame of the sensor
456  double sensor_tilt_theta; // should not be used due to clashing volumes with cvd and flex prints
457  // psi rotation in the reference frame of the sensor
458  double sensor_tilt_psi; // should not be used due to clashing volumes with cvd and flex prints
459  //*********************************** lumi box parameters ***********************************
460  // see CAD files for details
461  // https://edms.cern.ch/nav/P:FAIR-000000719:V0/P:FAIR-000000726:V0/TAB3
462  // width
463  double box_size_x;
464  // height
465  double box_size_y;
466  // length
467  double box_size_z;
468  // thickness of the V2A steel plates
470  // position of the inner rib
471  double pos_rib;
472  // beam pipe radius at entrance
473  double rad_entrance;
474  // beam pipe radius at exit
475  double rad_exit;
476  // beam pipe separating non interacting paricles
477  double rad_pipe;
478  // beam pipe thickness;
480  // cone height of the transition region
482  // length of the inner pipe
483  double length_pipe;
484  // position of the first detector plane
485  double pos_plane_0;
486  //*********************************** global parameters *************************************
487  // where bending starts with
489  // the bending radius
490  double r_bend;
491  // and the angle of the circle path
492  double phi_bend;
493  // the point where both tangents of the straight beam pipe tubes meet is
494  double pos_rot_z;
495  // z position of the lmd
496  double pos_z; //(cm)
497  double end_seg_bend;
498  // x position of the lmd
499  double pos_x;
500  // y position of the lmd
501  double pos_y;
502  double rot_x;
503  double rot_y;
504  double rot_z;
505 
506  // returns false when one of the variables exceeds design values
507  bool Is_valid_idcall(int ihalf, int iplane = 0, int imodule = 0, int iside = 0, int idie = 0, int isensor = 0)
508  {
509  if (ihalf < 0 || ihalf >= 2)
510  return false;
511  if (iplane < 0 || (unsigned)iplane >= n_planes)
512  return false;
513  if (imodule < 0 || imodule >= n_cvd_discs)
514  return false;
515  if (iside < 0 || iside >= 2)
516  return false;
517  if (idie < 0 || idie >= 2)
518  return false;
519  // allow to count the non existing inner sensor at die 2
520  if (isensor < 0 || isensor >= n_sensors + 1)
521  return false;
522  return true;
523  }
524 
525  // get the sensor id for a sensor on a given side, module and plane
526  int Get_sensor_id(int ihalf, int iplane, int imodule, int iside, int idie, int isensor)
527  {
528  if (idie == 1)
529  isensor += 2; // the parallel sensor to sensor 0 is not there!
530  int result = isensor + (iside + (imodule + (iplane + ihalf * n_planes) * nmodules) * 2) * n_sensors;
531  return result + sensIDoffset;
532  }
533 
534  // get the sensor position by it's id in terms of plane module and side
535  void Get_sensor_by_id(const int sensor_id, int &ihalf, int &iplane, int &imodule, int &iside, int &idie, int &isensor)
536  {
537  int _sensor_id = sensor_id - sensIDoffset;
538  isensor = _sensor_id % n_sensors;
539  idie = 0;
540  if (isensor > 2) {
541  idie = 1;
542  isensor -= 2; // add the first but non existing sensor at die 2
543  }
544  _sensor_id /= n_sensors;
545  iside = _sensor_id % 2;
546  _sensor_id /= 2;
547  imodule = _sensor_id % nmodules;
548  _sensor_id /= nmodules;
549  iplane = _sensor_id % n_planes;
550  _sensor_id /= n_planes;
551  ihalf = _sensor_id % 2;
552  if (!Is_valid_idcall(ihalf, iplane, imodule, iside, idie, isensor)) {
553  ihalf = 0;
554  iplane = 0;
555  imodule = 0;
556  iside = 0;
557  idie = 0;
558  isensor = 0;
559  cout << "Error in PndLmdDim::Get_sensor_by_id: " << sensor_id << " is not a valid sensor id!" << endl;
560  }
561  }
562 
563  // when calling for a displaced module, the generated
564  // value must be kept same for the cvd diamond as well
565  // as the sensors sitting on the diamond it self
566  // the storage is realized by a map
567  // the vector contains offsets in x, y, z, rotphi, rottheta, rotpsi;
568  map<Tkey, vector<double>> offsets;
569  map<Tkey, vector<double>>::iterator itoffset;
570  /* replaced by an ugly but faster version below
571  string Generate_key(int ihalf, int iplane, int imodule, int iside, int idie, int isensor){
572  stringstream keystream;
573  keystream << ihalf << iplane << imodule << iside << idie << isensor;
574  return keystream.str();
575  }*/
576 
582  char *itoa(int value, char *result, int base)
583  {
584  // check that the base if valid
585  char *last_char;
586  if (base < 2 || base > 36) {
587  *result = '\0';
588  return result;
589  }
590  char *ptr = result, *ptr1 = result, tmp_char;
591  int tmp_value;
592  do {
593  tmp_value = value;
594  value /= base;
595  *ptr++ = "zyxwvutsrqponmlkjihgfedcba9876543210123456789abcdefghijklmnopqrstuvwxyz"[35 + (tmp_value - value * base)];
596  } while (value);
597  // Apply negative sign
598  if (tmp_value < 0)
599  *ptr++ = '-';
600  last_char = ptr;
601  *ptr-- = '\0';
602  // cout << last_char << endl;
603  while (ptr1 < ptr) {
604  tmp_char = *ptr;
605  *ptr-- = *ptr1;
606  *ptr1++ = tmp_char;
607  }
608  return last_char;
609  }
610 
611  string Generate_key(int ihalf, int iplane, int imodule, int iside, int idie, int isensor)
612  {
613  char key[100];
614  char *ptr;
615  ptr = itoa(ihalf, key, 10);
616  ptr = itoa(iplane, ptr, 10);
617  ptr = itoa(imodule, ptr, 10);
618  ptr = itoa(iside, ptr, 10);
619  ptr = itoa(idie, ptr, 10);
620  ptr = itoa(isensor, ptr, 10);
621  string result(key);
622  // stringstream keystream;
623  // keystream << ihalf << iplane << imodule << iside << idie << isensor;
624  return result;
625  }
626 
627  // generate a unique integer key not same as the string above since there negative numbers are allowed
628  // so in case of adding -1's key is not unique!
629  // moreover numbers should be kept 1 digit long
630  int Generate_keynumber(unsigned int ihalf = 0, unsigned int iplane = 0, unsigned int imodule = 0, unsigned int iside = 0, unsigned int idie = 0, unsigned int isensor = 0)
631  {
632  stringstream keystream;
633  keystream << ihalf << iplane << imodule << iside << idie << isensor;
634  int key;
635  key = atoi(keystream.str().c_str());
636  return key;
637  }
638 
639  // same structure as for offsets is used for the transformation matrices
640  // stored are matrix operations
641  // global -> local lumi
642  // key: ihalf = -1 iplane = -1 imodule = -1 iside = -1 idie = -1 isensor = -1
643  // local lumi -> local side on cvd disc
644  // key: ihalf >=0 iplane >= 0 imodule >=0 iside = -1 idie = -1 isensor = -1
645  // local side on cvd disc -> local sensor
646  // key: all variable
647  // map<string, TGeoMatrix* > transformation_matrices;
648  // map<string, TGeoMatrix* > transformation_matrices_aligned; // alternative aligned detector description
649  // map<string, TGeoMatrix* >::iterator it_transformation_matrices;
650  // to increase the performance by a factor of 5-6 a struct is used for the key now
651  map<Tkey, TGeoMatrix *> transformation_matrices;
652  map<Tkey, TGeoMatrix *> transformation_matrices_aligned; // alternative aligned detector description
653  map<Tkey, TGeoMatrix *>::iterator it_transformation_matrices;
654 
655  // cleanup some maps containing only references
656  void Cleanup();
657 
658  // read transformation matrices from a given file
659  // aligned and not aligned are two separate maps
660  // containing the description of the detector positions
661  // if not filename is specified matrices are searched in
662  // VMCWORKDIR/input/matrices.txt
663  // you may overwrite the version number if necessary
664  // VMCWORKDIR/geometry folder is used if no filename is specified
665  // ATTENTION! aligned matrices means perfect geometry, set to false if using misaligned geometry
666  void Read_transformation_matrices(string filename = "", bool aligned = true, int version_number = geometry_version);
667 
668  // write transformation matrices from a given file
669  // aligned and not aligned are two separate maps
670  // containing the description of the detector positions
671  // you may overwrite the version number if necessary
672  // version == 0 is reserved for backward compatibility!
673  // VMCWORKDIR/geometry folder is used if no filename (e.g. "") is specified
674  // warning overwrites existing trafo_matrices_lmd.dat!
675  void Write_transformation_matrices(string filename, bool aligned = true, int version_number = geometry_version);
676 
677  // read transformation matrices from a loaded geometry
678  // aligned and not aligned are two separate maps
679  // containing the description of the detector positions
680  // the geometry must be loaded otherwise matrices cannot be read
681  // version number will be set according to the geometry version number
682  // ToDo: multiply also matrices on the way to the key matrices
683  // in case those are not unity matrices
684  bool Read_transformation_matrices_from_geometry(bool aligned = true);
685 
686  // apply transformation matrices to a loaded geometry
687  // aligned and not aligned are two separate maps
688  // containing the description of the detector positions
689  // the geometry must be loaded otherwise matrices cannot be read
690  // version number will be set according to the geometry version number
691  // IMPORTANT: you may choose which PndLmdDim matrices you want to use
692  // but a ROOT Geometry can always be only aligned. The original
693  // matrix stays untouched!
694  // TODO: multiply also matrices on the way to the key matrices
695  // in case those are not unity matrices
696  // TODO: Find out how to store the aligned geometry as a default
697  // one to pandaroot parameter files
698  bool Write_transformation_matrices_to_geometry(bool aligned = true);
699 
700  // get a list of sensor paths in the geometry navigation model
701  // returns the path to the lmd top volume
702  // It is a recursive search, call it once with the default found_lmd variable
703  // in case first_call then gGeoManager->CdTop(); is executed to get to the top node
704  // of a geometry
705  // The geometry must be loaded
706  string Get_List_of_Sensors(vector<string> &list_of_sensors, bool found_lmd = false, bool first_call = true);
707 
708  // check a list of sensor paths for validity
709  // result is true if tests were sucessful
710  // offset is the offset in the sensor number which may be
711  // not 0 if the geometry was not created in the first place
712  bool Test_List_of_Sensors(vector<string> list_of_sensors, int &offset);
713 
714  // Get an offset for a volume, if not existent and random
715  // a random offset is generated and stored
716  // Is used during generation of geometries when calling
717  void Get_offset(int ihalf, int iplane, int imodule, int iside, int idie, int isensor, double &x, double &y, double &z, double &rotphi, double &rottheta, double &rotpsi,
718  bool random = false);
719 
720  // set an offset for example for the case of existent alignment
721  // values, to generate with Get_offset a geometry that matches
722  // those offsets
723  void Set_offset(int ihalf, int iplane, int imodule, int iside, int idie, int isensor, double x, double y, double z, double rotphi, double rottheta, double rotpsi);
724 
725  // read alignment constants from DB
726  // Feb 2013: currently DB is ASCII file
727  void Read_DB_offsets(PndLmdAlignPar *lmdalignpar);
728 
729  // correct transformation matrices by align
730  void Correct_transformation_matrices();
731  void reCreate_transformation_matrices();
732  // several functions returning the position and orientation of
733  // the luminosity detector
734 
735  // the global system is defined by PANDA
736  // returns the position and rotation of the lmd detector
737  // the origin is PANDA interaction point
738  // first comes translation than rotation
739  void Get_pos_lmd_global(double &x, double &y, double &z, double &rotx, double &roty, double &rotz, bool misaligned = false)
740  {
741  rotx = rot_x;
742  roty = rot_y; // phi_bend;
743  rotz = rot_z;
744  x = pos_x;
745  y = pos_y;
746  z = pos_z;
747  if (misaligned)
748  rotx += 0; // pedantic compiler fix
749  }
750 
751  // decoding a digital hit by the position of the sensor given by the sensor ID
752  // and the row and column entry
753  // parameters of MC geometry input are used to determine the position of
754  // the active area within the sensor volume
755  // The hit point is returned in the panda global reference frame
756  // needs transformation matrices to determine the position
757  // column and row can be also the mean from a cluster and therefore
758  // not an integer
759  TVector3 Decode_hit(const int sensorID, const double column, const double row, const bool aligned = true, bool newVersion = false);
760 
761  // matrices for a fast prediction of a particle track to the lmd
762  // depending on the momentum setting of the hesr which is the key
763  map<double, PndLmdDimPropMat> propagation_matrices;
764 
765  // propagate a particle at the IP to the first plane of the lmd
766  // the propagation is based on a transformation matrix which was
767  // fit to GEANT4 propagated data from January 2015
768  // only 1.5 GeV/c and 15 GeV/c are implemented properly
769  // TODO: interpolation between matrices
770  // back propagation not implemented yet since
771  // Mathematica inverted matrices did not work
772  void Propagate_fast_ip_to_lmd(TVector3 &pos, TVector3 &mom, double pbeam);
773 
774  // Find the corresponding sensor on the opposite side of a module
775  // point is in the panda frame
776  // point is transformed into the local lmd frame and
777  // the projection is tested 1. to lie on the given sensor
778  // 2. on all other sensors on the opposite side for intersection
779  // returns true if the corresponding sensor was found
780  // in that case input parameters are set to the corresponding sensor
781  // otherwise those are set to -1!
782  // do not use in time critical cases!
783  bool Get_overlapping_sensor(const TVector3 &point, int &ihalf, int &iplane, int &imodule, int &iside, int &idie, int &isensor, bool aligned = true);
784 
785  // Test if a point lies on a specific sensor
786  // The point in the panda frame is transformed into the sensor frame
787  // the projection is tested to be within the boundaries of the active sensor area
788  bool Is_on_Sensor(const TVector3 &point, int ihalf, int iplane, int imodule, int iside, int idie, int isensor, bool aligned = true);
789 
790  // get the overlapping sensors by geometric constraints
791  // hard coded overlapping areas are given sorted by the overlapping area
792  // returned is the number of overlapping sensors
793  // jdie and jsensor are vectors with the length of the returned number
794  int Get_overlapping_sensor(int idie, int isensor, vector<int> &jdie, vector<int> &jsensor);
795 
796  // get the transformation matrix from the PANDA global reference frame to the
797  // Luminosity reference frame
798  TGeoHMatrix Get_transformation_global_to_lmd_local(bool aligned = true);
799 
800  // get the transformation matrix from lmd local reference frame to the
801  // cvd disc surface reference frame
802  TGeoHMatrix Get_transformation_lmd_local_to_module_side(int ihalf, int iplane, int imodule, int iside, bool aligned = true);
803 
804  // get the transformation matrix from lmd cvd disc surface frame to the
805  // sensor reference frame
806  TGeoHMatrix Get_transformation_module_side_to_sensor(int ihalf, int iplane, int imodule, int iside, int idie, int isensor, bool aligned = true);
807 
808  // get the transformation matrix from PANDA global reference frame to the
809  // sensor reference frame
810  TGeoHMatrix Get_transformation_global_to_sensor(int ihalf, int iplane, int imodule, int iside, int idie, int isensor, bool aligned = true);
811 
812  // get the transformation matrix from lumi reference frame to the
813  // sensor reference frame
814  TGeoHMatrix Get_transformation_lmd_local_to_sensor(int ihalf, int iplane, int imodule, int iside, int idie, int isensor, bool aligned = true);
815 
816  // get the inverse transformation matrix from the PANDA global reference frame to the
817  // Luminosity reference frame
818  TGeoHMatrix Get_transformation_lmd_local_to_global(bool aligned = true);
819 
820  // get the inverse transformation matrix from lmd local reference frame to the
821  // cvd disc surface reference frame
822  TGeoHMatrix Get_transformation_module_side_to_lmd_local(int ihalf, int iplane, int imodule, int iside, bool aligned = true);
823 
824  // get the inverse transformation matrix from lmd cvd disc surface frame to the
825  // sensor reference frame
826  TGeoHMatrix Get_transformation_sensor_to_module_side(int ihalf, int iplane, int imodule, int iside, int idie, int isensor, bool aligned = true);
827 
828  // get the inverse transformation matrix from PANDA global reference frame to the
829  // sensor reference frame
830  TGeoHMatrix Get_transformation_sensor_to_global(int ihalf, int iplane, int imodule, int iside, int idie, int isensor, bool aligned = true);
831 
832  // get the inverse transformation matrix from lmd local reference frame to the
833  // sensor reference frame
834  TGeoHMatrix Get_transformation_sensor_to_lmd_local(int ihalf, int iplane, int imodule, int iside, int idie, int isensor, bool aligned = true);
835 
836  // get the transformation matrix from a ideal sensor to the aligned one
837  TGeoHMatrix Get_transformation_sensor_to_sensor_aligned(int ihalf, int iplane, int imodule, int iside, int idie, int isensor);
838 
839  // get the transformation matrix from a aligned sensor to the ideal one
840  TGeoHMatrix Get_transformation_sensor_aligned_to_sensor(int ihalf, int iplane, int imodule, int iside, int idie, int isensor);
841 
842  //************************** 3d vector transformations ******************************
843 
844  // Transform from the PANDA global reference frame to the
845  // Luminosity reference frame
846  TVector3 Transform_global_to_lmd_local(const TVector3 &point, bool isvector = false, bool aligned = true);
847 
848  // Transform from lmd local reference frame to the
849  // cvd disc surface reference frame
850  TVector3 Transform_lmd_local_to_module_side(const TVector3 &point, int ihalf, int iplane, int imodule, int iside, bool isvector = false, bool aligned = true);
851 
852  // Transform from lmd cvd disc surface frame to the
853  // sensor reference frame
854  TVector3 Transform_module_side_to_sensor(const TVector3 &point, int ihalf, int iplane, int imodule, int iside, int idie, int isensor, bool isvector = false, bool aligned = true);
855 
856  // Transform from PANDA global reference frame to the
857  // sensor reference frame
858  TVector3 Transform_global_to_sensor(const TVector3 &point, int ihalf, int iplane, int imodule, int iside, int idie, int isensor, bool isvector = false, bool aligned = true);
859 
860  // Transform from lmd local reference frame to the
861  // sensor reference frame
862  TVector3 Transform_lmd_local_to_sensor(const TVector3 &point, int ihalf, int iplane, int imodule, int iside, int idie, int isensor, bool isvector = false, bool aligned = true);
863 
864  // Transform from the PANDA global reference frame to the
865  // Luminosity reference frame
866  TVector3 Transform_lmd_local_to_global(const TVector3 &point, bool isvector = false, bool aligned = true);
867 
868  // Transform from lmd local reference frame to the
869  // cvd disc surface reference frame
870  TVector3 Transform_module_side_to_lmd_local(const TVector3 &point, int ihalf, int iplane, int imodule, int iside, bool isvector = false, bool aligned = true);
871 
872  // Transform from lmd cvd disc surface frame to the
873  // sensor reference frame
874  TVector3 Transform_sensor_to_module_side(const TVector3 &point, int ihalf, int iplane, int imodule, int iside, int idie, int isensor, bool isvector = false, bool aligned = true);
875 
876  // Transform from PANDA global reference frame to the
877  // sensor reference frame
878  TVector3 Transform_sensor_to_global(const TVector3 &point, int ihalf, int iplane, int imodule, int iside, int idie, int isensor, bool isvector = false, bool aligned = true);
879 
880  // Transform from lmd local reference frame to the
881  // sensor reference frame
882  TVector3 Transform_sensor_to_lmd_local(const TVector3 &point, int ihalf, int iplane, int imodule, int iside, int idie, int isensor, bool isvector = false, bool aligned = true);
883 
884  // Transform from a ideal sensor to the aligned one
885  TVector3 Transform_sensor_to_sensor_aligned(const TVector3 &point, int ihalf, int iplane, int imodule, int iside, int idie, int isensor, bool isvector = false);
886 
887  // Transform from a aligned sensor to the ideal one
888  TVector3 Transform_sensor_aligned_to_sensor(const TVector3 &point, int ihalf, int iplane, int imodule, int iside, int idie, int isensor, bool isvector = false);
889 
890  // Transform from one sensor to an other
891  TVector3 Transform_sensor_to_sensor(const TVector3 &point, int ihalf_from, int iplane_from, int imodule_from, int iside_from, int idie_from, int isensor_from, int ihalf_to,
892  int iplane_to, int imodule_to, int iside_to, int idie_to, int isensor_to, bool isvector = false, bool aligned = true);
893 
894  // ************************* 3d matrix rotations ***************************************
895 
896  // Transform from the PANDA global reference frame to the
897  // Luminosity reference frame
898  // treats only 3 x 3 matrices representing the space
899  TMatrixD Transform_global_to_lmd_local(const TMatrixD &matrix, bool aligned = true);
900 
901  // Transform from lmd local reference frame to the
902  // cvd disc surface reference frame
903  // treats only 3 x 3 matrices representing the space
904  TMatrixD Transform_lmd_local_to_module_side(const TMatrixD &matrix, int ihalf, int iplane, int imodule, int iside, bool aligned = true);
905 
906  // Transform from lmd local reference frame to the
907  // sensor reference frame
908  // treats only 3 x 3 matrices representing the space
909  TMatrixD Transform_lmd_local_to_sensor(const TMatrixD &matrix, int ihalf, int iplane, int imodule, int iside, int idie, int isensor, bool aligned = true);
910 
911  // Transform from lmd cvd disc surface frame to the
912  // sensor reference frame
913  // treats only 3 x 3 matrices representing the space
914  TMatrixD Transform_module_side_to_sensor(const TMatrixD &matrix, int ihalf, int iplane, int imodule, int iside, int idie, int isensor, bool aligned = true);
915 
916  // Transform from PANDA global reference frame to the
917  // sensor reference frame
918  // treats only 3 x 3 matrices representing the space
919  TMatrixD Transform_global_to_sensor(const TMatrixD &matrix, int ihalf, int iplane, int imodule, int iside, int idie, int isensor, bool aligned = true);
920 
921  // Transform from the PANDA global reference frame to the
922  // Luminosity reference frame
923  // treats only 3 x 3 matrices representing the space
924  TMatrixD Transform_lmd_local_to_global(const TMatrixD &matrix, bool aligned = true);
925 
926  // Transform from lmd local reference frame to the
927  // cvd disc surface reference frame
928  // treats only 3 x 3 matrices representing the space
929  TMatrixD Transform_module_side_to_lmd_local(const TMatrixD &matrix, int ihalf, int iplane, int imodule, int iside, bool aligned = true);
930 
931  // Transform from lmd cvd disc surface frame to the
932  // sensor reference frame
933  // treats only 3 x 3 matrices representing the space
934  TMatrixD Transform_sensor_to_module_side(const TMatrixD &matrix, int ihalf, int iplane, int imodule, int iside, int idie, int isensor, bool aligned = true);
935 
936  // Transform from sensor reference frame to the
937  // lmd local reference frame
938  // treats only 3 x 3 matrices representing the space
939  TMatrixD Transform_sensor_to_lmd_local(const TMatrixD &matrix, int ihalf, int iplane, int imodule, int iside, int idie, int isensor, bool aligned = true);
940 
941  // Transform from PANDA global reference frame to the
942  // sensor reference frame
943  // treats only 3 x 3 matrices representing the space
944  TMatrixD Transform_sensor_to_global(const TMatrixD &matrix, int ihalf, int iplane, int imodule, int iside, int idie, int isensor, bool aligned = true);
945 
946  // Transform from a ideal sensor to the aligned one
947  // treats only 3 x 3 matrices representing the space
948  TMatrixD Transform_sensor_to_sensor_aligned(const TMatrixD &matrix, int ihalf, int iplane, int imodule, int iside, int idie, int isensor);
949 
950  // Transform from a aligned sensor to the ideal one
951  // treats only 3 x 3 matrices representing the space
952  TMatrixD Transform_sensor_aligned_to_sensor(const TMatrixD &matrix, int ihalf, int iplane, int imodule, int iside, int idie, int isensor);
953 
954  // Transform from one sensor to an other
955  // treats only 3 x 3 matrices representing the space
956  TMatrixD Transform_sensor_to_sensor(const TMatrixD &matrix, int ihalf_from, int iplane_from, int imodule_from, int iside_from, int idie_from, int isensor_from, int ihalf_to,
957  int iplane_to, int imodule_to, int iside_to, int idie_to, int isensor_to, bool aligned = true);
958 
959  // *************************
960 
961  // get a pointer to the requested matrices with checks
962  // returns nullptr if no matrices available
963  // do not delete!
964  map<Tkey, TGeoMatrix *> *Get_matrices(bool aligned = true);
965 
966  // get a pointer to the requested matrix with checks
967  // returns nullptr if no matrix available
968  // do not delete or modify unless you know why you want to
969  // load the two files for matrices first
970  TGeoMatrix *Get_matrix(int ihalf, int iplane, int imodule, int iside, int idie, int isensor, bool aligned = true);
971 
972  // get the transformation matrix for an path in an existing root geometry
973  // no checks are performed in advance
974  // result may be 0!
975  // if (aligned) the matrix after a possible alignment is returned
976  // in that case details to the matrix must be provided in form
977  // of ihalf ... isensor
978  // TODO: get rid of path and do it only on the basis of ihalf ... isensor
979  // if (!aligned) the original matrix is returned
980  TGeoHMatrix *Get_matrix(string path, bool aligned = true, int ihalf = -1, int iplane = -1, int imodule = -1, int iside = -1, int idie = -1, int isensor = -1);
981 
982  // set the transformation matrix for an path in an existing root geometry
983  // A matrix can be only aligned,
984  // therefore by default original matrices are not touched!
985  // since a key must be created for a node
986  // details to it must be provided in form of
987  // ihalf ... isensor
988  // TODO: get rid of path and do it only on the basis of ihalf ... isensor
989  bool Set_matrix(string path, TGeoHMatrix *matrix, int ihalf = -1, int iplane = -1, int imodule = -1, int iside = -1, int idie = -1, int isensor = -1); //, bool aligned = true);
990 
991  // get the difference between two matrices of the aligned and misaligned branch
992  // in terms of displacement and euler angles
993  // all 0 in case of troubles and result is false
994  // load the two files for matrices first
995  // NOTE: output values are formatted to µm and µrad!!!
996  bool Get_matrix_difference(int ihalf, int iplane, int imodule, int iside, int idie, int isensor, double &dx, double &dy, double &dz, double &dphi, double &dtheta, double &dpsi);
997 
998  // calculates the differences of matrices between loaded
999  // aligned and misaligned ones
1000  // As an output a table and some histograms are generated
1001  // load the two files for matrices first
1002  void Calc_matrix_offsets();
1003 
1004  // see get matrix
1005  TGeoMatrix *Get_matrix_global_to_lmd_local(bool aligned = true);
1006 
1007  // see get matrix
1008  TGeoMatrix *Get_matrix_lmd_local_to_module_side(int ihalf, int iplane, int imodule, int iside, bool aligned = true);
1009 
1010  // see get matrix
1011  TGeoMatrix *Get_matrix_module_side_to_sensor(int ihalf, int iplane, int imodule, int iside, int idie, int isensor, bool aligned = true);
1012 
1013  // TGeoMatrix* Get_matrix_global_to_sector_local(int ihalf, int iplane, int imodule, bool aligned=true);
1014 
1015  // x, y, z coordinate transformation from the PANDA global reference frame to the
1016  // local reference frame of the luminosity monitor
1017  void Transform_global_to_lmd_local(double &x, double &y, double &z, bool aligned = true);
1018 
1019  // x, y, z vector transformation from the PANDA global reference frame to the
1020  // local reference frame of the luminosity monitor
1021  void Transform_global_to_lmd_local_vect(double &x, double &y, double &z, bool aligned = true);
1022 
1023  // x, y, z coordinate transformation from the local sensor reference frame to the
1024  // local reference frame of the luminosity monitor
1025  // void transform_sensor_local_to_lmd_local(const int sensor_id, double& x, double& y, double& z, bool misaligned = false);
1026 
1027  // x, y, z coordinate transformation from the local luminosity reference frame to the
1028  // global reference frame of panda
1029  // void transform_local_lmd_to_global(const int sensor_id, double& x, double& y, double& z, bool misaligned = false);
1030 
1031  // x, y, z coordinate transformation between the local sensor reference frames
1032  // of misaligned and aligned sensors
1033  // void transform_local_sensor();
1034 
1035  // Generates the luminosity monitor geometry into the mother volume
1036  // Please make sure that mother volume is large enough or that it
1037  // is an assembly volume
1038  // in addition rotation and translation matrices are calculated
1039  // to store those into a file please use
1040  // Write_transformation_matrices(filename, false);
1041  // in case of misaligned, offsets are retrieved via get_offset
1042  // and included into the geometry
1043  void Generate_rootgeom(TGeoVolume &mothervol, bool misaligned = false);
1044 
1045  // returns false
1046  // if version number of the geometry could not be retrieved from a loaded geometry
1047  // geometry must be available via the root geometry manager
1048  bool Retrieve_version_number();
1049 
1050  // small function to test some transformation matrices and methods
1051  void Test_matrices();
1052 
1053  // Draw the Sensors as overlays to an active root pad
1054  // Projection in XY is used
1055  // lmd_frame == true : The Lumi reference frame is used
1056  void Draw_Sensors(int iplane, bool aligned = true, bool lmd_frame = true, int glside = 2); // by default draw both sides
1057  // Get one Sensor as a polyline to be drawn to an active root pad
1058  // Projection in XY is used
1059  // Important -> Do not delete the PolyLine until you are sure that you are
1060  // finished with displaying it!
1061  // lmd_frame == true : The Lumi reference frame is used
1062  TPolyLine *Get_Sensor_Shape(int ihalf, int iplane, int imodule, int iside, int idie, int isensor, bool aligned = true, bool lmd_frame = true);
1063 
1064  // Get one Sensor as a vector of graphs
1065  // Projection in XY is used
1066  // lmd_frame == true : The Lumi reference frame is used
1067  // else the sensor reference frame
1068  // if pixel_subdivision: several graphs are returned
1069  // representing the passive area and the
1070  // active area subdivided into several pixels
1071  // please do not call several times with same
1072  // parameters if previous result and it's contents
1073  // are not deleted
1074  vector<TGraph *>
1075  Get_Sensor_Graph(int ihalf, int iplane, int imodule, int iside, int idie, int isensor, bool aligned = true, bool lmd_frame = true, bool pixel_subdivision = true);
1076 
1077  // Get a TH2Poly histogram where bins matching the x_y projected shapes
1078  // of the sensors in one plane
1079  // The active area can be subdivided further
1080  // the active pixels: NOT RECOMMENDED due to heavy ram usage
1081  // Please rename it if you intend to call the function
1082  // several times with same parameters
1083  TH2Poly *Get_histogram_Plane(int iplane, int iside, bool aligned = true, bool lmd_frame = true, bool pixel_subdivision = false);
1084 
1085  // Get a TH2Poly histogram for one module side
1086  // in the reference frame of the lumi
1087  // on request in the panda reference frame
1088  // The active area can be subdivided further
1089  // into the active pixels: WARNING heavy ram usage
1090  // Please rename it if you intend to call the function
1091  // several times with same parameters
1092  TH2Poly *Get_histogram_Moduleside(int ihalf, int iplane, int imodule, int iside, bool aligned = true, bool lmd_frame = true, bool pixel_subdivision = true);
1093 
1094  // Get a TH2Poly histogram for one sensor
1095  // in the reference frame of the lumi
1096  // on request in the panda reference frame
1097  // The active area can be subdivided into
1098  // and the active pixels
1099  // Please rename it if you intend to call the function
1100  // several times with same parameters
1101  TH2Poly *Get_histogram_Sensor(int ihalf, int iplane, int imodule, int iside, int idie, int isensor, bool aligned = true, bool lmd_frame = true);
1102 
1103  // gets all ids that correspond to an overlapping area
1104  std::vector<int> getAvailableOverlapIDs();
1105  int makeOverlapID(int firstSensorId, int secondSensorId);
1106  int getID1fromOverlapID(int overlapID);
1107  int getID2fromOverlapID(int overlapID);
1108 
1109  // this is a legacy function and should not be called anymore
1110  int makeModuleID(int overlapID);
1111 };
1112 
1113 #endif /* PNDLMDDIM_H_ */
double maps_active_pixel_size
Definition: PndLmdDim.h:413
double sensor_tilt_psi
Definition: PndLmdDim.h:458
double rot_z
Definition: PndLmdDim.h:504
double die_tilt_psi
Definition: PndLmdDim.h:445
double pos_y
Definition: PndLmdDim.h:501
double r_bend
Definition: PndLmdDim.h:490
map< Tkey, vector< double > >::iterator itoffset
Definition: PndLmdDim.h:569
void Get_pos_lmd_global(double &x, double &y, double &z, double &rotx, double &roty, double &rotz, bool misaligned=false)
Definition: PndLmdDim.h:739
Tkey(int ihalf, int iplane, int imodule, int iside, int idie, int isensor)
Definition: PndLmdDim.h:183
double half_tilt_phi
Definition: PndLmdDim.h:282
char * itoa(int value, char *result, int base)
Definition: PndLmdDim.h:582
bool Is_valid_idcall(int ihalf, int iplane=0, int imodule=0, int iside=0, int idie=0, int isensor=0)
Definition: PndLmdDim.h:507
double plane_half_tilt_theta
Definition: PndLmdDim.h:297
string Generate_key(int ihalf, int iplane, int imodule, int iside, int idie, int isensor)
Definition: PndLmdDim.h:611
double half_offset_z
Definition: PndLmdDim.h:280
double pos_z
Definition: PndLmdDim.h:496
double plane_half_offset_y
Definition: PndLmdDim.h:291
map< Tkey, TGeoMatrix * >::iterator it_transformation_matrices
Definition: PndLmdDim.h:653
double cvd_offset_y
Definition: PndLmdDim.h:336
double die_tilt_theta
Definition: PndLmdDim.h:443
double die_offset_y
Definition: PndLmdDim.h:437
double delta_phi
Definition: PndLmdDim.h:317
double die_tilt_phi
Definition: PndLmdDim.h:441
map< Tkey, TGeoMatrix * > transformation_matrices_aligned
Definition: PndLmdDim.h:652
bool operator<(const Tkey &comp) const
Definition: PndLmdDim.h:139
double end_seg_upstream
Definition: PndLmdDim.h:488
void Propagate(TVector3 &pos, TVector3 &momdir)
Definition: PndLmdDim.h:113
double plane_half_tilt_phi
Definition: PndLmdDim.h:295
double cvd_disc_rad
Definition: PndLmdDim.h:310
double phi_bend
Definition: PndLmdDim.h:492
double maps_passive_right
Definition: PndLmdDim.h:409
double maps_die_height
Definition: PndLmdDim.h:424
double * plane_pos_z
Definition: PndLmdDim.h:273
double cvd_tilt_theta
Definition: PndLmdDim.h:342
STL namespace.
double pipe_thickness
Definition: PndLmdDim.h:479
map< Tkey, TGeoMatrix * > transformation_matrices
Definition: PndLmdDim.h:651
double rad_entrance
Definition: PndLmdDim.h:473
double length_pipe
Definition: PndLmdDim.h:483
double sensor_offset_x
Definition: PndLmdDim.h:448
bool operator==(const Tkey &comp) const
Definition: PndLmdDim.h:168
double sensor_tilt_phi
Definition: PndLmdDim.h:454
double plane_half_tilt_psi
Definition: PndLmdDim.h:299
double side_offset_x
Definition: PndLmdDim.h:351
double outer_rad
Definition: PndLmdDim.h:306
double box_size_y
Definition: PndLmdDim.h:465
unsigned int i
Definition: P4_F32vec4.h:21
double side_tilt_psi
Definition: PndLmdDim.h:361
int Get_sensor_id(int ihalf, int iplane, int imodule, int iside, int idie, int isensor)
Definition: PndLmdDim.h:526
Tkey(string key)
Definition: PndLmdDim.h:193
double maps_passive_bottom
Definition: PndLmdDim.h:407
unsigned int sensIDoffset
Definition: PndLmdDim.h:257
double pol_side_dist_min
Definition: PndLmdDim.h:322
double length_transision
Definition: PndLmdDim.h:481
double sensor_offset_y
Definition: PndLmdDim.h:450
double pos_plane_0
Definition: PndLmdDim.h:485
double maps_width
Definition: PndLmdDim.h:415
double side_offset_y
Definition: PndLmdDim.h:353
signed char die
Definition: PndLmdDim.h:137
double cvd_disc_thick_half
Definition: PndLmdDim.h:312
Alignment Parameter Class for LMD.
double maps_active_offset_x
Definition: PndLmdDim.h:418
void Get_sensor_by_id(const int sensor_id, int &ihalf, int &iplane, int &imodule, int &iside, int &idie, int &isensor)
Definition: PndLmdDim.h:535
double kapton_disc_thick_half
Definition: PndLmdDim.h:348
double rot_y
Definition: PndLmdDim.h:503
double rad_pipe
Definition: PndLmdDim.h:477
double end_seg_bend
Definition: PndLmdDim.h:497
double box_thickness
Definition: PndLmdDim.h:469
double pol_side_lg_half
Definition: PndLmdDim.h:320
double pos_rib
Definition: PndLmdDim.h:471
double half_tilt_theta
Definition: PndLmdDim.h:284
double cvd_offset_x
Definition: PndLmdDim.h:334
double maps_passive_left
Definition: PndLmdDim.h:408
double maps_active_offset_y
Definition: PndLmdDim.h:419
double cvd_tilt_phi
Definition: PndLmdDim.h:340
Tkey()
Definition: PndLmdDim.h:223
double box_size_z
Definition: PndLmdDim.h:467
double die_offset_x
Definition: PndLmdDim.h:435
signed char sensor
Definition: PndLmdDim.h:138
double cvd_disc_even_odd_offset
Definition: PndLmdDim.h:315
int maps_n_col
Definition: PndLmdDim.h:397
double pos_rot_z
Definition: PndLmdDim.h:494
double side_tilt_theta
Definition: PndLmdDim.h:359
double cvd_disc_dist
Definition: PndLmdDim.h:326
double die_gap
Definition: PndLmdDim.h:421
map< Tkey, vector< double > > offsets
Definition: PndLmdDim.h:568
void Set(const double *matrix)
Definition: PndLmdDim.h:76
int maps_n_row
Definition: PndLmdDim.h:398
bool ** enabled
Definition: PndLmdDim.h:400
double cvd_offset_z
Definition: PndLmdDim.h:338
double inner_rad
Definition: PndLmdDim.h:304
Tkey(const Tkey &copy)
Definition: PndLmdDim.h:173
double maps_die_width
Definition: PndLmdDim.h:423
double plane_half_offset_x
Definition: PndLmdDim.h:289
PndLmdDimPropMat(double mom_init)
Definition: PndLmdDim.h:85
double maps_active_height
Definition: PndLmdDim.h:411
int n_cvd_discs
Definition: PndLmdDim.h:308
signed char module
Definition: PndLmdDim.h:135
double pi
Definition: PndLmdDim.h:267
int sign(T val)
Definition: PndCADef.h:49
unsigned int nmodules
Definition: PndLmdDim.h:271
double half_offset_x
Definition: PndLmdDim.h:276
double plane_half_offset_z
Definition: PndLmdDim.h:293
double half_tilt_psi
Definition: PndLmdDim.h:286
double half_offset_y
Definition: PndLmdDim.h:278
double rot_x
Definition: PndLmdDim.h:502
double maps_height
Definition: PndLmdDim.h:416
int n_sensors
Definition: PndLmdDim.h:402
signed char plane
Definition: PndLmdDim.h:134
double cvd_tilt_psi
Definition: PndLmdDim.h:344
double side_tilt_phi
Definition: PndLmdDim.h:357
double sensor_offset_z
Definition: PndLmdDim.h:452
double sensor_tilt_theta
Definition: PndLmdDim.h:456
double rad_exit
Definition: PndLmdDim.h:475
double maps_thickness
Definition: PndLmdDim.h:405
map< double, PndLmdDimPropMat > propagation_matrices
Definition: PndLmdDim.h:763
signed char side
Definition: PndLmdDim.h:136
int Generate_keynumber(unsigned int ihalf=0, unsigned int iplane=0, unsigned int imodule=0, unsigned int iside=0, unsigned int idie=0, unsigned int isensor=0)
Definition: PndLmdDim.h:630
double maps_active_width
Definition: PndLmdDim.h:410
unsigned int n_planes
Definition: PndLmdDim.h:269
TMatrixT< double > TMatrixD
Definition: PndLmdDim.h:52
double pos_x
Definition: PndLmdDim.h:499
double box_size_x
Definition: PndLmdDim.h:463
double maps_passive_top
Definition: PndLmdDim.h:406
signed char half
Definition: PndLmdDim.h:133
double side_offset_z
Definition: PndLmdDim.h:355
double die_offset_z
Definition: PndLmdDim.h:439