CMS 3D CMS Logo

List of all members | Public Member Functions | Private 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 ()
 

Private Types

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_ { 0 }
 
int HistoNumber
 
bool isTH2F_
 
std::string MapName_
 
const TkDetMaptkdetmap_
 
std::vector< MonitorElement * > tkHistoMap_
 

Detailed Description

Definition at line 13 of file TkHistoMap.h.

Member Typedef Documentation

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

Definition at line 15 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 37 of file TkHistoMap.cc.

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

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

Definition at line 13 of file TkHistoMap.cc.

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

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

Definition at line 25 of file TkHistoMap.cc.

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

25  :
26  HistoNumber(35),
27  MapName_(MapName)
28 {
29  LogTrace("TkHistoMap") <<"TkHistoMap::constructor with parameters";
30  load(tkDetMap, path, baseline, mechanicalView, isTH2F);
31  dqmStore_->meBookerGetter([this, &path, &baseline, mechanicalView](DQMStore::IBooker& ibooker,
33  this->createTkHistoMap(ibooker, path, MapName_, baseline, mechanicalView);
34  });
35 }
void load(const TkDetMap *tkDetMap, const std::string &path, float baseline, bool mechanicalView, bool isTH2F, bool createTkMap=true)
Definition: TkHistoMap.cc:46
int HistoNumber
Definition: TkHistoMap.h:64
DQMStore * dqmStore_
Definition: TkHistoMap.h:57
std::string MapName_
Definition: TkHistoMap.h:65
void createTkHistoMap(DQMStore::IBooker &ibooker, const std::string &path, const std::string &MapName, float baseline, bool mechanicalView)
Definition: TkHistoMap.cc:93
#define LogTrace(id)
void meBookerGetter(iFunc f)
Definition: DQMStore.h:286
TkHistoMap::TkHistoMap ( const TkDetMap tkDetMap)

Definition at line 6 of file TkHistoMap.cc.

References f, load(), and LogTrace.

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

Member Function Documentation

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

Definition at line 212 of file TkHistoMap.cc.

References cached_detid, cached_layer, cached_XYbin, MonitorElement::DQM_KIND_TH2F, MonitorElement::DQM_KIND_TPROFILE2D, TkDetMap::findLayer(), TkDetMap::getXY(), TkLayerMap::XYbin::ix, TkLayerMap::XYbin::iy, callgraph::kind, LogTrace, setBinContent(), tkdetmap_, and tkHistoMap_.

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

212  {
213 #ifdef debug_TkHistoMap
214  LogTrace("TkHistoMap") << "[TkHistoMap::add]";
215 #endif
216  int16_t layer=tkdetmap_->findLayer(detid , cached_detid , cached_layer , cached_XYbin);
219  setBinContent(detid,tkHistoMap_[layer]->getTProfile2D()->GetBinContent(tkHistoMap_[layer]->getTProfile2D()->GetBin(xybin.ix,xybin.iy))+value);
220  else if (tkHistoMap_[layer]->kind() == MonitorElement::DQM_KIND_TH2F)
221  setBinContent(detid,tkHistoMap_[layer]->getTH2F()->GetBinContent(tkHistoMap_[layer]->getTH2F()->GetBin(xybin.ix,xybin.iy))+value);
222 }
DetId cached_detid
Definition: TkHistoMap.h:60
void setBinContent(DetId detid, float value)
Definition: TkHistoMap.cc:190
int16_t cached_layer
Definition: TkHistoMap.h:61
std::vector< MonitorElement * > tkHistoMap_
Definition: TkHistoMap.h:63
TkLayerMap::XYbin cached_XYbin
Definition: TkHistoMap.h:62
Definition: value.py:1
#define LogTrace(id)
int16_t findLayer(DetId detid, DetId &cached_detid, int16_t &cached_layer, TkLayerMap::XYbin &cached_XYbin) const
Definition: TkDetMap.cc:563
const TkDetMap * tkdetmap_
Definition: TkHistoMap.h:59
const TkLayerMap::XYbin & getXY(DetId detid, DetId &cached_detid, int16_t &cached_layer, TkLayerMap::XYbin &cached_XYbin) const
Definition: TkDetMap.cc:549
void TkHistoMap::createTkHistoMap ( DQMStore::IBooker ibooker,
const std::string &  path,
const std::string &  MapName,
float  baseline,
bool  mechanicalView 
)
private

Definition at line 93 of file TkHistoMap.cc.

