00001
00002 #ifndef XAODMISSINGET_VERSIONS_MISSINGETASSOCIATIONMAP_V1_H
00003 #define XAODMISSINGET_VERSIONS_MISSINGETASSOCIATIONMAP_V1_H
00004
00005 #include "AthContainers/DataVector.h"
00006
00007 #include "xAODJet/Jet.h"
00008 #include "xAODMissingET/versions/MissingETAssociation_v1.h"
00009
00010 #include <string>
00011 #include <vector>
00012 #include <map>
00013
00014 #include <iostream>
00015
00016 namespace xAOD
00017 {
00018
00019 class MissingETAssociationMap_v1 : public DataVector<MissingETAssociation_v1>
00020 {
00021 public:
00022
00024 MissingETAssociationMap_v1(SG::OwnershipPolicy own=SG::OWN_ELEMENTS, SG::IndexTrackingPolicy trackIndices = SG::DEFAULT_TRACK_INDICES);
00026 MissingETAssociationMap_v1(MissingETAssociationMap_v1::iterator first, MissingETAssociationMap_v1::iterator last,
00027 SG::OwnershipPolicy own=SG::OWN_ELEMENTS, SG::IndexTrackingPolicy trackIndices = SG::DEFAULT_TRACK_INDICES);
00029 virtual ~MissingETAssociationMap_v1();
00030
00040 const_iterator find(const Jet* pJet) const;
00048 iterator find(const Jet* pJet);
00049 size_t findIndex(const Jet* pJet) const;
00050
00058 const_iterator findByJetConst(const IParticle* pConst) const;
00066 iterator findByJetConst(const IParticle* pConst);
00074 const_iterator findByJetConst(ElementLink<IParticleContainer> constLink) const;
00082 iterator findByJetConst(ElementLink<IParticleContainer> constLink);
00083 size_t findIndexByJetConst(const IParticle* pConst) const;
00084 size_t findIndexByJetConst(ElementLink<IParticleContainer> pConstLink) const;
00089 const MissingETAssociation_v1* getMiscAssociation() const;
00090 MissingETAssociation_v1* getMiscAssociation();
00101 bool setJetConstituents(const Jet* pJet) const;
00109 bool setJetConstituents(const std::vector<ElementLink<IParticleContainer> >& constLinks, const Jet* pJet) const;
00117 bool setJetConstituents(const std::vector<ElementLink<IParticleContainer> >& constLinks, size_t jetIndex) const;
00123 bool identifyOverlaps();
00124 void clearOverlaps();
00132 const IParticleContainer* getUniqueSignals(const IParticleContainer* signals,MissingETBase::UsageHandler::Policy p=MissingETBase::UsageHandler::TrackCluster) const;
00140 const IParticleContainer* getOverlapRemovedSignals(const IParticleContainer* signals,MissingETBase::UsageHandler::Policy p=MissingETBase::UsageHandler::TrackCluster) const;
00143
00144
00145
00146 void resize(size_type sz);
00147 void pop_back();
00148 void clear();
00149 void sort();
00150 template <class COMPARE> void sort(COMPARE comp);
00151 void clear (SG::OwnershipPolicy ownPolicy);
00152 void clear (SG::OwnershipPolicy ownPolicy,SG::IndexTrackingPolicy trackIndices);
00153 iterator erase(iterator position);
00154 iterator erase(iterator first, iterator last);
00155
00158 void resetObjSelectionFlags() const;
00160 void resetAssocCache() const;
00161
00162 protected:
00163
00164 void f_setJetConstMap(std::map<ElementLink<IParticleContainer>, size_t> map);
00165 void f_clearJetConstMap();
00166 mutable std::map<ElementLink<IParticleContainer>, size_t> m_jetConstLinks;
00183 const_iterator f_findConst(const Jet* pJet) const;
00184 void f_setConstCache(const_iterator fCont) const;
00185
00186 iterator f_find(const Jet* pJet);
00187 void f_setCache(iterator fCont);
00188
00189 void resetCache() const;
00190
00191 private:
00192
00193 mutable const Jet* m_lastRefJet;
00194 mutable size_t m_lastContribIndex;
00195 mutable ElementLink<IParticleContainer> m_lastConstLink;
00196 mutable size_t m_miscAssocIndex;
00197
00198 static size_t m_jetConstLinkReserve;
00199
00200 };
00201 }
00202
00203 #include "xAODCore/BaseInfo.h"
00204 SG_BASE(xAOD::MissingETAssociationMap_v1, DataVector<xAOD::MissingETAssociation_v1>);
00205
00206 #include "xAODMissingET/versions/MissingETAssociationMap_v1.icc"
00207 #endif