FairRoot/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 
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 
64 
66  double effects(const std::vector<TVector3>& points,
67  const std::vector<double>& pointPaths,
68  const double& mom,
69  const int& pdg,
70  const bool& doNoise = false,
71  TMatrixT<double>* noise = NULL,
72  const TMatrixT<double>* jacobian = NULL,
73  const TVector3* directionBefore = NULL,
74  const TVector3* directionAfter = NULL);
75 
77 
79  double stepper(const double& maxDist,
80  const double& posx,
81  const double& posy,
82  const double& posz,
83  const double& dirx,
84  const double& diry,
85  const double& dirz,
86  const double& mom,
87  const int& pdg);
88 
89  double stepper(const double& maxDist,
90  const TVector3& pos,
91  const TVector3& dir,
92  const double& mom,
93  const int& pdg){
94  return stepper(maxDist, pos.X(),pos.Y(),pos.Z(),dir.X(),dir.Y(),dir.Z(),mom,pdg);
95  }
96 
97  private:
99  void getParameters();
100 
102  void calcBeta(double mom);
103 
105 
110  double energyLossBetheBloch(const double& mom);
111 
113 
121  void noiseBetheBloch(const double& mom,
122  TMatrixT<double>* noise) const;
123 
125 
314  void noiseCoulomb(const double& mom,
315  TMatrixT<double>* noise,
316  const TMatrixT<double>* jacobian,
317  const TVector3* directionBefore,
318  const TVector3* directionAfter) const;
319 
321 
325  double energyLossBrems(const double& mom) const;
326 
328 
331  void noiseBrems(const double& mom,
332  TMatrixT<double>* noise) const;
333 
339 
340  const double me; // electron mass (GeV)
341 
342  double fstep; // stepsize
343 
344  // cached values for energy loss and noise calculations
345  double fbeta;
346  double fdedx;
347  double fgamma;
348  double fgammaSquare;
349 
350  double fmatDensity;
351  double fmatZ;
352  double fmatA;
354  double fmEE; // mean excitation energy
355 
356  int fpdg;
357  double fcharge;
358  double fmass;
359 
360  public:
361  ClassDef(GFMaterialEffects,1)
362 
363 };
364 
365 #endif
366 
TVector3 pos
void setNoiseBrems(bool opt=true)
void noiseCoulomb(const double &mom, TMatrixT< double > *noise, const TMatrixT< double > *jacobian, const TVector3 *directionBefore, const TVector3 *directionAfter) const
calculation of multiple scattering
void noiseBrems(const double &mom, TMatrixT< double > *noise) const
calculation of energy loss straggeling
void calcBeta(double mom)
sets fbeta, fgamma, fgammasquare; must only be used after calling getParameters() ...
Contains stepper and energy loss/noise matrix calculation.
void noiseBetheBloch(const double &mom, TMatrixT< double > *noise) const
calculation of energy loss straggeling
void setNoiseCoulomb(bool opt=true)
void setEnergyLossBrems(bool opt=true)
static void destruct()
static GFMaterialEffects * finstance
Double_t mom
Definition: plot_dirc.C:14
double energyLossBetheBloch(const double &mom)
Returns energy loss.
void getParameters()
sets fmatDensity, fmatZ, fmatA, fradiationLength, fmEE, fcharge, fmass;
double energyLossBrems(const double &mom) const
Returns energy loss.
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)
static GFMaterialEffects * getInstance()
double noise
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=NULL, const TMatrixT< double > *jacobian=NULL, const TVector3 *directionBefore=NULL, const TVector3 *directionAfter=NULL)
Calculates energy loss in the travelled path, optional calculation of noise matrix.