LArSoft  v07_13_02
Liquid Argon Software toolkit - http://larsoft.org/
larg4::ISCalculationNEST Class Reference

#include "ISCalculationNEST.h"

Inheritance diagram for larg4::ISCalculationNEST:
larg4::ISCalculation

Public Member Functions

 ISCalculationNEST (CLHEP::HepRandomEngine &engine)
 
virtual ~ISCalculationNEST ()
 
void Initialize ()
 
void Reset ()
 
void CalculateIonizationAndScintillation (const G4Step *step)
 
double StepSizeLimit () const
 
double EnergyDeposit () const
 
double NumberIonizationElectrons () const
 
double NumberScintillationPhotons () const
 
double VisibleEnergyDeposit () const
 
double EFieldAtStep (double fEfield, const G4Step *step) const
 

Protected Attributes

double fEnergyDeposit
 total energy deposited in the step More...
 
double fNumIonElectrons
 number of ionization electrons for this step More...
 
double fNumScintPhotons
 number of scintillation photons for this step More...
 
double fVisibleEnergyDeposition
 

Private Attributes

NestAlgfNest
 the fast optical simulation process More...
 
double fStepSize
 maximum step to take More...
 
CLHEP::HepRandomEngine & fEngine
 random engine More...
 

Detailed Description

Definition at line 19 of file ISCalculationNEST.h.

Constructor & Destructor Documentation

larg4::ISCalculationNEST::ISCalculationNEST ( CLHEP::HepRandomEngine &  engine)

Definition at line 19 of file ISCalculationNEST.cxx.

20  : fNest(0)
21  , fEngine(engine)
22  {
23  return;
24  }
CLHEP::HepRandomEngine & fEngine
random engine
NestAlg * fNest
the fast optical simulation process
larg4::ISCalculationNEST::~ISCalculationNEST ( )
virtual

Definition at line 27 of file ISCalculationNEST.cxx.

References fNest.

28  {
29  if(fNest) delete fNest;
30 
31  return;
32  }
NestAlg * fNest
the fast optical simulation process

Member Function Documentation

void larg4::ISCalculationNEST::CalculateIonizationAndScintillation ( const G4Step *  step)
virtual

Implements larg4::ISCalculation.

Definition at line 61 of file ISCalculationNEST.cxx.

References NestAlg::CalculateIonizationAndScintillation(), NestAlg::EnergyDeposition(), larg4::ISCalculation::fEnergyDeposit, fNest, larg4::ISCalculation::fNumIonElectrons, larg4::ISCalculation::fNumScintPhotons, larg4::ISCalculation::fVisibleEnergyDeposition, NestAlg::NumberIonizationElectrons(), NestAlg::NumberScintillationPhotons(), and track.

62  {
63  // get a const representation of the track for this step
64  const G4Track track(*(step->GetTrack()));
65 
67 
68  // compare the energy deposition of this step to what is in the fNest object
69  if(fNest->EnergyDeposition() != step->GetTotalEnergyDeposit()/CLHEP::MeV)
70  mf::LogWarning("ISCalculationNest") << "NEST and G4 step depositions do not agree!\n"
71  << fNest->EnergyDeposition() << " vs "
72  << step->GetTotalEnergyDeposit()/CLHEP::MeV;
73 
74  // Nest uses Geant units, LArSoft assumes energy is in units of MeV here
75  fEnergyDeposit = fNest->EnergyDeposition()/CLHEP::MeV;
78  fVisibleEnergyDeposition = 0.; //Not implimented for NEST.
79 
80  return;
81  }
int NumberScintillationPhotons() const
Definition: NestAlg.h:24
const G4VParticleChange & CalculateIonizationAndScintillation(G4Track const &aTrack, G4Step const &aStep)
Definition: NestAlg.cxx:82
int NumberIonizationElectrons() const
Definition: NestAlg.h:25
double fNumIonElectrons
number of ionization electrons for this step
Definition: ISCalculation.h:40
NestAlg * fNest
the fast optical simulation process
double fNumScintPhotons
number of scintillation photons for this step
Definition: ISCalculation.h:41
double fVisibleEnergyDeposition
Definition: ISCalculation.h:42
double EnergyDeposition() const
Definition: NestAlg.h:26
double fEnergyDeposit
total energy deposited in the step
Definition: ISCalculation.h:39
Float_t track
Definition: plot.C:34
double larg4::ISCalculation::EFieldAtStep ( double  fEfield,
const G4Step *  step 
) const
inherited

Definition at line 30 of file ISCalculation.cxx.

Referenced by larg4::ISCalculationSeparate::CalculateIonizationAndScintillation(), and larg4::ISCalculation::VisibleEnergyDeposit().

