1 #ifndef ALIITSUTRACKERSAAUX_H
2 #define ALIITSUTRACKERSAAUX_H
8 #include "AliExternalTrackParam.h"
9 #include "AliITSUTrackCooked.h"
10 #include "AliITSUAux.h"
14 #include <Riostream.h>
18 //::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
20 struct Comparison { //Adapted from TMath ROOT code
21 Comparison(vector<T> *d) : fData(d) {}
23 bool operator()(int i1, int i2) {
24 return fData->at(i1).CmpVar() < fData->at(i2).CmpVar();
29 //::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
38 // Inlined standard constructor
41 Cell(int i1, int i2) : Level(1),
47 // Inlined standard constructor
52 Cell(int i1, int i2, int i3) : Level(1),
59 // Inlined standard constructor
69 vector<int> Neighbours;
73 //::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
75 SpacePoint(const float *xyz, const float &alpha) : XYZ(),
85 Cov[0]=Cov[1]=Cov[2]=99999.f;
88 SpacePoint(const SpacePoint &sp) : XYZ(),
95 for(int i=0; i<3; ++i) {
102 float CmpVar() const { return Phi; }
112 //::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
118 int operator()(const int &i) { return Index[i]; } // Just for compatibility with old code
119 SpacePoint& operator[](const int &i) { return Points[Index[i]]; }
120 ~Layer() { Clear(); }
122 void AddPoint(const float xyz[3], const float cov[3], const float &phi, const float &alpha) {
123 Index.push_back(N++);
124 Points.push_back(SpacePoint(xyz,alpha));
125 Points.back().Cov[0] = cov[0];
126 Points.back().Cov[1] = cov[1];
127 Points.back().Cov[2] = cov[2];
128 Points.back().Phi = phi;
132 Comparison<SpacePoint> cmp(&Points);
133 sort(Index.begin(),Index.end(),cmp);
144 vector<SpacePoint> Points;
147 //::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
150 Road() : Elements(), N(0), Label(-1) {
154 Road(int layer, int id) : Elements(), N(1), Label(-1) {
156 Elements[layer] = id;
159 Road(const Road& copy) : Elements(), N(copy.N), Label(copy.Label) {
160 for ( int i=0; i<5; ++i ) Elements[i] = copy.Elements[i];
163 int &operator[] (const int &i) {
167 void ResetElements() {
168 for ( int i=0; i<5; ++i )
172 void AddElement(int i, int el) {
182 // class AliITSUTrackCA : public AliITSUTrackCooked {
184 // AliITSUTrackCA() : AliITSUTrackCooked() {}
185 // AliITSUTrackCA(const AliITSUTrackCA &t) : AliITSUTrackCooked((AliITSUTrackCooked)t) {}
186 // AliITSUTrackCA(const AliESDtrack &t) : AliITSUTrackCooked(t) {}
187 // AliITSUTrackCA &operator=(const AliITSUTrackCooked &t);
188 // virtual ~AliITSUTrackCA();
189 // void SetChi2(Double_t chi2) { fChi2=chi2; }
190 // ClassDef(AliITSUTrackCA,1)
193 //::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
195 struct Comparison <AliITSUTrackCooked> {
196 Comparison(vector<AliITSUTrackCooked> *d) : fData(d) {}
198 bool operator()(int i1, int i2) {
199 return (fData->at(i1).GetChi2() < fData->at(i2).GetChi2());
201 vector<AliITSUTrackCooked> *fData;
204 // //::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
205 // class Candidate : public AliKalmanTrack {
208 // Candidate() : AliKalmanTrack(),
212 // fInnermostLayer(-1),
213 // fOutermostLayer(-1)
215 // for ( unsigned int i = 0; i < 2*AliITSUAux::kMaxLayers; ++i ) fPoints[i]=-1;
218 // Candidate(const Candidate ©) : AliExternalTrackParam(),
219 // fChi2(copy.fChi2),
221 // fNPoints(copy.fNPoints),
222 // fInnermostLayer(copy.fInnermostLayer),
223 // fOutermostLayer(copy.fOutermostLayer)
225 // for ( unsigned int i = 0; i < 2*AliITSUAux::kMaxLayers; ++i ) fPoints[i]=copy.fPoints[i];
228 // Candidate(int points[7]) : AliExternalTrackParam(),
232 // fInnermostLayer( -1 ),
233 // fOutermostLayer( -1 )
237 // for ( int i=6; i>=0; --i ) {
238 // if (points[i]!=-1) {
241 // fOutermostLayer = points[i];
243 // fInnermostLayer = points[i];
246 // fPoints[i<<0x1] = points[i];
250 // int GetClusterIndex(const int &i) const {
251 // return ((fInnermostLayer+i)<<28)+fPoints[(fInnermostLayer+i)<<0x1];
254 // Double_t CmpVar() const { return fChi2; }
256 // void ResetPoints() { for(unsigned int i = 0; i < 2*AliITSUAux::kMaxLayers; ++i) fPoints[i]=-1; }
258 // // Double_t fChi2;
259 // // Double_t fFakeRatio;
260 // Int_t fPoints[2*AliITSUAux::kMaxLayers];
261 // // Int_t fNPoints;
263 // Int_t fInnermostLayer;
264 // Int_t fOutermostLayer;