Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
H
hcana
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
jlab
hallc
analyzer_software
hcana
Commits
13ac3c02
Commit
13ac3c02
authored
6 years ago
by
Whitney Armstrong
Browse files
Options
Downloads
Patches
Plain Diff
THcRawAdcHit: added loggin/removed throws
- Added better logging - Removed throws modified: THcRawAdcHit.cxx
parent
4bcc8096
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/THcRawAdcHit.cxx
+36
-22
36 additions, 22 deletions
src/THcRawAdcHit.cxx
with
36 additions
and
22 deletions
src/THcRawAdcHit.cxx
+
36
−
22
View file @
13ac3c02
...
@@ -260,7 +260,8 @@ void THcRawAdcHit::SetRefTime(Int_t refTime) {
...
@@ -260,7 +260,8 @@ void THcRawAdcHit::SetRefTime(Int_t refTime) {
void
THcRawAdcHit
::
SetSample
(
Int_t
data
)
{
void
THcRawAdcHit
::
SetSample
(
Int_t
data
)
{
if
(
fNSamples
>=
fMaxNSamples
)
{
if
(
fNSamples
>=
fMaxNSamples
)
{
throw
std
::
out_of_range
(
"`THcRawAdcHit::SetSample`: too many samples!"
);
//throw std::out_of_range("`THcRawAdcHit::SetSample`: too many samples!");
_hit_logger
->
error
(
"THcRawAdcHit::SetSample: too many samples! Ignoring sample {}"
,
fNSamples
);
}
}
fSample
[
fNSamples
]
=
data
;
fSample
[
fNSamples
]
=
data
;
++
fNSamples
;
++
fNSamples
;
...
@@ -282,10 +283,12 @@ void THcRawAdcHit::SetDataTimePedestalPeak(Int_t data, Int_t time, Int_t pedesta
...
@@ -282,10 +283,12 @@ void THcRawAdcHit::SetDataTimePedestalPeak(Int_t data, Int_t time, Int_t pedesta
Int_t
THcRawAdcHit
::
GetRawData
(
UInt_t
iPulse
)
const
{
Int_t
THcRawAdcHit
::
GetRawData
(
UInt_t
iPulse
)
const
{
if
(
iPulse
>=
fNPulses
&&
iPulse
!=
0
)
{
if
(
iPulse
>=
fNPulses
&&
iPulse
!=
0
)
{
TString
msg
=
TString
::
Format
(
//TString msg = TString::Format(
"`THcRawAdcHit::GetRawData`: requested pulse %d where only %d pulses available!"
,
iPulse
,
// "`THcRawAdcHit::GetRawData`: requested pulse %d where only %d pulses available!", iPulse,
fNPulses
);
// fNPulses);
throw
std
::
out_of_range
(
msg
.
Data
());
//throw std::out_of_range(msg.Data());
_hit_logger
->
error
(
"THcRawAdcHit::GetRawData: requested pulse {} where only {} pulses available!"
,
iPulse
,
fNPulses
);
return
0
;
}
else
if
(
iPulse
>=
fNPulses
&&
iPulse
==
0
)
{
}
else
if
(
iPulse
>=
fNPulses
&&
iPulse
==
0
)
{
return
0
;
return
0
;
}
else
{
}
else
{
...
@@ -308,8 +311,10 @@ Double_t THcRawAdcHit::GetAverage(UInt_t iSampleLow, UInt_t iSampleHigh) const {
...
@@ -308,8 +311,10 @@ Double_t THcRawAdcHit::GetAverage(UInt_t iSampleLow, UInt_t iSampleHigh) const {
Int_t
THcRawAdcHit
::
GetIntegral
(
UInt_t
iSampleLow
,
UInt_t
iSampleHigh
)
const
{
Int_t
THcRawAdcHit
::
GetIntegral
(
UInt_t
iSampleLow
,
UInt_t
iSampleHigh
)
const
{
if
(
iSampleHigh
>=
fNSamples
||
iSampleLow
>=
fNSamples
)
{
if
(
iSampleHigh
>=
fNSamples
||
iSampleLow
>=
fNSamples
)
{
TString
msg
=
TString
::
Format
(
"`THcRawAdcHit::GetAverage`: not this many samples available!"
);
//TString msg = TString::Format("`THcRawAdcHit::GetAverage`: not this many samples available!");
throw
std
::
out_of_range
(
msg
.
Data
());
//throw std::out_of_range(msg.Data());
_hit_logger
->
error
(
"THcRawAdcHit::GetRawData: not this many samples available!"
);
return
0
;
}
else
{
}
else
{
Int_t
integral
=
0
;
Int_t
integral
=
0
;
for
(
UInt_t
i
=
iSampleLow
;
i
<=
iSampleHigh
;
++
i
)
{
for
(
UInt_t
i
=
iSampleLow
;
i
<=
iSampleHigh
;
++
i
)
{
...
@@ -338,10 +343,12 @@ Int_t THcRawAdcHit::GetPulseIntRaw(UInt_t iPulse) const {
...
@@ -338,10 +343,12 @@ Int_t THcRawAdcHit::GetPulseIntRaw(UInt_t iPulse) const {
}
else
if
(
iPulse
==
0
)
{
}
else
if
(
iPulse
==
0
)
{
return
0
;
return
0
;
}
else
{
}
else
{
TString
msg
=
TString
::
Format
(
//TString msg = TString::Format(
"`THcRawAdcHit::GetPulseIntRaw`: Trying to get pulse %d where only %d pulses available!"
,
// "`THcRawAdcHit::GetPulseIntRaw`: Trying to get pulse %d where only %d pulses available!",
iPulse
,
fNPulses
);
// iPulse, fNPulses);
throw
std
::
out_of_range
(
msg
.
Data
());
//throw std::out_of_range(msg.Data());
_hit_logger
->
error
(
"THcRawAdcHit::GetPulseIntRaw: Trying to get pulse {} where only {} pulses available!"
,
iPulse
,
fNPulses
);
return
0
;
}
}
}
}
...
@@ -351,10 +358,12 @@ Int_t THcRawAdcHit::GetPulseAmpRaw(UInt_t iPulse) const {
...
@@ -351,10 +358,12 @@ Int_t THcRawAdcHit::GetPulseAmpRaw(UInt_t iPulse) const {
}
else
if
(
iPulse
==
0
)
{
}
else
if
(
iPulse
==
0
)
{
return
0
;
return
0
;
}
else
{
}
else
{
TString
msg
=
TString
::
Format
(
//TString msg = TString::Format(
"`THcRawAdcHit::GetPulseAmpRaw`: Trying to get pulse %d where only %d pulses available!"
,
// "`THcRawAdcHit::GetPulseAmpRaw`: Trying to get pulse %d where only %d pulses available!",
iPulse
,
fNPulses
);
// iPulse, fNPulses);
throw
std
::
out_of_range
(
msg
.
Data
());
//throw std::out_of_range(msg.Data());
_hit_logger
->
error
(
"THcRawAdcHit::GetPulseIntRaw: Trying to get pulse {} where only {} pulses available!"
,
iPulse
,
fNPulses
);
return
0
;
}
}
}
}
...
@@ -364,10 +373,12 @@ Int_t THcRawAdcHit::GetPulseTimeRaw(UInt_t iPulse) const {
...
@@ -364,10 +373,12 @@ Int_t THcRawAdcHit::GetPulseTimeRaw(UInt_t iPulse) const {
}
else
if
(
iPulse
==
0
)
{
}
else
if
(
iPulse
==
0
)
{
return
0
;
return
0
;
}
else
{
}
else
{
TString
msg
=
TString
::
Format
(
//TString msg = TString::Format(
"`THcRawAdcHit::GetPulseTimeRaw`: Trying to get pulse %d where only %d pulses available!"
,
// "`THcRawAdcHit::GetPulseTimeRaw`: Trying to get pulse %d where only %d pulses available!",
iPulse
,
fNPulses
);
// iPulse, fNPulses);
throw
std
::
out_of_range
(
msg
.
Data
());
//throw std::out_of_range(msg.Data());
_hit_logger
->
error
(
"THcRawAdcHit::GetPulseIntRaw: Trying to get pulse {} where only {} pulses available!"
,
iPulse
,
fNPulses
);
return
0
;
}
}
}
}
...
@@ -375,10 +386,13 @@ Int_t THcRawAdcHit::GetSampleRaw(UInt_t iSample) const {
...
@@ -375,10 +386,13 @@ Int_t THcRawAdcHit::GetSampleRaw(UInt_t iSample) const {
if
(
iSample
<
fNSamples
)
{
if
(
iSample
<
fNSamples
)
{
return
fSample
[
iSample
];
return
fSample
[
iSample
];
}
else
{
}
else
{
TString
msg
=
TString
::
Format
(
//TString msg = TString::Format(
"`THcRawAdcHit::GetSampleRaw`: Trying to get sample %d where only %d samples available!"
,
// "`THcRawAdcHit::GetSampleRaw`: Trying to get sample %d where only %d samples available!",
// iSample, fNSamples);
//throw std::out_of_range(msg.Data());
_hit_logger
->
error
(
"THcRawAdcHit::GetSampleRaw: Trying to get sample {} where only {} samples available!"
,
iSample
,
fNSamples
);
iSample
,
fNSamples
);
throw
std
::
out_of_range
(
msg
.
Data
())
;
return
0
;
}
}
}
}
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment