FairRoot/PandaRoot
PndFsmMdcFS.cxx
Go to the documentation of this file.
1 //--------------------------------------------------------------------------
2 // File and Version Information:
3 // $Id: FsmMdcFS.cc,v 1.9 2007/05/24 08:07:40 klausg Exp $
4 //
5 // Description:
6 // Class FsmMdcFS
7 //
8 // Implementation of the MDCs system for the Forward Spectrometer (DC3-DC8) for the FastSim
9 //
10 // This software was developed for the PANDA collaboration. If you
11 // use all or part of it, please give an appropriat2e acknowledgement.
12 //
13 // Author List:
14 // Klaus Goetzen Original Author
15 //
16 // Copyright Information:
17 // Copyright (C) 2006 GSI
18 //
19 //------------------------------------------------------------------------
20 
21 //-----------------------
22 // This Class's Header --
23 //-----------------------
24 #include "PndFsmMdcFS.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 
49 
50 //-----------------------------------------------------------------------
51 // Local Macros, Typedefs, Structures, Unions and Forward Declarations --
52 //-----------------------------------------------------------------------
53 
54 //----------------
55 // Constructors --
56 //----------------
57 
59 {
61 
62  _thtMin=_thtMin*M_PI/180.0;
63  _thtMax=_thtMax*M_PI/180.0;
64  _angleXMax *= M_PI/180.0;
65  _angleYMax *= M_PI/180.0;
66  //print(std::cout);
67 }
68 
70 {
72  //set default parameter values and parses a parameter list
73  //i.e. std::list<std::string> of the form
74  //"a=1" "b=2" "c=3"
75  parseParameterList(par);
76 
77  _thtMin=_thtMin*M_PI/180.0;
78  _thtMax=_thtMax*M_PI/180.0;
79  _angleXMax *= M_PI/180.0;
80  _angleYMax *= M_PI/180.0;
81 
82 
83  //print(std::cout);
84 }
85 
86 //--------------
87 // Destructor --
88 //--------------
89 
91 {
92 }
93 
94 //--------------
95 // Operations --
96 //--------------
97 
100 {
101  PndFsmResponse *result=new PndFsmResponse();
102 
103  result->setDetector(this);
104  bool wasDetected=detected(t);
105  result->setDetected(wasDetected);
106 
107  if (wasDetected && fabs(t->charge())>1e-8)
108  {
109  result->setdp(dp(t));
110  result->setdphi(dphi(t));
111  result->setdtheta(dtheta(t));
112  }
113  else
114  {
115  result->setdp(0.);
116  result->setdphi(0.);
117  result->setdtheta(0.);
118  }
119 
120  return result;
121 }
122 
123 bool
125 {
126  if (t->hitMapValid()) {
128  } else {
129  double theta = t->p4().Theta();
130 
131  if (t->p4().Z()<=0) return false;
132 
133  double angleX = fabs(atan(t->p4().X()/t->p4().Z()));
134  double angleY = fabs(atan(t->p4().Y()/t->p4().Z()));
135  double p=t->p4().Vect().Mag();
136  double charge=t->charge();
137  return ( charge!=0.0 && theta>=_thtMin && angleX<=_angleXMax && angleY<=_angleYMax && p>_pmin && _rand->Rndm()<=_efficiency);
138  }
139 }
140 
141 double
143 {
144  TLorentzVector p4=t->p4();
145  double mom=p4.Vect().Mag();
146  double rad=_a1Par*_a1Par*mom*mom + _a2Par*_a2Par;
147  if (rad<0 || mom==0 ) return 0.0;
148  double sigp = sqrt(rad) / _Bl * mom;
149 
150  return sigp;
151 }
152 
153 double
154 PndFsmMdcFS::dphi(PndFsmTrack *) const // t //[R.K.03/2017] unused variable(s)
155 {
156  return 0.0002; //to be refined
157 }
158 
159 double
160 PndFsmMdcFS::dtheta(PndFsmTrack *) const // t //[R.K.03/2017] unused variable(s)
161 {
162  return 0.0002; //to be refined
163 }
164 
165 void
167 {
168  o <<"Parameters for detector <"<<detName()<<">"<<endl;
169  o <<" _thtMin = "<<_thtMin<<endl;
170  o <<" _angleXMax = "<<_angleXMax<<endl;
171  o <<" _angleYMax = "<<_angleYMax<<endl;
172  o <<" _radiationLength = "<<_radiationLength<<endl;
173  o <<" _pmin = "<<_pmin<<endl;
174  o <<" _a1Par = "<<_a1Par<<endl;
175  o <<" _a2Par = "<<_a2Par<<endl;
176  o <<" _Bl = "<<_Bl<<endl;
177  o <<" _efficiency = "<<_efficiency<<endl;
178 }
179 
180 void
182 {
183  _detName = "MdcFS";
184  _thtMin = 0.5;
185  _angleXMax = 10.0;
186  _angleYMax = 5.0;
187  _radiationLength = 0.0;
188  _pmin = 0.7;
189  _a1Par = 0.00113;
190  _a2Par = 0.00227;
191  _Bl = 2.0;
192  _efficiency =1.0;
193 
194 }
195 
196 bool
197 PndFsmMdcFS::setParameter(std::string &name, double value)
198 {
199  // *****************
200  // include here all parameters which should be settable via tcl
201  // *****************
202 
203  bool knownName=true;
204 
205  if (name == "thtMin")
206  _thtMin=value;
207  else
208  if (name == "angleXMax")
209  _angleXMax=value;
210  else
211  if (name == "angleYMax")
212  _angleYMax=value;
213  else
214  if (name == "radiationLength")
215  _radiationLength=value;
216  else
217  if (name == "pmin")
218  _pmin=value;
219  else
220  if (name == "a1Par")
221  _a1Par=value;
222  else
223  if (name == "a2Par")
224  _a2Par=value;
225  else
226  if (name == "Bl")
227  _Bl=value;
228  else
229  if (name == "efficiency")
230  _efficiency=value;
231  else
232  knownName=false;
233 
234  return knownName;
235 }
236 
237 
double _a2Par
Definition: PndFsmMdcFS.h:88
double _radiationLength
Definition: PndFsmMdcFS.h:84
double _efficiency
Definition: PndFsmAbsDet.h:93
void setdphi(double val)
std::list< std::string > ArgList
Definition: ArgList.h:7
friend F32vec4 sqrt(const F32vec4 &a)
Definition: P4_F32vec4.h:29
virtual PndFsmResponse * respond(PndFsmTrack *t)
Definition: PndFsmMdcFS.cxx:99
bool hitMapResponse(unsigned int)
Definition: PndFsmTrack.h:86
Double_t par[3]
double charge()
Definition: PndFsmTrack.h:75
Double_t mom
Definition: plot_dirc.C:14
void parseParameterList(ArgList &par)
TRandom3 * _rand
Definition: PndFsmAbsDet.h:94
double _thtMin
Definition: PndFsmMdcFS.h:80
Double_t p
Definition: anasim.C:58
void print(std::ostream &o)
virtual ~PndFsmMdcFS()
Definition: PndFsmMdcFS.cxx:90
TLorentzVector p4()
Definition: PndFsmTrack.h:72
double _thtMax
Definition: PndFsmMdcFS.h:81
basic_ostream< char, char_traits< char > > ostream
void setDetector(PndFsmAbsDet *detector)
double _angleYMax
Definition: PndFsmMdcFS.h:83
bool detected(PndFsmTrack *t) const
const std::string & detName()
Definition: PndFsmAbsDet.h:74
double dp(PndFsmTrack *t) const
void setdp(double val)
double _a1Par
Definition: PndFsmMdcFS.h:87
double _Bl
Definition: PndFsmMdcFS.h:89
friend F32vec4 fabs(const F32vec4 &a)
Definition: P4_F32vec4.h:47
TString name
double dphi(PndFsmTrack *t) const
bool hitMapValid()
Definition: PndFsmTrack.h:85
void initParameters()
double _angleXMax
Definition: PndFsmMdcFS.h:82
std::string _detName
Definition: PndFsmAbsDet.h:92
double dtheta(PndFsmTrack *t) const
void setDetected(bool isdet)
TTree * t
Definition: bump_analys.C:13
bool setParameter(std::string &name, double value)
void setdtheta(double val)
double _pmin
Definition: PndFsmMdcFS.h:85