CMS 3D CMS Logo

List of all members | Public Member Functions | Private Attributes
TTTrackAssociationMap< T > Class Template Reference

NOTE: this is needed even if it seems not. More...

#include <TTTrackAssociationMap.h>

Public Member Functions

template<>
edm::Ptr< TrackingParticlefindTrackingParticlePtr (edm::Ptr< TTTrack< Ref_Phase2TrackerDigi_ > > aTrack) const
 Implementation of methods. More...
 
template<>
edm::Ptr< TrackingParticlefindTrackingParticlePtr (edm::Ptr< TTTrack< Ref_Phase2TrackerDigi_ > > aTrack) const
 Operations. More...
 
edm::Ptr< TrackingParticlefindTrackingParticlePtr (edm::Ptr< TTTrack< T > > aTrack) const
 Operations. More...
 
template<>
std::vector< edm::Ptr< TTTrack< Ref_Phase2TrackerDigi_ > > > findTTTrackPtrs (edm::Ptr< TrackingParticle > aTrackingParticle) const
 
std::vector< edm::Ptr< TTTrack< T > > > findTTTrackPtrs (edm::Ptr< TrackingParticle > aTrackingParticle) const
 
template<>
std::vector< edm::Ptr< TTTrack< Ref_Phase2TrackerDigi_ > > > findTTTrackPtrs (edm::Ptr< TrackingParticle > aTrackingParticle) const
 
bool getAllowOneFalse2SStub ()
 
template<>
bool getAllowOneFalse2SStub ()
 
std::map< edm::Ptr< TrackingParticle >, std::vector< edm::Ptr< TTTrack< T > > > > getTrackingParticleToTTTracksMap () const
 
std::map< edm::Ptr< TTTrack< T > >, edm::Ptr< TrackingParticle > > getTTTrackToTrackingParticleMap () const
 Maps. More...
 
template<>
bool isCombinatoric (edm::Ptr< TTTrack< Ref_Phase2TrackerDigi_ > > aTrack) const
 
template<>
bool isCombinatoric (edm::Ptr< TTTrack< Ref_Phase2TrackerDigi_ > > aTrack) const
 
bool isCombinatoric (edm::Ptr< TTTrack< T > > aTrack) const
 
template<>
bool isGenuine (edm::Ptr< TTTrack< Ref_Phase2TrackerDigi_ > > aTrack) const
 MC truth. More...
 
template<>
bool isGenuine (edm::Ptr< TTTrack< Ref_Phase2TrackerDigi_ > > aTrack) const
 MC truth. More...
 
bool isGenuine (edm::Ptr< TTTrack< T > > aTrack) const
 MC Truth methods. More...
 
template<>
bool isLooselyGenuine (edm::Ptr< TTTrack< Ref_Phase2TrackerDigi_ > > aTrack) const
 MC truth. More...
 
template<>
bool isLooselyGenuine (edm::Ptr< TTTrack< Ref_Phase2TrackerDigi_ > > aTrack) const
 MC truth. More...
 
bool isLooselyGenuine (edm::Ptr< TTTrack< T > > aTrack) const
 
template<>
bool isUnknown (edm::Ptr< TTTrack< Ref_Phase2TrackerDigi_ > > aTrack) const
 
template<>
bool isUnknown (edm::Ptr< TTTrack< Ref_Phase2TrackerDigi_ > > aTrack) const
 
bool isUnknown (edm::Ptr< TTTrack< T > > aTrack) const
 
void setAllowOneFalse2SStub (bool allowFalse2SStub)
 
template<>
void setAllowOneFalse2SStub (bool allowFalse2SStub)
 
void setTrackingParticleToTTTracksMap (std::map< edm::Ptr< TrackingParticle >, std::vector< edm::Ptr< TTTrack< T > > > > aMap)
 
void setTTStubAssociationMap (edm::RefProd< TTStubAssociationMap< T > > aStubAssoMap)
 
void setTTTrackToTrackingParticleMap (std::map< edm::Ptr< TTTrack< T > >, edm::Ptr< TrackingParticle > > aMap)
 
 TTTrackAssociationMap ()
 Constructors. More...
 
 ~TTTrackAssociationMap ()
 Destructor. More...
 

