FairRoot/PandaRoot
Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
PndFsmSimpleTracker Class Reference

#include <PndFsmSimpleTracker.h>

Inheritance diagram for PndFsmSimpleTracker:
PndFsmAbsDet

Public Member Functions

 PndFsmSimpleTracker ()
 
 PndFsmSimpleTracker (ArgList &par)
 
virtual ~PndFsmSimpleTracker ()
 
virtual PndFsmResponserespond (PndFsmTrack *t)
 
const std::string & detName ()
 
void setName (std::string &name)
 
Bool_t doesPid () const
 
void setStorePid (Bool_t doespid=kTRUE)
 

Protected Member Functions

bool detected (PndFsmTrack *t) const
 
double dp (PndFsmTrack *t) const
 
double dphi (PndFsmTrack *t) const
 
double dtheta (PndFsmTrack *t) const
 
virtual void initParameters ()
 
void print (std::ostream &o)
 
bool setParameter (std::string &name, double value)
 
virtual bool setParameter (std::string &name, std::string &value)
 
void parseParameterList (ArgList &par)
 

Protected Attributes

double _thtMin
 
double _thtMax
 
double _pmin
 
double _ptmin
 
double _pRes
 
double _thtRes
 
double _phiRes
 
std::string _detName
 
double _efficiency
 
TRandom3 * _rand
 
TDatabasePDG * _fdbPDG
 
Bool_t _doesPid
 

Detailed Description

Definition at line 38 of file PndFsmSimpleTracker.h.

Constructor & Destructor Documentation

PndFsmSimpleTracker::PndFsmSimpleTracker ( )

Default ctor.

Definition at line 54 of file PndFsmSimpleTracker.cxx.

References _thtMax, _thtMin, and initParameters().

55 {
57 
58  _thtMin=_thtMin*M_PI/180.0;
59  _thtMax=_thtMax*M_PI/180.0;
60 
61  //print(std::cout);
62 }
PndFsmSimpleTracker::PndFsmSimpleTracker ( ArgList par)

Definition at line 64 of file PndFsmSimpleTracker.cxx.

References _thtMax, _thtMin, initParameters(), and PndFsmAbsDet::parseParameterList().

65 {
67  //set default parameter values and parses a parameter list
68  //i.e. std::list<std::string> of the form
69  //"a=1" "b=2" "c=3"
71 
72  _thtMin=_thtMin*M_PI/180.0;
73  _thtMax=_thtMax*M_PI/180.0;
74 
75  //print(std::cout);
76 }
Double_t par[3]
void parseParameterList(ArgList &par)
PndFsmSimpleTracker::~PndFsmSimpleTracker ( )
virtual

Destructor

Definition at line 82 of file PndFsmSimpleTracker.cxx.

83 {
84 }

Member Function Documentation

bool PndFsmSimpleTracker::detected ( PndFsmTrack t) const
protected

Definition at line 110 of file PndFsmSimpleTracker.cxx.

References PndFsmAbsDet::_efficiency, _pmin, _ptmin, PndFsmAbsDet::_rand, _thtMin, PndFsmTrack::charge(), p, PndFsmTrack::p4(), and theta.

Referenced by respond().

111 {
112  double theta = t->p4().Theta();
113  double p_t=t->p4().Vect().Perp(TVector3(0.,0.,1.));
114  double p=t->p4().Vect().Mag();
115  double charge=t->charge();
116 
117  double eff = _efficiency;
118  // use parametrization for eff(p) for p<0.6 as multiplier for _efficiency from
119  // https://panda-wiki.gsi.de/foswiki/pub/Computing/Minutes07April2014/Costanza_EVO_April07.pdf
120  if (eff<0)
121  {
122  eff = -eff;
123  if (p<0.6) eff = eff * (0.32602 + 1.91679*p -1.58341*p*p + 0.305179*p*p*p);
124  }
125 
126  return ( charge!=0.0 && theta>=_thtMin && theta<=_thtMax && p_t>_ptmin && p>_pmin && _rand->Rndm()<=eff);
127 }
Double_t p
Definition: anasim.C:58
double _efficiency
Definition: PndFsmAbsDet.h:93
double charge()
Definition: PndFsmTrack.h:75
TRandom3 * _rand
Definition: PndFsmAbsDet.h:94
TLorentzVector p4()
Definition: PndFsmTrack.h:72
const std::string& PndFsmAbsDet::detName ( )
inlineinherited
Bool_t PndFsmAbsDet::doesPid ( ) const
inlineinherited

Definition at line 76 of file PndFsmAbsDet.h.

References PndFsmAbsDet::_doesPid.

