CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
List of all members | Public Member Functions | Protected Types | Private Member Functions | Private Attributes
TkHistoMap Class Reference

#include <TkHistoMap.h>

Public Member Functions

void add (DetId detid, float value)
 
void dumpInTkMap (TrackerMap *tkmap, bool dumpEntries=false)
 
void fill (DetId detid, float value)
 
void fillFromAscii (const std::string &filename)
 
const std::vector
< MonitorElement * > & 
getAllMaps () const
 
std::vector< MonitorElement * > & getAllMaps ()
 
DetId getDetId (const std::string &title, int ix, int iy)
 
DetId getDetId (int layer, int ix, int iy)
 
DetId getDetId (const MonitorElement *ME, int ix, int iy)
 
float getEntries (DetId detid)
 
std::string getLayerName (std::string title)
 
uint16_t getLayerNum (const std::string &layerName)
 
MonitorElementgetMap (short layerNumber)
 
float getValue (DetId detid)
 
void loadServices ()
 
void loadTkHistoMap (const std::string &path, const std::string &MapName, bool mechanicalView=false)
 
void save (const std::string &filename)
 
void saveAsCanvas (const std::string &filename, const std::string &options="", const std::string &mode="RECREATE")
 
void setBinContent (DetId detid, float value)
 
 TkHistoMap (const TkDetMap *tkDetMap, DQMStore::IBooker &ibooker, const std::string &path, const std::string &MapName, float baseline=0, bool mechanicalView=false)
 
 TkHistoMap (const TkDetMap *tkDetMap, const std::string &path, const std::string &MapName, float baseline=0, bool mechanicalView=false)
 
 TkHistoMap (const TkDetMap *tkDetMap, const std::string &path, const std::string &MapName, float baseline, bool mechanicalView, bool isTH2F)
 
 TkHistoMap (const TkDetMap *tkDetMap)
 
 ~TkHistoMap ()
 

Protected Types

typedef dqm::legacy::DQMStore DQMStore
 
typedef dqm::legacy::MonitorElement MonitorElement
 
typedef std::vector
< MonitorElement * > 
tkHistoMapVect
 

Private Member Functions

void createTkHistoMap (DQMStore::IBooker &ibooker, const std::string &path, const std::string &MapName, float baseline, bool mechanicalView)
 
std::string folderDefinition (DQMStore::IBooker &ibooker, std::string folder, const std::string &MapName, int layer, bool mechanicalView, std::string &fullName)
 
void load (const TkDetMap *tkDetMap, const std::string &path, float baseline, bool mechanicalView, bool isTH2F, bool createTkMap=true)
 

Private Attributes

DetId cached_detid
 
int16_t cached_layer
 
TkLayerMap::XYbin cached_XYbin
 
DQMStoredqmStore_ {nullptr}
 
int HistoNumber
 
bool isTH2F_
 
std::string MapName_
 
const TkDetMaptkdetmap_
 
std::vector< MonitorElement * > tkHistoMap_
 

Detailed Description

Definition at line 12 of file TkHistoMap.h.

Member Typedef Documentation

Definition at line 14 of file TkHistoMap.h.

Definition at line 15 of file TkHistoMap.h.

typedef std::vector<MonitorElement*> TkHistoMap::tkHistoMapVect
protected

Definition at line 16 of file TkHistoMap.h.

Constructor & Destructor Documentation

TkHistoMap::TkHistoMap ( const TkDetMap tkDetMap,
DQMStore::IBooker ibooker,
const std::string &  path,
const std::string &  MapName,
float  baseline = 0,
bool  mechanicalView = false 
)

Definition at line 35 of file TkHistoMap.cc.

References createTkHistoMap(), load(), LogTrace, and MapName_.

41  : HistoNumber(35), MapName_(MapName) {
42  LogTrace("TkHistoMap") << "TkHistoMap::constructor with parameters";
43  load(tkDetMap, path, baseline, mechanicalView, false);
44  createTkHistoMap(ibooker, path, MapName_, baseline, mechanicalView);
45 }
void load(const TkDetMap *tkDetMap, const std::string &path, float baseline, bool mechanicalView, bool isTH2F, bool createTkMap=true)
Definition: TkHistoMap.cc:47
int HistoNumber
Definition: TkHistoMap.h:95
#define LogTrace(id)
std::string MapName_
Definition: TkHistoMap.h:96
void createTkHistoMap(DQMStore::IBooker &ibooker, const std::string &path, const std::string &MapName, float baseline, bool mechanicalView)
Definition: TkHistoMap.cc:100
TkHistoMap::TkHistoMap ( const TkDetMap tkDetMap,
const std::string &  path,
const std::string &  MapName,
float  baseline = 0,
bool  mechanicalView = false 
)

Definition at line 11 of file TkHistoMap.cc.

References createTkHistoMap(), dqmStore_, load(), LogTrace, MapName_, and dqm::implementation::DQMStore::meBookerGetter().

13  : HistoNumber(35), MapName_(MapName) {
14  LogTrace("TkHistoMap") << "TkHistoMap::constructor with parameters";
15  load(tkDetMap, path, baseline, mechanicalView, false);
16  dqmStore_->meBookerGetter([this, &path, &baseline, mechanicalView](DQMStore::IBooker& ibooker, DQMStore::IGetter&) {
17  this->createTkHistoMap(ibooker, path, MapName_, baseline, mechanicalView);
18  });
19 }
void load(const TkDetMap *tkDetMap, const std::string &path, float baseline, bool mechanicalView, bool isTH2F, bool createTkMap=true)
Definition: TkHistoMap.cc:47
int HistoNumber
Definition: TkHistoMap.h:95
DQMStore * dqmStore_
Definition: TkHistoMap.h:88
#define LogTrace(id)
std::string MapName_
Definition: TkHistoMap.h:96
void createTkHistoMap(DQMStore::IBooker &ibooker, const std::string &path, const std::string &MapName, float baseline, bool mechanicalView)
Definition: TkHistoMap.cc:100
void meBookerGetter(iFunc f)
Definition: DQMStore.h:632
TkHistoMap::TkHistoMap ( const TkDetMap tkDetMap,
const std::string &  path,
const std::string &  MapName,
float  baseline,
bool  mechanicalView,
bool  isTH2F 
)

