8 : trackLabel_algoA(consumes<
View<
reco::Track>>(iConfig.getParameter<edm::
InputTag>(
"trackLabel_algoA"))),
9 trackLabel_algoB(consumes<
View<
reco::Track>>(iConfig.getParameter<edm::
InputTag>(
"trackLabel_algoB"))),
10 trackingParticleLabel_fakes(
12 trackingParticleLabel_effic(
15 UseAssociators(iConfig.getParameter<bool>(
"UseAssociators")),
16 UseVertex(iConfig.getParameter<bool>(
"UseVertex")) {
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()) {
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)
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
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
T getParameter(std::string const &) 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)
std::vector< TrackingParticle > TrackingParticleCollection
edm::EDGetTokenT< reco::RecoToSimCollection > associatormap_algoB_recoToSim
edm::Ref< TrackingParticleCollection > TrackingParticleRef
Global3DVector GlobalVector
void produce(edm::StreamID, edm::Event &, const edm::EventSetup &) const override