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
5e3b3692
Commit
5e3b3692
authored
4 years ago
by
Chad Lantz
Browse files
Options
Downloads
Patches
Plain Diff
Implemented addRandNoise with Gaussian noise. Added draw argument to generateWaveform
parent
388a6be2
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
-7
16 additions, 7 deletions
outputDigitization.cc
with
16 additions
and
7 deletions
outputDigitization.cc
+
16
−
7
View file @
5e3b3692
...
...
@@ -11,9 +11,10 @@ using namespace std;
TGraph
*
getPMTdata
(
string
fileName
);
double
evaluateSum
(
vector
<
TF1
*
>&
funcVec
,
double
x
);
void
generateWaveform
(
string
fileName
);
void
generateWaveform
(
string
fileName
,
bool
DRAW
=
false
);
void
addDarkCurrent
(
vector
<
TF1
*
>&
vec
,
float
timeInterval
);
void
addRandNoise
(
vector
<
float
>*
vec
,
float
timeInterval
);
void
addTimingJitter
(
vector
<
float
>*
vec
,
float
timeInterval
);
Double_t
PMTpulseFunction
(
Double_t
*
t
,
Double_t
*
par
){
Float_t
tt
=
t
[
0
];
...
...
@@ -299,13 +300,13 @@ void PMTcuts(string fileName, int PMTmodel = 6091){
* Generate a waveform as the sum of single photon responses
* Pulse integral to amplitude conversion factor is a result of the following
* integral_21^∞ A*((t - t0)/10)^3.4 exp(-1/10 (t - t0)) dt = A*101.3581
* DRAW saves event display to .png
*/
void
generateWaveform
(
string
fileName
){
void
generateWaveform
(
string
fileName
,
bool
DRAW
){
// Choose a path
bool
theHardWay
=
true
;
// (superposition) Create a TF1 for every photon using each photon's time and energy/wavelength
bool
theMiddleWay
=
false
;
// (per time bin) Create a TF1 for every time bin using the sum of that bin's photons energy/wavelength
bool
theEasyWay
=
false
;
// (impulse) Create a single TF1 using the average photon energy (known value = 4.625eV) multiplied by nPhotons in that tile
bool
DRAW
=
true
;
// Save each event to .png
float
inputImpedance
=
50.0
;
// ohms
float
gain
=
1e6
;
// unitless
...
...
@@ -383,11 +384,12 @@ void generateWaveform(string fileName){
addRandNoise
(
waveforms
[
tile
],
204.8
);
if
(
DRAW
){
if
(
DRAW
&&
tile
==
10
){
for
(
int
bin
=
0
;
bin
<
1024
;
bin
++
){
h
[
tile
]
->
SetBinContent
(
bin
,
waveforms
[
tile
]
->
at
(
bin
));
}
//end waveform loop
c
->
cd
(
tile
+
1
);
// c->cd(tile+1);
c
->
cd
(
0
);
h
[
tile
]
->
Draw
();
h
[
tile
]
->
SetAxisRange
(
-
10
,
750
,
"Y"
);
}
...
...
@@ -427,8 +429,15 @@ void generateWaveform(string fileName){
void
addRandNoise
(
vector
<
float
>*
vec
,
float
timeInterval
){
float
sigma
=
5.0
;
//mV
float
mean
=
0.0
;
//mV
int
size
=
vec
->
size
();
TRandom2
rnd
;
rnd
.
SetSeed
(
gSystem
->
Now
());
for
(
int
i
=
0
;
i
<
size
;
i
++
){
vec
->
at
(
i
)
+=
rnd
.
Gaus
(
mean
,
sigma
);
}
}
/*
...
...
@@ -453,7 +462,7 @@ void addDarkCurrent(vector< TF1* >& pulses, float timeInterval){
float
aveNpulses
=
timeInterval
*
aveNpulsePerNanoSec
;
// unitless. Probably want to randomize this a bit
float
avePulseAmp
=
1e3
*
aveChargePerPulse
*
gain
*
inputImpedance
/
101.3581
;
// mV
TRandom
rnd
;
TRandom
2
rnd
;
rnd
.
SetSeed
(
gSystem
->
Now
());
int
nPulses
=
rnd
.
Poisson
(
aveNpulses
);
for
(
int
i
=
0
;
i
<
nPulses
;
i
++
){
...
...
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