Definition at line 21 of file TkHistoMap.cc.

References createTkHistoMap(), dqmStore_, load(), LogTrace, MapName_, and dqm::implementation::DQMStore::meBookerGetter().

27  : HistoNumber(35), MapName_(MapName) {
28  LogTrace("TkHistoMap") << "TkHistoMap::constructor with parameters";
29  load(tkDetMap, path, baseline, mechanicalView, isTH2F);
30  dqmStore_->meBookerGetter([this, &path, &baseline, mechanicalView](DQMStore::IBooker& ibooker, DQMStore::IGetter&) {
31  this->createTkHistoMap(ibooker, path, MapName_, baseline, mechanicalView);
32  });
33 }
void load(const TkDetMap *tkDetMap, const std::string &path, float baseline, bool mechanicalView, bool isTH2F, bool createTkMap=true)
Definition: TkHistoMap.cc:47
int HistoNumber
Definition: TkHistoMap.h:95
DQMStore * dqmStore_
Definition: TkHistoMap.h:88
#define LogTrace(id)
std::string MapName_
Definition: TkHistoMap.h:96
void createTkHistoMap(DQMStore::IBooker &ibooker, const std::string &path, const std::string &MapName, float baseline, bool mechanicalView)
Definition: TkHistoMap.cc:100
void meBookerGetter(iFunc f)
Definition: DQMStore.h:632
TkHistoMap::TkHistoMap ( const TkDetMap tkDetMap)

Definition at line 6 of file TkHistoMap.cc.

References validate-o2o-wbm::f, load(), and LogTrace.

6  : HistoNumber(35) {
7  LogTrace("TkHistoMap") << "TkHistoMap::constructor without parameters";
8  load(tkDetMap, "", 0.0f, false, false, false);
9 }
void load(const TkDetMap *tkDetMap, const std::string &path, float baseline, bool mechanicalView, bool isTH2F, bool createTkMap=true)
Definition: TkHistoMap.cc:47
int HistoNumber
Definition: TkHistoMap.h:95
#define LogTrace(id)
TkHistoMap::~TkHistoMap ( )
inline

Definition at line 37 of file TkHistoMap.h.

37 {};

Member Function Documentation

void TkHistoMap::add ( DetId  detid,
float  value 
)

Definition at line 232 of file TkHistoMap.cc.

References cached_detid, cached_layer, cached_XYbin, TkDetMap::findLayer(), TkDetMap::getXY(), TkLayerMap::XYbin::ix, TkLayerMap::XYbin::iy, class-composition::kind, phase1PixelTopology::layer, LogTrace, setBinContent(), MonitorElementData::TH2F, tkdetmap_, tkHistoMap_, and MonitorElementData::TPROFILE2D.

Referenced by counter.Counter::register(), SequenceTypes.Task::remove(), and SequenceTypes.Task::replace().

232  {
233 #ifdef debug_TkHistoMap
234  LogTrace("TkHistoMap") << "[TkHistoMap::add]";
235 #endif
239  setBinContent(detid,
240  tkHistoMap_[layer]->getTProfile2D()->GetBinContent(
241  tkHistoMap_[layer]->getTProfile2D()->GetBin(xybin.ix, xybin.iy)) +
242  value);
243  else if (tkHistoMap_[layer]->kind() == MonitorElement::Kind::TH2F)
245  detid,
246  tkHistoMap_[layer]->getTH2F()->GetBinContent(tkHistoMap_[layer]->getTH2F()->GetBin(xybin.ix, xybin.iy)) +
247  value);
248 }
DetId cached_detid
Definition: TkHistoMap.h:91
void setBinContent(DetId detid, float value)
Definition: TkHistoMap.cc:204
int16_t cached_layer
Definition: TkHistoMap.h:92
#define LogTrace(id)
constexpr std::array< uint8_t, layerIndexSize > layer
std::vector< MonitorElement * > tkHistoMap_
Definition: TkHistoMap.h:94
TkLayerMap::XYbin cached_XYbin
Definition: TkHistoMap.h:93
int16_t findLayer(DetId detid, DetId &cached_detid, int16_t &cached_layer, TkLayerMap::XYbin &cached_XYbin) const
Definition: TkDetMap.cc:568
const TkDetMap * tkdetmap_
Definition: TkHistoMap.h:90
const TkLayerMap::XYbin & getXY(DetId detid, DetId &cached_detid, int16_t &cached_layer, TkLayerMap::XYbin &cached_XYbin) const
Definition: TkDetMap.cc:548
void TkHistoMap::createTkHistoMap ( DQMStore::IBooker ibooker,
const std::string &  path,
const std::string &  MapName,
float  baseline,
bool  mechanicalView 
)
private

Definition at line 100 of file TkHistoMap.cc.

References dqm::implementation::IBooker::book2D(), dqm::implementation::IBooker::bookProfile2D(), dqm::impl::MonitorElement::Fill(), printsummarytable::folder, folderDefinition(), newFWLiteAna::fullName, TkDetMap::getComponents(), TkDetMap::getDetFromBin(), HistoNumber, isTH2F_, phase1PixelTopology::layer, LogTrace, hlt_dqm_clientPB-live_cfg::me, AlCaHLTBitMon_QueryRunRegistry::string, tkdetmap_, and tkHistoMap_.

Referenced by TkHistoMap().

