FairRoot/PandaRoot
PndFsmCombiDet.cxx
Go to the documentation of this file.
1 //--------------------------------------------------------------------------
2 // Description:
3 // Class PndFsmCombiDet
4 //
5 // Detector class that combines responses from other detectors (same as PndFsmCmpDet)
6 // Includes a simple parametrization for charged particles
7 //
8 // This software was developed for the PANDA collaboration. If you
9 // use all or part of it, please give an appropriate acknowledgement.
10 //
11 // Author List:
12 // Oscar Reinecke Original Author
13 // Andreas Pitka Efficiency part
14 //
15 // Copyright Information:
16 // Copyright (C) 2008 GSI
17 //
18 //
19 //------------------------------------------------------------------------
20 
21 //-----------------------
22 // This Class's Header --
23 //-----------------------
24 #include "PndFsmCombiDet.h"
25 
26 //-------------
27 // C Headers --
28 //-------------
29 
30 //---------------
31 // C++ Headers --
32 //---------------
33 #include <math.h>
34 #include <iostream>
35 
36 using std::cout;
37 using std::endl;
38 using std::ostream;
39 using std::string;
40 
41 //-------------------------------
42 // Collaborating Class Headers --
43 //-------------------------------
44 
45 #include "ArgList.h"
46 #include "PndFsmResponse.h"
47 #include "PndFsmTrack.h"
48 #include "PndFsmAbsDet.h"
49 #include "PndFsmDetFactory.h"
50 
51 #include "TFile.h"
52 #include "TString.h"
53 #include "TSpline.h"
54 #include "TParameter.h"
55 #include "TF1.h"
56 #include "TF3.h"
57 
58 //-----------------------------------------------------------------------
59 // Local Macros, Typedefs, Structures, Unions and Forward Declarations --
60 //-----------------------------------------------------------------------
61 
62 //----------------
63 // Constructors --
64 //----------------
65 
68  parseParameterList(par);
69  std::cout<<" -I- (PndFsmCombiDet::PndFsmCombiDet) - Using parameter file '"<<_parFileName<<"'"<<endl;
71 
72  // when PndFsmCombiDet has been created by the detector
73  // factory, some arbitrary detector set is added
74 
75  std::cout<<" -I- (PndFsmCombiDet::PndFsmCombiDet) - Creating arbitrary detector set"<<endl;
76 
77  //EM Calorimeters w/ default parameters
78  AddDetector("EmcBarrel");
79  AddDetector("EmcFwCap");
80  AddDetector("EmcBwCap");
81  AddDetector("EmcFS");
82 
83  //Tracking, Vertexing, dE/dx
84  AddDetector("Mvd2");
85  AddDetector("Stt");
86  AddDetector("MdcTS");
87  AddDetector("MdcFS");
88 //AddDetector("Tpc");
89 
90  //PID detectors
91  AddDetector("DrcBarrel");
92  AddDetector("DrcDisc");
93  AddDetector("Rich");
94  AddDetector("Tof");
95 }
96 
100 }
101 
102 //--------------
103 // Destructor --
104 //--------------
105 
107 }
108 
109 //--------------
110 // Operations --
111 //--------------
112 
115  PndFsmResponse *result=new PndFsmResponse();
116 
117  result->setDetector(this);
118 
119  Bool_t detected=false;
120 
121  Double_t dE=0.0;
122  Double_t dp=0.0;
123  Double_t dtheta=0.0;
124  Double_t dphi=0.0;
125  Double_t dt=0.0;
126  Double_t dm=0.0;
127 
128  Double_t m2=0;
129  Double_t MvddEdx=0;
130  Double_t TpcdEdx=0;
131  Double_t SttdEdx=0;
132  Double_t DrcDiscThtc=0;
133  Double_t DrcBarrelThtc=0;
134  Double_t RichThtc=0;
135 
136  Double_t m2Err=0;
137  Double_t MvddEdxErr=0;
138  Double_t TpcdEdxErr=0;
139  Double_t SttdEdxErr=0;
140  Double_t DrcDiscThtcErr=0;
141  Double_t DrcBarrelThtcErr=0;
142  Double_t RichThtcErr=0;
143 
144  Double_t dVx=0;
145  Double_t dVy=0;
146  Double_t dVz=0;
147 
148  Double_t LH_e=1.0;
149  Double_t LH_mu=1.0;
150  Double_t LH_pi=1.0;
151  Double_t LH_K=1.0;
152  Double_t LH_p=1.0;
153 
154  Double_t val=0.0;
155 
156  for (FsmAbsDetList::iterator iter=fDetList.begin();iter!=fDetList.end(); iter++) {
157  PndFsmResponse* resp=(*iter)->respond(t);
158 
159  detected |= resp->detected();
160 
161  if (resp->detected()) {
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;
166  if (fabs (val = resp->MvddEdx()) > 1e-11) MvddEdx+=val;
167  if (fabs (val = resp->TpcdEdx()) > 1e-11) TpcdEdx+=val;
168  if (fabs (val = resp->SttdEdx()) > 1e-11) SttdEdx+=val;
169  if (fabs (val = resp->DrcDiscThtc()) > 1e-11) DrcDiscThtc+=val;
170  if (fabs (val = resp->DrcBarrelThtc()) > 1e-11) DrcBarrelThtc+=val;
171  if (fabs (val = resp->RichThtc()) > 1e-11) RichThtc+=val;
172 
173  if (fabs (val = resp->m2Err()) > 1e-11) m2Err+=val;
174  if (fabs (val = resp->MvddEdxErr()) > 1e-11) MvddEdxErr+=val;
175  if (fabs (val = resp->TpcdEdxErr()) > 1e-11) TpcdEdxErr+=val;
176  if (fabs (val = resp->SttdEdxErr()) > 1e-11) SttdEdxErr+=val;
177  if (fabs (val = resp->DrcDiscThtcErr()) > 1e-11) DrcDiscThtcErr+=val;
178  if (fabs (val = resp->DrcBarrelThtcErr()) > 1e-11) DrcBarrelThtcErr+=val;
179  if (fabs (val = resp->RichThtcErr()) > 1e-11) RichThtcErr+=val;
180 
181  Double_t rawLHe = resp->LHElectron();
182  Double_t rawLHmu = resp->LHMuon();
183  Double_t rawLHpi = resp->LHPion();
184  Double_t rawLHK = resp->LHKaon();
185  Double_t rawLHp = resp->LHProton();
186 
187  Double_t sumRaw = rawLHe+rawLHmu+rawLHpi+rawLHK+rawLHp;
188 
189  if (sumRaw>0) {
190  rawLHe /= sumRaw;
191  rawLHmu /= sumRaw;
192  rawLHpi /= sumRaw;
193  rawLHK /= sumRaw;
194  rawLHp /= sumRaw;
195  LH_e *= rawLHe;
196  LH_mu *= rawLHmu;
197  LH_pi *= rawLHpi;
198  LH_K *= rawLHK;
199  LH_p *= rawLHp;
200  } else {
201  LH_e *= 0.2;
202  LH_mu *= 0.2;
203  LH_pi *= 0.2;
204  LH_K *= 0.2;
205  LH_p *= 0.2;
206  }
207  }
208  }
209 
210  // invoke parameterised vertex/momentum resolution
211  // (this will overwrite dp, dtheta, dphi and dV)
212  if ( _parFile )
213  // haven't done neutral particles yet
214  if ( fabs(t->charge())>1e-8 ) {
215  Double_t p=t->p4().Vect().Mag();
216  Double_t theta=t->p4().Vect().Theta()*180/M_PI;
217  Int_t pid=abs(t->pdt());
218  // cut off slow and out of theta range particles
219  // (this avoids floating poInt_t exceptions)
220  detected &= ( p > _mom0[pid]->GetVal() );
221  detected &= ( theta >= _tht0->GetVal() );
222  detected &= ( theta <= _tht1->GetVal() );
223 
224  if (detected) {
225  dtheta = eval(_tht[pid], theta) * _thtScale[pid]->Eval(p) * _thtResMulti * 3.1416/180;
226  dphi = eval(_phi[pid], theta) * _phiScale[pid]->Eval(p) * _phiResMulti * 3.1416/180;
227  dp = eval(_mom[pid], theta) * _momScale[pid]->Eval(p) * _momResMulti * p;
228 
229  dVx = eval(_d0[pid], theta) * _d0Scale[pid]->Eval(p) * _d0ResMulti;
230  dVy = eval(_d0[pid], theta) * _d0Scale[pid]->Eval(p) * _d0ResMulti;
231  dVz = eval(_z0[pid], theta) * _z0Scale[pid]->Eval(p) * _z0ResMulti;
232 
233  dtheta=1/(dtheta*dtheta);
234  dphi=1/(dphi*dphi);
235  dp=1/(dp*dp);
236  }
237  }
238 
239  for (FsmAbsDetList::iterator iter=fSubtractDetList.begin();iter!=fSubtractDetList.end(); iter++) {
240  PndFsmResponse* resp=(*iter)->respond(t);
241 
242  if (resp->detected()) {
243  if (fabs(val = resp->dE()) > 1e-8) dE-=1/(val*val);
244  if (fabs(val = resp->dp()) > 1e-8) dp-=1/(val*val);
245  if (fabs(val = resp->dtheta())> 1e-8) dtheta-=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;
250  if (fabs (val = resp->MvddEdx()) > 1e-11) MvddEdx-=val;
251  if (fabs (val = resp->TpcdEdx()) > 1e-11) TpcdEdx-=val;
252  if (fabs (val = resp->SttdEdx()) > 1e-11) SttdEdx-=val;
253  if (fabs (val = resp->DrcDiscThtc()) > 1e-11) DrcDiscThtc-=val;
254  if (fabs (val = resp->DrcBarrelThtc()) > 1e-11) DrcBarrelThtc-=val;
255  if (fabs (val = resp->RichThtc()) > 1e-11) RichThtc-=val;
256 
257  if (fabs (val = resp->m2Err()) > 1e-11) m2Err-=val;
258  if (fabs (val = resp->MvddEdxErr()) > 1e-11) MvddEdxErr-=val;
259  if (fabs (val = resp->TpcdEdxErr()) > 1e-11) TpcdEdxErr-=val;
260  if (fabs (val = resp->SttdEdxErr()) > 1e-11) SttdEdxErr-=val;
261  if (fabs (val = resp->DrcDiscThtcErr()) > 1e-11) DrcDiscThtcErr-=val;
262  if (fabs (val = resp->DrcBarrelThtcErr()) > 1e-11) DrcBarrelThtcErr-=val;
263  if (fabs (val = resp->RichThtcErr()) > 1e-11) RichThtcErr-=val;
264 
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);
268 
269  Double_t rawLHe = resp->LHElectron();
270  Double_t rawLHmu = resp->LHMuon();
271  Double_t rawLHpi = resp->LHPion();
272  Double_t rawLHK = resp->LHKaon();
273  Double_t rawLHp = resp->LHProton();
274 
275  Double_t sumRaw = rawLHe+rawLHmu+rawLHpi+rawLHK+rawLHp;
276 
277  if (sumRaw>0) {
278  rawLHe /= sumRaw;
279  rawLHmu /= sumRaw;
280  rawLHpi /= sumRaw;
281  rawLHK /= sumRaw;
282  rawLHp /= sumRaw;
283  LH_e /= rawLHe;
284  LH_mu /= rawLHmu;
285  LH_pi /= rawLHpi;
286  LH_K /= rawLHK;
287  LH_p /= rawLHp;
288  }
289  }
290  }
291 
292  Double_t sumLH = LH_e + LH_mu + LH_pi + LH_K + LH_p;
293 
294  if (sumLH>0) {
295  LH_e /= sumLH;
296  LH_mu /= sumLH;
297  LH_pi /= sumLH;
298  LH_K /= sumLH;
299  LH_p /= sumLH;
300  } else {
301  LH_e = 0.2;
302  LH_mu = 0.2;
303  LH_pi = 0.2;
304  LH_K = 0.2;
305  LH_p = 0.2;
306  }
307 
308  // this shifts all likelihoods linearly to the state
309  // of no pid information at all i. e. all lhs are 0.2
310  LH_e = 0.2*(1-_pidLhMulti) + LH_e*_pidLhMulti;
311  LH_mu = 0.2*(1-_pidLhMulti) + LH_mu*_pidLhMulti;
312  LH_pi = 0.2*(1-_pidLhMulti) + LH_pi*_pidLhMulti;
313  LH_K = 0.2*(1-_pidLhMulti) + LH_K*_pidLhMulti;
314  LH_p = 0.2*(1-_pidLhMulti) + LH_p*_pidLhMulti;
315 
316  result->setdE( dE>0. ? 1/sqrt(dE) : 0.0 );
317  result->setdp( dp>0. ? 1/sqrt(dp) : 0.0 );
318  result->setdtheta( dtheta>0. ? 1/sqrt(dtheta) : 0.0 );
319  result->setdphi( dphi>0. ? 1/sqrt(dphi) : 0.0 );
320  result->setdt( sqrt(dt) );
321  result->setdm(dm);
322 
323  result->setm2(m2, m2Err);
324  result->setMvddEdx(MvddEdx,MvddEdxErr);
325  result->setTpcdEdx(TpcdEdx,TpcdEdxErr);
326  result->setSttdEdx(SttdEdx,SttdEdxErr);
327 
328  result->setDrcDiscThtc(DrcDiscThtc,DrcDiscThtcErr);
329  result->setDrcBarrelThtc(DrcBarrelThtc,DrcBarrelThtcErr);
330  result->setRichThtc(RichThtc,RichThtcErr);
331 
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;
335 
336  result->setdV( dVx , dVy , dVz );
337 
338  result->setLHElectron(LH_e);
339  result->setLHMuon(LH_mu);
340  result->setLHPion(LH_pi);
341  result->setLHKaon(LH_K);
342  result->setLHProton(LH_p);
343 
344  Double_t Eff=0;
345  TLorentzVector P4=t->p4();
346  Double_t Mom = P4.P();
347  Double_t CosTheta = P4.CosTheta();
348  Double_t Phi = TMath::RadToDeg() * P4.Phi();
349  Int_t PDG = t->pdt();
350 
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);}
356 
357  if(PDG==-211){Eff=fPimPara->Eval(Mom,CosTheta,Phi);}
358  if(PDG==-321){Eff=fKmPara->Eval(Mom,CosTheta,Phi);}
359  if(PDG==-2212){Eff=fAntiProtPara->Eval(Mom,CosTheta,Phi);}
360  if(PDG==13){Eff=fmumPara->Eval(Mom,CosTheta,Phi);}
361  if(PDG==11){Eff=femPara->Eval(Mom,CosTheta,Phi);}
362 
363  if(Eff>0) {
364  Double_t Alea=gRandom->Rndm();
365  if(Eff>=Alea){detected=true;}
366  if(Eff<Alea){detected=false;}
367  }
368 
369  result->setDetected(detected);
370 
371  return result;
372 }
373 
374 Bool_t PndFsmCombiDet::AddDetector(string name, string params) {
375  PndFsmAbsDet *det=fDetFact.create(name,params);
376  if (det)
377  fDetList.push_back(det);
378  return det;
379 }
380 
382  PndFsmAbsDet *det=fDetFact.create(name,params);
383  if (det)
384  fSubtractDetList.push_back(det);
385  return det;
386 }
387 
388 Bool_t PndFsmCombiDet::setParameter(string &name, string &value) {
389  // *****************
390  // include here all string parameters which should be settable
391  // *****************
392 
393  Bool_t knownName=true;
394 
395  if (name == "parFileName")
396  _parFileName=value;
397  else
398  knownName=false;
399 
400  return knownName;
401 }
402 
403 Bool_t PndFsmCombiDet::setParameter(std::string &name, Double_t value) {
404  // *****************
405  // include here all float parameters which should be settable
406  // *****************
407 
408  Bool_t knownName=true;
409 
410  if (name == "d0ResMulti")
411  _d0ResMulti=value;
412  else
413  if (name == "z0ResMulti")
414  _z0ResMulti=value;
415  else
416  if (name == "thtResMulti")
417  _thtResMulti=value;
418  else
419  if (name == "phiResMulti")
420  _phiResMulti=value;
421  else
422  if (name == "momResMulti")
423  _momResMulti=value;
424  else
425  if (name == "thtMin")
426  _tht0 = new TParameter<Double_t>("tht0", value);
427  else
428  if (name == "thtMax")
429  _tht1 = new TParameter<Double_t>("tht1", value);
430  else
431  if (name == "pidLhMulti")
432  _pidLhMulti=value;
433  else
434  knownName=false;
435 
436  return knownName;
437 }
438 
440 
441  TFile f(_parFileName);
442 
443  if (f.IsZombie()) {
444  cout <<" -W- (PndFsmCombiDet::readParameters) - file "<<_parFileName
445  <<" doesn't exist. Using constant vertex reso"<<endl;
446  } else {
447  // electrons
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-");
453  if (!_mom0[11]) _mom0[11]=(TParameter<Double_t>*)f.Get("mom0E-");
454  _d0Scale[11]=(TF1*)f.Get("d0ScaleE-");
455  _z0Scale[11]=(TF1*)f.Get("z0ScaleE-");
456  _thtScale[11]=(TF1*)f.Get("thtScaleE-");
457  _phiScale[11]=(TF1*)f.Get("phiScaleE-");
458  _momScale[11]=(TF1*)f.Get("momScaleE-");
459  // muons
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+");
465  _mom0[13]=(TParameter<Double_t>*)f.Get("mom0Mu+");
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+");
471  // pions
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-");
477  if (!_mom0[211]) _mom0[211]=(TParameter<Double_t>*)f.Get("mom0Pi-");
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-");
483  // kaons
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-");
489  if (!_mom0[321]) _mom0[321]=(TParameter<Double_t>*)f.Get("mom0K-");
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-");
495  // protons
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+");
501  if (!_mom0[2212]) _mom0[2212]=(TParameter<Double_t>*)f.Get("mom0P+");
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+");
507 
508  if (!_tht0) _tht0=(TParameter<Double_t>*)f.Get("tht0");
509  if (!_tht1) _tht1=(TParameter<Double_t>*)f.Get("tht1");
510 
511  f.Close();
512  // now check that all parameters have been loaded correctly
513  _parFile=true;
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;
517 
518  for (i=_d0.begin(); i!=_d0.end(); i++) _parFile = _parFile && i->second;
519  for (i=_z0.begin(); i!=_z0.end(); i++) _parFile = _parFile && i->second;
520  for (i=_tht.begin(); i!=_tht.end(); i++) _parFile = _parFile && i->second;
521  for (i=_phi.begin(); i!=_phi.end(); i++) _parFile = _parFile && i->second;
522  for (i=_mom.begin(); i!=_mom.end(); i++) _parFile = _parFile && i->second;
523 
524  for (j=_mom0.begin(); j!=_mom0.end(); j++) _parFile = _parFile && j->second;
525  _parFile = _parFile && _tht0 && _tht1;
526 
527  for (k=_d0Scale.begin(); k!=_d0Scale.end(); k++) _parFile = _parFile && k->second;
528  for (k=_z0Scale.begin(); k!=_z0Scale.end(); k++) _parFile = _parFile && k->second;
529  for (k=_thtScale.begin(); k!=_thtScale.end(); k++) _parFile = _parFile && k->second;
530  for (k=_phiScale.begin(); k!=_phiScale.end(); k++) _parFile = _parFile && k->second;
531  for (k=_momScale.begin(); k!=_momScale.end(); k++) _parFile = _parFile && k->second;
532 
533  if (!_parFile)
534  cout <<" -W- (PndFsmCombiDet::readParameters) - file "<<_parFileName
535  <<" is defective. Using constant vertex reso"<<endl;
536  }
537 }
538 
540  _detName = "CmpDet";
541  _parFileName = "$VMCWORKDIR/fastsim/cmpdetparams.root";
542  fEffFile = new TFile("$VMCWORKDIR/fastsim/FsmCombiDetParas.root");
543 
544  fPipPara = (TF3*)fEffFile->Get("PipPara");
545  fPimPara = (TF3*)fEffFile->Get("PimPara");
546  fKpPara = (TF3*)fEffFile->Get("KpPara");
547  fKmPara = (TF3*)fEffFile->Get("KmPara");
548  fProtPara = (TF3*)fEffFile->Get("ProtPara");
549  fAntiProtPara = (TF3*)fEffFile->Get("AntiProtPara");
550  fepPara = (TF3*)fEffFile->Get("EpPara");
551  femPara = (TF3*)fEffFile->Get("EmPara");
552  fmupPara = (TF3*)fEffFile->Get("mupPara");
553  fmumPara = (TF3*)fEffFile->Get("mumPara");
554 
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");
565 
566  _parFile=false;
567  _d0ResMulti=1.0;
568  _z0ResMulti=1.0;
569  _thtResMulti=1.0;
570  _phiResMulti=1.0;
571  _momResMulti=1.0;
572  _pidLhMulti=1.0;
573  _mom0[11]=0;
574  _mom0[13]=0;
575  _mom0[211]=0;
576  _mom0[321]=0;
577  _mom0[2212]=0;
578  _tht0=0;
579  _tht1=0;
580  }
581 
582 // TSpline3::Eval returns bogus values when outside the
583 // Interval, so the spline has to be continued somehow
585  Double_t xmin=s->GetXmin();
586  Double_t xmax=s->GetXmax();
587  if (x<xmin)
588  return s->Eval(xmin)+(x-xmin)*s->Derivative(xmin);
589  else if (x>xmax)
590  return s->Eval(xmax)+(x-xmax)*s->Derivative(xmax);
591  else
592  return s->Eval(x);
593 }
594 
TVector3 dV()
std::map< Int_t, TSpline3 * > _phi
Double_t eval(TSpline3 *spline, Double_t theta)
void setDrcBarrelThtc(double val, double err=0)
void setdV(TVector3 v)
void setdphi(double val)
void setLHElectron(double val)
std::map< Int_t, TSpline3 * > _tht
Int_t i
Definition: run_full.C:25
std::map< Int_t, TSpline3 * > _d0
void setLHProton(double val)
std::list< std::string > ArgList
Definition: ArgList.h:7
friend F32vec4 sqrt(const F32vec4 &a)
Definition: P4_F32vec4.h:29
Double_t _pidLhMulti
void setTpcdEdx(double val, double err=0)
Double_t val[nBoxes][nFEBox]
Definition: createCalib.C:11
double MvddEdxErr()
void setLHMuon(double val)
TLorentzVector s
Definition: Pnd2DStar.C:50
Double_t xmax
int pid()
virtual ~PndFsmCombiDet()
Double_t par[3]
double MvddEdx()
TString _parFileName
double charge()
Definition: PndFsmTrack.h:75
double RichThtcErr()
Double_t _d0ResMulti
void parseParameterList(ArgList &par)
Double_t _thtResMulti
std::map< Int_t, TF1 * > _thtScale
void setm2(double val, double err=0)
double RichThtc()
Double_t p
Definition: anasim.C:58
double DrcDiscThtcErr()
for(int j=0;j< ncounts;j++)
FsmAbsDetList fDetList
std::map< Int_t, TSpline3 * > _mom
FsmAbsDetList fSubtractDetList
TString m2(TString pts, TString exts="e px py pz")
Definition: invexp.C:117
std::map< Int_t, TSpline3 * > _z0
void setdt(double val)
double SttdEdxErr()
TLorentzVector p4()
Definition: PndFsmTrack.h:72
double TpcdEdx()
basic_ostream< char, char_traits< char > > ostream
void setDetector(PndFsmAbsDet *detector)
Double_t
double SttdEdx()
std::map< Int_t, TF1 * > _z0Scale
void setDrcDiscThtc(double val, double err=0)
std::map< Int_t, TF1 * > _momScale
Double_t dE
Definition: anasim.C:58
double dtheta
Definition: anaLmdCluster.C:54
void setdp(double val)
PndFsmAbsDet * create(std::string &name, ArgList &par)
TFile * f
Definition: bump_analys.C:12
Bool_t SubtractDetector(std::string name, std::string params="")
double LHElectron()
Double_t _z0ResMulti
void setLHKaon(double val)
friend F32vec4 fabs(const F32vec4 &a)
Definition: P4_F32vec4.h:47
TString name
TParameter< Double_t > * _tht1
Bool_t AddDetector(std::string name, std::string params="")
void setdE(double val)
std::map< Int_t, TF1 * > _d0Scale
std::map< Int_t, TParameter< Double_t > * > _mom0
double DrcDiscThtc()
Double_t x
void setRichThtc(double val, double err=0)
std::string _detName
Definition: PndFsmAbsDet.h:92
PndFsmDetFactory fDetFact
void setDetected(bool isdet)
TTree * t
Definition: bump_analys.C:13
Double_t xmin
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)
void setdm(double val)
if(fWindowIsBox)
double TpcdEdxErr()
double DrcBarrelThtcErr()
TParameter< Double_t > * _tht0
void setMvddEdx(double val, double err=0)
double DrcBarrelThtc()
Double_t _momResMulti
Double_t _phiResMulti
void setLHPion(double val)