Referenced by PndFastSim::Register(), and PndFastSim::smearTrack().

76 {return _doesPid;};
Bool_t _doesPid
Definition: PndFsmAbsDet.h:96
double PndFsmSimpleTracker::dp ( PndFsmTrack t) const
protected

Definition at line 131 of file PndFsmSimpleTracker.cxx.

References _pRes, p, PndFsmTrack::p4(), and res.

Referenced by respond().

132 {
133  double p=t->p4().Vect().Mag();
134 
135  double res;
136 
137  // use parametrization dp/p(p) from
138  // https://panda-wiki.gsi.de/foswiki/pub/Computing/Minutes07April2014/Costanza_EVO_April07.pdf
139  if (_pRes<0)
140  res = 0.012 + p*0.0034;
141  else // use fixed resolution
142  res = _pRes * p;
143 
144  return res;
145 }
Double_t p
Definition: anasim.C:58
Int_t res
Definition: anadigi.C:166
TLorentzVector p4()
Definition: PndFsmTrack.h:72
double PndFsmSimpleTracker::dphi ( PndFsmTrack t) const
protected

Definition at line 148 of file PndFsmSimpleTracker.cxx.

References _phiRes, p, PndFsmTrack::p4(), and res.

Referenced by respond().

149 {
150  double res = _phiRes;
151 
152  // use parametrization dphi(p) from
153  // https://panda-wiki.gsi.de/foswiki/pub/Computing/Minutes07April2014/Costanza_EVO_April07.pdf
154  if (_phiRes<0)
155  {
156  double p=t->p4().Vect().Mag();
157  res = 2.497e-3/pow(p,1.307) + 8.77e-4;
158  }
159 
160  return res;
161 }
Double_t p
Definition: anasim.C:58
Int_t res
Definition: anadigi.C:166
TLorentzVector p4()
Definition: PndFsmTrack.h:72
double PndFsmSimpleTracker::dtheta ( PndFsmTrack t) const
protected

Definition at line 164 of file PndFsmSimpleTracker.cxx.

References _thtRes, p, PndFsmTrack::p4(), and res.

Referenced by respond().

165 {
166  double res = _thtRes;
167 
168  // use parametrization dtheta(p) from
169  // https://panda-wiki.gsi.de/foswiki/pub/Computing/Minutes07April2014/Costanza_EVO_April07.pdf
170  if (_thtRes<0)
171  {
172  double p=t->p4().Vect().Mag();
173  res = 1.81e-3/pow(p,1.131) + 3.85e-4;
174  }
175  return res;
176 }
Double_t p
Definition: anasim.C:58
Int_t res
Definition: anadigi.C:166
TLorentzVector p4()
Definition: PndFsmTrack.h:72
void PndFsmSimpleTracker::initParameters ( )
protectedvirtual

Reimplemented from PndFsmAbsDet.

Definition at line 197 of file PndFsmSimpleTracker.cxx.

References PndFsmAbsDet::_detName, PndFsmAbsDet::_efficiency, _phiRes, _pmin, _pRes, _ptmin, _thtMax, _thtMin, and _thtRes.

Referenced by PndFsmSimpleTracker().

198 {
199  _detName = "PndFsmSimpleTracker";
200  _thtMin = 7.765;
201  _thtMax = 159.44;
202  _ptmin = 0.1;
203  _pmin = 0.0;
204  // if the resolutions are <0, than the parametrisations according to
205  // https://panda-wiki.gsi.de/foswiki/pub/Computing/Minutes07April2014/Costanza_EVO_April07.pdf
206  // p.6, p.9, p.10 are used
207  _pRes = -1.;//0.02; // 2%
208  _thtRes = -1.;//0.005;
209  _phiRes = -1.;//0.005;
210  // if the efficiency<0 and p<0.6GeV/c, parametrisation as multiplier to _efficiency according to p.8; else flat _efficiency
211  _efficiency = -1.0;//
212 
213 }
double _efficiency
Definition: PndFsmAbsDet.h:93
std::string _detName
Definition: PndFsmAbsDet.h:92
void PndFsmAbsDet::parseParameterList ( ArgList par)
protectedinherited

Definition at line 119 of file PndFsmAbsDet.cxx.

References CStrTok::GetFirst(), CStrTok::GetNext(), name, and PndFsmAbsDet::setParameter().

