9 trackLabel_algoA(consumes<
View<
reco::Track>>(iConfig.getParameter<edm::
InputTag>(
"trackLabel_algoA"))),
10 trackLabel_algoB(consumes<
View<
reco::Track>>(iConfig.getParameter<edm::
InputTag>(
"trackLabel_algoB"))),
14 UseAssociators(iConfig.getParameter< bool >(
"UseAssociators")),
15 UseVertex(iConfig.getParameter< bool >(
"UseVertex"))
37 produces<RecoTracktoTPCollection>(
"AlgoA");
38 produces<RecoTracktoTPCollection>(
"AlgoB");
39 produces<TPtoRecoTrackCollection>(
"TP");
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 );
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 );
203 outputAlgoB->push_back(recoTracktoTP);
217 if(simRecColl_AlgoA.
find(tparticle) != simRecColl_AlgoA.
end())
219 associatedRecoTracks = simRecColl_AlgoA[tparticle];
240 if(simRecColl_AlgoB.
find(tparticle) != simRecColl_AlgoB.
end())
242 associatedRecoTracks = simRecColl_AlgoB[tparticle];
261 outputTP->push_back(tptoRecoTrack);
266 iEvent.
put(outputAlgoA,
"AlgoA");
267 iEvent.
put(outputAlgoB,
"AlgoB");
268 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)
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
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)
std::vector< RecoTracktoTP > RecoTracktoTPCollection
edm::EDGetTokenT< TrackingParticleCollection > trackingParticleLabel_effic
void SetRecoVertex(reco::VertexRef vertex)
std::vector< TPtoRecoTrack > TPtoRecoTrackCollection
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
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 &)
edm::EDGetTokenT< reco::SimToRecoCollection > associatormap_algoA_simToReco
GlobalVector momentum() const
FTS const & trackStateAtPCA() const
edm::EDGetTokenT< TrackingParticleCollection > trackingParticleLabel_fakes
GlobalPoint position() const
T const * product() const
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)
T const * product() const
void SetBeamSpot(const math::XYZPoint &bs)
void SetBeamSpot(const math::XYZPoint &bs)
const bool UseAssociators
const Point & position() const
position
void SetRecoTrack_AlgoB(reco::TrackBaseRef track)
edm::EDGetTokenT< reco::RecoToSimCollection > associatormap_algoB_recoToSim
edm::Ref< TrackingParticleCollection > TrackingParticleRef
Global3DVector GlobalVector
virtual void produce(edm::StreamID, edm::Event &, const edm::EventSetup &) const override