00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012 #ifndef Laser_Event
00013 #define Laser_Event
00015 // //
00016
00017
00018
00019
00020
00021
00022
00024
00025 #include "TObject.h"
00026 #include "TClonesArray.h"
00027 #include "TMath.h"
00028 #include "LaserBeams.h"
00029 #include "Stiostream.h"
00030 #include "StThreeVectorF.hh"
00031 #include "StHelixModel.h"
00032 #include "TString.h"
00033 #include "TGeoMatrix.h"
00034 #ifdef __CINT__
00035 class StPrimaryVertex;
00036 class StTrack;
00037 class StTpcHit;
00038 #else
00039 #include "StPrimaryVertex.h"
00040 #include "StTrack.h"
00041 #include "StTpcHit.h"
00042 #endif
00043 class LaserRaft : public TObject {
00044 public:
00045 LaserRaft() {}
00046 Int_t Sector, Raft, Bundle, Mirror;
00047 StThreeVectorD XyzL, dirL;
00048 StThreeVectorD XyzU, dirU;
00049 StThreeVectorD XyzB, dirB;
00050
00051 Double_t Theta, Phi;
00052
00053 Char_t *Name;
00054 virtual void Print(const Option_t* opt="") const {
00055 cout << Form("Raft:%2i,%2i,%1i,%1i,%9.4f,%9.4f",
00056 Sector, Raft, Bundle, Mirror, Theta, Phi) << endl;
00057 cout << " XyzL: " << XyzL << " U: " << XyzU << " B: " << XyzB << endl;
00058 cout << " dirL: " << dirL << " U: " << dirU << " B: " << dirB << endl;
00059 }
00060 ClassDef(LaserRaft,1)
00061 };
00062 class FitDV : public TObject {
00063 public:
00064 FitDV() {Clear();}
00065 virtual ~FitDV() {}
00066 void Clear(Option_t *opt="") {memset(first, 0, last - first); chisq = -1;}
00067 Char_t first[1];
00068 Int_t N;
00069 Int_t Sector;
00070 Int_t Bundle[42];
00071 Int_t Mirror[42];
00072 Double32_t offset;
00073 Double32_t slope;
00074 Double32_t doffset;
00075 Double32_t dslope;
00076 Double32_t chisq;
00077 Double32_t X[42];
00078 Double32_t Y[42];
00079 Double32_t Prob;
00080 Int_t ndf;
00081 Int_t Flag[42];
00082 Char_t last[1];
00083 virtual void Print(const Option_t* opt="") const {
00084 cout << Form("FitDV:%5i,%2i,%9.4f,%9.4f,%9.4f,%9.4f,%9.4f",
00085 N, Sector, offset, slope, doffset, dslope, chisq)
00086 << endl;
00087
00088 }
00089 ClassDef(FitDV,1)
00090 };
00091
00092 class LaserB {
00093 public:
00094 LaserB(const LaserRaft &laser);
00095 LaserB() : IsValid(1), Sector(0), Raft(0), Bundle(0), Mirror(0),
00096 Theta(0), Phi(0), ThetaG(0), PhiG(0) {}
00097 virtual ~LaserB() {}
00098 Int_t IsValid;
00099 Int_t Sector, Raft, Bundle, Mirror;
00100 StThreeVectorD XyzG;
00101 StThreeVectorD XyzL;
00102 StThreeVectorD XyzU;
00103 StThreeVectorD XyzB;
00104 StThreeVectorD dirG;
00105 StThreeVectorD dirL;
00106 StThreeVectorD dirU;
00107 StThreeVectorD dirB;
00108 Double_t Theta, Phi;
00109 Double_t ThetaG, PhiG;
00110 virtual void Print(const Option_t* opt="") const {
00111 cout << "LaserB:" << IsValid << " S/R/B/M = " << Sector << "/" << Raft << "/" << Bundle << "/" << Mirror
00112 << " xyz B:" << XyzB << " U: " << XyzU << " L: " << XyzL << " G: " << XyzG << endl;
00113 cout << "\tdir B:" << dirB << " U: " << dirU << " L: " << dirL << " G: " << dirG << endl;
00114 cout << "\tTheta L: " << Theta << " G: " << ThetaG << " Phi L: " << Phi << " G: " << PhiG
00115 << endl;
00116 }
00117 ClassDef(LaserB,2)
00118 };
00119
00120 class EventHeader {
00121
00122 private:
00123 Int_t fEvtNum;
00124 Int_t fRun;
00125 Int_t fDate;
00126 Int_t fTime;
00127 Float_t ftZero;
00128 Float_t fDriVel;
00129 public:
00130 Float_t fDriVelWest;
00131 Float_t fDriVelEast;
00132 private:
00133 Float_t fClock;
00134 Float_t fTrigger;
00135 Float_t fDriftDistance;
00136 Float_t fInnerSectorzOffset;
00137 Float_t fOuterSectorzOffset;
00138 Float_t ftriggerTimeOffset;
00139 Float_t fOnlClock;
00140 public:
00141 EventHeader() : fEvtNum(0), fRun(0), fDate(0), fTime(0), fOnlClock(0) { }
00142 virtual ~EventHeader() { }
00143 void Set(Int_t i, Int_t r, Int_t d, Int_t t) { fEvtNum = i; fRun = r; fDate = d; fTime = t; }
00144 void SetE(Float_t tz, Float_t dv, Float_t ck) {
00145 ftZero = tz; fDriVel = dv; fClock = ck; }
00146 void SetE(Float_t tz, Float_t dv, Float_t ck, Float_t tg) {
00147 ftZero = tz; fDriVel = dv; fClock = ck; fTrigger = tg; }
00148 void SetDriftDistance(Double_t p) {fDriftDistance = p;}
00149 void SetInnerSectorzOffset(Double_t p) {fInnerSectorzOffset= p;}
00150 void SetOuterSectorzOffset(Double_t p) {fOuterSectorzOffset= p;}
00151 void SettriggerTimeOffset(Double_t p) {ftriggerTimeOffset= p;}
00152 void SetOnlClock(Double_t p) {fOnlClock = p;}
00153 Int_t GetEvtNum() const { return fEvtNum; }
00154 Int_t GetRun() const { return fRun; }
00155 Int_t GetDate() const { return fDate; }
00156 Int_t GetTime() const { return fTime; }
00157 Float_t tZeor() {return ftZero;}
00158 Float_t DriftVel() {return fDriVel;}
00159 Float_t Clock() {return fClock;}
00160 Float_t OnlClock() {return fOnlClock;}
00161 Float_t Trigger() {return fTrigger;}
00162 Float_t DriftDistance() {return fDriftDistance;}
00163 Float_t InnerSectorzOffset() {return fInnerSectorzOffset;}
00164 Float_t OuterSectorzOffset() {return fOuterSectorzOffset;}
00165 Float_t triggerTimeOffset() {return ftriggerTimeOffset;}
00166
00167 ClassDef(EventHeader,1)
00168 };
00169 class Vertex : public TObject {
00170 public:
00171 Vertex(StPrimaryVertex *vertex=0);
00172 virtual ~Vertex() {}
00173 StVertexId mType;
00174 Int_t WestEast;
00175 StThreeVectorD Xyz;
00176 StThreeVectorD XyzL;
00177 UInt_t numberOfDaughter;
00178 virtual void Print(const Option_t* opt="") const {
00179 cout << "Vertex: WE = " << WestEast << " XYZ L: " << XyzL << " G: " << Xyz << " Nd " << numberOfDaughter << endl;
00180 }
00181 ClassDef(Vertex,1)
00182 };
00183 class Hit : public TObject {
00184 public:
00185 Hit(StTpcHit *tpcHit=0);
00186 virtual ~Hit() {}
00187 UShort_t sector;
00188 UShort_t row;
00189 Float_t charge;
00190 UInt_t flag;
00191 Int_t usedInFit;
00192 StThreeVectorF xyz;
00193 StThreeVectorF xyzL;
00194 Float_t pad;
00195 Float_t tbk;
00196 ClassDef(Hit,2)
00197 };
00198 class Track : public TObject {
00199 public:
00200 Int_t Flag;
00201
00202 StVertexId mType;
00203 StThreeVectorD Vertex;
00204
00205 Int_t mSector;
00206 Int_t mKey;
00207 Short_t mFlag;
00208 UShort_t mNumberOfPossiblePointsTpc;
00209 Float_t mImpactParameter;
00210 Float_t mLength;
00211
00212 UShort_t mNumberOfFitPointsTpc;
00213 UShort_t mPrimaryVertexUsedInFit;
00214 #if 1
00215 Int_t fNdEdx;
00216 Float_t fdEdx;
00217 #endif
00218 StHelixModel fgeoIn;
00219 StHelixModel fgeoOut;
00220 Double32_t fpTInv;
00221 Double32_t fTheta;
00222 Double32_t fPhi;
00223 StThreeVectorD XyzP;
00224 StThreeVectorD XyzPL;
00225 StThreeVectorD XyzPU;
00226 StThreeVectorD XyzPB;
00227 StThreeVectorD XyzPM;
00228 StThreeVectorD dirP;
00229 StThreeVectorD dirPL;
00230 StThreeVectorD dirPU;
00231 StThreeVectorD dirPB;
00232 StThreeVectorD dirPM;
00233 StThreeVectorD dU;
00234 Double32_t thePath;
00235 LaserB Laser;
00236 Double32_t dPhi;
00237 Double32_t dTheta;
00238 #if 0
00239 FitDV fit;
00240 #endif
00241 Double32_t zLastHit;
00242 public:
00243 Track() {};
00244 Track(Int_t sector, StTrack *track, LaserB *laser = 0, Double_t z=0);
00245 virtual ~Track() { }
00246 Int_t Matched();
00247 void SetPredictions(TGeoHMatrix *Raft2Tpc = 0, TGeoHMatrix *Bundle2Tpc = 0, TGeoHMatrix *Mirror2Tpc = 0);
00248 virtual void Print(const Option_t* opt="") const {
00249 cout << "Track F: " << Flag << " Vtx: " << Vertex << " Sec/Key = " << mSector << "/" << mKey << endl;
00250 cout << "\tgeoIn pxyz " << fgeoIn.momentum() << " geoIn xyz " << fgeoIn.origin() << endl;
00251 cout << "\tgeoOut pxyz " << fgeoOut.momentum() << " geoOut xyz " << fgeoOut.origin() << endl;
00252 cout << "\tTheta " << fTheta << " Phi " << fPhi << endl;
00253 cout << "\tXyzP M " << XyzPM << " B: " << XyzPB << " U: " << XyzPU << " L: " << XyzPL << " G: " << XyzP << endl;
00254 cout << "\tdirP M " << dirPM << " B: " << dirPB << " U: " << dirPU << " L: " << dirPL << " G: " << dirP << endl;
00255 cout << "\tdU : " << dU << endl;
00256 Laser.Print();
00257 cout << "\tdTheta " << dTheta << " dPhi " << dPhi << endl;
00258 }
00259 ClassDef(Track,2)
00260 };
00261 class LaserEvent : public TObject {
00262
00263 private:
00264 Int_t fNtrack;
00265 Int_t fNhit;
00266 Int_t fNvertex;
00267 EventHeader fEvtHdr;
00268 TClonesArray *fVertices;
00269 TClonesArray *fTracks;
00270 TClonesArray *fHits;
00271 TClonesArray *fFit;
00272 public:
00273 TClonesArray *Vertices(){return fVertices;}
00274 TClonesArray *Tracks() {return fTracks;}
00275 TClonesArray *Hits() {return fHits;}
00276 TClonesArray *Fit() {return fFit;}
00277
00278 private:
00279 static TClonesArray *fgTracks;
00280 static TClonesArray *fgHits;
00281 static TClonesArray *fgVertices;
00282 static TClonesArray *fgFit;
00283 public:
00284 LaserEvent();
00285 virtual ~LaserEvent();
00286 void Clear(Option_t *option ="");
00287 static void Reset();
00288 void SetNtrack(Int_t n) { fNtrack = n; }
00289 void SetNhit(Int_t n) { fNhit = n; }
00290 void SetHeader(Int_t i, Int_t run, Int_t date, Int_t time);
00291 void SetHeader(Int_t i, Int_t run, Int_t date, Int_t time,
00292 Float_t tzero, Float_t drivel, Float_t clock);
00293 void SetHeader(Int_t i, Int_t run, Int_t date, Int_t time,
00294 Float_t tzero, Float_t drivel, Float_t clock, Float_t trigger);
00295 void SetDVWest(Float_t dv) {fEvtHdr.fDriVelWest = dv;}
00296 void SetDVEast(Float_t dv) {fEvtHdr.fDriVelEast = dv;}
00297 Vertex *AddVertex(StPrimaryVertex *vertex = 0);
00298 Track *AddTrack(Int_t sector = 0, StTrack *track = 0, LaserB *laser = 0, Double_t zLastHit=0);
00299 Hit *AddHit(StTpcHit *tpcHit = 0);
00300 void AddTrackFit(Track *t = 0);
00301 Int_t GetNtrack() const { return fNtrack; }
00302 Int_t GetNhit() const { return fNhit; }
00303 EventHeader *GetHeader() { return &fEvtHdr; }
00304 TClonesArray *GetTracks() const { return fTracks; }
00305 TClonesArray *GetHits() const { return fHits; }
00306 ClassDef(LaserEvent,2)
00307 };
00308
00309 #endif