CMS 3D CMS Logo

List of all members | Public Member Functions | Private Member Functions | Private Attributes
TrackAlgoCompareUtil Class Reference

#include <TrackAlgoCompareUtil.h>

Inheritance diagram for TrackAlgoCompareUtil:
edm::global::EDProducer<> edm::global::EDProducerBase edm::ProducerBase edm::EDConsumerBase edm::ProductRegistryHelper

Public Member Functions

 TrackAlgoCompareUtil (const edm::ParameterSet &)
 
 ~TrackAlgoCompareUtil () override
 
- Public Member Functions inherited from edm::global::EDProducer<>
 EDProducer ()=default
 
bool hasAbilityToProduceInBeginLumis () const final
 
bool hasAbilityToProduceInBeginRuns () const final
 
bool hasAbilityToProduceInEndLumis () const final
 
bool hasAbilityToProduceInEndRuns () const final
 
bool wantsGlobalLuminosityBlocks () const final
 
bool wantsGlobalRuns () const final
 
bool wantsStreamLuminosityBlocks () const final
 
bool wantsStreamRuns () const final
 
- Public Member Functions inherited from edm::global::EDProducerBase
 EDProducerBase ()
 
ModuleDescription const & moduleDescription () const
 
 ~EDProducerBase () override
 
- Public Member Functions inherited from edm::ProducerBase
void callWhenNewProductsRegistered (std::function< void(BranchDescription const &)> const &func)
 
std::vector< edm::ProductResolverIndex > const & indiciesForPutProducts (BranchType iBranchType) const
 
 ProducerBase ()
 
std::vector< edm::ProductResolverIndex > const & putTokenIndexToProductResolverIndex () const
 
void registerProducts (ProducerBase *, ProductRegistry *, ModuleDescription const &)
 
std::function< void(BranchDescription const &)> registrationCallback () const
 used by the fwk to register list of products More...
 
void resolvePutIndicies (BranchType iBranchType, ModuleToResolverIndicies const &iIndicies, std::string const &moduleLabel)
 
 ~ProducerBase () noexcept(false) override
 
- Public Member Functions inherited from edm::EDConsumerBase
std::vector< ConsumesInfoconsumesInfo () const
 
void convertCurrentProcessAlias (std::string const &processName)
 Convert "@currentProcess" in InputTag process names to the actual current process name. More...
 
 EDConsumerBase ()
 
 EDConsumerBase (EDConsumerBase const &)=delete
 
 EDConsumerBase (EDConsumerBase &&)=default
 
ESProxyIndex const * esGetTokenIndices (edm::Transition iTrans) const
 
ProductResolverIndexAndSkipBit indexFrom (EDGetToken, BranchType, TypeID const &) const
 
void itemsMayGet (BranchType, std::vector< ProductResolverIndexAndSkipBit > &) const
 
void itemsToGet (BranchType, std::vector< ProductResolverIndexAndSkipBit > &) const
 
std::vector< ProductResolverIndexAndSkipBit > const & itemsToGetFrom (BranchType iType) const
 
void labelsForToken (EDGetToken iToken, Labels &oLabels) const
 
void modulesWhoseProductsAreConsumed (std::vector< ModuleDescription const * > &modules, ProductRegistry const &preg, std::map< std::string, ModuleDescription const * > const &labelsToDesc, std::string const &processName) const
 
EDConsumerBase const & operator= (EDConsumerBase const &)=delete
 
EDConsumerBaseoperator= (EDConsumerBase &&)=default
 
bool registeredToConsume (ProductResolverIndex, bool, BranchType) const
 
bool registeredToConsumeMany (TypeID const &, BranchType) const
 
ProductResolverIndexAndSkipBit uncheckedIndexFrom (EDGetToken) const
 
void updateLookup (BranchType iBranchType, ProductResolverIndexHelper const &, bool iPrefetchMayGet)
 
void updateLookup (eventsetup::ESRecordsToProxyIndices const &)
 
virtual ~EDConsumerBase () noexcept(false)
 

Private Member Functions

void produce (edm::StreamID, edm::Event &, const edm::EventSetup &) const override
 
void SetTrackingParticleD0Dz (TrackingParticleRef tp, const reco::BeamSpot &bs, const MagneticField *bf, TPtoRecoTrack &TPRT) const
 
void SetTrackingParticleD0Dz (TrackingParticleRef tp, const reco::BeamSpot &bs, const MagneticField *bf, RecoTracktoTP &RTTP) const
 

Private Attributes

edm::EDGetTokenT< reco::RecoToSimCollectionassociatormap_algoA_recoToSim
 
