PandaRoot
PndEmcBWEndcapNoiseAdder.h
Go to the documentation of this file.
1 //****************************************************************************
2 //* This file is part of PandaRoot. *
3 //* *
4 //* PandaRoot is distributed under the terms of the *
5 //* GNU General Public License (GPL) version 3, *
6 //* copied verbatim in the file "LICENSE". *
7 //* *
8 //* Copyright (C) 2006 - 2024 FAIR GmbH and copyright holders of PandaRoot *
9 //* The copyright holders are listed in the file "COPYRIGHTHOLDERS". *
10 //* The authors are listed in the file "AUTHORS". *
11 //****************************************************************************
12 
13 //#pragma once
14 #ifndef PNDEMCBWENDCAPNOISEADDER_H_
15 #define PNDEMCBWENDCAPNOISEADDER_H_
16 
18 #include "TString.h"
19 #include "TRandom.h"
20 
21 class PndEmcWaveform;
22 class TVirtualFFT;
23 
30 {
31  public:
34  PndEmcBWEndcapNoiseAdder(Int_t mode, Double_t sampling_rate, const Double_t* ps_freq,
35  const Double_t* ps_power, Int_t ps_size, Double_t adc_noise, Double_t fe_noise,
36  Double_t sigma_ps, Double_t sigma_ges, Int_t seed, Int_t verbose); // mode: 0 - full, 1 - reduced, 2 - last
37 
38  virtual void Modify(PndEmcWaveform* wf);
39 
40  private:
41  Int_t fTraceLength;
42  Int_t fBufferPosition;
43  Int_t fWaveformLength;
44  Int_t fPowerSpecSample;
45  Double_t fSamplingRate;
46  Double_t fAdcNoise;
47  Double_t fFENoise;
48  Double_t fSigmaPs;
49  Double_t fSigmaGes;
50  Double_t fInputScale;
51  const Double_t* fPSFreq;
52  const Double_t* fPSPower;
53  TVirtualFFT* fft;
54  Int_t fVerbose;
55 
56  Int_t fBufferSize;
57  Int_t fPSNoiseMode; // 0 for precision; 1 for speed; 2 for last
58  Double_t fBufferUseRate;
59  Bool_t fBufferIsEmpty;
60  Double_t* fPSNoiseBuffer;
61  Double_t* fBandNoiseBuffer;
62  Double_t* fFFTFreqBuffer;
63  Double_t* fFFTReCoeffBuffer;
64  Double_t* fFFTImCoeffBuffer;
65  void expand_buffer(Int_t wf_size);
66 
67  void get_ps_noise(PndEmcWaveform* wf);
68  void generate_ps_noise();
69  void generate_band_noise(Double_t min_freq, Double_t max_freq);
70  void get_rnd_noise(PndEmcWaveform* wf, Double_t noise);
71 
73 };
74 
75 #endif
interface for waveform modifiers
ClassDef(PndEmcAbsWaveformModifier, 1)
represents a simulated waveform in an emc crystal
virtual void Modify(PndEmcWaveform *wf)
waveform modifier to add noise to waveform