ATLAS Offline Software
Loading...
Searching...
No Matches
Event/xAOD/xAODInDetMeasurement/Root/Utilities.cxx
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2025 CERN for the benefit of the ATLAS collaboration
3*/
4
6
8
9 float computeTotalCharge( const SG::AuxElement& cluster) {
10 static const SG::AuxElement::Accessor<std::vector<float> > chargesAcc("chargeList");
11 assert( chargesAcc.isAvailable( cluster ) );
13 }
14
15 float computeTotalCharge( const std::vector<float>& charges) {
16 float totalCharge = 0.f;
17 for (float charge : charges)
18 totalCharge += charge;
19 return totalCharge;
20 }
21
22 int computeTotalToT( const SG::AuxElement& cluster) {
23 static const SG::AuxElement::Accessor< std::vector<int> > totsAcc("totList");
24 assert( totsAcc.isAvailable( cluster ) );
26 }
27
28 int computeTotalToT( const std::vector<int>& tots) {
29 int totalToT = 0;
30 for (int tot : tots)
31 totalToT += tot;
32 return totalToT;
33 }
34
35}
Base class for elements of a container that can have aux data.
Definition AuxElement.h:483
SG::Accessor< T, ALLOC > Accessor
Definition AuxElement.h:572
bool isAvailable(const ELT &e) const
Test to see if this variable exists in the store.