Referenced by PndFsmAbsDet::PndFsmAbsDet(), PndFsmCmpDet::PndFsmCmpDet(), PndFsmCombiDet::PndFsmCombiDet(), PndFsmDetTemplate::PndFsmDetTemplate(), PndFsmDrcBarrel::PndFsmDrcBarrel(), PndFsmDrcDisc::PndFsmDrcDisc(), PndFsmEffTracker::PndFsmEffTracker(), PndFsmEmcBarrel::PndFsmEmcBarrel(), PndFsmEmcBwCap::PndFsmEmcBwCap(), PndFsmEmcFS::PndFsmEmcFS(), PndFsmEmcFwCap::PndFsmEmcFwCap(), PndFsmEmcPid::PndFsmEmcPid(), PndFsmIdealPid::PndFsmIdealPid(), PndFsmMdcFS::PndFsmMdcFS(), PndFsmMdcTS::PndFsmMdcTS(), PndFsmMdtPid::PndFsmMdtPid(), PndFsmMvd::PndFsmMvd(), PndFsmMvd2::PndFsmMvd2(), PndFsmMvdPid::PndFsmMvdPid(), PndFsmRich::PndFsmRich(), PndFsmSimpleTracker(), PndFsmSimpleVtx::PndFsmSimpleVtx(), PndFsmStt::PndFsmStt(), PndFsmSttPid::PndFsmSttPid(), and PndFsmTof::PndFsmTof().

120 {
121  // ArgList is a std::list<std::string> of the form ("a=1","b=2","c=3","d=4")
122 
123  // Default values for the parameters
124 
125  CStrTok tokenizer;
126  char csrc[200];
127 
128  if (par.size() != 0) {
129 
130  //cout <<"Parameters for detector <"<<_detName<<">"<<endl;
131  for(ArgList::const_iterator argIt=par.begin(); argIt!=par.end();argIt++) {
132 
133  const char *src=argIt->data();
134  strcpy(csrc,src);
135 
136  char* token = tokenizer.GetFirst(csrc,"=");
137  string name(token);
138  //cout <<"variable: -" << name << "- ";
139  token = tokenizer.GetNext("=");
140 
141  double value = atof(token);
142  string strvalue(token);
143 
144  //cout <<"value: -"<<value<<"- "<<endl;
145 
146  if (value!=0 || strvalue=="0" || strvalue=="0.0" || strvalue=="0.")
147  {
148  if (!setParameter(name,value))
149  cout <<" -W- (PndFsmAbsDet::parseParameterList) Unknown Parameter: <"<<name<< endl;
150  }
151  else
152  {
153  if (!setParameter(name,strvalue))
154  cout <<" -W- (PndFsmAbsDet::parseParameterList) Unknown Parameter: <"<<name<< endl;
155  }
156 
157  }
158  }
159 
160  /*
161  if (par.size() != 0) {
162 
163  //cout <<"Parameters for detector <"<<_detName<<">"<<endl;
164  for(ArgList::const_iterator argIt=par.begin(); argIt!=par.end();argIt++) {
165  typedef boost::tokenizer<boost::char_separator<char> > tokenizer;
166  boost::char_separator<char> sep("=");
167  tokenizer tokens(*argIt, sep);
168  tokenizer::iterator tok_iter = tokens.begin();
169  string name(*tok_iter);
170  ++tok_iter;
171  double value=atof((*tok_iter).c_str());
172 
173  //cout <<"<"<<name<<"> = "<<value<<endl;
174 
175  string name("efficiency");
176  double value=0.99;
177  if (!setParameter(name,value))
178  cout <<" -W- Unknown Parameter: <"<<name<<"> in PndFsmAbsDet::parseParameterList" << endl;
179  }
180  }
181  */
182  //print(std::cout);
183 
184 }
Double_t par[3]
char * GetFirst(char *lpsz, const char *lpcszDelimiters)
Definition: StrTok.cxx:29
TString name
Definition: StrTok.h:11
virtual bool setParameter(std::string &name, double value)
char * GetNext(const char *lpcszDelimiters)
Definition: StrTok.cxx:37
void PndFsmSimpleTracker::print ( std::ostream o)
protectedvirtual

Reimplemented from PndFsmAbsDet.

Definition at line 179 of file PndFsmSimpleTracker.cxx.

References PndFsmAbsDet::_efficiency, _phiRes, _pmin, _pRes, _ptmin, _thtMax, _thtMin, _thtRes, and PndFsmAbsDet::detName().

