PandaRoot
GFMaterialEffects.h
Go to the documentation of this file.
1 /* Copyright 2008-2009, Technische Universitaet Muenchen,
2  Authors: Christian Hoeppner & Sebastian Neubert
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 GFMATERIALEFFECTS_H
25 #define GFMATERIALEFFECTS_H
26 
27 #include <iostream>
28 #include "TObject.h"
29 #include <vector>
30 #include "TVector3.h"
31 #include "TMatrixT.h"
32 
47 class GFMaterialEffects : public TObject {
48  private:
50  virtual ~GFMaterialEffects();
51 
52  static GFMaterialEffects *finstance;
53 
54  public:
56  static void destruct();
57 
58  void setEnergyLossBetheBloch(bool opt = true) { fEnergyLossBetheBloch = opt; }
59  void setNoiseBetheBloch(bool opt = true) { fNoiseBetheBloch = opt; }
60  void setNoiseCoulomb(bool opt = true) { fNoiseCoulomb = opt; }
61  void setEnergyLossBrems(bool opt = true) { fEnergyLossBrems = opt; }
62  void setNoiseBrems(bool opt = true) { fNoiseBrems = opt; }
63 
65  double effects(const std::vector<TVector3> &points, const std::vector<double> &pointPaths, const double &mom, const int &pdg, const bool &doNoise = false,
66  TMatrixT<double> *noise = nullptr, const TMatrixT<double> *jacobian = nullptr, const TVector3 *directionBefore = nullptr,
67  const TVector3 *directionAfter = nullptr);
68 
70 
72  double stepper(const double &maxDist, const double &posx, const double &posy, const double &posz, const double &dirx, const double &diry, const double &dirz, const double &mom,
73  const int &pdg);
74 
75  double stepper(const double &maxDist, const TVector3 &pos, const TVector3 &dir, const double &mom, const int &pdg)
76  {
77  return stepper(maxDist, pos.X(), pos.Y(), pos.Z(), dir.X(), dir.Y(), dir.Z(), mom, pdg);
78  }
79 
80  private:
82  void getParameters();
83 
85  void calcBeta(double mom);
86 
88 
93  double energyLossBetheBloch(const double &mom);
94 
96 
104  void noiseBetheBloch(const double &mom, TMatrixT<double> *noise) const;
105 
107 
296  void noiseCoulomb(const double &mom, TMatrixT<double> *noise, const TMatrixT<double> *jacobian, const TVector3 *directionBefore, const TVector3 *directionAfter) const;
297 
299 
303  double energyLossBrems(const double &mom) const;
304 
306 
309  void noiseBrems(const double &mom, TMatrixT<double> *noise) const;
310 
311  bool fEnergyLossBetheBloch;
312  bool fNoiseBetheBloch;
313  bool fNoiseCoulomb;
314  bool fEnergyLossBrems;
315  bool fNoiseBrems;
316 
317  const double me; // electron mass (GeV)
318 
319  double fstep; // stepsize
320 
321  // cached values for energy loss and noise calculations
322  double fbeta;
323  double fdedx;
324  double fgamma;
325  double fgammaSquare;
326 
327  double fmatDensity;
328  double fmatZ;
329  double fmatA;
330  double fradiationLength;
331  double fmEE; // mean excitation energy
332 
333  int fpdg;
334  double fcharge;
335  double fmass;
336 
337  public:
338  ClassDef(GFMaterialEffects, 1)
339 };
340 
341 #endif
342 
void setNoiseBrems(bool opt=true)
static void destruct()
Contains stepper and energy loss/noise matrix calculation.
void setNoiseCoulomb(bool opt=true)
void setEnergyLossBrems(bool opt=true)
static GFMaterialEffects * getInstance()
void setEnergyLossBetheBloch(bool opt=true)
void setNoiseBetheBloch(bool opt=true)
double stepper(const double &maxDist, const double &posx, const double &posy, const double &posz, const double &dirx, const double &diry, const double &dirz, const double &mom, const int &pdg)
Returns maximum length so that a specified momentum loss will not be exceeded.
double stepper(const double &maxDist, const TVector3 &pos, const TVector3 &dir, const double &mom, const int &pdg)
double effects(const std::vector< TVector3 > &points, const std::vector< double > &pointPaths, const double &mom, const int &pdg, const bool &doNoise=false, TMatrixT< double > *noise=nullptr, const TMatrixT< double > *jacobian=nullptr, const TVector3 *directionBefore=nullptr, const TVector3 *directionAfter=nullptr)
Calculates energy loss in the travelled path, optional calculation of noise matrix.