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
}
37
38
return
true
;
39
}
40
41
42
bool
FormatBarrelHits::operator()
(
const
PSimHit
&
a
,
const
PSimHit
&
b
)
43
{
44
return
(
sortId
(a)<
sortId
(b));
45
}
46
47
int
FormatBarrelHits::sortId
(
const
PSimHit
&
a
)
const
48
{
49
return
a.
detUnitId
();
50
}
51
52
bool
FormatEndcapHits::operator()
(
const
PSimHit
&
a
,
const
PSimHit
&
b
)
53
{
54
return
(
sortId
(a)<
sortId
(b));
55
}
56
57
int
FormatEndcapHits::sortId
(
const
PSimHit
&
a
)
const
58
{
59
return
a.
detUnitId
();
60
}
61
62
bool
FormatRpcHits::operator()
(
const
PSimHit
&
a
,
const
PSimHit
&
b
)
63
{
64
return
(
sortId
(a)<
sortId
(b));
65
}
66
67
int
FormatRpcHits::sortId
(
const
PSimHit
&
a
)
const
68
{
69
return
a.
detUnitId
();
70
}
71
LogDebug
#define LogDebug(id)
Definition:
MessageLogger.h:501
MuonSlaveSD::detector
MuonSubDetector * detector
Definition:
MuonSlaveSD.h:44
MessageLogger.h
MuonSlaveSD::hits_
Collection hits_
Definition:
MuonSlaveSD.h:41
MuonSlaveSD::clearHits
virtual void clearHits()
Definition:
MuonSlaveSD.cc:21
FormatRpcHits
Definition:
MuonSlaveSD.h:62
MuonSubDetector::isRpc
bool isRpc()
Definition:
MuonSubDetector.cc:28
python.multivaluedict.sort
def sort
Definition:
multivaluedict.py:161
MuonSubDetector::name
std::string name()
Definition:
MuonSubDetector.cc:32
FormatBarrelHits::sortId
int sortId(const PSimHit &a) const
Definition:
MuonSlaveSD.cc:47
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
FormatRpcHits::sortId
int sortId(const PSimHit &a) const
Definition:
MuonSlaveSD.cc:67
FormatEndcapHits::sortId
int sortId(const PSimHit &a) const
Definition:
MuonSlaveSD.cc:57
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:42
MuonSubDetector
Definition:
MuonSubDetector.h:21
a
double a
Definition:
hdecay.h:121
PSimHit
Definition:
PSimHit.h:15
MuonSubDetector::isBarrel
bool isBarrel()
Definition:
MuonSubDetector.cc:20
FormatEndcapHits
Definition:
MuonSlaveSD.h:56
FormatRpcHits::operator()
bool operator()(const PSimHit &a, const PSimHit &b)
Definition:
MuonSlaveSD.cc:62
TrackingSlaveSD
Definition:
TrackingSlaveSD.h:11
MuonSlaveSD.h
MuonSubDetector::isEndcap
bool isEndcap()
Definition:
MuonSubDetector.cc:24
MuonSubDetector.h
FormatEndcapHits::operator()
bool operator()(const PSimHit &a, const PSimHit &b)
Definition:
MuonSlaveSD.cc:52
PSimHit::detUnitId
unsigned int detUnitId() const
Definition:
PSimHit.h:93
SimTrackManager
Definition:
SimTrackManager.h:35
Generated for CMSSW Reference Manual by
1.8.5