CMS 3D CMS Logo

List of all members | Public Types | Public Member Functions | Protected Member Functions | Private Member Functions | Private Attributes | Friends
HcalDcsValues Class Reference

#include <HcalDcsValues.h>

Public Types

typedef std::vector< HcalDcsValueDcsSet
 
enum  DcsSubDet {
  HcalHB = 1, HcalHE = 2, HcalHO0 = 3, HcalHO12 = 4,
  HcalHF = 5
}
 

Public Member Functions

bool addValue (HcalDcsValue const &newVal)
 
bool DcsValuesOK (DcsSubDet subd, int LS=-1)
 
bool exists (HcalDcsDetId const &fid)
 
DcsSet const & getAllSubdetValues (DcsSubDet subd) const
 
DcsSet getValues (HcalDcsDetId const &fid)
 
 HcalDcsValues ()
 
std::string myname () const
 
void sortAll ()
 
virtual ~HcalDcsValues ()
 

Protected Member Functions

bool foundDcsId (DcsSet const &valList, HcalDcsDetId const &fid) const
 
bool sortList (DcsSet &valList) const
 
bool subDetOk (DcsSet const &valList, int LS) const
 

Private Member Functions

template<class Archive >
void serialize (Archive &ar, const unsigned int version)
 

Private Attributes

bool mHBsorted
 
DcsSet mHBValues
 
bool mHEsorted
 
DcsSet mHEValues
 
bool mHFsorted
 
DcsSet mHFValues
 
bool mHO0sorted
 
DcsSet mHO0Values
 
bool mHO12sorted
 
DcsSet mHO12Values
 

Friends

class boost::serialization::access
 
template<typename CondSerializationT , typename Enabled >
struct cond::serialization::access
 

Detailed Description

Definition at line 25 of file HcalDcsValues.h.

Member Typedef Documentation

◆ DcsSet

typedef std::vector<HcalDcsValue> HcalDcsValues::DcsSet

Definition at line 27 of file HcalDcsValues.h.

Member Enumeration Documentation

◆ DcsSubDet

Enumerator
HcalHB 
HcalHE 
HcalHO0 
HcalHO12 
HcalHF 

Definition at line 30 of file HcalDcsValues.h.

Constructor & Destructor Documentation

◆ HcalDcsValues()

HcalDcsValues::HcalDcsValues ( )

Definition at line 5 of file HcalDcsValues.cc.

6  : mHBsorted(false), mHEsorted(false), mHO0sorted(false), mHO12sorted(false), mHFsorted(false) {}

◆ ~HcalDcsValues()

HcalDcsValues::~HcalDcsValues ( )
virtual

Definition at line 8 of file HcalDcsValues.cc.

8 {}

Member Function Documentation

◆ addValue()

bool HcalDcsValues::addValue ( HcalDcsValue const &  newVal)

Definition at line 10 of file HcalDcsValues.cc.

References HcalDcsValue::DcsId(), HcalDcsBarrel, HcalDcsEndcap, HcalDcsForward, HcalDcsOuter, mHBsorted, mHBValues, mHEsorted, mHEValues, mHFsorted, mHFValues, mHO0sorted, mHO0Values, mHO12sorted, and mHO12Values.

10  {
11  HcalDcsDetId tempId(newVal.DcsId());
12  switch (tempId.subdet()) {
13  case HcalDcsBarrel:
14  mHBValues.push_back(newVal);
15  mHBsorted = false;
16  return true;
17  case HcalDcsEndcap:
18  mHEValues.push_back(newVal);
19  mHEsorted = false;
20  return true;
21  case HcalDcsOuter:
22  if (tempId.ring() == 0) {
23  mHO0Values.push_back(newVal);
24  mHO0sorted = false;
25  } else {
26  mHO12Values.push_back(newVal);
27  mHO12sorted = false;
28  }
29  return true;
30  case HcalDcsForward:
31  mHFValues.push_back(newVal);
32  mHFsorted = false;
33  return true;
34  default:
35  return false;
36  }
37 }
DcsSet mHO0Values
Definition: HcalDcsValues.h:63
DcsSet mHFValues
Definition: HcalDcsValues.h:67
DcsSet mHBValues
Definition: HcalDcsValues.h:59
DcsSet mHO12Values
Definition: HcalDcsValues.h:65
DcsSet mHEValues
Definition: HcalDcsValues.h:61

