]> git.uio.no Git - u/mrichter/AliRoot.git/blame - ITS/AliITSClusterFinder.h
macro to configure EMCAL trigger QA analysis
[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>
87f41a67 17#include "AliLog.h"
e8189707 18
19class AliITSMap;
20class AliITSresponse;
21class AliITSsegmentation;
8ca6a9a5 22class AliITSdigit;
9355b256 23class AliITSRecPoint;
7d62fb64 24class AliITSDetTypeRec;
5d2c2f86 25class AliRawReader;
6c8e94cf 26class TArrayI;
b0f5e3fc 27
9de0700b 28//----------------------------------------------------------------------
29class AliITSClusterFinder :public TObject{
aacedc3e 30 public:
28a570fd 31 AliITSClusterFinder(); // Default constructor
aacedc3e 32 // Standard Constructor
8ba39da9 33 AliITSClusterFinder(AliITSDetTypeRec* dettyp);
34 AliITSClusterFinder(AliITSDetTypeRec* dettyp,TClonesArray *digits);// Standard+ Constructor
28a570fd 35 virtual ~AliITSClusterFinder(); // Destructor
9de0700b 36 //
aacedc3e 37 // Do the Reconstruction.
87f41a67 38 virtual void FindRawClusters(Int_t /*mod*/)=0; // Finds cluster of digits.
01ef1bd4 39 virtual void RawdataToClusters(AliRawReader* /*rawReader*/) {
87f41a67 40 AliError("Method not implemented in this class ");
41 }
42
aacedc3e 43 // Digit
44 virtual void SetDigits(TClonesArray *itsDigits) {// set digits
45 fDigits=itsDigits;fNdigits = fDigits->GetEntriesFast();}
46 virtual AliITSdigit* GetDigit(Int_t i){ // Returns ith digit
47 return (AliITSdigit*) fDigits->UncheckedAt(i);}
48 virtual TClonesArray* Digits(){return fDigits;}// Gets fDigits
49 virtual Int_t NDigits() const {return fNdigits;}// Get Number of Digits
87f41a67 50
aacedc3e 51 // Set fClusters up
52 virtual void SetClusters(TClonesArray *itsClusters){// set clusters
87f41a67 53 fClusters = itsClusters;}
aacedc3e 54 // Get fCluters
55 virtual TClonesArray* Clusters(){return fClusters;}
aacedc3e 56 // Returns the present number of enteries
57 virtual Int_t NClusters()const {return fClusters->GetEntriesFast();}
d2f55a22 58
aacedc3e 59 virtual void SetModule(Int_t module){fModule = module;}// Set module number
00a7cc50 60 virtual Int_t GetModule()const {return fModule;}// Returns module number
5d2c2f86 61
87f41a67 62 void SetEvent(Int_t event) { fEvent=event; }
5d2c2f86 63
aacedc3e 64 // Others
65 virtual void SetMap(AliITSMap *m) {fMap=m;}// map
66 AliITSMap* Map(){return fMap;}// map
aacedc3e 67 virtual Int_t GetNPeaks() const {return fNPeaks;}// returns fNPeaks
68 //
69 virtual Bool_t IsNeighbor(TObjArray *digs,Int_t i,Int_t j[]) const;
aacedc3e 70 // Set max. cluster size ; bigger clusters will be rejected
87f41a67 71
aacedc3e 72 // IO functions
7d62fb64 73 void Print(ostream *os) const; // Class ascii print function
aacedc3e 74 void Read(istream *os); // Class ascii read function
d2f55a22 75 virtual void Print(Option_t *option="") const {TObject::Print(option);}
76 virtual Int_t Read(const char *name) {return TObject::Read(name);}
e8189707 77
7d62fb64 78 virtual void SetDetTypeRec(AliITSDetTypeRec* dtr) {fDetTypeRec=dtr;}
79 AliITSDetTypeRec* GetDetTypeRec() const {return fDetTypeRec;}
04366a57 80
7d62fb64 81 void InitGeometry();
6c8e94cf 82 //
83 Int_t GetNClusters() const {return fNClusters;}
84 void SetRawID2ClusID(TArrayI *arr) {fRawID2ClusID = arr;}
85 TArrayI* GetRawID2ClusID() const {return fRawID2ClusID;}
86 //
aacedc3e 87 protected:
5d2c2f86 88 class Ali1Dcluster {
89 public:
90 void SetY(Float_t y) {fY=y;}
91 void SetQ(Float_t q) {fQ=q;}
92 void SetNd(Int_t n) {fNd=n;}
93 void SetLabels(Int_t *lab) {fLab[0]=lab[0];fLab[1]=lab[1];fLab[2]=lab[2];}
94 Float_t GetY() const {return fY;}
95 Float_t GetQ() const {return fQ;}
96 Int_t GetNd()const {return fNd;}
97 Int_t GetLabel(Int_t lab) const { return fLab[lab]; }
98 protected:
99 Float_t fY; //cluster position
100 Float_t fQ; //cluster charge
101 Int_t fNd; //number of digits
102 Int_t fLab[3]; //track label
103 };
104 class AliBin {
105 public:
6c8e94cf 106 AliBin():fIndex(0),fMask(0xFFFFFFFE),fRawID(-1),fQ(0){}
5d2c2f86 107 void SetIndex(UInt_t idx) {fIndex=idx;}
108 void SetQ(UShort_t q) {fQ=q;}
109 void SetMask(UInt_t m) {fMask=m;}
6c8e94cf 110 void SetRawID(Int_t id) {fRawID=id;}
111 void Reset() {fIndex=0; fMask=0xFFFFFFFE; fQ=0; fRawID=-1;}
5d2c2f86 112
113 void Use() {fMask&=0xFFFFFFFE;}
114 Bool_t IsNotUsed() const {return (fMask&1);}
115 Bool_t IsUsed() const {return !(IsNotUsed());}
116
117 UInt_t GetIndex() const {return fIndex;}
118 UShort_t GetQ() const {return fQ;}
119 UInt_t GetMask() const {return fMask;}
6c8e94cf 120 Int_t GetRawID() const {return fRawID;}
5d2c2f86 121 protected:
122 UInt_t fIndex; //digit index
123 UInt_t fMask; //peak mask
6c8e94cf 124 Int_t fRawID; // ID of raw word (used for embedding)
5d2c2f86 125 UShort_t fQ; //signal
126 };
127 void MakeCluster(Int_t k,Int_t max,AliBin *bins,UInt_t m,AliITSRecPoint &c);
128 static Bool_t IsMaximum(Int_t k, Int_t max, const AliBin *bins);
129 static void FindPeaks(Int_t k,Int_t m,AliBin*b,Int_t*idx,UInt_t*msk,Int_t&n);
130 static void MarkPeak(Int_t k, Int_t max, AliBin *bins, UInt_t m);
131 static void FindCluster(Int_t k,Int_t maxz,AliBin *bins,Int_t &n,Int_t *idx);
132
133 static void CheckLabels2(Int_t lab[10]);
134 static void AddLabel(Int_t lab[10], Int_t label);
88cb7938 135
87f41a67 136 // data members
137
138 Int_t fModule; //! Module number to be reconstuctted
139 TClonesArray *fDigits; //! digits
140 Int_t fNdigits; //! num of digits
141
142 AliITSDetTypeRec* fDetTypeRec; //ITS object for reconstruction
143 TClonesArray *fClusters; //! Array of clusters
144 AliITSMap *fMap; //! map
145 Int_t fNPeaks; //! NPeaks
146 // Data members needed to fill AliCluster objects
147 Int_t fNdet[2200]; // detector index
148 Int_t fNlayer[2200]; // detector layer
149
150 Int_t fNModules; // total number of modules
151 Int_t fEvent; //event number
d59a647b 152 Int_t fZmin; // minimum channel in Zloc
153 Int_t fZmax; // maximum channel in Zloc
154 Int_t fXmin; // minimum channel in Xloc
155 Int_t fXmax; // maximum channel in Xloc
6c8e94cf 156 //
157 UInt_t fNClusters; // total number of clusters found
158 //
159 TArrayI* fRawID2ClusID; //! optional array to store raw word ID -> ClusID for embedding (not owned)
87f41a67 160
161 AliITSClusterFinder(const AliITSClusterFinder &source); // copy constructor
162 // assignment operator
163 AliITSClusterFinder& operator=(const AliITSClusterFinder &source);
164
165
6c8e94cf 166 ClassDef(AliITSClusterFinder,11) //Class for clustering and reconstruction of space points
9de0700b 167};
aacedc3e 168// Input and output functions for standard C++ input/output.
169ostream &operator<<(ostream &os,AliITSClusterFinder &source);
170istream &operator>>(istream &os,AliITSClusterFinder &source);
b0f5e3fc 171#endif