Go to the documentation of this file.00001 #ifndef CaloOnlineTools_HcalOnlineDb_HcalAssistant_h
00002 #define CaloOnlineTools_HcalOnlineDb_HcalAssistant_h
00003
00004
00005
00006
00007
00016
00017
00018
00019
00020
00021
00022 #include <iostream>
00023 #include <string>
00024 #include <vector>
00025 #include <map>
00026
00027 #include "DataFormats/HcalDetId/interface/HcalSubdetector.h"
00028 #include "DataFormats/HcalDetId/interface/HcalZDCDetId.h"
00029
00030 #ifndef DATAFORMATS_HCALDETID_HCALSUBDETECTOR_H
00031 #define DATAFORMATS_HCALDETID_HCALSUBDETECTOR_H
00032 enum HcalSubdetector { HcalEmpty=0, HcalBarrel=1, HcalEndcap=2, HcalOuter=3, HcalForward=4, HcalTriggerTower=5, HcalOther=7 };
00033 enum HcalOtherSubdetector { HcalOtherEmpty=0, HcalCalibration=2 };
00034 #endif
00035
00036 class HcalAssistant
00037 {
00038
00039 public:
00040 friend class HcalChannelQualityXml;
00041
00042 HcalAssistant();
00043 virtual ~HcalAssistant();
00044
00045 int addQuotes();
00046 std::string getRandomQuote(void);
00047
00048 std::string getUserName(void);
00049
00050 HcalSubdetector getSubdetector(std::string _det);
00051 std::string getSubdetectorString(HcalSubdetector _det);
00052 HcalZDCDetId::Section getZDCSection(std::string _section);
00053 std::string getZDCSectionString(HcalZDCDetId::Section _section);
00054
00055 int getListOfChannelsFromDb();
00056 int getSubdetector(int _rawid);
00057 int getIeta(int _rawid);
00058 int getIphi(int _rawid);
00059 int getDepth(int _rawid);
00060 int getRawId(HcalSubdetector _det, int _ieta, int _iphi, int _depth);
00061
00062 int a_to_i(char * inbuf);
00063
00064 private:
00065 std::vector<std::string> quotes;
00066 std::map<int,int> geom_to_rawid;
00067 std::map<int,int> rawid_to_geom;
00068 bool listIsRead;
00069
00070
00071
00072
00073 int getGeomId(HcalSubdetector _det, int _ieta, int _iphi, int _depth);
00074 int getHcalIeta(int _geomId);
00075 int getHcalIphi(int _geomId);
00076 int getHcalDepth(int _geomId);
00077 HcalSubdetector getHcalSubdetector(int _geomId);
00078 std::string getSubdetectorString(int _geomId);
00079 int getRawId(int _geomId);
00080 int getRawIdFromCmssw(int _geomId);
00081 int getGeomId(int _rawid);
00082 };
00083
00084
00085 #endif