References DQMStore::IBooker::book2D(), DQMStore::IBooker::bookProfile2D(), MonitorElement::Fill(), printsummarytable::folder, folderDefinition(), TkDetMap::getComponents(), TkDetMap::getDetFromBin(), HistoNumber, createfilelist::int, isTH2F_, LogTrace, AlCaHLTBitMon_QueryRunRegistry::string, tkdetmap_, and tkHistoMap_.

Referenced by getLayerNum(), and TkHistoMap().

93  {
94 
95  int nchX;
96  int nchY;
97  double lowX,highX;
98  double lowY, highY;
99  std::string fullName, folder;
100 
101  tkHistoMap_.resize(HistoNumber);
102  const bool bookTH2F = isTH2F_;
103  for(int layer=1;layer<HistoNumber;++layer){
104  folder=folderDefinition(ibooker, path, MapName,layer,mechanicalView,fullName);
105  tkdetmap_->getComponents(layer,nchX,lowX,highX,nchY,lowY,highY);
106  MonitorElement* me;
107  if(bookTH2F==false){
108  me = ibooker.bookProfile2D(fullName.c_str(),fullName.c_str(),
109  nchX,lowX,highX,
110  nchY,lowY,highY,
111  0.0, 0.0);
112  }
113  else{
114  me = ibooker.book2D(fullName.c_str(),fullName.c_str(),
115  nchX,lowX,highX,
116  nchY,lowY,highY);
117  }
118  //initialize bin content for the not assigned bins
119  if(baseline!=0){
120  for(size_t ix = 1; ix <= (unsigned int) nchX; ++ix)
121  for(size_t iy = 1;iy <= (unsigned int) nchY; ++iy)
122  if(!tkdetmap_->getDetFromBin(layer,ix,iy))
123  me->Fill(1.*(lowX+ix-.5),1.*(lowY+iy-.5),baseline);
124  }
125 
126  tkHistoMap_[layer]=me;
127 #ifdef debug_TkHistoMap
128  LogTrace("TkHistoMap") << "[TkHistoMap::createTkHistoMap] folder " << folder << " histoName " << fullName << " layer " << layer << " ptr " << tkHistoMap_[layer];
129 #endif
130  }
131 }
int HistoNumber
Definition: TkHistoMap.h:64
std::vector< MonitorElement * > tkHistoMap_
Definition: TkHistoMap.h:63
void Fill(long long x)
MonitorElement * bookProfile2D(Args &&...args)
Definition: DQMStore.h:114
#define LogTrace(id)
void getComponents(int layer, int &nchX, double &lowX, double &highX, int &nchY, double &lowY, double &highY) const
Definition: TkDetMap.cc:581
MonitorElement * book2D(Args &&...args)
Definition: DQMStore.h:109
bool isTH2F_
Definition: TkHistoMap.h:66
const TkDetMap * tkdetmap_
Definition: TkHistoMap.h:59
DetId getDetFromBin(int layer, int ix, int iy) const
Definition: TkDetMap.h:139
std::string folderDefinition(DQMStore::IBooker &ibooker, std::string folder, const std::string &MapName, int layer, bool mechanicalView, std::string &fullName)
Definition: TkHistoMap.cc:133
void TkHistoMap::dumpInTkMap ( TrackerMap tkmap,
bool  dumpEntries = false 
)

Definition at line 242 of file TkHistoMap.cc.

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

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

242  {
243  for(int layer=1;layer<HistoNumber;++layer){
244  // std::vector<uint32_t> dets;
245  // tkdetmap_->getDetsForLayer(layer,dets);
246  std::vector<DetId> dets = tkdetmap_->getDetsForLayer(layer);
247  for(size_t i=0;i<dets.size();++i){
248  if(dets[i]>0){
249  if(getEntries(dets[i])>0) {
250  tkmap->fill(dets[i],
251  dumpEntries ? getEntries(dets[i]) : getValue(dets[i]));
252  }
253  }
254  }
255  }
256 }
int HistoNumber
Definition: TkHistoMap.h:64
std::vector< DetId > getDetsForLayer(int layer) const
Definition: TkDetMap.h:144
const TkDetMap * tkdetmap_
Definition: TkHistoMap.h:59
float getEntries(DetId detid)
Definition: TkHistoMap.cc:233
float getValue(DetId detid)
Definition: TkHistoMap.cc:224
void fill(int layer, int ring, int nmod, float x)
Definition: TrackerMap.cc:2786
void TkHistoMap::fill ( DetId  detid,
float  value 
)

