CMS 3D CMS Logo

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, bool isTH2F=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

◆ DQMStore

Definition at line 14 of file TkHistoMap.h.

◆ MonitorElement

Definition at line 15 of file TkHistoMap.h.

◆ tkHistoMapVect

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

Definition at line 16 of file TkHistoMap.h.

Constructor & Destructor Documentation

◆ TkHistoMap() [1/4]

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

Definition at line 35 of file TkHistoMap.cc.

References createTkHistoMap(), load(), LogTrace, MapName_, and castor_dqm_sourceclient_file_cfg::path.

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

◆ TkHistoMap() [2/4]

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_, dqm::implementation::DQMStore::meBookerGetter(), and castor_dqm_sourceclient_file_cfg::path.

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:48
int HistoNumber
Definition: TkHistoMap.h:96
DQMStore * dqmStore_
Definition: TkHistoMap.h:89
#define LogTrace(id)
std::string MapName_
Definition: TkHistoMap.h:97
void createTkHistoMap(DQMStore::IBooker &ibooker, const std::string &path, const std::string &MapName, float baseline, bool mechanicalView)
Definition: TkHistoMap.cc:101
void meBookerGetter(iFunc f)
Definition: DQMStore.h:709

◆ TkHistoMap() [3/4]

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_, dqm::implementation::DQMStore::meBookerGetter(), and castor_dqm_sourceclient_file_cfg::path.

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:48
int HistoNumber
Definition: TkHistoMap.h:96
DQMStore * dqmStore_
Definition: TkHistoMap.h:89
#define LogTrace(id)
std::string MapName_
Definition: TkHistoMap.h:97
void createTkHistoMap(DQMStore::IBooker &ibooker, const std::string &path, const std::string &MapName, float baseline, bool mechanicalView)
Definition: TkHistoMap.cc:101
void meBookerGetter(iFunc f)
Definition: DQMStore.h:709

◆ TkHistoMap() [4/4]

TkHistoMap::TkHistoMap ( const TkDetMap tkDetMap)

Definition at line 6 of file TkHistoMap.cc.

References 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:48
int HistoNumber
Definition: TkHistoMap.h:96
#define LogTrace(id)
double f[11][100]

◆ ~TkHistoMap()

TkHistoMap::~TkHistoMap ( )
inline

Definition at line 38 of file TkHistoMap.h.

38 {};

Member Function Documentation

◆ add()

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

Definition at line 233 of file TkHistoMap.cc.

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

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

233  {
234 #ifdef debug_TkHistoMap
235  LogTrace("TkHistoMap") << "[TkHistoMap::add]";
236 #endif
240  setBinContent(detid,
241  tkHistoMap_[layer]->getTProfile2D()->GetBinContent(
242  tkHistoMap_[layer]->getTProfile2D()->GetBin(xybin.ix, xybin.iy)) +
243  value);
246  detid,
247  tkHistoMap_[layer]->getTH2F()->GetBinContent(tkHistoMap_[layer]->getTH2F()->GetBin(xybin.ix, xybin.iy)) +
248  value);
249 }
DetId cached_detid
Definition: TkHistoMap.h:92
void setBinContent(DetId detid, float value)
Definition: TkHistoMap.cc:205
int16_t cached_layer
Definition: TkHistoMap.h:93
#define LogTrace(id)
constexpr std::array< uint8_t, layerIndexSize > layer
std::vector< MonitorElement * > tkHistoMap_
Definition: TkHistoMap.h:95
const TkLayerMap::XYbin & getXY(DetId detid, DetId &cached_detid, int16_t &cached_layer, TkLayerMap::XYbin &cached_XYbin) const
Definition: TkDetMap.cc:548
int16_t findLayer(DetId detid, DetId &cached_detid, int16_t &cached_layer, TkLayerMap::XYbin &cached_XYbin) const
Definition: TkDetMap.cc:568
TkLayerMap::XYbin cached_XYbin
Definition: TkHistoMap.h:94
Definition: value.py:1
const TkDetMap * tkdetmap_
Definition: TkHistoMap.h:91

◆ createTkHistoMap()

void TkHistoMap::createTkHistoMap ( DQMStore::IBooker ibooker,
const std::string &  path,
const std::string &  MapName,
float  baseline,
bool  mechanicalView 
)
private

Definition at line 101 of file TkHistoMap.cc.

