QwAnalysis
MQwMockable Class Referenceabstract

#include <MQwMockable.h>

+ Inheritance diagram for MQwMockable:

Public Member Functions

 MQwMockable ()
 
virtual ~MQwMockable ()
 

Parity mock data generation

static boost::mt19937 fRandomnessGenerator
 Internal randomness generator. More...
 
static
boost::normal_distribution
< double > 
fNormalDistribution
 Internal normal probability distribution. More...
 
static
boost::variate_generator
< boost::mt19937,
boost::normal_distribution
< double > > 
fNormalRandomVariable
 Internal normal random variable. More...
 
bool fUseExternalRandomVariable
 Flag to use an externally provided normal random variable. More...
 
double fExternalRandomVariable
 Externally provided normal random variable. More...
 
Double_t fMockAsymmetry
 Helicity asymmetry. More...
 
Double_t fMockGaussianMean
 Mean of normal distribution. More...
 
Double_t fMockGaussianSigma
 Sigma of normal distribution. More...
 
std::vector< Double_t > fMockDriftAmplitude
 Harmonic drift amplitude. More...
 
std::vector< Double_t > fMockDriftFrequency
 Harmonic drift frequency. More...
 
std::vector< Double_t > fMockDriftPhase
 Harmonic drift phase. More...
 
void SetRandomEventDriftParameters (Double_t amplitude, Double_t phase, Double_t frequency)
 Set a single set of harmonic drift parameters. More...
 
void AddRandomEventDriftParameters (Double_t amplitude, Double_t phase, Double_t frequency)
 Add drift parameters to the internal set. More...
 
void SetRandomEventParameters (Double_t mean, Double_t sigma)
 Set the normal random event parameters. More...
 
void SetRandomEventAsymmetry (Double_t asymmetry)
 Set the helicity asymmetry. More...
 
Double_t GetRandomValue ()
 
virtual void RandomizeEventData (int helicity=0, double time=0.0)=0
 Internally generate random event data. More...
 
virtual void EncodeEventData (std::vector< UInt_t > &buffer)=0
 Encode the event data into a CODA buffer. More...
 
void UseExternalRandomVariable ()
 Set the flag to use an externally provided random variable. More...
 
void SetExternalRandomVariable (Double_t random_variable)
 Set the externally provided random variable. More...
 

Detailed Description

Definition at line 19 of file MQwMockable.h.

Constructor & Destructor Documentation

MQwMockable::MQwMockable ( )
inline

Class: MQwMockable Mix-in class to enable mock-data generation for a data element. Only the data element classes which actually contain raw data (such as QwVQWK_Channel, QwScaler_Channel, etc.) should inherit from this class.

Definition at line 29 of file MQwMockable.h.

References fMockDriftAmplitude, fMockDriftFrequency, and fMockDriftPhase.

32  {
33  // Mock drifts
34  fMockDriftAmplitude.clear();
35  fMockDriftFrequency.clear();
36  fMockDriftPhase.clear();
37  }
std::vector< Double_t > fMockDriftPhase
Harmonic drift phase.
Definition: MQwMockable.h:96
std::vector< Double_t > fMockDriftFrequency
Harmonic drift frequency.
Definition: MQwMockable.h:95
Double_t fMockGaussianSigma
Sigma of normal distribution.
Definition: MQwMockable.h:93
bool fUseExternalRandomVariable
Flag to use an externally provided normal random variable.
Definition: MQwMockable.h:86
Double_t fMockGaussianMean
Mean of normal distribution.
Definition: MQwMockable.h:92
std::vector< Double_t > fMockDriftAmplitude
Harmonic drift amplitude.
Definition: MQwMockable.h:94
Double_t fMockAsymmetry
Helicity asymmetry.
Definition: MQwMockable.h:91
virtual MQwMockable::~MQwMockable ( )
inlinevirtual

Definition at line 38 of file MQwMockable.h.

References fMockDriftAmplitude, fMockDriftFrequency, and fMockDriftPhase.

