--- DarthVader/TrackerLevel2/inc/TrkLevel2.h 2007/03/28 09:27:58 1.21 +++ DarthVader/TrackerLevel2/inc/TrkLevel2.h 2009/03/11 14:19:09 1.42 @@ -11,27 +11,38 @@ #include #include -//#include #include #include // z-coordinate of track state-vector reference-plane #define ZINI 23.5 -// upper and lower (mechanical) z-coordinate of the tracker -//#define ZTRKUP 22.29 -//#define ZTRKDW -22.22 // (mechanical) z-coordinate of the tracker planes -#define ZTRK6 -22.23 -#define ZTRK5 -13.32 -#define ZTRK4 -4.42 -#define ZTRK3 4.48 -#define ZTRK2 13.38 -#define ZTRK1 22.28 +#define ZTRK6 -22.22 +#define ZTRK5 -13.31 +#define ZTRK4 -4.41 +#define ZTRK3 4.49 +#define ZTRK2 13.39 +#define ZTRK1 22.29 +// magnet cavity dimensions +#define ZMAGNHIGH 21.83 +#define ZMAGNLOW -21.83 +#define XMAGNHIGH 8.07 +#define XMAGNLOW -8.07 +#define YMAGNHIGH 6.57 +#define YMAGNLOW -6.57 +// tof planes +#define ZS11 53.74 +#define ZS12 53.04 +#define ZS21 23.94 +#define ZS22 23.44 +#define ZS31 -23.49 +#define ZS32 -24.34 + // (mechanical) x/y-coordinates of magnet cavity -#define XTRKL -8.1 -#define XTRKR 8.1 -#define YTRKL -6.6 -#define YTRKR 6.6 +/* #define XTRKL -8.1 */ +/* #define XTRKR 8.1 */ +/* #define YTRKL -6.6 */ +/* #define YTRKR 6.6 */ /** * \brief Class to describe, by points, a particle trajectory in the apparatus. @@ -46,12 +57,12 @@ public: int npoint; ///< number of evaluated points along the trajectory - float* x; ///< x coordinates - float* y; ///< y coordinates - float* z; ///< z coordinates - float* thx; ///< x projected angle - float* thy; ///< y projected angle - float* tl; ///< track length + float* x; //[npoint] + float* y; //[npoint] + float* z; //[npoint] + float* thx; //[npoint] + float* thy; //[npoint] + float* tl; //[npoint] Trajectory(); Trajectory(int n); @@ -60,11 +71,16 @@ void Dump(); void Delete(); - int DoTrack2(float* al); + int DoTrack(float* al, float zini); + int DoTrack(float* al){ return DoTrack(al,23.5); }; + + int DoTrack2(float* al, float zini); + int DoTrack2(float* al){ return DoTrack2(al,23.5); }; + float GetLength(){float l=0; for(int i=0; i 0;}; - Bool_t YGood(int ip){ return ygood[ip]> 0;}; - + Float_t GetDEDX(int ip); + Float_t GetDEDX(int ip,int iv); + Int_t GetLeverArmXY(); + Int_t GetLeverArmX(); + Int_t GetLeverArmY(); + Float_t GetChi2X(); + Float_t GetChi2Y(); + Float_t GetLnLX(); + Float_t GetLnLY(); + Float_t GetEffectiveAngle(int ip, int iv); + void SetMeasure(double *xmeas, double *ymeas, double *zmeas); void SetResolution(double *rx, double *ry); + void SetTail(double *tx, double *ty, double factor); + void SetStudentParam(int flag); void SetGood(int *xg, int *yg); void LoadField(TString s); - void Fit(double pfixed, int& fail, int iprint); + void Fit(double pfixed, int& fail, int iprint, int froml1); + void Fit(double pfixed, int& fail, int iprint){ Fit(pfixed,fail,iprint,0); }; void FitReset(); void SetTrackingMode(int trackmode); void SetPrecisionFactor(double fact); void SetStepMin(int istepmin); + void SetDeltaB(int id, double db); + + Bool_t IsInsideCavity(float); + Bool_t IsInsideCavity(){ return IsInsideCavity(0.); }; + Bool_t IsInsideAcceptance(float); + Bool_t IsInsideAcceptance(){ return IsInsideAcceptance(0.); }; + Bool_t IsInsideGFSurface(const char*,float); + Bool_t IsInsideGFSurface(const char* surf){ return IsInsideGFSurface(surf,0.); }; + + Bool_t EvaluateClusterPositions(); void FillMiniStruct(cMini2track&); void SetFromMiniStruct(cMini2track*); - TrkCluster *GetClusterX(int ip); - TrkCluster *GetClusterY(int ip); - - Int_t GetClusterX_ID(int ip){return xgood[ip];}; - Int_t GetClusterY_ID(int ip){return ygood[ip];}; + Int_t GetClusterX_ID(int ip); + Int_t GetClusterY_ID(int ip); + Int_t GetLadder(int ip); + Int_t GetSensor(int ip); + Bool_t XGood(int ip){ return GetClusterX_ID(ip)!=-1; }; + Bool_t YGood(int ip){ return GetClusterY_ID(ip)!=-1; }; + void ResetXGood(int ip){ xgood[ip]=0; }; + void ResetYGood(int ip){ ygood[ip]=0; }; +/* void SetXGood(int ip, int clid, int is); */ +/* void SetYGood(int ip, int clid, int is); */ + void SetXGood(int ip, int clid, int il, int is, bool bad); + void SetYGood(int ip, int clid, int il, int is, bool bad); + void SetXGood(int ip, int clid, int il, int is){ SetXGood(ip,clid,il,is,false); }; + void SetYGood(int ip, int clid, int il, int is){ SetYGood(ip,clid,il,is,false); }; + + + Bool_t BadClusterX(int ip){ return IsBad(ip,0); }; + Bool_t BadClusterY(int ip){ return IsBad(ip,1); }; + + Bool_t SaturatedClusterX(int ip){ return IsSaturated(ip,0); }; + Bool_t SaturatedClusterY(int ip){ return IsSaturated(ip,1); }; + + Int_t GetClusterX_Multiplicity(int ip){ return (Int_t)(multmaxx[ip]/10000); }; + Int_t GetClusterY_Multiplicity(int ip){ return (Int_t)(multmaxy[ip]/10000); }; + Int_t GetClusterX_MaxStrip(int ip){ return (Int_t)(multmaxx[ip]%10000); }; + Int_t GetClusterY_MaxStrip(int ip){ return (Int_t)(multmaxy[ip]%10000); }; + Float_t GetClusterX_Seed(int ip){ return seedx[ip]; }; + Float_t GetClusterY_Seed(int ip){ return seedy[ip]; }; +/* Float_t GetClusterX_oordinatePU(int ip); */ +/* Float_t GetClusterY_CoordinatePU(int ip); */ + Float_t GetYav(); + Float_t GetXav(); + Float_t GetZav(); + + Int_t GetNColumns(); + + Float_t GetDEDX_max(int ip, int iv); + Float_t GetDEDX_max(int iv){ return GetDEDX_max(-1,iv); }; + Float_t GetDEDX_max(){ return GetDEDX_max(-1,-1); }; + Float_t GetDEDX_min(int ip, int iv); + Float_t GetDEDX_min(int iv){ return GetDEDX_min(-1,iv); }; + Float_t GetDEDX_min(){ return GetDEDX_min(-1,-1); }; + + Float_t GetResidual_max(int ip, int iv); + Float_t GetResidual_max(int iv){ return GetResidual_max(-1,iv); }; + Float_t GetResidual_max(){ return GetResidual_max(-1,-1); }; + Float_t GetResidual_av(int ip, int iv); + Float_t GetResidual_av(int iv){ return GetResidual_av(-1,iv); }; + Float_t GetResidual_av(){ return GetResidual_av(-1,-1); }; + + Int_t GetClusterX_Multiplicity_max(); + Int_t GetClusterX_Multiplicity_min(); + Int_t GetClusterY_Multiplicity_max(); + Int_t GetClusterY_Multiplicity_min(); + + Float_t GetClusterX_Seed_min(); + Float_t GetClusterY_Seed_min(); + TrkTrack* GetTrkTrack(){return this;}; friend class TrkLevel2; - ClassDef(TrkTrack,2); + ClassDef(TrkTrack,5); }; /** @@ -179,11 +284,10 @@ public: - TRef cls; - int plane; /// 0 missing packet + * 1 CRC error + * 2 on-line software alarm (latch-up, timeout ecc...) + * 3 jump in the trigger counter + * 4 decode error + * 5 n.clusters > maximum number (level1 processing) + * 6 + * 7 + * 8 n.clusters > maximum value (level2 processing) + * 9 n.couples per plane > maximum values (vector dimention) + * 10 n.doublets > maximum values + * 11 n.triplets > maximum values + * 12 n.yz-clouds > maximum values + * 13 n.xz-clouds > maximum values + * 14 n.candidate-tracks > maximum values + * 15 n.couples per plane > maximum values (for Hough transform) + * MSB --> 16 + * + * + * For all data processed before June 2007 the event status was coded according to + * a different rule: + * + * Status of level1 processing + * 0 -- OK + * 1 -- missing packet + * 2 -- 1 CRC error + * 3 -- 2 on-line software alarm (latch-up flags asserted or n.transmitted-words = 0) + * 4 -- 3 jump in the trigger counter + * 10 -- 4 decode error + * 11 -- 5 n.clusters > maximum number (for level1 processing) + * Status of level2 processing + * 21 -- 0 n.clusters > maximum value (for level2 processing) + * 22 -- 1 n.couples per plane > maximum values (vector dimention) + * 23 -- 2 n.doublets > maximum values + * 24 -- 3 n.triplets > maximum values + * 25 -- 4 n.yz-clouds > maximum values + * 26 -- 5 n.xz-clouds > maximum values + * 27 -- 6 n.candidate-tracks > maximum values + * 28 -- 7 n.couples per plane > maximum values (for Hough transform) + * + * */ class TrkLevel2 : public TObject { @@ -220,6 +374,8 @@ public: Int_t good[12]; ///< event status + UInt_t VKmask[12]; ///< Viking-chip mask + UInt_t VKflag[12]; ///< Viking-chip flag TClonesArray *Track; ///< fitted tracks TClonesArray *SingletX; ///< x singlets @@ -233,6 +389,7 @@ void Clear(Option_t *option){Clear();}; void Delete(); void Set(); + int UnpackError(){ for(int i=0; i<12; i++)if(!StatusCheck(i,0x12))return 1; return 0;}; int ntrk() {return Track->GetEntries();} ///< number of stored track int nclsx(){return SingletX->GetEntries();} ///< number of x singlets @@ -245,27 +402,28 @@ void SetFromLevel2Struct() { SetFromLevel2Struct(&level2event_); }; void GetLevel2Struct(cTrkLevel2 *) const; void LoadField(TString); - float GetBX(float*); - float GetBY(float*); - float GetBZ(float*); + float GetBX(float* v){return TrkParams::GetBX(v);};///< Bx (kGauss) + float GetBY(float* v){return TrkParams::GetBY(v);};///< By (kGauss) + float GetBZ(float* v){return TrkParams::GetBZ(v);};///< Bz (kGauss) Float_t GetZTrk(Int_t); - Float_t GetXTrkLeft(){return XTRKL;}; - Float_t GetXTrkRight(){return XTRKR;}; - Float_t GetYTrkLeft(){return YTRKL;}; - Float_t GetYTrkRight(){return YTRKR;}; + Float_t GetXTrkLeft(){return XMAGNLOW;}; + Float_t GetXTrkRight(){return XMAGNHIGH;}; + Float_t GetYTrkLeft(){return YMAGNLOW;}; + Float_t GetYTrkRight(){return YMAGNHIGH;}; + Bool_t IsMaskedVK(int,int); + Bool_t GetVKMask(int,int); + Bool_t GetVKFlag(int,int); + TrkSinglet *GetSingletX(int); TrkSinglet *GetSingletY(int); TrkTrack *GetStoredTrack(int i); Int_t GetSeqNo(Int_t i) {return (((TrkTrack *)Track->At(i))->seqno);}; ///< Returns track sequential number -// TClonesArray *GetTracks_Chi2Sorted(); -// TClonesArray *GetTracks_NFitSorted(); -// TClonesArray *GetTracks(); + TRefArray *GetTracks_NFitSorted(); TRefArray *GetTracks(){return this->GetTracks_NFitSorted();}; -// int GetNTracks(){return this->GetTracks()->GetEntries();} Int_t GetNTracks(); TrkTrack* GetTrack(int i); TrkTrack* GetTrackImage(int i); @@ -273,7 +431,10 @@ TrkLevel2* GetTrkLevel2(){return this;} TClonesArray* GetTrackArray(){return Track;};///< returns pointer to the track array - ClassDef(TrkLevel2,2); + void StatusDump(int view); + Bool_t StatusCheck(int view, int flagmask); + + ClassDef(TrkLevel2,3); };