Main Page
Namespaces
Classes
Package Documentation
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Properties
Friends
Macros
Pages
src
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/Application/interface/SimTrackManager.h
"
5
#include "
FWCore/MessageLogger/interface/MessageLogger.h
"
6
7
#include <iostream>
8
9
10
MuonSlaveSD::MuonSlaveSD
(
MuonSubDetector
* d,
11
const
SimTrackManager
* manager):
12
TrackingSlaveSD
(d->
name
() ), m_trackManager(manager)
13
{
14
detector
=d;
15
16
}
17
18
MuonSlaveSD::~MuonSlaveSD
() {
19
}
20
21
void
MuonSlaveSD::clearHits
()
22
{
23
LogDebug
(
"MuonSimDebug"
) <<
" MuonSlaveSD::clearHits "
<<
detector
->
name
() << std::endl;
24
hits_
.clear();
25
}
26
27
bool
MuonSlaveSD::format
()
28
{
29
LogDebug
(
"MuonSimDebug"
) <<
" MuonSlaveSD "
<<
detector
->
name
()<<
" formatting "
<<
hits_
.size() <<
" hits."
<< std::endl;
30
if
(
detector
->
isBarrel
()) {
31
sort
(
hits_
.begin(),
hits_
.end(),
FormatBarrelHits
());
32
}
else
if
(
detector
->
isEndcap
()) {
33
sort
(
hits_
.begin(),
hits_
.end(),
FormatEndcapHits
());
34
}
else
if
(
detector
->
isRPC
()) {
35
sort
(
hits_
.begin(),
hits_
.end(),
FormatRpcHits
());
36
}
else
if
(
detector
->
isGEM
()) {
37
sort
(
hits_
.begin(),
hits_
.end(),
FormatGemHits
());
38
}
else
if
(
detector
->
isME0
()) {
39
sort
(
hits_
.begin(),
hits_
.end(),
FormatMe0Hits
());
40
}
41
return
true
;
42
}
43
44
45
bool
FormatBarrelHits::operator()
(
const
PSimHit
&
a
,
const
PSimHit
&
b
)
46
{
47
return
(
sortId
(a)<
sortId
(b));
48
}
49
50
int
FormatBarrelHits::sortId
(
const
PSimHit
&
a
)
const
51
{
52
return
a.
detUnitId
();
53
}
54
55
bool
FormatEndcapHits::operator()
(
const
PSimHit
&
a
,
const
PSimHit
&
b
)
56
{
57
return
(
sortId
(a)<
sortId
(b));
58
}
59
60
int
FormatEndcapHits::sortId
(
const
PSimHit
&
a
)
const
61
{
62
return
a.
detUnitId
();
63
}
64
65
bool
FormatRpcHits::operator()
(
const
PSimHit
&
a
,
const
PSimHit
&
b
)
66
{
67
return
(
sortId
(a)<
sortId
(b));
68
}
69
70
int
FormatRpcHits::sortId
(
const
PSimHit
&
a
)
const
71
{
72
return
a.
detUnitId
();
73
}
74
75
bool
FormatGemHits::operator()
(
const
PSimHit
&
a
,
const
PSimHit
&
b
)
76
{
77
return
(
sortId
(a)<
sortId
(b));
78
}
79
80
int
FormatGemHits::sortId
(
const
PSimHit
&
a
)
const
81
{
82
return
a.
detUnitId
();
83
}
84
85
86
bool
FormatMe0Hits::operator()
(
const
PSimHit
&
a
,
const
PSimHit
&
b
)
87
{
88
return
(
sortId
(a)<
sortId
(b));
89
}
90
91
int
FormatMe0Hits::sortId
(
const
PSimHit
&
a
)
const
92
{
93
return
a.
detUnitId
();
94
}
LogDebug
#define LogDebug(id)
Definition:
MessageLogger.h:501
MuonSlaveSD::detector
MuonSubDetector * detector
Definition:
MuonSlaveSD.h:44
MessageLogger.h
FormatMe0Hits::sortId
int sortId(const PSimHit &a) const
Definition:
MuonSlaveSD.cc:91
MuonSlaveSD::hits_
Collection hits_
Definition:
MuonSlaveSD.h:41
MuonSlaveSD::clearHits
virtual void clearHits()
Definition:
MuonSlaveSD.cc:21
FormatRpcHits
Definition:
MuonSlaveSD.h:62
python.multivaluedict.sort
def sort
Definition:
multivaluedict.py:161
FormatMe0Hits::operator()
bool operator()(const PSimHit &a, const PSimHit &b)
Definition:
MuonSlaveSD.cc:86
MuonSubDetector::name
std::string name()
Definition:
MuonSubDetector.cc:44
FormatBarrelHits::sortId
int sortId(const PSimHit &a) const
Definition:
MuonSlaveSD.cc:50
mergeVDriftHistosByStation.name
string name
Definition:
mergeVDriftHistosByStation.py:77
MuonSlaveSD::~MuonSlaveSD
virtual ~MuonSlaveSD()
Definition:
MuonSlaveSD.cc:18
SimTrackManager.h
MuonSlaveSD::MuonSlaveSD
MuonSlaveSD(MuonSubDetector *, const SimTrackManager *)
Definition:
MuonSlaveSD.cc:10
MuonSlaveSD::format
virtual bool format()
Definition:
MuonSlaveSD.cc:27
FormatGemHits
Definition:
MuonSlaveSD.h:68
MuonSubDetector::isRPC
bool isRPC()
Definition:
MuonSubDetector.cc:32
FormatRpcHits::sortId
int sortId(const PSimHit &a) const
Definition:
MuonSlaveSD.cc:70
MuonSubDetector::isME0
bool isME0()
Definition:
MuonSubDetector.cc:40
FormatEndcapHits::sortId
int sortId(const PSimHit &a) const
Definition:
MuonSlaveSD.cc:60
FormatGemHits::sortId
int sortId(const PSimHit &a) const
Definition:
MuonSlaveSD.cc:80
FormatMe0Hits
Definition:
MuonSlaveSD.h:74
FormatBarrelHits
Definition:
MuonSlaveSD.h:50
b
double b
Definition:
hdecay.h:120
FormatBarrelHits::operator()
bool operator()(const PSimHit &a, const PSimHit &b)
Definition:
MuonSlaveSD.cc:45
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:56
FormatRpcHits::operator()
bool operator()(const PSimHit &a, const PSimHit &b)
Definition:
MuonSlaveSD.cc:65
FormatGemHits::operator()
bool operator()(const PSimHit &a, const PSimHit &b)
Definition:
MuonSlaveSD.cc:75
MuonSubDetector::isGEM
bool isGEM()
Definition:
MuonSubDetector.cc:36
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:55
PSimHit::detUnitId
unsigned int detUnitId() const
Definition:
PSimHit.h:93
SimTrackManager
Definition:
SimTrackManager.h:34
Generated for CMSSW Reference Manual by
1.8.5