CMS 3D CMS Logo

List of all members | Public Member Functions | Static Public Attributes | Protected Attributes | Private Member Functions | Private Attributes
AbsElectronicODERHS Class Referenceabstract

#include <AbsElectronicODERHS.h>

Inheritance diagram for AbsElectronicODERHS:
AbsODERHS DoublePadeDelay< ODE1, ODE2, DelayTimeModel1, DelayTimeModel2 >

Public Member Functions

 AbsElectronicODERHS ()
 
 AbsElectronicODERHS (const HcalInterpolatedPulse &pulse)
 
bool allParametersSet () const
 
virtual unsigned controlNode () const
 
const std::vector< double > & getAllParameters () const
 
double getParameter (const unsigned which) const
 
HcalInterpolatedPulseinputPulse ()
 
const HcalInterpolatedPulseinputPulse () const
 
virtual unsigned nParameters () const =0
 
virtual unsigned numberOfNodes () const =0
 
virtual unsigned outputNode () const =0
 
template<class Pulse >
void setInputPulse (const Pulse &pulse)
 
void setLeadingParameters (const double *values, const unsigned len)
 
void setLeadingParameters (const std::vector< double > &values)
 
void setParameter (const unsigned which, const double value)
 
 ~AbsElectronicODERHS () override
 
- Public Member Functions inherited from AbsODERHS
virtual void calc (double t, const double *x, unsigned lenX, double *derivative)=0
 
virtual AbsODERHSclone () const =0
 
virtual ~AbsODERHS ()
 

Static Public Attributes

static const unsigned invalidNode = UINT_MAX - 1U
 

Protected Attributes

HcalInterpolatedPulse inputPulse_
 
std::vector< double > params_
 

Private Member Functions

void initialize ()
 

Private Attributes

bool allSet_
 
bool initialized_
 
std::vector< unsigned char > paramMask_
 

Detailed Description

Definition at line 16 of file AbsElectronicODERHS.h.

Constructor & Destructor Documentation

◆ AbsElectronicODERHS() [1/2]

AbsElectronicODERHS::AbsElectronicODERHS ( )
inline

Definition at line 20 of file AbsElectronicODERHS.h.

20 : initialized_(false), allSet_(false) {}

◆ AbsElectronicODERHS() [2/2]

AbsElectronicODERHS::AbsElectronicODERHS ( const HcalInterpolatedPulse pulse)
inlineexplicit

Definition at line 22 of file AbsElectronicODERHS.h.

22 : inputPulse_(pulse) {}

◆ ~AbsElectronicODERHS()

AbsElectronicODERHS::~AbsElectronicODERHS ( )
inlineoverride

Definition at line 24 of file AbsElectronicODERHS.h.

24 {}

Member Function Documentation

◆ allParametersSet()

bool AbsElectronicODERHS::allParametersSet ( ) const
inline

Definition at line 52 of file AbsElectronicODERHS.h.

52  {
53  // Raise "allSet_" flag if all parameters have been set
54  if (!allSet_) {
55  const unsigned nExpected = this->nParameters();
56  if (nExpected) {
57  if (paramMask_.size() != nExpected)
58  return false;
59  unsigned count = 0;
60  const unsigned char* mask = &paramMask_[0];
61  for (unsigned i = 0; i < nExpected; ++i)
62  count += mask[i];
63  allSet_ = count == nExpected;
64  } else
65  allSet_ = true;
66  }
67  return allSet_;
68  }

References allSet_, submitPVResolutionJobs::count, mps_fire::i, nParameters(), and paramMask_.

Referenced by DoublePadeDelay< ODE1, ODE2, DelayTimeModel1, DelayTimeModel2 >::calc(), and getAllParameters().

◆ controlNode()

virtual unsigned AbsElectronicODERHS::controlNode ( ) const
inlinevirtual

Reimplemented in DoublePadeDelay< ODE1, ODE2, DelayTimeModel1, DelayTimeModel2 >.

Definition at line 46 of file AbsElectronicODERHS.h.

46 { return invalidNode; }

References invalidNode.

Referenced by QIE8Simulator::controlOutput().

◆ getAllParameters()

const std::vector<double>& AbsElectronicODERHS::getAllParameters ( ) const
inline

Definition at line 85 of file AbsElectronicODERHS.h.

85  {
86  if (!allParametersSet())
87  throw cms::Exception(
88  "In AbsElectronicODERHS::getAllParameters: "
89  "some parameter values were not established yet");
90  return params_;
91  }

References allParametersSet(), Exception, and params_.

◆ getParameter()

double AbsElectronicODERHS::getParameter ( const unsigned  which) const
inline

Definition at line 77 of file AbsElectronicODERHS.h.

77  {
78  if (!paramMask_.at(which))
79  throw cms::Exception(
80  "In AbsElectronicODERHS::getParameter: no such parameter or "
81  "parameter value is not established yet");
82  return params_[which];
83  }

References paramMask_, params_, and eostools::which().

Referenced by QIE8Simulator::getParameter(), and Mixins._Parameterizable::hasParameter().

◆ initialize()

void AbsElectronicODERHS::initialize ( )
inlineprivate

Definition at line 121 of file AbsElectronicODERHS.h.