Definition at line 167 of file TkHistoMap.cc.

References cached_detid, cached_layer, cached_XYbin, MonitorElement::DQM_KIND_TH2F, MonitorElement::DQM_KIND_TPROFILE2D, TkDetMap::findLayer(), TkDetMap::getXY(), cuy::ii, TkLayerMap::XYbin::ix, TkLayerMap::XYbin::iy, findQualityFiles::jj, callgraph::kind, LogTrace, DetId::rawId(), tkdetmap_, tkHistoMap_, TkLayerMap::XYbin::x, and TkLayerMap::XYbin::y.

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

167  {
168  int16_t layer=tkdetmap_->findLayer(detid , cached_detid , cached_layer , cached_XYbin);
170 #ifdef debug_TkHistoMap
171  LogTrace("TkHistoMap") << "[TkHistoMap::fill] Fill detid " << detid.rawId() << " Layer " << layer << " value " << value << " ix,iy " << xybin.ix << " " << xybin.iy << " " << xybin.x << " " << xybin.y << " " << tkHistoMap_[layer]->getTProfile2D()->GetName();
172 #endif
174  tkHistoMap_[layer]->getTProfile2D()->Fill(xybin.x,xybin.y,value);
175  else if (tkHistoMap_[layer]->kind() == MonitorElement::DQM_KIND_TH2F)
176  tkHistoMap_[layer]->getTH2F()->Fill(xybin.x,xybin.y,value);
177 
178 #ifdef debug_TkHistoMap
179  LogTrace("TkHistoMap") << "[TkHistoMap::fill] " << tkHistoMap_[layer]->getTProfile2D()->GetBinContent(xybin.ix,xybin.iy);
180  for(size_t ii=0;ii<4;ii++)
181  for(size_t jj=0;jj<11;jj++){
183  LogTrace("TkHistoMap") << "[TkHistoMap::fill] " << ii << " " << jj << " " << tkHistoMap_[layer]->getTProfile2D()->GetBinContent(ii,jj);
185  LogTrace("TkHistoMap") << "[TkHistoMap::fill] " << ii << " " << jj << " " << tkHistoMap_[layer]->getTH2F()->GetBinContent(ii,jj);
186  }
187 #endif
188 }
DetId cached_detid
Definition: TkHistoMap.h:60
constexpr uint32_t rawId() const
get the raw id
Definition: DetId.h:50
int16_t cached_layer
Definition: TkHistoMap.h:61
std::vector< MonitorElement * > tkHistoMap_
Definition: TkHistoMap.h:63
TkLayerMap::XYbin cached_XYbin
Definition: TkHistoMap.h:62
Definition: value.py:1
#define LogTrace(id)
ii
Definition: cuy.py:590
int16_t findLayer(DetId detid, DetId &cached_detid, int16_t &cached_layer, TkLayerMap::XYbin &cached_XYbin) const
Definition: TkDetMap.cc:563
const TkDetMap * tkdetmap_
Definition: TkHistoMap.h:59
const TkLayerMap::XYbin & getXY(DetId detid, DetId &cached_detid, int16_t &cached_layer, TkLayerMap::XYbin &cached_XYbin) const
Definition: TkDetMap.cc:549
void TkHistoMap::fillFromAscii ( const std::string &  filename)

Definition at line 155 of file TkHistoMap.cc.

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

Referenced by getLayerNum().

155  {
156  std::ifstream file;
157  file.open(filename.c_str());
158  float value;
159  uint32_t detid;
160  while (file.good()){
161  file >> detid >> value;
162  fill(detid,value);
163  }
164  file.close();
165 }
void fill(DetId detid, float value)
Definition: TkHistoMap.cc:167
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 133 of file TkHistoMap.cc.

References printsummarytable::folder, TkDetMap::getLayerName(), SiStripFolderOrganizer::getSubDetLayerFolderName(), TkDetMap::getSubDetLayerSide(), dataset::name, DQMStore::IBooker::setCurrentFolder(), SiStripFolderOrganizer::setSiStripFolderName(), and AlCaHLTBitMon_QueryRunRegistry::string.

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

