List of all members | Classes | Public Types | Public Member Functions | Static Public Member Functions | Static Public Attributes | Protected Types | Protected Attributes | Private Types | Private Member Functions | Private Attributes
MdCounterSimulatorAG::MdCounterSimulator Class Reference

Describe your module. In one sentence. More...

#include <MdCounterSimulatorAG/MdCounterSimulator.h>

Inheritance diagram for MdCounterSimulatorAG::MdCounterSimulator:
Inheritance graph
[legend]

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::StopwatchGetStopwatch ()
 
const utl::StopwatchGetStopwatch () 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::PESiPMPulseContainer
 

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< ParticleTypefAllowedParticleTypes
 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...
 

Detailed Description

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.

Author
Rodolfo Federico Gamarra
Date
01 Jun 2009

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.

Author
Rodolfo Federico Gamarra
Date
01 Jun 2009

Definition at line 96 of file MdCounterSimulator.h.

Member Typedef Documentation

Definition at line 123 of file MdCounterSimulator.h.

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.

See Also
utl::Particle

Definition at line 446 of file MdCounterSimulator.h.

Definition at line 125 of file MdCounterSimulator.h.

Map associating the information with IDs (meant to be from pixel's).

Definition at line 154 of file MdCounterSimulator.h.

Definition at line 126 of file MdCounterSimulator.h.

Definition at line 122 of file MdCounterSimulator.h.

Member Enumeration Documentation

enum fwk::VModule::InfoLevel
protectedinherited
Enumerator
eInfoNone 
eInfoFinal 
eInfoIntermediate 
eInfoDebug 

Definition at line 125 of file VModule.h.

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.

enum fwk::VModule::ResultFlag
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.

Definition at line 60 of file VModule.h.

Kind of possible simulation to be performed.

Enumerator
eFromMEvent 

Simulate from information stored in MEvent. And photons generated from Parametrization

eFromMEventSimulatedScint 

Simulate from information stored in MEvent. And photons generated from Geant4 Simulation

Definition at line 101 of file MdCounterSimulator.h.

Different types of version info that can be retrieved from GetVersionInfo.

Enumerator
eFilename 
eRevisionNumber 
eDate 
eTime 
eLastEditor 

Definition at line 110 of file VModule.h.

Constructor & Destructor Documentation

MdCounterSimulatorAG::MdCounterSimulator::MdCounterSimulator ( )

Definition at line 370 of file MdCounterSimulator.cc.

MdCounterSimulatorAG::MdCounterSimulator::~MdCounterSimulator ( )

Definition at line 375 of file MdCounterSimulator.cc.

Member Function Documentation

void MdCounterSimulatorAG::MdCounterSimulator::ApplyBackEndTransfer ( const mdet::BackEndSiPM backEnd,
const double  maxTimePreFE,
const double  minTimePreFE,
TimeTrace traceAfterADCLowGain,
TimeTrace traceAfterADCHighGain,
TVectorD &  totalAnalogicalInput,
const std::vector< utl::TraceD traceAnalogical 
)
privatevirtual
void MdCounterSimulatorAG::MdCounterSimulator::ApplyBackEndTransferWStepSaturation ( const mdet::BackEndSiPM backEnd,
const double  maxTimePreFE,
const double  minTimePreFE,
TimeTrace traceAfterADCLowGain,
TimeTrace traceAfterADCHighGain,
TVectorD &  totalAnalogicalInput,
const std::vector< utl::TraceD traceAnalogical 
)
privatevirtual
void MdCounterSimulatorAG::MdCounterSimulator::ApplyCITIROCTransfer ( const mdet::ChannelSiPM channel,
const SignalInformation si,
const double  pulseTimeSpan,
double  minTimePreFE,
double  analogicTraceStartTime,
double  analogicTraceEndTime,
TimeTrace totalPulsePostFrontEndTrace,
TimeTrace totalPulsePostDiscriminatorTrace,
utl::TraceD traceAnalogical 
)
privatevirtual
void MdCounterSimulatorAG::MdCounterSimulator::ApplyTransferBlock ( utl::FFTDataContainer< utl::Trace, TimeTrace::ValueType, FrequencyTrace::ValueType > &  fft,
const mdet::BackEndSiPM backEnd,
BackEndSiPM::TransferStep  step 
)
privatevirtual
void MdCounterSimulatorAG::MdCounterSimulator::ApplyTransferBlocks ( utl::FFTDataContainer< utl::Trace, TimeTrace::ValueType, FrequencyTrace::ValueType > &  fft,
utl::FFTDataContainer< utl::Trace, TimeTrace::ValueType, FrequencyTrace::ValueType > &  fftHG,
const mdet::BackEndSiPM backEnd 
)
privatevirtual
void MdCounterSimulatorAG::MdCounterSimulator::Dump ( const TF1 &  fun,
const std::string &  suffix 
)
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().

VModule::ResultFlag MdCounterSimulatorAG::MdCounterSimulator::Finish ( )
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.

double MdCounterSimulatorAG::MdCounterSimulator::GetPulseTimeSpan ( const SignalInformation si,
const utl::TimeStamp eventTime,
double &  minTimePreFE,
double &  maxTimePreFE,
double &  analogicTraceStartTime,
double &  analogicTraceEndTime 
)
privatevirtual
std::string fwk::VModule::GetResultFlagByName ( const ResultFlag  flag)
staticinherited
utl::Stopwatch& fwk::VModule::GetStopwatch ( )
inlineinherited

Definition at line 106 of file VModule.h.

References fwk::VModule::fStopwatch.

const utl::Stopwatch& fwk::VModule::GetStopwatch ( ) const
inlineinherited

Definition at line 107 of file VModule.h.

References fwk::VModule::fStopwatch.

int MdCounterSimulatorAG::MdCounterSimulator::GetTriggerTimeFromSD ( evt::Event event,
const mdet::Counter cmDet,
mevt::MEvent::CounterIterator  cIt,
double &  T1 
)
private
std::string fwk::VModule::GetVersionInfo ( const VersionInfoType  v) const
inherited
VModule::ResultFlag MdCounterSimulatorAG::MdCounterSimulator::Init ( )
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().

void MdCounterSimulatorAG::MdCounterSimulator::Init ( std::unique_ptr< utl::TabularStream > &  pt,
unsigned int  nCol 
) const
private

Helper to init a tabular stream.

Definition at line 2834 of file MdCounterSimulator.cc.

References fLog.

void fwk::VModule::InitTiming ( )
inlineinherited

Definition at line 95 of file VModule.h.

References fwk::VModule::fStopwatch, and utl::Stopwatch::Reset().

void MdCounterSimulatorAG::MdCounterSimulator::InjectDigitalNoise ( const mdet::Module module,
mevt::Module evtModule 
)
privatevirtual
void MdCounterSimulatorAG::MdCounterSimulator::PlotChannel ( const double  traceStartTime,
const double  minTimePreFE,
const double  binning,
const mdet::ChannelSiPM channel,
utl::TraceD traceAnalogical,
TimeTrace totalPulsePostFrontEndTrace,
TimeTrace totalPulsePostDiscriminatorTrace,
utl::TraceB trace 
)
privatevirtual
void MdCounterSimulatorAG::MdCounterSimulator::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 
)
privatevirtual
void MdCounterSimulatorAG::MdCounterSimulator::ProcessPulses ( const mdet::Channel c,
const SignalInformation signalInfo,
utl::TraceB trace,
double &  span,
const utl::TimeInterval traceStart,
const utl::TimeStamp eventTime 
)
privatevirtual

