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