|
reco::RecoToSimCollection | associateRecoToSim (const edm::RefToBaseVector< reco::Track > &, const edm::RefVector< TrackingParticleCollection > &) const override |
| Association Reco To Sim with Collections. More...
|
|
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 More...
|
|
reco::SimToRecoCollection | associateSimToReco (const edm::RefToBaseVector< reco::Track > &, const edm::RefVector< TrackingParticleCollection > &) const override |
| Association Sim To Reco with Collections. More...
|
|
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 More...
|
|
| TrackAssociatorByChi2Impl (edm::EDProductGetter const &productGetter, const MagneticField &mF, const reco::BeamSpot &bs, double chi2Cut, bool onlyDiag) |
| Constructor. More...
|
|
Public Member Functions inherited from reco::TrackToTrackingParticleAssociatorBaseImpl |
virtual reco::RecoToSimCollection | associateRecoToSim (const edm::Handle< edm::View< reco::Track >> &tCH, const edm::Handle< TrackingParticleCollection > &tPCH) const |
|
virtual
reco::RecoToSimCollectionSeed | associateRecoToSim (const edm::Handle< edm::View< TrajectorySeed >> &, const edm::Handle< TrackingParticleCollection > &) const |
|
virtual
reco::RecoToSimCollectionTCandidate | associateRecoToSim (const edm::Handle< TrackCandidateCollection > &, const edm::Handle< TrackingParticleCollection > &) const |
|
virtual reco::SimToRecoCollection | associateSimToReco (const edm::Handle< edm::View< reco::Track >> &tCH, const edm::Handle< TrackingParticleCollection > &tPCH) const |
|
virtual
reco::SimToRecoCollectionSeed | associateSimToReco (const edm::Handle< edm::View< TrajectorySeed >> &, const edm::Handle< TrackingParticleCollection > &) const |
|
virtual
reco::SimToRecoCollectionTCandidate | associateSimToReco (const edm::Handle< TrackCandidateCollection > &, const edm::Handle< TrackingParticleCollection > &) const |
|
| TrackToTrackingParticleAssociatorBaseImpl () |
| Constructor. More...
|
|
virtual | ~TrackToTrackingParticleAssociatorBaseImpl () |
| Destructor. More...
|
|
Class that performs the association of reco::Tracks and TrackingParticles evaluating the chi2 of reco tracks parameters and sim tracks parameters. The cut can be tuned from the config file: see data/TrackAssociatorByChi2.cfi. Note that the Association Map is filled with -ch2 and not chi2 because it is ordered using std::greater: the track with the lowest association chi2 will be the first in the output map.It is possible to use only diagonal terms (associator by pulls) seeting onlyDiagonal = true in the PSet
- Author
- cerati, magni
Definition at line 38 of file TrackAssociatorByChi2Impl.h.
Association Reco To Sim with Collections.
Implements reco::TrackToTrackingParticleAssociatorBaseImpl.
Definition at line 14 of file TrackAssociatorByChi2Impl.cc.
References edm::RefToBaseVector< T >::begin(), cms::cuda::bs, RecoTauCleanerPlugins::charge, HLT_FULL_cff::chi2, edm::RefToBaseVector< T >::end(), edm::first(), mps_fire::i, edm::AssociationMap< Tag >::insert(), dqmiolumiharvest::j, LogDebug, edm::AssociationMap< Tag >::post_insert(), hcal_runs::rt, edm::second(), edm::RefVector< C, T, F >::size(), cmsswSequenceInfo::tp, track_associator::trackAssociationChi2(), and reco::trackingParametersAtClosestApproachToBeamSpot().
21 std::vector<TrackingParticle const*> tPC;
22 std::vector<std::pair<bool, TrackBase::ParameterVector>> tpParams;
23 tPC.reserve(tPCH.
size());
24 tpParams.reserve(tPCH.
size());
25 for (
auto const& ref : tPCH) {
26 auto const&
tp = *ref;
34 tpParams.emplace_back(
41 LogDebug(
"TrackAssociator") <<
"=========LOOKING FOR ASSOCIATION==========="
43 <<
"rec::Track #" << tindex <<
" with pt=" << (*rt)->pt() <<
"\n"
44 <<
"==========================================="
51 for (
unsigned int i = 0;
i < 5;
i++) {
52 for (
unsigned int j = 0;
j < 5;
j++) {
54 recoTrackCovMatrix(
i,
j) = 0;
59 recoTrackCovMatrix.Invert();
62 for (
auto tp = tPC.begin();
tp != tPC.end();
tp++, ++tpindex) {
65 if (!tpParams[tpindex].
first)
72 outputCollection.insert(tC[tindex], std::make_pair(tPCH[tpindex], -chi2));
76 outputCollection.post_insert();
77 return outputCollection;
edm::EDProductGetter const * productGetter_
const_iterator end() const
math::Vector< dimension >::type ParameterVector
parameter vector
U second(std::pair< T, U > const &p)
const MagneticField * mF_
std::pair< bool, reco::TrackBase::ParameterVector > trackingParametersAtClosestApproachToBeamSpot(const Basic3DVector< double > &vertex, const Basic3DVector< double > &momAtVtx, float charge, const MagneticField &magField, const BeamSpot &bs)
const_iterator begin() const
size_type size() const
Size of the RefVector.
double trackAssociationChi2(const reco::TrackBase::ParameterVector &rParameters, const reco::TrackBase::CovarianceMatrix &recoTrackCovMatrix, const reco::TrackBase::ParameterVector &sParameters)
basic method where chi2 is computed
math::Error< dimension >::type CovarianceMatrix
5 parameter covariance matrix
const reco::BeamSpot * beamSpot_
Association Sim To Reco with Collections.
Implements reco::TrackToTrackingParticleAssociatorBaseImpl.
Definition at line 80 of file TrackAssociatorByChi2Impl.cc.
References edm::RefVector< C, T, F >::begin(), cms::cuda::bs, RecoTauCleanerPlugins::charge, HLT_FULL_cff::chi2, edm::RefVector< C, T, F >::end(), mps_fire::i, edm::AssociationMap< Tag >::insert(), dqmiolumiharvest::j, LogDebug, edm::AssociationMap< Tag >::post_insert(), edm::RefToBaseVector< T >::size(), mathSSE::sqrt(), cmsswSequenceInfo::tp, track_associator::trackAssociationChi2(), and reco::trackingParametersAtClosestApproachToBeamSpot().
87 std::vector<TrackBase::ParameterVector> tPars;
88 tPars.reserve(tC.
size());
89 std::vector<TrackBase::CovarianceMatrix> tCovs;
90 tCovs.reserve(tC.
size());
91 for (
auto const& ref : tC) {
92 auto const& aTk = *ref;
93 tPars.emplace_back(aTk.parameters());
97 for (
unsigned int i = 0;
i < 5;
i++) {
98 for (
unsigned int j = 0;
j < 5;
j++) {
100 recoTrackCovMatrix(
i,
j) = 0;
104 recoTrackCovMatrix.Invert();
105 tCovs.emplace_back(recoTrackCovMatrix);
112 auto const& aTP = **
tp;
113 int charge = aTP.charge();
117 LogDebug(
"TrackAssociator") <<
"=========LOOKING FOR ASSOCIATION==========="
119 <<
"TrackingParticle #" << tpindex <<
" with pt=" <<
sqrt(aTP.momentum().perp2())
121 <<
"==========================================="
125 auto const tpBoolParams =
127 if (!tpBoolParams.first)
130 for (
unsigned int tindex = 0; tindex < tC.size(); tindex++) {
138 outputCollection.insert(*
tp, std::make_pair(tC[tindex], -chi2));
142 outputCollection.post_insert();
143 return outputCollection;
edm::EDProductGetter const * productGetter_
math::Vector< dimension >::type ParameterVector
parameter vector
const_iterator end() const
Termination of iteration.
const_iterator begin() const
Initialize an iterator over the RefVector.
const MagneticField * mF_
std::pair< bool, reco::TrackBase::ParameterVector > trackingParametersAtClosestApproachToBeamSpot(const Basic3DVector< double > &vertex, const Basic3DVector< double > &momAtVtx, float charge, const MagneticField &magField, const BeamSpot &bs)
double trackAssociationChi2(const reco::TrackBase::ParameterVector &rParameters, const reco::TrackBase::CovarianceMatrix &recoTrackCovMatrix, const reco::TrackBase::ParameterVector &sParameters)
basic method where chi2 is computed
math::Error< dimension >::type CovarianceMatrix
5 parameter covariance matrix
const reco::BeamSpot * beamSpot_