104  {
105  int nchX;
106  int nchY;
107  double lowX, highX;
108  double lowY, highY;
110 
111  tkHistoMap_.resize(HistoNumber);
112  const bool bookTH2F = isTH2F_;
113  for (int layer = 1; layer < HistoNumber; ++layer) {
114  folder = folderDefinition(ibooker, path, MapName, layer, mechanicalView, fullName);
115  tkdetmap_->getComponents(layer, nchX, lowX, highX, nchY, lowY, highY);
117  if (bookTH2F == false) {
118  me = ibooker.bookProfile2D(fullName.c_str(), fullName.c_str(), nchX, lowX, highX, nchY, lowY, highY, 0.0, 0.0);
119  } else {
120  me = ibooker.book2D(fullName.c_str(), fullName.c_str(), nchX, lowX, highX, nchY, lowY, highY);
121  }
122  //initialize bin content for the not assigned bins
123  if (baseline != 0) {
124  for (size_t ix = 1; ix <= (unsigned int)nchX; ++ix)
125  for (size_t iy = 1; iy <= (unsigned int)nchY; ++iy)
126  if (!tkdetmap_->getDetFromBin(layer, ix, iy))
127  me->Fill(1. * (lowX + ix - .5), 1. * (lowY + iy - .5), baseline);
128  }
129 
130  tkHistoMap_[layer] = me;
131 #ifdef debug_TkHistoMap
132  LogTrace("TkHistoMap") << "[TkHistoMap::createTkHistoMap] folder " << folder << " histoName " << fullName
133  << " layer " << layer << " ptr " << tkHistoMap_[layer];
134 #endif
135  }
136 }
MonitorElement * bookProfile2D(TString const &name, TString const &title, int nchX, double lowX, double highX, int nchY, double lowY, double highY, double lowZ, double highZ, char const *option="s", FUNC onbooking=NOOP())
Definition: DQMStore.h:399
int HistoNumber
Definition: TkHistoMap.h:95
#define LogTrace(id)
constexpr std::array< uint8_t, layerIndexSize > layer
std::vector< MonitorElement * > tkHistoMap_
Definition: TkHistoMap.h:94
void Fill(long long x)
void getComponents(int layer, int &nchX, double &lowX, double &highX, int &nchY, double &lowY, double &highY) const
Definition: TkDetMap.cc:589
string fullName
bool isTH2F_
Definition: TkHistoMap.h:97
MonitorElement * book2D(TString const &name, TString const &title, int nchX, double lowX, double highX, int nchY, double lowY, double highY, FUNC onbooking=NOOP())
Definition: DQMStore.h:177
const TkDetMap * tkdetmap_
Definition: TkHistoMap.h:90
DetId getDetFromBin(int layer, int ix, int iy) const
Definition: TkDetMap.h:191
std::string folderDefinition(DQMStore::IBooker &ibooker, std::string folder, const std::string &MapName, int layer, bool mechanicalView, std::string &fullName)
Definition: TkHistoMap.cc:138
void TkHistoMap::dumpInTkMap ( TrackerMap tkmap,
bool  dumpEntries = false 
)

Definition at line 270 of file TkHistoMap.cc.

References TrackerMap::fill(), TkDetMap::getDetsForLayer(), getEntries(), getValue(), HistoNumber, mps_fire::i, phase1PixelTopology::layer, and tkdetmap_.

Referenced by SiStripDetVOffTkMapPlotter::analyze(), and TkVoltageMapCreator::beginRun().

270  {
271  for (int layer = 1; layer < HistoNumber; ++layer) {
272  // std::vector<uint32_t> dets;
273  // tkdetmap_->getDetsForLayer(layer,dets);
274  std::vector<DetId> dets = tkdetmap_->getDetsForLayer(layer);
275  for (size_t i = 0; i < dets.size(); ++i) {
276  if (dets[i] > 0) {
277  if (getEntries(dets[i]) > 0) {
278  tkmap->fill(dets[i], dumpEntries ? getEntries(dets[i]) : getValue(dets[i]));
279  }
280  }
281  }
282  }
283 }
int HistoNumber
Definition: TkHistoMap.h:95
std::vector< DetId > getDetsForLayer(int layer) const
Definition: TkDetMap.h:196
constexpr std::array< uint8_t, layerIndexSize > layer
const TkDetMap * tkdetmap_
Definition: TkHistoMap.h:90
float getEntries(DetId detid)
Definition: TkHistoMap.cc:260
float getValue(DetId detid)
Definition: TkHistoMap.cc:250
void fill(int layer, int ring, int nmod, float x)
Definition: TrackerMap.cc:3289
void TkHistoMap::fill ( DetId  detid,
float  value 
)

Definition at line 176 of file TkHistoMap.cc.

References cached_detid, cached_layer, cached_XYbin, TkDetMap::findLayer(), TkDetMap::getXY(), cuy::ii, TkLayerMap::XYbin::ix, TkLayerMap::XYbin::iy, findQualityFiles::jj, class-composition::kind, phase1PixelTopology::layer, LogTrace, DetId::rawId(), MonitorElementData::TH2F, tkdetmap_, tkHistoMap_, MonitorElementData::TPROFILE2D, TkLayerMap::XYbin::x, and TkLayerMap::XYbin::y.

Referenced by SiStripDetVOffTkMapPlotter::analyze(), TkVoltageMapCreator::beginRun(), SiStripMonitorDigi::FillApvShotsMap(), and fillFromAscii().

