PandaRoot
MaterialEffects.h
Go to the documentation of this file.
1 /* Copyright 2008-2014, Technische Universitaet Muenchen,
2  Authors: Christian Hoeppner & Sebastian Neubert & Johannes Rauch
3 
4  This file is part of GENFIT.
5 
6  GENFIT is free software: you can redistribute it and/or modify
7  it under the terms of the GNU Lesser General Public License as published
8  by the Free Software Foundation, either version 3 of the License, or
9  (at your option) any later version.
10 
11  GENFIT is distributed in the hope that it will be useful,
12  but WITHOUT ANY WARRANTY; without even the implied warranty of
13  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14  GNU Lesser General Public License for more details.
15 
16  You should have received a copy of the GNU Lesser General Public License
17  along with GENFIT. If not, see <http://www.gnu.org/licenses/>.
18 */
19 
24 #ifndef genfit_MaterialEffects_h
25 #define genfit_MaterialEffects_h
26 
27 #include "RKTools.h"
28 #include "AbsMaterialInterface.h"
29 
30 #include <iostream>
31 #include <vector>
32 
33 #include <TObject.h>
34 #include <TVector3.h>
35 
36 namespace genfit {
37 
50 class MaterialEffects : public TObject {
51 
52  private:
54  virtual ~MaterialEffects();
55 
56  static MaterialEffects *instance_;
57 
58  public:
59  static MaterialEffects *getInstance();
60  static void destruct();
61 
63  void init(AbsMaterialInterface *matIfc);
64  bool isInitialized() { return materialInterface_ != nullptr; }
65 
66  void setNoEffects(bool opt = true) { noEffects_ = opt; }
67 
68  void setEnergyLossBetheBloch(bool opt = true)
69  {
70  energyLossBetheBloch_ = opt;
71  noEffects_ = false;
72  }
73  void setNoiseBetheBloch(bool opt = true)
74  {
75  noiseBetheBloch_ = opt;
76  noEffects_ = false;
77  }
78  void setNoiseCoulomb(bool opt = true)
79  {
80  noiseCoulomb_ = opt;
81  noEffects_ = false;
82  }
83  void setEnergyLossBrems(bool opt = true)
84  {
85  energyLossBrems_ = opt;
86  noEffects_ = false;
87  }
88  void setNoiseBrems(bool opt = true)
89  {
90  noiseBrems_ = opt;
91  noEffects_ = false;
92  }
93  void ignoreBoundariesBetweenEqualMaterials(bool opt = true) { ignoreBoundariesBetweenEqualMaterials_ = opt; }
94 
100  void setMscModel(const std::string &modelName);
101 
103  double effects(const std::vector<RKStep> &steps, int materialsFXStart, int materialsFXStop, const double &mom, const int &pdg, M7x7 *noise = nullptr);
104 
110  void stepper(const RKTrackRep *rep, M1x7 &state7,
111  const double &mom, // momentum
112  double &relMomLoss, // relative momloss for the step will be added
113  const int &pdg, MaterialProperties &currentMaterial, StepLimits &limits, bool varField = true);
114 
115  void setDebugLvl(unsigned int lvl = 1);
116 
117  void drawdEdx(int pdg = 11);
118 
119  private:
121  void getParticleParameters();
122 
123  void getMomGammaBeta(double Energy, double &mom, double &gammaSquare, double &gamma, double &betaSquare) const;
124 
126 
129  double momentumLoss(double stepSign, double mom, bool linear);
130 
132  double dEdx(double Energy) const;
133 
135  double dEdxBetheBloch(double betaSquare, double gamma, double gammasquare) const;
136 
138 
146  void noiseBetheBloch(M7x7 &noise, double mom, double betaSquare, double gamma, double gammaSquare) const;
147 
149 
156  void noiseCoulomb(M7x7 &noise, const M1x3 &direction, double momSquare, double betaSquare) const;
157 
159 
163  double dEdxBrems(double mom) const;
164 
166 
168  void noiseBrems(M7x7 &noise, double momSquare, double betaSquare) const;
169 
170  bool noEffects_;
171 
172  bool energyLossBetheBloch_;
173  bool noiseBetheBloch_;
174  bool noiseCoulomb_;
175  bool energyLossBrems_;
176  bool noiseBrems_;
177 
178  bool ignoreBoundariesBetweenEqualMaterials_;
179 
180  const double me_; // electron mass (GeV)
181 
182  double stepSize_; // stepsize
183 
184  // cached values for energy loss and noise calculations
185  double dEdx_; // Runkge Kutta dEdx
186  double E_; // Runge Kutta Energy
187  double matDensity_;
188  double matZ_;
189  double matA_;
190  double radiationLength_;
191  double mEE_; // mean excitation energy
192 
193  int pdg_;
194  int charge_;
195  double mass_;
196 
197  int mscModelCode_;
198 
199  AbsMaterialInterface *materialInterface_;
200 
201  unsigned int debugLvl_;
202 
203  // ClassDef(MaterialEffects, 1);
204 };
205 
206 } /* End of namespace genfit */
209 #endif // genfit_MaterialEffects_h
Helper to store different limits on the stepsize for the RKTRackRep.
Definition: StepLimits.h:52
Abstract base class for geometry interfacing.
double effects(const std::vector< RKStep > &steps, int materialsFXStart, int materialsFXStop, const double &mom, const int &pdg, M7x7 *noise=nullptr)
Calculates energy loss in the traveled path, optional calculation of noise matrix.
Material properties needed e.g. for material effects calculation.
void ignoreBoundariesBetweenEqualMaterials(bool opt=true)
void setEnergyLossBrems(bool opt=true)
void stepper(const RKTrackRep *rep, M1x7 &state7, const double &mom, double &relMomLoss, const int &pdg, MaterialProperties &currentMaterial, StepLimits &limits, bool varField=true)
Returns maximum length so that a specified momentum loss will not be exceeded.
void setEnergyLossBetheBloch(bool opt=true)
void setNoEffects(bool opt=true)
Stepper and energy loss/noise matrix calculation.
static MaterialEffects * getInstance()
void setNoiseBrems(bool opt=true)
double M1x7[1 *7]
Definition: RKTools.h:36
void init(AbsMaterialInterface *matIfc)
set the material interface here. Material interface classes must be derived from AbsMaterialInterface...
void setNoiseBetheBloch(bool opt=true)
static void destruct()
void setNoiseCoulomb(bool opt=true)
void setMscModel(const std::string &modelName)
Select the multiple scattering model that will be used during track fit.
double M1x3[1 *3]
Definition: RKTools.h:33
AbsTrackRep with 5D track parameterization in plane coordinates: (q/p, u&#39;, v&#39;, u, v) ...
void setDebugLvl(unsigned int lvl=1)
double M7x7[7 *7]
Definition: RKTools.h:39
void drawdEdx(int pdg=11)
Matrix inversion tools.
Definition: AbsBField.h:28