# How to use the AddWhiteNoise() function in Garfield++?

**URL:** <https://root-forum.cern.ch/t/how-to-use-the-addwhitenoise-function-in-garfield/53694>\
**Category:** Garfield++\
**Created:** [February 20, 2023, 1:15pm UTC](https://root-forum.cern.ch/t/how-to-use-the-addwhitenoise-function-in-garfield/53694 "2023-02-20T13:15:46Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![WAQ](https://root-forum.cern.ch/letter_avatar_proxy/v4/letter/w/e95f7d/32.png) [@WAQ](https://root-forum.cern.ch/u/WAQ)\
**Post date:** [February 20, 2023, 1:15pm UTC](https://root-forum.cern.ch/t/how-to-use-the-addwhitenoise-function-in-garfield/53694/1 "2023-02-20T13:15:46Z")

</div>

Dear experts,  
I am using the AddWhiteNoise() function to simulate the noise of the gaseous detector. But There’s something I don’t understand about this function. Does this function need add to the the induced current signal ? Then, What’s the effection of the parameter(q0) ?

Code:

```
signal View->SetSensor(sensor);
sensor->SetTransferFunction(transfer);

const bool poisson = true;
double enc = 25;
double q0 = 25.;
sensor->AddWhiteNoise(enc,poisson,q0);

constexpr bool fft = true;
sensor->ConvoluteSignals(fft);

signalView->SetCanvas(c1);
signalView->SetLabelY("signal [mv]");
signalView->PlotSignal("readout");

```

---

<div class="post-metadata">

**Author:** ![hschindl](https://root-forum.cern.ch/letter_avatar_proxy/v4/letter/h/977dab/32.png) [@hschindl](https://root-forum.cern.ch/u/hschindl)\
**Post date:** [February 21, 2023, 6:48am UTC](https://root-forum.cern.ch/t/how-to-use-the-addwhitenoise-function-in-garfield/53694/2 "2023-02-21T06:48:00Z")

</div>

Hi,

you can find a description of the formalism behind the `AddWhiteNoise` function in Section 7.1.1 of the user guide:

> **[UserGuide.pdf](https://garfieldpp.web.cern.ch/garfieldpp/documentation/UserGuide.pdf)**
>
> 719.34 KB

With the `poisson` flag set to `true`, q0 is the amplitude of the noise pulses added to the induced current signal.

---

<div class="post-metadata">

**Author:** ![WAQ](https://root-forum.cern.ch/letter_avatar_proxy/v4/letter/w/e95f7d/32.png) [@WAQ](https://root-forum.cern.ch/u/WAQ)\
**Post date:** [February 22, 2023, 1:34am UTC](https://root-forum.cern.ch/t/how-to-use-the-addwhitenoise-function-in-garfield/53694/3 "2023-02-22T01:34:40Z")

</div>

> [@hschindl](#):
>
> you can find a description of the formalism

Thank you for your reply.  
Best wishes!

---

<div class="post-metadata">

**Author:** ![system](https://root-forum.cern.ch/uploads/default/original/3X/e/f/efe4f24398fd8ffeb76bccb6ecc46d9d9c003376.png) [@system](https://root-forum.cern.ch/u/system)\
**Post date:** [March 8, 2023, 1:34am UTC](https://root-forum.cern.ch/t/how-to-use-the-addwhitenoise-function-in-garfield/53694/4 "2023-03-08T01:34:49Z")

</div>

Closed on March 8, 2023, 1:34am UTC

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.
