CMS 3D CMS Logo

LowPtGsfElectronSeedProducer.cc
Go to the documentation of this file.
1 // -*- C++ -*-
2 //
3 // Package: ElectronProducers
4 // Class: LowPtGsfElectronSeedProducer
5 //
11 // Original Author: Robert Bainbridge
12 
54 
56 
58  : public edm::stream::EDProducer<edm::GlobalCache<lowptgsfeleseed::HeavyObjectCache> > {
59 public:
60  using TrackIndxMap = std::unordered_map<reco::TrackRef::key_type, size_t>;
62 
63  static std::unique_ptr<lowptgsfeleseed::HeavyObjectCache> initializeGlobalCache(const edm::ParameterSet& conf) {
64  return std::make_unique<lowptgsfeleseed::HeavyObjectCache>(lowptgsfeleseed::HeavyObjectCache(conf));
65  }
66 
68 
69  void beginLuminosityBlock(edm::LuminosityBlock const&, edm::EventSetup const&) override;
70 
71  void produce(edm::Event&, const edm::EventSetup&) override;
72 
74 
75 private: // member functions
76  template <typename T>
77  void loop(const edm::Handle<std::vector<T> >& handle,
80  reco::PreIdCollection& ecalPreIds,
81  reco::PreIdCollection& hcalPreIds,
82  TrackIndxMap& trksToPreIdIndx,
83  edm::Event&,
84  const edm::EventSetup&);
85 
86  // Overloaded methods to retrieve reco::TrackRef
87 
88  reco::TrackRef getBaseRef(edm::Handle<std::vector<reco::Track> > handle, int idx) const;
89  reco::TrackRef getBaseRef(edm::Handle<std::vector<reco::PFRecTrack> > handle, int idx) const;
90 
91  // Overloaded methods to populate PreIds (using PF or KF tracks)
92 
93  void propagateTrackToCalo(const reco::PFRecTrackRef& pfTrackRef,
96  std::vector<int>& matchedEcalClusters,
97  std::vector<int>& matchedHcalClusters,
98  reco::PreId& ecalPreId,
99  reco::PreId& hcalPreId);
100 
101  void propagateTrackToCalo(const reco::PFRecTrackRef& pfTrackRef,
103  std::vector<int>& matchedClusters,
104  reco::PreId& preId,
105  bool ecal);
106 
110  std::vector<int>& matchedEcalClusters,
111  std::vector<int>& matchedHcalClusters,
112  reco::PreId& ecalPreId,
113  reco::PreId& hcalPreId);
114  template <typename CollType>
116  const TrackIndxMap& trksToPreIdIndx,
117  const edm::OrphanHandle<reco::PreIdCollection>& preIdHandle,
119 
120  // Overloaded methods to evaluate BDTs (using PF or KF tracks)
121 
122  bool decision(const reco::PFRecTrackRef& pfTrackRef,
123  reco::PreId& ecal,
124  reco::PreId& hcal,
125  double rho,
126  const reco::BeamSpot& spot,
127  noZS::EcalClusterLazyTools& ecalTools);
128 
129  bool decision(const reco::TrackRef& kfTrackRef,
130  reco::PreId& ecal,
131  reco::PreId& hcal,
132  double rho,
133  const reco::BeamSpot& spot,
134  noZS::EcalClusterLazyTools& ecalTools);
135 
136  // Perform lightweight GSF tracking
138 
139 private: // member data
141  std::unique_ptr<TrajectoryFitter> fitterPtr_;
142  std::unique_ptr<TrajectorySmoother> smootherPtr_;
151 
156 
157  const bool passThrough_;
158  const bool usePfTracks_;
159  const double minPtThreshold_;
160  const double maxPtThreshold_;
161 
162  // pow( sinh(1.65), 2. )
163  static constexpr double boundary_ = 2.50746495928 * 2.50746495928;
164  // pow( ele_mass, 2. )
165  static constexpr double mass_ = 0.000511 * 0.000511;
166 };
167 
169 //
172  : field_(),
173  fitterPtr_(),
174  smootherPtr_(),
175  kfTracks_(),
176  pfTracks_(),
177  ecalClusters_{consumes(conf.getParameter<edm::InputTag>("ecalClusters"))},
178  hcalClusters_(),
179  ebRecHits_{consumes(conf.getParameter<edm::InputTag>("EBRecHits"))},
180  eeRecHits_{consumes(conf.getParameter<edm::InputTag>("EERecHits"))},
181  rho_(consumes(conf.getParameter<edm::InputTag>("rho"))),
182  beamSpot_(consumes(conf.getParameter<edm::InputTag>("BeamSpot"))),
183  trajectoryFitterToken_{esConsumes(conf.getParameter<edm::ESInputTag>("Fitter"))},
184  trajectorySmootherToken_{esConsumes(conf.getParameter<edm::ESInputTag>("Smoother"))},
185  builderToken_{esConsumes(conf.getParameter<edm::ESInputTag>("TTRHBuilder"))},
186  ecalClusterToolsESGetTokens_{consumesCollector()},
187  passThrough_(conf.getParameter<bool>("PassThrough")),
188  usePfTracks_(conf.getParameter<bool>("UsePfTracks")),
189  minPtThreshold_(conf.getParameter<double>("MinPtThreshold")),
190  maxPtThreshold_(conf.getParameter<double>("MaxPtThreshold")) {
191  if (usePfTracks_) {
192  pfTracks_ = consumes(conf.getParameter<edm::InputTag>("pfTracks"));
193  hcalClusters_ = consumes(conf.getParameter<edm::InputTag>("hcalClusters"));
194  }
195  kfTracks_ = consumes(conf.getParameter<edm::InputTag>("tracks"));
196 
197  produces<reco::ElectronSeedCollection>();
198  produces<reco::PreIdCollection>();
199  produces<reco::PreIdCollection>("HCAL");
200  produces<edm::ValueMap<reco::PreIdRef> >(); // indexed by edm::Ref<ElectronSeed>.index()
201 }
202 
204 //
207 }
208 
210 //
212  // Products
213  auto seeds = std::make_unique<reco::ElectronSeedCollection>();
214  auto ecalPreIds = std::make_unique<reco::PreIdCollection>();
215  auto hcalPreIds = std::make_unique<reco::PreIdCollection>();
216 
217  const edm::RefProd<reco::PreIdCollection> preIdsRefProd = event.getRefBeforePut<reco::PreIdCollection>();
218 
219  // HCAL clusters (only used with PF tracks)
221 
222  //we always need kftracks as we link the preids to them
224  event.getByToken(kfTracks_, kfTracks);
225 
226  TrackIndxMap trksToPreIdIndx;
227  if (usePfTracks_) {
229  event.getByToken(pfTracks_, pfTracks);
230  event.getByToken(hcalClusters_, hcalClusters);
231 
232  //check consistency between kfTracks and pfTracks collection
233  for (auto& trk : *pfTracks) {
234  if (trk.trackRef().isNonnull()) {
235  if (trk.trackRef().id() != kfTracks.id()) {
236  throw cms::Exception("ConfigError")
237  << "kfTracks is not the collection that pfTracks was built from, please fix this";
238  }
239  break; //we only need one valid track ref to check this so end the loop
240  }
241  }
242 
243  loop(pfTracks, // PF tracks
244  hcalClusters,
245  *seeds,
246  *ecalPreIds,
247  *hcalPreIds,
248  trksToPreIdIndx,
249  event,
250  setup);
251 
252  } else {
253  loop(kfTracks, // KF tracks
254  hcalClusters,
255  *seeds,
256  *ecalPreIds,
257  *hcalPreIds,
258  trksToPreIdIndx,
259  event,
260  setup);
261  }
262 
263  auto ecalPreIdsHandle = event.put(std::move(ecalPreIds));
264  event.put(std::move(hcalPreIds), "HCAL");
265  event.put(std::move(seeds));
266 
267  auto preIdVMOut = std::make_unique<edm::ValueMap<reco::PreIdRef> >();
268  edm::ValueMap<reco::PreIdRef>::Filler mapFiller(*preIdVMOut);
269  fillPreIdRefValueMap(kfTracks, trksToPreIdIndx, ecalPreIdsHandle, mapFiller);
270  mapFiller.fill();
271  event.put(std::move(preIdVMOut));
272 }
273 
275 // Return reco::Track from edm::Ref<T>
276 
278  return reco::TrackRef(handle, idx);
279 }
280 
282  int idx) const {
283  return reco::PFRecTrackRef(handle, idx)->trackRef();
284 }
285 
287 // Template function, instantiated for both reco::Tracks and reco::PFRecTracks
288 template <typename T>
289 void LowPtGsfElectronSeedProducer::loop(const edm::Handle<std::vector<T> >& handle, // PF or KF tracks
292  reco::PreIdCollection& ecalPreIds,
293  reco::PreIdCollection& hcalPreIds,
294  TrackIndxMap& trksToPreIdIndx,
295  edm::Event& event,
296  const edm::EventSetup& setup) {
297  // Pileup
298  auto const& rho = event.get(rho_);
299 
300  // Beam spot
301  auto const& spot = event.get(beamSpot_);
302 
303  // Track fitter
304  fitterPtr_ = setup.getData(trajectoryFitterToken_).clone();
305 
306  // Track smoother
307  smootherPtr_.reset(setup.getData(trajectorySmootherToken_).clone());
308 
309  // RecHit cloner
310  TkClonerImpl hitCloner = static_cast<TkTransientTrackingRecHitBuilder const&>(setup.getData(builderToken_)).cloner();
311  fitterPtr_->setHitCloner(&hitCloner);
312  smootherPtr_->setHitCloner(&hitCloner);
313 
314  // ECAL clusters
315  auto ecalClusters = event.getHandle(ecalClusters_);
316 
317  // Utility to access to shower shape vars
319 
320  // Ensure each cluster is only matched once to a track
321  std::vector<int> matchedEcalClusters;
322  std::vector<int> matchedHcalClusters;
323 
324  // Reserve
325  seeds.reserve(handle->size());
326  ecalPreIds.reserve(handle->size());
327  hcalPreIds.reserve(handle->size());
328 
329  // Iterate through (PF or KF) tracks
330  for (unsigned int itrk = 0; itrk < handle.product()->size(); itrk++) {
331  edm::Ref<std::vector<T> > templatedRef(handle, itrk); // TrackRef or PFRecTrackRef
332  reco::TrackRef trackRef = getBaseRef(handle, itrk);
333 
334  if (!(trackRef->quality(reco::TrackBase::qualityByName("highPurity")))) {
335  continue;
336  }
337  if (!passThrough_ && (trackRef->pt() < minPtThreshold_)) {
338  continue;
339  }
340 
341  // Create ElectronSeed
342  reco::ElectronSeed seed(*(trackRef->seedRef()));
343  if (seed.nHits() == 0) { //if DeepCore is used in jetCore iteration the seed are hitless, in case skip
344  continue;
345  }
346  seed.setCtfTrack(trackRef);
347 
348  // Create PreIds
349  unsigned int nModels = globalCache()->modelNames().size();
350  reco::PreId ecalPreId(nModels);
351  reco::PreId hcalPreId(nModels);
352 
353  // Add track ref to PreId
354  ecalPreId.setTrack(trackRef);
355  hcalPreId.setTrack(trackRef);
356 
357  // Add Track-Calo matching variables to PreIds
359  templatedRef, ecalClusters, hcalClusters, matchedEcalClusters, matchedHcalClusters, ecalPreId, hcalPreId);
360 
361  // Add variables related to GSF tracks to PreId
362  lightGsfTracking(ecalPreId, trackRef, seed);
363 
364  // Decision based on BDT
365  bool result = decision(templatedRef, ecalPreId, hcalPreId, rho, spot, ecalTools);
366 
367  // If fails BDT, do not store seed
368  if (!result) {
369  continue;
370  }
371 
372  // Store PreId
373  ecalPreIds.push_back(ecalPreId);
374  hcalPreIds.push_back(hcalPreId);
375  trksToPreIdIndx[trackRef.index()] = ecalPreIds.size() - 1;
376 
377  // Store ElectronSeed and corresponding edm::Ref<PreId>.index()
378  seeds.push_back(seed);
379  }
380 }
381 
383 // Template instantiation for reco::Tracks
384 template void LowPtGsfElectronSeedProducer::loop<reco::Track>(const edm::Handle<std::vector<reco::Track> >&,
387  reco::PreIdCollection& ecalPreIds,
388  reco::PreIdCollection& hcalPreIds,
389  TrackIndxMap& trksToPreIdIndx,
390  edm::Event&,
391  const edm::EventSetup&);
392 
394 // Template instantiation for reco::PFRecTracks
395 template void LowPtGsfElectronSeedProducer::loop<reco::PFRecTrack>(const edm::Handle<std::vector<reco::PFRecTrack> >&,
398  reco::PreIdCollection& ecalPreIds,
399  reco::PreIdCollection& hcalPreIds,
400  TrackIndxMap& trksToPreIdIndx,
401  edm::Event&,
402  const edm::EventSetup&);
403 
405 // Loops through both ECAL and HCAL clusters
409  std::vector<int>& matchedEcalClusters,
410  std::vector<int>& matchedHcalClusters,
411  reco::PreId& ecalPreId,
412  reco::PreId& hcalPreId) {
413  propagateTrackToCalo(pfTrackRef, ecalClusters, matchedEcalClusters, ecalPreId, true);
414  propagateTrackToCalo(pfTrackRef, hcalClusters, matchedHcalClusters, hcalPreId, false);
415 }
416 
418 // Loops through ECAL or HCAL clusters (called twice)
421  std::vector<int>& matched,
422  reco::PreId& preId,
423  bool ecal) {
424  // Store info for PreId
425  struct Info {
427  float dr2min = 1.e6;
428  float deta = 1.e6;
429  float dphi = 1.e6;
430  math::XYZPoint showerPos = math::XYZPoint(0., 0., 0.);
431  } info;
432 
433  // Find closest "seed cluster" to KF track extrapolated to ECAL (or HCAL)
435  if (ecal) {
436  point = pfTrackRef->extrapolatedPoint(reco::PFTrajectoryPoint::LayerType::ECALShowerMax);
437  } else {
438  point = pfTrackRef->extrapolatedPoint(reco::PFTrajectoryPoint::LayerType::HCALEntrance);
439  }
440 
441  if (point.isValid()) {
442  Info info;
443  for (unsigned int iclu = 0; iclu < clusters.product()->size(); iclu++) {
444  if (std::find(matched.begin(), matched.end(), iclu) == matched.end()) {
445  reco::PFClusterRef cluRef(clusters, iclu);
446 
447  // Determine dR squared
448  float dr2 = reco::deltaR2(cluRef->positionREP(), point.positionREP());
449 
450  if (dr2 < info.dr2min) {
451  info.dr2min = dr2;
452  info.cluRef = cluRef;
453  info.deta = cluRef->positionREP().eta() - point.positionREP().eta();
454  info.dphi =
455  reco::deltaPhi(cluRef->positionREP().phi(), point.positionREP().phi()) * pfTrackRef->trackRef()->charge();
456  info.showerPos = point.position();
457  }
458  }
459  }
460 
461  // Set PreId content if match found
462  if (info.dr2min < 1.e5) {
463  float ep = info.cluRef->correctedEnergy() / std::sqrt(pfTrackRef->trackRef()->innerMomentum().mag2());
464  preId.setECALMatchingProperties(info.cluRef,
465  point.position(), // ECAL or HCAL surface
466  info.showerPos, //
467  info.deta,
468  info.dphi,
469  0.f, // chieta
470  0.f, // chiphi
471  pfTrackRef->trackRef()->normalizedChi2(), // chi2
472  ep);
473  }
474 
475  } // clusters
476 }
477 
479 // Original implementation in GoodSeedProducer, loops over ECAL clusters only
481  const reco::TrackRef& kfTrackRef,
484  std::vector<int>& matchedEcalClusters,
485  std::vector<int>& matchedHcalClusters, // not used
486  reco::PreId& ecalPreId,
487  reco::PreId& hcalPreId /* not used */) {
488  // Store info for PreId
489  struct Info {
491  float dr2min = 1.e6;
492  float deta = 1.e6;
493  float dphi = 1.e6;
494  math::XYZPoint showerPos = math::XYZPoint(0., 0., 0.);
495  } info;
496 
497  // Propagate 'electron' to ECAL surface
498  float energy = sqrt(mass_ + kfTrackRef->outerMomentum().Mag2());
500  kfTrackRef->outerMomentum().x(), kfTrackRef->outerMomentum().y(), kfTrackRef->outerMomentum().z(), energy);
502  kfTrackRef->outerPosition().x(), kfTrackRef->outerPosition().y(), kfTrackRef->outerPosition().z(), 0.);
503  math::XYZVector field(field_->inTesla(GlobalPoint(0, 0, 0)));
504  BaseParticlePropagator particle(RawParticle(mom, pos, kfTrackRef->charge()), 0, 0, field.z());
505  particle.propagateToEcalEntrance(false);
506  if (particle.getSuccess() == 0) {
507  return;
508  }
509 
510  // ECAL entry point for track
511  GlobalPoint ecal_pos(
512  particle.particle().vertex().x(), particle.particle().vertex().y(), particle.particle().vertex().z());
513 
514  // Preshower limit
515  bool below_ps = pow(ecal_pos.z(), 2.) > boundary_ * ecal_pos.perp2();
516 
517  // Iterate through ECAL clusters
518  for (unsigned int iclu = 0; iclu < ecalClusters.product()->size(); iclu++) {
519  reco::PFClusterRef cluRef(ecalClusters, iclu);
520 
521  // Correct ecal_pos for shower depth
522  double shower_depth = reco::PFCluster::getDepthCorrection(cluRef->correctedEnergy(), below_ps, false);
523  GlobalPoint showerPos = ecal_pos + GlobalVector(particle.particle().momentum().x(),
524  particle.particle().momentum().y(),
525  particle.particle().momentum().z())
526  .unit() *
527  shower_depth;
528 
529  // Determine dR squared
530  float dr2 = reco::deltaR2(cluRef->positionREP(), showerPos);
531 
532  // Find nearest ECAL cluster
533  if (dr2 < info.dr2min) {
534  info.dr2min = dr2;
535  info.cluRef = cluRef;
536  info.deta = std::abs(cluRef->positionREP().eta() - showerPos.eta());
537  info.dphi = std::abs(reco::deltaPhi(cluRef->positionREP().phi(), showerPos.phi())) * kfTrackRef->charge();
538  info.showerPos = showerPos;
539  }
540  }
541 
542  // Populate PreId object
543  math::XYZPoint point(ecal_pos.x(), ecal_pos.y(), ecal_pos.z());
544 
545  // Set PreId content
546  ecalPreId.setECALMatchingProperties(
547  info.cluRef,
548  point,
549  info.showerPos,
550  info.deta,
551  info.dphi,
552  0.f, // chieta
553  0.f, // chiphi
554  kfTrackRef->normalizedChi2(), // chi2
555  info.cluRef->correctedEnergy() / std::sqrt(kfTrackRef->innerMomentum().mag2())); // E/p
556 }
557 
559 // Original implementation for "lightweight" GSF tracking
561  const reco::TrackRef& trackRef,
562  const reco::ElectronSeed& seed) {
564  for (unsigned int ihit = 0; ihit < trackRef->recHitsSize(); ++ihit) {
565  hits.push_back(trackRef->recHit(ihit)->cloneSH());
566  }
567 
568  GlobalVector gv(trackRef->innerMomentum().x(), trackRef->innerMomentum().y(), trackRef->innerMomentum().z());
569  GlobalPoint gp(trackRef->innerPosition().x(), trackRef->innerPosition().y(), trackRef->innerPosition().z());
570 
571  GlobalTrajectoryParameters gtps(gp, gv, trackRef->charge(), &*field_);
572 
573  TrajectoryStateOnSurface tsos(gtps, trackRef->innerStateCovariance(), *hits[0]->surface());
574 
575  // Track fitted and smoothed under electron hypothesis
576  Trajectory traj1 = fitterPtr_->fitOne(seed, hits, tsos);
577  if (!traj1.isValid()) {
578  return false;
579  }
580  Trajectory traj2 = smootherPtr_->trajectory(traj1);
581  if (!traj2.isValid()) {
582  return false;
583  }
584 
585  // Set PreId content
586  float chi2Ratio = trackRef->chi2() > 0. ? traj2.chiSquared() / trackRef->chi2() : -1.;
587  float gsfReducedChi2 = chi2Ratio > -1. ? chi2Ratio * trackRef->normalizedChi2() : -1.;
588  float ptOut = traj2.firstMeasurement().updatedState().globalMomentum().perp();
589  float ptIn = traj2.lastMeasurement().updatedState().globalMomentum().perp();
590  float gsfDpt = (ptIn > 0) ? fabs(ptOut - ptIn) / ptIn : 0.;
591  preId.setTrackProperties(gsfReducedChi2, chi2Ratio, gsfDpt);
592 
593  return true;
594 }
595 
597 // Decision based on OR of outputs from list of models
599  reco::PreId& ecalPreId,
600  reco::PreId& hcalPreId,
601  double rho,
602  const reco::BeamSpot& spot,
603  noZS::EcalClusterLazyTools& ecalTools) {
604  bool result = false;
605  for (auto& name : globalCache()->modelNames()) {
606  result |= globalCache()->eval(name, ecalPreId, hcalPreId, rho, spot, ecalTools);
607  }
608  return passThrough_ || (pfTrackRef->trackRef()->pt() > maxPtThreshold_) || result;
609 }
610 
612 //
614  reco::PreId& ecalPreId,
615  reco::PreId& hcalPreId,
616  double rho,
617  const reco::BeamSpot& spot,
618  noZS::EcalClusterLazyTools& ecalTools) {
619  // No implementation currently
620  return passThrough_;
621 }
622 
623 template <typename CollType>
625  const TrackIndxMap& trksToPreIdIndx,
626  const edm::OrphanHandle<reco::PreIdCollection>& preIdHandle,
628  std::vector<reco::PreIdRef> values;
629 
630  unsigned ntracks = tracksHandle->size();
631  for (unsigned itrack = 0; itrack < ntracks; ++itrack) {
632  edm::Ref<CollType> trackRef(tracksHandle, itrack);
633  auto preIdRefIt = trksToPreIdIndx.find(trackRef.index());
634  if (preIdRefIt == trksToPreIdIndx.end()) {
635  values.push_back(reco::PreIdRef());
636  } else {
637  edm::Ref<reco::PreIdCollection> preIdRef(preIdHandle, preIdRefIt->second);
638  values.push_back(preIdRef);
639  }
640  }
641  filler.insert(tracksHandle, values.begin(), values.end());
642 }
643 
645 //
648  desc.add<edm::InputTag>("tracks", edm::InputTag("generalTracks"));
649  desc.add<edm::InputTag>("pfTracks", edm::InputTag("lowPtGsfElePfTracks"));
650  desc.add<edm::InputTag>("ecalClusters", edm::InputTag("particleFlowClusterECAL"));
651  desc.add<edm::InputTag>("hcalClusters", edm::InputTag("particleFlowClusterHCAL"));
652  desc.add<edm::InputTag>("EBRecHits", edm::InputTag("ecalRecHit", "EcalRecHitsEB"));
653  desc.add<edm::InputTag>("EERecHits", edm::InputTag("ecalRecHit", "EcalRecHitsEE"));
654  desc.add<edm::InputTag>("rho", edm::InputTag("fixedGridRhoFastjetAllTmp"));
655  desc.add<edm::InputTag>("BeamSpot", edm::InputTag("offlineBeamSpot"));
656  desc.add<edm::ESInputTag>("Fitter", edm::ESInputTag{"", "GsfTrajectoryFitter_forPreId"});
657  desc.add<edm::ESInputTag>("Smoother", edm::ESInputTag{"", "GsfTrajectorySmoother_forPreId"});
658  desc.add<edm::ESInputTag>("TTRHBuilder", edm::ESInputTag{"", "WithAngleAndTemplate"});
659  desc.add<std::vector<std::string> >("ModelNames", {});
660  desc.add<std::vector<std::string> >("ModelWeights", {});
661  desc.add<std::vector<double> >("ModelThresholds", {});
662  desc.add<bool>("PassThrough", false);
663  desc.add<bool>("UsePfTracks", true);
664  desc.add<double>("MinPtThreshold", 1.0);
665  desc.add<double>("MaxPtThreshold", 15.);
666  descriptions.add("lowPtGsfElectronSeeds", desc);
667 }
668 
670 //
Vector3DBase
Definition: Vector3DBase.h:8
ConfigurationDescriptions.h
muonTagProbeFilters_cff.matched
matched
Definition: muonTagProbeFilters_cff.py:62
edm::RefProd
Definition: EDProductfwd.h:25
LowPtGsfElectronSeedProducer::pfTracks_
edm::EDGetTokenT< reco::PFRecTrackCollection > pfTracks_
Definition: LowPtGsfElectronSeedProducer.cc:144
lowPtGsfElectronSeeds_cfi.pfTracks
pfTracks
Definition: lowPtGsfElectronSeeds_cfi.py:10
LowPtGsfElectronSeedProducer::rho_
const edm::EDGetTokenT< double > rho_
Definition: LowPtGsfElectronSeedProducer.cc:149
RefProd.h
LowPtGsfElectronSeedProducer::usePfTracks_
const bool usePfTracks_
Definition: LowPtGsfElectronSeedProducer.cc:158
TrajectoryStateOnSurface.h
Handle.h
MagneticField::inTesla
virtual GlobalVector inTesla(const GlobalPoint &gp) const =0
Field value ad specified global point, in Tesla.
LowPtGsfElectronSeedHeavyObjectCache.h
RawParticle
Definition: RawParticle.h:37
edm::ESInputTag
Definition: ESInputTag.h:87
BaseParticlePropagator::propagateToEcalEntrance
bool propagateToEcalEntrance(bool first=true)
Definition: BaseParticlePropagator.cc:450
GlobalTrajectoryParameters.h
LowPtGsfElectronSeedProducer::fillDescriptions
static void fillDescriptions(edm::ConfigurationDescriptions &)
Definition: LowPtGsfElectronSeedProducer.cc:646
hfClusterShapes_cfi.hits
hits
Definition: hfClusterShapes_cfi.py:5
LowPtGsfElectronSeedProducer
Definition: LowPtGsfElectronSeedProducer.cc:57
ESHandle.h
lowPtGsfElectronSeeds_cfi.hcalClusters
hcalClusters
Definition: lowPtGsfElectronSeeds_cfi.py:12
Trajectory::chiSquared
float chiSquared() const
Definition: Trajectory.h:241
edm::LuminosityBlock
Definition: LuminosityBlock.h:50
patZpeak.handle
handle
Definition: patZpeak.py:23
LowPtGsfElectronSeedProducer::eeRecHits_
const edm::EDGetTokenT< EcalRecHitCollection > eeRecHits_
Definition: LowPtGsfElectronSeedProducer.cc:148
reco::deltaPhi
constexpr double deltaPhi(double phi1, double phi2)
Definition: deltaPhi.h:26
deltaPhi.h
edm::EDGetTokenT< reco::TrackCollection >
hcal
Definition: ConfigurationDatabase.cc:13
TrackBase.h
TransientRecHitRecord.h
pos
Definition: PixelAliasList.h:18
ZElectronSkim_cff.rho
rho
Definition: ZElectronSkim_cff.py:38
HLT_FULL_cff.InputTag
InputTag
Definition: HLT_FULL_cff.py:89301
edm::ParameterSetDescription
Definition: ParameterSetDescription.h:52
BaseParticlePropagator.h
EDProducer.h
LowPtGsfElectronSeedProducer::initializeGlobalCache
static std::unique_ptr< lowptgsfeleseed::HeavyObjectCache > initializeGlobalCache(const edm::ParameterSet &conf)
Definition: LowPtGsfElectronSeedProducer.cc:63
LowPtGsfElectronSeedProducer::produce
void produce(edm::Event &, const edm::EventSetup &) override
Definition: LowPtGsfElectronSeedProducer.cc:211
info
static const TGPicture * info(bool iBackgroundIsBlack)
Definition: FWCollectionSummaryWidget.cc:153
EcalClusterLazyTools.h
TrajectoryMeasurement::updatedState
TrajectoryStateOnSurface const & updatedState() const
Definition: TrajectoryMeasurement.h:184
LowPtGsfElectronSeedProducer::beginLuminosityBlock
void beginLuminosityBlock(edm::LuminosityBlock const &, edm::EventSetup const &) override
Definition: LowPtGsfElectronSeedProducer.cc:205
XYZTLorentzVector
math::XYZTLorentzVector XYZTLorentzVector
Definition: RawParticle.h:25
LowPtGsfElectronSeedProducer::boundary_
static constexpr double boundary_
Definition: LowPtGsfElectronSeedProducer.cc:163
vertices_cff.ntracks
ntracks
Definition: vertices_cff.py:34
GlobalVector
Global3DVector GlobalVector
Definition: GlobalVector.h:10
spr::find
void find(edm::Handle< EcalRecHitCollection > &hits, DetId thisDet, std::vector< EcalRecHitCollection::const_iterator > &hit, bool debug=false)
Definition: FindCaloHit.cc:19
reco::PreId
Definition: PreId.h:13
ecal
Definition: ElectronicsMappingGPU.h:13
edm::Ref::index
key_type index() const
Definition: Ref.h:253
edm::Handle
Definition: AssociativeIterator.h:50
singleTopDQM_cfi.setup
setup
Definition: singleTopDQM_cfi.py:37
EcalRecHitCollections.h
BaseParticlePropagator
Definition: BaseParticlePropagator.h:82
TkTransientTrackingRecHitBuilder.h
ElectronSeedFwd.h
edm::Ref< TrackCollection >
PreId.h
heavyIonCSV_trainingSettings.idx
idx
Definition: heavyIonCSV_trainingSettings.py:5
reco::PFClusterRef
edm::Ref< PFClusterCollection > PFClusterRef
persistent reference to PFCluster objects
Definition: PFClusterFwd.h:15
fileCollector.seed
seed
Definition: fileCollector.py:127
IdealMagneticFieldRecord
Definition: IdealMagneticFieldRecord.h:11
TrajectoryStateOnSurface
Definition: TrajectoryStateOnSurface.h:16
MakerMacros.h
reco::ElectronSeed
Definition: ElectronSeed.h:51
LowPtGsfElectronSeedProducer::maxPtThreshold_
const double maxPtThreshold_
Definition: LowPtGsfElectronSeedProducer.cc:160
Track.h
TrackFwd.h
DEFINE_FWK_MODULE
#define DEFINE_FWK_MODULE(type)
Definition: MakerMacros.h:16
BeamSpot.h
edm::ConfigurationDescriptions::add
void add(std::string const &label, ParameterSetDescription const &psetDescription)
Definition: ConfigurationDescriptions.cc:57
LowPtGsfElectronSeedProducer::builderToken_
const edm::ESGetToken< TransientTrackingRecHitBuilder, TransientRecHitRecord > builderToken_
Definition: LowPtGsfElectronSeedProducer.cc:154
contentValuesCheck.values
values
Definition: contentValuesCheck.py:38
LowPtGsfElectronSeedProducer::getBaseRef
reco::TrackRef getBaseRef(edm::Handle< std::vector< reco::Track > > handle, int idx) const
Definition: LowPtGsfElectronSeedProducer.cc:277
mathSSE::sqrt
T sqrt(T t)
Definition: SSEVec.h:19
reco::BeamSpot
Definition: BeamSpot.h:21
IdealMagneticFieldRecord.h
edm::ESHandle< MagneticField >
PFCluster.h
reco::ElectronSeedCollection
std::vector< ElectronSeed > ElectronSeedCollection
collection of ElectronSeed objects
Definition: ElectronSeedFwd.h:10
TrajectoryFitter.h
reco::PFRecTrackRef
edm::Ref< PFRecTrackCollection > PFRecTrackRef
persistent reference to PFRecTrack objects
Definition: PFRecTrackFwd.h:15
HCALHighEnergyHPDFilter_cfi.energy
energy
Definition: HCALHighEnergyHPDFilter_cfi.py:5
GlobalTrajectoryParameters
Definition: GlobalTrajectoryParameters.h:15
EcalClusterLazyToolsBase::ESGetTokens
Definition: EcalClusterLazyTools.h:55
Point3DBase< float, GlobalTag >
ParameterSetDescription.h
RawParticle::z
double z() const
z of vertex
Definition: RawParticle.h:284
LowPtGsfElectronSeedProducer::fitterPtr_
std::unique_ptr< TrajectoryFitter > fitterPtr_
Definition: LowPtGsfElectronSeedProducer.cc:141
edm::ConfigurationDescriptions
Definition: ConfigurationDescriptions.h:28
reco::TrackRef
edm::Ref< TrackCollection > TrackRef
persistent reference to a Track
Definition: TrackFwd.h:20
DDAxes::rho
Trajectory::ConstRecHitContainer
TrackingRecHit::ConstRecHitContainer ConstRecHitContainer
Definition: Trajectory.h:41
bsc_activity_cfg.clusters
clusters
Definition: bsc_activity_cfg.py:36
runTauDisplay.gp
gp
Definition: runTauDisplay.py:431
EcalClusterLazyToolsT
Definition: EcalClusterLazyTools.h:137
LowPtGsfElectronSeedProducer::LowPtGsfElectronSeedProducer
LowPtGsfElectronSeedProducer(const edm::ParameterSet &, const lowptgsfeleseed::HeavyObjectCache *)
Definition: LowPtGsfElectronSeedProducer.cc:170
edm::ParameterSet
Definition: ParameterSet.h:47
math::XYZPoint
XYZPointD XYZPoint
point in space with cartesian internal representation
Definition: Point3D.h:12
RecoEcal_cff.ecalClusters
ecalClusters
Definition: RecoEcal_cff.py:26
pfTrack_cfi.pfTrack
pfTrack
Definition: pfTrack_cfi.py:3
deltaR.h
Trajectory::lastMeasurement
TrajectoryMeasurement const & lastMeasurement() const
Definition: Trajectory.h:150
trigObjTnPSource_cfi.filler
filler
Definition: trigObjTnPSource_cfi.py:21
reco::deltaR2
constexpr auto deltaR2(const T1 &t1, const T2 &t2) -> decltype(t1.eta())
Definition: deltaR.h:16
LowPtGsfElectronSeedProducer::field_
edm::ESHandle< MagneticField > field_
Definition: LowPtGsfElectronSeedProducer.cc:140
math::XYZVector
XYZVectorD XYZVector
spatial vector with cartesian internal representation
Definition: Vector3D.h:31
reco::PFCluster::getDepthCorrection
static double getDepthCorrection(double energy, bool isBelowPS=false, bool isHadron=false)
Definition: PFCluster.cc:39
LorentzVector.h
LowPtGsfElectronSeedProducer::ecalClusters_
const edm::EDGetTokenT< reco::PFClusterCollection > ecalClusters_
Definition: LowPtGsfElectronSeedProducer.cc:145
LowPtGsfElectronSeedProducer::smootherPtr_
std::unique_ptr< TrajectorySmoother > smootherPtr_
Definition: LowPtGsfElectronSeedProducer.cc:142
PFClusterFwd.h
LowPtGsfElectronSeedProducer::hcalClusters_
edm::EDGetTokenT< reco::PFClusterCollection > hcalClusters_
Definition: LowPtGsfElectronSeedProducer.cc:146
edm::stream::EDProducer
Definition: EDProducer.h:36
TkClonerImpl.h
MagneticField.h
edm::EventSetup
Definition: EventSetup.h:58
TrajectorySmoother.h
PreIdFwd.h
LowPtGsfElectronSeedProducer::decision
bool decision(const reco::PFRecTrackRef &pfTrackRef, reco::PreId &ecal, reco::PreId &hcal, double rho, const reco::BeamSpot &spot, noZS::EcalClusterLazyTools &ecalTools)
Definition: LowPtGsfElectronSeedProducer.cc:598
LowPtGsfElectronSeedProducer::propagateTrackToCalo
void propagateTrackToCalo(const reco::PFRecTrackRef &pfTrackRef, const edm::Handle< reco::PFClusterCollection > &ecalClusters, const edm::Handle< reco::PFClusterCollection > &hcalClusters, std::vector< int > &matchedEcalClusters, std::vector< int > &matchedHcalClusters, reco::PreId &ecalPreId, reco::PreId &hcalPreId)
Definition: LowPtGsfElectronSeedProducer.cc:406
get
#define get
PFRecTrack.h
LowPtGsfElectronSeedProducer::trajectorySmootherToken_
const edm::ESGetToken< TrajectorySmoother, TrajectoryFitter::Record > trajectorySmootherToken_
Definition: LowPtGsfElectronSeedProducer.cc:153
reco::PreId::setTrack
void setTrack(reco::TrackRef trackref)
Definition: PreId.h:31
edm::ESGetToken
Definition: EventSetup.h:48
EcalClusterLazyToolsBase::ESGetTokens::get
ESData get(edm::EventSetup const &eventSetup) const
Definition: EcalClusterLazyTools.h:64
InputTag.h
unit
Basic3DVector unit() const
Definition: Basic3DVectorLD.h:162
LowPtGsfElectronSeedProducer::lightGsfTracking
bool lightGsfTracking(reco::PreId &, const reco::TrackRef &, const reco::ElectronSeed &)
Definition: LowPtGsfElectronSeedProducer.cc:560
ValueMap.h
LowPtGsfElectronSeedProducer::globalEndJob
static void globalEndJob(lowptgsfeleseed::HeavyObjectCache const *)
Definition: LowPtGsfElectronSeedProducer.cc:67
reco::TrackBase::qualityByName
static TrackQuality qualityByName(const std::string &name)
Definition: TrackBase.cc:126
LowPtGsfElectronSeedProducer::beamSpot_
const edm::EDGetTokenT< reco::BeamSpot > beamSpot_
Definition: LowPtGsfElectronSeedProducer.cc:150
Trajectory.h
LowPtGsfElectronSeedProducer::passThrough_
const bool passThrough_
Definition: LowPtGsfElectronSeedProducer.cc:157
TrajectoryStateOnSurface::globalMomentum
GlobalVector globalMomentum() const
Definition: TrajectoryStateOnSurface.h:66
submitPVResolutionJobs.desc
string desc
Definition: submitPVResolutionJobs.py:251
eostools.move
def move(src, dest)
Definition: eostools.py:511
edm::OrphanHandle
Definition: EDProductfwd.h:39
DetachedQuadStep_cff.seeds
seeds
Definition: DetachedQuadStep_cff.py:195
TkClonerImpl
Definition: TkClonerImpl.h:12
Trajectory::firstMeasurement
TrajectoryMeasurement const & firstMeasurement() const
Definition: Trajectory.h:166
LowPtGsfElectronSeedProducer::TrackIndxMap
std::unordered_map< reco::TrackRef::key_type, size_t > TrackIndxMap
Definition: LowPtGsfElectronSeedProducer.cc:60
Trajectory
Definition: Trajectory.h:38
LowPtGsfElectronSeedProducer::trajectoryFitterToken_
const edm::ESGetToken< TrajectoryFitter, TrajectoryFitter::Record > trajectoryFitterToken_
Definition: LowPtGsfElectronSeedProducer.cc:152
LowPtGsfElectronSeedProducer::ecalClusterToolsESGetTokens_
const noZS::EcalClusterLazyTools::ESGetTokens ecalClusterToolsESGetTokens_
Definition: LowPtGsfElectronSeedProducer.cc:155
RawParticle.h
lowptgsfeleseed::HeavyObjectCache
Definition: LowPtGsfElectronSeedHeavyObjectCache.h:16
reco::PFTrajectoryPoint
A PFTrack holds several trajectory points, which basically contain the position and momentum of a tra...
Definition: PFTrajectoryPoint.h:26
Exception
Definition: hltDiff.cc:245
GlobalVector.h
Skims_PA_cff.name
name
Definition: Skims_PA_cff.py:17
edm::ParameterSet::getParameter
T getParameter(std::string const &) const
Definition: ParameterSet.h:303
PFRecTrackFwd.h
funct::pow
Power< A, B >::type pow(const A &a, const B &b)
Definition: Power.h:29
mps_fire.result
result
Definition: mps_fire.py:311
edm::helper::Filler
Definition: ValueMap.h:22
funct::abs
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
ParameterSet.h
LowPtGsfElectronSeedProducer::fillPreIdRefValueMap
void fillPreIdRefValueMap(edm::Handle< CollType > tracksHandle, const TrackIndxMap &trksToPreIdIndx, const edm::OrphanHandle< reco::PreIdCollection > &preIdHandle, edm::ValueMap< reco::PreIdRef >::Filler &filler)
Definition: LowPtGsfElectronSeedProducer.cc:624
reco::PreId::setTrackProperties
void setTrackProperties(float newchi2, float chi2ratio, float dpt)
Definition: PreId.h:53
point
*vegas h *****************************************************used in the default bin number in original ***version of VEGAS is ***a higher bin number might help to derive a more precise ***grade subtle point
Definition: invegas.h:5
LowPtGsfElectronSeedProducer::loop
void loop(const edm::Handle< std::vector< T > > &handle, edm::Handle< reco::PFClusterCollection > &hcalClusters, reco::ElectronSeedCollection &seeds, reco::PreIdCollection &ecalPreIds, reco::PreIdCollection &hcalPreIds, TrackIndxMap &trksToPreIdIndx, edm::Event &, const edm::EventSetup &)
Definition: LowPtGsfElectronSeedProducer.cc:289
event
Definition: event.py:1
DeDxTools::esConsumes
ESGetTokenH3DDVariant esConsumes(std::string const &Reccord, edm::ConsumesCollector &)
Definition: DeDxTools.cc:283
LowPtGsfElectronSeedProducer::mass_
static constexpr double mass_
Definition: LowPtGsfElectronSeedProducer.cc:165
edm::Event
Definition: Event.h:73
edm::HandleBase::id
ProductID id() const
Definition: HandleBase.cc:29
GlobalPoint.h
reco::PreId::setECALMatchingProperties
void setECALMatchingProperties(PFClusterRef clusterRef, const math::XYZPoint &ecalpos, const math::XYZPoint &meanShower, float deta, float dphi, float chieta, float chiphi, float chi2, float eop)
Definition: PreId.h:33
LowPtGsfElectronSeedProducer::kfTracks_
edm::EDGetTokenT< reco::TrackCollection > kfTracks_
Definition: LowPtGsfElectronSeedProducer.cc:143
PV3DBase::perp
T perp() const
Definition: PV3DBase.h:69
SiStripBadComponentsDQMServiceTemplate_cfg.ep
ep
Definition: SiStripBadComponentsDQMServiceTemplate_cfg.py:86
LowPtGsfElectronSeedProducer::minPtThreshold_
const double minPtThreshold_
Definition: LowPtGsfElectronSeedProducer.cc:159
edm::InputTag
Definition: InputTag.h:15
reco::PreIdCollection
std::vector< reco::PreId > PreIdCollection
Definition: PreIdFwd.h:6
Trajectory::isValid
bool isValid() const
Definition: Trajectory.h:257
ElectronSeed.h
LowPtGsfElectronSeedProducer::ebRecHits_
const edm::EDGetTokenT< EcalRecHitCollection > ebRecHits_
Definition: LowPtGsfElectronSeedProducer.cc:147
PFTrajectoryPoint.h