CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
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
 
const HcalInterpolatedPulseinputPulse () const
 
HcalInterpolatedPulseinputPulse ()
 
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)
 
virtual ~AbsElectronicODERHS ()
 
- 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::AbsElectronicODERHS ( )
inline

Definition at line 21 of file AbsElectronicODERHS.h.

AbsElectronicODERHS::AbsElectronicODERHS ( const HcalInterpolatedPulse pulse)
inlineexplicit

Definition at line 23 of file AbsElectronicODERHS.h.

24  : inputPulse_(pulse) {}
HcalInterpolatedPulse inputPulse_
virtual AbsElectronicODERHS::~AbsElectronicODERHS ( )
inlinevirtual

Definition at line 26 of file AbsElectronicODERHS.h.

26 {}

Member Function Documentation

bool AbsElectronicODERHS::allParametersSet ( ) const
inline

Definition at line 52 of file AbsElectronicODERHS.h.

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

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

53  {
54  // Raise "allSet_" flag if all parameters have been set
55  if (!allSet_)
56  {
57  const unsigned nExpected = this->nParameters();
58  if (nExpected)
59  {
60  if (paramMask_.size() != nExpected)
61  return false;
62  unsigned count = 0;
63  const unsigned char* mask = &paramMask_[0];
64  for (unsigned i=0; i<nExpected; ++i)
65  count += mask[i];
66  allSet_ = count == nExpected;
67  }
68  else
69  allSet_ = true;
70  }
71  return allSet_;
72  }
int i
Definition: DBlmapReader.cc:9
std::vector< unsigned char > paramMask_
virtual unsigned nParameters() const =0
virtual unsigned AbsElectronicODERHS::controlNode ( ) const
inlinevirtual

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

Definition at line 46 of file AbsElectronicODERHS.h.

References invalidNode.

Referenced by QIE8Simulator::controlOutput().

46 {return invalidNode;}
static const unsigned invalidNode
const std::vector<double>& AbsElectronicODERHS::getAllParameters ( ) const
inline

Definition at line 90 of file AbsElectronicODERHS.h.

References allParametersSet(), Exception, and params_.

91  {
92  if (!allParametersSet()) throw cms::Exception(
93  "In AbsElectronicODERHS::getAllParameters: "
94  "some parameter values were not established yet");
95  return params_;
96  }
std::vector< double > params_
bool allParametersSet() const
double AbsElectronicODERHS::getParameter ( const unsigned  which) const
inline

Definition at line 82 of file AbsElectronicODERHS.h.

References paramMask_, and params_.

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

83  {
84  if (!paramMask_.at(which)) throw cms::Exception(
85  "In AbsElectronicODERHS::getParameter: no such parameter or "
86  "parameter value is not established yet");
87  return params_[which];
88  }
std::vector< double > params_
std::vector< unsigned char > paramMask_
void AbsElectronicODERHS::initialize ( )
inlineprivate

Definition at line 130 of file AbsElectronicODERHS.h.

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

Referenced by setLeadingParameters(), and setParameter().

131  {
132  const unsigned nExpected = this->nParameters();
133  if (nExpected)
134  {
135  params_.resize(nExpected);
136  paramMask_.resize(nExpected);
137  for (unsigned i=0; i<nExpected; ++i)
138  paramMask_[i] = 0;
139  }
140  initialized_ = true;
141  }
int i
Definition: DBlmapReader.cc:9
std::vector< double > params_
std::vector< unsigned char > paramMask_
virtual unsigned nParameters() const =0
const HcalInterpolatedPulse& AbsElectronicODERHS::inputPulse ( ) const
inline
HcalInterpolatedPulse& AbsElectronicODERHS::inputPulse ( )
inline

Definition at line 30 of file AbsElectronicODERHS.h.

References inputPulse_.

30 {return inputPulse_;}
HcalInterpolatedPulse inputPulse_
virtual unsigned AbsElectronicODERHS::nParameters ( ) const
pure virtual
virtual unsigned AbsElectronicODERHS::numberOfNodes ( ) const
pure virtual
virtual unsigned AbsElectronicODERHS::outputNode ( ) const
pure virtual
template<class Pulse >
void AbsElectronicODERHS::setInputPulse ( const Pulse &  pulse)
inline

