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(
16 UseAssociators(iConfig.getParameter<bool>(
"UseAssociators")),
17 UseVertex(iConfig.getParameter<bool>(
"UseVertex")) {
39 produces<RecoTracktoTPCollection>(
"AlgoA");
40 produces<RecoTracktoTPCollection>(
"AlgoB");
41 produces<TPtoRecoTrackCollection>(
"TP");
49 auto outputAlgoA = std::make_unique<RecoTracktoTPCollection>();
50 auto outputAlgoB = std::make_unique<RecoTracktoTPCollection>();
51 auto outputTP = std::make_unique<TPtoRecoTrackCollection>();
91 recSimColl_AlgoA = theAssociator_algoA->associateRecoToSim(trackCollAlgoA, trackingParticleCollFakes);
92 recSimColl_AlgoB = theAssociator_algoB->associateRecoToSim(trackCollAlgoB, trackingParticleCollFakes);
94 simRecColl_AlgoA = theAssociator_algoA->associateSimToReco(trackCollAlgoA, trackingParticleCollEffic);
95 simRecColl_AlgoB = theAssociator_algoB->associateSimToReco(trackCollAlgoB, trackingParticleCollEffic);
99 recSimColl_AlgoA = *(recotosimCollectionH_AlgoA.
product());
103 recSimColl_AlgoB = *(recotosimCollectionH_AlgoB.
product());
107 simRecColl_AlgoA = *(simtorecoCollectionH_AlgoA.
product());
111 simRecColl_AlgoB = *(simtorecoCollectionH_AlgoB.
product());
115 std::vector<std::pair<TrackingParticleRef, double>> associatedTrackingParticles;
118 std::vector<std::pair<reco::TrackBaseRef, double>> associatedRecoTracks;
132 if (recSimColl_AlgoA.
find(recoTrack) != recSimColl_AlgoA.
end()) {
133 associatedTrackingParticles = recSimColl_AlgoA[recoTrack];
135 recoTracktoTP.
SetShared(associatedTrackingParticles.begin()->second);
143 if (
UseVertex && !vertexCollAlgoA->empty()) {
149 outputAlgoA->push_back(recoTracktoTP);
161 if (recSimColl_AlgoB.
find(recoTrack) != recSimColl_AlgoB.
end()) {
162 associatedTrackingParticles = recSimColl_AlgoB[recoTrack];
164 recoTracktoTP.
SetShared(associatedTrackingParticles.begin()->second);
172 if (
UseVertex && !vertexCollAlgoB->empty()) {
178 outputAlgoB->push_back(recoTracktoTP);
190 if (simRecColl_AlgoA.
find(tparticle) != simRecColl_AlgoA.
end()) {
191 associatedRecoTracks = simRecColl_AlgoA[tparticle];
200 if (
UseVertex && !vertexCollAlgoA->empty()) {
207 if (simRecColl_AlgoB.
find(tparticle) != simRecColl_AlgoB.
end()) {
208 associatedRecoTracks = simRecColl_AlgoB[tparticle];
216 if (
UseVertex && !vertexCollAlgoB->empty()) {
222 outputTP->push_back(tptoRecoTrack);
236 GlobalPoint trackingParticleVertex(tp->vertex().x(), tp->vertex().y(), tp->vertex().z());
238 tp->g4Track_begin()->momentum().x(), tp->g4Track_begin()->momentum().y(), tp->g4Track_begin()->momentum().z());
241 FreeTrajectoryState ftsAtProduction(trackingParticleVertex, trackingParticleP3, trackingParticleCharge, bf);
244 tscblBuilder(ftsAtProduction, bs);
246 if (tsAtClosestApproach.
isValid()) {
262 GlobalPoint trackingParticleVertex(tp->vertex().x(), tp->vertex().y(), tp->vertex().z());
264 tp->g4Track_begin()->momentum().x(), tp->g4Track_begin()->momentum().y(), tp->g4Track_begin()->momentum().z());
267 FreeTrajectoryState ftsAtProduction(trackingParticleVertex, trackingParticleP3, trackingParticleCharge, bf);
270 tscblBuilder(ftsAtProduction, bs);
272 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.
const edm::ESGetToken< MagneticField, IdealMagneticFieldRecord > magField
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)
void SetRecoVertex(reco::VertexRef vertex)
void SetRecoTrack_AlgoA(reco::TrackBaseRef track)
const edm::EDGetTokenT< TrackingParticleCollection > trackingParticleLabel_effic
void SetTrackingParticleD0Dz(TrackingParticleRef tp, const reco::BeamSpot &bs, const MagneticField *bf, TPtoRecoTrack &TPRT) const
void SetTrackingParticlePCA(const GlobalPoint &v)
bool getData(T &iHolder) const
edm::EDGetTokenT< reco::RecoToSimCollection > associatormap_algoA_recoToSim
const edm::EDGetTokenT< edm::View< reco::Track > > trackLabel_algoA
edm::EDGetTokenT< reco::VertexCollection > vertexLabel_algoB
const edm::EDGetTokenT< TrackingParticleCollection > trackingParticleLabel_fakes
void SetRecoVertex_AlgoB(reco::VertexRef vertex)
const edm::EDGetTokenT< edm::View< reco::Track > > trackLabel_algoB
void SetRecoVertex_AlgoA(reco::VertexRef vertex)
TrackAlgoCompareUtil(const edm::ParameterSet &)
edm::EDGetTokenT< reco::SimToRecoCollection > associatormap_algoA_simToReco
GlobalVector momentum() const
FTS const & trackStateAtPCA() const
GlobalPoint position() const
const edm::EDGetTokenT< reco::BeamSpot > beamSpotLabel
T const * product() const
edm::EDGetTokenT< reco::TrackToTrackingParticleAssociator > assocLabel_algoB
void SetShared_AlgoB(const float &mB)
void SetRecoTrack(reco::TrackBaseRef track)
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