CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Member Functions | Private Attributes
L1Analysis::L1AnalysisRecoMuon2 Class Reference

#include <L1AnalysisRecoMuon2.h>

Public Member Functions

L1AnalysisRecoMuon2DataFormatgetData ()
 
 L1AnalysisRecoMuon2 ()
 
void Reset ()
 
void SetMuon (const edm::Event &event, const edm::EventSetup &setup, const edm::Handle< reco::MuonCollection > muons, unsigned maxMuon)
 
 ~L1AnalysisRecoMuon2 ()
 

Private Attributes

L1AnalysisRecoMuon2DataFormat recoMuon_
 

Detailed Description

Definition at line 33 of file L1AnalysisRecoMuon2.h.

Constructor & Destructor Documentation

L1Analysis::L1AnalysisRecoMuon2::L1AnalysisRecoMuon2 ( )

Definition at line 9 of file L1AnalysisRecoMuon2.cc.

10 {
11 }
L1Analysis::L1AnalysisRecoMuon2::~L1AnalysisRecoMuon2 ( )

Definition at line 14 of file L1AnalysisRecoMuon2.cc.

15 {
16 }

Member Function Documentation

L1AnalysisRecoMuon2DataFormat* L1Analysis::L1AnalysisRecoMuon2::getData ( void  )
inline

Definition at line 47 of file L1AnalysisRecoMuon2.h.

References recoMuon_.

47 {return &recoMuon_;}
L1AnalysisRecoMuon2DataFormat recoMuon_
void L1Analysis::L1AnalysisRecoMuon2::Reset ( void  )
inline
void L1Analysis::L1AnalysisRecoMuon2::SetMuon ( const edm::Event event,
const edm::EventSetup setup,
const edm::Handle< reco::MuonCollection muons,
unsigned  maxMuon 
)

Definition at line 18 of file L1AnalysisRecoMuon2.cc.

References isLooseMuonCustom(), isMediumMuonCustom(), and bookConverter::max.

21 {
22 
23  recoMuon_.nMuons=0;
24 
25  for(reco::MuonCollection::const_iterator it=muons->begin();
26  it!=muons->end() && recoMuon_.nMuons < maxMuon;
27  ++it) {
28 
29  recoMuon_.e.push_back(it->energy());
30  recoMuon_.pt.push_back(it->pt());
31  recoMuon_.et.push_back(it->et());
32  recoMuon_.eta.push_back(it->eta());
33  recoMuon_.phi.push_back(it->phi());
34 
35  //check isLooseMuon
36  bool flagLoose = isLooseMuonCustom(*it);
37  recoMuon_.isLooseMuon.push_back(flagLoose);
38 
39  //check isMediumMuon
40  bool flagMedium = isMediumMuonCustom(*it);
41  recoMuon_.isMediumMuon.push_back(flagMedium);
42 
43  double iso = (it->pfIsolationR03().sumChargedHadronPt + max(
44  it->pfIsolationR03().sumNeutralHadronEt +
45  it->pfIsolationR03().sumPhotonEt -
46  0.5 * it->pfIsolationR03().sumPUPt, 0.0)) / it->pt();
47  recoMuon_.iso.push_back(iso);
48 
49  recoMuon_.nMuons++;
50 
51  }
52 }
bool isLooseMuonCustom(const reco::Muon &recoMu)
Definition: MuonID.h:15
bool isMediumMuonCustom(const reco::Muon &recoMu)
Definition: MuonID.h:23
L1AnalysisRecoMuon2DataFormat recoMuon_

Member Data Documentation

L1AnalysisRecoMuon2DataFormat L1Analysis::L1AnalysisRecoMuon2::recoMuon_
private

Definition at line 51 of file L1AnalysisRecoMuon2.h.

Referenced by getData(), and Reset().