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 (const std::string &path, const std::string &MapName, float baseline, bool mechanicalView)
 
std::string folderDefinition (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
 
DQMStore::IBookeribooker_ { 0 }
 
DQMStore::IGetterigetter_ { 0 }
 
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 29 of file TkHistoMap.cc.

References load(), and LogTrace.

29  :
30  HistoNumber(35),
31  MapName_(MapName)
32 {
33  LogTrace("TkHistoMap") <<"TkHistoMap::constructor with parameters";
34  load(tkDetMap, path, baseline, mechanicalView, false);
35 }
void load(const TkDetMap *tkDetMap, const std::string &path, float baseline, bool mechanicalView, bool isTH2F, bool createTkMap=true)
Definition: TkHistoMap.cc:37
int HistoNumber
Definition: TkHistoMap.h:67
std::string MapName_
Definition: TkHistoMap.h:68
#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 load(), and LogTrace.

13  :
14  HistoNumber(35),
15  MapName_(MapName)
16 {
17  LogTrace("TkHistoMap") <<"TkHistoMap::constructor with parameters";
18  load(tkDetMap, path, baseline, mechanicalView, false);
19 }
void load(const TkDetMap *tkDetMap, const std::string &path, float baseline, bool mechanicalView, bool isTH2F, bool createTkMap=true)
Definition: TkHistoMap.cc:37
int HistoNumber
Definition: TkHistoMap.h:67
std::string MapName_
Definition: TkHistoMap.h:68
#define LogTrace(id)
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 load(), and LogTrace.

21  :
22  HistoNumber(35),
23  MapName_(MapName)
24 {
25  LogTrace("TkHistoMap") <<"TkHistoMap::constructor with parameters";
26  load(tkDetMap, path, baseline, mechanicalView, isTH2F);
27 }
void load(const TkDetMap *tkDetMap, const std::string &path, float baseline, bool mechanicalView, bool isTH2F, bool createTkMap=true)
Definition: TkHistoMap.cc:37
int HistoNumber
Definition: TkHistoMap.h:67
std::string MapName_
Definition: TkHistoMap.h:68
#define LogTrace(id)
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:37
int HistoNumber
Definition: TkHistoMap.h:67
double f[11][100]
#define LogTrace(id)
TkHistoMap::~TkHistoMap ( )
inline

Member Function Documentation

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

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

207  {
208 #ifdef debug_TkHistoMap
209  LogTrace("TkHistoMap") << "[TkHistoMap::add]";
210 #endif
211  int16_t layer=tkdetmap_->findLayer(detid , cached_detid , cached_layer , cached_XYbin);
214  setBinContent(detid,tkHistoMap_[layer]->getTProfile2D()->GetBinContent(tkHistoMap_[layer]->getTProfile2D()->GetBin(xybin.ix,xybin.iy))+value);
215  else if (tkHistoMap_[layer]->kind() == MonitorElement::DQM_KIND_TH2F)
216  setBinContent(detid,tkHistoMap_[layer]->getTH2F()->GetBinContent(tkHistoMap_[layer]->getTH2F()->GetBin(xybin.ix,xybin.iy))+value);
217 }
DetId cached_detid
Definition: TkHistoMap.h:63
void setBinContent(DetId detid, float value)
Definition: TkHistoMap.cc:185
int16_t cached_layer
Definition: TkHistoMap.h:64
std::vector< MonitorElement * > tkHistoMap_
Definition: TkHistoMap.h:66
TkLayerMap::XYbin cached_XYbin
Definition: TkHistoMap.h:65
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:62
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 ( const std::string &  path,
const std::string &  MapName,
float  baseline,
bool  mechanicalView 
)
private

Definition at line 86 of file TkHistoMap.cc.

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

Referenced by getLayerNum(), and load().

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

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

237  {
238  for(int layer=1;layer<HistoNumber;++layer){
239  // std::vector<uint32_t> dets;
240  // tkdetmap_->getDetsForLayer(layer,dets);
241  std::vector<DetId> dets = tkdetmap_->getDetsForLayer(layer);
242  for(size_t i=0;i<dets.size();++i){
243  if(dets[i]>0){
244  if(getEntries(dets[i])>0) {
245  tkmap->fill(dets[i],
246  dumpEntries ? getEntries(dets[i]) : getValue(dets[i]));
247  }
248  }
249  }
250  }
251 }
int HistoNumber
Definition: TkHistoMap.h:67
std::vector< DetId > getDetsForLayer(int layer) const
Definition: TkDetMap.h:144
const TkDetMap * tkdetmap_
Definition: TkHistoMap.h:62
float getEntries(DetId detid)
Definition: TkHistoMap.cc:228
float getValue(DetId detid)
Definition: TkHistoMap.cc:219
void fill(int layer, int ring, int nmod, float x)
Definition: TrackerMap.cc:2786
void TkHistoMap::fill ( DetId  detid,
float  value 
)

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

162  {
163  int16_t layer=tkdetmap_->findLayer(detid , cached_detid , cached_layer , cached_XYbin);
165 #ifdef debug_TkHistoMap
166  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();
167 #endif
169  tkHistoMap_[layer]->getTProfile2D()->Fill(xybin.x,xybin.y,value);
170  else if (tkHistoMap_[layer]->kind() == MonitorElement::DQM_KIND_TH2F)
171  tkHistoMap_[layer]->getTH2F()->Fill(xybin.x,xybin.y,value);
172 
173 #ifdef debug_TkHistoMap
174  LogTrace("TkHistoMap") << "[TkHistoMap::fill] " << tkHistoMap_[layer]->getTProfile2D()->GetBinContent(xybin.ix,xybin.iy);
175  for(size_t ii=0;ii<4;ii++)
176  for(size_t jj=0;jj<11;jj++){
178  LogTrace("TkHistoMap") << "[TkHistoMap::fill] " << ii << " " << jj << " " << tkHistoMap_[layer]->getTProfile2D()->GetBinContent(ii,jj);
180  LogTrace("TkHistoMap") << "[TkHistoMap::fill] " << ii << " " << jj << " " << tkHistoMap_[layer]->getTH2F()->GetBinContent(ii,jj);
181  }
182 #endif
183 }
DetId cached_detid
Definition: TkHistoMap.h:63
int16_t cached_layer
Definition: TkHistoMap.h:64
std::vector< MonitorElement * > tkHistoMap_
Definition: TkHistoMap.h:66
uint32_t rawId() const
get the raw id
Definition: DetId.h:44
TkLayerMap::XYbin cached_XYbin
Definition: TkHistoMap.h:65
Definition: value.py:1
#define LogTrace(id)
ii
Definition: cuy.py:588
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:62
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 150 of file TkHistoMap.cc.

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

Referenced by getLayerNum().

150  {
151  std::ifstream file;
152  file.open(filename.c_str());
153  float value;
154  uint32_t detid;
155  while (file.good()){
156  file >> detid >> value;
157  fill(detid,value);
158  }
159  file.close();
160 }
void fill(DetId detid, float value)
Definition: TkHistoMap.cc:162
std::string TkHistoMap::folderDefinition ( std::string  folder,
const std::string &  MapName,
int  layer,
bool  mechanicalView,
std::string &  fullName 
)
private

Definition at line 126 of file TkHistoMap.cc.

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

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

126  {
127 
128  std::string name = MapName+std::string("_");
129  fullName=name+TkDetMap::getLayerName(layer);
130  // std::cout << "[TkHistoMap::folderDefinition] fullName: " << fullName << std::endl;
131 
132  if(mechanicalView){
133  std::stringstream ss;
134 
135  SiStripFolderOrganizer folderOrg;
136  folderOrg.setSiStripFolderName(folder);
137 
139  uint32_t subdetlayer = 0, side = 0;
140  TkDetMap::getSubDetLayerSide(layer,subDet,subdetlayer,side);
141  folderOrg.getSubDetLayerFolderName(ss,subDet,subdetlayer,side);
142  folder = ss.str();
143  // std::cout << "[TkHistoMap::folderDefinition] folder: " << folder << std::endl;
144  }
146  return folder;
147 }
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
DQMStore::IBooker * ibooker_
Definition: TkHistoMap.h:58
void getSubDetLayerFolderName(std::stringstream &ss, SiStripDetId::SubDetector subDet, uint32_t layer, uint32_t side=0)
void setCurrentFolder(const std::string &fullpath)
Definition: DQMStore.cc:279
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:66
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:66
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:62
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 228 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().

228  {
229  int16_t layer=tkdetmap_->findLayer(detid , cached_detid , cached_layer , cached_XYbin);
232  return 1;
233  else
234  return tkHistoMap_[layer]->getTProfile2D()->GetBinEntries(tkHistoMap_[layer]->getTProfile2D()->GetBin(xybin.ix,xybin.iy));
235 }
DetId cached_detid
Definition: TkHistoMap.h:63
int16_t cached_layer
Definition: TkHistoMap.h:64
std::vector< MonitorElement * > tkHistoMap_
Definition: TkHistoMap.h:66
TkLayerMap::XYbin cached_XYbin
Definition: TkHistoMap.h:65
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:62
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:68
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:66
float TkHistoMap::getValue ( DetId  detid)

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

219  {
220  int16_t layer=tkdetmap_->findLayer(detid , cached_detid , cached_layer , cached_XYbin);
222 
224  return tkHistoMap_[layer]->getTH2F()->GetBinContent(tkHistoMap_[layer]->getTH2F()->GetBin(xybin.ix,xybin.iy));
225  else
226  return tkHistoMap_[layer]->getTProfile2D()->GetBinContent(tkHistoMap_[layer]->getTProfile2D()->GetBin(xybin.ix,xybin.iy));
227 }
DetId cached_detid
Definition: TkHistoMap.h:63
int16_t cached_layer
Definition: TkHistoMap.h:64
std::vector< MonitorElement * > tkHistoMap_
Definition: TkHistoMap.h:66
TkLayerMap::XYbin cached_XYbin
Definition: TkHistoMap.h:65
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:62
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 37 of file TkHistoMap.cc.

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

Referenced by getLayerNum(), and TkHistoMap().

38 {
39  cached_detid=0;
40  cached_layer=0;
41  loadServices();
42  tkdetmap_ = tkDetMap;
43  isTH2F_ = isTH2F;
44  if (createTkMap) createTkHistoMap(path, MapName_, baseline, mechanicalView);
45 }
void loadServices()
Definition: TkHistoMap.cc:47
DetId cached_detid
Definition: TkHistoMap.h:63
int16_t cached_layer
Definition: TkHistoMap.h:64
void createTkHistoMap(const std::string &path, const std::string &MapName, float baseline, bool mechanicalView)
Definition: TkHistoMap.cc:86
std::string MapName_
Definition: TkHistoMap.h:68
bool isTH2F_
Definition: TkHistoMap.h:69
const TkDetMap * tkdetmap_
Definition: TkHistoMap.h:62
void TkHistoMap::loadServices ( )

Definition at line 47 of file TkHistoMap.cc.

References b, dqmStore_, g, ibooker_, igetter_, DQMStore::meBookerGetter(), and Utilities::operator.

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

47  {
48  if(!edm::Service<DQMStore>().isAvailable()){
49  edm::LogError("TkHistoMap") <<
50  "\n------------------------------------------"
51  "\nUnAvailable Service DQMStore: please insert in the configuration file an instance like"
52  "\n\tprocess.load(\"DQMServices.Core.DQMStore_cfg\")"
53  "\n------------------------------------------";
54  }
57  this->ibooker_ = &b;
58  this->igetter_ = &g;
59  });
60 }
DQMStore * dqmStore_
Definition: TkHistoMap.h:57
DQMStore::IBooker * ibooker_
Definition: TkHistoMap.h:58
The Signals That Services Can Subscribe To This is based on ActivityRegistry and is current per Services can connect to the signals distributed by the ActivityRegistry in order to monitor the activity of the application Each possible callback has some defined which we here list in angle e g
Definition: Activities.doc:4
DQMStore::IGetter * igetter_
Definition: TkHistoMap.h:59
double b
Definition: hdecay.h:120
void meBookerGetter(iFunc f)
Definition: DQMStore.h:395
void TkHistoMap::loadTkHistoMap ( const std::string &  path,
const std::string &  MapName,
bool  mechanicalView = false 
)