◆ DcsValuesOK()

bool HcalDcsValues::DcsValuesOK ( DcsSubDet  subd,
int  LS = -1 
)

Definition at line 179 of file HcalDcsValues.cc.

References HcalHB, HcalHE, HcalHF, HcalHO0, HcalHO12, mHBsorted, mHBValues, mHEsorted, mHEValues, mHFsorted, mHFValues, mHO0sorted, mHO0Values, mHO12sorted, mHO12Values, sortList(), and subDetOk().

179  {
180  switch (subd) {
181  case HcalHB:
182  if (!mHBsorted)
184  return subDetOk(mHBValues, LS);
185  case HcalHE:
186  if (!mHEsorted)
188  return subDetOk(mHEValues, LS);
189  case HcalHO0:
190  if (!mHO0sorted)
192  return subDetOk(mHO0Values, LS);
193  case HcalHO12:
194  if (!mHO12sorted)
196  return subDetOk(mHO12Values, LS);
197  case HcalHF:
198  if (!mHFsorted)
200  return subDetOk(mHFValues, LS);
201  default:
202  return false;
203  }
204  return false;
205 }
bool subDetOk(DcsSet const &valList, int LS) const
DcsSet mHO0Values
Definition: HcalDcsValues.h:63
DcsSet mHFValues
Definition: HcalDcsValues.h:67
bool sortList(DcsSet &valList) const
DcsSet mHBValues
Definition: HcalDcsValues.h:59
DcsSet mHO12Values
Definition: HcalDcsValues.h:65
DcsSet mHEValues
Definition: HcalDcsValues.h:61

◆ exists()

bool HcalDcsValues::exists ( HcalDcsDetId const &  fid)

Definition at line 47 of file HcalDcsValues.cc.

References foundDcsId(), HcalDcsBarrel, HcalDcsEndcap, HcalDcsForward, HcalDcsOuter, mHBsorted, mHBValues, mHEsorted, mHEValues, mHFsorted, mHFValues, mHO0sorted, mHO0Values, mHO12sorted, mHO12Values, HcalDcsDetId::ring(), sortList(), and HcalOtherDetId::subdet().

47  {
48  switch (fid.subdet()) {
49  case HcalDcsBarrel:
50  if (!mHBsorted)
52  return foundDcsId(mHBValues, fid);
53  case HcalDcsEndcap:
54  if (!mHEsorted)
56  return foundDcsId(mHEValues, fid);
57  case HcalDcsOuter:
58  if (fid.ring() == 0) {
59  if (!mHO0sorted)
61  return foundDcsId(mHO0Values, fid);
62  } else {
63  if (!mHO12sorted)
65  return foundDcsId(mHO12Values, fid);
66  }
67  case HcalDcsForward:
68  if (!mHFsorted)
70  return foundDcsId(mHBValues, fid);
71  default:
72  return false;
73  }
74 }
bool foundDcsId(DcsSet const &valList, HcalDcsDetId const &fid) const
DcsSet mHO0Values
Definition: HcalDcsValues.h:63
DcsSet mHFValues
Definition: HcalDcsValues.h:67
bool sortList(DcsSet &valList) const
DcsSet mHBValues
Definition: HcalDcsValues.h:59
DcsSet mHO12Values
Definition: HcalDcsValues.h:65
DcsSet mHEValues
Definition: HcalDcsValues.h:61

◆ foundDcsId()

bool HcalDcsValues::foundDcsId ( DcsSet const &  valList,
HcalDcsDetId const &  fid 
) const
protected

Definition at line 207 of file HcalDcsValues.cc.

References pfDeepBoostedJetPreprocessParams_cfi::lower_bound, and DetId::rawId().

Referenced by exists().

