Alignment
CommonAlignmentProducer
src
AlignmentCSCTrackSelector.cc
Go to the documentation of this file.
1
#include "
Alignment/CommonAlignmentProducer/interface/AlignmentCSCTrackSelector.h
"
2
3
#include "
FWCore/MessageLogger/interface/MessageLogger.h
"
4
#include "
FWCore/ParameterSet/interface/ParameterSet.h
"
5
6
#include "
FWCore/Framework/interface/Event.h
"
7
8
#include "
DataFormats/TrackingRecHit/interface/TrackingRecHit.h
"
9
#include "
DataFormats/TrackReco/interface/Track.h
"
10
#include "
DataFormats/DetId/interface/DetId.h
"
11
#include "
DataFormats/MuonDetId/interface/CSCDetId.h
"
12
13
// constructor ----------------------------------------------------------------
14
15
AlignmentCSCTrackSelector::AlignmentCSCTrackSelector
(
const
edm::ParameterSet
&
cfg
)
16
: m_src(
cfg
.getParameter<
edm
::
InputTag
>(
"src"
)),
17
m_stationA(
cfg
.getParameter<
int
>(
"stationA"
)),
18
m_stationB(
cfg
.getParameter<
int
>(
"stationB"
)),
19
m_minHitsDT(
cfg
.getParameter<
int
>(
"minHitsDT"
)),
20
m_minHitsPerStation(
cfg
.getParameter<
int
>(
"minHitsPerStation"
)),
21
m_maxHitsPerStation(
cfg
.getParameter<
int
>(
"maxHitsPerStation"
)) {}
22
23
// destructor -----------------------------------------------------------------
24
25
AlignmentCSCTrackSelector::~AlignmentCSCTrackSelector
() {}
26
27
// do selection ---------------------------------------------------------------
28
29
AlignmentCSCTrackSelector::Tracks
AlignmentCSCTrackSelector::select
(
const
Tracks
&
tracks
,
const
edm::Event
& evt)
const
{
30
Tracks
result
;
31
32
for
(
auto
const
&
track
:
tracks
) {
33
int
hitsOnStationA = 0;
34
int
hitsOnStationB = 0;
35
36
for
(
auto
const
&
hit
:
track
->recHits()) {
37
DetId
id
=
hit
->geographicalId();
38
39
if
(
id
.det() ==
DetId::Muon
&&
id
.subdetId() ==
MuonSubdetId::DT
) {
40
if
(
m_stationA
== 0)
41
hitsOnStationA++;
42
if
(
m_stationB
== 0)
43
hitsOnStationB++;
44
}
else
if
(
id
.det() ==
DetId::Muon
&&
id
.subdetId() ==
MuonSubdetId::CSC
) {
45
CSCDetId
cscid(
id
.rawId());
46
int
station
= (cscid.
endcap
() == 1 ? 1 : -1) * cscid.
station
();
47
48
if
(
station
==
m_stationA
)
49
hitsOnStationA++;
50
if
(
station
==
m_stationB
)
51
hitsOnStationB++;
52
53
}
// end if CSC
54
}
// end loop over hits
55
56
bool
stationAokay;
57
if
(
m_stationA
== 0)
58
stationAokay = (
m_minHitsDT
<= hitsOnStationA);
59
else
60
stationAokay = (
m_minHitsPerStation
<= hitsOnStationA && hitsOnStationA <=
m_maxHitsPerStation
);
61
62
bool
stationBokay;
63
if
(
m_stationB
== 0)
64
stationBokay = (
m_minHitsDT
<= hitsOnStationB);
65
else
66
stationBokay = (
m_minHitsPerStation
<= hitsOnStationB && hitsOnStationB <=
m_maxHitsPerStation
);
67
68
if
(stationAokay && stationBokay) {
69
result
.push_back(
track
);
70
}
71
}
// end loop over tracks
72
73
return
result
;
74
}
MuonSubdetId::CSC
static constexpr int CSC
Definition:
MuonSubdetId.h:12
AlignmentCSCTrackSelector::m_stationB
int m_stationB
Definition:
AlignmentCSCTrackSelector.h:30
HLT_FULL_cff.track
track
Definition:
HLT_FULL_cff.py:11713
MessageLogger.h
relativeConstraints.station
station
Definition:
relativeConstraints.py:67
edm
HLT enums.
Definition:
AlignableModifier.h:19
HLT_FULL_cff.InputTag
InputTag
Definition:
HLT_FULL_cff.py:89281
AlignmentCSCTrackSelector::select
Tracks select(const Tracks &tracks, const edm::Event &evt) const
select tracks
Definition:
AlignmentCSCTrackSelector.cc:29
CSCDetId.h
DetId
Definition:
DetId.h:17
TrackingRecHit.h
AlignmentCSCTrackSelector::m_maxHitsPerStation
int m_maxHitsPerStation
Definition:
AlignmentCSCTrackSelector.h:30
AlignmentCSCTrackSelector::m_stationA
int m_stationA
Definition:
AlignmentCSCTrackSelector.h:30
Track.h
AlignmentCSCTrackSelector::AlignmentCSCTrackSelector
AlignmentCSCTrackSelector(const edm::ParameterSet &cfg)
constructor
Definition:
AlignmentCSCTrackSelector.cc:15
AlignmentCSCTrackSelector::m_minHitsDT
int m_minHitsDT
Definition:
AlignmentCSCTrackSelector.h:30
MuonSubdetId::DT
static constexpr int DT
Definition:
MuonSubdetId.h:11
edm::ParameterSet
Definition:
ParameterSet.h:47
Event.h
tracks
const uint32_t *__restrict__ const HitContainer *__restrict__ TkSoA *__restrict__ tracks
Definition:
CAHitNtupletGeneratorKernelsImpl.h:159
CSCDetId
Definition:
CSCDetId.h:26
createfilelist.int
int
Definition:
createfilelist.py:10
AlignmentCSCTrackSelector::~AlignmentCSCTrackSelector
~AlignmentCSCTrackSelector()
destructor
Definition:
AlignmentCSCTrackSelector.cc:25
AlignmentCSCTrackSelector::Tracks
std::vector< const reco::Track * > Tracks
Definition:
AlignmentCSCTrackSelector.h:17
looper.cfg
cfg
Definition:
looper.py:297
AlignmentCSCTrackSelector::m_minHitsPerStation
int m_minHitsPerStation
Definition:
AlignmentCSCTrackSelector.h:30
DetId.h
CSCDetId::endcap
int endcap() const
Definition:
CSCDetId.h:85
mps_fire.result
result
Definition:
mps_fire.py:311
DetId::Muon
Definition:
DetId.h:26
ParameterSet.h
CSCDetId::station
int station() const
Definition:
CSCDetId.h:79
edm::Event
Definition:
Event.h:73
AlignmentCSCTrackSelector.h
hit
Definition:
SiStripHitEffFromCalibTree.cc:88
Generated for CMSSW Reference Manual by
1.8.16