Loading [MathJax]/extensions/tex2jax.js
 |
ATLAS Offline Software
|
Go to the documentation of this file.
52 this->cpx() += cvec.
cpx(); this->cpy() += cvec.
cpy(); this->cpz() += cvec.
cpz(); this->ce() += cvec.
ce();
53 this->sumpt() += cvec.
sumpt();
59 this->cpx() -= cvec.
cpx(); this->cpy() -= cvec.
cpy(); this->cpz() -= cvec.
cpz(); this->ce() -= cvec.
ce();
60 this->sumpt() -= cvec.
sumpt();
67 this->sumpt() *=
scale;
73 if (
scale <1
e-9 ) { this->cpx() = 0.; this->cpy() = 0.; this->cpz() = 0.; this->ce() = 0.; this->sumpt() = 0.;
return *
this; }
74 else {
return this->operator*=(1./
scale); }
87 float MissingETAssociation_v1::ConstVec::cpt()
const
89 return sqrt(this->cpx()*this->cpx()+this->cpy()*this->cpy());
96 MissingETAssociation_v1::MissingETAssociation_v1(
bool createStore )
115 :
SG::AuxElement(assocDescr)
123 if((&assocDescr) !=
this) {
164 for(
const auto&
signal : constlist) {
176 vector<MissingETBase::Types::objlink_t > linklist;
177 linklist.reserve(constlist.size());
178 for(
const auto&
signal : constlist) {
181 linklist.push_back(
el);
186 bool linkset = f_setLink<MissingETBase::Types::objlink_t>(oLnk);
215 if ( this->
empty() ) {
return false; }
217 {
size_t nEnt(this->
size());
for (
size_t objIdx(0); objIdx<nEnt; ++objIdx ) { this->
f_removeContrib(objIdx); }
return true; }
273 if((*fLnk).isValid()) {
274 if(*(*fLnk) == pPart)
break;
306 { this->
f_cale().clear(); this->
f_cale().insert(this->
f_cale().
end(),calevec.begin(),calevec.end());
return !this->
f_cale().empty(); }
319 { this->
f_trke().clear(); this->
f_trke().insert(this->
f_trke().
end(),trkevec.begin(),trkevec.end());
return !this->
f_trke().empty(); }
344 this->
f_calsumpt()[keyIdx] = sumpt;
return true;
345 }
else {
return false; }
350 if(key==testkey)
return false;
353 this->
f_calpx().push_back(calpx);
354 this->
f_calpy().push_back(calpy);
355 this->
f_calpz().push_back(calpz);
356 this->
f_cale().push_back(cale);
378 this->
f_trksumpt()[keyIdx] = sumpt;
return true;
379 }
else {
return false; }
384 if(key==testkey)
return false;
387 this->
f_trkpx().push_back(trkpx);
388 this->
f_trkpy().push_back(trkpy);
389 this->
f_trkpz().push_back(trkpz);
390 this->
f_trke().push_back(trke);
432 }
else {
return false; }
438 bool wasSet(this->
f_jetLink().getStorableObjectPointer() !=
nullptr);
439 f_setObject<Jet,MissingETBase::Types::jetlink_t>(pJet,this->
f_jetLink());
445 bool wasSet(this->
f_jetLink().getStorableObjectPointer() !=
nullptr);
452 bool wasSet(this->
f_jetLink().getStorableObjectPointer() !=
nullptr);
507 vector<const IParticle*> pVec;
508 for ( objlink_vector_t::const_iterator fLnk(this->
objectLinks().
begin()); fLnk != this->
objectLinks().end(); ++fLnk) {pVec.push_back((*fLnk).isValid()?*(*fLnk):
nullptr); }
515 vector<const IParticle*> pVec(nEnt,(
const IParticle*)
nullptr);
516 calVecs.clear(); calVecs.resize(this->sizeCal(),
constvec_t());
517 trkVecs.clear(); trkVecs.resize(this->sizeTrk(),
constvec_t());
525 const std::vector<float>*& calpzPtr,
const std::vector<float>*& calePtr,
526 const std::vector<float>*& calsumptPtr,
527 const std::vector<float>*& trkpxPtr,
const std::vector<float>*& trkpyPtr,
528 const std::vector<float>*& trkpzPtr,
const std::vector<float>*& trkePtr,
529 const std::vector<float>*& trksumptPtr)
const
531 calpxPtr = &(this->
calpx()); calpyPtr = &(this->
calpy()); calpzPtr = &(this->
calpz()); calePtr = &(this->
cale()); calsumptPtr = &(this->
calsumpt());
532 trkpxPtr = &(this->
trkpx()); trkpyPtr = &(this->
trkpy()); trkpzPtr = &(this->
trkpz()); trkePtr = &(this->
trke()); trksumptPtr = &(this->
trksumpt());
543 for (
size_t iKey = 0; iKey < this->sizeCal(); iKey++) {
545 totalvec+=this->
calVec(iKey);
553 for (
size_t iKey = 0; iKey < this->sizeTrk(); iKey++) {
555 totalvec+=this->
trkVec(iKey);
582 this->
size() == assocDescr.size();
597 }
else {
return false; }
604 std::map<MissingETBase::Types::bitmask_t,MissingETBase::Types::constvec_t> trkOverlaps;
605 std::map<MissingETBase::Types::bitmask_t,MissingETBase::Types::constvec_t> calOverlaps;
607 for(
size_t iObj=0; iObj<this->
objectLinks().size(); ++iObj) {
608 const vector<ElementLink<IParticleContainer> >& myConst =
m_objConstLinks[iObj];
609 for (
size_t iConst=0; iConst<myConst.size(); ++iConst) {
613 for (
const auto& objpair :
objects) {
637 const PFO* pfo =
static_cast<const PFO*
>(
obj);
655 if(fabs(
tp->charge())>0.)
662 for (
const auto& calpair : calOverlaps) {
667 for (
const auto& trkpair : trkOverlaps) {
673 bool foundOverlaps(
false);
674 for(
size_t iObj=0; iObj<this->
objectLinks().size(); ++iObj) {
677 return foundOverlaps;
684 const vector<MissingETBase::Types::objlink_t >& myConst =
m_objConstLinks[objIdx];
688 for(
size_t iTargetObj=objIdx+1; iTargetObj<this->
objectLinks().size(); ++iTargetObj) {
689 const vector<MissingETBase::Types::objlink_t >& checkConst =
m_objConstLinks[iTargetObj];
690 bool overlapFound(
false);
693 for(vector<size_t>::const_iterator iOverlap=myOverlaps.begin();
694 iOverlap!=myOverlaps.end() && !overlapFound; ++iOverlap) {
695 overlapFound = (*iOverlap) == iTargetObj;
697 if(overlapFound)
continue;
699 for(
const auto& mine : myConst) {
700 for(
const auto&
target : checkConst) {
701 overlapFound |= ( mine ==
target );
723 vector<unsigned char> types = this->
overlapTypes(objIdx);
724 for(
size_t iOL=0; iOL<
indices.size(); ++iOL) {
741 if(types[iOL] & 1) {
break;}
767 for (
size_t iKey = 0; iKey < this->sizeCal(); iKey++)
if (
mask & this->
calkey()[iKey]) newpt += this->
calVec(iKey);
768 newvec.SetPxPyPzE(newpt.
cpx(),newpt.
cpy(),newpt.
cpz(),newpt.
ce());
775 for (
size_t iKey = 0; iKey < this->sizeCal(); iKey++) {
777 if (selector) calvec+=this->
calVec(iKey);
785 for (
size_t iKey = 0; iKey < this->sizeTrk(); iKey++) {
806 for(
size_t iObj=0; iObj<this->
objectLinks().size(); ++iObj) {
823 for(
size_t iObj=0; iObj<this->
objectLinks().size(); ++iObj) {
824 if(
helper.objSelected(
this,iObj)) {
826 if(
el == link)
return true;
JetConstituentVector::iterator iterator
void initCache()
initialise cache for overlap removal decisions
void clearOverlaps()
Clear the vectors of overlap indices
bool setCalPx(const std::vector< float > &calpxvec)
Set the vector of
std::vector< float > & f_calpy()
const MissingETBase::Types::objlink_vector_t & objectLinks() const
Get the vector of links to the contributing physics or signal objects.
bool operator==(const DataVector< T > &a, const DataVector< T > &b)
Vector equality comparison.
void setJetTrkPy(float py)
Set track constituent vector for the reference jet.
float jettrkpx() const
Get the vector for a given object referenced by index.
@ TruthParticle
Truth particle based.
ConstVec overlapCalVec(const MissingETAssociationHelper &helper) const
Retrieve total cluster-based vector to be subtracted from the jet.
std::vector< std::vector< unsigned char > > & f_overlapTypes()
record overlapTypes between constributing objects
void setJetTrkSumpt(float sumpt)
Set track constituent vector for the reference jet.
Helper class to provide type-safe access to aux data.
MET association descriptor contains object links and corresponding parameters.
bool setTrkPy(const std::vector< float > &trkpyvec)
Set the vector of
MissingETAssociation_v1 & operator=(const MissingETAssociation_v1 &assocDescr)
bool hasAlternateConstVec() const
bool removeContrib()
Remove all contributions.
std::pair< long int, long int > indices
void setJetTrkE(float e)
Set track constituent vector for the reference jet.
static double ceError()
Access error return value for constituent vector .
const std::vector< float > & cale() const
Get the vector of
bool toIndexedElement(BaseConstReference data, index_type elemID, IProxyDict *sg=0)
Set the link to an element given by index and pointer to container.
bool setTrkSumpt(const std::vector< float > &trksumptvec)
Set the vector of
bool identifyOverlaps()
Loop over contributing objects to identify those that share constituents.
std::vector< float > & f_trksumpt()
static double cpxError()
Access error return value for constituent vector .
ICaloAffectedTool is abstract interface for tools checking if 4 mom is in calo affected region.
bool containsSignal(const IParticle *pSig) const
Check if this signal object matches the constituents of any contributing objects.
std::vector< float > & f_trkpz()
const std::vector< std::vector< unsigned char > > & overlapTypes() const
Get the list of object overlapTypes.
float jettrksumpt() const
Get the sumpt for a given object referenced by index.
static size_t invalidIndex()
Access invalid index indicator.
static double sumptError()
Access error return value for constituent vector sumpt.
bool addObject(const IParticle *pPart, const std::vector< const IParticle * > &constlist)
Add object (particle) from pointer reference with individual constituent vectors.
uint64_t bitmask_t
Type for status word bit mask.
@ OnlyCluster
CaloCluster based only.
Class providing the definition of the 4-vector interface.
float jettrkpz() const
Get the vector for a given object referenced by pointer.
void setJetTrkPz(float pz)
Set track constituent vector for the reference jet.
bool setTrkE(const std::vector< float > &trkevec)
Set the vector of
const std::vector< std::vector< size_t > > & overlapIndices() const
Get the list of object overlapIndices.
const std::vector< float > & trksumpt() const
Get the vector of
bool hasOverlaps(const MissingETAssociationHelper &helper, size_t objIdx, MissingETBase::UsageHandler::Policy p=MissingETBase::UsageHandler::OnlyCluster) const
Check if any selected particles overlap this one.
Vector sum of constituents for subtractive overlap removal.
bool containsPhysics(const IParticle *pPhys) const
Check if this physics object matches any contributing objects.
static bool testPolicy(const xAOD::IParticle &part, MissingETBase::UsageHandler::Policy p)
CaloCluster_v1 CaloCluster
Define the latest version of the calorimeter cluster class.
MissingETBase::Types::bitmask_t getObjMask(size_t objIndex)
bool resetContrib()
Reset all contribution parameters.
TrackParticle_v1 TrackParticle
Reference the current persistent version:
ElementLink< xAOD::JetContainer > jetlink_t
Link to Jet object.
size_t findIndex(const IParticle *pPart) const
Find index of given object in contributing object store.
const std::vector< float > & calpx() const
Get the vector of
bool f_removeContrib(size_t objIdx)
Copy the contribution data from a source.
bool setJetLink(const MissingETBase::Types::jetlink_t &jetLnk)
Set the link to the reference jet.
static double cpzError()
Access error return value for constituent vector .
std::vector< objlink_t > objlink_vector_t
Vector of object links type.
bool setCalSumpt(const std::vector< float > &calsumptvec)
Set the vector of sumpt
void setJetTrkVec(const ConstVec &cvec=ConstVec())
Set the track constituent vector for the reference jet.
const std::vector< float > & calsumpt() const
Get the vector of sumpt
FlowElement_v1 FlowElement
Definition of the current "pfo version".
Class describing a truth particle in the MC record.
float cpy() const
Returns .
float sumpt() const
Returns sum of component pt.
xAOD::MissingETAssociation_v1::ConstVec constvec_t
Type for constituent vector.
std::vector< float > & f_trkpy()
float jettrkpy() const
Get the vector for a given object referenced by pointer.
TruthParticle_v1 TruthParticle
Typedef to implementation.
const std::vector< MissingETBase::Types::bitmask_t > & trkkey() const
Get the vector of trk keys.
virtual ~MissingETAssociation_v1()
Assignment operator.
bool setCalPy(const std::vector< float > &calpyvec)
Set the vector of
void setJetTrkPx(float px)
Set track constituent vector for the reference jet.
bool setTrkPx(const std::vector< float > &trkpxvec)
Set the vector of
@ ParticleFlow
The object is a particle-flow object.
bool addOverlap(const IParticle *pPart, size_t index, unsigned char type)
Add overlap index for a given contributing object referenced by pointer.
NeutralParticle_v1 NeutralParticle
Reference the current persistent version:
bool setTrkVec(size_t keyIdx, const ConstVec &cvec=ConstVec())
Set the track constituent vector of an object contribution referenced by index.
size_t index() const
Return the index of this element within its container.
xAOD::Type::ObjectType signalToXAODType(const xAOD::FlowElement &fe)
std::vector< std::vector< ElementLink< IParticleContainer > > > m_objConstLinks
Cache object constituents for overlap-finding.
const MissingETBase::Types::jetlink_t & jetLink() const
Get the link to the reference jet.
@ TrackCluster
Both cluster and track based.
float cpz() const
Returns .
ConstVec calVec(const IParticle *pPart) const
Get calo constituent vector for a given object.
bool isCharged() const
is a charged PFO
ConstVec jetTrkVec() const
Get track constituent vector for the reference jet.
bool addCalVec(MissingETBase::Types::bitmask_t key, float calpx, float calpy, float calpz, float cale, float sumpt)
Add a key/vector pair for calo contributions.
bool setTrkKey(const std::vector< MissingETBase::Types::bitmask_t > &trkkeyvec)
Set the vector of keys
Policy
Policies on usage checks.
ROOT::Math::LorentzVector< ROOT::Math::PtEtaPhiM4D< double > > JetFourMom_t
Base 4 Momentum type for Jet.
MissingETBase::Types::jetlink_t & f_jetLink()
Non-const link reference
const std::vector< float > & trke() const
Get the vector of
void createPrivateStore()
Function initialising the object to work in standalone mode.
bool setCalVec(size_t keyIdx, const ConstVec &cvec=ConstVec())
Set the calo constituent vector of an object contribution referenced by index.
@ AllCalo
Inclusive except tracks.
static bool isEqual(double x, double y)
Test of equality.
std::vector< std::vector< size_t > > & f_overlapIndices()
record overlapIndices between constributing objects
static double cpyError()
Access error return value for constituent vector .
@ OnlyTrack
Track based only.
std::map< const IParticle *, ConstVec > m_override
void makePrivateStore()
Create a new (empty) private store for this object.
ConstVec overlapTrkVec(const MissingETAssociationHelper &helper) const
Retrieve total track-based vector to be subtracted from the jet.
float jettrke() const
Get the vector for a given object referenced by index.
@ ParticleFlow
Particle Flow Object based.
std::vector< float > & f_trke()
MissingETBase::Types::objlink_vector_t & f_objectLinks()
Non-const link reference.
const std::vector< MissingETBase::Types::bitmask_t > & calkey() const
Get the vector of cal keys.
bool addTrkVec(MissingETBase::Types::bitmask_t key, float trkpx, float trkpy, float trkpz, float ce, float sumpt)
Add a key/vector pair for calo contributions.
const std::vector< float > & calpz() const
Get the vector of
bool isMisc() const
Check if this association is a miscellaneous association.
std::vector< MissingETBase::Types::bitmask_t > & f_calkey()
bool empty() const
Update all internally used ElementLink instances.
const std::vector< float > & trkpy() const
Get the vector of
bool checkUsage(const MissingETAssociationHelper &helper, const IParticle *pSig, MissingETBase::UsageHandler::Policy p) const
Check if this signal object matches the constituents of any flagged contributing objects.
bool setCalE(const std::vector< float > &calevec)
Set the vector of
std::vector< float > & f_calpz()
bool setOverlaps(const std::vector< std::vector< size_t > > &overlapIndices, const std::vector< std::vector< unsigned char > > &overlapTypes)
Set the vector of overlap indices and types.
size_t findTrkIndex(MissingETBase::Types::bitmask_t mask) const
std::vector< float > & f_calsumpt()
std::vector< float > & f_trkpx()
ConstVec trkVec(const IParticle *pPart) const
Get track constituent vector for a given object.
bool setCalPz(const std::vector< float > &calpzvec)
Set the vector of
std::vector< float > & f_calpx()
std::vector< float > & f_cale()
bool setCalKey(const std::vector< MissingETBase::Types::bitmask_t > &calkeyvec)
Set the vector of keys
const SG::AuxVectorData * container() const
Return the container holding this element.
const std::vector< float > & trkpx() const
Get the vector of
float cpx() const
Returns .
const std::vector< float > & trkpz() const
Get the vector of
size_t findCalIndex(MissingETBase::Types::bitmask_t mask) const
bool setObjectLinks(const MissingETBase::Types::objlink_vector_t &objLnks)
Set the vector of links to the contributing physics or signal objects.
float distance(const Amg::Vector3D &p1, const Amg::Vector3D &p2)
calculates the distance between two point in 3D space
const Jet * refJet() const
Access reference jet.
std::vector< MissingETBase::Types::bitmask_t > & f_trkkey()
bool operator==(const MissingETAssociation_v1 &contrib) const
float ce() const
Returns .
std::vector< const IParticle * > objects() const
Access contributing objects.
bool setTrkPz(const std::vector< float > &trkpzvec)
Set the vector of
Namespace for generally used type definitions.
xAOD::JetFourMom_t getAlternateConstVec() const
bool setRefJet(const Jet *pJet)
Set reference jet by object pointer reference.
const std::vector< float > & calpy() const
Get the vector of
A detector object made of other lower level object(s)
MissingETAssociation_v1(bool createStore=false)
Default constructor.