]> git.uio.no Git - u/mrichter/AliRoot.git/blob - ITS/UPGRADE/AliITSUTrackerSAaux.h
update of the tracker
[u/mrichter/AliRoot.git] / ITS / UPGRADE / AliITSUTrackerSAaux.h
1 #ifndef ALIITSUTRACKERSAAUX_H
2 #define ALIITSUTRACKERSAAUX_H
3
4 #ifdef __DEBUG__ 
5 #include <iostream>
6 using std::ostream;
7 using std::endl;
8 #endif
9
10 #include <vector>
11 using std::vector;
12 #include "AliExternalTrackParam.h"
13 #include "AliITSUAux.h"
14
15 struct itsCluster {
16 itsCluster():isUsed(false),x(0.f),y(0.f),z(0.f),varx(0.f),covxy(0.f),vary(0.f),phi(0.f),phiM(0.f) {}
17 itsCluster(const float &X,const float &Y, const float &Z, const float &varX, const float &covXY, const float &varY,const float &Phi, const float &PhiM) : 
18   isUsed(false),x(X),y(Y),z(Z),varx(varX),covxy(covXY),vary(varY),phi(Phi),phiM(PhiM) {}
19   bool isUsed;
20   float x,y,z;            // Global coordinates
21   float varx,covxy,vary;  // Local covariance matrix
22   float phi,phiM;         // phi of the cluster and phi angle of the module containing the cluster
23   
24 #ifdef __DEBUG__
25   friend ostream& operator<<(ostream& out, const itsCluster& cl) {
26     out << "pos = (" << cl.x << ", " << cl.y << ", "<< cl.z <<")"<<" phi="<<cl.phi <<endl;
27     return out;
28   }
29 #endif
30 };
31
32 struct nPlets {
33 nPlets() : id0(-1),id1(-1),id2(-1),level(1),tanPhi(),tanLambda(),neighbours() {}
34 nPlets(int arg0,int arg1) : id0(arg0),id1(arg1),id2(-1),level(1),tanPhi(),tanLambda(),neighbours()  {}
35   int id0,id1,id2;
36   int level;
37   float tanPhi,tanLambda;
38   vector<int> neighbours;
39 #ifdef __DEBUG__
40   friend ostream& operator<<(ostream& out, const nPlets& cl) {
41     out << "id = (" << cl.id0 << ", " << cl.id1 << ", "<< cl.id2 <<")"<< endl;
42     out << "tanPhi="<< cl.tanPhi <<" tanLambda="<<cl.tanLambda << " level=" << cl.level <<endl;
43     out << "neighbours= ";
44     for( unsigned int i = 0; i< cl.neighbours.size(); ++i ) out << cl.neighbours[i];
45     out << endl;
46     return out;
47   }
48 #endif
49 };
50
51 class trackC : public AliExternalTrackParam {
52  public : 
53  trackC() : AliExternalTrackParam(), fChi2( 0. ), fPoints() {
54     for ( unsigned int i = 0; i < 2*AliITSUAux::kMaxLayers; ++i ) fPoints[i]=-1;
55   }
56 #ifdef __DEBUG__
57   friend ostream& operator<<(ostream& out, const trackC& cl) {
58     out << "points = (";
59     for( unsigned int i = 0; i < 2*AliITSUAux::kMaxLayers; ++i ) out << cl.fPoints[i] << " ";
60     out << "), chi2: " << cl.fChi2 <<endl;
61     const double* par = cl.GetParameter();
62     const double* cov = cl.GetCovariance();    
63     out << "X: " << cl.GetX() << " Alpha: " << cl.GetAlpha() << endl;
64     out << "Param: \n";
65     for (int i=0;i<5;i++) out << par[i] << " "; out << endl;
66     out << "Covar: \n";
67     int cnt = 0;
68     for (int i=0;i<5;i++) {for (int j=i+1;j--;) out << cov[cnt++] << " "; out << endl;}
69     return out;
70   }
71 #endif
72   
73   /* bool operator < ( const trackC &t ) { return fChi2 < t.fChi2; } */
74   /* bool operator <= ( const trackC &t ) { return fChi2 <= t.fChi2; } */
75   /* bool operator > ( const trackC &t ) { return fChi2 > t.fChi2; } */
76   /* bool operator >= ( const trackC &t ) { return fChi2 >= t.fChi2; } */
77   /* bool operator == ( const trackC &t ) { return fChi2 == t.fChi2; } */
78   /* bool operator != ( const trackC &t ) { return fChi2 != t.fChi2; } */
79   Double_t fChi2;
80   Int_t fPoints[2*AliITSUAux::kMaxLayers]; 
81   
82 };
83
84
85 struct CompDesc { //Adapted from TMath ROOT code 
86 CompDesc(vector<trackC> *d) : fData(d) {} 
87   
88   bool operator()(int i1, int i2) { 
89     return fData->at(i1).fChi2 > fData->at(i2).fChi2; 
90   } 
91   
92   vector<trackC> *fData; 
93 }; 
94
95 #endif