CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Types | Public Member Functions | Protected Member Functions | Private Attributes
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 Attributes

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

Detailed Description

Definition at line 23 of file HcalDcsValues.h.

Member Typedef Documentation

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

Definition at line 25 of file HcalDcsValues.h.

Member Enumeration Documentation

Enumerator
HcalHB 
HcalHE 
HcalHO0 
HcalHO12 
HcalHF 

Definition at line 28 of file HcalDcsValues.h.

Constructor & Destructor Documentation

HcalDcsValues::HcalDcsValues ( )

Definition at line 5 of file HcalDcsValues.cc.

5  :
6  mHBsorted(false),mHEsorted(false),mHO0sorted(false), mHO12sorted(false),
7  mHFsorted(false) {
8 }
HcalDcsValues::~HcalDcsValues ( )
virtual

Definition at line 10 of file HcalDcsValues.cc.

10  {
11 }

Member Function Documentation

bool HcalDcsValues::addValue ( HcalDcsValue const &  newVal)

Definition at line 13 of file HcalDcsValues.cc.

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

13  {
14  HcalDcsDetId tempId( newVal.DcsId() );
15  switch (tempId.subdet()) {
16  case HcalDcsBarrel :
17  mHBValues.push_back(newVal);
18  mHBsorted=false;
19  return true;
20  case HcalDcsEndcap :
21  mHEValues.push_back(newVal);
22  mHEsorted=false;
23  return true;
24  case HcalDcsOuter :
25  if (tempId.ring() == 0) {
26  mHO0Values.push_back(newVal);
27  mHO0sorted=false;
28  } else {
29  mHO12Values.push_back(newVal);
30  mHO12sorted=false;
31  }
32  return true;
33  case HcalDcsForward :
34  mHFValues.push_back(newVal);
35  mHFsorted=false;
36  return true;
37  default :
38  return false;
39  }
40 }
DcsSet mHO0Values
Definition: HcalDcsValues.h:62
DcsSet mHFValues
Definition: HcalDcsValues.h:66
DcsSet mHBValues
Definition: HcalDcsValues.h:58
DcsSet mHO12Values
Definition: HcalDcsValues.h:64
DcsSet mHEValues
Definition: HcalDcsValues.h:60
bool HcalDcsValues::DcsValuesOK ( DcsSubDet  subd,
int  LS = -1 
)

Definition at line 166 of file HcalDcsValues.cc.

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

166  {
167  switch (subd) {
168  case HcalHB :
170  return subDetOk(mHBValues, LS);
171  case HcalHE :
173  return subDetOk(mHEValues, LS);
174  case HcalHO0 :
176  return subDetOk(mHO0Values, LS);
177  case HcalHO12 :
179  return subDetOk(mHO12Values, LS);
180  case HcalHF :
182  return subDetOk(mHFValues, LS);
183  default : return false;
184  }
185  return false;
186 }
DcsSet mHO0Values
Definition: HcalDcsValues.h:62
DcsSet mHFValues
Definition: HcalDcsValues.h:66
DcsSet mHBValues
Definition: HcalDcsValues.h:58
bool sortList(DcsSet &valList) const
bool subDetOk(DcsSet const &valList, int LS) const
DcsSet mHO12Values
Definition: HcalDcsValues.h:64
DcsSet mHEValues
Definition: HcalDcsValues.h:60
bool HcalDcsValues::exists ( HcalDcsDetId const &  fid)

Definition at line 50 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().

50  {
51  switch (fid.subdet()) {
52  case HcalDcsBarrel :
54  return foundDcsId(mHBValues, fid);
55  case HcalDcsEndcap :
57  return foundDcsId(mHEValues, fid);
58  case HcalDcsOuter :
59  if (fid.ring() == 0) {
61  return foundDcsId(mHO0Values, fid);
62  } else {
64  return foundDcsId(mHO12Values, fid);
65  }
66  case HcalDcsForward :
68  return foundDcsId(mHBValues, fid);
69  default : return false;
70  }
71 }
DcsSet mHO0Values
Definition: HcalDcsValues.h:62
bool foundDcsId(DcsSet const &valList, HcalDcsDetId const &fid) const
DcsSet mHFValues
Definition: HcalDcsValues.h:66
DcsSet mHBValues
Definition: HcalDcsValues.h:58
bool sortList(DcsSet &valList) const
list fid
Definition: NewTree.py:51
DcsSet mHO12Values
Definition: HcalDcsValues.h:64
DcsSet mHEValues
Definition: HcalDcsValues.h:60
bool HcalDcsValues::foundDcsId ( DcsSet const &  valList,
HcalDcsDetId const &  fid 
) const
protected

Definition at line 188 of file HcalDcsValues.cc.

References DetId::rawId().

Referenced by exists().

189  {
190  HcalDcsValue dummy(fid.rawId(), -1, 0., 0., 0.);
191  DcsSet::const_iterator lb = lower_bound(valList.begin(), valList.end(), dummy);
192  if ((lb != valList.end()) && (lb->DcsId() == fid.rawId()))
193  return true;
194  return false;
195 }
list fid
Definition: NewTree.py:51
HcalDcsValues::DcsSet const & HcalDcsValues::getAllSubdetValues ( DcsSubDet  subd) const

