#ifndef HMDCDEDX2SCALE_H #define HMDCDEDX2SCALE_H #include "hparcond.h" #include "hparamlist.h" #include "TArrayF.h" class HParamList; class TH2; class TH2F; class HMdcDeDx2Scale : public HParCond { protected: Int_t fNbinTheta; Int_t fNbinPhi; TArrayF fScale; TArrayF fScaleSim; Double_t fPhiBin; Double_t fThetaBin; Int_t index(Int_t phBin, Int_t thetaBin) {return thetaBin*fNbinPhi+phBin;} Int_t thetaInd(Double_t th) {return th>=0.&&th< 90. ? th/fThetaBin : 0;} Int_t phiInd (Double_t ph) {return ph>=0.&&ph<360. ? ph/fPhiBin : 0;} Int_t ind(Double_t ph,Double_t th) {return index(phiInd(ph),thetaInd(th));} void clear(); public: HMdcDeDx2Scale(const Char_t* name ="MdcDeDx2Scale", const Char_t* title ="Mdc lookup table for correction of MdcDeDx value ", const Char_t* context="MdcDeDx2ScaleProduction"); ~HMdcDeDx2Scale(); //------------------------------------------------------ Float_t getScale(Double_t phi, Double_t theta) {return fScale[ind(phi,theta)];} Float_t getScaleSim(Double_t phi, Double_t theta) {return fScaleSim[ind(phi,theta)];} //------------------------------------------------------ Bool_t fillScaleTable(TH2* hPhiTheta); Bool_t fillScaleTableSim(TH2* hPhiTheta); TH2F* getScaleTable(void); TH2F* getScaleTableSim(void); //------------------------------------------------------ void putParams(HParamList*); Bool_t getParams(HParamList*); ClassDef(HMdcDeDx2Scale,1) // MDC DeDx correction parameters }; #endif /*!HMDCDEDX2SCALE_H*/