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 reco {
26  typedef edm::AssociationMap<
29  typedef edm::AssociationMap<
32 } // namespace reco
33 
35 public:
36  typedef std::map<double, SimTrack> Chi2SimMap;
37  typedef std::pair<reco::Track, Chi2SimMap> RecoToSimPair;
38  typedef std::vector<RecoToSimPair> RecoToSimPairAssociation;
39 
40  /*
42  TrackAssociatorByChi2Impl(const edm::ESHandle<MagneticField> mF, const edm::ParameterSet& conf):
43  chi2cut(conf.getParameter<double>("chi2cut")),
44  onlyDiagonal(conf.getParameter<bool>("onlyDiagonal")),
45  bsSrc(conf.getParameter<edm::InputTag>("beamSpot")) {
46  theMF=mF;
47  if (onlyDiagonal)
48  edm::LogInfo("TrackAssociator") << " ---- Using Off Diagonal Covariance Terms = 0 ---- " << "\n";
49  else
50  edm::LogInfo("TrackAssociator") << " ---- Using Off Diagonal Covariance Terms != 0 ---- " << "\n";
51  }
52  */
53 
55  TrackAssociatorByChi2Impl(const MagneticField& mF, const reco::BeamSpot& bs, double chi2Cut, bool onlyDiag)
56  : theMF(&mF), theBeamSpot(&bs), chi2cut(chi2Cut), onlyDiagonal(onlyDiag) {}
57 
59 
61  const edm::RefVector<TrackingParticleCollection>&) const override;
63 
65  const edm::RefVector<TrackingParticleCollection>&) const override;
66 
68 
70  const edm::Handle<TrackingParticleCollection>& tPCH) const override {
71  return TrackToTrackingParticleAssociatorBaseImpl::associateRecoToSim(tCH, tPCH);
72  }
73 
75 
77  const edm::Handle<TrackingParticleCollection>& tPCH) const override {
78  return TrackToTrackingParticleAssociatorBaseImpl::associateSimToReco(tCH, tPCH);
79  }
80 
81 private:
83  double getChi2(const reco::TrackBase::ParameterVector& rParameters,
84  const reco::TrackBase::CovarianceMatrix& recoTrackCovMatrix,
85  const Basic3DVector<double>& momAtVtx,
86  const Basic3DVector<double>& vert,
87  int charge,
88  const reco::BeamSpot&) const;
89 
92  double chi2cut;
94 };
95 
96 #endif
ZMuMuCategoriesSequences_cff.chi2Cut
chi2Cut
Definition: ZMuMuCategoriesSequences_cff.py:141
TrackToTrackingParticleAssociatorBaseImpl.h
MessageLogger.h
TrackAssociatorByChi2Impl::getChi2
double getChi2(const reco::TrackBase::ParameterVector &rParameters, const reco::TrackBase::CovarianceMatrix &recoTrackCovMatrix, const Basic3DVector< double > &momAtVtx, const Basic3DVector< double > &vert, int charge, const reco::BeamSpot &) const
basic method where chi2 is computed
Definition: TrackAssociatorByChi2Impl.cc:12
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:21
TrackAssociatorByChi2Impl::RecoToSimPairAssociation
std::vector< RecoToSimPair > RecoToSimPairAssociation
Definition: TrackAssociatorByChi2Impl.h:38
reco::GenParticleCollection
std::vector< GenParticle > GenParticleCollection
collection of GenParticles
Definition: GenParticleFwd.h:13
TrackAssociatorByChi2Impl::onlyDiagonal
bool onlyDiagonal
Definition: TrackAssociatorByChi2Impl.h:93
edm::RefVector< TrackingParticleCollection >
reco
fixed size matrix
Definition: AlignmentAlgorithmBase.h:45
edm::Handle
Definition: AssociativeIterator.h:50
GenParticle.h
cms::cuda::bs
bs
Definition: HistoContainer.h:127
TrackAssociatorByChi2Impl::RecoToSimPair
std::pair< reco::Track, Chi2SimMap > RecoToSimPair
Definition: TrackAssociatorByChi2Impl.h:37
BeamSpot.h
reco::TrackToTrackingParticleAssociatorBaseImpl
Definition: TrackToTrackingParticleAssociatorBaseImpl.h:33
TrackAssociatorByChi2Impl
Definition: TrackAssociatorByChi2Impl.h:34
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:76
GenParticleFwd.h
reco::BeamSpot
Definition: BeamSpot.h:21
reco::TrackBase::ParameterVector
math::Vector< dimension >::type ParameterVector
parameter vector
Definition: TrackBase.h:71
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:69
ALCARECOTkAlJpsiMuMu_cff.charge
charge
Definition: ALCARECOTkAlJpsiMuMu_cff.py:47
edm::View
Definition: CaloClusterFwd.h:14
edm::AssociationMap
Definition: AssociationMap.h:48
LorentzVector.h
MagneticField.h
edm::RefToBaseVector< reco::Track >
edm::OneToManyWithQualityGeneric
Definition: OneToManyWithQualityGeneric.h:21
reco::GenToRecoCollection
edm::AssociationMap< edm::OneToManyWithQualityGeneric< reco::GenParticleCollection, edm::View< reco::Track >, double > > GenToRecoCollection
Definition: TrackToGenParticleAssociator.h:29
reco::TrackBase::CovarianceMatrix
math::Error< dimension >::type CovarianceMatrix
5 parameter covariance matrix
Definition: TrackBase.h:74
TrackAssociatorByChi2Impl::chi2cut
double chi2cut
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:36
SimTrackContainer.h
SimVertexContainer.h
TrackAssociatorByChi2Impl::theMF
const MagneticField * theMF
Definition: TrackAssociatorByChi2Impl.h:90
Basic3DVector
Definition: extBasic3DVector.h:30
TrackAssociatorByChi2Impl::theBeamSpot
const reco::BeamSpot * theBeamSpot
Definition: TrackAssociatorByChi2Impl.h:91
TrackAssociatorByChi2Impl::TrackAssociatorByChi2Impl
TrackAssociatorByChi2Impl(const MagneticField &mF, const reco::BeamSpot &bs, double chi2Cut, bool onlyDiag)
Constructor.
Definition: TrackAssociatorByChi2Impl.h:55