test
CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
L1AnalysisRecoMuon2.cc
Go to the documentation of this file.
5 
6 using namespace std;
7 using namespace muon;
8 
10 {
11 }
12 
13 
15 {
16 }
17 
19  const edm::EventSetup& setup,
20  edm::Handle<reco::MuonCollection> muons, unsigned maxMuon)
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 }
53 
54 
bool isLooseMuonCustom(const reco::Muon &recoMu)
Definition: MuonID.h:15
bool isMediumMuonCustom(const reco::Muon &recoMu)
Definition: MuonID.h:23
How EventSelector::AcceptEvent() decides whether to accept an event for output otherwise it is excluding the probing of A single or multiple positive and the trigger will pass if any such matching triggers are PASS or EXCEPTION[A criterion thatmatches no triggers at all is detected and causes a throw.] A single negative with an expectation of appropriate bit checking in the decision and the trigger will pass if any such matching triggers are FAIL or EXCEPTION A wildcarded negative criterion that matches more than one trigger in the trigger but the state exists so we define the behavior If all triggers are the negative crieriion will lead to accepting the event(this again matches the behavior of"!*"before the partial wildcard feature was incorporated).The per-event"cost"of each negative criterion with multiple relevant triggers is about the same as!*was in the past
void SetMuon(const edm::Event &event, const edm::EventSetup &setup, const edm::Handle< reco::MuonCollection > muons, unsigned maxMuon)
tuple muons
Definition: patZpeak.py:38