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 
26 
27 class LowPtGsfElectronSeedProducer final : public edm::stream::EDProducer< edm::GlobalCache<lowptgsfeleseed::HeavyObjectCache> >
28 {
29 
30  public:
31  using TrackIndxMap = std::unordered_map<reco::TrackRef::key_type,size_t>;
34 
36 
37  static std::unique_ptr<lowptgsfeleseed::HeavyObjectCache>
39  return std::make_unique<lowptgsfeleseed::HeavyObjectCache>(lowptgsfeleseed::HeavyObjectCache(conf));
40  }
41 
43 
45  edm::EventSetup const& ) override;
46 
47  void produce( edm::Event&, const edm::EventSetup& ) override;
48 
50 
51  private: // member functions
52 
53  template <typename T> void loop( const edm::Handle< std::vector<T> >& handle,
56  reco::PreIdCollection& ecalPreIds,
57  reco::PreIdCollection& hcalPreIds,
58  TrackIndxMap& trksToPreIdIndx,
59  edm::Event&,
60  const edm::EventSetup& );
61 
62  // Overloaded methods to retrieve reco::TrackRef
63 
64  reco::TrackRef getBaseRef( edm::Handle< std::vector<reco::Track> > handle, int idx ) const;
65  reco::TrackRef getBaseRef( edm::Handle< std::vector<reco::PFRecTrack> > handle, int idx ) const;
66 
67  // Overloaded methods to populate PreIds (using PF or KF tracks)
68 
69  void propagateTrackToCalo( const reco::PFRecTrackRef& pfTrackRef,
71  const edm::Handle<reco::PFClusterCollection>& hcalClusters,
72  std::vector<int>& matchedEcalClusters,
73  std::vector<int>& matchedHcalClusters,
74  reco::PreId& ecalPreId,
75  reco::PreId& hcalPreId );
76 
77  void propagateTrackToCalo( const reco::PFRecTrackRef& pfTrackRef,
79  std::vector<int>& matchedClusters,
80  reco::PreId& preId,
81  bool ecal );
82 
84  const edm::Handle<reco::PFClusterCollection>& ecalClusters,
85  const edm::Handle<reco::PFClusterCollection>& hcalClusters,
86  std::vector<int>& matchedEcalClusters,
87  std::vector<int>& matchedHcalClusters,
88  reco::PreId& ecalPreId,
89  reco::PreId& hcalPreId );
90  template<typename CollType>
92  const TrackIndxMap& trksToPreIdIndx,
95 
96  // Overloaded methods to evaluate BDTs (using PF or KF tracks)
97 
98  bool decision( const reco::PFRecTrackRef& pfTrackRef,
99  reco::PreId& ecal,
100  reco::PreId& hcal,
101  double rho,
102  const reco::BeamSpot& spot,
103  noZS::EcalClusterLazyTools& ecalTools );
104 
105  bool decision( const reco::TrackRef& kfTrackRef,
106  reco::PreId& ecal,
107  reco::PreId& hcal,
108  double rho,
109  const reco::BeamSpot& spot,
110  noZS::EcalClusterLazyTools& ecalTools );
111 
112  // Perform lightweight GSF tracking
114  const reco::TrackRef&,
115  const reco::ElectronSeed&,
116  const edm::EventSetup& );
117 
118  private: // member data
119 
121  std::unique_ptr<TrajectoryFitter> fitterPtr_;
122  std::unique_ptr<TrajectorySmoother> smootherPtr_;
134  const bool passThrough_;
135  const bool usePfTracks_;
136  const double minPtThreshold_;
137  const double maxPtThreshold_;
138 
139  // pow( sinh(1.65), 2. )
140  static constexpr double boundary_ = 2.50746495928*2.50746495928;
141  // pow( ele_mass, 2. )
142  static constexpr double mass_ = 0.000511*0.000511;
143 
144 };
145 
146 #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_
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)
std::unordered_map< reco::TrackRef::key_type, size_t > TrackIndxMap
reco::TrackRef getBaseRef(edm::Handle< std::vector< reco::Track > > handle, int idx) const
std::unique_ptr< TrajectoryFitter > fitterPtr_
#define constexpr