CMS 3D CMS Logo

TrackAssociatorByChi2Impl.h
Go to the documentation of this file.
1 #ifndef TrackAssociatorByChi2Impl_h
2 #define TrackAssociatorByChi2Impl_h
3 
19 
20 #include <map>
21 
22 //Note that the Association Map is filled with -ch2 and not chi2 because it is ordered using std::greater:
23 //the track with the lowest association chi2 will be the first in the output map.
24 
25 namespace edm {
26  class EDProductGetter;
27 }
28 
29 namespace reco {
30  typedef edm::AssociationMap<
33  typedef edm::AssociationMap<
36 } // namespace reco
37 
39 public:
40  typedef std::map<double, SimTrack> Chi2SimMap;
41  typedef std::pair<reco::Track, Chi2SimMap> RecoToSimPair;
42  typedef std::vector<RecoToSimPair> RecoToSimPairAssociation;
43 
44  /*
46  TrackAssociatorByChi2Impl(const edm::ESHandle<MagneticField> mF, const edm::ParameterSet& conf):
47  chi2cut(conf.getParameter<double>("chi2cut")),
48  onlyDiagonal(conf.getParameter<bool>("onlyDiagonal")),
49  bsSrc(conf.getParameter<edm::InputTag>("beamSpot")) {
50  mF_=mF;
51  if (onlyDiagonal)
52  edm::LogInfo("TrackAssociator") << " ---- Using Off Diagonal Covariance Terms = 0 ---- " << "\n";
53  else
54  edm::LogInfo("TrackAssociator") << " ---- Using Off Diagonal Covariance Terms != 0 ---- " << "\n";
55  }
56  */
57 
60  const MagneticField& mF,
61  const reco::BeamSpot& bs,
62  double chi2Cut,
63  bool onlyDiag)
65 
67 
69  const edm::RefVector<TrackingParticleCollection>&) const override;
71 
73  const edm::RefVector<TrackingParticleCollection>&) const override;
74 
76 
78  const edm::Handle<TrackingParticleCollection>& tPCH) const override {
79  return TrackToTrackingParticleAssociatorBaseImpl::associateRecoToSim(tCH, tPCH);
80  }
81 
83 
85  const edm::Handle<TrackingParticleCollection>& tPCH) const override {
86  return TrackToTrackingParticleAssociatorBaseImpl::associateSimToReco(tCH, tPCH);
87  }
88 
89 private:
93  double chi2cut_;
95 };
96 
97 #endif
TrackToTrackingParticleAssociatorBaseImpl.h
MessageLogger.h
TrackAssociatorByChi2Impl::associateRecoToSim
reco::RecoToSimCollection associateRecoToSim(const edm::RefToBaseVector< reco::Track > &, const edm::RefVector< TrackingParticleCollection > &) const override
Association Reco To Sim with Collections.
Definition: TrackAssociatorByChi2Impl.cc:14
edm
HLT enums.
Definition: AlignableModifier.h:19
TrackAssociatorByChi2Impl::RecoToSimPairAssociation
std::vector< RecoToSimPair > RecoToSimPairAssociation
Definition: TrackAssociatorByChi2Impl.h:42
TrackAssociatorByChi2Impl::TrackAssociatorByChi2Impl
TrackAssociatorByChi2Impl(edm::EDProductGetter const &productGetter, const MagneticField &mF, const reco::BeamSpot &bs, double chi2Cut, bool onlyDiag)
Constructor.
Definition: TrackAssociatorByChi2Impl.h:59
reco::GenParticleCollection
std::vector< GenParticle > GenParticleCollection
collection of GenParticles
Definition: GenParticleFwd.h:13
edm::RefVector< TrackingParticleCollection >
TrackAssociatorByChi2Impl::productGetter_
edm::EDProductGetter const * productGetter_
Definition: TrackAssociatorByChi2Impl.h:90
reco
fixed size matrix
Definition: AlignmentAlgorithmBase.h:46
edm::Handle
Definition: AssociativeIterator.h:50
TrackAssociatorByChi2Impl::mF_
const MagneticField * mF_
Definition: TrackAssociatorByChi2Impl.h:91
GenParticle.h
edm::EDProductGetter
Definition: EDProductGetter.h:41
cms::cuda::bs
bs
Definition: HistoContainer.h:76
TrackAssociatorByChi2Impl::RecoToSimPair
std::pair< reco::Track, Chi2SimMap > RecoToSimPair
Definition: TrackAssociatorByChi2Impl.h:41
BeamSpot.h
reco::TrackToTrackingParticleAssociatorBaseImpl
Definition: TrackToTrackingParticleAssociatorBaseImpl.h:33
TrackAssociatorByChi2Impl
Definition: TrackAssociatorByChi2Impl.h:38
TrackAssociatorByChi2Impl::associateSimToReco
reco::SimToRecoCollection associateSimToReco(const edm::Handle< edm::View< reco::Track > > &tCH, const edm::Handle< TrackingParticleCollection > &tPCH) const override
compare reco to sim the handle of reco::Track and TrackingParticle collections
Definition: TrackAssociatorByChi2Impl.h:84
GenParticleFwd.h
reco::BeamSpot
Definition: BeamSpot.h:21
TrackAssociatorByChi2Impl::associateSimToReco
reco::SimToRecoCollection associateSimToReco(const edm::RefToBaseVector< reco::Track > &, const edm::RefVector< TrackingParticleCollection > &) const override
Association Sim To Reco with Collections.
Definition: TrackAssociatorByChi2Impl.cc:80
TrackAssociatorByChi2Impl::associateRecoToSim
reco::RecoToSimCollection associateRecoToSim(const edm::Handle< edm::View< reco::Track > > &tCH, const edm::Handle< TrackingParticleCollection > &tPCH) const override
compare reco to sim the handle of reco::Track and TrackingParticle collections
Definition: TrackAssociatorByChi2Impl.h:77
edm::View
Definition: CaloClusterFwd.h:14
EDProductGetter
edm::AssociationMap
Definition: AssociationMap.h:48
TrackAssociatorByChi2Impl::onlyDiagonal_
bool onlyDiagonal_
Definition: TrackAssociatorByChi2Impl.h:94
LorentzVector.h
edm::refcoreimpl::productGetter
EDProductGetter const * productGetter(std::atomic< void const * > const &iCache)
Definition: refcore_implementation.h:72
MagneticField.h
edm::RefToBaseVector< reco::Track >
edm::OneToManyWithQualityGeneric
Definition: OneToManyWithQualityGeneric.h:21
TrackAssociatorByChi2Impl::chi2cut_
double chi2cut_
Definition: TrackAssociatorByChi2Impl.h:93
PixelTripletNoTipGenerator_cfi.chi2Cut
chi2Cut
Definition: PixelTripletNoTipGenerator_cfi.py:10
reco::GenToRecoCollection
edm::AssociationMap< edm::OneToManyWithQualityGeneric< reco::GenParticleCollection, edm::View< reco::Track >, double > > GenToRecoCollection
Definition: TrackToGenParticleAssociator.h:29
TrackAssociatorByChi2Impl::beamSpot_
const reco::BeamSpot * beamSpot_
Definition: TrackAssociatorByChi2Impl.h:92
reco::RecoToGenCollection
edm::AssociationMap< edm::OneToManyWithQualityGeneric< edm::View< reco::Track >, reco::GenParticleCollection, double > > RecoToGenCollection
Definition: TrackToGenParticleAssociator.h:32
MagneticField
Definition: MagneticField.h:19
TrackAssociatorByChi2Impl::Chi2SimMap
std::map< double, SimTrack > Chi2SimMap
Definition: TrackAssociatorByChi2Impl.h:40
SimTrackContainer.h
SimVertexContainer.h