ATLAS Offline Software
Toggle main menu visibility
Loading...
Searching...
No Matches
LArCalorimeter
LArG4
LArG4Barrel
src
PresamplerCalibrationCalculator.cxx
Go to the documentation of this file.
1
/*
2
Copyright (C) 2002-2025 CERN for the benefit of the ATLAS collaboration
3
*/
4
5
/********************************************************************
6
7
NAME: PresamplerCalibrationCalculator.cxx
8
PACKAGE: offline/LArCalorimeter/LArG4/LArG4Barrel
9
10
AUTHORS: G. Unal, L. Carminati (on a template from Bill Selingman)
11
CREATED: September, 2004
12
13
PURPOSE: This class calculates the values needed for calibration hits
14
in the barrel presampler of LAr calorimeter. This calculator is
15
called in calibration runs (see LArBarrelPresamplerSDConsultant)
16
for calibration hits in the presampler volume.
17
18
UPDATES:
19
20
********************************************************************/
21
22
// #define DEBUG_HITS
23
24
#include "
PresamplerCalibrationCalculator.h
"
25
26
#include "
LArBarrelPresamplerGeometry.h
"
27
28
#include "
LArG4Code/LArG4Identifier.h
"
29
30
#include "G4Step.hh"
31
#include "globals.hh"
32
#include <algorithm>
33
34
namespace
LArG4
{
35
36
namespace
BarrelPresampler
{
37
38
CalibrationCalculator::CalibrationCalculator
(
const
std::string& name, ISvcLocator *pSvcLocator)
39
:
LArCalibCalculatorSvcImp
(name, pSvcLocator)
40
{
41
}
42
43
StatusCode
CalibrationCalculator::initialize
() {
44
// Initialize the geometry calculator
45
ATH_CHECK
(
m_geometryCalculator
.retrieve());
46
return
StatusCode::SUCCESS;
47
}
48
49
G4bool
CalibrationCalculator::Process
(
const
G4Step* step,
50
LArG4Identifier
& identifier,
51
[[maybe_unused]]
LArG4Identifier
& identifier_sr,
52
std::vector<G4double> & energies,
53
const
eCalculatorProcessing
process
)
const
54
{
55
// Use the calculators to determine the energies and the
56
// identifier associated with this G4Step. Note that the
57
// default is to process both the energy and the ID.
58
59
if
(
process
==
kEnergyAndID
||
process
==
kOnlyEnergy
) {
60
#ifdef DEBUG_HITS
61
std::cout <<
"LArG4::Barrel::CalibrationCalculator::Process"
62
<<
" calling SimulationEnergies"
<< std::endl;
63
#endif
64
m_energyCalculator
.
Energies
( step, energies );
65
}
66
else
{
67
for
(
unsigned
int
i=0; i != 4; i++) energies.push_back( 0. );
68
}
69
70
71
if
(
process
==
kEnergyAndID
||
process
==
kOnlyID
) {
72
// Calculate the identifier.
73
identifier =
m_geometryCalculator
->CalculateIdentifier( step );
74
}
75
else
{
76
identifier
= LArG4Identifier();
77
}
78
79
#ifdef DEBUG_HITS
80
G4double
energy
=
accumulate
(energies.begin(),energies.end(),0.);
81
std::cout <<
"LArG4::Barrel::CalibrationCalculator::Process"
82
<<
" ID="
<< std::string(identifier)
83
<<
" energy="
<<
energy
84
<<
" energies=("
<< energies[0]
85
<<
","
<< energies[1]
86
<<
","
<< energies[2]
87
<<
","
<< energies[3] <<
")"
88
<< std::endl;
89
#endif
90
91
// Check for bad result.
92
return
( identifier != LArG4Identifier() );
93
}
94
95
}
// namespace Barrel
96
97
}
// namespace LAr
ATH_CHECK
#define ATH_CHECK
Evaluate an expression and check for errors.
Definition
AthCheckMacros.h:40
accumulate
bool accumulate(AccumulateMap &map, std::vector< module_t > const &modules, FPGATrackSimMatrixAccumulator const &acc)
Accumulates an accumulator (e.g.
Definition
FPGATrackSimMatrixAccumulator.cxx:22
LArBarrelPresamplerGeometry.h
PresamplerCalibrationCalculator.h
LArG4Identifier.h
CaloG4::SimulationEnergies::Energies
void Energies(const G4Step *, std::vector< G4double > &) const
The simple method to call from a calibration calculator: Examine the G4Step and return the energies r...
LArCalibCalculatorSvcImp::LArCalibCalculatorSvcImp
LArCalibCalculatorSvcImp(const std::string &name, ISvcLocator *pSvcLocator)
Definition
LArCalibCalculatorSvcImp.cxx:7
LArG4Identifier
Definition
LArG4Identifier.h:121
LArG4::BarrelPresampler::CalibrationCalculator::CalibrationCalculator
CalibrationCalculator(const std::string &name, ISvcLocator *pSvcLocator)
Definition
PresamplerCalibrationCalculator.cxx:38
LArG4::BarrelPresampler::CalibrationCalculator::m_geometryCalculator
ServiceHandle< ILArBarrelPresamplerGeometry > m_geometryCalculator
Definition
LArG4Barrel/src/PresamplerCalibrationCalculator.h:64
LArG4::BarrelPresampler::CalibrationCalculator::initialize
StatusCode initialize() override final
Definition
PresamplerCalibrationCalculator.cxx:43
LArG4::BarrelPresampler::CalibrationCalculator::Process
virtual G4bool Process(const G4Step *step, LArG4Identifier &identifier, LArG4Identifier &identifier_sr, std::vector< double > &energies, const LArG4::eCalculatorProcessing process) const override final
LArG4::BarrelPresampler::CalibrationCalculator::m_energyCalculator
CaloG4::SimulationEnergies m_energyCalculator
Definition
LArG4Barrel/src/PresamplerCalibrationCalculator.h:67
process
const std::string process
Definition
fbtTestBasics.cxx:76
LArG4::BarrelPresampler
Definition
ILArBarrelPresamplerGeometry.h:23
LArG4
Definition
LArWheelCalculatorEnums.h:8
LArG4::eCalculatorProcessing
eCalculatorProcessing
Definition
LArG4EnumDefs.h:10
LArG4::kOnlyID
@ kOnlyID
Definition
LArG4EnumDefs.h:10
LArG4::kOnlyEnergy
@ kOnlyEnergy
Definition
LArG4EnumDefs.h:10
LArG4::kEnergyAndID
@ kEnergyAndID
Definition
LArG4EnumDefs.h:10
mc.energy
energy
Definition
mc.Ep4_simple_OO.py:8
xAOD::identifier
identifier
Definition
UncalibratedMeasurement_v1.cxx:15
Generated on
for ATLAS Offline Software by
1.17.0