edm::EDGetTokenT< reco::SimToRecoCollectionassociatormap_algoA_simToReco
 
edm::EDGetTokenT< reco::RecoToSimCollectionassociatormap_algoB_recoToSim
 
edm::EDGetTokenT< reco::SimToRecoCollectionassociatormap_algoB_simToReco
 
edm::EDGetTokenT< reco::TrackToTrackingParticleAssociatorassocLabel_algoA
 
edm::EDGetTokenT< reco::TrackToTrackingParticleAssociatorassocLabel_algoB
 
edm::EDGetTokenT< reco::BeamSpotbeamSpotLabel
 
edm::EDGetTokenT< TrackingParticleCollectiontrackingParticleLabel_effic
 
edm::EDGetTokenT< TrackingParticleCollectiontrackingParticleLabel_fakes
 
edm::EDGetTokenT< edm::View< reco::Track > > trackLabel_algoA
 
edm::EDGetTokenT< edm::View< reco::Track > > trackLabel_algoB
 
const bool UseAssociators
 
const bool UseVertex
 
edm::EDGetTokenT< reco::VertexCollectionvertexLabel_algoA
 
edm::EDGetTokenT< reco::VertexCollectionvertexLabel_algoB
 

Additional Inherited Members

- Public Types inherited from edm::global::EDProducerBase
typedef EDProducerBase ModuleType
 
- Public Types inherited from edm::ProducerBase
using ModuleToResolverIndicies = std::unordered_multimap< std::string, std::tuple< edm::TypeID const *, const char *, edm::ProductResolverIndex >>
 
typedef ProductRegistryHelper::TypeLabelList TypeLabelList
 
- Public Types inherited from edm::EDConsumerBase
typedef ProductLabels Labels
 
- Static Public Member Functions inherited from edm::global::EDProducerBase
static const std::string & baseType ()
 
static void fillDescriptions (ConfigurationDescriptions &descriptions)
 
static void prevalidate (ConfigurationDescriptions &descriptions)
 
- Protected Member Functions inherited from edm::ProducerBase
ProducesCollector producesCollector ()
 
- Protected Member Functions inherited from edm::EDConsumerBase
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > consumes (edm::InputTag const &tag)
 
EDGetToken consumes (const TypeToGet &id, edm::InputTag const &tag)
 
template<BranchType B>
EDGetToken consumes (TypeToGet const &id, edm::InputTag const &tag)
 
ConsumesCollector consumesCollector ()
 Use a ConsumesCollector to gather consumes information from helper functions. More...
 
template<typename ProductType , BranchType B = InEvent>
void consumesMany ()
 
void consumesMany (const TypeToGet &id)
 
template<BranchType B>
void consumesMany (const TypeToGet &id)
 
template<typename ESProduct , typename ESRecord , Transition Tr = Transition::Event>
auto esConsumes ()
 
template<typename ESProduct , typename ESRecord , Transition Tr = Transition::Event>
auto esConsumes (ESInputTag const &tag)
 
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > mayConsume (edm::InputTag const &tag)
 
EDGetToken mayConsume (const TypeToGet &id, edm::InputTag const &tag)
 
template<BranchType B>
EDGetToken mayConsume (const TypeToGet &id, edm::InputTag const &tag)
 

Detailed Description

Definition at line 49 of file TrackAlgoCompareUtil.h.

Constructor & Destructor Documentation

TrackAlgoCompareUtil::TrackAlgoCompareUtil ( const edm::ParameterSet iConfig)
explicit

Definition at line 7 of file TrackAlgoCompareUtil.cc.

References associatormap_algoA_recoToSim, associatormap_algoA_simToReco, associatormap_algoB_recoToSim, associatormap_algoB_simToReco, assocLabel_algoA, assocLabel_algoB, edm::ParameterSet::getParameter(), edm::ParameterSet::getUntrackedParameter(), AlCaHLTBitMon_QueryRunRegistry::string, UseAssociators, UseVertex, vertexLabel_algoA, and vertexLabel_algoB.

