118 double p = t->
p4().Vect().Mag();
119 double tht = t->
p4().Theta()*57.296;
120 double charge = t->
charge();
124 if (abs(type)==11) idx=0;
125 else if (abs(type)==13) idx=1;
126 else if (abs(type)==211) idx=2;
127 else if (abs(type)==321) idx=3;
128 else if (type==2212) idx=4;
135 int currbinT =
_mdtPidPdf[0]->GetYaxis()->FindBin(tht);
136 int currbinP =
_mdtPidPdf[0]->GetZaxis()->FindBin(p);
139 TH1D *hpdf =
_mdtPidPdf[
idx]->ProjectionX(
"_tmppdf",currbinT, currbinT, currbinP, currbinP);
144 if (hpdf->Integral()>0) xsig = hpdf->GetRandom();
150 int xsigbin = hpdf->FindBin(xsig);
153 double P[6], Psum=0.;
156 for (
int k=0;k<6;++k)
158 P[k] =
_mdtPidPdf[k]->GetBinContent(xsigbin,currbinT,currbinP);
159 if (k<4) Psum += P[k];
162 if (charge>0) Psum+=P[4];
165 if (Psum<=0.) Psum=1.;
183 double theta = t->
p4().Theta();
184 double p=t->
p4().Vect().Mag();
185 double charge=t->
charge();
186 int type=abs(t->
pdt());
190 return ( charge!=0.0 && theta>=
_thtMin && theta<=_thtMax && p>
_pmin );
196 o <<
"Parameters for detector <"<<
detName()<<
">"<<endl;
197 o <<
" _thtMin = "<<
_thtMin<<endl;
198 o <<
" _thtMax = "<<
_thtMax<<endl;
199 o <<
" _pmin = "<<
_pmin<<endl;
200 o <<
" _misId = "<<
_misId<<endl;
226 if (name ==
"thtMin")
229 if (name ==
"thtMax")
238 if (name ==
"efficiency")
251 for (
int i=0;
i<6;
i++)
258 cout <<
" -W- (PndFsmMdtPid::readParameters) - file "<<
_parFileName.c_str()
259 <<
" doesn't exist. Using simple likelihood."<<endl;
void print(std::ostream &o)
void setLHElectron(double val)
void setLHProton(double val)
std::list< std::string > ArgList
void setLHMuon(double val)
void parseParameterList(ArgList &par)
virtual PndFsmResponse * respond(PndFsmTrack *t)
bool detected(PndFsmTrack *t) const
void setMuoIron(double val)
basic_ostream< char, char_traits< char > > ostream
void setDetector(PndFsmAbsDet *detector)
const std::string & detName()
TString tht(TString pts, TString exts="px py pz")
void setLHKaon(double val)
bool setParameter(std::string &name, double value)
void setDetected(bool isdet)
void setLHPion(double val)