SimG4CMS
Calo
src
CaloHitID.cc
Go to the documentation of this file.
1
// File: CaloHitID.cc
3
// Description: Identifier for a calorimetric hit
5
#include "
SimG4CMS/Calo/interface/CaloHitID.h
"
6
7
#include <iomanip>
8
9
CaloHitID::CaloHitID
(uint32_t unitID,
double
timeSlice
,
int
trackID, uint16_t
depth
,
float
tSlice,
bool
ignoreTkID)
10
: timeSliceUnit(tSlice), ignoreTrackID(ignoreTkID) {
11
setID
(
unitID
,
timeSlice
,
trackID
,
depth
);
12
}
13
14
CaloHitID::CaloHitID
(
float
tSlice,
bool
ignoreTkID) : timeSliceUnit(tSlice), ignoreTrackID(ignoreTkID) {
reset
(); }
15
16
CaloHitID::CaloHitID
(
const
CaloHitID
&
id
) {
17
theUnitID
=
id
.theUnitID;
18
theTimeSlice
=
id
.theTimeSlice;
19
theTrackID
=
id
.theTrackID;
20
theTimeSliceID
=
id
.theTimeSliceID;
21
theDepth
=
id
.theDepth;
22
timeSliceUnit
=
id
.timeSliceUnit;
23
ignoreTrackID
=
id
.ignoreTrackID;
24
}
25
26
const
CaloHitID
&
CaloHitID::operator=
(
const
CaloHitID
&
id
) {
27
theUnitID
=
id
.theUnitID;
28
theTimeSlice
=
id
.theTimeSlice;
29
theTrackID
=
id
.theTrackID;
30
theTimeSliceID
=
id
.theTimeSliceID;
31
theDepth
=
id
.theDepth;
32
timeSliceUnit
=
id
.timeSliceUnit;
33
ignoreTrackID
=
id
.ignoreTrackID;
34
35
return
*
this
;
36
}
37
38
CaloHitID::~CaloHitID
() {}
39
40
void
CaloHitID::setID
(uint32_t unitID,
double
timeSlice
,
int
trackID, uint16_t
depth
) {
41
theUnitID
=
unitID
;
42
theTimeSlice
=
timeSlice
;
43
theTrackID
=
trackID
;
44
theTimeSliceID
= (
int
)(
theTimeSlice
/
timeSliceUnit
);
45
theDepth
=
depth
;
46
}
47
48
void
CaloHitID::reset
() {
49
theUnitID
= 0;
50
theTimeSlice
= -2 *
timeSliceUnit
;
51
theTrackID
= -2;
52
theTimeSliceID
= (
int
)(
theTimeSlice
/
timeSliceUnit
);
53
theDepth
= 0;
54
}
55
56
bool
CaloHitID::operator==
(
const
CaloHitID
&
id
)
const
{
57
return
((
theUnitID
==
id
.
unitID
()) && (
theTrackID
==
id
.
trackID
() ||
ignoreTrackID
) &&
58
(
theTimeSliceID
==
id
.
timeSliceID
()) && (
theDepth
==
id
.
depth
()))
59
?
true
60
:
false
;
61
}
62
63
bool
CaloHitID::operator<
(
const
CaloHitID
&
id
)
const
{
64
if
(
theTrackID
!=
id
.
trackID
()) {
65
return
(
theTrackID
>
id
.
trackID
());
66
}
else
if
(
theUnitID
!=
id
.
unitID
()) {
67
return
(
theUnitID
>
id
.
unitID
());
68
}
else
if
(
theDepth
!=
id
.
depth
()) {
69
return
(
theDepth
>
id
.
depth
());
70
}
else
{
71
return
(
theTimeSliceID
>
id
.
timeSliceID
());
72
}
73
}
74
75
bool
CaloHitID::operator>
(
const
CaloHitID
&
id
)
const
{
76
if
(
theTrackID
!=
id
.
trackID
()) {
77
return
(
theTrackID
<
id
.
trackID
());
78
}
else
if
(
theUnitID
!=
id
.
unitID
()) {
79
return
(
theUnitID
<
id
.
unitID
());
80
}
else
if
(
theDepth
!=
id
.
depth
()) {
81
return
(
theDepth
<
id
.
depth
());
82
}
else
{
83
return
(
theTimeSliceID
<
id
.
timeSliceID
());
84
}
85
}
86
87
std::ostream&
operator<<
(std::ostream& os,
const
CaloHitID
&
id
) {
88
os <<
"UnitID 0x"
<< std::hex <<
id
.unitID() <<
std::dec
<<
" Depth "
<< std::setw(6) <<
id
.depth() <<
" Time "
89
<< std::setw(6) <<
id
.timeSlice() <<
" TrackID "
<< std::setw(8) <<
id
.trackID();
90
return
os;
91
}
CaloHitID::operator=
const CaloHitID & operator=(const CaloHitID &)
Definition:
CaloHitID.cc:26
CaloHitID::depth
uint16_t depth() const
Definition:
CaloHitID.h:24
CaloHitID::operator>
bool operator>(const CaloHitID &) const
Definition:
CaloHitID.cc:75
CaloHitID::theDepth
uint16_t theDepth
Definition:
CaloHitID.h:37
CaloHitID::operator<
bool operator<(const CaloHitID &) const
Definition:
CaloHitID.cc:63
CaloHitID::trackID
int trackID() const
Definition:
CaloHitID.h:23
CaloHitID.h
CaloHitID::unitID
uint32_t unitID() const
Definition:
CaloHitID.h:20
CaloHitID::timeSliceUnit
float timeSliceUnit
Definition:
CaloHitID.h:38
CaloHitID::setID
void setID(uint32_t unitID, double timeSlice, int trackID, uint16_t depth=0)
Definition:
CaloHitID.cc:40
CaloHitID::timeSlice
double timeSlice() const
Definition:
CaloHitID.h:22
LEDCalibrationChannels.depth
depth
Definition:
LEDCalibrationChannels.py:65
CaloHitID::~CaloHitID
virtual ~CaloHitID()
Definition:
CaloHitID.cc:38
funct::true
true
Definition:
Factorize.h:173
CaloHitID::theTimeSlice
double theTimeSlice
Definition:
CaloHitID.h:34
CaloHitID::theTrackID
int theTrackID
Definition:
CaloHitID.h:35
CaloHitID::theTimeSliceID
int theTimeSliceID
Definition:
CaloHitID.h:36
createfilelist.int
int
Definition:
createfilelist.py:10
CaloHitID::ignoreTrackID
bool ignoreTrackID
Definition:
CaloHitID.h:39
CaloHitID::operator==
bool operator==(const CaloHitID &) const
Definition:
CaloHitID.cc:56
operator<<
std::ostream & operator<<(std::ostream &os, const CaloHitID &id)
Definition:
CaloHitID.cc:87
CaloHitID::timeSliceID
int timeSliceID() const
Definition:
CaloHitID.h:21
CaloHitID::reset
void reset()
Definition:
CaloHitID.cc:48
CaloHitID
Definition:
CaloHitID.h:11
cscdqm::timeSlice
CSCCFEBTimeSlice const *const timeSlice(T const &data, int nCFEB, int nSample)
Definition:
CSCDQM_EventProcessor_processCSC.cc:29
CaloHitID::CaloHitID
CaloHitID(uint32_t unitID, double timeSlice, int trackID, uint16_t depth=0, float tSlice=1, bool ignoreTkID=false)
Definition:
CaloHitID.cc:9
TauDecayModes.dec
dec
Definition:
TauDecayModes.py:143
CaloHitID::theUnitID
uint32_t theUnitID
Definition:
CaloHitID.h:33
Generated for CMSSW Reference Manual by
1.8.16