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 produce(edm::Event&, const edm::EventSetup&) override;
70 
72 
73 private: // member functions
74  template <typename T>
75  void loop(const edm::Handle<std::vector<T> >& handle,
78  reco::PreIdCollection& ecalPreIds,
79  reco::PreIdCollection& hcalPreIds,
80  TrackIndxMap& trksToPreIdIndx,
81  edm::Event&,
82  const edm::EventSetup&);
83 
84  // Overloaded methods to retrieve reco::TrackRef
85 
86  reco::TrackRef getBaseRef(edm::Handle<std::vector<reco::Track> > handle, int idx) const;
87  reco::TrackRef getBaseRef(edm::Handle<std::vector<reco::PFRecTrack> > handle, int idx) const;
88 
89  // Overloaded methods to populate PreIds (using PF or KF tracks)
90 
91  void propagateTrackToCalo(const reco::PFRecTrackRef& pfTrackRef,
94  std::vector<int>& matchedEcalClusters,
95  std::vector<int>& matchedHcalClusters,
96  reco::PreId& ecalPreId,
97  reco::PreId& hcalPreId);
98 
99  void propagateTrackToCalo(const reco::PFRecTrackRef& pfTrackRef,
101  std::vector<int>& matchedClusters,
102  reco::PreId& preId,
103  bool ecal);
104 
108  std::vector<int>& matchedEcalClusters,
109  std::vector<int>& matchedHcalClusters,
110  reco::PreId& ecalPreId,
111  reco::PreId& hcalPreId);
112  template <typename CollType>
114  const TrackIndxMap& trksToPreIdIndx,
115  const edm::OrphanHandle<reco::PreIdCollection>& preIdHandle,
117 
118  // Overloaded methods to evaluate BDTs (using PF or KF tracks)
119 
120  bool decision(const reco::PFRecTrackRef& pfTrackRef,
121  reco::PreId& ecal,
122  reco::PreId& hcal,
123  double rho,
124  const reco::BeamSpot& spot,
125  noZS::EcalClusterLazyTools& ecalTools);
126 
127  bool decision(const reco::TrackRef& kfTrackRef,
128  reco::PreId& ecal,
129  reco::PreId& hcal,
130  double rho,
131  const reco::BeamSpot& spot,
132  noZS::EcalClusterLazyTools& ecalTools);
133 
134  // Perform lightweight GSF tracking
136 
137 private: // member data
139  std::unique_ptr<TrajectoryFitter> fitterPtr_;
140  std::unique_ptr<TrajectorySmoother> smootherPtr_;
149 
155 
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(conf.getParameter<edm::InputTag>("ecalClusters"))},
177  hcalClusters_(),
178  ebRecHits_{consumes(conf.getParameter<edm::InputTag>("EBRecHits"))},
179  eeRecHits_{consumes(conf.getParameter<edm::InputTag>("EERecHits"))},
180  rho_(consumes(conf.getParameter<edm::InputTag>("rho"))),
181  beamSpot_(consumes(conf.getParameter<edm::InputTag>("BeamSpot"))),
182  trajectoryFitterToken_{esConsumes(conf.getParameter<edm::ESInputTag>("Fitter"))},
183  trajectorySmootherToken_{esConsumes(conf.getParameter<edm::ESInputTag>("Smoother"))},
184  builderToken_{esConsumes(conf.getParameter<edm::ESInputTag>("TTRHBuilder"))},
185  magToken_{esConsumes()},
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 //
206  field_ = setup.getHandle(magToken_);
207  // Products
208  auto seeds = std::make_unique<reco::ElectronSeedCollection>();
209  auto ecalPreIds = std::make_unique<reco::PreIdCollection>();
210  auto hcalPreIds = std::make_unique<reco::PreIdCollection>();
211 
212  const edm::RefProd<reco::PreIdCollection> preIdsRefProd = event.getRefBeforePut<reco::PreIdCollection>();
213 
214  // HCAL clusters (only used with PF tracks)
216 
217  //we always need kftracks as we link the preids to them
219  event.getByToken(kfTracks_, kfTracks);
220 
221  TrackIndxMap trksToPreIdIndx;
222  if (usePfTracks_) {
224  event.getByToken(pfTracks_, pfTracks);
225  event.getByToken(hcalClusters_, hcalClusters);
226 
227  //check consistency between kfTracks and pfTracks collection
228  for (auto& trk : *pfTracks) {
229  if (trk.trackRef().isNonnull()) {
230  if (trk.trackRef().id() != kfTracks.id()) {
231  throw cms::Exception("ConfigError")
232  << "kfTracks is not the collection that pfTracks was built from, please fix this";
233  }
234  break; //we only need one valid track ref to check this so end the loop
235  }
236  }
237 
238  loop(pfTracks, // PF tracks
239  hcalClusters,
240  *seeds,
241  *ecalPreIds,
242  *hcalPreIds,
243  trksToPreIdIndx,
244  event,
245  setup);
246 
247  } else {
248  loop(kfTracks, // KF tracks
249  hcalClusters,
250  *seeds,
251  *ecalPreIds,
252  *hcalPreIds,
253  trksToPreIdIndx,
254  event,
255  setup);
256  }
257 
258  auto ecalPreIdsHandle = event.put(std::move(ecalPreIds));
259  event.put(std::move(hcalPreIds), "HCAL");
260  event.put(std::move(seeds));
261 
262  auto preIdVMOut = std::make_unique<edm::ValueMap<reco::PreIdRef> >();
263  edm::ValueMap<reco::PreIdRef>::Filler mapFiller(*preIdVMOut);
264  fillPreIdRefValueMap(kfTracks, trksToPreIdIndx, ecalPreIdsHandle, mapFiller);
265  mapFiller.fill();
266  event.put(std::move(preIdVMOut));
267 }
268 
270 // Return reco::Track from edm::Ref<T>
271 
273  return reco::TrackRef(handle, idx);
274 }
275 
277  int idx) const {
278  return reco::PFRecTrackRef(handle, idx)->trackRef();
279 }
280 
282 // Template function, instantiated for both reco::Tracks and reco::PFRecTracks
283 template <typename T>
284 void LowPtGsfElectronSeedProducer::loop(const edm::Handle<std::vector<T> >& handle, // PF or KF tracks
287  reco::PreIdCollection& ecalPreIds,
288  reco::PreIdCollection& hcalPreIds,
289  TrackIndxMap& trksToPreIdIndx,
290  edm::Event& event,
291  const edm::EventSetup& setup) {
292  // Pileup
293  auto const& rho = event.get(rho_);
294 
295  // Beam spot
296  auto const& spot = event.get(beamSpot_);
297 
298  // Track fitter
299  fitterPtr_ = setup.getData(trajectoryFitterToken_).clone();
300 
301  // Track smoother
302  smootherPtr_.reset(setup.getData(trajectorySmootherToken_).clone());
303 
304  // RecHit cloner
305  TkClonerImpl hitCloner = static_cast<TkTransientTrackingRecHitBuilder const&>(setup.getData(builderToken_)).cloner();
306  fitterPtr_->setHitCloner(&hitCloner);
307  smootherPtr_->setHitCloner(&hitCloner);
308 
309  // ECAL clusters
310  auto ecalClusters = event.getHandle(ecalClusters_);
311 
312  // Utility to access to shower shape vars
314 
315  // Ensure each cluster is only matched once to a track
316  std::vector<int> matchedEcalClusters;
317  std::vector<int> matchedHcalClusters;
318 
319  // Reserve
320  seeds.reserve(handle->size());
321  ecalPreIds.reserve(handle->size());
322  hcalPreIds.reserve(handle->size());
323 
324  // Iterate through (PF or KF) tracks
325  for (unsigned int itrk = 0; itrk < handle.product()->size(); itrk++) {
326  edm::Ref<std::vector<T> > templatedRef(handle, itrk); // TrackRef or PFRecTrackRef
327  reco::TrackRef trackRef = getBaseRef(handle, itrk);
328 
329  if (!(trackRef->quality(reco::TrackBase::qualityByName("highPurity")))) {
330  continue;
331  }
332  if (!passThrough_ && (trackRef->pt() < minPtThreshold_)) {
333  continue;
334  }
335 
336  // Create ElectronSeed
337  reco::ElectronSeed seed(*(trackRef->seedRef()));
338  if (seed.nHits() == 0) { //if DeepCore is used in jetCore iteration the seed are hitless, in case skip
339  continue;
340  }
341  seed.setCtfTrack(trackRef);
342 
343  // Create PreIds
344  unsigned int nModels = globalCache()->modelNames().size();
345  reco::PreId ecalPreId(nModels);
346  reco::PreId hcalPreId(nModels);
347 
348  // Add track ref to PreId
349  ecalPreId.setTrack(trackRef);
350  hcalPreId.setTrack(trackRef);
351 
352  // Add Track-Calo matching variables to PreIds
354  templatedRef, ecalClusters, hcalClusters, matchedEcalClusters, matchedHcalClusters, ecalPreId, hcalPreId);
355 
356  // Add variables related to GSF tracks to PreId
357  lightGsfTracking(ecalPreId, trackRef, seed);
358 
359  // Decision based on BDT
360  bool result = decision(templatedRef, ecalPreId, hcalPreId, rho, spot, ecalTools);
361 
362  // If fails BDT, do not store seed
363  if (!result) {
364  continue;
365  }
366 
367  // Store PreId
368  ecalPreIds.push_back(ecalPreId);
369  hcalPreIds.push_back(hcalPreId);
370  trksToPreIdIndx[trackRef.index()] = ecalPreIds.size() - 1;
371 
372  // Store ElectronSeed and corresponding edm::Ref<PreId>.index()
373  seeds.push_back(seed);
374  }
375 }
376 
378 // Template instantiation for reco::Tracks
379 template void LowPtGsfElectronSeedProducer::loop<reco::Track>(const edm::Handle<std::vector<reco::Track> >&,
382  reco::PreIdCollection& ecalPreIds,
383  reco::PreIdCollection& hcalPreIds,
384  TrackIndxMap& trksToPreIdIndx,
385  edm::Event&,
386  const edm::EventSetup&);
387 
389 // Template instantiation for reco::PFRecTracks
390 template void LowPtGsfElectronSeedProducer::loop<reco::PFRecTrack>(const edm::Handle<std::vector<reco::PFRecTrack> >&,
393  reco::PreIdCollection& ecalPreIds,
394  reco::PreIdCollection& hcalPreIds,
395  TrackIndxMap& trksToPreIdIndx,
396  edm::Event&,
397  const edm::EventSetup&);
398 
400 // Loops through both ECAL and HCAL clusters
404  std::vector<int>& matchedEcalClusters,
405  std::vector<int>& matchedHcalClusters,
406  reco::PreId& ecalPreId,
407  reco::PreId& hcalPreId) {
408  propagateTrackToCalo(pfTrackRef, ecalClusters, matchedEcalClusters, ecalPreId, true);
409  propagateTrackToCalo(pfTrackRef, hcalClusters, matchedHcalClusters, hcalPreId, false);
410 }
411 
413 // Loops through ECAL or HCAL clusters (called twice)
416  std::vector<int>& matched,
417  reco::PreId& preId,
418  bool ecal) {
419  // Store info for PreId
420  struct Info {
422  float dr2min = 1.e6;
423  float deta = 1.e6;
424  float dphi = 1.e6;
425  math::XYZPoint showerPos = math::XYZPoint(0., 0., 0.);
426  } info;
427 
428  // Find closest "seed cluster" to KF track extrapolated to ECAL (or HCAL)
430  if (ecal) {
431  point = pfTrackRef->extrapolatedPoint(reco::PFTrajectoryPoint::LayerType::ECALShowerMax);
432  } else {
433  point = pfTrackRef->extrapolatedPoint(reco::PFTrajectoryPoint::LayerType::HCALEntrance);
434  }
435 
436  if (point.isValid()) {
437  Info info;
438  for (unsigned int iclu = 0; iclu < clusters.product()->size(); iclu++) {
439  if (std::find(matched.begin(), matched.end(), iclu) == matched.end()) {
440  reco::PFClusterRef cluRef(clusters, iclu);
441 
442  // Determine dR squared
443  float dr2 = reco::deltaR2(cluRef->positionREP(), point.positionREP());
444 
445  if (dr2 < info.dr2min) {
446  info.dr2min = dr2;
447  info.cluRef = cluRef;
448  info.deta = cluRef->positionREP().eta() - point.positionREP().eta();
449  info.dphi =
450  reco::deltaPhi(cluRef->positionREP().phi(), point.positionREP().phi()) * pfTrackRef->trackRef()->charge();
451  info.showerPos = point.position();
452  }
453  }
454  }
455 
456  // Set PreId content if match found
457  if (info.dr2min < 1.e5) {
458  float ep = info.cluRef->correctedEnergy() / std::sqrt(pfTrackRef->trackRef()->innerMomentum().mag2());
459  preId.setECALMatchingProperties(info.cluRef,
460  point.position(), // ECAL or HCAL surface
461  info.showerPos, //
462  info.deta,
463  info.dphi,
464  0.f, // chieta
465  0.f, // chiphi
466  pfTrackRef->trackRef()->normalizedChi2(), // chi2
467  ep);
468  }
469 
470  } // clusters
471 }
472 
474 // Original implementation in GoodSeedProducer, loops over ECAL clusters only
476  const reco::TrackRef& kfTrackRef,
479  std::vector<int>& matchedEcalClusters,
480  std::vector<int>& matchedHcalClusters, // not used
481  reco::PreId& ecalPreId,
482  reco::PreId& hcalPreId /* not used */) {
483  // Store info for PreId
484  struct Info {
486  float dr2min = 1.e6;
487  float deta = 1.e6;
488  float dphi = 1.e6;
489  math::XYZPoint showerPos = math::XYZPoint(0., 0., 0.);
490  } info;
491 
492  // Propagate 'electron' to ECAL surface
493  float energy = sqrt(mass_ + kfTrackRef->outerMomentum().Mag2());
495  kfTrackRef->outerMomentum().x(), kfTrackRef->outerMomentum().y(), kfTrackRef->outerMomentum().z(), energy);
497  kfTrackRef->outerPosition().x(), kfTrackRef->outerPosition().y(), kfTrackRef->outerPosition().z(), 0.);
498  math::XYZVector field(field_->inTesla(GlobalPoint(0, 0, 0)));
499  BaseParticlePropagator particle(RawParticle(mom, pos, kfTrackRef->charge()), 0, 0, field.z());
500  particle.propagateToEcalEntrance(false);
501  if (particle.getSuccess() == 0) {
502  return;
503  }
504 
505  // ECAL entry point for track
506  GlobalPoint ecal_pos(
507  particle.particle().vertex().x(), particle.particle().vertex().y(), particle.particle().vertex().z());
508 
509  // Preshower limit
510  bool below_ps = pow(ecal_pos.z(), 2.) > boundary_ * ecal_pos.perp2();
511 
512  // Iterate through ECAL clusters
513  for (unsigned int iclu = 0; iclu < ecalClusters.product()->size(); iclu++) {
514  reco::PFClusterRef cluRef(ecalClusters, iclu);
515 
516  // Correct ecal_pos for shower depth
517  double shower_depth = reco::PFCluster::getDepthCorrection(cluRef->correctedEnergy(), below_ps, false);
518  GlobalPoint showerPos = ecal_pos + GlobalVector(particle.particle().momentum().x(),
519  particle.particle().momentum().y(),
520  particle.particle().momentum().z())
521  .unit() *
522  shower_depth;
523 
524  // Determine dR squared
525  float dr2 = reco::deltaR2(cluRef->positionREP(), showerPos);
526 
527  // Find nearest ECAL cluster
528  if (dr2 < info.dr2min) {
529  info.dr2min = dr2;
530  info.cluRef = cluRef;
531  info.deta = std::abs(cluRef->positionREP().eta() - showerPos.eta());
532  info.dphi = std::abs(reco::deltaPhi(cluRef->positionREP().phi(), showerPos.phi())) * kfTrackRef->charge();
533  info.showerPos = showerPos;
534  }
535  }
536 
537  // Populate PreId object
538  math::XYZPoint point(ecal_pos.x(), ecal_pos.y(), ecal_pos.z());
539 
540  // Set PreId content
541  ecalPreId.setECALMatchingProperties(
542  info.cluRef,
543  point,
544  info.showerPos,
545  info.deta,
546  info.dphi,
547  0.f, // chieta
548  0.f, // chiphi
549  kfTrackRef->normalizedChi2(), // chi2
550  info.cluRef->correctedEnergy() / std::sqrt(kfTrackRef->innerMomentum().mag2())); // E/p
551 }
552 
554 // Original implementation for "lightweight" GSF tracking
556  const reco::TrackRef& trackRef,
557  const reco::ElectronSeed& seed) {
559  for (unsigned int ihit = 0; ihit < trackRef->recHitsSize(); ++ihit) {
560  hits.push_back(trackRef->recHit(ihit)->cloneSH());
561  }
562 
563  GlobalVector gv(trackRef->innerMomentum().x(), trackRef->innerMomentum().y(), trackRef->innerMomentum().z());
564  GlobalPoint gp(trackRef->innerPosition().x(), trackRef->innerPosition().y(), trackRef->innerPosition().z());
565 
566  GlobalTrajectoryParameters gtps(gp, gv, trackRef->charge(), &*field_);
567 
568  TrajectoryStateOnSurface tsos(gtps, trackRef->innerStateCovariance(), *hits[0]->surface());
569 
570  // Track fitted and smoothed under electron hypothesis
571  Trajectory traj1 = fitterPtr_->fitOne(seed, hits, tsos);
572  if (!traj1.isValid()) {
573  return false;
574  }
575  Trajectory traj2 = smootherPtr_->trajectory(traj1);
576  if (!traj2.isValid()) {
577  return false;
578  }
579 
580  // Set PreId content
581  float chi2Ratio = trackRef->chi2() > 0. ? traj2.chiSquared() / trackRef->chi2() : -1.;
582  float gsfReducedChi2 = chi2Ratio > -1. ? chi2Ratio * trackRef->normalizedChi2() : -1.;
583  float ptOut = traj2.firstMeasurement().updatedState().globalMomentum().perp();
584  float ptIn = traj2.lastMeasurement().updatedState().globalMomentum().perp();
585  float gsfDpt = (ptIn > 0) ? fabs(ptOut - ptIn) / ptIn : 0.;
586  preId.setTrackProperties(gsfReducedChi2, chi2Ratio, gsfDpt);
587 
588  return true;
589 }
590 
592 // Decision based on OR of outputs from list of models
594  reco::PreId& ecalPreId,
595  reco::PreId& hcalPreId,
596  double rho,
597  const reco::BeamSpot& spot,
598  noZS::EcalClusterLazyTools& ecalTools) {
599  bool result = false;
600  for (auto& name : globalCache()->modelNames()) {
601  result |= globalCache()->eval(name, ecalPreId, hcalPreId, rho, spot, ecalTools);
602  }
603  return passThrough_ || (pfTrackRef->trackRef()->pt() > maxPtThreshold_) || result;
604 }
605 
607 //
609  reco::PreId& ecalPreId,
610  reco::PreId& hcalPreId,
611  double rho,
612  const reco::BeamSpot& spot,
613  noZS::EcalClusterLazyTools& ecalTools) {
614  // No implementation currently
615  return passThrough_;
616 }
617 
618 template <typename CollType>
620  const TrackIndxMap& trksToPreIdIndx,
621  const edm::OrphanHandle<reco::PreIdCollection>& preIdHandle,
623  std::vector<reco::PreIdRef> values;
624 
625  unsigned ntracks = tracksHandle->size();
626  for (unsigned itrack = 0; itrack < ntracks; ++itrack) {
627  edm::Ref<CollType> trackRef(tracksHandle, itrack);
628  auto preIdRefIt = trksToPreIdIndx.find(trackRef.index());
629  if (preIdRefIt == trksToPreIdIndx.end()) {
630  values.push_back(reco::PreIdRef());
631  } else {
632  edm::Ref<reco::PreIdCollection> preIdRef(preIdHandle, preIdRefIt->second);
633  values.push_back(preIdRef);
634  }
635  }
636  filler.insert(tracksHandle, values.begin(), values.end());
637 }
638 
640 //
643  desc.add<edm::InputTag>("tracks", edm::InputTag("generalTracks"));
644  desc.add<edm::InputTag>("pfTracks", edm::InputTag("lowPtGsfElePfTracks"));
645  desc.add<edm::InputTag>("ecalClusters", edm::InputTag("particleFlowClusterECAL"));
646  desc.add<edm::InputTag>("hcalClusters", edm::InputTag("particleFlowClusterHCAL"));
647  desc.add<edm::InputTag>("EBRecHits", edm::InputTag("ecalRecHit", "EcalRecHitsEB"));
648  desc.add<edm::InputTag>("EERecHits", edm::InputTag("ecalRecHit", "EcalRecHitsEE"));
649  desc.add<edm::InputTag>("rho", edm::InputTag("fixedGridRhoFastjetAllTmp"));
650  desc.add<edm::InputTag>("BeamSpot", edm::InputTag("offlineBeamSpot"));
651  desc.add<edm::ESInputTag>("Fitter", edm::ESInputTag{"", "GsfTrajectoryFitter_forPreId"});
652  desc.add<edm::ESInputTag>("Smoother", edm::ESInputTag{"", "GsfTrajectorySmoother_forPreId"});
653  desc.add<edm::ESInputTag>("TTRHBuilder", edm::ESInputTag{"", "WithAngleAndTemplate"});
654  desc.add<std::vector<std::string> >("ModelNames", {});
655  desc.add<std::vector<std::string> >("ModelWeights", {});
656  desc.add<std::vector<double> >("ModelThresholds", {});
657  desc.add<bool>("PassThrough", false);
658  desc.add<bool>("UsePfTracks", true);
659  desc.add<double>("MinPtThreshold", 1.0);
660  desc.add<double>("MaxPtThreshold", 15.);
661  descriptions.add("lowPtGsfElectronSeeds", desc);
662 }
663 
665 //
constexpr double deltaPhi(double phi1, double phi2)
Definition: deltaPhi.h:26
edm::ESHandle< MagneticField > field_
ESGetTokenH3DDVariant esConsumes(std::string const &Record, edm::ConsumesCollector &)
Definition: DeDxTools.cc:283
T getParameter(std::string const &) const
Definition: ParameterSet.h:307
std::unique_ptr< TrajectorySmoother > smootherPtr_
static const TGPicture * info(bool iBackgroundIsBlack)
T perp() const
Definition: PV3DBase.h:69
LowPtGsfElectronSeedProducer(const edm::ParameterSet &, const lowptgsfeleseed::HeavyObjectCache *)
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
std::vector< reco::PreId > PreIdCollection
Definition: PreIdFwd.h:6
bool isValid() const
Definition: Trajectory.h:257
ProductID id() const
Definition: HandleBase.cc:29
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)
bool decision(const reco::PFRecTrackRef &pfTrackRef, reco::PreId &ecal, reco::PreId &hcal, double rho, const reco::BeamSpot &spot, noZS::EcalClusterLazyTools &ecalTools)
bool lightGsfTracking(reco::PreId &, const reco::TrackRef &, const reco::ElectronSeed &)
virtual GlobalVector inTesla(const GlobalPoint &gp) const =0
Field value ad specified global point, in Tesla.
const edm::EDGetTokenT< reco::PFClusterCollection > ecalClusters_
static void globalEndJob(lowptgsfeleseed::HeavyObjectCache const *)
edm::EDGetTokenT< reco::PFClusterCollection > hcalClusters_
const edm::ESGetToken< MagneticField, IdealMagneticFieldRecord > magToken_
std::unordered_map< reco::TrackRef::key_type, size_t > TrackIndxMap
const edm::ESGetToken< TrajectorySmoother, TrajectoryFitter::Record > trajectorySmootherToken_
float chiSquared() const
Definition: Trajectory.h:241
const edm::EDGetTokenT< reco::BeamSpot > beamSpot_
void find(edm::Handle< EcalRecHitCollection > &hits, DetId thisDet, std::vector< EcalRecHitCollection::const_iterator > &hit, bool debug=false)
Definition: FindCaloHit.cc:19
const edm::ESGetToken< TrajectoryFitter, TrajectoryFitter::Record > trajectoryFitterToken_
TrajectoryMeasurement const & lastMeasurement() const
Definition: Trajectory.h:150
const noZS::EcalClusterLazyTools::ESGetTokens ecalClusterToolsESGetTokens_
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 &)
void setTrack(reco::TrackRef trackref)
Definition: PreId.h:31
void fillPreIdRefValueMap(edm::Handle< CollType > tracksHandle, const TrackIndxMap &trksToPreIdIndx, const edm::OrphanHandle< reco::PreIdCollection > &preIdHandle, edm::ValueMap< reco::PreIdRef >::Filler &filler)
ESData get(edm::EventSetup const &eventSetup) const
edm::EDGetTokenT< reco::TrackCollection > kfTracks_
T sqrt(T t)
Definition: SSEVec.h:23
edm::Ref< PFClusterCollection > PFClusterRef
persistent reference to PFCluster objects
Definition: PFClusterFwd.h:15
const edm::EDGetTokenT< EcalRecHitCollection > ebRecHits_
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
double z() const
z of vertex
Definition: RawParticle.h:284
edm::Ref< PFRecTrackCollection > PFRecTrackRef
persistent reference to PFRecTrack objects
Definition: PFRecTrackFwd.h:15
#define DEFINE_FWK_MODULE(type)
Definition: MakerMacros.h:16
std::vector< ElectronSeed > ElectronSeedCollection
collection of ElectronSeed objects
const edm::EDGetTokenT< EcalRecHitCollection > eeRecHits_
const edm::EDGetTokenT< double > rho_
edm::EDGetTokenT< reco::PFRecTrackCollection > pfTracks_
Basic3DVector unit() const
bool propagateToEcalEntrance(bool first=true)
static void fillDescriptions(edm::ConfigurationDescriptions &)
void produce(edm::Event &, const edm::EventSetup &) override
static double getDepthCorrection(double energy, bool isBelowPS=false, bool isHadron=false)
Definition: PFCluster.cc:39
constexpr auto deltaR2(const T1 &t1, const T2 &t2) -> decltype(t1.eta())
Definition: deltaR.h:16
static TrackQuality qualityByName(const std::string &name)
Definition: TrackBase.cc:126
XYZVectorD XYZVector
spatial vector with cartesian internal representation
Definition: Vector3D.h:31
XYZPointD XYZPoint
point in space with cartesian internal representation
Definition: Point3D.h:12
key_type index() const
Definition: Ref.h:253
edm::Ref< TrackCollection > TrackRef
persistent reference to a Track
Definition: TrackFwd.h:20
void add(std::string const &label, ParameterSetDescription const &psetDescription)
GlobalVector globalMomentum() const
TrajectoryStateOnSurface const & updatedState() const
TrackingRecHit::ConstRecHitContainer ConstRecHitContainer
Definition: Trajectory.h:41
static std::unique_ptr< lowptgsfeleseed::HeavyObjectCache > initializeGlobalCache(const edm::ParameterSet &conf)
void setTrackProperties(float newchi2, float chi2ratio, float dpt)
Definition: PreId.h:53
TrajectoryMeasurement const & firstMeasurement() const
Definition: Trajectory.h:166
const edm::ESGetToken< TransientTrackingRecHitBuilder, TransientRecHitRecord > builderToken_
reco::TrackRef getBaseRef(edm::Handle< std::vector< reco::Track > > handle, int idx) const
A PFTrack holds several trajectory points, which basically contain the position and momentum of a tra...
Power< A, B >::type pow(const A &a, const B &b)
Definition: Power.h:29
def move(src, dest)
Definition: eostools.py:511
std::unique_ptr< TrajectoryFitter > fitterPtr_
*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
Definition: event.py:1
Global3DVector GlobalVector
Definition: GlobalVector.h:10
math::XYZTLorentzVector XYZTLorentzVector
Definition: RawParticle.h:25