Private Attributes

bool AllowOneFalse2SStub
 
edm::RefProd< TTStubAssociationMap< T > > theStubAssociationMap
 
std::map< edm::Ptr< TrackingParticle >, std::vector< edm::Ptr< TTTrack< T > > > > trackingParticleToTrackVectorMap
 
std::map< edm::Ptr< TTTrack< T > >, edm::Ptr< TrackingParticle > > trackToTrackingParticleMap
 Data members. More...
 

Detailed Description

template<typename T>
class TTTrackAssociationMap< T >

NOTE: this is needed even if it seems not.

Class to store the MC truth of L1 Track Trigger tracks.

After moving from SimDataFormats to DataFormats, the template structure of the class was maintained in order to accomodate any types other than PixelDigis in case there is such a need in the future.

Author
Nicola Pozzobon
Date
2013, Jul 19

Definition at line 34 of file TTTrackAssociationMap.h.

Constructor & Destructor Documentation

◆ TTTrackAssociationMap()

template<typename T >
TTTrackAssociationMap< T >::TTTrackAssociationMap ( )

Constructors.

Close class.

Implementation of methods

Here, in the header file, the methods which do not depend on the specific type <T> that can fit the template. Other methods, with type-specific features, are implemented in the source file. Default Constructor NOTE: to be used with setSomething(...) methods

Set default data members

Definition at line 97 of file TTTrackAssociationMap.h.

97  {
101 }

◆ ~TTTrackAssociationMap()

template<typename T >
TTTrackAssociationMap< T >::~TTTrackAssociationMap ( )

Destructor.

Definition at line 105 of file TTTrackAssociationMap.h.

105 {}

Member Function Documentation

◆ findTrackingParticlePtr() [1/3]

template<>
edm::Ptr< TrackingParticle > TTTrackAssociationMap< Ref_Phase2TrackerDigi_ >::findTrackingParticlePtr ( edm::Ptr< TTTrack< Ref_Phase2TrackerDigi_ > >  aTrack) const

Implementation of methods.

Here, in the header file, the methods which do not depend on the specific type <T> that can fit the template. Other methods, with type-specific features, are implemented in the source file. Operations

Default: return NULL

Definition at line 12 of file TTTrackAssociationMap.cc.

13  {
14  if (trackToTrackingParticleMap.find(aTrack) != trackToTrackingParticleMap.end()) {
15  return trackToTrackingParticleMap.find(aTrack)->second;
16  }
17 
20  return *temp;
21 }

References groupFilesInBlocks::temp.

◆ findTrackingParticlePtr() [2/3]

template<>
edm::Ptr< TrackingParticle > TTTrackAssociationMap< Ref_Phase2TrackerDigi_ >::findTrackingParticlePtr ( edm::Ptr< TTTrack< Ref_Phase2TrackerDigi_ > >  aTrack) const

Operations.

◆ findTrackingParticlePtr() [3/3]

template<typename T >
edm::Ptr<TrackingParticle> TTTrackAssociationMap< T >::findTrackingParticlePtr ( edm::Ptr< TTTrack< T > >  aTrack) const

Operations.

◆ findTTTrackPtrs() [1/3]

template<>
std::vector< edm::Ptr< TTTrack< Ref_Phase2TrackerDigi_ > > > TTTrackAssociationMap< Ref_Phase2TrackerDigi_ >::findTTTrackPtrs ( edm::Ptr< TrackingParticle aTrackingParticle) const

Default: return empty vector

Definition at line 24 of file TTTrackAssociationMap.cc.

25  {
26  if (trackingParticleToTrackVectorMap.find(aTrackingParticle) != trackingParticleToTrackVectorMap.end()) {
27  return trackingParticleToTrackVectorMap.find(aTrackingParticle)->second;
28  }
29 
31  std::vector<edm::Ptr<TTTrack<Ref_Phase2TrackerDigi_> > > tempVec;
32  tempVec.clear();
33  return tempVec;
34 }

◆ findTTTrackPtrs() [2/3]

template<typename T >
std::vector<edm::Ptr<TTTrack<T> > > TTTrackAssociationMap< T >::findTTTrackPtrs ( edm::Ptr< TrackingParticle aTrackingParticle) const

◆ findTTTrackPtrs() [3/3]

template<>
std::vector< edm::Ptr< TTTrack< Ref_Phase2TrackerDigi_ > > > TTTrackAssociationMap< Ref_Phase2TrackerDigi_ >::findTTTrackPtrs ( edm::Ptr< TrackingParticle aTrackingParticle) const

◆ getAllowOneFalse2SStub() [1/2]

template<typename T >
bool TTTrackAssociationMap< T >::getAllowOneFalse2SStub ( )

◆ getAllowOneFalse2SStub() [2/2]

template<>
bool TTTrackAssociationMap< Ref_Phase2TrackerDigi_ >::getAllowOneFalse2SStub ( )

Definition at line 117 of file TTTrackAssociationMap.cc.

117  {
118  return AllowOneFalse2SStub;
119 }

◆ getTrackingParticleToTTTracksMap()

template<typename T >
std::map<edm::Ptr<TrackingParticle>, std::vector<edm::Ptr<TTTrack<T> > > > TTTrackAssociationMap< T >::getTrackingParticleToTTTracksMap ( ) const
inline

◆ getTTTrackToTrackingParticleMap()

template<typename T >
std::map<edm::Ptr<TTTrack<T> >, edm::Ptr<TrackingParticle> > TTTrackAssociationMap< T >::getTTTrackToTrackingParticleMap ( ) const
inline

Maps.

Data members: getABC( ... ) Helper methods: findABC( ... )

Definition at line 46 of file TTTrackAssociationMap.h.

46  {
48  }

References TTTrackAssociationMap< T >::trackToTrackingParticleMap.

◆ isCombinatoric() [1/3]

template<>
bool TTTrackAssociationMap< Ref_Phase2TrackerDigi_ >::isCombinatoric ( edm::Ptr< TTTrack< Ref_Phase2TrackerDigi_ > >  aTrack) const

Defined by exclusion

Definition at line 81 of file TTTrackAssociationMap.cc.

82  {
84  if (this->isLooselyGenuine(aTrack))
85  return false;
86 
87  if (this->isUnknown(aTrack))
88  return false;
89 
90  return true;
91 }

◆ isCombinatoric() [2/3]

template<>
bool TTTrackAssociationMap< Ref_Phase2TrackerDigi_ >::isCombinatoric ( edm::Ptr< TTTrack< Ref_Phase2TrackerDigi_ > >  aTrack) const

◆ isCombinatoric() [3/3]

template<typename T >
bool TTTrackAssociationMap< T >::isCombinatoric ( edm::Ptr< TTTrack< T > >  aTrack) const

◆ isGenuine() [1/3]

template<>
bool TTTrackAssociationMap< Ref_Phase2TrackerDigi_ >::isGenuine ( edm::Ptr< TTTrack< Ref_Phase2TrackerDigi_ > >  aTrack) const

MC truth.

Check if there is a TrackingParticle

Get all the stubs from this TrackingParticle

We want that all the stubs of the track are included in the container of all the stubs produced by this particular TrackingParticle which we already know is one of the TrackingParticles that released hits in this track we are evaluating right now Now modifying to allow one and only one false 2S stub in the track idr 06/19

Definition at line 49 of file TTTrackAssociationMap.cc.

49  {
51  if ((this->findTrackingParticlePtr(aTrack)).isNull())
52  return false;
53 
55  std::vector<edm::Ref<edmNew::DetSetVector<TTStub<Ref_Phase2TrackerDigi_> >, TTStub<Ref_Phase2TrackerDigi_> > >
57  std::vector<edm::Ref<edmNew::DetSetVector<TTStub<Ref_Phase2TrackerDigi_> >, TTStub<Ref_Phase2TrackerDigi_> > >
58  TRK_Stubs = aTrack->getStubRefs();
59 
60  bool one2SStub = false;
61  for (unsigned int js = 0; js < TRK_Stubs.size(); js++) {
67  if (std::find(TP_Stubs.begin(), TP_Stubs.end(), TRK_Stubs.at(js)) == TP_Stubs.end()) {
68  if (!AllowOneFalse2SStub || TRK_Stubs.at(js)->moduleTypePS() || one2SStub) // Has to be first false 2S stub
69  {
70  return false;
71  } else {
72  one2SStub = true;
73  }
74  }
75  }
76 
77  return true;
78 }

References spr::find().

◆ isGenuine() [2/3]

template<>
bool TTTrackAssociationMap< Ref_Phase2TrackerDigi_ >::isGenuine ( edm::Ptr< TTTrack< Ref_Phase2TrackerDigi_ > >  aTrack) const

MC truth.

◆ isGenuine() [3/3]

template<typename T >
bool TTTrackAssociationMap< T >::isGenuine ( edm::Ptr< TTTrack< T > >  aTrack) const

MC Truth methods.

◆ isLooselyGenuine() [1/3]

template<>
bool TTTrackAssociationMap< Ref_Phase2TrackerDigi_ >::isLooselyGenuine ( edm::Ptr< TTTrack< Ref_Phase2TrackerDigi_ > >  aTrack) const

MC truth.

Check if there is a TrackingParticle

Definition at line 38 of file TTTrackAssociationMap.cc.

39  {
41  if ((this->findTrackingParticlePtr(aTrack)).isNull())
42  return false;
43 
44  return true;
45 }

◆ isLooselyGenuine() [2/3]

template<>
bool TTTrackAssociationMap< Ref_Phase2TrackerDigi_ >::isLooselyGenuine ( edm::Ptr< TTTrack< Ref_Phase2TrackerDigi_ > >  aTrack) const

MC truth.

◆ isLooselyGenuine() [3/3]

template<typename T >
bool TTTrackAssociationMap< T >::isLooselyGenuine ( edm::Ptr< TTTrack< T > >  aTrack) const

◆ isUnknown() [1/3]

template<>
bool TTTrackAssociationMap< Ref_Phase2TrackerDigi_ >::isUnknown ( edm::Ptr< TTTrack< Ref_Phase2TrackerDigi_ > >  aTrack) const

UNKNOWN means that more than 2 stubs are unknown

Definition at line 94 of file TTTrackAssociationMap.cc.

94  {
96  int unknownstubs = 0;
97 
98  std::vector<edm::Ref<edmNew::DetSetVector<TTStub<Ref_Phase2TrackerDigi_> >, TTStub<Ref_Phase2TrackerDigi_> > >
99  theseStubs = aTrack->getStubRefs();
100  for (unsigned int i = 0; i < theseStubs.size(); i++) {
101  if (theStubAssociationMap->isUnknown(theseStubs.at(i)) == false) {
102  ++unknownstubs;
103  if (unknownstubs >= 2)
104  return false;
105  }
106  }
107 
108  return true;
109 }

References mps_fire::i.

◆ isUnknown() [2/3]

template<>
bool TTTrackAssociationMap< Ref_Phase2TrackerDigi_ >::isUnknown ( edm::Ptr< TTTrack< Ref_Phase2TrackerDigi_ > >  aTrack) const

◆ isUnknown() [3/3]

template<typename T >
bool TTTrackAssociationMap< T >::isUnknown ( edm::Ptr< TTTrack< T > >  aTrack) const

◆ setAllowOneFalse2SStub() [1/2]

template<typename T >
void TTTrackAssociationMap< T >::setAllowOneFalse2SStub ( bool  allowFalse2SStub)

◆ setAllowOneFalse2SStub() [2/2]

template<>
void TTTrackAssociationMap< Ref_Phase2TrackerDigi_ >::setAllowOneFalse2SStub ( bool  allowFalse2SStub)

Definition at line 112 of file TTTrackAssociationMap.cc.

112  {
113  AllowOneFalse2SStub = allowFalse2SStub;
114 }

◆ setTrackingParticleToTTTracksMap()

template<typename T >
void TTTrackAssociationMap< T >::setTrackingParticleToTTTracksMap ( std::map< edm::Ptr< TrackingParticle >, std::vector< edm::Ptr< TTTrack< T > > > >  aMap)
inline

◆ setTTStubAssociationMap()

template<typename T >
void TTTrackAssociationMap< T >::setTTStubAssociationMap ( edm::RefProd< TTStubAssociationMap< T > >  aStubAssoMap)
inline

Definition at line 60 of file TTTrackAssociationMap.h.

60  {
61  theStubAssociationMap = aStubAssoMap;
62  }

References TTTrackAssociationMap< T >::theStubAssociationMap.

◆ setTTTrackToTrackingParticleMap()

template<typename T >
void TTTrackAssociationMap< T >::setTTTrackToTrackingParticleMap ( std::map< edm::Ptr< TTTrack< T > >, edm::Ptr< TrackingParticle > >  aMap)
inline

Definition at line 53 of file TTTrackAssociationMap.h.

53  {
55  }

References TTTrackAssociationMap< T >::trackToTrackingParticleMap.

Member Data Documentation

◆ AllowOneFalse2SStub

template<typename T >
bool TTTrackAssociationMap< T >::AllowOneFalse2SStub
private

Definition at line 83 of file TTTrackAssociationMap.h.

◆ theStubAssociationMap

template<typename T >
edm::RefProd<TTStubAssociationMap<T> > TTTrackAssociationMap< T >::theStubAssociationMap
private

◆ trackingParticleToTrackVectorMap

template<typename T >
std::map<edm::Ptr<TrackingParticle>, std::vector<edm::Ptr<TTTrack<T> > > > TTTrackAssociationMap< T >::trackingParticleToTrackVectorMap
private

◆ trackToTrackingParticleMap

template<typename T >
std::map<edm::Ptr<TTTrack<T> >, edm::Ptr<TrackingParticle> > TTTrackAssociationMap< T >::trackToTrackingParticleMap
private
mps_fire.i
i
Definition: mps_fire.py:355
TTTrackAssociationMap::trackToTrackingParticleMap
std::map< edm::Ptr< TTTrack< T > >, edm::Ptr< TrackingParticle > > trackToTrackingParticleMap
Data members.
Definition: TTTrackAssociationMap.h:79
TTTrackAssociationMap::trackingParticleToTrackVectorMap
std::map< edm::Ptr< TrackingParticle >, std::vector< edm::Ptr< TTTrack< T > > > > trackingParticleToTrackVectorMap
Definition: TTTrackAssociationMap.h:80
TTTrackAssociationMap::isLooselyGenuine
bool isLooselyGenuine(edm::Ptr< TTTrack< T > > aTrack) const
TTTrackAssociationMap::AllowOneFalse2SStub
bool AllowOneFalse2SStub
Definition: TTTrackAssociationMap.h:83
spr::find
void find(edm::Handle< EcalRecHitCollection > &hits, DetId thisDet, std::vector< EcalRecHitCollection::const_iterator > &hit, bool debug=false)
Definition: FindCaloHit.cc:19
groupFilesInBlocks.temp
list temp
Definition: groupFilesInBlocks.py:142
TTStubAssociationMap::findTTStubRefs
std::vector< edm::Ref< edmNew::DetSetVector< TTStub< T > >, TTStub< T > > > findTTStubRefs(edm::Ptr< TrackingParticle > aTrackingParticle) const
Definition: TTStubAssociationMap.h:125
TTTrackAssociationMap::findTrackingParticlePtr
edm::Ptr< TrackingParticle > findTrackingParticlePtr(edm::Ptr< TTTrack< T > > aTrack) const
Operations.
TTStub
Class to store the L1 Track Trigger stubs.
Definition: TTStub.h:22
TTTrackAssociationMap::isUnknown
bool isUnknown(edm::Ptr< TTTrack< T > > aTrack) const
edm::Ptr< TrackingParticle >
TTStubAssociationMap::isUnknown
bool isUnknown(edm::Ref< edmNew::DetSetVector< TTStub< T > >, TTStub< T > > aStub) const
Definition: TTStubAssociationMap.h:159
TTTrackAssociationMap::theStubAssociationMap
edm::RefProd< TTStubAssociationMap< T > > theStubAssociationMap
Definition: TTTrackAssociationMap.h:81