Definition at line 67 of file TkHistoMap.cc.

References printsummarytable::folder, folderDefinition(), DQMStore::IGetter::get(), HistoNumber, igetter_, LogTrace, MapName_, AlCaHLTBitMon_QueryRunRegistry::string, and tkHistoMap_.

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

67  {
68  MapName_=MapName;
69  std::string fullName, folder;
70  tkHistoMap_.resize(HistoNumber);
71  for(int layer=1;layer<HistoNumber;++layer){
72  folder=folderDefinition(path, MapName_, layer, mechanicalView, fullName);
73 
74 #ifdef debug_TkHistoMap
75  LogTrace("TkHistoMap") << "[TkHistoMap::loadTkHistoMap] folder " << folder << " histoName " << fullName << " find " << folder.find_last_of("/") << " length " << folder.length();
76 #endif
77  if(folder.find_last_of("/")!=folder.length()-1)
78  folder+="/";
79  tkHistoMap_[layer]=igetter_->get(folder+fullName);
80 #ifdef debug_TkHistoMap
81  LogTrace("TkHistoMap") << "[TkHistoMap::loadTkHistoMap] folder " << folder << " histoName " << fullName << " layer " << layer << " ptr " << tkHistoMap_[layer] << " find " << folder.find_last_of("/") << " length " << folder.length();
82 #endif
83  }
84 }
std::string folderDefinition(std::string folder, const std::string &MapName, int layer, bool mechanicalView, std::string &fullName)
Definition: TkHistoMap.cc:126
MonitorElement * get(const std::string &path)
Definition: DQMStore.cc:307
int HistoNumber
Definition: TkHistoMap.h:67
std::vector< MonitorElement * > tkHistoMap_
Definition: TkHistoMap.h:66
std::string MapName_
Definition: TkHistoMap.h:68
#define LogTrace(id)
DQMStore::IGetter * igetter_
Definition: TkHistoMap.h:59
void TkHistoMap::save ( const std::string &  filename)

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

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

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

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

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

