CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
TkHistoMap.h
Go to the documentation of this file.
1 #ifndef DQM_SiStripCommon_TKHistoMap_h
2 #define DQM_SiStripCommon_TKHistoMap_h
3 
8 
11 #include <string>
12 
13 class TkHistoMap{
14 
15  typedef std::vector<MonitorElement*> tkHistoMapVect;
16 
17  public:
18  TkHistoMap(DQMStore::IBooker & ibooker , std::string path, std::string MapName, float baseline=0, bool mechanicalView=false);
19  TkHistoMap(std::string path, std::string MapName, float baseline=0, bool mechanicalView=false);
20  TkHistoMap();
22 
23  void loadServices();
24 
25  void loadTkHistoMap(std::string path, std::string MapName, bool mechanicalView=false);
26 
27  MonitorElement* getMap(short layerNumber){return tkHistoMap_[layerNumber];};
28  std::vector<MonitorElement*>& getAllMaps(){return tkHistoMap_;};
29 
30  float getValue(uint32_t& detid);
31  float getEntries(uint32_t& detid);
32  uint32_t getDetId(std::string title, int ix, int iy){return getDetId(getLayerNum(getLayerName(title)),ix,iy);}
33  uint32_t getDetId(int layer, int ix, int iy){return tkdetmap_->getDetFromBin(layer,ix,iy);}
34  uint32_t getDetId(MonitorElement*ME, int ix, int iy){return getDetId(ME->getTitle(),ix,iy);}
35  std::string getLayerName(std::string title){return title.erase(0,MapName_.size()+1);}
36  uint16_t getLayerNum(std::string layerName){return tkdetmap_->getLayerNum(layerName);}
37 
39  void fill(uint32_t& detid,float value);
40  void setBinContent(uint32_t& detid,float value);
41  void add(uint32_t& detid,float value);
42 
43  void dumpInTkMap(TrackerMap* tkmap, bool dumpEntries=false); //dumpEntries==true? (dump entries) : (dump mean values)
46 
47  private:
48 
49  //fixme: keep single method
50  void createTkHistoMap(std::string& path, std::string& MapName, float& baseline, bool mechanicalView);
51  void createTkHistoMap(DQMStore::IBooker & ibooker , std::string& path, std::string& MapName, float& baseline, bool mechanicalView);
52 
53  std::string folderDefinition(std::string& path, std::string& MapName, int layer , bool mechanicalView, std::string& fullName);
54 
57  uint32_t cached_detid;
58  int16_t cached_layer;
60  std::vector<MonitorElement*> tkHistoMap_;
63 };
64 
65 #endif
int getLayerNum(const std::string &in) const
Definition: TkDetMap.cc:777
void loadServices()
Definition: TkHistoMap.cc:38
uint32_t getDetId(int layer, int ix, int iy)
Definition: TkHistoMap.h:33
std::vector< MonitorElement * > & getAllMaps()
Definition: TkHistoMap.h:28
uint32_t getDetId(MonitorElement *ME, int ix, int iy)
Definition: TkHistoMap.h:34
uint32_t cached_detid
Definition: TkHistoMap.h:57
int16_t cached_layer
Definition: TkHistoMap.h:58
int HistoNumber
Definition: TkHistoMap.h:61
std::vector< MonitorElement * > tkHistoMapVect
Definition: TkHistoMap.h:15
DQMStore * dqmStore_
Definition: TkHistoMap.h:55
std::vector< MonitorElement * > tkHistoMap_
Definition: TkHistoMap.h:60
void saveAsCanvas(std::string filename, std::string options="", std::string mode="RECREATE")
Definition: TkHistoMap.cc:252
std::string getLayerName(std::string title)
Definition: TkHistoMap.h:35
uint32_t getDetFromBin(int layer, int ix, int iy) const
Definition: TkDetMap.h:128
Definition: ME.h:11
float getEntries(uint32_t &detid)
Definition: TkHistoMap.cc:228
std::string MapName_
Definition: TkHistoMap.h:62
void loadTkHistoMap(std::string path, std::string MapName, bool mechanicalView=false)
Definition: TkHistoMap.cc:61
void save(std::string filename)
Definition: TkHistoMap.cc:57
void fill(uint32_t &detid, float value)
Definition: TkHistoMap.cc:180
TkLayerMap::XYbin cached_XYbin
Definition: TkHistoMap.h:59
float getValue(uint32_t &detid)
Definition: TkHistoMap.cc:223
std::string getTitle(void) const
get MonitorElement title
TkDetMap * tkdetmap_
Definition: TkHistoMap.h:56
void createTkHistoMap(std::string &path, std::string &MapName, float &baseline, bool mechanicalView)
Definition: TkHistoMap.cc:80
void dumpInTkMap(TrackerMap *tkmap, bool dumpEntries=false)
Definition: TkHistoMap.cc:234
void setBinContent(uint32_t &detid, float value)
Definition: TkHistoMap.cc:196
void fillFromAscii(std::string filename)
Definition: TkHistoMap.cc:168
string fullName
MonitorElement * getMap(short layerNumber)
Definition: TkHistoMap.h:27
uint16_t getLayerNum(std::string layerName)
Definition: TkHistoMap.h:36
tuple filename
Definition: lut2db_cfg.py:20
std::string folderDefinition(std::string &path, std::string &MapName, int layer, bool mechanicalView, std::string &fullName)
Definition: TkHistoMap.cc:142
void add(uint32_t &detid, float value)
Definition: TkHistoMap.cc:213
uint32_t getDetId(std::string title, int ix, int iy)
Definition: TkHistoMap.h:32