CMS 3D CMS Logo

TSGForOIFromL2.cc
Go to the documentation of this file.
1 
11 
12 #include <memory>
13 
15  : src_(consumes<reco::TrackCollection>(iConfig.getParameter<edm::InputTag>("src"))),
16  maxSeeds_(iConfig.getParameter<uint32_t>("maxSeeds")),
17  maxHitlessSeeds_(iConfig.getParameter<uint32_t>("maxHitlessSeeds")),
18  maxHitSeeds_(iConfig.getParameter<uint32_t>("maxHitSeeds")),
19  numOfLayersToTry_(iConfig.getParameter<int32_t>("layersToTry")),
20  numOfHitsToTry_(iConfig.getParameter<int32_t>("hitsToTry")),
21  numL2ValidHitsCutAllEta_(iConfig.getParameter<uint32_t>("numL2ValidHitsCutAllEta")),
22  numL2ValidHitsCutAllEndcap_(iConfig.getParameter<uint32_t>("numL2ValidHitsCutAllEndcap")),
23  fixedErrorRescalingForHits_(iConfig.getParameter<double>("fixedErrorRescaleFactorForHits")),
24  fixedErrorRescalingForHitless_(iConfig.getParameter<double>("fixedErrorRescaleFactorForHitless")),
25  adjustErrorsDynamicallyForHits_(iConfig.getParameter<bool>("adjustErrorsDynamicallyForHits")),
26  adjustErrorsDynamicallyForHitless_(iConfig.getParameter<bool>("adjustErrorsDynamicallyForHitless")),
27  estimatorName_(iConfig.getParameter<std::string>("estimator")),
28  minEtaForTEC_(iConfig.getParameter<double>("minEtaForTEC")),
29  maxEtaForTOB_(iConfig.getParameter<double>("maxEtaForTOB")),
30  useHitLessSeeds_(iConfig.getParameter<bool>("UseHitLessSeeds")),
31  updator_(new KFUpdator()),
32  measurementTrackerTag_(
33  consumes<MeasurementTrackerEvent>(iConfig.getParameter<edm::InputTag>("MeasurementTrackerEvent"))),
34  pT1_(iConfig.getParameter<double>("pT1")),
35  pT2_(iConfig.getParameter<double>("pT2")),
36  pT3_(iConfig.getParameter<double>("pT3")),
37  eta1_(iConfig.getParameter<double>("eta1")),
38  eta2_(iConfig.getParameter<double>("eta2")),
39  eta3_(iConfig.getParameter<double>("eta3")),
40  eta4_(iConfig.getParameter<double>("eta4")),
41  eta5_(iConfig.getParameter<double>("eta5")),
42  eta6_(iConfig.getParameter<double>("eta6")),
43  eta7_(iConfig.getParameter<double>("eta7")),
44  SF1_(iConfig.getParameter<double>("SF1")),
45  SF2_(iConfig.getParameter<double>("SF2")),
46  SF3_(iConfig.getParameter<double>("SF3")),
47  SF4_(iConfig.getParameter<double>("SF4")),
48  SF5_(iConfig.getParameter<double>("SF5")),
49  SF6_(iConfig.getParameter<double>("SF6")),
50  tsosDiff1_(iConfig.getParameter<double>("tsosDiff1")),
51  tsosDiff2_(iConfig.getParameter<double>("tsosDiff2")),
52  propagatorName_(iConfig.getParameter<std::string>("propagatorName")),
53  theCategory_(std::string("Muon|RecoMuon|TSGForOIFromL2")) {
54  produces<std::vector<TrajectorySeed> >();
55 }
56 
58 
59 //
60 // Produce seeds
61 //
63  // Initialize variables
64  unsigned int numSeedsMade = 0;
65  unsigned int layerCount = 0;
66  unsigned int hitlessSeedsMadeIP = 0;
67  unsigned int hitlessSeedsMadeMuS = 0;
68  unsigned int hitSeedsMade = 0;
69 
70  // Surface used to make a TSOS at the PCA to the beamline
72 
73  // Read ESHandles
74  edm::Handle<MeasurementTrackerEvent> measurementTrackerH;
77  edm::ESHandle<Propagator> propagatorAlongH;
78  edm::ESHandle<Propagator> propagatorOppositeH;
79  edm::ESHandle<TrackerGeometry> tmpTkGeometryH;
81 
82  iSetup.get<IdealMagneticFieldRecord>().get(magfieldH);
83  iSetup.get<TrackingComponentsRecord>().get(propagatorName_, propagatorOppositeH);
84  iSetup.get<TrackingComponentsRecord>().get(propagatorName_, propagatorAlongH);
85  iSetup.get<GlobalTrackingGeometryRecord>().get(geometryH);
86  iSetup.get<TrackerDigiGeometryRecord>().get(tmpTkGeometryH);
87  iSetup.get<TrackingComponentsRecord>().get(estimatorName_, estimatorH);
88  iEvent.getByToken(measurementTrackerTag_, measurementTrackerH);
89 
90  // Read L2 track collection
92  iEvent.getByToken(src_, l2TrackCol);
93 
94  // The product
95  std::unique_ptr<std::vector<TrajectorySeed> > result(new std::vector<TrajectorySeed>());
96 
97  // Get vector of Detector layers
98  std::vector<BarrelDetLayer const*> const& tob = measurementTrackerH->geometricSearchTracker()->tobLayers();
99  std::vector<ForwardDetLayer const*> const& tecPositive =
100  tmpTkGeometryH->isThere(GeomDetEnumerators::P2OTEC)
101  ? measurementTrackerH->geometricSearchTracker()->posTidLayers()
102  : measurementTrackerH->geometricSearchTracker()->posTecLayers();
103  std::vector<ForwardDetLayer const*> const& tecNegative =
104  tmpTkGeometryH->isThere(GeomDetEnumerators::P2OTEC)
105  ? measurementTrackerH->geometricSearchTracker()->negTidLayers()
106  : measurementTrackerH->geometricSearchTracker()->negTecLayers();
107 
108  // Get suitable propagators
109  std::unique_ptr<Propagator> propagatorAlong = SetPropagationDirection(*propagatorAlongH, alongMomentum);
110  std::unique_ptr<Propagator> propagatorOpposite = SetPropagationDirection(*propagatorOppositeH, oppositeToMomentum);
111 
112  // Stepping Helix Propagator for propogation from muon system to tracker
113  edm::ESHandle<Propagator> SHPOpposite;
114  iSetup.get<TrackingComponentsRecord>().get("hltESPSteppingHelixPropagatorOpposite", SHPOpposite);
115 
116  // Loop over the L2's and make seeds for all of them
117  LogTrace(theCategory_) << "TSGForOIFromL2::produce: Number of L2's: " << l2TrackCol->size();
118  for (unsigned int l2TrackColIndex(0); l2TrackColIndex != l2TrackCol->size(); ++l2TrackColIndex) {
119  const reco::TrackRef l2(l2TrackCol, l2TrackColIndex);
120 
121  // Container of Seeds
122  std::vector<TrajectorySeed> out;
123  LogTrace("TSGForOIFromL2") << "TSGForOIFromL2::produce: L2 muon pT, eta, phi --> " << l2->pt() << " , " << l2->eta()
124  << " , " << l2->phi() << std::endl;
125 
127 
128  dummyPlane->move(fts.position() - dummyPlane->position());
129  TrajectoryStateOnSurface tsosAtIP = TrajectoryStateOnSurface(fts, *dummyPlane);
130  LogTrace("TSGForOIFromL2") << "TSGForOIFromL2::produce: Created TSOSatIP: " << tsosAtIP << std::endl;
131 
132  // Get the TSOS on the innermost layer of the L2
133  TrajectoryStateOnSurface tsosAtMuonSystem =
134  trajectoryStateTransform::innerStateOnSurface(*l2, *geometryH, magfieldH.product());
135  LogTrace("TSGForOIFromL2") << "TSGForOIFromL2::produce: Created TSOSatMuonSystem: " << tsosAtMuonSystem
136  << std::endl;
137 
138  LogTrace("TSGForOIFromL2")
139  << "TSGForOIFromL2::produce: Check the error of the L2 parameter and use hit seeds if big errors" << std::endl;
140 
141  StateOnTrackerBound fromInside(propagatorAlong.get());
142  TrajectoryStateOnSurface outerTkStateInside = fromInside(fts);
143 
144  StateOnTrackerBound fromOutside(&*SHPOpposite);
145  TrajectoryStateOnSurface outerTkStateOutside = fromOutside(tsosAtMuonSystem);
146 
147  // Check if the two positions (using updated and not-updated TSOS) agree withing certain extent.
148  // If both TSOSs agree, use only the one at vertex, as it uses more information. If they do not agree, search for seeds based on both.
149  double L2muonEta = l2->eta();
150  double absL2muonEta = std::abs(L2muonEta);
151  bool useBoth = false;
152  if (outerTkStateInside.isValid() && outerTkStateOutside.isValid()) {
153  //following commented out variables dist1 (5 par compatibility of tsos at outertracker surface)
154  //dist2 (angle between two tsos) could further be explored in combination of L2 valid hits for seeding. So kept for
155  //future developers
156  //auto dist1 = match_Chi2(outerTkStateInside,outerTkStateOutside);//for future developers
157  //auto dist2 = deltaR(outerTkStateInside.globalMomentum(),outerTkStateOutside.globalMomentum());//for future developers
158  //if ((dist1 > tsosDiff1_ || dist2 > tsosDiff2_) && l2->numberOfValidHits() < 20) useBoth = true;//for future developers
159  if (l2->numberOfValidHits() < numL2ValidHitsCutAllEta_)
160  useBoth = true;
161  if (l2->numberOfValidHits() < numL2ValidHitsCutAllEndcap_ && absL2muonEta > eta7_)
162  useBoth = true;
163  if (absL2muonEta > eta1_ && absL2muonEta < eta1_)
164  useBoth = true;
165  }
166 
167  numSeedsMade = 0;
168  hitlessSeedsMadeIP = 0;
169  hitlessSeedsMadeMuS = 0;
170  hitSeedsMade = 0;
171 
172  // calculate scale factors
174  double errorSFHitless =
176 
177  // BARREL
178  if (absL2muonEta < maxEtaForTOB_) {
179  layerCount = 0;
180  for (auto it = tob.rbegin(); it != tob.rend(); ++it) {
181  LogTrace("TSGForOIFromL2") << "TSGForOIFromL2::produce: looping in TOB layer " << layerCount << std::endl;
182  if (useHitLessSeeds_ && hitlessSeedsMadeIP < maxHitlessSeeds_ && numSeedsMade < maxSeeds_)
184  tsosAtIP,
185  *(propagatorAlong.get()),
186  estimatorH,
187  errorSFHitless,
188  hitlessSeedsMadeIP,
189  numSeedsMade,
190  out);
191 
192  // Do not create hitbased seeds in barrel region
193  if (absL2muonEta > 1.0 && hitSeedsMade < maxHitSeeds_ && numSeedsMade < maxSeeds_)
194  makeSeedsFromHits(**it,
195  tsosAtIP,
196  *(propagatorAlong.get()),
197  estimatorH,
198  measurementTrackerH,
199  errorSFHits,
200  hitSeedsMade,
201  numSeedsMade,
202  layerCount,
203  out);
204 
205  if (useBoth) {
206  if (useHitLessSeeds_ && hitlessSeedsMadeMuS < maxHitlessSeeds_ && numSeedsMade < maxSeeds_)
208  outerTkStateOutside,
209  *(propagatorOpposite.get()),
210  estimatorH,
211  errorSFHitless,
212  hitlessSeedsMadeMuS,
213  numSeedsMade,
214  out);
215  }
216  }
217  LogTrace("TSGForOIFromL2") << "TSGForOIFromL2:::produce: NumSeedsMade = " << numSeedsMade
218  << " , layerCount = " << layerCount << std::endl;
219  }
220 
221  // Reset number of seeds if in overlap region
222  if (absL2muonEta > minEtaForTEC_ && absL2muonEta < maxEtaForTOB_) {
223  numSeedsMade = 0;
224  hitlessSeedsMadeIP = 0;
225  hitlessSeedsMadeMuS = 0;
226  hitSeedsMade = 0;
227  }
228 
229  // ENDCAP+
230  if (L2muonEta > minEtaForTEC_) {
231  layerCount = 0;
232  for (auto it = tecPositive.rbegin(); it != tecPositive.rend(); ++it) {
233  LogTrace("TSGForOIFromL2") << "TSGForOIFromL2::produce: looping in TEC+ layer " << layerCount << std::endl;
234  if (useHitLessSeeds_ && hitlessSeedsMadeIP < maxHitlessSeeds_ && numSeedsMade < maxSeeds_)
236  tsosAtIP,
237  *(propagatorAlong.get()),
238  estimatorH,
239  errorSFHitless,
240  hitlessSeedsMadeIP,
241  numSeedsMade,
242  out);
243 
244  if (absL2muonEta > 1.0 && hitSeedsMade < maxHitSeeds_ && numSeedsMade < maxSeeds_)
245  makeSeedsFromHits(**it,
246  tsosAtIP,
247  *(propagatorAlong.get()),
248  estimatorH,
249  measurementTrackerH,
250  errorSFHits,
251  hitSeedsMade,
252  numSeedsMade,
253  layerCount,
254  out);
255 
256  if (useBoth) {
257  if (useHitLessSeeds_ && hitlessSeedsMadeMuS < maxHitlessSeeds_ && numSeedsMade < maxSeeds_)
259  outerTkStateOutside,
260  *(propagatorOpposite.get()),
261  estimatorH,
262  errorSFHitless,
263  hitlessSeedsMadeMuS,
264  numSeedsMade,
265  out);
266  }
267  }
268  LogTrace("TSGForOIFromL2") << "TSGForOIFromL2:::produce: NumSeedsMade = " << numSeedsMade
269  << " , layerCount = " << layerCount << std::endl;
270  }
271 
272  // ENDCAP-
273  if (L2muonEta < -minEtaForTEC_) {
274  layerCount = 0;
275  for (auto it = tecNegative.rbegin(); it != tecNegative.rend(); ++it) {
276  LogTrace("TSGForOIFromL2") << "TSGForOIFromL2::produce: looping in TEC- layer " << layerCount << std::endl;
277  if (useHitLessSeeds_ && hitlessSeedsMadeIP < maxHitlessSeeds_ && numSeedsMade < maxSeeds_)
279  tsosAtIP,
280  *(propagatorAlong.get()),
281  estimatorH,
282  errorSFHitless,
283  hitlessSeedsMadeIP,
284  numSeedsMade,
285  out);
286 
287  if (absL2muonEta > 1.0 && hitSeedsMade < maxHitSeeds_ && numSeedsMade < maxSeeds_)
288  makeSeedsFromHits(**it,
289  tsosAtIP,
290  *(propagatorAlong.get()),
291  estimatorH,
292  measurementTrackerH,
293  errorSFHits,
294  hitSeedsMade,
295  numSeedsMade,
296  layerCount,
297  out);
298 
299  if (useBoth) {
300  if (useHitLessSeeds_ && hitlessSeedsMadeMuS < maxHitlessSeeds_ && numSeedsMade < maxSeeds_)
302  outerTkStateOutside,
303  *(propagatorOpposite.get()),
304  estimatorH,
305  errorSFHitless,
306  hitlessSeedsMadeMuS,
307  numSeedsMade,
308  out);
309  }
310  }
311  LogTrace("TSGForOIFromL2") << "TSGForOIFromL2:::produce: NumSeedsMade = " << numSeedsMade
312  << " , layerCount = " << layerCount << std::endl;
313  }
314 
315  for (std::vector<TrajectorySeed>::iterator it = out.begin(); it != out.end(); ++it) {
316  result->push_back(*it);
317  }
318 
319  } // L2Collection
320 
321  edm::LogInfo(theCategory_) << "TSGForOIFromL2::produce: number of seeds made: " << result->size();
322 
323  iEvent.put(std::move(result));
324 }
325 
326 //
327 // Create seeds without hits on a given layer (TOB or TEC)
328 //
330  const TrajectoryStateOnSurface& tsos,
333  double errorSF,
334  unsigned int& hitlessSeedsMade,
335  unsigned int& numSeedsMade,
336  std::vector<TrajectorySeed>& out) const {
337  // create hitless seeds
338  LogTrace("TSGForOIFromL2") << "TSGForOIFromL2::makeSeedsWithoutHits: Start hitless" << std::endl;
339  std::vector<GeometricSearchDet::DetWithState> dets;
340  layer.compatibleDetsV(tsos, propagatorAlong, *estimator, dets);
341  if (!dets.empty()) {
342  auto const& detOnLayer = dets.front().first;
343  auto const& tsosOnLayer = dets.front().second;
344  LogTrace("TSGForOIFromL2") << "TSGForOIFromL2::makeSeedsWithoutHits: tsosOnLayer " << tsosOnLayer << std::endl;
345  if (!tsosOnLayer.isValid()) {
346  edm::LogInfo(theCategory_) << "ERROR!: Hitless TSOS is not valid!";
347  } else {
348  dets.front().second.rescaleError(errorSF);
349  PTrajectoryStateOnDet const& ptsod =
350  trajectoryStateTransform::persistentState(tsosOnLayer, detOnLayer->geographicalId().rawId());
352  out.push_back(TrajectorySeed(ptsod, rHC, oppositeToMomentum));
353  LogTrace("TSGForOIFromL2") << "TSGForOIFromL2::makeSeedsWithoutHits: TSOS (Hitless) done " << std::endl;
354  hitlessSeedsMade++;
355  numSeedsMade++;
356  }
357  }
358 }
359 
360 //
361 // Find hits on a given layer (TOB or TEC) and create seeds from updated TSOS with hit
362 //
364  const TrajectoryStateOnSurface& tsos,
368  double errorSF,
369  unsigned int& hitSeedsMade,
370  unsigned int& numSeedsMade,
371  unsigned int& layerCount,
372  std::vector<TrajectorySeed>& out) const {
373  if (layerCount > numOfLayersToTry_)
374  return;
375 
376  // Error Rescaling
377  TrajectoryStateOnSurface onLayer(tsos);
378  onLayer.rescaleError(errorSF);
379 
380  std::vector<GeometricSearchDet::DetWithState> dets;
381  layer.compatibleDetsV(onLayer, propagatorAlong, *estimator, dets);
382 
383  // Find Measurements on each DetWithState
384  LogTrace("TSGForOIFromL2") << "TSGForOIFromL2::makeSeedsFromHits: Find measurements on each detWithState "
385  << dets.size() << std::endl;
386  std::vector<TrajectoryMeasurement> meas;
387  for (std::vector<GeometricSearchDet::DetWithState>::iterator it = dets.begin(); it != dets.end(); ++it) {
388  MeasurementDetWithData det = measurementTracker->idToDet(it->first->geographicalId());
389  if (det.isNull())
390  continue;
391  if (!it->second.isValid())
392  continue; // Skip if TSOS is not valid
393 
394  std::vector<TrajectoryMeasurement> mymeas =
395  det.fastMeasurements(it->second, onLayer, propagatorAlong, *estimator); // Second TSOS is not used
396  for (std::vector<TrajectoryMeasurement>::const_iterator it2 = mymeas.begin(), ed2 = mymeas.end(); it2 != ed2;
397  ++it2) {
398  if (it2->recHit()->isValid())
399  meas.push_back(*it2); // Only save those which are valid
400  }
401  }
402 
403  // Update TSOS using TMs after sorting, then create Trajectory Seed and put into vector
404  LogTrace("TSGForOIFromL2") << "TSGForOIFromL2::makeSeedsFromHits: Update TSOS using TMs after sorting, then create "
405  "Trajectory Seed, number of TM = "
406  << meas.size() << std::endl;
407  std::sort(meas.begin(), meas.end(), TrajMeasLessEstim());
408 
409  unsigned int found = 0;
410  for (std::vector<TrajectoryMeasurement>::const_iterator it = meas.begin(); it != meas.end(); ++it) {
411  TrajectoryStateOnSurface updatedTSOS = updator_->update(it->forwardPredictedState(), *it->recHit());
412  LogTrace("TSGForOIFromL2") << "TSGForOIFromL2::makeSeedsFromHits: TSOS for TM " << found << std::endl;
413  if (not updatedTSOS.isValid())
414  continue;
415 
417  seedHits.push_back(*it->recHit()->hit());
418  PTrajectoryStateOnDet const& pstate =
419  trajectoryStateTransform::persistentState(updatedTSOS, it->recHit()->geographicalId().rawId());
420  LogTrace("TSGForOIFromL2") << "TSGForOIFromL2::makeSeedsFromHits: Number of seedHits: " << seedHits.size()
421  << std::endl;
422  TrajectorySeed seed(pstate, std::move(seedHits), oppositeToMomentum);
423  out.push_back(seed);
424  found++;
425  numSeedsMade++;
426  hitSeedsMade++;
427  if (found == numOfHitsToTry_)
428  break;
429  if (hitSeedsMade > maxHitSeeds_)
430  return;
431  }
432 
433  if (found)
434  layerCount++;
435 }
436 
437 //
438 // Calculate the dynamic error SF by analysing the L2
439 //
441  double theSF = 1.0;
442  // L2 direction vs pT blowup - as was previously done:
443  // Split into 4 pT ranges: <pT1_, pT1_<pT2_, pT2_<pT3_, <pT4_: 13,30,70
444  // Split into different eta ranges depending in pT
445  double abseta = std::abs(track->eta());
446  if (track->pt() <= pT1_)
447  theSF = SF1_;
448  else if (track->pt() > pT1_ && track->pt() <= pT2_) {
449  if (abseta <= eta3_)
450  theSF = SF3_;
451  else if (abseta > eta3_ && abseta <= eta6_)
452  theSF = SF2_;
453  else if (abseta > eta6_)
454  theSF = SF3_;
455  } else if (track->pt() > pT2_ && track->pt() <= pT3_) {
456  if (abseta <= eta1_)
457  theSF = SF6_;
458  else if (abseta > eta1_ && abseta <= eta2_)
459  theSF = SF4_;
460  else if (abseta > eta2_ && abseta <= eta3_)
461  theSF = SF6_;
462  else if (abseta > eta3_ && abseta <= eta4_)
463  theSF = SF1_;
464  else if (abseta > eta4_ && abseta <= eta5_)
465  theSF = SF1_;
466  else if (abseta > eta5_)
467  theSF = SF5_;
468  } else if (track->pt() > pT3_) {
469  if (abseta <= eta3_)
470  theSF = SF5_;
471  else if (abseta > eta3_ && abseta <= eta4_)
472  theSF = SF4_;
473  else if (abseta > eta4_ && abseta <= eta5_)
474  theSF = SF4_;
475  else if (abseta > eta5_)
476  theSF = SF5_;
477  }
478 
479  LogTrace(theCategory_) << "TSGForOIFromL2::calculateSFFromL2: SF has been calculated as: " << theSF;
480 
481  return theSF;
482 }
483 
484 //
485 // calculate Chi^2 of two trajectory states
486 //
488  if (!tsos1.isValid() || !tsos2.isValid())
489  return -1.;
490 
492  AlgebraicSymMatrix55 m(tsos1.localError().matrix() + tsos2.localError().matrix());
493 
494  bool ierr = !m.Invert();
495 
496  if (ierr) {
497  edm::LogInfo("TSGForOIFromL2") << "Error inverting covariance matrix";
498  return -1;
499  }
500 
501  double est = ROOT::Math::Similarity(v, m);
502 
503  return est;
504 }
505 
506 //
507 //
508 //
511  desc.add<edm::InputTag>("src", edm::InputTag("hltL2Muons", "UpdatedAtVtx"));
512  desc.add<int>("layersToTry", 2);
513  desc.add<double>("fixedErrorRescaleFactorForHitless", 2.0);
514  desc.add<int>("hitsToTry", 1);
515  desc.add<bool>("adjustErrorsDynamicallyForHits", false);
516  desc.add<bool>("adjustErrorsDynamicallyForHitless", true);
517  desc.add<edm::InputTag>("MeasurementTrackerEvent", edm::InputTag("hltSiStripClusters"));
518  desc.add<bool>("UseHitLessSeeds", true);
519  desc.add<std::string>("estimator", "hltESPChi2MeasurementEstimator100");
520  desc.add<double>("maxEtaForTOB", 1.8);
521  desc.add<double>("minEtaForTEC", 0.7);
522  desc.addUntracked<bool>("debug", false);
523  desc.add<double>("fixedErrorRescaleFactorForHits", 1.0);
524  desc.add<unsigned int>("maxSeeds", 20);
525  desc.add<unsigned int>("maxHitlessSeeds", 5);
526  desc.add<unsigned int>("maxHitSeeds", 1);
527  desc.add<unsigned int>("numL2ValidHitsCutAllEta", 20);
528  desc.add<unsigned int>("numL2ValidHitsCutAllEndcap", 30);
529  desc.add<double>("pT1", 13.0);
530  desc.add<double>("pT2", 30.0);
531  desc.add<double>("pT3", 70.0);
532  desc.add<double>("eta1", 0.2);
533  desc.add<double>("eta2", 0.3);
534  desc.add<double>("eta3", 1.0);
535  desc.add<double>("eta4", 1.2);
536  desc.add<double>("eta5", 1.6);
537  desc.add<double>("eta6", 1.4);
538  desc.add<double>("eta7", 2.1);
539  desc.add<double>("SF1", 3.0);
540  desc.add<double>("SF2", 4.0);
541  desc.add<double>("SF3", 5.0);
542  desc.add<double>("SF4", 7.0);
543  desc.add<double>("SF5", 10.0);
544  desc.add<double>("SF6", 2.0);
545  desc.add<double>("tsosDiff1", 0.2);
546  desc.add<double>("tsosDiff2", 0.02);
547  desc.add<std::string>("propagatorName", "PropagatorWithMaterialParabolicMf");
548  descriptions.add("TSGForOIFromL2", desc);
549 }
550 
edm::ESHandle::product
T const * product() const
Definition: ESHandle.h:86
edm::StreamID
Definition: StreamID.h:30
TkRotation< float >
electrons_cff.bool
bool
Definition: electrons_cff.py:393
MeasurementDetWithData::fastMeasurements
std::vector< TrajectoryMeasurement > fastMeasurements(const TrajectoryStateOnSurface &stateOnThisDet, const TrajectoryStateOnSurface &tsos2, const Propagator &prop, const MeasurementEstimator &est) const
Definition: MeasurementDetWithData.h:46
HLT_FULL_cff.track
track
Definition: HLT_FULL_cff.py:11779
GeometricSearchTracker::tobLayers
std::vector< BarrelDetLayer const * > const & tobLayers() const
Definition: GeometricSearchTracker.h:39
TrackerGeometry.h
trajectoryStateTransform::initialFreeState
FreeTrajectoryState initialFreeState(const reco::Track &tk, const MagneticField *field, bool withErr=true)
Definition: TrajectoryStateTransform.cc:58
TSGForOIFromL2::pT2_
const double pT2_
Definition: TSGForOIFromL2.h:91
TSGForOIFromL2::SF2_
const double SF2_
Definition: TSGForOIFromL2.h:93
HLTSiStripMonitoring_cff.measurementTracker
measurementTracker
Definition: HLTSiStripMonitoring_cff.py:178
TSGForOIFromL2::useHitLessSeeds_
const bool useHitLessSeeds_
Definition: TSGForOIFromL2.h:83
edm
HLT enums.
Definition: AlignableModifier.h:19
TSGForOIFromL2::SF4_
const double SF4_
Definition: TSGForOIFromL2.h:93
TSGForOIFromL2::SF5_
const double SF5_
Definition: TSGForOIFromL2.h:93
trajectoryStateTransform::persistentState
PTrajectoryStateOnDet persistentState(const TrajectoryStateOnSurface &ts, unsigned int detid)
Definition: TrajectoryStateTransform.cc:14
TSGForOIFromL2::makeSeedsWithoutHits
void makeSeedsWithoutHits(const GeometricSearchDet &layer, const TrajectoryStateOnSurface &tsos, const Propagator &propagatorAlong, edm::ESHandle< Chi2MeasurementEstimatorBase > &estimator, double errorSF, unsigned int &hitlessSeedsMade, unsigned int &numSeedsMade, std::vector< TrajectorySeed > &out) const
Create seeds without hits on a given layer (TOB or TEC)
Definition: TSGForOIFromL2.cc:329
HLT_FULL_cff.InputTag
InputTag
Definition: HLT_FULL_cff.py:89353
edm::ParameterSetDescription
Definition: ParameterSetDescription.h:52
TSGForOIFromL2::src_
const edm::EDGetTokenT< reco::TrackCollection > src_
Labels for input collections.
Definition: TSGForOIFromL2.h:43
oppositeToMomentum
Definition: PropagationDirection.h:4
GlobalTrackingGeometryRecord
Definition: GlobalTrackingGeometryRecord.h:17
TrajMeasLessEstim
Definition: TrajMeasLessEstim.h:10
TSGForOIFromL2::fillDescriptions
static void fillDescriptions(edm::ConfigurationDescriptions &descriptions)
Definition: TSGForOIFromL2.cc:509
SetPropagationDirection
std::unique_ptr< Propagator > SetPropagationDirection(Propagator const &iprop, PropagationDirection dir)
Definition: HelperPropagatorUtility.cc:5
LocalTrajectoryError::matrix
const AlgebraicSymMatrix55 & matrix() const
Definition: LocalTrajectoryError.h:60
ReferenceCountingPointer< Plane >
reco
fixed size matrix
Definition: AlignmentAlgorithmBase.h:45
FreeTrajectoryState::position
GlobalPoint position() const
Definition: FreeTrajectoryState.h:67
edm::LogInfo
Log< level::Info, false > LogInfo
Definition: MessageLogger.h:125
TSGForOIFromL2::match_Chi2
double match_Chi2(const TrajectoryStateOnSurface &tsos1, const TrajectoryStateOnSurface &tsos2) const
Find compatability between two TSOSs.
Definition: TSGForOIFromL2.cc:487
findQualityFiles.v
v
Definition: findQualityFiles.py:179
TSGForOIFromL2::TSGForOIFromL2
TSGForOIFromL2(const edm::ParameterSet &iConfig)
Definition: TSGForOIFromL2.cc:14
newFWLiteAna.found
found
Definition: newFWLiteAna.py:118
edm::Handle< MeasurementTrackerEvent >
TSGForOIFromL2::numL2ValidHitsCutAllEndcap_
const unsigned int numL2ValidHitsCutAllEndcap_
Definition: TSGForOIFromL2.h:62
TSGForOIFromL2::maxSeeds_
const unsigned int maxSeeds_
Maximum number of seeds for each L2.
Definition: TSGForOIFromL2.h:46
TSGForOIFromL2::minEtaForTEC_
const double minEtaForTEC_
Minimum eta value to activate searching in the TEC.
Definition: TSGForOIFromL2.h:76
edm::Ref< TrackCollection >
TSGForOIFromL2::produce
void produce(edm::StreamID sid, edm::Event &iEvent, const edm::EventSetup &iSetup) const override
Definition: TSGForOIFromL2.cc:62
TSGForOIFromL2::~TSGForOIFromL2
~TSGForOIFromL2() override
Definition: TSGForOIFromL2.cc:57
fileCollector.seed
seed
Definition: fileCollector.py:127
IdealMagneticFieldRecord
Definition: IdealMagneticFieldRecord.h:11
Propagator
Definition: Propagator.h:44
TrajectoryStateOnSurface
Definition: TrajectoryStateOnSurface.h:16
TrackerTopology.h
TSGForOIFromL2::adjustErrorsDynamicallyForHits_
const bool adjustErrorsDynamicallyForHits_
Whether or not to use an automatically calculated scale-factor value.
Definition: TSGForOIFromL2.h:69
PVValHelper::estimator
estimator
Definition: PVValidationHelpers.h:44
edm::EventSetup::get
T get() const
Definition: EventSetup.h:80
TSGForOIFromL2::pT3_
const double pT3_
Definition: TSGForOIFromL2.h:91
DEFINE_FWK_MODULE
#define DEFINE_FWK_MODULE(type)
Definition: MakerMacros.h:16
TSGForOIFromL2
Create L3MuonTrajectorySeeds from L2 Muons updated at vertex in an outside-in manner.
Definition: TSGForOIFromL2.h:34
TSGForOIFromL2::measurementTrackerTag_
const edm::EDGetTokenT< MeasurementTrackerEvent > measurementTrackerTag_
Definition: TSGForOIFromL2.h:88
edm::ConfigurationDescriptions::add
void add(std::string const &label, ParameterSetDescription const &psetDescription)
Definition: ConfigurationDescriptions.cc:57
TSGForOIFromL2::maxHitlessSeeds_
const unsigned int maxHitlessSeeds_
Maximum number of hitless seeds for each L2.
Definition: TSGForOIFromL2.h:49
GeometricSearchTracker::posTecLayers
std::vector< ForwardDetLayer const * > const & posTecLayers() const
Definition: GeometricSearchTracker.h:47
visualization-live-secondInstance_cfg.m
m
Definition: visualization-live-secondInstance_cfg.py:72
TSGForOIFromL2::eta2_
const double eta2_
Definition: TSGForOIFromL2.h:92
TSGForOIFromL2::maxHitSeeds_
const unsigned int maxHitSeeds_
Maximum number of hitbased seeds for each L2.
Definition: TSGForOIFromL2.h:52
TrackerDigiGeometryRecord
Definition: TrackerDigiGeometryRecord.h:15
GeometricSearchTracker::posTidLayers
std::vector< ForwardDetLayer const * > const & posTidLayers() const
Definition: GeometricSearchTracker.h:46
edm::ESHandle< Chi2MeasurementEstimatorBase >
LocalTrajectoryParameters::vector
AlgebraicVector5 vector() const
Definition: LocalTrajectoryParameters.h:120
GeomDetEnumerators::P2OTEC
Definition: GeomDetEnumerators.h:24
TSGForOIFromL2::maxEtaForTOB_
const double maxEtaForTOB_
Maximum eta value to activate searching in the TOB.
Definition: TSGForOIFromL2.h:79
Point3DBase< float, GlobalTag >
TrackerGeometry::isThere
bool isThere(GeomDetEnumerators::SubDetector subdet) const
Definition: TrackerGeometry.cc:219
MeasurementDetWithData::isNull
bool isNull() const
Definition: MeasurementDetWithData.h:13
edm::ConfigurationDescriptions
Definition: ConfigurationDescriptions.h:28
AlCaHLTBitMon_QueryRunRegistry.string
string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
TrajectoryStateOnSurface::localParameters
const LocalTrajectoryParameters & localParameters() const
Definition: TrajectoryStateOnSurface.h:73
Plane::build
static PlanePointer build(Args &&... args)
Definition: Plane.h:33
TSGForOIFromL2::SF6_
const double SF6_
Definition: TSGForOIFromL2.h:93
TSGForOIFromL2::eta3_
const double eta3_
Definition: TSGForOIFromL2.h:92
TSGForOIFromL2::eta1_
const double eta1_
Definition: TSGForOIFromL2.h:92
GeometricSearchTracker::negTecLayers
std::vector< ForwardDetLayer const * > const & negTecLayers() const
Definition: GeometricSearchTracker.h:43
MeasurementTrackerEvent
Definition: MeasurementTrackerEvent.h:16
edm::ParameterSet
Definition: ParameterSet.h:47
HLT_FULL_cff.propagatorOpposite
propagatorOpposite
Definition: HLT_FULL_cff.py:116
deltaR.h
MeasurementTrackerEvent::geometricSearchTracker
const GeometricSearchTracker * geometricSearchTracker() const
Definition: MeasurementTrackerEvent.h:73
GeometricSearchDet::compatibleDetsV
virtual void compatibleDetsV(const TrajectoryStateOnSurface &startingState, const Propagator &prop, const MeasurementEstimator &est, std::vector< DetWithState > &result) const
Definition: GeometricSearchDet.cc:9
TSGForOIFromL2::theCategory_
const std::string theCategory_
Definition: TSGForOIFromL2.h:101
TSGForOIFromL2::SF3_
const double SF3_
Definition: TSGForOIFromL2.h:93
iEvent
int iEvent
Definition: GenABIO.cc:224
StateOnTrackerBound
Definition: StateOnTrackerBound.h:13
TSGForOIFromL2::adjustErrorsDynamicallyForHitless_
const bool adjustErrorsDynamicallyForHitless_
Definition: TSGForOIFromL2.h:70
TSGForOIFromL2::fixedErrorRescalingForHits_
const double fixedErrorRescalingForHits_
Rescale L2 parameter uncertainties (fixed error vs pT, eta)
Definition: TSGForOIFromL2.h:65
edm::EventSetup
Definition: EventSetup.h:57
TSGForOIFromL2::pT1_
const double pT1_
pT, eta ranges and scale factor values
Definition: TSGForOIFromL2.h:91
TSGForOIFromL2::SF1_
const double SF1_
Definition: TSGForOIFromL2.h:93
AlgebraicVector5
ROOT::Math::SVector< double, 5 > AlgebraicVector5
Definition: AlgebraicROOTObjects.h:14
get
#define get
TrajectoryStateOnSurface::rescaleError
void rescaleError(double factor)
Definition: TrajectoryStateOnSurface.h:82
TSGForOIFromL2::eta7_
const double eta7_
Definition: TSGForOIFromL2.h:92
TSGForOIFromL2::numL2ValidHitsCutAllEta_
const unsigned int numL2ValidHitsCutAllEta_
L2 valid hit cuts to decide seed creation by both states.
Definition: TSGForOIFromL2.h:61
TSGForOIFromL2::propagatorName_
const std::string propagatorName_
Counters and flags for the implementation.
Definition: TSGForOIFromL2.h:100
HLT_FULL_cff.propagatorAlong
propagatorAlong
Definition: HLT_FULL_cff.py:118
submitPVResolutionJobs.desc
string desc
Definition: submitPVResolutionJobs.py:251
eostools.move
def move(src, dest)
Definition: eostools.py:511
std
Definition: JetResolutionObject.h:76
TSGForOIFromL2::numOfLayersToTry_
const unsigned int numOfLayersToTry_
How many layers to try.
Definition: TSGForOIFromL2.h:55
MeasurementDetWithData
Definition: MeasurementDetWithData.h:6
FreeTrajectoryState
Definition: FreeTrajectoryState.h:27
TSGForOIFromL2.h
TrajectorySeed
Definition: TrajectorySeed.h:18
TSGForOIFromL2::eta4_
const double eta4_
Definition: TSGForOIFromL2.h:92
TSGForOIFromL2::updator_
const std::unique_ptr< TrajectoryStateUpdator > updator_
KFUpdator defined in constructor.
Definition: TSGForOIFromL2.h:86
TSGForOIFromL2::makeSeedsFromHits
void makeSeedsFromHits(const GeometricSearchDet &layer, const TrajectoryStateOnSurface &tsos, const Propagator &propagatorAlong, edm::ESHandle< Chi2MeasurementEstimatorBase > &estimator, edm::Handle< MeasurementTrackerEvent > &measurementTracker, double errorSF, unsigned int &hitSeedsMade, unsigned int &numSeedsMade, unsigned int &layerCount, std::vector< TrajectorySeed > &out) const
Find hits on a given layer (TOB or TEC) and create seeds from updated TSOS with hit.
Definition: TSGForOIFromL2.cc:363
edm::OwnVector::push_back
void push_back(D *&d)
Definition: OwnVector.h:326
MillePedeFileConverter_cfg.out
out
Definition: MillePedeFileConverter_cfg.py:31
mps_fire.result
result
Definition: mps_fire.py:311
funct::abs
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
LogTrace
#define LogTrace(id)
Definition: MessageLogger.h:224
PTrajectoryStateOnDet
Definition: PTrajectoryStateOnDet.h:10
GeometricSearchDet
Definition: GeometricSearchDet.h:17
trajectoryStateTransform::innerStateOnSurface
TrajectoryStateOnSurface innerStateOnSurface(const reco::Track &tk, const TrackingGeometry &geom, const MagneticField *field, bool withErr=true)
Definition: TrajectoryStateTransform.cc:110
TSGForOIFromL2::eta5_
const double eta5_
Definition: TSGForOIFromL2.h:92
edm::Event
Definition: Event.h:73
TSGForOIFromL2::eta6_
const double eta6_
Definition: TSGForOIFromL2.h:92
TrajectoryStateOnSurface::localError
const LocalTrajectoryError & localError() const
Definition: TrajectoryStateOnSurface.h:77
TSGForOIFromL2::numOfHitsToTry_
const unsigned int numOfHitsToTry_
How many hits to try per layer.
Definition: TSGForOIFromL2.h:58
AlgebraicSymMatrix55
ROOT::Math::SMatrix< double, 5, 5, ROOT::Math::MatRepSym< double, 5 > > AlgebraicSymMatrix55
Definition: AlgebraicROOTObjects.h:23
edm::OwnVector::size
size_type size() const
Definition: OwnVector.h:300
edm::InputTag
Definition: InputTag.h:15
reco::TrackCollection
std::vector< Track > TrackCollection
collection of Tracks
Definition: TrackFwd.h:14
alongMomentum
Definition: PropagationDirection.h:4
KFUpdator
Definition: KFUpdator.h:32
TrajectoryStateOnSurface::isValid
bool isValid() const
Definition: TrajectoryStateOnSurface.h:54
TSGForOIFromL2::fixedErrorRescalingForHitless_
const double fixedErrorRescalingForHitless_
Definition: TSGForOIFromL2.h:66
edm::OwnVector< TrackingRecHit >
GeometricSearchTracker::negTidLayers
std::vector< ForwardDetLayer const * > const & negTidLayers() const
Definition: GeometricSearchTracker.h:42
TSGForOIFromL2::estimatorName_
const std::string estimatorName_
Estimator used to find dets and TrajectoryMeasurements.
Definition: TSGForOIFromL2.h:73
TSGForOIFromL2::calculateSFFromL2
double calculateSFFromL2(const reco::TrackRef track) const
Calculate the dynamic error SF by analysing the L2.
Definition: TSGForOIFromL2.cc:440
TrackingComponentsRecord
Definition: TrackingComponentsRecord.h:12