38  {
39  fMockDriftAmplitude.clear();
40  fMockDriftFrequency.clear();
41  fMockDriftPhase.clear();
42  }
std::vector< Double_t > fMockDriftPhase
Harmonic drift phase.
Definition: MQwMockable.h:96
std::vector< Double_t > fMockDriftFrequency
Harmonic drift frequency.
Definition: MQwMockable.h:95
std::vector< Double_t > fMockDriftAmplitude
Harmonic drift amplitude.
Definition: MQwMockable.h:94

Member Function Documentation

void MQwMockable::AddRandomEventDriftParameters ( Double_t  amplitude,
Double_t  phase,
Double_t  frequency 
)

Add drift parameters to the internal set.

Definition at line 32 of file MQwMockable.cc.

References fMockDriftAmplitude, fMockDriftFrequency, and fMockDriftPhase.

Referenced by QwIntegrationPMT::AddRandomEventDriftParameters().

33 {
34  // Add new values
35  fMockDriftAmplitude.push_back(amplitude);
36  fMockDriftFrequency.push_back(frequency);
37  fMockDriftPhase.push_back(phase);
38  return;
39 }
std::vector< Double_t > fMockDriftPhase
Harmonic drift phase.
Definition: MQwMockable.h:96
std::vector< Double_t > fMockDriftFrequency
Harmonic drift frequency.
Definition: MQwMockable.h:95
std::vector< Double_t > fMockDriftAmplitude
Harmonic drift amplitude.
Definition: MQwMockable.h:94

+ Here is the caller graph for this function:

virtual void MQwMockable::EncodeEventData ( std::vector< UInt_t > &  buffer)
pure virtual
Double_t MQwMockable::GetRandomValue ( )

Return a random value generated either from the internal or external Random Variable.

Definition at line 54 of file MQwMockable.cc.

References fExternalRandomVariable, fNormalRandomVariable, and fUseExternalRandomVariable.

Referenced by VQwScaler_Channel::RandomizeEventData(), and QwVQWK_Channel::RandomizeEventData().

54  {
55  Double_t random_variable;
57  // external normal random variable
58  random_variable = fExternalRandomVariable;
59  else
60  // internal normal random variable
61  random_variable = fNormalRandomVariable();
62  return random_variable;
63 }
bool fUseExternalRandomVariable
Flag to use an externally provided normal random variable.
Definition: MQwMockable.h:86
double fExternalRandomVariable
Externally provided normal random variable.
Definition: MQwMockable.h:88
static boost::variate_generator< boost::mt19937, boost::normal_distribution< double > > fNormalRandomVariable
Internal normal random variable.
Definition: MQwMockable.h:84

+ Here is the caller graph for this function:

virtual void MQwMockable::RandomizeEventData ( int  helicity = 0,
double  time = 0.0 
)
pure virtual

Internally generate random event data.

Implemented in QwVQWK_Channel, QwSIS3320_Channel, and VQwScaler_Channel.

void MQwMockable::SetExternalRandomVariable ( Double_t  random_variable)
inline

Set the externally provided random variable.

Definition at line 69 of file MQwMockable.h.

References fExternalRandomVariable, and fUseExternalRandomVariable.

Referenced by QwIntegrationPMT::SetExternalRandomVariable().

69  {
71  fExternalRandomVariable = random_variable;
72  };
bool fUseExternalRandomVariable
Flag to use an externally provided normal random variable.
Definition: MQwMockable.h:86
double fExternalRandomVariable
Externally provided normal random variable.
Definition: MQwMockable.h:88

+ Here is the caller graph for this function:

void MQwMockable::SetRandomEventAsymmetry ( Double_t  asymmetry)

Set the helicity asymmetry.

Definition at line 48 of file MQwMockable.cc.

References fMockAsymmetry.

Referenced by QwIntegrationPMT::SetRandomEventAsymmetry().

49 {
50  fMockAsymmetry = asymmetry;
51  return;
52 }
Double_t fMockAsymmetry
Helicity asymmetry.
Definition: MQwMockable.h:91

+ Here is the caller graph for this function:

