CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
TrajectorySeedProducer.cc
Go to the documentation of this file.
1 
6 
9 
12 
16 
18 
20 
24 
27 
30 
31 //Propagator withMaterial
33 
35 
36 
37 #include <unordered_set>
38 
39 
40 template class SeedingTree<TrackingLayer>;
41 template class SeedingNode<TrackingLayer>;
42 
45  magneticFieldMap(nullptr),
46  trackerGeometry(nullptr),
47  trackerTopology(nullptr),
48  testBeamspotCompatibility(false),
50  testPrimaryVertexCompatibility(false),
52 {
53  // The name of the TrajectorySeed Collection
54  produces<TrajectorySeedCollection>();
55 
56 
57 
58  const edm::ParameterSet& simTrackSelectionConfig = conf.getParameter<edm::ParameterSet>("simTrackSelection");
59  // The smallest pT,dxy,dz for a simtrack
60  simTrack_pTMin = simTrackSelectionConfig.getParameter<double>("pTMin");
61  simTrack_maxD0 = simTrackSelectionConfig.getParameter<double>("maxD0");
62  simTrack_maxZ0 = simTrackSelectionConfig.getParameter<double>("maxZ0");
63  //simtracks to skip (were processed in previous iterations)
64  std::vector<edm::InputTag> skipSimTrackTags = simTrackSelectionConfig.getParameter<std::vector<edm::InputTag> >("skipSimTrackIds");
65 
66  for ( unsigned int k=0; k<skipSimTrackTags.size(); ++k)
67  {
68  skipSimTrackIdTokens.push_back(consumes<std::vector<unsigned int> >(skipSimTrackTags[k]));
69  }
70 
71 
72  // The smallest number of hits for a track candidate
73  minLayersCrossed = conf.getParameter<unsigned int>("minLayersCrossed");
74 
76  if (beamSpotTag.label()!="")
77  {
79  beamSpotToken = consumes<reco::BeamSpot>(beamSpotTag);
80  }
81  edm::InputTag primaryVertexTag = conf.getParameter<edm::InputTag>("primaryVertex");
82  if (primaryVertexTag.label()!="")
83  {
85  recoVertexToken=consumes<reco::VertexCollection>(primaryVertexTag);
86  }
87 
88  //make sure that only one test is performed
90  {
91  throw cms::Exception("FastSimulation/Tracking/TrajectorySeedProducer: bad configuration","Either 'beamSpot' or 'primaryVertex' compatiblity should be configured; not both");
92  }
93 
94  // The name of the hit producer
95  edm::InputTag recHitTag = conf.getParameter<edm::InputTag>("recHits");
96  recHitToken = consumes<SiTrackerGSMatchedRecHit2DCollection>(recHitTag);
97 
98  // read Layers
99  std::vector<std::string> layerStringList = conf.getParameter<std::vector<std::string>>("layerList");
100  for(auto it=layerStringList.cbegin(); it < layerStringList.cend(); ++it)
101  {
102  std::vector<TrackingLayer> trackingLayerList;
103  std::string line = *it;
105  while (pos != std::string::npos)
106  {
107  pos=line.find("+");
108  std::string layer = line.substr(0, pos);
110 
111  trackingLayerList.push_back(layerSpec);
112  line=line.substr(pos+1,std::string::npos);
113  }
114  _seedingTree.insert(trackingLayerList);
115  seedingLayers.push_back(std::move(trackingLayerList));
116  }
117 
118  originRadius = conf.getParameter<double>("originRadius");
119  originHalfLength = conf.getParameter<double>("originHalfLength");
120  ptMin = conf.getParameter<double>("ptMin");
121  nSigmaZ = conf.getParameter<double>("nSigmaZ");
122 
123  //make sure that only one cut is configured
124  if (originHalfLength>=0 && nSigmaZ>=0)
125  {
126  throw cms::Exception("FastSimulation/Tracking/TrajectorySeedProducer: bad configuration","Either 'originHalfLength' or 'nSigmaZ' selection should be configured; not both. Deactivate one (or both) by setting it to <0.");
127  }
128 
129  //make sure that performance cuts are not interfering with selection on reconstruction
130  if ((ptMin>=0 && simTrack_pTMin>=0) && (ptMin<simTrack_pTMin))
131  {
132  throw cms::Exception("FastSimulation/Tracking/TrajectorySeedProducer: bad configuration","Performance cut on SimTrack pT is tighter than cut on pT estimate from seed.");
133  }
134  if ((originHalfLength>=0 && simTrack_maxZ0>=0) && (originHalfLength>simTrack_maxZ0))
135  {
136  throw cms::Exception("FastSimulation/Tracking/TrajectorySeedProducer: bad configuration","Performance cut on SimTrack dz is tighter than cut on dz estimate from seed.");
137  }
138  if ((originRadius>=0 && simTrack_maxD0>=0) && (originRadius>simTrack_maxD0))
139  {
140  throw cms::Exception("FastSimulation/Tracking/TrajectorySeedProducer: bad configuration","Performance cut on SimTrack dxy is tighter than cut on dxy estimate from seed.");
141  }
142  simTrackToken = consumes<edm::SimTrackContainer>(edm::InputTag("famosSimHits"));
143  simVertexToken = consumes<edm::SimVertexContainer>(edm::InputTag("famosSimHits"));
144 }
145 
146 void
148 {
149  edm::ESHandle<MagneticField> magneticFieldHandle;
150  edm::ESHandle<TrackerGeometry> trackerGeometryHandle;
151  edm::ESHandle<MagneticFieldMap> magneticFieldMapHandle;
152  edm::ESHandle<TrackerTopology> trackerTopologyHandle;
153 
154  es.get<IdealMagneticFieldRecord>().get(magneticFieldHandle);
155  es.get<TrackerDigiGeometryRecord>().get(trackerGeometryHandle);
156  es.get<MagneticFieldMapRecord>().get(magneticFieldMapHandle);
157  es.get<TrackerTopologyRcd>().get(trackerTopologyHandle);
158 
159  magneticField = &(*magneticFieldHandle);
160  trackerGeometry = &(*trackerGeometryHandle);
161  magneticFieldMap = &(*magneticFieldMapHandle);
162  trackerTopology = &(*trackerTopologyHandle);
163 
164  thePropagator = std::make_shared<PropagatorWithMaterial>(alongMomentum,0.105,magneticField);
165 }
166 
167 bool
168 TrajectorySeedProducer::passSimTrackQualityCuts(const SimTrack& theSimTrack, const SimVertex& theSimVertex) const
169 {
170  //require min pT of the simtrack
171  if ((simTrack_pTMin>0) && ( theSimTrack.momentum().Perp2() < simTrack_pTMin*simTrack_pTMin))
172  {
173  return false;
174  }
176  {
177  return true;
178  }
179 
180  //require impact parameter of the simtrack
182  RawParticle(
184  theSimTrack.momentum().px(),
185  theSimTrack.momentum().py(),
186  theSimTrack.momentum().pz(),
187  theSimTrack.momentum().e()
188  ),
190  theSimVertex.position().x(),
191  theSimVertex.position().y(),
192  theSimVertex.position().z(),
193  theSimVertex.position().t())
194  ),
195  0.,0.,4.
196  );
197  theParticle.setCharge(theSimTrack.charge());
198 
199 
200  //this are just some cuts on the SimTrack for speed up
201  std::vector<const math::XYZPoint*> origins;
203  {
204  origins.push_back(&beamSpot->position());
205  }
207  {
208  for (unsigned int iv = 0; iv < primaryVertices->size(); ++iv)
209  {
210  origins.push_back(&(*primaryVertices)[iv].position());
211  }
212  }
213 
214  //only one possible origin is required to succeed
215  for (unsigned int i = 0; i < origins.size(); ++i)
216  {
217  if ((simTrack_maxD0>0.0) && ( theParticle.xyImpactParameter(origins[i]->X(),origins[i]->Y()) > simTrack_maxD0 ))
218  {
219  continue;
220  }
221  if ((simTrack_maxZ0>0.0) && ( fabs( theParticle.zImpactParameter(origins[i]->X(),origins[i]->Y()) - origins[i]->Z()) > simTrack_maxZ0))
222  {
223  continue;
224  }
225  return true;
226  }
227  return false;
228 }
229 
230 bool
232 {
233 
234  const GlobalPoint& globalHitPos1 = hit1.globalPosition();
235  const GlobalPoint& globalHitPos2 = hit2.globalPosition();
236  bool forward = hit1.isForward(); // true if hit is in endcap, false = barrel
237  double error = std::sqrt(hit1.largerError()+hit2.largerError());
239  {
240  return compatibleWithBeamSpot(globalHitPos1,globalHitPos2,error,forward);
241  }
243  {
244  return compatibleWithPrimaryVertex(globalHitPos1,globalHitPos2,error,forward);
245  }
246  else
247  {
248  return true;
249  }
250 
251 }
252 
254  const std::vector<TrajectorySeedHitCandidate>& trackerRecHits,
255  std::vector<int>& hitIndicesInTree,
256  const SeedingNode<TrackingLayer>* node, unsigned int trackerHit
257 ) const
258 {
259  if (!node->getParent() || hitIndicesInTree[node->getParent()->getIndex()]>=0)
260  {
261  if (hitIndicesInTree[node->getIndex()]<0)
262  {
263  const TrajectorySeedHitCandidate& currentTrackerHit = trackerRecHits[trackerHit];
264  if (!isHitOnLayer(currentTrackerHit,node->getData()))
265  {
266  return nullptr;
267  }
268  if (!passHitTuplesCuts(*node,trackerRecHits,hitIndicesInTree,currentTrackerHit))
269  {
270  return nullptr;
271  }
272  hitIndicesInTree[node->getIndex()]=trackerHit;
273  if (node->getChildrenSize()==0)
274  {
275  return node;
276  }
277  return nullptr;
278  }
279  else
280  {
281  for (unsigned int ichild = 0; ichild<node->getChildrenSize(); ++ichild)
282  {
283  const SeedingNode<TrackingLayer>* seed = insertHit(trackerRecHits,hitIndicesInTree,node->getChild(ichild),trackerHit);
284  if (seed)
285  {
286  return seed;
287  }
288  }
289  }
290  }
291  return nullptr;
292 }
293 
294 
295 std::vector<unsigned int> TrajectorySeedProducer::iterateHits(
296  unsigned int start,
297  const std::vector<TrajectorySeedHitCandidate>& trackerRecHits,
298  std::vector<int> hitIndicesInTree,
299  bool processSkippedHits
300  ) const
301 {
302  for (unsigned int irecHit = start; irecHit<trackerRecHits.size(); ++irecHit)
303  {
304  unsigned int currentHitIndex=irecHit;
305 
306  for (unsigned int inext=currentHitIndex+1; inext< trackerRecHits.size(); ++inext)
307  {
308  //if multiple hits are on the same layer -> follow all possibilities by recusion
309  if (trackerRecHits[currentHitIndex].getTrackingLayer()==trackerRecHits[inext].getTrackingLayer())
310  {
311  if (processSkippedHits)
312  {
313  //recusively call the method again with hit 'inext' but skip all following on the same layer though 'processSkippedHits=false'
314  std::vector<unsigned int> seedHits = iterateHits(
315  inext,
316  trackerRecHits,
317  hitIndicesInTree,
318  false
319  );
320  if (seedHits.size()>0)
321  {
322  return seedHits;
323  }
324  }
325  irecHit+=1;
326  }
327  else
328  {
329  break;
330  }
331  }
332 
333  processSkippedHits=true;
334 
335  const SeedingNode<TrackingLayer>* seedNode = nullptr;
336  for (unsigned int iroot=0; seedNode==nullptr && iroot<_seedingTree.numberOfRoots(); ++iroot)
337  {
338  seedNode=insertHit(trackerRecHits,hitIndicesInTree,_seedingTree.getRoot(iroot), currentHitIndex);
339  }
340  if (seedNode)
341  {
342  std::vector<unsigned int> seedIndices(seedNode->getDepth()+1);
343  while (seedNode)
344  {
345  seedIndices[seedNode->getDepth()]=hitIndicesInTree[seedNode->getIndex()];
346  seedNode=seedNode->getParent();
347  }
348  return seedIndices;
349  }
350 
351  }
352 
353  return std::vector<unsigned int>();
354 
355 }
356 
357 void
359 {
360  PTrajectoryStateOnDet initialState;
361 
362  // the tracks to be skipped
363  std::unordered_set<unsigned int> skipSimTrackIds;
364  for ( unsigned int i=0; i<skipSimTrackIdTokens.size(); ++i )
365  {
366  edm::Handle<std::vector<unsigned int> > skipSimTrackIds_temp;
367  e.getByToken(skipSimTrackIdTokens[i],skipSimTrackIds_temp);
368  skipSimTrackIds.insert(skipSimTrackIds_temp->begin(),skipSimTrackIds_temp->end());
369  }
370  // Beam spot
372  {
373  edm::Handle<reco::BeamSpot> recoBeamSpotHandle;
374  e.getByToken(beamSpotToken,recoBeamSpotHandle);
375  beamSpot = recoBeamSpotHandle.product();
376  }
377 
378  // Primary vertices
380  {
382  e.getByToken(recoVertexToken,theRecVtx);
383  primaryVertices = theRecVtx.product();
384  }
385 
386  // SimTracks and SimVertices
388  e.getByToken(simTrackToken,theSimTracks);
389 
391  e.getByToken(simVertexToken,theSimVtx);
392 
393  // edm::Handle<SiTrackerGSRecHit2DCollection> theGSRecHits;
395  e.getByToken(recHitToken, theGSRecHits);
396 
397  std::auto_ptr<TrajectorySeedCollection> output{new TrajectorySeedCollection()};
398 
399  //if no hits -> directly write empty collection
400  if(theGSRecHits->size() == 0)
401  {
402  e.put(output);
403  return;
404  }
405  for (SiTrackerGSMatchedRecHit2DCollection::id_iterator itSimTrackId=theGSRecHits->id_begin(); itSimTrackId!=theGSRecHits->id_end(); ++itSimTrackId )
406  {
407 
408  const unsigned int currentSimTrackId = *itSimTrackId;
409 
410  if(skipSimTrackIds.find(currentSimTrackId)!=skipSimTrackIds.end())
411  {
412  continue;
413  }
414 
415  const SimTrack& theSimTrack = (*theSimTracks)[currentSimTrackId];
416 
417  int vertexIndex = theSimTrack.vertIndex();
418  if (vertexIndex<0)
419  {
420  //tracks are required to be associated to a vertex
421  continue;
422  }
423  const SimVertex& theSimVertex = (*theSimVtx)[vertexIndex];
424 
425  if (!this->passSimTrackQualityCuts(theSimTrack,theSimVertex))
426  {
427  continue;
428  }
429  SiTrackerGSMatchedRecHit2DCollection::range recHitRange = theGSRecHits->get(currentSimTrackId);
430 
431  TrajectorySeedHitCandidate previousTrackerHit;
432  TrajectorySeedHitCandidate currentTrackerHit;
433  unsigned int layersCrossed=0;
434 
435  std::vector<TrajectorySeedHitCandidate> trackerRecHits;
436  for (SiTrackerGSMatchedRecHit2DCollection::const_iterator itRecHit = recHitRange.first; itRecHit!=recHitRange.second; ++itRecHit)
437  {
438  const SiTrackerGSMatchedRecHit2D& vec = *itRecHit;
439  previousTrackerHit=currentTrackerHit;
440 
442 
443  if (!currentTrackerHit.isOnTheSameLayer(previousTrackerHit))
444  {
445  ++layersCrossed;
446  }
447  if (_seedingTree.getSingleSet().find(currentTrackerHit.getTrackingLayer())!=_seedingTree.getSingleSet().end())
448  {
449  //add only the hits which are actually on the requested layers
450  trackerRecHits.push_back(std::move(currentTrackerHit));
451  }
452  }
453 
454  if ( layersCrossed < minLayersCrossed)
455  {
456  continue;
457  }
458 
459  std::vector<int> hitIndicesInTree(_seedingTree.numberOfNodes(),-1);
460  //A SeedingNode is associated by its index to this list. The list stores the indices of the hits in 'trackerRecHits'
461  /* example
462  SeedingNode | hit index | hit
463  -------------------------------------------------------------------------------
464  index= 0: [BPix1] | hitIndicesInTree[0] (=1) | trackerRecHits[1]
465  index= 1: -- [BPix2] | hitIndicesInTree[1] (=3) | trackerRecHits[3]
466  index= 2: -- -- [BPix3] | hitIndicesInTree[2] (=4) | trackerRecHits[4]
467  index= 3: -- -- [FPix1_pos] | hitIndicesInTree[3] (=6) | trackerRecHits[6]
468  index= 4: -- -- [FPix1_neg] | hitIndicesInTree[4] (=7) | trackerRecHits[7]
469 
470  The implementation has been chosen such that the tree only needs to be build once upon construction.
471  */
472 
473  std::vector<unsigned int> seedHitNumbers = iterateHits(0,trackerRecHits,hitIndicesInTree,true);
474 
475  if (seedHitNumbers.size()>0)
476  {
478  for ( unsigned ihit=0; ihit<seedHitNumbers.size(); ++ihit )
479  {
480  TrackingRecHit* aTrackingRecHit = trackerRecHits[seedHitNumbers[ihit]].hit()->clone();
481  recHits.push_back(aTrackingRecHit);
482  }
483  GlobalPoint position((*theSimVtx)[vertexIndex].position().x(),
484  (*theSimVtx)[vertexIndex].position().y(),
485  (*theSimVtx)[vertexIndex].position().z());
486 
487  GlobalVector momentum(theSimTrack.momentum().x(),theSimTrack.momentum().y(),theSimTrack.momentum().z());
488  float charge = theSimTrack.charge();
489  GlobalTrajectoryParameters initialParams(position,momentum,(int)charge,magneticField);
491  //this line help the fit succeed in the case of pixelless tracks (4th and 5th iteration)
492  //for the future: probably the best thing is to use the mini-kalmanFilter
493  if(trackerRecHits[seedHitNumbers[0]].subDetId() !=1 ||trackerRecHits[seedHitNumbers[0]].subDetId() !=2)
494  {
495  errorMatrix = errorMatrix * 0.0000001;
496  }
497  CurvilinearTrajectoryError initialError(errorMatrix);
498  FreeTrajectoryState initialFTS(initialParams, initialError);
499 
500  const GeomDet* initialLayer = trackerGeometry->idToDet( recHits.back().geographicalId() );
501  const TrajectoryStateOnSurface initialTSOS = thePropagator->propagate(initialFTS,initialLayer->surface()) ;
502 
503  if (!initialTSOS.isValid())
504  {
505  break; //continues with the next seeding algorithm
506  }
507 
508  const AlgebraicSymMatrix55& m = initialTSOS.localError().matrix();
509  int dim = 5;
510  float localErrors[15];
511  int k = 0;
512  for (int i=0; i<dim; ++i)
513  {
514  for (int j=0; j<=i; ++j)
515  {
516  localErrors[k++] = m(i,j);
517  }
518  }
519  int surfaceSide = static_cast<int>(initialTSOS.surfaceSide());
520  initialState = PTrajectoryStateOnDet( initialTSOS.localParameters(),initialTSOS.globalMomentum().perp(),localErrors, recHits.back().geographicalId().rawId(), surfaceSide);
521  output->push_back(TrajectorySeed(initialState, recHits, PropagationDirection::alongMomentum));
522 
523  }
524  } //end loop over simtracks
525 
526 
527  e.put(output);
528 }
529 
530 
531 
532 bool
534  const GlobalPoint& gpos1,
535  const GlobalPoint& gpos2,
536  double error,
537  bool forward
538  ) const
539 {
540 
541  // The hits 1 and 2 positions, in HepLorentzVector's
542  XYZTLorentzVector thePos1(gpos1.x(),gpos1.y(),gpos1.z(),0.);
543  XYZTLorentzVector thePos2(gpos2.x(),gpos2.y(),gpos2.z(),0.);
544 
545  // create a particle with following properties
546  // - charge = +1
547  // - vertex at second rechit
548  // - momentum direction: from first to second rechit
549  // - magnitude of momentum: nonsense (distance between 1st and 2nd rechit)
550  ParticlePropagator myPart(thePos2 - thePos1,thePos2,1.,magneticFieldMap);
551 
552  /*
553  propagateToBeamCylinder does the following
554  - check there exists a track through the 2 hits and through a
555  cylinder with radius "originRadius" centered around the CMS axis
556  - if such tracks exists, pick the one with maximum pt
557  - track vertex z coordinate is z coordinate of closest approach of
558  track to (x,y) = (0,0)
559  - the particle gets the charge that allows the highest pt
560  */
561  if (originRadius>0)
562  {
563  bool intersect = myPart.propagateToBeamCylinder(thePos1,originRadius*1.);
564  if ( !intersect )
565  {
566  return false;
567  }
568  }
569 
570  // Check if the constraints are satisfied
571  // 1. pT at cylinder with radius originRadius
572  if ((ptMin>0) && ( myPart.Pt() < ptMin ))
573  {
574  return false;
575  }
576  // 2. Z compatible with beam spot size
577  // in constuctur only one of originHalfLength,nSigmaZ is allowed to be >= 0
578  double zConstraint = std::max(originHalfLength,beamSpot->sigmaZ()*nSigmaZ);
579  if ((zConstraint>0) && ( fabs(myPart.Z()-beamSpot->position().Z()) > zConstraint ))
580  {
581  return false;
582  }
583  return true;
584 }
585 //this fucntion is currently poorly understood and needs clearer comments in the future
586 bool
588  const GlobalPoint& gpos1,
589  const GlobalPoint& gpos2,
590  double error,
591  bool forward
592  ) const
593 {
594 
595  unsigned int nVertices = primaryVertices->size();
596  if ( nVertices==0 || ((originHalfLength < 0.0) && (nSigmaZ < 0.0)))
597  {
598  return true;
599  }
600 
601  // Loop on primary vertices
602  for ( unsigned iv=0; iv<nVertices; ++iv )
603  {
604  // Z position of the primary vertex
605  const reco::Vertex& vertex = (*primaryVertices)[iv];
606 
607  double xV = vertex.x();
608  double yV = vertex.y();
609  double zV = vertex.z();
610 
611  // Radii of the two hits with respect to the vertex position
612  double R1 = std::sqrt ( (gpos1.x()-xV)*(gpos1.x()-xV) + (gpos1.y()-yV)*(gpos1.y()-yV) );
613  double R2 = std::sqrt ( (gpos2.x()-xV)*(gpos2.x()-xV) + (gpos2.y()-yV)*(gpos2.y()-yV) );
614 
615  double zConstraint = std::max(originHalfLength,vertex.zError()*nSigmaZ);
616  //inner hit must be within a sort of pyramid using
617  //the outer hit and the cylinder around the PV
618  double checkRZ1 = forward ?
619  (gpos1.z()-zV+zConstraint) / (gpos2.z()-zV+zConstraint) * R2 :
620  -zConstraint + R1/R2*(gpos2.z()-zV+zConstraint);
621  double checkRZ2 = forward ?
622  (gpos1.z()-zV-zConstraint)/(gpos2.z()-zV-zConstraint) * R2 :
623  +zConstraint + R1/R2*(gpos2.z()-zV-zConstraint);
624  double checkRZmin = std::min(checkRZ1,checkRZ2)-3.*error;
625  double checkRZmax = std::max(checkRZ1,checkRZ2)+3.*error;
626  // Check if the innerhit is within bounds
627  bool compatible = forward ?
628  checkRZmin < R1 && R1 < checkRZmax :
629  checkRZmin < gpos1.z()-zV && gpos1.z()-zV < checkRZmax;
630  // If it is, just return ok
631  if ( compatible )
632  {
633  return compatible;
634  }
635  }
636  // Otherwise, return not ok
637  return false;
638 
639 }
640 
const double Z[kNumberCalorimeter]
bool passHitTuplesCuts(const SeedingNode< TrackingLayer > &seedingNode, const std::vector< TrajectorySeedHitCandidate > &trackerRecHits, const std::vector< int > &hitIndicesInTree, const TrajectorySeedHitCandidate &currentTrackerHit) const
method checks if a TrajectorySeedHitCandidate fulfills the quality requirements.
void setCharge(float q)
set the MEASURED charge
Definition: RawParticle.cc:139
T getParameter(std::string const &) const
int i
Definition: DBlmapReader.cc:9
reference back()
Definition: OwnVector.h:327
tuple start
Check for commandline option errors.
Definition: dqm_diff.py:58
const MagneticField * magneticField
std::pair< const_iterator, const_iterator > range
iterator range
Definition: RangeMap.h:50
double zImpactParameter(double x0=0, double y0=0.) const
Longitudinal impact parameter.
bool compatibleWithBeamSpot(const GlobalPoint &gpos1, const GlobalPoint &gpos2, double error, bool forward) const
T perp() const
Definition: PV3DBase.h:72
TrajectorySeedProducer(const edm::ParameterSet &conf)
const LocalTrajectoryParameters & localParameters() const
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:457
double zError() const
error on z
Definition: Vertex.h:118
double y() const
y coordinate
Definition: Vertex.h:110
const SingleSet & getSingleSet() const
Definition: SeedingTree.h:204
ROOT::Math::SMatrixIdentity AlgebraicMatrixID
bool isForward() const
Is it a forward hit ?
T y() const
Definition: PV3DBase.h:63
#define X(str)
Definition: MuonsGrabber.cc:48
bool propagateToBeamCylinder(const XYZTLorentzVector &v, double radius=0.)
virtual void produce(edm::Event &e, const edm::EventSetup &es)
identifier iterator
Definition: RangeMap.h:136
ROOT::Math::SMatrix< double, 5, 5, ROOT::Math::MatRepSym< double, 5 > > AlgebraicSymMatrix55
GlobalPoint globalPosition() const
The global position.
const DATA & getData() const
Definition: SeedingTree.h:136
#define nullptr
float charge() const
charge
Definition: CoreSimTrack.cc:18
unsigned int getChildrenSize() const
Definition: SeedingTree.h:121
uint16_t size_type
const Plane & surface() const
The nominal surface of the GeomDet.
Definition: GeomDet.h:40
edm::EDGetTokenT< SiTrackerGSMatchedRecHit2DCollection > recHitToken
tuple node
Definition: Node.py:50
unsigned int getDepth() const
Definition: SeedingTree.h:84
EDGetTokenT< ProductType > consumes(edm::InputTag const &tag)
const reco::BeamSpot * beamSpot
std::vector< edm::EDGetTokenT< std::vector< unsigned int > > > skipSimTrackIdTokens
uint32_t rawId() const
get the raw id
Definition: DetId.h:43
const SeedingNode * getParent() const
Definition: SeedingTree.h:112
bool insert(const std::vector< DATA > &dataList)
Definition: SeedingTree.h:179
unsigned int numberOfNodes() const
Definition: SeedingTree.h:227
C::const_iterator const_iterator
constant access iterator type
Definition: RangeMap.h:43
void push_back(D *&d)
Definition: OwnVector.h:280
unsigned int numberOfRoots() const
Definition: SeedingTree.h:222
const TrackerTopology * trackerTopology
std::vector< TrajectorySeed > TrajectorySeedCollection
OrphanHandle< PROD > put(std::auto_ptr< PROD > product)
Put a new product.
Definition: Event.h:115
unsigned int subDetId[18]
T sqrt(T t)
Definition: SSEVec.h:48
SurfaceSide surfaceSide() const
Position relative to material, defined relative to momentum vector.
const reco::VertexCollection * primaryVertices
T z() const
Definition: PV3DBase.h:64
virtual std::vector< unsigned int > iterateHits(unsigned int start, const std::vector< TrajectorySeedHitCandidate > &trackerRecHits, std::vector< int > hitIndicesInTree, bool processSkippedHits) const
method tries to insert all hits into the tree structure.
double Z() const
z of vertex
Definition: RawParticle.h:276
int j
Definition: DBlmapReader.cc:9
double z() const
y coordinate
Definition: Vertex.h:112
virtual void beginRun(edm::Run const &run, const edm::EventSetup &es)
static TrackingLayer createFromString(std::string layerSpecification)
const AlgebraicSymMatrix55 & matrix() const
const math::XYZTLorentzVectorD & position() const
Definition: CoreSimVertex.h:26
T min(T a, T b)
Definition: MathUtil.h:58
const LocalTrajectoryError & localError() const
edm::EDGetTokenT< edm::SimVertexContainer > simVertexToken
bool isHitOnLayer(const TrajectorySeedHitCandidate &trackerRecHit, const TrackingLayer &layer) const
tuple conf
Definition: dbtoconf.py:185
bool pass2HitsCuts(const TrajectorySeedHitCandidate &hit1, const TrajectorySeedHitCandidate &hit2) const
virtual TrackingRecHit * clone() const =0
int vertIndex() const
index of the vertex in the Event container (-1 if no vertex)
Definition: SimTrack.h:29
edm::EDGetTokenT< edm::SimTrackContainer > simTrackToken
virtual bool passSimTrackQualityCuts(const SimTrack &theSimTrack, const SimVertex &theSimVertex) const
method checks if a SimTrack fulfills the quality requirements.
virtual TrackingRecHit const * hit() const
double x() const
x coordinate
Definition: Vertex.h:108
T const * product() const
Definition: Handle.h:81
const T & get() const
Definition: EventSetup.h:55
double sigmaZ() const
sigma z
Definition: BeamSpot.h:80
std::vector< std::vector< TrackingLayer > > seedingLayers
std::string const & label() const
Definition: InputTag.h:43
const SeedingNode< DATA > * getRoot(unsigned int i) const
Definition: SeedingTree.h:232
GlobalVector globalMomentum() const
const math::XYZTLorentzVectorD & momentum() const
Definition: CoreSimTrack.h:22
static int position[264][3]
Definition: ReadPGInfo.cc:509
edm::EDGetTokenT< reco::VertexCollection > recoVertexToken
const TrackerGeometry * trackerGeometry
const SeedingNode< TrackingLayer > * insertHit(const std::vector< TrajectorySeedHitCandidate > &trackerRecHits, std::vector< int > &hitIndicesInTree, const SeedingNode< TrackingLayer > *node, unsigned int trackerHit) const
method inserts hit into the tree structure at an empty position.
std::shared_ptr< PropagatorWithMaterial > thePropagator
const Point & position() const
position
Definition: BeamSpot.h:62
edm::EDGetTokenT< reco::BeamSpot > beamSpotToken
unsigned int getIndex() const
Definition: SeedingTree.h:107
DetId geographicalId() const
volatile std::atomic< bool > shutdown_flag false
const TrackingLayer & getTrackingLayer() const
SeedingTree< TrackingLayer > _seedingTree
bool compatibleWithPrimaryVertex(const GlobalPoint &gpos1, const GlobalPoint &gpos2, double error, bool forward) const
bool isOnTheSameLayer(const TrajectorySeedHitCandidate &other) const
Check if two hits are on the same layer of the same subdetector.
T x() const
Definition: PV3DBase.h:62
const MagneticFieldMap * magneticFieldMap
Definition: Run.h:41
double xyImpactParameter(double x0=0., double y0=0.) const
Transverse impact parameter.
const SeedingNode< DATA > * getChild(unsigned int ichild) const
Definition: SeedingTree.h:126
math::XYZTLorentzVector XYZTLorentzVector
Definition: RawParticle.h:15
virtual const TrackerGeomDet * idToDet(DetId) const