CMS 3D CMS Logo

LowPtGsfElectronCoreProducer.cc
Go to the documentation of this file.
9 
12 {
13  superClusterRefs_ = consumes< edm::ValueMap<reco::SuperClusterRef> >(config.getParameter<edm::InputTag>("superClusters"));
14 }
15 
17 
19 
20  // Output collection
21  auto electrons = std::make_unique<reco::GsfElectronCoreCollection>();
22 
23  // Init
25  if ( !useGsfPfRecTracks_ ) { edm::LogError("useGsfPfRecTracks_ is (redundantly) set to False!"); }
26 
28  event.getByToken(superClusterRefs_,superClusterRefs);
29 
30  // Create ElectronCore objects
31  for ( size_t ipfgsf = 0; ipfgsf < gsfPfRecTracksH_->size(); ++ipfgsf ) {
32 
33  // Refs to GSF(PF) objects and SC
35  reco::GsfTrackRef gsf = pfgsf->gsfTrackRef();
36  const reco::SuperClusterRef sc = (*superClusterRefs)[pfgsf];
37 
38  // Use GsfElectronCore(gsf) constructor and store object via emplace
39  electrons->emplace_back(gsf);
40 
41  // Do not consider ECAL-driven objects
42  if( electrons->back().ecalDrivenSeed() ) {
43  electrons->pop_back();
44  continue;
45  }
46 
47  // Add GSF(PF) track information
49 
50  // Add super cluster information
51  electrons->back().setSuperCluster(sc);
52 
53  }
54 
55  event.put(std::move(electrons));
56 
57 }
58 
60 //
62 {
65  desc.add<edm::InputTag>("superClusters",edm::InputTag("lowPtGsfElectronSuperClusters"));
66  descriptions.add("defaultLowPtGsfElectronCores",desc);
67 }
68 
70 //
void initEvent(edm::Event &event, const edm::EventSetup &setup)
T getParameter(std::string const &) const
void produce(edm::Event &, const edm::EventSetup &) override
def setup(process, global_tag, zero_tesla=False)
Definition: GeneralSetup.py:2
edm::EDGetTokenT< edm::ValueMap< reco::SuperClusterRef > > superClusterRefs_
Definition: config.py:1
#define DEFINE_FWK_MODULE(type)
Definition: MakerMacros.h:16
ParameterDescriptionBase * add(U const &iLabel, T const &value)
LowPtGsfElectronCoreProducer(const edm::ParameterSet &conf)
static void fillDescription(edm::ParameterSetDescription &)
static void fillDescriptions(edm::ConfigurationDescriptions &)
void add(std::string const &label, ParameterSetDescription const &psetDescription)
edm::Handle< reco::GsfPFRecTrackCollection > gsfPfRecTracksH_
void fillElectronCore(reco::GsfElectronCore *)
def move(src, dest)
Definition: eostools.py:511
Definition: event.py:1