ATLAS Offline Software
Loading...
Searching...
No Matches
Event
xAOD
xAODInDetMeasurement
Root
Event/xAOD/xAODInDetMeasurement/Root/Utilities.cxx
Go to the documentation of this file.
1
/*
2
Copyright (C) 2002-2026 CERN for the benefit of the ATLAS collaboration
3
*/
4
5
#include "
xAODInDetMeasurement/Utilities.h
"
6
#include "
AthContainers/JaggedVecAccessor.h
"
7
#include <numeric>
8
9
namespace
xAOD::xAODInDetMeasurement::Utilities
{
10
11
float
computeTotalCharge
(
const
SG::AuxElement
& cluster) {
12
static
const
SG::AuxElement::Accessor<SG::JaggedVecElt<float> > chargesAcc(
"chargeList"
);
13
assert( chargesAcc.isAvailable( cluster ) );
14
const
std::vector<float>& charges = chargesAcc(cluster);
15
return
std::accumulate(charges.begin(), charges.end(), 0.);
16
}
17
18
int
computeTotalToT
(
const
SG::AuxElement
& cluster) {
19
static
const
SG::AuxElement::Accessor< SG::JaggedVecElt<int> > totsAcc(
"totList"
);
20
assert( totsAcc.isAvailable( cluster ) );
21
const
std::vector<int>& tots = totsAcc(cluster);
22
return
std::accumulate(tots.begin(), tots.end(), 0);
23
}
24
25
}
Utilities.h
JaggedVecAccessor.h
Helper class to provide type-safe access to aux data, specialized for JaggedVecElt.
SG::AuxElement
AuxElement(SG::AuxVectorData *container, size_t index)
Base class for elements of a container that can have aux data.
xAOD::xAODInDetMeasurement::Utilities
Definition
Event/xAOD/xAODInDetMeasurement/Root/Utilities.cxx:9
xAOD::xAODInDetMeasurement::Utilities::computeTotalCharge
float computeTotalCharge(const SG::AuxElement &cluster)
Definition
Event/xAOD/xAODInDetMeasurement/Root/Utilities.cxx:11
xAOD::xAODInDetMeasurement::Utilities::computeTotalToT
int computeTotalToT(const SG::AuxElement &cluster)
Definition
Event/xAOD/xAODInDetMeasurement/Root/Utilities.cxx:18
Generated on
for ATLAS Offline Software by
1.16.1