LArSoft  v09_90_00
Liquid Argon Software toolkit - https://larsoft.org/
GFGeoMatManager.cxx File Reference
#include "GFGeoMatManager.h"
#include "math.h"
#include <cassert>
#include "TGeoManager.h"
#include "TGeoMaterial.h"
#include "GFException.h"

Go to the source code of this file.

Functions

float MeanExcEnergy_get (int Z)
 
float MeanExcEnergy_get (TGeoMaterial *)
 

Variables

const int MeanExcEnergy_NELEMENTS = 92
 
const float MeanExcEnergy_vals [MeanExcEnergy_NELEMENTS]
 

Function Documentation

float MeanExcEnergy_get ( int  Z)

Definition at line 88 of file GFGeoMatManager.cxx.

References MeanExcEnergy_NELEMENTS, MeanExcEnergy_vals, and GFException::setFatal().

Referenced by genf::GFGeoMatManager::getMaterialParameters(), and MeanExcEnergy_get().

89 {
90  if ((Z <= 0) || (Z > MeanExcEnergy_NELEMENTS))
91  throw GFException("MeanExcEnergy_get(): Z out of range", __LINE__, __FILE__).setFatal();
92  return MeanExcEnergy_vals[Z - 1];
93 }
const float MeanExcEnergy_vals[MeanExcEnergy_NELEMENTS]
Float_t Z
Definition: plot.C:37
Exception class for error handling in GENFIT (provides storage for diagnostic information) ...
Definition: GFException.h:47
GFException & setFatal(bool b=true)
set fatal flag. if this is true, the fit stops for this current track repr.
Definition: GFException.h:75
const int MeanExcEnergy_NELEMENTS
float MeanExcEnergy_get ( TGeoMaterial *  mat)

Definition at line 95 of file GFGeoMatManager.cxx.

References e, and MeanExcEnergy_get().

96 {
97  if (mat->IsMixture()) {
98  double logMEE = 0.;
99  double denom = 0.;
100  TGeoMixture* mix = (TGeoMixture*)mat;
101  for (int i = 0; i < mix->GetNelements(); ++i) {
102  int index = int(floor((mix->GetZmixt())[i]));
103  //check whether the floor command worked
104  assert(fabs(index - ((mix->GetZmixt())[i])) < 1.e-3);
105  logMEE += 1. / (mix->GetAmixt())[i] * (mix->GetWmixt())[i] * (mix->GetZmixt())[i] *
106  log(MeanExcEnergy_get(index));
107  denom += (mix->GetWmixt())[i] * (mix->GetZmixt())[i] * 1. / (mix->GetAmixt())[i];
108  }
109  logMEE /= denom;
110  return exp(logMEE);
111  }
112  else { // not a mixture
113  int index = int(floor(mat->GetZ()));
114  //check whether the floor command worked
115  assert(fabs(index - mat->GetZ()) < 1.e-3);
116  return MeanExcEnergy_get(index);
117  }
118 }
float MeanExcEnergy_get(int Z)
Float_t mat
Definition: plot.C:38
Float_t e
Definition: plot.C:35

Variable Documentation

const int MeanExcEnergy_NELEMENTS = 92

Definition at line 78 of file GFGeoMatManager.cxx.

Referenced by MeanExcEnergy_get().

const float MeanExcEnergy_vals[MeanExcEnergy_NELEMENTS]
Initial value:
= {
19.2, 41.8, 40.0, 63.7, 76.0, 78., 82.0, 95.0, 115.0, 137.0, 149.0, 156.0, 166.0, 173.0,
173.0, 180.0, 174.0, 188.0, 190.0, 191.0, 216.0, 233.0, 245.0, 257.0, 272.0, 286.0, 297.0, 311.0,
322.0, 330.0, 334.0, 350.0, 347.0, 348.0, 343.0, 352.0, 363.0, 366.0, 379.0, 393.0, 417.0, 424.0,
428.0, 441.0, 449.0, 470.0, 470.0, 469.0, 488.0, 488.0, 487.0, 485.0, 491.0, 482.0, 488.0, 491.0,
501.0, 523.0, 535.0, 546.0, 560.0, 574.0, 580.0, 591.0, 614.0, 628.0, 650.0, 658.0, 674.0, 684.0,
694.0, 705.0, 718.0, 727.0, 736.0, 746.0, 757.0, 790.0, 790.0, 800.0, 810.0, 823.0, 823.0, 830.0,
825.0, 794.0, 827.0, 826.0, 841.0, 847.0, 878.0, 890.0}

Definition at line 79 of file GFGeoMatManager.cxx.

Referenced by MeanExcEnergy_get().