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 */
6 // HMPID base class to reconstruct an event
8 #include <AliReconstructor.h> //base class
9 #include "AliHMPIDTracker.h" //CreateTracker()
10 #include "AliHMPIDDigit.h" //Dig2Clu(), UseDig()
12 #include <TMatrixF.h> //UseDig()
13 #include <TClonesArray.h> //UseDig()
14 #include <TObjArray.h> //SigConv()
15 class AliRawReader; //Reconstruct() with raw data
16 class AliHMPIDCluster; //Dig2Clu()
18 class AliHMPIDReconstructor: public AliReconstructor
21 AliHMPIDReconstructor();
22 virtual ~AliHMPIDReconstructor() {delete fDig;delete fClu;delete [] fUserCut;}//dtor
24 AliTracker* CreateTracker () const {return new AliHMPIDTracker;} //from AliReconstructor for clusters->PID
25 void ConvertDigits (AliRawReader *pRR, TTree *pDigTree) const; //from AliReconstruction for raw->digit
26 Bool_t HasDigitConversion() const {return kTRUE;} //HMPID digits converted with ConvertDigits
27 void Reconstruct (TTree* digitsTree, TTree* clustersTree) const; //from AliReconstruction for digit->cluster
28 void FillESD (TTree* /*digitsTree*/, TTree* /*clustersTree*/, AliESDEvent *pESD)const; //calculate pid for HMPID
30 using AliReconstructor::FillESD; //
31 using AliReconstructor::Reconstruct; //
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 inline Bool_t IsDigSurvive(AliHMPIDDigit *pDig )const;//check for sigma cut
40 Int_t *fUserCut; // n sigmas for pedestals decided by the User for each chamber(if in OCDB)
41 TObjArray *fDaqSig; // container for the pad pedestal sigmas
42 TObjArray *fDig; // tmp list of digits
43 TObjArray *fClu; // tmp list of clusters
46 AliHMPIDReconstructor(const AliHMPIDReconstructor& r); //dummy copy constructor
47 AliHMPIDReconstructor &operator=(const AliHMPIDReconstructor& r); //dummy assignment operator
49 ClassDef(AliHMPIDReconstructor, 0) // class for the HMPID reconstruction
52 //__________________________________________________________________________________________________
53 AliHMPIDDigit* AliHMPIDReconstructor::UseDig(Int_t padX,Int_t padY,TClonesArray *pDigLst,TMatrixF *pPadMap)
55 //Digit map contains a matrix if digit numbers.
56 //Main operation in forming initial cluster is done here. Requested digit pointer is returned and this digit marked as taken.
57 //Arguments: padX,padY - pad number
58 // pDigLst - list of digits for one sector
59 // pDigMap - map of those digits
60 // Returns: pointer to digit if not yet used or 0 if used
61 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
62 if(iDig!=-1) return (AliHMPIDDigit*)pDigLst->At(iDig); //digit pointer
65 //++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
66 Bool_t AliHMPIDReconstructor::IsDigSurvive(AliHMPIDDigit *pDig)const
68 //Check if the current digit survive to a riapllied sigma cut
69 //Arguments: pDig pointer to the current digit
70 // Returns: kTRUE if charge > mean+n*sigma
71 Int_t iCh = pDig->Ch();
72 Int_t iDaqSigCut =(Int_t)fDaqSig->At(iCh)->GetUniqueID();
73 if(fUserCut[iCh]<=iDaqSigCut) return kTRUE;
74 TMatrixF *pM = (TMatrixF*)fDaqSig->At(pDig->Ch());
75 Float_t sig = (*pM)(pDig->PadChX(),pDig->PadChY());
76 if(pDig->Q()>fUserCut[iCh]*sig) return kTRUE;