CMS 3D CMS Logo

StubAssociation.h
Go to the documentation of this file.
1 #ifndef SimTracker_TrackTriggerAssociation_StubAssociation_h
2 #define SimTracker_TrackTriggerAssociation_StubAssociation_h
3 
6 
7 #include <vector>
8 #include <map>
9 
10 namespace tt {
11 
20  public:
21  StubAssociation() { setup_ = nullptr; }
24  // insert a TPPtr and its associated collection of TTstubRefs into the underlayering maps
25  void insert(const TPPtr& tpPtr, const std::vector<TTStubRef>& ttSTubRefs);
26  // returns map containing TTStubRef and their associated collection of TPPtrs
27  const std::map<TTStubRef, std::vector<TPPtr>>& getTTStubToTrackingParticlesMap() const {
28  return mapTTStubRefsTPPtrs_;
29  }
30  // returns map containing TPPtr and their associated collection of TTStubRefs
31  const std::map<TPPtr, std::vector<TTStubRef>>& getTrackingParticleToTTStubsMap() const {
32  return mapTPPtrsTTStubRefs_;
33  }
34  // returns collection of TPPtrs associated to given TTstubRef
35  std::vector<TPPtr> findTrackingParticlePtrs(const TTStubRef& ttStubRef) const;
36  // returns collection of TTStubRefs associated to given TPPtr
37  std::vector<TTStubRef> findTTStubRefs(const TPPtr& tpPtr) const;
38  // total number of stubs associated with TPs
39  int numStubs() const { return mapTTStubRefsTPPtrs_.size(); };
40  // total number of TPs associated with stubs
41  int numTPs() const { return mapTPPtrsTTStubRefs_.size(); };
42  // Get all TPs that are matched to these stubs in at least 'tpMinLayers' layers and 'tpMinLayersPS' ps layers
43  std::vector<TPPtr> associate(const std::vector<TTStubRef>& ttStubRefs) const;
44  // 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
45  std::vector<TPPtr> associateFinal(const std::vector<TTStubRef>& ttStubRefs) const;
46 
47  private:
48  // stores, calculates and provides run-time constants
49  const Setup* setup_;
50  // map containing TTStubRef and their associated collection of TPPtrs
51  std::map<TTStubRef, std::vector<TPPtr>> mapTTStubRefsTPPtrs_;
52  // map containing TPPtr and their associated collection of TTStubRefs
53  std::map<TPPtr, std::vector<TTStubRef>> mapTPPtrsTTStubRefs_;
54  // empty container of TPPtr
55  const std::vector<TPPtr> emptyTPPtrs_;
56  // empty container of TTStubRef
57  const std::vector<TTStubRef> emptyTTStubRefs_;
58  };
59 
60 } // namespace tt
61 
62 #endif
std::vector< TTStubRef > findTTStubRefs(const TPPtr &tpPtr) const
Class to process and provide run-time constants used by Track Trigger emulators.
Definition: Setup.h:44
const std::vector< TPPtr > emptyTPPtrs_
StubAssociation(const Setup *setup)
Class to associate reconstrucable TrackingParticles with TTStubs and vice versa. It may associate mul...
const std::map< TPPtr, std::vector< TTStubRef > > & getTrackingParticleToTTStubsMap() const
const std::vector< TTStubRef > emptyTTStubRefs_
Definition: TTTypes.h:54
std::map< TPPtr, std::vector< TTStubRef > > mapTPPtrsTTStubRefs_
std::map< TTStubRef, std::vector< TPPtr > > mapTTStubRefsTPPtrs_
std::vector< TPPtr > associateFinal(const std::vector< TTStubRef > &ttStubRefs) const
const Setup * setup_
void insert(const TPPtr &tpPtr, const std::vector< TTStubRef > &ttSTubRefs)
const std::map< TTStubRef, std::vector< TPPtr > > & getTTStubToTrackingParticlesMap() const
std::vector< TPPtr > findTrackingParticlePtrs(const TTStubRef &ttStubRef) const
std::vector< TPPtr > associate(const std::vector< TTStubRef > &ttStubRefs) const