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 // $Id: HcalChannelQualityXml.h,v 1.7 2009/10/26 02:55:16 kukartse Exp $
20 //
21 
22 #include <map>
23 #include <string>
25 
27 {
28 
29  public:
30 
31  typedef struct _ChannelQuality{
33  int status;
34  int onoff;
35  std::string comment;
37 
39  virtual ~HcalChannelQualityXml();
40 
41  // read ASCII stream with channel status word (cat ascii file)
42  // and generate corresponding XML
43  int makeXmlFromAsciiStream(int _runnumber,
44  int _iov_begin,
45  int _iov_end,
46  std::string _tag,
47  std::string _elements_comment,
48  std::string _base="hex"
49  );
50 
51  // get baseline channel status from a tag for a given IOV
52  // and output it in the ASCII format to stdout
53  int writeBaseLineFromOmdsToStdout(std::string _tag, int _iov_begin, std::string base="hex");
54 
55  // read ASCII stream with channel status word (cat ascii file)
56  int readStatusWordFromStdin(std::string base="hex");
57 
58  // write ASCII stream with channel status word
59  int writeStatusWordToStdout(std::string base = "hex"); // status and detId in hex or dec
60 
61  // add dataset to the XML document
62  DOMNode * add_hcal_channel_dataset( int ieta, int iphi, int depth, std::string subdetector,
63  int _channel_status, int _on_off, std::string _comment );
64 
65  // add channel to the geomid_cq map (XML has not changed)
66  int addChannelToGeomIdMap( int ieta, int iphi, int depth, std::string subdetector,
67  int _channel_status, int _on_off, std::string _comment );
68 
69  // add data tag inside a dataset tag
70  DOMElement * add_data( DOMNode * _dataset, int _channel_status, int _on_off, std::string _comment );
71 
72  // add XML for all HCAL channels onoff entries
73  int set_all_channels_on_off( int _hb, int _he, int _hf, int _ho);
74 
75  // add XML for all HCAL channels status entries
76  int set_all_channels_status( uint32_t _hb, uint32_t _he, uint32_t _hf, uint32_t _ho);
77 
78  // get baseline channel status from a tag for a given IOV
79  int getBaseLineFromOmds(std::string _tag, int _iov_begin);
80 
81  // adds to XML datasets for channels in the map
82  int addChannelQualityGeom(std::map<int,ChannelQuality> & _cq); // the map key is geom hash as in HcalAssistant
83 
84  // reads tags from OMDS and dumps them to stdout newest first
85  // returns number of available tags
86  int dumpTagsFromOmdsToStdout(void);
87 
88  // reads a sorted list of tags, newest first
89  std::vector<std::string> getTagsFromOmds(void);
90 
91  // Reads IOVs available for a given tag from OMDS and dumps them
92  // to stdout newest first.
93  // Returns the number of available IOVs
94  int dumpIovsFromOmdsToStdout(std::string tag);
95 
96  // reads a sorted list of IOVs for a given tag, newest first
97  std::vector<int> getIovsFromOmds(std::string tag);
98 
99 
100  std::map<int,ChannelQuality> detid_cq; // HcalDetId as key
101  std::map<int,ChannelQuality> geomid_cq; // geomId as key
102 
103  private:
104  std::string get_random_comment( void );
105  HcalAssistant hAss; // HcalDetId and proprietary channel hash
106 };
107 
108 #endif
tuple base
Main Program
Definition: newFWLiteAna.py:92
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)
MemBufInputSource * _dataset
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")
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)
DOMElement * add_data(DOMNode *_dataset, 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")
int addChannelQualityGeom(std::map< int, ChannelQuality > &_cq)