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 
57 #include "TMath.h"
58 
60  : public edm::stream::EDProducer<edm::GlobalCache<lowptgsfeleseed::HeavyObjectCache> > {
61 public:
62  using TrackIndxMap = std::unordered_map<reco::TrackRef::key_type, size_t>;
64 
65  static std::unique_ptr<lowptgsfeleseed::HeavyObjectCache> initializeGlobalCache(const edm::ParameterSet& conf) {
66  return std::make_unique<lowptgsfeleseed::HeavyObjectCache>(lowptgsfeleseed::HeavyObjectCache(conf));
67  }
68 
70 
71  void beginLuminosityBlock(edm::LuminosityBlock const&, edm::EventSetup const&) override;
72 
73  void produce(edm::Event&, const edm::EventSetup&) override;
74 
76 
77 private: // member functions
78  template <typename T>
79  void loop(const edm::Handle<std::vector<T> >& handle,
82  reco::PreIdCollection& ecalPreIds,
83  reco::PreIdCollection& hcalPreIds,
84  TrackIndxMap& trksToPreIdIndx,
85  edm::Event&,
86  const edm::EventSetup&);
87 
88  // Overloaded methods to retrieve reco::TrackRef
89 
90  reco::TrackRef getBaseRef(edm::Handle<std::vector<reco::Track> > handle, int idx) const;
91  reco::TrackRef getBaseRef(edm::Handle<std::vector<reco::PFRecTrack> > handle, int idx) const;
92 
93  // Overloaded methods to populate PreIds (using PF or KF tracks)
94 
95  void propagateTrackToCalo(const reco::PFRecTrackRef& pfTrackRef,
98  std::vector<int>& matchedEcalClusters,
99  std::vector<int>& matchedHcalClusters,
100  reco::PreId& ecalPreId,
101  reco::PreId& hcalPreId);
102 
103  void propagateTrackToCalo(const reco::PFRecTrackRef& pfTrackRef,
105  std::vector<int>& matchedClusters,
106  reco::PreId& preId,
107  bool ecal);
108 
112  std::vector<int>& matchedEcalClusters,
113  std::vector<int>& matchedHcalClusters,
114  reco::PreId& ecalPreId,
115  reco::PreId& hcalPreId);
116  template <typename CollType>
118  const TrackIndxMap& trksToPreIdIndx,
119  const edm::OrphanHandle<reco::PreIdCollection>& preIdHandle,
121 
122  // Overloaded methods to evaluate BDTs (using PF or KF tracks)
123 
124  bool decision(const reco::PFRecTrackRef& pfTrackRef,
125  reco::PreId& ecal,
126  reco::PreId& hcal,
127  double rho,
128  const reco::BeamSpot& spot,
129  noZS::EcalClusterLazyTools& ecalTools);
130 
131  bool decision(const reco::TrackRef& kfTrackRef,
132  reco::PreId& ecal,
133  reco::PreId& hcal,
134  double rho,
135  const reco::BeamSpot& spot,
136  noZS::EcalClusterLazyTools& ecalTools);
137 
138  // Perform lightweight GSF tracking
140 
141 private: // member data
143  std::unique_ptr<TrajectoryFitter> fitterPtr_;
144  std::unique_ptr<TrajectorySmoother> smootherPtr_;
156  const bool passThrough_;
157  const bool usePfTracks_;
158  const double minPtThreshold_;
159  const double maxPtThreshold_;
160 
161  // pow( sinh(1.65), 2. )
162  static constexpr double boundary_ = 2.50746495928 * 2.50746495928;
163  // pow( ele_mass, 2. )
164  static constexpr double mass_ = 0.000511 * 0.000511;
165 };
166 
168 //
171  : field_(),
172  fitterPtr_(),
173  smootherPtr_(),
174  kfTracks_(),
175  pfTracks_(),
176  ecalClusters_{consumes<reco::PFClusterCollection>(conf.getParameter<edm::InputTag>("ecalClusters"))},
177  hcalClusters_(),
178  ebRecHits_{consumes<EcalRecHitCollection>(conf.getParameter<edm::InputTag>("EBRecHits"))},
179  eeRecHits_{consumes<EcalRecHitCollection>(conf.getParameter<edm::InputTag>("EERecHits"))},
180  rho_(consumes<double>(conf.getParameter<edm::InputTag>("rho"))),
181  beamSpot_(consumes<reco::BeamSpot>(conf.getParameter<edm::InputTag>("BeamSpot"))),
182  fitter_(conf.getParameter<std::string>("Fitter")),
183  smoother_(conf.getParameter<std::string>("Smoother")),
184  builder_(conf.getParameter<std::string>("TTRHBuilder")),
185  passThrough_(conf.getParameter<bool>("PassThrough")),
186  usePfTracks_(conf.getParameter<bool>("UsePfTracks")),
187  minPtThreshold_(conf.getParameter<double>("MinPtThreshold")),
188  maxPtThreshold_(conf.getParameter<double>("MaxPtThreshold")) {
189  if (usePfTracks_) {
190  pfTracks_ = consumes<reco::PFRecTrackCollection>(conf.getParameter<edm::InputTag>("pfTracks"));
191  hcalClusters_ = consumes<reco::PFClusterCollection>(conf.getParameter<edm::InputTag>("hcalClusters"));
192  }
193  kfTracks_ = consumes<reco::TrackCollection>(conf.getParameter<edm::InputTag>("tracks"));
194 
195  produces<reco::ElectronSeedCollection>();
196  produces<reco::PreIdCollection>();
197  produces<reco::PreIdCollection>("HCAL");
198  produces<edm::ValueMap<reco::PreIdRef> >(); // indexed by edm::Ref<ElectronSeed>.index()
199 }
200 
202 //
205 }
206 
208 //
210  // Products
211  auto seeds = std::make_unique<reco::ElectronSeedCollection>();
212  auto ecalPreIds = std::make_unique<reco::PreIdCollection>();
213  auto hcalPreIds = std::make_unique<reco::PreIdCollection>();
214 
215  const edm::RefProd<reco::PreIdCollection> preIdsRefProd = event.getRefBeforePut<reco::PreIdCollection>();
216 
217  // HCAL clusters (only used with PF tracks)
219 
220  //we always need kftracks as we link the preids to them
222  event.getByToken(kfTracks_, kfTracks);
223 
224  TrackIndxMap trksToPreIdIndx;
225  if (usePfTracks_) {
227  event.getByToken(pfTracks_, pfTracks);
228  event.getByToken(hcalClusters_, hcalClusters);
229 
230  //check consistency between kfTracks and pfTracks collection
231  for (auto& trk : *pfTracks) {
232  if (trk.trackRef().isNonnull()) {
233  if (trk.trackRef().id() != kfTracks.id()) {
234  throw cms::Exception("ConfigError")
235  << "kfTracks is not the collection that pfTracks was built from, please fix this";
236  }
237  break; //we only need one valid track ref to check this so end the loop
238  }
239  }
240 
241  loop(pfTracks, // PF tracks
242  hcalClusters,
243  *seeds,
244  *ecalPreIds,
245  *hcalPreIds,
246  trksToPreIdIndx,
247  event,
248  setup);
249 
250  } else {
251  loop(kfTracks, // KF tracks
252  hcalClusters,
253  *seeds,
254  *ecalPreIds,
255  *hcalPreIds,
256  trksToPreIdIndx,
257  event,
258  setup);
259  }
260 
261  auto ecalPreIdsHandle = event.put(std::move(ecalPreIds));
262  event.put(std::move(hcalPreIds), "HCAL");
263  event.put(std::move(seeds));
264 
265  auto preIdVMOut = std::make_unique<edm::ValueMap<reco::PreIdRef> >();
266  edm::ValueMap<reco::PreIdRef>::Filler mapFiller(*preIdVMOut);
267  fillPreIdRefValueMap(kfTracks, trksToPreIdIndx, ecalPreIdsHandle, mapFiller);
268  mapFiller.fill();
269  event.put(std::move(preIdVMOut));
270 }
271 
273 // Return reco::Track from edm::Ref<T>
274 
276  return reco::TrackRef(handle, idx);
277 }
278 
280  int idx) const {
281  return reco::PFRecTrackRef(handle, idx)->trackRef();
282 }
283 
285 // Template function, instantiated for both reco::Tracks and reco::PFRecTracks
286 template <typename T>
287 void LowPtGsfElectronSeedProducer::loop(const edm::Handle<std::vector<T> >& handle, // PF or KF tracks
290  reco::PreIdCollection& ecalPreIds,
291  reco::PreIdCollection& hcalPreIds,
292  TrackIndxMap& trksToPreIdIndx,
293  edm::Event& event,
294  const edm::EventSetup& setup) {
295  // Pileup
297  event.getByToken(rho_, rho);
298 
299  // Beam spot
301  event.getByToken(beamSpot_, spot);
302 
303  // Track fitter
305  setup.get<TrajectoryFitter::Record>().get(fitter_, fitter);
306  fitterPtr_ = fitter->clone();
307 
308  // Track smoother
310  setup.get<TrajectoryFitter::Record>().get(smoother_, smoother);
311  smootherPtr_.reset(smoother->clone());
312 
313  // RecHit cloner
315  setup.get<TransientRecHitRecord>().get(builder_, builder);
316  TkClonerImpl hitCloner = static_cast<TkTransientTrackingRecHitBuilder const*>(builder.product())->cloner();
317  fitterPtr_->setHitCloner(&hitCloner);
318  smootherPtr_->setHitCloner(&hitCloner);
319 
320  // ECAL clusters
322  event.getByToken(ecalClusters_, ecalClusters);
323 
324  // Utility to access to shower shape vars
326 
327  // Ensure each cluster is only matched once to a track
328  std::vector<int> matchedEcalClusters;
329  std::vector<int> matchedHcalClusters;
330 
331  // Reserve
332  seeds.reserve(handle->size());
333  ecalPreIds.reserve(handle->size());
334  hcalPreIds.reserve(handle->size());
335 
336  // Iterate through (PF or KF) tracks
337  for (unsigned int itrk = 0; itrk < handle.product()->size(); itrk++) {
338  edm::Ref<std::vector<T> > templatedRef(handle, itrk); // TrackRef or PFRecTrackRef
339  reco::TrackRef trackRef = getBaseRef(handle, itrk);
340 
341  if (!(trackRef->quality(reco::TrackBase::qualityByName("highPurity")))) {
342  continue;
343  }
344  if (!passThrough_ && (trackRef->pt() < minPtThreshold_)) {
345  continue;
346  }
347 
348  // Create ElectronSeed
349  reco::ElectronSeed seed(*(trackRef->seedRef()));
350  seed.setCtfTrack(trackRef);
351 
352  // Create PreIds
353  unsigned int nModels = globalCache()->modelNames().size();
354  reco::PreId ecalPreId(nModels);
355  reco::PreId hcalPreId(nModels);
356 
357  // Add track ref to PreId
358  ecalPreId.setTrack(trackRef);
359  hcalPreId.setTrack(trackRef);
360 
361  // Add Track-Calo matching variables to PreIds
363  templatedRef, ecalClusters, hcalClusters, matchedEcalClusters, matchedHcalClusters, ecalPreId, hcalPreId);
364 
365  // Add variables related to GSF tracks to PreId
366  lightGsfTracking(ecalPreId, trackRef, seed, setup);
367 
368  // Decision based on BDT
369  bool result = decision(templatedRef, ecalPreId, hcalPreId, *rho, *spot, ecalTools);
370 
371  // If fails BDT, do not store seed
372  if (!result) {
373  continue;
374  }
375 
376  // Store PreId
377  ecalPreIds.push_back(ecalPreId);
378  hcalPreIds.push_back(hcalPreId);
379  trksToPreIdIndx[trackRef.index()] = ecalPreIds.size() - 1;
380 
381  // Store ElectronSeed and corresponding edm::Ref<PreId>.index()
382  seeds.push_back(seed);
383  }
384 }
385 
387 // Template instantiation for reco::Tracks
388 template void LowPtGsfElectronSeedProducer::loop<reco::Track>(const edm::Handle<std::vector<reco::Track> >&,
391  reco::PreIdCollection& ecalPreIds,
392  reco::PreIdCollection& hcalPreIds,
393  TrackIndxMap& trksToPreIdIndx,
394  edm::Event&,
395  const edm::EventSetup&);
396 
398 // Template instantiation for reco::PFRecTracks
399 template void LowPtGsfElectronSeedProducer::loop<reco::PFRecTrack>(const edm::Handle<std::vector<reco::PFRecTrack> >&,
402  reco::PreIdCollection& ecalPreIds,
403  reco::PreIdCollection& hcalPreIds,
404  TrackIndxMap& trksToPreIdIndx,
405  edm::Event&,
406  const edm::EventSetup&);
407 
409 // Loops through both ECAL and HCAL clusters
413  std::vector<int>& matchedEcalClusters,
414  std::vector<int>& matchedHcalClusters,
415  reco::PreId& ecalPreId,
416  reco::PreId& hcalPreId) {
417  propagateTrackToCalo(pfTrackRef, ecalClusters, matchedEcalClusters, ecalPreId, true);
418  propagateTrackToCalo(pfTrackRef, hcalClusters, matchedHcalClusters, hcalPreId, false);
419 }
420 
422 // Loops through ECAL or HCAL clusters (called twice)
425  std::vector<int>& matched,
426  reco::PreId& preId,
427  bool ecal) {
428  // Store info for PreId
429  struct Info {
431  float dr2min = 1.e6;
432  float deta = 1.e6;
433  float dphi = 1.e6;
434  math::XYZPoint showerPos = math::XYZPoint(0., 0., 0.);
435  } info;
436 
437  // Find closest "seed cluster" to KF track extrapolated to ECAL (or HCAL)
439  if (ecal) {
440  point = pfTrackRef->extrapolatedPoint(reco::PFTrajectoryPoint::LayerType::ECALShowerMax);
441  } else {
442  point = pfTrackRef->extrapolatedPoint(reco::PFTrajectoryPoint::LayerType::HCALEntrance);
443  }
444 
445  if (point.isValid()) {
446  Info info;
447  for (unsigned int iclu = 0; iclu < clusters.product()->size(); iclu++) {
448  if (std::find(matched.begin(), matched.end(), iclu) == matched.end()) {
449  reco::PFClusterRef cluRef(clusters, iclu);
450 
451  // Determine dR squared
452  float dr2 = reco::deltaR2(cluRef->positionREP(), point.positionREP());
453 
454  if (dr2 < info.dr2min) {
455  info.dr2min = dr2;
456  info.cluRef = cluRef;
457  info.deta = cluRef->positionREP().eta() - point.positionREP().eta();
458  info.dphi =
459  reco::deltaPhi(cluRef->positionREP().phi(), point.positionREP().phi()) * pfTrackRef->trackRef()->charge();
460  info.showerPos = point.position();
461  }
462  }
463  }
464 
465  // Set PreId content if match found
466  if (info.dr2min < 1.e5) {
467  float ep = info.cluRef->correctedEnergy() / std::sqrt(pfTrackRef->trackRef()->innerMomentum().mag2());
468  preId.setECALMatchingProperties(info.cluRef,
469  point.position(), // ECAL or HCAL surface
470  info.showerPos, //
471  info.deta,
472  info.dphi,
473  0.f, // chieta
474  0.f, // chiphi
475  pfTrackRef->trackRef()->normalizedChi2(), // chi2
476  ep);
477  }
478 
479  } // clusters
480 }
481 
483 // Original implementation in GoodSeedProducer, loops over ECAL clusters only
485  const reco::TrackRef& kfTrackRef,
488  std::vector<int>& matchedEcalClusters,
489  std::vector<int>& matchedHcalClusters, // not used
490  reco::PreId& ecalPreId,
491  reco::PreId& hcalPreId /* not used */) {
492  // Store info for PreId
493  struct Info {
495  float dr2min = 1.e6;
496  float deta = 1.e6;
497  float dphi = 1.e6;
498  math::XYZPoint showerPos = math::XYZPoint(0., 0., 0.);
499  } info;
500 
501  // Propagate 'electron' to ECAL surface
502  float energy = sqrt(mass_ + kfTrackRef->outerMomentum().Mag2());
504  kfTrackRef->outerMomentum().x(), kfTrackRef->outerMomentum().y(), kfTrackRef->outerMomentum().z(), energy);
506  kfTrackRef->outerPosition().x(), kfTrackRef->outerPosition().y(), kfTrackRef->outerPosition().z(), 0.);
507  math::XYZVector field(field_->inTesla(GlobalPoint(0, 0, 0)));
508  BaseParticlePropagator particle(RawParticle(mom, pos, kfTrackRef->charge()), 0, 0, field.z());
509  particle.propagateToEcalEntrance(false);
510  if (particle.getSuccess() == 0) {
511  return;
512  }
513 
514  // ECAL entry point for track
515  GlobalPoint ecal_pos(
516  particle.particle().vertex().x(), particle.particle().vertex().y(), particle.particle().vertex().z());
517 
518  // Preshower limit
519  bool below_ps = pow(ecal_pos.z(), 2.) > boundary_ * ecal_pos.perp2();
520 
521  // Iterate through ECAL clusters
522  for (unsigned int iclu = 0; iclu < ecalClusters.product()->size(); iclu++) {
523  reco::PFClusterRef cluRef(ecalClusters, iclu);
524 
525  // Correct ecal_pos for shower depth
526  double shower_depth = reco::PFCluster::getDepthCorrection(cluRef->correctedEnergy(), below_ps, false);
527  GlobalPoint showerPos = ecal_pos + GlobalVector(particle.particle().momentum().x(),
528  particle.particle().momentum().y(),
529  particle.particle().momentum().z())
530  .unit() *
531  shower_depth;
532 
533  // Determine dR squared
534  float dr2 = reco::deltaR2(cluRef->positionREP(), showerPos);
535 
536  // Find nearest ECAL cluster
537  if (dr2 < info.dr2min) {
538  info.dr2min = dr2;
539  info.cluRef = cluRef;
540  info.deta = std::abs(cluRef->positionREP().eta() - showerPos.eta());
541  info.dphi = std::abs(reco::deltaPhi(cluRef->positionREP().phi(), showerPos.phi())) * kfTrackRef->charge();
542  info.showerPos = showerPos;
543  }
544  }
545 
546  // Populate PreId object
547  math::XYZPoint point(ecal_pos.x(), ecal_pos.y(), ecal_pos.z());
548 
549  // Set PreId content
550  ecalPreId.setECALMatchingProperties(
551  info.cluRef,
552  point,
553  info.showerPos,
554  info.deta,
555  info.dphi,
556  0.f, // chieta
557  0.f, // chiphi
558  kfTrackRef->normalizedChi2(), // chi2
559  info.cluRef->correctedEnergy() / std::sqrt(kfTrackRef->innerMomentum().mag2())); // E/p
560 }
561 
563 // Original implementation for "lightweight" GSF tracking
565  const reco::TrackRef& trackRef,
566  const reco::ElectronSeed& seed,
567  const edm::EventSetup& setup) {
569  for (unsigned int ihit = 0; ihit < trackRef->recHitsSize(); ++ihit) {
570  hits.push_back(trackRef->recHit(ihit)->cloneSH());
571  }
572 
573  GlobalVector gv(trackRef->innerMomentum().x(), trackRef->innerMomentum().y(), trackRef->innerMomentum().z());
574  GlobalPoint gp(trackRef->innerPosition().x(), trackRef->innerPosition().y(), trackRef->innerPosition().z());
575 
576  GlobalTrajectoryParameters gtps(gp, gv, trackRef->charge(), &*field_);
577 
578  TrajectoryStateOnSurface tsos(gtps, trackRef->innerStateCovariance(), *hits[0]->surface());
579 
580  // Track fitted and smoothed under electron hypothesis
581  Trajectory traj1 = fitterPtr_->fitOne(seed, hits, tsos);
582  if (!traj1.isValid()) {
583  return false;
584  }
585  Trajectory traj2 = smootherPtr_->trajectory(traj1);
586  if (!traj2.isValid()) {
587  return false;
588  }
589 
590  // Set PreId content
591  float chi2Ratio = trackRef->chi2() > 0. ? traj2.chiSquared() / trackRef->chi2() : -1.;
592  float gsfReducedChi2 = chi2Ratio > -1. ? chi2Ratio * trackRef->normalizedChi2() : -1.;
593  float ptOut = traj2.firstMeasurement().updatedState().globalMomentum().perp();
594  float ptIn = traj2.lastMeasurement().updatedState().globalMomentum().perp();
595  float gsfDpt = (ptIn > 0) ? fabs(ptOut - ptIn) / ptIn : 0.;
596  preId.setTrackProperties(gsfReducedChi2, chi2Ratio, gsfDpt);
597 
598  return true;
599 }
600 
602 // Decision based on OR of outputs from list of models
604  reco::PreId& ecalPreId,
605  reco::PreId& hcalPreId,
606  double rho,
607  const reco::BeamSpot& spot,
608  noZS::EcalClusterLazyTools& ecalTools) {
609  bool result = false;
610  for (auto& name : globalCache()->modelNames()) {
611  result |= globalCache()->eval(name, ecalPreId, hcalPreId, rho, spot, ecalTools);
612  }
613  return passThrough_ || (pfTrackRef->trackRef()->pt() > maxPtThreshold_) || result;
614 }
615 
617 //
619  reco::PreId& ecalPreId,
620  reco::PreId& hcalPreId,
621  double rho,
622  const reco::BeamSpot& spot,
623  noZS::EcalClusterLazyTools& ecalTools) {
624  // No implementation currently
625  return passThrough_;
626 }
627 
628 template <typename CollType>
630  const TrackIndxMap& trksToPreIdIndx,
631  const edm::OrphanHandle<reco::PreIdCollection>& preIdHandle,
633  std::vector<reco::PreIdRef> values;
634 
635  unsigned ntracks = tracksHandle->size();
636  for (unsigned itrack = 0; itrack < ntracks; ++itrack) {
637  edm::Ref<CollType> trackRef(tracksHandle, itrack);
638  auto preIdRefIt = trksToPreIdIndx.find(trackRef.index());
639  if (preIdRefIt == trksToPreIdIndx.end()) {
640  values.push_back(reco::PreIdRef());
641  } else {
642  edm::Ref<reco::PreIdCollection> preIdRef(preIdHandle, preIdRefIt->second);
643  values.push_back(preIdRef);
644  }
645  }
646  filler.insert(tracksHandle, values.begin(), values.end());
647 }
648 
650 //
653  desc.add<edm::InputTag>("tracks", edm::InputTag("generalTracks"));
654  desc.add<edm::InputTag>("pfTracks", edm::InputTag("lowPtGsfElePfTracks"));
655  desc.add<edm::InputTag>("ecalClusters", edm::InputTag("particleFlowClusterECAL"));
656  desc.add<edm::InputTag>("hcalClusters", edm::InputTag("particleFlowClusterHCAL"));
657  desc.add<edm::InputTag>("EBRecHits", edm::InputTag("ecalRecHit", "EcalRecHitsEB"));
658  desc.add<edm::InputTag>("EERecHits", edm::InputTag("ecalRecHit", "EcalRecHitsEE"));
659  desc.add<edm::InputTag>("rho", edm::InputTag("fixedGridRhoFastjetAllTmp"));
660  desc.add<edm::InputTag>("BeamSpot", edm::InputTag("offlineBeamSpot"));
661  desc.add<std::string>("Fitter", "GsfTrajectoryFitter_forPreId");
662  desc.add<std::string>("Smoother", "GsfTrajectorySmoother_forPreId");
663  desc.add<std::string>("TTRHBuilder", "WithAngleAndTemplate");
664  desc.add<std::vector<std::string> >("ModelNames", std::vector<std::string>());
665  desc.add<std::vector<std::string> >("ModelWeights", std::vector<std::string>());
666  desc.add<std::vector<double> >("ModelThresholds", std::vector<double>());
667  desc.add<bool>("PassThrough", false);
668  desc.add<bool>("UsePfTracks", true);
669  desc.add<double>("MinPtThreshold", 1.0);
670  desc.add<double>("MaxPtThreshold", 15.);
671  descriptions.add("lowPtGsfElectronSeeds", desc);
672 }
673 
675 //
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:146
lowPtGsfElectronSeeds_cfi.pfTracks
pfTracks
Definition: lowPtGsfElectronSeeds_cfi.py:10
TrajectorySmoother::clone
virtual TrajectorySmoother * clone() const =0
LowPtGsfElectronSeedProducer::rho_
const edm::EDGetTokenT< double > rho_
Definition: LowPtGsfElectronSeedProducer.cc:151
edm::ESHandle::product
T const * product() const
Definition: ESHandle.h:86
RefProd.h
LowPtGsfElectronSeedProducer::usePfTracks_
const bool usePfTracks_
Definition: LowPtGsfElectronSeedProducer.cc:157
TrajectoryStateOnSurface.h
LowPtGsfElectronSeedProducer::lightGsfTracking
bool lightGsfTracking(reco::PreId &, const reco::TrackRef &, const reco::ElectronSeed &, const edm::EventSetup &)
Definition: LowPtGsfElectronSeedProducer.cc:564
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::ParameterSetDescription::add
ParameterDescriptionBase * add(U const &iLabel, T const &value)
Definition: ParameterSetDescription.h:95
BaseParticlePropagator::propagateToEcalEntrance
bool propagateToEcalEntrance(bool first=true)
Definition: BaseParticlePropagator.cc:450
GlobalTrajectoryParameters.h
LowPtGsfElectronSeedProducer::fillDescriptions
static void fillDescriptions(edm::ConfigurationDescriptions &)
Definition: LowPtGsfElectronSeedProducer.cc:651
hfClusterShapes_cfi.hits
hits
Definition: hfClusterShapes_cfi.py:5
LowPtGsfElectronSeedProducer
Definition: LowPtGsfElectronSeedProducer.cc:59
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:150
reco::deltaPhi
constexpr double deltaPhi(double phi1, double phi2)
Definition: deltaPhi.h:26
edm::EDGetTokenT< reco::TrackCollection >
hcal
Definition: ConfigurationDatabase.cc:13
TrackBase.h
TransientRecHitRecord.h
pos
Definition: PixelAliasList.h:18
LowPtGsfElectronSeedProducer::fitter_
const std::string fitter_
Definition: LowPtGsfElectronSeedProducer.cc:153
ZElectronSkim_cff.rho
rho
Definition: ZElectronSkim_cff.py:38
edm::ParameterSetDescription
Definition: ParameterSetDescription.h:52
TransientRecHitRecord
Definition: TransientRecHitRecord.h:14
BaseParticlePropagator.h
EDProducer.h
LowPtGsfElectronSeedProducer::initializeGlobalCache
static std::unique_ptr< lowptgsfeleseed::HeavyObjectCache > initializeGlobalCache(const edm::ParameterSet &conf)
Definition: LowPtGsfElectronSeedProducer.cc:65
LowPtGsfElectronSeedProducer::produce
void produce(edm::Event &, const edm::EventSetup &) override
Definition: LowPtGsfElectronSeedProducer.cc:209
info
static const TGPicture * info(bool iBackgroundIsBlack)
Definition: FWCollectionSummaryWidget.cc:152
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:203
XYZTLorentzVector
math::XYZTLorentzVector XYZTLorentzVector
Definition: RawParticle.h:25
LowPtGsfElectronSeedProducer::boundary_
static constexpr double boundary_
Definition: LowPtGsfElectronSeedProducer.cc:162
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
edm::Ref::index
key_type index() const
Definition: Ref.h:253
edm::Handle
Definition: AssociativeIterator.h:50
training_settings.idx
idx
Definition: training_settings.py:16
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
reco::PFClusterRef
edm::Ref< PFClusterCollection > PFClusterRef
persistent reference to PFCluster objects
Definition: PFClusterFwd.h:15
deltaR.h
IdealMagneticFieldRecord
Definition: IdealMagneticFieldRecord.h:11
TrajectoryFitter::clone
virtual std::unique_ptr< TrajectoryFitter > clone() const =0
TrajectoryStateOnSurface
Definition: TrajectoryStateOnSurface.h:16
MakerMacros.h
reco::ElectronSeed
Definition: ElectronSeed.h:51
LowPtGsfElectronSeedProducer::maxPtThreshold_
const double maxPtThreshold_
Definition: LowPtGsfElectronSeedProducer.cc:159
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
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:275
mathSSE::sqrt
T sqrt(T t)
Definition: SSEVec.h:19
reco::BeamSpot
Definition: BeamSpot.h:21
IdealMagneticFieldRecord.h
edm::ESHandle< MagneticField >
PFCluster.h
TrajectoryFitterRecord
Definition: TrajectoryFitterRecord.h:12
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
Point3DBase< float, GlobalTag >
ParameterSetDescription.h
RawParticle::z
double z() const
z of vertex
Definition: RawParticle.h:284
LowPtGsfElectronSeedProducer::smoother_
const std::string smoother_
Definition: LowPtGsfElectronSeedProducer.cc:154
LowPtGsfElectronSeedProducer::fitterPtr_
std::unique_ptr< TrajectoryFitter > fitterPtr_
Definition: LowPtGsfElectronSeedProducer.cc:143
edm::ConfigurationDescriptions
Definition: ConfigurationDescriptions.h:28
reco::TrackRef
edm::Ref< TrackCollection > TrackRef
persistent reference to a Track
Definition: TrackFwd.h:20
DDAxes::rho
AlCaHLTBitMon_QueryRunRegistry.string
string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
Trajectory::ConstRecHitContainer
TrackingRecHit::ConstRecHitContainer ConstRecHitContainer
Definition: Trajectory.h:41
bsc_activity_cfg.clusters
clusters
Definition: bsc_activity_cfg.py:36
InitialStep_cff.seeds
seeds
Definition: InitialStep_cff.py:232
runTauDisplay.gp
gp
Definition: runTauDisplay.py:431
EcalClusterLazyToolsT
Definition: EcalClusterLazyTools.h:105
LowPtGsfElectronSeedProducer::LowPtGsfElectronSeedProducer
LowPtGsfElectronSeedProducer(const edm::ParameterSet &, const lowptgsfeleseed::HeavyObjectCache *)
Definition: LowPtGsfElectronSeedProducer.cc:169
HLT_2018_cff.InputTag
InputTag
Definition: HLT_2018_cff.py:79016
edm::ParameterSet
Definition: ParameterSet.h:36
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
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:142
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:83
LorentzVector.h
LowPtGsfElectronSeedProducer::ecalClusters_
const edm::EDGetTokenT< reco::PFClusterCollection > ecalClusters_
Definition: LowPtGsfElectronSeedProducer.cc:147
LowPtGsfElectronSeedProducer::smootherPtr_
std::unique_ptr< TrajectorySmoother > smootherPtr_
Definition: LowPtGsfElectronSeedProducer.cc:144
PFClusterFwd.h
LowPtGsfElectronSeedProducer::hcalClusters_
edm::EDGetTokenT< reco::PFClusterCollection > hcalClusters_
Definition: LowPtGsfElectronSeedProducer.cc:148
edm::stream::EDProducer
Definition: EDProducer.h:38
TkClonerImpl.h
MagneticField.h
edm::EventSetup
Definition: EventSetup.h:57
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:603
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:410
get
#define get
PFRecTrack.h
reco::PreId::setTrack
void setTrack(reco::TrackRef trackref)
Definition: PreId.h:31
InputTag.h
unit
Basic3DVector unit() const
Definition: Basic3DVectorLD.h:162
ValueMap.h
LowPtGsfElectronSeedProducer::globalEndJob
static void globalEndJob(lowptgsfeleseed::HeavyObjectCache const *)
Definition: LowPtGsfElectronSeedProducer.cc:69
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:152
edm::ParameterSet::getParameter
T getParameter(std::string const &) const
Trajectory.h
LowPtGsfElectronSeedProducer::passThrough_
const bool passThrough_
Definition: LowPtGsfElectronSeedProducer.cc:156
TrajectoryStateOnSurface::globalMomentum
GlobalVector globalMomentum() const
Definition: TrajectoryStateOnSurface.h:66
eostools.move
def move(src, dest)
Definition: eostools.py:511
edm::OrphanHandle
Definition: EDProductfwd.h:39
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:62
Trajectory
Definition: Trajectory.h:38
RawParticle.h
lowptgsfeleseed::HeavyObjectCache
Definition: LowPtGsfElectronSeedHeavyObjectCache.h:52
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:246
GlobalVector.h
Skims_PA_cff.name
name
Definition: Skims_PA_cff.py:17
bsc_activity_cfg.ecal
ecal
Definition: bsc_activity_cfg.py:25
PFRecTrackFwd.h
funct::pow
Power< A, B >::type pow(const A &a, const B &b)
Definition: Power.h:30
LowPtGsfElectronSeedProducer::builder_
const std::string builder_
Definition: LowPtGsfElectronSeedProducer.cc:155
mps_fire.result
result
Definition: mps_fire.py:303
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:629
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:287
event
Definition: event.py:1
LowPtGsfElectronSeedProducer::mass_
static constexpr double mass_
Definition: LowPtGsfElectronSeedProducer.cc:164
edm::Event
Definition: Event.h:73
edm::HandleBase::id
ProductID id() const
Definition: HandleBase.cc:13
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:145
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:158
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
deltaPhi.h
SurveyInfoScenario_cff.seed
seed
Definition: SurveyInfoScenario_cff.py:295
ElectronSeed.h
LowPtGsfElectronSeedProducer::ebRecHits_
const edm::EDGetTokenT< EcalRecHitCollection > ebRecHits_
Definition: LowPtGsfElectronSeedProducer.cc:149
PFTrajectoryPoint.h