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
cd9cc78c
Commit
cd9cc78c
authored
5 years ago
by
Chao Peng
Browse files
Options
Downloads
Patches
Plain Diff
Merge Steve's Helicity Scaler code into the repo
parent
6246cbfb
No related branches found
No related tags found
No related merge requests found
Changes
3
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
src/THcHelicity.cxx
+2
-0
2 additions, 0 deletions
src/THcHelicity.cxx
src/THcHelicityScaler.cxx
+379
-143
379 additions, 143 deletions
src/THcHelicityScaler.cxx
src/THcHelicityScaler.h
+60
-44
60 additions, 44 deletions
src/THcHelicityScaler.h
with
441 additions
and
187 deletions
src/THcHelicity.cxx
+
2
−
0
View file @
cd9cc78c
...
@@ -270,6 +270,7 @@ Int_t THcHelicity::Decode(const THaEvData& evdata) {
...
@@ -270,6 +270,7 @@ Int_t THcHelicity::Decode(const THaEvData& evdata) {
fMPS
=
fIsMPS
?
1
:
0
;
fMPS
=
fIsMPS
?
1
:
0
;
fQrt
=
fIsQrt
?
1
:
0
;
// Last of quartet
fQrt
=
fIsQrt
?
1
:
0
;
// Last of quartet
#if 0
if (fglHelicityScaler) {
if (fglHelicityScaler) {
Int_t nhelev = fglHelicityScaler->GetNevents();
Int_t nhelev = fglHelicityScaler->GetNevents();
Int_t ncycles = fglHelicityScaler->GetNcycles();
Int_t ncycles = fglHelicityScaler->GetNcycles();
...
@@ -303,6 +304,7 @@ Int_t THcHelicity::Decode(const THaEvData& evdata) {
...
@@ -303,6 +304,7 @@ Int_t THcHelicity::Decode(const THaEvData& evdata) {
}
}
}
}
}
}
#endif
if
(
fHelDelay
==
0
)
{
// If no delay actual=reported (but zero if in MPS)
if
(
fHelDelay
==
0
)
{
// If no delay actual=reported (but zero if in MPS)
fActualHelicity
=
fIsMPS
?
kUnknown
:
fReportedHelicity
;
fActualHelicity
=
fIsMPS
?
kUnknown
:
fReportedHelicity
;
...
...
This diff is collapsed.
Click to expand it.
src/THcHelicityScaler.cxx
+
379
−
143
View file @
cd9cc78c
This diff is collapsed.
Click to expand it.
src/THcHelicityScaler.h
+
60
−
44
View file @
cd9cc78c
...
@@ -8,78 +8,94 @@
...
@@ -8,78 +8,94 @@
//
//
/////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////
#include
"Decoder.h"
#include
"THaEvtTypeHandler.h"
#include
"THaEvtTypeHandler.h"
#include
"TString.h"
#include
"Decoder.h"
#include
"TTree.h"
#include
<algorithm>
#include
<cstring>
#include
<set>
#include
<string>
#include
<string>
#include
<vector>
#include
<vector>
#include
<algorithm>
#include
<set>
#include
"TTree.h"
#include
"TString.h"
#include
<cstring>
class
THcHelicity
;
class
THcHelicity
;
class
THcHelicityScaler
:
public
THaEvtTypeHandler
{
class
THcHelicityScaler
:
public
THaEvtTypeHandler
{
public:
public:
THcHelicityScaler
(
const
char
*
,
const
char
*
);
THcHelicityScaler
(
const
char
*
,
const
char
*
);
virtual
~
THcHelicityScaler
();
virtual
~
THcHelicityScaler
();
Int_t
Analyze
(
THaEvData
*
evdata
);
Int_t
Analyze
(
THaEvData
*
evdata
);
Int_t
AnalyzeBuffer
(
UInt_t
*
rdata
,
Bool_t
onlysync
);
Int_t
AnalyzeBuffer
(
UInt_t
*
rdata
);
Int_t
AnalyzeHelicityScaler
(
UInt_t
*
p
);
Int_t
AnalyzeHelicityScaler
(
UInt_t
*
p
);
virtual
EStatus
Init
(
const
TDatime
&
run_time
);
virtual
EStatus
Init
(
const
TDatime
&
run_time
);
virtual
Int_t
ReadDatabase
(
const
TDatime
&
date
);
virtual
Int_t
ReadDatabase
(
const
TDatime
&
date
);
virtual
Int_t
End
(
THaRunBase
*
r
=
0
);
virtual
Int_t
End
(
THaRunBase
*
r
=
0
);
virtual
void
SetUseFirstEvent
(
Bool_t
b
=
kFALSE
)
{
fUseFirstEvent
=
b
;
}
virtual
void
SetUseFirstEvent
(
Bool_t
b
=
kFALSE
)
{
fUseFirstEvent
=
b
;}
virtual
void
SetDelayedType
(
int
evtype
);
virtual
void
SetDelayedType
(
int
evtype
);
virtual
void
SetROC
(
Int_t
roc
)
{
fROC
=
roc
;
}
virtual
void
SetROC
(
Int_t
roc
)
{
fROC
=
roc
;}
virtual
void
SetBankID
(
Int_t
bankid
)
{
fBankID
=
bankid
;
}
virtual
void
SetBankID
(
Int_t
bankid
)
{
fBankID
=
bankid
;}
virtual
void
SetHelicityDetector
(
THcHelicity
*
f
)
{
fglHelicityDetector
=
f
;
}
virtual
void
SetNScalerChannels
(
Int_t
n
)
{
fNScalerChannels
=
n
;}
virtual
Int_t
GetNevents
()
{
return
fNevents
;
}
virtual
Int_t
GetNevents
()
{
return
fNTrigsInBuf
;}
virtual
Int_t
GetNcycles
()
{
return
fNcycles
;
}
virtual
Int_t
GetNcycles
()
{
return
fNTriggers
;}
virtual
Int_t
GetEvNum
()
{
return
evNumber
;
}
virtual
Int_t
GetEvNum
()
{
return
evNumber
;}
virtual
Int_t
*
GetHelicityHistoryP
()
{
return
fHelicityHistory
;
}
virtual
Int_t
*
GetHelicityHistoryP
()
{
return
fHelicityHistory
;}
virtual
Int_t
GetReportedSeed
()
{
return
fRingSeed_reported
;}
virtual
Int_t
GetReportedActual
()
{
return
fRingSeed_actual
;}
virtual
Bool_t
IsSeedGood
()
{
return
fNBits
>=
30
;}
private
:
private
:
static
size_t
FindNoCase
(
const
std
::
string
&
sdata
,
const
std
::
string
&
skey
);
Int_t
fNumBCMs
;
Int_t
RanBit30
(
Int_t
ranseed
);
Double_t
*
fBCM_Gain
;
void
MakeParms
();
Double_t
*
fBCM_Offset
;
Double_t
*
fBCM_delta_charge
;
Int_t
fROC
;
UInt_t
fBankID
;
UInt_t
fBankID
;
// Helicity Scaler variables
// Helicity Scaler variables
Int_t
fNevents
;
/* # of helicity scaler reads in last event */
Int_t
fNTrigsInBuf
;
/* # of helicity scaler reads in last event */
Int_t
fNcycles
;
Int_t
fNTriggers
;
Int_t
fFirstCycle
;
Int_t
fHelicityHistory
[
200
];
Int_t
fHelicityHistory
[
200
];
//
//
Bool_t
fUseFirstEvent
;
Bool_t
fUseFirstEvent
;
Bool_t
fOnlySyncEvents
;
Int_t
fDelayedType
;
Bool_t
fOnlyBanks
;
Int_t
fDelayedType
;
Int_t
fRingSeed_reported
;
Int_t
fClockChan
;
Int_t
fRingSeed_actual
;
UInt_t
fLastClock
;
Int_t
fNBits
;
Int_t
fClockOverflows
;
Int_t
fNTriggersPlus
;
Int_t
fNTriggersMinus
;
Double_t
*
fHScalers
[
2
];
Int_t
fGateCount
[
2
];
Double_t
*
fScalerSums
;
Double_t
*
fAsymmetry
;
Double_t
*
fAsymmetryError
;
Double_t
*
fCharge
;
Double_t
*
fChargeAsymmetry
;
Double_t
fTime
;
Double_t
fTimeAsymmetry
;
Double_t
fTriggerAsymmetry
;
std
::
vector
<
UInt_t
*>
fDelayedEvents
;
std
::
vector
<
UInt_t
*>
fDelayedEvents
;
std
::
set
<
UInt_t
>
fRocSet
;
Int_t
fROC
;
Int_t
fNScalerChannels
;
// Number of scaler channels/event
Int_t
fNumBCMs
;
Double_t
*
fBCM_Gain
;
Double_t
*
fBCM_Offset
;
std
::
vector
<
std
::
string
>
fBCM_Name
;
THcHelicityScaler
(
const
THcHelicityScaler
&
fh
);
THcHelicityScaler
(
const
THcHelicityScaler
&
fh
);
THcHelicityScaler
&
operator
=
(
const
THcHelicityScaler
&
fh
);
THcHelicityScaler
&
operator
=
(
const
THcHelicityScaler
&
fh
);
UInt_t
evcount
;
UInt_t
evNumber
;
Double_t
evcountR
;
UInt_t
evNumber
;
ClassDef
(
THcHelicityScaler
,
0
)
// Scaler Event handler
Int_t
ifound
;
THcHelicity
*
fglHelicityDetector
;
ClassDef
(
THcHelicityScaler
,
0
)
// Scaler Event handler
};
};
#endif
#endif
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