15 SimTrackContainer::const_iterator st,
24 std::pair<bool,reco::TrackBase::ParameterVector> params = parametersAtClosestApproach(vert, momAtVtx, st->charge(), bs);
31 double chi2 = ROOT::Math::Dot(diffParameters * invertedCovariance, diffParameters);
48 for (TrackCollection::const_iterator track=rtColl.begin(); track!=rtColl.end(); track++){
55 for (
unsigned int i=0;
i<5;
i++){
56 for (
unsigned int j=0;
j<5;
j++){
57 if (
i!=
j) recoTrackCovMatrix(
i,
j)=0;
61 recoTrackCovMatrix.Invert();
63 for (SimTrackContainer::const_iterator st=stColl.begin(); st!=stColl.end(); st++){
68 std::pair<bool,reco::TrackBase::ParameterVector> params = parametersAtClosestApproach(vert, momAtVtx, st->charge(), bs);
74 double chi2 = ROOT::Math::Dot(diffParameters * recoTrackCovMatrix, diffParameters);
76 if (chi2<chi2cut) outMap[chi2]=*st;
93 std::pair<bool,reco::TrackBase::ParameterVector> params = parametersAtClosestApproach(vert, momAtVtx, charge, bs);
99 chi2 = ROOT::Math::Dot(diffParameters * recoTrackCovMatrix, diffParameters);
102 LogDebug(
"TrackAssociator") <<
"====NEW RECO TRACK WITH PT=" <<
sin(rParameters[1])*float(charge)/rParameters[0] <<
"====\n"
103 <<
"qoverp sim: " << sParameters[0] <<
"\n"
104 <<
"lambda sim: " << sParameters[1] <<
"\n"
105 <<
"phi sim: " << sParameters[2] <<
"\n"
106 <<
"dxy sim: " << sParameters[3] <<
"\n"
107 <<
"dsz sim: " << sParameters[4] <<
"\n"
109 <<
"qoverp rec: " << rParameters[0] <<
"\n"
110 <<
"lambda rec: " << rParameters[1] <<
"\n"
111 <<
"phi rec: " << rParameters[2] <<
"\n"
112 <<
"dxy rec: " << rParameters[3] <<
"\n"
113 <<
"dsz rec: " << rParameters[4] <<
"\n"
115 <<
"chi2: " << chi2 <<
"\n";
125 TrackingParticleCollection::const_iterator tp,
130 for (
unsigned int i=0;
i<5;
i++){
131 for (
unsigned int j=0;
j<5;
j++){
132 if (
i!=
j) recoTrackCovMatrix(
i,
j)=0;
137 recoTrackCovMatrix.Invert();
140 int charge = tp->charge();
141 return getChi2(rParameters,recoTrackCovMatrix,momAtVtx,vert,charge,bs);
144 pair<bool,TrackBase::ParameterVector>
163 sParameters[2] = p.
phi();
167 return pair<bool,TrackBase::ParameterVector>(
true,sParameters);
169 return pair<bool,TrackBase::ParameterVector>(
false,sParameters);
189 LogDebug(
"TrackAssociator") <<
"=========LOOKING FOR ASSOCIATION===========" <<
"\n"
190 <<
"rec::Track #"<<tindex<<
" with pt=" << (*rt)->pt() <<
"\n"
191 <<
"===========================================" <<
"\n";
197 for (
unsigned int i=0;
i<5;
i++){
198 for (
unsigned int j=0;
j<5;
j++){
199 if (
i!=
j) recoTrackCovMatrix(
i,
j)=0;
204 recoTrackCovMatrix.Invert();
207 for (TrackingParticleCollection::const_iterator tp=tPC.begin(); tp!=tPC.end(); tp++, ++tpindex){
211 int charge = tp->charge();
212 if (charge==0)
continue;
216 double chi2 = getChi2(rParameters,recoTrackCovMatrix,momAtVtx,vert,charge,bs);
219 outputCollection.
insert(tC[tindex],
226 return outputCollection;
244 for (TrackingParticleCollection::const_iterator tp=tPC.begin(); tp!=tPC.end(); tp++, ++tpindex){
248 int charge = tp->charge();
249 if (charge==0)
continue;
251 LogDebug(
"TrackAssociator") <<
"=========LOOKING FOR ASSOCIATION===========" <<
"\n"
252 <<
"TrackingParticle #"<<tpindex<<
" with pt=" <<
sqrt(tp->momentum().perp2()) <<
"\n"
253 <<
"===========================================" <<
"\n";
264 for (
unsigned int i=0;
i<5;
i++){
265 for (
unsigned int j=0;
j<5;
j++){
266 if (
i!=
j) recoTrackCovMatrix(
i,
j)=0;
270 recoTrackCovMatrix.Invert();
272 double chi2 = getChi2(rParameters,recoTrackCovMatrix,momAtVtx,vert,charge,bs);
276 std::make_pair(tC[tindex],
282 return outputCollection;
304 LogDebug(
"TrackAssociator") <<
"=========LOOKING FOR ASSOCIATION===========" <<
"\n"
305 <<
"rec::Track #"<<tindex<<
" with pt=" << (*rt)->pt() <<
"\n"
306 <<
"===========================================" <<
"\n";
312 for (
unsigned int i=0;
i<5;
i++){
313 for (
unsigned int j=0;
j<5;
j++){
314 if (
i!=
j) recoTrackCovMatrix(
i,
j)=0;
319 recoTrackCovMatrix.Invert();
322 for (GenParticleCollection::const_iterator tp=tPC.begin(); tp!=tPC.end(); tp++, ++tpindex){
326 int charge = tp->charge();
327 if (charge==0)
continue;
331 double chi2 = getChi2(rParameters,recoTrackCovMatrix,momAtVtx,vert,charge,bs);
334 outputCollection.
insert(tC[tindex],
341 return outputCollection;
360 for (GenParticleCollection::const_iterator tp=tPC.begin(); tp!=tPC.end(); tp++, ++tpindex){
364 int charge = tp->charge();
365 if (charge==0)
continue;
367 LogDebug(
"TrackAssociator") <<
"=========LOOKING FOR ASSOCIATION===========" <<
"\n"
368 <<
"TrackingParticle #"<<tpindex<<
" with pt=" <<
sqrt(tp->momentum().perp2()) <<
"\n"
369 <<
"===========================================" <<
"\n";
380 for (
unsigned int i=0;
i<5;
i++){
381 for (
unsigned int j=0;
j<5;
j++){
382 if (
i!=
j) recoTrackCovMatrix(
i,
j)=0;
386 recoTrackCovMatrix.Invert();
388 double chi2 = getChi2(rParameters,recoTrackCovMatrix,momAtVtx,vert,charge,bs);
392 std::make_pair(tC[tindex],
398 return outputCollection;
std::vector< GenParticle > GenParticleCollection
collection of GenParticles
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.
std::vector< TrackingParticle > TrackingParticleCollection
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.
double getChi2(reco::TrackBase::ParameterVector &rParameters, reco::TrackBase::CovarianceMatrix &recoTrackCovMatrix, Basic3DVector< double > &momAtVtx, Basic3DVector< double > &vert, int &charge, const reco::BeamSpot &) const
basic method where chi2 is computed
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
double deltaPhi(double phi1, double phi2)
GlobalPoint position() const
void insert(const key_type &k, const data_type &v)
insert an association
reco::RecoToGenCollection associateRecoToGen(const edm::RefToBaseVector< reco::Track > &, const edm::RefVector< reco::GenParticleCollection > &, const edm::Event *event=0, const edm::EventSetup *setup=0) const
Association Sim To Reco with Collections (Gen Particle version)
std::vector< SimVertex > SimVertexContainer
reco::GenToRecoCollection associateGenToReco(const edm::RefToBaseVector< reco::Track > &, const edm::RefVector< reco::GenParticleCollection > &, const edm::Event *event=0, const edm::EventSetup *setup=0) const
Association Sim To Reco with Collections (Gen Particle version)
const_iterator begin() const
std::map< double, SimTrack > Chi2SimMap
std::vector< RecoToSimPair > RecoToSimPairAssociation
size_type size() const
Size of the RefVector.
std::vector< SimTrack > SimTrackContainer
void setup(std::vector< TH2F > &depth, std::string name, std::string units="")
math::Error< dimension >::type CovarianceMatrix
5 parameter covariance matrix
Global3DVector GlobalVector