MarlinUtil  1.12.1
Phys_Geom_Database.h
1 #ifndef PHYS_GEOM_DATABASE_H
2 #define PHYS_GEOM_DATABASE_H 1
3 
4 #include <iostream>
5 #include "marlin/Processor.h"
6 #include "lcio.h"
7 #include <B_Util.h>
8 
54 //============================================================================
55 class PGdb {
56 //============================================================================
57  public:
58 // !! Change get_name() in cc file in case of changes here !!
59  typedef enum {
60  VTX=0,
61  TPC,
62  ENDPLATE1, // TPC
63  ENDPLATE2, // TPC
64  ECAL1_BAR,
65  ECAL2_BAR,
66  ECAL1_CAP,
67  ECAL2_CAP,
68  HCAL_BAR,
69  HCAL_CAP,
70  COIL,
71  DETECTOR,
72  WORLD,
73  ZONE_COUNT
74  } ZONE;
75 //============================================================================
76  class Volume {
77 //============================================================================
78  public:
79  typedef enum {
80  CYLINDER=0,
81  POLYGON
82  }SHAPE;
83  SHAPE shape;
84  unsigned symmetry;
85  double phi0;
86  double r_inner;
87  double r_outer;
88  double z_inner;
89  double z_outer;
90  };
91 //============================================================================
92  class Zone : public Volume {
93 //============================================================================
94  private:
95  double r_min;
96  double r_max;
97  double a0; // Polygone segment angle = 2Pi/symmetry for speed up
98  public:
99  unsigned no; // Zone ID
100  //---------------------------------
101  // Detector Parameters
102  //---------------------------------
103  unsigned n_sampl; // Number of layers in calorimeter or TPC rings
104  double sampling; // Sampling layer thickness
105  unsigned min_lay; // Minimal Layer number
106  unsigned max_lay; // Maximal Layer number
107  double absorber; // Absorber layer thickness
108  int abs_mat; // Absorber material
109  double detector; // Detector layer thickness
110  int det_mat; // Detector material
111  double cell_size; // Cell size in X and Y (square shape)
112  double Zeff; // effective Z
113  double Aeff; // effective A
114  double Rhoeff; // effective Ro g/cm^3
115  double Ieff; // effective exc. energy [GeV]
116  double Rmeff ;// Molere radius [mm]
117  double x0eff; // X0 [mm]
118  double Eceff; // Critical energy [MeV]
119  double eprime; // EM shower parameter
120 //---------------------------------
121 // Physical Parameters
122 //---------------------------------
123 // MIP most probable detector energy, does not include energy lost in absorber
124  double mip_vis;
125 // Coeff converts visible energy to physical energy
126 // i.e. converts energy lost in detector into energy lost in sampling layer
127 // including absorber
128  double e_coeff;
129 
130  double r_neighbor; // Predicted distance to neighbor for particular zone
131 
132  double cell_vol; // Volume including absorber
133 // RGB Predicted cutoffs for particular zone around MIP
134  double cut_noise;
135  double cut_mip;
136  double cut_hadr;
137 // MIP most probable physical energy, i.e. including energy lost in absorber
138  double mip_whole;
139 
140  double mip_dens; // MIP energy density in whole cell volume
141 
142  const char *get_name() const;
143 
144  private:
145  friend class PGdb;
146  void _init_final();
147  void _init_tpc();
148  void _init_endpl1();
149  void _init_endpl2();
150  void _init_ecal_bar_common();
151  void _init_ecal1_bar(int last_layer);
152  void _init_ecal2_bar(int last_ecal1_layer);
153  void _init_ecal_cap_common();
154  void _init_ecal1_cap(int last_layer);
155  void _init_ecal2_cap(int last_ecal1_layer);
156  void _init_hcal(PGdb::ZONE zone);
157  void _init_all_common();
158  void _init_vtx();
159  void _init_coil();
160  void _init_detector();
161  void _init_world();
162 // Geometry
163  bool inside(Point3D &p);
164  bool in_polygon(double r,Point3D &p);
165  };
166 
167  private:
168  Zone zone[ZONE_COUNT];
169 
170  public:
171  double B_Field;
172  void init();
173  ZONE get_zone(Point3D &p);
174 // ZONE get_zone(Hit &h); // Hit is not separate class ????? will be less calculations
175  const Zone &operator[](ZONE z) const { return zone[z]; }
176 
177 }; // +++++++++++ End PGdb -- Phys_Geom_Database definition +++++++++++++++++++++++
178 
179 extern PGdb PGDB;
180 
181 std::ostream &operator<<(std::ostream &o,const PGdb &d);
182 
183 using namespace lcio ;
184 using namespace marlin ;
185 
186 //============================================================================
187 class PGDBP : public Processor {
188 //============================================================================
189  public:
190  virtual Processor* newProcessor() { return new PGDBP ; }
191  PGDBP();
192  virtual void init() ;
193 };
194 
195 #endif
<br> Phys_Geom_Database cla...
Definition: Phys_Geom_Database.h:55
Definition: Phys_Geom_Database.h:92
Definition: B_Util.h:36
Definition: Phys_Geom_Database.h:76
Definition: Phys_Geom_Database.h:187