void MQwMockable::SetRandomEventDriftParameters ( Double_t  amplitude,
Double_t  phase,
Double_t  frequency 
)

Set a single set of harmonic drift parameters.

Definition at line 19 of file MQwMockable.cc.

References fMockDriftAmplitude, fMockDriftFrequency, and fMockDriftPhase.

Referenced by QwIntegrationPMT::SetRandomEventDriftParameters().

20 {
21  // Clear existing values
22  fMockDriftAmplitude.clear();
23  fMockDriftFrequency.clear();
24  fMockDriftPhase.clear();
25  // Add new values
26  fMockDriftAmplitude.push_back(amplitude);
27  fMockDriftFrequency.push_back(frequency);
28  fMockDriftPhase.push_back(phase);
29  return;
30 }
std::vector< Double_t > fMockDriftPhase
Harmonic drift phase.
Definition: MQwMockable.h:96
std::vector< Double_t > fMockDriftFrequency
Harmonic drift frequency.
Definition: MQwMockable.h:95
std::vector< Double_t > fMockDriftAmplitude
Harmonic drift amplitude.
Definition: MQwMockable.h:94

+ Here is the caller graph for this function:

void MQwMockable::SetRandomEventParameters ( Double_t  mean,
Double_t  sigma 
)

Set the normal random event parameters.

Definition at line 41 of file MQwMockable.cc.

References fMockGaussianMean, and fMockGaussianSigma.

Referenced by VQwScaler_Channel::InitializeChannel(), QwIntegrationPMT::SetRandomEventParameters(), QwQPD::SetRandomEventParameters(), and QwLinearDiodeArray::SetRandomEventParameters().

42 {
43  fMockGaussianMean = mean;
44  fMockGaussianSigma = sigma;
45  return;
46 }
Double_t fMockGaussianSigma
Sigma of normal distribution.
Definition: MQwMockable.h:93
Double_t fMockGaussianMean
Mean of normal distribution.
Definition: MQwMockable.h:92

+ Here is the caller graph for this function:

void MQwMockable::UseExternalRandomVariable ( )
inline

Set the flag to use an externally provided random variable.

Definition at line 67 of file MQwMockable.h.

References fUseExternalRandomVariable.

Referenced by QwIntegrationPMT::UseExternalRandomVariable().

67 { fUseExternalRandomVariable = true; };
bool fUseExternalRandomVariable
Flag to use an externally provided normal random variable.
Definition: MQwMockable.h:86

+ Here is the caller graph for this function:

Field Documentation

double MQwMockable::fExternalRandomVariable
protected

Externally provided normal random variable.

Definition at line 88 of file MQwMockable.h.

Referenced by GetRandomValue(), and SetExternalRandomVariable().

Double_t MQwMockable::fMockAsymmetry
protected
std::vector<Double_t> MQwMockable::fMockDriftAmplitude
protected
std::vector<Double_t> MQwMockable::fMockDriftFrequency
protected
std::vector<Double_t> MQwMockable::fMockDriftPhase
protected
Double_t MQwMockable::fMockGaussianMean
protected
Double_t MQwMockable::fMockGaussianSigma
protected
boost::normal_distribution< double > MQwMockable::fNormalDistribution
staticprotected

Internal normal probability distribution.

Definition at line 81 of file MQwMockable.h.

boost::variate_generator< boost::mt19937, boost::normal_distribution< double > > MQwMockable::fNormalRandomVariable
staticprotected

Internal normal random variable.

Definition at line 84 of file MQwMockable.h.

Referenced by GetRandomValue().

boost::mt19937 MQwMockable::fRandomnessGenerator
staticprotected

Internal randomness generator.

Definition at line 79 of file MQwMockable.h.

bool MQwMockable::fUseExternalRandomVariable
protected

Flag to use an externally provided normal random variable.

Definition at line 86 of file MQwMockable.h.

Referenced by GetRandomValue(), QwVQWK_Channel::InitializeChannel(), SetExternalRandomVariable(), and UseExternalRandomVariable().


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