file access optimized (thanks to Laurent)
[u/mrichter/AliRoot.git] / ITS / AliITSClusterFinder.h
CommitLineData
b0f5e3fc 1#ifndef ALIITSCLUSTERFINDER_H
2#define ALIITSCLUSTERFINDER_H
9de0700b 3
4/* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
5 * See cxx source for full Copyright notice */
6
7/* $Id$ */
b0f5e3fc 8
9////////////////////////////////////////////////
e8189707 10// ITS Cluster Finder Class //
04366a57 11// //
12// //
b0f5e3fc 13////////////////////////////////////////////////
14
e8189707 15#include <TObject.h>
16#include <TClonesArray.h>
17
18class AliITSMap;
19class AliITSresponse;
20class AliITSsegmentation;
21class AliITSRawCluster;
7d62fb64 22class AliITSgeom;
8ca6a9a5 23class AliITSdigit;
9355b256 24class AliITSRecPoint;
7d62fb64 25class AliITSDetTypeRec;
b0f5e3fc 26
9de0700b 27//----------------------------------------------------------------------
28class AliITSClusterFinder :public TObject{
aacedc3e 29 public:
28a570fd 30 AliITSClusterFinder(); // Default constructor
aacedc3e 31 // Standard Constructor
32 AliITSClusterFinder(AliITSsegmentation *seg, AliITSresponse *resp);
9de0700b 33 AliITSClusterFinder(AliITSsegmentation *seg, AliITSresponse *resp,
aacedc3e 34 TClonesArray *digits);// Standard+ Constructor
28a570fd 35 virtual ~AliITSClusterFinder(); // Destructor
9de0700b 36 //
aacedc3e 37 // Do the Reconstruction.
f8d9a5b8 38 virtual void FindRawClusters(Int_t mod=0); // Finds cluster of digits.
04366a57 39 //
aacedc3e 40 // Sets the debug flag for debugging output
41 void SetDebug(Int_t level=1){fDebug=level;}
42 // Clears the debug flag so no debugging output will be generated
43 void SetNoDebug(){fDebug=0;}
44 // Returns the debug flag value
5d766c75 45 Bool_t GetDebug(Int_t level=1)const {return fDebug>=level;}
7d62fb64 46
47 void SetITSgeom(AliITSgeom* geom) {fITSgeom=geom;}
48 AliITSgeom* GetITSgeom() const {return fITSgeom;}
aacedc3e 49 //
50 // Setters and Getters
51 // segmentation
52 virtual void SetSegmentation(AliITSsegmentation *segmentation) {
53 fSegmentation=segmentation;}
54 //Returns fSegmentation
55 virtual AliITSsegmentation* GetSegmentation()const{return fSegmentation;}
56 // Digit
57 virtual void SetDigits(TClonesArray *itsDigits) {// set digits
58 fDigits=itsDigits;fNdigits = fDigits->GetEntriesFast();}
59 virtual AliITSdigit* GetDigit(Int_t i){ // Returns ith digit
60 return (AliITSdigit*) fDigits->UncheckedAt(i);}
61 virtual TClonesArray* Digits(){return fDigits;}// Gets fDigits
62 virtual Int_t NDigits() const {return fNdigits;}// Get Number of Digits
63 // Response
64 //Return Response
65 virtual AliITSresponse* GetResponse()const{return fResponse;}
66 virtual void SetResponse(AliITSresponse *response) {// set response
67 fResponse=response;}
68 // clulsters
69 // Set fClusters up
70 virtual void SetClusters(TClonesArray *itsClusters){// set clusters
71 fClusters = itsClusters;fNRawClusters = fClusters->GetEntriesFast();}
72 // Get fCluters
73 virtual TClonesArray* Clusters(){return fClusters;}
74 // Get fCluter
75 virtual AliITSRawCluster* Cluster(Int_t i){
76 return (AliITSRawCluster*)(fClusters->At(i));}
77 // Returns the present number of enteries
78 virtual Int_t NClusters()const {return fClusters->GetEntriesFast();}
79 // returns fNRawClusters
80 virtual Int_t GetNRawClusters() const {return fNRawClusters;}
f8d9a5b8 81 // Determins if digit i has a neighbor and if so that neighor index is j.
aacedc3e 82 virtual void AddCluster(Int_t branch,AliITSRawCluster *c);
83 virtual void AddCluster(Int_t branch,AliITSRawCluster *c,
84 AliITSRecPoint &rp);
85 virtual void FillCluster(AliITSRawCluster *,Int_t) {}// fiil cluster
86 virtual void FillCluster(AliITSRawCluster *cluster) {// fill cluster
87 FillCluster(cluster,1);}
d2f55a22 88
aacedc3e 89 //
90 virtual void SetModule(Int_t module){fModule = module;}// Set module number
91 virtual Int_t GetModule()const{return fModule;}// Returns module number
92 //
93 // RecPoints
f8d9a5b8 94 // Given a cluster of digits, creates the nessesary RecPoint. May also
95 // do some peak separation.
ac74f489 96 virtual void CreateRecPoints(TObjArray *,Int_t){};
aacedc3e 97 // Others
98 virtual void SetMap(AliITSMap *m) {fMap=m;}// map
99 AliITSMap* Map(){return fMap;}// map
100 virtual Int_t GetNperMax() const {return fNperMax;}// returns fNperMax
101 // returns fDeclusterFlag
102 virtual Int_t GetDeclusterFlag()const{return fDeclusterFlag;}
103 // returns fClusterSize
104 virtual Int_t GetClusterSize() const {return fClusterSize;}
105 virtual Int_t GetNPeaks() const {return fNPeaks;}// returns fNPeaks
106 //
107 virtual Bool_t IsNeighbor(TObjArray *digs,Int_t i,Int_t j[]) const;
ac74f489 108 virtual void Decluster(AliITSRawCluster *) {}// Decluster
aacedc3e 109 // Set max. Number of cells per local cluster
110 virtual void SetNperMax(Int_t npermax=3) {fNperMax = npermax;}
111 //Decluster
112 virtual void SetDeclusterFlag(Int_t flag=1){fDeclusterFlag=flag;}
113 // Set max. cluster size ; bigger clusters will be rejected
114 virtual void SetClusterSize(Int_t clsize=3) {fClusterSize = clsize;}
115 virtual void CalibrateCOG() {}// Self Calibration of COG
116 virtual void CorrectCOG(){}// correct COG
117 virtual Bool_t Centered(AliITSRawCluster *) const {return kTRUE;}// cluster
118 //split by local maxima
119 virtual void SplitByLocalMaxima(AliITSRawCluster *){}
120 // IO functions
7d62fb64 121 void Print(ostream *os) const; // Class ascii print function
aacedc3e 122 void Read(istream *os); // Class ascii read function
d2f55a22 123 virtual void Print(Option_t *option="") const {TObject::Print(option);}
124 virtual Int_t Read(const char *name) {return TObject::Read(name);}
e8189707 125
7d62fb64 126 virtual void SetDetTypeRec(AliITSDetTypeRec* dtr) {fDetTypeRec=dtr;}
127 AliITSDetTypeRec* GetDetTypeRec() const {return fDetTypeRec;}
04366a57 128
7d62fb64 129 void InitGeometry();
04366a57 130
aacedc3e 131 protected:
04366a57 132 // methods
04366a57 133 AliITSClusterFinder(const AliITSClusterFinder &source); // copy constructor
134 // assignment operator
135 AliITSClusterFinder& operator=(const AliITSClusterFinder &source);
136 // data members
aacedc3e 137 Int_t fDebug; //! Debug flag/level
138 Int_t fModule; //! Module number to be reconstuctted
bf3f2830 139 TClonesArray *fDigits; //! digits
88cb7938 140 Int_t fNdigits; //! num of digits
141
9de0700b 142 AliITSresponse *fResponse; //! response
aacedc3e 143 AliITSsegmentation *fSegmentation; //! segmentation
144 TClonesArray *fClusters; //! Array of clusters
9de0700b 145 Int_t fNRawClusters; //! in case we split the cluster
146 // and want to keep track of
147 // the cluster which was splitted
148 AliITSMap *fMap; //! map
149 Int_t fNperMax; //! NperMax
150 Int_t fDeclusterFlag; //! DeclusterFlag
151 Int_t fClusterSize; //! ClusterSize
152 Int_t fNPeaks; //! NPeaks
04366a57 153 // Data members needed to fill AliCluster objects
154 Float_t fYshift[2200]; // y-shifts of detector local coor. systems
155 Float_t fZshift[2200]; // z-shifts of detector local coor. systems
156 Int_t fNdet[2200]; // detector index
157 Int_t fNlayer[2200]; // detector layer
7d62fb64 158 AliITSDetTypeRec* fDetTypeRec; //ITS object for reconstruction
159 AliITSgeom* fITSgeom; //!ITS geometry
aacedc3e 160
7d62fb64 161 ClassDef(AliITSClusterFinder,5) //Class for clustering and reconstruction of space points
9de0700b 162};
aacedc3e 163// Input and output functions for standard C++ input/output.
164ostream &operator<<(ostream &os,AliITSClusterFinder &source);
165istream &operator>>(istream &os,AliITSClusterFinder &source);
b0f5e3fc 166#endif