Simulates the electronics of the telescopes. More...
#include <FdElectronicsSimulator.h>
Public Types | |
enum | ResultFlag { eSuccess, eFailure, eBreakLoop, eContinueLoop } |
Flag returned by module methods to the RunController. More... | |
enum | VersionInfoType { eFilename = 1, eRevisionNumber = 2, eDate = 3, eTime = 4, eLastEditor = 5 } |
Different types of version info that can be retrieved from GetVersionInfo. More... | |
Public Member Functions | |
FdElectronicsSimulator () | |
fwk::VModule::ResultFlag | Finish () |
Finish: invoked at end of the run (NOT end of the event) More... | |
bool | GetPeFluctuations () |
Returns true if photo electron fluctuations are enabled. More... | |
utl::Stopwatch & | GetStopwatch () |
const utl::Stopwatch & | GetStopwatch () const |
std::string | GetVersionInfo (const VersionInfoType v) const |
Retrieve different sorts of module version info. More... | |
fwk::VModule::ResultFlag | Init () |
Initialize: invoked at beginning of run (NOT beginning of event) More... | |
void | InitTiming () |
fwk::VModule::ResultFlag | Run (evt::Event &event) |
Run: invoked once per event. More... | |
ResultFlag | RunWithTiming (evt::Event &event) |
void | SetPeFluctuations (bool doFluctuations) |
Set whether photo electron fluctuations should be simulated. More... | |
~FdElectronicsSimulator () | |
Static Public Member Functions | |
static std::string | GetResultFlagByName (const ResultFlag flag) |
Protected Types | |
enum | InfoLevel { eInfoNone = 0, eInfoFinal = 1, eInfoIntermediate = 2, eInfoDebug = 3 } |
Protected Attributes | |
int | fInfoLevel = 0 |
Private Member Functions | |
void | DoTimeConvolution (const std::vector< double > &originalTrace, std::vector< double > &convolutedTrace, unsigned int timeOffset) |
void | ElecSim (fevt::Telescope &tel) |
double | EvalRedThreshold (double npe, int nSamp, double gainVariance) |
bool | InitCamera (fevt::Telescope &tel) |
void | PrepareTimeConvolution (const fdet::Telescope &detTel) |
REGISTER_MODULE ("FdElectronicsSimulatorOG", FdElectronicsSimulator) | |
Private Attributes | |
double | fBandWidthFactor |
int | fBaseline |
std::map< int, double > | fCalibCorrection |
bool | fDoAntiAliasingFilter |
bool | fDrumCalibMode |
std::vector< double > | fErrFuncFactors |
std::map< int, double > | fOpticalEfficiencyCorrection |
std::map< int, double > | fPeBgNoiseTable |
bool | fPeFluctuations |
std::map< int, double > | fQEffAtNormWavelength |
utl::RandomEngine * | fRandomEngine |
std::map< std::string, utl::TabulatedFunction > | fSimThresholdValues |
bool | fThresholdBoxCarReducedInMon |
bool | fThresholdMode |
bool | fUseMonitoring |
bool | fUseNewThreshold |
int | fVerbosityLevel |
Simulates the electronics of the telescopes.
Definition at line 51 of file FdElectronicsSimulator.h.
|
protectedinherited |
|
inherited |
Flag returned by module methods to the RunController.
Enumerator | |
---|---|
eSuccess |
Report success to RunController. |
eFailure |
Report failure to RunController, causing RunController to terminate execution. |
eBreakLoop |
Break current loop. It works for nested loops too! |
eContinueLoop |
Skip remaining modules in the current loop and continue with next iteration of the loop. |
|
inherited |
FdElectronicsSimulator::FdElectronicsSimulator | ( | ) |
Definition at line 75 of file FdElectronicsSimulator.cc.
FdElectronicsSimulator::~FdElectronicsSimulator | ( | ) |
Definition at line 86 of file FdElectronicsSimulator.cc.
|
private |
Definition at line 810 of file FdElectronicsSimulator.cc.
References utl::abs(), ERROR, and fErrFuncFactors.
Referenced by ElecSim().
|
private |
Definition at line 492 of file FdElectronicsSimulator.cc.
References DoTimeConvolution(), fevt::ComponentSelector::eDeSelected, ERROR, fevt::FdConstants::eTotal, fBandWidthFactor, fBaseline, fCalibCorrection, fDoAntiAliasingFilter, fErrFuncFactors, fOpticalEfficiencyCorrection, fPeBgNoiseTable, fPeFluctuations, fQEffAtNormWavelength, fRandomEngine, fVerbosityLevel, fdet::Camera::GetADCDynamicRange(), fdet::Telescope::GetCamera(), fevt::Telescope::GetChannel(), fdet::Telescope::GetChannel(), fdet::Camera::GetCutoffFrequency(), fdet::Channel::GetElectronicNoiseVariance(), fdet::Channel::GetElectronicsGain(), utl::RandomEngine::GetEngine(), fevt::Telescope::GetEyeId(), fdet::Camera::GetFADCBinSize(), fevt::ChannelSimData::GetFADCTrace(), fdet::Camera::GetFADCTraceLength(), fdet::Channel::GetGainVariance(), fdet::Channel::GetId(), fevt::Telescope::GetId(), fdet::Telescope::GetLastPixelId(), fevt::PixelSimData::GetMean(), fevt::TelescopeSimData::GetNumberOfPhotonBins(), fevt::PixelSimData::GetPhotonTrace(), fevt::Telescope::GetPixel(), fdet::Channel::GetPixelId(), fevt::Pixel::GetSimData(), fevt::Channel::GetSimData(), fevt::Telescope::GetSimData(), utl::Trace< T >::GetSize(), fdet::Camera::GetSLTTriggerBin(), fevt::Pixel::GetStatus(), fdet::FDetector::GetTelescope(), fdet::Channel::GetVirtualChannelId(), fevt::Telescope::HasChannel(), fevt::ChannelSimData::HasFADCTrace(), fevt::PixelSimData::HasPhotonTrace(), fevt::Telescope::HasPixel(), fevt::Pixel::HasSimData(), fevt::Channel::HasSimData(), fdet::Channel::IsVirtual(), utl::kPi, fevt::Telescope::MakeChannel(), fevt::ChannelSimData::MakeFADCTrace(), fevt::Channel::MakeSimData(), max, ns, and sqrt().
Referenced by Run().
|
private |
Definition at line 845 of file FdElectronicsSimulator.cc.
References ERROR.
Referenced by InitCamera().
|
virtual |
Finish: invoked at end of the run (NOT end of the event)
This method is for things that should be done at the end of the run (for example, closing files or writing out histograms) {You must override this method in your concrete module}
Implements fwk::VModule.
Definition at line 248 of file FdElectronicsSimulator.cc.
References fwk::VModule::eSuccess.
|
inline |
Returns true if photo electron fluctuations are enabled.
Definition at line 63 of file FdElectronicsSimulator.h.
References fPeFluctuations.
|
staticinherited |
Definition at line 8 of file VModule.cc.
References fwk::VModule::eBreakLoop, fwk::VModule::eContinueLoop, fwk::VModule::eFailure, and fwk::VModule::eSuccess.
Referenced by fwk::RunController::DoNextInSequence(), fwk::RunController::FinishBranch(), and fwk::RunController::InitBranch().
|
inlineinherited |
Definition at line 106 of file VModule.h.
References fwk::VModule::fStopwatch.
|
inlineinherited |
Definition at line 107 of file VModule.h.
References fwk::VModule::fStopwatch.
|
inherited |
Retrieve different sorts of module version info.
Definition at line 26 of file VModule.cc.
Referenced by fwk::CentralConfig::GetConfig(), ThresholdCalculatorKG::ThresholdCalculator::Init(), fdDoubleBumpFinder::FdDoubleBumpFinder::Init(), LaserGeneratorNA::LaserGenerator::Init(), LaserLightSimulatorNA::LaserLightSimulator::Init(), Init(), TelescopeSimulatorKG::TelescopeSimulator::Init(), TelescopeSimulatorKG2::TelescopeSimulator::Init(), SdSimpleSimKG::SdSimpleSim::Init(), ShowerPhotonGeneratorOG::ShowerPhotonGenerator::Init(), and testRunController::testModuleVersionInfo().
|
virtual |
Initialize: invoked at beginning of run (NOT beginning of event)
This method is for things that should be done once at the beginning of a run (for example, booking histograms, performing calculations that need to be done only once, initializing parameters) {You must override this method in your concrete module}
Implements fwk::VModule.
Definition at line 91 of file FdElectronicsSimulator.cc.
References fwk::VModule::eSuccess, fBaseline, fDoAntiAliasingFilter, fPeFluctuations, fRandomEngine, fSimThresholdValues, fThresholdBoxCarReducedInMon, fThresholdMode, fUseMonitoring, fUseNewThreshold, fVerbosityLevel, utl::Branch::GetAttributes(), utl::Branch::GetChild(), utl::Branch::GetData(), utl::Branch::GetFirstChild(), fwk::CentralConfig::GetTopBranch(), fwk::VModule::GetVersionInfo(), and INFO.
|
private |
Definition at line 255 of file FdElectronicsSimulator.cc.
References fevt::FdConstants::eBackground, fevt::ComponentSelector::eDeSelected, fdet::Pixel::eGood, ERROR, EvalRedThreshold(), fBandWidthFactor, fBaseline, fCalibCorrection, fDrumCalibMode, fOpticalEfficiencyCorrection, fPeBgNoiseTable, fQEffAtNormWavelength, fSimThresholdValues, fThresholdBoxCarReducedInMon, fThresholdMode, fUseMonitoring, fUseNewThreshold, fVerbosityLevel, fdet::Channel::GetADCVariance(), fdet::Channel::GetBaseline(), fdet::Telescope::GetCamera(), fdet::FDetector::GetChannel(), fevt::TelescopeSimData::GetConfigSignature(), fdet::Channel::GetElectronicNoiseVariance(), fdet::Channel::GetElectronicsGain(), fdet::Pixel::GetEndToEndCalibrationConstant(), fdet::Pixel::GetEndToEndCalibrationConstantAtReferenceWavelength(), fevt::Pixel::GetEyeId(), fevt::Telescope::GetEyeId(), fdet::Camera::GetFADCBinSize(), fdet::Camera::GetFLTBoxcarSumLength(), fdet::Channel::GetGainVariance(), fevt::Telescope::GetId(), fdet::Telescope::GetLastPixelId(), fevt::PixelSimData::GetMeanBgPhotonFlux(), utl::TabulatedFunction::GetNPoints(), fdet::Pixel::GetOpticalEfficiencyCorrectionAtReferenceWavelength(), fevt::PixelSimData::GetPhotonTrace(), fevt::Telescope::GetPixel(), fdet::FDetector::GetPixel(), fdet::Pixel::GetQEfficiency(), fdet::FDetector::GetReferenceLambda(), fevt::Pixel::GetSimData(), fevt::Telescope::GetSimData(), fdet::Pixel::GetSimulatedEndToEndCalibration(), fevt::Pixel::GetStatus(), fdet::Pixel::GetStatus(), fdet::FDetector::GetTelescope(), fevt::Pixel::GetTelescopeId(), fdet::Channel::GetThreshold(), fdet::Camera::GetThresholdConfigSignature(), fdet::Telescope::HasCorrectorRing(), fevt::PixelSimData::HasPhotonTrace(), fevt::Telescope::HasPixel(), fevt::Pixel::HasSimData(), fdet::Channel::IsVirtual(), ns, PrepareTimeConvolution(), fevt::PixelSimData::SetMean(), fevt::PixelSimData::SetNumSamples(), fevt::PixelSimData::SetRMS(), fevt::Pixel::SetStatus(), fevt::PixelSimData::SetThreshold(), sqrt(), WARNING, and utl::TabulatedFunction::Y().
Referenced by Run().
|
inlineinherited |
Definition at line 95 of file VModule.h.
References fwk::VModule::fStopwatch, and utl::Stopwatch::Reset().
|
private |
Definition at line 748 of file FdElectronicsSimulator.cc.
References ERROR, fBandWidthFactor, fErrFuncFactors, fdet::Telescope::GetCamera(), fdet::Camera::GetCutoffFrequency(), fdet::Camera::GetFADCBinSize(), utl::kPi, utl::kTwoPi, and sqrt().
Referenced by InitCamera().
|
private |
|
virtual |
Run: invoked once per event.
This method is for things that should be done once per event {You must override this method in your concrete module}
Implements fwk::VModule.
Definition at line 163 of file FdElectronicsSimulator.cc.
References fevt::ComponentSelector::eDeSelected, fwk::VModule::eFailure, fevt::ComponentSelector::eInDAQ, ElecSim(), ERROR, fwk::VModule::eSuccess, fevt::FEvent::EyesBegin(), fevt::FEvent::EyesEnd(), fDrumCalibMode, fVerbosityLevel, fevt::Eye::GetId(), fevt::Telescope::GetId(), evt::Event::HasFEvent(), INFO, InitCamera(), fevt::Telescope::PixelsBegin(), fevt::Telescope::PixelsEnd(), fevt::Eye::SetStatus(), fevt::Telescope::SetStatus(), fevt::Eye::TelescopesBegin(), and fevt::Eye::TelescopesEnd().
|
inlineinherited |
Definition at line 98 of file VModule.h.
References fwk::VModule::fStopwatch, fwk::VModule::Run(), utl::Stopwatch::Start(), and utl::Stopwatch::Stop().
Referenced by fwk::RunController::DoNextInSequence().
|
inline |
Set whether photo electron fluctuations should be simulated.
Definition at line 65 of file FdElectronicsSimulator.h.
References fPeFluctuations.
|
private |
Definition at line 96 of file FdElectronicsSimulator.h.
Referenced by ElecSim(), InitCamera(), and PrepareTimeConvolution().
|
private |
Definition at line 78 of file FdElectronicsSimulator.h.
Referenced by ElecSim(), Init(), and InitCamera().
|
private |
Definition at line 91 of file FdElectronicsSimulator.h.
Referenced by ElecSim(), and InitCamera().
|
private |
Definition at line 74 of file FdElectronicsSimulator.h.
|
private |
Definition at line 82 of file FdElectronicsSimulator.h.
Referenced by InitCamera(), and Run().
|
private |
Definition at line 95 of file FdElectronicsSimulator.h.
Referenced by DoTimeConvolution(), ElecSim(), and PrepareTimeConvolution().
|
protectedinherited |
Definition at line 123 of file VModule.h.
Referenced by RdChannelASCIINoiseImporterRD::RdChannelASCIINoiseImporterRD::Init(), Rd2dLDFFitter::Rd2dLDFFitter::Init(), RdChannelNoiseImporter_AERA::RdChannelNoiseImporter_AERA::Init(), and Rd2dLDFFitter::Rd2dLDFFitter::Run().
|
private |
Definition at line 93 of file FdElectronicsSimulator.h.
Referenced by ElecSim(), and InitCamera().
|
private |
Definition at line 89 of file FdElectronicsSimulator.h.
Referenced by ElecSim(), and InitCamera().
|
private |
Definition at line 73 of file FdElectronicsSimulator.h.
Referenced by ElecSim(), GetPeFluctuations(), Init(), and SetPeFluctuations().
|
private |
Definition at line 92 of file FdElectronicsSimulator.h.
Referenced by ElecSim(), and InitCamera().
|
private |
Definition at line 106 of file FdElectronicsSimulator.h.
|
private |
Definition at line 85 of file FdElectronicsSimulator.h.
Referenced by Init(), and InitCamera().
|
private |
Definition at line 80 of file FdElectronicsSimulator.h.
Referenced by Init(), and InitCamera().
|
private |
Definition at line 87 of file FdElectronicsSimulator.h.
Referenced by Init(), and InitCamera().
|
private |
Definition at line 79 of file FdElectronicsSimulator.h.
Referenced by Init(), and InitCamera().
|
private |
Definition at line 84 of file FdElectronicsSimulator.h.
Referenced by Init(), and InitCamera().
|
private |
Definition at line 71 of file FdElectronicsSimulator.h.
Referenced by ElecSim(), Init(), InitCamera(), and Run().