StuckBitAdcDistortionService.h
Go to the documentation of this file.
1 // StuckBitAdcDistortionService.h
2 //
3 // David Adams
4 // December 2015
5 //
6 // Service that adds stuck bits to ADCs.
7 //
8 // FCL parameters:
9 // StuckBitsProbabilitiesFname - Input file name
10 // StuckBitsOverflowProbHistoName - Name of histogram with overflow probablilities
11 // StuckBitsUnderflowProbHistoName - Name of histogram with underflow probablilities
12 // RandomSeed - Overrides NuRandomService if set nonzero.
13 // LogLevel - (0=none, 1=init only, ...)
14 
15 #ifndef StuckBitAdcDistortionService_H
16 #define StuckBitAdcDistortionService_H
17 
19 #include <string>
20 #include <iostream>
22 
23 namespace fhicl {
24 class ParameterSet;
25 }
26 namespace art {
27 class ActivityRegistry;
28 }
29 namespace CLHEP {
30 class HepRandomEngine;
31 }
32 
34 
35 public:
36 
37  typedef unsigned int Channel;
38 
39  // Ctor.
41 
42  // Dtor.
44 
45  // Modify an input ADC vector.
46  int modify(Channel chan, AdcCountVector& adcvec) const;
47 
48  // Print the configuration.
49  std::ostream& print(std::ostream& out =std::cout, std::string prefix =" ") const;
50 
51 private:
52 
53  // Configuration.
54  std::string fStuckBitsProbabilitiesFname; ///< file holding ADC stuck code probabilities
55  std::string fStuckBitsOverflowProbHistoName; ///< Name of hist with ADC stuck code overflow probs
56  std::string fStuckBitsUnderflowProbHistoName; ///< Name of hist with ADC stuck code underflow probs
59 
60  double fOverflowProbs[64]; ///< array of probs for LSF bits getting stuck at 000000
61  double fUnderflowProbs[64]; ///< array of probs for LSF bits getting stuck at 111111
62 
63  CLHEP::HepRandomEngine* m_pran;
64 
65 };
66 
68 
69 #endif
std::vector< AdcCount > AdcCountVector
Definition: AdcTypes.h:19
std::string string
Definition: nybbler.cc:12
DECLARE_ART_SERVICE_INTERFACE_IMPL(MySharedService, art::test::MyServiceInterface, SHARED) DEFINE_ART_SERVICE_INTERFACE_IMPL(MySharedService
std::string fStuckBitsOverflowProbHistoName
Name of hist with ADC stuck code overflow probs.
std::string fStuckBitsProbabilitiesFname
file holding ADC stuck code probabilities
std::string fStuckBitsUnderflowProbHistoName
Name of hist with ADC stuck code underflow probs.