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

#include <LArBarrelCalibrationCalculator.h>

Inheritance diagram for LArG4::Barrel::CalibrationCalculator:
Collaboration diagram for LArG4::Barrel::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< ILArBarrelGeometrym_geometryCalculator {this, "GeometryCalculator", "LArBarrelGeometry"}
CaloG4::SimulationEnergies m_energyCalculator {}

Detailed Description

Definition at line 37 of file LArBarrelCalibrationCalculator.h.

Constructor & Destructor Documentation

◆ CalibrationCalculator()

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

Definition at line 36 of file LArBarrelCalibrationCalculator.cxx.

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

◆ ~CalibrationCalculator()

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

Member Function Documentation

◆ initialize()

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

Definition at line 41 of file LArBarrelCalibrationCalculator.cxx.

41 {
42 // Initialize the geometry calculator.
44 return StatusCode::SUCCESS;
45 }
#define ATH_CHECK
Evaluate an expression and check for errors.
ServiceHandle< ILArBarrelGeometry > m_geometryCalculator

◆ Process()

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

Definition at line 47 of file LArBarrelCalibrationCalculator.cxx.

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

Definition at line 65 of file LArBarrelCalibrationCalculator.h.

65{};

◆ m_geometryCalculator

ServiceHandle<ILArBarrelGeometry> LArG4::Barrel::CalibrationCalculator::m_geometryCalculator {this, "GeometryCalculator", "LArBarrelGeometry"}
private

Definition at line 62 of file LArBarrelCalibrationCalculator.h.

62{this, "GeometryCalculator", "LArBarrelGeometry"};

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