| 1 |
mocchiut |
1.1 |
/** |
| 2 |
|
|
* \file TrkLevel2.h |
| 3 |
|
|
* \author Elena Vannuccini |
| 4 |
|
|
*/ |
| 5 |
|
|
#ifndef trklevel2_h |
| 6 |
|
|
#define trklevel2_h |
| 7 |
|
|
|
| 8 |
|
|
#include <TObject.h> |
| 9 |
|
|
#include <TObjArray.h> |
| 10 |
|
|
#include <TClonesArray.h> |
| 11 |
pam-fi |
1.7 |
#include <TRefArray.h> |
| 12 |
pam-fi |
1.8 |
#include <TRef.h> |
| 13 |
pam-fi |
1.3 |
|
| 14 |
mocchiut |
1.1 |
#include <TrkStruct.h> |
| 15 |
pam-fi |
1.8 |
#include <TrkLevel1.h> |
| 16 |
mocchiut |
1.1 |
|
| 17 |
pam-fi |
1.2 |
// z-coordinate of track state-vector reference-plane |
| 18 |
|
|
#define ZINI 23.5 |
| 19 |
|
|
// upper and lower (mechanical) z-coordinate of the tracker |
| 20 |
pam-fi |
1.5 |
//#define ZTRKUP 22.29 |
| 21 |
|
|
//#define ZTRKDW -22.22 |
| 22 |
|
|
// (mechanical) z-coordinate of the tracker planes |
| 23 |
|
|
#define ZTRK6 -22.23 |
| 24 |
|
|
#define ZTRK5 -13.32 |
| 25 |
|
|
#define ZTRK4 -4.42 |
| 26 |
|
|
#define ZTRK3 4.48 |
| 27 |
|
|
#define ZTRK2 13.38 |
| 28 |
|
|
#define ZTRK1 22.28 |
| 29 |
|
|
// (mechanical) x/y-coordinates of magnet cavity |
| 30 |
|
|
#define XTRKL -8.1 |
| 31 |
|
|
#define XTRKR 8.1 |
| 32 |
|
|
#define YTRKL -6.6 |
| 33 |
|
|
#define YTRKR 6.6 |
| 34 |
pam-fi |
1.2 |
|
| 35 |
mocchiut |
1.1 |
/** |
| 36 |
|
|
* \brief Class to describe, by points, a particle trajectory in the apparatus. |
| 37 |
|
|
* |
| 38 |
|
|
* The idea is to create it by integrating the equations of motion, given the |
| 39 |
|
|
* track state vector and the z coordinates where to evaluate track position. |
| 40 |
|
|
*/ |
| 41 |
|
|
// ================================================================== |
| 42 |
|
|
class Trajectory : public TObject{ |
| 43 |
|
|
private: |
| 44 |
|
|
|
| 45 |
|
|
public: |
| 46 |
|
|
|
| 47 |
|
|
int npoint; ///< number of evaluated points along the trajectory |
| 48 |
|
|
float* x; ///< x coordinates |
| 49 |
|
|
float* y; ///< y coordinates |
| 50 |
|
|
float* z; ///< z coordinates |
| 51 |
pam-fi |
1.2 |
float* thx; ///< x projected angle |
| 52 |
|
|
float* thy; ///< y projected angle |
| 53 |
|
|
float* tl; ///< track length |
| 54 |
mocchiut |
1.1 |
|
| 55 |
pam-fi |
1.2 |
Trajectory(); |
| 56 |
mocchiut |
1.1 |
Trajectory(int n); |
| 57 |
|
|
Trajectory(int n, float* pz); |
| 58 |
|
|
void Dump(); |
| 59 |
|
|
|
| 60 |
pam-fi |
1.2 |
float GetLength(){float l=0; for(int i=0; i<npoint;i++)l=l+tl[i]; return l;}; |
| 61 |
|
|
float GetLength(int,int); |
| 62 |
|
|
|
| 63 |
mocchiut |
1.1 |
ClassDef(Trajectory,1); |
| 64 |
|
|
|
| 65 |
|
|
}; |
| 66 |
|
|
/** |
| 67 |
|
|
* \brief Class to describe fitted tracks. |
| 68 |
|
|
* |
| 69 |
|
|
* A track is defined by the measured coordinates associated to it, the |
| 70 |
|
|
* track status vector, plus other quantities. |
| 71 |
|
|
* A track may have an "image", due to the ambiguity in the y view. |
| 72 |
|
|
*/ |
| 73 |
|
|
// ================================================================== |
| 74 |
|
|
class TrkTrack : public TObject { |
| 75 |
|
|
|
| 76 |
|
|
private: |
| 77 |
|
|
|
| 78 |
pam-fi |
1.3 |
int seqno; ///<stored track sequential number |
| 79 |
|
|
int image; ///<sequential number of track-image |
| 80 |
|
|
|
| 81 |
pam-fi |
1.8 |
|
| 82 |
mocchiut |
1.1 |
public: |
| 83 |
|
|
|
| 84 |
pam-fi |
1.8 |
// TRef clx[6]; |
| 85 |
|
|
// TRef cly[6]; |
| 86 |
|
|
TRefArray *clx; |
| 87 |
|
|
TRefArray *cly; |
| 88 |
pam-fi |
1.3 |
|
| 89 |
mocchiut |
1.1 |
float al[5]; ///<TRACK STATE VECTOR |
| 90 |
|
|
float coval[5][5]; ///<covariance matrix |
| 91 |
|
|
int xgood[6]; ///<mask of included x planes |
| 92 |
|
|
int ygood[6]; ///<mask of included y planes |
| 93 |
|
|
float xm[6]; ///<measured x coordinates |
| 94 |
|
|
float ym[6]; ///<measured y coordinates |
| 95 |
|
|
float zm[6]; ///<measured z coordinates |
| 96 |
|
|
float resx[6]; ///<spatial resolution on X view |
| 97 |
|
|
float resy[6]; ///<spatial resolution on y view |
| 98 |
|
|
float chi2; ///<chi2 |
| 99 |
|
|
float xv[6]; ///<calculated x coordinates |
| 100 |
|
|
float yv[6]; ///<calculated y coordinates |
| 101 |
|
|
float zv[6]; ///<calculated z coordinates |
| 102 |
|
|
float axv[6]; ///<calculated angles (deg) on x view |
| 103 |
|
|
float ayv[6]; ///<calculated angles (deg) on y view |
| 104 |
|
|
float dedx_x[6]; ///<signal in MIP (scaled to 300 micrometer) |
| 105 |
|
|
float dedx_y[6]; ///<signal in MIP (scaled to 300 micrometer) |
| 106 |
pam-fi |
1.3 |
|
| 107 |
mocchiut |
1.1 |
|
| 108 |
|
|
TrkTrack(); |
| 109 |
|
|
TrkTrack(const TrkTrack&); |
| 110 |
|
|
|
| 111 |
|
|
void Dump(); |
| 112 |
|
|
|
| 113 |
pam-fi |
1.3 |
Int_t GetSeqNo(){return seqno;} ///< Returns the track sequential number |
| 114 |
|
|
Int_t GetImageSeqNo(){return image;} ///< Returns the track image sequential number |
| 115 |
mocchiut |
1.1 |
Bool_t HasImage(){return !(image==-1);} ///< Returns true if the track has an image |
| 116 |
pam-fi |
1.2 |
int DoTrack(Trajectory* t); ///< Evaluates the trajectory in the apparatus. |
| 117 |
|
|
int DoTrack2(Trajectory* t); ///< Evaluates the trajectory in the apparatus. |
| 118 |
|
|
float BdL(){return 0;}; ///< Evaluates the integral of B*dL along the track. |
| 119 |
mocchiut |
1.1 |
Int_t GetNX(){Int_t n=0; for(Int_t i=0; i<6; i++)n+=xgood[i]; return n;}; |
| 120 |
|
|
Int_t GetNY(){Int_t n=0; for(Int_t i=0; i<6; i++)n+=ygood[i]; return n;}; |
| 121 |
pam-fi |
1.3 |
Int_t GetNtot(){return GetNX()+GetNY();}; |
| 122 |
mocchiut |
1.1 |
Float_t GetRigidity(); |
| 123 |
|
|
Float_t GetDeflection(); |
| 124 |
|
|
Float_t GetDEDX(); |
| 125 |
|
|
|
| 126 |
pam-fi |
1.8 |
TrkCluster *GetClusterX(int ip){TrkCluster *pt = (TrkCluster*)(clx->At(ip)); return pt;}; |
| 127 |
|
|
TrkCluster *GetClusterY(int ip){TrkCluster *pt = (TrkCluster*)(cly->At(ip)); return pt;}; |
| 128 |
|
|
|
| 129 |
mocchiut |
1.1 |
TrkTrack* GetTrkTrack(){return this;}; |
| 130 |
|
|
|
| 131 |
pam-fi |
1.3 |
friend class TrkLevel2; |
| 132 |
|
|
|
| 133 |
mocchiut |
1.1 |
ClassDef(TrkTrack,1); |
| 134 |
|
|
|
| 135 |
|
|
}; |
| 136 |
|
|
/** |
| 137 |
|
|
* \brief Class to describe single clusters ("singlets"). |
| 138 |
|
|
* |
| 139 |
|
|
* Single clusters are clusters not associated to any track. |
| 140 |
|
|
*/ |
| 141 |
|
|
class TrkSinglet : public TObject { |
| 142 |
|
|
|
| 143 |
|
|
private: |
| 144 |
pam-fi |
1.8 |
|
| 145 |
mocchiut |
1.1 |
|
| 146 |
|
|
public: |
| 147 |
pam-fi |
1.8 |
|
| 148 |
|
|
TRef cls; |
| 149 |
mocchiut |
1.1 |
|
| 150 |
|
|
int plane; ///<plane |
| 151 |
|
|
float coord[2]; ///<coordinate (on sensor 1 and 2) |
| 152 |
|
|
float sgnl; ///<cluster signal in MIP |
| 153 |
|
|
|
| 154 |
|
|
TrkSinglet(); |
| 155 |
|
|
TrkSinglet(const TrkSinglet&); |
| 156 |
|
|
|
| 157 |
|
|
void Dump(); |
| 158 |
pam-fi |
1.8 |
|
| 159 |
|
|
TrkCluster *GetCluster(){TrkCluster *pt = (TrkCluster*)cls.GetObject(); return pt;}; |
| 160 |
mocchiut |
1.1 |
|
| 161 |
pam-fi |
1.3 |
friend class TrkLevel2; |
| 162 |
|
|
|
| 163 |
mocchiut |
1.1 |
ClassDef(TrkSinglet,1); |
| 164 |
|
|
|
| 165 |
|
|
}; |
| 166 |
|
|
|
| 167 |
|
|
/** |
| 168 |
|
|
* \brief Class to describe tracker LEVEL2 data. |
| 169 |
|
|
* |
| 170 |
|
|
* A tracker events is defined by some general variables, plus the collection of all the fitted tracks and all |
| 171 |
|
|
* single clusters on X and Y views. |
| 172 |
|
|
* Tracks and single clusters ("singlets") are described by the classes TrkTrack and TrkSinglet respectivelly. |
| 173 |
|
|
* |
| 174 |
|
|
* Each track may have an "image", due to the ambiguity on the Y view, which is stored also. |
| 175 |
|
|
* Thus, the number of stored tracks ( ntrk() ) differs from the number of "physical" tracks ( GetNTracks() ). |
| 176 |
|
|
* Proper methods allow to sort tracks and select the physical ones ( GetTracks() ). |
| 177 |
|
|
*/ |
| 178 |
|
|
class TrkLevel2 : public TObject { |
| 179 |
|
|
|
| 180 |
|
|
private: |
| 181 |
pam-fi |
1.5 |
|
| 182 |
|
|
// TRefArray *PhysicalTrack; ///< physical tracks (no image) - |
| 183 |
|
|
|
| 184 |
mocchiut |
1.1 |
public: |
| 185 |
|
|
|
| 186 |
|
|
Int_t good2; |
| 187 |
|
|
Int_t crc[12]; |
| 188 |
|
|
|
| 189 |
|
|
TClonesArray *Track; ///< fitted tracks |
| 190 |
|
|
TClonesArray *SingletX; ///< x singlets |
| 191 |
|
|
TClonesArray *SingletY; ///< y singlets |
| 192 |
|
|
|
| 193 |
|
|
TrkLevel2(); |
| 194 |
|
|
// TrkLevel2(cTrkLevel2 *); |
| 195 |
|
|
|
| 196 |
pam-fi |
1.5 |
int ntrk() {return Track->GetEntries();} ///< number of stored track |
| 197 |
mocchiut |
1.1 |
int nclsx(){return SingletX->GetEntries();} ///< number of x singlets |
| 198 |
|
|
int nclsy(){return SingletY->GetEntries();} ///< number of y singlets |
| 199 |
|
|
|
| 200 |
|
|
void Dump(); |
| 201 |
pam-fi |
1.6 |
void SetFromLevel2Struct(cTrkLevel2 *); |
| 202 |
pam-fi |
1.8 |
void SetFromLevel2Struct(cTrkLevel2 *, TrkLevel1 *); |
| 203 |
|
|
void GetLevel2Struct(cTrkLevel2 *) const; |
| 204 |
mocchiut |
1.1 |
void Clear(); |
| 205 |
pam-fi |
1.3 |
void LoadField(TString); |
| 206 |
pam-fi |
1.6 |
Float_t GetZTrk(Int_t); |
| 207 |
|
|
Float_t GetXTrkLeft(){return XTRKL;}; |
| 208 |
|
|
Float_t GetXTrkRight(){return XTRKR;}; |
| 209 |
|
|
Float_t GetYTrkLeft(){return YTRKL;}; |
| 210 |
|
|
Float_t GetYTrkRight(){return YTRKR;}; |
| 211 |
|
|
|
| 212 |
|
|
TrkSinglet *GetSingletX(int); |
| 213 |
|
|
TrkSinglet *GetSingletY(int); |
| 214 |
|
|
|
| 215 |
|
|
TrkTrack *GetStoredTrack(int i); |
| 216 |
pam-fi |
1.3 |
Int_t GetSeqNo(Int_t i) {return (((TrkTrack *)Track->At(i))->seqno);}; ///< Returns track sequential number |
| 217 |
pam-fi |
1.5 |
// TClonesArray *GetTracks_Chi2Sorted(); |
| 218 |
pam-fi |
1.7 |
// TClonesArray *GetTracks_NFitSorted(); |
| 219 |
|
|
// TClonesArray *GetTracks(); |
| 220 |
|
|
TRefArray *GetTracks_NFitSorted(); |
| 221 |
|
|
TRefArray *GetTracks(){return this->GetTracks_NFitSorted();}; |
| 222 |
mocchiut |
1.1 |
|
| 223 |
pam-fi |
1.4 |
// int GetNTracks(){return this->GetTracks()->GetEntries();} |
| 224 |
|
|
Int_t GetNTracks(); |
| 225 |
|
|
TrkTrack* GetTrack(int i); |
| 226 |
mocchiut |
1.1 |
TrkTrack* GetTrackImage(int i); |
| 227 |
|
|
|
| 228 |
pam-fi |
1.3 |
TrkLevel2* GetTrkLevel2(){return this;} |
| 229 |
|
|
TClonesArray* GetTrackArray(){return Track;};///< returns pointer to the track array |
| 230 |
|
|
|
| 231 |
mocchiut |
1.1 |
ClassDef(TrkLevel2,1); |
| 232 |
|
|
|
| 233 |
|
|
}; |
| 234 |
|
|
|
| 235 |
|
|
#endif |