176  {
179 #ifdef debug_TkHistoMap
180  LogTrace("TkHistoMap") << "[TkHistoMap::fill] Fill detid " << detid.rawId() << " Layer " << layer << " value "
181  << value << " ix,iy " << xybin.ix << " " << xybin.iy << " " << xybin.x << " " << xybin.y << " "
182  << tkHistoMap_[layer]->getTProfile2D()->GetName();
183 #endif
185  tkHistoMap_[layer]->getTProfile2D()->Fill(xybin.x, xybin.y, value);
186  else if (tkHistoMap_[layer]->kind() == MonitorElement::Kind::TH2F)
187  tkHistoMap_[layer]->getTH2F()->Fill(xybin.x, xybin.y, value);
188 
189 #ifdef debug_TkHistoMap
190  LogTrace("TkHistoMap") << "[TkHistoMap::fill] "
191  << tkHistoMap_[layer]->getTProfile2D()->GetBinContent(xybin.ix, xybin.iy);
192  for (size_t ii = 0; ii < 4; ii++)
193  for (size_t jj = 0; jj < 11; jj++) {
195  LogTrace("TkHistoMap") << "[TkHistoMap::fill] " << ii << " " << jj << " "
196  << tkHistoMap_[layer]->getTProfile2D()->GetBinContent(ii, jj);
198  LogTrace("TkHistoMap") << "[TkHistoMap::fill] " << ii << " " << jj << " "
199  << tkHistoMap_[layer]->getTH2F()->GetBinContent(ii, jj);
200  }
201 #endif
202 }
DetId cached_detid
Definition: TkHistoMap.h:91
constexpr uint32_t rawId() const
get the raw id
Definition: DetId.h:57
int16_t cached_layer
Definition: TkHistoMap.h:92
int ii
Definition: cuy.py:589
#define LogTrace(id)
constexpr std::array< uint8_t, layerIndexSize > layer
std::vector< MonitorElement * > tkHistoMap_
Definition: TkHistoMap.h:94
TkLayerMap::XYbin cached_XYbin
Definition: TkHistoMap.h:93
int16_t findLayer(DetId detid, DetId &cached_detid, int16_t &cached_layer, TkLayerMap::XYbin &cached_XYbin) const
Definition: TkDetMap.cc:568
const TkDetMap * tkdetmap_
Definition: TkHistoMap.h:90
const TkLayerMap::XYbin & getXY(DetId detid, DetId &cached_detid, int16_t &cached_layer, TkLayerMap::XYbin &cached_XYbin) const
Definition: TkDetMap.cc:548
void TkHistoMap::fillFromAscii ( const std::string &  filename)

Definition at line 164 of file TkHistoMap.cc.

References mergeVDriftHistosByStation::file, fill(), and relativeConstraints::value.

164  {
165  std::ifstream file;
166  file.open(filename.c_str());
167  float value;
168  uint32_t detid;
169  while (file.good()) {
170  file >> detid >> value;
171  fill(detid, value);
172  }
173  file.close();
174 }
void fill(DetId detid, float value)
Definition: TkHistoMap.cc:176
tuple filename
Definition: lut2db_cfg.py:20
std::string TkHistoMap::folderDefinition ( DQMStore::IBooker ibooker,
std::string  folder,
const std::string &  MapName,
int  layer,
bool  mechanicalView,
std::string &  fullName 
)
private

Definition at line 138 of file TkHistoMap.cc.

References printsummarytable::folder, TkDetMap::getLayerName(), SiStripFolderOrganizer::getSubDetLayerFolderName(), TkDetMap::getSubDetLayerSide(), mergeVDriftHistosByStation::name, dqm::implementation::NavigatorBase::setCurrentFolder(), SiStripFolderOrganizer::setSiStripFolderName(), contentValuesCheck::ss, and AlCaHLTBitMon_QueryRunRegistry::string.

Referenced by createTkHistoMap(), and loadTkHistoMap().

143  {
144  std::string name = MapName + std::string("_");
146 
147  if (mechanicalView) {
148  std::stringstream ss;
149 
150  SiStripFolderOrganizer folderOrg;
151  folderOrg.setSiStripFolderName(folder);
152 
154  uint32_t subdetlayer = 0, side = 0;
155  TkDetMap::getSubDetLayerSide(layer, subDet, subdetlayer, side);
156  folderOrg.getSubDetLayerFolderName(ss, subDet, subdetlayer, side);
157  folder = ss.str();
158  }
159  ibooker.setCurrentFolder(folder);
160  return folder;
161 }
void setSiStripFolderName(std::string name)
static std::string getLayerName(int in)
Definition: TkDetMap.cc:237
static void getSubDetLayerSide(int in, SiStripDetId::SubDetector &, uint32_t &layer, uint32_t &side)
Definition: TkDetMap.cc:383
virtual void setCurrentFolder(std::string const &fullpath)
Definition: DQMStore.cc:32
constexpr std::array< uint8_t, layerIndexSize > layer
void getSubDetLayerFolderName(std::stringstream &ss, SiStripDetId::SubDetector subDet, uint32_t layer, uint32_t side=0)
string fullName
const std::vector<MonitorElement*>& TkHistoMap::getAllMaps ( ) const
inline

Definition at line 44 of file TkHistoMap.h.

References tkHistoMap_.

Referenced by BuildTrackerMapPlugin::subtractMap().

44 { return tkHistoMap_; };
std::vector< MonitorElement * > tkHistoMap_
Definition: TkHistoMap.h:94
std::vector<MonitorElement*>& TkHistoMap::getAllMaps ( )
inline

Definition at line 45 of file TkHistoMap.h.

References tkHistoMap_.

45 { return tkHistoMap_; };
std::vector< MonitorElement * > tkHistoMap_
Definition: TkHistoMap.h:94
DetId TkHistoMap::getDetId ( const std::string &  title,
int  ix,
int  iy 
)
inline

Definition at line 49 of file TkHistoMap.h.

References getLayerName(), and getLayerNum().

49  {
50  return getDetId(getLayerNum(getLayerName(title)), ix, iy);
51  }
std::string getLayerName(std::string title)
Definition: TkHistoMap.h:54
DetId getDetId(const std::string &title, int ix, int iy)
Definition: TkHistoMap.h:49
uint16_t getLayerNum(const std::string &layerName)
Definition: TkHistoMap.h:55
DetId TkHistoMap::getDetId ( int  layer,
int  ix,
int  iy 
)
inline

Definition at line 52 of file TkHistoMap.h.

References TkDetMap::getDetFromBin(), and tkdetmap_.