8  : trackLabel_algoA(consumes<View<reco::Track>>(iConfig.getParameter<edm::InputTag>("trackLabel_algoA"))),
11  consumes<TrackingParticleCollection>(iConfig.getParameter<edm::InputTag>("trackingParticleLabel_fakes"))),
13  consumes<TrackingParticleCollection>(iConfig.getParameter<edm::InputTag>("trackingParticleLabel_effic"))),
14  beamSpotLabel(consumes<reco::BeamSpot>(iConfig.getParameter<edm::InputTag>("beamSpotLabel"))),
15  UseAssociators(iConfig.getParameter<bool>("UseAssociators")),
16  UseVertex(iConfig.getParameter<bool>("UseVertex")) {
17  //now do what ever other initialization is needed
18  if (UseVertex) {
19  vertexLabel_algoA = consumes<reco::VertexCollection>(iConfig.getParameter<edm::InputTag>("vertexLabel_algoA"));
20  vertexLabel_algoB = consumes<reco::VertexCollection>(iConfig.getParameter<edm::InputTag>("vertexLabel_algoB"));
21  }
22 
23  if (UseAssociators) {
24  assocLabel_algoA = consumes<reco::TrackToTrackingParticleAssociator>(
25  iConfig.getUntrackedParameter<std::string>("assocLabel_algoA", "trackAssociatorByHits"));
26  assocLabel_algoB = consumes<reco::TrackToTrackingParticleAssociator>(
27  iConfig.getUntrackedParameter<std::string>("assocLabel_algoB", "trackAssociatorByHits"));
28  } else {
29  edm::InputTag algoA = iConfig.getParameter<edm::InputTag>("associatormap_algoA");
30  edm::InputTag algoB = iConfig.getParameter<edm::InputTag>("associatormap_algoB");
31 
32  associatormap_algoA_recoToSim = consumes<reco::RecoToSimCollection>(algoA);
33  associatormap_algoB_recoToSim = consumes<reco::RecoToSimCollection>(algoB);
34  associatormap_algoA_simToReco = consumes<reco::SimToRecoCollection>(algoA);
35  associatormap_algoB_simToReco = consumes<reco::SimToRecoCollection>(algoB);
36  }
37 
38  produces<RecoTracktoTPCollection>("AlgoA");
39  produces<RecoTracktoTPCollection>("AlgoB");
40  produces<TPtoRecoTrackCollection>("TP");
41 }
T getParameter(std::string const &) const
T getUntrackedParameter(std::string const &, T const &) const
edm::EDGetTokenT< reco::SimToRecoCollection > associatormap_algoB_simToReco
edm::EDGetTokenT< reco::TrackToTrackingParticleAssociator > assocLabel_algoA
edm::EDGetTokenT< reco::VertexCollection > vertexLabel_algoA
edm::EDGetTokenT< TrackingParticleCollection > trackingParticleLabel_effic
EDGetTokenT< ProductType > consumes(edm::InputTag const &tag)
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
edm::EDGetTokenT< reco::SimToRecoCollection > associatormap_algoA_simToReco
edm::EDGetTokenT< TrackingParticleCollection > trackingParticleLabel_fakes
edm::EDGetTokenT< edm::View< reco::Track > > trackLabel_algoB
edm::EDGetTokenT< reco::TrackToTrackingParticleAssociator > assocLabel_algoB
edm::EDGetTokenT< reco::RecoToSimCollection > associatormap_algoB_recoToSim
TrackAlgoCompareUtil::~TrackAlgoCompareUtil ( )
override

Definition at line 43 of file TrackAlgoCompareUtil.cc.

43 {}

Member Function Documentation

void TrackAlgoCompareUtil::produce ( edm::StreamID  ,
edm::Event iEvent,
const edm::EventSetup iSetup 
) const
overrideprivate

Definition at line 46 of file TrackAlgoCompareUtil.cc.

References reco::TrackToTrackingParticleAssociator::associateRecoToSim(), reco::TrackToTrackingParticleAssociator::associateSimToReco(), associatormap_algoA_recoToSim, associatormap_algoA_simToReco, associatormap_algoB_recoToSim, associatormap_algoB_simToReco, assocLabel_algoA, assocLabel_algoB, pwdgSkimBPark_cfi::beamSpot, beamSpotLabel, edm::AssociationMap< Tag >::end(), edm::AssociationMap< Tag >::find(), edm::EventSetup::get(), edm::Event::getByToken(), mps_fire::i, HLT_2018_cff::magneticField, eostools::move(), reco::BeamSpot::position(), edm::Handle< T >::product(), edm::ESHandle< T >::product(), edm::Event::put(), RecoTracktoTP::SetBeamSpot(), TPtoRecoTrack::SetBeamSpot(), RecoTracktoTP::SetRecoTrack(), TPtoRecoTrack::SetRecoTrack_AlgoA(), TPtoRecoTrack::SetRecoTrack_AlgoB(), RecoTracktoTP::SetRecoVertex(), TPtoRecoTrack::SetRecoVertex_AlgoA(), TPtoRecoTrack::SetRecoVertex_AlgoB(), RecoTracktoTP::SetShared(), TPtoRecoTrack::SetShared_AlgoA(), TPtoRecoTrack::SetShared_AlgoB(), TPtoRecoTrack::SetTrackingParticle(), RecoTracktoTP::SetTrackingParticle(), SetTrackingParticleD0Dz(), trackingParticleLabel_effic, trackingParticleLabel_fakes, trackLabel_algoA, trackLabel_algoB, UseAssociators, UseVertex, vertexLabel_algoA, and vertexLabel_algoB.

