File indexing completed on 2025-06-03 00:12:41
0001 #ifndef SimTracker_TrackTriggerAssociation_StubAssociation_h
0002 #define SimTracker_TrackTriggerAssociation_StubAssociation_h
0003
0004 #include "DataFormats/Common/interface/Ptr.h"
0005 #include "SimDataFormats/TrackingAnalysis/interface/TrackingParticle.h"
0006 #include "L1Trigger/TrackTrigger/interface/Setup.h"
0007
0008 #include <vector>
0009 #include <map>
0010
0011 namespace tt {
0012
0013 typedef edm::Ptr<TrackingParticle> TPPtr;
0014
0015
0016
0017
0018
0019
0020
0021
0022 class StubAssociation {
0023 public:
0024
0025 struct Config {
0026 int minLayersGood_;
0027 int minLayersGoodPS_;
0028 int maxLayersBad_;
0029 int maxLayersBadPS_;
0030 };
0031 StubAssociation() { setup_ = nullptr; }
0032 StubAssociation(const Config& iConfig, const Setup* setup);
0033 ~StubAssociation() = default;
0034
0035 void insert(const TPPtr& tpPtr, const std::vector<TTStubRef>& ttSTubRefs);
0036
0037 const std::map<TTStubRef, std::vector<TPPtr>>& getTTStubToTrackingParticlesMap() const {
0038 return mapTTStubRefsTPPtrs_;
0039 }
0040
0041 const std::map<TPPtr, std::vector<TTStubRef>>& getTrackingParticleToTTStubsMap() const {
0042 return mapTPPtrsTTStubRefs_;
0043 }
0044
0045 std::vector<TPPtr> findTrackingParticlePtrs(const TTStubRef& ttStubRef) const;
0046
0047 std::vector<TTStubRef> findTTStubRefs(const TPPtr& tpPtr) const;
0048
0049 int numStubs() const { return mapTTStubRefsTPPtrs_.size(); };
0050
0051 int numTPs() const { return mapTPPtrsTTStubRefs_.size(); };
0052
0053 std::vector<TPPtr> associate(const std::vector<TTStubRef>& ttStubRefs) const;
0054
0055 std::vector<TPPtr> associateFinal(const std::vector<TTStubRef>& ttStubRefs) const;
0056
0057 private:
0058
0059 const Setup* setup_;
0060
0061 int minLayersGood_;
0062
0063 int minLayersGoodPS_;
0064
0065 int maxLayersBad_;
0066
0067 int maxLayersBadPS_;
0068
0069 std::map<TTStubRef, std::vector<TPPtr>> mapTTStubRefsTPPtrs_;
0070
0071 std::map<TPPtr, std::vector<TTStubRef>> mapTPPtrsTTStubRefs_;
0072
0073 const std::vector<TPPtr> emptyTPPtrs_;
0074
0075 const std::vector<TTStubRef> emptyTTStubRefs_;
0076 };
0077
0078 }
0079
0080 #endif