File indexing completed on 2023-10-25 09:35:43
0001 #ifndef CaloOnlineTools_HcalOnlineDb_HcalAssistant_h
0002 #define CaloOnlineTools_HcalOnlineDb_HcalAssistant_h
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015
0016
0017
0018
0019
0020
0021 #include <iostream>
0022 #include <string>
0023 #include <vector>
0024 #include <map>
0025
0026 #include "DataFormats/HcalDetId/interface/HcalSubdetector.h"
0027 #include "DataFormats/HcalDetId/interface/HcalZDCDetId.h"
0028
0029 #ifndef DATAFORMATS_HCALDETID_HCALSUBDETECTOR_H
0030 #define DATAFORMATS_HCALDETID_HCALSUBDETECTOR_H
0031 enum HcalSubdetector {
0032 HcalEmpty = 0,
0033 HcalBarrel = 1,
0034 HcalEndcap = 2,
0035 HcalOuter = 3,
0036 HcalForward = 4,
0037 HcalTriggerTower = 5,
0038 HcalOther = 7
0039 };
0040 enum HcalOtherSubdetector { HcalOtherEmpty = 0, HcalCalibration = 2 };
0041 #endif
0042
0043 class HcalAssistant {
0044 public:
0045 friend class HcalChannelQualityXml;
0046
0047 HcalAssistant();
0048 virtual ~HcalAssistant();
0049
0050 int addQuotes();
0051 std::string getRandomQuote(void);
0052
0053 std::string getUserName(void);
0054
0055 HcalSubdetector getSubdetector(std::string _det);
0056 std::string getSubdetectorString(HcalSubdetector _det);
0057 HcalZDCDetId::Section getZDCSection(std::string _section);
0058 std::string getZDCSectionString(HcalZDCDetId::Section _section);
0059
0060 int getListOfChannelsFromDb();
0061 int getSubdetector(int _rawid);
0062 int getIeta(int _rawid);
0063 int getIphi(int _rawid);
0064 int getDepth(int _rawid);
0065 int getRawId(HcalSubdetector _det, int _ieta, int _iphi, int _depth);
0066
0067 int a_to_i(char* inbuf);
0068
0069 private:
0070 std::vector<std::string> quotes;
0071 std::map<int, int> geom_to_rawid;
0072 std::map<int, int> rawid_to_geom;
0073 bool listIsRead;
0074
0075
0076
0077
0078 int getGeomId(HcalSubdetector _det, int _ieta, int _iphi, int _depth);
0079 int getHcalIeta(int _geomId);
0080 int getHcalIphi(int _geomId);
0081 int getHcalDepth(int _geomId);
0082 HcalSubdetector getHcalSubdetector(int _geomId);
0083 std::string getSubdetectorString(int _geomId);
0084 int getRawId(int _geomId);
0085 int getRawIdFromCmssw(int _geomId);
0086 int getGeomId(int _rawid);
0087 };
0088
0089 #endif