52 { return tkdetmap_->getDetFromBin(layer, ix, iy); }
constexpr std::array< uint8_t, layerIndexSize > layer
const TkDetMap * tkdetmap_
Definition: TkHistoMap.h:90
DetId getDetFromBin(int layer, int ix, int iy) const
Definition: TkDetMap.h:191
DetId TkHistoMap::getDetId ( const MonitorElement ME,
int  ix,
int  iy 
)
inline

Definition at line 53 of file TkHistoMap.h.

References getDetId(), and dqm::impl::MonitorElement::getTitle().

Referenced by getDetId().

53 { return getDetId(ME->getTitle(), ix, iy); }
virtual std::string getTitle() const
get MonitorElement title
DetId getDetId(const std::string &title, int ix, int iy)
Definition: TkHistoMap.h:49
float TkHistoMap::getEntries ( DetId  detid)

Definition at line 260 of file TkHistoMap.cc.

References cached_detid, cached_layer, cached_XYbin, TkDetMap::findLayer(), TkDetMap::getXY(), TkLayerMap::XYbin::ix, TkLayerMap::XYbin::iy, class-composition::kind, phase1PixelTopology::layer, MonitorElementData::TH2F, tkdetmap_, and tkHistoMap_.

Referenced by dumpInTkMap().

260  {
264  return 1;
265  else
266  return tkHistoMap_[layer]->getTProfile2D()->GetBinEntries(
267  tkHistoMap_[layer]->getTProfile2D()->GetBin(xybin.ix, xybin.iy));
268 }
DetId cached_detid
Definition: TkHistoMap.h:91
int16_t cached_layer
Definition: TkHistoMap.h:92
constexpr std::array< uint8_t, layerIndexSize > layer
std::vector< MonitorElement * > tkHistoMap_
Definition: TkHistoMap.h:94
TkLayerMap::XYbin cached_XYbin
Definition: TkHistoMap.h:93
int16_t findLayer(DetId detid, DetId &cached_detid, int16_t &cached_layer, TkLayerMap::XYbin &cached_XYbin) const
Definition: TkDetMap.cc:568
const TkDetMap * tkdetmap_
Definition: TkHistoMap.h:90
const TkLayerMap::XYbin & getXY(DetId detid, DetId &cached_detid, int16_t &cached_layer, TkLayerMap::XYbin &cached_XYbin) const
Definition: TkDetMap.cc:548
std::string TkHistoMap::getLayerName ( std::string  title)
inline

Definition at line 54 of file TkHistoMap.h.

References MapName_.

Referenced by getDetId().

54 { return title.erase(0, MapName_.size() + 1); }
std::string MapName_
Definition: TkHistoMap.h:96
uint16_t TkHistoMap::getLayerNum ( const std::string &  layerName)
inline

Definition at line 55 of file TkHistoMap.h.

References TkDetMap::getLayerNum(), and tkdetmap_.

Referenced by getDetId().

55 { return tkdetmap_->getLayerNum(layerName); }
constexpr char const * layerName[numberOfLayers]
static int getLayerNum(const std::string &in)
Definition: TkDetMap.cc:311
const TkDetMap * tkdetmap_
Definition: TkHistoMap.h:90
MonitorElement* TkHistoMap::getMap ( short  layerNumber)
inline

Definition at line 43 of file TkHistoMap.h.

References tkHistoMap_.

43 { return tkHistoMap_[layerNumber]; };
std::vector< MonitorElement * > tkHistoMap_
Definition: TkHistoMap.h:94
float TkHistoMap::getValue ( DetId  detid)

Definition at line 250 of file TkHistoMap.cc.

References cached_detid, cached_layer, cached_XYbin, TkDetMap::findLayer(), TkDetMap::getXY(), TkLayerMap::XYbin::ix, TkLayerMap::XYbin::iy, class-composition::kind, phase1PixelTopology::layer, MonitorElementData::TH2F, tkdetmap_, and tkHistoMap_.

Referenced by dumpInTkMap().

250  {
253 
255  return tkHistoMap_[layer]->getTH2F()->GetBinContent(tkHistoMap_[layer]->getTH2F()->GetBin(xybin.ix, xybin.iy));
256  else
257  return tkHistoMap_[layer]->getTProfile2D()->GetBinContent(
258  tkHistoMap_[layer]->getTProfile2D()->GetBin(xybin.ix, xybin.iy));
259 }
DetId cached_detid
Definition: TkHistoMap.h:91
int16_t cached_layer
Definition: TkHistoMap.h:92
constexpr std::array< uint8_t, layerIndexSize > layer
std::vector< MonitorElement * > tkHistoMap_
Definition: TkHistoMap.h:94
TkLayerMap::XYbin cached_XYbin
Definition: TkHistoMap.h:93
int16_t findLayer(DetId detid, DetId &cached_detid, int16_t &cached_layer, TkLayerMap::XYbin &cached_XYbin) const
Definition: TkDetMap.cc:568
const TkDetMap * tkdetmap_
Definition: TkHistoMap.h:90
const TkLayerMap::XYbin & getXY(DetId detid, DetId &cached_detid, int16_t &cached_layer, TkLayerMap::XYbin &cached_XYbin) const
Definition: TkDetMap.cc:548
void TkHistoMap::load ( const TkDetMap tkDetMap,
const std::string &  path,
float  baseline,
bool  mechanicalView,
bool  isTH2F,
bool  createTkMap = true 
)
private

Definition at line 47 of file TkHistoMap.cc.

References cached_detid, cached_layer, isTH2F_, loadServices(), and tkdetmap_.

Referenced by TkHistoMap().

52  {
53  cached_detid = 0;
54  cached_layer = 0;
55  loadServices();
56  tkdetmap_ = tkDetMap;
57  isTH2F_ = isTH2F;
58 }
void loadServices()
Definition: TkHistoMap.cc:60
DetId cached_detid
Definition: TkHistoMap.h:91
int16_t cached_layer
Definition: TkHistoMap.h:92
bool isTH2F_
Definition: TkHistoMap.h:97
const TkDetMap * tkdetmap_
Definition: TkHistoMap.h:90
void TkHistoMap::loadServices ( )

