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 AliTRDcluster : public AliCluster {
18 enum ETRDclusterStatus {
19 kInChamber = BIT(16) // Out of fiducial volume of chamber (signal tails)
20 ,kFivePad = BIT(17) // Deconvoluted clusters
25 enum ETRDclusterMask {
32 AliTRDcluster(Int_t det, UChar_t col, UChar_t row, UChar_t time, const Short_t *sig, UShort_t volid);
34 Int_t det, Float_t q, Float_t *pos, Float_t *sig,
35 Int_t *tracks, Char_t npads, Short_t *signals,
36 UChar_t col, UChar_t row, UChar_t time,
37 Char_t timebin, Float_t center, UShort_t volid);
38 AliTRDcluster(const AliTRDcluster &c);
39 virtual ~AliTRDcluster() {};
41 virtual void AddTrackIndex(Int_t *i);
42 void Clear(Option_t *o="");
44 Bool_t IsEqual(const TObject *otherCluster) const;
45 Bool_t IsInChamber() const { return TestBit(kInChamber); }
46 Bool_t IsMasked() const { return fClusterMasking ? kTRUE : kFALSE; }
47 Bool_t IsShared() const { return IsClusterShared();}
48 Bool_t IsUsed() const { return IsClusterUsed(); }
49 Bool_t IsFivePad() const { return TestBit(kFivePad);}
50 inline Bool_t IsRPhiMethod(ETRDclusterStatus m) const;
52 UChar_t GetPadMaskedPosition() const { return fClusterMasking & 7; }
53 UChar_t GetPadMaskedStatus() const { return fClusterMasking >> 3; }
54 Int_t GetDetector() const { return fDetector; }
55 Int_t GetLocalTimeBin() const { return fLocalTimeBin; }
56 Float_t GetQ() const { return fQ; }
57 Int_t GetNPads() const { return fNPads; }
58 Float_t GetCenter() const { return fCenter; }
59 Int_t GetPadCol() const { return fPadCol; }
60 Int_t GetPadRow() const { return fPadRow; }
61 Int_t GetPadTime() const { return fPadTime; }
62 Short_t *GetSignals() { return fSignals; }
63 Float_t GetSumS() const;
64 static Double_t GetSX(Int_t tb, Double_t z=-1);
65 static Double_t GetSY(Int_t tb, Double_t z=-1);
66 static Double_t GetXcorr(Int_t tb, Double_t z=-1);
67 static Double_t GetYcorr(Int_t ly, Float_t y);
68 Float_t GetXloc(Double_t t0, Double_t vd, Double_t *const q=0x0, Double_t *const xq=0x0, Double_t z = 0.2);
69 Float_t GetYloc(Double_t y0, Double_t s2, Double_t W, Double_t *const y1=0x0, Double_t *const y2=0x0);
71 void Print(Option_t* o="") const;
73 void SetLocalTimeBin(Char_t t) { fLocalTimeBin = t; }
74 void SetInChamber(Bool_t in = kTRUE) { SetBit(kInChamber,in); }
75 void SetNPads(Int_t n) { fNPads = n; }
76 void SetPadMaskedPosition(UChar_t position);
77 void SetPadMaskedStatus(UChar_t status);
78 void SetPadCol(UChar_t inPadCol){ fPadCol = inPadCol;}
79 void SetPadRow(UChar_t inPadRow){ fPadRow = inPadRow;}
80 void SetPadTime(UChar_t inPadTime){ fPadTime = inPadTime;}
81 inline void SetRPhiMethod(ETRDclusterStatus m);
82 void SetDetector(Short_t inDetector){ fDetector = inDetector;}
83 void SetQ(Float_t inQ){ fQ = inQ;}
84 void SetClusterMasking(UChar_t inClusterMasking){ fClusterMasking = inClusterMasking;}
85 void SetShared(Bool_t sh = kTRUE) { SetBit(AliCluster::kShared,sh); }
86 void Use(Int_t = 0) { SetBit(AliCluster::kUsed, kTRUE); }
87 void SetFivePad(Bool_t b = kTRUE) { SetBit(kFivePad,b);}
90 UChar_t fPadCol; // Central pad number in column direction
91 UChar_t fPadRow; // Central pad number in row direction
92 UChar_t fPadTime; // Uncalibrated time bin number
93 Char_t fLocalTimeBin; // T0-calibrated time bin number
94 UChar_t fNPads; // Number of pads in cluster
95 UChar_t fClusterMasking; // Bit field containing cluster status information;
96 Short_t fDetector; // TRD detector number
97 Short_t fSignals[7]; // Signals in the cluster
98 Float_t fQ; // Amplitude
99 Float_t fCenter; // Center of the cluster relative to the pad
102 Float_t GetDYcog(Double_t *const y1=0x0, Double_t *const y2=0x0);
103 Float_t GetDYlut(Double_t *const y1=0x0, Double_t *const y2=0x0);
104 Float_t GetDYgauss(Double_t sw, Double_t *const y1=0x0, Double_t *const y2=0x0);
105 static void FillLUT();
107 static const Int_t fgkNlut; //! Number of bins of the LUT
108 static Double_t *fgLUT; //! The lookup table
110 ClassDef(AliTRDcluster, 7) // Cluster for the TRD
113 //________________________________________________
114 inline Bool_t AliTRDcluster::IsRPhiMethod(ETRDclusterStatus m) const
116 if(m==kLUT && TestBit(kLUT)) return kTRUE;
117 else if(m==kGAUS && TestBit(kGAUS)) return kTRUE;
118 else if(m==kCOG && (!TestBit(kLUT)&&!TestBit(kGAUS))) return kTRUE;
123 //________________________________________________
124 inline void AliTRDcluster::SetRPhiMethod(ETRDclusterStatus m)
127 case kCOG: SetBit(kCOG); break;
128 case kLUT: SetBit(kLUT); break;
129 case kGAUS: SetBit(kGAUS); break;