46  {
47  // create output collection instance
48  auto outputAlgoA = std::make_unique<RecoTracktoTPCollection>();
49  auto outputAlgoB = std::make_unique<RecoTracktoTPCollection>();
50  auto outputTP = std::make_unique<TPtoRecoTrackCollection>();
51 
52  // Get Inputs
53  edm::Handle<reco::BeamSpot> recoBeamSpotHandle;
54  iEvent.getByToken(beamSpotLabel, recoBeamSpotHandle);
55  reco::BeamSpot beamSpot = *recoBeamSpotHandle;
56 
57  edm::Handle<View<reco::Track>> trackCollAlgoA;
58  iEvent.getByToken(trackLabel_algoA, trackCollAlgoA);
59 
60  edm::Handle<View<reco::Track>> trackCollAlgoB;
61  iEvent.getByToken(trackLabel_algoB, trackCollAlgoB);
62 
63  edm::Handle<TrackingParticleCollection> trackingParticleCollFakes;
64  iEvent.getByToken(trackingParticleLabel_fakes, trackingParticleCollFakes);
65 
66  edm::Handle<TrackingParticleCollection> trackingParticleCollEffic;
67  iEvent.getByToken(trackingParticleLabel_effic, trackingParticleCollEffic);
68 
71  if (UseVertex) {
72  iEvent.getByToken(vertexLabel_algoA, vertexCollAlgoA);
73  iEvent.getByToken(vertexLabel_algoB, vertexCollAlgoB);
74  }
75 
76  // call the associator functions:
77  reco::RecoToSimCollection recSimColl_AlgoA;
78  reco::RecoToSimCollection recSimColl_AlgoB;
79 
80  reco::SimToRecoCollection simRecColl_AlgoA;
81  reco::SimToRecoCollection simRecColl_AlgoB;
82 
83  if (UseAssociators) {
85  iEvent.getByToken(assocLabel_algoA, theAssociator_algoA);
86 
88  iEvent.getByToken(assocLabel_algoB, theAssociator_algoB);
89 
90  recSimColl_AlgoA = theAssociator_algoA->associateRecoToSim(trackCollAlgoA, trackingParticleCollFakes);
91  recSimColl_AlgoB = theAssociator_algoB->associateRecoToSim(trackCollAlgoB, trackingParticleCollFakes);
92 
93  simRecColl_AlgoA = theAssociator_algoA->associateSimToReco(trackCollAlgoA, trackingParticleCollEffic);
94  simRecColl_AlgoB = theAssociator_algoB->associateSimToReco(trackCollAlgoB, trackingParticleCollEffic);
95  } else {
96  Handle<reco::RecoToSimCollection> recotosimCollectionH_AlgoA;
97  iEvent.getByToken(associatormap_algoA_recoToSim, recotosimCollectionH_AlgoA);
98  recSimColl_AlgoA = *(recotosimCollectionH_AlgoA.product());
99 
100  Handle<reco::RecoToSimCollection> recotosimCollectionH_AlgoB;
101  iEvent.getByToken(associatormap_algoB_recoToSim, recotosimCollectionH_AlgoB);
102  recSimColl_AlgoB = *(recotosimCollectionH_AlgoB.product());
103 
104  Handle<reco::SimToRecoCollection> simtorecoCollectionH_AlgoA;
105  iEvent.getByToken(associatormap_algoA_simToReco, simtorecoCollectionH_AlgoA);
106  simRecColl_AlgoA = *(simtorecoCollectionH_AlgoA.product());
107 
108  Handle<reco::SimToRecoCollection> simtorecoCollectionH_AlgoB;
109  iEvent.getByToken(associatormap_algoB_simToReco, simtorecoCollectionH_AlgoB);
110  simRecColl_AlgoB = *(simtorecoCollectionH_AlgoB.product());
111  }
112 
113  // define the vector of references to trackingParticleColl associated with a given reco::Track
114  std::vector<std::pair<TrackingParticleRef, double>> associatedTrackingParticles;
115 
116  // define the vector of references to trackColl associated with a given TrackingParticle
117  std::vector<std::pair<reco::TrackBaseRef, double>> associatedRecoTracks;
118 
119  // Get the magnetic field data from the event (used to calculate the point of closest TrackingParticle)
120  edm::ESHandle<MagneticField> theMagneticField;
121  iSetup.get<IdealMagneticFieldRecord>().get(theMagneticField);
122  const MagneticField* magneticField = theMagneticField.product();
123 
124  // fill collection algoA
125  for (View<reco::Track>::size_type i = 0; i < trackCollAlgoA->size(); ++i) {
126  // get recoTrack algo A
127  reco::TrackBaseRef recoTrack(trackCollAlgoA, i);
128  RecoTracktoTP recoTracktoTP;
129  recoTracktoTP.SetRecoTrack(recoTrack);
130  recoTracktoTP.SetBeamSpot(beamSpot.position());
131 
132  // get the associated trackingParticle
133  if (recSimColl_AlgoA.find(recoTrack) != recSimColl_AlgoA.end()) {
134  associatedTrackingParticles = recSimColl_AlgoA[recoTrack];
135  recoTracktoTP.SetTrackingParticle(associatedTrackingParticles.begin()->first);
136  recoTracktoTP.SetShared(associatedTrackingParticles.begin()->second);
137  SetTrackingParticleD0Dz(associatedTrackingParticles.begin()->first, beamSpot, magneticField, recoTracktoTP);
138  } else {
139  recoTracktoTP.SetTrackingParticle(TrackingParticleRef());
140  recoTracktoTP.SetShared(-1.0);
141  }
142 
143  // get the reco primary vertex info
144  if (UseVertex && !vertexCollAlgoA->empty()) {
145  recoTracktoTP.SetRecoVertex(reco::VertexRef(vertexCollAlgoA, 0));
146  } else {
147  recoTracktoTP.SetRecoVertex(reco::VertexRef());
148  }
149 
150  outputAlgoA->push_back(recoTracktoTP);
151  }
152 
153  // fill collection algoB
154  for (reco::TrackCollection::size_type i = 0; i < trackCollAlgoB->size(); ++i) {
155  // get recoTrack algo B
156  reco::TrackBaseRef recoTrack(trackCollAlgoB, i);
157  RecoTracktoTP recoTracktoTP;
158  recoTracktoTP.SetRecoTrack(recoTrack);
159  recoTracktoTP.SetBeamSpot(beamSpot.position());
160 
161  // get the associated trackingParticle
162  if (recSimColl_AlgoB.find(recoTrack) != recSimColl_AlgoB.end()) {
163  associatedTrackingParticles = recSimColl_AlgoB[recoTrack];
164  recoTracktoTP.SetTrackingParticle(associatedTrackingParticles.begin()->first);
165  recoTracktoTP.SetShared(associatedTrackingParticles.begin()->second);
166  SetTrackingParticleD0Dz(associatedTrackingParticles.begin()->first, beamSpot, magneticField, recoTracktoTP);
167  } else {
168  recoTracktoTP.SetTrackingParticle(TrackingParticleRef());
169  recoTracktoTP.SetShared(-1.0);
170  }
171 
172  // get the reco primary vertex info
173  if (UseVertex && !vertexCollAlgoB->empty()) {
174  recoTracktoTP.SetRecoVertex(reco::VertexRef(vertexCollAlgoB, 0));
175  } else {
176  recoTracktoTP.SetRecoVertex(reco::VertexRef());
177  }
178 
179  outputAlgoB->push_back(recoTracktoTP);
180  }
181 
182  for (TrackingParticleCollection::size_type i = 0; i < trackingParticleCollEffic->size(); ++i) {
183  // initialize the trackingParticle (sim) info
184  TrackingParticleRef tparticle(trackingParticleCollEffic, i);
185  TPtoRecoTrack tptoRecoTrack;
186  tptoRecoTrack.SetBeamSpot(beamSpot.position());
187  tptoRecoTrack.SetTrackingParticle(tparticle);
188  SetTrackingParticleD0Dz(tparticle, beamSpot, magneticField, tptoRecoTrack);
189 
190  // get the assocated recoTrack algoA
191  if (simRecColl_AlgoA.find(tparticle) != simRecColl_AlgoA.end()) {
192  associatedRecoTracks = simRecColl_AlgoA[tparticle];
193  tptoRecoTrack.SetRecoTrack_AlgoA(associatedRecoTracks.begin()->first);
194  tptoRecoTrack.SetShared_AlgoA(associatedRecoTracks.begin()->second);
195  } else {
196  tptoRecoTrack.SetRecoTrack_AlgoA(reco::TrackBaseRef());
197  tptoRecoTrack.SetShared_AlgoA(-1.0);
198  }
199 
200  // get the recoVertex algo A
201  if (UseVertex && !vertexCollAlgoA->empty()) {
202  tptoRecoTrack.SetRecoVertex_AlgoA(reco::VertexRef(vertexCollAlgoA, 0));
203  } else {
204  tptoRecoTrack.SetRecoVertex_AlgoA(reco::VertexRef());
205  }
206 
207  // get the assocated recoTrack algoB
208  if (simRecColl_AlgoB.find(tparticle) != simRecColl_AlgoB.end()) {
209  associatedRecoTracks = simRecColl_AlgoB[tparticle];
210  tptoRecoTrack.SetRecoTrack_AlgoB(associatedRecoTracks.begin()->first);
211  tptoRecoTrack.SetShared_AlgoB(associatedRecoTracks.begin()->second);
212  } else {
213  tptoRecoTrack.SetRecoTrack_AlgoB(reco::TrackBaseRef());
214  tptoRecoTrack.SetShared_AlgoB(-1.0);
215  }
216  // get the recoVertex algo B
217  if (UseVertex && !vertexCollAlgoB->empty()) {
218  tptoRecoTrack.SetRecoVertex_AlgoB(reco::VertexRef(vertexCollAlgoB, 0));
219  } else {
220  tptoRecoTrack.SetRecoVertex_AlgoB(reco::VertexRef());
221  }
222 
223  outputTP->push_back(tptoRecoTrack);
224  }
225 
226  // put the collection in the event record
227  iEvent.put(std::move(outputAlgoA), "AlgoA");
228  iEvent.put(std::move(outputAlgoB), "AlgoB");
229  iEvent.put(std::move(outputTP), "TP");
230 }
reco::SimToRecoCollection associateSimToReco(const edm::Handle< edm::View< reco::Track >> &tCH, const edm::Handle< TrackingParticleCollection > &tPCH) const
unsigned int size_type
Definition: View.h:90
void SetTrackingParticle(TrackingParticleRef tp)
Definition: RecoTracktoTP.h:25
OrphanHandle< PROD > put(std::unique_ptr< PROD > product)
Put a new product.
Definition: Event.h:131
const_iterator end() const
last iterator over the map (read only)
void SetTrackingParticle(TrackingParticleRef tp)
Definition: TPtoRecoTrack.h:25
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:525
void SetShared_AlgoA(const float &mA)
Definition: TPtoRecoTrack.h:30
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)
Definition: RecoTracktoTP.h:29
edm::EDGetTokenT< reco::VertexCollection > vertexLabel_algoA
edm::EDGetTokenT< TrackingParticleCollection > trackingParticleLabel_effic
void SetRecoVertex(reco::VertexRef vertex)
Definition: RecoTracktoTP.h:27
void SetRecoTrack_AlgoA(reco::TrackBaseRef track)
Definition: TPtoRecoTrack.h:27
void SetTrackingParticleD0Dz(TrackingParticleRef tp, const reco::BeamSpot &bs, const MagneticField *bf, TPtoRecoTrack &TPRT) const
uint16_t size_type
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)
Definition: TPtoRecoTrack.h:34
void SetRecoVertex_AlgoA(reco::VertexRef vertex)
Definition: TPtoRecoTrack.h:33
edm::EDGetTokenT< reco::SimToRecoCollection > associatormap_algoA_simToReco
reco::RecoToSimCollection associateRecoToSim(const edm::Handle< edm::View< reco::Track >> &tCH, const edm::Handle< TrackingParticleCollection > &tPCH) const
edm::EDGetTokenT< TrackingParticleCollection > trackingParticleLabel_fakes
T const * product() const
Definition: Handle.h:69
edm::EDGetTokenT< edm::View< reco::Track > > trackLabel_algoB
edm::EDGetTokenT< reco::TrackToTrackingParticleAssociator > assocLabel_algoB
void SetShared_AlgoB(const float &mB)
Definition: TPtoRecoTrack.h:31
void SetRecoTrack(reco::TrackBaseRef track)
Definition: RecoTracktoTP.h:26
void SetBeamSpot(const math::XYZPoint &bs)
Definition: TPtoRecoTrack.h:36
void SetBeamSpot(const math::XYZPoint &bs)
Definition: RecoTracktoTP.h:28
T get() const
Definition: EventSetup.h:73
const Point & position() const
position
Definition: BeamSpot.h:59
void SetRecoTrack_AlgoB(reco::TrackBaseRef track)
Definition: TPtoRecoTrack.h:28
T const * product() const
Definition: ESHandle.h:86
edm::EDGetTokenT< reco::RecoToSimCollection > associatormap_algoB_recoToSim
edm::Ref< TrackingParticleCollection > TrackingParticleRef
def move(src, dest)
Definition: eostools.py:511
void TrackAlgoCompareUtil::SetTrackingParticleD0Dz ( TrackingParticleRef  tp,
const reco::BeamSpot bs,
const MagneticField bf,
TPtoRecoTrack TPRT 
) const
private

