CMS 3D CMS Logo

TSGForOIFromL2.cc
Go to the documentation of this file.
1 
10 
11 #include <memory>
12 
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()), measurementTrackerTag_(consumes<MeasurementTrackerEvent>(iConfig.getParameter<edm::InputTag>("MeasurementTrackerEvent"))),
32  pT1_(iConfig.getParameter<double>("pT1")),
33  pT2_(iConfig.getParameter<double>("pT2")),
34  pT3_(iConfig.getParameter<double>("pT3")),
35  eta1_(iConfig.getParameter<double>("eta1")),
36  eta2_(iConfig.getParameter<double>("eta2")),
37  eta3_(iConfig.getParameter<double>("eta3")),
38  eta4_(iConfig.getParameter<double>("eta4")),
39  eta5_(iConfig.getParameter<double>("eta5")),
40  eta6_(iConfig.getParameter<double>("eta6")),
41  eta7_(iConfig.getParameter<double>("eta7")),
42  SF1_(iConfig.getParameter<double>("SF1")),
43  SF2_(iConfig.getParameter<double>("SF2")),
44  SF3_(iConfig.getParameter<double>("SF3")),
45  SF4_(iConfig.getParameter<double>("SF4")),
46  SF5_(iConfig.getParameter<double>("SF5")),
47  SF6_(iConfig.getParameter<double>("SF6")),
48  tsosDiff1_(iConfig.getParameter<double>("tsosDiff1")),
49  tsosDiff2_(iConfig.getParameter<double>("tsosDiff2")),
50  propagatorName_(iConfig.getParameter<std::string>("propagatorName")),
51  theCategory_(std::string("Muon|RecoMuon|TSGForOIFromL2"))
52 {
53  produces<std::vector<TrajectorySeed> >();
54 }
55 
57 
58 }
59 
60 //
61 // Produce seeds
62 //
64 
65  // Initialize variables
66  unsigned int numSeedsMade = 0;
67  unsigned int layerCount = 0;
68  unsigned int hitlessSeedsMadeIP = 0;
69  unsigned int hitlessSeedsMadeMuS = 0;
70  unsigned int hitSeedsMade = 0;
71 
72  // Surface used to make a TSOS at the PCA to the beamline
74 
75  // Read ESHandles
76  edm::Handle<MeasurementTrackerEvent> measurementTrackerH;
79  edm::ESHandle<Propagator> propagatorAlongH;
80  edm::ESHandle<Propagator> propagatorOppositeH;
81  edm::ESHandle<TrackerGeometry> tmpTkGeometryH;
83 
84  iSetup.get<IdealMagneticFieldRecord>().get(magfieldH);
85  iSetup.get<TrackingComponentsRecord>().get(propagatorName_, propagatorOppositeH);
86  iSetup.get<TrackingComponentsRecord>().get(propagatorName_, propagatorAlongH);
87  iSetup.get<GlobalTrackingGeometryRecord>().get(geometryH);
88  iSetup.get<TrackerDigiGeometryRecord>().get(tmpTkGeometryH);
89  iSetup.get<TrackingComponentsRecord>().get(estimatorName_,estimatorH);
90  iEvent.getByToken(measurementTrackerTag_, measurementTrackerH);
91 
92  // Read L2 track collection
94  iEvent.getByToken(src_, l2TrackCol);
95 
96  // The product
97  std::unique_ptr<std::vector<TrajectorySeed> > result(new std::vector<TrajectorySeed>());
98 
99  // Get vector of Detector layers
100  std::vector<BarrelDetLayer const*> const& tob = measurementTrackerH->geometricSearchTracker()->tobLayers();
101  std::vector<ForwardDetLayer const*> const& tecPositive = tmpTkGeometryH->isThere(GeomDetEnumerators::P2OTEC) ?
102  measurementTrackerH->geometricSearchTracker()->posTidLayers() :
103  measurementTrackerH->geometricSearchTracker()->posTecLayers();
104  std::vector<ForwardDetLayer const*> const& tecNegative = 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 
120  const reco::TrackRef l2(l2TrackCol, l2TrackColIndex);
121 
122  // Container of Seeds
123  std::vector<TrajectorySeed> out;
124  LogTrace("TSGForOIFromL2") << "TSGForOIFromL2::produce: L2 muon pT, eta, phi --> " << l2->pt() << " , " << l2->eta() << " , " << 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 = trajectoryStateTransform::innerStateOnSurface(*l2, *geometryH, magfieldH.product());
134  LogTrace("TSGForOIFromL2") << "TSGForOIFromL2::produce: Created TSOSatMuonSystem: " << tsosAtMuonSystem <<std::endl;
135 
136  LogTrace("TSGForOIFromL2") << "TSGForOIFromL2::produce: Check the error of the L2 parameter and use hit seeds if big errors" << std::endl;
137 
138  StateOnTrackerBound fromInside(propagatorAlong.get());
139  TrajectoryStateOnSurface outerTkStateInside = fromInside(fts);
140 
141  StateOnTrackerBound fromOutside(&*SHPOpposite);
142  TrajectoryStateOnSurface outerTkStateOutside = fromOutside(tsosAtMuonSystem);
143 
144  // Check if the two positions (using updated and not-updated TSOS) agree withing certain extent.
145  // 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.
146  double L2muonEta=l2->eta();
147  double absL2muonEta=std::abs(L2muonEta);
148  bool useBoth = false;
149  if (outerTkStateInside.isValid() && outerTkStateOutside.isValid()) {
150  //following commented out variables dist1 (5 par compatibility of tsos at outertracker surface)
151  //dist2 (angle between two tsos) could further be explored in combination of L2 valid hits for seeding. So kept for
152  //future developers
153  //auto dist1 = match_Chi2(outerTkStateInside,outerTkStateOutside);//for future developers
154  //auto dist2 = deltaR(outerTkStateInside.globalMomentum(),outerTkStateOutside.globalMomentum());//for future developers
155  //if ((dist1 > tsosDiff1_ || dist2 > tsosDiff2_) && l2->numberOfValidHits() < 20) useBoth = true;//for future developers
156  if (l2->numberOfValidHits() < numL2ValidHitsCutAllEta_) useBoth = true;
157  if (l2->numberOfValidHits() < numL2ValidHitsCutAllEndcap_ && absL2muonEta > eta7_) useBoth = true;
158  if (absL2muonEta > eta1_ && absL2muonEta < eta1_) useBoth = true;
159  }
160 
161  numSeedsMade = 0;
162  hitlessSeedsMadeIP = 0;
163  hitlessSeedsMadeMuS = 0;
164  hitSeedsMade = 0;
165 
166  // calculate scale factors
169 
170  // BARREL
171  if (absL2muonEta < maxEtaForTOB_) {
172  layerCount = 0;
173  for (auto it=tob.rbegin(); it!=tob.rend(); ++it) {
174  LogTrace("TSGForOIFromL2") << "TSGForOIFromL2::produce: looping in TOB layer " << layerCount << std::endl;
175  if ( useHitLessSeeds_ && hitlessSeedsMadeIP < maxHitlessSeeds_ && numSeedsMade < maxSeeds_ )
176  makeSeedsWithoutHits(**it, tsosAtIP, *(propagatorAlong.get()), estimatorH, errorSFHitless, hitlessSeedsMadeIP, numSeedsMade, out);
177 
178  // Do not create hitbased seeds in barrel region
179  if (absL2muonEta > 1.0 && hitSeedsMade < maxHitSeeds_ && numSeedsMade < maxSeeds_ )
180  makeSeedsFromHits(**it, tsosAtIP, *(propagatorAlong.get()), estimatorH, measurementTrackerH, errorSFHits, hitSeedsMade, numSeedsMade, layerCount, out);
181 
182  if (useBoth) {
183  if ( useHitLessSeeds_ && hitlessSeedsMadeMuS < maxHitlessSeeds_ && numSeedsMade < maxSeeds_ )
184  makeSeedsWithoutHits(**it, outerTkStateOutside, *(propagatorOpposite.get()), estimatorH, errorSFHitless, hitlessSeedsMadeMuS, numSeedsMade, out);
185  }
186  }
187  LogTrace("TSGForOIFromL2") << "TSGForOIFromL2:::produce: NumSeedsMade = " << numSeedsMade << " , layerCount = " << layerCount << std::endl;
188  }
189 
190  // Reset number of seeds if in overlap region
191  if (absL2muonEta > minEtaForTEC_ && absL2muonEta < maxEtaForTOB_) {
192  numSeedsMade = 0;
193  hitlessSeedsMadeIP = 0;
194  hitlessSeedsMadeMuS = 0;
195  hitSeedsMade = 0;
196  }
197 
198  // ENDCAP+
199  if (L2muonEta > minEtaForTEC_) {
200  layerCount = 0;
201  for (auto it=tecPositive.rbegin(); it!=tecPositive.rend(); ++it) {
202  LogTrace("TSGForOIFromL2") << "TSGForOIFromL2::produce: looping in TEC+ layer " << layerCount << std::endl;
203  if ( useHitLessSeeds_ && hitlessSeedsMadeIP < maxHitlessSeeds_ && numSeedsMade < maxSeeds_ )
204  makeSeedsWithoutHits(**it, tsosAtIP, *(propagatorAlong.get()), estimatorH, errorSFHitless, hitlessSeedsMadeIP, numSeedsMade, out);
205 
206  if (absL2muonEta > 1.0 && hitSeedsMade < maxHitSeeds_ && numSeedsMade < maxSeeds_ )
207  makeSeedsFromHits(**it, tsosAtIP, *(propagatorAlong.get()), estimatorH, measurementTrackerH, errorSFHits, hitSeedsMade, numSeedsMade, layerCount, out);
208 
209  if (useBoth) {
210  if ( useHitLessSeeds_ && hitlessSeedsMadeMuS < maxHitlessSeeds_ && numSeedsMade < maxSeeds_ )
211  makeSeedsWithoutHits(**it, outerTkStateOutside, *(propagatorOpposite.get()), estimatorH, errorSFHitless, hitlessSeedsMadeMuS, numSeedsMade, out);
212  }
213  }
214  LogTrace("TSGForOIFromL2") << "TSGForOIFromL2:::produce: NumSeedsMade = " << numSeedsMade << " , layerCount = " << layerCount << std::endl;
215  }
216 
217  // ENDCAP-
218  if (L2muonEta < -minEtaForTEC_) {
219  layerCount = 0;
220  for (auto it=tecNegative.rbegin(); it!=tecNegative.rend(); ++it) {
221  LogTrace("TSGForOIFromL2") << "TSGForOIFromL2::produce: looping in TEC- layer " << layerCount << std::endl;
222  if ( useHitLessSeeds_ && hitlessSeedsMadeIP < maxHitlessSeeds_ && numSeedsMade < maxSeeds_ )
223  makeSeedsWithoutHits(**it, tsosAtIP, *(propagatorAlong.get()), estimatorH, errorSFHitless, hitlessSeedsMadeIP, numSeedsMade, out);
224 
225  if (absL2muonEta > 1.0 && hitSeedsMade < maxHitSeeds_ && numSeedsMade < maxSeeds_ )
226  makeSeedsFromHits(**it, tsosAtIP, *(propagatorAlong.get()), estimatorH, measurementTrackerH, errorSFHits, hitSeedsMade, numSeedsMade, layerCount, out);
227 
228  if (useBoth) {
229  if ( useHitLessSeeds_ && hitlessSeedsMadeMuS < maxHitlessSeeds_ && numSeedsMade < maxSeeds_ )
230  makeSeedsWithoutHits(**it, outerTkStateOutside, *(propagatorOpposite.get()), estimatorH, errorSFHitless, hitlessSeedsMadeMuS, numSeedsMade, out);
231  }
232  }
233  LogTrace("TSGForOIFromL2") << "TSGForOIFromL2:::produce: NumSeedsMade = " << numSeedsMade << " , layerCount = " << layerCount << std::endl;
234  }
235 
236  for (std::vector<TrajectorySeed>::iterator it=out.begin(); it!=out.end(); ++it) {
237  result->push_back(*it);
238  }
239 
240  } // L2Collection
241 
242  edm::LogInfo(theCategory_) << "TSGForOIFromL2::produce: number of seeds made: " << result->size();
243 
244  iEvent.put(std::move(result));
245 }
246 
247 
248 //
249 // Create seeds without hits on a given layer (TOB or TEC)
250 //
252  const GeometricSearchDet& layer,
253  const TrajectoryStateOnSurface& tsos,
256  double errorSF,
257  unsigned int& hitlessSeedsMade,
258  unsigned int& numSeedsMade,
259  std::vector<TrajectorySeed>& out) const {
260 
261  // create hitless seeds
262  LogTrace("TSGForOIFromL2") << "TSGForOIFromL2::makeSeedsWithoutHits: Start hitless" << std::endl;
263  std::vector< GeometricSearchDet::DetWithState > dets;
264  layer.compatibleDetsV(tsos, propagatorAlong, *estimator, dets);
265  if (!dets.empty()) {
266  auto const& detOnLayer = dets.front().first;
267  auto const& tsosOnLayer = dets.front().second;
268  LogTrace("TSGForOIFromL2") << "TSGForOIFromL2::makeSeedsWithoutHits: tsosOnLayer " << tsosOnLayer << std::endl;
269  if (!tsosOnLayer.isValid()) {
270  edm::LogInfo(theCategory_) << "ERROR!: Hitless TSOS is not valid!";
271  }
272  else {
273  dets.front().second.rescaleError(errorSF);
274  PTrajectoryStateOnDet const& ptsod = trajectoryStateTransform::persistentState(tsosOnLayer,detOnLayer->geographicalId().rawId());
277  LogTrace("TSGForOIFromL2") << "TSGForOIFromL2::makeSeedsWithoutHits: TSOS (Hitless) done " << std::endl;
278  hitlessSeedsMade++;
279  numSeedsMade++;
280  }
281  }
282 
283 }
284 
285 
286 //
287 // Find hits on a given layer (TOB or TEC) and create seeds from updated TSOS with hit
288 //
290  const GeometricSearchDet& layer,
291  const TrajectoryStateOnSurface& tsos,
294  edm::Handle<MeasurementTrackerEvent>& measurementTracker,
295  double errorSF,
296  unsigned int& hitSeedsMade,
297  unsigned int& numSeedsMade,
298  unsigned int& layerCount,
299  std::vector<TrajectorySeed>& out) const {
300 
301  if (layerCount > numOfLayersToTry_) return;
302 
303  // Error Rescaling
304  TrajectoryStateOnSurface onLayer(tsos);
305  onLayer.rescaleError(errorSF);
306 
307  std::vector< GeometricSearchDet::DetWithState > dets;
308  layer.compatibleDetsV(onLayer, propagatorAlong, *estimator, dets);
309 
310  // Find Measurements on each DetWithState
311  LogTrace("TSGForOIFromL2") << "TSGForOIFromL2::makeSeedsFromHits: Find measurements on each detWithState " << dets.size() << std::endl;
312  std::vector<TrajectoryMeasurement> meas;
313  for (std::vector<GeometricSearchDet::DetWithState>::iterator it=dets.begin(); it!=dets.end(); ++it) {
314  MeasurementDetWithData det = measurementTracker->idToDet(it->first->geographicalId());
315  if (det.isNull()) continue;
316  if (!it->second.isValid()) continue; // Skip if TSOS is not valid
317 
318  std::vector <TrajectoryMeasurement> mymeas = det.fastMeasurements(it->second, onLayer, propagatorAlong, *estimator); // Second TSOS is not used
319  for (std::vector<TrajectoryMeasurement>::const_iterator it2 = mymeas.begin(), ed2 = mymeas.end(); it2 != ed2; ++it2) {
320  if (it2->recHit()->isValid()) meas.push_back(*it2); // Only save those which are valid
321  }
322  }
323 
324  // Update TSOS using TMs after sorting, then create Trajectory Seed and put into vector
325  LogTrace("TSGForOIFromL2") << "TSGForOIFromL2::makeSeedsFromHits: Update TSOS using TMs after sorting, then create Trajectory Seed, number of TM = " << meas.size() << std::endl;
326  std::sort(meas.begin(), meas.end(), TrajMeasLessEstim());
327 
328  unsigned int found = 0;
329  for (std::vector<TrajectoryMeasurement>::const_iterator it=meas.begin(); it!=meas.end(); ++it) {
330  TrajectoryStateOnSurface updatedTSOS = updator_->update(it->forwardPredictedState(), *it->recHit());
331  LogTrace("TSGForOIFromL2") << "TSGForOIFromL2::makeSeedsFromHits: TSOS for TM " << found << std::endl;
332  if (not updatedTSOS.isValid()) continue;
333 
335  seedHits.push_back(*it->recHit()->hit());
336  PTrajectoryStateOnDet const& pstate = trajectoryStateTransform::persistentState(updatedTSOS, it->recHit()->geographicalId().rawId());
337  TrajectorySeed seed(pstate, std::move(seedHits), oppositeToMomentum);
338  LogTrace("TSGForOIFromL2") << "TSGForOIFromL2::makeSeedsFromHits: Number of seedHits: " << seedHits.size() << std::endl;
339  out.push_back(seed);
340  found++;
341  numSeedsMade++;
342  hitSeedsMade++;
343  if (found == numOfHitsToTry_) break;
344  if (hitSeedsMade > maxHitSeeds_) return;
345  }
346 
347  if (found) layerCount++;
348 
349 }
350 
351 
352 //
353 // Calculate the dynamic error SF by analysing the L2
354 //
356 
357  double theSF = 1.0;
358  // L2 direction vs pT blowup - as was previously done:
359  // Split into 4 pT ranges: <pT1_, pT1_<pT2_, pT2_<pT3_, <pT4_: 13,30,70
360  // Split into different eta ranges depending in pT
361  double abseta = std::abs(track->eta());
362  if (track->pt() <= pT1_) theSF = SF1_;
363  else if (track->pt() > pT1_ && track->pt() <= pT2_) {
364  if (abseta <= eta3_) theSF = SF3_;
365  else if (abseta > eta3_ && abseta <= eta6_) theSF = SF2_;
366  else if (abseta > eta6_) theSF = SF3_;
367  }
368  else if (track->pt() > pT2_ && track->pt() <= pT3_) {
369  if (abseta <= eta1_) theSF = SF6_;
370  else if (abseta > eta1_ && abseta <= eta2_) theSF = SF4_;
371  else if (abseta > eta2_ && abseta <= eta3_) theSF = SF6_;
372  else if (abseta > eta3_ && abseta <= eta4_) theSF = SF1_;
373  else if (abseta > eta4_ && abseta <= eta5_) theSF = SF1_;
374  else if (abseta > eta5_ ) theSF = SF5_;
375  }
376  else if (track->pt() > pT3_) {
377  if (abseta <= eta3_) theSF = SF5_;
378  else if (abseta > eta3_ && abseta <= eta4_) theSF = SF4_;
379  else if (abseta > eta4_ && abseta <= eta5_) theSF = SF4_;
380  else if (abseta > eta5_ ) theSF = SF5_;
381  }
382 
383  LogTrace(theCategory_) << "TSGForOIFromL2::calculateSFFromL2: SF has been calculated as: " << theSF;
384 
385  return theSF;
386 
387 }
388 
389 //
390 // calculate Chi^2 of two trajectory states
391 //
393  const TrajectoryStateOnSurface& tsos2) const {
394 
395  if ( !tsos1.isValid() || !tsos2.isValid() ) return -1.;
396 
398  AlgebraicSymMatrix55 m(tsos1.localError().matrix() + tsos2.localError().matrix());
399 
400  bool ierr = !m.Invert();
401 
402  if ( ierr ) {
403  edm::LogInfo("TSGForOIFromL2") << "Error inverting covariance matrix";
404  return -1;
405  }
406 
407  double est = ROOT::Math::Similarity(v,m);
408 
409  return est;
410 
411 }
412 
413 
414 //
415 //
416 //
418 
420  desc.add<edm::InputTag>("src",edm::InputTag("hltL2Muons","UpdatedAtVtx"));
421  desc.add<int>("layersToTry",2);
422  desc.add<double>("fixedErrorRescaleFactorForHitless",2.0);
423  desc.add<int>("hitsToTry",1);
424  desc.add<bool>("adjustErrorsDynamicallyForHits",false);
425  desc.add<bool>("adjustErrorsDynamicallyForHitless",true);
426  desc.add<edm::InputTag>("MeasurementTrackerEvent",edm::InputTag("hltSiStripClusters"));
427  desc.add<bool>("UseHitLessSeeds",true);
428  desc.add<std::string>("estimator","hltESPChi2MeasurementEstimator100");
429  desc.add<double>("maxEtaForTOB",1.8);
430  desc.add<double>("minEtaForTEC",0.7);
431  desc.addUntracked<bool>("debug",false);
432  desc.add<double>("fixedErrorRescaleFactorForHits",1.0);
433  desc.add<unsigned int>("maxSeeds",20);
434  desc.add<unsigned int>("maxHitlessSeeds",5);
435  desc.add<unsigned int>("maxHitSeeds",1);
436  desc.add<unsigned int>("numL2ValidHitsCutAllEta",20);
437  desc.add<unsigned int>("numL2ValidHitsCutAllEndcap",30);
438  desc.add<double>("pT1",13.0);
439  desc.add<double>("pT2",30.0);
440  desc.add<double>("pT3",70.0);
441  desc.add<double>("eta1",0.2);
442  desc.add<double>("eta2",0.3);
443  desc.add<double>("eta3",1.0);
444  desc.add<double>("eta4",1.2);
445  desc.add<double>("eta5",1.6);
446  desc.add<double>("eta6",1.4);
447  desc.add<double>("eta7",2.1);
448  desc.add<double>("SF1",3.0);
449  desc.add<double>("SF2",4.0);
450  desc.add<double>("SF3",5.0);
451  desc.add<double>("SF4",7.0);
452  desc.add<double>("SF5",10.0);
453  desc.add<double>("SF6",2.0);
454  desc.add<double>("tsosDiff1",0.2);
455  desc.add<double>("tsosDiff2",0.02);
456  desc.add<std::string>("propagatorName","PropagatorWithMaterialParabolicMf");
457  descriptions.add("TSGForOIFromL2",desc);
458 
459 }
460 
static void fillDescriptions(edm::ConfigurationDescriptions &descriptions)
const bool useHitLessSeeds_
MeasurementDetWithData idToDet(const DetId &id) const
Previous MeasurementDetSystem interface.
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.
OrphanHandle< PROD > put(std::unique_ptr< PROD > product)
Put a new product.
Definition: Event.h:125
TSGForOIFromL2(const edm::ParameterSet &iConfig)
const double eta2_
ParameterDescriptionBase * addUntracked(U const &iLabel, T const &value)
const LocalTrajectoryParameters & localParameters() const
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:517
const unsigned int numOfHitsToTry_
How many hits to try per layer.
const double minEtaForTEC_
Minimum eta value to activate searching in the TEC.
const std::string estimatorName_
Estimator used to find dets and TrajectoryMeasurements.
size_type size() const
Definition: OwnVector.h:264
std::vector< Track > TrackCollection
collection of Tracks
Definition: TrackFwd.h:15
PTrajectoryStateOnDet persistentState(const TrajectoryStateOnSurface &ts, unsigned int detid)
const unsigned int maxHitSeeds_
Maximum number of hitbased seeds for each L2.
std::vector< BarrelDetLayer const * > const & tobLayers() const
ROOT::Math::SMatrix< double, 5, 5, ROOT::Math::MatRepSym< double, 5 > > AlgebraicSymMatrix55
const double SF2_
void produce(edm::StreamID sid, edm::Event &iEvent, const edm::EventSetup &iSetup) const override
bool isThere(GeomDetEnumerators::SubDetector subdet) const
const unsigned int maxHitlessSeeds_
Maximum number of hitless seeds for each L2.
AlgebraicVector5 vector() const
std::unique_ptr< Propagator > SetPropagationDirection(Propagator const &iprop, PropagationDirection dir)
void push_back(D *&d)
Definition: OwnVector.h:290
const double pT2_
const double SF6_
int iEvent
Definition: GenABIO.cc:224
#define DEFINE_FWK_MODULE(type)
Definition: MakerMacros.h:16
const double eta7_
std::vector< TrajectoryMeasurement > fastMeasurements(const TrajectoryStateOnSurface &stateOnThisDet, const TrajectoryStateOnSurface &tsos2, const Propagator &prop, const MeasurementEstimator &est) const
static PlanePointer build(Args &&...args)
Definition: Plane.h:33
const unsigned int numL2ValidHitsCutAllEndcap_
const unsigned int maxSeeds_
Maximum number of seeds for each L2.
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
const double eta1_
const std::unique_ptr< TrajectoryStateUpdator > updator_
KFUpdator defined in constructor.
const double SF3_
const double fixedErrorRescalingForHits_
Rescale L2 parameter uncertainties (fixed error vs pT, eta)
const double maxEtaForTOB_
Maximum eta value to activate searching in the TOB.
const AlgebraicSymMatrix55 & matrix() const
const LocalTrajectoryError & localError() const
const bool adjustErrorsDynamicallyForHits_
Whether or not to use an automatically calculated scale-factor value.
ParameterDescriptionBase * add(U const &iLabel, T const &value)
const std::string theCategory_
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)
const edm::EDGetTokenT< MeasurementTrackerEvent > measurementTrackerTag_
#define LogTrace(id)
const unsigned int numL2ValidHitsCutAllEta_
L2 valid hit cuts to decide seed creation by both states.
~TSGForOIFromL2() override
const double eta6_
GlobalPoint position() const
double match_Chi2(const TrajectoryStateOnSurface &tsos1, const TrajectoryStateOnSurface &tsos2) const
Find compatability between two TSOSs.
ROOT::Math::SVector< double, 5 > AlgebraicVector5
const double eta5_
std::vector< ForwardDetLayer const * > const & posTecLayers() const
void add(std::string const &label, ParameterSetDescription const &psetDescription)
const double SF4_
std::vector< ForwardDetLayer const * > const & negTidLayers() const
const edm::EDGetTokenT< reco::TrackCollection > src_
Labels for input collections.
std::vector< ForwardDetLayer const * > const & posTidLayers() const
fixed size matrix
HLT enums.
const double eta3_
double calculateSFFromL2(const reco::TrackRef track) const
Calculate the dynamic error SF by analysing the L2.
const double eta4_
T get() const
Definition: EventSetup.h:71
const bool adjustErrorsDynamicallyForHitless_
std::vector< ForwardDetLayer const * > const & negTecLayers() const
FreeTrajectoryState initialFreeState(const reco::Track &tk, const MagneticField *field, bool withErr=true)
Create L3MuonTrajectorySeeds from L2 Muons updated at vertex in an outside-in manner.
T const * product() const
Definition: ESHandle.h:86
const double SF5_
const unsigned int numOfLayersToTry_
How many layers to try.
const std::string propagatorName_
Counters and flags for the implementation.
const GeometricSearchTracker * geometricSearchTracker() const
const double SF1_
virtual void compatibleDetsV(const TrajectoryStateOnSurface &startingState, const Propagator &prop, const MeasurementEstimator &est, std::vector< DetWithState > &result) const
def move(src, dest)
Definition: eostools.py:511
const double pT3_
const double pT1_
pT, eta ranges and scale factor values
TrajectoryStateOnSurface innerStateOnSurface(const reco::Track &tk, const TrackingGeometry &geom, const MagneticField *field, bool withErr=true)
const double fixedErrorRescalingForHitless_