References dqm::implementation::IBooker::book2D(), dqm::implementation::IBooker::bookProfile2D(), printsummarytable::folder, folderDefinition(), newFWLiteAna::fullName, TkDetMap::getComponents(), TkDetMap::getDetFromBin(), HistoNumber, createfilelist::int, isTH2F_, phase1PixelTopology::layer, LogTrace, SiPixelPhase1Summary_cfi::MapName, hlt_dqm_clientPB-live_cfg::me, castor_dqm_sourceclient_file_cfg::path, AlCaHLTBitMon_QueryRunRegistry::string, tkdetmap_, and tkHistoMap_.

Referenced by TkHistoMap().

105  {
106  int nchX;
107  int nchY;
108  double lowX, highX;
109  double lowY, highY;
111 
112  tkHistoMap_.resize(HistoNumber);
113  const bool bookTH2F = isTH2F_;
114  for (int layer = 1; layer < HistoNumber; ++layer) {
115  folder = folderDefinition(ibooker, path, MapName, layer, mechanicalView, fullName);
116  tkdetmap_->getComponents(layer, nchX, lowX, highX, nchY, lowY, highY);
118  if (bookTH2F == false) {
119  me = ibooker.bookProfile2D(fullName.c_str(), fullName.c_str(), nchX, lowX, highX, nchY, lowY, highY, 0.0, 0.0);
120  } else {
121  me = ibooker.book2D(fullName.c_str(), fullName.c_str(), nchX, lowX, highX, nchY, lowY, highY);
122  }
123  //initialize bin content for the not assigned bins
124  if (baseline != 0) {
125  for (size_t ix = 1; ix <= (unsigned int)nchX; ++ix)
126  for (size_t iy = 1; iy <= (unsigned int)nchY; ++iy)
127  if (!tkdetmap_->getDetFromBin(layer, ix, iy))
128  me->Fill(1. * (lowX + ix - .5), 1. * (lowY + iy - .5), baseline);
129  }
130 
131  tkHistoMap_[layer] = me;
132 #ifdef debug_TkHistoMap
133  LogTrace("TkHistoMap") << "[TkHistoMap::createTkHistoMap] folder " << folder << " histoName " << fullName
134  << " layer " << layer << " ptr " << tkHistoMap_[layer];
135 #endif
136  }
137 }
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:476
int HistoNumber
Definition: TkHistoMap.h:96
#define LogTrace(id)
constexpr std::array< uint8_t, layerIndexSize > layer
std::vector< MonitorElement * > tkHistoMap_
Definition: TkHistoMap.h:95
DetId getDetFromBin(int layer, int ix, int iy) const
Definition: TkDetMap.h:191
void getComponents(int layer, int &nchX, double &lowX, double &highX, int &nchY, double &lowY, double &highY) const
Definition: TkDetMap.cc:589
bool isTH2F_
Definition: TkHistoMap.h:98
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:212
const TkDetMap * tkdetmap_
Definition: TkHistoMap.h:91
std::string folderDefinition(DQMStore::IBooker &ibooker, std::string folder, const std::string &MapName, int layer, bool mechanicalView, std::string &fullName)
Definition: TkHistoMap.cc:139

◆ dumpInTkMap()

void TkHistoMap::dumpInTkMap ( TrackerMap tkmap,
bool  dumpEntries = false 
)

Definition at line 271 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().

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

◆ fill()

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

Definition at line 177 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, CalibrationSummaryClient_cfi::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().

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

◆ fillFromAscii()

void TkHistoMap::fillFromAscii ( const std::string &  filename)

Definition at line 165 of file TkHistoMap.cc.

References geometryDiff::file, corrVsCorr::filename, fill(), and relativeConstraints::value.

165  {
166  std::ifstream file;
167  file.open(filename.c_str());
168  float value;
169  uint32_t detid;
170  while (file.good()) {
171  file >> detid >> value;
172  fill(detid, value);
173  }
174  file.close();
175 }
Definition: value.py:1
void fill(DetId detid, float value)
Definition: TkHistoMap.cc:177

◆ folderDefinition()

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 139 of file TkHistoMap.cc.

References printsummarytable::folder, newFWLiteAna::fullName, TkDetMap::getLayerName(), SiStripFolderOrganizer::getSubDetLayerFolderName(), TkDetMap::getSubDetLayerSide(), phase1PixelTopology::layer, SiPixelPhase1Summary_cfi::MapName, Skims_PA_cff::name, dqm::implementation::NavigatorBase::setCurrentFolder(), SiStripFolderOrganizer::setSiStripFolderName(), contentValuesCheck::ss, and AlCaHLTBitMon_QueryRunRegistry::string.

