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

#include <PndFsmMdcTS.h>

Inheritance diagram for PndFsmMdcTS:
PndFsmAbsDet

Public Member Functions

 PndFsmMdcTS ()
 
 PndFsmMdcTS (ArgList &par)
 
virtual ~PndFsmMdcTS ()
 
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

virtual bool setParameter (std::string &name, std::string &value)
 
void parseParameterList (ArgList &par)
 

Protected Attributes

std::string _detName
 
double _efficiency
 
TRandom3 * _rand
 
TDatabasePDG * _fdbPDG
 
Bool_t _doesPid
 

Private Member Functions

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

Private Attributes

double _thtMin
 
double _thtMax
 
double _radiationLength
 
double _pmin
 
double _a3Par
 
double _a4Par
 

Detailed Description

Definition at line 41 of file PndFsmMdcTS.h.

Constructor & Destructor Documentation

PndFsmMdcTS::PndFsmMdcTS ( )

Default ctor.

Definition at line 57 of file PndFsmMdcTS.cxx.

References _thtMax, _thtMin, and initParameters().

58 {
60 
61  _thtMin=_thtMin*M_PI/180.0;
62  _thtMax=_thtMax*M_PI/180.0;
63  //print(std::cout);
64 }
void initParameters()
double _thtMin
Definition: PndFsmMdcTS.h:80
double _thtMax
Definition: PndFsmMdcTS.h:81
PndFsmMdcTS::PndFsmMdcTS ( ArgList par)

Definition at line 66 of file PndFsmMdcTS.cxx.

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

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

Destructor

Definition at line 83 of file PndFsmMdcTS.cxx.

84 {
85 }

Member Function Documentation

bool PndFsmMdcTS::detected ( PndFsmTrack t) const
private

Definition at line 117 of file PndFsmMdcTS.cxx.

References PndFsmAbsDet::_efficiency, _pmin, PndFsmAbsDet::_rand, _thtMin, PndFsmTrack::charge(), FsmDetEnum::Dch1, FsmDetEnum::Dch2, PndFsmTrack::hitMapResponse(), PndFsmTrack::hitMapValid(), p, PndFsmTrack::p4(), and theta.

Referenced by respond().

118 {
119  if (t->hitMapValid()) {
121  } else {
122  double theta = t->p4().Theta();
123  double p=t->p4().Vect().Mag();
124  double charge=t->charge();
125  return ( charge!=0.0 && theta>=_thtMin && theta<=_thtMax && p>_pmin && _rand->Rndm()<=_efficiency);
126  }
127 }
double _pmin
Definition: PndFsmMdcTS.h:83
Double_t p
Definition: anasim.C:58
double _efficiency
Definition: PndFsmAbsDet.h:93
bool hitMapResponse(unsigned int)
Definition: PndFsmTrack.h:86
double _thtMin
Definition: PndFsmMdcTS.h:80
double charge()
Definition: PndFsmTrack.h:75
TRandom3 * _rand
Definition: PndFsmAbsDet.h:94
TLorentzVector p4()
Definition: PndFsmTrack.h:72
bool hitMapValid()
Definition: PndFsmTrack.h:85
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 PndFsmMdcTS::dp ( PndFsmTrack t) const
private

Definition at line 130 of file PndFsmMdcTS.cxx.

References _a3Par, _a4Par, mom, PndFsmTrack::p4(), sin(), sqrt(), and theta.

Referenced by respond().

131 {
132  TLorentzVector p4=t->p4();
133  double theta=p4.Theta();
134  double mom=p4.Vect().Mag();
135 
136  double sigp = sqrt(_a3Par*_a3Par*mom*mom + _a4Par*_a4Par) / sin(theta) * mom;
137 
138  return sigp;
139 }
friend F32vec4 sqrt(const F32vec4 &a)
Definition: P4_F32vec4.h:29
friend F32vec4 sin(const F32vec4 &a)
Definition: P4_F32vec4.h:111
Double_t mom
Definition: plot_dirc.C:14
double _a3Par
Definition: PndFsmMdcTS.h:85
TLorentzVector p4()
Definition: PndFsmTrack.h:72
double _a4Par
Definition: PndFsmMdcTS.h:86
double PndFsmMdcTS::dphi ( PndFsmTrack t) const
private

Definition at line 142 of file PndFsmMdcTS.cxx.

Referenced by respond().

143 {
144  return 0.0002; //to be refined
145 }
double PndFsmMdcTS::dtheta ( PndFsmTrack t) const
private

Definition at line 148 of file PndFsmMdcTS.cxx.

Referenced by respond().

149 {
150  return 0.0002; //to be refined
151 }
void PndFsmMdcTS::initParameters ( )
privatevirtual

Reimplemented from PndFsmAbsDet.

