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
35dfb2ad
Commit
35dfb2ad
authored
13 years ago
by
Stephen A. Wood
Browse files
Options
Downloads
Patches
Plain Diff
Decoding of Hodoscope hits now works.
parent
192d0d31
No related branches found
No related tags found
No related merge requests found
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
src/THcHitList.cxx
+8
-3
8 additions, 3 deletions
src/THcHitList.cxx
src/THcHodoscope.cxx
+5
-2
5 additions, 2 deletions
src/THcHodoscope.cxx
src/THcHodoscopeHit.cxx
+12
-12
12 additions, 12 deletions
src/THcHodoscopeHit.cxx
src/THcRawHit.h
+1
-1
1 addition, 1 deletion
src/THcRawHit.h
with
26 additions
and
18 deletions
src/THcHitList.cxx
+
8
−
3
View file @
35dfb2ad
...
...
@@ -43,7 +43,7 @@ void THcHitList::InitHitList(THaDetMap* detmap,
Int_t
THcHitList
::
DecodeToHitList
(
const
THaEvData
&
evdata
)
{
THcRawHit
*
rawhit
;
cout
<<
" Clearing TClonesArray "
<<
endl
;
//
cout << " Clearing TClonesArray " << endl;
fRawHitList
->
Clear
(
"C"
);
fNRawHits
=
0
;
...
...
@@ -51,6 +51,7 @@ Int_t THcHitList::DecodeToHitList( const THaEvData& evdata ) {
THaDetMap
::
Module
*
d
=
fdMap
->
GetModule
(
i
);
// Loop over all channels that have a hit.
// cout << "Crate/Slot: " << d->crate << "/" << d->slot << endl;
for
(
Int_t
j
=
0
;
j
<
evdata
.
GetNumChan
(
d
->
crate
,
d
->
slot
);
j
++
)
{
Int_t
chan
=
evdata
.
GetNextChan
(
d
->
crate
,
d
->
slot
,
j
);
...
...
@@ -61,7 +62,8 @@ Int_t THcHitList::DecodeToHitList( const THaEvData& evdata ) {
Int_t
plane
=
d
->
plane
;
Int_t
signal
=
d
->
signal
;
Int_t
counter
=
d
->
reverse
?
d
->
first
+
d
->
hi
-
chan
:
d
->
first
+
chan
-
d
->
lo
;
//cout << d->crate << " " << d->slot << " " << chan << " " << plane << " "
// << counter << " " << signal << endl;
// Search hit list for plane and counter
// We could do sorting
Int_t
thishit
=
0
;
...
...
@@ -69,13 +71,15 @@ Int_t THcHitList::DecodeToHitList( const THaEvData& evdata ) {
rawhit
=
(
THcRawHit
*
)
(
*
fRawHitList
)[
thishit
];
if
(
plane
==
rawhit
->
fPlane
&&
counter
==
rawhit
->
fCounter
)
{
// cout << "Found as " << thishit << "/" << fNRawHits << endl;
break
;
}
thishit
++
;
}
if
(
thishit
==
fNRawHits
)
{
fNRawHits
++
;
rawhit
=
(
THcRawHit
*
)
(
*
fRawHitList
)[
thishit
];
fNRawHits
++
;
rawhit
->
fPlane
=
plane
;
rawhit
->
fCounter
=
counter
;
}
...
...
@@ -85,6 +89,7 @@ Int_t THcHitList::DecodeToHitList( const THaEvData& evdata ) {
Int_t
nMHits
=
evdata
.
GetNumHits
(
d
->
crate
,
d
->
slot
,
chan
);
for
(
Int_t
mhit
=
0
;
mhit
<
nMHits
;
mhit
++
)
{
Int_t
data
=
evdata
.
GetData
(
d
->
crate
,
d
->
slot
,
chan
,
mhit
);
// cout << "Signal " << signal << "=" << data << endl;
rawhit
->
SetData
(
signal
,
data
);
}
}
...
...
This diff is collapsed.
Click to expand it.
src/THcHodoscope.cxx
+
5
−
2
View file @
35dfb2ad
...
...
@@ -138,6 +138,7 @@ Int_t THcHodoscope::ReadDatabase( const TDatime& date )
iplane
=
0
;
p
=
(
Double_t
*
)
gHcParms
->
Find
(
"hscin_1x_center"
)
->
GetValuePointer
();
fCenter
[
iplane
]
=
new
Double_t
[
fNPaddle
[
iplane
]];
// Print out some parameters just to demonstrate that it works
cout
<<
iplane
;
for
(
Int_t
i
=
0
;
i
<
fNPaddle
[
iplane
];
i
++
)
{
fCenter
[
iplane
][
i
]
=
p
[
i
];
...
...
@@ -295,9 +296,11 @@ Int_t THcHodoscope::Decode( const THaEvData& evdata )
// fRawHitList is TClones array of THcHodoscopeHit objects
for
(
Int_t
ihit
=
0
;
ihit
<
fNRawHits
;
ihit
++
)
{
THcHodoscopeHit
*
hit
=
(
THcHodoscopeHit
*
)
fRawHitList
->
At
(
ihit
);
cout
<<
ihit
<<
": "
<<
hit
->
fADC_pos
<<
" "
<<
hit
->
fADC_neg
<<
" "
<<
hit
->
fTDC_pos
<<
" "
<<
hit
->
fTDC_pos
<<
endl
;
cout
<<
ihit
<<
" : "
<<
hit
->
fPlane
<<
":"
<<
hit
->
fCounter
<<
" : "
<<
hit
->
fADC_pos
<<
" "
<<
hit
->
fADC_neg
<<
" "
<<
hit
->
fTDC_pos
<<
" "
<<
hit
->
fTDC_neg
<<
endl
;
}
cout
<<
endl
;
return
nhits
;
}
...
...
This diff is collapsed.
Click to expand it.
src/THcHodoscopeHit.cxx
+
12
−
12
View file @
35dfb2ad
...
...
@@ -14,26 +14,26 @@ using namespace std;
void
THcHodoscopeHit
::
SetData
(
Int_t
signal
,
Int_t
data
)
{
if
(
signal
==
1
)
{
if
(
signal
==
0
)
{
fADC_pos
=
data
;
}
else
if
(
signal
==
2
)
{
fADC_neg
=
data
;
}
else
if
(
signal
==
3
)
{
fADC_pos
=
data
;
}
else
if
(
signal
==
4
)
{
}
else
if
(
signal
==
1
)
{
fADC_neg
=
data
;
}
else
if
(
signal
==
2
)
{
fTDC_pos
=
data
;
}
else
if
(
signal
==
3
)
{
fTDC_neg
=
data
;
}
}
Int_t
THcHodoscopeHit
::
GetData
(
Int_t
signal
)
{
if
(
signal
==
1
)
{
return
(
fADC_pos
);
}
else
if
(
signal
==
2
)
{
return
(
fADC_neg
);
}
else
if
(
signal
==
3
)
{
if
(
signal
==
0
)
{
return
(
fADC_pos
);
}
else
if
(
signal
==
4
)
{
}
else
if
(
signal
==
1
)
{
return
(
fADC_neg
);
}
else
if
(
signal
==
2
)
{
return
(
fTDC_pos
);
}
else
if
(
signal
==
3
)
{
return
(
fTDC_neg
);
}
return
(
-
1
);
// Actually should throw exception
}
...
...
This diff is collapsed.
Click to expand it.
src/THcRawHit.h
+
1
−
1
View file @
35dfb2ad
...
...
@@ -37,7 +37,7 @@ public:
private
:
ClassDef
(
THcRawHit
,
2
)
// Track ID abstract base class
ClassDef
(
THcRawHit
,
0
)
// Track ID abstract base class
};
#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