23 UseAssociators = iConfig.
getParameter<
bool >(
"UseAssociators");
26 produces<RecoTracktoTPCollection>(
"AlgoA");
27 produces<RecoTracktoTPCollection>(
"AlgoB");
28 produces<TPtoRecoTrackCollection>(
"TP");
58 iEvent.
getByLabel(trackLabel_algoA, trackCollAlgoA);
61 iEvent.
getByLabel(trackLabel_algoB, trackCollAlgoB);
64 iEvent.
getByLabel(trackingParticleLabel_fakes, trackingParticleCollFakes);
67 iEvent.
getByLabel(trackingParticleLabel_effic, trackingParticleCollEffic);
73 iEvent.
getByLabel(vertexLabel_algoA, vertexCollAlgoA);
74 iEvent.
getByLabel(vertexLabel_algoB, vertexCollAlgoB);
87 iEvent.
getByLabel(assocLabel_algoA, theAssociator_algoA);
90 iEvent.
getByLabel(assocLabel_algoB, theAssociator_algoB);
92 recSimColl_AlgoA = theAssociator_algoA->associateRecoToSim(trackCollAlgoA, trackingParticleCollFakes);
93 recSimColl_AlgoB = theAssociator_algoB->associateRecoToSim(trackCollAlgoB, trackingParticleCollFakes);
95 simRecColl_AlgoA = theAssociator_algoA->associateSimToReco(trackCollAlgoA, trackingParticleCollEffic);
96 simRecColl_AlgoB = theAssociator_algoB->associateSimToReco(trackCollAlgoB, trackingParticleCollEffic);
101 iEvent.
getByLabel(associatormap_algoA,recotosimCollectionH_AlgoA);
102 recSimColl_AlgoA = *(recotosimCollectionH_AlgoA.
product());
105 iEvent.
getByLabel(associatormap_algoB,recotosimCollectionH_AlgoB);
106 recSimColl_AlgoB = *(recotosimCollectionH_AlgoB.
product());
109 iEvent.
getByLabel(associatormap_algoA, simtorecoCollectionH_AlgoA);
110 simRecColl_AlgoA = *(simtorecoCollectionH_AlgoA.
product());
113 iEvent.
getByLabel(associatormap_algoB, simtorecoCollectionH_AlgoB);
114 simRecColl_AlgoB = *(simtorecoCollectionH_AlgoB.
product());
118 std::vector<std::pair<TrackingParticleRef, double> > associatedTrackingParticles;
121 std::vector<std::pair<reco::TrackBaseRef, double> > associatedRecoTracks;
138 if(recSimColl_AlgoA.
find(recoTrack) != recSimColl_AlgoA.
end())
140 associatedTrackingParticles = recSimColl_AlgoA[recoTrack];
142 recoTracktoTP.
SetShared( associatedTrackingParticles.begin()->second );
143 SetTrackingParticleD0Dz(associatedTrackingParticles.begin()->first,
beamSpot,
magneticField, recoTracktoTP);
152 if(UseVertex && vertexCollAlgoA->size())
161 outputAlgoA->push_back(recoTracktoTP);
175 if(recSimColl_AlgoB.
find(recoTrack) != recSimColl_AlgoB.
end())
177 associatedTrackingParticles = recSimColl_AlgoB[recoTrack];
179 recoTracktoTP.
SetShared( associatedTrackingParticles.begin()->second );
180 SetTrackingParticleD0Dz(associatedTrackingParticles.begin()->first,
beamSpot,
magneticField, recoTracktoTP);
189 if(UseVertex && vertexCollAlgoB->size())
198 outputAlgoB->push_back(recoTracktoTP);
209 SetTrackingParticleD0Dz(tparticle, beamSpot, magneticField, tptoRecoTrack);
212 if(simRecColl_AlgoA.
find(tparticle) != simRecColl_AlgoA.
end())
214 associatedRecoTracks = simRecColl_AlgoA[tparticle];
225 if(UseVertex && vertexCollAlgoA->size())
235 if(simRecColl_AlgoB.
find(tparticle) != simRecColl_AlgoB.
end())
237 associatedRecoTracks = simRecColl_AlgoB[tparticle];
247 if(UseVertex && vertexCollAlgoB->size())
256 outputTP->push_back(tptoRecoTrack);
261 iEvent.
put(outputAlgoA,
"AlgoA");
262 iEvent.
put(outputAlgoB,
"AlgoB");
263 iEvent.
put(outputTP,
"TP");
275 GlobalPoint trackingParticleVertex( tp->vertex().x(), tp->vertex().y(), tp->vertex().z() );
276 GlobalVector trackingParticleP3(tp->g4Track_begin()->momentum().x(),
277 tp->g4Track_begin()->momentum().y(),
278 tp->g4Track_begin()->momentum().z() );
281 FreeTrajectoryState ftsAtProduction( trackingParticleVertex, trackingParticleP3, trackingParticleCharge, bf );
285 if(tsAtClosestApproach.
isValid())
303 GlobalPoint trackingParticleVertex( tp->vertex().x(), tp->vertex().y(), tp->vertex().z() );
304 GlobalVector trackingParticleP3(tp->g4Track_begin()->momentum().x(),
305 tp->g4Track_begin()->momentum().y(),
306 tp->g4Track_begin()->momentum().z() );
309 FreeTrajectoryState ftsAtProduction( trackingParticleVertex, trackingParticleP3, trackingParticleCharge, bf );
313 if(tsAtClosestApproach.
isValid())
T getParameter(std::string const &) const
T getUntrackedParameter(std::string const &, T const &) const
void SetTrackingParticle(TrackingParticleRef tp)
void SetTrackingParticleMomentumPCA(const GlobalVector &p)
const_iterator end() const
last iterator over the map (read only)
void SetTrackingParticle(TrackingParticleRef tp)
void SetShared_AlgoA(const float &mA)
void SetTrackingParticleMomentumPCA(const GlobalVector &p)
const_iterator find(const key_type &k) const
find element with specified reference key
void SetShared(const float &m)
Global3DPoint GlobalPoint
void SetTrackingParticlePCA(const GlobalPoint &v)
std::vector< RecoTracktoTP > RecoTracktoTPCollection
void SetRecoVertex(reco::VertexRef vertex)
std::vector< TPtoRecoTrack > TPtoRecoTrackCollection
void SetRecoTrack_AlgoA(reco::TrackBaseRef track)
void SetTrackingParticlePCA(const GlobalPoint &v)
void SetTrackingParticleD0Dz(TrackingParticleRef tp, const reco::BeamSpot &bs, const MagneticField *bf, TPtoRecoTrack &TPRT)
OrphanHandle< PROD > put(std::auto_ptr< PROD > product)
Put a new product.
virtual void produce(edm::Event &, const edm::EventSetup &) override
void SetRecoVertex_AlgoB(reco::VertexRef vertex)
void SetRecoVertex_AlgoA(reco::VertexRef vertex)
TrackAlgoCompareUtil(const edm::ParameterSet &)
bool getByLabel(InputTag const &tag, Handle< PROD > &result) const
GlobalVector momentum() const
FTS const & trackStateAtPCA() const
GlobalPoint position() const
T const * product() const
void SetShared_AlgoB(const float &mB)
void SetRecoTrack(reco::TrackBaseRef track)
T const * product() const
void SetBeamSpot(const math::XYZPoint &bs)
void SetBeamSpot(const math::XYZPoint &bs)
const Point & position() const
position
void SetRecoTrack_AlgoB(reco::TrackBaseRef track)
edm::Ref< TrackingParticleCollection > TrackingParticleRef
Global3DVector GlobalVector