Definition at line 167 of file PndFsmMdcTS.cxx.

References _a3Par, _a4Par, PndFsmAbsDet::_detName, PndFsmAbsDet::_efficiency, _pmin, _radiationLength, _thtMax, and _thtMin.

Referenced by PndFsmMdcTS().

168 {
169  _detName = "MdcTS";
170  _thtMin = 0.5;
171  _thtMax = 22.0;
172  _radiationLength = 0.0;
173  _pmin = 0.0;
174  _a3Par = 0.00033;
175  _a4Par = 0.00077;
176  _efficiency =1.0;
177 
178 }
double _pmin
Definition: PndFsmMdcTS.h:83
double _efficiency
Definition: PndFsmAbsDet.h:93
double _thtMin
Definition: PndFsmMdcTS.h:80
double _a3Par
Definition: PndFsmMdcTS.h:85
double _thtMax
Definition: PndFsmMdcTS.h:81
std::string _detName
Definition: PndFsmAbsDet.h:92
double _radiationLength
Definition: PndFsmMdcTS.h:82
double _a4Par
Definition: PndFsmMdcTS.h:86
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(), PndFsmMdtPid::PndFsmMdtPid(), PndFsmMvd::PndFsmMvd(), PndFsmMvd2::PndFsmMvd2(), PndFsmMvdPid::PndFsmMvdPid(), PndFsmRich::PndFsmRich(), PndFsmSimpleTracker::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 PndFsmMdcTS::print ( std::ostream o)
privatevirtual

Reimplemented from PndFsmAbsDet.

Definition at line 154 of file PndFsmMdcTS.cxx.

References _a3Par, _a4Par, PndFsmAbsDet::_efficiency, _pmin, _radiationLength, _thtMax, _thtMin, and PndFsmAbsDet::detName().

155 {
156  o <<"Parameters for detector <"<<detName()<<">"<<endl;
157  o <<" _thtMin = "<<_thtMin<<endl;
158  o <<" _thtMax = "<<_thtMax<<endl;
159  o <<" _radiationLength = "<<_radiationLength<<endl;
160  o <<" _pmin = "<<_pmin<<endl;
161  o <<" _a3Par = "<<_a3Par<<endl;
162  o <<" _a4Par = "<<_a4Par<<endl;
163  o <<" _efficiency = "<<_efficiency<<endl;
164 }
double _pmin
Definition: PndFsmMdcTS.h:83
double _efficiency
Definition: PndFsmAbsDet.h:93
double _thtMin
Definition: PndFsmMdcTS.h:80
double _a3Par
Definition: PndFsmMdcTS.h:85
const std::string & detName()
Definition: PndFsmAbsDet.h:74
double _thtMax
Definition: PndFsmMdcTS.h:81
double _radiationLength
Definition: PndFsmMdcTS.h:82
double _a4Par
Definition: PndFsmMdcTS.h:86
PndFsmResponse * PndFsmMdcTS::respond ( PndFsmTrack t)
virtual

Accessors to contained information

Implements PndFsmAbsDet.

Definition at line 92 of file PndFsmMdcTS.cxx.

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

