FrontEndSiPM.h
Go to the documentation of this file.
1 #ifndef _mdet_FrontEndSiPM_h
2 #define _mdet_FrontEndSiPM_h
3 
4 #include <mdet/MComponentGroup.h>
5 #include <mdet/MDetectorComponent.h>
6 #include <mdet/ChannelSiPM.h>
7 //#include <mdet/BackEndSiPM.h>
8 
9 #include <utl/ShadowPtr_fwd.h> // just forward it, to declare friendship.
10 #include <utl/Validated.h>
11 
12 #include <Rtypes.h> // allow the use of ULong64_t
13 
14 namespace det {
15  struct ComponentUpdater;
16 }
17 
18 namespace mdet {
19 
20  class Module;
21 
35  class FrontEndSiPM :
36  public MDetectorComponent<FrontEndSiPM>::Type {
37  private:
43  public:
53  class Sampler {
54  public:
62  bool operator()(double v);
63  private:
65  friend class FrontEndSiPM;
67  Sampler(const FrontEndSiPM& fe);
71  };
72 
73  static const char* const kComponentName;
74 
75  static const char* const kComponentId;
76 
77  typedef std::vector<int> BrokenChannelContainer;
82  typedef ChannelGroup::ConstIterator ChannelConstIterator;
83 
88  return fChannels.Begin();
89  }
94  return fChannels.End();
95  }
105  double GetMeanSampleRatePeriod() const;
110  unsigned int GetPreT1BufferLength() const;
115  unsigned int GetPostT1BufferLength() const;
120  unsigned int GetBufferLength() const {
122  }
154 // unsigned int GetExternalMemoryBufferLength() const;
159  ULong64_t GetMask() const;
160 
169  const Module& GetModule() const;
173  Sampler MakeSampler() const;
174 
178  double GetSampleTimeADC() const;
179  double GetDelayBinaryADC() const;
183  unsigned short GetADCBaseLineFluctuationLG() const;
184  unsigned short GetADCBaseLineFluctuationHG() const;
185 
189  unsigned short GetADCBaseLineOffsetLG() const;
190  unsigned short GetADCBaseLineOffsetHG() const;
191 
192  short GetInjectDigitalNoiseBin() const;
193  unsigned short GetInjectDigitalNoiseWidth() const;
194  unsigned short GetInjectDigitalNoiseChannel() const;
195 
196  //const BackEndSiPM& GetBackEndSiPM() const;
197  unsigned short GetADCCounts(double value) const;
198 
199  private:
201  void Update(bool invalidateData, bool invalidateComponents);
212  double GetTrueRangeLowThreshold() const;
224  double GetFalseRangeHiThreshold() const;
225 
230  double GetDelayBinaryADCMean() const;
231  double GetDelayBinaryADCSigma() const;
232 
236  double GetStepADC() const;
237 
238 
239  double GetBaseLineFluctuationLG() const;
240  double GetBaseLineFluctuationHG() const;
241 
245  double GetDigitalBackGroundProbability() const;
246  double GetDigitalBackGroundWidthMean() const;
247  double GetDigitalBackGroundWidthStdDev() const;
248 
264  FrontEndSiPM(int fId, const det::VManager::IndexMap& parentMap, const Module& parent);
272  const ChannelGroup& GetChannels() const {
273  return fChannels;
274  }
278  friend class Module;
279 
280  //friend class BackEndSiPM;
289  template<class A1, class A2, class A3, class A4>
290  friend class det::ComponentGroup;
291 
293 
295 
296  /*
297  * Note that managers do not provide unsigned retrievers.
298  * So use internally a signed one, and do a cast at the
299  * accesor: the interface is kept unsigned as I think
300  * that should be (this is the number of bins, no sense to
301  * be negative).
302  */
304  // See fPreT1BufferLength.
306  // See fPreT1BufferLength.
308 
310 
312 
314 
319 
320  /****************************************************
321  * *
322  * Noise Injection *
323  * *
324  ****************************************************/
327 
331 
332  const Module& fModule;
333  //const BackEndSiPM& fBackEndSiPM;
334  };
335 
336 }
337 
338 #endif // _mdet_FrontEndSiPM_h
339 
double GetDigitalBackGroundProbability() const
Noise in digital channel.
pointer with built-in initialization, deletion, deep copying
Definition: ShadowPtr.h:163
utl::Validated< double > fDigitalBackGroundWidthStdDev
Definition: FrontEndSiPM.h:330
utl::Validated< int > fExternalMemoryBufferLength
Definition: FrontEndSiPM.h:307
MComponentGroup< FrontEndSiPM, ChannelSiPM, det::ParentCreator >::Type ChannelGroup
Type for the set of associated mdet::ChannelSiPM.
Definition: FrontEndSiPM.h:42
Defines within it the common (templated) type for muon detector hierarchy components groups...
std::vector< int > BrokenChannelContainer
Definition: FrontEndSiPM.h:77
int fId
Id of the component.
double GetDelayBinaryADCMean() const
Delay between the binary trace and the ADC traces.
double GetSampleTimeADC() const
ADC Sample Time and delay.
Definition: FrontEndSiPM.cc:90
double GetDigitalBackGroundWidthMean() const
const FrontEndSiPM & fFrontEndSiPM
Definition: FrontEndSiPM.h:70
void Update(bool invalidateData, bool invalidateComponents)
Forward to channels and to base-class.
utl::Validated< double > fDigitalBackGroundProbability
Definition: FrontEndSiPM.h:328
double GetStepADC() const
ADC resolution.
Definition: FrontEndSiPM.cc:97
ChannelGroup::ConstIterator ChannelConstIterator
Convenience typedef for const iterator over the contained mdet::Channel instances.
Definition: FrontEndSiPM.h:82
short GetInjectDigitalNoiseBin() const
unsigned short GetADCBaseLineFluctuationLG() const
Noise injection for binary and ADC channels.
const ChannelGroup & GetChannels() const
Retrieves the group of channels.
Definition: FrontEndSiPM.h:272
static const char *const kComponentName
Definition: FrontEndSiPM.h:73
utl::Validated< double > fBaseLineFluctuationHG
Definition: FrontEndSiPM.h:326
double GetTrueRangeLowThreshold() const
Low end-point of the range where the voltage is taken as a true-value by the FPGA sampling proccess...
Definition: FrontEndSiPM.cc:76
Defines within it the common (templated) type for muon detector hierarchy components.
utl::Validated< double > fDelayBinaryADCSigma
Definition: FrontEndSiPM.h:318
double GetBaseLineFluctuationHG() const
unsigned short GetInjectDigitalNoiseWidth() const
ChannelGroup fChannels
Definition: FrontEndSiPM.h:292
utl::Validated< double > fFalseRangeHiThreshold
Definition: FrontEndSiPM.h:311
double GetDelayBinaryADC() const
Encapsulates the sampling logic.
Definition: FrontEndSiPM.h:53
Sampler MakeSampler() const
Create a new sampler object.
utl::Validated< double > fDelayBinaryADCMean
Definition: FrontEndSiPM.h:317
Electronic front-end for the modules.
Definition: FrontEndSiPM.h:35
double GetBaseLineFluctuationLG() const
utl::Validated< double > fStepADC
Definition: FrontEndSiPM.h:316
FrontEndSiPM(int fId, const det::VManager::IndexMap &parentMap, const Module &parent)
Constructs the electronic front-end.
Definition: FrontEndSiPM.cc:26
ChannelConstIterator ChannelsBegin() const
Begin iterator over the contained channels.
Definition: FrontEndSiPM.h:87
Sampler(const FrontEndSiPM &fe)
Construct with the associated FrontEndSiPM.
utl::Validated< double > fBaseLineFluctuationLG
Definition: FrontEndSiPM.h:325
utl::Validated< double > fDigitalBackGroundWidthMean
Definition: FrontEndSiPM.h:329
Array of Scintillator.
double GetMeanSampleRatePeriod() const
Mean electronic sample rate period.
Definition: FrontEndSiPM.cc:53
ULong64_t GetMask() const
Size of the (cyclic) external memory buffer associated to each module.
unsigned int GetPreT1BufferLength() const
Number of bins of the (cyclic) pre-T1 buffer.
Definition: FrontEndSiPM.cc:61
utl::ShadowPtr< BrokenChannelContainer > fBrokenChannels
Definition: FrontEndSiPM.h:313
unsigned int GetPostT1BufferLength() const
Number of bins of the post-T1 buffer.
Definition: FrontEndSiPM.cc:69
const Module & fModule
Definition: FrontEndSiPM.h:332
bool operator()(double v)
Digitally sample the voltage.
const BrokenChannelContainer & GetBrokenChannels() const
List of broken channels.
~FrontEndSiPM()
Destructor (!).
Definition: FrontEndSiPM.h:268
utl::Validated< double > fSampleTimeADC
Definition: FrontEndSiPM.h:315
double GetDelayBinaryADCSigma() const
Base class for group of detector components.
double GetDigitalBackGroundWidthStdDev() const
unsigned short GetADCCounts(double value) const
utl::Validated< int > fPreT1BufferLength
Definition: FrontEndSiPM.h:303
std::map< std::string, std::string > IndexMap
Definition: VManager.h:133
static const char *const kComponentId
Definition: FrontEndSiPM.h:75
double GetFalseRangeHiThreshold() const
Hi end-point of the range where the voltage is taken as a false-value by the FPGA sampling process...
Definition: FrontEndSiPM.cc:83
unsigned short GetADCBaseLineOffsetHG() const
Type
The type of file that we are acutally opening.
Definition: IoCodes.h:33
unsigned short GetADCBaseLineFluctuationHG() const
const Module & GetModule() const
The module to which this FrontEndSiPM belongs.
Definition: FrontEndSiPM.cc:46
utl::Validated< double > fMeanSampleRatePeriod
Definition: FrontEndSiPM.h:294
utl::Validated< double > fTrueRangeLowThreshold
Definition: FrontEndSiPM.h:309
ChannelConstIterator ChannelsEnd() const
End iterator over the contained channels.
Definition: FrontEndSiPM.h:93
unsigned short GetADCBaseLineOffsetLG() const
ADC channels offset.
unsigned short GetInjectDigitalNoiseChannel() const
utl::Validated< int > fPostT1BufferLength
Definition: FrontEndSiPM.h:305
bool fLastSample
By now the criteria is to depend only in the last sample.
Definition: FrontEndSiPM.h:69
unsigned int GetBufferLength() const
Number of bins of the buffer.
Definition: FrontEndSiPM.h:120

, generated on Tue Sep 26 2023.