Process: analyze, electronic simulation and sampling.

Parameters
cThe corresponding channel.
signalInfoThe pulses and other information that generates signal.
traceOutput parameter with the trace to be filled with the samples.
spanOutput parameter with the total time of the discriminator output signal.
traceStartTimeInterval for trace start.
eventTimeTime 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().

void MdCounterSimulatorAG::MdCounterSimulator::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 
)
privatevirtual
void MdCounterSimulatorAG::MdCounterSimulator::ProcessPulsesIntegrator ( const mdet::Module module,
std::vector< utl::TraceD analogicalTraces,
utl::TraceUSI traceIntegratorA,
utl::TraceUSI traceIntegratorB,
const utl::TimeInterval traceStart,
double &  minTimePreFE,
double &  maxTimePreFE 
)
privatevirtual
MdCounterSimulatorAG::MdCounterSimulator::REGISTER_MODULE ( "MdCounterSimulatorAG"  ,
MdCounterSimulator   
)
private
VModule::ResultFlag MdCounterSimulatorAG::MdCounterSimulator::Run ( evt::Event event)
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().

VModule::ResultFlag MdCounterSimulatorAG::MdCounterSimulator::RunFromMEvent ( evt::Event e)
private
VModule::ResultFlag MdCounterSimulatorAG::MdCounterSimulator::RunFromMEventScintillatorSimulated ( evt::Event e)
private
ResultFlag fwk::VModule::RunWithTiming ( evt::Event event)
inlineinherited
void MdCounterSimulatorAG::MdCounterSimulator::SampleTrace ( double  minTimePostFE,
double  maxTimePostFE,
double  binning,
const mdet::FrontEndSiPM frontEnd,
const utl::TimeInterval traceStart,
TimeTrace totalPulsePostDiscriminatorTrace,
utl::TraceB trace 
)
privatevirtual
void MdCounterSimulatorAG::MdCounterSimulator::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 
)
privatevirtual
VModule::ResultFlag MdCounterSimulatorAG::MdCounterSimulator::SimulateElectronics ( mevt::Module evtModule,
const mdet::Module module,
const SignalsMap sm,
const utl::TimeStamp eventTime 
)
privatevirtual
VModule::ResultFlag MdCounterSimulatorAG::MdCounterSimulator::SimulatePulses ( const mdet::Scintillator scint,
const mevt::ScintillatorSimData ssd,
mevt::ScintillatorSimData ssd_nonconst,
SignalsMap sm 
)
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().