Definition at line 233 of file TrackAlgoCompareUtil.cc.

References TrajectoryStateClosestToBeamLine::isValid(), FreeTrajectoryState::momentum(), AlCaHLTBitMon_ParallelJobs::p, FreeTrajectoryState::position(), TPtoRecoTrack::SetTrackingParticleMomentumPCA(), TPtoRecoTrack::SetTrackingParticlePCA(), and TrajectoryStateClosestToBeamLine::trackStateAtPCA().

Referenced by produce().

236  {
237  GlobalPoint trackingParticleVertex(tp->vertex().x(), tp->vertex().y(), tp->vertex().z());
238  GlobalVector trackingParticleP3(
239  tp->g4Track_begin()->momentum().x(), tp->g4Track_begin()->momentum().y(), tp->g4Track_begin()->momentum().z());
240  TrackCharge trackingParticleCharge(tp->charge());
241 
242  FreeTrajectoryState ftsAtProduction(trackingParticleVertex, trackingParticleP3, trackingParticleCharge, bf);
243  TSCBLBuilderNoMaterial tscblBuilder;
244  TrajectoryStateClosestToBeamLine tsAtClosestApproach =
245  tscblBuilder(ftsAtProduction, bs); //as in TrackProducerAlgorithm
246 
247  if (tsAtClosestApproach.isValid()) {
248  GlobalPoint v1 = tsAtClosestApproach.trackStateAtPCA().position();
249  GlobalVector p = tsAtClosestApproach.trackStateAtPCA().momentum();
250 
252  TPRT.SetTrackingParticlePCA(v1);
253  } else {
254  TPRT.SetTrackingParticleMomentumPCA(GlobalVector(-9999.0, -9999.0, -9999.0));
255  TPRT.SetTrackingParticlePCA(GlobalPoint(-9999.0, -9999.0, -9999.0));
256  }
257 }
void SetTrackingParticleMomentumPCA(const GlobalVector &p)
Definition: TPtoRecoTrack.h:82
Global3DPoint GlobalPoint
Definition: GlobalPoint.h:10
void SetTrackingParticlePCA(const GlobalPoint &v)
Definition: TPtoRecoTrack.h:83
int TrackCharge
Definition: TrackCharge.h:4
GlobalVector momentum() const
GlobalPoint position() const
Global3DVector GlobalVector
Definition: GlobalVector.h:10
void TrackAlgoCompareUtil::SetTrackingParticleD0Dz ( TrackingParticleRef  tp,
const reco::BeamSpot bs,
const MagneticField bf,
RecoTracktoTP RTTP 
) const
private

