FairRoot/PandaRoot
PndFsmIdealPid.cxx
Go to the documentation of this file.
1 //--------------------------------------------------------------------------
2 // File and Version Information:
3 // $Id: PndFsmIdealPid.cxx $
4 //
5 // Description:
6 // Class PndFsmIdealPid
7 //
8 // Implementation of the Montecarlo true PID 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 appropriate acknowledgement.
12 //
13 // Author List:
14 // Ralf Kliemt Original Author
15 //
16 // Copyright Information:
17 // Copyright (C) 2014 GSI
18 //
19 //------------------------------------------------------------------------
20 
21 //-----------------------
22 // This Class's Header --
23 //-----------------------
24 #include "PndFsmIdealPid.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 {
61  //print(std::cout);
62 }
63 
65 {
67  parseParameterList(par);
69  //print(std::cout);
70 }
71 
72 //--------------
73 // Destructor --
74 //--------------
75 
77 {
78 }
79 
80 //--------------
81 // Operations --
82 //--------------
83 
86 {
87  PndFsmResponse *result=new PndFsmResponse();
88 
89  result->setDetector(this);
90  bool wasDetected=detected(t);
91  result->setDetected(wasDetected);
92 
93  if (wasDetected)
94  {
95  int type = abs(t->pdt());
96 
97  result->setLHElectron(0.);
98  result->setLHMuon(0.);
99  result->setLHPion(0.);
100  result->setLHKaon(0.);
101  result->setLHProton(0.);
102 
103  if (abs(type)==11) result->setLHElectron(1.);
104  else if (abs(type)==13) result->setLHMuon(1.);
105  else if (abs(type)==211) result->setLHPion(1.);
106  else if (abs(type)==321) result->setLHKaon(1.);
107  else if (type==2212) result->setLHProton(1.);
108  else {
109  result->setLHElectron(0.2);
110  result->setLHMuon(0.2);
111  result->setLHPion(0.2);
112  result->setLHKaon(0.2);
113  result->setLHProton(0.2);
114  }
115  }
116  return result;
117 }
118 
119 bool
121 {
122  if(t) return true;
123  else return false;
124 }
125 
126 void
128 {
129  o <<"Parameters for detector <"<<detName()<<">"<<endl;
130 }
131 
132 void
134 {
135  _detName="IdealPid";
136  return;
137 }
138 
139 bool
140 PndFsmIdealPid::setParameter(std::string &, double ) // name value//[R.K.03/2017] unused variable(s)
141 {
142  return true;
143 }
144 
146 {
147  return true;
148 }
void setLHElectron(double val)
void setLHProton(double val)
std::list< std::string > ArgList
Definition: ArgList.h:7
virtual PndFsmResponse * respond(PndFsmTrack *t)
void setLHMuon(double val)
Double_t par[3]
void parseParameterList(ArgList &par)
void print(std::ostream &o)
basic_ostream< char, char_traits< char > > ostream
void setDetector(PndFsmAbsDet *detector)
bool setParameter(std::string &name, double value)
const std::string & detName()
Definition: PndFsmAbsDet.h:74
void setLHKaon(double val)
std::string _detName
Definition: PndFsmAbsDet.h:92
virtual ~PndFsmIdealPid()
bool detected(PndFsmTrack *t) const
void setDetected(bool isdet)
TTree * t
Definition: bump_analys.C:13
void setLHPion(double val)