CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Member Functions | Private Member Functions | Private Attributes
TrackAlgoCompareUtil Class Reference

#include <TrackAlgoCompareUtil.h>

Inheritance diagram for TrackAlgoCompareUtil:
edm::EDProducer edm::ProducerBase edm::EDConsumerBase edm::ProductRegistryHelper

Public Member Functions

 TrackAlgoCompareUtil (const edm::ParameterSet &)
 
 ~TrackAlgoCompareUtil ()
 
- Public Member Functions inherited from edm::EDProducer
 EDProducer ()
 
ModuleDescription const & moduleDescription () const
 
virtual ~EDProducer ()
 
- Public Member Functions inherited from edm::ProducerBase
 ProducerBase ()
 
void registerProducts (ProducerBase *, ProductRegistry *, ModuleDescription const &)
 
std::function< void(BranchDescription
const &)> 
registrationCallback () const
 used by the fwk to register list of products More...
 
virtual ~ProducerBase ()
 
- Public Member Functions inherited from edm::EDConsumerBase
 EDConsumerBase ()
 
ProductHolderIndexAndSkipBit indexFrom (EDGetToken, BranchType, TypeID const &) const
 
void itemsMayGet (BranchType, std::vector< ProductHolderIndexAndSkipBit > &) const
 
void itemsToGet (BranchType, std::vector< ProductHolderIndexAndSkipBit > &) const
 
std::vector
< ProductHolderIndexAndSkipBit >
const & 
itemsToGetFromEvent () const
 
void labelsForToken (EDGetToken iToken, Labels &oLabels) const
 
bool registeredToConsume (ProductHolderIndex, bool, BranchType) const
 
bool registeredToConsumeMany (TypeID const &, BranchType) const
 
void updateLookup (BranchType iBranchType, ProductHolderIndexHelper const &)
 
virtual ~EDConsumerBase ()
 

Private Member Functions

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

Private Attributes

edm::InputTag associatormap_algoA
 
edm::InputTag associatormap_algoB
 
std::string assocLabel_algoA
 
std::string assocLabel_algoB
 
edm::InputTag beamSpotLabel
 
edm::InputTag trackingParticleLabel_effic
 
edm::InputTag trackingParticleLabel_fakes
 
edm::InputTag trackingVertexLabel
 
edm::InputTag trackLabel_algoA
 
edm::InputTag trackLabel_algoB
 
bool UseAssociators
 
bool UseVertex
 
edm::InputTag vertexLabel_algoA
 
edm::InputTag vertexLabel_algoB
 

Additional Inherited Members

- Public Types inherited from edm::EDProducer
typedef EDProducer ModuleType
 
- Public Types inherited from edm::ProducerBase
typedef
ProductRegistryHelper::TypeLabelList 
TypeLabelList
 
- Static Public Member Functions inherited from edm::EDProducer
static const std::string & baseType ()
 
static void fillDescriptions (ConfigurationDescriptions &descriptions)
 
static void prevalidate (ConfigurationDescriptions &descriptions)
 
- Protected Member Functions inherited from edm::ProducerBase
void callWhenNewProductsRegistered (std::function< void(BranchDescription const &)> const &func)
 
- 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 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 57 of file TrackAlgoCompareUtil.h.

Constructor & Destructor Documentation

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

Definition at line 8 of file TrackAlgoCompareUtil.cc.

References edm::ParameterSet::getParameter(), edm::ParameterSet::getUntrackedParameter(), and AlCaHLTBitMon_QueryRunRegistry::string.

