module LCSlowController verbosity = info enable = true InitBias = 1.543 InitGain = 448 InitResistance = 54 AdjustOffsetAtStartup = true MaxExternalBias = 20. StepMode = log BiasStep = 0.1 ChannelListSource = DB WrongPolarityFile = Q_STRING_DEFAULT GroupSize = 10 FirstGroup = 1 SleepAfterChange = 10 endmod
Public Member Functions | |
MLCSlowController (QSequence *s) | |
constructor | |
virtual | ~MLCSlowController () |
destructor | |
void | Init () |
Init method. | |
QEvent * | Do (QEvent *ev) |
return immediately if there are still measurements to be performed with current electronics configuration, or prepare new configuration if there are no channels that are still waiting for a measurement with current one | |
void | Done () |
Done method. | |
Private Types | |
enum | QLCStepMode { QLC_STEP_LINEAR, QLC_STEP_LOG, QLC_STEP_FILE } |
Private Member Functions | |
void | GroupChannels (const std::list< unsigned int > &channels) |
group logical channels in subgroups | |
void | InitConfig (QEleChannelConfig &conf, const bool polarity) |
init QLCMeasConfig object with default front end settings values | |
void | GetInitParameters () |
get parameters for first measurement from config file (or elsewhere). See config example for the list of init parameters | |
virtual bool | PopulateNextConfig () |
determine electronics configuration for next set of measurements and apply to hardware | |
bool | IncrementExternalBias (int step=0) |
increment or decrement external bias | |
float | GetExtBiasStepSize () const |
get step size (in Volts) for external bias incrementation | |
void | SetExtBiasStepSize (const float size) |
set step size (in Volts) for external bias incrementation | |
Private Attributes | |
std::vector< std::list < unsigned int > > | fGroups |
vector of logical channel subgroups. Each element is in turn a list of logical channels belonging to a given subgroup | |
int | fDefaultBias |
int | fDefaultGain |
bool | fDefaultResistance |
float | fExtBiasStepSize |
float | fDefaultExternalBias |
bool | fAdjustOffsetAtStartup |
QLCStepMode | fStepMode |
std::vector< float > | fExtBiasFromFile |
size_t | fExtBiasIndex |
enum MLCSlowController::QLCStepMode [private] |
void MLCSlowController::Init | ( | ) | [virtual] |
Init method.
This method reads init values from cfg, create channel groups to be processed at each iteration of the load curves sequence and initialize the QLCSlowConfigHandler singleton.
Implements QModule.
References QLCSlowConfigHandler::AddConfig(), QLCSlowConfigHandler::Clear(), QLCSlowConfigHandler::Consolidate(), QBaseModule::Debug(), QBaseModule::Error(), fGroups, QLCSlowConfigHandler::GetCurrentBranch(), QDbDetector::GetCurrentRunNumber(), GetInitParameters(), QLCSlowConfigHandler::GetInstance(), QBaseModule::GetInt(), QDbDetector::GetListOfChannels(), QBaseModule::GetString(), GroupChannels(), QBaseModule::Info(), InitConfig(), QBaseModule::Panic(), QLCSlowConfigHandler::SetActiveChannels(), QLCSlowConfigHandler::SetExternalBias(), QEleChannelConfig::SetLg(), QLCSlowConfigHandler::SetSleepTime(), QLCSlowConfigHandler::SetWrongPolarityChannels(), and QBaseModule::Warn().
void MLCSlowController::GroupChannels | ( | const std::list< unsigned int > & | channels | ) | [private] |
group logical channels in subgroups
channels | list of all logical channels to be grouped |
References fGroups, and QBaseModule::GetInt().
Referenced by Init().
void MLCSlowController::InitConfig | ( | QEleChannelConfig & | conf, | |
const bool | polarity | |||
) | [private] |
init QLCMeasConfig object with default front end settings values
conf | QLCMeasConfig object to be initialized (passed by reference) | |
polarity | bias polarity to be set in new configuration |
References QBaseModule::Error(), fAdjustOffsetAtStartup, fDefaultBias, fDefaultGain, fDefaultResistance, QEleChannelConfig::GetLg(), QEleChannelConfig::SetAdjustOffset(), QEleChannelConfig::SetBias(), QEleChannelConfig::SetBiasPolarity(), QEleChannelConfig::SetExternalBias(), QEleChannelConfig::SetGain(), and QEleChannelConfig::SetLoadResistance().
Referenced by Init(), and PopulateNextConfig().
bool MLCSlowController::PopulateNextConfig | ( | ) | [private, virtual] |
determine electronics configuration for next set of measurements and apply to hardware
References QLCSlowConfigHandler::AddConfig(), QLCSlowConfigHandler::AddNextScheduled(), QLCSlowConfigHandler::Clear(), QLCSlowConfigHandler::Consolidate(), QLCSlowConfigHandler::EraseNextScheduled(), QBaseModule::Error(), fExtBiasIndex, QLCSlowConfigHandler::GetActiveChannels(), QLCSlowConfigHandler::GetCurrentBranch(), QLCSlowConfigHandler::GetExternalBias(), QEleChannelConfig::GetExternalBias(), QLCSlowConfigHandler::GetInstance(), QLCSlowConfigHandler::GetLastConfig(), QLCSlowConfigHandler::GetNextScheduled(), QLCSlowConfigHandler::GoToPositiveBranch(), IncrementExternalBias(), QBaseModule::Info(), InitConfig(), QLCSlowConfigHandler::IsBranchDone(), QLCSlowConfigHandler::IsCurvesDone(), QBaseModule::Panic(), QEleChannelConfig::SetExternalBias(), and QLCSlowConfigHandler::SetExternalBias().
Referenced by Do().
bool MLCSlowController::IncrementExternalBias | ( | int | step = 0 |
) | [private] |
increment or decrement external bias
step | number of step for incrementation, defaults to 0 (automatic). Step size is set by calling SetExtBiasStepSize(). Positive values will increase external bias, while negative values will decrement it. In case of 0 number of steps is determined automatically based on the value of the variable fStepMode. |
References fExtBiasFromFile, fExtBiasIndex, fExtBiasStepSize, fStepMode, QLCSlowConfigHandler::GetExternalBias(), QLCSlowConfigHandler::GetInstance(), QBaseModule::Panic(), QLC_STEP_FILE, QLC_STEP_LINEAR, and QLCSlowConfigHandler::SetExternalBias().
Referenced by PopulateNextConfig().
int MLCSlowController::fDefaultBias [private] |
bias voltage used for 1st measurement
Referenced by GetInitParameters(), and InitConfig().
int MLCSlowController::fDefaultGain [private] |
gain used for 1st measurement
Referenced by GetInitParameters(), and InitConfig().
bool MLCSlowController::fDefaultResistance [private] |
load resistance used for 1st measurement
Referenced by GetInitParameters(), and InitConfig().
float MLCSlowController::fExtBiasStepSize [private] |
external bias incrementation step size in V
Referenced by GetExtBiasStepSize(), GetInitParameters(), IncrementExternalBias(), and SetExtBiasStepSize().
bool MLCSlowController::fAdjustOffsetAtStartup [private] |
if true the offset is adjusted at the startup to the value hardcoded in QLCSlowConfigHandler::ApplyConfig()
Referenced by GetInitParameters(), and InitConfig().
QLCStepMode MLCSlowController::fStepMode [private] |
step mode, defaults to QLC_STEP_LOG
Referenced by GetInitParameters(), and IncrementExternalBias().
std::vector<float> MLCSlowController::fExtBiasFromFile [private] |
contains external bias values if QLC_STEP_FILE is used
Referenced by GetInitParameters(), and IncrementExternalBias().
size_t MLCSlowController::fExtBiasIndex [private] |
keeps track of the next external bias to be used if QLC_STEP_FILE is used
Referenced by IncrementExternalBias(), and PopulateNextConfig().