Describe your module. In one sentence. More...
#include <MdCounterSimulatorAG/MdCounterSimulator.h>
Classes | |
struct | SignalInformation |
Simple struct to store signal information in containers. More... | |
Public Types | |
typedef utl::TraceC | FrequencyTrace |
enum | IntegratorSimulationType { eStepByStep, eSimplified } |
enum | ResultFlag { eSuccess, eFailure, eBreakLoop, eContinueLoop } |
Flag returned by module methods to the RunController. More... | |
enum | SimulationType { eFromMEvent, eFromMEventSimulatedScint } |
Kind of possible simulation to be performed. More... | |
typedef utl::TraceD | TimeTrace |
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 | |
VModule::ResultFlag | Finish () |
Finish: invoked at end of the run (NOT end of the event) More... | |
utl::Stopwatch & | GetStopwatch () |
const utl::Stopwatch & | GetStopwatch () const |
std::string | GetVersionInfo (const VersionInfoType v) const |
Retrieve different sorts of module version info. More... | |
VModule::ResultFlag | Init () |
Initialize: invoked at beginning of run (NOT beginning of event) More... | |
void | InitTiming () |
MdCounterSimulator () | |
VModule::ResultFlag | Run (evt::Event &e) |
Run: invoked once per event. More... | |
ResultFlag | RunWithTiming (evt::Event &event) |
~MdCounterSimulator () | |
Static Public Member Functions | |
static std::string | GetResultFlagByName (const ResultFlag flag) |
Static Public Attributes | |
static const char *const | kIntegratorSimulationTypeTags [] = { "StepByStep", "Simplified"} |
Tags for the types of integrator simulation. More... | |
static const char *const | kSimulationTypeTags [] = { "FromMEvent", "FromMEventSimulatedScint"} |
Tags for the types of simulation. More... | |
Protected Types | |
enum | InfoLevel { eInfoNone = 0, eInfoFinal = 1, eInfoIntermediate = 2, eInfoDebug = 3 } |
Protected Attributes | |
int | fInfoLevel = 0 |
Private Types | |
typedef int | ParticleType |
Simple own typedef for the real datatype of the particles' type. In the class utl::Particle there's a nested enumeration, tough the method utl::Particle::GetType returns a plain int: that's why this typedef uses int. More... | |
typedef std::list < mdet::Pixel::SPE > | PulseContainer |
typedef std::map< int, SignalInformation > | SignalsMap |
Map associating the information with IDs (meant to be from pixel's). More... | |
typedef std::list< mdet::SiPM::PE > | SiPMPulseContainer |
Private Member Functions | |
virtual void | ApplyBackEndTransfer (const mdet::BackEndSiPM &backEnd, const double maxTimePreFE, const double minTimePreFE, TimeTrace &traceAfterADCLowGain, TimeTrace &traceAfterADCHighGain, TVectorD &totalAnalogicalInput, const std::vector< utl::TraceD > traceAnalogical) |
virtual void | ApplyBackEndTransferWStepSaturation (const mdet::BackEndSiPM &backEnd, const double maxTimePreFE, const double minTimePreFE, TimeTrace &traceAfterADCLowGain, TimeTrace &traceAfterADCHighGain, TVectorD &totalAnalogicalInput, const std::vector< utl::TraceD > traceAnalogical) |
virtual void | ApplyCITIROCTransfer (const mdet::ChannelSiPM &channel, const SignalInformation &si, const double pulseTimeSpan, double minTimePreFE, double analogicTraceStartTime, double analogicTraceEndTime, TimeTrace &totalPulsePostFrontEndTrace, TimeTrace &totalPulsePostDiscriminatorTrace, utl::TraceD &traceAnalogical) |
virtual void | ApplyTransferBlock (utl::FFTDataContainer< utl::Trace, TimeTrace::ValueType, FrequencyTrace::ValueType > &fft, const mdet::BackEndSiPM &backEnd, BackEndSiPM::TransferStep step) |
virtual void | ApplyTransferBlocks (utl::FFTDataContainer< utl::Trace, TimeTrace::ValueType, FrequencyTrace::ValueType > &fft, utl::FFTDataContainer< utl::Trace, TimeTrace::ValueType, FrequencyTrace::ValueType > &fftHG, const mdet::BackEndSiPM &backEnd) |
void | Dump (const TF1 &fun, const std::string &suffix) |
Helper to dump a TF1 to the configured file. More... | |
virtual double | GetPulseTimeSpan (const SignalInformation &si, const utl::TimeStamp &eventTime, double &minTimePreFE, double &maxTimePreFE, double &analogicTraceStartTime, double &analogicTraceEndTime) |
int | GetTriggerTimeFromSD (evt::Event &, const mdet::Counter &, mevt::MEvent::CounterIterator, double &) |
Retrieve T1 time from associated SD tank. More... | |
void | Init (std::unique_ptr< utl::TabularStream > &pt, unsigned int nCol) const |
Helper to init a tabular stream. More... | |
virtual void | InjectDigitalNoise (const mdet::Module &module, mevt::Module &evtModule) |
virtual void | PlotChannel (const double traceStartTime, const double minTimePreFE, const double binning, const mdet::ChannelSiPM &channel, utl::TraceD &traceAnalogical, TimeTrace &totalPulsePostFrontEndTrace, TimeTrace &totalPulsePostDiscriminatorTrace, utl::TraceB &trace) |
virtual void | PlotIntegrator (const double traceStartTime, const double minTimePreFE, const double binning, const mdet::FrontEndSiPM &frontEnd, TVectorD &traceAnalogical, TimeTrace &traceIntegratorAAmplifier, TimeTrace &traceIntegratorBAmplifier, utl::TraceUSI &traceIntegratorA, utl::TraceUSI &traceIntegratorB) |
virtual void | ProcessPulses (const mdet::Channel &c, const SignalInformation &signalInfo, utl::TraceB &trace, double &span, const utl::TimeInterval &traceStart, const utl::TimeStamp &eventTime) |
Process: analyze, electronic simulation and sampling. More... | |
virtual void | ProcessPulses (const mdet::ChannelSiPM &c, const SignalInformation &signalInfo, utl::TraceB &trace, utl::TraceD &analogSignal, double &span, const utl::TimeInterval &traceStart, double &minTimePreFE, double &maxTimePreFE, double &analogicTraceStartTime, double &analogicTraceEndTime) |
virtual void | ProcessPulsesIntegrator (const mdet::Module &module, std::vector< utl::TraceD > analogicalTraces, utl::TraceUSI &traceIntegratorA, utl::TraceUSI &traceIntegratorB, const utl::TimeInterval &traceStart, double &minTimePreFE, double &maxTimePreFE) |
REGISTER_MODULE ("MdCounterSimulatorAG", MdCounterSimulator) | |
VModule::ResultFlag | RunFromMEvent (evt::Event &e) |
Run for the eFromEvent enumeration. More... | |
VModule::ResultFlag | RunFromMEventScintillatorSimulated (evt::Event &e) |
virtual void | SampleTrace (double minTimePostFE, double maxTimePostFE, double binning, const mdet::FrontEndSiPM &frontEnd, const utl::TimeInterval &traceStart, TimeTrace &totalPulsePostDiscriminatorTrace, utl::TraceB &trace) |
virtual void | SampleTraceADC (const double minTimePostFE, const double maxTimePostFE, const mdet::FrontEndSiPM &frontEnd, const utl::TimeInterval &traceStart, TimeTrace &traceAfterADCLowGain, TimeTrace &traceAfterADCHighGain, utl::TraceUSI &traceIntegratorA, utl::TraceUSI &traceIntegratorB) |
virtual VModule::ResultFlag | SimulateElectronics (mevt::Module &evtModule, const mdet::Module &module, const SignalsMap &sm, const utl::TimeStamp &eventTime) |
Peform the simulation of the electronics response. More... | |
virtual VModule::ResultFlag | SimulatePulses (const mdet::Scintillator &scint, const mevt::ScintillatorSimData &ssd, mevt::ScintillatorSimData &ssd_nonconst, SignalsMap &sm) |
Perform the simulation given the particles in the scintillator. More... | |
Private Attributes | |
std::set< ParticleType > | fAllowedParticleTypes |
Particle types that are considered to generate signal, if empty then every kind of particle is allowed. More... | |
bool | fForcedSDTrigger |
Ignore WCD trigger condition. More... | |
bool | fGeneratePostFETotalPulseOutput |
To include the total pulse after front-end in the output file. More... | |
bool | fGeneratePreFETotalPulseOutput |
To include the total pulse prior front-end in the output file. More... | |
bool | fGenerateSPEPulseOutput |
To include individual pulses samples in the output file. More... | |
bool | fIgnoreCrossTalk |
Ignore cross-talk effects. More... | |
bool | fIncludeBaseLineFluctuationIntegrator |
To simulate baseline fluctuation in the integrator output. More... | |
bool | fInjectNoiseBinary |
To inject noise in binary traces. More... | |
IntegratorSimulationType | fIntegratorSimType |
Type of integrator simulation. Step by step simulates the complete transfer functions and applies saturation and offsets in each step (very slow). In fast mode the whole transfer is simplified to a low pass filter. More... | |
utl::MessageLoggerConfig | fLog |
Output messages handler. More... | |
unsigned int | fMaxSPE |
Maximum number of spe (inclusive). More... | |
unsigned int | fMinSPE |
Minimum number of spe (inclusive). More... | |
unsigned int | fNBinsHistograms |
Number of bins for histograms. More... | |
unsigned int | fNDiscretization |
Discretization over the continuous functions. More... | |
unsigned int | fNPulseSamples |
Number of samples to use in the output files for pulses. More... | |
unsigned int | fNRepetitions |
Repetitions for in-module loop. More... | |
unsigned int | fNumPlotPoints |
Number of points to be used in plotting (theoretically) continuous functions. More... | |
bool | fPlotChannelPulses |
bool | fPlotDelay |
bool | fPlotFftPostAmp |
bool | fPlotFftPriorAmp |
std::vector< std::string > | fPlotFileExtensions |
File extensions for plots (dot included). More... | |
bool | fPlotInputOutput |
bool | fPlotOutcome |
bool | fPlotTransferAmpResponse |
bool | fPlotTransferPhaseResponse |
std::ofstream | fPulseFile |
Associated stream. More... | |
std::string | fPulseFilename |
Pulse output file filename. More... | |
double | fPulseSampleWindow |
Define the length of the window within which the pulse is sampled. More... | |
unsigned int | fRunNumber |
Tracks the number of runs. More... | |
SimulationType | fSimType |
Type of simulation. More... | |
unsigned int | fStepSPE |
Step size for spe iteration. More... | |
TStyle * | fStyle |
bool | fToggleDelay |
bool | fToggleFftPriorAmp |
bool | fToggleInputOutput |
bool | fToggleOutcome |
bool | fTogglePlotchannelPulses |
bool | fTogglePlotFftPostAmp |
bool | fToggleTransferAmpResponse |
bool | fToggleTransferPhaseResponse |
utl::UnitsConfig | fUnits |
Units configuration. More... | |
Describe your module. In one sentence.
Simulate the signal from impinging muons in scintillators.
Now here a longer description in doxygen. You may use HTML.
Actually the module has several "run modes"; the most important one performs the simulation based on the Offline-event information associated with the scintillators.
Basically the workflow is: iterate over particles, simulate SPEs for each of them, see where each SPE ends (crosstalk effects). Then gather together all the SPEs from each channel and the simulate the electronic response: pulse amplification, discrimination and sampling.
This workflow is materialized in three methods so far: SimulatePulses and SimulateElectronics (this last one which calls ProcessPulses). This methods are defined as virtual so as to allow deriving class and customization of some particular stage.
In the future: more stages could be defined (and so new methods) or directly most of this information could be put in the event.
Definition at line 96 of file MdCounterSimulator.h.
Definition at line 123 of file MdCounterSimulator.h.
|
private |
Simple own typedef for the real datatype of the particles' type. In the class utl::Particle there's a nested enumeration, tough the method utl::Particle::GetType returns a plain int: that's why this typedef uses int.
Definition at line 446 of file MdCounterSimulator.h.
|
private |
Definition at line 125 of file MdCounterSimulator.h.
|
private |
Map associating the information with IDs (meant to be from pixel's).
Definition at line 154 of file MdCounterSimulator.h.
|
private |
Definition at line 126 of file MdCounterSimulator.h.
Definition at line 122 of file MdCounterSimulator.h.
|
protectedinherited |
Enumerator | |
---|---|
eStepByStep |
Simulate the inteagrator with intermediate saturation steps and full transfer functions (very consuming) |
eSimplified |
Simulate the integrator in one step with simplified transfer |
Definition at line 106 of file MdCounterSimulator.h.
|
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. |
Kind of possible simulation to be performed.
Definition at line 101 of file MdCounterSimulator.h.
|
inherited |
MdCounterSimulatorAG::MdCounterSimulator::MdCounterSimulator | ( | ) |
Definition at line 370 of file MdCounterSimulator.cc.
MdCounterSimulatorAG::MdCounterSimulator::~MdCounterSimulator | ( | ) |
Definition at line 375 of file MdCounterSimulator.cc.
|
privatevirtual |
Definition at line 2251 of file MdCounterSimulator.cc.
References mdet::BackEndSiPM::ApplySaturation(), ApplyTransferBlocks(), mdet::BackEndSiPM::eHighGainAmplifier, mdet::BackEndSiPM::eLowGainAmplifier, fLog, fNDiscretization, fUnits, utl::UnitsConfig::GetTimeName(), utl::FFTDataContainer< C, T, F >::GetTimeSeries(), utl::UnitsConfig::GetTimeUnit(), and utl::Trace< T >::PushBack().
Referenced by ProcessPulsesIntegrator().
|
privatevirtual |
Definition at line 2154 of file MdCounterSimulator.cc.
References mdet::BackEndSiPM::ApplySaturation(), ApplyTransferBlock(), mdet::BackEndSiPM::eADC, mdet::BackEndSiPM::eFirstAdder, mdet::BackEndSiPM::eHighGainAmplifier, mdet::BackEndSiPM::eLowGainAmplifier, mdet::BackEndSiPM::eSecondAdder, fLog, fNDiscretization, fUnits, mdet::BackEndSiPM::GetNumberOfChannelsToGroup(), utl::UnitsConfig::GetTimeName(), utl::FFTDataContainer< C, T, F >::GetTimeSeries(), utl::UnitsConfig::GetTimeUnit(), and utl::Trace< T >::PushBack().
Referenced by ProcessPulsesIntegrator().
|
privatevirtual |
Definition at line 1797 of file MdCounterSimulator.cc.
References RdGeoCeLDFFitter::c, mdet::ChannelSiPM::ComputeDiscriminator(), mdet::ChannelSiPM::ComputeTransfer(), utl::endc, utl::endr, fLog, fNDiscretization, freq, MdCounterSimulatorAG::MdCounterSimulator::SignalInformation::fScintSimData, MdCounterSimulatorAG::MdCounterSimulator::SignalInformation::fSiPMPulses, fUnits, mevt::ScintillatorSimData::GetAnalogicTrace(), utl::Trace< T >::GetBinning(), utl::UnitsConfig::GetElectricPotentialUnit(), utl::UnitsConfig::GetFrequencyName(), utl::FFTDataContainer< C, T, F >::GetFrequencySpectrum(), utl::UnitsConfig::GetFrequencyUnit(), utl::MessageLoggerConfig::GetLevel(), utl::Trace< T >::GetSize(), utl::UnitsConfig::GetTimeName(), utl::FFTDataContainer< C, T, F >::GetTimeSeries(), utl::UnitsConfig::GetTimeUnit(), mevt::ScintillatorSimData::HasAnalogicTrace(), utl::hline(), Init(), utl::Trace< T >::PushBack(), and utl::Trace< T >::SetBinning().
Referenced by ProcessPulses().
|
privatevirtual |
Definition at line 2296 of file MdCounterSimulator.cc.
References RdGeoCeLDFFitter::c, mdet::BackEndSiPM::ComputeTransfer(), utl::endc, utl::endr, fLog, freq, fUnits, utl::UnitsConfig::GetFrequencyName(), utl::FFTDataContainer< C, T, F >::GetFrequencySpectrum(), utl::UnitsConfig::GetFrequencyUnit(), utl::MessageLoggerConfig::GetLevel(), utl::hline(), and Init().
Referenced by ApplyBackEndTransferWStepSaturation().
|
privatevirtual |
Definition at line 2337 of file MdCounterSimulator.cc.
References mdet::BackEndSiPM::ComputeTransfer(), utl::endc, utl::endr, mdet::BackEndSiPM::eSimplifiedHG, mdet::BackEndSiPM::eSimplifiedLG, fLog, freq, fUnits, utl::UnitsConfig::GetFrequencyName(), utl::FFTDataContainer< C, T, F >::GetFrequencySpectrum(), utl::UnitsConfig::GetFrequencyUnit(), utl::MessageLoggerConfig::GetLevel(), utl::hline(), Init(), utl::Trace< T >::PushBack(), and utl::Trace< T >::SetBinning().
Referenced by ApplyBackEndTransfer().
|
private |
Helper to dump a TF1 to the configured file.
Definition at line 2806 of file MdCounterSimulator.cc.
References fNPulseSamples, fPulseFile, fPulseSampleWindow, fRunNumber, and max.
Referenced by ProcessPulses().
|
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 2695 of file MdCounterSimulator.cc.
References fwk::VModule::eSuccess.
|
privatevirtual |
Definition at line 1738 of file MdCounterSimulator.cc.
References utl::endc, utl::endr, fLog, MdCounterSimulatorAG::MdCounterSimulator::SignalInformation::fScintSimData, MdCounterSimulatorAG::MdCounterSimulator::SignalInformation::fSiPMPulses, fUnits, mevt::ScintillatorSimData::GetAnalogicTrace(), utl::Trace< T >::GetBinning(), utl::MessageLoggerConfig::GetLevel(), utl::Trace< T >::GetSize(), utl::UnitsConfig::GetTimeName(), utl::UnitsConfig::GetTimeUnit(), mevt::ScintillatorSimData::HasAnalogicTrace(), utl::hline(), Init(), max, and G4StationSimulatorOG::p.
Referenced by SimulateElectronics().
|
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.
|
private |
Retrieve T1 time from associated SD tank.
Definition at line 2701 of file MdCounterSimulator.cc.
References mdet::FrontEndSiPM::ChannelsBegin(), mdet::FrontEndSiPM::ChannelsEnd(), ERROR, fForcedSDTrigger, sevt::StationTriggerData::GetAlgorithmName(), mdet::Counter::GetAssociatedTankId(), sdet::Station::GetFADCBinSize(), sdet::Station::GetFADCTraceLength(), mdet::Module::GetFrontEndSiPM(), sdet::Station::GetLatchBin(), mdet::FrontEndSiPM::GetMeanSampleRatePeriod(), mdet::Counter::GetModule(), mdet::FrontEndSiPM::GetPostT1BufferLength(), mdet::FrontEndSiPM::GetPreT1BufferLength(), sevt::Station::GetSimData(), sevt::SEvent::GetStation(), sevt::StationSimData::GetTriggerData(), evt::Event::HasSEvent(), sevt::Station::HasSimData(), sevt::SEvent::HasStation(), MdOptoElectronicSimulatorAG::SetTraceStartTime(), sevt::StationSimData::TriggerTimeIterator, sevt::StationSimData::TriggerTimesBegin(), sevt::StationSimData::TriggerTimesEnd(), and WARNING.
Referenced by RunFromMEventScintillatorSimulated().
|
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(), FdElectronicsSimulatorOG::FdElectronicsSimulator::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 380 of file MdCounterSimulator.cc.
References utl::ampere, utl::cm, utl::UnitsConfig::Configure(), utl::MessageLoggerConfig::Configure(), utl::ConsecutiveEnumFactory< EnumType, last, tags, NoConversionPolicy, first >::Create(), eFromMEvent, eFromMEventSimulatedScint, fwk::VModule::eSuccess, fAllowedParticleTypes, fForcedSDTrigger, fGeneratePostFETotalPulseOutput, fGeneratePreFETotalPulseOutput, fGenerateSPEPulseOutput, fIgnoreCrossTalk, fIncludeBaseLineFluctuationIntegrator, fInjectNoiseBinary, fIntegratorSimType, fLog, fMaxSPE, fMinSPE, fNBinsHistograms, fNDiscretization, fNPulseSamples, fNRepetitions, fNumPlotPoints, fPlotChannelPulses, fPlotDelay, fPlotFftPostAmp, fPlotFftPriorAmp, fPlotFileExtensions, fPlotInputOutput, fPlotOutcome, fPlotTransferAmpResponse, fPlotTransferPhaseResponse, fPulseFile, fPulseFilename, fPulseSampleWindow, fSimType, fStepSPE, fStyle, fToggleDelay, fToggleFftPriorAmp, fToggleInputOutput, fToggleOutcome, fTogglePlotchannelPulses, fTogglePlotFftPostAmp, fToggleTransferAmpResponse, fToggleTransferPhaseResponse, fUnits, fwk::CentralConfig::GetInstance(), utl::UnitsConfig::GetTimeUnit(), fwk::CentralConfig::GetTopBranch(), kIntegratorSimulationTypeTags, kSimulationTypeTags, utl::LoadConfig(), utl::megahertz, utl::milli, utl::ns, utl::UnitsConfig::SetElectricCurrentDefault(), utl::UnitsConfig::SetElectricPotentialDefault(), utl::UnitsConfig::SetFrequencyDefault(), utl::UnitsConfig::SetLengthDefault(), utl::UnitsConfig::SetTimeDefault(), and utl::volt.
Referenced by ApplyCITIROCTransfer(), ApplyTransferBlock(), ApplyTransferBlocks(), GetPulseTimeSpan(), ProcessPulses(), and SimulatePulses().
|
private |
Helper to init a tabular stream.
Definition at line 2834 of file MdCounterSimulator.cc.
References fLog.
|
inlineinherited |
Definition at line 95 of file VModule.h.
References fwk::VModule::fStopwatch, and utl::Stopwatch::Reset().
|
privatevirtual |
Definition at line 1943 of file MdCounterSimulator.cc.
References mevt::Module::GetChannel(), mdet::Module::GetFrontEndSiPM(), mdet::FrontEndSiPM::GetInjectDigitalNoiseBin(), mdet::FrontEndSiPM::GetInjectDigitalNoiseChannel(), mdet::FrontEndSiPM::GetInjectDigitalNoiseWidth(), utl::Trace< T >::GetSize(), mevt::Channel::GetTrace(), mevt::Module::HasChannel(), mevt::Channel::HasTrace(), and mevt::Channel::MakeTrace().
Referenced by SimulateElectronics().
|
privatevirtual |
Definition at line 1967 of file MdCounterSimulator.cc.
References fGeneratePostFETotalPulseOutput, fGeneratePreFETotalPulseOutput, fGenerateSPEPulseOutput, fLog, fPlotFileExtensions, fPlotOutcome, fRunNumber, fStyle, fUnits, mdet::Module::GetCounter(), utl::UnitsConfig::GetElectricPotentialName(), mdet::ChannelSiPM::GetFrontEnd(), det::DetectorComponent< C, ManagerProvider >::GetId(), mdet::FrontEndSiPM::GetMeanSampleRatePeriod(), mdet::FrontEndSiPM::GetModule(), utl::Trace< T >::GetSize(), and utl::UnitsConfig::GetTimeName().
Referenced by ProcessPulses().
|
privatevirtual |
Definition at line 2456 of file MdCounterSimulator.cc.
References fGeneratePostFETotalPulseOutput, fGeneratePreFETotalPulseOutput, fLog, fPlotFileExtensions, fPlotOutcome, fRunNumber, fStyle, fUnits, mdet::Module::GetCounter(), det::DetectorComponent< C, ManagerProvider >::GetId(), mdet::FrontEndSiPM::GetModule(), mdet::FrontEndSiPM::GetSampleTimeADC(), utl::Trace< T >::GetSize(), and utl::UnitsConfig::GetTimeName().
Referenced by ProcessPulsesIntegrator().
|
privatevirtual |
Process: analyze, electronic simulation and sampling.
c | The corresponding channel. |
signalInfo | The pulses and other information that generates signal. |
trace | Output parameter with the trace to be filled with the samples. |
span | Output parameter with the total time of the discriminator output signal. |
traceStart | TimeInterval for trace start. |
eventTime | Time of the event, reference base time. |
Definition at line 941 of file MdCounterSimulator.cc.
References utl::abs(), mdet::Channel::Discriminator::AtThresholdBegin(), mdet::Channel::Discriminator::AtThresholdEnd(), RdGeoCeLDFFitter::b, RdGeoCeLDFFitter::c, mdet::Channel::ComputeSignalShift(), mdet::Channel::ComputeTransfer(), Dump(), utl::endc, utl::endr, fGeneratePostFETotalPulseOutput, fGeneratePreFETotalPulseOutput, fGenerateSPEPulseOutput, fLog, fNDiscretization, fNumPlotPoints, fPlotChannelPulses, fPlotDelay, fPlotFftPostAmp, fPlotFftPriorAmp, fPlotFileExtensions, fPlotInputOutput, fPlotOutcome, fPlotTransferAmpResponse, fPlotTransferPhaseResponse, MdCounterSimulatorAG::MdCounterSimulator::SignalInformation::fPulses, freq, fRunNumber, MdCounterSimulatorAG::MdCounterSimulator::SignalInformation::fScintSimData, fStyle, fUnits, mevt::ScintillatorSimData::GetAnalogicTrace(), utl::UnitsConfig::GetAngleName(), utl::UnitsConfig::GetAngleUnit(), utl::Trace< T >::GetBinning(), mdet::Module::GetCounter(), utl::UnitsConfig::GetElectricCurrentName(), utl::UnitsConfig::GetElectricCurrentUnit(), utl::UnitsConfig::GetElectricPotentialName(), utl::UnitsConfig::GetElectricPotentialUnit(), utl::UnitsConfig::GetElectricResistanceName(), utl::UnitsConfig::GetElectricResistanceUnit(), utl::UnitsConfig::GetFrequencyName(), utl::FFTDataContainer< C, T, F >::GetFrequencySpectrum(), utl::UnitsConfig::GetFrequencyUnit(), mdet::Channel::GetFrontEnd(), det::DetectorComponent< C, ManagerProvider >::GetId(), utl::TimeInterval::GetInterval(), utl::MessageLoggerConfig::GetLevel(), mdet::FrontEnd::GetMeanSampleRatePeriod(), mdet::FrontEnd::GetModule(), mdet::Channel::Discriminator::GetOverThresholdTimeSpan(), mdet::FrontEnd::GetPostT1BufferLength(), mdet::FrontEnd::GetPreT1BufferLength(), utl::Trace< T >::GetSize(), mdet::Channel::GetThreshold(), utl::UnitsConfig::GetTimeName(), utl::FFTDataContainer< C, T, F >::GetTimeSeries(), utl::UnitsConfig::GetTimeUnit(), mevt::ScintillatorSimData::HasAnalogicTrace(), utl::hline(), Init(), utl::kTwoPi, mdet::FrontEnd::MakeSampler(), max, G4StationSimulatorOG::p, utl::Trace< T >::PushBack(), utl::s, and utl::Trace< T >::SetBinning().
Referenced by SimulateElectronics().
|
privatevirtual |
Definition at line 1673 of file MdCounterSimulator.cc.
References ApplyCITIROCTransfer(), fLog, fNDiscretization, MdCounterSimulatorAG::MdCounterSimulator::SignalInformation::fScintSimData, MdCounterSimulatorAG::MdCounterSimulator::SignalInformation::fSiPMPulses, fUnits, mdet::ChannelSiPM::GetFrontEnd(), det::DetectorComponent< C, ManagerProvider >::GetId(), utl::TimeInterval::GetInterval(), mdet::FrontEndSiPM::GetMeanSampleRatePeriod(), mdet::FrontEndSiPM::GetPostT1BufferLength(), mdet::FrontEndSiPM::GetPreT1BufferLength(), utl::UnitsConfig::GetTimeName(), utl::UnitsConfig::GetTimeUnit(), mevt::ScintillatorSimData::HasAnalogicTrace(), PlotChannel(), utl::Trace< T >::PushBack(), SampleTrace(), and utl::Trace< T >::SetBinning().
|
privatevirtual |
Definition at line 2085 of file MdCounterSimulator.cc.
References ApplyBackEndTransfer(), ApplyBackEndTransferWStepSaturation(), eSimplified, fIntegratorSimType, fLog, fNDiscretization, fUnits, mdet::Module::GetBackEndSiPM(), mdet::Module::GetFrontEndSiPM(), det::DetectorComponent< C, ManagerProvider >::GetId(), utl::TimeInterval::GetInterval(), mdet::FrontEndSiPM::GetMeanSampleRatePeriod(), mdet::FrontEndSiPM::GetPostT1BufferLength(), mdet::FrontEndSiPM::GetPreT1BufferLength(), mdet::FrontEndSiPM::GetSampleTimeADC(), utl::UnitsConfig::GetTimeName(), utl::UnitsConfig::GetTimeUnit(), PlotIntegrator(), utl::Trace< T >::PushBack(), SampleTraceADC(), and utl::Trace< T >::SetBinning().
Referenced by SimulateElectronics().
|
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 546 of file MdCounterSimulator.cc.
References fwk::VModule::eFailure, eFromMEvent, eFromMEventSimulatedScint, fRunNumber, fSimType, fStyle, RunFromMEvent(), and RunFromMEventScintillatorSimulated().
|
private |
Run for the eFromEvent enumeration.
Definition at line 565 of file MdCounterSimulator.cc.
References mevt::MEvent::CountersBegin(), mevt::MEvent::CountersEnd(), fwk::VModule::eSuccess, fLog, mdet::MDetector::GetCounter(), mevt::MEvent::GetHeader(), mdet::Counter::GetModule(), mdet::Module::GetScintillator(), mevt::Header::GetTime(), evt::Event::HasMEvent(), INFO, is(), SimulateElectronics(), and SimulatePulses().
Referenced by Run().
|
private |
Definition at line 617 of file MdCounterSimulator.cc.
References mevt::ScintillatorSimData::AddPEPulse(), mevt::ScintillatorSimData::AddSPEPulse(), mdet::PMT::ComputePulseDestination(), mevt::MEvent::CountersBegin(), mevt::MEvent::CountersEnd(), delay, fwk::VModule::eSuccess, fForcedSDTrigger, fIgnoreCrossTalk, fLog, mdet::Pixel::SPE::GetAmplitude(), mdet::SiPM::PE::GetAmplitude1(), mdet::SiPM::PE::GetAmplitude2(), mdet::SiPM::PE::GetAmplitude3(), mdet::MDetector::GetCounter(), mdet::SiPM::PE::GetFallTime1(), mdet::SiPM::PE::GetFallTime2(), mdet::SiPM::PE::GetFallTime3(), det::DetectorComponent< C, ManagerProvider >::GetId(), mdet::Counter::GetModule(), mdet::Pixel::SPE::GetMu(), mevt::ScintillatorSimData::GetPhotonTime(), mdet::Module::GetPixelFor(), mdet::Pixel::GetPMT(), mdet::SiPM::PE::GetRiseTime(), mdet::Module::GetScintillator(), mdet::Pixel::SPE::GetSigma(), mdet::Module::GetSiPMFor(), mdet::SiPM::PE::GetStartTime(), GetTriggerTimeFromSD(), evt::Event::HasMEvent(), INFO, is(), mdet::Module::IsSiPM(), mdet::SiPM::MakePEAt(), mdet::Pixel::MakeSPEAt(), utl::ns, mevt::ScintillatorSimData::PhotonTimesBegin(), mevt::ScintillatorSimData::PhotonTimesEnd(), and SimulateElectronics().
Referenced by Run().
|
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().
|
privatevirtual |
Definition at line 1890 of file MdCounterSimulator.cc.
References fLog, fUnits, utl::TimeInterval::GetInterval(), mdet::FrontEndSiPM::GetMeanSampleRatePeriod(), mdet::FrontEndSiPM::GetPostT1BufferLength(), mdet::FrontEndSiPM::GetPreT1BufferLength(), utl::Trace< T >::GetSize(), utl::UnitsConfig::GetTimeName(), utl::UnitsConfig::GetTimeUnit(), mdet::FrontEndSiPM::MakeSampler(), utl::Trace< T >::PushBack(), and utl::s.
Referenced by ProcessPulses().
|
privatevirtual |
Definition at line 2387 of file MdCounterSimulator.cc.
References fIncludeBaseLineFluctuationIntegrator, fLog, fNDiscretization, fUnits, mdet::FrontEndSiPM::GetADCBaseLineFluctuationHG(), mdet::FrontEndSiPM::GetADCBaseLineFluctuationLG(), mdet::FrontEndSiPM::GetADCCounts(), mdet::Module::GetBackEndSiPM(), mdet::FrontEndSiPM::GetDelayBinaryADC(), mdet::BackEndSiPM::GetHighGainAmplifierOffset(), utl::TimeInterval::GetInterval(), mdet::BackEndSiPM::GetLowGainAmplifierOffset(), mdet::FrontEndSiPM::GetMeanSampleRatePeriod(), mdet::FrontEndSiPM::GetModule(), mdet::FrontEndSiPM::GetPostT1BufferLength(), mdet::FrontEndSiPM::GetPreT1BufferLength(), mdet::FrontEndSiPM::GetSampleTimeADC(), utl::Trace< T >::GetSize(), utl::UnitsConfig::GetTimeName(), utl::UnitsConfig::GetTimeUnit(), and utl::Trace< T >::PushBack().
Referenced by ProcessPulsesIntegrator().
|
privatevirtual |
Peform the simulation of the electronics response.
This method iterates over the different channels and then forwards to the actual electronic processing in ProcessPulses.
Definition at line 2573 of file MdCounterSimulator.cc.
References fwk::VModule::eSuccess, fInjectNoiseBinary, fLog, fUnits, mevt::Module::GetChannel(), mdet::Module::GetChannelFor(), mdet::Module::GetChannelSiPMFor(), det::DetectorComponent< C, ManagerProvider >::GetId(), mevt::Module::GetIntegratorATrace(), mevt::Module::GetIntegratorBTrace(), mdet::Module::GetPixel(), GetPulseTimeSpan(), mdet::Module::GetSiPM(), utl::UnitsConfig::GetTimeName(), utl::UnitsConfig::GetTimeUnit(), mevt::Channel::GetTrace(), mevt::Channel::GetTraceStartTime(), mevt::Module::HasChannel(), mevt::Module::HasIntegratorATrace(), mevt::Module::HasIntegratorBTrace(), mevt::Channel::HasTrace(), InjectDigitalNoise(), mdet::Module::IsSiPM(), mevt::Module::MakeChannel(), mevt::Module::MakeIntegratorATrace(), mevt::Module::MakeIntegratorBTrace(), mevt::Channel::MakeTrace(), max, ProcessPulses(), ProcessPulsesIntegrator(), and det::DetectorComponent< C, ManagerProvider >::second.
Referenced by RunFromMEvent(), and RunFromMEventScintillatorSimulated().
|
privatevirtual |
Perform the simulation given the particles in the scintillator.
Iterates the particles that have reached the given scintillator, and generate SPE pulses according to them, these pulses are accumulated in the sm
map.
In this process the PMT crosstalk is taken into account, which may produce a pulse in another channel different to the correspoding to the impinged scintillator.
Definition at line 704 of file MdCounterSimulator.cc.
References mevt::ScintillatorSimData::AddPEPulse(), mevt::ScintillatorSimData::AddSPEPulse(), mdet::Fiber::ComputeDecayDelay(), mdet::Scintillator::ComputeDecayDelay(), mdet::Scintillator::ComputeIntersectionWith(), mdet::PMT::ComputePulseDestination(), mdet::Fiber::ComputeSPENumber(), delay, utl::Distance(), utl::endc, utl::endr, fwk::VModule::eSuccess, fAllowedParticleTypes, fIgnoreCrossTalk, fLog, fUnits, mdet::Pixel::SPE::GetAmplitude(), mdet::SiPM::PE::GetAmplitude1(), mdet::SiPM::PE::GetAmplitude2(), utl::Segment::GetBegin(), mdet::Module::GetDepth(), utl::Segment::GetDirection(), utl::Particle::GetDirection(), utl::Segment::GetEnd(), mdet::SiPM::PE::GetFallTime1(), mdet::SiPM::PE::GetFallTime2(), mdet::SiPM::PE::GetFallTime3(), mdet::Module::GetFiberFor(), det::DetectorComponent< C, ManagerProvider >::GetId(), utl::TimeInterval::GetInterval(), utl::Segment::GetLength(), utl::UnitsConfig::GetLengthName(), utl::UnitsConfig::GetLengthUnit(), utl::MessageLoggerConfig::GetLevel(), det::MPositionable< Config >::GetLocalCoordinateSystem(), mdet::Scintillator::GetModule(), mdet::Pixel::SPE::GetMu(), mdet::Fiber::GetOnManifoldLength(), mdet::Module::GetPixelFor(), mdet::Pixel::GetPMT(), utl::Particle::GetPosition(), mdet::Fiber::GetRefractionIndex(), mdet::SiPM::PE::GetRiseTime(), mdet::Pixel::SPE::GetSigma(), mdet::Module::GetSiPMFor(), mdet::SiPM::PE::GetStartTime(), utl::Particle::GetTime(), utl::UnitsConfig::GetTimeName(), utl::UnitsConfig::GetTimeUnit(), utl::Particle::GetType(), utl::Particle::GetWeight(), utl::BasicVector< HepVector >::GetX(), utl::BasicVector< HepVector >::GetY(), utl::BasicVector< HepVector >::GetZ(), mevt::ScintillatorSimData::HasAnalogicTrace(), utl::hline(), Init(), mdet::Scintillator::IntersectedBy(), mdet::Module::IsSiPM(), utl::kSpeedOfLight, mdet::SiPM::MakePEAt(), mdet::Pixel::MakeSPEAt(), particle, mevt::ScintillatorSimData::ParticlesBegin(), and mevt::ScintillatorSimData::ParticlesEnd().
Referenced by RunFromMEvent().
|
private |
Particle types that are considered to generate signal, if empty then every kind of particle is allowed.
The particle sensitive part of the detector, the scintillator, gives a signal for negative charged particle's. Nevertheless, the actual charge is not used so far. Originally, the loop over the impinging particles was filtered only to consider muons: something not very ellaborated, and that discarded the possibility to take also into account the presence of electrons (something which may be desired to analyze the so-called punch-through effects). So, it was considered to change that filter to restrict the simulation to negatively charged particles, but the class utl::Particle lacks a GetCharge method. This method could have been added, but it would have been used here to code something like if (p.GetCharge() < 0) which, I think, does not add much and missed the point (note that besides this condition the charge is not used in any other place). The correct alternative, I think, is to have configured here which particles are allowed in the simulation, and so restrict with this set of particle types the impinging particles.
It may sound wrong to take empty to mean all, but certainly is a, say, nice shorcut taking into account that so far it doesn't mean anything to filter out every kind of particle: no signal is generated is every particle is rejected.
Definition at line 471 of file MdCounterSimulator.h.
Referenced by Init(), and SimulatePulses().
|
private |
Ignore WCD trigger condition.
Definition at line 390 of file MdCounterSimulator.h.
Referenced by GetTriggerTimeFromSD(), Init(), and RunFromMEventScintillatorSimulated().
|
private |
To include the total pulse after front-end in the output file.
Definition at line 429 of file MdCounterSimulator.h.
Referenced by Init(), PlotChannel(), PlotIntegrator(), and ProcessPulses().
|
private |
To include the total pulse prior front-end in the output file.
Definition at line 425 of file MdCounterSimulator.h.
Referenced by Init(), PlotChannel(), PlotIntegrator(), and ProcessPulses().
|
private |
To include individual pulses samples in the output file.
Definition at line 421 of file MdCounterSimulator.h.
Referenced by Init(), PlotChannel(), and ProcessPulses().
|
private |
Ignore cross-talk effects.
Definition at line 394 of file MdCounterSimulator.h.
Referenced by Init(), RunFromMEventScintillatorSimulated(), and SimulatePulses().
|
private |
To simulate baseline fluctuation in the integrator output.
Definition at line 433 of file MdCounterSimulator.h.
Referenced by Init(), and SampleTraceADC().
|
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 |
To inject noise in binary traces.
Definition at line 438 of file MdCounterSimulator.h.
Referenced by Init(), and SimulateElectronics().
|
private |
Type of integrator simulation. Step by step simulates the complete transfer functions and applies saturation and offsets in each step (very slow). In fast mode the whole transfer is simplified to a low pass filter.
Definition at line 357 of file MdCounterSimulator.h.
Referenced by Init(), and ProcessPulsesIntegrator().
|
private |
Output messages handler.
Definition at line 340 of file MdCounterSimulator.h.
Referenced by ApplyBackEndTransfer(), ApplyBackEndTransferWStepSaturation(), ApplyCITIROCTransfer(), ApplyTransferBlock(), ApplyTransferBlocks(), GetPulseTimeSpan(), Init(), PlotChannel(), PlotIntegrator(), ProcessPulses(), ProcessPulsesIntegrator(), RunFromMEvent(), RunFromMEventScintillatorSimulated(), SampleTrace(), SampleTraceADC(), SimulateElectronics(), and SimulatePulses().
|
private |
Maximum number of spe (inclusive).
Definition at line 380 of file MdCounterSimulator.h.
Referenced by Init().
|
private |
Minimum number of spe (inclusive).
Used a starting point for simulations where an iteration over spes is desired.
Definition at line 374 of file MdCounterSimulator.h.
Referenced by Init().
|
private |
Number of bins for histograms.
Definition at line 365 of file MdCounterSimulator.h.
Referenced by Init().
|
private |
Discretization over the continuous functions.
Definition at line 336 of file MdCounterSimulator.h.
Referenced by ApplyBackEndTransfer(), ApplyBackEndTransferWStepSaturation(), ApplyCITIROCTransfer(), Init(), ProcessPulses(), ProcessPulsesIntegrator(), and SampleTraceADC().
|
private |
Number of samples to use in the output files for pulses.
Definition at line 410 of file MdCounterSimulator.h.
|
private |
Repetitions for in-module loop.
Definition at line 361 of file MdCounterSimulator.h.
Referenced by Init().
|
private |
Number of points to be used in plotting (theoretically) continuous functions.
Definition at line 348 of file MdCounterSimulator.h.
Referenced by Init(), and ProcessPulses().
|
private |
Definition at line 476 of file MdCounterSimulator.h.
Referenced by Init(), and ProcessPulses().
|
private |
Definition at line 481 of file MdCounterSimulator.h.
Referenced by Init(), and ProcessPulses().
|
private |
Definition at line 483 of file MdCounterSimulator.h.
Referenced by Init(), and ProcessPulses().
|
private |
Definition at line 482 of file MdCounterSimulator.h.
Referenced by Init(), and ProcessPulses().
|
private |
File extensions for plots (dot included).
Definition at line 344 of file MdCounterSimulator.h.
Referenced by Init(), PlotChannel(), PlotIntegrator(), and ProcessPulses().
|
private |
Definition at line 478 of file MdCounterSimulator.h.
Referenced by Init(), and ProcessPulses().
|
private |
Definition at line 477 of file MdCounterSimulator.h.
Referenced by Init(), PlotChannel(), PlotIntegrator(), and ProcessPulses().
|
private |
Definition at line 479 of file MdCounterSimulator.h.
Referenced by Init(), and ProcessPulses().
|
private |
Definition at line 480 of file MdCounterSimulator.h.
Referenced by Init(), and ProcessPulses().
|
private |
Associated stream.
Definition at line 406 of file MdCounterSimulator.h.
|
private |
Pulse output file filename.
Definition at line 402 of file MdCounterSimulator.h.
Referenced by Init().
|
private |
Define the length of the window within which the pulse is sampled.
Actually, there are two samples, one with a fixed window (defined by this value) and another that spans the whole pulse.
Definition at line 417 of file MdCounterSimulator.h.
|
private |
Tracks the number of runs.
Definition at line 332 of file MdCounterSimulator.h.
Referenced by Dump(), PlotChannel(), PlotIntegrator(), ProcessPulses(), and Run().
|
private |
Type of simulation.
Definition at line 352 of file MdCounterSimulator.h.
|
private |
Step size for spe iteration.
Definition at line 386 of file MdCounterSimulator.h.
Referenced by Init().
|
private |
Definition at line 495 of file MdCounterSimulator.h.
Referenced by Init(), PlotChannel(), PlotIntegrator(), ProcessPulses(), and Run().
|
private |
Definition at line 491 of file MdCounterSimulator.h.
Referenced by Init().
|
private |
Definition at line 492 of file MdCounterSimulator.h.
Referenced by Init().
|
private |
Definition at line 488 of file MdCounterSimulator.h.
Referenced by Init().
|
private |
Definition at line 487 of file MdCounterSimulator.h.
Referenced by Init().
|
private |
Definition at line 486 of file MdCounterSimulator.h.
Referenced by Init().
|
private |
Definition at line 493 of file MdCounterSimulator.h.
Referenced by Init().
|
private |
Definition at line 489 of file MdCounterSimulator.h.
Referenced by Init().
|
private |
Definition at line 490 of file MdCounterSimulator.h.
Referenced by Init().
|
private |
Units configuration.
Definition at line 398 of file MdCounterSimulator.h.
Referenced by ApplyBackEndTransfer(), ApplyBackEndTransferWStepSaturation(), ApplyCITIROCTransfer(), ApplyTransferBlock(), ApplyTransferBlocks(), GetPulseTimeSpan(), Init(), PlotChannel(), PlotIntegrator(), ProcessPulses(), ProcessPulsesIntegrator(), SampleTrace(), SampleTraceADC(), SimulateElectronics(), and SimulatePulses().
|
static |
Tags for the types of integrator simulation.
Definition at line 114 of file MdCounterSimulator.h.
Referenced by Init().
|
static |
Tags for the types of simulation.
Definition at line 111 of file MdCounterSimulator.h.
Referenced by Init().