Member Data Documentation

std::set<ParticleType> MdCounterSimulatorAG::MdCounterSimulator::fAllowedParticleTypes
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().

bool MdCounterSimulatorAG::MdCounterSimulator::fForcedSDTrigger
private

Ignore WCD trigger condition.

Definition at line 390 of file MdCounterSimulator.h.

Referenced by GetTriggerTimeFromSD(), Init(), and RunFromMEventScintillatorSimulated().

bool MdCounterSimulatorAG::MdCounterSimulator::fGeneratePostFETotalPulseOutput
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().

bool MdCounterSimulatorAG::MdCounterSimulator::fGeneratePreFETotalPulseOutput
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().

bool MdCounterSimulatorAG::MdCounterSimulator::fGenerateSPEPulseOutput
private

To include individual pulses samples in the output file.

Definition at line 421 of file MdCounterSimulator.h.

Referenced by Init(), PlotChannel(), and ProcessPulses().

bool MdCounterSimulatorAG::MdCounterSimulator::fIgnoreCrossTalk
private

Ignore cross-talk effects.

Definition at line 394 of file MdCounterSimulator.h.

Referenced by Init(), RunFromMEventScintillatorSimulated(), and SimulatePulses().

bool MdCounterSimulatorAG::MdCounterSimulator::fIncludeBaseLineFluctuationIntegrator
private

To simulate baseline fluctuation in the integrator output.

Definition at line 433 of file MdCounterSimulator.h.

Referenced by Init(), and SampleTraceADC().

int fwk::VModule::fInfoLevel = 0
protectedinherited
bool MdCounterSimulatorAG::MdCounterSimulator::fInjectNoiseBinary
private

To inject noise in binary traces.

Definition at line 438 of file MdCounterSimulator.h.

Referenced by Init(), and SimulateElectronics().

IntegratorSimulationType MdCounterSimulatorAG::MdCounterSimulator::fIntegratorSimType
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().

utl::MessageLoggerConfig MdCounterSimulatorAG::MdCounterSimulator::fLog
private
unsigned int MdCounterSimulatorAG::MdCounterSimulator::fMaxSPE
private

Maximum number of spe (inclusive).

See Also
fMaxSPE

Definition at line 380 of file MdCounterSimulator.h.

Referenced by Init().

unsigned int MdCounterSimulatorAG::MdCounterSimulator::fMinSPE
private

Minimum number of spe (inclusive).

Used a starting point for simulations where an iteration over spes is desired.

See Also
fMinSPE

Definition at line 374 of file MdCounterSimulator.h.

Referenced by Init().

unsigned int MdCounterSimulatorAG::MdCounterSimulator::fNBinsHistograms
private

Number of bins for histograms.

Definition at line 365 of file MdCounterSimulator.h.

Referenced by Init().

unsigned int MdCounterSimulatorAG::MdCounterSimulator::fNDiscretization
private
unsigned int MdCounterSimulatorAG::MdCounterSimulator::fNPulseSamples
private

Number of samples to use in the output files for pulses.

Definition at line 410 of file MdCounterSimulator.h.

Referenced by Dump(), and Init().

unsigned int MdCounterSimulatorAG::MdCounterSimulator::fNRepetitions
private

Repetitions for in-module loop.

Definition at line 361 of file MdCounterSimulator.h.

Referenced by Init().

unsigned int MdCounterSimulatorAG::MdCounterSimulator::fNumPlotPoints
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().

bool MdCounterSimulatorAG::MdCounterSimulator::fPlotChannelPulses
private

Definition at line 476 of file MdCounterSimulator.h.

Referenced by Init(), and ProcessPulses().

bool MdCounterSimulatorAG::MdCounterSimulator::fPlotDelay
private

Definition at line 481 of file MdCounterSimulator.h.

Referenced by Init(), and ProcessPulses().

bool MdCounterSimulatorAG::MdCounterSimulator::fPlotFftPostAmp
private

Definition at line 483 of file MdCounterSimulator.h.

Referenced by Init(), and ProcessPulses().

bool MdCounterSimulatorAG::MdCounterSimulator::fPlotFftPriorAmp
private

Definition at line 482 of file MdCounterSimulator.h.

Referenced by Init(), and ProcessPulses().

