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
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
jlab
hallc
analyzer_software
hcana
Commits
aa439648
Commit
aa439648
authored
Aug 2, 2018
by
Whitney Armstrong
Browse files
Options
Downloads
Plain Diff
Merge branch 'develop' of
https://github.com/JeffersonLab/hcana
parents
6102e1c3
803ad821
No related branches found
No related tags found
No related merge requests found
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
src/THcParmList.cxx
+24
-14
24 additions, 14 deletions
src/THcParmList.cxx
src/THcTimeSyncEvtHandler.cxx
+49
-3
49 additions, 3 deletions
src/THcTimeSyncEvtHandler.cxx
src/THcTimeSyncEvtHandler.h
+3
-1
3 additions, 1 deletion
src/THcTimeSyncEvtHandler.h
with
76 additions
and
18 deletions
src/THcParmList.cxx
+
24
−
14
View file @
aa439648
...
...
@@ -241,20 +241,30 @@ The ENGINE CTP support parameter "blocks" which were marked with
// If RunNumber>0 and first line we encounter is not a run range, need to
// print an error
if
(
RunNumber
>
0
)
{
if
(
line
.
find_first_not_of
(
"0123456789-"
)
==
string
::
npos
)
{
// Interpret as runnum range
if
(
(
pos
=
line
.
find_first_of
(
"-"
))
!=
string
::
npos
)
{
Int_t
RangeStart
=
atoi
(
line
.
substr
(
0
,
pos
).
c_str
());
Int_t
RangeEnd
=
atoi
(
line
.
substr
(
pos
+
1
,
string
::
npos
).
c_str
());
if
(
RunNumber
>=
RangeStart
&&
RunNumber
<=
RangeEnd
)
{
InRunRange
=
1
;
}
else
{
if
(
line
.
find_first_not_of
(
"0123456789-,"
)
==
string
::
npos
)
{
// Interpret as runnum range
// Interpret line as a list of comma separated run numbers or ranges
TString
runnums
(
line
.
c_str
());
TObjArray
*
runnumarr
=
runnums
.
Tokenize
(
","
);
Int_t
nranges
=
runnumarr
->
GetLast
()
+
1
;
InRunRange
=
0
;
Int_t
ind
;
for
(
Int_t
i
=
0
;
i
<
nranges
;
i
++
)
{
TString
runstr
=
((
TObjString
*
)
runnumarr
->
At
(
i
))
->
GetString
();
if
(
runstr
.
IsDec
())
{
// A single run number
if
(
RunNumber
==
runstr
.
Atoi
())
{
InRunRange
=
1
;
break
;
}
}
else
{
// A single number. Run
if
(
atoi
(
line
.
c_str
())
==
RunNumber
)
{
}
else
if
((
ind
=
runstr
.
First
(
'-'
))
>=
0
)
{
// A run range
TString
start
=
runstr
(
0
,
ind
);
TString
end
=
runstr
(
ind
+
1
,
runstr
.
Length
());
if
(
start
.
IsDec
()
&&
end
.
IsDec
())
{
if
((
RunNumber
>=
start
.
Atoi
())
&&
(
RunNumber
<=
end
.
Atoi
()))
{
InRunRange
=
1
;
}
else
{
InRunRange
=
0
;
break
;
}
}
}
}
continue
;
// Skip to next line
...
...
This diff is collapsed.
Click to expand it.
src/THcTimeSyncEvtHandler.cxx
+
49
−
3
View file @
aa439648
...
...
@@ -168,9 +168,12 @@ Int_t THcTimeSyncEvtHandler::Analyze(THaEvData *evdata)
if
(
fSlippage
)
{
pslippedbank
=
p
-
2
;
// cout << banklen << " " << pslippedbank[0] << endl;
if
(
AllTdcsPresent
(
pslippedbank
)
&&
(
banklen
>
fBadSyncSizeTrigger
))
{
cout
<<
"Slippage detected at event "
<<
evdata
->
GetEvNum
()
<<
" with size "
<<
banklen
<<
" but not corrected"
<<
endl
;
}
}
else
{
if
(
banklen
>
fBadSyncSizeTrigger
)
{
cout
<<
"Slippage enabled at event "
<<
evdata
->
GetEvNum
()
<<
endl
;
if
(
AllTdcsPresent
(
p
-
2
)
&&
(
banklen
>
fBadSyncSizeTrigger
)
)
{
cout
<<
"Slippage enabled at event "
<<
evdata
->
GetEvNum
()
<<
" with size "
<<
banklen
<<
endl
;
fSlippage
=
1
;
}
}
...
...
@@ -502,6 +505,7 @@ THaAnalysisObject::EStatus THcTimeSyncEvtHandler::Init(const TDatime& date)
}
fFirstTime
=
kTRUE
;
fFirstTdcCheck
=
kTRUE
;
fMasterRoc
=
-
1
;
fNEvents
=
0
;
CrateTimeMap
.
clear
();
...
...
@@ -544,6 +548,48 @@ Int_t THcTimeSyncEvtHandler::SetRewriteFile(const char *filename) {
}
return
(
0
);
}
Int_t
THcTimeSyncEvtHandler
::
AllTdcsPresent
(
UInt_t
*
bank
)
{
/**
Check that all the 1190 TDCs that should be present are there.
Return codes:
0: All TDCs present
1: TDCs missing at high end of crate
2: TDCs missing at low end of crate
3: Other arrangement of missing
*/
UInt_t
headermask
=
0
;
UInt_t
trailermask
=
0
;
UInt_t
*
p
=
bank
;
Int_t
banklen
=
*
p
;
p
++
;
// Header word
while
(
p
++
<
bank
+
banklen
)
{
if
((
*
p
&
0xf8000000
)
==
0x40000000
)
{
headermask
|=
(
1
<<
(
*
p
&
0x1f
));
}
else
if
((
*
p
&
0xf8000000
)
==
0x80000000
)
{
trailermask
|=
(
1
<<
(
*
p
&
0x1f
));
}
}
if
(
fFirstTdcCheck
)
{
fFirstTdcCheck
=
kFALSE
;
fTdcMask
=
headermask
|
trailermask
;
return
(
0
);
// All TDC present by definition
}
else
{
if
((
fTdcMask
==
headermask
)
&&
(
fTdcMask
==
trailermask
))
{
return
(
0
);
}
else
{
cout
<<
hex
<<
"Header mask "
<<
headermask
<<
" Trailer mask "
<<
trailermask
<<
dec
<<
endl
;
cout
<<
"TDC1190 Bank"
<<
endl
;
for
(
Int_t
i
=
0
;
i
<=
banklen
;
i
++
)
{
if
(
i
%
5
==
0
)
cout
<<
endl
<<
dec
<<
i
<<
": "
;
cout
<<
hex
<<
setw
(
10
)
<<
bank
[
i
];
}
cout
<<
dec
<<
endl
;
return
(
1
);
// Just return this for now
}
}
}
ClassImp
(
THcTimeSyncEvtHandler
)
This diff is collapsed.
Click to expand it.
src/THcTimeSyncEvtHandler.h
+
3
−
1
View file @
aa439648
...
...
@@ -33,7 +33,7 @@ public:
virtual
void
SetBadROC
(
Int_t
roc
)
{
fBadROC
=
roc
;}
virtual
void
SetResync
(
Bool_t
b
)
{
fResync
=
b
;}
virtual
void
SetBadSyncSizeTrigger
(
Int_t
sizetrigger
)
{
fBadSyncSizeTrigger
=
sizetrigger
;}
virtual
Int_t
AllTdcsPresent
(
UInt_t
*
bank
);
private
:
virtual
void
InitStats
();
...
...
@@ -51,6 +51,8 @@ private:
Bool_t
fResync
;
// If true, stop correcting events on sync
Int_t
fBadSyncSizeTrigger
;
Bool_t
fLastEventWasSync
;
// True when last event was sync event
Bool_t
fFirstTdcCheck
;
UInt_t
fTdcMask
;
// Bit Pattern of TDC in ROC being checked
Decoder
::
THaCodaFile
*
fCodaOut
;
// The CODA output file
Int_t
handle
;
...
...
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