]> git.uio.no Git - u/mrichter/AliRoot.git/blame - TRD/AliTRDstackLayer.h
added protection
[u/mrichter/AliRoot.git] / TRD / AliTRDstackLayer.h
CommitLineData
e4f2f73d 1#ifndef ALITRDSTACKLAYER_H
2#define ALITRDSTACKLAYER_H
3
4/* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
5 * See cxx source for full Copyright notice */
6
7/* $Id$ */
8
9////////////////////////////////////////////////////////////////////////////
10// //
11// A TRD layer in a single stack //
12// //
13////////////////////////////////////////////////////////////////////////////
14
15#ifndef ALITRDPROPAGATIONLAYER_H
16#include "AliTRDpropagationLayer.h"
17#endif
18
19#ifndef ALITRDCLUSTER_H
20#include "AliTRDcluster.h"
21#endif
22
23class AliTRDrecoParam;
24
25class AliTRDstackLayer : public AliTRDpropagationLayer
26{
27 public:
28 enum{
29 kMaxClustersLayer = 150,
30 kMaxRows = 16
31 };
32
33 AliTRDstackLayer(Double_t z0 = 0., Double_t zLength = 0., UChar_t stackNr = 0
34 , AliTRDrecoParam *p=0x0);
35 AliTRDstackLayer(const AliTRDpropagationLayer &layer, Double_t z0
36 , Double_t zLength, UChar_t stackNr, AliTRDrecoParam *p = 0x0);
37 AliTRDstackLayer(const AliTRDpropagationLayer &layer);
38 AliTRDstackLayer(const AliTRDstackLayer &layer);
39 ~AliTRDstackLayer();
40 AliTRDstackLayer &operator=(const AliTRDpropagationLayer &myLayer);
41 AliTRDstackLayer &operator=(const AliTRDstackLayer &myLayer);
d76231c8 42 AliTRDcluster *operator[](const Int_t i) const {
e4f2f73d 43 return ((i < fN) && (i >= 0)) ? fClusters[i] : 0x0;
44 }
45
46 void BuildIndices(Int_t iter = 0);
47 void BuildCond(AliTRDcluster *cl, Double_t *cond, UChar_t Layer, Double_t theta=0., Double_t phi=0.);
48 AliTRDcluster* GetCluster(Int_t index) const {return index < fN ? fClusters[index] : 0x0;}
49 Int_t GetGlobalIndex(const Int_t index) const {return ((index < fN) && (index >= 0)) ? fIndex[index] : 0; }
50 void GetClusters(Double_t *cond, Int_t *index, Int_t& ncl, Int_t BufferSize = kMaxClustersLayer);
51 AliTRDcluster* GetNearestCluster(Double_t *cond);
52
53 Double_t GetZ0() const { return fZ0; }
54 Double_t GetDZ0() const { return fZLength; }
55 Int_t GetNClusters() const { return fN; }
56 UInt_t GetStackNr() const { return fStackNr; }
57 void PrintClusters() const;
58 Int_t SearchNearestCluster(const Double_t y, const Double_t z, const Double_t Roady, const Double_t Roadz) const;
59 void SetRange(Float_t z0, Float_t zLength);
60 void SetNRows(const Int_t nRows){ fNRows = nRows; }
61 void SetStackNr(const UInt_t stackNr){ fStackNr = stackNr; }
62 void SetOwner(Bool_t own = kTRUE) {fOwner = own;}
63 void SetClustersArray(AliTRDcluster **cl, Int_t nClusters){fClusters = cl; fN = nClusters;}
64 void SetIndexArray(UInt_t *indexArray){fIndex = indexArray;}
65 void SetDebugStream(TTreeSRedirector *debug) {fDebugStream = debug;}
66 void SetRecoParam(AliTRDrecoParam *p) {fRecoParam = p;}
67
68private:
69 void Copy(TObject &o) const;
70 Int_t FindYPosition(Double_t y, UChar_t z, Int_t nClusters) const;
71 Int_t FindNearestYCluster(Double_t y, UChar_t z) const;
72
73private:
74 Bool_t fOwner; // owner of the clusters
75 UChar_t fStackNr; // stack number in supermodule
76 UChar_t fNRows; // number of pad rows in the chamber
77 UChar_t fPositions[kMaxRows]; // starting index of clusters in pad row
78 Double_t fZ0; // starting position of the layer in Z direction
79 Double_t fZLength; // length of the layer in Z direction
80 AliTRDrecoParam *fRecoParam; //! reconstruction parameters
81 TTreeSRedirector *fDebugStream; //! debug streamer
82
83 ClassDef(AliTRDstackLayer, 1) // stack propagation layer
84
85};
86#endif // ALITRDSTACKLAYER_H_
87