CMS 3D CMS Logo

L1TrackTruthMatched.h
Go to the documentation of this file.
1 #ifndef __L1Trigger_VertexFinder_L1TrackTruthMatched_h__
2 #define __L1Trigger_VertexFinder_L1TrackTruthMatched_h__
3 
4 #include <vector>
5 
10 // TTStubAssociationMap.h forgets to two needed files, so must include them here ...
13 
14 class TrackerGeometry;
15 class TrackerTopology;
16 
17 namespace l1tVertexFinder {
18 
19  class AnalysisSettings;
20  class TP;
21 
23 
25  class L1TrackTruthMatched : public L1Track {
26  public:
29  const edm::ValueMap<TP>& tpValueMap,
30  edm::Handle<TTTrackAssMap> mcTruthTTTrackHandle)
31  : L1Track(aTrack), matchedTPidx_(-1) {
32  auto mcTruthTP = mcTruthTTTrackHandle->findTrackingParticlePtr(aTrack);
33  if (!mcTruthTP.isNull()) {
34  auto tpTranslation = tpPtrToRefMap.find(mcTruthTP);
35  if (tpTranslation != tpPtrToRefMap.end()) {
36  matchedTP_ = &tpValueMap[tpTranslation->second];
37  matchedTPidx_ = std::distance(tpPtrToRefMap.begin(), tpTranslation);
38  } else {
39  matchedTP_ = nullptr;
40  }
41  } else {
42  matchedTP_ = nullptr;
43  }
44  }
46 
47  // Get best matching tracking particle (=nullptr if none).
48  const TP* getMatchedTP() const { return matchedTP_; }
49 
50  // Get the index of the matched TP in the map of TP particles with the use flag set
51  const int getMatchedTPidx() const { return matchedTPidx_; }
52 
53  private:
54  const TP* matchedTP_;
56  };
57 
58 } // namespace l1tVertexFinder
59 
60 #endif
l1tVertexFinder
Definition: AlgoSettings.h:10
TP.h
l1tVertexFinder::TTTrackAssMap
TTTrackAssociationMap< Ref_Phase2TrackerDigi_ > TTTrackAssMap
Definition: L1TrackTruthMatched.h:20
TTTypes.h
TrackerTopology
Definition: TrackerTopology.h:16
l1tVertexFinder::L1TrackTruthMatched::getMatchedTP
const TP * getMatchedTP() const
Definition: L1TrackTruthMatched.h:48
TTTrack
Class to store the L1 Track Trigger tracks.
Definition: TTTrack.h:29
edm::Handle
Definition: AssociativeIterator.h:50
l1tVertexFinder::TP
Definition: TP.h:16
l1tVertexFinder::L1TrackTruthMatched::matchedTPidx_
int matchedTPidx_
Definition: L1TrackTruthMatched.h:55
l1tVertexFinder::L1TrackTruthMatched::getMatchedTPidx
const int getMatchedTPidx() const
Definition: L1TrackTruthMatched.h:51
TTTrackAssociationMap
Stores association of Truth Particles (TP) to L1 Track-Trigger Tracks.
Definition: TTTrackAssociationMap.h:46
l1tVertexFinder::L1TrackTruthMatched::L1TrackTruthMatched
L1TrackTruthMatched(const edm::Ptr< TTTrack< Ref_Phase2TrackerDigi_ >> &aTrack, const std::map< edm::Ptr< TrackingParticle >, edm::RefToBase< TrackingParticle >> &tpPtrToRefMap, const edm::ValueMap< TP > &tpValueMap, edm::Handle< TTTrackAssMap > mcTruthTTTrackHandle)
Definition: L1TrackTruthMatched.h:27
l1tVertexFinder::L1TrackTruthMatched::matchedTP_
const TP * matchedTP_
Definition: L1TrackTruthMatched.h:54
Ptr.h
edm::Ptr
Definition: AssociationVector.h:31
TrackingParticle.h
TTTrackAssociationMap.h
edm::ValueMap
Definition: ValueMap.h:107
l1tVertexFinder::L1TrackTruthMatched::~L1TrackTruthMatched
~L1TrackTruthMatched()
Definition: L1TrackTruthMatched.h:45
edm::RefToBase
Definition: AssociativeIterator.h:54
genParticles_cff.map
map
Definition: genParticles_cff.py:11
L1Track.h
HLT_FULL_cff.distance
distance
Definition: HLT_FULL_cff.py:7746
l1tVertexFinder::L1Track
Simple wrapper class for TTTrack.
Definition: L1Track.h:17
l1tVertexFinder::L1TrackTruthMatched
Simple wrapper class for TTTrack, with match to a tracking particle.
Definition: L1TrackTruthMatched.h:25
TrackerGeometry
Definition: TrackerGeometry.h:14