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