//_HADES_CLASS_DESCRIPTION //////////////////////////////////////////////////////////////////////////// // HParticleCandFillerPar // // Container class for parameters of HParticleCandFiller // The parameters are stored in TArrayD of linearized from // provided by HHistConverter. The TArrayD parameters will // be converted to histograms, which are used to obtain the // values. Because the parameters are stored in TArrayD format // they can be inspected by the ORACLE web interface and // standard ascii file output format. For the Foramt description // see the documentaion of HHistConverter. // // parameters : // 1-dim RICH-MDC matching cuts per sector as function of momentum [MeV/c] // // phiLow , phiUp per sector = lower/upper boundaries of RICH-MDC matching in delta Phi [deg] // thetaLow, thetaUp per sector = lower/upper boundaries of RICH-MDC matching in delta Theta [deg] // // RICH 2-dim correction for Theta as function of event vertex z position // 1. dim = z position // 2. dim = 8 parameters for polynom // // Usage: // // Float_t HParticleCandFillerPar::getRichCorr(Float_t zVertex, Float_t thetaRich); // // returns the correction for theta which should be added to thetarich (deg). // // // Bool_t HParticleCandFillerPar::acceptPhiTheta(Int_t s,Float_t mom,Float_t dphi,Float_t dtheta); // // check if the values for deltaPhi and deltaTheta, where // deltaPhi = (rich.phi - MDC.phi ) * TMath::Sin(TMath::DegToRad() * MDC.theta) and // deltaTheta = rich.theta - MDC.theta, // are inside the cut. // // //////////////////////////////////////////////////////////////////////////// #include "hparticlecandfillerpar.h" #include "hpario.h" #include "hparamlist.h" #include "hhistconverter.h" #include "TMath.h" #include using namespace std; ClassImp(HParticleCandFillerPar) HParticleCandFillerPar::HParticleCandFillerPar(const Char_t* name,const Char_t* title, const Char_t* context) : HParCond(name,title,context) { // clear(); } HParticleCandFillerPar::~HParticleCandFillerPar() { // destructor removeHists(); } void HParticleCandFillerPar::removeHists(){ for(Int_t s = 0; s < 6; s ++){ if(hphiLow [s]) delete hphiLow [s]; if(hphiUp [s]) delete hphiUp [s]; if(hthetaLow[s]) delete hthetaLow[s]; if(hthetaUp [s]) delete hthetaUp [s]; hphiLow [s] = 0; hphiUp [s] = 0; hthetaLow[s] = 0; hthetaUp [s] = 0; } if(hrichCorr) delete hrichCorr; hrichCorr = 0; } void HParticleCandFillerPar::createHists(){ for(Int_t s = 0; s < 6; s ++){ hphiLow [s] = (TH1D*)HHistConverter::createHist(Form("hphiLowS%i" ,s),phiLow [s]); hphiUp [s] = (TH1D*)HHistConverter::createHist(Form("hphiUpS%i" ,s),phiUp [s]); hthetaLow[s] = (TH1D*)HHistConverter::createHist(Form("hthetaLowS%i",s),thetaLow[s]); hthetaUp [s] = (TH1D*)HHistConverter::createHist(Form("hthetaUpS%i" ,s),thetaUp [s]); } hrichCorr = (TH2D*)HHistConverter::createHist("hrichCorr",richCorr); } void HParticleCandFillerPar::clear() { for(Int_t s = 0; s < 6; s ++){ hphiLow [s] = 0; hphiUp [s] = 0; hthetaLow[s] = 0; hthetaUp [s] = 0; } hrichCorr = 0; status=kFALSE; resetInputVersions(); changed=kFALSE; } void HParticleCandFillerPar::printParam(void) { cout<<"############################################################"<add(Form("phiLowS%i" ,s), phiLow[s]); } for(Int_t s = 0; s < 6; s ++){ l->add(Form("phiUpS%i" ,s), phiUp[s]); } for(Int_t s = 0; s < 6; s ++){ l->add(Form("thetaLowS%i",s), thetaLow[s]); } for(Int_t s = 0; s < 6; s ++){ l->add(Form("thetaUpS%i" ,s), thetaUp[s]); } l->add("richCorr",richCorr); } Bool_t HParticleCandFillerPar::getParams(HParamList* l) { if (!l) return kFALSE; for(Int_t s = 0; s < 6; s ++){ if(! (l->fill(Form("phiLowS%i" ,s), &phiLow[s]) )) return kFALSE; } for(Int_t s = 0; s < 6; s ++){ if(! (l->fill(Form("phiUpS%i" ,s), &phiUp[s]) )) return kFALSE; } for(Int_t s = 0; s < 6; s ++){ if(! (l->fill(Form("thetaLowS%i",s), &thetaLow[s]) )) return kFALSE; } for(Int_t s = 0; s < 6; s ++){ if(! (l->fill(Form("thetaUpS%i" ,s), &thetaUp[s]) )) return kFALSE; } if(! (l->fill("richCorr",&richCorr) )) return kFALSE; return kTRUE; } void HParticleCandFillerPar::setPhiLow (Int_t s, const TArrayD& linData) { if(s >= 0 && s < 6) { phiLow [s].Set(linData.GetSize(),linData.GetArray()); if(hphiLow[s]) delete hphiLow[s]; hphiLow[s] = (TH1D*) HHistConverter::createHist(Form("hphiLowS%i",s),phiLow[s]); } } void HParticleCandFillerPar::setPhiUp (Int_t s, const TArrayD& linData) { if(s >= 0 && s < 6) { phiUp [s].Set(linData.GetSize(),linData.GetArray()); if(hphiUp[s]) delete hphiUp[s]; hphiUp[s] = (TH1D*) HHistConverter::createHist(Form("hphiUpS%i",s),phiUp[s]); } } void HParticleCandFillerPar::setThetaLow(Int_t s, const TArrayD& linData) { if(s >= 0 && s < 6) { thetaLow[s].Set(linData.GetSize(),linData.GetArray()); if(hthetaLow[s]) delete hthetaLow[s]; hthetaLow[s] = (TH1D*) HHistConverter::createHist(Form("hthetaLowS%i",s),thetaLow[s]); } } void HParticleCandFillerPar::setThetaUp (Int_t s, const TArrayD& linData) { if(s >= 0 && s < 6) { thetaUp [s].Set(linData.GetSize(),linData.GetArray()); if(hthetaUp[s]) delete hthetaUp[s]; hthetaUp[s] = (TH1D*) HHistConverter::createHist(Form("hthetaUpS%i",s),thetaUp[s]); } } void HParticleCandFillerPar::setRichCorr(const TArrayD& linData){ richCorr.Set(linData.GetSize(),linData.GetArray()); if(hrichCorr) delete hrichCorr; hrichCorr = (TH2D*) HHistConverter::createHist("hrichCorr",richCorr); } Float_t HParticleCandFillerPar::getRichCorr(Float_t zVertex, Float_t thetaRich){ // returns the correction for theta which should be added to thetarich (deg) Float_t richThetaCorr = 0.0f; for(Int_t i = 0; i< 8; i ++){ richThetaCorr += (Float_t)(HParticleTool::getValue(hrichCorr,zVertex,i) * TMath::Power(thetaRich,i)); } return richThetaCorr; } Bool_t HParticleCandFillerPar::acceptPhiTheta(Int_t s,Float_t mom,Float_t dphi,Float_t dtheta){ // check if the values for deltaPhi and deltaTheta, where // deltaPhi = (rich.phi - MDC.phi ) * TMath::Sin(TMath::DegToRad() * MDC.theta) // deltaTheta = rich.theta - MDC.theta; // are inside the cut. if(dtheta < HParticleTool::getInterpolatedValue(hthetaUp [s],mom,kFALSE) && dtheta > HParticleTool::getInterpolatedValue(hthetaLow[s],mom,kFALSE) && dphi < HParticleTool::getInterpolatedValue(hphiUp [s],mom,kFALSE) && dphi > HParticleTool::getInterpolatedValue(hphiLow [s],mom,kFALSE) ) return kTRUE; return kFALSE; }