ProtoDUNEChannelNoiseService.h
Go to the documentation of this file.
1 // ProtoDUNEChannelNoiseService
2 
3 // David Adams
4 // January 2016
5 //
6 // Implementation of TPC channel noise model with an exponential
7 // shape in frequency.
8 // Same as the nose model 1 in SimWireDUNE35t, e.g. from dunetpc v04_29_01.
9 //
10 // DLA Feb 2016: Change normalization so RMS does not vary with FFT size.
11 // See https://cdcvs.fnal.gov/redmine/issues/11470.
12 
13 #ifndef ProtoDUNEChannelNoiseService_H
14 #define ProtoDUNEChannelNoiseService_H
15 
17 #include <vector>
18 #include <iostream>
19 
20 class TH1;
21 namespace CLHEP {
22 class HepRandomEngine;
23 }
24 
26 
27 public:
28 
29  // Ctor.
31 
32  // Ctor.
34 
35  // Dtor.
37 
38  // Add noise to a signal array.
39  int addNoise(detinfo::DetectorClocksData const& clockData,
40  detinfo::DetectorPropertiesData const& detProp,
41  Channel chan, AdcSignalVector& sigs) const;
42 
43  // Print the configuration.
44  std::ostream& print(std::ostream& out =std::cout, std::string prefix ="") const;
45 
46  // Fill a noise vector.
47  // Input vector contents are lost.
48  // The size of the vector is obtained from the FFT service.
49  void generateNoise(detinfo::DetectorClocksData const& clockData,
50  float wirelength, float ENOB, float aLowCutoff,
51  AdcSignalVector& noise, TH1* aNoiseHist) const;
52 
53 private:
54 
55  // Fill the noise vectors.
56  void generateNoise(detinfo::DetectorClocksData const& clockData);
57 
58  // Parameters.
59  float fLowCutoffZ; ///< low frequency filter cutoff (kHz) for Z (collection) plane
60  float fLowCutoffU; ///< low frequency filter cutoff (kHz) for U plane
61  float fLowCutoffV; ///< low frequency filter cutoff (kHz) for V plane
62  unsigned int fNoiseArrayPoints; ///< number of points in randomly generated noise array
63  bool fOldNoiseIndex; ///< Use old selection of noise array index
64  float fWhiteNoiseZ; ///< Level (per freq bin) for white noise for Z.
65  float fWhiteNoiseU; ///< Level (per freq bin) for white noise for U.
66  float fWhiteNoiseV; ///< Level (per freq bin) for white noise for V.
67  int fRandomSeed; ///< Seed for random number service. If absent or zero, use SeedSvc.
68  int fLogLevel; ///< Log message level: 0=quiet, 1=init only, 2+=every event
69  float fWirelengthZ;
70  float fWirelengthU;
71  float fWirelengthV;
72  float fENOB;
73 
74  // Noise arrays.
75  AdcSignalVectorVector fNoiseZ; ///< noise on each channel for each time for Z (collection) plane
76  AdcSignalVectorVector fNoiseU; ///< noise on each channel for each time for U plane
77  AdcSignalVectorVector fNoiseV; ///< noise on each channel for each time for V plane
78 
79  // Histograms.
80  //TH1* fNoiseHist; ///< distribution of noise counts // unused
81  TH1* fNoiseHistZ; ///< distribution of noise counts for Z
82  TH1* fNoiseHistU; ///< distribution of noise counts for U
83  TH1* fNoiseHistV; ///< distribution of noise counts for V
84  TH1* fNoiseChanHist; ///< distribution of accessed noise samples
85 
86  CLHEP::HepRandomEngine* m_pran;
87 
88 };
89 
91 
92 #endif
float fWhiteNoiseU
Level (per freq bin) for white noise for U.
std::string string
Definition: nybbler.cc:12
float fWhiteNoiseZ
Level (per freq bin) for white noise for Z.
AdcSignalVectorVector fNoiseZ
noise on each channel for each time for Z (collection) plane
DECLARE_ART_SERVICE_INTERFACE_IMPL(MySharedService, art::test::MyServiceInterface, SHARED) DEFINE_ART_SERVICE_INTERFACE_IMPL(MySharedService
TH1 * fNoiseHistU
distribution of noise counts for U
AdcSignalVectorVector fNoiseV
noise on each channel for each time for V plane
bool fOldNoiseIndex
Use old selection of noise array index.
AdcSignalVectorVector fNoiseU
noise on each channel for each time for U plane
float fLowCutoffV
low frequency filter cutoff (kHz) for V plane
int fRandomSeed
Seed for random number service. If absent or zero, use SeedSvc.
TH1 * fNoiseHistV
distribution of noise counts for V
float fWhiteNoiseV
Level (per freq bin) for white noise for V.
TH1 * fNoiseChanHist
distribution of accessed noise samples
Contains all timing reference information for the detector.
std::vector< AdcSignalVector > AdcSignalVectorVector
Definition: AdcTypes.h:23
std::vector< AdcSignal > AdcSignalVector
Definition: AdcTypes.h:22
TH1 * fNoiseHistZ
distribution of noise counts for Z
int fLogLevel
Log message level: 0=quiet, 1=init only, 2+=every event.
unsigned int fNoiseArrayPoints
number of points in randomly generated noise array
float fLowCutoffZ
low frequency filter cutoff (kHz) for Z (collection) plane
float fLowCutoffU
low frequency filter cutoff (kHz) for U plane