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
44159e9f
Commit
44159e9f
authored
4 years ago
by
Chad Lantz
Browse files
Options
Downloads
Patches
Plain Diff
Cleared vectors because I forgot to do that
parent
7e17d9b2
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
+15
-5
15 additions, 5 deletions
outputDigitization.cc
with
15 additions
and
5 deletions
outputDigitization.cc
+
15
−
5
View file @
44159e9f
#include
"TFile.h"
#include
"TH1F.h"
#include
"T
H2
F.h"
#include
"TF
1
.h"
#include
"TRandom.h"
#include
<TTree.h>
#include
<vector>
...
...
@@ -81,11 +81,13 @@ void cutZDCoutput(string fileName, string rod, double xOffset, double zOffset){
for
(
int
bin
=
0
;
bin
<
nBins
;
bin
++
){
hTrans
->
SetBinContent
(
bin
,
transData
[
bin
]
);
}
if
(
rod
==
"fusedQuartz"
){
TF1
*
bLine
=
new
TF1
(
"baseline"
,
"0.0883*log(0.013087*(x-156.8) ) + 0.802"
,
197
,
1028
);
hTrans
->
Multiply
(
bLine
);
}
//Get the number of events in the file
int
nEvents
=
inTree
->
GetEntries
();
//Find out how many events contain photons
float
wl
;
int
realNevents
=
0
;
...
...
@@ -113,7 +115,7 @@ void cutZDCoutput(string fileName, string rod, double xOffset, double zOffset){
// get the data from the appropriate bin.
wl
=
1240.
/
energy
;
if
(
wl
<
197.2888
){
hTrans
->
GetBinContent
(
1
);
trans
=
hTrans
->
GetBinContent
(
1
);
}
else
{
trans
=
hTrans
->
GetBinContent
(
hTrans
->
GetBin
(
wl
)
);
}
...
...
@@ -127,7 +129,7 @@ void cutZDCoutput(string fileName, string rod, double xOffset, double zOffset){
x
->
push_back
(
X
);
z
->
push_back
(
Z
);
//We
only
want momentum direction, not magnitude
//We want momentum direction, not magnitude
Px
/=
energy
;
Py
/=
energy
;
Pz
/=
energy
;
...
...
@@ -149,6 +151,14 @@ void cutZDCoutput(string fileName, string rod, double xOffset, double zOffset){
outTree
->
Fill
();
totalCut
+=
nCut
;
totalPhotons
+=
nPhotons
;
//Clear vectors
x
->
clear
();
z
->
clear
();
px
->
clear
();
py
->
clear
();
pz
->
clear
();
Energy
->
clear
();
}
//end loop over events
cout
<<
Form
(
"%5d of %5d photons cut %3.0f%%"
,
totalCut
,
totalPhotons
,
100.
*
(
float
)
totalCut
/
(
float
)
totalPhotons
)
<<
endl
;
inFile
->
Close
();
...
...
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