Definition at line 60 of file TkHistoMap.cc.

References dqmStore_, and Utilities::operator.

Referenced by load().

60  {
61  if (!edm::Service<DQMStore>().isAvailable()) {
62  edm::LogError("TkHistoMap")
63  << "\n------------------------------------------"
64  "\nUnAvailable Service DQMStore: please insert in the configuration file an instance like"
65  "\n\tprocess.load(\"DQMServices.Core.DQMStore_cfg\")"
66  "\n------------------------------------------";
67  }
69 }
Log< level::Error, false > LogError
DQMStore * dqmStore_
Definition: TkHistoMap.h:88
void TkHistoMap::loadTkHistoMap ( const std::string &  path,
const std::string &  MapName,
bool  mechanicalView = false 
)

Definition at line 76 of file TkHistoMap.cc.

References dqmStore_, printsummarytable::folder, folderDefinition(), newFWLiteAna::fullName, HistoNumber, phase1PixelTopology::layer, LogTrace, MapName_, dqm::implementation::DQMStore::meBookerGetter(), fed_dqm_sourceclient-live_cfg::path, AlCaHLTBitMon_QueryRunRegistry::string, and tkHistoMap_.

Referenced by BuildTrackerMapPlugin::read().

76  {
77  MapName_ = MapName;
78  tkHistoMap_.resize(HistoNumber);
79  auto loadMap = [this, &path, mechanicalView](DQMStore::IBooker& ibooker, DQMStore::IGetter& igetter) {
81  for (int layer = 1; layer < HistoNumber; ++layer) {
82  folder = folderDefinition(ibooker, path, MapName_, layer, mechanicalView, fullName);
83 #ifdef debug_TkHistoMap
84  LogTrace("TkHistoMap") << "[TkHistoMap::loadTkHistoMap] folder " << folder << " histoName " << fullName
85  << " find " << folder.find_last_of("/") << " length " << folder.length();
86 #endif
87  if (folder.find_last_of('/') != folder.length() - 1)
88  folder += "/";
89  tkHistoMap_[layer] = igetter.get(folder + fullName);
90 #ifdef debug_TkHistoMap
91  LogTrace("TkHistoMap") << "[TkHistoMap::loadTkHistoMap] folder " << folder << " histoName " << fullName
92  << " layer " << layer << " ptr " << tkHistoMap_[layer] << " find "
93  << folder.find_last_of("/") << " length " << folder.length();
94 #endif
95  }
96  };
97  dqmStore_->meBookerGetter(loadMap);
98 }
int HistoNumber
Definition: TkHistoMap.h:95
DQMStore * dqmStore_
Definition: TkHistoMap.h:88
#define LogTrace(id)
constexpr std::array< uint8_t, layerIndexSize > layer
std::vector< MonitorElement * > tkHistoMap_
Definition: TkHistoMap.h:94
std::string MapName_
Definition: TkHistoMap.h:96
void meBookerGetter(iFunc f)
Definition: DQMStore.h:632
string fullName
std::string folderDefinition(DQMStore::IBooker &ibooker, std::string folder, const std::string &MapName, int layer, bool mechanicalView, std::string &fullName)
Definition: TkHistoMap.cc:138
void TkHistoMap::save ( const std::string &  filename)

Definition at line 71 of file TkHistoMap.cc.

References dqmStore_, and dqm::implementation::DQMStore::save().

Referenced by SiStripDetVOffTkMapPlotter::analyze(), and TkVoltageMapCreator::beginRun().

71  {
72  // dqmStore_ only for saving
74 }
DQMStore * dqmStore_
Definition: TkHistoMap.h:88
DQM_DEPRECATED void save(std::string const &filename, std::string const &path="")
Definition: DQMStore.cc:784
tuple filename
Definition: lut2db_cfg.py:20
void TkHistoMap::saveAsCanvas ( const std::string &  filename,
const std::string &  options = "",
const std::string &  mode = "RECREATE" 
)

Definition at line 287 of file TkHistoMap.cc.

References validate-o2o-wbm::f, mps_fire::i, MapName_, AlCaHLTBitMon_QueryRunRegistry::string, TkLayerMap::TECM_W1, TkLayerMap::TECM_W2, TkLayerMap::TECM_W3, TkLayerMap::TECM_W4, TkLayerMap::TECM_W5, TkLayerMap::TECM_W6, TkLayerMap::TECM_W7, TkLayerMap::TECM_W8, TkLayerMap::TECM_W9, TkLayerMap::TECP_W1, TkLayerMap::TECP_W2, TkLayerMap::TECP_W3, TkLayerMap::TECP_W4, TkLayerMap::TECP_W5, TkLayerMap::TECP_W6, TkLayerMap::TECP_W7, TkLayerMap::TECP_W8, TkLayerMap::TECP_W9, TkLayerMap::TIB_L1, TkLayerMap::TIB_L2, TkLayerMap::TIB_L3, TkLayerMap::TIB_L4, TkLayerMap::TIDM_D1, TkLayerMap::TIDM_D2, TkLayerMap::TIDM_D3, TkLayerMap::TIDP_D1, TkLayerMap::TIDP_D2, TkLayerMap::TIDP_D3, tkHistoMap_, TkLayerMap::TOB_L1, TkLayerMap::TOB_L2, TkLayerMap::TOB_L3, TkLayerMap::TOB_L4, TkLayerMap::TOB_L5, and TkLayerMap::TOB_L6.

