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(DQMStore::IBooker& ibooker, const std::string& path, const std::string& MapName, float baseline, bool mechanicalView);
54 
55  std::string folderDefinition(DQMStore::IBooker& ibooker, std::string folder, const std::string& MapName, int layer , bool mechanicalView,std::string& fullName );
56 
57  DQMStore* dqmStore_{nullptr};
58 
61  int16_t cached_layer;
63  std::vector<MonitorElement*> tkHistoMap_;
66  bool isTH2F_;
67 };
68 
69 #endif
void loadServices()
Definition: TkHistoMap.cc:55
DetId cached_detid
Definition: TkHistoMap.h:60
void setBinContent(DetId detid, float value)
Definition: TkHistoMap.cc:190
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:155
void load(const TkDetMap *tkDetMap, const std::string &path, float baseline, bool mechanicalView, bool isTH2F, bool createTkMap=true)
Definition: TkHistoMap.cc:46
int16_t cached_layer
Definition: TkHistoMap.h:61
int HistoNumber
Definition: TkHistoMap.h:64
std::vector< MonitorElement * > tkHistoMapVect
Definition: TkHistoMap.h:15
const std::vector< MonitorElement * > & getAllMaps() const
Definition: TkHistoMap.h:29
DQMStore * dqmStore_
Definition: TkHistoMap.h:57
std::vector< MonitorElement * > tkHistoMap_
Definition: TkHistoMap.h:63
std::string getLayerName(std::string title)
Definition: TkHistoMap.h:37
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:66
std::string MapName_
Definition: TkHistoMap.h:65
std::string getTitle() const
get MonitorElement title
void createTkHistoMap(DQMStore::IBooker &ibooker, const std::string &path, const std::string &MapName, float baseline, bool mechanicalView)
Definition: TkHistoMap.cc:93
TkLayerMap::XYbin cached_XYbin
Definition: TkHistoMap.h:62
TkHistoMap(const TkDetMap *tkDetMap, DQMStore::IBooker &ibooker, const std::string &path, const std::string &MapName, float baseline=0, bool mechanicalView=false)
Definition: TkHistoMap.cc:37
Definition: value.py:1
void dumpInTkMap(TrackerMap *tkmap, bool dumpEntries=false)
Definition: TkHistoMap.cc:242
Definition: DetId.h:18
MonitorElement * getMap(short layerNumber)
Definition: TkHistoMap.h:28
bool isTH2F_
Definition: TkHistoMap.h:66
DetId getDetId(const std::string &title, int ix, int iy)
Definition: TkHistoMap.h:34
void fill(DetId detid, float value)
Definition: TkHistoMap.cc:167
uint16_t getLayerNum(const std::string &layerName)
Definition: TkHistoMap.h:38
const TkDetMap * tkdetmap_
Definition: TkHistoMap.h:59
void saveAsCanvas(const std::string &filename, const std::string &options="", const std::string &mode="RECREATE")
Definition: TkHistoMap.cc:260
void loadTkHistoMap(const std::string &path, const std::string &MapName, bool mechanicalView=false)
Definition: TkHistoMap.cc:71
DetId getDetFromBin(int layer, int ix, int iy) const
Definition: TkDetMap.h:139
void add(DetId detid, float value)
Definition: TkHistoMap.cc:212
float getEntries(DetId detid)
Definition: TkHistoMap.cc:233
float getValue(DetId detid)
Definition: TkHistoMap.cc:224
std::string folderDefinition(DQMStore::IBooker &ibooker, std::string folder, const std::string &MapName, int layer, bool mechanicalView, std::string &fullName)
Definition: TkHistoMap.cc:133