]> git.uio.no Git - u/mrichter/AliRoot.git/blob - HMPID/AliHMPIDReconstructor.h
correction of trivial typo preventing compilation
[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 "AliHMPIDDigit.h"           //Dig2Clu(), UseDig()
11 #include "AliHMPIDRecoParam.h"       //Init
12
13 #include <TMatrixF.h>                //UseDig()
14 #include <TClonesArray.h>            //UseDig()
15 #include <TObjArray.h>               //SigConv()
16 class AliRawReader;                  //Reconstruct() with raw data   
17 class AliHMPIDCluster;               //Dig2Clu()
18
19 class AliHMPIDReconstructor: public AliReconstructor 
20 {
21 public:
22            AliHMPIDReconstructor();              
23   virtual ~AliHMPIDReconstructor()                                  {delete fDig;delete fClu;delete [] fUserCut;}//dtor  
24 //framework part  
25   AliTracker*  CreateTracker         () const {return new AliHMPIDTracker;}            //from AliReconstructor for clusters->PID
26   void         ConvertDigits         (AliRawReader *pRR, TTree *pDigTree) const;                                        //from AliReconstruction for raw->digit
27   Bool_t       HasDigitConversion()   const {return kTRUE;}                                                             //HMPID digits converted with ConvertDigits 
28   void         Reconstruct           (TTree* digitsTree, TTree* clustersTree) const;                                    //from AliReconstruction for digit->cluster
29   void         FillESD               (TTree* /*digitsTree*/, TTree* /*clustersTree*/, AliESDEvent *pESD)const;                                        //calculate pid for HMPID
30   
31   using AliReconstructor::FillESD;                                                                                      //
32   using AliReconstructor::Reconstruct;                                                                                  // 
33
34   //private part  
35   static        void           Dig2Clu (TObjArray *pDigLst,TObjArray *pCluLst,Bool_t isUnfold=kFALSE                      );//digits->clusters
36   static        void           FormClu (AliHMPIDCluster *pClu,AliHMPIDDigit *pDig,TClonesArray *pDigLst,TMatrixF *pPadMap);//cluster formation recursive algorithm
37   static inline AliHMPIDDigit* UseDig  (Int_t padX,Int_t padY,                    TClonesArray *pDigLst,TMatrixF *pDigMap);//use this pad's digit to form a cluster
38   inline Bool_t                IsDigSurvive(AliHMPIDDigit *pDig                                                     )const;//check for sigma cut
39   
40   void SetRecoParam(AliHMPIDRecoParam *recopar){ fgkRecoParam = recopar;}
41   static const AliHMPIDRecoParam* GetRecoParam(){ return fgkRecoParam;}
42
43   
44   protected:
45   static AliHMPIDRecoParam*  fgkRecoParam;      // Pointer to HMPID RecoParams
46   Int_t     *fUserCut;                 // n sigmas for pedestals decided by the User for each chamber(if in OCDB)
47   TObjArray *fDaqSig;                  // container for the pad pedestal sigmas
48   TObjArray *fDig;                     // tmp list of digits
49   TObjArray *fClu;                     // tmp list of clusters
50 //
51   private:
52   AliHMPIDReconstructor(const AliHMPIDReconstructor& r);              //dummy copy constructor
53   AliHMPIDReconstructor &operator=(const AliHMPIDReconstructor& r);   //dummy assignment operator
54 //  
55   ClassDef(AliHMPIDReconstructor, 1)   // class for the HMPID reconstruction
56 };
57
58 //++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
59 AliHMPIDDigit* AliHMPIDReconstructor::UseDig(Int_t padX,Int_t padY,TClonesArray *pDigLst,TMatrixF *pPadMap)
60 {
61 //Digit map contains a matrix if digit numbers.
62 //Main operation in forming initial cluster is done here. Requested digit pointer is returned and this digit marked as taken.
63 //Arguments: padX,padY - pad number
64 //           pDigLst   - list of digits for one sector
65 //           pDigMap   - map of those digits
66 //  Returns: pointer to digit if not yet used or 0 if used
67   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
68   if(iDig!=-1)    return (AliHMPIDDigit*)pDigLst->At(iDig);        //digit pointer
69   else            return 0;
70 }
71 //++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
72 Bool_t AliHMPIDReconstructor::IsDigSurvive(AliHMPIDDigit *pDig)const
73 {
74 //Check if the current digit survive to a riapllied sigma cut
75 //Arguments: pDig pointer to the current digit
76 //  Returns: kTRUE if charge > mean+n*sigma
77   Int_t iCh = pDig->Ch();
78   Int_t iDaqSigCut =(Int_t)fDaqSig->At(iCh)->GetUniqueID(); 
79   if(fUserCut[iCh]<=iDaqSigCut) return kTRUE;
80   TMatrixF *pM = (TMatrixF*)fDaqSig->At(pDig->Ch());
81   Float_t sig = (*pM)(pDig->PadChX(),pDig->PadChY());
82   if(pDig->Q()>fUserCut[iCh]*sig) return kTRUE;
83   else return kFALSE;
84 }
85
86 #endif