9 {
10  //now do what ever other initialization is needed
11  trackLabel_algoA = iConfig.getParameter<edm::InputTag>("trackLabel_algoA");
12  trackLabel_algoB = iConfig.getParameter<edm::InputTag>("trackLabel_algoB");
13  trackingParticleLabel_fakes = iConfig.getParameter<edm::InputTag>("trackingParticleLabel_fakes");
14  trackingParticleLabel_effic = iConfig.getParameter<edm::InputTag>("trackingParticleLabel_effic");
15  vertexLabel_algoA = iConfig.getParameter<edm::InputTag>("vertexLabel_algoA");
16  vertexLabel_algoB = iConfig.getParameter<edm::InputTag>("vertexLabel_algoB");
17  beamSpotLabel = iConfig.getParameter<edm::InputTag>("beamSpotLabel");
18  assocLabel_algoA = iConfig.getUntrackedParameter<std::string>("assocLabel_algoA", "TrackAssociatorByHits");
19  assocLabel_algoB = iConfig.getUntrackedParameter<std::string>("assocLabel_algoB", "TrackAssociatorByHits");
20  associatormap_algoA = iConfig.getParameter< edm::InputTag >("associatormap_algoA");
21  associatormap_algoB = iConfig.getParameter< edm::InputTag >("associatormap_algoB");
22  UseAssociators = iConfig.getParameter< bool >("UseAssociators");
23  UseVertex = iConfig.getParameter< bool >("UseVertex");
24 
25  produces<RecoTracktoTPCollection>("AlgoA");
26  produces<RecoTracktoTPCollection>("AlgoB");
27  produces<TPtoRecoTrackCollection>("TP");
28 }
T getParameter(std::string const &) const
T getUntrackedParameter(std::string const &, T const &) const
edm::InputTag trackingParticleLabel_effic
edm::InputTag trackingParticleLabel_fakes
edm::InputTag vertexLabel_algoB
edm::InputTag vertexLabel_algoA
edm::InputTag trackLabel_algoA
edm::InputTag associatormap_algoA
edm::InputTag associatormap_algoB
edm::InputTag trackLabel_algoB
TrackAlgoCompareUtil::~TrackAlgoCompareUtil ( )

Definition at line 31 of file TrackAlgoCompareUtil.cc.

32 {
33 }

Member Function Documentation

void TrackAlgoCompareUtil::beginJob ( void  )
privatevirtual

Reimplemented from edm::EDProducer.

Definition at line 37 of file TrackAlgoCompareUtil.cc.

38 {
39 }
void TrackAlgoCompareUtil::endJob ( void  )
privatevirtual

Reimplemented from edm::EDProducer.

Definition at line 266 of file TrackAlgoCompareUtil.cc.

267 {
268 }
void TrackAlgoCompareUtil::produce ( edm::Event iEvent,
const edm::EventSetup iSetup 
)
overrideprivatevirtual

Implements edm::EDProducer.

Definition at line 44 of file TrackAlgoCompareUtil.cc.

References SiPixelRawToDigiRegional_cfi::beamSpot, edm::AssociationMap< Tag >::end(), edm::AssociationMap< Tag >::find(), edm::EventSetup::get(), edm::Event::getByLabel(), i, reco::BeamSpot::position(), edm::Handle< T >::product(), edm::ESHandle< class >::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(), RecoTracktoTP::SetTrackingParticle(), and TPtoRecoTrack::SetTrackingParticle().

