1 #include <mdet/FrontEnd.h>
3 #include <mdet/Pixel.h>
4 #include <mdet/MHierarchyInfo.h>
25 Register(fMeanSampleRatePeriod);
26 Register(fSampleRatePeriodJitter);
27 Register(fPreT1BufferLength);
28 Register(fPostT1BufferLength);
29 Register(fExternalMemoryBufferLength);
30 Register(fTrueRangeLowThreshold);
31 Register(fFalseRangeHiThreshold);
32 fChannels.Update(GetIdsMap());
100 return GetData<BrokenChannelContainer,utl::ThrowOnZeroDereference,utl::ShadowPtr>(
fBrokenChannels,
"channelsBroken");
107 std::ostringstream msg;
111 std::bitset<64> bit_mask;
118 for ( BrokenChannelContainer::const_iterator chIt = channels->begin(), chIte = channels->end();
119 chIt != chIte; ++chIt ){
120 msg << *chIt <<
" " ;
122 mask |= ULong64_t(1) << *chIt;
126 msg <<
"MD MASK -- " << std::setw( 10 ) << std::setfill(
' ')
128 <<
" ==> (" << bit_mask.count() <<
")\n";
129 msg <<
"mask in decimal: " << std::endl;
130 msg << mask << std::endl;
157 if (v >= fFrontEnd.GetTrueRangeLowThreshold())
159 else if (v <= fFrontEnd.GetFalseRangeHiThreshold())
173 if ( invalidateData )
Sampler(const FrontEnd &fe)
Construct with the associated FrontEnd.
utl::Validated< int > fPreT1BufferLength
utl::ShadowPtr< BrokenChannelContainer > fBrokenChannels
void Update(bool invalidateData, bool invalidateComponents)
Forward to channels and to base-class.
static const char *const kComponentsNames[13]
det::DetectorComponent< C, MManagerProvider > Type
Type specializing det::DetectorComponent for Muon hierarchy.
unsigned int GetPostT1BufferLength() const
Number of bins of the post-T1 buffer.
double GetFalseRangeHiThreshold() const
Hi end-point of the range where the voltage is taken as a false-value by the FPGA sampling process...
void Update(std::vector< double > &init, const std::vector< double > &res)
static const char *const kComponentsIds[13]
Electronic front-end for the modules.
utl::Validated< double > fFalseRangeHiThreshold
unsigned int GetPreT1BufferLength() const
Number of bins of the (cyclic) pre-T1 buffer.
const VManager::IndexMap & GetIdsMap() const
The id identifying this component within its detector hierarhy.
T & GetData(P< T > &d, const std::string &p) const
Common utility function for configuration.
Sampler MakeSampler() const
Create a new sampler object.
double GetMeanSampleRatePeriod() const
Mean electronic sample rate period.
Encapsulates the sampling logic.
bool operator()(double v)
Digitally sample the voltage.
static const char *const kComponentId
const BrokenChannelContainer & GetBrokenChannels() const
List of broken channels.
utl::Validated< double > fMeanSampleRatePeriod
ULong64_t GetMask() const
Size of the (cyclic) external memory buffer associated to each module.
std::map< std::string, std::string > IndexMap
utl::Validated< double > fSampleRatePeriodJitter
double GetSampleRatePeriodJitter() const
Electronic's jitter in sample rate.
utl::Validated< double > fTrueRangeLowThreshold
const Module & GetModule() const
The module to which this FrontEnd belongs.
static const char *const kComponentName
FrontEnd(int fId, const det::VManager::IndexMap &parentMap, const Module &parent)
Constructs the electronic front-end.
double GetTrueRangeLowThreshold() const
Low end-point of the range where the voltage is taken as a true-value by the FPGA sampling proccess...
utl::Validated< int > fPostT1BufferLength
std::vector< int > BrokenChannelContainer