13 SimTrackContainer::const_iterator st,
22 std::pair<bool,reco::TrackBase::ParameterVector> params = parametersAtClosestApproach(vert, momAtVtx, st->charge(), bs);
28 double chi2 = ROOT::Math::Dot(diffParameters * invertedCovariance, diffParameters);
45 for (TrackCollection::const_iterator
track=rtColl.begin();
track!=rtColl.end();
track++){
52 for (
unsigned int i=0;
i<5;
i++){
53 for (
unsigned int j=0;
j<5;
j++){
54 if (
i!=
j) recoTrackCovMatrix(
i,
j)=0;
58 recoTrackCovMatrix.Invert();
60 for (SimTrackContainer::const_iterator st=stColl.begin(); st!=stColl.end(); st++){
65 std::pair<bool,reco::TrackBase::ParameterVector> params = parametersAtClosestApproach(vert, momAtVtx, st->charge(), bs);
70 double chi2 = ROOT::Math::Dot(diffParameters * recoTrackCovMatrix, diffParameters);
72 if (chi2<chi2cut) outMap[
chi2]=*st;
82 TrackingParticleCollection::const_iterator tp,
91 for (
unsigned int i=0;
i<5;
i++){
92 for (
unsigned int j=0;
j<5;
j++){
93 if (
i!=
j) recoTrackCovMatrix(
i,
j)=0;
97 recoTrackCovMatrix.Invert();
102 std::pair<bool,reco::TrackBase::ParameterVector> params = parametersAtClosestApproach(vert, momAtVtx, tp->charge(), bs);
107 chi2 = ROOT::Math::Dot(diffParameters * recoTrackCovMatrix, diffParameters);
110 LogDebug(
"TrackAssociator") <<
"====NEW RECO TRACK WITH PT=" << rt->pt() <<
"====\n"
111 <<
"qoverp sim: " << sParameters[0] <<
"\n"
112 <<
"lambda sim: " << sParameters[1] <<
"\n"
113 <<
"phi sim: " << sParameters[2] <<
"\n"
114 <<
"dxy sim: " << sParameters[3] <<
"\n"
115 <<
"dsz sim: " << sParameters[4] <<
"\n"
117 <<
"qoverp rec: " << rt->qoverp() <<
"\n"
118 <<
"lambda rec: " << rt->lambda() <<
"\n"
119 <<
"phi rec: " << rt->phi() <<
"\n"
120 <<
"dxy rec: " << rt->dxy(bs.
position()) <<
"\n"
121 <<
"dsz rec: " << rt->dsz(bs.
position()) <<
"\n"
123 <<
"chi2: " << chi2 <<
"\n";
131 pair<bool,TrackBase::ParameterVector>
150 sParameters[2] = p.
phi();
154 return pair<bool,TrackBase::ParameterVector>(
true,sParameters);
156 return pair<bool,TrackBase::ParameterVector>(
false,sParameters);
177 LogDebug(
"TrackAssociator") <<
"=========LOOKING FOR ASSOCIATION===========" <<
"\n"
178 <<
"rec::Track #"<<tindex<<
" with pt=" << (*rt)->pt() <<
"\n"
179 <<
"===========================================" <<
"\n";
185 for (
unsigned int i=0;
i<5;
i++){
186 for (
unsigned int j=0;
j<5;
j++){
187 if (
i!=
j) recoTrackCovMatrix(
i,
j)=0;
192 recoTrackCovMatrix.Invert();
195 for (TrackingParticleCollection::const_iterator tp=tPC.begin(); tp!=tPC.end(); tp++, ++tpindex){
202 std::pair<bool,reco::TrackBase::ParameterVector> params = parametersAtClosestApproach(vert, momAtVtx, tp->charge(), bs);
208 chi2 = ROOT::Math::Similarity(diffParameters, recoTrackCovMatrix);
211 LogTrace(
"TrackAssociator") <<
"====TP index=" << tpindex <<
" RECO TRACK index="<<tindex<<
" WITH PT=" << (*rt)->pt() <<
"====\n"
212 <<
"qoverp sim: " << sParameters[0] <<
"\n"
213 <<
"lambda sim: " << sParameters[1] <<
"\n"
214 <<
"phi sim: " << sParameters[2] <<
"\n"
215 <<
"dxy sim: " << sParameters[3] <<
"\n"
216 <<
"dsz sim: " << sParameters[4] <<
"\n"
218 <<
"qoverp rec: " << (*rt)->qoverp() <<
" err: " << (*rt)->error(0) <<
"\n"
219 <<
"lambda rec: " << (*rt)->lambda() <<
" err: " << (*rt)->error(1) <<
"\n"
220 <<
"phi rec: " << (*rt)->phi() <<
" err: " << (*rt)->error(2) <<
"\n"
221 <<
"dxy rec: " << (*rt)->dxy(bs.
position()) <<
" err: " << (*rt)->error(3) <<
"\n"
222 <<
"dsz rec: " << (*rt)->dsz(bs.
position()) <<
" err: " << (*rt)->error(4) <<
"\n"
224 <<
"chi2: " << chi2 <<
"\n";
227 outputCollection.
insert(tC[tindex],
235 return outputCollection;
255 for (TrackingParticleCollection::const_iterator tp=tPC.begin(); tp!=tPC.end(); tp++, ++tpindex){
260 LogDebug(
"TrackAssociator") <<
"=========LOOKING FOR ASSOCIATION===========" <<
"\n"
261 <<
"TrackingParticle #"<<tpindex<<
" with pt=" <<
sqrt(tp->momentum().perp2()) <<
"\n"
262 <<
"===========================================" <<
"\n";
267 std::pair<bool,reco::TrackBase::ParameterVector> params = parametersAtClosestApproach(vert, momAtVtx, tp->charge(), bs);
278 for (
unsigned int i=0;
i<5;
i++){
279 for (
unsigned int j=0;
j<5;
j++){
280 if (
i!=
j) recoTrackCovMatrix(
i,
j)=0;
285 recoTrackCovMatrix.Invert();
289 chi2 = ROOT::Math::Similarity(recoTrackCovMatrix, diffParameters);
292 LogTrace(
"TrackAssociator") <<
"====TP index=" << tpindex <<
" RECO TRACK index="<<tindex<<
" WITH PT=" << (*rt)->pt() <<
"====\n"
293 <<
"qoverp sim: " << sParameters[0] <<
"\n"
294 <<
"lambda sim: " << sParameters[1] <<
"\n"
295 <<
"phi sim: " << sParameters[2] <<
"\n"
296 <<
"dxy sim: " << sParameters[3] <<
"\n"
297 <<
"dsz sim: " << sParameters[4] <<
"\n"
299 <<
"qoverp rec: " << (*rt)->qoverp() <<
" err: " << (*rt)->error(0) <<
"\n"
300 <<
"lambda rec: " << (*rt)->lambda() <<
" err: " << (*rt)->error(1) <<
"\n"
301 <<
"phi rec: " << (*rt)->phi() <<
" err: " << (*rt)->error(2) <<
"\n"
302 <<
"dxy rec: " << (*rt)->dxy(bs.
position()) <<
" err: " << (*rt)->error(3) <<
"\n"
303 <<
"dsz rec: " << (*rt)->dsz(bs.
position()) <<
" err: " << (*rt)->error(4) <<
"\n"
305 <<
"chi2: " << chi2 <<
"\n";
309 std::make_pair(tC[tindex],
316 return outputCollection;
T y() const
Cartesian y coordinate.
T x() const
Cartesian x coordinate.
ROOT::Math::LorentzVector< ROOT::Math::PxPyPzE4D< double > > XYZTLorentzVectorD
Lorentz vector with cylindrical internal representation using pseudorapidity.
C const * product() const
Accessor for product collection.
Sin< T >::type sin(const T &t)
Geom::Phi< T > phi() const
const_iterator end() const
Global3DPoint GlobalPoint
std::vector< Track > TrackCollection
collection of Tracks
std::pair< bool, reco::TrackBase::ParameterVector > parametersAtClosestApproach(Basic3DVector< double >, Basic3DVector< double >, float, const reco::BeamSpot &) const
propagate the track parameters of TrackinParticle from production vertex to the point of closest appr...
std::pair< reco::Track, Chi2SimMap > RecoToSimPair
math::Vector< dimension >::type ParameterVector
parameter vector
TrackCharge charge() const
double compareTracksParam(reco::TrackCollection::const_iterator, edm::SimTrackContainer::const_iterator, const math::XYZTLorentzVectorD, GlobalVector, reco::TrackBase::CovarianceMatrix, const reco::BeamSpot &) const
compare reco::TrackCollection and edm::SimTrackContainer iterators: returns the chi2 ...
Geom::Theta< T > theta() const
T z() const
Cartesian z coordinate.
void post_insert()
post insert action
Cos< T >::type cos(const T &t)
reco::SimToRecoCollection associateSimToReco(const edm::RefToBaseVector< reco::Track > &, const edm::RefVector< TrackingParticleCollection > &, const edm::Event *event=0, const edm::EventSetup *setup=0) const
Association Sim To Reco with Collections.
bool getByLabel(InputTag const &tag, Handle< PROD > &result) const
GlobalVector momentum() const
double associateRecoToSim(reco::TrackCollection::const_iterator, TrackingParticleCollection::const_iterator, const reco::BeamSpot &) const
compare reco::TrackCollection and TrackingParticleCollection iterators: returns the chi2 ...
FTS const & trackStateAtPCA() const
GlobalPoint position() const
void insert(const key_type &k, const data_type &v)
insert an association
std::vector< SimVertex > SimVertexContainer
const_iterator begin() const
std::map< double, SimTrack > Chi2SimMap
std::vector< RecoToSimPair > RecoToSimPairAssociation
size_type size() const
Size of the RefVector.
const Point & position() const
position
std::vector< TrackingParticle > TrackingParticleCollection
std::vector< SimTrack > SimTrackContainer
math::Error< dimension >::type CovarianceMatrix
5 parameter covariance matrix
Global3DVector GlobalVector