ATLAS Offline Software
Loading...
Searching...
No Matches
xAOD::xAODInDetMeasurement::Utilities Namespace Reference

Functions

float computeTotalCharge (const SG::AuxElement &cluster)
float computeTotalCharge (const std::vector< float > &charges)
int computeTotalToT (const SG::AuxElement &cluster)
int computeTotalToT (const std::vector< int > &tots)

Function Documentation

◆ computeTotalCharge() [1/2]

float xAOD::xAODInDetMeasurement::Utilities::computeTotalCharge ( const SG::AuxElement & cluster)

Definition at line 9 of file Event/xAOD/xAODInDetMeasurement/Root/Utilities.cxx.

9 {
10 static const SG::AuxElement::Accessor<std::vector<float> > chargesAcc("chargeList");
11 assert( chargesAcc.isAvailable( cluster ) );
13 }
SG::Accessor< T, ALLOC > Accessor
Definition AuxElement.h:572

◆ computeTotalCharge() [2/2]

float xAOD::xAODInDetMeasurement::Utilities::computeTotalCharge ( const std::vector< float > & charges)

Definition at line 15 of file Event/xAOD/xAODInDetMeasurement/Root/Utilities.cxx.

15 {
16 float totalCharge = 0.f;
17 for (float charge : charges)
18 totalCharge += charge;
19 return totalCharge;
20 }

◆ computeTotalToT() [1/2]

int xAOD::xAODInDetMeasurement::Utilities::computeTotalToT ( const SG::AuxElement & cluster)

Definition at line 22 of file Event/xAOD/xAODInDetMeasurement/Root/Utilities.cxx.

22 {
23 static const SG::AuxElement::Accessor< std::vector<int> > totsAcc("totList");
24 assert( totsAcc.isAvailable( cluster ) );
26 }

◆ computeTotalToT() [2/2]

int xAOD::xAODInDetMeasurement::Utilities::computeTotalToT ( const std::vector< int > & tots)

Definition at line 28 of file Event/xAOD/xAODInDetMeasurement/Root/Utilities.cxx.

28 {
29 int totalToT = 0;
30 for (int tot : tots)
31 totalToT += tot;
32 return totalToT;
33 }