CMS 3D CMS Logo

Namespaces | Functions
parseHFPhase1AlgoDescription.h File Reference
#include <memory>
#include "RecoLocalCalo/HcalRecAlgos/interface/AbsHFPhase1Algo.h"
#include "FWCore/ParameterSet/interface/ParameterSetDescription.h"

Go to the source code of this file.

Namespaces

 edm
 HLT enums.
 

Functions

edm::ParameterSetDescription fillDescriptionForParseHFPhase1AlgoDescription ()
 
std::unique_ptr< AbsHFPhase1AlgoparseHFPhase1AlgoDescription (const edm::ParameterSet &ps)
 

Function Documentation

◆ fillDescriptionForParseHFPhase1AlgoDescription()

edm::ParameterSetDescription fillDescriptionForParseHFPhase1AlgoDescription ( )

Definition at line 80 of file parseHFPhase1AlgoDescription.cc.

80  {
82 
83  std::vector<double> allPass{-10000.0, 10000.0, -10000.0, 10000.0};
84  desc.add<std::vector<double> >("tlimits", allPass);
85  desc.add<std::vector<double> >("energyWeights");
86  desc.add<unsigned>("soiPhase", 1U);
87  desc.add<double>("timeShift", 0.0);
88  desc.add<double>("triseIfNoTDC", -100.0);
89  desc.add<double>("tfallIfNoTDC", -101.0);
90  desc.add<double>("minChargeForUndershoot", 1.0e10);
91  desc.add<double>("minChargeForOvershoot", 1.0e10);
92  desc.add<bool>("alwaysCalculateQAsymmetry", true);
93 
94  desc.ifValue(edm::ParameterDescription<std::string>("Class", "HFSimpleTimeCheck", true),
95  "HFSimpleTimeCheck" >> edm::ParameterDescription<bool>("rejectAllFailures", false, true) or
96  "HFFlexibleTimeCheck" >> edm::ParameterDescription<bool>("rejectAllFailures", true, true));
97 
98  return desc;
99 }

References edm::ParameterSetDescription::add(), edm::ParameterSetDescription::ifValue(), or, and mitigatedMETSequence_cff::U.

Referenced by HFPhase1Reconstructor::fillDescriptions().

◆ parseHFPhase1AlgoDescription()

std::unique_ptr<AbsHFPhase1Algo> parseHFPhase1AlgoDescription ( const edm::ParameterSet ps)

Definition at line 10 of file parseHFPhase1AlgoDescription.cc.

