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 
7 
10 #include <string>
11 
12 class TkHistoMap {
13 protected:
16  typedef std::vector<MonitorElement*> tkHistoMapVect;
17 
18 public:
19  TkHistoMap(const TkDetMap* tkDetMap,
20  DQMStore::IBooker& ibooker,
21  const std::string& path,
22  const std::string& MapName,
23  float baseline = 0,
24  bool mechanicalView = false);
25  TkHistoMap(const TkDetMap* tkDetMap,
26  const std::string& path,
27  const std::string& MapName,
28  float baseline = 0,
29  bool mechanicalView = false);
30  TkHistoMap(const TkDetMap* tkDetMap,
31  const std::string& path,
32  const std::string& MapName,
33  float baseline,
34  bool mechanicalView,
35  bool isTH2F);
36  TkHistoMap(const TkDetMap* tkDetMap);
38 
39  void loadServices();
40 
41  void loadTkHistoMap(const std::string& path, const std::string& MapName, bool mechanicalView = false);
42 
43  MonitorElement* getMap(short layerNumber) { return tkHistoMap_[layerNumber]; };
44  const std::vector<MonitorElement*>& getAllMaps() const { return tkHistoMap_; };
45  std::vector<MonitorElement*>& getAllMaps() { return tkHistoMap_; };
46 
47  float getValue(DetId detid);
48  float getEntries(DetId detid);
49  DetId getDetId(const std::string& title, int ix, int iy) {
50  return getDetId(getLayerNum(getLayerName(title)), ix, iy);
51  }
52  DetId getDetId(int layer, int ix, int iy) { return tkdetmap_->getDetFromBin(layer, ix, iy); }
53  DetId getDetId(const MonitorElement* ME, int ix, int iy) { return getDetId(ME->getTitle(), ix, iy); }
54  std::string getLayerName(std::string title) { return title.erase(0, MapName_.size() + 1); }
56 
57  void fillFromAscii(const std::string& filename);
58  void fill(DetId detid, float value);
59  void setBinContent(DetId detid, float value);
60  void add(DetId detid, float value);
61 
62  void dumpInTkMap(TrackerMap* tkmap,
63  bool dumpEntries = false); //dumpEntries==true? (dump entries) : (dump mean values)
64  void save(const std::string& filename);
65  void saveAsCanvas(const std::string& filename, const std::string& options = "", const std::string& mode = "RECREATE");
66 
67 private:
68  void load(const TkDetMap* tkDetMap,
69  const std::string& path,
70  float baseline,
71  bool mechanicalView,
72  bool isTH2F,
73  bool createTkMap = true);
74 
75  void createTkHistoMap(DQMStore::IBooker& ibooker,
76  const std::string& path,
77  const std::string& MapName,
78  float baseline,
79  bool mechanicalView);
80 
83  const std::string& MapName,
84  int layer,
85  bool mechanicalView,
87 
88  DQMStore* dqmStore_{nullptr};
89 
92  int16_t cached_layer;
94  std::vector<MonitorElement*> tkHistoMap_;
97  bool isTH2F_;
98 };
99 
100 #endif
runGCPTkAlMap.title
string title
Definition: runGCPTkAlMap.py:94
MessageLogger.h
TkHistoMap::setBinContent
void setBinContent(DetId detid, float value)
Definition: TkHistoMap.cc:204
TkHistoMap::getAllMaps
const std::vector< MonitorElement * > & getAllMaps() const
Definition: TkHistoMap.h:44
TkHistoMap::getDetId
DetId getDetId(int layer, int ix, int iy)
Definition: TkHistoMap.h:52
printsummarytable.folder
folder
Definition: printsummarytable.py:7
TkHistoMap::MapName_
std::string MapName_
Definition: TkHistoMap.h:96
TkHistoMap::tkHistoMapVect
std::vector< MonitorElement * > tkHistoMapVect
Definition: TkHistoMap.h:16
ALCARECOPromptCalibProdSiPixelAli0T_cff.mode
mode
Definition: ALCARECOPromptCalibProdSiPixelAli0T_cff.py:96
TkHistoMap::fillFromAscii
void fillFromAscii(const std::string &filename)
Definition: TkHistoMap.cc:164
TkHistoMap::add
void add(DetId detid, float value)
Definition: TkHistoMap.cc:232
DQMStore.h
dqm::legacy::MonitorElement
Definition: MonitorElement.h:462
TkHistoMap::cached_detid
DetId cached_detid
Definition: TkHistoMap.h:91
TkHistoMap::getAllMaps
std::vector< MonitorElement * > & getAllMaps()
Definition: TkHistoMap.h:45
TkHistoMap::save
void save(const std::string &filename)
Definition: TkHistoMap.cc:71
TkHistoMap::getValue
float getValue(DetId detid)
Definition: TkHistoMap.cc:250
TkHistoMap::MonitorElement
dqm::legacy::MonitorElement MonitorElement
Definition: TkHistoMap.h:15
TkDetMap::getLayerNum
static int getLayerNum(const std::string &in)
Definition: TkDetMap.cc:311
options
Definition: options.py:1
DetId
Definition: DetId.h:17
TkHistoMap::load
void load(const TkDetMap *tkDetMap, const std::string &path, float baseline, bool mechanicalView, bool isTH2F, bool createTkMap=true)
Definition: TkHistoMap.cc:47
TkHistoMap::fill
void fill(DetId detid, float value)
Definition: TkHistoMap.cc:176
dqm::legacy::DQMStore
Definition: DQMStore.h:727
TkHistoMap::getLayerNum
uint16_t getLayerNum(const std::string &layerName)
Definition: TkHistoMap.h:55
Service.h
TkDetMap::getDetFromBin
DetId getDetFromBin(int layer, int ix, int iy) const
Definition: TkDetMap.h:191
TkHistoMap::getDetId
DetId getDetId(const MonitorElement *ME, int ix, int iy)
Definition: TkHistoMap.h:53
TkHistoMap::dqmStore_
DQMStore * dqmStore_
Definition: TkHistoMap.h:88
corrVsCorr.filename
filename
Definition: corrVsCorr.py:123
TkDetMap
Definition: TkDetMap.h:175
TkHistoMap::loadTkHistoMap
void loadTkHistoMap(const std::string &path, const std::string &MapName, bool mechanicalView=false)
Definition: TkHistoMap.cc:76
TrackerMap
Definition: TrackerMap.h:76
TkHistoMap::tkHistoMap_
std::vector< MonitorElement * > tkHistoMap_
Definition: TkHistoMap.h:94
phase1PixelTopology::layer
constexpr std::array< uint8_t, layerIndexSize > layer
Definition: phase1PixelTopology.h:99
AlCaHLTBitMon_QueryRunRegistry.string
string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
newFWLiteAna.fullName
fullName
Definition: newFWLiteAna.py:122
TkHistoMap::cached_layer
int16_t cached_layer
Definition: TkHistoMap.h:92
TkHistoMap::HistoNumber
int HistoNumber
Definition: TkHistoMap.h:95
TkHistoMap::dumpInTkMap
void dumpInTkMap(TrackerMap *tkmap, bool dumpEntries=false)
Definition: TkHistoMap.cc:270
TkHistoMap::createTkHistoMap
void createTkHistoMap(DQMStore::IBooker &ibooker, const std::string &path, const std::string &MapName, float baseline, bool mechanicalView)
Definition: TkHistoMap.cc:100
TkHistoMap::folderDefinition
std::string folderDefinition(DQMStore::IBooker &ibooker, std::string folder, const std::string &MapName, int layer, bool mechanicalView, std::string &fullName)
Definition: TkHistoMap.cc:138
TkHistoMap::getLayerName
std::string getLayerName(std::string title)
Definition: TkHistoMap.h:54
TkHistoMap::TkHistoMap
TkHistoMap(const TkDetMap *tkDetMap, DQMStore::IBooker &ibooker, const std::string &path, const std::string &MapName, float baseline=0, bool mechanicalView=false)
Definition: TkHistoMap.cc:35
value
Definition: value.py:1
TkHistoMap::tkdetmap_
const TkDetMap * tkdetmap_
Definition: TkHistoMap.h:90
SiPixelPhase1Summary_cfi.MapName
MapName
Definition: SiPixelPhase1Summary_cfi.py:17
TrackerMap.h
TkHistoMap
Definition: TkHistoMap.h:12
TkHistoMap::isTH2F_
bool isTH2F_
Definition: TkHistoMap.h:97
TkHistoMap::cached_XYbin
TkLayerMap::XYbin cached_XYbin
Definition: TkHistoMap.h:93
TkHistoMap::saveAsCanvas
void saveAsCanvas(const std::string &filename, const std::string &options="", const std::string &mode="RECREATE")
Definition: TkHistoMap.cc:287
TkHistoMap::getEntries
float getEntries(DetId detid)
Definition: TkHistoMap.cc:260
ME
Definition: ME.h:11
TkHistoMap::getMap
MonitorElement * getMap(short layerNumber)
Definition: TkHistoMap.h:43
TkHistoMap::getDetId
DetId getDetId(const std::string &title, int ix, int iy)
Definition: TkHistoMap.h:49
TkDetMap.h
dqm::implementation::IBooker
Definition: DQMStore.h:43
castor_dqm_sourceclient_file_cfg.path
path
Definition: castor_dqm_sourceclient_file_cfg.py:37
TkHistoMap::DQMStore
dqm::legacy::DQMStore DQMStore
Definition: TkHistoMap.h:14
phase1PixelTopology::layerName
constexpr char const * layerName[numberOfLayers]
Definition: phase1PixelTopology.h:37
TkLayerMap::XYbin
Definition: TkDetMap.h:12
TkHistoMap::~TkHistoMap
~TkHistoMap()
Definition: TkHistoMap.h:37
TkHistoMap::loadServices
void loadServices()
Definition: TkHistoMap.cc:60