]> git.uio.no Git - u/mrichter/AliRoot.git/blob - HMPID/AliHMPIDReconstructor.h
Coding convention
[u/mrichter/AliRoot.git] / HMPID / AliHMPIDReconstructor.h
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 // HMPID base class to reconstruct an event
7 //.
8 #include <AliReconstructor.h>       //base class
9 #include "AliHMPIDTracker.h"         //CreateTracker()
10 #include <TMatrixF.h>               //UseDig()
11 #include <TClonesArray.h>           //UseDig()
12 class AliRawReader;                 //Reconstruct() with raw data   
13 class AliHMPIDDigit;                 //Dig2Clu(), UseDig()
14 class AliHMPIDCluster;               //Dig2Clu()
15
16 class AliHMPIDReconstructor: public AliReconstructor 
17 {
18 public:
19            AliHMPIDReconstructor();              
20   virtual ~AliHMPIDReconstructor()                                  {delete fDig;delete fClu;}//dtor  
21 //framework part  
22   AliTracker*  CreateTracker         (AliRunLoader*                      )const{return new AliHMPIDTracker;}            //from AliReconstructor for clusters->PID
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
29   
30   using AliReconstructor::FillESD;                                                                                      //
31   using AliReconstructor::Reconstruct;                                                                                  // 
32
33   //private part  
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
37
38   protected:
39   TObjArray *fDig;                     // tmp list of digits
40   TObjArray *fClu;                     // tmp list of clusters
41   ClassDef(AliHMPIDReconstructor, 0)   //class for the HMPID reconstruction
42 };
43
44 //__________________________________________________________________________________________________
45 AliHMPIDDigit* AliHMPIDReconstructor::UseDig(Int_t padX,Int_t padY,TClonesArray *pDigLst,TMatrixF *pPadMap)
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
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
55   else            return 0;
56 }
57
58 #endif