LArSoft  v07_13_02
Liquid Argon Software toolkit - http://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 <iostream>
28 #include "TObject.h"
29 #include <vector>
30 #include "TVector3.h"
31 #include "TMatrixT.h"
32 
33 #include "TDatabasePDG.h"
34 #include "TGeoMaterial.h"
35 #include "TGeoManager.h"
36 
39 
40 
56 namespace genf {
57 
58 class GFMaterialEffects : public TObject{
59  private:
60 
62  virtual ~GFMaterialEffects();
64 
65  public:
67  static void destruct();
68 
69  void setEnergyLossBetheBloch(bool opt = true){fEnergyLossBetheBloch=opt;}
70  void setNoiseBetheBloch(bool opt = true){fNoiseBetheBloch=opt;}
71  void setNoiseCoulomb(bool opt = true){fNoiseCoulomb=opt;}
72  void setEnergyLossBrems(bool opt = true){fEnergyLossBrems=opt;}
73  void setNoiseBrems(bool opt = true){fNoiseBrems=opt;}
74 
76  double effects(const std::vector<TVector3>& points,
77  const std::vector<double>& pointPaths,
78  const double& mom,
79  const int& pdg,
80  const bool& doNoise = false,
81  TMatrixT<Double_t>* noise = NULL,
82  const TMatrixT<Double_t>* jacobian = NULL,
83  const TVector3* directionBefore = NULL,
84  const TVector3* directionAfter = NULL);
85 
87 
89  double stepper(const double& maxDist,
90  const double& posx,
91  const double& posy,
92  const double& posz,
93  const double& dirx,
94  const double& diry,
95  const double& dirz,
96  const double& mom,
97  const int& pdg);
98  double stepper(const double& maxDist,
99  const TVector3& pos,
100  const TVector3& dir,
101  const double& mom,
102  const int& pdg){
103  return stepper(maxDist, pos.X(),pos.Y(),pos.Z(),dir.X(),dir.Y(),dir.Z(),mom,pdg);};
104 
105  private:
107  // std::vector<GFAbsEnergyLoss*> fEnergyLoss;
109  //GFGeoMatManager *geoMatManager;
110  void getParameters();
111 
113  void calcBeta(double mom);
114 
116 
121  double energyLossBetheBloch(const double& mom);
122 
124 
132  void noiseBetheBloch(const double& mom,
133  TMatrixT<double>* noise) const;
134 
136 
325  void noiseCoulomb(const double& mom,
326  TMatrixT<double>* noise,
327  const TMatrixT<double>* jacobian,
328  const TVector3* directionBefore,
329  const TVector3* directionAfter) const;
330 
332 
336  double energyLossBrems(const double& mom) const;
337 
339 
342  void noiseBrems(const double& mom,
343  TMatrixT<double>* noise) const;
344  double MeanExcEnergy_get(int Z);
345  double MeanExcEnergy_get(TGeoMaterial*);
346 
352 
353  const double me; // electron mass (GeV)
354 
355  double fstep; // stepsize
356 
357  // cached values for energy loss and noise calculations
358  double fbeta;
359  double fdedx;
360  double fgamma;
361  double fgammaSquare;
362 
363  double fmatDensity;
364  double fmatZ;
365  double fmatA;
367  double fmEE; // mean excitation energy
368 
369  int fpdg;
370  double fcharge;
371  double fmass;
372 
373 
374  // public:
375  //classDef(GFMaterialEffects,1)
376 
377 };
378 
379 } // end namespace
380 
381 #endif
382 
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.
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:265
Float_t Z
Definition: plot.C:39
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.