207  {
208  HcalDcsValue dummy(fid.rawId(), -1, 0., 0., 0.);
209  DcsSet::const_iterator lb = lower_bound(valList.begin(), valList.end(), dummy);
210  if ((lb != valList.end()) && (lb->DcsId() == fid.rawId()))
211  return true;
212  return false;
213 }

◆ getAllSubdetValues()

HcalDcsValues::DcsSet const & HcalDcsValues::getAllSubdetValues ( DcsSubDet  subd) const

Definition at line 163 of file HcalDcsValues.cc.

References HcalHB, HcalHE, HcalHF, HcalHO0, HcalHO12, mHBValues, mHEValues, mHFValues, mHO0Values, and mHO12Values.

163  {
164  switch (subd) {
165  case HcalHB:
166  return mHBValues;
167  case HcalHE:
168  return mHEValues;
169  case HcalHO0:
170  return mHO0Values;
171  case HcalHO12:
172  return mHO12Values;
173  case HcalHF:
174  return mHFValues;
175  }
176  return mHBValues;
177 }
DcsSet mHO0Values
Definition: HcalDcsValues.h:63
DcsSet mHFValues
Definition: HcalDcsValues.h:67
DcsSet mHBValues
Definition: HcalDcsValues.h:59
DcsSet mHO12Values
Definition: HcalDcsValues.h:65
DcsSet mHEValues
Definition: HcalDcsValues.h:61

◆ getValues()

HcalDcsValues::DcsSet HcalDcsValues::getValues ( HcalDcsDetId const &  fid)

Definition at line 76 of file HcalDcsValues.cc.

References HcalDcsBarrel, HcalDcsEndcap, HcalDcsForward, HcalDcsOuter, pfDeepBoostedJetPreprocessParams_cfi::lower_bound, mHBsorted, mHBValues, mHEsorted, mHEValues, mHFsorted, mHFValues, mHO0sorted, mHO0Values, mHO12sorted, mHO12Values, DetId::rawId(), HcalDcsDetId::ring(), sortList(), HcalOtherDetId::subdet(), and pfDeepBoostedJetPreprocessParams_cfi::upper_bound.

76  {
77  DcsSet* valList = nullptr;
78  switch (fid.subdet()) {
79  case HcalDcsBarrel:
80  valList = &mHBValues;
81  if (!mHBsorted)
83  break;
84  case HcalDcsEndcap:
85  valList = &mHEValues;
86  if (!mHEsorted)
88  break;
89  case HcalDcsOuter:
90  if (fid.ring() == 0) {
91  valList = &mHO0Values;
92  if (!mHO0sorted)
94  } else {
95  valList = &mHO12Values;
96  if (!mHO12sorted)
98  }
99  break;
100  case HcalDcsForward:
101  valList = &mHFValues;
102  if (!mHFsorted)
104  break;
105  default:
106  valList = nullptr;
107  }
108 
109  if (valList) {
110  HcalDcsValue dummy(fid.rawId(), -1, 0., 0., 0.);
111  DcsSet::const_iterator lb = lower_bound(valList->begin(), valList->end(), dummy);
112  if ((lb != valList->end()) && (lb->DcsId() == fid.rawId())) {
113  DcsSet::const_iterator ub = upper_bound(valList->begin(), valList->end(), dummy);
114  return DcsSet(lb, ub);
115  }
116  }
117  return DcsSet();
118 }
DcsSet mHO0Values
Definition: HcalDcsValues.h:63
std::vector< HcalDcsValue > DcsSet
Definition: HcalDcsValues.h:27
DcsSet mHFValues
Definition: HcalDcsValues.h:67
bool sortList(DcsSet &valList) const
DcsSet mHBValues
Definition: HcalDcsValues.h:59
DcsSet mHO12Values
Definition: HcalDcsValues.h:65
DcsSet mHEValues
Definition: HcalDcsValues.h:61

◆ myname()

std::string HcalDcsValues::myname ( ) const
inline

Definition at line 46 of file HcalDcsValues.h.

References AlCaHLTBitMon_QueryRunRegistry::string.

46 { return (std::string) "HcalDcsValues"; }

◆ serialize()

