Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2021-02-14 12:51:08

0001 // -*- C++ -*-
0002 #ifndef HcalDcsValues_h
0003 #define HcalDcsValues_h
0004 
0005 #include "CondFormats/Serialization/interface/Serializable.h"
0006 
0007 #include <iostream>
0008 //#include <set>
0009 #include <vector>
0010 #include "CondFormats/HcalObjects/interface/HcalDcsValue.h"
0011 #include "DataFormats/HcalDetId/interface/HcalDetId.h"
0012 #include "DataFormats/HcalDetId/interface/HcalDcsDetId.h"
0013 #include "DataFormats/HcalDetId/interface/HcalSubdetector.h"
0014 
0015 /*
0016   \class: HcalDcsValues
0017   \author: Jacob Anderson
0018 
0019   A container class for holding the dcs values from the database.  The
0020   values are organized by subdetector, and sorted by HcalDcsDetId.
0021   There is also checking functionality to be able to see that the
0022   values are witin their set bounds.
0023  */
0024 
0025 class HcalDcsValues {
0026 public:
0027   typedef std::vector<HcalDcsValue> DcsSet;
0028 
0029   //The subdetectors of interest to the Hcal run certification
0030   enum DcsSubDet { HcalHB = 1, HcalHE = 2, HcalHO0 = 3, HcalHO12 = 4, HcalHF = 5 };
0031 
0032   HcalDcsValues();
0033 
0034   virtual ~HcalDcsValues();
0035 
0036   // add a new value to the appropriate list
0037   bool addValue(HcalDcsValue const& newVal);
0038   void sortAll();
0039   // check if a given id has any entries in a list
0040   bool exists(HcalDcsDetId const& fid);
0041   // get a list of values that are for the give id
0042   DcsSet getValues(HcalDcsDetId const& fid);
0043 
0044   DcsSet const& getAllSubdetValues(DcsSubDet subd) const;
0045 
0046   std::string myname() const { return (std::string) "HcalDcsValues"; }
0047 
0048   //Check the values of a subdetector.  If LS is -1 then for the whole run
0049   //otherwise for the given LS.
0050   bool DcsValuesOK(DcsSubDet subd, int LS = -1);
0051   //bool DcsValuesOK(HcalDetID dataId, DcsMap, int LS = -1) const;
0052 
0053 protected:
0054   bool foundDcsId(DcsSet const& valList, HcalDcsDetId const& fid) const;
0055   bool subDetOk(DcsSet const& valList, int LS) const;
0056   bool sortList(DcsSet& valList) const;
0057 
0058 private:
0059   DcsSet mHBValues;
0060   bool mHBsorted;
0061   DcsSet mHEValues;
0062   bool mHEsorted;
0063   DcsSet mHO0Values;
0064   bool mHO0sorted;
0065   DcsSet mHO12Values;
0066   bool mHO12sorted;
0067   DcsSet mHFValues;
0068   bool mHFsorted;
0069 
0070   COND_SERIALIZABLE;
0071 };
0072 
0073 #endif