133  {
134 
135  std::string name = MapName+std::string("_");
136  fullName=name+TkDetMap::getLayerName(layer);
137 
138  if(mechanicalView){
139  std::stringstream ss;
140 
141  SiStripFolderOrganizer folderOrg;
142  folderOrg.setSiStripFolderName(folder);
143 
145  uint32_t subdetlayer = 0, side = 0;
146  TkDetMap::getSubDetLayerSide(layer,subDet,subdetlayer,side);
147  folderOrg.getSubDetLayerFolderName(ss,subDet,subdetlayer,side);
148  folder = ss.str();
149  }
150  ibooker.setCurrentFolder(folder);
151  return folder;
152 }
void setSiStripFolderName(std::string name)
static std::string getLayerName(int in)
Definition: TkDetMap.cc:235
static void getSubDetLayerSide(int in, SiStripDetId::SubDetector &, uint32_t &layer, uint32_t &side)
Definition: TkDetMap.cc:383
void getSubDetLayerFolderName(std::stringstream &ss, SiStripDetId::SubDetector subDet, uint32_t layer, uint32_t side=0)
void setCurrentFolder(std::string const &fullpath)
Definition: DQMStore.cc:268
const std::vector<MonitorElement*>& TkHistoMap::getAllMaps ( ) const
inline

Definition at line 29 of file TkHistoMap.h.

References tkHistoMap_.

Referenced by BuildTrackerMapPlugin::subtractMap().

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

Definition at line 30 of file TkHistoMap.h.

References getEntries(), getValue(), and tkHistoMap_.

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

Definition at line 34 of file TkHistoMap.h.

References getDetId(), getLayerName(), and getLayerNum().

Referenced by getDetId().

34 {return getDetId(getLayerNum(getLayerName(title)),ix,iy);}
std::string getLayerName(std::string title)
Definition: TkHistoMap.h:37
DetId getDetId(const std::string &title, int ix, int iy)
Definition: TkHistoMap.h:34
uint16_t getLayerNum(const std::string &layerName)
Definition: TkHistoMap.h:38
DetId TkHistoMap::getDetId ( int  layer,
int  ix,
int  iy 
)
inline

Definition at line 35 of file TkHistoMap.h.

References TkDetMap::getDetFromBin(), and tkdetmap_.

35 {return tkdetmap_->getDetFromBin(layer,ix,iy);}
const TkDetMap * tkdetmap_
Definition: TkHistoMap.h:59
DetId getDetFromBin(int layer, int ix, int iy) const
Definition: TkDetMap.h:139
DetId TkHistoMap::getDetId ( const MonitorElement ME,
int  ix,
int  iy 
)
inline

Definition at line 36 of file TkHistoMap.h.

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

Referenced by getDetId().

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

Definition at line 233 of file TkHistoMap.cc.

References cached_detid, cached_layer, cached_XYbin, MonitorElement::DQM_KIND_TH2F, TkDetMap::findLayer(), TkDetMap::getXY(), TkLayerMap::XYbin::ix, TkLayerMap::XYbin::iy, callgraph::kind, tkdetmap_, and tkHistoMap_.

Referenced by dumpInTkMap(), and getAllMaps().

233  {
234  int16_t layer=tkdetmap_->findLayer(detid , cached_detid , cached_layer , cached_XYbin);
237  return 1;
238  else
239  return tkHistoMap_[layer]->getTProfile2D()->GetBinEntries(tkHistoMap_[layer]->getTProfile2D()->GetBin(xybin.ix,xybin.iy));
240 }
DetId cached_detid
Definition: TkHistoMap.h:60
int16_t cached_layer
Definition: TkHistoMap.h:61
std::vector< MonitorElement * > tkHistoMap_
Definition: TkHistoMap.h:63
TkLayerMap::XYbin cached_XYbin
Definition: TkHistoMap.h:62
int16_t findLayer(DetId detid, DetId &cached_detid, int16_t &cached_layer, TkLayerMap::XYbin &cached_XYbin) const
Definition: TkDetMap.cc:563
const TkDetMap * tkdetmap_
Definition: TkHistoMap.h:59
const TkLayerMap::XYbin & getXY(DetId detid, DetId &cached_detid, int16_t &cached_layer, TkLayerMap::XYbin &cached_XYbin) const
Definition: TkDetMap.cc:549
std::string TkHistoMap::getLayerName ( std::string  title)
inline

Definition at line 37 of file TkHistoMap.h.

References MapName_.

Referenced by getDetId().

37 {return title.erase(0,MapName_.size()+1);}
std::string MapName_
Definition: TkHistoMap.h:65
uint16_t TkHistoMap::getLayerNum ( const std::string &  layerName)
inline
MonitorElement* TkHistoMap::getMap ( short  layerNumber)
inline

Definition at line 28 of file TkHistoMap.h.

References tkHistoMap_.

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

Definition at line 224 of file TkHistoMap.cc.

References cached_detid, cached_layer, cached_XYbin, MonitorElement::DQM_KIND_TH2F, TkDetMap::findLayer(), TkDetMap::getXY(), TkLayerMap::XYbin::ix, TkLayerMap::XYbin::iy, callgraph::kind, tkdetmap_, and tkHistoMap_.

Referenced by dumpInTkMap(), and getAllMaps().

224  {
225  int16_t layer=tkdetmap_->findLayer(detid , cached_detid , cached_layer , cached_XYbin);
227 
229  return tkHistoMap_[layer]->getTH2F()->GetBinContent(tkHistoMap_[layer]->getTH2F()->GetBin(xybin.ix,xybin.iy));
230  else
231  return tkHistoMap_[layer]->getTProfile2D()->GetBinContent(tkHistoMap_[layer]->getTProfile2D()->GetBin(xybin.ix,xybin.iy));
232 }
DetId cached_detid
Definition: TkHistoMap.h:60
int16_t cached_layer
Definition: TkHistoMap.h:61
std::vector< MonitorElement * > tkHistoMap_
Definition: TkHistoMap.h:63
TkLayerMap::XYbin cached_XYbin
Definition: TkHistoMap.h:62
int16_t findLayer(DetId detid, DetId &cached_detid, int16_t &cached_layer, TkLayerMap::XYbin &cached_XYbin) const
Definition: TkDetMap.cc:563
const TkDetMap * tkdetmap_
Definition: TkHistoMap.h:59
const TkLayerMap::XYbin & getXY(DetId detid, DetId &cached_detid, int16_t &cached_layer, TkLayerMap::XYbin &cached_XYbin) const
Definition: TkDetMap.cc:549
void TkHistoMap::load ( const TkDetMap tkDetMap,
const std::string &  path,
float  baseline,
bool  mechanicalView,
bool  isTH2F,
bool  createTkMap = true 
)
private

Definition at line 46 of file TkHistoMap.cc.

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

Referenced by getLayerNum(), and TkHistoMap().

47 {
48  cached_detid=0;
49  cached_layer=0;
50  loadServices();
51  tkdetmap_ = tkDetMap;
52  isTH2F_ = isTH2F;
53 }
void loadServices()
Definition: TkHistoMap.cc:55
DetId cached_detid
Definition: TkHistoMap.h:60
int16_t cached_layer
Definition: TkHistoMap.h:61
bool isTH2F_
Definition: TkHistoMap.h:66
const TkDetMap * tkdetmap_
Definition: TkHistoMap.h:59
void TkHistoMap::loadServices ( )

Definition at line 55 of file TkHistoMap.cc.

References dqmStore_, and Utilities::operator.

Referenced by load(), and ~TkHistoMap().

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

Definition at line 71 of file TkHistoMap.cc.

References dqmStore_, printsummarytable::folder, folderDefinition(), HistoNumber, edm::loadMap(), LogTrace, MapName_, DQMStore::meBookerGetter(), callgraph::path, AlCaHLTBitMon_QueryRunRegistry::string, and tkHistoMap_.

Referenced by BuildTrackerMapPlugin::read(), and ~TkHistoMap().

71  {
72  MapName_=MapName;
73  tkHistoMap_.resize(HistoNumber);
74  auto loadMap = [this, &path, mechanicalView](DQMStore::IBooker& ibooker,
75  DQMStore::IGetter& igetter) {
76  std::string fullName, folder;
77  for (int layer=1;layer<HistoNumber;++layer) {
78  folder=folderDefinition(ibooker, path, MapName_, layer, mechanicalView, fullName);
79 #ifdef debug_TkHistoMap
80  LogTrace("TkHistoMap") << "[TkHistoMap::loadTkHistoMap] folder " << folder << " histoName " << fullName << " find " << folder.find_last_of("/") << " length " << folder.length();
81 #endif
82  if (folder.find_last_of("/")!=folder.length()-1)
83  folder+="/";
84  tkHistoMap_[layer]=igetter.get(folder+fullName);
85 #ifdef debug_TkHistoMap
86  LogTrace("TkHistoMap") << "[TkHistoMap::loadTkHistoMap] folder " << folder << " histoName " << fullName << " layer " << layer << " ptr " << tkHistoMap_[layer] << " find " << folder.find_last_of("/") << " length " << folder.length();
87 #endif
88  }
89  };
91 }
int HistoNumber
Definition: TkHistoMap.h:64
DQMStore * dqmStore_
Definition: TkHistoMap.h:57
std::vector< MonitorElement * > tkHistoMap_
Definition: TkHistoMap.h:63
static ELmap const & loadMap()
std::string MapName_
Definition: TkHistoMap.h:65
#define LogTrace(id)
void meBookerGetter(iFunc f)
Definition: DQMStore.h:286
std::string folderDefinition(DQMStore::IBooker &ibooker, std::string folder, const std::string &MapName, int layer, bool mechanicalView, std::string &fullName)
Definition: TkHistoMap.cc:133
void TkHistoMap::save ( const std::string &  filename)