Definition at line 259 of file TrackAlgoCompareUtil.cc.

References TrajectoryStateClosestToBeamLine::isValid(), FreeTrajectoryState::momentum(), AlCaHLTBitMon_ParallelJobs::p, FreeTrajectoryState::position(), RecoTracktoTP::SetTrackingParticleMomentumPCA(), RecoTracktoTP::SetTrackingParticlePCA(), and TrajectoryStateClosestToBeamLine::trackStateAtPCA().

262  {
263  GlobalPoint trackingParticleVertex(tp->vertex().x(), tp->vertex().y(), tp->vertex().z());
264  GlobalVector trackingParticleP3(
265  tp->g4Track_begin()->momentum().x(), tp->g4Track_begin()->momentum().y(), tp->g4Track_begin()->momentum().z());
266  TrackCharge trackingParticleCharge(tp->charge());
267 
268  FreeTrajectoryState ftsAtProduction(trackingParticleVertex, trackingParticleP3, trackingParticleCharge, bf);
269  TSCBLBuilderNoMaterial tscblBuilder;
270  TrajectoryStateClosestToBeamLine tsAtClosestApproach =
271  tscblBuilder(ftsAtProduction, bs); //as in TrackProducerAlgorithm
272 
273  if (tsAtClosestApproach.isValid()) {
274  GlobalPoint v1 = tsAtClosestApproach.trackStateAtPCA().position();
275  GlobalVector p = tsAtClosestApproach.trackStateAtPCA().momentum();
276 
278  RTTP.SetTrackingParticlePCA(v1);
279  } else {
280  RTTP.SetTrackingParticleMomentumPCA(GlobalVector(-9999.0, -9999.0, -9999.0));
281  RTTP.SetTrackingParticlePCA(GlobalPoint(-9999.0, -9999.0, -9999.0));
282  }
283 }
void SetTrackingParticleMomentumPCA(const GlobalVector &p)
Definition: RecoTracktoTP.h:55
Global3DPoint GlobalPoint
Definition: GlobalPoint.h:10
void SetTrackingParticlePCA(const GlobalPoint &v)
Definition: RecoTracktoTP.h:56
int TrackCharge
Definition: TrackCharge.h:4
GlobalVector momentum() const
GlobalPoint position() const
Global3DVector GlobalVector
Definition: GlobalVector.h:10

