38 produces<RecoTracktoTPCollection>(
"AlgoA");
39 produces<RecoTracktoTPCollection>(
"AlgoB");
40 produces<TPtoRecoTrackCollection>(
"TP");
48 auto outputAlgoA = std::make_unique<RecoTracktoTPCollection>();
49 auto outputAlgoB = std::make_unique<RecoTracktoTPCollection>();
50 auto outputTP = std::make_unique<TPtoRecoTrackCollection>();
90 recSimColl_AlgoA = theAssociator_algoA->
associateRecoToSim(trackCollAlgoA, trackingParticleCollFakes);
91 recSimColl_AlgoB = theAssociator_algoB->
associateRecoToSim(trackCollAlgoB, trackingParticleCollFakes);
93 simRecColl_AlgoA = theAssociator_algoA->
associateSimToReco(trackCollAlgoA, trackingParticleCollEffic);
94 simRecColl_AlgoB = theAssociator_algoB->
associateSimToReco(trackCollAlgoB, trackingParticleCollEffic);
98 recSimColl_AlgoA = *(recotosimCollectionH_AlgoA.
product());
102 recSimColl_AlgoB = *(recotosimCollectionH_AlgoB.
product());
106 simRecColl_AlgoA = *(simtorecoCollectionH_AlgoA.
product());
110 simRecColl_AlgoB = *(simtorecoCollectionH_AlgoB.
product());
114 std::vector<std::pair<TrackingParticleRef, double>> associatedTrackingParticles;
117 std::vector<std::pair<reco::TrackBaseRef, double>> associatedRecoTracks;
133 if (recSimColl_AlgoA.
find(recoTrack) != recSimColl_AlgoA.
end()) {
134 associatedTrackingParticles = recSimColl_AlgoA[recoTrack];
136 recoTracktoTP.
SetShared(associatedTrackingParticles.begin()->second);
144 if (
UseVertex && !vertexCollAlgoA->empty()) {
150 outputAlgoA->push_back(recoTracktoTP);
162 if (recSimColl_AlgoB.
find(recoTrack) != recSimColl_AlgoB.
end()) {
163 associatedTrackingParticles = recSimColl_AlgoB[recoTrack];
165 recoTracktoTP.
SetShared(associatedTrackingParticles.begin()->second);
173 if (
UseVertex && !vertexCollAlgoB->empty()) {
179 outputAlgoB->push_back(recoTracktoTP);
191 if (simRecColl_AlgoA.
find(tparticle) != simRecColl_AlgoA.
end()) {
192 associatedRecoTracks = simRecColl_AlgoA[tparticle];
201 if (
UseVertex && !vertexCollAlgoA->empty()) {
208 if (simRecColl_AlgoB.
find(tparticle) != simRecColl_AlgoB.
end()) {
209 associatedRecoTracks = simRecColl_AlgoB[tparticle];
217 if (
UseVertex && !vertexCollAlgoB->empty()) {
223 outputTP->push_back(tptoRecoTrack);
237 GlobalPoint trackingParticleVertex(
tp->vertex().x(),
tp->vertex().y(),
tp->vertex().z());
239 tp->g4Track_begin()->momentum().x(),
tp->g4Track_begin()->momentum().y(),
tp->g4Track_begin()->momentum().z());
242 FreeTrajectoryState ftsAtProduction(trackingParticleVertex, trackingParticleP3, trackingParticleCharge, bf);
245 tscblBuilder(ftsAtProduction,
bs);
247 if (tsAtClosestApproach.
isValid()) {
263 GlobalPoint trackingParticleVertex(
tp->vertex().x(),
tp->vertex().y(),
tp->vertex().z());
265 tp->g4Track_begin()->momentum().x(),
tp->g4Track_begin()->momentum().y(),
tp->g4Track_begin()->momentum().z());
268 FreeTrajectoryState ftsAtProduction(trackingParticleVertex, trackingParticleP3, trackingParticleCharge, bf);
271 tscblBuilder(ftsAtProduction,
bs);
273 if (tsAtClosestApproach.
isValid()) {