]>
Commit | Line | Data |
---|---|---|
2cbb5f31 | 1 | #ifndef ALIITSUTRACKERSAAUX_H |
2 | #define ALIITSUTRACKERSAAUX_H | |
3 | ||
57a336dd | 4 | #ifdef __DEBUG__ |
a0c47fdb | 5 | #include <iostream> |
6 | using std::ostream; | |
7 | using std::endl; | |
57a336dd | 8 | using std::cout; |
a0c47fdb | 9 | #endif |
10 | ||
2cbb5f31 | 11 | #include <vector> |
12 | using std::vector; | |
a0c47fdb | 13 | #include "AliExternalTrackParam.h" |
14 | #include "AliITSUAux.h" | |
2cbb5f31 | 15 | |
16 | struct itsCluster { | |
57a336dd | 17 | 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) |
18 | #ifdef __DEBUG__ | |
19 | ,pid() | |
20 | #endif | |
21 | {} | |
22 | 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) : | |
23 | isUsed(false),x(X),y(Y),z(Z),varx(varX),covxy(covXY),vary(varY),phi(Phi),phiM(PhiM) | |
24 | #ifdef __DEBUG__ | |
25 | ,pid() | |
26 | #endif | |
27 | {} | |
28 | #ifdef __DEBUG__ | |
29 | 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,int &Pid) : | |
30 | isUsed(false),x(X),y(Y),z(Z),varx(varX),covxy(covXY),vary(varY),phi(Phi),phiM(PhiM),pid(Pid) {} | |
31 | #endif | |
2cbb5f31 | 32 | bool isUsed; |
33 | float x,y,z; // Global coordinates | |
34 | float varx,covxy,vary; // Local covariance matrix | |
35 | float phi,phiM; // phi of the cluster and phi angle of the module containing the cluster | |
57a336dd | 36 | |
a0c47fdb | 37 | #ifdef __DEBUG__ |
57a336dd | 38 | int pid; |
a0c47fdb | 39 | friend ostream& operator<<(ostream& out, const itsCluster& cl) { |
40 | out << "pos = (" << cl.x << ", " << cl.y << ", "<< cl.z <<")"<<" phi="<<cl.phi <<endl; | |
41 | return out; | |
42 | } | |
43 | #endif | |
2cbb5f31 | 44 | }; |
45 | ||
57a336dd | 46 | struct Road { |
47 | Road() : fElements(), fNElements(0) { | |
48 | ResetElements(); | |
49 | } | |
50 | Road(const Road& copy) : fElements(), fNElements(copy.fNElements) { | |
51 | for ( int i=0; i<6; ++i ) { | |
52 | fElements[i] = copy.fElements[i]; | |
53 | } | |
54 | } | |
55 | ||
56 | void ResetElements() { | |
57 | for ( int i=0; i<6; ++i ) { | |
58 | fElements[i] = -1; | |
59 | } | |
60 | } | |
61 | ||
62 | void AddElement(int i, int el) { | |
63 | fNElements++; | |
64 | fElements[i] = el; | |
65 | } | |
66 | ||
67 | int fElements[6]; | |
68 | int fNElements; | |
69 | ||
70 | #ifdef __DEBUG__ | |
71 | friend ostream& operator<<(ostream& out, const Road& cl) { | |
72 | out << "Elements ("<< cl.fNElements <<"): "; | |
73 | for ( int i=0; i<6; ++i ) out << cl.fElements[i]; | |
74 | return out; | |
75 | } | |
76 | #endif | |
77 | }; | |
78 | ||
2cbb5f31 | 79 | struct nPlets { |
57a336dd | 80 | nPlets() : id0(-1),id1(-1),id2(-1),level(1),tanPhi(),tanLambda(),neighbours() |
81 | #ifdef __DEBUG__ | |
82 | ,pid0() | |
83 | ,pid1() | |
84 | ,pid2() | |
85 | #endif | |
86 | {} | |
87 | nPlets(int arg0,int arg1) : id0(arg0),id1(arg1),id2(-1),level(1),tanPhi(),tanLambda(),neighbours() | |
88 | #ifdef __DEBUG__ | |
89 | ,pid0() | |
90 | ,pid1() | |
91 | ,pid2() | |
92 | #endif | |
93 | {} | |
2cbb5f31 | 94 | int id0,id1,id2; |
95 | int level; | |
96 | float tanPhi,tanLambda; | |
97 | vector<int> neighbours; | |
a0c47fdb | 98 | #ifdef __DEBUG__ |
57a336dd | 99 | nPlets(int arg0,int arg1,int pd0,int pd1) : id0(arg0),id1(arg1),id2(-1),level(1),tanPhi(),tanLambda(),neighbours(),pid0(pd0),pid1(pd1),pid2(-1) {} |
100 | int pid0,pid1,pid2; | |
a0c47fdb | 101 | friend ostream& operator<<(ostream& out, const nPlets& cl) { |
102 | out << "id = (" << cl.id0 << ", " << cl.id1 << ", "<< cl.id2 <<")"<< endl; | |
57a336dd | 103 | out << "pid = (" << cl.pid0 << ", " << cl.pid1 << ", "<< cl.pid2 <<")"<< endl; |
a0c47fdb | 104 | out << "tanPhi="<< cl.tanPhi <<" tanLambda="<<cl.tanLambda << " level=" << cl.level <<endl; |
105 | out << "neighbours= "; | |
106 | for( unsigned int i = 0; i< cl.neighbours.size(); ++i ) out << cl.neighbours[i]; | |
107 | out << endl; | |
108 | return out; | |
109 | } | |
110 | #endif | |
2cbb5f31 | 111 | }; |
112 | ||
a0c47fdb | 113 | class trackC : public AliExternalTrackParam { |
57a336dd | 114 | public : |
115 | ||
116 | trackC() : AliExternalTrackParam(), | |
117 | fChi2( 0. ), | |
118 | fPoints(), | |
119 | fNPoints(0), | |
120 | fInnermostLayer(-1), | |
121 | fOutermostLayer(-1) | |
122 | { | |
123 | for ( unsigned int i = 0; i < 2*AliITSUAux::kMaxLayers; ++i ) fPoints[i]=-1; | |
124 | } | |
125 | ||
126 | trackC(const trackC ©) : AliExternalTrackParam(), | |
127 | fChi2(copy.fChi2), | |
128 | fPoints(), | |
129 | fNPoints(copy.fNPoints), | |
130 | fInnermostLayer(copy.fInnermostLayer), | |
131 | fOutermostLayer(copy.fOutermostLayer) | |
132 | { | |
133 | for ( unsigned int i = 0; i < 2*AliITSUAux::kMaxLayers; ++i ) fPoints[i]=copy.fPoints[i]; | |
134 | } | |
135 | ||
136 | trackC(int points[7]) : AliExternalTrackParam(), | |
137 | fChi2( 0. ), | |
138 | fPoints(), | |
139 | fNPoints( 0 ), | |
140 | fInnermostLayer( -1 ), | |
141 | fOutermostLayer( -1 ) | |
142 | { | |
143 | bool outer=false; | |
144 | for ( unsigned int i = 0; i < 2*AliITSUAux::kMaxLayers; ++i ) fPoints[i]=-1; | |
145 | for ( int i=6; i--; ) { | |
146 | if (points[i]!=-1) { | |
147 | if (! outer ) { | |
148 | outer = true; | |
149 | fOutermostLayer = points[i]; | |
150 | } | |
151 | fInnermostLayer = points[i]; | |
152 | ++fNPoints; | |
153 | } | |
154 | fPoints[i<<0x1] = points[i]; | |
155 | } | |
156 | } | |
157 | ||
158 | #ifdef __DEBUG__ | |
159 | friend ostream& operator<<(ostream& out, const trackC& cl) { | |
160 | out << "points = ("; | |
161 | for( unsigned int i = 0; i < 2*AliITSUAux::kMaxLayers; ++i ) | |
162 | out << cl.fPoints[i] << " "; | |
a0c47fdb | 163 | out << "), chi2: " << cl.fChi2 <<endl; |
57a336dd | 164 | const double* par = cl.GetParameter(); |
165 | const double* cov = cl.GetCovariance(); | |
a0c47fdb | 166 | out << "X: " << cl.GetX() << " Alpha: " << cl.GetAlpha() << endl; |
167 | out << "Param: \n"; | |
168 | for (int i=0;i<5;i++) out << par[i] << " "; out << endl; | |
169 | out << "Covar: \n"; | |
170 | int cnt = 0; | |
171 | for (int i=0;i<5;i++) {for (int j=i+1;j--;) out << cov[cnt++] << " "; out << endl;} | |
172 | return out; | |
173 | } | |
174 | #endif | |
57a336dd | 175 | void ResetPoints() { for(unsigned int i = 0; i < 2*AliITSUAux::kMaxLayers; ++i) fPoints[i]=-1; } |
176 | // | |
a0c47fdb | 177 | Double_t fChi2; |
57a336dd | 178 | Int_t fPoints[2*AliITSUAux::kMaxLayers]; |
179 | Int_t fNPoints; | |
180 | Int_t fInnermostLayer; | |
181 | Int_t fOutermostLayer; | |
182 | ||
a0c47fdb | 183 | }; |
184 | ||
57a336dd | 185 | struct CompDesc { //Adapted from TMath ROOT code |
186 | CompDesc(vector<trackC> *d) : fData(d) {} | |
a0c47fdb | 187 | |
57a336dd | 188 | bool operator()(int i1, int i2) { |
189 | return fData->at(i1).fChi2 > fData->at(i2).fChi2; | |
190 | } | |
191 | ||
192 | vector<trackC> *fData; | |
193 | }; | |
a0c47fdb | 194 | |
2cbb5f31 | 195 | #endif |