CMS 3D CMS Logo

LowPtGsfElectronSeedProducer.h
Go to the documentation of this file.
1 #ifndef RecoEgamma_EgammaElectronProducers_LowPtGsfElectronSeedProducer_h
2 #define RecoEgamma_EgammaElectronProducers_LowPtGsfElectronSeedProducer_h
3 
25 
27 
29  : public edm::stream::EDProducer<edm::GlobalCache<lowptgsfeleseed::HeavyObjectCache> > {
30 public:
31  using TrackIndxMap = std::unordered_map<reco::TrackRef::key_type, size_t>;
33 
35 
36  static std::unique_ptr<lowptgsfeleseed::HeavyObjectCache> initializeGlobalCache(const edm::ParameterSet& conf) {
37  return std::make_unique<lowptgsfeleseed::HeavyObjectCache>(lowptgsfeleseed::HeavyObjectCache(conf));
38  }
39 
41 
42  void beginLuminosityBlock(edm::LuminosityBlock const&, edm::EventSetup const&) override;
43 
44  void produce(edm::Event&, const edm::EventSetup&) override;
45 
47 
48 private: // member functions
49  template <typename T>
50  void loop(const edm::Handle<std::vector<T> >& handle,
53  reco::PreIdCollection& ecalPreIds,
54  reco::PreIdCollection& hcalPreIds,
55  TrackIndxMap& trksToPreIdIndx,
56  edm::Event&,
57  const edm::EventSetup&);
58 
59  // Overloaded methods to retrieve reco::TrackRef
60 
61  reco::TrackRef getBaseRef(edm::Handle<std::vector<reco::Track> > handle, int idx) const;
62  reco::TrackRef getBaseRef(edm::Handle<std::vector<reco::PFRecTrack> > handle, int idx) const;
63 
64  // Overloaded methods to populate PreIds (using PF or KF tracks)
65 
66  void propagateTrackToCalo(const reco::PFRecTrackRef& pfTrackRef,
68  const edm::Handle<reco::PFClusterCollection>& hcalClusters,
69  std::vector<int>& matchedEcalClusters,
70  std::vector<int>& matchedHcalClusters,
71  reco::PreId& ecalPreId,
72  reco::PreId& hcalPreId);
73 
74  void propagateTrackToCalo(const reco::PFRecTrackRef& pfTrackRef,
76  std::vector<int>& matchedClusters,
77  reco::PreId& preId,
78  bool ecal);
79 
81  const edm::Handle<reco::PFClusterCollection>& ecalClusters,
82  const edm::Handle<reco::PFClusterCollection>& hcalClusters,
83  std::vector<int>& matchedEcalClusters,
84  std::vector<int>& matchedHcalClusters,
85  reco::PreId& ecalPreId,
86  reco::PreId& hcalPreId);
87  template <typename CollType>
89  const TrackIndxMap& trksToPreIdIndx,
92 
93  // Overloaded methods to evaluate BDTs (using PF or KF tracks)
94 
95  bool decision(const reco::PFRecTrackRef& pfTrackRef,
96  reco::PreId& ecal,
98  double rho,
99  const reco::BeamSpot& spot,
100  noZS::EcalClusterLazyTools& ecalTools);
101 
102  bool decision(const reco::TrackRef& kfTrackRef,
103  reco::PreId& ecal,
104  reco::PreId& hcal,
105  double rho,
106  const reco::BeamSpot& spot,
107  noZS::EcalClusterLazyTools& ecalTools);
108 
109  // Perform lightweight GSF tracking
111 
112 private: // member data
114  std::unique_ptr<TrajectoryFitter> fitterPtr_;
115  std::unique_ptr<TrajectorySmoother> smootherPtr_;
127  const bool passThrough_;
128  const bool usePfTracks_;
129  const double minPtThreshold_;
130  const double maxPtThreshold_;
131 
132  // pow( sinh(1.65), 2. )
133  static constexpr double boundary_ = 2.50746495928 * 2.50746495928;
134  // pow( ele_mass, 2. )
135  static constexpr double mass_ = 0.000511 * 0.000511;
136 };
137 
138 #endif // RecoEgamma_EgammaElectronProducers_LowPtGsfElectronSeedProducer_h
edm::ESHandle< MagneticField > field_
std::unique_ptr< TrajectorySmoother > smootherPtr_
LowPtGsfElectronSeedProducer(const edm::ParameterSet &, const lowptgsfeleseed::HeavyObjectCache *)
std::vector< reco::PreId > PreIdCollection
Definition: PreIdFwd.h:6
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)
const edm::EDGetTokenT< reco::PFClusterCollection > ecalClusters_
static void globalEndJob(lowptgsfeleseed::HeavyObjectCache const *)
edm::EDGetTokenT< reco::PFClusterCollection > hcalClusters_
std::unordered_map< reco::TrackRef::key_type, size_t > TrackIndxMap
const edm::EDGetTokenT< reco::BeamSpot > beamSpot_
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 fillPreIdRefValueMap(edm::Handle< CollType > tracksHandle, const TrackIndxMap &trksToPreIdIndx, const edm::OrphanHandle< reco::PreIdCollection > &preIdHandle, edm::ValueMap< reco::PreIdRef >::Filler &filler)
edm::EDGetTokenT< reco::TrackCollection > kfTracks_
bool lightGsfTracking(reco::PreId &, const reco::TrackRef &, const reco::ElectronSeed &, const edm::EventSetup &)
const edm::EDGetTokenT< EcalRecHitCollection > ebRecHits_
std::vector< ElectronSeed > ElectronSeedCollection
collection of ElectronSeed objects
const edm::EDGetTokenT< EcalRecHitCollection > eeRecHits_
const edm::EDGetTokenT< double > rho_
edm::EDGetTokenT< reco::PFRecTrackCollection > pfTracks_
static void fillDescriptions(edm::ConfigurationDescriptions &)
void produce(edm::Event &, const edm::EventSetup &) override
void beginLuminosityBlock(edm::LuminosityBlock const &, edm::EventSetup const &) override
static std::unique_ptr< lowptgsfeleseed::HeavyObjectCache > initializeGlobalCache(const edm::ParameterSet &conf)
reco::TrackRef getBaseRef(edm::Handle< std::vector< reco::Track > > handle, int idx) const
std::unique_ptr< TrajectoryFitter > fitterPtr_
#define constexpr