CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
HcalChannelQualityXml.h
Go to the documentation of this file.
1 #ifndef CaloOnlineTools_HcalOnlineDb_HcalChannelQualityXml_h
2 #define CaloOnlineTools_HcalOnlineDb_HcalChannelQualityXml_h
3 // -*- C++ -*-
4 //
5 // Package: CaloOnlineTools/HcalOnlineDb
6 // Class : HcalChannelQualityXml
7 //
16 //
17 // Original Author: Gena Kukartsev, kukarzev@fnal.gov
18 // Created: Wed Jul 01 06:42:00 CDT 2009
19 //
20 
21 #include <map>
22 #include <string>
24 
26 {
27 
28  public:
29 
30  typedef struct _ChannelQuality{
32  int status;
33  int onoff;
36 
38  virtual ~HcalChannelQualityXml();
39 
40  // read ASCII stream with channel status word (cat ascii file)
41  // and generate corresponding XML
42  int makeXmlFromAsciiStream(int _runnumber,
43  int _iov_begin,
44  int _iov_end,
45  std::string _tag,
46  std::string _elements_comment,
47  std::string _base="hex"
48  );
49 
50  // get baseline channel status from a tag for a given IOV
51  // and output it in the ASCII format to stdout
52  int writeBaseLineFromOmdsToStdout(std::string _tag, int _iov_begin, std::string base="hex");
53 
54  // read ASCII stream with channel status word (cat ascii file)
56 
57  // write ASCII stream with channel status word
58  int writeStatusWordToStdout(std::string base = "hex"); // status and detId in hex or dec
59 
60  // add dataset to the XML document
61  XERCES_CPP_NAMESPACE::DOMNode * add_hcal_channel_dataset( int ieta, int iphi, int depth, std::string subdetector,
62  int _channel_status, int _on_off, std::string _comment );
63 
64  // add channel to the geomid_cq map (XML has not changed)
65  int addChannelToGeomIdMap( int ieta, int iphi, int depth, std::string subdetector,
66  int _channel_status, int _on_off, std::string _comment );
67 
68  // add data tag inside a dataset tag
69  XERCES_CPP_NAMESPACE::DOMElement * add_data( XERCES_CPP_NAMESPACE::DOMNode * _dataset, int _channel_status, int _on_off, std::string _comment );
70 
71  // add XML for all HCAL channels onoff entries
72  int set_all_channels_on_off( int _hb, int _he, int _hf, int _ho);
73 
74  // add XML for all HCAL channels status entries
75  int set_all_channels_status( uint32_t _hb, uint32_t _he, uint32_t _hf, uint32_t _ho);
76 
77  // get baseline channel status from a tag for a given IOV
78  int getBaseLineFromOmds(std::string _tag, int _iov_begin);
79 
80  // adds to XML datasets for channels in the map
81  int addChannelQualityGeom(std::map<int,ChannelQuality> & _cq); // the map key is geom hash as in HcalAssistant
82 
83  // reads tags from OMDS and dumps them to stdout newest first
84  // returns number of available tags
85  int dumpTagsFromOmdsToStdout(void);
86 
87  // reads a sorted list of tags, newest first
88  std::vector<std::string> getTagsFromOmds(void);
89 
90  // Reads IOVs available for a given tag from OMDS and dumps them
91  // to stdout newest first.
92  // Returns the number of available IOVs
94 
95  // reads a sorted list of IOVs for a given tag, newest first
96  std::vector<int> getIovsFromOmds(std::string tag);
97 
98 
99  std::map<int,ChannelQuality> detid_cq; // HcalDetId as key
100  std::map<int,ChannelQuality> geomid_cq; // geomId as key
101 
102  private:
104  HcalAssistant hAss; // HcalDetId and proprietary channel hash
105 };
106 
107 #endif
tuple base
Main Program
Definition: newFWLiteAna.py:91
XERCES_CPP_NAMESPACE::MemBufInputSource * _dataset
int makeXmlFromAsciiStream(int _runnumber, int _iov_begin, int _iov_end, std::string _tag, std::string _elements_comment, std::string _base="hex")
std::string get_random_comment(void)
int set_all_channels_status(uint32_t _hb, uint32_t _he, uint32_t _hf, uint32_t _ho)
std::vector< std::string > getTagsFromOmds(void)
int writeBaseLineFromOmdsToStdout(std::string _tag, int _iov_begin, std::string base="hex")
XERCES_CPP_NAMESPACE::DOMNode * add_hcal_channel_dataset(int ieta, int iphi, int depth, std::string subdetector, int _channel_status, int _on_off, std::string _comment)
int dumpIovsFromOmdsToStdout(std::string tag)
std::vector< int > getIovsFromOmds(std::string tag)
struct HcalChannelQualityXml::_ChannelQuality ChannelQuality
int addChannelToGeomIdMap(int ieta, int iphi, int depth, std::string subdetector, int _channel_status, int _on_off, std::string _comment)
int readStatusWordFromStdin(std::string base="hex")
int set_all_channels_on_off(int _hb, int _he, int _hf, int _ho)
int getBaseLineFromOmds(std::string _tag, int _iov_begin)
std::map< int, ChannelQuality > detid_cq
std::map< int, ChannelQuality > geomid_cq
int writeStatusWordToStdout(std::string base="hex")
XERCES_CPP_NAMESPACE::DOMElement * add_data(XERCES_CPP_NAMESPACE::DOMNode *_dataset, int _channel_status, int _on_off, std::string _comment)
int addChannelQualityGeom(std::map< int, ChannelQuality > &_cq)