287  {
288  // TCanvas C(MapName_,MapName_,200,10,900,700);
289  TCanvas* CTIB =
290  new TCanvas(std::string("Canvas_" + MapName_ + "TIB").c_str(), std::string("Canvas_" + MapName_ + "TIB").c_str());
291  TCanvas* CTOB =
292  new TCanvas(std::string("Canvas_" + MapName_ + "TOB").c_str(), std::string("Canvas_" + MapName_ + "TOB").c_str());
293  TCanvas* CTIDP = new TCanvas(std::string("Canvas_" + MapName_ + "TIDP").c_str(),
294  std::string("Canvas_" + MapName_ + "TIDP").c_str());
295  TCanvas* CTIDM = new TCanvas(std::string("Canvas_" + MapName_ + "TIDM").c_str(),
296  std::string("Canvas_" + MapName_ + "TIDM").c_str());
297  TCanvas* CTECP = new TCanvas(std::string("Canvas_" + MapName_ + "TECP").c_str(),
298  std::string("Canvas_" + MapName_ + "TECP").c_str());
299  TCanvas* CTECM = new TCanvas(std::string("Canvas_" + MapName_ + "TECM").c_str(),
300  std::string("Canvas_" + MapName_ + "TECM").c_str());
301  CTIB->Divide(2, 2);
302  CTOB->Divide(2, 3);
303  CTIDP->Divide(1, 3);
304  CTIDM->Divide(1, 3);
305  CTECP->Divide(3, 3);
306  CTECM->Divide(3, 3);
307 
308  int i;
309  i = 0;
310  CTIB->cd(++i);
311  tkHistoMap_[TkLayerMap::TIB_L1]->getTProfile2D()->Draw(options.c_str());
312  CTIB->cd(++i);
313  tkHistoMap_[TkLayerMap::TIB_L2]->getTProfile2D()->Draw(options.c_str());
314  CTIB->cd(++i);
315  tkHistoMap_[TkLayerMap::TIB_L3]->getTProfile2D()->Draw(options.c_str());
316  CTIB->cd(++i);
317  tkHistoMap_[TkLayerMap::TIB_L4]->getTProfile2D()->Draw(options.c_str());
318 
319  i = 0;
320  CTIDP->cd(++i);
321  tkHistoMap_[TkLayerMap::TIDP_D1]->getTProfile2D()->Draw(options.c_str());
322  CTIDP->cd(++i);
323  tkHistoMap_[TkLayerMap::TIDP_D2]->getTProfile2D()->Draw(options.c_str());
324  CTIDP->cd(++i);
325  tkHistoMap_[TkLayerMap::TIDP_D3]->getTProfile2D()->Draw(options.c_str());
326 
327  i = 0;
328  CTIDM->cd(++i);
329  tkHistoMap_[TkLayerMap::TIDM_D1]->getTProfile2D()->Draw(options.c_str());
330  CTIDM->cd(++i);
331  tkHistoMap_[TkLayerMap::TIDM_D2]->getTProfile2D()->Draw(options.c_str());
332  CTIDM->cd(++i);
333  tkHistoMap_[TkLayerMap::TIDM_D3]->getTProfile2D()->Draw(options.c_str());
334 
335  i = 0;
336  CTOB->cd(++i);
337  tkHistoMap_[TkLayerMap::TOB_L1]->getTProfile2D()->Draw(options.c_str());
338  CTOB->cd(++i);
339  tkHistoMap_[TkLayerMap::TOB_L2]->getTProfile2D()->Draw(options.c_str());
340  CTOB->cd(++i);
341  tkHistoMap_[TkLayerMap::TOB_L3]->getTProfile2D()->Draw(options.c_str());
342  CTOB->cd(++i);
343  tkHistoMap_[TkLayerMap::TOB_L4]->getTProfile2D()->Draw(options.c_str());
344  CTOB->cd(++i);
345  tkHistoMap_[TkLayerMap::TOB_L5]->getTProfile2D()->Draw(options.c_str());
346  CTOB->cd(++i);
347  tkHistoMap_[TkLayerMap::TOB_L6]->getTProfile2D()->Draw(options.c_str());
348 
349  i = 0;
350  CTECP->cd(++i);
351  tkHistoMap_[TkLayerMap::TECP_W1]->getTProfile2D()->Draw(options.c_str());
352  CTECP->cd(++i);
353  tkHistoMap_[TkLayerMap::TECP_W2]->getTProfile2D()->Draw(options.c_str());
354  CTECP->cd(++i);
355  tkHistoMap_[TkLayerMap::TECP_W3]->getTProfile2D()->Draw(options.c_str());
356  CTECP->cd(++i);
357  tkHistoMap_[TkLayerMap::TECP_W4]->getTProfile2D()->Draw(options.c_str());
358  CTECP->cd(++i);
359  tkHistoMap_[TkLayerMap::TECP_W5]->getTProfile2D()->Draw(options.c_str());
360  CTECP->cd(++i);
361  tkHistoMap_[TkLayerMap::TECP_W6]->getTProfile2D()->Draw(options.c_str());
362  CTECP->cd(++i);
363  tkHistoMap_[TkLayerMap::TECP_W7]->getTProfile2D()->Draw(options.c_str());
364  CTECP->cd(++i);
365  tkHistoMap_[TkLayerMap::TECP_W8]->getTProfile2D()->Draw(options.c_str());
366  CTECP->cd(++i);
367  tkHistoMap_[TkLayerMap::TECP_W9]->getTProfile2D()->Draw(options.c_str());
368 
369  i = 0;
370  CTECM->cd(++i);
371  tkHistoMap_[TkLayerMap::TECM_W1]->getTProfile2D()->Draw(options.c_str());
372  CTECM->cd(++i);
373  tkHistoMap_[TkLayerMap::TECM_W2]->getTProfile2D()->Draw(options.c_str());
374  CTECM->cd(++i);
375  tkHistoMap_[TkLayerMap::TECM_W3]->getTProfile2D()->Draw(options.c_str());
376  CTECM->cd(++i);
377  tkHistoMap_[TkLayerMap::TECM_W4]->getTProfile2D()->Draw(options.c_str());
378  CTECM->cd(++i);
379  tkHistoMap_[TkLayerMap::TECM_W5]->getTProfile2D()->Draw(options.c_str());
380  CTECM->cd(++i);
381  tkHistoMap_[TkLayerMap::TECM_W6]->getTProfile2D()->Draw(options.c_str());
382  CTECM->cd(++i);
383  tkHistoMap_[TkLayerMap::TECM_W7]->getTProfile2D()->Draw(options.c_str());
384  CTECM->cd(++i);
385  tkHistoMap_[TkLayerMap::TECM_W8]->getTProfile2D()->Draw(options.c_str());
386  CTECM->cd(++i);
387  tkHistoMap_[TkLayerMap::TECM_W9]->getTProfile2D()->Draw(options.c_str());
388 
389  TFile* f = new TFile(filename.c_str(), mode.c_str());
390  CTIB->Write();
391  CTIDP->Write();
392  CTIDM->Write();
393  CTOB->Write();
394  CTECP->Write();
395  CTECM->Write();
396  f->Close();
397  delete f;
398 }
std::vector< MonitorElement * > tkHistoMap_
Definition: TkHistoMap.h:94
std::string MapName_
Definition: TkHistoMap.h:96
tuple filename
Definition: lut2db_cfg.py:20
void TkHistoMap::setBinContent ( DetId  detid,
float  value 
)

