CMS 3D CMS Logo

List of all members | Public Member Functions | Private Attributes
L1Analysis::L1AnalysisRecoElectron Class Reference

#include <L1AnalysisRecoElectron.h>

Public Member Functions

L1AnalysisRecoElectronDataFormatgetData ()
 
 L1AnalysisRecoElectron ()
 
void Reset ()
 
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)
 
 ~L1AnalysisRecoElectron ()
 

Private Attributes

L1AnalysisRecoElectronDataFormat recoElectron_
 

Detailed Description

Definition at line 22 of file L1AnalysisRecoElectron.h.

Constructor & Destructor Documentation

◆ L1AnalysisRecoElectron()

L1Analysis::L1AnalysisRecoElectron::L1AnalysisRecoElectron ( )

Definition at line 5 of file L1AnalysisRecoElectron.cc.

5 {}

◆ ~L1AnalysisRecoElectron()

L1Analysis::L1AnalysisRecoElectron::~L1AnalysisRecoElectron ( )

Definition at line 7 of file L1AnalysisRecoElectron.cc.

7 {}

Member Function Documentation

◆ getData()

L1AnalysisRecoElectronDataFormat* L1Analysis::L1AnalysisRecoElectron::getData ( void  )
inline

Definition at line 43 of file L1AnalysisRecoElectron.h.

43 { return &recoElectron_; }

References recoElectron_.

Referenced by L1ElectronRecoTreeProducer::L1ElectronRecoTreeProducer().

◆ Reset()

void L1Analysis::L1AnalysisRecoElectron::Reset ( )
inline

◆ SetElectron()

void L1Analysis::L1AnalysisRecoElectron::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 at line 9 of file L1AnalysisRecoElectron.cc.

17 {
19 
20  for (reco::GsfElectronCollection::const_iterator el = electrons->begin();
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 
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 
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 }

References pwdgSkimBPark_cfi::electrons, PVValHelper::eta, SiStripPI::max, l1ElectronRecoTree_cfi::maxElectron, and phi.

Referenced by L1ElectronRecoTreeProducer::analyze().

Member Data Documentation

◆ recoElectron_

L1AnalysisRecoElectronDataFormat L1Analysis::L1AnalysisRecoElectron::recoElectron_
private

Definition at line 47 of file L1AnalysisRecoElectron.h.

Referenced by getData(), and Reset().

L1Analysis::L1AnalysisRecoElectronDataFormat::eta_SC
std::vector< float > eta_SC
Definition: L1AnalysisRecoElectronDataFormat.h:46
L1Analysis::L1AnalysisRecoElectron::recoElectron_
L1AnalysisRecoElectronDataFormat recoElectron_
Definition: L1AnalysisRecoElectron.h:47
L1Analysis::L1AnalysisRecoElectronDataFormat::e
std::vector< float > e
Definition: L1AnalysisRecoElectronDataFormat.h:39
L1Analysis::L1AnalysisRecoElectronDataFormat::pt
std::vector< float > pt
Definition: L1AnalysisRecoElectronDataFormat.h:44
L1Analysis::L1AnalysisRecoElectronDataFormat::iso
std::vector< float > iso
Definition: L1AnalysisRecoElectronDataFormat.h:48
L1Analysis::L1AnalysisRecoElectronDataFormat::e_SC
std::vector< float > e_SC
Definition: L1AnalysisRecoElectronDataFormat.h:41
L1Analysis::L1AnalysisRecoElectronDataFormat::phi
std::vector< float > phi
Definition: L1AnalysisRecoElectronDataFormat.h:47
L1Analysis::L1AnalysisRecoElectronDataFormat::et
std::vector< float > et
Definition: L1AnalysisRecoElectronDataFormat.h:40
edm::Ref
Definition: AssociativeIterator.h:58
L1Analysis::L1AnalysisRecoElectronDataFormat::Reset
void Reset()
Definition: L1AnalysisRecoElectronDataFormat.h:18
L1Analysis::L1AnalysisRecoElectronDataFormat::isTightElectron
std::vector< short > isTightElectron
Definition: L1AnalysisRecoElectronDataFormat.h:52
PVValHelper::eta
Definition: PVValidationHelpers.h:70
L1Analysis::L1AnalysisRecoElectronDataFormat::nElectrons
unsigned nElectrons
Definition: L1AnalysisRecoElectronDataFormat.h:38
L1Analysis::L1AnalysisRecoElectronDataFormat::e_ECAL
std::vector< float > e_ECAL
Definition: L1AnalysisRecoElectronDataFormat.h:42
SiStripPI::max
Definition: SiStripPayloadInspectorHelper.h:169
L1Analysis::L1AnalysisRecoElectronDataFormat::isLooseElectron
std::vector< short > isLooseElectron
Definition: L1AnalysisRecoElectronDataFormat.h:50
DDAxes::phi
pwdgSkimBPark_cfi.electrons
electrons
Definition: pwdgSkimBPark_cfi.py:6
l1ElectronRecoTree_cfi.maxElectron
maxElectron
Definition: l1ElectronRecoTree_cfi.py:4
L1Analysis::L1AnalysisRecoElectronDataFormat::eta
std::vector< float > eta
Definition: L1AnalysisRecoElectronDataFormat.h:45
L1Analysis::L1AnalysisRecoElectronDataFormat::charge
std::vector< int > charge
Definition: L1AnalysisRecoElectronDataFormat.h:53
L1Analysis::L1AnalysisRecoElectronDataFormat::isVetoElectron
std::vector< short > isVetoElectron
Definition: L1AnalysisRecoElectronDataFormat.h:49
L1Analysis::L1AnalysisRecoElectronDataFormat::isMediumElectron
std::vector< short > isMediumElectron
Definition: L1AnalysisRecoElectronDataFormat.h:51
L1Analysis::L1AnalysisRecoElectronDataFormat::phi_SC
std::vector< float > phi_SC
Definition: L1AnalysisRecoElectronDataFormat.h:43