CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
FastTSGFromPropagation.cc
Go to the documentation of this file.
2 
18 
21 // #include "RecoTracker/MeasurementDet/interface/TkStripMeasurementDet.h"
24 
27 
31 
42 
43 
44 using namespace std;
45 
46 
47 FastTSGFromPropagation::FastTSGFromPropagation(const edm::ParameterSet & iConfig) :theTkLayerMeasurements (0), theTracker(0), theNavigation(0), theService(0), theEstimator(0), theTSTransformer(0), theSigmaZ(0), theConfig (iConfig)
48 {
49  theCategory = "FastSimulation|Muons||FastTSGFromPropagation";
50 
51 }
52 
53 FastTSGFromPropagation::FastTSGFromPropagation(const edm::ParameterSet & iConfig, const MuonServiceProxy* service) : theTkLayerMeasurements (0), theTracker(0), theNavigation(0), theService(service),theUpdator(0), theEstimator(0), theTSTransformer(0), theSigmaZ(0), theConfig (iConfig)
54 {
55  theCategory = "FastSimulation|Muons|FastTSGFromPropagation";
56 }
57 
59 {
60 
61  LogTrace(theCategory) << " FastTSGFromPropagation dtor called ";
62  if ( theNavigation ) delete theNavigation;
63  if ( theUpdator ) delete theUpdator;
64  if ( theEstimator ) delete theEstimator;
66  if ( theTSTransformer ) delete theTSTransformer;
68 
69 }
70 
71 void FastTSGFromPropagation::trackerSeeds(const TrackCand& staMuon, const TrackingRegion& region, std::vector<TrajectorySeed> & result) {
72 
73  if ( theResetMethod == "discrete" ) getRescalingFactor(staMuon);
74 
75  TrajectoryStateOnSurface staState = outerTkState(staMuon);
76 
77  if ( !staState.isValid() ) {
78  LogTrace(theCategory) << "Error: initial state from L2 muon is invalid.";
79  return;
80  }
81 
82  LogTrace(theCategory) << "begin of trackerSeed:\n staState pos: "<<staState.globalPosition()
83  << " mom: "<<staState.globalMomentum()
84  <<"pos eta: "<<staState.globalPosition().eta()
85  <<"mom eta: "<<staState.globalMomentum().eta();
86 
87 
88  std::vector<const DetLayer*> nls = theNavigation->compatibleLayers(*(staState.freeState()), oppositeToMomentum);
89 
90  LogTrace(theCategory) << " compatible layers: "<<nls.size();
91 
92  if ( nls.empty() ) return;
93 
94  int ndesLayer = 0;
95 
96  bool usePredictedState = false;
97 
98  if ( theUpdateStateFlag ) { //use updated states
99  std::vector<TrajectoryMeasurement> alltm;
100 
101  for (std::vector<const DetLayer*>::const_iterator inl = nls.begin();
102  inl != nls.end(); inl++, ndesLayer++ ) {
103  if ( (*inl == 0) ) break;
104 // if ( (inl != nls.end()-1 ) && ( (*inl)->subDetector() == GeomDetEnumerators::TEC ) && ( (*(inl+1))->subDetector() == GeomDetEnumerators::TOB ) ) continue;
105  alltm = findMeasurements_new(*inl, staState);
106  if ( (!alltm.empty()) ) {
107  LogTrace(theCategory) << "final compatible layer: "<<ndesLayer;
108  break;
109  }
110  }
111 
112  if ( alltm.empty() ) {
113  LogTrace(theCategory) << " NO Measurements Found: eta: "<<staState.globalPosition().eta() <<"pt "<<staState.globalMomentum().perp();
114  usePredictedState = true;
115  } else {
116  LogTrace(theCategory) << " Measurements for seeds: "<<alltm.size();
117  std::stable_sort(alltm.begin(),alltm.end(),increasingEstimate());
118  if ( alltm.size() > 5 ) alltm.erase(alltm.begin() + 5, alltm.end());
119 
120  const edm::SimTrackContainer* simTracks = &(*theSimTracks);
121  const std::vector<unsigned> theSimTrackIds = theGSRecHits->ids();
122  TrackerRecHit theSeedHits;
123  std::vector<TrackerRecHit> outerHits;
124 
125  //std::vector<TrajectorySeed> tmpTS;
126  bool isMatch = false;
127  for (std::vector<TrajectoryMeasurement>::const_iterator itm = alltm.begin(); itm != alltm.end(); itm++) {
128  const TrajectoryStateOnSurface seedState = itm->predictedState();
129  double preY = seedState.globalPosition().y();
130 
131  // Check SimTrack
132  TrackingRecHit* aTrackingRecHit;
133  FreeTrajectoryState simtrack_trackerstate;
134  for( unsigned tkId=0; tkId != theSimTrackIds.size(); ++tkId ) {
135  const SimTrack & simtrack = (*simTracks)[theSimTrackIds[tkId]];
136  SiTrackerGSMatchedRecHit2DCollection::range theRecHitRange = theGSRecHits->get(theSimTrackIds[tkId]);
137  SiTrackerGSMatchedRecHit2DCollection::const_iterator theRecHitRangeIteratorBegin = theRecHitRange.first;
138  SiTrackerGSMatchedRecHit2DCollection::const_iterator theRecHitRangeIteratorEnd = theRecHitRange.second;
140 
142  simtrack.trackerSurfacePosition().y(),
143  simtrack.trackerSurfacePosition().z());
144  GlobalVector momentum(simtrack.trackerSurfaceMomentum().x(),
145  simtrack.trackerSurfaceMomentum().y(),
146  simtrack.trackerSurfaceMomentum().z());
147  int charge = (int)simtrack.charge();
148  GlobalTrajectoryParameters glb_parameters(position, momentum, charge, &*theService->magneticField().product());
149  simtrack_trackerstate = FreeTrajectoryState(glb_parameters);
150 
151  unsigned int outerId = 0;
152  for( iterRecHit = theRecHitRangeIteratorBegin; iterRecHit != theRecHitRangeIteratorEnd; ++iterRecHit) {
153  theSeedHits = TrackerRecHit(&(*iterRecHit), theGeometry);
154  unsigned int id = theSeedHits.hit()->geographicalId().rawId();
155  if( preY < 0 ) {
156  if( id > outerId ) outerId = id;
157  }
158  else {
159  if( id > outerId ) outerId = id;
160  }
161  }
162  for( iterRecHit = theRecHitRangeIteratorBegin; iterRecHit != theRecHitRangeIteratorEnd; ++iterRecHit) {
163  theSeedHits = TrackerRecHit(&(*iterRecHit), theGeometry);
164  if( itm->recHit()->hit()->geographicalId().rawId() == theSeedHits.hit()->geographicalId().rawId() ) {
165  aTrackingRecHit = theSeedHits.hit()->clone();
166  TransientTrackingRecHit::ConstRecHitPointer recHit = theTTRHBuilder->build(aTrackingRecHit);
167  if( !recHit ) continue;
168  TrajectoryStateOnSurface updatedTSOS = updator()->update(seedState, *(recHit));
169  if( updatedTSOS.isValid() && passSelection(updatedTSOS) ) {
171  container.push_back(recHit->hit()->clone());
172  TrajectorySeed ts = createSeed(updatedTSOS, container, recHit->geographicalId());
173  // check direction
174  const BasicTrajectorySeed* aSeed = &ts;
175  PTrajectoryStateOnDet PTSOD = aSeed->startingState();
176  TrajectoryStateTransform tsTransform;
177  const GeomDet *g = theGeometry->idToDet(PTSOD.detId());
178  TrajectoryStateOnSurface tsos = tsTransform.transientState(PTSOD, &(g->surface()), &*theService->magneticField().product());
179  if( tsos.globalMomentum().basicVector()*seedState.globalMomentum().basicVector() < 0. ) continue;
180  result.push_back(ts);
181  isMatch = true;
182  }
183  }
184  }
185  }
186  }
187  if( !isMatch ) {
188  // if there is no hits w.r.t. TM, find outermost hit
189  for (std::vector<TrajectoryMeasurement>::const_iterator itm = alltm.begin(); itm != alltm.end(); itm++) {
190  const TrajectoryStateOnSurface seedState = itm->predictedState();
191  double preY = seedState.globalPosition().y();
192 
193  // Check SimTrack
194  TrackingRecHit* aTrackingRecHit;
195  FreeTrajectoryState simtrack_trackerstate;
196  for( unsigned tkId=0; tkId != theSimTrackIds.size(); ++tkId ) {
197  const SimTrack & simtrack = (*simTracks)[theSimTrackIds[tkId]];
198  SiTrackerGSMatchedRecHit2DCollection::range theRecHitRange = theGSRecHits->get(theSimTrackIds[tkId]);
199  SiTrackerGSMatchedRecHit2DCollection::const_iterator theRecHitRangeIteratorBegin = theRecHitRange.first;
200  SiTrackerGSMatchedRecHit2DCollection::const_iterator theRecHitRangeIteratorEnd = theRecHitRange.second;
202 
204  simtrack.trackerSurfacePosition().y(),
205  simtrack.trackerSurfacePosition().z());
206  GlobalVector momentum(simtrack.trackerSurfaceMomentum().x(),
207  simtrack.trackerSurfaceMomentum().y(),
208  simtrack.trackerSurfaceMomentum().z());
209  int charge = (int)simtrack.charge();
210  GlobalTrajectoryParameters glb_parameters(position, momentum, charge, &*theService->magneticField().product());
211  simtrack_trackerstate = FreeTrajectoryState(glb_parameters);
212 
213  unsigned int outerId = 0;
214  for( iterRecHit = theRecHitRangeIteratorBegin; iterRecHit != theRecHitRangeIteratorEnd; ++iterRecHit) {
215  theSeedHits = TrackerRecHit(&(*iterRecHit), theGeometry);
216  unsigned int id = theSeedHits.hit()->geographicalId().rawId();
217  if( preY < 0 ) {
218  if( id > outerId ) outerId = id;
219  }
220  else {
221  if( id > outerId ) outerId = id;
222  }
223  }
224  for( iterRecHit = theRecHitRangeIteratorBegin; iterRecHit != theRecHitRangeIteratorEnd; ++iterRecHit) {
225  theSeedHits = TrackerRecHit(&(*iterRecHit), theGeometry);
226  if( outerId == theSeedHits.hit()->geographicalId().rawId() ) {
227  aTrackingRecHit = theSeedHits.hit()->clone();
228  TransientTrackingRecHit::ConstRecHitPointer recHit = theTTRHBuilder->build(aTrackingRecHit);
229  if( !recHit ) continue;
230  TrajectoryStateOnSurface updatedTSOS = updator()->update(seedState, *(recHit));
231  if( updatedTSOS.isValid() && passSelection(updatedTSOS) ) {
233  container.push_back(recHit->hit()->clone());
234  TrajectorySeed ts = createSeed(updatedTSOS, container, recHit->geographicalId());
235  // check direction
236  const BasicTrajectorySeed* aSeed = &ts;
237  PTrajectoryStateOnDet PTSOD = aSeed->startingState();
238  TrajectoryStateTransform tsTransform;
239  const GeomDet *g = theGeometry->idToDet(PTSOD.detId());
240  TrajectoryStateOnSurface tsos = tsTransform.transientState(PTSOD, &(g->surface()), &*theService->magneticField().product());
241  if( tsos.globalMomentum().basicVector()*seedState.globalMomentum().basicVector() < 0. ) continue;
242  result.push_back(ts);
243  }
244  }
245  }
246  }
247  }
248  }
249 
250  /*
251  for( unsigned ir = 0; ir < tmpTS.size(); ir++ ) {
252  const BasicTrajectorySeed* aSeed = &((tmpTS)[ir]);
253  PTrajectoryStateOnDet PTSOD = aSeed->startingState();
254  TrajectoryStateTransform tsTransform;
255  DetId seedDetId(PTSOD.detId());
256  const GeomDet * g = theGeometry->idToDet(seedDetId);
257  TrajectoryStateOnSurface tsos = tsTransform.transientState(PTSOD, &(g->surface()), &*theService->magneticField().product());
258  cout << "tsos3 = " << tsos.globalMomentum() << endl;
259  if( _index == ir ) {
260  cout << "tsos4 = " << tsos.globalMomentum() << endl;
261  result.push_back(tmpTS[ir]);
262  }
263  }
264  */
265  LogTrace(theCategory) << "result: "<<result.size();
266  return;
267  }
268  }
269 
270  if ( !theUpdateStateFlag || usePredictedState ) { //use predicted states
271  LogTrace(theCategory) << "use predicted state: ";
272  for (std::vector<const DetLayer*>::const_iterator inl = nls.begin();
273  inl != nls.end(); inl++ ) {
274 
275  if ( !result.empty() || *inl == 0 ) {
276  break;
277  }
278  std::vector<DetLayer::DetWithState> compatDets = (*inl)->compatibleDets(staState, *propagator(), *estimator());
279  LogTrace(theCategory) << " compatDets "<<compatDets.size();
280  if ( compatDets.empty() ) continue;
281  TrajectorySeed ts = createSeed(compatDets.front().second, compatDets.front().first->geographicalId());
282  result.push_back(ts);
283 
284  }
285  LogTrace(theCategory) << "result: "<<result.size();
286  return;
287  }
288  return;
289 }
290 
292 
293  theMaxChi2 = theConfig.getParameter<double>("MaxChi2");
294 
295  theFixedErrorRescaling = theConfig.getParameter<double>("ErrorRescaling");
296 
297  theFlexErrorRescaling = 1.0;
298 
299  theResetMethod = theConfig.getParameter<std::string>("ResetMethod");
300 
301  if (theResetMethod != "discrete" && theResetMethod != "fixed" && theResetMethod != "matrix" ) {
302  edm::LogError("FastTSGFromPropagation")
303  <<"Wrong error rescaling method: "<<theResetMethod <<"\n"
304  <<"Possible choices are: discrete, fixed, matrix.\n"
305  <<"Use discrete method" <<std::endl;
306  theResetMethod = "discrete";
307  }
308 
310 
311  theCacheId_MT = 0;
312 
313  theCacheId_TG = 0;
314 
315  thePropagatorName = theConfig.getParameter<std::string>("Propagator");
316 
317  theService = service;
318 
319  theUseVertexStateFlag = theConfig.getParameter<bool>("UseVertexState");
320 
321  theUpdateStateFlag = theConfig.getParameter<bool>("UpdateState");
322 
323  theSelectStateFlag = theConfig.getParameter<bool>("SelectState");
324 
325  theSimTrackCollectionLabel = theConfig.getParameter<edm::InputTag>("SimTrackCollectionLabel");
327 
328  theUpdator = new KFUpdator();
329 
331 
332  theSigmaZ = theConfig.getParameter<double>("SigmaZ");
333 
334  edm::ParameterSet errorMatrixPset = theConfig.getParameter<edm::ParameterSet>("errorMatrixPset");
335  if ( theResetMethod == "matrix" && !errorMatrixPset.empty()){
336  theAdjustAtIp = errorMatrixPset.getParameter<bool>("atIP");
337  theErrorMatrixAdjuster = new MuonErrorMatrix(errorMatrixPset);
338  } else {
339  theAdjustAtIp =false;
341  }
342 
343  theService->eventSetup().get<TrackerRecoGeometryRecord>().get(theTracker);
345 
347  theService->eventSetup().get<TrackerDigiGeometryRecord>().get(geometry);
348  theGeometry = &(*geometry);
349 
350  theService->eventSetup().get<TransientRecHitRecord>().get("WithTrackAngle", theTTRHBuilder);
351 
352 }
353 
355 
356  bool measTrackerChanged = false;
357 
358  iEvent.getByType(theBeamSpot);
359 
360  // retrieve the MC truth (SimTracks)
363 
364 
365  unsigned long long newCacheId_MT = theService->eventSetup().get<CkfComponentsRecord>().cacheIdentifier();
366 
367  if ( theUpdateStateFlag && newCacheId_MT != theCacheId_MT ) {
368  LogTrace(theCategory) << "Measurment Tracker Geometry changed!";
369  theCacheId_MT = newCacheId_MT;
370  theService->eventSetup().get<CkfComponentsRecord>().get(theMeasTracker);
371  measTrackerChanged = true;
372  }
373 
374  //if ( theUpdateStateFlag ) theMeasTracker->update(iEvent);
375 
376  if ( measTrackerChanged && (&*theMeasTracker) ) {
379  }
380 
381  bool trackerGeomChanged = false;
382 
383  unsigned long long newCacheId_TG = theService->eventSetup().get<TrackerRecoGeometryRecord>().cacheIdentifier();
384 
385  if ( newCacheId_TG != theCacheId_TG ) {
386  LogTrace(theCategory) << "Tracker Reco Geometry changed!";
387  theCacheId_TG = newCacheId_TG;
388  theService->eventSetup().get<TrackerRecoGeometryRecord>().get(theTracker);
389  trackerGeomChanged = true;
390  }
391 
392  if ( trackerGeomChanged && (&*theTracker) ) {
393  if ( theNavigation ) delete theNavigation;
395  }
396 }
397 
399 
400  TrajectoryStateOnSurface innerTS;
401 
402  if ( staMuon.first && staMuon.first->isValid() ) {
403  if (staMuon.first->direction() == alongMomentum) {
404  innerTS = staMuon.first->firstMeasurement().updatedState();
405  }
406  else if (staMuon.first->direction() == oppositeToMomentum) {
407  innerTS = staMuon.first->lastMeasurement().updatedState();
408  }
409  } else {
410  innerTS = theTSTransformer->innerStateOnSurface(*(staMuon.second),*theService->trackingGeometry(), &*theService->magneticField());
411  }
412  //rescale the error
413  adjust(innerTS);
414 
415  return innerTS;
416 
417 // return theTSTransformer->innerStateOnSurface(*(staMuon.second),*theService->trackingGeometry(), &*theService->magneticField());
418 }
419 
421 
423 
424  if ( theUseVertexStateFlag && staMuon.second->pt() > 1.0 ) {
425  FreeTrajectoryState iniState = theTSTransformer->initialFreeState(*(staMuon.second), &*theService->magneticField());
426  //rescale the error at IP
427  adjust(iniState);
428 
429  StateOnTrackerBound fromInside(&*(theService->propagator("PropagatorWithMaterial")));
430  result = fromInside(iniState);
431  } else {
432  StateOnTrackerBound fromOutside(&*propagator());
433  result = fromOutside(innerState(staMuon));
434  }
435  return result;
436 }
437 
439 
441  return createSeed(tsos, container, id);
442 
443 }
444 
446 
447  PTrajectoryStateOnDet* seedTSOS = theTSTransformer->persistentState(tsos,id.rawId());
448  return TrajectorySeed(*seedTSOS,container,oppositeToMomentum);
449 
450 }
451 
452 
453 void FastTSGFromPropagation::validMeasurements(std::vector<TrajectoryMeasurement>& tms) const {
454 
455  std::vector<TrajectoryMeasurement>::iterator tmsend = std::remove_if(tms.begin(), tms.end(), isInvalid());
456  tms.erase(tmsend, tms.end());
457  return;
458 
459 }
460 
461 std::vector<TrajectoryMeasurement> FastTSGFromPropagation::findMeasurements_new(const DetLayer* nl, const TrajectoryStateOnSurface& staState) const {
462 
463  std::vector<TrajectoryMeasurement> result;
464 
465  std::vector<DetLayer::DetWithState> compatDets = nl->compatibleDets(staState, *propagator(), *estimator());
466  if ( compatDets.empty() ) return result;
467 
468  for (std::vector<DetLayer::DetWithState>::const_iterator idws = compatDets.begin(); idws != compatDets.end(); ++idws) {
469  if ( idws->second.isValid() && (idws->first) ) {
470  std::vector<TrajectoryMeasurement> tmptm =
471  theMeasTracker->idToDet(idws->first->geographicalId())->fastMeasurements(idws->second, idws->second, *propagator(), *estimator());
472  //validMeasurements(tmptm);
473 // if ( tmptm.size() > 2 ) {
474 // std::stable_sort(tmptm.begin(),tmptm.end(),increasingEstimate());
475 // result.insert(result.end(),tmptm.begin(), tmptm.begin()+2);
476 // } else {
477  result.insert(result.end(),tmptm.begin(), tmptm.end());
478 // }
479  }
480  }
481 
482  return result;
483 
484 }
485 
486 std::vector<TrajectoryMeasurement> FastTSGFromPropagation::findMeasurements(const DetLayer* nl, const TrajectoryStateOnSurface& staState) const {
487 
488  std::vector<TrajectoryMeasurement> result = tkLayerMeasurements()->measurements((*nl), staState, *propagator(), *estimator());
489  validMeasurements(result);
490  return result;
491 }
492 
494  if ( !theSelectStateFlag ) return true;
495  else {
496  if ( theBeamSpot.isValid() ) {
497  return ( ( fabs(zDis(tsos) - theBeamSpot->z0() ) < theSigmaZ) );
498 
499  } else {
500  return ( ( fabs(zDis(tsos)) < theSigmaZ) );
501 // double theDxyCut = 100;
502 // return ( (zDis(tsos) < theSigmaZ) && (dxyDis(tsos) < theDxyCut) );
503  }
504  }
505 
506 }
507 
509  return fabs(( - tsos.globalPosition().x() * tsos.globalMomentum().y() + tsos.globalPosition().y() * tsos.globalMomentum().x() )/tsos.globalMomentum().perp());
510 }
511 
513  return tsos.globalPosition().z() - tsos.globalPosition().perp() * tsos.globalMomentum().z()/tsos.globalMomentum().perp();
514 }
515 
517  float pt = (staMuon.second)->pt();
518  if ( pt < 13.0 ) theFlexErrorRescaling = 3;
519  else if ( pt < 30.0 ) theFlexErrorRescaling = 5;
520  else theFlexErrorRescaling = 10;
521  return;
522 }
523 
524 
526 
527  //rescale the error
528  if ( theResetMethod == "discreate" ) {
530  return;
531  }
532 
533  //rescale the error
534  if ( theResetMethod == "fixed" || !theErrorMatrixAdjuster) {
536  return;
537  }
538 
540  CurvilinearTrajectoryError sfMat = theErrorMatrixAdjuster->get(state.momentum());//FIXME with position
541  MuonErrorMatrix::multiply(oMat, sfMat);
542 
543  state = FreeTrajectoryState(state.parameters(),
544  oMat);
545 }
546 
548 
549  //rescale the error
550  if ( theResetMethod == "discreate" ) {
552  return;
553  }
554 
555  if ( theResetMethod == "fixed" || !theErrorMatrixAdjuster) {
557  return;
558  }
559 
561  CurvilinearTrajectoryError sfMat = theErrorMatrixAdjuster->get(state.globalMomentum());//FIXME with position
562  MuonErrorMatrix::multiply(oMat, sfMat);
563 
565  oMat,
566  state.surface(),
567  state.surfaceSide(),
568  state.weight());
569 }
570 
572  unsigned int detid,
573  PTrajectoryStateOnDet& pts) const
574 {
575  const AlgebraicSymMatrix55& m = ts.localError().matrix();
576  int dim = 5;
577  float localErrors[15];
578  int k = 0;
579  for (int i=0; i<dim; ++i) {
580  for (int j=0; j<=i; ++j) {
581  localErrors[k++] = m(i,j);
582  }
583  }
584  int surfaceSide = static_cast<int>(ts.surfaceSide());
586  localErrors, detid,
587  surfaceSide);
588 }
std::vector< TrajectoryMeasurement > findMeasurements(const DetLayer *, const TrajectoryStateOnSurface &) const
look for measurements on the first compatible layer
edm::ESHandle< MeasurementTracker > theMeasTracker
const math::XYZVectorD & trackerSurfacePosition() const
Definition: SimTrack.h:36
T getParameter(std::string const &) const
std::vector< TrajectoryMeasurement > measurements(const DetLayer &layer, const TrajectoryStateOnSurface &startingState, const Propagator &prop, const MeasurementEstimator &est) const
int i
Definition: DBlmapReader.cc:9
edm::Handle< reco::BeamSpot > theBeamSpot
std::pair< const_iterator, const_iterator > range
iterator range
Definition: RangeMap.h:53
T perp() const
Definition: PV3DBase.h:66
const Chi2MeasurementEstimator * theEstimator
void adjust(FreeTrajectoryState &) const
adjust the error matrix of the FTS
unsigned long long theCacheId_MT
std::pair< const Trajectory *, reco::TrackRef > TrackCand
const LocalTrajectoryParameters & localParameters() const
const LayerMeasurements * tkLayerMeasurements() const
const GlobalTrajectoryParameters & parameters() const
edm::Handle< edm::SimTrackContainer > theSimTracks
const DirectTrackerNavigation * theNavigation
virtual TrajectoryStateOnSurface update(const TrajectoryStateOnSurface &, const TransientTrackingRecHit &) const =0
const CurvilinearTrajectoryError & curvilinearError() const
virtual ~FastTSGFromPropagation()
destructor
virtual RecHit2DLocalPos * clone() const =0
edm::ESHandle< GeometricSearchTracker > theTracker
T y() const
Definition: PV3DBase.h:57
GlobalPoint globalPosition() const
void validMeasurements(std::vector< TrajectoryMeasurement > &) const
select valid measurements
CurvilinearTrajectoryError get(GlobalVector momentum, bool convolute=true)
main method to be used. Retrieve a 5x5 symetrical matrix according to parametrization of error or sca...
bool getByType(Handle< PROD > &result) const
Definition: Event.h:397
const MuonServiceProxy * theService
TrajectoryStateTransform * theTSTransformer
ROOT::Math::SMatrix< double, 5, 5, ROOT::Math::MatRepSym< double, 5 > > AlgebraicSymMatrix55
float charge() const
charge
Definition: CoreSimTrack.cc:3
double charge(const std::vector< uint8_t > &Ampls)
const CurvilinearTrajectoryError & curvilinearError() const
The Signals That Services Can Subscribe To This is based on ActivityRegistry and is current per Services can connect to the signals distributed by the ActivityRegistry in order to monitor the activity of the application Each possible callback has some defined which we here list in angle e g
Definition: Activities.doc:4
virtual std::vector< DetWithState > compatibleDets(const TrajectoryStateOnSurface &startingState, const Propagator &prop, const MeasurementEstimator &est) const
static int position[TOTALCHAMBERS][3]
Definition: ReadPGInfo.cc:509
const Chi2MeasurementEstimator * estimator() const
FastTSGFromPropagation(const edm::ParameterSet &pset)
constructor
uint32_t rawId() const
get the raw id
Definition: DetId.h:45
void getRescalingFactor(const TrackCand &staMuon)
C::const_iterator const_iterator
constant access iterator type
Definition: RangeMap.h:46
void push_back(D *&d)
Definition: OwnVector.h:290
int iEvent
Definition: GenABIO.cc:243
bool passSelection(const TrajectoryStateOnSurface &) const
check some quantity and beam-spot compatibility and decide to continue
FreeTrajectoryState * freeState(bool withErrors=true) const
const TrajectoryStateUpdator * theUpdator
SurfaceSide surfaceSide() const
Position relative to material, defined relative to momentum vector.
T z() const
Definition: PV3DBase.h:58
tuple result
Definition: query.py:137
int j
Definition: DBlmapReader.cc:9
TrajectoryStateOnSurface transientState(const PTrajectoryStateOnDet &ts, const Surface *surface, const MagneticField *field) const
std::vector< TrajectoryMeasurement > findMeasurements_new(const DetLayer *, const TrajectoryStateOnSurface &) const
look for measurements on the first compatible layer (faster way)
TrajectoryStateOnSurface outerTkState(const TrackCand &) const
const AlgebraicSymMatrix55 & matrix() const
PTrajectoryStateOnDet * persistentState(const TrajectoryStateOnSurface &ts, unsigned int detid) const
static void multiply(CurvilinearTrajectoryError &initial_error, const CurvilinearTrajectoryError &scale_error)
multiply term by term the two matrix
TrajectoryStateOnSurface innerState(const TrackCand &) const
const LocalTrajectoryError & localError() const
bool isValid() const
Definition: HandleBase.h:76
virtual const GeomDet * idToDet(DetId) const
bool getByLabel(InputTag const &tag, Handle< PROD > &result) const
Definition: Event.h:355
GlobalVector momentum() const
#define LogTrace(id)
int k[5][pyjets_maxn]
MuonErrorMatrix * theErrorMatrixAdjuster
edm::Handle< SiTrackerGSMatchedRecHit2DCollection > theGSRecHits
Definition: DetId.h:20
void rescaleError(double factor)
const TrackerGeometry * theGeometry
void init(const MuonServiceProxy *)
initialize
double zDis(const TrajectoryStateOnSurface &tsos) const
const TrajectoryStateUpdator * updator() const
const GlobalTrajectoryParameters & globalParameters() const
const math::XYZTLorentzVectorD & trackerSurfaceMomentum() const
Definition: SimTrack.h:38
edm::ESHandle< Propagator > propagator() const
TrajectorySeed createSeed(const TrajectoryStateOnSurface &, const DetId &) const
create a hitless seed from a trajectory state
void stateOnDet(const TrajectoryStateOnSurface &ts, unsigned int detid, PTrajectoryStateOnDet &pts) const
A mere copy (without memory leak) of an existing tracking method.
const unsigned int detId() const
TrajectoryStateOnSurface innerStateOnSurface(const reco::Track &tk, const TrackingGeometry &geom, const MagneticField *field) const
void trackerSeeds(const TrackCand &, const TrackingRegion &, std::vector< TrajectorySeed > &)
generate seed(s) for a track
char state
Definition: procUtils.cc:75
T eta() const
Definition: PV3DBase.h:70
const GSSiTrackerRecHit2DLocalPos * hit() const
Definition: TrackerRecHit.h:73
edm::InputTag theSimTrackCollectionLabel
const LayerMeasurements * theTkLayerMeasurements
ESHandle< TrackerGeometry > geometry
GlobalVector globalMomentum() const
const Surface & surface() const
std::vector< const DetLayer * > compatibleLayers(const FreeTrajectoryState &fts, PropagationDirection timeDirection) const
find compatible layers for a given trajectory state
double dxyDis(const TrajectoryStateOnSurface &tsos) const
DetId geographicalId() const
T x() const
Definition: PV3DBase.h:56
const BasicVectorType & basicVector() const
Definition: PV3DBase.h:54
edm::ESHandle< TransientTrackingRecHitBuilder > theTTRHBuilder
std::vector< SimTrack > SimTrackContainer
virtual const BoundPlane & surface() const
The nominal surface of the GeomDet.
Definition: GeomDet.h:37
void setEvent(const edm::Event &)
set an event
unsigned long long theCacheId_TG
FreeTrajectoryState initialFreeState(const reco::Track &tk, const MagneticField *field) const