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
50d2aad9
Commit
50d2aad9
authored
9 years ago
by
Edward Brash
Committed by
Stephen A. Wood
9 years ago
Browse files
Options
Downloads
Patches
Plain Diff
Minor edits to Hall C Scaler processing code
parent
d610f241
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/THcScalerEvtHandler.cxx
+39
-19
39 additions, 19 deletions
src/THcScalerEvtHandler.cxx
src/THcScalerEvtHandler.h
+1
-0
1 addition, 0 deletions
src/THcScalerEvtHandler.h
with
40 additions
and
19 deletions
src/THcScalerEvtHandler.cxx
+
39
−
19
View file @
50d2aad9
...
...
@@ -63,7 +63,7 @@ static const UInt_t defaultDT = 4;
THcScalerEvtHandler
::
THcScalerEvtHandler
(
const
char
*
name
,
const
char
*
description
)
:
THaEvtTypeHandler
(
name
,
description
),
evcount
(
0
),
ifound
(
0
),
fNormIdx
(
-
1
),
dvars
(
0
),
fScalerTree
(
0
)
dvars
(
0
),
dvarsFirst
(
0
),
fScalerTree
(
0
)
{
rdata
=
new
UInt_t
[
MAXTEVT
];
}
...
...
@@ -147,8 +147,8 @@ Int_t THcScalerEvtHandler::Analyze(THaEvData *evdata)
ifound
=
0
;
while
(
p
<
pstop
&&
j
<
ndata
)
{
if
(
fDebugFile
)
{
*
fDebugFile
<<
"p and pstop "
<<
j
++<<
" "
<<
p
<<
" "
<<
pstop
<<
" "
<<
hex
<<*
p
<<
" "
<<
dec
<<
endl
;
if
(
fDebugFile
)
{
*
fDebugFile
<<
"p and pstop "
<<
j
++<<
" "
<<
p
<<
" "
<<
pstop
<<
" "
<<
hex
<<*
p
<<
" "
<<
dec
<<
endl
;
}
nskip
=
1
;
for
(
UInt_t
j
=
0
;
j
<
scalers
.
size
();
j
++
)
{
...
...
@@ -170,11 +170,8 @@ Int_t THcScalerEvtHandler::Analyze(THaEvData *evdata)
*
fDebugFile
<<
" Found flag = "
<<
ifound
<<
endl
;
}
// FIXME: What are the HMS and SOS headers? Are there header words?
//
// L-HRS has headers which are different from R-HRS, but both are
// event type 140 and come here. If you found no headers, it was
// the other arms event type. (The arm is fName).
// HMS has headers which are different from SOS, but both are
// event type 0 and come here. If you found no headers, return.
if
(
!
ifound
)
return
0
;
...
...
@@ -185,15 +182,28 @@ Int_t THcScalerEvtHandler::Analyze(THaEvData *evdata)
UInt_t
ivar
=
scalerloc
[
i
]
->
ivar
;
UInt_t
isca
=
scalerloc
[
i
]
->
iscaler
;
UInt_t
ichan
=
scalerloc
[
i
]
->
ichan
;
if
(
fDebugFile
)
*
fDebugFile
<<
"Debug dvars "
<<
i
<<
" "
<<
ivar
<<
" "
<<
isca
<<
" "
<<
ichan
<<
endl
;
if
((
ivar
>=
0
&&
ivar
<
scalerloc
.
size
())
&&
(
isca
>=
0
&&
isca
<
scalers
.
size
())
&&
(
ichan
>=
0
&&
ichan
<
MAXCHAN
))
{
if
(
scalerloc
[
ivar
]
->
ikind
==
ICOUNT
)
dvars
[
ivar
]
=
scalers
[
isca
]
->
GetData
(
ichan
);
if
(
scalerloc
[
ivar
]
->
ikind
==
IRATE
)
dvars
[
ivar
]
=
scalers
[
isca
]
->
GetRate
(
ichan
);
if
(
fDebugFile
)
*
fDebugFile
<<
" dvars "
<<
scalerloc
[
ivar
]
->
ikind
<<
" "
<<
dvars
[
ivar
]
<<
endl
;
}
else
{
cout
<<
"THcScalerEvtHandler:: ERROR:: incorrect index "
<<
ivar
<<
" "
<<
isca
<<
" "
<<
ichan
<<
endl
;
if
(
evcount
==
0
)
{
if
(
fDebugFile
)
*
fDebugFile
<<
"Debug dvarsFirst "
<<
i
<<
" "
<<
ivar
<<
" "
<<
isca
<<
" "
<<
ichan
<<
endl
;
if
((
ivar
>=
0
&&
ivar
<
scalerloc
.
size
())
&&
(
isca
>=
0
&&
isca
<
scalers
.
size
())
&&
(
ichan
>=
0
&&
ichan
<
MAXCHAN
))
{
if
(
scalerloc
[
ivar
]
->
ikind
==
ICOUNT
)
dvarsFirst
[
ivar
]
=
scalers
[
isca
]
->
GetData
(
ichan
);
if
(
scalerloc
[
ivar
]
->
ikind
==
IRATE
)
dvarsFirst
[
ivar
]
=
scalers
[
isca
]
->
GetRate
(
ichan
);
if
(
fDebugFile
)
*
fDebugFile
<<
" dvarsFirst "
<<
scalerloc
[
ivar
]
->
ikind
<<
" "
<<
dvarsFirst
[
ivar
]
<<
endl
;
}
else
{
cout
<<
"THcScalerEvtHandler:: ERROR:: incorrect index "
<<
ivar
<<
" "
<<
isca
<<
" "
<<
ichan
<<
endl
;
}
}
else
{
if
(
fDebugFile
)
*
fDebugFile
<<
"Debug dvars "
<<
i
<<
" "
<<
ivar
<<
" "
<<
isca
<<
" "
<<
ichan
<<
endl
;
if
((
ivar
>=
0
&&
ivar
<
scalerloc
.
size
())
&&
(
isca
>=
0
&&
isca
<
scalers
.
size
())
&&
(
ichan
>=
0
&&
ichan
<
MAXCHAN
))
{
if
(
scalerloc
[
ivar
]
->
ikind
==
ICOUNT
)
dvars
[
ivar
]
=
scalers
[
isca
]
->
GetData
(
ichan
)
-
dvarsFirst
[
ivar
];
if
(
scalerloc
[
ivar
]
->
ikind
==
IRATE
)
dvars
[
ivar
]
=
scalers
[
isca
]
->
GetRate
(
ichan
);
if
(
fDebugFile
)
*
fDebugFile
<<
" dvars "
<<
scalerloc
[
ivar
]
->
ikind
<<
" "
<<
dvars
[
ivar
]
<<
endl
;
}
else
{
cout
<<
"THcScalerEvtHandler:: ERROR:: incorrect index "
<<
ivar
<<
" "
<<
isca
<<
" "
<<
ichan
<<
endl
;
}
}
}
...
...
@@ -298,7 +308,12 @@ THaAnalysisObject::EStatus THcScalerEvtHandler::Init(const TDatime& date)
if
(
scalers
.
size
()
>
0
)
{
UInt_t
idx
=
scalers
.
size
()
-
1
;
scalers
[
idx
]
->
SetHeader
(
header
,
mask
);
if
(
clkchan
>=
0
)
scalers
[
idx
]
->
SetClock
(
defaultDT
,
clkchan
,
clkfreq
);
if
(
clkchan
>=
0
)
{
scalers
[
idx
]
->
SetClock
(
defaultDT
,
clkchan
,
clkfreq
);
cout
<<
"Setting scaler clock ... channel = "
<<
clkchan
<<
" ... freq = "
<<
clkfreq
<<
endl
;
if
(
fDebugFile
)
*
fDebugFile
<<
"Setting scaler clock ... channel = "
<<
clkchan
<<
" ... freq = "
<<
clkfreq
<<
endl
;
fNormIdx
=
idx
;
}
}
}
}
...
...
@@ -306,7 +321,8 @@ THaAnalysisObject::EStatus THcScalerEvtHandler::Init(const TDatime& date)
// can't compare UInt_t to Int_t (compiler warning), so do this
nscalers
=
0
;
for
(
UInt_t
i
=
0
;
i
<
scalers
.
size
();
i
++
)
nscalers
++
;
// need to do LoadNormScaler after scalers created and if fNormIdx found.
// need to do LoadNormScaler after scalers created and if fNormIdx found
if
(
fDebugFile
)
*
fDebugFile
<<
"fNormIdx = "
<<
fNormIdx
<<
endl
;
if
((
fNormIdx
>=
0
)
&&
fNormIdx
<
nscalers
)
{
for
(
Int_t
i
=
0
;
i
<
nscalers
;
i
++
)
{
if
(
i
==
fNormIdx
)
continue
;
...
...
@@ -391,7 +407,9 @@ void THcScalerEvtHandler::DefVars()
Nvars
=
scalerloc
.
size
();
if
(
Nvars
==
0
)
return
;
dvars
=
new
Double_t
[
Nvars
];
// dvars is a member of this class
dvarsFirst
=
new
Double_t
[
Nvars
];
// dvarsFirst is a member of this class
memset
(
dvars
,
0
,
Nvars
*
sizeof
(
Double_t
));
memset
(
dvarsFirst
,
0
,
Nvars
*
sizeof
(
Double_t
));
if
(
gHaVars
)
{
if
(
fDebugFile
)
*
fDebugFile
<<
"THcScalerEVtHandler:: Have gHaVars "
<<
gHaVars
<<
endl
;
}
else
{
...
...
@@ -403,6 +421,8 @@ void THcScalerEvtHandler::DefVars()
for
(
UInt_t
i
=
0
;
i
<
scalerloc
.
size
();
i
++
)
{
gHaVars
->
DefineByType
(
scalerloc
[
i
]
->
name
.
Data
(),
scalerloc
[
i
]
->
description
.
Data
(),
&
dvars
[
i
],
kDouble
,
count
);
//gHaVars->DefineByType(scalerloc[i]->name.Data(), scalerloc[i]->description.Data(),
// &dvarsFirst[i], kDouble, count);
}
}
...
...
This diff is collapsed.
Click to expand it.
src/THcScalerEvtHandler.h
+
1
−
0
View file @
50d2aad9
...
...
@@ -51,6 +51,7 @@ private:
std
::
vector
<
Int_t
>
index
;
Int_t
Nvars
,
ifound
,
fNormIdx
,
nscalers
;
Double_t
*
dvars
;
Double_t
*
dvarsFirst
;
TTree
*
fScalerTree
;
THcScalerEvtHandler
(
const
THcScalerEvtHandler
&
fh
);
...
...
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