Referenced by createTkHistoMap(), and loadTkHistoMap().

144  {
147 
148  if (mechanicalView) {
149  std::stringstream ss;
150 
151  SiStripFolderOrganizer folderOrg;
152  folderOrg.setSiStripFolderName(folder);
153 
155  uint32_t subdetlayer = 0, side = 0;
156  TkDetMap::getSubDetLayerSide(layer, subDet, subdetlayer, side);
157  folderOrg.getSubDetLayerFolderName(ss, subDet, subdetlayer, side);
158  folder = ss.str();
159  }
160  ibooker.setCurrentFolder(folder);
161  return folder;
162 }
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)

◆ getAllMaps() [1/2]

const std::vector<MonitorElement*>& TkHistoMap::getAllMaps ( ) const
inline

Definition at line 45 of file TkHistoMap.h.

References tkHistoMap_.

Referenced by BuildTrackerMapPlugin::subtractMap().

45 { return tkHistoMap_; };
std::vector< MonitorElement * > tkHistoMap_
Definition: TkHistoMap.h:95

◆ getAllMaps() [2/2]

std::vector<MonitorElement*>& TkHistoMap::getAllMaps ( )
inline

Definition at line 46 of file TkHistoMap.h.

References tkHistoMap_.

46 { return tkHistoMap_; };
std::vector< MonitorElement * > tkHistoMap_
Definition: TkHistoMap.h:95

◆ getDetId() [1/3]

DetId TkHistoMap::getDetId ( const std::string &  title,
int  ix,
int  iy 
)
inline

Definition at line 50 of file TkHistoMap.h.

References getLayerName(), getLayerNum(), and runGCPTkAlMap::title.

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

◆ getDetId() [2/3]

DetId TkHistoMap::getDetId ( int  layer,
int  ix,
int  iy 
)
inline

Definition at line 53 of file TkHistoMap.h.

References TkDetMap::getDetFromBin(), phase1PixelTopology::layer, and tkdetmap_.

53 { return tkdetmap_->getDetFromBin(layer, ix, iy); }
constexpr std::array< uint8_t, layerIndexSize > layer
DetId getDetFromBin(int layer, int ix, int iy) const
Definition: TkDetMap.h:191
const TkDetMap * tkdetmap_
Definition: TkHistoMap.h:91

◆ getDetId() [3/3]

DetId TkHistoMap::getDetId ( const MonitorElement ME,
int  ix,
int  iy 
)
inline

Definition at line 54 of file TkHistoMap.h.

References getDetId().

Referenced by getDetId().

54 { return getDetId(ME->getTitle(), ix, iy); }
Definition: ME.h:11
DetId getDetId(const std::string &title, int ix, int iy)
Definition: TkHistoMap.h:50

◆ getEntries()

float TkHistoMap::getEntries ( DetId  detid)

Definition at line 261 of file TkHistoMap.cc.

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

Referenced by dumpInTkMap().

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

◆ getLayerName()

std::string TkHistoMap::getLayerName ( std::string  title)
inline

Definition at line 55 of file TkHistoMap.h.

References MapName_, and runGCPTkAlMap::title.

Referenced by getDetId().

55 { return title.erase(0, MapName_.size() + 1); }
std::string MapName_
Definition: TkHistoMap.h:97

◆ getLayerNum()

uint16_t TkHistoMap::getLayerNum ( const std::string &  layerName)
inline

Definition at line 56 of file TkHistoMap.h.

References TkDetMap::getLayerNum(), phase1PixelTopology::layerName, and tkdetmap_.

Referenced by getDetId().

56 { 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:91

◆ getMap()

MonitorElement* TkHistoMap::getMap ( short  layerNumber)
inline

Definition at line 44 of file TkHistoMap.h.

References tkHistoMap_.

44 { return tkHistoMap_[layerNumber]; };
std::vector< MonitorElement * > tkHistoMap_
Definition: TkHistoMap.h:95

◆ getValue()

float TkHistoMap::getValue ( DetId  detid)

Definition at line 251 of file TkHistoMap.cc.

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

Referenced by dumpInTkMap().

251  {
254 
256  return tkHistoMap_[layer]->getTH2F()->GetBinContent(tkHistoMap_[layer]->getTH2F()->GetBin(xybin.ix, xybin.iy));
257  else
258  return tkHistoMap_[layer]->getTProfile2D()->GetBinContent(
259  tkHistoMap_[layer]->getTProfile2D()->GetBin(xybin.ix, xybin.iy));
260 }
DetId cached_detid
Definition: TkHistoMap.h:92
int16_t cached_layer
Definition: TkHistoMap.h:93
constexpr std::array< uint8_t, layerIndexSize > layer
std::vector< MonitorElement * > tkHistoMap_
Definition: TkHistoMap.h:95
const TkLayerMap::XYbin & getXY(DetId detid, DetId &cached_detid, int16_t &cached_layer, TkLayerMap::XYbin &cached_XYbin) const
Definition: TkDetMap.cc:548
int16_t findLayer(DetId detid, DetId &cached_detid, int16_t &cached_layer, TkLayerMap::XYbin &cached_XYbin) const
Definition: TkDetMap.cc:568
TkLayerMap::XYbin cached_XYbin
Definition: TkHistoMap.h:94
const TkDetMap * tkdetmap_
Definition: TkHistoMap.h:91

◆ load()

void TkHistoMap::load ( const TkDetMap tkDetMap,
const std::string &  path,
float  baseline,
bool  mechanicalView,
bool  isTH2F,
bool  createTkMap = true 
)
private

Definition at line 48 of file TkHistoMap.cc.

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

Referenced by TkHistoMap().

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

◆ loadServices()

void TkHistoMap::loadServices ( )

Definition at line 61 of file TkHistoMap.cc.

References dqmStore_, and Utilities::operator.

Referenced by load().

61  {
62  if (!edm::Service<DQMStore>().isAvailable()) {
63  edm::LogError("TkHistoMap")
64  << "\n------------------------------------------"
65  "\nUnAvailable Service DQMStore: please insert in the configuration file an instance like"
66  "\n\tprocess.load(\"DQMServices.Core.DQMStore_cfg\")"
67  "\n------------------------------------------";
68  }
70 }
Log< level::Error, false > LogError
DQMStore * dqmStore_
Definition: TkHistoMap.h:89

◆ loadTkHistoMap()

void TkHistoMap::loadTkHistoMap ( const std::string &  path,
const std::string &  MapName,
bool  mechanicalView = false 
)

Definition at line 77 of file TkHistoMap.cc.

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

Referenced by BuildTrackerMapPlugin::read().

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

◆ save()

void TkHistoMap::save ( const std::string &  filename)

Definition at line 72 of file TkHistoMap.cc.

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

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

72  {
73  // dqmStore_ only for saving
75 }
DQMStore * dqmStore_
Definition: TkHistoMap.h:89
DQM_DEPRECATED void save(std::string const &filename, std::string const &path="")
Definition: DQMStore.cc:791

◆ saveAsCanvas()

void TkHistoMap::saveAsCanvas ( const std::string &  filename,
const std::string &  options = "",
const std::string &  mode = "RECREATE" 
)

Definition at line 288 of file TkHistoMap.cc.

References f, corrVsCorr::filename, mps_fire::i, MapName_, ALCARECOPromptCalibProdSiPixelAli0T_cff::mode, 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.

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

◆ setBinContent()

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

Definition at line 205 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, CalibrationSummaryClient_cfi::kind, phase1PixelTopology::layer, LogTrace, DetId::rawId(), MonitorElementData::TH2F, tkdetmap_, tkHistoMap_, MonitorElementData::TPROFILE2D, TkLayerMap::XYbin::x, and TkLayerMap::XYbin::y.

Referenced by add().

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

Member Data Documentation

◆ cached_detid

DetId TkHistoMap::cached_detid
private

Definition at line 92 of file TkHistoMap.h.

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

◆ cached_layer

int16_t TkHistoMap::cached_layer
private

Definition at line 93 of file TkHistoMap.h.

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

◆ cached_XYbin

TkLayerMap::XYbin TkHistoMap::cached_XYbin
private

Definition at line 94 of file TkHistoMap.h.

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

◆ dqmStore_

DQMStore* TkHistoMap::dqmStore_ {nullptr}
private

Definition at line 89 of file TkHistoMap.h.

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

◆ HistoNumber

int TkHistoMap::HistoNumber
private

Definition at line 96 of file TkHistoMap.h.

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

◆ isTH2F_

bool TkHistoMap::isTH2F_
private

Definition at line 98 of file TkHistoMap.h.

Referenced by createTkHistoMap(), and load().

◆ MapName_

std::string TkHistoMap::MapName_
private

Definition at line 97 of file TkHistoMap.h.

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

◆ tkdetmap_

const TkDetMap* TkHistoMap::tkdetmap_
private

◆ tkHistoMap_

std::vector<MonitorElement*> TkHistoMap::tkHistoMap_
private