CMS 3D CMS Logo

L1AnalysisRecoElectron.cc
Go to the documentation of this file.
2 
3 using namespace std;
4 
6 
8 
10  const edm::Event& event,
11  const edm::EventSetup& setup,
12  //const edm::Handle<edm::View<reco::GsfElectron>>& electrons,
14  std::vector<edm::Handle<edm::ValueMap<bool> > > eleVIDDecisionHandles,
15  const unsigned& maxElectron)
16 
17 {
18  recoElectron_.nElectrons = 0;
19 
20  for (reco::GsfElectronCollection::const_iterator el = electrons->begin();
21  el != electrons->end() && recoElectron_.nElectrons < maxElectron;
22  ++el) {
23  recoElectron_.e.push_back(el->energy());
24  recoElectron_.pt.push_back(el->pt());
25  recoElectron_.et.push_back(el->et());
26  recoElectron_.eta.push_back(el->eta());
27  recoElectron_.phi.push_back(el->phi());
28  recoElectron_.eta_SC.push_back((el->superClusterPosition()).eta());
29  recoElectron_.phi_SC.push_back((el->superClusterPosition()).phi());
30  recoElectron_.e_ECAL.push_back(el->ecalEnergy());
31  recoElectron_.e_SC.push_back(el->superCluster()->energy());
32  recoElectron_.charge.push_back(el->charge());
33 
34  edm::Ref<reco::GsfElectronCollection> electronEdmRef(electrons, recoElectron_.nElectrons);
35 
36  recoElectron_.isVetoElectron.push_back((*(eleVIDDecisionHandles[0]))[electronEdmRef]);
37  recoElectron_.isLooseElectron.push_back((*(eleVIDDecisionHandles[1]))[electronEdmRef]);
38  recoElectron_.isMediumElectron.push_back((*(eleVIDDecisionHandles[2]))[electronEdmRef]);
39  recoElectron_.isTightElectron.push_back((*(eleVIDDecisionHandles[3]))[electronEdmRef]);
40 
41  double iso = (el->pfIsolationVariables().sumChargedHadronPt +
42  max(el->pfIsolationVariables().sumNeutralHadronEt + el->pfIsolationVariables().sumPhotonEt -
43  0.5 * el->pfIsolationVariables().sumPUPt,
44  0.0)) /
45  el->pt();
46 
47  recoElectron_.iso.push_back(iso);
48  // cout<<ConversionTools::hasMatchedConversion(*el,conversions,theBeamSpot->position())<<endl;
49 
50  recoElectron_.nElectrons++;
51  }
52  // for(reco::GsfElectronCollection::const_iterator it=electrons->begin();
53  // it!=electrons->end() && recoElectron_.nElectrons < maxElectron;
54  // ++it) {
55 
56  // recoElectron_.e.push_back(it->energy());
57  // recoElectron_.pt.push_back(it->pt());
58  // recoElectron_.et.push_back(it->et());
59  // recoElectron_.eta.push_back(it->eta());
60  // recoElectron_.phi.push_back(it->phi());
61 
62  // // cout<<it->superCluster().position().eta()<<endl;
63  // isVetoElectronCustom(*it, vertices, conversions, theBeamSpot, Rho);
64 
65  // // cout<<ConversionTools::hasMatchedConversion(*it,conversions,theBeamSpot->position())<<endl;
66 
67  // recoElectron_.nElectrons++;
68 
69  // }
70 }
edm::Handle< reco::GsfElectronCollection >
singleTopDQM_cfi.setup
setup
Definition: singleTopDQM_cfi.py:37
edm::Ref
Definition: AssociativeIterator.h:58
PVValHelper::eta
Definition: PVValidationHelpers.h:69
L1Analysis::L1AnalysisRecoElectron::L1AnalysisRecoElectron
L1AnalysisRecoElectron()
Definition: L1AnalysisRecoElectron.cc:5
L1Analysis::L1AnalysisRecoElectron::SetElectron
void SetElectron(const edm::Event &event, const edm::EventSetup &setup, const edm::Handle< reco::GsfElectronCollection > electrons, const std::vector< edm::Handle< edm::ValueMap< bool > > > eleVIDDecisionHandles, const unsigned &maxElectron)
Definition: L1AnalysisRecoElectron.cc:9
L1AnalysisRecoElectron.h
SiStripPI::max
Definition: SiStripPayloadInspectorHelper.h:169
edm::EventSetup
Definition: EventSetup.h:57
DDAxes::phi
std
Definition: JetResolutionObject.h:76
pwdgSkimBPark_cfi.electrons
electrons
Definition: pwdgSkimBPark_cfi.py:6
l1ElectronRecoTree_cfi.maxElectron
maxElectron
Definition: l1ElectronRecoTree_cfi.py:4
edm::ValueMap
Definition: ValueMap.h:107
event
Definition: event.py:1
edm::Event
Definition: Event.h:73
L1Analysis::L1AnalysisRecoElectron::~L1AnalysisRecoElectron
~L1AnalysisRecoElectron()
Definition: L1AnalysisRecoElectron.cc:7