185  {
186  int16_t layer=tkdetmap_->findLayer(detid , cached_detid , cached_layer , cached_XYbin);
189  tkHistoMap_[layer]->getTProfile2D()->SetBinEntries(tkHistoMap_[layer]->getTProfile2D()->GetBin(xybin.ix,xybin.iy),1);
190  tkHistoMap_[layer]->getTProfile2D()->SetBinContent(tkHistoMap_[layer]->getTProfile2D()->GetBin(xybin.ix,xybin.iy),value);
191  }
192  else if (tkHistoMap_[layer]->kind() == MonitorElement::DQM_KIND_TH2F){
193  tkHistoMap_[layer]->getTH2F()->SetBinContent(xybin.ix,xybin.iy,value);
194  }
195 
196 #ifdef debug_TkHistoMap
197  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);
198 
199  LogTrace("TkHistoMap") << "[TkHistoMap::setbincontent] " << tkHistoMap_[layer]->getTProfile2D()->GetBinContent(xybin.ix,xybin.iy);
200  for(size_t ii=0;ii<4;ii++)
201  for(size_t jj=0;jj<11;jj++){
202  LogTrace("TkHistoMap") << "[TkHistoMap::setbincontent] " << ii << " " << jj << " " << tkHistoMap_[layer]->getTProfile2D()->GetBinContent(ii,jj);
203  }
204 #endif
205 }
DetId cached_detid
Definition: TkHistoMap.h:63
int16_t cached_layer
Definition: TkHistoMap.h:64
std::vector< MonitorElement * > tkHistoMap_
Definition: TkHistoMap.h:66
uint32_t rawId() const
get the raw id
Definition: DetId.h:44
TkLayerMap::XYbin cached_XYbin
Definition: TkHistoMap.h:65
Definition: value.py:1
#define LogTrace(id)
ii
Definition: cuy.py:588
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:62
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 63 of file TkHistoMap.h.

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

int16_t TkHistoMap::cached_layer
private

Definition at line 64 of file TkHistoMap.h.

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

TkLayerMap::XYbin TkHistoMap::cached_XYbin
private

Definition at line 65 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(), and save().

int TkHistoMap::HistoNumber
private

Definition at line 67 of file TkHistoMap.h.

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

DQMStore::IBooker* TkHistoMap::ibooker_ { 0 }
private

Definition at line 58 of file TkHistoMap.h.

Referenced by createTkHistoMap(), folderDefinition(), and loadServices().

DQMStore::IGetter* TkHistoMap::igetter_ { 0 }
private

Definition at line 59 of file TkHistoMap.h.

Referenced by loadServices(), and loadTkHistoMap().

bool TkHistoMap::isTH2F_
private

Definition at line 69 of file TkHistoMap.h.

Referenced by createTkHistoMap(), and load().

std::string TkHistoMap::MapName_
private

Definition at line 68 of file TkHistoMap.h.

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

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