8#ifndef COLUMNAR_MET_MET_ASSOCIATION_H
9#define COLUMNAR_MET_MET_ASSOCIATION_H
28 template<
typename IteratorType,
class FunctionType>
31 template<
typename IteratorType,
class FunctionType>
57 template<
typename IteratorType,
class FunctionType>
84 template<
typename CM = ColumnarModeDefault>
class MetAssociationHelper;
108 :
calpx (columnarBase,
"calpx"),
109 calpy (columnarBase,
"calpy"),
110 calpz (columnarBase,
"calpz"),
111 cale (columnarBase,
"cale"),
112 calsumpt (columnarBase,
"calsumpt"),
114 trkpx (columnarBase,
"trkpx"),
115 trkpy (columnarBase,
"trkpy"),
116 trkpz (columnarBase,
"trkpz"),
117 trke (columnarBase,
"trke"),
118 trksumpt (columnarBase,
"trksumpt"),
120 jettrkpx (columnarBase,
"jettrkpx"),
121 jettrkpy (columnarBase,
"jettrkpy"),
122 jettrkpz (columnarBase,
"jettrkpz"),
123 jettrke (columnarBase,
"jettrke"),
126 jetLink (columnarBase,
"jetLink"),
127 isMisc (columnarBase,
"isMisc"),
187 return cale(assoc).size();}
197 template<ContainerIdConcept CI>
200 for (
size_t iKey = 0; iKey < this->
sizeCal(assoc); iKey++) {
202 totalvec+=this->
calVec(assoc, iKey);
214 return trke(assoc).size();}
224 template<ContainerIdConcept CI>
227 for (
size_t iKey = 0; iKey < this->
sizeTrk(assoc); iKey++) {
229 totalvec+=this->
trkVec(assoc,iKey);
234 for (
size_t iKey = 0; iKey < this->
sizeTrk(assoc); iKey++) {
236 totalvec+=this->
trkVec(assoc,iKey);
263 if (objIdx ==
invalidIndex)
return std::span<const std::size_t>();
265 return objIdx <
indices.size() ?
indices[objIdx] : std::span<const std::size_t>(); }
268 if (objIdx ==
invalidIndex)
return std::span<const unsigned char>();
270 return objIdx <
types.size() ?
types[objIdx] : std::span<const unsigned char>(); }
274 template<ContainerIdConcept CI>
295 if (
isMisc(assoc))
return false;
297 if (!
refJet)
return false;
308 for (
size_t iKey = 0; iKey <
sizeCal(assoc); iKey++)
if (mask &
calkey(assoc)[iKey]) newpt +=
calVec(assoc,iKey);
309 newvec.SetPxPyPzE(newpt.
cpx(),newpt.
cpy(),newpt.
cpz(),newpt.
ce());
329 for (
auto assocIter =
map.rbegin(); assocIter !=
map.rend(); ++assocIter)
374 throw std::logic_error (
"can't call xAOD function in columnar mode");}
387 template<ContainerIdConcept CI>
396 return m_xaodHelper->objSelected(&assocId.getXAODObject(), objIdx);
398 if (objIdx >=
sizeof(
bitmask_t)*8)
return false;
404 template<ContainerIdConcept CI>
413 return m_xaodHelper->getObjSelectionFlags(&assocId.getXAODObject());
421 m_xaodHelper->setObjSelectionFlag(&assocId.getXAODObject(), objIdx, status);
424 if (objIdx >=
sizeof(
bitmask_t)*8)
return;
426 if (status)
m_accessors->useObjectFlagsAcc(assocId) |= mask;
427 else m_accessors->useObjectFlagsAcc(assocId) &= ~mask;
432 template<ContainerIdConcept CI>
447 for(
size_t iOL=0; iOL<
indices.size(); ++iOL) {
464 if(
types[iOL] & 1) {
break;}
481 bool overlaps(
false);
483 if (overlaps)
return false;
497 for (
auto assoc :
m_map) {
502 return std::nullopt;}
506 template<ContainerIdConcept CI>
513 return (accessors->findIndex(assoc,pPart) != invalidIndex);});}
537 for (
size_t iKey = 0; iKey <
m_accessors->sizeCal(assoc); iKey++) {
539 if (selector) calvec+=
m_accessors->calVec(assoc,iKey);
545 for (
size_t iKey = 0; iKey <
m_accessors->sizeTrk(assoc); iKey++) {
571 template<
typename CM>
578 template<
typename CM>
std::vector< std::vector< int64_t > > indices
static const std::vector< std::string > types
FilterRangeIterator & operator++() noexcept
bool operator==(const FilterRangeIterator &that) const noexcept
FilterRangeIterator(const IteratorType &val_iterator, const FilterRange< IteratorType, FunctionType > *val_range) noexcept
const FilterRange< IteratorType, FunctionType > * m_range
bool operator!=(const FilterRangeIterator &that) const noexcept
auto operator*() const noexcept
a simple range adaptor that filters the elements of a range
FilterRange & operator=(FilterRange &&)=default
FilterRange(IteratorType begin, IteratorType end, FunctionType &&filter)
auto begin() const noexcept
FilterRange(FilterRange &&)=default
friend class FilterRangeIterator< IteratorType, FunctionType >
auto end() const noexcept
FilterRange(const FilterRange &)=default
bool empty() const noexcept
a class representing a single object (electron, muons, etc.)
a class representing a continuous sequence of objects (a.k.a. a container)
a class representing a single optional object (electron, muons, etc.)
Class providing the definition of the 4-vector interface.
Vector sum of constituents for subtractive overlap removal.
float ce() const
Returns .
float cpz() const
Returns .
float cpx() const
Returns .
float cpy() const
Returns .
static constexpr size_t invalidIndex
Invalid index indicator.
xAOD::MissingETAssociation_v1::ConstVec constvec_t
Type for constituent vector.
uint64_t bitmask_t
Type for status word bit mask.
Policy
Policies on usage checks.
@ AllCalo
Inclusive except tracks.
@ OnlyTrack
Track based only.
@ OnlyCluster
CaloCluster based only.
@ TruthParticle
Truth particle based.
@ ParticleFlow
Particle Flow Object based.
@ TrackCluster
Both cluster and track based.
AccessorTemplate< CI, CT, ColumnAccessMode::input, CM > ColumnAccessor
ObjectRange< MetAssociationDef > MetAssociationRange
ObjectId< ParticleDef > ParticleId
AccessorTemplate< CI, CT, ColumnAccessMode::update, CM > ColumnUpdater
@ TrackParticle
The object is a charged track particle.
@ ParticleFlow
The object is a particle-flow object.
@ CaloCluster
The object is a calorimeter cluster.
Jet_v1 Jet
Definition of the current "jet version".
ROOT::Math::LorentzVector< ROOT::Math::PtEtaPhiM4D< double > > JetFourMom_t
Base 4 Momentum type for Jet.
static double cpyError()
Access error return value for constituent vector .
static double cpxError()
Access error return value for constituent vector .
static double ceError()
Access error return value for constituent vector .
static double cpzError()
Access error return value for constituent vector .
static double sumptError()
Access error return value for constituent vector sumpt.
an accessor that allows to access the xAOD object type of an input object