"MarlinReco"  1.16.0
KITutil.h
1 #ifndef KITUTIL_h
2 #define KITUTIL_h 1
3 
4 #include "lcio.h"
5 #include "EVENT/LCIO.h"
6 #include <EVENT/SimCalorimeterHit.h>
7 #include <EVENT/CalorimeterHit.h>
8 #include <vector>
9 #include <list>
10 #include <stack>
11 #include <string>
12 #include <UTIL/CellIDDecoder.h>
13 #include "Phys_Geom_Database.h"
14 #include <gsl/gsl_vector.h>
15 #include <gsl/gsl_matrix.h>
16 #include <gsl/gsl_blas.h>
17 #include <gsl/gsl_linalg.h>
18 #include <gsl/gsl_eigen.h>
19 #include <gsl/gsl_multifit_nlin.h>
20 #include <gsl/gsl_rng.h>
21 #include <gsl/gsl_sf_gamma.h>
22 #include <gsl/gsl_integration.h>
23 #include <gsl/gsl_sf_pow_int.h>
24 #include <ANN/ANN.h>
25 
26 using namespace lcio;
27 using namespace std;
28 
29 class Tmpcl2;
35 class Superhit2
36 {
37  public:
38 
43  Superhit2(float E,CalorimeterHit* chitin);
47  ~Superhit2();
51  const float* getPosition(int i);
55  CalorimeterHit* chit;
56 
57  bool connect;
61  float point[3]; // transform position
65  float pointt[3]; // true position
69  float mip;
73  float mipE;
77  int top; // topological parameter
81  bool is_assigned;
85  vector <Superhit2*> neighbours;
93  int S;
97  int K;
101  int M;
105  int tip;
106 
107 };
112 class Tmpcl2{
113 
114  public :
118  Tmpcl2();
122  ~Tmpcl2();
126  void calcCenter();
130  double* getCenter();
134  double getEnergy();
138  void findInertia();
139 
140  // vector<Superhit2*> konektori;
144  vector<Superhit2*> hits;
148  vector<Tmpcl2*> daughters;
152  vector<Tmpcl2*> parents;
156  double energy;
160  double center[3];
164  double direction[3];
168  double inteigen[3];
172  double inteigenvec[9];
173 
177  int type ;
178 };
179 
180 class Photon2
181 {
182 
183  public:
187  Photon2(double Ein,double* pravac, double* pocetak);
191  ~Photon2();
192 
193  void Prob(CalorimeterHit* ch,double cut,double* out);
194 
195  // data- stvari koje se racunaju jednom i gotovo
196  double z1;
197  double z2;
198  double k1;
199  double k2;
200  double k3;
201  double k4;
202  double p1;
203  double p2;
204  double p3;
205  double y;
206  double eprime;
207  double Z;
208  double x0eff;
209  double sampling;
210  double Eceff;
211  double Rm;
212  double Fs;
213  double Thom;
214  double Tsam;
215 
216  double alfahom;
217  double alfasam;
218  double betasam;
219  //
220  double Ee;
221  double dir[3];
222  double start[3];
223 };
224 typedef vector<Superhit2*> Shitvec2;
225 typedef vector<Tmpcl2*> Tmpclvec2;
226 
230 typedef struct{
234  int level;
238  double Enom;
242  double a;
246  double b;
250  double Emin;
254  double Emax;
255 } CoreCalib2;
256 
260 typedef struct{
268  int level;
272  double X[3];
276  bool active;
277 }PROTSEED2;
278 
282 typedef struct{
286  double Rcut;
290  double Distcut;
294  double Coscut;
298  unsigned int MinHit0;
302  unsigned int MinHitSplit;
303 }CoreCut2;
304 
305 
310 void CreateAllShits2(LCCollection* colt,CellIDDecoder<CalorimeterHit>& id,vector<Superhit2*>* calo);
311 
316 void TotalPrecalc2(vector<Superhit2*>* calo,CellIDDecoder<CalorimeterHit>& id,
317  unsigned int nelem, int Ncut);
321 void Precalc2(vector< Superhit2* >& shvec,double r, double z, double cell, double dist,bool tip,int stove,int module,CellIDDecoder<CalorimeterHit>& id);
322 
326 void GridTransform2( CalorimeterHit* clh,float& radius, float& halfz, float& cellsize,float*X,
327  bool tip,int stove,int module,CellIDDecoder<CalorimeterHit>& id);
328 
333 void FindCores2(Shitvec2* secal1, vector< Tmpclvec2>& bbb , vector <PROTSEED2> * prs2,
334  unsigned int N, vector<float> miipstep, CoreCut2 Ccut);
338 void cluster5( vector<Superhit2*>* shv, vector<Tmpcl2*>* clv);
343 double giveMeEEstimate2(int nivo,double Ecore, vector<CoreCalib2> cc);
347 void CreateCalibrationLDC00(vector<CoreCalib2>* cc);
348 
349 
350 void LineCaloIntersectD2( double* X1, double* dir,double&d,double&zmax, double*X);
351 void LineCaloIntersect2(double* X1, double* X2,double&d,double&zmax, double*X);
352 double LinePointDistance2( double* X1, double* X2, double* X0);
353 void PointOnLine3(const double* X1,const double* X2,const float* X0,double* Xline);
354 void PointOnLine22(const double* Xstart,const double* dir,const float* X0,double* Xline);
355 void ModuleNormal2(double* X1,double& zmax, double* X0);
356 void ClusterInCluster2(Tmpcl2* cl, vector<Tmpcl2*>& clv);
357 double D_cl_cl2(Tmpcl2* cl1,Tmpcl2* cl2) ;
358 inline double Dot2(double* X1,double* X2);
359 void ClusterInCluster2(Tmpcl2* cl, vector<Tmpcl2*>& clv,vector<Tmpcl2*>& clout);
360 
361 #endif
362 
363 
364 
container for keeping the parameters of the core fineder together
Definition: KITutil.h:282
Definition: KITutil.h:180
vector< Superhit2 * > hits
hit in the cluster
Definition: KITutil.h:144
unsigned int MinHitSplit
minimal number of hits in i-th level cluster to be accepted for splitting of the core ...
Definition: KITutil.h:302
double b
Eestimate = a+b*Ecore , b parameter of this funcition.
Definition: KITutil.h:246
unsigned int MinHit0
minimal number of hits needed for 0-th level cluster to be accepted as a core candidate ...
Definition: KITutil.h:298
float mipE
MIP value [GeV].
Definition: KITutil.h:73
int top
Number of neighbours.
Definition: KITutil.h:77
float mip
Energy of hit i terms of MIP.
Definition: KITutil.h:69
double Distcut
distance cut for core merging
Definition: KITutil.h:290
CalorimeterHit * chit
Pointer to the LCIO calorimeter hit.
Definition: KITutil.h:55
Basic cluster class for reconstruction.
Definition: KITutil.h:112
bool is_assigned
Is hit assigned to a cluster or not.
Definition: KITutil.h:81
int level
level of cluster
Definition: KITutil.h:234
double Emax
upper validity range of energy estimation funciton in GeV
Definition: KITutil.h:254
int S
stove as coded by Mokka
Definition: KITutil.h:93
double Emin
lower validity range of energy estimation funciton in GeV
Definition: KITutil.h:250
double Coscut
angular cut for core merging (value of the cosine is stored not the angle!)
Definition: KITutil.h:294
vector< Tmpcl2 * > parents
pointers to clusters that contain this cluster
Definition: KITutil.h:152
container for storing the EM shower core candidates
Definition: KITutil.h:260
double Enom
nominal i.e.
Definition: KITutil.h:238
double a
Eestimate = a+b*Ecore , a parameter of this funcition.
Definition: KITutil.h:242
int M
module as coded by Mokka
Definition: KITutil.h:101
int type
Internal type of the cluster.
Definition: KITutil.h:177
double Rcut
fluctuation suppresion cut
Definition: KITutil.h:286
int level
level of the cluster
Definition: KITutil.h:268
vector< Tmpcl2 * > daughters
pointers to clusters that are contained in this cluster
Definition: KITutil.h:148
double energy
energy in GeV (sum over hits in cluster)
Definition: KITutil.h:156
Tmpcl2 * cl
pointer to the cluster
Definition: KITutil.h:264
int K
layer as coded by Mokka
Definition: KITutil.h:97
vector< Superhit2 * > neighbours
Vector of pointers to the neighbouring hits of Superhit2 type.
Definition: KITutil.h:85
Basic hit class for reconstruction, contains the calorimeter hit plus additional parameters.
Definition: KITutil.h:35
Tmpcl2 * cl
Pointer to the cluster to wich hit belong.
Definition: KITutil.h:89
int tip
0 by constructor 1 for ecal 2 for hcal
Definition: KITutil.h:105
container for holding the numbers needed for energy estimation
Definition: KITutil.h:230
bool active
flag to activate deactivate
Definition: KITutil.h:276