Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Z
ZDCdigitizer
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
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
Chad Lantz
ZDCdigitizer
Commits
661bcb86
Commit
661bcb86
authored
4 years ago
by
Chad Lantz
Browse files
Options
Downloads
Plain Diff
'Merge branch 'master' of gitlab.engr.illinois.edu:clantz2/zdcdigitizer
parents
4f74ffdc
8bfcda06
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
outputDigitization.cc
+16
-3
16 additions, 3 deletions
outputDigitization.cc
with
16 additions
and
3 deletions
outputDigitization.cc
+
16
−
3
View file @
661bcb86
...
...
@@ -375,27 +375,38 @@ void generateWaveform(string fileName, bool DRAW){
cout
<<
fileName
<<
" didn't open"
<<
endl
;
return
;
}
TTree
*
eventDatatree
=
(
TTree
*
)
inFile
->
Get
(
"EventData"
);
TTree
*
tree
=
(
TTree
*
)
inFile
->
Get
(
"RPD1tree"
);
vector
<
double
>
*
Px
=
0
,
*
Py
=
0
,
*
Pz
=
0
,
*
time
=
0
;
vector
<
double
>
*
Px
=
0
,
*
Py
=
0
,
*
Pz
=
0
,
*
time
=
0
,
*
LastStepZf
=
0
;
vector
<
int
>
*
rodNo
=
0
;
double
Xf
=
0
,
Yf
=
0
,
Zf
=
0
;
tree
->
SetBranchAddress
(
"Px"
,
&
Px
);
tree
->
SetBranchAddress
(
"Py"
,
&
Py
);
tree
->
SetBranchAddress
(
"Pz"
,
&
Pz
);
tree
->
SetBranchAddress
(
"time"
,
&
time
);
tree
->
SetBranchAddress
(
"rodNo"
,
&
rodNo
);
eventDatatree
->
SetBranchAddress
(
"gunPosX"
,
&
Xf
);
eventDatatree
->
SetBranchAddress
(
"gunPosY"
,
&
Yf
);
eventDatatree
->
SetBranchAddress
(
"gunPosZ"
,
&
Zf
);
eventDatatree
->
SetBranchAddress
(
"lastStepZ"
,
&
LastStepZf
);
// Output root file
TFile
*
outFile
=
new
TFile
(
"output.root"
,
"RECREATE"
);
TTree
*
outTree
=
new
TTree
(
"tree"
,
"tree"
);
outTree
->
Branch
(
"gunPosX"
,
&
Xf
);
outTree
->
Branch
(
"gunPosY"
,
&
Yf
);
outTree
->
Branch
(
"gunPosZ"
,
&
Zf
);
outTree
->
Branch
(
"lastStepZ"
,
&
LastStepZf
);
vector
<
vector
<
float
>*
>
waveforms
(
16
,
0
);
for
(
int
tile
=
0
;
tile
<
16
;
tile
++
){
waveforms
[
tile
]
=
new
vector
<
float
>
;
outTree
->
Branch
(
Form
(
"Signal%d"
,
tile
),
&
waveforms
[
tile
]
);
if
(
DRAW
)
h
[
tile
]
=
new
TH1D
(
Form
(
"tile%dwaveform"
,
tile
),
Form
(
"Tile %d Simulated Waveform;time (ns);Amplitude (mV)"
,
tile
),
nSamples
,
0
,
timeWindow
*
1e9
);
if
(
DRAW
)
h
[
tile
]
=
new
TH1D
(
Form
(
"tile%dwaveform"
,
tile
),
Form
(
"Tile %d Simulated Waveform;time (ns);Amplitude (mV)"
,
tile
),
nSamples
,
0
,
timeWindow
);
}
...
...
@@ -410,7 +421,9 @@ void generateWaveform(string fileName, bool DRAW){
int
nEntries
=
tree
->
GetEntries
();
for
(
int
ev
=
0
;
ev
<
nEntries
;
ev
++
){
eventDatatree
->
GetEntry
(
ev
);
tree
->
GetEntry
(
ev
);
int
nHits
=
Px
->
size
();
for
(
int
hit
=
0
;
hit
<
nHits
;
hit
++
){
...
...
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