31  {
32  auto const* SCE = lar::providerFrom<spacecharge::SpaceChargeService>();
33  if (!SCE->EnableSimEfieldSCE()) return fEfield;
34 
35  geo::Point_t midPoint
36  { ( step->GetPreStepPoint()->GetPosition() + step->GetPostStepPoint()->GetPosition() ) * 0.5/CLHEP::cm };
37  auto EfieldDelta = fEfield * SCE->GetEfieldOffsets(midPoint);
38  geo::Vector_t EfieldVec
39  = { fEfield + EfieldDelta.X(), EfieldDelta.Y(), EfieldDelta.Z() };
40  return EfieldVec.R();
41  }
ROOT::Math::DisplacementVector3D< ROOT::Math::Cartesian3D< double >, ROOT::Math::GlobalCoordinateSystemTag > Vector_t
Type for representation of momenta in 3D space.
Definition: geo_vectors.h:167
ROOT::Math::PositionVector3D< ROOT::Math::Cartesian3D< double >, ROOT::Math::GlobalCoordinateSystemTag > Point_t
Type for representation of position in physical 3D space.
Definition: geo_vectors.h:187
double larg4::ISCalculation::EnergyDeposit ( ) const
inlineinherited

Definition at line 29 of file ISCalculation.h.

References larg4::ISCalculation::fEnergyDeposit.

Referenced by larg4::IonizationAndScintillation::Reset().

29 { return fEnergyDeposit; }
double fEnergyDeposit
total energy deposited in the step
Definition: ISCalculation.h:39
void larg4::ISCalculationNEST::Initialize ( )
virtual

Implements larg4::ISCalculation.

Definition at line 35 of file ISCalculationNEST.cxx.

References fEngine, fNest, and fStepSize.

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 LArSoft uses a fudge factor to compensate, but NEST is "purer" -- no
43  // fudge factor. "
44  fStepSize = 0.05 * CLHEP::micrometer;
45 
46  return;
47  }
CLHEP::HepRandomEngine & fEngine
random engine
double fStepSize
maximum step to take
NestAlg * fNest
the fast optical simulation process
double larg4::ISCalculation::NumberIonizationElectrons ( ) const
inlineinherited

Definition at line 30 of file ISCalculation.h.

References larg4::ISCalculation::fNumIonElectrons.

Referenced by larg4::IonizationAndScintillation::Reset().

30 { return fNumIonElectrons; }
double fNumIonElectrons
number of ionization electrons for this step
Definition: ISCalculation.h:40
double larg4::ISCalculation::NumberScintillationPhotons ( ) const
inlineinherited

Definition at line 31 of file ISCalculation.h.

References larg4::ISCalculation::fNumScintPhotons.

Referenced by larg4::IonizationAndScintillation::Reset().

31 { return fNumScintPhotons; }
double fNumScintPhotons
number of scintillation photons for this step
Definition: ISCalculation.h:41
void larg4::ISCalculationNEST::Reset ( )
virtual

Implements larg4::ISCalculation.

Definition at line 50 of file ISCalculationNEST.cxx.

References larg4::ISCalculation::fEnergyDeposit, larg4::ISCalculation::fNumIonElectrons, larg4::ISCalculation::fNumScintPhotons, and larg4::ISCalculation::fVisibleEnergyDeposition.

51  {
52  fEnergyDeposit = 0.;
53  fNumIonElectrons = 0.;
54  fNumScintPhotons = 0.;
56 
57  return;
58  }
double fNumIonElectrons
number of ionization electrons for this step
Definition: ISCalculation.h:40
double fNumScintPhotons
number of scintillation photons for this step
Definition: ISCalculation.h:41
double fVisibleEnergyDeposition
Definition: ISCalculation.h:42
double fEnergyDeposit
total energy deposited in the step
Definition: ISCalculation.h:39
double larg4::ISCalculationNEST::StepSizeLimit ( ) const
inlinevirtual

Implements larg4::ISCalculation.

Definition at line 29 of file ISCalculationNEST.h.

29 { return fStepSize; }
double fStepSize
maximum step to take
double larg4::ISCalculation::VisibleEnergyDeposit ( ) const
inlineinherited

Member Data Documentation

double larg4::ISCalculation::fEnergyDeposit
protectedinherited
CLHEP::HepRandomEngine& larg4::ISCalculationNEST::fEngine
private

random engine

Definition at line 35 of file ISCalculationNEST.h.

Referenced by Initialize().

NestAlg* larg4::ISCalculationNEST::fNest
private

the fast optical simulation process

Definition at line 33 of file ISCalculationNEST.h.

Referenced by CalculateIonizationAndScintillation(), Initialize(), and ~ISCalculationNEST().

double larg4::ISCalculation::fNumIonElectrons
protectedinherited
double larg4::ISCalculation::fNumScintPhotons
protectedinherited
double larg4::ISCalculationNEST::fStepSize
private

maximum step to take

Definition at line 34 of file ISCalculationNEST.h.

Referenced by Initialize().

double larg4::ISCalculation::fVisibleEnergyDeposition
protectedinherited

The documentation for this class was generated from the following files: