File indexing completed on 2024-08-09 23:47:42
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015
0016
0017
0018 #ifndef SimDataFormats_Associations_TTTrackAssociationMap_h
0019 #define SimDataFormats_Associations_TTTrackAssociationMap_h
0020
0021 #include "DataFormats/Common/interface/Ref.h"
0022 #include "DataFormats/Common/interface/Ptr.h"
0023 #include "DataFormats/L1TrackTrigger/interface/TTTypes.h"
0024 #include "SimDataFormats/TrackingAnalysis/interface/TrackingParticleFwd.h"
0025 #include "DataFormats/Common/interface/DetSet.h"
0026 #include "DataFormats/Common/interface/DetSetVector.h"
0027 #include "DataFormats/Common/interface/DetSetVectorNew.h"
0028 #include "DataFormats/DetId/interface/DetId.h"
0029 #include "DataFormats/Phase2TrackerDigi/interface/Phase2TrackerDigi.h"
0030 #include "DataFormats/GeometryCommonDetAlgo/interface/MeasurementPoint.h"
0031 #include "DataFormats/GeometryVector/interface/GlobalPoint.h" /// NOTE: this is needed even if it seems not
0032 #include "SimDataFormats/Track/interface/SimTrack.h"
0033 #include "SimDataFormats/Track/interface/SimTrackContainer.h"
0034 #include "SimDataFormats/EncodedEventId/interface/EncodedEventId.h"
0035 #include "SimDataFormats/TrackingAnalysis/interface/TrackingParticle.h"
0036 #include "SimDataFormats/Associations/interface/TTStubAssociationMap.h"
0037
0038
0039 template <typename T>
0040 using MapL1TrackToTP = std::map<TTTrackPtrT<T>, TrackingParticlePtr>;
0041 template <typename T>
0042 using MapTPToVecL1Track = std::map<TrackingParticlePtr, std::vector<TTTrackPtrT<T>>>;
0043
0044 template <typename T>
0045 class TTTrackAssociationMap {
0046 public:
0047
0048 TTTrackAssociationMap();
0049
0050
0051 ~TTTrackAssociationMap();
0052
0053
0054
0055 const MapL1TrackToTP<T>& getTTTrackToTrackingParticleMap() const { return trackToTrackingParticleMap_; }
0056 const MapTPToVecL1Track<T>& getTrackingParticleToTTTracksMap() const { return trackingParticleToTrackVectorMap_; }
0057
0058 void setTTTrackToTrackingParticleMap(const MapL1TrackToTP<T>& aMap) { trackToTrackingParticleMap_ = aMap; }
0059 void setTrackingParticleToTTTracksMap(const MapTPToVecL1Track<T>& aMap) { trackingParticleToTrackVectorMap_ = aMap; }
0060
0061
0062 void setTTStubAssociationMap(edm::RefProd<TTStubAssociationMap<T>> aStubAssoMap) {
0063 theStubAssociationMap_ = aStubAssoMap;
0064 }
0065
0066
0067
0068 const TrackingParticlePtr& findTrackingParticlePtr(TTTrackPtrT<T> aTrack) const;
0069
0070
0071
0072
0073 const std::vector<TTTrackPtrT<T>>& findTTTrackPtrs(TrackingParticlePtr aTrackingParticle) const;
0074
0075
0076
0077
0078
0079
0080
0081
0082
0083
0084
0085
0086 bool isGenuine(TTTrackPtrT<T> aTrack) const;
0087
0088
0089 bool isLooselyGenuine(TTTrackPtrT<T> aTrack) const;
0090
0091 bool isUnknown(TTTrackPtrT<T> aTrack) const;
0092
0093 bool isCombinatoric(TTTrackPtrT<T> aTrack) const;
0094
0095
0096 void setAllowOneFalse2SStub(bool allowFalse2SStub);
0097 bool getAllowOneFalse2SStub();
0098
0099 private:
0100
0101 MapL1TrackToTP<T> trackToTrackingParticleMap_;
0102 MapTPToVecL1Track<T> trackingParticleToTrackVectorMap_;
0103 edm::RefProd<TTStubAssociationMap<T>> theStubAssociationMap_;
0104
0105 bool AllowOneFalse2SStub;
0106
0107
0108 static const TrackingParticlePtr nullTrackingParticlePtr_;
0109 static const std::vector<TTTrackPtr> nullVecTTTrackPtr_;
0110
0111 };
0112
0113
0114
0115
0116
0117
0118
0119
0120
0121 template <typename T>
0122 const TrackingParticlePtr TTTrackAssociationMap<T>::nullTrackingParticlePtr_;
0123 template <typename T>
0124 const std::vector<TTTrackPtr> TTTrackAssociationMap<T>::nullVecTTTrackPtr_;
0125
0126
0127
0128 template <typename T>
0129 TTTrackAssociationMap<T>::TTTrackAssociationMap() {
0130
0131 }
0132
0133
0134 template <typename T>
0135 TTTrackAssociationMap<T>::~TTTrackAssociationMap() {}
0136
0137
0138 template <>
0139 const TrackingParticlePtr& TTTrackAssociationMap<Ref_Phase2TrackerDigi_>::findTrackingParticlePtr(
0140 TTTrackPtr aTrack) const;
0141
0142 template <>
0143 const std::vector<TTTrackPtr>& TTTrackAssociationMap<Ref_Phase2TrackerDigi_>::findTTTrackPtrs(
0144 TrackingParticlePtr aTrackingParticle) const;
0145
0146
0147 template <>
0148 bool TTTrackAssociationMap<Ref_Phase2TrackerDigi_>::isLooselyGenuine(TTTrackPtr aTrack) const;
0149
0150
0151 template <>
0152 bool TTTrackAssociationMap<Ref_Phase2TrackerDigi_>::isGenuine(TTTrackPtr aTrack) const;
0153
0154 template <>
0155 bool TTTrackAssociationMap<Ref_Phase2TrackerDigi_>::isCombinatoric(TTTrackPtr aTrack) const;
0156
0157 template <>
0158 bool TTTrackAssociationMap<Ref_Phase2TrackerDigi_>::isUnknown(TTTrackPtr aTrack) const;
0159
0160 #endif