00001 // -*- C++ -*- 00002 #ifndef HcalDcsValues_h 00003 #define HcalDcsValues_h 00004 00005 #include <iostream> 00006 //#include <set> 00007 #include <vector> 00008 #include "CondFormats/HcalObjects/interface/HcalDcsValue.h" 00009 #include "DataFormats/HcalDetId/interface/HcalDetId.h" 00010 #include "DataFormats/HcalDetId/interface/HcalDcsDetId.h" 00011 #include "DataFormats/HcalDetId/interface/HcalSubdetector.h" 00012 00013 /* 00014 \class: HcalDcsValues 00015 \author: Jacob Anderson 00016 00017 A container class for holding the dcs values from the database. The 00018 values are organized by subdetector, and sorted by HcalDcsDetId. 00019 There is also checking functionality to be able to see that the 00020 values are witin their set bounds. 00021 */ 00022 00023 class HcalDcsValues { 00024 public: 00025 typedef std::vector<HcalDcsValue> DcsSet; 00026 00027 //The subdetectors of interest to the Hcal run certification 00028 enum DcsSubDet{ HcalHB = 1, HcalHE = 2, HcalHO0 = 3, HcalHO12 = 4, 00029 HcalHF = 5 }; 00030 00031 HcalDcsValues(); 00032 00033 virtual ~HcalDcsValues(); 00034 00035 // add a new value to the appropriate list 00036 bool addValue(HcalDcsValue const& newVal); 00037 void sortAll(); 00038 // check if a given id has any entries in a list 00039 bool exists(HcalDcsDetId const& fid); 00040 // get a list of values that are for the give id 00041 DcsSet getValues(HcalDcsDetId const& fid); 00042 00043 DcsSet const & getAllSubdetValues(DcsSubDet subd) const; 00044 00045 std::string myname() const { return (std::string)"HcalDcsValues"; } 00046 00047 //Check the values of a subdetector. If LS is -1 then for the whole run 00048 //otherwise for the given LS. 00049 bool DcsValuesOK(DcsSubDet subd, int LS = -1); 00050 //bool DcsValuesOK(HcalDetID dataId, DcsMap, int LS = -1) const; 00051 00052 protected: 00053 bool foundDcsId(DcsSet const& valList, HcalDcsDetId const& fid) const; 00054 bool subDetOk(DcsSet const& valList, int LS) const; 00055 bool sortList(DcsSet& valList) const; 00056 00057 private: 00058 DcsSet mHBValues; 00059 mutable bool mHBsorted; 00060 DcsSet mHEValues; 00061 mutable bool mHEsorted; 00062 DcsSet mHO0Values; 00063 mutable bool mHO0sorted; 00064 DcsSet mHO12Values; 00065 mutable bool mHO12sorted; 00066 DcsSet mHFValues; 00067 mutable bool mHFsorted; 00068 }; 00069 00070 #endif