Definition at line 204 of file TkHistoMap.cc.

References cached_detid, cached_layer, cached_XYbin, TkDetMap::findLayer(), TkDetMap::getXY(), cuy::ii, TkLayerMap::XYbin::ix, TkLayerMap::XYbin::iy, findQualityFiles::jj, class-composition::kind, phase1PixelTopology::layer, LogTrace, DetId::rawId(), MonitorElementData::TH2F, tkdetmap_, tkHistoMap_, MonitorElementData::TPROFILE2D, TkLayerMap::XYbin::x, and TkLayerMap::XYbin::y.

Referenced by add().

204  {
208  tkHistoMap_[layer]->getTProfile2D()->SetBinEntries(tkHistoMap_[layer]->getTProfile2D()->GetBin(xybin.ix, xybin.iy),
209  1);
210  tkHistoMap_[layer]->getTProfile2D()->SetBinContent(tkHistoMap_[layer]->getTProfile2D()->GetBin(xybin.ix, xybin.iy),
211  value);
212  } else if (tkHistoMap_[layer]->kind() == MonitorElement::Kind::TH2F) {
213  tkHistoMap_[layer]->setBinContent(xybin.ix, xybin.iy, value);
214  }
215 
216 #ifdef debug_TkHistoMap
217  LogTrace("TkHistoMap") << "[TkHistoMap::setbincontent] setBinContent detid " << detid.rawId() << " Layer " << layer
218  << " value " << value << " ix,iy " << xybin.ix << " " << xybin.iy << " " << xybin.x << " "
219  << xybin.y << " " << tkHistoMap_[layer]->getTProfile2D()->GetName() << " bin "
220  << tkHistoMap_[layer]->getTProfile2D()->GetBin(xybin.ix, xybin.iy);
221 
222  LogTrace("TkHistoMap") << "[TkHistoMap::setbincontent] "
223  << tkHistoMap_[layer]->getTProfile2D()->GetBinContent(xybin.ix, xybin.iy);
224  for (size_t ii = 0; ii < 4; ii++)
225  for (size_t jj = 0; jj < 11; jj++) {
226  LogTrace("TkHistoMap") << "[TkHistoMap::setbincontent] " << ii << " " << jj << " "
227  << tkHistoMap_[layer]->getTProfile2D()->GetBinContent(ii, jj);
228  }
229 #endif
230 }
DetId cached_detid
Definition: TkHistoMap.h:91
constexpr uint32_t rawId() const
get the raw id
Definition: DetId.h:57
int16_t cached_layer
Definition: TkHistoMap.h:92
int ii
Definition: cuy.py:589
#define LogTrace(id)
constexpr std::array< uint8_t, layerIndexSize > layer
std::vector< MonitorElement * > tkHistoMap_
Definition: TkHistoMap.h:94
TkLayerMap::XYbin cached_XYbin
Definition: TkHistoMap.h:93
int16_t findLayer(DetId detid, DetId &cached_detid, int16_t &cached_layer, TkLayerMap::XYbin &cached_XYbin) const
Definition: TkDetMap.cc:568
const TkDetMap * tkdetmap_
Definition: TkHistoMap.h:90
const TkLayerMap::XYbin & getXY(DetId detid, DetId &cached_detid, int16_t &cached_layer, TkLayerMap::XYbin &cached_XYbin) const
Definition: TkDetMap.cc:548

Member Data Documentation

DetId TkHistoMap::cached_detid
private

Definition at line 91 of file TkHistoMap.h.

Referenced by add(), fill(), getEntries(), getValue(), load(), and setBinContent().

int16_t TkHistoMap::cached_layer
private

Definition at line 92 of file TkHistoMap.h.

Referenced by add(), fill(), getEntries(), getValue(), load(), and setBinContent().

TkLayerMap::XYbin TkHistoMap::cached_XYbin
private

Definition at line 93 of file TkHistoMap.h.

Referenced by add(), fill(), getEntries(), getValue(), and setBinContent().

DQMStore* TkHistoMap::dqmStore_ {nullptr}
private

Definition at line 88 of file TkHistoMap.h.

Referenced by loadServices(), loadTkHistoMap(), save(), and TkHistoMap().

int TkHistoMap::HistoNumber
private

Definition at line 95 of file TkHistoMap.h.

Referenced by createTkHistoMap(), dumpInTkMap(), and loadTkHistoMap().

bool TkHistoMap::isTH2F_
private

Definition at line 97 of file TkHistoMap.h.

Referenced by createTkHistoMap(), and load().

std::string TkHistoMap::MapName_
private

Definition at line 96 of file TkHistoMap.h.

Referenced by getLayerName(), loadTkHistoMap(), saveAsCanvas(), and TkHistoMap().

const TkDetMap* TkHistoMap::tkdetmap_
private
std::vector<MonitorElement*> TkHistoMap::tkHistoMap_
private