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

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)
 
 ~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.

◆ AbsElectronicODERHS() [2/2]

AbsElectronicODERHS::AbsElectronicODERHS ( const HcalInterpolatedPulse pulse)
inlineexplicit

Definition at line 22 of file AbsElectronicODERHS.h.

22 : inputPulse_(pulse) {}
double pulse(double x, double y, double z, double t)
HcalInterpolatedPulse inputPulse_

◆ ~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.

References allSet_, submitPVResolutionJobs::count, mps_fire::i, gpuClustering::pixelStatus::mask, HLT_2022v12_cff::nExpected, nParameters(), and paramMask_.

Referenced by getAllParameters().

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  }
constexpr uint32_t mask
Definition: gpuClustering.h:24
std::vector< unsigned char > paramMask_
virtual unsigned nParameters() const =0

◆ controlNode()

virtual unsigned AbsElectronicODERHS::controlNode ( ) const
inlinevirtual

Definition at line 46 of file AbsElectronicODERHS.h.

References invalidNode.

Referenced by QIE8Simulator::controlOutput().

46 { return invalidNode; }
static const unsigned invalidNode

◆ getAllParameters()

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

Definition at line 85 of file AbsElectronicODERHS.h.

References allParametersSet(), Exception, and params_.

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

◆ getParameter()

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

Definition at line 77 of file AbsElectronicODERHS.h.

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

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

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  }
std::vector< double > params_
std::vector< unsigned char > paramMask_
def which(cmd)
Definition: eostools.py:336

◆ initialize()

void AbsElectronicODERHS::initialize ( )
inlineprivate

Definition at line 121 of file AbsElectronicODERHS.h.

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

Referenced by setLeadingParameters(), and setParameter().

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  }
std::vector< double > params_
std::vector< unsigned char > paramMask_
virtual unsigned nParameters() const =0

◆ inputPulse() [1/2]

const HcalInterpolatedPulse& AbsElectronicODERHS::inputPulse ( ) const
inline

◆ inputPulse() [2/2]

HcalInterpolatedPulse& AbsElectronicODERHS::inputPulse ( )
inline

Definition at line 28 of file AbsElectronicODERHS.h.

References inputPulse_.

28 { return inputPulse_; }
HcalInterpolatedPulse inputPulse_

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

References inputPulse_, and pulse().

Referenced by QIE8Simulator::setInputSignal().

31  {
33  }
double pulse(double x, double y, double z, double t)
HcalInterpolatedPulse inputPulse_

◆ setLeadingParameters() [1/2]

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

Definition at line 93 of file AbsElectronicODERHS.h.

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

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

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  }
std::vector< double > params_
assert(be >=bs)
std::vector< unsigned char > paramMask_

◆ setLeadingParameters() [2/2]

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

Definition at line 107 of file AbsElectronicODERHS.h.

References setLeadingParameters(), and contentValuesCheck::values.

107  {
108  if (!values.empty())
109  setLeadingParameters(&values[0], values.size());
110  }
void setLeadingParameters(const double *values, const unsigned len)

◆ setParameter()

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

Definition at line 70 of file AbsElectronicODERHS.h.

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

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

70  {
71  if (!initialized_)
72  initialize();
73  paramMask_.at(which) = 1;
74  params_[which] = value;
75  }
std::vector< double > params_
std::vector< unsigned char > paramMask_
def which(cmd)
Definition: eostools.py:336

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

Definition at line 113 of file AbsElectronicODERHS.h.

Referenced by inputPulse(), and setInputPulse().

◆ invalidNode

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

◆ paramMask_

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

◆ params_

std::vector<double> AbsElectronicODERHS::params_
protected