10  {
11  std::unique_ptr<AbsHFPhase1Algo> algo;
12 
13  const std::string& className = ps.getParameter<std::string>("Class");
14 
15  const bool isHFSimpleTimeCheck = className == "HFSimpleTimeCheck";
16  if (isHFSimpleTimeCheck || className == "HFFlexibleTimeCheck") {
17  const std::vector<double>& energyWeightsVec = ps.getParameter<std::vector<double> >("energyWeights");
18  const unsigned soiPhase = ps.getParameter<unsigned>("soiPhase");
19  const float timeShift = ps.getParameter<double>("timeShift");
20  const float triseIfNoTDC = ps.getParameter<double>("triseIfNoTDC");
21  const float tfallIfNoTDC = ps.getParameter<double>("tfallIfNoTDC");
22  const bool rejectAllFailures = ps.getParameter<bool>("rejectAllFailures");
23  const float minChargeForUndershoot = ps.getParameter<double>("minChargeForUndershoot");
24  const float minChargeForOvershoot = ps.getParameter<double>("minChargeForOvershoot");
25  const bool alwaysCalculateQAsymmetry = ps.getParameter<bool>("alwaysCalculateQAsymmetry");
26 
28  const unsigned sz = sizeof(energyWeights) / sizeof(energyWeights[0][0]);
29 
30  if (energyWeightsVec.size() == sz) {
31  std::pair<float, float> tlimits[2];
32  if (isHFSimpleTimeCheck) {
33  // Must specify the time limits explicitly for this algorithm
34  const std::vector<double>& tlimitsVec = ps.getParameter<std::vector<double> >("tlimits");
35  if (tlimitsVec.size() == 4) {
36  tlimits[0] = std::pair<float, float>(tlimitsVec[0], tlimitsVec[1]);
37  tlimits[1] = std::pair<float, float>(tlimitsVec[2], tlimitsVec[3]);
38  } else
39  return algo;
40  } else {
41  // Use "all pass" time limits values, just in case
42  tlimits[0] = std::pair<float, float>(-FLT_MAX, FLT_MAX);
43  tlimits[1] = tlimits[0];
44  }
45 
46  // Same order of elements as in the natural C array mapping
47  float* to = &energyWeights[0][0];
48  for (unsigned i = 0; i < sz; ++i)
49  to[i] = energyWeightsVec[i];
50 
51  // Create the algorithm object
52  if (isHFSimpleTimeCheck)
53  algo = std::unique_ptr<AbsHFPhase1Algo>(new HFSimpleTimeCheck(tlimits,
55  soiPhase,
56  timeShift,
63  else
64  algo = std::unique_ptr<AbsHFPhase1Algo>(new HFFlexibleTimeCheck(tlimits,
66  soiPhase,
67  timeShift,
74  }
75  }
76 
77  return algo;
78 }

References HFPhase1Reconstructor_cfi::alwaysCalculateQAsymmetry, className(), HLT_2018_cff::energyWeights, edm::ParameterSet::getParameter(), mps_fire::i, HFPhase1Reconstructor_cfi::minChargeForOvershoot, HFPhase1Reconstructor_cfi::minChargeForUndershoot, HFAnodeStatus::N_POSSIBLE_STATES, HLT_2018_cff::rejectAllFailures, HLT_2018_cff::soiPhase, AlCaHLTBitMon_QueryRunRegistry::string, HLT_2018_cff::tfallIfNoTDC, HLT_2018_cff::timeShift, HLT_2018_cff::tlimits, and HLT_2018_cff::triseIfNoTDC.

HLT_2018_cff.triseIfNoTDC
triseIfNoTDC
Definition: HLT_2018_cff.py:7165
mps_fire.i
i
Definition: mps_fire.py:355
edm::ParameterSetDescription::add
ParameterDescriptionBase * add(U const &iLabel, T const &value)
Definition: ParameterSetDescription.h:95
HLT_2018_cff.tlimits
tlimits
Definition: HLT_2018_cff.py:7170
edm::ParameterSetDescription
Definition: ParameterSetDescription.h:52
to
HFPhase1Reconstructor_cfi.minChargeForUndershoot
minChargeForUndershoot
Definition: HFPhase1Reconstructor_cfi.py:70
HFAnodeStatus::N_POSSIBLE_STATES
Definition: HFAnodeStatus.h:14
HLT_2018_cff.tfallIfNoTDC
tfallIfNoTDC
Definition: HLT_2018_cff.py:7164
HFPhase1Reconstructor_cfi.minChargeForOvershoot
minChargeForOvershoot
Definition: HFPhase1Reconstructor_cfi.py:71
cmsdt::algo
algo
Definition: constants.h:164
HLT_2018_cff.rejectAllFailures
rejectAllFailures
Definition: HLT_2018_cff.py:7166
mitigatedMETSequence_cff.U
U
Definition: mitigatedMETSequence_cff.py:36
AlCaHLTBitMon_QueryRunRegistry.string
string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
HFFlexibleTimeCheck
Definition: HFFlexibleTimeCheck.h:7
edm::ParameterSet::getParameter
T getParameter(std::string const &) const
HLT_2018_cff.energyWeights
energyWeights
Definition: HLT_2018_cff.py:7167
or
The Signals That Services Can Subscribe To This is based on ActivityRegistry and is current per Services can connect to the signals distributed by the ActivityRegistry in order to monitor the activity of the application Each possible callback has some defined which we here list in angle e< void, edm::EventID const &, edm::Timestamp const & > We also list in braces which AR_WATCH_USING_METHOD_ is used for those or
Definition: Activities.doc:12
HFSimpleTimeCheck
Definition: HFSimpleTimeCheck.h:9
HFPhase1Reconstructor_cfi.alwaysCalculateQAsymmetry
alwaysCalculateQAsymmetry
Definition: HFPhase1Reconstructor_cfi.py:78
className
std::string className(const T &t)
Definition: ClassName.h:31
HLT_2018_cff.soiPhase
soiPhase
Definition: HLT_2018_cff.py:7168
HLT_2018_cff.timeShift
timeShift
Definition: HLT_2018_cff.py:7169
edm::ParameterDescription
Definition: ParameterDescription.h:110