]> git.uio.no Git - u/mrichter/AliRoot.git/blame - TRD/AliTRDclusterizer.h
Adding missing include
[u/mrichter/AliRoot.git] / TRD / AliTRDclusterizer.h
CommitLineData
8230f242 1#ifndef ALITRDCLUSTERIZER_H
2#define ALITRDCLUSTERIZER_H
f7336fa3 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// //
3fe61b77 10// TRD cluster finder //
6d50f529 11// //
12////////////////////////////////////////////////////////////////////////////
13
f7336fa3 14#include <TNamed.h>
793ff80c 15
16class TFile;
bdbb05bb 17class TTree;
66f6bfd9 18class TClonesArray;
6d50f529 19
88cb7938 20class AliRunLoader;
3fe61b77 21class AliRawReader;
6d50f529 22
bdbb05bb 23class AliTRD;
c85a4951 24class AliTRDcluster;
b65e5048 25
26class AliTRDarrayADC;
27class AliTRDarraySignal;
3fe61b77 28class AliTRDdigitsManager;
29class AliTRDSignalIndex;
30class AliTRDtransform;
31class AliTRDCalROC;
3a039a31 32class AliTRDReconstructor;
1b3a719f 33class AliTRDCalSingleChamberStatus;
b65e5048 34
3a039a31 35class AliTRDclusterizer : public TNamed
36{
b65e5048 37
38 public:
39
66f6bfd9 40 // steering flags
41 enum{
b72f4eaf 42 kOwner = BIT(14) // toggle cluster ownership
43 ,kLabels = BIT(15) // toggle MC labels for clusters
44 ,kHLT = BIT(16) // HLT mode
45 ,kLUT = BIT(17) // using look up table for cluster's r-phi position
46 ,kGAUS = BIT(18) // using gauss approx. for cluster's r-phi position
66f6bfd9 47 };
486c2339 48
49 struct MaxStruct
50 {
51 Int_t Row;
52 Int_t Col;
53 Int_t Time;
54 UChar_t padStatus;
c96d03ba 55 Short_t Signals[3];
1b3a719f 56 Bool_t FivePad;
57 MaxStruct():Row(-1),Col(0),Time(0),padStatus(0),FivePad(kFALSE)
c96d03ba 58 {memset(Signals, 0, 3*sizeof(Short_t));}
486c2339 59 MaxStruct &operator=(const MaxStruct &a)
1b3a719f 60 {Row=a.Row; Col=a.Col; Time=a.Time; padStatus=a.padStatus; FivePad=a.FivePad;
c96d03ba 61 memcpy(Signals, a.Signals, 3*sizeof(Short_t)); return *this;}
486c2339 62 };
66f6bfd9 63
486c2339 64 AliTRDclusterizer(const AliTRDReconstructor *const rec = 0x0);
65 AliTRDclusterizer(const Text_t* name, const Text_t* title, const AliTRDReconstructor *const rec = 0x0);
dd9a6ee3 66 AliTRDclusterizer(const AliTRDclusterizer &c);
6d50f529 67 virtual ~AliTRDclusterizer();
dd9a6ee3 68 AliTRDclusterizer &operator=(const AliTRDclusterizer &c);
69
6cd9a21f 70 void Copy(TObject &c) const;
3fe61b77 71
6cd9a21f 72 Bool_t Open(const Char_t *name, Int_t nEvent = 0);
73 Bool_t OpenInput(Int_t nEvent = 0);
74 Bool_t OpenOutput();
75 Bool_t OpenOutput(TTree *clusterTree);
3fe61b77 76
6cd9a21f 77 Bool_t ReadDigits();
78 Bool_t ReadDigits(AliRawReader *rawReader);
79 Bool_t ReadDigits(TTree *digitsTree);
3fe61b77 80
6cd9a21f 81 Bool_t WriteClusters(Int_t det);
3d0c7d6d 82 void ResetRecPoints();
83 virtual TClonesArray *RecPoints();
6cd9a21f 84 Bool_t WriteTracklets(Int_t det);
bdbb05bb 85
6cd9a21f 86 Bool_t Raw2Clusters(AliRawReader *rawReader);
87 Bool_t Raw2ClustersChamber(AliRawReader *rawReader);
3fe61b77 88
6cd9a21f 89 Bool_t MakeClusters();
90 Bool_t MakeClusters(Int_t det);
3fe61b77 91
6cd9a21f 92 Bool_t AddLabels();
b72f4eaf 93 Bool_t SetUseLabels(const Bool_t kset) { SetBit(kLabels, kset); return TestBit(kLabels); } // should we assign labels to clusters
6cd9a21f 94 void SetRawVersion(const Int_t iver) { fRawVersion = iver; } // set the expected raw data version
3a039a31 95 void SetReconstructor(const AliTRDReconstructor *rec) {fReconstructor = rec;}
66f6bfd9 96 static UChar_t GetStatus(Short_t &signal);
3d0c7d6d 97 Int_t GetAddedClusters() {return fNoOfClusters;}
66f6bfd9 98
6cd9a21f 99 Bool_t IsClustersOwner() const {return TestBit(kOwner);}
100 virtual void SetClustersOwner(Bool_t own=kTRUE) {SetBit(kOwner, own); if(!own) {fRecPoints = 0x0; fNoOfClusters=0;} }
3a039a31 101
b72f4eaf 102protected:
b65e5048 103
064d808d 104 void DeConvExp (const Double_t *const source, Double_t *const target
105 ,const Int_t nTimeTotal, const Int_t nexp);
106 void TailCancelation();
107
6cd9a21f 108 Float_t Unfold(Double_t eps, Int_t layer, Double_t *padSignal) const;
b72f4eaf 109 //Double_t GetCOG(Double_t signal[5]) const;
110 //Double_t LUTposition(Int_t ilayer, Double_t ampL, Double_t ampC, Double_t ampR) const;
6d9e79cc 111
064d808d 112 void SetPadStatus(const UChar_t status, UChar_t &encoding);
113 UChar_t GetPadStatus(UChar_t encoding) const;
114 Int_t GetCorruption(UChar_t encoding) const;
115
1b3a719f 116 Bool_t IsMaximum(const MaxStruct &Max, UChar_t &padStatus, Short_t *const Signals); //for const correctness reasons not const parameters are given separately
117 Bool_t FivePadCluster(MaxStruct &ThisMax, MaxStruct &NeighbourMax);
486c2339 118 void CreateCluster(const MaxStruct &Max);
3d0c7d6d 119 inline void CalcAdditionalInfo(const MaxStruct &Max, Short_t *const signals, Int_t &nPadCount);
120 virtual void AddClusterToArray(AliTRDcluster *cluster);
3fe61b77 121
3d0c7d6d 122 const AliTRDReconstructor *fReconstructor; //! reconstructor
3fe61b77 123 AliRunLoader *fRunLoader; //! Run Loader
124 TTree *fClusterTree; //! Tree with the cluster
66f6bfd9 125 TClonesArray *fRecPoints; //! Array of clusters
3fe61b77 126
b65e5048 127 TTree *fTrackletTree; //! Tree for tracklets
9c7c9ec1 128
3fe61b77 129 AliTRDdigitsManager *fDigitsManager; //! TRD digits manager
130
b65e5048 131 UInt_t **fTrackletContainer; //! tracklet container
9c7c9ec1 132
3fe61b77 133 Int_t fRawVersion; // Expected raw version of the data - default is 2
134
3fe61b77 135 AliTRDtransform *fTransform; //! Transforms the reconstructed space points
f7336fa3 136
3d0c7d6d 137 AliTRDarrayADC *fDigits; // Array holding the digits
138 AliTRDSignalIndex *fIndexes; // Array holding the indexes to the digits
064d808d 139 Float_t fADCthresh; // ADC thresholds: There is no ADC threshold anymore, and simParam should not be used in clusterizer. KO
140 Float_t fMaxThresh; // Threshold value for the maximum
141 Float_t fSigThresh; // Threshold value for the digit signal
142 Float_t fMinMaxCutSigma; // Threshold value for the maximum (cut noise)
143 Float_t fMinLeftRightCutSigma; // Threshold value for the sum pad (cut noise)
144 Int_t fLayer; // Current layer of the detector
145 Int_t fDet; // Current detecor
146 UShort_t fVolid; // Volume ID
147 Int_t fColMax; // Number of Colums in one detector
148 Int_t fTimeTotal; // Number of time bins
149 AliTRDCalROC *fCalGainFactorROC; // Calibration object with pad wise values for the gain factors
150 Float_t fCalGainFactorDetValue;// Calibration value for chamber wise noise
151 AliTRDCalROC *fCalNoiseROC; // Calibration object with pad wise values for the noise
152 Float_t fCalNoiseDetValue; // Calibration value for chamber wise noise
3d0c7d6d 153 AliTRDCalSingleChamberStatus *fCalPadStatusROC; // Calibration object with the pad status
064d808d 154 Int_t fClusterROC; // The index to the first cluster of a given ROC
155 Int_t firstClusterROC; // The number of cluster in a given ROC
3d0c7d6d 156 Int_t fNoOfClusters; // Number of Clusters already processed and still owned by the clusterizer
064d808d 157
3d0c7d6d 158 ClassDef(AliTRDclusterizer,6) // TRD clusterfinder
f7336fa3 159
160};
161
f7336fa3 162#endif