Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
H
hcana
Manage
Activity
Members
Labels
Plan
Issues
0
Issue boards
Milestones
Wiki
Code
Merge requests
0
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
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
Whitney Armstrong
hcana
Commits
b4acaf19
Commit
b4acaf19
authored
5 years ago
by
Sylvester Joosten
Browse files
Options
Downloads
Plain Diff
Merged in upstream changes to helicity
parents
495a0a21
beae6df7
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
src/THcHelicity.cxx
+13
-14
13 additions, 14 deletions
src/THcHelicity.cxx
src/THcHelicity.h
+1
-1
1 addition, 1 deletion
src/THcHelicity.h
src/THcHelicityReader.cxx
+16
-2
16 additions, 2 deletions
src/THcHelicityReader.cxx
src/THcHelicityScaler.cxx
+2
-2
2 additions, 2 deletions
src/THcHelicityScaler.cxx
with
32 additions
and
19 deletions
src/THcHelicity.cxx
+
13
−
14
View file @
b4acaf19
...
...
@@ -35,7 +35,7 @@ THcHelicity::THcHelicity(const char* name, const char* description, THaApparatus
}
//_____________________________________________________________________________
THcHelicity
::
THcHelicity
()
:
THaHelicityDet
(),
fnQrt
(
-
1
),
fHelDelay
(
8
),
fMAXBIT
(
30
)
{
THcHelicity
::
THcHelicity
()
:
fnQrt
(
-
1
),
fHelDelay
(
8
),
fMAXBIT
(
30
)
{
// Default constructor for ROOT I/O
// for( Int_t i = 0; i < NHIST; ++i )
...
...
@@ -88,6 +88,9 @@ THaAnalysisObject::EStatus THcHelicity::Init(const TDatime& date) {
fPeriodCheck
=
0.0
;
fCycle
=
0.0
;
fglHelicityScaler
=
0
;
fHelicityHistory
=
0
;
fStatus
=
kOK
;
return
fStatus
;
}
...
...
@@ -104,7 +107,6 @@ void THcHelicity::Setup(const char* name, const char* description) {
Int_t
THcHelicity
::
ReadDatabase
(
const
TDatime
&
date
)
{
_logger
->
info
(
"In THcHelicity::ReadDatabase"
);
// cout << "In THcHelicity::ReadDatabase" << endl;
// Read general HelicityDet database values (e.g. fSign)
// Int_t st = THaHelicityDet::ReadDatabase( date );
// if( st != kOK )
...
...
@@ -155,8 +157,6 @@ Int_t THcHelicity::ReadDatabase(const TDatime& date) {
_logger
->
info
(
"Helicity decoder initialized with frequency of {} Hz and reporting delay of {} cycles."
,
fFreq
,
fHelDelay
);
// cout << "Helicity decoder initialized with frequency of " << fFreq
// << " Hz and reporting delay of " << fHelDelay << " cycles." << endl;
return
kOK
;
}
...
...
@@ -273,7 +273,6 @@ Int_t THcHelicity::Decode(const THaEvData& evdata) {
if
(
fglHelicityScaler
)
{
Int_t
nhelev
=
fglHelicityScaler
->
GetNevents
();
Int_t
ncycles
=
fglHelicityScaler
->
GetNcycles
();
if
(
nhelev
>
0
)
{
for
(
Int_t
i
=
0
;
i
<
nhelev
;
i
++
)
{
fScaleQuartet
=
(
fHelicityHistory
[
i
]
&
2
)
!=
0
;
...
...
@@ -490,16 +489,16 @@ Int_t THcHelicity::Decode(const THaEvData& evdata) {
}
else
{
if
(
fNCycle
-
fFirstCycle
>
4
)
{
// Not at start of run. Reset
_logger
->
warn
(
"Lost quarted sync at cycle {}"
,
fNCycle
);
//
cout << fQuartet[0] << " " << fQuartet[1] << " " << fQuartet[2] << " "
//
<< fQuartet[3] << endl;
cout
<<
fQuartet
[
0
]
<<
" "
<<
fQuartet
[
1
]
<<
" "
<<
fQuartet
[
2
]
<<
" "
<<
fQuartet
[
3
]
<<
endl
;
fFirstCycle
+=
4
*
((
fNCycle
-
fFirstCycle
)
/
4
);
// Update, but don't change phase
}
fFoundQuartet
=
kFALSE
;
fNBits
=
0
;
_logger
->
info
(
"Searching for first of a quaret at cycle {}"
,
fFirstCycle
);
//
cout << fQuartet[0] << " " << fQuartet[1] << " " << fQuartet[2] << " "
//
<< fQuartet[3] << endl;
cout
<<
fQuartet
[
0
]
<<
" "
<<
fQuartet
[
1
]
<<
" "
<<
fQuartet
[
2
]
<<
" "
<<
fQuartet
[
3
]
<<
endl
;
fFirstCycle
++
;
}
}
else
{
...
...
@@ -522,11 +521,11 @@ Int_t THcHelicity::Decode(const THaEvData& evdata) {
// << fPredictedHelicity << " " << fActualHelicity << endl;
}
// Ignore until a MPS Is found
}
else
{
// No MPS found yet
fActualHelicity
=
kUnknown
;
}
}
else
{
// cout << "Initializing" << endl;
_logger
->
info
(
"Initializing Helicity"
);
fLastReportedHelicity
=
fReportedHelicity
;
fActualHelicity
=
kUnknown
;
...
...
@@ -564,8 +563,8 @@ Int_t THcHelicity::End(THaRunBase*) {
return
0
;
}
//_____________________________________________________________________________
//_____________________________________________________________________________
void
THcHelicity
::
SetDebug
(
Int_t
level
)
{
// Set debug level of this detector as well as the THcHelicityReader
// helper class.
...
...
@@ -573,8 +572,8 @@ void THcHelicity::SetDebug(Int_t level) {
THaHelicityDet
::
SetDebug
(
level
);
fQWEAKDebug
=
level
;
}
//_____________________________________________________________________________
//_____________________________________________________________________________
void
THcHelicity
::
LoadHelicity
(
Int_t
reportedhelicity
,
Int_t
cyclecount
,
Int_t
missedcycles
)
{
// static const char* const here = "THcHelicity::LoadHelicity";
int
quartetphase
=
(
cyclecount
-
fFirstCycle
)
%
4
;
...
...
@@ -651,7 +650,6 @@ void THcHelicity::LoadHelicity(Int_t reportedhelicity, Int_t cyclecount, Int_t m
//<< endl;
if
(
fReportedHelicity
!=
fPredictedHelicity
)
{
_logger
->
warn
(
"Helicity prediction failed {} {} {}"
,
fReportedHelicity
,
fPredictedHelicity
,
fActualHelicity
);
_logger
->
warn
(
"{} {}"
,
fRingSeed_reported
,
fRingSeed_actual
);
fNBits
=
0
;
// Need to reaquire seed
fActualHelicity
=
kUnknown
;
...
...
@@ -679,7 +677,8 @@ Int_t THcHelicity::RanBit30(Int_t ranseed) {
if
(
ranseed
<=
0
)
{
if
(
fQWEAKDebug
>
1
)
_logger
->
error
(
"ranseed must be greater than zero!"
);
std
::
cerr
<<
"ranseed must be greater than zero!"
<<
"
\n
"
;
newbit
=
0
;
}
...
...
This diff is collapsed.
Click to expand it.
src/THcHelicity.h
+
1
−
1
View file @
b4acaf19
...
...
@@ -107,7 +107,7 @@ protected:
virtual
Int_t
ReadDatabase
(
const
TDatime
&
date
);
THcHelicityScaler
*
fglHelicityScaler
=
nullptr
;
Int_t
*
fHelicityHistory
=
nullptr
;
Int_t
*
fHelicityHistory
=
nullptr
;
Int_t
fLastHelpCycle
;
Int_t
fScaleQuartet
;
Int_t
fQuadPattern
[
8
];
...
...
This diff is collapsed.
Click to expand it.
src/THcHelicityReader.cxx
+
16
−
2
View file @
b4acaf19
...
...
@@ -23,8 +23,8 @@ using namespace std;
//____________________________________________________________________
THcHelicityReader
::
THcHelicityReader
()
:
hcana
::
ConfigLogging
<
podd2
::
EmptyBase
>
(),
fTITime
(
0
),
fTITime_last
(
0
),
fTITime_rollovers
(
0
),
fHaveROCs
(
kFALSE
)
{
:
hcana
::
ConfigLogging
<
podd2
::
EmptyBase
>
(),
fTITime
(
0
),
fTITime_last
(
0
),
fTITime_rollovers
(
0
),
fHaveROCs
(
kFALSE
)
{
// Default constructor
}
//____________________________________________________________________
...
...
@@ -104,6 +104,7 @@ Int_t THcHelicityReader::ReadData(const THaEvData& evdata) {
}
// Check if ROC info is correct
if
(
!
evdata
.
GetModule
(
fROCinfo
[
kTime
].
roc
,
fROCinfo
[
kTime
].
slot
))
{
cout
<<
"THcHelicityReader: ROC 2 not found"
<<
endl
;
cout
<<
"Changing to ROC 1 (HMS)"
<<
endl
;
...
...
@@ -119,6 +120,18 @@ Int_t THcHelicityReader::ReadData(const THaEvData& evdata) {
// Int_t fTIEvNum = evData.GetData(fTICrate, fTISlot, 1, 0);
UInt_t
titime
=
(
UInt_t
)
evdata
.
GetData
(
fROCinfo
[
kTime
].
roc
,
fROCinfo
[
kTime
].
slot
,
fROCinfo
[
kTime
].
index
,
0
);
// Check again if ROC info is correct
if
(
titime
==
0
&&
fTITime_last
==
0
)
{
cout
<<
"THcHelicityReader: ROC 2 not found"
<<
endl
;
cout
<<
"Changing to ROC 1 (HMS)"
<<
endl
;
SetROCinfo
(
kHel
,
1
,
18
,
9
);
SetROCinfo
(
kHelm
,
1
,
18
,
8
);
SetROCinfo
(
kMPS
,
1
,
18
,
10
);
SetROCinfo
(
kQrt
,
1
,
18
,
7
);
SetROCinfo
(
kTime
,
1
,
21
,
2
);
titime
=
(
UInt_t
)
evdata
.
GetData
(
fROCinfo
[
kTime
].
roc
,
fROCinfo
[
kTime
].
slot
,
fROCinfo
[
kTime
].
index
,
0
);
}
// cout << fTITime_last << " " << titime << endl;
if
(
titime
<
fTITime_last
)
{
fTITime_rollovers
++
;
...
...
@@ -177,3 +190,4 @@ Int_t THcHelicityReader::SetROCinfo(EROC which, Int_t roc, Int_t slot, Int_t ind
//____________________________________________________________________
ClassImp
(
THcHelicityReader
)
This diff is collapsed.
Click to expand it.
src/THcHelicityScaler.cxx
+
2
−
2
View file @
b4acaf19
...
...
@@ -165,8 +165,8 @@ Int_t THcHelicityScaler::AnalyzeBuffer(UInt_t* rdata, Bool_t onlysync) {
if
(
fDebugFile
)
*
fDebugFile
<<
"ROC: "
<<
roc
<<
" "
<<
evlen
<<
" "
<<
*
(
p
-
1
)
<<
hex
<<
" "
<<
*
p
<<
dec
<<
endl
;
// cout << "ROC: " << roc << " " << evlen << " " << *(p-1) << hex << " " << *p
//
<<
dec << endl;
// cout << "ROC: " << roc << " " << evlen << " " << *(p-1) << hex << " " << *p
<<
//dec << endl;
if
(
fRocSet
.
find
(
roc
)
==
fRocSet
.
end
())
{
// Not a ROC with helicity scaler
p
+=
*
(
p
-
1
)
-
1
;
// Skip to next ROC
}
...
...
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