8#ifndef COLUMNAR_MET_MET_ASSOCIATION_H
9#define COLUMNAR_MET_MET_ASSOCIATION_H
29 template<
typename IteratorType,
class FunctionType>
32 template<
typename IteratorType,
class FunctionType>
58 template<
typename IteratorType,
class FunctionType>
85 template<
typename CM = ColumnarModeDefault>
class MetAssociationHelper;
109 :
calpx (columnarBase,
"calpx"),
110 calpy (columnarBase,
"calpy"),
111 calpz (columnarBase,
"calpz"),
112 cale (columnarBase,
"cale"),
113 calsumpt (columnarBase,
"calsumpt"),
115 trkpx (columnarBase,
"trkpx"),
116 trkpy (columnarBase,
"trkpy"),
117 trkpz (columnarBase,
"trkpz"),
118 trke (columnarBase,
"trke"),
119 trksumpt (columnarBase,
"trksumpt"),
121 jettrkpx (columnarBase,
"jettrkpx"),
122 jettrkpy (columnarBase,
"jettrkpy"),
123 jettrkpz (columnarBase,
"jettrkpz"),
124 jettrke (columnarBase,
"jettrke"),
127 jetLink (columnarBase,
"jetLink"),
128 isMisc (columnarBase,
"isMisc"),
186 return cale(assoc).size();}
196 template<ContainerIdConcept CI>
199 for (
size_t iKey = 0; iKey < this->
sizeCal(assoc); iKey++) {
201 totalvec+=this->
calVec(assoc, iKey);
213 return trke(assoc).size();}
223 template<ContainerIdConcept CI>
226 for (
size_t iKey = 0; iKey < this->
sizeTrk(assoc); iKey++) {
228 totalvec+=this->
trkVec(assoc,iKey);
233 for (
size_t iKey = 0; iKey < this->
sizeTrk(assoc); iKey++) {
235 totalvec+=this->
trkVec(assoc,iKey);
262 if (objIdx ==
invalidIndex)
return std::span<const std::size_t>();
264 return objIdx < indices.size() ? indices[objIdx] : std::span<const std::size_t>(); }
267 if (objIdx ==
invalidIndex)
return std::span<const unsigned char>();
269 return objIdx <
types.size() ?
types[objIdx] : std::span<const unsigned char>(); }
273 template<ContainerIdConcept CI>
294 if (
isMisc(assoc))
return false;
296 if (!
refJet)
return false;
307 for (
size_t iKey = 0; iKey <
sizeCal(assoc); iKey++)
if (mask &
calkey(assoc)[iKey]) newpt +=
calVec(assoc,iKey);
308 newvec.SetPxPyPzE(newpt.
cpx(),newpt.
cpy(),newpt.
cpz(),newpt.
ce());
328 for (
auto assocIter =
map.rbegin(); assocIter !=
map.rend(); ++assocIter)
373 throw std::logic_error (
"can't call xAOD function in columnar mode");}
386 template<ContainerIdConcept CI>
395 return m_xaodHelper->objSelected(&assocId.getXAODObject(), objIdx);
397 if (objIdx >=
sizeof(
bitmask_t)*8)
return false;
403 template<ContainerIdConcept CI>
412 return m_xaodHelper->getObjSelectionFlags(&assocId.getXAODObject());
420 m_xaodHelper->setObjSelectionFlag(&assocId.getXAODObject(), objIdx, status);
423 if (objIdx >=
sizeof(
bitmask_t)*8)
return;
425 if (status)
m_accessors->useObjectFlagsAcc(assocId) |= mask;
426 else m_accessors->useObjectFlagsAcc(assocId) &= ~mask;
431 template<ContainerIdConcept CI>
444 auto indices =
m_accessors->overlapIndices(assocId, objIdx);
446 for(
size_t iOL=0; iOL<indices.size(); ++iOL) {
463 if(
types[iOL] & 1) {
break;}
480 bool overlaps(
false);
482 if (overlaps)
return false;
496 for (
auto assoc :
m_map) {
501 return std::nullopt;}
505 template<ContainerIdConcept CI>
512 return (accessors->findIndex(assoc,pPart) != invalidIndex);});}
536 for (
size_t iKey = 0; iKey <
m_accessors->sizeCal(assoc); iKey++) {
538 if (selector) calvec+=
m_accessors->calVec(assoc,iKey);
544 for (
size_t iKey = 0; iKey <
m_accessors->sizeTrk(assoc); iKey++) {
570 template<
typename CM>
577 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