Back to home page

Project CMSSW displayed by LXR

 
 

    


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   /*! \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 
0025     // insert a TPPtr and its associated collection of TTstubRefs into the underlayering maps
0026     void insert(const TPPtr& tpPtr, const std::vector<TTStubRef>& ttSTubRefs);
0027     // returns map containing TTStubRef and their associated collection of TPPtrs
0028     const std::map<TTStubRef, std::vector<TPPtr>>& getTTStubToTrackingParticlesMap() const {
0029       return mapTTStubRefsTPPtrs_;
0030     }
0031     // returns map containing TPPtr and their associated collection of TTStubRefs
0032     const std::map<TPPtr, std::vector<TTStubRef>>& getTrackingParticleToTTStubsMap() const {
0033       return mapTPPtrsTTStubRefs_;
0034     }
0035     // returns collection of TPPtrs associated to given TTstubRef
0036     std::vector<TPPtr> findTrackingParticlePtrs(const TTStubRef& ttStubRef) const;
0037     // returns collection of TTStubRefs associated to given TPPtr
0038     std::vector<TTStubRef> findTTStubRefs(const TPPtr& tpPtr) const;
0039     // total number of stubs associated with TPs
0040     int numStubs() const { return mapTTStubRefsTPPtrs_.size(); };
0041     // total number of TPs associated with stubs
0042     int numTPs() const { return mapTPPtrsTTStubRefs_.size(); };
0043     // Get all TPs that are matched to these stubs in at least 'tpMinLayers' layers and 'tpMinLayersPS' ps layers
0044     std::vector<TPPtr> associate(const std::vector<TTStubRef>& ttStubRefs) const;
0045     // 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
0046     std::vector<TPPtr> associateFinal(const std::vector<TTStubRef>& ttStubRefs) const;
0047 
0048   private:
0049     // stores, calculates and provides run-time constants
0050     const Setup* setup_;
0051     // map containing TTStubRef and their associated collection of TPPtrs
0052     std::map<TTStubRef, std::vector<TPPtr>> mapTTStubRefsTPPtrs_;
0053     // map containing TPPtr and their associated collection of TTStubRefs
0054     std::map<TPPtr, std::vector<TTStubRef>> mapTPPtrsTTStubRefs_;
0055     // empty container of TPPtr
0056     const std::vector<TPPtr> emptyTPPtrs_;
0057     // empty container of TTStubRef
0058     const std::vector<TTStubRef> emptyTTStubRefs_;
0059   };
0060 
0061 }  // namespace tt
0062 
0063 #endif