ATLAS Offline Software
Loading...
Searching...
No Matches
LArG4::BarrelPresampler::CalibrationCalculator Class Reference

#include <PresamplerCalibrationCalculator.h>

Inheritance diagram for LArG4::BarrelPresampler::CalibrationCalculator:
Collaboration diagram for LArG4::BarrelPresampler::CalibrationCalculator:

Public Member Functions

 CalibrationCalculator (const std::string &name, ISvcLocator *pSvcLocator)
StatusCode initialize () override final
virtual ~CalibrationCalculator ()=default
virtual G4bool Process (const G4Step *step, LArG4Identifier &identifier, std::vector< G4double > &energies, const eCalculatorProcessing process=kEnergyAndID) const override final

Private Attributes

ServiceHandle< ILArBarrelPresamplerGeometrym_geometryCalculator {this, "GeometryCalculator", "LArBarrelPresamplerGeometry"}
CaloG4::SimulationEnergies m_energyCalculator {}

Detailed Description

Constructor & Destructor Documentation

◆ CalibrationCalculator()

LArG4::BarrelPresampler::CalibrationCalculator::CalibrationCalculator ( const std::string & name,
ISvcLocator * pSvcLocator )

Definition at line 38 of file PresamplerCalibrationCalculator.cxx.

39 : LArCalibCalculatorSvcImp(name, pSvcLocator)
40 {
41 }
LArCalibCalculatorSvcImp(const std::string &name, ISvcLocator *pSvcLocator)

◆ ~CalibrationCalculator()

virtual LArG4::BarrelPresampler::CalibrationCalculator::~CalibrationCalculator ( )
virtualdefault

Member Function Documentation

◆ initialize()

StatusCode LArG4::BarrelPresampler::CalibrationCalculator::initialize ( )
finaloverride

Definition at line 43 of file PresamplerCalibrationCalculator.cxx.

43 {
44 // Initialize the geometry calculator
46 return StatusCode::SUCCESS;
47 }
#define ATH_CHECK
Evaluate an expression and check for errors.

◆ Process()

G4bool LArG4::BarrelPresampler::CalibrationCalculator::Process ( const G4Step * step,
LArG4Identifier & identifier,
std::vector< G4double > & energies,
const eCalculatorProcessing process = kEnergyAndID ) const
finaloverridevirtual

Definition at line 49 of file PresamplerCalibrationCalculator.cxx.

52 {
53 // Use the calculators to determine the energies and the
54 // identifier associated with this G4Step. Note that the
55 // default is to process both the energy and the ID.
56
57 if ( process == kEnergyAndID || process == kOnlyEnergy ) {
58#ifdef DEBUG_HITS
59 std::cout << "LArG4::Barrel::CalibrationCalculator::Process"
60 << " calling SimulationEnergies" << std::endl;
61#endif
62 m_energyCalculator.Energies( step, energies );
63 }
64 else {
65 for (unsigned int i=0; i != 4; i++) energies.push_back( 0. );
66 }
67
68
69 if ( process == kEnergyAndID || process == kOnlyID ) {
70 // Calculate the identifier.
71 identifier = m_geometryCalculator->CalculateIdentifier( step );
72 }
73 else {
74 identifier = LArG4Identifier();
75 }
76
77#ifdef DEBUG_HITS
78 G4double energy = accumulate(energies.begin(),energies.end(),0.);
79 std::cout << "LArG4::Barrel::CalibrationCalculator::Process"
80 << " ID=" << std::string(identifier)
81 << " energy=" << energy
82 << " energies=(" << energies[0]
83 << "," << energies[1]
84 << "," << energies[2]
85 << "," << energies[3] << ")"
86 << std::endl;
87#endif
88
89 // Check for bad result.
90 return ( identifier != LArG4Identifier() );
91 }
bool accumulate(AccumulateMap &map, std::vector< module_t > const &modules, FPGATrackSimMatrixAccumulator const &acc)
Accumulates an accumulator (e.g.
const std::string process
@ kOnlyEnergy
@ kEnergyAndID

Member Data Documentation

◆ m_energyCalculator

CaloG4::SimulationEnergies LArG4::BarrelPresampler::CalibrationCalculator::m_energyCalculator {}
private

Definition at line 66 of file LArG4Barrel/src/PresamplerCalibrationCalculator.h.

66{};

◆ m_geometryCalculator

ServiceHandle<ILArBarrelPresamplerGeometry> LArG4::BarrelPresampler::CalibrationCalculator::m_geometryCalculator {this, "GeometryCalculator", "LArBarrelPresamplerGeometry"}
private

Definition at line 63 of file LArG4Barrel/src/PresamplerCalibrationCalculator.h.

63{this, "GeometryCalculator", "LArBarrelPresamplerGeometry"};

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