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