LArSoft  v09_90_00
Liquid Argon Software toolkit - https://larsoft.org/
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 "TObject.h"
28 #include "TVector3.h"
29 #include <vector>
30 
31 class TGeoMaterial;
32 
48 namespace genf {
49 
50  class GFMaterialEffects : public TObject {
51  private:
53  virtual ~GFMaterialEffects();
55 
56  public:
58  static void destruct();
59 
60  void setEnergyLossBetheBloch(bool opt = true) { fEnergyLossBetheBloch = opt; }
61  void setNoiseBetheBloch(bool opt = true) { fNoiseBetheBloch = opt; }
62  void setNoiseCoulomb(bool opt = true) { fNoiseCoulomb = opt; }
63  void setEnergyLossBrems(bool opt = true) { fEnergyLossBrems = opt; }
64  void setNoiseBrems(bool opt = true) { fNoiseBrems = opt; }
65 
67  double effects(const std::vector<TVector3>& points,
68  const std::vector<double>& pointPaths,
69  const double& mom,
70  const int& pdg,
71  const bool& doNoise = false,
72  TMatrixT<Double_t>* noise = NULL,
73  const TMatrixT<Double_t>* jacobian = NULL,
74  const TVector3* directionBefore = NULL,
75  const TVector3* directionAfter = NULL);
76 
78 
80  double stepper(const double& maxDist,
81  const double& posx,
82  const double& posy,
83  const double& posz,
84  const double& dirx,
85  const double& diry,
86  const double& dirz,
87  const double& mom,
88  const int& pdg);
89  double stepper(const double& maxDist,
90  const TVector3& pos,
91  const TVector3& dir,
92  const double& mom,
93  const int& pdg)
94  {
95  return stepper(maxDist, pos.X(), pos.Y(), pos.Z(), dir.X(), dir.Y(), dir.Z(), mom, pdg);
96  };
97 
98  private:
100  // std::vector<GFAbsEnergyLoss*> fEnergyLoss;
102  //GFGeoMatManager *geoMatManager;
103  void getParameters();
104 
106  void calcBeta(double mom);
107 
109 
114  double energyLossBetheBloch(const double& mom);
115 
117 
125  void noiseBetheBloch(const double& mom, TMatrixT<double>* noise) const;
126 
128 
317  void noiseCoulomb(const double& mom,
318  TMatrixT<double>* noise,
319  const TMatrixT<double>* jacobian,
320  const TVector3* directionBefore,
321  const TVector3* directionAfter) const;
322 
324 
328  double energyLossBrems(const double& mom) const;
329 
331 
334  void noiseBrems(const double& mom, TMatrixT<double>* noise) const;
335  double MeanExcEnergy_get(int Z);
336  double MeanExcEnergy_get(TGeoMaterial*);
337 
343 
344  const double me; // electron mass (GeV)
345 
346  double fstep; // stepsize
347 
348  // cached values for energy loss and noise calculations
349  double fbeta;
350  double fdedx;
351  double fgamma;
352  double fgammaSquare;
353 
354  double fmatDensity;
355  double fmatZ;
356  double fmatA;
358  double fmEE; // mean excitation energy
359 
360  int fpdg;
361  double fcharge;
362  double fmass;
363 
364  // public:
365  //classDef(GFMaterialEffects,1)
366  };
367 
368 } // end namespace
369 
370 #endif
371 
static GFMaterialEffects * getInstance()
void noiseBrems(const double &mom, TMatrixT< double > *noise) const
calculation of energy loss straggeling
void noiseCoulomb(const double &mom, TMatrixT< double > *noise, const TMatrixT< double > *jacobian, const TVector3 *directionBefore, const TVector3 *directionAfter) const
calculation of multiple scattering
void setNoiseBrems(bool opt=true)
Generic Interface to magnetic fields in GENFIT.
Definition: GFAbsBField.h:34
void setNoiseBetheBloch(bool opt=true)
double energyLossBrems(const double &mom) const
Returns energy loss.
void noiseBetheBloch(const double &mom, TMatrixT< double > *noise) const
calculation of energy loss straggling
void setEnergyLossBrems(bool opt=true)
double stepper(const double &maxDist, const TVector3 &pos, const TVector3 &dir, const double &mom, const int &pdg)
unsigned int noise()
Definition: chem4.cc:261
Float_t Z
Definition: plot.C:37
void setNoiseCoulomb(bool opt=true)
void setEnergyLossBetheBloch(bool opt=true)
static GFMaterialEffects * finstance
void calcBeta(double mom)
sets fbeta, fgamma, fgammasquare; must only be used after calling getParameters() ...
TDirectory * dir
Definition: macro.C:5
double effects(const std::vector< TVector3 > &points, const std::vector< double > &pointPaths, const double &mom, const int &pdg, const bool &doNoise=false, TMatrixT< Double_t > *noise=NULL, const TMatrixT< Double_t > *jacobian=NULL, const TVector3 *directionBefore=NULL, const TVector3 *directionAfter=NULL)
Calculates energy loss in the travelled path, optional calculation of noise matrix.
void getParameters()
contains energy loss classes
double energyLossBetheBloch(const double &mom)
Returns energy loss.
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.