45 {
46  // create output collection instance
47  std::auto_ptr<RecoTracktoTPCollection> outputAlgoA(new RecoTracktoTPCollection());
48  std::auto_ptr<RecoTracktoTPCollection> outputAlgoB(new RecoTracktoTPCollection());
49  std::auto_ptr<TPtoRecoTrackCollection> outputTP(new TPtoRecoTrackCollection());
50 
51  // Get Inputs
52  edm::Handle<reco::BeamSpot> recoBeamSpotHandle;
53  iEvent.getByLabel(beamSpotLabel, recoBeamSpotHandle);
54  reco::BeamSpot beamSpot = *recoBeamSpotHandle;
55 
56  edm::Handle<View<reco::Track> > trackCollAlgoA;
57  iEvent.getByLabel(trackLabel_algoA, trackCollAlgoA);
58 
59  edm::Handle< View<reco::Track> > trackCollAlgoB;
60  iEvent.getByLabel(trackLabel_algoB, trackCollAlgoB);
61 
62  edm::Handle<TrackingParticleCollection> trackingParticleCollFakes;
63  iEvent.getByLabel(trackingParticleLabel_fakes, trackingParticleCollFakes);
64 
65  edm::Handle<TrackingParticleCollection> trackingParticleCollEffic;
66  iEvent.getByLabel(trackingParticleLabel_effic, trackingParticleCollEffic);
67 
70  if(UseVertex)
71  {
72  iEvent.getByLabel(vertexLabel_algoA, vertexCollAlgoA);
73  iEvent.getByLabel(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)
84  {
85  edm::ESHandle<TrackAssociatorBase> theAssociator_algoA;
86  iSetup.get<TrackAssociatorRecord>().get(assocLabel_algoA, theAssociator_algoA);
87 
88  edm::ESHandle<TrackAssociatorBase> theAssociator_algoB;
89  iSetup.get<TrackAssociatorRecord>().get(assocLabel_algoB, theAssociator_algoB);
90 
91  recSimColl_AlgoA = theAssociator_algoA->associateRecoToSim(trackCollAlgoA, trackingParticleCollFakes, &iEvent, &iSetup);
92  recSimColl_AlgoB = theAssociator_algoB->associateRecoToSim(trackCollAlgoB, trackingParticleCollFakes, &iEvent, &iSetup);
93 
94  simRecColl_AlgoA = theAssociator_algoA->associateSimToReco(trackCollAlgoA, trackingParticleCollEffic, &iEvent, &iSetup);
95  simRecColl_AlgoB = theAssociator_algoB->associateSimToReco(trackCollAlgoB, trackingParticleCollEffic, &iEvent, &iSetup);
96  }
97  else
98  {
99  Handle<reco::RecoToSimCollection > recotosimCollectionH_AlgoA;
100  iEvent.getByLabel(associatormap_algoA,recotosimCollectionH_AlgoA);
101  recSimColl_AlgoA = *(recotosimCollectionH_AlgoA.product());
102 
103  Handle<reco::RecoToSimCollection > recotosimCollectionH_AlgoB;
104  iEvent.getByLabel(associatormap_algoB,recotosimCollectionH_AlgoB);
105  recSimColl_AlgoB = *(recotosimCollectionH_AlgoB.product());
106 
107  Handle<reco::SimToRecoCollection > simtorecoCollectionH_AlgoA;
108  iEvent.getByLabel(associatormap_algoA, simtorecoCollectionH_AlgoA);
109  simRecColl_AlgoA = *(simtorecoCollectionH_AlgoA.product());
110 
111  Handle<reco::SimToRecoCollection > simtorecoCollectionH_AlgoB;
112  iEvent.getByLabel(associatormap_algoB, simtorecoCollectionH_AlgoB);
113  simRecColl_AlgoB = *(simtorecoCollectionH_AlgoB.product());
114  }
115 
116  // define the vector of references to trackingParticleColl associated with a given reco::Track
117  std::vector<std::pair<TrackingParticleRef, double> > associatedTrackingParticles;
118 
119  // define the vector of references to trackColl associated with a given TrackingParticle
120  std::vector<std::pair<reco::TrackBaseRef, double> > associatedRecoTracks;
121 
122  // Get the magnetic field data from the event (used to calculate the point of closest TrackingParticle)
123  edm::ESHandle<MagneticField> theMagneticField;
124  iSetup.get<IdealMagneticFieldRecord>().get(theMagneticField);
125  const MagneticField *magneticField = theMagneticField.product();
126 
127  // fill collection algoA
128  for(View<reco::Track>::size_type i = 0; i < trackCollAlgoA->size(); ++i)
129  {
130  // get recoTrack algo A
131  reco::TrackBaseRef recoTrack(trackCollAlgoA, i);
132  RecoTracktoTP recoTracktoTP;
133  recoTracktoTP.SetRecoTrack(recoTrack);
134  recoTracktoTP.SetBeamSpot(beamSpot.position());
135 
136  // get the associated trackingParticle
137  if(recSimColl_AlgoA.find(recoTrack) != recSimColl_AlgoA.end())
138  {
139  associatedTrackingParticles = recSimColl_AlgoA[recoTrack];
140  recoTracktoTP.SetTrackingParticle( associatedTrackingParticles.begin()->first );
141  recoTracktoTP.SetShared( associatedTrackingParticles.begin()->second );
142  SetTrackingParticleD0Dz(associatedTrackingParticles.begin()->first, beamSpot, magneticField, recoTracktoTP);
143  }
144  else
145  {
146  recoTracktoTP.SetTrackingParticle(TrackingParticleRef());
147  recoTracktoTP.SetShared(-1.0);
148  }
149 
150  // get the reco primary vertex info
151  if(UseVertex && vertexCollAlgoA->size())
152  {
153  recoTracktoTP.SetRecoVertex( reco::VertexRef(vertexCollAlgoA, 0) );
154  }
155  else
156  {
157  recoTracktoTP.SetRecoVertex( reco::VertexRef() );
158  }
159 
160  outputAlgoA->push_back(recoTracktoTP);
161  }
162 
163 
164  // fill collection algoB
165  for(reco::TrackCollection::size_type i = 0; i < trackCollAlgoB->size(); ++i)
166  {
167  // get recoTrack algo B
168  reco::TrackBaseRef recoTrack(trackCollAlgoB, i);
169  RecoTracktoTP recoTracktoTP;
170  recoTracktoTP.SetRecoTrack(recoTrack);
171  recoTracktoTP.SetBeamSpot(beamSpot.position());
172 
173  // get the associated trackingParticle
174  if(recSimColl_AlgoB.find(recoTrack) != recSimColl_AlgoB.end())
175  {
176  associatedTrackingParticles = recSimColl_AlgoB[recoTrack];
177  recoTracktoTP.SetTrackingParticle( associatedTrackingParticles.begin()->first );
178  recoTracktoTP.SetShared( associatedTrackingParticles.begin()->second );
179  SetTrackingParticleD0Dz(associatedTrackingParticles.begin()->first, beamSpot, magneticField, recoTracktoTP);
180  }
181  else
182  {
183  recoTracktoTP.SetTrackingParticle(TrackingParticleRef());
184  recoTracktoTP.SetShared(-1.0);
185  }
186 
187  // get the reco primary vertex info
188  if(UseVertex && vertexCollAlgoB->size())
189  {
190  recoTracktoTP.SetRecoVertex( reco::VertexRef(vertexCollAlgoB, 0) );
191  }
192  else
193  {
194  recoTracktoTP.SetRecoVertex( reco::VertexRef() );
195  }
196 
197  outputAlgoB->push_back(recoTracktoTP);
198  }
199 
200 
201  for(TrackingParticleCollection::size_type i = 0; i < trackingParticleCollEffic->size(); ++i)
202  {
203  // initialize the trackingParticle (sim) info
204  TrackingParticleRef tparticle(trackingParticleCollEffic, i);
205  TPtoRecoTrack tptoRecoTrack;
206  tptoRecoTrack.SetBeamSpot(beamSpot.position());
207  tptoRecoTrack.SetTrackingParticle(tparticle);
208  SetTrackingParticleD0Dz(tparticle, beamSpot, magneticField, tptoRecoTrack);
209 
210  // get the assocated recoTrack algoA
211  if(simRecColl_AlgoA.find(tparticle) != simRecColl_AlgoA.end())
212  {
213  associatedRecoTracks = simRecColl_AlgoA[tparticle];
214  tptoRecoTrack.SetRecoTrack_AlgoA(associatedRecoTracks.begin()->first );
215  tptoRecoTrack.SetShared_AlgoA(associatedRecoTracks.begin()->second );
216  }
217  else
218  {
219  tptoRecoTrack.SetRecoTrack_AlgoA(reco::TrackBaseRef());
220  tptoRecoTrack.SetShared_AlgoA(-1.0);
221  }
222 
223  // get the recoVertex algo A
224  if(UseVertex && vertexCollAlgoA->size())
225  {
226  tptoRecoTrack.SetRecoVertex_AlgoA( reco::VertexRef(vertexCollAlgoA, 0) );
227  }
228  else
229  {
230  tptoRecoTrack.SetRecoVertex_AlgoA( reco::VertexRef() );
231  }
232 
233  // get the assocated recoTrack algoB
234  if(simRecColl_AlgoB.find(tparticle) != simRecColl_AlgoB.end())
235  {
236  associatedRecoTracks = simRecColl_AlgoB[tparticle];
237  tptoRecoTrack.SetRecoTrack_AlgoB(associatedRecoTracks.begin()->first );
238  tptoRecoTrack.SetShared_AlgoB(associatedRecoTracks.begin()->second );
239  }
240  else
241  {
242  tptoRecoTrack.SetRecoTrack_AlgoB(reco::TrackBaseRef());
243  tptoRecoTrack.SetShared_AlgoB(-1.0);
244  }
245  // get the recoVertex algo B
246  if(UseVertex && vertexCollAlgoB->size())
247  {
248  tptoRecoTrack.SetRecoVertex_AlgoB( reco::VertexRef(vertexCollAlgoB, 0) );
249  }
250  else
251  {
252  tptoRecoTrack.SetRecoVertex_AlgoB( reco::VertexRef() );
253  }
254 
255  outputTP->push_back(tptoRecoTrack);
256  }
257 
258 
259  // put the collection in the event record
260  iEvent.put(outputAlgoA, "AlgoA");
261  iEvent.put(outputAlgoB, "AlgoB");
262  iEvent.put(outputTP, "TP");
263 }
int i
Definition: DBlmapReader.cc:9
void SetTrackingParticle(TrackingParticleRef tp)
Definition: RecoTracktoTP.h:28
const_iterator end() const
last iterator over the map (read only)
void SetTrackingParticle(TrackingParticleRef tp)
Definition: TPtoRecoTrack.h:28
void SetShared_AlgoA(const float &mA)
Definition: TPtoRecoTrack.h:33
edm::InputTag trackingParticleLabel_effic
const_iterator find(const key_type &k) const
find element with specified reference key
void SetShared(const float &m)
Definition: RecoTracktoTP.h:32
std::vector< RecoTracktoTP > RecoTracktoTPCollection
void SetRecoVertex(reco::VertexRef vertex)
Definition: RecoTracktoTP.h:30
std::vector< TPtoRecoTrack > TPtoRecoTrackCollection
void SetRecoTrack_AlgoA(reco::TrackBaseRef track)
Definition: TPtoRecoTrack.h:30
uint16_t size_type
edm::InputTag trackingParticleLabel_fakes
void SetTrackingParticleD0Dz(TrackingParticleRef tp, const reco::BeamSpot &bs, const MagneticField *bf, TPtoRecoTrack &TPRT)
OrphanHandle< PROD > put(std::auto_ptr< PROD > product)
Put a new product.
Definition: Event.h:116
void SetRecoVertex_AlgoB(reco::VertexRef vertex)
Definition: TPtoRecoTrack.h:37
unsigned int size_type
Definition: View.h:85
void SetRecoVertex_AlgoA(reco::VertexRef vertex)
Definition: TPtoRecoTrack.h:36
edm::InputTag vertexLabel_algoB
bool getByLabel(InputTag const &tag, Handle< PROD > &result) const
Definition: Event.h:390
edm::InputTag vertexLabel_algoA
edm::InputTag trackLabel_algoA
void SetShared_AlgoB(const float &mB)
Definition: TPtoRecoTrack.h:34
void SetRecoTrack(reco::TrackBaseRef track)
Definition: RecoTracktoTP.h:29
const T & get() const
Definition: EventSetup.h:55
T const * product() const
Definition: ESHandle.h:62
edm::InputTag associatormap_algoA
T const * product() const
Definition: Handle.h:81
void SetBeamSpot(const math::XYZPoint &bs)
Definition: TPtoRecoTrack.h:39
edm::InputTag associatormap_algoB
void SetBeamSpot(const math::XYZPoint &bs)
Definition: RecoTracktoTP.h:31
const Point & position() const
position
Definition: BeamSpot.h:62
void SetRecoTrack_AlgoB(reco::TrackBaseRef track)
Definition: TPtoRecoTrack.h:31
edm::Ref< TrackingParticleCollection > TrackingParticleRef
edm::InputTag trackLabel_algoB
void TrackAlgoCompareUtil::SetTrackingParticleD0Dz ( TrackingParticleRef  tp,
const reco::BeamSpot bs,
const MagneticField bf,
TPtoRecoTrack TPRT 
)
private

Definition at line 272 of file TrackAlgoCompareUtil.cc.

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

273 {
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() );
278  TrackCharge trackingParticleCharge(tp->charge());
279 
280  FreeTrajectoryState ftsAtProduction( trackingParticleVertex, trackingParticleP3, trackingParticleCharge, bf );
281  TSCBLBuilderNoMaterial tscblBuilder;
282  TrajectoryStateClosestToBeamLine tsAtClosestApproach = tscblBuilder(ftsAtProduction, bs); //as in TrackProducerAlgorithm
283 
284  if(tsAtClosestApproach.isValid())
285  {
286  GlobalPoint v1 = tsAtClosestApproach.trackStateAtPCA().position();
287  GlobalVector p = tsAtClosestApproach.trackStateAtPCA().momentum();
288 
290  TPRT.SetTrackingParticlePCA(v1);
291  }
292  else
293  {
294  TPRT.SetTrackingParticleMomentumPCA(GlobalVector(-9999.0, -9999.0, -9999.0));
295  TPRT.SetTrackingParticlePCA(GlobalPoint(-9999.0, -9999.0, -9999.0));
296  }
297 }
void SetTrackingParticleMomentumPCA(const GlobalVector &p)
Definition: TPtoRecoTrack.h:81
Global3DPoint GlobalPoint
Definition: GlobalPoint.h:10
void SetTrackingParticlePCA(const GlobalPoint &v)
Definition: TPtoRecoTrack.h:82
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 
)
private

