PandaRoot
BSEmcBwEndcapNoiseAdder.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 BSEMCBWENDCAPNOISEADDER_HH
15 #define BSEMCBWENDCAPNOISEADDER_HH
16 
17 #include "Rtypes.h"
18 #include "RtypesCore.h"
19 #include "TString.h"
20 
22 
23 class BSEmcWaveform;
24 class TVirtualFFT;
25 class TBuffer;
26 class TClass;
27 class TMemberInspector;
28 
35  public:
37  virtual ~BSEmcBwEndcapNoiseAdder();
38  BSEmcBwEndcapNoiseAdder(Int_t t_mode, Double_t t_sampling_rate, const Double_t *t_ps_freq, const Double_t *t_ps_power, Int_t t_ps_size, Double_t t_adc_noise, Double_t t_fe_noise,
39  Double_t t_sigma_ps, Double_t t_sigma_ges, Int_t t_seed, Int_t t_verbose); // mode: 0 - full, 1 - reduced, 2 - last
40 
41  virtual void Modify(BSEmcWaveform *t_wf) /*override*/;
42 
43  private:
44  Int_t fTraceLength{128};
45  Int_t fBufferPosition{0};
46  Int_t fWaveformLength{0};
47  Int_t fPowerSpecSample{0};
48  Double_t fSamplingRate{0};
49  Double_t fAdcNoise{0};
50  Double_t fFENoise{0};
51  Double_t fSigmaPs{0};
52  Double_t fSigmaGes{0};
53  Double_t fInputScale{0};
54  const Double_t *fPSFreq{nullptr};
55  const Double_t *fPSPower{nullptr};
56  TVirtualFFT *fft{nullptr};
57  Int_t fVerbose{0};
58 
59  Int_t fBufferSize{0};
60  Int_t fPSNoiseMode{1}; // 0 for precision; 1 for speed; 2 for last
61  Double_t fBufferUseRate{0};
62  Bool_t fBufferIsEmpty{kTRUE};
63  Double_t *fPSNoiseBuffer{nullptr};
64  Double_t *fBandNoiseBuffer{nullptr};
65  Double_t *fFFTFreqBuffer{nullptr};
66  Double_t *fFFTReCoeffBuffer{nullptr};
67  Double_t *fFFTImCoeffBuffer{nullptr};
68 
69  void expand_buffer(Int_t t_wf_size);
70 
71  void get_ps_noise(BSEmcWaveform *t_wf);
72  void generate_ps_noise();
73  void generate_band_noise(Double_t t_min_freq, Double_t t_max_freq);
74  void get_rnd_noise(BSEmcWaveform *t_wf, Double_t t_noise);
75 
77 };
78 
79 #endif /*BSEMCBWENDCAPNOISEADDER_HH*/
represents a simulated waveform in an emc crystal
Definition: BSEmcWaveform.h:75
virtual ~BSEmcBwEndcapNoiseAdder()
waveform modifier to add noise to waveform
interface for waveform modifiers
ClassDef(BSEmcAbsWaveformModifier, 1)
virtual void Modify(BSEmcWaveform *t_wf)