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

#include <PndFsmSimpleVtx.h>

Inheritance diagram for PndFsmSimpleVtx:
PndFsmAbsDet

Public Member Functions

 PndFsmSimpleVtx ()
 
 PndFsmSimpleVtx (ArgList &par)
 
virtual ~PndFsmSimpleVtx ()
 
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
 
void initParameters ()
 
void print (std::ostream &o)
 
bool setParameter (std::string &name, double value)
 

Private Attributes

double _thtMin
 
double _thtMax
 
double _ptmin
 
double _vtxRes
 

Detailed Description

Definition at line 41 of file PndFsmSimpleVtx.h.

Constructor & Destructor Documentation

PndFsmSimpleVtx::PndFsmSimpleVtx ( )

Default ctor.

Definition at line 58 of file PndFsmSimpleVtx.cxx.

References _thtMax, _thtMin, and initParameters().

59 {
61 
62  _thtMin=_thtMin*M_PI/180.0;
63  _thtMax=_thtMax*M_PI/180.0;
64  //print(std::cout);
65 }
PndFsmSimpleVtx::PndFsmSimpleVtx ( ArgList par)

Definition at line 67 of file PndFsmSimpleVtx.cxx.

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

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

Destructor

Definition at line 84 of file PndFsmSimpleVtx.cxx.

85 {
86 }

Member Function Documentation

bool PndFsmSimpleVtx::detected ( PndFsmTrack t) const
private

Definition at line 110 of file PndFsmSimpleVtx.cxx.

References PndFsmAbsDet::_efficiency, _ptmin, PndFsmAbsDet::_rand, _thtMin, PndFsmTrack::charge(), 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 charge=t->charge();
115 
116  return ( charge!=0.0 && theta>=_thtMin && theta<=_thtMax && p_t>_ptmin && _rand->Rndm()<=_efficiency);
117 }
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
void PndFsmSimpleVtx::initParameters ( )
privatevirtual

Reimplemented from PndFsmAbsDet.

Definition at line 132 of file PndFsmSimpleVtx.cxx.

References PndFsmAbsDet::_detName, PndFsmAbsDet::_efficiency, _ptmin, _thtMax, _thtMin, _vtxRes, FsmDetEnum::Mvd, and FsmDetName::name().

Referenced by PndFsmSimpleVtx().

133 {
135  _thtMin = 5.0;
136  _thtMax = 160.0;
137  _ptmin = 0.0;
138  _vtxRes = 100e-4; //vtx res = 100 um
139  _efficiency =1.0;
140 }
double _efficiency
Definition: PndFsmAbsDet.h:93
static const std::string & name(unsigned int t)
Definition: FsmDetTypes.h:26
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::PndFsmSimpleTracker(), 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 PndFsmSimpleVtx::print ( std::ostream o)
privatevirtual

Reimplemented from PndFsmAbsDet.

Definition at line 121 of file PndFsmSimpleVtx.cxx.

References PndFsmAbsDet::_efficiency, _ptmin, _thtMax, _thtMin, _vtxRes, and PndFsmAbsDet::detName().

122 {
123  o <<"Parameters for detector <"<<detName()<<">"<<endl;
124  o <<" _thtMin = "<<_thtMin<<endl;
125  o <<" _thtMax = "<<_thtMax<<endl;
126  o <<" _ptmin = "<<_ptmin<<endl;
127  o <<" _vtxRes = "<<_vtxRes*1e5<<"um"<<endl;
128  o <<" _efficiency = "<<_efficiency<<endl;
129 }
double _efficiency
Definition: PndFsmAbsDet.h:93
const std::string & detName()
Definition: PndFsmAbsDet.h:74
PndFsmResponse * PndFsmSimpleVtx::respond ( PndFsmTrack t)
virtual

Accessors to contained information

Implements PndFsmAbsDet.

Definition at line 93 of file PndFsmSimpleVtx.cxx.

References _vtxRes, PndFsmTrack::charge(), detected(), fabs(), PndFsmResponse::setDetected(), PndFsmResponse::setDetector(), and PndFsmResponse::setdV().

94 {
95  PndFsmResponse *result=new PndFsmResponse();
96 
97  result->setDetector(this);
98  bool wasDetected=detected(t);
99  result->setDetected(wasDetected);
100 
101  if (wasDetected && fabs(t->charge())>1e-8)
102  {
103  result->setdV(_vtxRes, _vtxRes, _vtxRes);
104  }
105 
106  return result;
107 }
void setdV(TVector3 v)
double charge()
Definition: PndFsmTrack.h:75
bool detected(PndFsmTrack *t) const
void setDetector(PndFsmAbsDet *detector)
friend F32vec4 fabs(const F32vec4 &a)
Definition: P4_F32vec4.h:47
void setDetected(bool isdet)
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 PndFsmSimpleVtx::setParameter ( std::string &  name,
double  value 
)
privatevirtual