Definition at line 155 of file HcalDcsValues.cc.

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

155  {
156  switch (subd) {
157  case HcalHB : return mHBValues;
158  case HcalHE : return mHEValues;
159  case HcalHO0 : return mHO0Values;
160  case HcalHO12 : return mHO12Values;
161  case HcalHF : return mHFValues;
162  }
163  return mHBValues;
164 }
DcsSet mHO0Values
Definition: HcalDcsValues.h:62
DcsSet mHFValues
Definition: HcalDcsValues.h:66
DcsSet mHBValues
Definition: HcalDcsValues.h:58
DcsSet mHO12Values
Definition: HcalDcsValues.h:64
DcsSet mHEValues
Definition: HcalDcsValues.h:60
HcalDcsValues::DcsSet HcalDcsValues::getValues ( HcalDcsDetId const &  fid)

Definition at line 73 of file HcalDcsValues.cc.

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

73  {
74  DcsSet * valList = 0;
75  switch(fid.subdet()) {
76  case HcalDcsBarrel :
77  valList = &mHBValues;
79  break;
80  case HcalDcsEndcap :
81  valList = &mHEValues;
83  break;
84  case HcalDcsOuter :
85  if (fid.ring() == 0) {
86  valList = &mHO0Values;
88  } else {
89  valList = &mHO12Values;
91  }
92  break;
93  case HcalDcsForward :
94  valList = &mHFValues;
96  break;
97  default : valList = 0;
98  }
99 
100  if (valList) {
101  HcalDcsValue dummy(fid.rawId(), -1, 0., 0., 0.);
102  DcsSet::const_iterator lb = lower_bound(valList->begin(), valList->end(), dummy);
103  if ((lb != valList->end()) && (lb->DcsId() == fid.rawId())) {
104  DcsSet::const_iterator ub = upper_bound(valList->begin(), valList->end(), dummy);
105  return DcsSet(lb, ub) ;
106  }
107  }
108  return DcsSet() ;
109 }
DcsSet mHO0Values
Definition: HcalDcsValues.h:62
std::vector< HcalDcsValue > DcsSet
Definition: HcalDcsValues.h:25
DcsSet mHFValues
Definition: HcalDcsValues.h:66
DcsSet mHBValues
Definition: HcalDcsValues.h:58
bool sortList(DcsSet &valList) const
list fid
Definition: NewTree.py:51
DcsSet mHO12Values
Definition: HcalDcsValues.h:64
DcsSet mHEValues
Definition: HcalDcsValues.h:60
std::string HcalDcsValues::myname ( ) const
inline

Definition at line 45 of file HcalDcsValues.h.

45 { return (std::string)"HcalDcsValues"; }
void HcalDcsValues::sortAll ( )
bool HcalDcsValues::sortList ( DcsSet valList) const
protected

Definition at line 213 of file HcalDcsValues.cc.

References python.multivaluedict::sort().

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

213  {
214  sort(valList.begin(), valList.end());
215  return true;
216 }
bool HcalDcsValues::subDetOk ( DcsSet const &  valList,
int  LS 
) const
protected

Definition at line 197 of file HcalDcsValues.cc.

Referenced by DcsValuesOK().

197  {
198  std::set<uint32_t> badIds;
199  DcsSet::const_iterator val = valList.begin();
200  while ( (val != valList.end()) &&
201  ( (LS>-1) ? (val->LS()<=LS) : true) ) {
202  if (!val->isValueGood()) {
203  badIds.insert(val->DcsId());
204  } else {
205  std::set<uint32_t>::iterator fnd = badIds.find(val->DcsId());
206  if (*fnd == val->DcsId()) badIds.erase(fnd);
207  }
208  ++val;
209  }
210  return (badIds.size()==0);
211 }

Member Data Documentation

bool HcalDcsValues::mHBsorted
mutableprivate

Definition at line 59 of file HcalDcsValues.h.

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

DcsSet HcalDcsValues::mHBValues
private

Definition at line 58 of file HcalDcsValues.h.

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

bool HcalDcsValues::mHEsorted
mutableprivate

Definition at line 61 of file HcalDcsValues.h.

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

DcsSet HcalDcsValues::mHEValues
private

Definition at line 60 of file HcalDcsValues.h.

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

bool HcalDcsValues::mHFsorted
mutableprivate

Definition at line 67 of file HcalDcsValues.h.

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

DcsSet HcalDcsValues::mHFValues
private

Definition at line 66 of file HcalDcsValues.h.

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

bool HcalDcsValues::mHO0sorted
mutableprivate

Definition at line 63 of file HcalDcsValues.h.

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

DcsSet HcalDcsValues::mHO0Values
private

Definition at line 62 of file HcalDcsValues.h.

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

bool HcalDcsValues::mHO12sorted
mutableprivate

Definition at line 65 of file HcalDcsValues.h.

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

DcsSet HcalDcsValues::mHO12Values
private

Definition at line 64 of file HcalDcsValues.h.

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