Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2024-04-06 12:31:07

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   /*! \class  tt::StubAssociation
0013    *  \brief  Class to associate reconstrucable TrackingParticles with TTStubs and vice versa.
0014    *          It may associate multiple TPs with a TTStub and can therefore be used to associate
0015    *          TTTracks with TrackingParticles.
0016    *  \author Thomas Schuh
0017    *  \date   2020, Apr
0018    */
0019   class StubAssociation {
0020   public:
0021     StubAssociation() { setup_ = nullptr; }
0022     StubAssociation(const Setup* setup) : setup_(setup) {}
0023     ~StubAssociation() {}
0024     // insert a TPPtr and its associated collection of TTstubRefs into the underlayering maps
0025     void insert(const TPPtr& tpPtr, const std::vector<TTStubRef>& ttSTubRefs);
0026     // returns map containing TTStubRef and their associated collection of TPPtrs
0027     const std::map<TTStubRef, std::vector<TPPtr>>& getTTStubToTrackingParticlesMap() const {
0028       return mapTTStubRefsTPPtrs_;
0029     }
0030     // returns map containing TPPtr and their associated collection of TTStubRefs
0031     const std::map<TPPtr, std::vector<TTStubRef>>& getTrackingParticleToTTStubsMap() const {
0032       return mapTPPtrsTTStubRefs_;
0033     }
0034     // returns collection of TPPtrs associated to given TTstubRef
0035     std::vector<TPPtr> findTrackingParticlePtrs(const TTStubRef& ttStubRef) const;
0036     // returns collection of TTStubRefs associated to given TPPtr
0037     std::vector<TTStubRef> findTTStubRefs(const TPPtr& tpPtr) const;
0038     // total number of stubs associated with TPs
0039     int numStubs() const { return mapTTStubRefsTPPtrs_.size(); };
0040     // total number of TPs associated with stubs
0041     int numTPs() const { return mapTPPtrsTTStubRefs_.size(); };
0042     // Get all TPs that are matched to these stubs in at least 'tpMinLayers' layers and 'tpMinLayersPS' ps layers
0043     std::vector<TPPtr> associate(const std::vector<TTStubRef>& ttStubRefs) const;
0044     // Get all TPs that are matched to these stubs in at least 'tpMinLayers' layers and 'tpMinLayersPS' ps layers with not more then 'tpMaxBadStubs2S' not associated 2S stubs and not more then 'tpMaxBadStubsPS' associated PS stubs
0045     std::vector<TPPtr> associateFinal(const std::vector<TTStubRef>& ttStubRefs) const;
0046 
0047   private:
0048     // stores, calculates and provides run-time constants
0049     const Setup* setup_;
0050     // map containing TTStubRef and their associated collection of TPPtrs
0051     std::map<TTStubRef, std::vector<TPPtr>> mapTTStubRefsTPPtrs_;
0052     // map containing TPPtr and their associated collection of TTStubRefs
0053     std::map<TPPtr, std::vector<TTStubRef>> mapTPPtrsTTStubRefs_;
0054     // empty container of TPPtr
0055     const std::vector<TPPtr> emptyTPPtrs_;
0056     // empty container of TTStubRef
0057     const std::vector<TTStubRef> emptyTTStubRefs_;
0058   };
0059 
0060 }  // namespace tt
0061 
0062 #endif