Definition at line 300 of file TrackAlgoCompareUtil.cc.

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

301 {
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() );
306  TrackCharge trackingParticleCharge(tp->charge());
307 
308  FreeTrajectoryState ftsAtProduction( trackingParticleVertex, trackingParticleP3, trackingParticleCharge, bf );
309  TSCBLBuilderNoMaterial tscblBuilder;
310  TrajectoryStateClosestToBeamLine tsAtClosestApproach = tscblBuilder(ftsAtProduction, bs); //as in TrackProducerAlgorithm
311 
312  if(tsAtClosestApproach.isValid())
313  {
314  GlobalPoint v1 = tsAtClosestApproach.trackStateAtPCA().position();
315  GlobalVector p = tsAtClosestApproach.trackStateAtPCA().momentum();
316 
318  RTTP.SetTrackingParticlePCA(v1);
319  }
320  else
321  {
322  RTTP.SetTrackingParticleMomentumPCA(GlobalVector(-9999.0, -9999.0, -9999.0));
323  RTTP.SetTrackingParticlePCA(GlobalPoint(-9999.0, -9999.0, -9999.0));
324  }
325 }
void SetTrackingParticleMomentumPCA(const GlobalVector &p)
Definition: RecoTracktoTP.h:56
Global3DPoint GlobalPoint
Definition: GlobalPoint.h:10
void SetTrackingParticlePCA(const GlobalPoint &v)
Definition: RecoTracktoTP.h:57
int TrackCharge
Definition: TrackCharge.h:4
GlobalVector momentum() const
GlobalPoint position() const
Global3DVector GlobalVector
Definition: GlobalVector.h:10

