54 #include "TParameter.h"
69 std::cout<<
" -I- (PndFsmCombiDet::PndFsmCombiDet) - Using parameter file '"<<
_parFileName<<
"'"<<endl;
75 std::cout<<
" -I- (PndFsmCombiDet::PndFsmCombiDet) - Creating arbitrary detector set"<<endl;
156 for (FsmAbsDetList::iterator iter=
fDetList.begin();iter!=
fDetList.end(); iter++) {
162 if (
fabs(val = resp->
dE()) > 1e-8) dE+=1/(val*
val);
163 if (
fabs(val = resp->
dt()) > 1e-8) dt += val*
val;
164 if (
fabs(val = resp->
dm()) > 1e-8) dm +=
val;
165 if (
fabs (val = resp->
m2()) > 1e-11) m2+=
val;
187 Double_t sumRaw = rawLHe+rawLHmu+rawLHpi+rawLHK+rawLHp;
220 detected &= ( p >
_mom0[
pid]->GetVal() );
221 detected &= ( theta >=
_tht0->GetVal() );
222 detected &= ( theta <=
_tht1->GetVal() );
243 if (
fabs(val = resp->
dE()) > 1e-8) dE-=1/(val*
val);
244 if (
fabs(val = resp->
dp()) > 1e-8) dp-=1/(val*
val);
246 if (
fabs(val = resp->
dphi()) > 1e-8) dphi-=1/(val*
val);
247 if (
fabs(val = resp->
dt()) > 1e-8) dt -= val*
val;
248 if (
fabs(val = resp->
dm()) > 1e-8) dm -=
val;
249 if (
fabs (val = resp->
m2()) > 1e-11) m2-=
val;
265 if (
fabs (val = resp->
dV().X()) > 1e-11) dVx-=1/(val*
val);
266 if (
fabs (val = resp->
dV().Y()) > 1e-11) dVy-=1/(val*
val);
267 if (
fabs (val = resp->
dV().Z()) > 1e-11) dVz-=1/(val*
val);
275 Double_t sumRaw = rawLHe+rawLHmu+rawLHpi+rawLHK+rawLHp;
292 Double_t sumLH = LH_e + LH_mu + LH_pi + LH_K + LH_p;
316 result->
setdE( dE>0. ? 1/
sqrt(dE) : 0.0 );
317 result->
setdp( dp>0. ? 1/
sqrt(dp) : 0.0 );
323 result->
setm2(m2, m2Err);
332 if (dVx > 0.) dVx=1./
sqrt(dVx);
else dVx = 0.0;
333 if (dVy > 0.) dVy=1./
sqrt(dVy);
else dVy = 0.0;
334 if (dVz > 0.) dVz=1./
sqrt(dVz);
else dVz = 0.0;
336 result->
setdV( dVx , dVy , dVz );
345 TLorentzVector P4=t->
p4();
348 Double_t Phi = TMath::RadToDeg() * P4.Phi();
349 Int_t PDG = t->
pdt();
351 if(PDG==211){Eff=
fPipPara->Eval(Mom,CosTheta,Phi);}
352 if(PDG==321){Eff=
fKpPara->Eval(Mom,CosTheta,Phi);}
353 if(PDG==2212){Eff=
fProtPara->Eval(Mom,CosTheta,Phi);}
354 if(PDG==-13){Eff=
fmupPara->Eval(Mom,CosTheta,Phi);}
355 if(PDG==-11){Eff=
fepPara->Eval(Mom,CosTheta,Phi);}
357 if(PDG==-211){Eff=
fPimPara->Eval(Mom,CosTheta,Phi);}
358 if(PDG==-321){Eff=
fKmPara->Eval(Mom,CosTheta,Phi);}
360 if(PDG==13){Eff=
fmumPara->Eval(Mom,CosTheta,Phi);}
361 if(PDG==11){Eff=
femPara->Eval(Mom,CosTheta,Phi);}
365 if(Eff>=Alea){detected=
true;}
366 if(Eff<Alea){detected=
false;}
395 if (name ==
"parFileName")
410 if (name ==
"d0ResMulti")
413 if (name ==
"z0ResMulti")
416 if (name ==
"thtResMulti")
419 if (name ==
"phiResMulti")
422 if (name ==
"momResMulti")
425 if (name ==
"thtMin")
428 if (name ==
"thtMax")
431 if (name ==
"pidLhMulti")
444 cout <<
" -W- (PndFsmCombiDet::readParameters) - file "<<
_parFileName
445 <<
" doesn't exist. Using constant vertex reso"<<endl;
448 _d0[11]=(TSpline3*)f.Get(
"d0E-");
449 _z0[11]=(TSpline3*)f.Get(
"z0E-");
450 _tht[11]=(TSpline3*)f.Get(
"thtE-");
451 _phi[11]=(TSpline3*)f.Get(
"phiE-");
452 _mom[11]=(TSpline3*)f.Get(
"momE-");
454 _d0Scale[11]=(TF1*)f.Get(
"d0ScaleE-");
455 _z0Scale[11]=(TF1*)f.Get(
"z0ScaleE-");
460 _d0[13]=(TSpline3*)f.Get(
"d0Mu+");
461 _z0[13]=(TSpline3*)f.Get(
"z0Mu+");
462 _tht[13]=(TSpline3*)f.Get(
"thtMu+");
463 _phi[13]=(TSpline3*)f.Get(
"phiMu+");
464 if (!
_mom0[13])
_mom[13]=(TSpline3*)f.Get(
"momMu+");
466 _d0Scale[13]=(TF1*)f.Get(
"d0ScaleMu+");
467 _z0Scale[13]=(TF1*)f.Get(
"z0ScaleMu+");
468 _thtScale[13]=(TF1*)f.Get(
"thtScaleMu+");
469 _phiScale[13]=(TF1*)f.Get(
"phiScaleMu+");
470 _momScale[13]=(TF1*)f.Get(
"momScaleMu+");
472 _d0[211]=(TSpline3*)f.Get(
"d0Pi-");
473 _z0[211]=(TSpline3*)f.Get(
"z0Pi-");
474 _tht[211]=(TSpline3*)f.Get(
"thtPi-");
475 _phi[211]=(TSpline3*)f.Get(
"phiPi-");
476 _mom[211]=(TSpline3*)f.Get(
"momPi-");
478 _d0Scale[211]=(TF1*)f.Get(
"d0ScalePi-");
479 _z0Scale[211]=(TF1*)f.Get(
"z0ScalePi-");
480 _thtScale[211]=(TF1*)f.Get(
"thtScalePi-");
481 _phiScale[211]=(TF1*)f.Get(
"phiScalePi-");
482 _momScale[211]=(TF1*)f.Get(
"momScalePi-");
484 _d0[321]=(TSpline3*)f.Get(
"d0K-");
485 _z0[321]=(TSpline3*)f.Get(
"z0K-");
486 _tht[321]=(TSpline3*)f.Get(
"thtK-");
487 _phi[321]=(TSpline3*)f.Get(
"phiK-");
488 _mom[321]=(TSpline3*)f.Get(
"momK-");
490 _d0Scale[321]=(TF1*)f.Get(
"d0ScaleK-");
491 _z0Scale[321]=(TF1*)f.Get(
"z0ScaleK-");
492 _thtScale[321]=(TF1*)f.Get(
"thtScaleK-");
493 _phiScale[321]=(TF1*)f.Get(
"phiScaleK-");
494 _momScale[321]=(TF1*)f.Get(
"momScaleK-");
496 _d0[2212]=(TSpline3*)f.Get(
"d0P+");
497 _z0[2212]=(TSpline3*)f.Get(
"z0P+");
498 _tht[2212]=(TSpline3*)f.Get(
"thtP+");
499 _phi[2212]=(TSpline3*)f.Get(
"phiP+");
500 _mom[2212]=(TSpline3*)f.Get(
"momP+");
502 _d0Scale[2212]=(TF1*)f.Get(
"d0ScaleP+");
503 _z0Scale[2212]=(TF1*)f.Get(
"z0ScaleP+");
504 _thtScale[2212]=(TF1*)f.Get(
"thtScaleP+");
505 _phiScale[2212]=(TF1*)f.Get(
"phiScaleP+");
506 _momScale[2212]=(TF1*)f.Get(
"momScaleP+");
514 std::map<Int_t, TSpline3*>::iterator
i;
515 std::map<Int_t, TParameter<Double_t>*>::iterator j;
516 std::map<Int_t, TF1*>::iterator k;
534 cout <<
" -W- (PndFsmCombiDet::readParameters) - file "<<
_parFileName
535 <<
" is defective. Using constant vertex reso"<<endl;
542 fEffFile =
new TFile(
"$VMCWORKDIR/fastsim/FsmCombiDetParas.root");
555 if(!
fPipPara) Error(
"initParameters",
"could not find \"PipPara\" in file CmpDetParas.root");
556 if(!
fPimPara) Error(
"initParameters",
"could not find \"PimPara\" in file CmpDetParas.root");
557 if(!
fKpPara) Error(
"initParameters",
"could not find \"KpPara\" in file CmpDetParas.root");
558 if(!
fKmPara) Error(
"initParameters",
"could not find \"KmPara\" in file CmpDetParas.root");
559 if(!
fProtPara) Error(
"initParameters",
"could not find \"ProtPara\" in file CmpDetParas.root");
560 if(!
fAntiProtPara) Error(
"initParameters",
"could not find \"AntiProtPara\" in file CmpDetParas.root");
561 if(!
fepPara) Error(
"initParameters",
"could not find \"epPara\" in file CmpDetParas.root");
562 if(!
femPara) Error(
"initParameters",
"could not find \"emPara\" in file CmpDetParas.root");
563 if(!
fmupPara) Error(
"initParameters",
"could not find \"mupPara\" in file CmpDetParas.root");
564 if(!
fmumPara) Error(
"initParameters",
"could not find \"mumPara\" in file CmpDetParas.root");
588 return s->Eval(xmin)+(x-
xmin)*s->Derivative(xmin);
590 return s->Eval(xmax)+(x-
xmax)*s->Derivative(xmax);
std::map< Int_t, TSpline3 * > _phi
Double_t eval(TSpline3 *spline, Double_t theta)
void setDrcBarrelThtc(double val, double err=0)
void setLHElectron(double val)
std::map< Int_t, TSpline3 * > _tht
std::map< Int_t, TSpline3 * > _d0
void setLHProton(double val)
std::list< std::string > ArgList
friend F32vec4 sqrt(const F32vec4 &a)
void setTpcdEdx(double val, double err=0)
Double_t val[nBoxes][nFEBox]
void setLHMuon(double val)
virtual ~PndFsmCombiDet()
void parseParameterList(ArgList &par)
std::map< Int_t, TF1 * > _thtScale
void setm2(double val, double err=0)
for(int j=0;j< ncounts;j++)
std::map< Int_t, TSpline3 * > _mom
FsmAbsDetList fSubtractDetList
TString m2(TString pts, TString exts="e px py pz")
std::map< Int_t, TSpline3 * > _z0
basic_ostream< char, char_traits< char > > ostream
void setDetector(PndFsmAbsDet *detector)
std::map< Int_t, TF1 * > _z0Scale
void setDrcDiscThtc(double val, double err=0)
std::map< Int_t, TF1 * > _momScale
PndFsmAbsDet * create(std::string &name, ArgList &par)
Bool_t SubtractDetector(std::string name, std::string params="")
void setLHKaon(double val)
friend F32vec4 fabs(const F32vec4 &a)
TParameter< Double_t > * _tht1
Bool_t AddDetector(std::string name, std::string params="")
std::map< Int_t, TF1 * > _d0Scale
std::map< Int_t, TParameter< Double_t > * > _mom0
void setRichThtc(double val, double err=0)
PndFsmDetFactory fDetFact
void setDetected(bool isdet)
void setdtheta(double val)
Bool_t setParameter(std::string &name, std::string &value)
virtual PndFsmResponse * respond(PndFsmTrack *t)
std::map< Int_t, TF1 * > _phiScale
void setSttdEdx(double val, double err=0)
double DrcBarrelThtcErr()
TParameter< Double_t > * _tht0
void setMvddEdx(double val, double err=0)
void setLHPion(double val)