File indexing completed on 2024-08-09 23:47:44
0001 #ifndef SimTracker_TrackTriggerAssociation_StubAssociation_h
0002 #define SimTracker_TrackTriggerAssociation_StubAssociation_h
0003
0004 #include "SimDataFormats/Associations/interface/TTTypes.h"
0005 #include "L1Trigger/TrackTrigger/interface/Setup.h"
0006
0007 #include <vector>
0008 #include <map>
0009
0010 namespace tt {
0011
0012
0013
0014
0015
0016
0017
0018
0019 class StubAssociation {
0020 public:
0021 StubAssociation() { setup_ = nullptr; }
0022 StubAssociation(const Setup* setup) : setup_(setup) {}
0023 ~StubAssociation() {}
0024
0025 void insert(const TPPtr& tpPtr, const std::vector<TTStubRef>& ttSTubRefs);
0026
0027 const std::map<TTStubRef, std::vector<TPPtr>>& getTTStubToTrackingParticlesMap() const {
0028 return mapTTStubRefsTPPtrs_;
0029 }
0030
0031 const std::map<TPPtr, std::vector<TTStubRef>>& getTrackingParticleToTTStubsMap() const {
0032 return mapTPPtrsTTStubRefs_;
0033 }
0034
0035 std::vector<TPPtr> findTrackingParticlePtrs(const TTStubRef& ttStubRef) const;
0036
0037 std::vector<TTStubRef> findTTStubRefs(const TPPtr& tpPtr) const;
0038
0039 int numStubs() const { return mapTTStubRefsTPPtrs_.size(); };
0040
0041 int numTPs() const { return mapTPPtrsTTStubRefs_.size(); };
0042
0043 std::vector<TPPtr> associate(const std::vector<TTStubRef>& ttStubRefs) const;
0044
0045 std::vector<TPPtr> associateFinal(const std::vector<TTStubRef>& ttStubRefs) const;
0046
0047 private:
0048
0049 const Setup* setup_;
0050
0051 std::map<TTStubRef, std::vector<TPPtr>> mapTTStubRefsTPPtrs_;
0052
0053 std::map<TPPtr, std::vector<TTStubRef>> mapTPPtrsTTStubRefs_;
0054
0055 const std::vector<TPPtr> emptyTPPtrs_;
0056
0057 const std::vector<TTStubRef> emptyTTStubRefs_;
0058 };
0059
0060 }
0061
0062 #endif