std::vector<std::string> MdCounterSimulatorAG::MdCounterSimulator::fPlotFileExtensions
private

File extensions for plots (dot included).

Definition at line 344 of file MdCounterSimulator.h.

Referenced by Init(), PlotChannel(), PlotIntegrator(), and ProcessPulses().

bool MdCounterSimulatorAG::MdCounterSimulator::fPlotInputOutput
private

Definition at line 478 of file MdCounterSimulator.h.

Referenced by Init(), and ProcessPulses().

bool MdCounterSimulatorAG::MdCounterSimulator::fPlotOutcome
private

Definition at line 477 of file MdCounterSimulator.h.

Referenced by Init(), PlotChannel(), PlotIntegrator(), and ProcessPulses().

bool MdCounterSimulatorAG::MdCounterSimulator::fPlotTransferAmpResponse
private

Definition at line 479 of file MdCounterSimulator.h.

Referenced by Init(), and ProcessPulses().

bool MdCounterSimulatorAG::MdCounterSimulator::fPlotTransferPhaseResponse
private

Definition at line 480 of file MdCounterSimulator.h.

Referenced by Init(), and ProcessPulses().

std::ofstream MdCounterSimulatorAG::MdCounterSimulator::fPulseFile
private

Associated stream.

Definition at line 406 of file MdCounterSimulator.h.

Referenced by Dump(), and Init().

std::string MdCounterSimulatorAG::MdCounterSimulator::fPulseFilename
private

Pulse output file filename.

Definition at line 402 of file MdCounterSimulator.h.

Referenced by Init().

double MdCounterSimulatorAG::MdCounterSimulator::fPulseSampleWindow
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.

Referenced by Dump(), and Init().

unsigned int MdCounterSimulatorAG::MdCounterSimulator::fRunNumber
private

Tracks the number of runs.

Definition at line 332 of file MdCounterSimulator.h.

Referenced by Dump(), PlotChannel(), PlotIntegrator(), ProcessPulses(), and Run().

SimulationType MdCounterSimulatorAG::MdCounterSimulator::fSimType
private

Type of simulation.

Definition at line 352 of file MdCounterSimulator.h.

Referenced by Init(), and Run().

unsigned int MdCounterSimulatorAG::MdCounterSimulator::fStepSPE
private

Step size for spe iteration.

See Also
fStepSPE

Definition at line 386 of file MdCounterSimulator.h.

Referenced by Init().

TStyle* MdCounterSimulatorAG::MdCounterSimulator::fStyle
private

Definition at line 495 of file MdCounterSimulator.h.

Referenced by Init(), PlotChannel(), PlotIntegrator(), ProcessPulses(), and Run().

bool MdCounterSimulatorAG::MdCounterSimulator::fToggleDelay
private

Definition at line 491 of file MdCounterSimulator.h.

Referenced by Init().

bool MdCounterSimulatorAG::MdCounterSimulator::fToggleFftPriorAmp
private

Definition at line 492 of file MdCounterSimulator.h.

Referenced by Init().

bool MdCounterSimulatorAG::MdCounterSimulator::fToggleInputOutput
private

Definition at line 488 of file MdCounterSimulator.h.

Referenced by Init().

bool MdCounterSimulatorAG::MdCounterSimulator::fToggleOutcome
private

Definition at line 487 of file MdCounterSimulator.h.

Referenced by Init().

bool MdCounterSimulatorAG::MdCounterSimulator::fTogglePlotchannelPulses
private

Definition at line 486 of file MdCounterSimulator.h.

Referenced by Init().

bool MdCounterSimulatorAG::MdCounterSimulator::fTogglePlotFftPostAmp
private

Definition at line 493 of file MdCounterSimulator.h.

Referenced by Init().

bool MdCounterSimulatorAG::MdCounterSimulator::fToggleTransferAmpResponse
private

Definition at line 489 of file MdCounterSimulator.h.

Referenced by Init().

bool MdCounterSimulatorAG::MdCounterSimulator::fToggleTransferPhaseResponse
private

Definition at line 490 of file MdCounterSimulator.h.

Referenced by Init().

utl::UnitsConfig MdCounterSimulatorAG::MdCounterSimulator::fUnits
private
const char *const MdCounterSimulatorAG::MdCounterSimulator::kIntegratorSimulationTypeTags = { "StepByStep", "Simplified"}
static

Tags for the types of integrator simulation.

Definition at line 114 of file MdCounterSimulator.h.

Referenced by Init().

const char *const MdCounterSimulatorAG::MdCounterSimulator::kSimulationTypeTags = { "FromMEvent", "FromMEventSimulatedScint"}
static

Tags for the types of simulation.

Definition at line 111 of file MdCounterSimulator.h.

Referenced by Init().


The documentation for this class was generated from the following files:

, generated on Tue Sep 26 2023.