Main Page
Namespaces
Classes
Package Documentation
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
(); }
LogDebug
#define LogDebug(id)
Definition:
MessageLogger.h:670
MuonSlaveSD::detector
MuonSubDetector * detector
Definition:
MuonSlaveSD.h:41
jetUpdater_cfi.sort
sort
Definition:
jetUpdater_cfi.py:29
MessageLogger.h
FormatMe0Hits::sortId
int sortId(const PSimHit &a) const
Definition:
MuonSlaveSD.cc:56
MuonSlaveSD::hits_
Collection hits_
Definition:
MuonSlaveSD.h:38
MuonSlaveSD::clearHits
virtual void clearHits()
Definition:
MuonSlaveSD.cc:16
FormatRpcHits
Definition:
MuonSlaveSD.h:58
FormatMe0Hits::operator()
bool operator()(const PSimHit &a, const PSimHit &b)
Definition:
MuonSlaveSD.cc:54
MuonSubDetector::name
std::string name()
Definition:
MuonSubDetector.cc:44
FormatBarrelHits::sortId
int sortId(const PSimHit &a) const
Definition:
MuonSlaveSD.cc:40
SimTrackManager.h
MuonSlaveSD::MuonSlaveSD
MuonSlaveSD(MuonSubDetector *, const SimTrackManager *)
Definition:
MuonSlaveSD.cc:9
MuonSlaveSD::format
bool format() override
Definition:
MuonSlaveSD.cc:21
FormatGemHits
Definition:
MuonSlaveSD.h:64
MuonSubDetector::isRPC
bool isRPC()
Definition:
MuonSubDetector.cc:32
FormatRpcHits::sortId
int sortId(const PSimHit &a) const
Definition:
MuonSlaveSD.cc:48
MuonSubDetector::isME0
bool isME0()
Definition:
MuonSubDetector.cc:40
edmIntegrityCheck.d
d
Definition:
edmIntegrityCheck.py:66
FormatEndcapHits::sortId
int sortId(const PSimHit &a) const
Definition:
MuonSlaveSD.cc:44
FormatGemHits::sortId
int sortId(const PSimHit &a) const
Definition:
MuonSlaveSD.cc:52
FormatMe0Hits
Definition:
MuonSlaveSD.h:70
FormatBarrelHits
Definition:
MuonSlaveSD.h:46
b
double b
Definition:
hdecay.h:120
MuonSlaveSD::~MuonSlaveSD
~MuonSlaveSD() override
Definition:
MuonSlaveSD.cc:14
FormatBarrelHits::operator()
bool operator()(const PSimHit &a, const PSimHit &b)
Definition:
MuonSlaveSD.cc:38
MuonSubDetector
Definition:
MuonSubDetector.h:19
a
double a
Definition:
hdecay.h:121
PSimHit
Definition:
PSimHit.h:15
MuonSubDetector::isBarrel
bool isBarrel()
Definition:
MuonSubDetector.cc:24
FormatEndcapHits
Definition:
MuonSlaveSD.h:52
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
MuonSubDetector::isGEM
bool isGEM()
Definition:
MuonSubDetector.cc:36
dataset.name
name
Definition:
dataset.py:45
TrackingSlaveSD
Definition:
TrackingSlaveSD.h:11
MuonSlaveSD.h
MuonSubDetector::isEndcap
bool isEndcap()
Definition:
MuonSubDetector.cc:28
MuonSubDetector.h
FormatEndcapHits::operator()
bool operator()(const PSimHit &a, const PSimHit &b)
Definition:
MuonSlaveSD.cc:42
PSimHit::detUnitId
unsigned int detUnitId() const
Definition:
PSimHit.h:97
SimTrackManager
Definition:
SimTrackManager.h:35
Generated for CMSSW Reference Manual by
1.8.11