CMS 3D CMS Logo

TTTrackAssociationMap.cc
Go to the documentation of this file.
1 
9 
11 template <>
13  TTTrackPtr aTrack) const {
14  if (trackToTrackingParticleMap_.find(aTrack) != trackToTrackingParticleMap_.end()) {
15  return trackToTrackingParticleMap_.find(aTrack)->second;
16  } else {
17  return nullTrackingParticlePtr_;
18  }
19 }
20 
21 template <>
23  TrackingParticlePtr aTrackingParticle) const {
24  if (trackingParticleToTrackVectorMap_.find(aTrackingParticle) != trackingParticleToTrackVectorMap_.end()) {
25  return trackingParticleToTrackVectorMap_.find(aTrackingParticle)->second;
26  } else {
27  return nullVecTTTrackPtr_;
28  }
29 }
30 
32 template <>
35  if ((this->findTrackingParticlePtr(aTrack)).isNull())
36  return false;
37 
38  return true;
39 }
40 
42 template <>
45  if ((this->findTrackingParticlePtr(aTrack)).isNull())
46  return false;
47 
49  const std::vector<TTStubRef>& TRK_Stubs = aTrack->getStubRefs();
50  const std::vector<TTStubRef>& TP_Stubs =
51  theStubAssociationMap_->findTTStubRefs(this->findTrackingParticlePtr(aTrack));
52 
53  bool one2SStub = false;
54  for (unsigned int js = 0; js < TRK_Stubs.size(); js++) {
60  if (std::find(TP_Stubs.begin(), TP_Stubs.end(), TRK_Stubs.at(js)) == TP_Stubs.end()) {
61  if (!AllowOneFalse2SStub || TRK_Stubs.at(js)->moduleTypePS() || one2SStub) // Has to be first false 2S stub
62  {
63  return false;
64  } else {
65  one2SStub = true;
66  }
67  }
68  }
69 
70  return true;
71 }
72 
73 template <>
76  if (this->isLooselyGenuine(aTrack))
77  return false;
78 
79  if (this->isUnknown(aTrack))
80  return false;
81 
82  return true;
83 }
84 
85 template <>
88  int unknownstubs = 0;
89 
90  const std::vector<TTStubRef>& theseStubs = aTrack->getStubRefs();
91  for (unsigned int i = 0; i < theseStubs.size(); i++) {
92  if (theStubAssociationMap_->isUnknown(theseStubs.at(i)) == false) {
93  ++unknownstubs;
94  if (unknownstubs >= 2)
95  return false;
96  }
97  }
98 
99  return true;
100 }
101 
102 template <>
104  AllowOneFalse2SStub = allowFalse2SStub;
105 }
106 
107 template <>
109  return AllowOneFalse2SStub;
110 }
const TrackingParticlePtr & findTrackingParticlePtr(TTTrackPtrT< T > aTrack) const
bool isUnknown(TTTrackPtrT< T > aTrack) const
More than one stub on track is "unknown".
void find(edm::Handle< EcalRecHitCollection > &hits, DetId thisDet, std::vector< EcalRecHitCollection::const_iterator > &hit, bool debug=false)
Definition: FindCaloHit.cc:19
bool isCombinatoric(TTTrackPtrT< T > aTrack) const
Both isLooselyGenuine() & isUnknown() are false.
bool isGenuine(TTTrackPtrT< T > aTrack) const
void setAllowOneFalse2SStub(bool allowFalse2SStub)
bool isLooselyGenuine(TTTrackPtrT< T > aTrack) const
const std::vector< TTTrackPtrT< T > > & findTTTrackPtrs(TrackingParticlePtr aTrackingParticle) const