FairRoot/PandaRoot
PndFsmMdcTS.cxx
Go to the documentation of this file.
1 //--------------------------------------------------------------------------
2 // File and Version Information:
3 // $Id: FsmMdcTS.cc,v 1.10 2007/05/24 08:07:40 klausg Exp $
4 //
5 // Description:
6 // Class FsmMdcTS
7 //
8 // Implementation of the MDCs system in the Traget Spectrometer (DC1-DC2) 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 "PndFsmMdcTS.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 // Local Macros, Typedefs, Structures, Unions and Forward Declarations --
51 //-----------------------------------------------------------------------
52 
53 //----------------
54 // Constructors --
55 //----------------
56 
58 {
60 
61  _thtMin=_thtMin*M_PI/180.0;
62  _thtMax=_thtMax*M_PI/180.0;
63  //print(std::cout);
64 }
65 
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"
72  parseParameterList(par);
73 
74  _thtMin=_thtMin*M_PI/180.0;
75  _thtMax=_thtMax*M_PI/180.0;
76  //print(std::cout);
77 }
78 
79 //--------------
80 // Destructor --
81 //--------------
82 
84 {
85 }
86 
87 //--------------
88 // Operations --
89 //--------------
90 
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 }
115 
116 bool
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 }
128 
129 double
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 }
140 
141 double
142 PndFsmMdcTS::dphi(PndFsmTrack *) const // t //[R.K.03/2017] unused variable(s)
143 {
144  return 0.0002; //to be refined
145 }
146 
147 double
148 PndFsmMdcTS::dtheta(PndFsmTrack *) const // t //[R.K.03/2017] unused variable(s)
149 {
150  return 0.0002; //to be refined
151 }
152 
153 void
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 }
165 
166 void
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 }
179 
180 bool
181 PndFsmMdcTS::setParameter(std::string &name, double value)
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
void setdphi(double val)
void initParameters()
std::list< std::string > ArgList
Definition: ArgList.h:7
friend F32vec4 sqrt(const F32vec4 &a)
Definition: P4_F32vec4.h:29
double dtheta(PndFsmTrack *t) const
friend F32vec4 sin(const F32vec4 &a)
Definition: P4_F32vec4.h:111
bool hitMapResponse(unsigned int)
Definition: PndFsmTrack.h:86
double _thtMin
Definition: PndFsmMdcTS.h:80
Double_t par[3]
double charge()
Definition: PndFsmTrack.h:75
Double_t mom
Definition: plot_dirc.C:14
void parseParameterList(ArgList &par)
void print(std::ostream &o)
double _a3Par
Definition: PndFsmMdcTS.h:85
TRandom3 * _rand
Definition: PndFsmAbsDet.h:94
Double_t p
Definition: anasim.C:58
bool setParameter(std::string &name, double value)
TLorentzVector p4()
Definition: PndFsmTrack.h:72
basic_ostream< char, char_traits< char > > ostream
void setDetector(PndFsmAbsDet *detector)
const std::string & detName()
Definition: PndFsmAbsDet.h:74
void setdp(double val)
virtual PndFsmResponse * respond(PndFsmTrack *t)
Definition: PndFsmMdcTS.cxx:92
friend F32vec4 fabs(const F32vec4 &a)
Definition: P4_F32vec4.h:47
TString name
bool hitMapValid()
Definition: PndFsmTrack.h:85
double _thtMax
Definition: PndFsmMdcTS.h:81
double dphi(PndFsmTrack *t) const
std::string _detName
Definition: PndFsmAbsDet.h:92
double dp(PndFsmTrack *t) const
double _radiationLength
Definition: PndFsmMdcTS.h:82
void setDetected(bool isdet)
TTree * t
Definition: bump_analys.C:13
void setdtheta(double val)
virtual ~PndFsmMdcTS()
Definition: PndFsmMdcTS.cxx:83
bool detected(PndFsmTrack *t) const
double _a4Par
Definition: PndFsmMdcTS.h:86