Main Page
Namespaces
Classes
Package Documentation
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Properties
Friends
Macros
Pages
src
CalibMuon
DTCalibration
src
DTCalibMuonSelection.cc
Go to the documentation of this file.
1
//
2
// Original Author: Marco Zanetti
3
// Created: Tue Sep 9 15:56:24 CEST 2008
4
5
6
7
// user include files
8
#include "
CalibMuon/DTCalibration/interface/DTCalibMuonSelection.h
"
9
10
#include "
FWCore/Framework/interface/Event.h
"
11
#include "
FWCore/ParameterSet/interface/ParameterSet.h
"
12
13
#include "
DataFormats/MuonReco/interface/Muon.h
"
14
#include "
DataFormats/MuonReco/interface/MuonFwd.h
"
15
16
#include "
DataFormats/TrackReco/interface/Track.h
"
17
#include "
DataFormats/TrackReco/interface/TrackFwd.h
"
18
19
using namespace
edm;
20
using namespace
reco
;
21
22
DTCalibMuonSelection::DTCalibMuonSelection
(
const
edm::ParameterSet
& iConfig)
23
{
24
muonList = iConfig.
getParameter
<
edm::InputTag
>(
"src"
);
25
etaMin
= iConfig.
getParameter
<
double
>(
"etaMin"
);
26
etaMax
= iConfig.
getParameter
<
double
>(
"etaMax"
);
27
ptMin
= iConfig.
getParameter
<
double
>(
"ptMin"
);
28
}
29
30
31
DTCalibMuonSelection::~DTCalibMuonSelection
() { }
32
33
34
bool
DTCalibMuonSelection::filter
(
edm::Event
&
iEvent
,
const
edm::EventSetup
& iSetup)
35
{
36
bool
result
=
false
;
37
38
//Retrieve the muons list
39
Handle<MuonCollection>
MuHandle;
40
iEvent.
getByLabel
(muonList,MuHandle);
41
42
for
(MuonCollection::const_iterator nmuon = MuHandle->begin(); nmuon != MuHandle->end(); ++nmuon) {
43
44
double
ptMuon(0.);
45
double
etaMuon(-999.);
46
47
if
(nmuon->isGlobalMuon()){
48
ptMuon = nmuon->globalTrack()->pt();
49
etaMuon = nmuon->globalTrack()->eta();
50
}
51
else
continue
;
52
53
if
(ptMuon >
ptMin
&&etaMuon >
etaMin
&& etaMuon <
etaMax
){
54
result =
true
;
55
break
;
56
}
57
58
}
59
60
return
result
;
61
}
62
63
64
65
// ------------ method called once each job just before starting event loop ------------
66
void
DTCalibMuonSelection::beginJob
() {
67
}
68
69
70
71
// ------------ method called once each job just after ending the event loop ------------
72
void
DTCalibMuonSelection::endJob
() {
73
}
74
edm::ParameterSet::getParameter
T getParameter(std::string const &) const
DTCalibMuonSelection::beginJob
virtual void beginJob()
Definition:
DTCalibMuonSelection.cc:66
Event.h
DTCalibMuonSelection::filter
virtual bool filter(edm::Event &, const edm::EventSetup &)
Definition:
DTCalibMuonSelection.cc:34
TrackFwd.h
DTCalibMuonSelection::DTCalibMuonSelection
DTCalibMuonSelection(const edm::ParameterSet &)
Definition:
DTCalibMuonSelection.cc:22
edm::Handle
Definition:
AssociativeIterator.h:47
dt_dqm_sourceclient_common_cff.reco
tuple reco
Definition:
dt_dqm_sourceclient_common_cff.py:105
MuonFwd.h
DTCalibMuonSelection::~DTCalibMuonSelection
~DTCalibMuonSelection()
Definition:
DTCalibMuonSelection.cc:31
ParameterSet.h
iEvent
int iEvent
Definition:
GenABIO.cc:243
query.result
tuple result
Definition:
query.py:137
edm::EventSetup
Definition:
EventSetup.h:44
Muon.h
edm::Event::getByLabel
bool getByLabel(InputTag const &tag, Handle< PROD > &result) const
Definition:
Event.h:390
PtMinSelector_cfg.ptMin
tuple ptMin
Definition:
PtMinSelector_cfg.py:44
jptDQMConfig_cff.etaMin
int etaMin
Definition:
jptDQMConfig_cff.py:52
edm::InputTag
Definition:
InputTag.h:17
jptDQMConfig_cff.etaMax
float etaMax
Definition:
jptDQMConfig_cff.py:9
DTCalibMuonSelection::endJob
virtual void endJob()
Definition:
DTCalibMuonSelection.cc:72
DTCalibMuonSelection.h
edm::ParameterSet
Definition:
ParameterSet.h:35
edm::Event
Definition:
Event.h:62
Track.h
Generated for CMSSW Reference Manual by
1.8.5