00001 #ifndef DQM_ECALCOMMON_GeomHelperFunctions_H
00002 #define DQM_ECALCOMMON_GeomHelperFunctions_H
00003
00012 #include <string>
00013 #include <map>
00014
00015 class DQMStore;
00016 class MonitorElement;
00017 class EEDetId;
00018 class EcalScDetId;
00019 class EcalTrigTowerDetId;
00020
00021 namespace ecaldqm {
00022
00023 enum ObjectType {
00024 kFullEE,
00025 kEEp,
00026 kEEm,
00027 kEEpFar, kEEpNear,
00028 kEEmFar, kEEmNear,
00029 kSM
00030 };
00031
00032 enum BinningType {
00033 kCrystal,
00034 kSuperCrystal,
00035 kTriggerTower
00036 };
00037
00038 struct MeInfo {
00039 ObjectType otype;
00040 BinningType btype;
00041 int ism;
00042 };
00043
00044 class MeInfoMap {
00045
00046 public:
00047 static void set(MonitorElement *me, ObjectType otype, BinningType btype, int ism);
00048 static const MeInfo *get(MonitorElement *me);
00049
00050 private:
00051 static std::map<std::string, MeInfo> infos;
00052 };
00053
00054
00055 MonitorElement *bookME(DQMStore *dqmStore, const std::string &name, const std::string &title, const std::string &className, ObjectType otype, BinningType btype = kCrystal, int ism = 0, double lowZ = 0., double highZ = 0., const char *option = "s");
00056
00057 void fillME(MonitorElement *me, const EEDetId &id, double wz = 1., double wprof = 1.);
00058 void fillME(MonitorElement *me, const EcalScDetId &id, double wz = 1., double wprof = 1.);
00059 void fillME(MonitorElement *me, const EcalTrigTowerDetId &id, double wz = 1., double wprof = 1.);
00060
00061 int getBinME(MonitorElement *me, const EEDetId &id);
00062 int getBinME(MonitorElement *me, const EcalScDetId &id);
00063 int getBinME(MonitorElement *me, const EcalTrigTowerDetId &id);
00064
00065 double getBinContentME(MonitorElement *me, const EEDetId &id);
00066 double getBinContentME(MonitorElement *me, const EcalScDetId &id);
00067 double getBinContentME(MonitorElement *me, const EcalTrigTowerDetId &id);
00068
00069 double getBinErrorME(MonitorElement *me, const EEDetId &id);
00070 double getBinErrorME(MonitorElement *me, const EcalScDetId &id);
00071 double getBinErrorME(MonitorElement *me, const EcalTrigTowerDetId &id);
00072
00073 double getBinEntriesME(MonitorElement *me, const EEDetId &id);
00074 double getBinEntriesME(MonitorElement *me, const EcalScDetId &id);
00075 double getBinEntriesME(MonitorElement *me, const EcalTrigTowerDetId &id);
00076
00077 void setBinContentME(MonitorElement *me, const EEDetId &id, double content);
00078 void setBinContentME(MonitorElement *me, const EcalScDetId &id, double content);
00079 void setBinContentME(MonitorElement *me, const EcalTrigTowerDetId &id, double content);
00080
00081 void setBinErrorME(MonitorElement *me, const EEDetId &id, double error);
00082 void setBinErrorME(MonitorElement *me, const EcalScDetId &id, double error);
00083 void setBinErrorME(MonitorElement *me, const EcalTrigTowerDetId &id, double error);
00084
00085 void setBinEntriesME(MonitorElement *me, const EEDetId &id, double entries);
00086 void setBinEntriesME(MonitorElement *me, const EcalScDetId &id, double entries);
00087 void setBinEntriesME(MonitorElement *me, const EcalTrigTowerDetId &id, double entries);
00088
00089 }
00090
00091 #endif