X-Git-Url: http://git.uio.no/git/?a=blobdiff_plain;f=TRD%2FAliTRDclusterizer.h;h=2f29505da47bdf7e1413a29b2c67b0ed52fdeb26;hb=8166d5d78ac8d0e29a6e7f7ce86777849b675800;hp=9828430bdc1d35498c2b29d0058f03fea26a9874;hpb=828b670e0af7871aa3e28575afd20e0d47a5558a;p=u%2Fmrichter%2FAliRoot.git diff --git a/TRD/AliTRDclusterizer.h b/TRD/AliTRDclusterizer.h index 9828430bdc1..2f29505da47 100644 --- a/TRD/AliTRDclusterizer.h +++ b/TRD/AliTRDclusterizer.h @@ -5,58 +5,168 @@ /* $Id$ */ +//////////////////////////////////////////////////////////////////////////// +// // +// TRD cluster finder // +// // +//////////////////////////////////////////////////////////////////////////// + #include -#include class TFile; class TTree; +class TClonesArray; + class AliRunLoader; -class AliTRDparameter; +class AliRawReader; + class AliTRD; +class AliTRDcluster; -/////////////////////////////////////////////////////// -// Finds and handles cluster // -/////////////////////////////////////////////////////// +class AliTRDarrayADC; +class AliTRDarraySignal; +class AliTRDdigitsManager; +class AliTRDSignalIndex; +class AliTRDtransform; +class AliTRDCalROC; +class AliTRDReconstructor; +class AliTRDCalSingleChamberStatus; +class AliTRDrawStreamBase; -class AliTRDclusterizer : public TNamed { +class AliTRDclusterizer : public TNamed +{ public: - AliTRDclusterizer(); - AliTRDclusterizer(const Text_t* name, const Text_t* title); + // steering flags + // bits from 0-13 are reserved by ROOT (see TObject.h) + enum{ + kTrOwner = BIT(14) // toggle online tracklets ownership + ,kClOwner= BIT(15) // toggle cluster ownership + ,kLabels = BIT(16) // toggle MC labels for clusters + ,kHLT = BIT(17) // HLT mode + ,kLUT = BIT(18) // using look up table for cluster's r-phi position + ,kGAUS = BIT(19) // using gauss approx. for cluster's r-phi position + ,knewDM = BIT(20) // was the digitsmanger created by raw2clusters? + }; + + struct MaxStruct + { + Int_t row; // row of the current cluster candidate + Int_t col; // col of the current cluster candidate + Int_t time; // time -"- + Short_t signals[3]; // signals of the maximum pad and it's twon neigbours + UChar_t padStatus; // padStatus of the current cluster candidate + Bool_t fivePad; // is this cluster candidate part of a 5 pad cluster (two overlaping clusters)? + MaxStruct():row(-1),col(0),time(0),padStatus(0),fivePad(kFALSE) + {memset(signals, 0, 3*sizeof(Short_t));} + MaxStruct &operator=(const MaxStruct &a) + {memcpy(this, &a, sizeof(MaxStruct)); return *this;} + }; + + AliTRDclusterizer(const AliTRDReconstructor *const rec = 0x0); + AliTRDclusterizer(const Text_t* name, const Text_t* title, const AliTRDReconstructor *const rec = 0x0); AliTRDclusterizer(const AliTRDclusterizer &c); - virtual ~AliTRDclusterizer(); + virtual ~AliTRDclusterizer(); AliTRDclusterizer &operator=(const AliTRDclusterizer &c); - virtual void Copy(TObject &c) const; - virtual Bool_t Open(const Char_t *name, Int_t nEvent = 0); - - virtual Bool_t OpenInput(Int_t nEvent = 0); - virtual Bool_t OpenOutput(); - virtual Bool_t MakeClusters() = 0; - virtual Bool_t WriteClusters(Int_t det); - virtual void SetParameter(AliTRDparameter *par) { fPar = par; }; - void SetVerbose(Int_t v = 1) { fVerbose = v; }; + void Copy(TObject &c) const; - AliTRDparameter *GetParameter() const { return fPar; }; + Bool_t Open(const Char_t *name, Int_t nEvent = 0); + Bool_t OpenInput(Int_t nEvent = 0); + Bool_t OpenOutput(); + Bool_t OpenOutput(TTree *const clusterTree); + Bool_t OpenTrackletOutput(); - TObjArray* RecPoints() {if (!fRecPoints) fRecPoints = new TObjArray(400); return fRecPoints;} - virtual void AddCluster(Double_t *pos, Int_t det, Double_t amp, Int_t *tracks - , Double_t *sig, Int_t iType, Float_t center = 0); - void ResetRecPoints() {if (fRecPoints) fRecPoints->Delete();} + Bool_t ReadDigits(); + Bool_t ReadDigits(AliRawReader *rawReader); + Bool_t ReadDigits(TTree *digitsTree); + Bool_t WriteClusters(Int_t det); + void ResetRecPoints(); + virtual TClonesArray *RecPoints(); + virtual TClonesArray *TrackletsArray(); + Bool_t WriteTracklets(Int_t det); - protected: + Bool_t Raw2Clusters(AliRawReader *rawReader); + Bool_t Raw2ClustersChamber(AliRawReader *rawReader); - AliRunLoader *fRunLoader; //! Run Loader - - TTree *fClusterTree; //! Tree with the cluster - AliTRDparameter *fPar; // TRD digitization parameter object + Bool_t MakeClusters(); + Bool_t MakeClusters(Int_t det); + + Bool_t AddLabels(); + Bool_t SetUseLabels(const Bool_t kset) { SetBit(kLabels, kset); return TestBit(kLabels); } // should we assign labels to clusters + void SetRawVersion(const Int_t iver) { fRawVersion = iver; } // set the expected raw data version + void SetReconstructor(const AliTRDReconstructor *rec) {fReconstructor = rec;} + static UChar_t GetStatus(Short_t &signal); + Int_t GetAddedClusters() const {return fNoOfClusters;} + Int_t GetNTimeBins() const {return fTimeTotal;} + + Bool_t IsClustersOwner() const {return TestBit(kClOwner);} + virtual void SetClustersOwner(Bool_t own=kTRUE) {SetBit(kClOwner, own); if(!own) {fRecPoints = 0x0; fNoOfClusters=0;} } + void SetTrackletsOwner(Bool_t own=kTRUE) {SetBit(kTrOwner, own); if(!own) {fTracklets = 0x0; } } - TObjArray* fRecPoints; //! Array of clusters - Int_t fVerbose; // Sets the verbose level +protected: - ClassDef(AliTRDclusterizer,3) // TRD-Cluster manager base class + void DeConvExp (Float_t *const arr, const Int_t nTimeTotal, const Int_t nexp); + void TailCancelation(); + + Float_t Unfold(Double_t eps, Int_t layer, const Double_t *const padSignal) const; + + void SetPadStatus(const UChar_t status, UChar_t &encoding) const; + UChar_t GetPadStatus(UChar_t encoding) const; + Int_t GetCorruption(UChar_t encoding) const; + + Bool_t IsMaximum(const MaxStruct &Max, UChar_t &padStatus, Short_t *const Signals); //for const correctness reasons not const parameters are given separately + Bool_t FivePadCluster(MaxStruct &ThisMax, MaxStruct &NeighbourMax); + void CreateCluster(const MaxStruct &Max); + + virtual void AddClusterToArray(AliTRDcluster* cluster); + virtual void AddTrackletsToArray(); + +private: + inline void CalcAdditionalInfo(const MaxStruct &Max, Short_t *const signals, Int_t &nPadCount); + +protected: + const AliTRDReconstructor *fReconstructor; //! reconstructor + AliRunLoader *fRunLoader; //! Run Loader + TTree *fClusterTree; //! Tree with the cluster + TClonesArray *fRecPoints; //! Array of clusters + TClonesArray *fTracklets; //! Array of online tracklets + + TTree *fTrackletTree; //! Tree for tracklets + + AliTRDdigitsManager *fDigitsManager; //! TRD digits manager + + UInt_t **fTrackletContainer; //! tracklet container + + Int_t fRawVersion; // Expected raw version of the data - default is 2 + + AliTRDtransform *fTransform; //! Transforms the reconstructed space points + + AliTRDarrayADC *fDigits; // Array holding the digits + AliTRDSignalIndex *fIndexes; // Array holding the indexes to the digits + Float_t fMaxThresh; // Threshold value for the maximum + Float_t fSigThresh; // Threshold value for the digit signal + Float_t fMinMaxCutSigma; // Threshold value for the maximum (cut noise) + Float_t fMinLeftRightCutSigma; // Threshold value for the sum pad (cut noise) + Int_t fLayer; // Current layer of the detector + Int_t fDet; // Current detecor + UShort_t fVolid; // Volume ID + Int_t fColMax; // Number of Colums in one detector + Int_t fTimeTotal; // Number of time bins + AliTRDCalROC *fCalGainFactorROC; // Calibration object with pad wise values for the gain factors + Float_t fCalGainFactorDetValue;// Calibration value for chamber wise noise + AliTRDCalROC *fCalNoiseROC; // Calibration object with pad wise values for the noise + Float_t fCalNoiseDetValue; // Calibration value for chamber wise noise + AliTRDCalSingleChamberStatus *fCalPadStatusROC; // Calibration object with the pad status + Int_t fClusterROC; // The index to the first cluster of a given ROC + Int_t firstClusterROC; // The number of cluster in a given ROC + Int_t fNoOfClusters; // Number of Clusters already processed and still owned by the clusterizer + Int_t fBaseline; // Baseline of the ADC values + AliTRDrawStreamBase *fRawStream; // Currently used RawStream + + ClassDef(AliTRDclusterizer,6) // TRD clusterfinder };