Definition at line 33 of file AbsElectronicODERHS.h.

References inputPulse_.

Referenced by QIE8Simulator::setInputSignal().

33 {inputPulse_ = pulse;}
HcalInterpolatedPulse inputPulse_
void AbsElectronicODERHS::setLeadingParameters ( const double *  values,
const unsigned  len 
)
inline

Definition at line 98 of file AbsElectronicODERHS.h.

References assert(), i, initialize(), initialized_, min(), paramMask_, and params_.

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

99  {
100  if (len)
101  {
102  assert(values);
103  if (!initialized_)
104  initialize();
105  const unsigned sz = params_.size();
106  const unsigned imax = std::min(sz, len);
107  for (unsigned i=0; i<imax; ++i)
108  {
109  params_[i] = values[i];
110  paramMask_[i] = 1;
111  }
112  }
113  }
int i
Definition: DBlmapReader.cc:9
std::vector< double > params_
assert(m_qm.get())
T min(T a, T b)
Definition: MathUtil.h:58
std::vector< unsigned char > paramMask_
void AbsElectronicODERHS::setLeadingParameters ( const std::vector< double > &  values)
inline

Definition at line 115 of file AbsElectronicODERHS.h.

References setLeadingParameters().

116  {
117  if (!values.empty())
118  setLeadingParameters(&values[0], values.size());
119  }
void setLeadingParameters(const double *values, const unsigned len)
void AbsElectronicODERHS::setParameter ( const unsigned  which,
const double  value 
)
inline

Definition at line 74 of file AbsElectronicODERHS.h.

References initialize(), initialized_, paramMask_, params_, and relativeConstraints::value.

Referenced by editorTools.UserCodeTool::__call__(), HiCoreTools.RestrictInputToAOD::__call__(), coreTools.RunOnData::__call__(), trackTools.MakeAODTrackCandidates::__call__(), runJetUncertainties.RunJetUncertainties::__call__(), metTools.AddMETCollection::__call__(), editorTools.ChangeSource::__call__(), HiCoreTools.RemoveMCMatching::__call__(), cmsswVersionTools.PickRelValInputFiles::__call__(), coreTools.RemoveMCMatching::__call__(), trackTools.MakePATTrackCandidates::__call__(), trigTools.SwitchOnTrigger::__call__(), runMETCorrectionsAndUncertainties.RunMETCorrectionsAndUncertainties::__call__(), jetTools.AddJetCollection::__call__(), HiCoreTools.RemoveAllPATObjectsBut::__call__(), HiCoreTools.RemoveSpecificPATObjects::__call__(), trigTools.SwitchOnTriggerStandAlone::__call__(), trackTools.MakeTrackCandidates::__call__(), tauTools.AddTauCollection::__call__(), trigTools.SwitchOnTriggerMatching::__call__(), HiCoreTools.RemoveCleaning::__call__(), HiCoreTools.AddCleaning::__call__(), trigTools.SwitchOnTriggerMatchingStandAlone::__call__(), trigTools.SwitchOnTriggerMatchEmbedding::__call__(), jetTools.SwitchJetCollection::__call__(), jetTools.AddJetID::__call__(), jetTools.SetTagInfos::__call__(), runMETCorrectionsAndUncertainties.RunMETCorrectionsAndUncertainties::jetConfiguration(), and QIE8Simulator::setParameter().

75  {
76  if (!initialized_)
77  initialize();
78  paramMask_.at(which) = 1;
79  params_[which] = value;
80  }
std::vector< double > params_
std::vector< unsigned char > paramMask_

Member Data Documentation

bool AbsElectronicODERHS::allSet_
mutableprivate

Definition at line 128 of file AbsElectronicODERHS.h.

Referenced by allParametersSet().

bool AbsElectronicODERHS::initialized_
private

Definition at line 127 of file AbsElectronicODERHS.h.

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

HcalInterpolatedPulse AbsElectronicODERHS::inputPulse_
protected
const unsigned AbsElectronicODERHS::invalidNode = UINT_MAX - 1U
static
std::vector<unsigned char> AbsElectronicODERHS::paramMask_
private
std::vector<double> AbsElectronicODERHS::params_
protected