93 {
94  PndFsmResponse *result=new PndFsmResponse();
95 
96  result->setDetector(this);
97  bool wasDetected=detected(t);
98  result->setDetected(wasDetected);
99 
100  if (wasDetected && fabs(t->charge())>1e-8)
101  {
102  result->setdp(dp(t));
103  result->setdphi(dphi(t));
104  result->setdtheta(dtheta(t));
105  }
106  else
107  {
108  result->setdp(0.);
109  result->setdphi(0.);
110  result->setdtheta(0.);
111  }
112 
113  return result;
114 }
void setdphi(double val)
double dtheta(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 dphi(PndFsmTrack *t) const
double dp(PndFsmTrack *t) const
void setDetected(bool isdet)
void setdtheta(double val)
bool detected(PndFsmTrack *t) const
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 PndFsmMdcTS::setParameter ( std::string &  name,
double  value 
)
privatevirtual

Reimplemented from PndFsmAbsDet.

Definition at line 181 of file PndFsmMdcTS.cxx.

References _a3Par, _a4Par, PndFsmAbsDet::_efficiency, _pmin, _radiationLength, _thtMax, and _thtMin.

182 {
183  // *****************
184  // include here all parameters which should be settable via tcl
185  // *****************
186  bool knownName=true;
187 
188  if (name == "thtMin")
189  _thtMin=value;
190  else
191  if (name == "thtMax")
192  _thtMax=value;
193  else
194  if (name == "radiationLength")
195  _radiationLength=value;
196  else
197  if (name == "pmin")
198  _pmin=value;
199  else
200  if (name == "a3Par")
201  _a3Par=value;
202  else
203  if (name == "a4Par")
204  _a4Par=value;
205  else
206  if (name == "efficiency")
207  _efficiency=value;
208  else
209  knownName=false;
210 
211  return knownName;
212 }
double _pmin
Definition: PndFsmMdcTS.h:83
double _efficiency
Definition: PndFsmAbsDet.h:93
double _thtMin
Definition: PndFsmMdcTS.h:80
double _a3Par
Definition: PndFsmMdcTS.h:85
TString name
double _thtMax
Definition: PndFsmMdcTS.h:81
double _radiationLength
Definition: PndFsmMdcTS.h:82
double _a4Par
Definition: PndFsmMdcTS.h:86
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

double PndFsmMdcTS::_a3Par
private

Definition at line 85 of file PndFsmMdcTS.h.

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

double PndFsmMdcTS::_a4Par
private

Definition at line 86 of file PndFsmMdcTS.h.

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

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(), PndFsmSimpleTracker::detected(), PndFsmMvd::detected(), PndFsmMvd2::detected(), PndFsmMdcFS::detected(), PndFsmEmcBwCap::detected(), PndFsmSimpleVtx::detected(), PndFsmEmcFwCap::detected(), detected(), PndFsmTof::detected(), PndFsmSttPid::detected(), PndFsmEmcFS::detected(), PndFsmStt::detected(), PndFsmMvdPid::detected(), PndFsmRich::detected(), PndFsmEmcBarrel::detected(), PndFsmDrcDisc::detected(), PndFsmMdtPid::detected(), PndFsmDrcBarrel::detected(), PndFsmEmcPid::detected(), PndFsmEffTracker::detected(), PndFsmSimpleTracker::initParameters(), PndFsmSimpleVtx::initParameters(), PndFsmDetTemplate::initParameters(), PndFsmMvdPid::initParameters(), PndFsmTof::initParameters(), PndFsmMdtPid::initParameters(), PndFsmEmcPid::initParameters(), initParameters(), PndFsmEmcBwCap::initParameters(), PndFsmEmcFS::initParameters(), PndFsmMvd2::initParameters(), PndFsmEmcFwCap::initParameters(), PndFsmRich::initParameters(), PndFsmMdcFS::initParameters(), PndFsmSttPid::initParameters(), PndFsmEmcBarrel::initParameters(), PndFsmDrcDisc::initParameters(), PndFsmDrcBarrel::initParameters(), PndFsmStt::initParameters(), PndFsmMvd::initParameters(), PndFsmEffTracker::initParameters(), PndFsmSimpleTracker::print(), PndFsmSimpleVtx::print(), PndFsmDetTemplate::print(), PndFsmMvdPid::print(), PndFsmTof::print(), PndFsmMdtPid::print(), PndFsmEmcPid::print(), PndFsmMdcFS::print(), PndFsmEmcFS::print(), print(), PndFsmEmcBwCap::print(), PndFsmMvd2::print(), PndFsmSttPid::print(), PndFsmEmcFwCap::print(), PndFsmRich::print(), PndFsmEmcBarrel::print(), PndFsmDrcDisc::print(), PndFsmDrcBarrel::print(), PndFsmStt::print(), PndFsmMvd::print(), PndFsmEffTracker::print(), PndFsmSimpleTracker::setParameter(), PndFsmSimpleVtx::setParameter(), PndFsmDetTemplate::setParameter(), PndFsmMvdPid::setParameter(), PndFsmMdtPid::setParameter(), PndFsmTof::setParameter(), PndFsmEmcPid::setParameter(), PndFsmMdcFS::setParameter(), PndFsmEmcFwCap::setParameter(), PndFsmEmcBwCap::setParameter(), PndFsmRich::setParameter(), PndFsmEmcFS::setParameter(), PndFsmMvd2::setParameter(), setParameter(), PndFsmSttPid::setParameter(), PndFsmEmcBarrel::setParameter(), PndFsmDrcBarrel::setParameter(), PndFsmDrcDisc::setParameter(), PndFsmMvd::setParameter(), PndFsmStt::setParameter(), and PndFsmEffTracker::setParameter().

TDatabasePDG* PndFsmAbsDet::_fdbPDG
protectedinherited
double PndFsmMdcTS::_pmin
private

Definition at line 83 of file PndFsmMdcTS.h.

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

double PndFsmMdcTS::_radiationLength
private

Definition at line 82 of file PndFsmMdcTS.h.

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

TRandom3* PndFsmAbsDet::_rand
protectedinherited
double PndFsmMdcTS::_thtMax
private

Definition at line 81 of file PndFsmMdcTS.h.

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

double PndFsmMdcTS::_thtMin
private

Definition at line 80 of file PndFsmMdcTS.h.

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


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