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
// user include files
6
#include "
CalibMuon/DTCalibration/interface/DTCalibMuonSelection.h
"
7
8
#include "
FWCore/Framework/interface/Event.h
"
9
#include "
FWCore/ParameterSet/interface/ParameterSet.h
"
10
#include "
FWCore/Utilities/interface/InputTag.h
"
11
12
#include "
DataFormats/MuonReco/interface/Muon.h
"
13
14
#include "
DataFormats/TrackReco/interface/Track.h
"
15
#include "
DataFormats/TrackReco/interface/TrackFwd.h
"
16
17
using namespace
edm
;
18
using namespace
reco
;
19
20
DTCalibMuonSelection::DTCalibMuonSelection
(
const
edm::ParameterSet
& iConfig) {
21
muonList = consumes<MuonCollection>(iConfig.
getParameter
<
edm::InputTag
>(
"src"
));
22
etaMin
= iConfig.
getParameter
<
double
>(
"etaMin"
);
23
etaMax
= iConfig.
getParameter
<
double
>(
"etaMax"
);
24
ptMin
= iConfig.
getParameter
<
double
>(
"ptMin"
);
25
}
26
27
DTCalibMuonSelection::~DTCalibMuonSelection
() {}
28
29
bool
DTCalibMuonSelection::filter
(
edm::Event
&
iEvent
,
const
edm::EventSetup
& iSetup) {
30
bool
result
=
false
;
31
32
//Retrieve the muons list
33
Handle<MuonCollection>
MuHandle;
34
iEvent
.getByToken(muonList, MuHandle);
35
36
for
(MuonCollection::const_iterator nmuon = MuHandle->begin(); nmuon != MuHandle->end(); ++nmuon) {
37
double
ptMuon(0.);
38
double
etaMuon(-999.);
39
40
if
(nmuon->isGlobalMuon()) {
41
ptMuon = nmuon->globalTrack()->pt();
42
etaMuon = nmuon->globalTrack()->eta();
43
}
else
44
continue
;
45
46
if
(ptMuon >
ptMin
&& etaMuon >
etaMin
&& etaMuon <
etaMax
) {
47
result
=
true
;
48
break
;
49
}
50
}
51
52
return
result
;
53
}
54
55
// ------------ method called once each job just before starting event loop ------------
56
void
DTCalibMuonSelection::beginJob
() {}
57
58
// ------------ method called once each job just after ending the event loop ------------
59
void
DTCalibMuonSelection::endJob
() {}
ALCARECOTkAlBeamHalo_cff.etaMin
etaMin
GeV.
Definition:
ALCARECOTkAlBeamHalo_cff.py:32
Muon.h
DTCalibMuonSelection::beginJob
void beginJob() override
Definition:
DTCalibMuonSelection.cc:56
edm
HLT enums.
Definition:
AlignableModifier.h:19
ptMin
constexpr float ptMin
Definition:
PhotonIDValueMapProducer.cc:155
reco
fixed size matrix
Definition:
AlignmentAlgorithmBase.h:45
edm::Handle
Definition:
AssociativeIterator.h:50
Track.h
TrackFwd.h
DTCalibMuonSelection::~DTCalibMuonSelection
~DTCalibMuonSelection() override
Definition:
DTCalibMuonSelection.cc:27
DTCalibMuonSelection.h
edm::ParameterSet
Definition:
ParameterSet.h:47
Event.h
DTCalibMuonSelection::endJob
void endJob() override
Definition:
DTCalibMuonSelection.cc:59
iEvent
int iEvent
Definition:
GenABIO.cc:224
edm::EventSetup
Definition:
EventSetup.h:58
DTCalibMuonSelection::DTCalibMuonSelection
DTCalibMuonSelection(const edm::ParameterSet &)
Definition:
DTCalibMuonSelection.cc:20
InputTag.h
ALCARECOTkAlBeamHalo_cff.etaMax
etaMax
Definition:
ALCARECOTkAlBeamHalo_cff.py:33
edm::ParameterSet::getParameter
T getParameter(std::string const &) const
Definition:
ParameterSet.h:303
mps_fire.result
result
Definition:
mps_fire.py:311
ParameterSet.h
edm::Event
Definition:
Event.h:73
DTCalibMuonSelection::filter
bool filter(edm::Event &, const edm::EventSetup &) override
Definition:
DTCalibMuonSelection.cc:29
edm::InputTag
Definition:
InputTag.h:15
Generated for CMSSW Reference Manual by
1.8.16