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
f35d3e74
Commit
f35d3e74
authored
7 years ago
by
Mark Jones
Committed by
Stephen Wood
7 years ago
Browse files
Options
Downloads
Patches
Plain Diff
Update THcScalerEventHandler to read PARAM database
parent
d4a1953f
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
+40
-0
40 additions, 0 deletions
src/THcScalerEvtHandler.cxx
src/THcScalerEvtHandler.h
+5
-0
5 additions, 0 deletions
src/THcScalerEvtHandler.h
with
45 additions
and
0 deletions
src/THcScalerEvtHandler.cxx
+
40
−
0
View file @
f35d3e74
...
...
@@ -44,6 +44,9 @@ To enable debugging you may try this in the setup script
#include
"Scaler9250.h"
#include
"THaCodaData.h"
#include
"THaEvData.h"
#include
"THcParmList.h"
#include
"THcGlobals.h"
#include
"THaGlobals.h"
#include
"TNamed.h"
#include
"TMath.h"
#include
"TString.h"
...
...
@@ -97,6 +100,40 @@ Int_t THcScalerEvtHandler::End( THaRunBase* r)
return
0
;
}
Int_t
THcScalerEvtHandler
::
ReadDatabase
(
const
TDatime
&
date
)
{
char
prefix
[
2
];
prefix
[
0
]
=
'g'
;
prefix
[
1
]
=
'\0'
;
DBRequest
list
[]
=
{
{
"NumBCMs"
,
&
fNumBCMs
,
kInt
},
{
0
}
};
gHcParms
->
LoadParmValues
((
DBRequest
*
)
&
list
,
prefix
);
cout
<<
" NUmber of BCMs = "
<<
fNumBCMs
<<
endl
;
//
fBCM_Gain
=
new
Double_t
[
fNumBCMs
];
fBCM_Offset
=
new
Double_t
[
fNumBCMs
];
string
bcm_namelist
;
DBRequest
list2
[]
=
{
{
"BCM_Gain"
,
fBCM_Gain
,
kDouble
,
(
UInt_t
)
fNumBCMs
},
{
"BCM_Offset"
,
fBCM_Offset
,
kDouble
,(
UInt_t
)
fNumBCMs
},
{
"BCM_Names"
,
&
bcm_namelist
,
kString
},
{
0
}
};
gHcParms
->
LoadParmValues
((
DBRequest
*
)
&
list2
,
prefix
);
vector
<
string
>
bcm_names
=
vsplit
(
bcm_namelist
);
fBCM_Name
=
new
char
*
[
fNumBCMs
];
for
(
Int_t
i
=
0
;
i
<
fNumBCMs
;
i
++
)
{
fBCM_Name
[
i
]
=
new
char
[
bcm_names
[
i
].
length
()
+
1
];
strcpy
(
fBCM_Name
[
i
],
bcm_names
[
i
].
c_str
());
cout
<<
fBCM_Gain
[
i
]
<<
" "
<<
fBCM_Offset
[
i
]
<<
" "
<<
fBCM_Name
[
i
]
<<
endl
;
}
//
//
return
kOK
;
}
void
THcScalerEvtHandler
::
SetDelayedType
(
int
evtype
)
{
/**
* \brief Delay analysis of this event type to end.
...
...
@@ -123,6 +160,7 @@ Int_t THcScalerEvtHandler::Analyze(THaEvData *evdata)
if
(
lfirst
&&
!
fScalerTree
)
{
lfirst
=
0
;
// Can't do this in Init for some reason
TString
sname1
=
"TS"
;
...
...
@@ -318,6 +356,8 @@ Int_t THcScalerEvtHandler::AnalyzeBuffer(UInt_t* rdata)
THaAnalysisObject
::
EStatus
THcScalerEvtHandler
::
Init
(
const
TDatime
&
date
)
{
//
ReadDatabase
(
date
);
const
int
LEN
=
200
;
char
cbuf
[
LEN
];
...
...
This diff is collapsed.
Click to expand it.
src/THcScalerEvtHandler.h
+
5
−
0
View file @
f35d3e74
...
...
@@ -37,6 +37,7 @@ public:
Int_t
Analyze
(
THaEvData
*
evdata
);
Int_t
AnalyzeBuffer
(
UInt_t
*
rdata
);
virtual
EStatus
Init
(
const
TDatime
&
run_time
);
virtual
Int_t
ReadDatabase
(
const
TDatime
&
date
);
virtual
Int_t
End
(
THaRunBase
*
r
=
0
);
virtual
void
SetUseFirstEvent
(
Bool_t
b
=
kFALSE
)
{
fUseFirstEvent
=
b
;}
virtual
void
SetDelayedType
(
int
evtype
);
...
...
@@ -50,6 +51,10 @@ private:
std
::
vector
<
Decoder
::
GenScaler
*>
scalers
;
std
::
vector
<
HCScalerLoc
*>
scalerloc
;
Int_t
fNumBCMs
;
Double_t
*
fBCM_Gain
;
Double_t
*
fBCM_Offset
;
char
**
fBCM_Name
;
UInt_t
evcount
;
Double_t
evcountR
;
Int_t
Nvars
,
ifound
,
fNormIdx
,
nscalers
;
...
...
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