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"),
185 return cale(assoc).size();}
195 template<ContainerIdConcept CI>
198 for (
size_t iKey = 0; iKey < this->
sizeCal(assoc); iKey++) {
200 totalvec+=this->
calVec(assoc, iKey);
212 return trke(assoc).size();}
222 template<ContainerIdConcept CI>
225 for (
size_t iKey = 0; iKey < this->
sizeTrk(assoc); iKey++) {
227 totalvec+=this->
trkVec(assoc,iKey);
232 for (
size_t iKey = 0; iKey < this->
sizeTrk(assoc); iKey++) {
234 totalvec+=this->
trkVec(assoc,iKey);
261 if (objIdx ==
invalidIndex)
return std::span<const std::size_t>();
263 return objIdx < indices.size() ? indices[objIdx] : std::span<const std::size_t>(); }
266 if (objIdx ==
invalidIndex)
return std::span<const unsigned char>();
268 return objIdx <
types.size() ?
types[objIdx] : std::span<const unsigned char>(); }
272 template<ContainerIdConcept CI>
293 if (
isMisc(assoc))
return false;
295 if (!
refJet)
return false;
306 for (
size_t iKey = 0; iKey <
sizeCal(assoc); iKey++)
if (mask &
calkey(assoc)[iKey]) newpt +=
calVec(assoc,iKey);
307 newvec.SetPxPyPzE(newpt.
cpx(),newpt.
cpy(),newpt.
cpz(),newpt.
ce());
327 for (
auto assocIter =
map.rbegin(); assocIter !=
map.rend(); ++assocIter)
372 throw std::logic_error (
"can't call xAOD function in columnar mode");}
385 template<ContainerIdConcept CI>
394 return m_xaodHelper->objSelected(&assocId.getXAODObject(), objIdx);
396 if (objIdx >=
sizeof(
bitmask_t)*8)
return false;
402 template<ContainerIdConcept CI>
411 return m_xaodHelper->getObjSelectionFlags(&assocId.getXAODObject());
419 m_xaodHelper->setObjSelectionFlag(&assocId.getXAODObject(), objIdx, status);
422 if (objIdx >=
sizeof(
bitmask_t)*8)
return;
424 if (status)
m_accessors->useObjectFlagsAcc(assocId) |= mask;
425 else m_accessors->useObjectFlagsAcc(assocId) &= ~mask;
430 template<ContainerIdConcept CI>
443 auto indices =
m_accessors->overlapIndices(assocId, objIdx);
445 for(
size_t iOL=0; iOL<indices.size(); ++iOL) {
462 if(
types[iOL] & 1) {
break;}
479 bool overlaps(
false);
481 if (overlaps)
return false;
495 for (
auto assoc :
m_map) {
500 return std::nullopt;}
504 template<ContainerIdConcept CI>
511 return (accessors->findIndex(assoc,pPart) != invalidIndex);});}
535 for (
size_t iKey = 0; iKey <
m_accessors->sizeCal(assoc); iKey++) {
537 if (selector) calvec+=
m_accessors->calVec(assoc,iKey);
543 for (
size_t iKey = 0; iKey <
m_accessors->sizeTrk(assoc); iKey++) {
569 template<
typename CM>
576 template<
typename CM>
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< ContainerId::metAssociation > MetAssociationRange
ObjectId< ContainerId::particle > ParticleId
AccessorTemplate< CI, CT, ColumnAccessMode::update, CM > ColumnUpdater
ObjectId< ContainerId::jet > JetId
@ 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