FrontEnd.h
Go to the documentation of this file.
1 #ifndef _mdet_FrontEnd_h
2 #define _mdet_FrontEnd_h
3 
4 #include <mdet/MComponentGroup.h>
5 #include <mdet/MDetectorComponent.h>
6 #include <mdet/Channel.h>
7 
8 #include <utl/ShadowPtr_fwd.h> // just forward it, to declare friendship.
9 #include <utl/Validated.h>
10 
11 #include <Rtypes.h> // allow the use of ULong64_t
12 
13 namespace det {
14  struct ComponentUpdater; // Actually not needed because PMT.h -> MComponentGroup.h -> ComponentGroup.h
15 }
16 
17 namespace mdet {
18 
19  class Module;
20 
33  class FrontEnd :
34  public MDetectorComponent<FrontEnd>::Type {
35  private:
41  public:
51  class Sampler {
52  public:
60  bool operator()(double v);
61  private:
63  friend class FrontEnd;
65  Sampler(const FrontEnd& fe);
69  };
70 
71  static const char* const kComponentName;
72 
73  static const char* const kComponentId;
74 
75  typedef std::vector<int> BrokenChannelContainer;
80  typedef ChannelGroup::ConstIterator ChannelConstIterator;
81 
86  return fChannels.Begin();
87  }
92  return fChannels.End();
93  }
103  double GetMeanSampleRatePeriod() const;
115  double GetSampleRatePeriodJitter() const;
120  unsigned int GetPreT1BufferLength() const;
125  unsigned int GetPostT1BufferLength() const;
130  unsigned int GetBufferLength() const {
132  }
164 // unsigned int GetExternalMemoryBufferLength() const;
169  ULong64_t GetMask() const;
170 
179  const Module& GetModule() const;
183  Sampler MakeSampler() const;
184  private:
186  void Update(bool invalidateData, bool invalidateComponents);
197  double GetTrueRangeLowThreshold() const;
209  double GetFalseRangeHiThreshold() const;
225  FrontEnd(int fId, const det::VManager::IndexMap& parentMap, const Module& parent);
229  ~FrontEnd() { }
233  const ChannelGroup& GetChannels() const {
234  return fChannels;
235  }
239  friend class Module;
246  friend class utl::ShadowPtr<FrontEnd>;
248  template<class A1, class A2, class A3, class A4>
249  friend class det::ComponentGroup;
250 
252  /*
253  * Sample rate stuff: Jitter handling.
254  */
256 
258  /*
259  * Note that managers do not provide unsigned retrievers.
260  * So use internally a signed one, and do a cast at the
261  * accesor: the interface is kept unsigned as I think
262  * that should be (this is the number of bins, no sense to
263  * be negative).
264  */
266  // See fPreT1BufferLength.
268  // See fPreT1BufferLength.
270 
272 
274 
276 
277  const Module& fModule;
278  };
279 
280 }
281 
282 #endif // _mdet_FrontEnd_h
283 
pointer with built-in initialization, deletion, deep copying
Definition: ShadowPtr.h:163
utl::Validated< int > fExternalMemoryBufferLength
Definition: FrontEnd.h:269
Defines within it the common (templated) type for muon detector hierarchy components groups...
int fId
Id of the component.
utl::Validated< int > fPreT1BufferLength
Definition: FrontEnd.h:265
Sampler(const FrontEnd &fe)
Construct with the associated FrontEnd.
Definition: FrontEnd.cc:144
bool fLastSample
By now the criteria is to depend only in the last sample.
Definition: FrontEnd.h:67
utl::ShadowPtr< BrokenChannelContainer > fBrokenChannels
Definition: FrontEnd.h:275
void Update(bool invalidateData, bool invalidateComponents)
Forward to channels and to base-class.
Definition: FrontEnd.cc:169
Defines within it the common (templated) type for muon detector hierarchy components.
ChannelConstIterator ChannelsEnd() const
End iterator over the contained channels.
Definition: FrontEnd.h:91
unsigned int GetPostT1BufferLength() const
Number of bins of the post-T1 buffer.
Definition: FrontEnd.cc:65
ChannelGroup fChannels
Definition: FrontEnd.h:251
double GetFalseRangeHiThreshold() const
Hi end-point of the range where the voltage is taken as a false-value by the FPGA sampling process...
Definition: FrontEnd.cc:88
Electronic front-end for the modules.
Definition: FrontEnd.h:33
utl::Validated< double > fFalseRangeHiThreshold
Definition: FrontEnd.h:273
unsigned int GetPreT1BufferLength() const
Number of bins of the (cyclic) pre-T1 buffer.
Definition: FrontEnd.cc:57
const ChannelGroup & GetChannels() const
Retrieves the group of channels.
Definition: FrontEnd.h:233
Sampler MakeSampler() const
Create a new sampler object.
Definition: FrontEnd.cc:138
ChannelGroup::ConstIterator ChannelConstIterator
Convenience typedef for const iterator over the contained mdet::Channel instances.
Definition: FrontEnd.h:80
MComponentGroup< FrontEnd, Channel, det::ParentCreator >::Type ChannelGroup
Type for the set of associated mdet::Channel.
Definition: FrontEnd.h:40
double GetMeanSampleRatePeriod() const
Mean electronic sample rate period.
Definition: FrontEnd.cc:43
Encapsulates the sampling logic.
Definition: FrontEnd.h:51
bool operator()(double v)
Digitally sample the voltage.
Definition: FrontEnd.cc:151
Array of Scintillator.
static const char *const kComponentId
Definition: FrontEnd.h:73
const BrokenChannelContainer & GetBrokenChannels() const
List of broken channels.
Definition: FrontEnd.cc:95
unsigned int GetBufferLength() const
Number of bins of the buffer.
Definition: FrontEnd.h:130
utl::Validated< double > fMeanSampleRatePeriod
Definition: FrontEnd.h:255
ULong64_t GetMask() const
Size of the (cyclic) external memory buffer associated to each module.
Definition: FrontEnd.cc:104
Base class for group of detector components.
const Module & fModule
Definition: FrontEnd.h:277
std::map< std::string, std::string > IndexMap
Definition: VManager.h:133
utl::Validated< double > fSampleRatePeriodJitter
Definition: FrontEnd.h:257
double GetSampleRatePeriodJitter() const
Electronic&#39;s jitter in sample rate.
Definition: FrontEnd.cc:50
ChannelConstIterator ChannelsBegin() const
Begin iterator over the contained channels.
Definition: FrontEnd.h:85
utl::Validated< double > fTrueRangeLowThreshold
Definition: FrontEnd.h:271
~FrontEnd()
Destructor (!).
Definition: FrontEnd.h:229
const Module & GetModule() const
The module to which this FrontEnd belongs.
Definition: FrontEnd.cc:36
Type
The type of file that we are acutally opening.
Definition: IoCodes.h:33
static const char *const kComponentName
Definition: FrontEnd.h:71
FrontEnd(int fId, const det::VManager::IndexMap &parentMap, const Module &parent)
Constructs the electronic front-end.
Definition: FrontEnd.cc:20
double GetTrueRangeLowThreshold() const
Low end-point of the range where the voltage is taken as a true-value by the FPGA sampling proccess...
Definition: FrontEnd.cc:81
utl::Validated< int > fPostT1BufferLength
Definition: FrontEnd.h:267
const FrontEnd & fFrontEnd
Definition: FrontEnd.h:68
std::vector< int > BrokenChannelContainer
Definition: FrontEnd.h:75

, generated on Tue Sep 26 2023.