Definition at line 66 of file TkHistoMap.cc.

References dqmStore_, and DQMStore::save().

Referenced by Vispa.Main.TabController.TabController::allowClose(), SiStripDetVOffTkMapPlotter::analyze(), TkVoltageMapCreator::beginRun(), Vispa.Main.TabController.TabController::checkModificationTimestamp(), and getLayerNum().

66  {
67  // dqmStore_ only for saving
69 }
DQMStore * dqmStore_
Definition: TkHistoMap.h:57
void save(std::string const &filename, std::string const &path="", std::string const &pattern="", std::string const &rewrite="", uint32_t run=0, uint32_t lumi=0, SaveReferenceTag ref=SaveWithReference, int minStatus=dqm::qstatus::STATUS_OK, std::string const &fileupdate="RECREATE")
Definition: DQMStore.cc:2443
void TkHistoMap::saveAsCanvas ( const std::string &  filename,
const std::string &  options = "",
const std::string &  mode = "RECREATE" 
)

Definition at line 260 of file TkHistoMap.cc.

References 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.

Referenced by getLayerNum().

260  {
261  // TCanvas C(MapName_,MapName_,200,10,900,700);
262  TCanvas* CTIB=new TCanvas(std::string("Canvas_"+MapName_+"TIB").c_str(),std::string("Canvas_"+MapName_+"TIB").c_str());
263  TCanvas* CTOB=new TCanvas(std::string("Canvas_"+MapName_+"TOB").c_str(),std::string("Canvas_"+MapName_+"TOB").c_str());
264  TCanvas* CTIDP=new TCanvas(std::string("Canvas_"+MapName_+"TIDP").c_str(),std::string("Canvas_"+MapName_+"TIDP").c_str());
265  TCanvas* CTIDM=new TCanvas(std::string("Canvas_"+MapName_+"TIDM").c_str(),std::string("Canvas_"+MapName_+"TIDM").c_str());
266  TCanvas* CTECP=new TCanvas(std::string("Canvas_"+MapName_+"TECP").c_str(),std::string("Canvas_"+MapName_+"TECP").c_str());
267  TCanvas* CTECM=new TCanvas(std::string("Canvas_"+MapName_+"TECM").c_str(),std::string("Canvas_"+MapName_+"TECM").c_str());
268  CTIB->Divide(2,2);
269  CTOB->Divide(2,3);
270  CTIDP->Divide(1,3);
271  CTIDM->Divide(1,3);
272  CTECP->Divide(3,3);
273  CTECM->Divide(3,3);
274 
275  int i;
276  i=0;
277  CTIB->cd(++i);tkHistoMap_[TkLayerMap::TIB_L1]->getTProfile2D()->Draw(options.c_str());
278  CTIB->cd(++i);tkHistoMap_[TkLayerMap::TIB_L2]->getTProfile2D()->Draw(options.c_str());
279  CTIB->cd(++i);tkHistoMap_[TkLayerMap::TIB_L3]->getTProfile2D()->Draw(options.c_str());
280  CTIB->cd(++i);tkHistoMap_[TkLayerMap::TIB_L4]->getTProfile2D()->Draw(options.c_str());
281 
282  i=0;
283  CTIDP->cd(++i);tkHistoMap_[TkLayerMap::TIDP_D1]->getTProfile2D()->Draw(options.c_str());
284  CTIDP->cd(++i);tkHistoMap_[TkLayerMap::TIDP_D2]->getTProfile2D()->Draw(options.c_str());
285  CTIDP->cd(++i);tkHistoMap_[TkLayerMap::TIDP_D3]->getTProfile2D()->Draw(options.c_str());
286 
287  i=0;
288  CTIDM->cd(++i);tkHistoMap_[TkLayerMap::TIDM_D1]->getTProfile2D()->Draw(options.c_str());
289  CTIDM->cd(++i);tkHistoMap_[TkLayerMap::TIDM_D2]->getTProfile2D()->Draw(options.c_str());
290  CTIDM->cd(++i);tkHistoMap_[TkLayerMap::TIDM_D3]->getTProfile2D()->Draw(options.c_str());
291 
292  i=0;
293  CTOB->cd(++i);tkHistoMap_[TkLayerMap::TOB_L1]->getTProfile2D()->Draw(options.c_str());
294  CTOB->cd(++i);tkHistoMap_[TkLayerMap::TOB_L2]->getTProfile2D()->Draw(options.c_str());
295  CTOB->cd(++i);tkHistoMap_[TkLayerMap::TOB_L3]->getTProfile2D()->Draw(options.c_str());
296  CTOB->cd(++i);tkHistoMap_[TkLayerMap::TOB_L4]->getTProfile2D()->Draw(options.c_str());
297  CTOB->cd(++i);tkHistoMap_[TkLayerMap::TOB_L5]->getTProfile2D()->Draw(options.c_str());
298  CTOB->cd(++i);tkHistoMap_[TkLayerMap::TOB_L6]->getTProfile2D()->Draw(options.c_str());
299 
300  i=0;
301  CTECP->cd(++i);tkHistoMap_[TkLayerMap::TECP_W1]->getTProfile2D()->Draw(options.c_str());
302  CTECP->cd(++i);tkHistoMap_[TkLayerMap::TECP_W2]->getTProfile2D()->Draw(options.c_str());
303  CTECP->cd(++i);tkHistoMap_[TkLayerMap::TECP_W3]->getTProfile2D()->Draw(options.c_str());
304  CTECP->cd(++i);tkHistoMap_[TkLayerMap::TECP_W4]->getTProfile2D()->Draw(options.c_str());
305  CTECP->cd(++i);tkHistoMap_[TkLayerMap::TECP_W5]->getTProfile2D()->Draw(options.c_str());
306  CTECP->cd(++i);tkHistoMap_[TkLayerMap::TECP_W6]->getTProfile2D()->Draw(options.c_str());
307  CTECP->cd(++i);tkHistoMap_[TkLayerMap::TECP_W7]->getTProfile2D()->Draw(options.c_str());
308  CTECP->cd(++i);tkHistoMap_[TkLayerMap::TECP_W8]->getTProfile2D()->Draw(options.c_str());
309  CTECP->cd(++i);tkHistoMap_[TkLayerMap::TECP_W9]->getTProfile2D()->Draw(options.c_str());
310 
311  i=0;
312  CTECM->cd(++i);tkHistoMap_[TkLayerMap::TECM_W1]->getTProfile2D()->Draw(options.c_str());
313  CTECM->cd(++i);tkHistoMap_[TkLayerMap::TECM_W2]->getTProfile2D()->Draw(options.c_str());
314  CTECM->cd(++i);tkHistoMap_[TkLayerMap::TECM_W3]->getTProfile2D()->Draw(options.c_str());
315  CTECM->cd(++i);tkHistoMap_[TkLayerMap::TECM_W4]->getTProfile2D()->Draw(options.c_str());
316  CTECM->cd(++i);tkHistoMap_[TkLayerMap::TECM_W5]->getTProfile2D()->Draw(options.c_str());
317  CTECM->cd(++i);tkHistoMap_[TkLayerMap::TECM_W6]->getTProfile2D()->Draw(options.c_str());
318  CTECM->cd(++i);tkHistoMap_[TkLayerMap::TECM_W7]->getTProfile2D()->Draw(options.c_str());
319  CTECM->cd(++i);tkHistoMap_[TkLayerMap::TECM_W8]->getTProfile2D()->Draw(options.c_str());
320  CTECM->cd(++i);tkHistoMap_[TkLayerMap::TECM_W9]->getTProfile2D()->Draw(options.c_str());
321 
322  TFile *f = new TFile(filename.c_str(),mode.c_str());
323  CTIB->Write();
324  CTIDP->Write();
325  CTIDM->Write();
326  CTOB->Write();
327  CTECP->Write();
328  CTECM->Write();
329  f->Close();
330  delete f;
331 }
std::vector< MonitorElement * > tkHistoMap_
Definition: TkHistoMap.h:63
std::string MapName_
Definition: TkHistoMap.h:65
double f[11][100]
void TkHistoMap::setBinContent ( DetId  detid,
float  value 
)

