CMS 3D CMS Logo

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(const TkDetMap* tkDetMap, DQMStore::IBooker& ibooker, const std::string& path, const std::string& MapName, float baseline=0, bool mechanicalView=false);
19  TkHistoMap(const TkDetMap* tkDetMap, const std::string& path, const std::string& MapName, float baseline=0, bool mechanicalView=false);
20  TkHistoMap(const TkDetMap* tkDetMap, const std::string& path, const std::string& MapName, float baseline, bool mechanicalView, bool isTH2F);
21  TkHistoMap(const TkDetMap* tkDetMap);
23 
24  void loadServices();
25 
26  void loadTkHistoMap(const std::string& path, const std::string& MapName, bool mechanicalView=false);
27 
28  MonitorElement* getMap(short layerNumber){return tkHistoMap_[layerNumber];};
29  const std::vector<MonitorElement*>& getAllMaps() const {return tkHistoMap_;};
30  std::vector<MonitorElement*>& getAllMaps(){return tkHistoMap_;};
31 
32  float getValue(DetId detid);
33  float getEntries(DetId detid);
34  DetId getDetId(const std::string& title, int ix, int iy){return getDetId(getLayerNum(getLayerName(title)),ix,iy);}
35  DetId getDetId(int layer, int ix, int iy){return tkdetmap_->getDetFromBin(layer,ix,iy);}
36  DetId getDetId(const MonitorElement* ME, int ix, int iy){return getDetId(ME->getTitle(),ix,iy);}
37  std::string getLayerName(std::string title){return title.erase(0,MapName_.size()+1);}
38  uint16_t getLayerNum(const std::string& layerName){return tkdetmap_->getLayerNum(layerName);}
39 
40  void fillFromAscii(const std::string& filename);
41  void fill(DetId detid,float value);
42  void setBinContent(DetId detid,float value);
43  void add(DetId detid,float value);
44 
45  void dumpInTkMap(TrackerMap* tkmap, bool dumpEntries=false); //dumpEntries==true? (dump entries) : (dump mean values)
46  void save(const std::string& filename);
47  void saveAsCanvas(const std::string& filename, const std::string& options="", const std::string& mode="RECREATE");
48 
49  private:
50 
51  void load(const TkDetMap* tkDetMap, const std::string& path, float baseline, bool mechanicalView, bool isTH2F, bool createTkMap = true);
52 
53  void createTkHistoMap(const std::string& path, const std::string& MapName, float baseline, bool mechanicalView);
54 
55  std::string folderDefinition(std::string folder, const std::string& MapName, int layer , bool mechanicalView,std::string& fullName );
56 
57  DQMStore* dqmStore_{nullptr};
60 
61 
64  int16_t cached_layer;
66  std::vector<MonitorElement*> tkHistoMap_;
69  bool isTH2F_;
70 };
71 
72 #endif
void loadServices()
Definition: TkHistoMap.cc:47
std::string folderDefinition(std::string folder, const std::string &MapName, int layer, bool mechanicalView, std::string &fullName)
Definition: TkHistoMap.cc:126
DetId cached_detid
Definition: TkHistoMap.h:63
void setBinContent(DetId detid, float value)
Definition: TkHistoMap.cc:185
std::vector< MonitorElement * > & getAllMaps()
Definition: TkHistoMap.h:30
DetId getDetId(const MonitorElement *ME, int ix, int iy)
Definition: TkHistoMap.h:36
void fillFromAscii(const std::string &filename)
Definition: TkHistoMap.cc:150
void load(const TkDetMap *tkDetMap, const std::string &path, float baseline, bool mechanicalView, bool isTH2F, bool createTkMap=true)
Definition: TkHistoMap.cc:37
int16_t cached_layer
Definition: TkHistoMap.h:64
int HistoNumber
Definition: TkHistoMap.h:67
std::vector< MonitorElement * > tkHistoMapVect
Definition: TkHistoMap.h:15
const std::vector< MonitorElement * > & getAllMaps() const
Definition: TkHistoMap.h:29
DQMStore * dqmStore_
Definition: TkHistoMap.h:57
DQMStore::IBooker * ibooker_
Definition: TkHistoMap.h:58
std::vector< MonitorElement * > tkHistoMap_
Definition: TkHistoMap.h:66
std::string getLayerName(std::string title)
Definition: TkHistoMap.h:37
void createTkHistoMap(const std::string &path, const std::string &MapName, float baseline, bool mechanicalView)
Definition: TkHistoMap.cc:86
Definition: ME.h:11
static int getLayerNum(const std::string &in)
Definition: TkDetMap.cc:310
DetId getDetId(int layer, int ix, int iy)
Definition: TkHistoMap.h:35
void save(const std::string &filename)
Definition: TkHistoMap.cc:62
std::string MapName_
Definition: TkHistoMap.h:68
std::string getTitle() const
get MonitorElement title
TkLayerMap::XYbin cached_XYbin
Definition: TkHistoMap.h:65
TkHistoMap(const TkDetMap *tkDetMap, DQMStore::IBooker &ibooker, const std::string &path, const std::string &MapName, float baseline=0, bool mechanicalView=false)
Definition: TkHistoMap.cc:29
Definition: value.py:1
void dumpInTkMap(TrackerMap *tkmap, bool dumpEntries=false)
Definition: TkHistoMap.cc:237
DQMStore::IGetter * igetter_
Definition: TkHistoMap.h:59
Definition: DetId.h:18
MonitorElement * getMap(short layerNumber)
Definition: TkHistoMap.h:28
bool isTH2F_
Definition: TkHistoMap.h:69
DetId getDetId(const std::string &title, int ix, int iy)
Definition: TkHistoMap.h:34
void fill(DetId detid, float value)
Definition: TkHistoMap.cc:162
uint16_t getLayerNum(const std::string &layerName)
Definition: TkHistoMap.h:38
const TkDetMap * tkdetmap_
Definition: TkHistoMap.h:62
void saveAsCanvas(const std::string &filename, const std::string &options="", const std::string &mode="RECREATE")
Definition: TkHistoMap.cc:255
void loadTkHistoMap(const std::string &path, const std::string &MapName, bool mechanicalView=false)
Definition: TkHistoMap.cc:67
DetId getDetFromBin(int layer, int ix, int iy) const
Definition: TkDetMap.h:139
void add(DetId detid, float value)
Definition: TkHistoMap.cc:207
float getEntries(DetId detid)
Definition: TkHistoMap.cc:228
float getValue(DetId detid)
Definition: TkHistoMap.cc:219