TauAnalysis
MCEmbeddingTools
plugins
MuonDetCleaner.cc
Go to the documentation of this file.
1
#include "
TauAnalysis/MCEmbeddingTools/plugins/MuonDetCleaner.h
"
2
3
#include "
DataFormats/MuonDetId/interface/DTLayerId.h
"
4
#include "
DataFormats/DTRecHit/interface/DTSLRecCluster.h
"
5
#include "
DataFormats/DTRecHit/interface/DTRecHit1DPair.h
"
6
7
#include "
DataFormats/MuonDetId/interface/CSCDetId.h
"
8
#include "
DataFormats/CSCRecHit/interface/CSCRecHit2D.h
"
9
#include "
DataFormats/MuonDetId/interface/RPCDetId.h
"
10
#include "
DataFormats/RPCRecHit/interface/RPCRecHit.h
"
11
12
typedef
MuonDetCleaner<CSCDetId, CSCRecHit2D>
CSCRecHitColCleaner
;
13
typedef
MuonDetCleaner<DTLayerId, DTRecHit1DPair>
DTRecHitColCleaner
;
14
typedef
MuonDetCleaner<RPCDetId, RPCRecHit>
RPCRecHitColCleaner
;
15
16
//-------------------------------------------------------------------------------
17
// define 'getDetIds' functions used for different types of recHits
18
//-------------------------------------------------------------------------------
19
20
template
<
typename
T1,
typename
T2>
21
uint32_t
MuonDetCleaner<T1, T2>::getRawDetId
(
const
T2&
recHit
) {
22
assert
(0);
// CV: make sure general function never gets called;
23
// always use template specializations
24
}
25
26
template
<>
27
uint32_t
MuonDetCleaner<CSCDetId, CSCRecHit2D>::getRawDetId
(
const
CSCRecHit2D
&
recHit
) {
28
return
recHit
.cscDetId().rawId();
29
}
30
31
template
<>
32
uint32_t
MuonDetCleaner<DTLayerId, DTRecHit1DPair>::getRawDetId
(
const
DTRecHit1DPair
&
recHit
) {
33
return
recHit
.geographicalId().rawId();
34
}
35
36
template
<>
37
uint32_t
MuonDetCleaner<RPCDetId, RPCRecHit>::getRawDetId
(
const
RPCRecHit
&
recHit
) {
38
return
recHit
.rpcId().rawId();
39
}
40
41
//-------------------------------------------------------------------------------
42
// find out what the kind of RecHit used by imput muons rechit
43
//-------------------------------------------------------------------------------
44
45
template
<
typename
T1,
typename
T2>
46
bool
MuonDetCleaner<T1, T2>::checkrecHit
(
const
TrackingRecHit
&
recHit
) {
47
edm::LogError
(
"TauEmbedding"
) <<
"!!!! Please add the checkrecHit for the individual class templates "
assert
(0);
48
}
49
50
template
<>
51
bool
MuonDetCleaner<CSCDetId, CSCRecHit2D>::checkrecHit
(
const
TrackingRecHit
&
recHit
) {
52
const
std::type_info& hit_type =
typeid
(
recHit
);
53
if
(hit_type ==
typeid
(
CSCSegment
)) {
54
return
true
;
55
}
// This should be the default one (which are included in the global (outer) muon track)
56
else
if
(hit_type ==
typeid
(
CSCRecHit2D
)) {
57
return
true
;
58
}
59
//else {std::cout<<"else "<<hit_type.name()<<std::endl;}
60
return
false
;
61
}
62
63
template
<>
64
bool
MuonDetCleaner<DTLayerId, DTRecHit1DPair>::checkrecHit
(
const
TrackingRecHit
&
recHit
) {
65
const
std::type_info& hit_type =
typeid
(
recHit
);
66
if
(hit_type ==
typeid
(
DTRecSegment4D
)) {
67
return
true
;
68
}
// This should be the default one (which are included in the global (outer) muon track)
69
else
if
(hit_type ==
typeid
(
DTRecHit1D
)) {
70
return
true
;
71
}
else
if
(hit_type ==
typeid
(
DTSLRecCluster
)) {
72
return
true
;
73
}
else
if
(hit_type ==
typeid
(
DTSLRecSegment2D
)) {
74
return
true
;
75
}
76
// else {std::cout<<"else "<<hit_type.name()<<std::endl;}
77
return
false
;
78
}
79
80
template
<>
81
bool
MuonDetCleaner<RPCDetId, RPCRecHit>::checkrecHit
(
const
TrackingRecHit
&
recHit
) {
82
const
std::type_info& hit_type =
typeid
(
recHit
);
83
if
(hit_type ==
typeid
(
RPCRecHit
)) {
84
return
true
;
85
}
// This should be the default one (which are included in the global (outer) muon track)
86
//else {std::cout<<"else "<<hit_type.name()<<std::endl;}
87
return
false
;
88
}
89
90
DEFINE_FWK_MODULE
(
CSCRecHitColCleaner
);
91
DEFINE_FWK_MODULE
(
DTRecHitColCleaner
);
92
DEFINE_FWK_MODULE
(
RPCRecHitColCleaner
);
DTSLRecSegment2D
Definition:
DTSLRecSegment2D.h:15
DTRecSegment4D
Definition:
DTRecSegment4D.h:23
DTSLRecCluster
Definition:
DTSLRecCluster.h:30
DTRecHitColCleaner
MuonDetCleaner< DTLayerId, DTRecHit1DPair > DTRecHitColCleaner
Definition:
MuonDetCleaner.cc:13
DTLayerId.h
DTRecHit1D
Definition:
DTRecHit1D.h:25
cms::cuda::assert
assert(be >=bs)
rpcPointValidation_cfi.recHit
recHit
Definition:
rpcPointValidation_cfi.py:7
RPCRecHitColCleaner
MuonDetCleaner< RPCDetId, RPCRecHit > RPCRecHitColCleaner
Definition:
MuonDetCleaner.cc:14
CSCDetId.h
MuonDetCleaner
Definition:
MuonDetCleaner.h:35
DEFINE_FWK_MODULE
#define DEFINE_FWK_MODULE(type)
Definition:
MakerMacros.h:16
RPCRecHit
Definition:
RPCRecHit.h:14
DTRecHit1DPair
Definition:
DTRecHit1DPair.h:26
CSCSegment
Definition:
CSCSegment.h:21
RPCDetId.h
CSCRecHit2D
Definition:
CSCRecHit2D.h:18
edm::LogError
Definition:
MessageLogger.h:183
DTRecHit1DPair.h
TrackingRecHit
Definition:
TrackingRecHit.h:21
DTSLRecCluster.h
MuonDetCleaner::checkrecHit
bool checkrecHit(const TrackingRecHit &)
Definition:
MuonDetCleaner.cc:46
RPCRecHit.h
MuonDetCleaner.h
CSCRecHit2D.h
MuonDetCleaner::getRawDetId
uint32_t getRawDetId(const T2 &)
Definition:
MuonDetCleaner.cc:21
CSCRecHitColCleaner
MuonDetCleaner< CSCDetId, CSCRecHit2D > CSCRecHitColCleaner
Definition:
MuonDetCleaner.cc:12
Generated for CMSSW Reference Manual by
1.8.16