]> git.uio.no Git - u/mrichter/AliRoot.git/blame - TRD/AliTRDchamberTimeBin.h
AddTask Fix
[u/mrichter/AliRoot.git] / TRD / AliTRDchamberTimeBin.h
CommitLineData
eb38ed55 1#ifndef ALITRDCHAMBERTIMEBIN_H
2#define ALITRDCHAMBERTIMEBIN_H
3
4/* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
3a039a31 5* See cxx source for full Copyright notice */
eb38ed55 6
7/* $Id: AliTRDchamberTimeBin.h 22646 2007-11-29 18:13:40Z cblume $ */
8
9////////////////////////////////////////////////////////////////////////////
10// //
11// A TRD layer in a single stack //
12// //
13////////////////////////////////////////////////////////////////////////////
14
15#ifndef ROOT_TObject
16#include "TObject.h"
17#endif
18
4d6aee34 19class AliTRDcluster;
3a039a31 20class AliTRDReconstructor;
4d6aee34 21
eb38ed55 22class AliTRDchamberTimeBin : public TObject
23{
24public:
ac1dec3b 25 enum AliTRDchamberTimeBinStatus {
26 kT0 = BIT(14) // is the T0 time bin
27 ,kOwner = BIT(15) // is owner of the clusters
28 };
3a039a31 29 enum{
ac1dec3b 30 kMaxClustersLayer = 150
3a039a31 31 ,kMaxRows = 16
32 };
eb38ed55 33
3a039a31 34 AliTRDchamberTimeBin(Int_t plane=-1, Int_t stack=-1, Int_t sector=-1, Double_t z0=-1., Double_t zLength=-1.);
35 //AliTRDchamberTimeBin(const AliTRDpropagationLayer &layer, Double_t z0, Double_t zLength, UChar_t stackNr);
36 //AliTRDchamberTimeBin(const AliTRDpropagationLayer &layer);
37 AliTRDchamberTimeBin(const AliTRDchamberTimeBin &layer);
38 ~AliTRDchamberTimeBin();
ac1dec3b 39 operator Int_t() const { return fN; }
40 AliTRDchamberTimeBin&
41 operator=(const AliTRDchamberTimeBin &myLayer);
42 AliTRDcluster* operator[](const Int_t i) const {
4d6aee34 43 return ((i < fN) && (i >= 0)) ? fClusters[i] : NULL;
3a039a31 44 }
eb38ed55 45
ac1dec3b 46 void Bootstrap(const AliTRDReconstructor *rec, Int_t det);
3a039a31 47 void BuildIndices(Int_t iter = 0);
4d6aee34 48 void BuildCond(AliTRDcluster * const cl, Double_t *cond, UChar_t Layer, Double_t theta=0., Double_t phi=0.);
49 void Clear(const Option_t *opt = NULL);
50 AliTRDcluster* GetCluster(Int_t index) const {return index < fN && index >= 0 ? fClusters[index] : NULL;}
8368e0ee 51 Int_t GetGlobalIndex(Int_t index) const {return ((index < fN) && (index >= 0)) ? fIndex[index] : 0; }
4d6aee34 52 void GetClusters(const Double_t * const cond, Int_t *index, Int_t& ncl, Int_t BufferSize = kMaxClustersLayer);
3a039a31 53 AliTRDcluster* GetNearestCluster(Double_t *cond);
54 Double_t GetX() const {
55 return fX; }
56 Double_t GetZ0() const { return fZ0; }
57 Double_t GetDZ0() const { return fZLength;}
58 Int_t GetNClusters() const { return fN; }
59 Int_t GetPlane() const { return fPlane; }
60 Int_t GetStack() const { return fStack; }
61 Int_t GetSector() const { return fSector; }
62 void InsertCluster(AliTRDcluster *c, UInt_t index);
eb38ed55 63
ac1dec3b 64 Bool_t IsT0() const {return TestBit(kT0);}
65 Bool_t IsOwner() const {return TestBit(kOwner);}
66
4d6aee34 67 void Print(Option_t *opt=NULL) const;
8368e0ee 68 Int_t SearchNearestCluster(Double_t y, Double_t z, Double_t Roady, Double_t Roadz) const;
3a039a31 69 void SetRange(Float_t z0, Float_t zLength);
8368e0ee 70 void SetNRows(Int_t nRows){ fNRows = nRows; }
3a039a31 71 void SetPlane(Int_t plane){ fPlane = plane; }
4d6aee34 72 void SetReconstructor(const AliTRDReconstructor *rec) {fkReconstructor = rec;}
3a039a31 73 void SetStack(Int_t stack){ fStack = stack; }
74 void SetSector(Int_t sector){ fSector = sector; }
ac1dec3b 75 void SetOwner(Bool_t copy=kTRUE);
76 void SetT0(Bool_t set=kTRUE) {SetBit(kT0, set);}
3a039a31 77 void SetX(Double_t x) {fX = x;}
eb38ed55 78private:
3a039a31 79 void Copy(TObject &o) const;
80 Int_t Find(Float_t y) const;
81 Int_t FindYPosition(Double_t y, UChar_t z, Int_t nClusters) const;
82 Int_t FindNearestYCluster(Double_t y, UChar_t z) const;
eb38ed55 83
84private:
87140b22 85 const AliTRDReconstructor *fkReconstructor; //! Global TRD reconstructor
86 Char_t fPlane; //! Plane number
87 Char_t fStack; //! Stack number in supermodule
88 Char_t fSector; //! Sector mumber
89 Char_t fNRows; //! Number of pad rows in the chamber
90 UChar_t fPositions[kMaxRows]; //! Starting index of clusters in pad row
91 Int_t fN; //! Number of clusters
92 AliTRDcluster *fClusters[kMaxClustersLayer];// Array of pointers to clusters
93 UInt_t fIndex[kMaxClustersLayer]; //! Array of cluster indexes
94 Double_t fX; //! Radial position of tb
95
3a039a31 96 // obsolete !!
87140b22 97 Double_t fZ0; // Starting position of the layer in Z direction
98 Double_t fZLength; // Length of the layer in Z direction
eb38ed55 99
87140b22 100 ClassDef(AliTRDchamberTimeBin, 2) // Tracking propagation layer for one time bin in chamber
eb38ed55 101};
102
eb38ed55 103#endif // ALITRDCHAMBERTIMEBIN_H
104