18 assocLabel_algoA = iConfig.
getUntrackedParameter<std::string>(
"assocLabel_algoA",
"TrackAssociatorByHits");
19 assocLabel_algoB = iConfig.
getUntrackedParameter<std::string>(
"assocLabel_algoB",
"TrackAssociatorByHits");
22 UseAssociators = iConfig.
getParameter<
bool >(
"UseAssociators");
25 produces<RecoTracktoTPCollection>(
"AlgoA");
26 produces<RecoTracktoTPCollection>(
"AlgoB");
27 produces<TPtoRecoTrackCollection>(
"TP");
53 iEvent.
getByLabel(beamSpotLabel, recoBeamSpotHandle);
57 iEvent.
getByLabel(trackLabel_algoA, trackCollAlgoA);
60 iEvent.
getByLabel(trackLabel_algoB, trackCollAlgoB);
63 iEvent.
getByLabel(trackingParticleLabel_fakes, trackingParticleCollFakes);
66 iEvent.
getByLabel(trackingParticleLabel_effic, trackingParticleCollEffic);
72 iEvent.
getByLabel(vertexLabel_algoA, vertexCollAlgoA);
73 iEvent.
getByLabel(vertexLabel_algoB, vertexCollAlgoB);
91 recSimColl_AlgoA = theAssociator_algoA->associateRecoToSim(trackCollAlgoA, trackingParticleCollFakes, &iEvent);
92 recSimColl_AlgoB = theAssociator_algoB->associateRecoToSim(trackCollAlgoB, trackingParticleCollFakes, &iEvent);
94 simRecColl_AlgoA = theAssociator_algoA->associateSimToReco(trackCollAlgoA, trackingParticleCollEffic, &iEvent);
95 simRecColl_AlgoB = theAssociator_algoB->associateSimToReco(trackCollAlgoB, trackingParticleCollEffic, &iEvent);
100 iEvent.
getByLabel(associatormap_algoA,recotosimCollectionH_AlgoA);
101 recSimColl_AlgoA = *(recotosimCollectionH_AlgoA.
product());
104 iEvent.
getByLabel(associatormap_algoB,recotosimCollectionH_AlgoB);
105 recSimColl_AlgoB = *(recotosimCollectionH_AlgoB.
product());
108 iEvent.
getByLabel(associatormap_algoA, simtorecoCollectionH_AlgoA);
109 simRecColl_AlgoA = *(simtorecoCollectionH_AlgoA.
product());
112 iEvent.
getByLabel(associatormap_algoB, simtorecoCollectionH_AlgoB);
113 simRecColl_AlgoB = *(simtorecoCollectionH_AlgoB.
product());
117 std::vector<std::pair<TrackingParticleRef, double> > associatedTrackingParticles;
120 std::vector<std::pair<reco::TrackBaseRef, double> > associatedRecoTracks;
137 if(recSimColl_AlgoA.
find(recoTrack) != recSimColl_AlgoA.
end())
139 associatedTrackingParticles = recSimColl_AlgoA[recoTrack];
141 recoTracktoTP.
SetShared( associatedTrackingParticles.begin()->second );
142 SetTrackingParticleD0Dz(associatedTrackingParticles.begin()->first, beamSpot, magneticField, recoTracktoTP);
151 if(UseVertex && vertexCollAlgoA->size())
160 outputAlgoA->push_back(recoTracktoTP);
174 if(recSimColl_AlgoB.
find(recoTrack) != recSimColl_AlgoB.
end())
176 associatedTrackingParticles = recSimColl_AlgoB[recoTrack];
178 recoTracktoTP.
SetShared( associatedTrackingParticles.begin()->second );
179 SetTrackingParticleD0Dz(associatedTrackingParticles.begin()->first, beamSpot, magneticField, recoTracktoTP);
188 if(UseVertex && vertexCollAlgoB->size())
197 outputAlgoB->push_back(recoTracktoTP);
208 SetTrackingParticleD0Dz(tparticle, beamSpot, magneticField, tptoRecoTrack);
211 if(simRecColl_AlgoA.
find(tparticle) != simRecColl_AlgoA.
end())
213 associatedRecoTracks = simRecColl_AlgoA[tparticle];
224 if(UseVertex && vertexCollAlgoA->size())
234 if(simRecColl_AlgoB.
find(tparticle) != simRecColl_AlgoB.
end())
236 associatedRecoTracks = simRecColl_AlgoB[tparticle];
246 if(UseVertex && vertexCollAlgoB->size())
255 outputTP->push_back(tptoRecoTrack);
260 iEvent.
put(outputAlgoA,
"AlgoA");
261 iEvent.
put(outputAlgoB,
"AlgoB");
262 iEvent.
put(outputTP,
"TP");
274 GlobalPoint trackingParticleVertex( tp->vertex().x(), tp->vertex().y(), tp->vertex().z() );
275 GlobalVector trackingParticleP3(tp->g4Track_begin()->momentum().x(),
276 tp->g4Track_begin()->momentum().y(),
277 tp->g4Track_begin()->momentum().z() );
280 FreeTrajectoryState ftsAtProduction( trackingParticleVertex, trackingParticleP3, trackingParticleCharge, bf );
284 if(tsAtClosestApproach.
isValid())
302 GlobalPoint trackingParticleVertex( tp->vertex().x(), tp->vertex().y(), tp->vertex().z() );
303 GlobalVector trackingParticleP3(tp->g4Track_begin()->momentum().x(),
304 tp->g4Track_begin()->momentum().y(),
305 tp->g4Track_begin()->momentum().z() );
308 FreeTrajectoryState ftsAtProduction( trackingParticleVertex, trackingParticleP3, trackingParticleCharge, bf );
312 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)
virtual void produce(edm::Event &, const edm::EventSetup &)
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.
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
void SetShared_AlgoB(const float &mB)
void SetRecoTrack(reco::TrackBaseRef track)
T const * product() const
void SetBeamSpot(math::XYZPoint bs)
T const * product() const
const Point & position() const
position
void SetRecoTrack_AlgoB(reco::TrackBaseRef track)
edm::Ref< TrackingParticleCollection > TrackingParticleRef
void SetBeamSpot(math::XYZPoint bs)
Global3DVector GlobalVector