template<class Archive >
void HcalDcsValues::serialize ( Archive &  ar,
const unsigned int  version 
)
private

◆ sortAll()

void HcalDcsValues::sortAll ( )

◆ sortList()

bool HcalDcsValues::sortList ( DcsSet valList) const
protected

Definition at line 231 of file HcalDcsValues.cc.

References jetUpdater_cfi::sort.

Referenced by DcsValuesOK(), exists(), getValues(), and sortAll().

231  {
232  sort(valList.begin(), valList.end());
233  return true;
234 }

◆ subDetOk()

bool HcalDcsValues::subDetOk ( DcsSet const &  valList,
int  LS 
) const
protected

Definition at line 215 of file HcalDcsValues.cc.

References heppy_batch::val.

Referenced by DcsValuesOK().

215  {
216  std::set<uint32_t> badIds;
217  DcsSet::const_iterator val = valList.begin();
218  while ((val != valList.end()) && ((LS > -1) ? (val->LS() <= LS) : true)) {
219  if (!val->isValueGood()) {
220  badIds.insert(val->DcsId());
221  } else {
222  std::set<uint32_t>::iterator fnd = badIds.find(val->DcsId());
223  if (*fnd == val->DcsId())
224  badIds.erase(fnd);
225  }
226  ++val;
227  }
228  return (badIds.empty());
229 }

Friends And Related Function Documentation

◆ boost::serialization::access

friend class boost::serialization::access
friend

Definition at line 70 of file HcalDcsValues.h.

◆ cond::serialization::access

template<typename CondSerializationT , typename Enabled >
friend struct cond::serialization::access
friend

Definition at line 70 of file HcalDcsValues.h.

Member Data Documentation

◆ mHBsorted

bool HcalDcsValues::mHBsorted
private

Definition at line 60 of file HcalDcsValues.h.

Referenced by addValue(), DcsValuesOK(), exists(), getValues(), and sortAll().

◆ mHBValues

DcsSet HcalDcsValues::mHBValues
private

Definition at line 59 of file HcalDcsValues.h.

Referenced by addValue(), DcsValuesOK(), exists(), getAllSubdetValues(), getValues(), and sortAll().

◆ mHEsorted

bool HcalDcsValues::mHEsorted
private

Definition at line 62 of file HcalDcsValues.h.

Referenced by addValue(), DcsValuesOK(), exists(), getValues(), and sortAll().

◆ mHEValues

DcsSet HcalDcsValues::mHEValues
private

Definition at line 61 of file HcalDcsValues.h.

Referenced by addValue(), DcsValuesOK(), exists(), getAllSubdetValues(), getValues(), and sortAll().

◆ mHFsorted

bool HcalDcsValues::mHFsorted
private

Definition at line 68 of file HcalDcsValues.h.

Referenced by addValue(), DcsValuesOK(), exists(), getValues(), and sortAll().

◆ mHFValues

DcsSet HcalDcsValues::mHFValues
private

Definition at line 67 of file HcalDcsValues.h.

Referenced by addValue(), DcsValuesOK(), exists(), getAllSubdetValues(), getValues(), and sortAll().

◆ mHO0sorted

bool HcalDcsValues::mHO0sorted
private

Definition at line 64 of file HcalDcsValues.h.

Referenced by addValue(), DcsValuesOK(), exists(), getValues(), and sortAll().

◆ mHO0Values

DcsSet HcalDcsValues::mHO0Values
private

Definition at line 63 of file HcalDcsValues.h.

Referenced by addValue(), DcsValuesOK(), exists(), getAllSubdetValues(), getValues(), and sortAll().

◆ mHO12sorted

bool HcalDcsValues::mHO12sorted
private

Definition at line 66 of file HcalDcsValues.h.

Referenced by addValue(), DcsValuesOK(), exists(), getValues(), and sortAll().

◆ mHO12Values

DcsSet HcalDcsValues::mHO12Values
private

Definition at line 65 of file HcalDcsValues.h.

Referenced by addValue(), DcsValuesOK(), exists(), getAllSubdetValues(), getValues(), and sortAll().