Definition at line 190 of file TkHistoMap.cc.

References cached_detid, cached_layer, cached_XYbin, MonitorElement::DQM_KIND_TH2F, MonitorElement::DQM_KIND_TPROFILE2D, TkDetMap::findLayer(), TkDetMap::getXY(), cuy::ii, TkLayerMap::XYbin::ix, TkLayerMap::XYbin::iy, findQualityFiles::jj, callgraph::kind, LogTrace, DetId::rawId(), tkdetmap_, tkHistoMap_, TkLayerMap::XYbin::x, and TkLayerMap::XYbin::y.

Referenced by add(), and getLayerNum().

190  {
191  int16_t layer=tkdetmap_->findLayer(detid , cached_detid , cached_layer , cached_XYbin);
194  tkHistoMap_[layer]->getTProfile2D()->SetBinEntries(tkHistoMap_[layer]->getTProfile2D()->GetBin(xybin.ix,xybin.iy),1);
195  tkHistoMap_[layer]->getTProfile2D()->SetBinContent(tkHistoMap_[layer]->getTProfile2D()->GetBin(xybin.ix,xybin.iy),value);
196  }
197  else if (tkHistoMap_[layer]->kind() == MonitorElement::DQM_KIND_TH2F){
198  tkHistoMap_[layer]->getTH2F()->SetBinContent(xybin.ix,xybin.iy,value);
199  }
200 
201 #ifdef debug_TkHistoMap
202  LogTrace("TkHistoMap") << "[TkHistoMap::setbincontent] setBinContent detid " << detid.rawId() << " Layer " << layer << " value " << value << " ix,iy " << xybin.ix << " " << xybin.iy << " " << xybin.x << " " << xybin.y << " " << tkHistoMap_[layer]->getTProfile2D()->GetName() << " bin " << tkHistoMap_[layer]->getTProfile2D()->GetBin(xybin.ix,xybin.iy);
203 
204  LogTrace("TkHistoMap") << "[TkHistoMap::setbincontent] " << tkHistoMap_[layer]->getTProfile2D()->GetBinContent(xybin.ix,xybin.iy);
205  for(size_t ii=0;ii<4;ii++)
206  for(size_t jj=0;jj<11;jj++){
207  LogTrace("TkHistoMap") << "[TkHistoMap::setbincontent] " << ii << " " << jj << " " << tkHistoMap_[layer]->getTProfile2D()->GetBinContent(ii,jj);
208  }
209 #endif
210 }
DetId cached_detid
Definition: TkHistoMap.h:60
constexpr uint32_t rawId() const
get the raw id
Definition: DetId.h:50
int16_t cached_layer
Definition: TkHistoMap.h:61
std::vector< MonitorElement * > tkHistoMap_
Definition: TkHistoMap.h:63
TkLayerMap::XYbin cached_XYbin
Definition: TkHistoMap.h:62
Definition: value.py:1
#define LogTrace(id)
ii
Definition: cuy.py:590
int16_t findLayer(DetId detid, DetId &cached_detid, int16_t &cached_layer, TkLayerMap::XYbin &cached_XYbin) const
Definition: TkDetMap.cc:563
const TkDetMap * tkdetmap_
Definition: TkHistoMap.h:59
const TkLayerMap::XYbin & getXY(DetId detid, DetId &cached_detid, int16_t &cached_layer, TkLayerMap::XYbin &cached_XYbin) const
Definition: TkDetMap.cc:549

Member Data Documentation

DetId TkHistoMap::cached_detid
private

Definition at line 60 of file TkHistoMap.h.

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

int16_t TkHistoMap::cached_layer
private

Definition at line 61 of file TkHistoMap.h.

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

TkLayerMap::XYbin TkHistoMap::cached_XYbin
private

Definition at line 62 of file TkHistoMap.h.

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

DQMStore* TkHistoMap::dqmStore_ { 0 }
private

Definition at line 57 of file TkHistoMap.h.

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

int TkHistoMap::HistoNumber
private

Definition at line 64 of file TkHistoMap.h.

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

bool TkHistoMap::isTH2F_
private

Definition at line 66 of file TkHistoMap.h.

Referenced by createTkHistoMap(), and load().

std::string TkHistoMap::MapName_
private

Definition at line 65 of file TkHistoMap.h.

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

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