Member Data Documentation

edm::EDGetTokenT<reco::RecoToSimCollection> TrackAlgoCompareUtil::associatormap_algoA_recoToSim
private

Definition at line 74 of file TrackAlgoCompareUtil.h.

Referenced by produce(), and TrackAlgoCompareUtil().

edm::EDGetTokenT<reco::SimToRecoCollection> TrackAlgoCompareUtil::associatormap_algoA_simToReco
private

Definition at line 76 of file TrackAlgoCompareUtil.h.

Referenced by produce(), and TrackAlgoCompareUtil().

edm::EDGetTokenT<reco::RecoToSimCollection> TrackAlgoCompareUtil::associatormap_algoB_recoToSim
private

Definition at line 75 of file TrackAlgoCompareUtil.h.

Referenced by produce(), and TrackAlgoCompareUtil().

edm::EDGetTokenT<reco::SimToRecoCollection> TrackAlgoCompareUtil::associatormap_algoB_simToReco
private

Definition at line 77 of file TrackAlgoCompareUtil.h.

Referenced by produce(), and TrackAlgoCompareUtil().

edm::EDGetTokenT<reco::TrackToTrackingParticleAssociator> TrackAlgoCompareUtil::assocLabel_algoA
private

Definition at line 78 of file TrackAlgoCompareUtil.h.

