File indexing completed on 2023-03-17 11:25:53
0001 #ifndef SimTracker_TrackTriggerAssociation_StubAssociation_h
0002 #define SimTracker_TrackTriggerAssociation_StubAssociation_h
0003
0004 #include "SimTracker/TrackTriggerAssociation/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
0026 void insert(const TPPtr& tpPtr, const std::vector<TTStubRef>& ttSTubRefs);
0027
0028 const std::map<TTStubRef, std::vector<TPPtr>>& getTTStubToTrackingParticlesMap() const {
0029 return mapTTStubRefsTPPtrs_;
0030 }
0031
0032 const std::map<TPPtr, std::vector<TTStubRef>>& getTrackingParticleToTTStubsMap() const {
0033 return mapTPPtrsTTStubRefs_;
0034 }
0035
0036 std::vector<TPPtr> findTrackingParticlePtrs(const TTStubRef& ttStubRef) const;
0037
0038 std::vector<TTStubRef> findTTStubRefs(const TPPtr& tpPtr) const;
0039
0040 int numStubs() const { return mapTTStubRefsTPPtrs_.size(); };
0041
0042 int numTPs() const { return mapTPPtrsTTStubRefs_.size(); };
0043
0044 std::vector<TPPtr> associate(const std::vector<TTStubRef>& ttStubRefs) const;
0045
0046 std::vector<TPPtr> associateFinal(const std::vector<TTStubRef>& ttStubRefs) const;
0047
0048 private:
0049
0050 const Setup* setup_;
0051
0052 std::map<TTStubRef, std::vector<TPPtr>> mapTTStubRefsTPPtrs_;
0053
0054 std::map<TPPtr, std::vector<TTStubRef>> mapTPPtrsTTStubRefs_;
0055
0056 const std::vector<TPPtr> emptyTPPtrs_;
0057
0058 const std::vector<TTStubRef> emptyTTStubRefs_;
0059 };
0060
0061 }
0062
0063 #endif