SimG4CMS
Muon
src
MuonSlaveSD.cc
Go to the documentation of this file.
1
#include "
SimG4CMS/Muon/interface/MuonSlaveSD.h
"
2
#include "
Geometry/MuonNumbering/interface/MuonSubDetector.h
"
3
4
#include "
SimG4Core/Notification/interface/SimTrackManager.h
"
5
#include "
FWCore/MessageLogger/interface/MessageLogger.h
"
6
7
#include <iostream>
8
9
MuonSlaveSD::MuonSlaveSD
(
MuonSubDetector
*
d
,
const
SimTrackManager
* manager)
10
:
TrackingSlaveSD
(
d
->
name
()), m_trackManager(manager) {
11
detector
=
d
;
12
}
13
14
MuonSlaveSD::~MuonSlaveSD
() {}
15
16
void
MuonSlaveSD::clearHits
() {
17
LogDebug
(
"MuonSimDebug"
) <<
" MuonSlaveSD::clearHits "
<<
detector
->
name
() << std::endl;
18
hits_
.clear();
19
}
20
21
bool
MuonSlaveSD::format
() {
22
LogDebug
(
"MuonSimDebug"
) <<
" MuonSlaveSD "
<<
detector
->
name
() <<
" formatting "
<<
hits_
.size() <<
" hits."
23
<< std::endl;
24
if
(
detector
->
isBarrel
()) {
25
sort
(
hits_
.begin(),
hits_
.end(),
FormatBarrelHits
());
26
}
else
if
(
detector
->
isEndcap
()) {
27
sort
(
hits_
.begin(),
hits_
.end(),
FormatEndcapHits
());
28
}
else
if
(
detector
->
isRPC
()) {
29
sort
(
hits_
.begin(),
hits_
.end(),
FormatRpcHits
());
30
}
else
if
(
detector
->
isGEM
()) {
31
sort
(
hits_
.begin(),
hits_
.end(),
FormatGemHits
());
32
}
else
if
(
detector
->
isME0
()) {
33
sort
(
hits_
.begin(),
hits_
.end(),
FormatMe0Hits
());
34
}
35
return
true
;
36
}
37
38
bool
FormatBarrelHits::operator()
(
const
PSimHit
&
a
,
const
PSimHit
&
b
) {
return
(
sortId
(
a
) <
sortId
(
b
)); }
39
40
int
FormatBarrelHits::sortId
(
const
PSimHit
&
a
)
const
{
return
a
.detUnitId(); }
41
42
bool
FormatEndcapHits::operator()
(
const
PSimHit
&
a
,
const
PSimHit
&
b
) {
return
(
sortId
(
a
) <
sortId
(
b
)); }
43
44
int
FormatEndcapHits::sortId
(
const
PSimHit
&
a
)
const
{
return
a
.detUnitId(); }
45
46
bool
FormatRpcHits::operator()
(
const
PSimHit
&
a
,
const
PSimHit
&
b
) {
return
(
sortId
(
a
) <
sortId
(
b
)); }
47
48
int
FormatRpcHits::sortId
(
const
PSimHit
&
a
)
const
{
return
a
.detUnitId(); }
49
50
bool
FormatGemHits::operator()
(
const
PSimHit
&
a
,
const
PSimHit
&
b
) {
return
(
sortId
(
a
) <
sortId
(
b
)); }
51
52
int
FormatGemHits::sortId
(
const
PSimHit
&
a
)
const
{
return
a
.detUnitId(); }
53
54
bool
FormatMe0Hits::operator()
(
const
PSimHit
&
a
,
const
PSimHit
&
b
) {
return
(
sortId
(
a
) <
sortId
(
b
)); }
55
56
int
FormatMe0Hits::sortId
(
const
PSimHit
&
a
)
const
{
return
a
.detUnitId(); }
FormatBarrelHits::operator()
bool operator()(const PSimHit &a, const PSimHit &b)
Definition:
MuonSlaveSD.cc:38
MuonSubDetector
Definition:
MuonSubDetector.h:19
SimTrackManager
Definition:
SimTrackManager.h:35
MessageLogger.h
FormatBarrelHits
Definition:
MuonSlaveSD.h:46
FormatEndcapHits::sortId
int sortId(const PSimHit &a) const
Definition:
MuonSlaveSD.cc:44
MuonSubDetector::name
std::string name()
Definition:
MuonSubDetector.cc:31
MuonSlaveSD::MuonSlaveSD
MuonSlaveSD(MuonSubDetector *, const SimTrackManager *)
Definition:
MuonSlaveSD.cc:9
MuonSlaveSD::format
bool format() override
Definition:
MuonSlaveSD.cc:21
FormatRpcHits
Definition:
MuonSlaveSD.h:58
MuonSubDetector.h
FormatGemHits
Definition:
MuonSlaveSD.h:64
FormatMe0Hits::sortId
int sortId(const PSimHit &a) const
Definition:
MuonSlaveSD.cc:56
MuonSubDetector::isBarrel
bool isBarrel()
Definition:
MuonSubDetector.cc:21
b
double b
Definition:
hdecay.h:118
FormatEndcapHits
Definition:
MuonSlaveSD.h:52
LogDebug
#define LogDebug(id)
Definition:
MessageLogger.h:233
a
double a
Definition:
hdecay.h:119
MuonSubDetector::isME0
bool isME0()
Definition:
MuonSubDetector.cc:29
jetUpdater_cfi.sort
sort
Definition:
jetUpdater_cfi.py:29
FormatEndcapHits::operator()
bool operator()(const PSimHit &a, const PSimHit &b)
Definition:
MuonSlaveSD.cc:42
MuonSubDetector::isEndcap
bool isEndcap()
Definition:
MuonSubDetector.cc:23
MuonSubDetector::isRPC
bool isRPC()
Definition:
MuonSubDetector.cc:25
TrackingSlaveSD
Definition:
TrackingSlaveSD.h:11
FormatMe0Hits
Definition:
MuonSlaveSD.h:70
MuonSubDetector::isGEM
bool isGEM()
Definition:
MuonSubDetector.cc:27
FormatMe0Hits::operator()
bool operator()(const PSimHit &a, const PSimHit &b)
Definition:
MuonSlaveSD.cc:54
SimTrackManager.h
Skims_PA_cff.name
name
Definition:
Skims_PA_cff.py:17
MuonSlaveSD::hits_
Collection hits_
Definition:
MuonSlaveSD.h:38
FormatBarrelHits::sortId
int sortId(const PSimHit &a) const
Definition:
MuonSlaveSD.cc:40
FormatGemHits::sortId
int sortId(const PSimHit &a) const
Definition:
MuonSlaveSD.cc:52
MuonSlaveSD::detector
MuonSubDetector * detector
Definition:
MuonSlaveSD.h:41
ztail.d
d
Definition:
ztail.py:151
PSimHit
Definition:
PSimHit.h:15
FormatRpcHits::sortId
int sortId(const PSimHit &a) const
Definition:
MuonSlaveSD.cc:48
FormatRpcHits::operator()
bool operator()(const PSimHit &a, const PSimHit &b)
Definition:
MuonSlaveSD.cc:46
FormatGemHits::operator()
bool operator()(const PSimHit &a, const PSimHit &b)
Definition:
MuonSlaveSD.cc:50
MuonSlaveSD::clearHits
virtual void clearHits()
Definition:
MuonSlaveSD.cc:16
MuonSlaveSD.h
MuonSlaveSD::~MuonSlaveSD
~MuonSlaveSD() override
Definition:
MuonSlaveSD.cc:14
Generated for CMSSW Reference Manual by
1.8.16