180 {
181  o <<"Parameters for detector <"<<detName()<<">"<<endl;
182  o <<" _thtMin = " << _thtMin << endl;
183  o <<" _thtMax = " << _thtMax << endl;
184  o <<" _ptmin = " << _ptmin << endl;
185  o <<" _pmin = " << _pmin << endl;
186  o <<" _pRes = " << _pRes << " (rel)"<< endl;
187  if (_pRes<0) o<<" ... using parametrisation function for dp/p."<<endl;
188  o <<" _thtRes = " << _thtRes << endl;
189  if (_thtRes<0) o<<" ... using parametrisation function for dtht."<<endl;
190  o <<" _phiRes = " << _phiRes << endl;
191  if (_phiRes<0) o<<" ... using parametrisation function for dphi."<<endl;
192  o <<" _efficiency = " << _efficiency<<endl;
193  if (_efficiency<0) o<<" ... using parametrisation function for p<0.6."<<endl;
194 }
double _efficiency
Definition: PndFsmAbsDet.h:93
const std::string & detName()
Definition: PndFsmAbsDet.h:74
PndFsmResponse * PndFsmSimpleTracker::respond ( PndFsmTrack t)
virtual

Accessors to contained information

Implements PndFsmAbsDet.

Definition at line 91 of file PndFsmSimpleTracker.cxx.

References PndFsmTrack::charge(), detected(), dp(), dphi(), dtheta(), fabs(), PndFsmResponse::setDetected(), PndFsmResponse::setDetector(), PndFsmResponse::setdp(), PndFsmResponse::setdphi(), and PndFsmResponse::setdtheta().

92 {
93  PndFsmResponse *result=new PndFsmResponse();
94 
95  result->setDetector(this);
96  bool wasDetected=detected(t);
97  result->setDetected(wasDetected);
98 
99  if (wasDetected && fabs(t->charge())>1e-8)
100  {
101  result->setdp(dp(t));
102  result->setdphi(dphi(t));
103  result->setdtheta(dtheta(t));
104  }
105 
106  return result;
107 }
void setdphi(double val)
double dp(PndFsmTrack *t) const
double charge()
Definition: PndFsmTrack.h:75
void setDetector(PndFsmAbsDet *detector)
void setdp(double val)
friend F32vec4 fabs(const F32vec4 &a)
Definition: P4_F32vec4.h:47
double dtheta(PndFsmTrack *t) const
double dphi(PndFsmTrack *t) const
bool detected(PndFsmTrack *t) const
void setDetected(bool isdet)
void setdtheta(double val)
void PndFsmAbsDet::setName ( std::string &  name)
inlineinherited

Definition at line 75 of file PndFsmAbsDet.h.

References PndFsmAbsDet::_detName, and name.

Referenced by PndFsmDetFactory::create().

75 {_detName = name;};
TString name
std::string _detName
Definition: PndFsmAbsDet.h:92
bool PndFsmSimpleTracker::setParameter ( std::string &  name,
double  value 
)
protectedvirtual

Reimplemented from PndFsmAbsDet.

Definition at line 216 of file PndFsmSimpleTracker.cxx.

References PndFsmAbsDet::_efficiency, _phiRes, _pmin, _pRes, _ptmin, _thtMax, _thtMin, and _thtRes.

217 {
218  // *****************
219  // include here all parameters which should be settable via script
220  // *****************
221 
222  bool knownName=true;
223 
224  if (name == "thtMin")
225  _thtMin=value;
226  else
227  if (name == "thtMax")
228  _thtMax=value;
229  else
230  if (name == "ptmin")
231  _ptmin=value;
232  else
233  if (name == "pmin")
234  _pmin=value;
235  else
236  if (name == "pRes")
237  _pRes=value;
238  else
239  if (name == "thtRes")
240  _thtRes=value;
241  else
242  if (name == "phiRes")
243  _phiRes=value;
244  else
245  if (name == "efficiency")
246  _efficiency=value;
247  else
248  knownName=false;
249 
250  return knownName;
251 }
double _efficiency
Definition: PndFsmAbsDet.h:93
TString name
bool PndFsmAbsDet::setParameter ( std::string &  name,
std::string &  value 
)
protectedvirtualinherited

Reimplemented in PndFsmDrcBarrel, PndFsmDrcDisc, PndFsmCombiDet, and PndFsmCmpDet.

Definition at line 99 of file PndFsmAbsDet.cxx.

100 {
101  return false;
102 }
void PndFsmAbsDet::setStorePid ( Bool_t  doespid = kTRUE)
inlineinherited

Definition at line 77 of file PndFsmAbsDet.h.

References PndFsmAbsDet::_doesPid.

Referenced by PndFsmDetFactory::create().

77 {_doesPid=doespid;};
Bool_t _doesPid
Definition: PndFsmAbsDet.h:96

Member Data Documentation

std::string PndFsmAbsDet::_detName
protectedinherited
Bool_t PndFsmAbsDet::_doesPid
protectedinherited
double PndFsmAbsDet::_efficiency
protectedinherited

Definition at line 93 of file PndFsmAbsDet.h.