Member Data Documentation

edm::InputTag TrackAlgoCompareUtil::associatormap_algoA
private

Definition at line 82 of file TrackAlgoCompareUtil.h.

edm::InputTag TrackAlgoCompareUtil::associatormap_algoB
private

Definition at line 83 of file TrackAlgoCompareUtil.h.

std::string TrackAlgoCompareUtil::assocLabel_algoA
private

Definition at line 86 of file TrackAlgoCompareUtil.h.

std::string TrackAlgoCompareUtil::assocLabel_algoB
private

Definition at line 87 of file TrackAlgoCompareUtil.h.

edm::InputTag TrackAlgoCompareUtil::beamSpotLabel
private

Definition at line 81 of file TrackAlgoCompareUtil.h.

edm::InputTag TrackAlgoCompareUtil::trackingParticleLabel_effic
private

Definition at line 77 of file TrackAlgoCompareUtil.h.

edm::InputTag TrackAlgoCompareUtil::trackingParticleLabel_fakes
private

Definition at line 76 of file TrackAlgoCompareUtil.h.

edm::InputTag TrackAlgoCompareUtil::trackingVertexLabel
private

Definition at line 80 of file TrackAlgoCompareUtil.h.

edm::InputTag TrackAlgoCompareUtil::trackLabel_algoA
private

Definition at line 74 of file TrackAlgoCompareUtil.h.

edm::InputTag TrackAlgoCompareUtil::trackLabel_algoB
private

Definition at line 75 of file TrackAlgoCompareUtil.h.

bool TrackAlgoCompareUtil::UseAssociators
private

Definition at line 84 of file TrackAlgoCompareUtil.h.

bool TrackAlgoCompareUtil::UseVertex
private

Definition at line 85 of file TrackAlgoCompareUtil.h.

edm::InputTag TrackAlgoCompareUtil::vertexLabel_algoA
private

Definition at line 78 of file TrackAlgoCompareUtil.h.

edm::InputTag TrackAlgoCompareUtil::vertexLabel_algoB
private

Definition at line 79 of file TrackAlgoCompareUtil.h.