Referenced by produce(), and TrackAlgoCompareUtil().

edm::EDGetTokenT<reco::TrackToTrackingParticleAssociator> TrackAlgoCompareUtil::assocLabel_algoB
private

Definition at line 79 of file TrackAlgoCompareUtil.h.

Referenced by produce(), and TrackAlgoCompareUtil().

edm::EDGetTokenT<reco::BeamSpot> TrackAlgoCompareUtil::beamSpotLabel
private

Definition at line 73 of file TrackAlgoCompareUtil.h.

Referenced by produce().

edm::EDGetTokenT<TrackingParticleCollection> TrackAlgoCompareUtil::trackingParticleLabel_effic
private

Definition at line 70 of file TrackAlgoCompareUtil.h.

Referenced by produce().

edm::EDGetTokenT<TrackingParticleCollection> TrackAlgoCompareUtil::trackingParticleLabel_fakes
private

Definition at line 69 of file TrackAlgoCompareUtil.h.

Referenced by produce().

edm::EDGetTokenT<edm::View<reco::Track> > TrackAlgoCompareUtil::trackLabel_algoA
private

Definition at line 67 of file TrackAlgoCompareUtil.h.

Referenced by produce().

edm::EDGetTokenT<edm::View<reco::Track> > TrackAlgoCompareUtil::trackLabel_algoB
private

Definition at line 68 of file TrackAlgoCompareUtil.h.

Referenced by produce().

const bool TrackAlgoCompareUtil::UseAssociators
private

Definition at line 80 of file TrackAlgoCompareUtil.h.

Referenced by produce(), and TrackAlgoCompareUtil().

const bool TrackAlgoCompareUtil::UseVertex
private

Definition at line 81 of file TrackAlgoCompareUtil.h.

Referenced by produce(), and TrackAlgoCompareUtil().

edm::EDGetTokenT<reco::VertexCollection> TrackAlgoCompareUtil::vertexLabel_algoA
private

Definition at line 71 of file TrackAlgoCompareUtil.h.

Referenced by produce(), and TrackAlgoCompareUtil().

edm::EDGetTokenT<reco::VertexCollection> TrackAlgoCompareUtil::vertexLabel_algoB
private

Definition at line 72 of file TrackAlgoCompareUtil.h.

Referenced by produce(), and TrackAlgoCompareUtil().