Main Page
Namespaces
Classes
Package Documentation
DataFormats
FTLRecHit
src
FTLUncalibratedRecHit.cc
Go to the documentation of this file.
1
#include "
DataFormats/FTLRecHit/interface/FTLUncalibratedRecHit.h
"
2
#include <cmath>
3
#include <limits>
4
5
FTLUncalibratedRecHit::FTLUncalibratedRecHit
() :
6
amplitude_(-1.
f
), time_(-1.
f
), timeError_(-1.
f
), id_(
DetId
()), flags_(
std
::numeric_limits<unsigned char>::
max
()) { }
7
8
FTLUncalibratedRecHit::FTLUncalibratedRecHit
(
const
DetId
&
id
,
float
ampl,
float
time
,
float
timeError
,
unsigned
char
flags
) :
9
amplitude_
(ampl),
time_
(time),
timeError_
(timeError),
id_
(id),
flags_
(flags) { }
10
11
FTLUncalibratedRecHit::~FTLUncalibratedRecHit
() {
12
}
13
14
bool
FTLUncalibratedRecHit::isSaturated
()
const
{
15
return
FTLUncalibratedRecHit::checkFlag
(
kSaturated
);
16
}
17
18
bool
FTLUncalibratedRecHit::isTimeValid
()
const
{
19
if
(
timeError
() < 0)
20
return
false
;
21
else
22
return
true
;
23
}
24
25
bool
FTLUncalibratedRecHit::isTimeErrorValid
()
const
{
26
if
(!
isTimeValid
())
27
return
false
;
28
if
(
timeError
() >= 10000)
29
return
false
;
30
31
return
true
;
32
}
33
34
void
FTLUncalibratedRecHit::setFlagBit
(
FTLUncalibratedRecHit::Flags
flag
) {
35
36
if
(flag ==
kGood
) {
37
//then set all bits to zero;
38
flags_
= 0;
39
return
;
40
}
41
// else set the flagbit
42
flags_
|= 0x1 <<
flag
;
43
}
44
45
46
bool
FTLUncalibratedRecHit::checkFlag
(
FTLUncalibratedRecHit::Flags
flag
)
const
{
47
if
(flag ==
kGood
){
if
( !
flags_
)
return
true
;
else
return
false
;}
// if all flags are unset, then hit is good
48
return
flags_
& ( 0x1<<
flag
);
49
}
FTLUncalibratedRecHit::time_
float time_
Definition:
FTLUncalibratedRecHit.h:46
FTLUncalibratedRecHit.h
FTLUncalibratedRecHit::flags_
unsigned char flags_
Definition:
FTLUncalibratedRecHit.h:49
FTLUncalibratedRecHit::isTimeErrorValid
bool isTimeErrorValid() const
Definition:
FTLUncalibratedRecHit.cc:25
FTLUncalibratedRecHit::id_
DetId id_
Definition:
FTLUncalibratedRecHit.h:48
RemoveAddSevLevel.flag
flag
Definition:
RemoveAddSevLevel.py:115
FTLUncalibratedRecHit::checkFlag
bool checkFlag(Flags flag) const
Definition:
FTLUncalibratedRecHit.cc:46
FTLUncalibratedRecHit::timeError_
float timeError_
Definition:
FTLUncalibratedRecHit.h:47
flags
std::vector< Variable::Flags > flags
Definition:
MVATrainer.cc:135
std
Definition:
JetResolutionObject.h:80
FTLUncalibratedRecHit::FTLUncalibratedRecHit
FTLUncalibratedRecHit()
Definition:
FTLUncalibratedRecHit.cc:5
FTLUncalibratedRecHit::isSaturated
bool isSaturated() const
Definition:
FTLUncalibratedRecHit.cc:14
FTLUncalibratedRecHit::timeError
float timeError() const
Definition:
FTLUncalibratedRecHit.h:27
f
double f[11][100]
Definition:
MuScleFitUtils.cc:78
SiStripPI::max
Definition:
SiStripPayloadInspectorHelper.h:178
FTLUncalibratedRecHit::time
float time() const
Definition:
FTLUncalibratedRecHit.h:25
FTLUncalibratedRecHit::kSaturated
Definition:
FTLUncalibratedRecHit.h:16
DetId
Definition:
DetId.h:18
FTLUncalibratedRecHit::kGood
Definition:
FTLUncalibratedRecHit.h:14
FTLUncalibratedRecHit::isTimeValid
bool isTimeValid() const
Definition:
FTLUncalibratedRecHit.cc:18
FTLUncalibratedRecHit::amplitude_
float amplitude_
Definition:
FTLUncalibratedRecHit.h:45
FTLUncalibratedRecHit::~FTLUncalibratedRecHit
~FTLUncalibratedRecHit()
Definition:
FTLUncalibratedRecHit.cc:11
FTLUncalibratedRecHit::setFlagBit
void setFlagBit(Flags flag)
Definition:
FTLUncalibratedRecHit.cc:34
FTLUncalibratedRecHit::Flags
Flags
Definition:
FTLUncalibratedRecHit.h:13
Generated for CMSSW Reference Manual by
1.8.11