28 std::vector<GenParticle const*> tPC;
29 tPC.reserve(tPCH.
size());
30 for(
auto const& ref: tPCH) {
31 tPC.push_back(&(*ref));
37 LogDebug(
"TrackAssociator") <<
"=========LOOKING FOR ASSOCIATION===========" <<
"\n"
38 <<
"rec::Track #"<<tindex<<
" with pt=" << (*rt)->pt() <<
"\n"
39 <<
"===========================================" <<
"\n";
45 for (
unsigned int i=0;
i<5;
i++){
46 for (
unsigned int j=0;
j<5;
j++){
47 if (
i!=
j) recoTrackCovMatrix(
i,
j)=0;
52 recoTrackCovMatrix.Invert();
55 for (
auto tp=tPC.begin(); tp!=tPC.end(); tp++, ++tpindex){
59 int charge = (*tp)->charge();
60 if (charge==0)
continue;
64 double chi2 =
getChi2(rParameters,recoTrackCovMatrix,momAtVtx,vert,charge,bs);
68 outputCollection.
insert(tC[tindex],
69 std::make_pair(tPCH[tpindex],
75 return outputCollection;
86 for (
auto tp=tPCH.
begin(); tp!=tPCH.
end(); tp++, ++tpindex){
90 int charge = (*tp)->charge();
91 if (charge==0)
continue;
93 LogDebug(
"TrackAssociator") <<
"=========LOOKING FOR ASSOCIATION===========" <<
"\n"
94 <<
"TrackingParticle #"<<tpindex<<
" with pt=" <<
sqrt((*tp)->momentum().perp2()) <<
"\n"
95 <<
"===========================================" <<
"\n";
106 for (
unsigned int i=0;
i<5;
i++){
107 for (
unsigned int j=0;
j<5;
j++){
108 if (
i!=
j) recoTrackCovMatrix(
i,
j)=0;
112 recoTrackCovMatrix.Invert();
114 double chi2 =
getChi2(rParameters,recoTrackCovMatrix,momAtVtx,vert,charge,bs);
117 outputCollection.
insert(*tp,
118 std::make_pair(tC[tindex],
124 return outputCollection;
double getChi2(const reco::TrackBase::ParameterVector &rParameters, const reco::TrackBase::CovarianceMatrix &recoTrackCovMatrix, const Basic3DVector< double > &momAtVtx, const Basic3DVector< double > &vert, int charge, const MagneticField &magfield, const reco::BeamSpot &bs)
basic method where chi2 is computed
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
const_iterator end() const
math::Vector< dimension >::type ParameterVector
parameter vector
const_iterator end() const
Termination of iteration.
const_iterator begin() const
Initialize an iterator over the RefVector.
void post_insert()
post insert action
reco::GenToRecoCollection associateGenToReco(const edm::RefToBaseVector< reco::Track > &, const edm::RefVector< reco::GenParticleCollection > &) const override
Association Sim To Reco with Collections (Gen Particle version)
void insert(const key_type &k, const data_type &v)
insert an association
const_iterator begin() const
reco::RecoToGenCollection associateRecoToGen(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.
math::Error< dimension >::type CovarianceMatrix
5 parameter covariance matrix