1 #ifndef ALITRDCLUSTER_H
2 #define ALITRDCLUSTER_H
3 /* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
4 * See cxx source for full Copyright notice */
8 ///////////////////////////////////////////////////////////////////////////////
12 ///////////////////////////////////////////////////////////////////////////////
14 #include "AliCluster.h"
16 class AliTRDtrackletWord;
18 class AliTRDcluster : public AliCluster {
21 enum ETRDclusterStatus {
22 kInChamber = BIT(16) // Out of fiducial volume of chamber (signal tails)
23 ,kFivePad = BIT(17) // Deconvoluted clusters
28 enum ETRDclusterMask {
35 AliTRDcluster(Int_t det, UChar_t col, UChar_t row, UChar_t time, const Short_t *sig, UShort_t volid);
36 AliTRDcluster(Int_t det, Float_t q, Float_t *pos, Float_t *sig
37 , Int_t *tracks, Char_t npads, Short_t * const signals
38 , UChar_t col, UChar_t row, UChar_t time
39 , Char_t timebin, Float_t center, UShort_t volid);
40 AliTRDcluster(const AliTRDtrackletWord *const tracklet, Int_t det, UShort_t volid);
41 AliTRDcluster(const AliTRDcluster &c);
42 virtual ~AliTRDcluster() {};
43 AliTRDcluster &operator=(const AliTRDcluster &c);
45 virtual void AddTrackIndex(const Int_t * const i);
46 void Clear(Option_t *o="");
48 Bool_t IsEqual(const TObject *otherCluster) const;
49 Bool_t IsInChamber() const { return TestBit(kInChamber); }
50 Bool_t IsMasked() const { return fClusterMasking ? kTRUE : kFALSE; }
51 Bool_t IsShared() const { return IsClusterShared(); }
52 Bool_t IsUsed() const { return IsClusterUsed(); }
53 Bool_t IsFivePad() const { return TestBit(kFivePad); }
54 inline Bool_t IsRPhiMethod(ETRDclusterStatus m) const;
56 UChar_t GetPadMaskedPosition() const { return fClusterMasking & 7; }
57 UChar_t GetPadMaskedStatus() const { return fClusterMasking >> 3; }
58 Int_t GetDetector() const { return fDetector; }
59 Int_t GetLocalTimeBin() const { return fLocalTimeBin; }
60 Float_t GetQ() const { return fQ; }
61 Int_t GetNPads() const { return fNPads; }
62 Float_t GetCenter() const { return fCenter; }
63 Int_t GetPadCol() const { return fPadCol; }
64 Int_t GetPadRow() const { return fPadRow; }
65 Int_t GetPadTime() const { return fPadTime; }
66 Short_t *GetSignals() { return fSignals; }
67 Float_t GetSumS() const;
69 static Double_t GetSX(Int_t tb, Double_t z=-1);
70 static Double_t GetSYdrift(Int_t tb, Int_t ly=0, Double_t z=-1);
71 static Double_t GetSYcharge(Float_t q);
72 static Double_t GetSYprf(Int_t ly, Double_t center, Double_t s2);
73 static Double_t GetXcorr(Int_t tb, Double_t z=-1);
74 static Double_t GetYcorr(Int_t ly, Float_t y);
75 Float_t GetXloc(Double_t t0, Double_t vd
76 , const Double_t *const q = 0x0
77 , const Double_t *const xq = 0x0
79 Float_t GetYloc(Double_t y0, Double_t s2, Double_t W, Double_t *const y1=0x0, Double_t *const y2=0x0);
81 void Print(Option_t* o="") const;
83 void SetLocalTimeBin(Char_t t) { fLocalTimeBin = t; }
84 void SetNPads(Int_t n) { fNPads = n; }
85 void SetPadCol(UChar_t inPadCol) { fPadCol = inPadCol; }
86 void SetPadRow(UChar_t inPadRow) { fPadRow = inPadRow; }
87 void SetPadTime(UChar_t inPadTime) { fPadTime = inPadTime; }
88 void SetDetector(Short_t inDetector) { fDetector = inDetector; }
89 void SetQ(Float_t inQ) { fQ = inQ; }
90 void SetClusterMasking(UChar_t inClusterMasking) { fClusterMasking = inClusterMasking; }
91 void SetShared(Bool_t sh = kTRUE) { SetBit(AliCluster::kShared,sh); }
92 void SetFivePad(Bool_t b = kTRUE) { SetBit(kFivePad,b); }
93 void SetInChamber(Bool_t in = kTRUE) { SetBit(kInChamber,in); }
94 void SetPadMaskedPosition(UChar_t position);
95 void SetPadMaskedStatus(UChar_t status);
96 void SetSigmaY2(Float_t s2, Float_t dt, Float_t exb, Float_t x0, Float_t z=-1., Float_t tgp=0.);
97 inline void SetRPhiMethod(ETRDclusterStatus m);
99 void Use(Int_t u = 1) { SetBit(AliCluster::kUsed, u ? kTRUE : kFALSE); }
103 UChar_t fPadCol; // Central pad number in column direction
104 UChar_t fPadRow; // Central pad number in row direction
105 UChar_t fPadTime; // Uncalibrated time bin number
106 Char_t fLocalTimeBin; // T0-calibrated time bin number
107 UChar_t fNPads; // Number of pads in cluster
108 UChar_t fClusterMasking; // Bit field containing cluster status information;
109 Short_t fDetector; // TRD detector number
110 Short_t fSignals[7]; // Signals in the cluster
111 Float_t fQ; // Amplitude
112 Float_t fCenter; // Center of the cluster relative to the pad
116 Float_t GetDYcog(const Double_t *const y1=0x0, const Double_t *const y2=0x0);
117 Float_t GetDYlut(const Double_t *const y1=0x0, const Double_t *const y2=0x0);
118 Float_t GetDYgauss(Double_t sw, Double_t *const y1=0x0, Double_t *const y2=0x0);
119 static void FillLUT();
121 static const Int_t fgkNlut; //! Number of bins of the LUT
122 static Double_t *fgLUT; //! The lookup table
124 ClassDef(AliTRDcluster, 7) // Cluster for the TRD
128 //________________________________________________
129 inline Bool_t AliTRDcluster::IsRPhiMethod(ETRDclusterStatus m) const
131 if(m==kLUT && TestBit(kLUT)) return kTRUE;
132 else if(m==kGAUS && TestBit(kGAUS)) return kTRUE;
133 else if(m==kCOG && (!TestBit(kLUT)&&!TestBit(kGAUS))) return kTRUE;
138 //________________________________________________
139 inline void AliTRDcluster::SetRPhiMethod(ETRDclusterStatus m)
141 SetBit(kCOG,0);SetBit(kLUT,0);SetBit(kGAUS,0);
143 case kCOG: SetBit(kCOG); break;
144 case kLUT: SetBit(kLUT); break;
145 case kGAUS: SetBit(kGAUS); break;
146 default: SetBit(kLUT); break;