Reimplemented from PndFsmAbsDet.

Definition at line 143 of file PndFsmSimpleVtx.cxx.

References PndFsmAbsDet::_efficiency, _ptmin, _thtMax, _thtMin, and _vtxRes.

144 {
145  // *****************
146  // include here all parameters which should be settable via tcl
147  // *****************
148 
149  bool knownName=true;
150 
151  if (name == "thtMin")
152  _thtMin=value;
153  else
154  if (name == "thtMax")
155  _thtMax=value;
156  else
157  if (name == "ptmin")
158  _ptmin=value;
159  else
160  if (name == "vtxRes")
161  _vtxRes=value;
162  else
163  if (name == "efficiency")
164  _efficiency=value;
165  else
166  knownName=false;
167 
168  return knownName;
169 }
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(), PndFsmSimpleTracker::detected(), PndFsmTof::detected(), PndFsmEmcBwCap::detected(), PndFsmStt::detected(), PndFsmEmcFS::detected(), PndFsmEmcFwCap::detected(), PndFsmMdcFS::detected(), detected(), PndFsmSttPid::detected(), PndFsmMdcTS::detected(), PndFsmMvd::detected(), PndFsmMvd2::detected(), PndFsmMvdPid::detected(), PndFsmRich::detected(), PndFsmEmcBarrel::detected(), PndFsmDrcDisc::detected(), PndFsmMdtPid::detected(), PndFsmDrcBarrel::detected(), PndFsmEmcPid::detected(), PndFsmEffTracker::detected(), PndFsmSimpleTracker::initParameters(), initParameters(), PndFsmDetTemplate::initParameters(), PndFsmMvdPid::initParameters(), PndFsmTof::initParameters(), PndFsmMdtPid::initParameters(), PndFsmEmcPid::initParameters(), PndFsmRich::initParameters(), PndFsmMdcFS::initParameters(), PndFsmSttPid::initParameters(), PndFsmMdcTS::initParameters(), PndFsmEmcBwCap::initParameters(), PndFsmEmcFS::initParameters(), PndFsmMvd2::initParameters(), PndFsmEmcFwCap::initParameters(), PndFsmEmcBarrel::initParameters(), PndFsmDrcDisc::initParameters(), PndFsmDrcBarrel::initParameters(), PndFsmStt::initParameters(), PndFsmMvd::initParameters(), PndFsmEffTracker::initParameters(), PndFsmSimpleTracker::print(), print(), PndFsmDetTemplate::print(), PndFsmMvdPid::print(), PndFsmTof::print(), PndFsmMdtPid::print(), PndFsmEmcPid::print(), PndFsmSttPid::print(), PndFsmMdcFS::print(), PndFsmMdcTS::print(), PndFsmEmcBwCap::print(), PndFsmMvd2::print(), PndFsmEmcFS::print(), PndFsmEmcFwCap::print(), PndFsmRich::print(), PndFsmDrcDisc::print(), PndFsmEmcBarrel::print(), PndFsmDrcBarrel::print(), PndFsmStt::print(), PndFsmMvd::print(), PndFsmEffTracker::print(), PndFsmSimpleTracker::setParameter(), PndFsmMvdPid::setParameter(), PndFsmDetTemplate::setParameter(), setParameter(), PndFsmMdtPid::setParameter(), PndFsmTof::setParameter(), PndFsmEmcPid::setParameter(), PndFsmMdcTS::setParameter(), PndFsmMvd2::setParameter(), PndFsmEmcFwCap::setParameter(), PndFsmSttPid::setParameter(), PndFsmMdcFS::setParameter(), PndFsmRich::setParameter(), PndFsmEmcBwCap::setParameter(), PndFsmEmcFS::setParameter(), PndFsmEmcBarrel::setParameter(), PndFsmDrcDisc::setParameter(), PndFsmDrcBarrel::setParameter(), PndFsmStt::setParameter(), PndFsmMvd::setParameter(), and PndFsmEffTracker::setParameter().

TDatabasePDG* PndFsmAbsDet::_fdbPDG
protectedinherited
double PndFsmSimpleVtx::_ptmin
private

Definition at line 79 of file PndFsmSimpleVtx.h.

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

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

Definition at line 78 of file PndFsmSimpleVtx.h.

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

double PndFsmSimpleVtx::_thtMin
private

Definition at line 77 of file PndFsmSimpleVtx.h.

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

double PndFsmSimpleVtx::_vtxRes
private

Definition at line 80 of file PndFsmSimpleVtx.h.

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


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