]>
Commit | Line | Data |
---|---|---|
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 | |
7 | //. | |
a0e5c1b9 | 8 | #include <AliReconstructor.h> //base class |
d3da6dc4 | 9 | #include "AliHMPIDTracker.h" //CreateTracker() |
a0e5c1b9 | 10 | #include "AliHMPIDDigit.h" //Dig2Clu(), UseDig() |
21f61e25 | 11 | |
a0e5c1b9 | 12 | #include <TMatrixF.h> //UseDig() |
13 | #include <TClonesArray.h> //UseDig() | |
14 | #include <TObjArray.h> //SigConv() | |
15 | class AliRawReader; //Reconstruct() with raw data | |
d3da6dc4 | 16 | class AliHMPIDCluster; //Dig2Clu() |
17 | ||
18 | class AliHMPIDReconstructor: public AliReconstructor | |
19 | { | |
20 | public: | |
94b1fbfa | 21 | AliHMPIDReconstructor(); |
17773e2e | 22 | virtual ~AliHMPIDReconstructor() {delete fDig;delete fClu;delete [] fUserCut;}//dtor |
d3da6dc4 | 23 | //framework part |
d76c31f4 | 24 | AliTracker* CreateTracker () const {return new AliHMPIDTracker;} //from AliReconstructor for clusters->PID |
94b1fbfa | 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 | |
d76c31f4 | 28 | void FillESD (TTree* /*digitsTree*/, TTree* /*clustersTree*/, AliESDEvent *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 | |
a0e5c1b9 | 37 | inline Bool_t IsDigSurvive(AliHMPIDDigit *pDig )const;//check for sigma cut |
d3da6dc4 | 38 | protected: |
9cc1a411 | 39 | Int_t *fUserCut; // n sigmas for pedestals decided by the User for each chamber(if in OCDB) |
a0e5c1b9 | 40 | TObjArray *fDaqSig; // container for the pad pedestal sigmas |
94b1fbfa | 41 | TObjArray *fDig; // tmp list of digits |
42 | TObjArray *fClu; // tmp list of clusters | |
a0e5c1b9 | 43 | ClassDef(AliHMPIDReconstructor, 0) // class for the HMPID reconstruction |
d3da6dc4 | 44 | }; |
cf7e313e | 45 | |
d3da6dc4 | 46 | //__________________________________________________________________________________________________ |
3c6274c1 | 47 | AliHMPIDDigit* AliHMPIDReconstructor::UseDig(Int_t padX,Int_t padY,TClonesArray *pDigLst,TMatrixF *pPadMap) |
d3da6dc4 | 48 | { |
49 | //Digit map contains a matrix if digit numbers. | |
50 | //Main operation in forming initial cluster is done here. Requested digit pointer is returned and this digit marked as taken. | |
51 | //Arguments: padX,padY - pad number | |
52 | // pDigLst - list of digits for one sector | |
53 | // pDigMap - map of those digits | |
54 | // Returns: pointer to digit if not yet used or 0 if used | |
3c6274c1 | 55 | 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 |
56 | if(iDig!=-1) return (AliHMPIDDigit*)pDigLst->At(iDig); //digit pointer | |
d3da6dc4 | 57 | else return 0; |
58 | } | |
a0e5c1b9 | 59 | //++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
60 | Bool_t AliHMPIDReconstructor::IsDigSurvive(AliHMPIDDigit *pDig)const | |
61 | { | |
62 | //Check if the current digit survive to a riapllied sigma cut | |
63 | //Arguments: pDig pointer to the current digit | |
64 | // Returns: kTRUE if charge > mean+n*sigma | |
9cc1a411 | 65 | Int_t iCh = pDig->Ch(); |
66 | Int_t iDaqSigCut =(Int_t)fDaqSig->At(iCh)->GetUniqueID(); | |
67 | if(fUserCut[iCh]<=iDaqSigCut) return kTRUE; | |
a0e5c1b9 | 68 | TMatrixF *pM = (TMatrixF*)fDaqSig->At(pDig->Ch()); |
69 | Float_t sig = (*pM)(pDig->PadChX(),pDig->PadChY()); | |
9cc1a411 | 70 | if(pDig->Q()>fUserCut[iCh]*sig) return kTRUE; |
a0e5c1b9 | 71 | else return kFALSE; |
72 | } | |
d3da6dc4 | 73 | |
74 | #endif |