]> git.uio.no Git - u/mrichter/AliRoot.git/blame - TRD/AliTRDcluster.h
Min Et changed for DA
[u/mrichter/AliRoot.git] / TRD / AliTRDcluster.h
CommitLineData
46d29e70 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 */
5
6/* $Id$ */
7
6d50f529 8///////////////////////////////////////////////////////////////////////////////
9// //
10// TRD cluster //
11// //
12///////////////////////////////////////////////////////////////////////////////
5443e65e 13
5843e420 14#include "AliCluster.h"
46d29e70 15
a5b99acd 16class AliTRDtrackletWord;
17
5443e65e 18class AliTRDcluster : public AliCluster {
3044dfe5 19 friend class AliHLTTRDCluster;
762571f0 20
3044dfe5 21public:
5843e420 22 enum ETRDclusterStatus {
23 kInChamber = BIT(16) // Out of fiducial volume of chamber (signal tails)
24 ,kFivePad = BIT(17) // Deconvoluted clusters
b72f4eaf 25 ,kLUT = BIT(18)
26 ,kGAUS = BIT(19)
27 ,kCOG = BIT(20)
5843e420 28 };
29 enum ETRDclusterMask {
30 kMaskedLeft = 0
31 ,kMaskedCenter = 1
32 ,kMaskedRight = 2
f5375dcb 33 };
0e09df31 34
bdb68f8c 35 AliTRDcluster();
b72f4eaf 36 AliTRDcluster(Int_t det, UChar_t col, UChar_t row, UChar_t time, const Short_t *sig, UShort_t volid);
762571f0 37 AliTRDcluster(Int_t det, Float_t q, Float_t *pos, Float_t *sig
38 , Int_t *tracks, Char_t npads, Short_t * const signals
39 , UChar_t col, UChar_t row, UChar_t time
40 , Char_t timebin, Float_t center, UShort_t volid);
a5b99acd 41 AliTRDcluster(const AliTRDtrackletWord *const tracklet, Int_t det, UShort_t volid);
a2b90f83 42 AliTRDcluster(const AliTRDcluster &c);
acc49af9 43 virtual ~AliTRDcluster() {};
762571f0 44 AliTRDcluster &operator=(const AliTRDcluster &c);
a2b90f83 45
762571f0 46 virtual void AddTrackIndex(const Int_t * const i);
47 void Clear(Option_t *o="");
203967fc 48
762571f0 49 Bool_t IsEqual(const TObject *otherCluster) const;
50 Bool_t IsInChamber() const { return TestBit(kInChamber); }
51 Bool_t IsMasked() const { return fClusterMasking ? kTRUE : kFALSE; }
52 Bool_t IsShared() const { return IsClusterShared(); }
53 Bool_t IsUsed() const { return IsClusterUsed(); }
54 Bool_t IsFivePad() const { return TestBit(kFivePad); }
55 inline Bool_t IsRPhiMethod(ETRDclusterStatus m) const;
56
57 UChar_t GetPadMaskedPosition() const { return fClusterMasking & 7; }
58 UChar_t GetPadMaskedStatus() const { return fClusterMasking >> 3; }
59 Int_t GetDetector() const { return fDetector; }
60 Int_t GetLocalTimeBin() const { return fLocalTimeBin; }
61 Float_t GetQ() const { return fQ; }
62 Int_t GetNPads() const { return fNPads; }
63 Float_t GetCenter() const { return fCenter; }
64 Int_t GetPadCol() const { return fPadCol; }
65 Int_t GetPadRow() const { return fPadRow; }
66 Int_t GetPadTime() const { return fPadTime; }
67 Short_t *GetSignals() { return fSignals; }
68 Float_t GetSumS() const;
69
70 static Double_t GetSX(Int_t tb, Double_t z=-1);
71 static Double_t GetSYdrift(Int_t tb, Int_t ly=0, Double_t z=-1);
72 static Double_t GetSYcharge(Float_t q);
73 static Double_t GetSYprf(Int_t ly, Double_t center, Double_t s2);
74 static Double_t GetXcorr(Int_t tb, Double_t z=-1);
75 static Double_t GetYcorr(Int_t ly, Float_t y);
76 Float_t GetXloc(Double_t t0, Double_t vd
77 , const Double_t *const q = 0x0
78 , const Double_t *const xq = 0x0
79 , Double_t z = 0.2);
80 Float_t GetYloc(Double_t y0, Double_t s2, Double_t W, Double_t *const y1=0x0, Double_t *const y2=0x0);
81
82 void Print(Option_t* o="") const;
83
84 void SetLocalTimeBin(Char_t t) { fLocalTimeBin = t; }
85 void SetNPads(Int_t n) { fNPads = n; }
86 void SetPadCol(UChar_t inPadCol) { fPadCol = inPadCol; }
87 void SetPadRow(UChar_t inPadRow) { fPadRow = inPadRow; }
88 void SetPadTime(UChar_t inPadTime) { fPadTime = inPadTime; }
89 void SetDetector(Short_t inDetector) { fDetector = inDetector; }
90 void SetQ(Float_t inQ) { fQ = inQ; }
91 void SetClusterMasking(UChar_t inClusterMasking) { fClusterMasking = inClusterMasking; }
92 void SetShared(Bool_t sh = kTRUE) { SetBit(AliCluster::kShared,sh); }
93 void SetFivePad(Bool_t b = kTRUE) { SetBit(kFivePad,b); }
94 void SetInChamber(Bool_t in = kTRUE) { SetBit(kInChamber,in); }
95 void SetPadMaskedPosition(UChar_t position);
96 void SetPadMaskedStatus(UChar_t status);
97 void SetSigmaY2(Float_t s2, Float_t dt, Float_t exb, Float_t x0, Float_t z=-1., Float_t tgp=0.);
b72f4eaf 98 inline void SetRPhiMethod(ETRDclusterStatus m);
762571f0 99
100 void Use(Int_t u = 1) { SetBit(AliCluster::kUsed, u ? kTRUE : kFALSE); }
af26ce80 101
5843e420 102protected:
762571f0 103
5843e420 104 UChar_t fPadCol; // Central pad number in column direction
105 UChar_t fPadRow; // Central pad number in row direction
106 UChar_t fPadTime; // Uncalibrated time bin number
107 Char_t fLocalTimeBin; // T0-calibrated time bin number
108 UChar_t fNPads; // Number of pads in cluster
109 UChar_t fClusterMasking; // Bit field containing cluster status information;
110 Short_t fDetector; // TRD detector number
111 Short_t fSignals[7]; // Signals in the cluster
112 Float_t fQ; // Amplitude
113 Float_t fCenter; // Center of the cluster relative to the pad
0e09df31 114
b72f4eaf 115private:
762571f0 116
117 Float_t GetDYcog(const Double_t *const y1=0x0, const Double_t *const y2=0x0);
118 Float_t GetDYlut(const Double_t *const y1=0x0, const Double_t *const y2=0x0);
119 Float_t GetDYgauss(Double_t sw, Double_t *const y1=0x0, Double_t *const y2=0x0);
b72f4eaf 120 static void FillLUT();
121
122 static const Int_t fgkNlut; //! Number of bins of the LUT
123 static Double_t *fgLUT; //! The lookup table
124
762571f0 125 ClassDef(AliTRDcluster, 7) // Cluster for the TRD
126
46d29e70 127};
b72f4eaf 128
129//________________________________________________
130inline Bool_t AliTRDcluster::IsRPhiMethod(ETRDclusterStatus m) const
131{
132 if(m==kLUT && TestBit(kLUT)) return kTRUE;
133 else if(m==kGAUS && TestBit(kGAUS)) return kTRUE;
134 else if(m==kCOG && (!TestBit(kLUT)&&!TestBit(kGAUS))) return kTRUE;
135
136 return kFALSE;
137}
138
139//________________________________________________
140inline void AliTRDcluster::SetRPhiMethod(ETRDclusterStatus m)
141{
a8d5c885 142 SetBit(kCOG,0);SetBit(kLUT,0);SetBit(kGAUS,0);
b72f4eaf 143 switch(m){
144 case kCOG: SetBit(kCOG); break;
145 case kLUT: SetBit(kLUT); break;
146 case kGAUS: SetBit(kGAUS); break;
a8d5c885 147 default: SetBit(kLUT); break;
b72f4eaf 148 }
149}
150
46d29e70 151#endif