gAlice dependence removed!
[u/mrichter/AliRoot.git] / HMPID / AliHMPIDReconstructor.h
CommitLineData
d3da6dc4 1#ifndef AliHMPIDReconstructor_h
2#define AliHMPIDReconstructor_h
3/* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
4 * See cxx source for full Copyright notice */
5
6#include <AliReconstructor.h> //base class
7#include "AliHMPIDTracker.h" //CreateTracker()
8#include <TMatrixF.h> //UseDig()
9#include <TClonesArray.h> //UseDig()
10class AliRawReader; //Reconstruct() with raw data
11class AliHMPIDDigit; //Dig2Clu(), UseDig()
12class AliHMPIDCluster; //Dig2Clu()
13
14class AliHMPIDReconstructor: public AliReconstructor
15{
16public:
94b1fbfa 17 AliHMPIDReconstructor();
18 virtual ~AliHMPIDReconstructor() {delete fDig;delete fClu;}//dtor
d3da6dc4 19//framework part
20 AliTracker* CreateTracker (AliRunLoader* )const{return new AliHMPIDTracker;} //from AliReconstructor for clusters->PID
94b1fbfa 21 void ConvertDigits (AliRawReader *pRR, TTree *pDigTree) const; //from AliReconstruction for raw->digit
22 Bool_t HasDigitConversion() const {return kTRUE;} //HMPID digits converted with ConvertDigits
23 void Reconstruct (TTree* digitsTree, TTree* clustersTree) const; //from AliReconstruction for digit->cluster
24 void Reconstruct (AliRunLoader *pAL,AliRawReader* pRR)const; //from AliReconstruction for raw->cluster with Digits on fly
25 Bool_t HasLocalReconstruction() const {return kTRUE;} // HMPID has local reconstruction algorithm
26 void FillESD (AliRunLoader* pAL,AliESD *pESD)const; //calculate pid for HMPID
d3da6dc4 27
94b1fbfa 28 using AliReconstructor::FillESD; //
29 using AliReconstructor::Reconstruct; //
d3da6dc4 30
31 //private part
3c6274c1 32 static void Dig2Clu (TObjArray *pDigLst,TObjArray *pCluLst,Bool_t isUnfold=kTRUE );//digits->clusters
33 static void FormClu (AliHMPIDCluster *pClu,AliHMPIDDigit *pDig,TClonesArray *pDigLst,TMatrixF *pPadMap);//cluster formation recursive algorithm
34 static inline AliHMPIDDigit* UseDig (Int_t padX,Int_t padY, TClonesArray *pDigLst,TMatrixF *pDigMap);//use this pad's digit to form a cluster
d3da6dc4 35
36 protected:
94b1fbfa 37 TObjArray *fDig; // tmp list of digits
38 TObjArray *fClu; // tmp list of clusters
d3da6dc4 39 ClassDef(AliHMPIDReconstructor, 0) //class for the HMPID reconstruction
40};
cf7e313e 41
d3da6dc4 42//__________________________________________________________________________________________________
3c6274c1 43AliHMPIDDigit* AliHMPIDReconstructor::UseDig(Int_t padX,Int_t padY,TClonesArray *pDigLst,TMatrixF *pPadMap)
d3da6dc4 44{
45//Digit map contains a matrix if digit numbers.
46//Main operation in forming initial cluster is done here. Requested digit pointer is returned and this digit marked as taken.
47//Arguments: padX,padY - pad number
48// pDigLst - list of digits for one sector
49// pDigMap - map of those digits
50// Returns: pointer to digit if not yet used or 0 if used
3c6274c1 51 Int_t iDig=(Int_t)(*pPadMap)(padX,padY);(*pPadMap)(padX,padY)=-1;//take digit number from the map and reset this map cell to -1
52 if(iDig!=-1) return (AliHMPIDDigit*)pDigLst->At(iDig); //digit pointer
d3da6dc4 53 else return 0;
54}
55
56#endif