Referenced by PndFsmDetTemplate::detected(), detected(), PndFsmSimpleVtx::detected(), PndFsmTof::detected(), PndFsmEmcFS::detected(), PndFsmSttPid::detected(), PndFsmMvd2::detected(), PndFsmEmcBwCap::detected(), PndFsmStt::detected(), PndFsmEmcFwCap::detected(), PndFsmMdcFS::detected(), PndFsmMdcTS::detected(), PndFsmMvd::detected(), PndFsmMvdPid::detected(), PndFsmRich::detected(), PndFsmEmcBarrel::detected(), PndFsmDrcDisc::detected(), PndFsmMdtPid::detected(), PndFsmDrcBarrel::detected(), PndFsmEmcPid::detected(), PndFsmEffTracker::detected(), initParameters(), PndFsmSimpleVtx::initParameters(), PndFsmDetTemplate::initParameters(), PndFsmMvdPid::initParameters(), PndFsmTof::initParameters(), PndFsmMdtPid::initParameters(), PndFsmEmcPid::initParameters(), PndFsmEmcFS::initParameters(), PndFsmMvd2::initParameters(), PndFsmEmcFwCap::initParameters(), PndFsmRich::initParameters(), PndFsmMdcFS::initParameters(), PndFsmSttPid::initParameters(), PndFsmMdcTS::initParameters(), PndFsmEmcBwCap::initParameters(), PndFsmEmcBarrel::initParameters(), PndFsmDrcDisc::initParameters(), PndFsmDrcBarrel::initParameters(), PndFsmStt::initParameters(), PndFsmMvd::initParameters(), PndFsmEffTracker::initParameters(), print(), PndFsmSimpleVtx::print(), PndFsmDetTemplate::print(), PndFsmMvdPid::print(), PndFsmTof::print(), PndFsmMdtPid::print(), PndFsmEmcPid::print(), PndFsmMdcFS::print(), PndFsmEmcFS::print(), PndFsmMdcTS::print(), PndFsmEmcBwCap::print(), PndFsmMvd2::print(), PndFsmSttPid::print(), PndFsmEmcFwCap::print(), PndFsmRich::print(), PndFsmEmcBarrel::print(), PndFsmDrcDisc::print(), PndFsmDrcBarrel::print(), PndFsmStt::print(), PndFsmMvd::print(), PndFsmEffTracker::print(), setParameter(), PndFsmSimpleVtx::setParameter(), PndFsmDetTemplate::setParameter(), PndFsmMvdPid::setParameter(), PndFsmMdtPid::setParameter(), PndFsmTof::setParameter(), PndFsmEmcPid::setParameter(), PndFsmEmcBwCap::setParameter(), PndFsmRich::setParameter(), PndFsmMvd2::setParameter(), PndFsmEmcFS::setParameter(), PndFsmMdcTS::setParameter(), PndFsmSttPid::setParameter(), PndFsmEmcFwCap::setParameter(), PndFsmMdcFS::setParameter(), PndFsmEmcBarrel::setParameter(), PndFsmDrcBarrel::setParameter(), PndFsmDrcDisc::setParameter(), PndFsmMvd::setParameter(), PndFsmStt::setParameter(), and PndFsmEffTracker::setParameter().

TDatabasePDG* PndFsmAbsDet::_fdbPDG
protectedinherited
double PndFsmSimpleTracker::_phiRes
protected

Definition at line 84 of file PndFsmSimpleTracker.h.

Referenced by dphi(), initParameters(), print(), and setParameter().

double PndFsmSimpleTracker::_pmin
protected

Definition at line 79 of file PndFsmSimpleTracker.h.

Referenced by detected(), initParameters(), print(), and setParameter().

double PndFsmSimpleTracker::_pRes
protected

Definition at line 82 of file PndFsmSimpleTracker.h.

Referenced by dp(), initParameters(), print(), and setParameter().

double PndFsmSimpleTracker::_ptmin
protected

Definition at line 80 of file PndFsmSimpleTracker.h.

Referenced by detected(), initParameters(), print(), and setParameter().

TRandom3* PndFsmAbsDet::_rand
protectedinherited
double PndFsmSimpleTracker::_thtMax
protected

Definition at line 78 of file PndFsmSimpleTracker.h.

Referenced by initParameters(), PndFsmSimpleTracker(), print(), and setParameter().

double PndFsmSimpleTracker::_thtMin
protected
double PndFsmSimpleTracker::_thtRes
protected

Definition at line 83 of file PndFsmSimpleTracker.h.

Referenced by dtheta(), initParameters(), print(), and setParameter().


The documentation for this class was generated from the following files: