28 std::vector<GenParticle const*> tPC;
29 tPC.reserve(tPCH.
size());
30 for (
auto const& ref : tPCH) {
31 tPC.push_back(&(*ref));
36 LogDebug(
"TrackAssociator") <<
"=========LOOKING FOR ASSOCIATION===========" 38 <<
"rec::Track #" << tindex <<
" with pt=" << (*rt)->pt() <<
"\n" 39 <<
"===========================================" 46 for (
unsigned int i = 0;
i < 5;
i++) {
47 for (
unsigned int j = 0;
j < 5;
j++) {
49 recoTrackCovMatrix(
i,
j) = 0;
54 recoTrackCovMatrix.Invert();
57 for (
auto tp = tPC.begin();
tp != tPC.end();
tp++, ++tpindex) {
60 int charge = (*tp)->charge();
66 double chi2 = getChi2(rParameters, recoTrackCovMatrix, momAtVtx, vert,
charge,
bs);
72 std::make_pair(tPCH[tpindex],
78 return outputCollection;
91 int charge = (*tp)->charge();
95 LogDebug(
"TrackAssociator") <<
"=========LOOKING FOR ASSOCIATION===========" 97 <<
"TrackingParticle #" << tpindex <<
" with pt=" <<
sqrt((*tp)->momentum().perp2())
99 <<
"===========================================" 110 for (
unsigned int i = 0;
i < 5;
i++) {
111 for (
unsigned int j = 0;
j < 5;
j++) {
113 recoTrackCovMatrix(
i,
j) = 0;
117 recoTrackCovMatrix.Invert();
119 double chi2 = getChi2(rParameters, recoTrackCovMatrix, momAtVtx, vert,
charge,
bs);
124 std::make_pair(tC[tindex],
130 return outputCollection;
math::Vector< dimension >::type ParameterVector
parameter vector
const_iterator begin() const
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
void post_insert()
post insert action
const_iterator end() const
reco::GenToRecoCollection associateGenToReco(const edm::RefToBaseVector< reco::Track > &, const edm::RefVector< reco::GenParticleCollection > &) const override
Association Sim To Reco with Collections (Gen Particle version)
size_type size() const
Size of the RefVector.
void insert(const key_type &k, const data_type &v)
insert an association
const_iterator end() const
Termination of iteration.
reco::RecoToGenCollection associateRecoToGen(const edm::RefToBaseVector< reco::Track > &, const edm::RefVector< reco::GenParticleCollection > &) const override
Association Sim To Reco with Collections (Gen Particle version)
const_iterator begin() const
Initialize an iterator over 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