Base class for detector components. More...
#include "det/DetectorComponent.h"
Public Member Functions | |
AddIdMessage (o) | |
int | GetId () const |
The id of this component. More... | |
const VManager::IndexMap & | GetIdsMap () const |
The id identifying this component within its detector hierarhy. More... | |
return o | str () |
Public Attributes | |
std::string | const |
Returns the message that identifies this component. More... | |
const DetectorUserData< C > & | const |
Retrieve the user custom data. More... | |
Protected Member Functions | |
template<typename T , template< typename > class P> | |
T & | GetData (P< T > &d, const std::string &p) const |
Common utility function for configuration. More... | |
template<typename T > | |
T & | GetData (T &d, const std::string &p) const |
Common utility function for configuration. More... | |
void | Register (utl::VValidated &v) |
Register the field so as to allow handling it. More... | |
s<< " ]";}DetectorComponent(int i, const VManager::IndexMap &parentMap):fId(i), fIdsMap(parentMap){Init();}DetectorComponent(const int i):fId(i){Init();}virtual ~DetectorComponent(){}virtual void Update(const bool invalidateData, const bool){for(FieldsContainer::iterator i=fFields.begin(), e=fFields.end();i!=e;++i)(*i) -> | SetValid (false) |
Protected Attributes | |
template<typename T1 , typename T2 , template< typename, typename > class P> | |
T1 & | const |
Doubly-templated variation of common utility. More... | |
template<typename T > | |
T & | const |
Specialization for utl::Validated. More... | |
void | const |
Message that identifies the component. More... | |
s<< "id="<< GetId()<< " [";for(It i=GetIdsMap().begin(), e=GetIdsMap().end();i!=e;++i) s<< " "<< i-> first<< "="<< i-> | second |
Private Types | |
typedef std::vector < utl::VValidated * > | FieldsContainer |
Container for those fields (from the deriving classes) meant to be managed by this object. More... | |
Private Member Functions | |
template<typename T > | |
std::string | BuildLogMessage (const T &d, const std::string &p, const std::string &c) |
All the requested info in a line. More... | |
template<typename T > | |
std::string | BuildLogMessage (const std::list< T > &d, const std::string &p, const std::string &c) |
Overload for list: don't show the list. More... | |
if (f==VManager::eNotFound) | |
void | Init () |
Common object initialization method. More... | |
Private Attributes | |
template<typename R , typename T > | |
R & | const |
Common handler of the case of template-template parameters. More... | |
return | d |
const VManager::Status | f = mngr.GetData(d, p, C::kComponentName, fIdsMap) |
FieldsContainer | fFields |
Keep pointers to the detector-date fields of the particular (deriving) instance. More... | |
int | fId |
Id of the component. More... | |
VManager::IndexMap | fIdsMap |
Identifies this component within its hierarchy. More... | |
utl::ShadowPtr < DetectorUserData< C > > | fUserData |
User customized detector component level data. More... | |
Base class for detector components.
This class provides the common base for detector components, handling identification within the hierarchy and also detector configuration.
C | The actual class of the detector component. |
ManagerProvider | A policy method to resolve the actual manager of this component. |
In C
two fields are expected
In ManagerProvider
an static function with the following signature is expected
Definition at line 83 of file DetectorComponent.h.
|
private |
Container for those fields (from the deriving classes) meant to be managed by this object.
The pointers are not owned by this container, are just a reference through which access the fields.
Despite this container is meant to be used in a context where there's no a-priori knowledge of the final size of the container we use a vector (instead of, say, a list). Typically the size will be in the order of 10s, so there's nothing to worry about; and then favor the simpler (and more space eficient) vector.
Definition at line 99 of file DetectorComponent.h.
det::DetectorComponent< C, ManagerProvider >::AddIdMessage | ( | o | ) |
|
inlineprivate |
All the requested info in a line.
Definition at line 360 of file DetectorComponent.h.
References det::DetectorComponent< C, ManagerProvider >::d, and utl::s.
Referenced by det::DetectorComponent< C, ManagerProvider >::BuildLogMessage().
|
inlineprivate |
Overload for list: don't show the list.
Definition at line 373 of file DetectorComponent.h.
References det::DetectorComponent< C, ManagerProvider >::BuildLogMessage(), G4StationSimulatorOG::p, and utl::s.
|
inlineprotected |
Common utility function for configuration.
Retrieves data from the provided (via this class' template parameter) Manager instance and goes on with initialization.
d | An object of type P<T> wrapping the real of type T. |
p | Property name. The template class P must provide:
|
This is fullfilled by, for instance, utl::ShadowPtr as P and built-in types for T.
Definition at line 191 of file DetectorComponent.h.
References det::DetectorComponent< C, ManagerProvider >::d, and G4StationSimulatorOG::p.
Referenced by mdet::Channel::GetAbsoluteError(), mdet::BackEndSiPM::GetADCOffset(), mdet::BackEndSiPM::GetADCPar1(), mdet::BackEndSiPM::GetADCPar2(), mdet::BackEndSiPM::GetADCPar3(), mdet::BackEndSiPM::GetADCPar4(), mdet::BackEndSiPM::GetADCPar5(), mdet::BackEndSiPM::GetADCPar6(), mdet::BackEndSiPM::GetADCSaturationDown(), mdet::BackEndSiPM::GetADCSaturationUp(), mdet::Module::GetAreaKind(), mdet::Counter::GetAssociatedTankId(), mdet::Fiber::GetAttenuationAmplitudeA(), mdet::Fiber::GetAttenuationAmplitudeASiPM(), mdet::Fiber::GetAttenuationAmplitudeB(), mdet::Fiber::GetAttenuationAmplitudeBSiPM(), mdet::Fiber::GetAttenuationLengthA(), mdet::Fiber::GetAttenuationLengthASiPM(), mdet::Fiber::GetAttenuationLengthB(), mdet::Fiber::GetAttenuationLengthBSiPM(), mdet::Fiber::GetAttenuationReference(), mdet::Fiber::GetAttenuationReferenceEnergy(), mdet::Fiber::GetAttenuationReferenceThickness(), mdet::Module::GetBackgroundMuonsFlux(), mdet::FrontEndSiPM::GetBaseLineFluctuationHG(), mdet::FrontEndSiPM::GetBaseLineFluctuationLG(), mdet::Channel::GetDCGain(), mdet::Fiber::GetDecayTime(), mdet::Scintillator::GetDecayTime(), mdet::FrontEndSiPM::GetDelayBinaryADCMean(), mdet::FrontEndSiPM::GetDelayBinaryADCSigma(), mdet::FrontEndSiPM::GetDigitalBackGroundProbability(), mdet::FrontEndSiPM::GetDigitalBackGroundWidthMean(), mdet::FrontEndSiPM::GetDigitalBackGroundWidthStdDev(), mdet::ChannelSiPM::GetDiscriminatorGain(), mdet::ChannelSiPM::GetDiscriminatorHiLevel(), mdet::Channel::GetDiscriminatorHiLevel(), mdet::ChannelSiPM::GetDiscriminatorLowLevel(), mdet::Channel::GetDiscriminatorLowLevel(), mdet::ChannelSiPM::GetDiscriminatorThreshold(), mdet::ChannelSiPM::GetDiscriminatorTransitionTime(), mdet::Scintillator::GetEpsilon(), mdet::FrontEnd::GetFalseRangeHiThreshold(), mdet::FrontEndSiPM::GetFalseRangeHiThreshold(), mdet::ChannelSiPM::GetFastShaperGain(), mdet::ChannelSiPM::GetFastShaperTime(), mdet::Channel::GetFeedbackResistance(), mdet::BackEndSiPM::GetFirstAdderOffset(), mdet::BackEndSiPM::GetFirstAdderPar1(), mdet::BackEndSiPM::GetFirstAdderPar2(), mdet::BackEndSiPM::GetFirstAdderPar3(), mdet::BackEndSiPM::GetFirstAdderPar4(), mdet::BackEndSiPM::GetFirstAdderPar5(), mdet::BackEndSiPM::GetFirstAdderSaturationDown(), mdet::BackEndSiPM::GetFirstAdderSaturationUp(), mdet::Scintillator::GetHeight(), mdet::Channel::GetHighCutoffFrequency(), mdet::BackEndSiPM::GetHighGainAmplifierAdjustmentFactor(), mdet::BackEndSiPM::GetHighGainAmplifierOffset(), mdet::BackEndSiPM::GetHighGainAmplifierPar1(), mdet::BackEndSiPM::GetHighGainAmplifierPar2(), mdet::BackEndSiPM::GetHighGainAmplifierPar3(), mdet::BackEndSiPM::GetHighGainAmplifierPar4(), mdet::BackEndSiPM::GetHighGainAmplifierPar5(), mdet::BackEndSiPM::GetHighGainAmplifierPar6(), mdet::BackEndSiPM::GetHighGainAmplifierPar7(), mdet::BackEndSiPM::GetHighGainAmplifierPar8(), mdet::BackEndSiPM::GetHighGainAmplifierPar9(), mdet::BackEndSiPM::GetHighGainAmplifierSaturationDown(), mdet::BackEndSiPM::GetHighGainAmplifierSaturationUp(), mdet::Channel::GetInitialIntervalLength(), mdet::Channel::GetInvertingInputResistance(), mdet::Channel::GetIterationsNumber(), mdet::Scintillator::GetLength(), mdet::Scintillator::GetLocalSoilDensity(), mdet::Channel::GetLowCutoffFrequency(), mdet::BackEndSiPM::GetLowGainAmplifierAdjustmentFactor(), mdet::BackEndSiPM::GetLowGainAmplifierOffset(), mdet::BackEndSiPM::GetLowGainAmplifierPar1(), mdet::BackEndSiPM::GetLowGainAmplifierPar2(), mdet::BackEndSiPM::GetLowGainAmplifierPar3(), mdet::BackEndSiPM::GetLowGainAmplifierPar4(), mdet::BackEndSiPM::GetLowGainAmplifierPar5(), mdet::BackEndSiPM::GetLowGainAmplifierPar6(), mdet::BackEndSiPM::GetLowGainAmplifierPar7(), mdet::BackEndSiPM::GetLowGainAmplifierPar8(), mdet::BackEndSiPM::GetLowGainAmplifierPar9(), mdet::BackEndSiPM::GetLowGainAmplifierSaturationDown(), mdet::BackEndSiPM::GetLowGainAmplifierSaturationUp(), mdet::Channel::GetMaxNumberOfErrors(), mdet::FrontEnd::GetMeanSampleRatePeriod(), mdet::FrontEndSiPM::GetMeanSampleRatePeriod(), mdet::BackEndSiPM::GetNumberOfChannelsToGroup(), mdet::Fiber::GetNumericalAperture(), mdet::Fiber::GetOnManifoldLength(), mdet::Module::GetPhotoDetector(), mdet::FrontEndSiPM::GetPostT1BufferLength(), mdet::FrontEnd::GetPostT1BufferLength(), mdet::ChannelSiPM::GetPreAmplifierGain(), mdet::ChannelSiPM::GetPreAmplifierTime(), mdet::FrontEndSiPM::GetPreT1BufferLength(), mdet::FrontEnd::GetPreT1BufferLength(), mdet::SiPM::GetPulseAmplitude1Mean(), mdet::SiPM::GetPulseAmplitude1StdDev(), mdet::SiPM::GetPulseAmplitude2Mean(), mdet::SiPM::GetPulseAmplitude2StdDev(), mdet::SiPM::GetPulseAmplitude3Mean(), mdet::SiPM::GetPulseAmplitude3StdDev(), mdet::Pixel::GetPulseAmplitudeMean(), mdet::Pixel::GetPulseAmplitudeStdDev(), mdet::Pixel::GetPulseChargeMean(), mdet::Pixel::GetPulseChargeStdDev(), mdet::Pixel::GetPulseParametersCorrelation(), mdet::Pixel::GetPulseParametrization(), mdet::SiPM::GetPulseRelevantWidth(), mdet::Pixel::GetPulseRelevantWidth(), mdet::Pixel::GetPulseStdDevMean(), mdet::Pixel::GetPulseStdDevStdDev(), mdet::SiPM::GetPulseTime1Mean(), mdet::SiPM::GetPulseTime1StdDev(), mdet::SiPM::GetPulseTime2Mean(), mdet::SiPM::GetPulseTime2StdDev(), mdet::SiPM::GetPulseTime3Mean(), mdet::SiPM::GetPulseTime3StdDev(), mdet::SiPM::GetPulseTime4Mean(), mdet::SiPM::GetPulseTime4StdDev(), mdet::Fiber::GetRadius(), mdet::Fiber::GetRefractionIndex(), mdet::Channel::GetResponseTime(), mdet::FrontEnd::GetSampleRatePeriodJitter(), mdet::FrontEndSiPM::GetSampleTimeADC(), mdet::BackEndSiPM::GetSecondAdderOffset(), mdet::BackEndSiPM::GetSecondAdderPar1(), mdet::BackEndSiPM::GetSecondAdderPar2(), mdet::BackEndSiPM::GetSecondAdderPar3(), mdet::BackEndSiPM::GetSecondAdderPar4(), mdet::BackEndSiPM::GetSecondAdderPar5(), mdet::BackEndSiPM::GetSecondAdderSaturationDown(), mdet::BackEndSiPM::GetSecondAdderSaturationUp(), mdet::Channel::GetSignalShiftMean(), mdet::Channel::GetSignalShiftStdDev(), mdet::BackEndSiPM::GetSimplifiedGainHG(), mdet::BackEndSiPM::GetSimplifiedGainLG(), mdet::BackEndSiPM::GetSimplifiedTime(), mdet::Channel::GetSlewRate(), mdet::FrontEndSiPM::GetStepADC(), mdet::Channel::GetThreshold(), mdet::FrontEnd::GetTrueRangeLowThreshold(), mdet::FrontEndSiPM::GetTrueRangeLowThreshold(), and mdet::Scintillator::GetWidth().
|
inlineprotected |
Common utility function for configuration.
Overload without wrapping parameter: directly gets the datum as parameter. Typically invoked with T equal to a primitive type (int, double, so on).
Definition at line 232 of file DetectorComponent.h.
|
inline |
The id of this component.
Definition at line 105 of file DetectorComponent.h.
References det::DetectorComponent< C, ManagerProvider >::fId.
Referenced by G4StationSimulatorOG::G4StationConstruction::AssembleUMD(), MuonCounterViewerAG::ScintBuilder::Box(), MdLDFFinderAG::Likelihood2::CalculateCandidateLikelihood(), MdLDFFinderAG::Likelihood3::CalculateCandidateLikelihood(), MdLDFFinderAG::Likelihood::CalculateCandidateLikelihood(), MdLDFFinderAG::MdLDFFinder::CalculateChi2(), MdLDFFinderAG::MdLDFFinder::FillModulesShowerPlaneDistances(), EdepSimulatorAG::PrimaryGenerator::GeneratePrimaries(), mdet::PMT::GetCrossTalk(), det::DetectorComponent< C, ManagerProvider >::Init(), MdOptoElectronicSimulatorAG::MdOptoElectronicSimulator::OptoElectronics(), MdOptoElectronicSimulatorAG::MdOptoElectronicSimulator::PlotChannel(), MdCounterSimulatorAG::MdCounterSimulator::PlotChannel(), MdOptoElectronicSimulatorAG::MdOptoElectronicSimulator::PlotIntegrator(), MdCounterSimulatorAG::MdCounterSimulator::PlotIntegrator(), MdOptoElectronicSimulatorAG::MdOptoElectronicSimulator::ProcessPulses(), MdCounterSimulatorAG::MdCounterSimulator::ProcessPulses(), MdOptoElectronicSimulatorAG::MdOptoElectronicSimulator::ProcessPulsesIntegrator(), MdCounterSimulatorAG::MdCounterSimulator::ProcessPulsesIntegrator(), MdEventSelectorAG::MdEventSelector::RejectTimeOutliers(), EdepSimulatorAG::EdepSimulator::Run(), MuonCounterViewerAG::MuonCounterViewer::Run(), MdCounterSimulatorAG::MdCounterSimulator::RunFromMEventScintillatorSimulated(), MdLDFFinderAG::MdLDFFinder::SetLdfResiduals(), MdOptoElectronicSimulatorAG::MdOptoElectronicSimulator::SimulateElectronics(), MdCounterSimulatorAG::MdCounterSimulator::SimulateElectronics(), and MdCounterSimulatorAG::MdCounterSimulator::SimulatePulses().
|
inline |
The id identifying this component within its detector hierarhy.
Definition at line 111 of file DetectorComponent.h.
References det::DetectorComponent< C, ManagerProvider >::fIdsMap.
Referenced by mdet::Counter::GetModules(), mdet::Module::Module(), mdet::PMT::PMT(), mdet::SiPMArray::Update(), mdet::FrontEnd::Update(), mdet::FrontEndSiPM::Update(), mdet::PMT::Update(), and mdet::Module::Update().
|
inlineprivate |
Definition at line 320 of file DetectorComponent.h.
References ERROR.
|
inlineprivate |
Common object initialization method.
Adds the id of this component to the attribute map, using as key the value specified via the template argument.
Definition at line 392 of file DetectorComponent.h.
References det::DetectorComponent< C, ManagerProvider >::fIdsMap, and det::DetectorComponent< C, ManagerProvider >::GetId().
|
inlineprotected |
Register the field so as to allow handling it.
Definition at line 298 of file DetectorComponent.h.
References det::DetectorComponent< C, ManagerProvider >::fFields.
Referenced by mdet::ChannelSiPM::ChannelSiPM(), mdet::Counter::Counter(), mdet::Module::Module(), and mdet::Scintillator::Scintillator().
|
protected |
return o det::DetectorComponent< C, ManagerProvider >::str | ( | ) |
T & det::DetectorComponent< T >::const |
Returns the message that identifies this component.
To make unambiguous the call in the wrapped version.
This method is just a convenience informative method, not meant to be used for control-flow logic (please do not parse this!).
In the wrapped version, when wrapped type is itself a wrapping template, the compiler has a hard time to decide what to do. So this function was created with the logic formerly contained in the non-wrapped version.
Related to this, see http://www.gotw.ca/publications/mill17.htm.
Definition at line 125 of file DetectorComponent.h.
const DetectorUserData<C>& det::DetectorComponent< C, ManagerProvider >::const |
Retrieve the user custom data.
Definition at line 137 of file DetectorComponent.h.
|
protected |
Doubly-templated variation of common utility.
Needed to be added in response to the addition of a 2nd policy parameter to utl::ShadowPtr.
Definition at line 203 of file DetectorComponent.h.
|
protected |
Specialization for utl::Validated.
To make unambiguous the call in the wrapped version.
In the wrapped version, when wrapped type is itself a wrapping template, the compiler has a hard time to decide what to do. So this function was created with the logic formerly contained in the non-wrapped version.
Related to this, see http://www.gotw.ca/publications/mill17.htm.
Definition at line 216 of file DetectorComponent.h.
|
protected |
Message that identifies the component.
Streams-out a (human-readeable) message identifying the component in the hierarchy. It's meant to be used only in messages sent to the user as a way to identify the component that isssues the message (be it an information, warning or error one).
Maybe it'd have been more idiomatic to overload operator<< but I feel that it would be misleading to "stream out" a DetectorComponent.
Definition at line 250 of file DetectorComponent.h.
|
private |
Common handler of the case of template-template parameters.
The typename R is the return type, that's the wrapped data-type. The typename T is the wrapper type.
Definition at line 341 of file DetectorComponent.h.
|
private |
Definition at line 328 of file DetectorComponent.h.
Referenced by det::DetectorComponent< C, ManagerProvider >::BuildLogMessage(), mdet::Scintillator::ComputeIntersectionWith(), det::DetectorComponent< C, ManagerProvider >::GetData(), and mdet::Scintillator::Intersects().
|
private |
Definition at line 319 of file DetectorComponent.h.
Referenced by mdet::Channel::Discriminator::Init().
|
private |
Keep pointers to the detector-date fields of the particular (deriving) instance.
Definition at line 419 of file DetectorComponent.h.
Referenced by det::DetectorComponent< C, ManagerProvider >::Register().
|
private |
Id of the component.
Definition at line 405 of file DetectorComponent.h.
Referenced by det::DetectorComponent< C, ManagerProvider >::GetId().
|
private |
Identifies this component within its hierarchy.
Contains the id of this component and also those of its parents.
Definition at line 414 of file DetectorComponent.h.
Referenced by det::DetectorComponent< C, ManagerProvider >::GetIdsMap(), and det::DetectorComponent< C, ManagerProvider >::Init().
|
mutableprivate |
User customized detector component level data.
It's contained in a pointer so as to have, precisely, a pointer which doesn't need the full definition of the data (for instance the sizeof of the objects of this class doesn't depend on the sizeof of this user data).
Definition at line 429 of file DetectorComponent.h.
|
protected |
Definition at line 257 of file DetectorComponent.h.
Referenced by MdOptoElectronicSimulatorAG::MdOptoElectronicSimulator::SimulateElectronics(), and MdCounterSimulatorAG::MdCounterSimulator::SimulateElectronics().