37 produces<RecoTracktoTPCollection>(
"AlgoA");
38 produces<RecoTracktoTPCollection>(
"AlgoB");
39 produces<TPtoRecoTrackCollection>(
"TP");
53 auto outputAlgoA = std::make_unique<RecoTracktoTPCollection>();
54 auto outputAlgoB = std::make_unique<RecoTracktoTPCollection>();
55 auto outputTP = std::make_unique<TPtoRecoTrackCollection>();
97 recSimColl_AlgoA = theAssociator_algoA->
associateRecoToSim(trackCollAlgoA, trackingParticleCollFakes);
98 recSimColl_AlgoB = theAssociator_algoB->
associateRecoToSim(trackCollAlgoB, trackingParticleCollFakes);
100 simRecColl_AlgoA = theAssociator_algoA->
associateSimToReco(trackCollAlgoA, trackingParticleCollEffic);
101 simRecColl_AlgoB = theAssociator_algoB->
associateSimToReco(trackCollAlgoB, trackingParticleCollEffic);
107 recSimColl_AlgoA = *(recotosimCollectionH_AlgoA.
product());
111 recSimColl_AlgoB = *(recotosimCollectionH_AlgoB.
product());
115 simRecColl_AlgoA = *(simtorecoCollectionH_AlgoA.
product());
119 simRecColl_AlgoB = *(simtorecoCollectionH_AlgoB.
product());
123 std::vector<std::pair<TrackingParticleRef, double> > associatedTrackingParticles;
126 std::vector<std::pair<reco::TrackBaseRef, double> > associatedRecoTracks;
143 if(recSimColl_AlgoA.
find(recoTrack) != recSimColl_AlgoA.
end())
145 associatedTrackingParticles = recSimColl_AlgoA[recoTrack];
147 recoTracktoTP.
SetShared( associatedTrackingParticles.begin()->second );
157 if(
UseVertex && !vertexCollAlgoA->empty())
166 outputAlgoA->push_back(recoTracktoTP);
180 if(recSimColl_AlgoB.
find(recoTrack) != recSimColl_AlgoB.
end())
182 associatedTrackingParticles = recSimColl_AlgoB[recoTrack];
184 recoTracktoTP.
SetShared( associatedTrackingParticles.begin()->second );
194 if(
UseVertex && !vertexCollAlgoB->empty())
203 outputAlgoB->push_back(recoTracktoTP);
217 if(simRecColl_AlgoA.
find(tparticle) != simRecColl_AlgoA.
end())
219 associatedRecoTracks = simRecColl_AlgoA[tparticle];
230 if(
UseVertex && !vertexCollAlgoA->empty())
240 if(simRecColl_AlgoB.
find(tparticle) != simRecColl_AlgoB.
end())
242 associatedRecoTracks = simRecColl_AlgoB[tparticle];
252 if(
UseVertex && !vertexCollAlgoB->empty())
261 outputTP->push_back(tptoRecoTrack);
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
reco::SimToRecoCollection associateSimToReco(const edm::Handle< edm::View< reco::Track >> &tCH, const edm::Handle< TrackingParticleCollection > &tPCH) const
T getUntrackedParameter(std::string const &, T const &) const
void SetTrackingParticle(TrackingParticleRef tp)
OrphanHandle< PROD > put(std::unique_ptr< PROD > product)
Put a new product.
void SetTrackingParticleMomentumPCA(const GlobalVector &p)
trackingParticleLabel_fakes
std::vector< TrackingParticle > TrackingParticleCollection
const_iterator end() const
last iterator over the map (read only)
void SetTrackingParticle(TrackingParticleRef tp)
bool getByToken(EDGetToken token, Handle< PROD > &result) const
~TrackAlgoCompareUtil() override
void SetShared_AlgoA(const float &mA)
void SetTrackingParticleMomentumPCA(const GlobalVector &p)
edm::EDGetTokenT< reco::SimToRecoCollection > associatormap_algoB_simToReco
edm::EDGetTokenT< reco::TrackToTrackingParticleAssociator > assocLabel_algoA
const_iterator find(const key_type &k) const
find element with specified reference key
void SetShared(const float &m)
Global3DPoint GlobalPoint
edm::EDGetTokenT< reco::VertexCollection > vertexLabel_algoA
void SetTrackingParticlePCA(const GlobalPoint &v)
edm::EDGetTokenT< TrackingParticleCollection > trackingParticleLabel_effic
void SetRecoVertex(reco::VertexRef vertex)
void SetRecoTrack_AlgoA(reco::TrackBaseRef track)
void SetTrackingParticleD0Dz(TrackingParticleRef tp, const reco::BeamSpot &bs, const MagneticField *bf, TPtoRecoTrack &TPRT) const
void SetTrackingParticlePCA(const GlobalPoint &v)
edm::EDGetTokenT< reco::RecoToSimCollection > associatormap_algoA_recoToSim
edm::EDGetTokenT< reco::VertexCollection > vertexLabel_algoB
edm::EDGetTokenT< reco::BeamSpot > beamSpotLabel
edm::EDGetTokenT< edm::View< reco::Track > > trackLabel_algoA
void SetRecoVertex_AlgoB(reco::VertexRef vertex)
void SetRecoVertex_AlgoA(reco::VertexRef vertex)
TrackAlgoCompareUtil(const edm::ParameterSet &)
edm::EDGetTokenT< reco::SimToRecoCollection > associatormap_algoA_simToReco
GlobalVector momentum() const
reco::RecoToSimCollection associateRecoToSim(const edm::Handle< edm::View< reco::Track >> &tCH, const edm::Handle< TrackingParticleCollection > &tPCH) const
FTS const & trackStateAtPCA() const
edm::EDGetTokenT< TrackingParticleCollection > trackingParticleLabel_fakes
GlobalPoint position() const
T const * product() const
trackingParticleLabel_effic
edm::EDGetTokenT< edm::View< reco::Track > > trackLabel_algoB
edm::EDGetTokenT< reco::TrackToTrackingParticleAssociator > assocLabel_algoB
void SetShared_AlgoB(const float &mB)
void SetRecoTrack(reco::TrackBaseRef track)
void SetBeamSpot(const math::XYZPoint &bs)
void SetBeamSpot(const math::XYZPoint &bs)
const bool UseAssociators
void produce(edm::StreamID, edm::Event &, const edm::EventSetup &) const override
const Point & position() const
position
void SetRecoTrack_AlgoB(reco::TrackBaseRef track)
T const * product() const
edm::EDGetTokenT< reco::RecoToSimCollection > associatormap_algoB_recoToSim
edm::Ref< TrackingParticleCollection > TrackingParticleRef
Global3DVector GlobalVector