121  {
122  const unsigned nExpected = this->nParameters();
123  if (nExpected) {
124  params_.resize(nExpected);
125  paramMask_.resize(nExpected);
126  for (unsigned i = 0; i < nExpected; ++i)
127  paramMask_[i] = 0;
128  }
129  initialized_ = true;
130  }

References mps_fire::i, initialized_, nParameters(), paramMask_, and params_.

Referenced by setLeadingParameters(), and setParameter().

◆ inputPulse() [1/2]

HcalInterpolatedPulse& AbsElectronicODERHS::inputPulse ( )
inline

Definition at line 28 of file AbsElectronicODERHS.h.

28 { return inputPulse_; }

References inputPulse_.

◆ inputPulse() [2/2]

const HcalInterpolatedPulse& AbsElectronicODERHS::inputPulse ( ) const
inline

◆ nParameters()

virtual unsigned AbsElectronicODERHS::nParameters ( ) const
pure virtual

◆ numberOfNodes()

virtual unsigned AbsElectronicODERHS::numberOfNodes ( ) const
pure virtual

◆ outputNode()

virtual unsigned AbsElectronicODERHS::outputNode ( ) const
pure virtual

◆ setInputPulse()

template<class Pulse >
void AbsElectronicODERHS::setInputPulse ( const Pulse &  pulse)
inline

Definition at line 31 of file AbsElectronicODERHS.h.

31  {
33  }

References inputPulse_, and pulse().

Referenced by QIE8Simulator::setInputSignal().

◆ setLeadingParameters() [1/2]

void AbsElectronicODERHS::setLeadingParameters ( const double *  values,
const unsigned  len 
)
inline

Definition at line 93 of file AbsElectronicODERHS.h.

93  {
94  if (len) {
95  assert(values);
96  if (!initialized_)
97  initialize();
98  const unsigned sz = params_.size();
99  const unsigned imax = std::min(sz, len);
100  for (unsigned i = 0; i < imax; ++i) {
101  params_[i] = values[i];
102  paramMask_[i] = 1;
103  }
104  }
105  }

References cms::cuda::assert(), mps_fire::i, initialize(), initialized_, min(), paramMask_, params_, and contentValuesCheck::values.

Referenced by QIE8Simulator::setLeadingParameters(), and setLeadingParameters().

◆ setLeadingParameters() [2/2]

void AbsElectronicODERHS::setLeadingParameters ( const std::vector< double > &  values)
inline

Definition at line 107 of file AbsElectronicODERHS.h.

107  {
108  if (!values.empty())
109  setLeadingParameters(&values[0], values.size());
110  }

References setLeadingParameters(), and contentValuesCheck::values.

◆ setParameter()

void AbsElectronicODERHS::setParameter ( const unsigned  which,
const double  value 
)
inline

Member Data Documentation

◆ allSet_

bool AbsElectronicODERHS::allSet_
mutableprivate

Definition at line 119 of file AbsElectronicODERHS.h.

Referenced by allParametersSet().

◆ initialized_

bool AbsElectronicODERHS::initialized_
private

Definition at line 118 of file AbsElectronicODERHS.h.

Referenced by initialize(), setLeadingParameters(), and setParameter().

◆ inputPulse_

HcalInterpolatedPulse AbsElectronicODERHS::inputPulse_
protected

◆ invalidNode

const unsigned AbsElectronicODERHS::invalidNode = UINT_MAX - 1U
static

◆ paramMask_

std::vector<unsigned char> AbsElectronicODERHS::paramMask_
private

◆ params_

std::vector<double> AbsElectronicODERHS::params_
protected
AbsElectronicODERHS::allSet_
bool allSet_
Definition: AbsElectronicODERHS.h:119
mps_fire.i
i
Definition: mps_fire.py:428
min
T min(T a, T b)
Definition: MathUtil.h:58
pulse
double pulse(double x, double y, double z, double t)
Definition: SiStripPulseShape.cc:49
cms::cuda::assert
assert(be >=bs)
AbsElectronicODERHS::initialized_
bool initialized_
Definition: AbsElectronicODERHS.h:118
AbsElectronicODERHS::params_
std::vector< double > params_
Definition: AbsElectronicODERHS.h:114
contentValuesCheck.values
values
Definition: contentValuesCheck.py:38
submitPVResolutionJobs.count
count
Definition: submitPVResolutionJobs.py:352
AbsElectronicODERHS::initialize
void initialize()
Definition: AbsElectronicODERHS.h:121
AbsElectronicODERHS::nParameters
virtual unsigned nParameters() const =0
AbsElectronicODERHS::paramMask_
std::vector< unsigned char > paramMask_
Definition: AbsElectronicODERHS.h:117
AbsElectronicODERHS::allParametersSet
bool allParametersSet() const
Definition: AbsElectronicODERHS.h:52
relativeConstraints.value
value
Definition: relativeConstraints.py:53
Exception
Definition: hltDiff.cc:246
AbsElectronicODERHS::inputPulse_
HcalInterpolatedPulse inputPulse_
Definition: AbsElectronicODERHS.h:113
cms::Exception
Definition: Exception.h:70
eostools.which
def which(cmd)
Definition: eostools.py:336
AbsElectronicODERHS::setLeadingParameters
void setLeadingParameters(const double *values, const unsigned len)
Definition: AbsElectronicODERHS.h:93
AbsElectronicODERHS::invalidNode
static const unsigned invalidNode
Definition: AbsElectronicODERHS.h:18