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
951d1ee0
Commit
951d1ee0
authored
9 years ago
by
Stephen A. Wood
Browse files
Options
Downloads
Patches
Plain Diff
Make ascii art showing hit patterns in Shower Array
Enable by defining HITPIC in THcShowerArray.h
parent
f8f421ce
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/THcShowerArray.cxx
+70
-0
70 additions, 0 deletions
src/THcShowerArray.cxx
src/THcShowerArray.h
+9
-0
9 additions, 0 deletions
src/THcShowerArray.h
with
79 additions
and
0 deletions
src/THcShowerArray.cxx
+
70
−
0
View file @
951d1ee0
...
@@ -25,6 +25,7 @@
...
@@ -25,6 +25,7 @@
#include
<iostream>
#include
<iostream>
#include
<fstream>
#include
<fstream>
using
namespace
std
;
using
namespace
std
;
ClassImp
(
THcShowerArray
)
ClassImp
(
THcShowerArray
)
...
@@ -104,6 +105,14 @@ Int_t THcShowerArray::ReadDatabase( const TDatime& date )
...
@@ -104,6 +105,14 @@ Int_t THcShowerArray::ReadDatabase( const TDatime& date )
fA
=
new
Double_t
[
fNelem
];
fA
=
new
Double_t
[
fNelem
];
fP
=
new
Double_t
[
fNelem
];
fP
=
new
Double_t
[
fNelem
];
#ifdef HITPIC
hitpic
=
new
char
*
[
fNRows
];
for
(
Int_t
row
=
0
;
row
<
fNRows
;
row
++
)
{
hitpic
[
row
]
=
new
char
[
NPERLINE
*
(
fNColumns
+
1
)
+
2
];
}
piccolumn
=
0
;
#endif
return
kOK
;
return
kOK
;
}
}
...
@@ -183,6 +192,8 @@ Int_t THcShowerArray::ProcessHits(TClonesArray* rawhits, Int_t nexthit)
...
@@ -183,6 +192,8 @@ Int_t THcShowerArray::ProcessHits(TClonesArray* rawhits, Int_t nexthit)
Int_t
ihit
=
nexthit
;
Int_t
ihit
=
nexthit
;
Int_t
ngood
=
0
;
Int_t
threshold
=
100
;
while
(
ihit
<
nrawhits
)
{
while
(
ihit
<
nrawhits
)
{
THcRawShowerHit
*
hit
=
(
THcRawShowerHit
*
)
rawhits
->
At
(
ihit
);
THcRawShowerHit
*
hit
=
(
THcRawShowerHit
*
)
rawhits
->
At
(
ihit
);
...
@@ -194,11 +205,70 @@ Int_t THcShowerArray::ProcessHits(TClonesArray* rawhits, Int_t nexthit)
...
@@ -194,11 +205,70 @@ Int_t THcShowerArray::ProcessHits(TClonesArray* rawhits, Int_t nexthit)
}
else
{
}
else
{
fA
[
hit
->
fCounter
-
1
]
=
hit
->
GetData
(
0
);
fA
[
hit
->
fCounter
-
1
]
=
hit
->
GetData
(
0
);
}
}
if
(
fA
[
hit
->
fCounter
-
1
]
>
threshold
)
{
ngood
++
;
}
// Do other stuff like comparison to thresholds, signal hits, energy sums
// Do other stuff like comparison to thresholds, signal hits, energy sums
ihit
++
;
ihit
++
;
}
}
#if 0
if(ngood > 0) {
cout << "+";
for(Int_t column=0;column<fNColumns;column++) {
cout << "-";
}
cout << "+" << endl;
for(Int_t row=0;row<fNRows;row++) {
cout << "|";
for(Int_t column=0;column<fNColumns;column++) {
Int_t counter = column*fNRows + row;
if(fA[counter]>threshold) {
cout << "X";
} else {
cout << " ";
}
}
cout << "|" << endl;
}
}
#endif
#ifdef HITPIC
if
(
ngood
>
0
)
{
for
(
Int_t
row
=
0
;
row
<
fNRows
;
row
++
)
{
if
(
piccolumn
==
0
)
{
hitpic
[
row
][
0
]
=
'|'
;
}
for
(
Int_t
column
=
0
;
column
<
fNColumns
;
column
++
)
{
Int_t
counter
=
column
*
fNRows
+
row
;
if
(
fA
[
counter
]
>
threshold
)
{
hitpic
[
row
][
piccolumn
*
(
fNColumns
+
1
)
+
column
+
1
]
=
'X'
;
}
else
{
hitpic
[
row
][
piccolumn
*
(
fNColumns
+
1
)
+
column
+
1
]
=
' '
;
}
hitpic
[
row
][(
piccolumn
+
1
)
*
(
fNColumns
+
1
)]
=
'|'
;
}
}
piccolumn
++
;
if
(
piccolumn
==
NPERLINE
)
{
cout
<<
"+"
;
for
(
Int_t
pc
=
0
;
pc
<
NPERLINE
;
pc
++
)
{
for
(
Int_t
column
=
0
;
column
<
fNColumns
;
column
++
)
{
cout
<<
"-"
;
}
cout
<<
"+"
;
}
cout
<<
endl
;
for
(
Int_t
row
=
0
;
row
<
fNRows
;
row
++
)
{
hitpic
[
row
][(
piccolumn
+
1
)
*
(
fNColumns
+
1
)
+
1
]
=
'\0'
;
cout
<<
hitpic
[
row
]
<<
endl
;
}
piccolumn
=
0
;
}
}
#endif
return
(
ihit
);
return
(
ihit
);
}
}
...
...
This diff is collapsed.
Click to expand it.
src/THcShowerArray.h
+
9
−
0
View file @
951d1ee0
#ifndef ROOT_THcShowerArray
#ifndef ROOT_THcShowerArray
#define ROOT_THcShowerArray
#define ROOT_THcShowerArray
//#define HITPIC 1
#ifdef HITPIC
#define NPERLINE 5
#endif
//////////////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////////
//
//
// THcShowerArray
// THcShowerArray
...
@@ -54,6 +59,10 @@ public:
...
@@ -54,6 +59,10 @@ public:
protected
:
protected
:
#ifdef HITPIC
char
**
hitpic
;
Int_t
piccolumn
;
#endif
Double_t
*
fA
;
// [fNelem] ADC amplitude of blocks
Double_t
*
fA
;
// [fNelem] ADC amplitude of blocks
Double_t
*
fP
;
// [fNelem] Event by event pedestals
Double_t
*
fP
;
// [fNelem] Event by event pedestals
...
...
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