ISCalculationNEST.cxx
Go to the documentation of this file.
1 ////////////////////////////////////////////////////////////////////////
2 /// \file ISCalcuationNEST.cxx
3 /// \brief Interface to algorithm class for calculating ionization electrons
4 /// and scintillation photons using nest
5 ///
6 /// \version $Id: $
7 /// \author brebel@fnal.gov
8 ////////////////////////////////////////////////////////////////////////
9 
11 
13 
14 namespace gar {
15  namespace rosim{
16 
17  //----------------------------------------------------------------------------
18  ISCalculationNEST::ISCalculationNEST(CLHEP::HepRandomEngine& engine)
19  : ISCalculation()
20  , fNest(0)
21  , fEngine(engine)
22  {
23  return;
24  }
25 
26  //----------------------------------------------------------------------------
28  {
29  if(fNest) delete fNest;
30 
31  return;
32  }
33 
34  //----------------------------------------------------------------------------
36  {
37  // \todo should ideally make the yield factor passed to the NestAlg ctor a parameter
38  if(!fNest) fNest = new NestAlg(1., fEngine);
39 
40  // Set the step size to small value if NEST is chosen, per Matthew Szydagis,
41  // "because without delta rays, the yields are wrong. The ICARUS model that is
42  // in GArSoft uses a fudge factor to compensate, but NEST is "purer" -- no
43  // fudge factor. "
45 
46  return;
47  }
48 
49  //----------------------------------------------------------------------------
51  {
52  fEnergyDeposit = 0.;
53  fNumIonElectrons = 0.;
54  fNumScintPhotons = 0.;
55 
56  return;
57  }
58 
59  //----------------------------------------------------------------------------
61  {
62  // get a const representation of the track for this step
63  //const G4Track track(*(step->GetTrack()));
64 
65  //fNest->CalculateIonizationAndScintillation(track, *step);
66 
67  // compare the energy deposition of this step to what is in the fNest object
68  if(fNest->EnergyDeposition() != dep->Energy() / CLHEP::GeV)
69  MF_LOG_WARNING("ISCalculationNest")
70  << "NEST and G4 step depositions do not agree!\n"
72  << " vs "
73  << dep->Energy() / CLHEP::GeV;
74 
75  // Nest uses Geant units, GArSoft assumes energy is in units of GeV here
79 
80  return;
81  }
82 
83  }// namespace
84 } // gar
ISCalculationNEST(CLHEP::HepRandomEngine &engine)
double EnergyDeposition() const
Definition: NestAlg.h:28
float const & Energy() const
Definition: EnergyDeposit.h:42
int fNumScintPhotons
number of scintillation photons for this step
Definition: ISCalculation.h:35
NestAlg * fNest
the fast optical simulation process
static constexpr double GeV
Definition: Units.h:28
double fEnergyDeposit
total energy deposited in the step
Definition: ISCalculation.h:33
int fNumIonElectrons
number of ionization electrons for this step
Definition: ISCalculation.h:34
int NumberScintillationPhotons() const
Definition: NestAlg.h:26
void CalculateIonizationAndScintillation(const gar::sdp::EnergyDeposit *dep)
General GArSoft Utilities.
int NumberIonizationElectrons() const
Definition: NestAlg.h:27
double fStepSize
maximum step to take
CLHEP::HepRandomEngine & fEngine
random engine
micrometer_as<> micrometer
Type of space stored in micrometers, in double precision.
Definition: spacetime.h:468
#define MF_LOG_WARNING(category)