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

Private Types

typedef std::vector< MonitorElement * > tkHistoMapVect
 

Private Member Functions

void createTkHistoMap (std::string &path, std::string &MapName, float &baseline, bool mechanicalView)
 
void createTkHistoMap (DQMStore::IBooker &ibooker, std::string &path, std::string &MapName, float &baseline, bool mechanicalView)
 
std::string folderDefinition (std::string &path, std::string &MapName, int layer, bool mechanicalView, std::string &fullName)
 

Private Attributes

uint32_t cached_detid
 
int16_t cached_layer
 
TkLayerMap::XYbin cached_XYbin
 
DQMStoredqmStore_
 
int HistoNumber
 
std::string MapName_
 
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 ( DQMStore::IBooker ibooker,
std::string  path,
std::string  MapName,
float  baseline = 0,
bool  mechanicalView = false 
)

Definition at line 27 of file TkHistoMap.cc.

References cached_detid, cached_layer, createTkHistoMap(), loadServices(), LogTrace, and MapName_.

27  :
28  HistoNumber(35),
29  MapName_(MapName)
30 {
31  cached_detid=0;
32  cached_layer=0;
33  LogTrace("TkHistoMap") <<"TkHistoMap::constructor with parameters";
34  loadServices();
35  createTkHistoMap(ibooker , path,MapName_, baseline, mechanicalView);
36 }
void loadServices()
Definition: TkHistoMap.cc:38
uint32_t cached_detid
Definition: TkHistoMap.h:57
int16_t cached_layer
Definition: TkHistoMap.h:58
int HistoNumber
Definition: TkHistoMap.h:61
std::string MapName_
Definition: TkHistoMap.h:62
void createTkHistoMap(std::string &path, std::string &MapName, float &baseline, bool mechanicalView)
Definition: TkHistoMap.cc:80
#define LogTrace(id)
TkHistoMap::TkHistoMap ( std::string  path,
std::string  MapName,
float  baseline = 0,
bool  mechanicalView = false 
)

Definition at line 16 of file TkHistoMap.cc.

References cached_detid, cached_layer, createTkHistoMap(), loadServices(), LogTrace, and MapName_.

16  :
17  HistoNumber(35),
18  MapName_(MapName)
19 {
20  cached_detid=0;
21  cached_layer=0;
22  LogTrace("TkHistoMap") <<"TkHistoMap::constructor with parameters";
23  loadServices();
24  createTkHistoMap(path,MapName_, baseline, mechanicalView);
25 }
void loadServices()
Definition: TkHistoMap.cc:38
uint32_t cached_detid
Definition: TkHistoMap.h:57
int16_t cached_layer
Definition: TkHistoMap.h:58
int HistoNumber
Definition: TkHistoMap.h:61
std::string MapName_
Definition: TkHistoMap.h:62
void createTkHistoMap(std::string &path, std::string &MapName, float &baseline, bool mechanicalView)
Definition: TkHistoMap.cc:80
#define LogTrace(id)
TkHistoMap::TkHistoMap ( )

Definition at line 6 of file TkHistoMap.cc.

References cached_detid, cached_layer, loadServices(), and LogTrace.

6  :
7  HistoNumber(35){
8  cached_detid=0;
9  cached_layer=0;
10 
11  LogTrace("TkHistoMap") <<"TkHistoMap::constructor without parameters";
12  loadServices();
13 }
void loadServices()
Definition: TkHistoMap.cc:38
uint32_t cached_detid
Definition: TkHistoMap.h:57
int16_t cached_layer
Definition: TkHistoMap.h:58
int HistoNumber
Definition: TkHistoMap.h:61
#define LogTrace(id)
TkHistoMap::~TkHistoMap ( )
inline

Member Function Documentation

void TkHistoMap::add ( uint32_t &  detid,
float  value 
)

Definition at line 213 of file TkHistoMap.cc.

References cached_detid, cached_layer, cached_XYbin, TkDetMap::FindLayer(), TkDetMap::getXY(), TkLayerMap::XYbin::ix, TkLayerMap::XYbin::iy, LogTrace, setBinContent(), tkdetmap_, and tkHistoMap_.

Referenced by DetIdSelectorTest::analyze(), APVShotsAnalyzer::analyze(), SiStripMonitorTrack::clusterInfos(), getLayerNum(), counter.Counter::register(), SequenceTypes.Task::remove(), SequenceTypes.Task::replace(), SiStripMonitorTrack::trackStudyFromTrack(), and SiStripMonitorTrack::trajectoryStudy().

213  {
214 #ifdef debug_TkHistoMap
215  LogTrace("TkHistoMap") << "[TkHistoMap::add]";
216 #endif
217  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 
221 }
uint32_t cached_detid
Definition: TkHistoMap.h:57
int16_t cached_layer
Definition: TkHistoMap.h:58
std::vector< MonitorElement * > tkHistoMap_
Definition: TkHistoMap.h:60
TkLayerMap::XYbin cached_XYbin
Definition: TkHistoMap.h:59
TkDetMap * tkdetmap_
Definition: TkHistoMap.h:56
Definition: value.py:1
#define LogTrace(id)
void setBinContent(uint32_t &detid, float value)
Definition: TkHistoMap.cc:196
int16_t FindLayer(uint32_t &detid, uint32_t &cached_detid, int16_t &cached_layer, TkLayerMap::XYbin &cached_XYbin) const
Definition: TkDetMap.cc:664
const TkLayerMap::XYbin & getXY(uint32_t &, uint32_t &cached_detid, int16_t &cached_layer, TkLayerMap::XYbin &cached_XYbin) const
Definition: TkDetMap.cc:652
void TkHistoMap::createTkHistoMap ( std::string &  path,
std::string &  MapName,
float &  baseline,
bool  mechanicalView 
)
private

Definition at line 80 of file TkHistoMap.cc.

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

Referenced by getLayerNum(), and TkHistoMap().

80  {
81 
82  int nchX;
83  int nchY;
84  double lowX,highX;
85  double lowY, highY;
86  std::string fullName, folder;
87 
88  tkHistoMap_.resize(HistoNumber);
89  for(int layer=1;layer<HistoNumber;++layer){
90  folder=folderDefinition(path,MapName,layer,mechanicalView,fullName);
91  tkdetmap_->getComponents(layer,nchX,lowX,highX,nchY,lowY,highY);
92  MonitorElement* me = dqmStore_->bookProfile2D(fullName.c_str(),fullName.c_str(),
93  nchX,lowX,highX,
94  nchY,lowY,highY,
95  0.0, 0.0);
96  //initialize bin content for the not assigned bins
97  if(baseline!=0){
98  for(size_t ix = 1; ix <= (unsigned int) nchX; ++ix)
99  for(size_t iy = 1;iy <= (unsigned int) nchY; ++iy)
100  if(!tkdetmap_->getDetFromBin(layer,ix,iy))
101  me->Fill(1.*(lowX+ix-.5),1.*(lowY+iy-.5),baseline);
102  }
103 
104  tkHistoMap_[layer]=me;
105 #ifdef debug_TkHistoMap
106  LogTrace("TkHistoMap") << "[TkHistoMap::createTkHistoMap] folder " << folder << " histoName " << fullName << " layer " << layer << " ptr " << tkHistoMap_[layer];
107 #endif
108  }
109 }
int HistoNumber
Definition: TkHistoMap.h:61
DQMStore * dqmStore_
Definition: TkHistoMap.h:55
std::vector< MonitorElement * > tkHistoMap_
Definition: TkHistoMap.h:60
void Fill(long long x)
uint32_t getDetFromBin(int layer, int ix, int iy) const
Definition: TkDetMap.h:128
TkDetMap * tkdetmap_
Definition: TkHistoMap.h:56
#define LogTrace(id)
void getComponents(int layer, int &nchX, double &lowX, double &highX, int &nchY, double &lowY, double &highY) const
Definition: TkDetMap.cc:684
std::string folderDefinition(std::string &path, std::string &MapName, int layer, bool mechanicalView, std::string &fullName)
Definition: TkHistoMap.cc:142
MonitorElement * bookProfile2D(const char *name, const char *title, int nchX, double lowX, double highX, int nchY, double lowY, double highY, int nchZ, double lowZ, double highZ, const char *option="s")
Definition: DQMStore.cc:1492
void TkHistoMap::createTkHistoMap ( DQMStore::IBooker ibooker,
std::string &  path,
std::string &  MapName,
float &  baseline,
bool  mechanicalView 
)
private

Definition at line 111 of file TkHistoMap.cc.

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

111  {
112 
113  int nchX;
114  int nchY;
115  double lowX,highX;
116  double lowY, highY;
117  std::string fullName, folder;
118 
119  tkHistoMap_.resize(HistoNumber);
120  for(int layer=1;layer<HistoNumber;++layer){
121  folder=folderDefinition(path,MapName,layer,mechanicalView,fullName);
122  tkdetmap_->getComponents(layer,nchX,lowX,highX,nchY,lowY,highY);
123  MonitorElement* me = ibooker.bookProfile2D(fullName.c_str(),fullName.c_str(),
124  nchX,lowX,highX,
125  nchY,lowY,highY,
126  0.0, 0.0);
127  //initialize bin content for the not assigned bins
128  if(baseline!=0){
129  for(size_t ix = 1; ix <= (unsigned int) nchX; ++ix)
130  for(size_t iy = 1;iy <= (unsigned int) nchY; ++iy)
131  if(!tkdetmap_->getDetFromBin(layer,ix,iy))
132  me->Fill(1.*(lowX+ix-.5),1.*(lowY+iy-.5),baseline);
133  }
134 
135  tkHistoMap_[layer]=me;
136 #ifdef debug_TkHistoMap
137  LogTrace("TkHistoMap") << "[TkHistoMap::createTkHistoMap] folder " << folder << " histoName " << fullName << " layer " << layer << " ptr " << tkHistoMap_[layer];
138 #endif
139  }
140 }
int HistoNumber
Definition: TkHistoMap.h:61
std::vector< MonitorElement * > tkHistoMap_
Definition: TkHistoMap.h:60
void Fill(long long x)
uint32_t getDetFromBin(int layer, int ix, int iy) const
Definition: TkDetMap.h:128
MonitorElement * bookProfile2D(Args &&...args)
Definition: DQMStore.h:163
TkDetMap * tkdetmap_
Definition: TkHistoMap.h:56
#define LogTrace(id)
void getComponents(int layer, int &nchX, double &lowX, double &highX, int &nchY, double &lowY, double &highY) const
Definition: TkDetMap.cc:684
std::string folderDefinition(std::string &path, std::string &MapName, int layer, bool mechanicalView, std::string &fullName)
Definition: TkHistoMap.cc:142
void TkHistoMap::dumpInTkMap ( TrackerMap tkmap,
bool  dumpEntries = false 
)

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

234  {
235  for(int layer=1;layer<HistoNumber;++layer){
236  std::vector<uint32_t> dets;
237  tkdetmap_->getDetsForLayer(layer,dets);
238  for(size_t i=0;i<dets.size();++i){
239  if(dets[i]>0){
240  if(getEntries(dets[i])>0) {
241  tkmap->fill(dets[i],
242  dumpEntries ? getEntries(dets[i]) : getValue(dets[i])
243  );
244  }
245  }
246  }
247  }
248 }
int HistoNumber
Definition: TkHistoMap.h:61
float getEntries(uint32_t &detid)
Definition: TkHistoMap.cc:228
float getValue(uint32_t &detid)
Definition: TkHistoMap.cc:223
TkDetMap * tkdetmap_
Definition: TkHistoMap.h:56
void getDetsForLayer(int layer, std::vector< uint32_t > &output) const
Definition: TkDetMap.cc:695
void fill(int layer, int ring, int nmod, float x)
Definition: TrackerMap.cc:2778
void TkHistoMap::fill ( uint32_t &  detid,
float  value 
)

Definition at line 180 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, LogTrace, tkdetmap_, tkHistoMap_, TkLayerMap::XYbin::x, and TkLayerMap::XYbin::y.

Referenced by SiStripDetVOffTkMapPlotter::analyze(), SiStripQualityStatistics::analyze(), SiStripMonitorDigi::analyze(), SiStripMonitorCluster::analyze(), APVShotsAnalyzer::analyze(), TkVoltageMapCreator::beginRun(), SiStripMonitorTrack::clusterInfos(), SiStripMonitorDigi::FillApvShotsMap(), fillFromAscii(), SiStripNoisesDQM::fillMEsForLayer(), SiStripPedestalsDQM::fillMEsForLayer(), SiStripThresholdDQM::fillMEsForLayer(), SiStripBackPlaneCorrectionDQM::fillMEsForLayer(), SiStripLorentzAngleDQM::fillMEsForLayer(), SiStripCablingDQM::getActiveDetIds(), and getLayerNum().

180  {
181  int16_t layer=tkdetmap_->FindLayer(detid , cached_detid , cached_layer , cached_XYbin);
183 #ifdef debug_TkHistoMap
184  LogTrace("TkHistoMap") << "[TkHistoMap::fill] Fill detid " << detid << " Layer " << layer << " value " << value << " ix,iy " << xybin.ix << " " << xybin.iy << " " << xybin.x << " " << xybin.y << " " << tkHistoMap_[layer]->getTProfile2D()->GetName();
185 #endif
186  tkHistoMap_[layer]->getTProfile2D()->Fill(xybin.x,xybin.y,value);
187 
188 #ifdef debug_TkHistoMap
189  LogTrace("TkHistoMap") << "[TkHistoMap::fill] " << tkHistoMap_[layer]->getTProfile2D()->GetBinContent(xybin.ix,xybin.iy);
190  for(size_t ii=0;ii<4;ii++)
191  for(size_t jj=0;jj<11;jj++)
192  LogTrace("TkHistoMap") << "[TkHistoMap::fill] " << ii << " " << jj << " " << tkHistoMap_[layer]->getTProfile2D()->GetBinContent(ii,jj);
193 #endif
194 }
uint32_t cached_detid
Definition: TkHistoMap.h:57
int16_t cached_layer
Definition: TkHistoMap.h:58
std::vector< MonitorElement * > tkHistoMap_
Definition: TkHistoMap.h:60
TkLayerMap::XYbin cached_XYbin
Definition: TkHistoMap.h:59
TkDetMap * tkdetmap_
Definition: TkHistoMap.h:56
Definition: value.py:1
#define LogTrace(id)
ii
Definition: cuy.py:588
int16_t FindLayer(uint32_t &detid, uint32_t &cached_detid, int16_t &cached_layer, TkLayerMap::XYbin &cached_XYbin) const
Definition: TkDetMap.cc:664
const TkLayerMap::XYbin & getXY(uint32_t &, uint32_t &cached_detid, int16_t &cached_layer, TkLayerMap::XYbin &cached_XYbin) const
Definition: TkDetMap.cc:652
void TkHistoMap::fillFromAscii ( std::string  filename)

Definition at line 168 of file TkHistoMap.cc.

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

Referenced by getLayerNum().

168  {
169  std::ifstream file;
170  file.open(filename.c_str());
171  float value;
172  uint32_t detid;
173  while (file.good()){
174  file >> detid >> value;
175  fill(detid,value);
176  }
177  file.close();
178 }
void fill(uint32_t &detid, float value)
Definition: TkHistoMap.cc:180
std::string TkHistoMap::folderDefinition ( std::string &  path,
std::string &  MapName,
int  layer,
bool  mechanicalView,
std::string &  fullName 
)
private

Definition at line 142 of file TkHistoMap.cc.

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

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

142  {
143 
145  std::string name=MapName+std::string("_");
146  fullName=name+tkdetmap_->getLayerName(layer);
147  // std::cout << "[TkHistoMap::folderDefinition] fullName: " << fullName << std::endl;
148 
149  if(mechanicalView){
150  std::stringstream ss;
151 
152  SiStripFolderOrganizer folderOrg;
153  folderOrg.setSiStripFolderName(path);
154 
156  uint32_t subdetlayer = 0, side = 0;
157  tkdetmap_->getSubDetLayerSide(layer,subDet,subdetlayer,side);
158  folderOrg.getSubDetLayerFolderName(ss,subDet,subdetlayer,side);
159 
160  folder = ss.str();
161  // std::cout << "[TkHistoMap::folderDefinition] folder: " << folder << std::endl;
162  }
163  dqmStore_->setCurrentFolder(folder);
164  return folder;
165 }
void setSiStripFolderName(std::string name)
DQMStore * dqmStore_
Definition: TkHistoMap.h:55
void getSubDetLayerFolderName(std::stringstream &ss, SiStripDetId::SubDetector subDet, uint32_t layer, uint32_t side=0)
void getSubDetLayerSide(int &in, SiStripDetId::SubDetector &, uint32_t &layer, uint32_t &side) const
Definition: TkDetMap.cc:849
std::string getLayerName(int &in) const
Definition: TkDetMap.cc:702
TkDetMap * tkdetmap_
Definition: TkHistoMap.h:56
void setCurrentFolder(const std::string &fullpath)
Definition: DQMStore.cc:740
std::vector<MonitorElement*>& TkHistoMap::getAllMaps ( )
inline

Definition at line 28 of file TkHistoMap.h.

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

Referenced by BuildTrackerMapPlugin::subtractMap().

28 {return tkHistoMap_;};
std::vector< MonitorElement * > tkHistoMap_
Definition: TkHistoMap.h:60
uint32_t TkHistoMap::getDetId ( std::string  title,
int  ix,
int  iy 
)
inline

Definition at line 32 of file TkHistoMap.h.

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

Referenced by getDetId().

32 {return getDetId(getLayerNum(getLayerName(title)),ix,iy);}
std::string getLayerName(std::string title)
Definition: TkHistoMap.h:35
uint16_t getLayerNum(std::string layerName)
Definition: TkHistoMap.h:36
uint32_t getDetId(std::string title, int ix, int iy)
Definition: TkHistoMap.h:32
uint32_t TkHistoMap::getDetId ( int  layer,
int  ix,
int  iy 
)
inline

Definition at line 33 of file TkHistoMap.h.

References TkDetMap::getDetFromBin(), and tkdetmap_.

33 {return tkdetmap_->getDetFromBin(layer,ix,iy);}
uint32_t getDetFromBin(int layer, int ix, int iy) const
Definition: TkDetMap.h:128
TkDetMap * tkdetmap_
Definition: TkHistoMap.h:56
uint32_t TkHistoMap::getDetId ( MonitorElement ME,
int  ix,
int  iy 
)
inline

Definition at line 34 of file TkHistoMap.h.

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

Referenced by getDetId().

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

Definition at line 228 of file TkHistoMap.cc.

References cached_detid, cached_layer, cached_XYbin, TkDetMap::FindLayer(), TkDetMap::getXY(), TkLayerMap::XYbin::ix, TkLayerMap::XYbin::iy, tkdetmap_, and tkHistoMap_.

Referenced by dumpInTkMap(), and getAllMaps().

228  {
229  int16_t layer=tkdetmap_->FindLayer(detid , cached_detid , cached_layer , cached_XYbin);
231  return tkHistoMap_[layer]->getTProfile2D()->GetBinEntries(tkHistoMap_[layer]->getTProfile2D()->GetBin(xybin.ix,xybin.iy));
232 }
uint32_t cached_detid
Definition: TkHistoMap.h:57
int16_t cached_layer
Definition: TkHistoMap.h:58
std::vector< MonitorElement * > tkHistoMap_
Definition: TkHistoMap.h:60
TkLayerMap::XYbin cached_XYbin
Definition: TkHistoMap.h:59
TkDetMap * tkdetmap_
Definition: TkHistoMap.h:56
int16_t FindLayer(uint32_t &detid, uint32_t &cached_detid, int16_t &cached_layer, TkLayerMap::XYbin &cached_XYbin) const
Definition: TkDetMap.cc:664
const TkLayerMap::XYbin & getXY(uint32_t &, uint32_t &cached_detid, int16_t &cached_layer, TkLayerMap::XYbin &cached_XYbin) const
Definition: TkDetMap.cc:652
std::string TkHistoMap::getLayerName ( std::string  title)
inline

Definition at line 35 of file TkHistoMap.h.

References MapName_.

Referenced by getDetId().

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

Definition at line 27 of file TkHistoMap.h.

References tkHistoMap_.

27 {return tkHistoMap_[layerNumber];};
std::vector< MonitorElement * > tkHistoMap_
Definition: TkHistoMap.h:60
float TkHistoMap::getValue ( uint32_t &  detid)

Definition at line 223 of file TkHistoMap.cc.

References cached_detid, cached_layer, cached_XYbin, TkDetMap::FindLayer(), TkDetMap::getXY(), TkLayerMap::XYbin::ix, TkLayerMap::XYbin::iy, tkdetmap_, and tkHistoMap_.

Referenced by dumpInTkMap(), and getAllMaps().

223  {
224  int16_t layer=tkdetmap_->FindLayer(detid , cached_detid , cached_layer , cached_XYbin);
226  return tkHistoMap_[layer]->getTProfile2D()->GetBinContent(tkHistoMap_[layer]->getTProfile2D()->GetBin(xybin.ix,xybin.iy));
227 }
uint32_t cached_detid
Definition: TkHistoMap.h:57
int16_t cached_layer
Definition: TkHistoMap.h:58
std::vector< MonitorElement * > tkHistoMap_
Definition: TkHistoMap.h:60
TkLayerMap::XYbin cached_XYbin
Definition: TkHistoMap.h:59
TkDetMap * tkdetmap_
Definition: TkHistoMap.h:56
int16_t FindLayer(uint32_t &detid, uint32_t &cached_detid, int16_t &cached_layer, TkLayerMap::XYbin &cached_XYbin) const
Definition: TkDetMap.cc:664
const TkLayerMap::XYbin & getXY(uint32_t &, uint32_t &cached_detid, int16_t &cached_layer, TkLayerMap::XYbin &cached_XYbin) const
Definition: TkDetMap.cc:652
void TkHistoMap::loadServices ( )

Definition at line 38 of file TkHistoMap.cc.

References dqmStore_, Utilities::operator, and tkdetmap_.

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

38  {
39  if(!edm::Service<DQMStore>().isAvailable()){
40  edm::LogError("TkHistoMap") <<
41  "\n------------------------------------------"
42  "\nUnAvailable Service DQMStore: please insert in the configuration file an instance like"
43  "\n\tprocess.load(\"DQMServices.Core.DQMStore_cfg\")"
44  "\n------------------------------------------";
45  }
47  if(!edm::Service<TkDetMap>().isAvailable()){
48  edm::LogError("TkHistoMap") <<
49  "\n------------------------------------------"
50  "\nUnAvailable Service TkHistoMap: please insert in the configuration file an instance like"
51  "\n\tprocess.TkDetMap = cms.Service(\"TkDetMap\")"
52  "\n------------------------------------------";
53  }
55 }
DQMStore * dqmStore_
Definition: TkHistoMap.h:55
TkDetMap * tkdetmap_
Definition: TkHistoMap.h:56
void TkHistoMap::loadTkHistoMap ( std::string  path,
std::string  MapName,
bool  mechanicalView = false 
)

Definition at line 61 of file TkHistoMap.cc.

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

Referenced by ~TkHistoMap().

61  {
62  MapName_=MapName;
63  std::string fullName, folder;
64  tkHistoMap_.resize(HistoNumber);
65  for(int layer=1;layer<HistoNumber;++layer){
66  folder=folderDefinition(path,MapName_,layer,mechanicalView,fullName);
67 
68 #ifdef debug_TkHistoMap
69  LogTrace("TkHistoMap") << "[TkHistoMap::loadTkHistoMap] folder " << folder << " histoName " << fullName << " find " << folder.find_last_of("/") << " length " << folder.length();
70 #endif
71  if(folder.find_last_of("/")!=folder.length()-1)
72  folder+="/";
73  tkHistoMap_[layer]=dqmStore_->get(folder+fullName);
74 #ifdef debug_TkHistoMap
75  LogTrace("TkHistoMap") << "[TkHistoMap::loadTkHistoMap] folder " << folder << " histoName " << fullName << " layer " << layer << " ptr " << tkHistoMap_[layer] << " find " << folder.find_last_of("/") << " length " << folder.length();
76 #endif
77  }
78 }
int HistoNumber
Definition: TkHistoMap.h:61
DQMStore * dqmStore_
Definition: TkHistoMap.h:55
std::vector< MonitorElement * > tkHistoMap_
Definition: TkHistoMap.h:60
std::string MapName_
Definition: TkHistoMap.h:62
MonitorElement * get(const std::string &path) const
get ME from full pathname (e.g. "my/long/dir/my_histo")
Definition: DQMStore.cc:1788
#define LogTrace(id)
std::string folderDefinition(std::string &path, std::string &MapName, int layer, bool mechanicalView, std::string &fullName)
Definition: TkHistoMap.cc:142
void TkHistoMap::save ( std::string  filename)

Definition at line 57 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(), SiStripQualityStatistics::endJob(), DetIdSelectorTest::endJob(), and getLayerNum().

57  {
59 }
DQMStore * dqmStore_
Definition: TkHistoMap.h:55
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", const bool resetMEsAfterWriting=false)
Definition: DQMStore.cc:2649
void TkHistoMap::saveAsCanvas ( std::string  filename,
std::string  options = "",
std::string  mode = "RECREATE" 
)

Definition at line 252 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 SiStripQualityStatistics::endJob(), and getLayerNum().

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

Definition at line 196 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, LogTrace, tkdetmap_, tkHistoMap_, TkLayerMap::XYbin::x, and TkLayerMap::XYbin::y.

Referenced by add(), SiStripApvGainsDQM::fillMEsForLayer(), SiStripQualityDQM::fillMEsForLayer(), and getLayerNum().

196  {
197  int16_t layer=tkdetmap_->FindLayer(detid , cached_detid , cached_layer , cached_XYbin);
199  tkHistoMap_[layer]->getTProfile2D()->SetBinEntries(tkHistoMap_[layer]->getTProfile2D()->GetBin(xybin.ix,xybin.iy),1);
200  tkHistoMap_[layer]->getTProfile2D()->SetBinContent(tkHistoMap_[layer]->getTProfile2D()->GetBin(xybin.ix,xybin.iy),value);
201 
202 #ifdef debug_TkHistoMap
203  LogTrace("TkHistoMap") << "[TkHistoMap::setbincontent] setBinContent detid " << detid << " 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);
204 
205  LogTrace("TkHistoMap") << "[TkHistoMap::setbincontent] " << tkHistoMap_[layer]->getTProfile2D()->GetBinContent(xybin.ix,xybin.iy);
206  for(size_t ii=0;ii<4;ii++)
207  for(size_t jj=0;jj<11;jj++){
208  LogTrace("TkHistoMap") << "[TkHistoMap::setbincontent] " << ii << " " << jj << " " << tkHistoMap_[layer]->getTProfile2D()->GetBinContent(ii,jj);
209  }
210 #endif
211 }
uint32_t cached_detid
Definition: TkHistoMap.h:57
int16_t cached_layer
Definition: TkHistoMap.h:58
std::vector< MonitorElement * > tkHistoMap_
Definition: TkHistoMap.h:60
TkLayerMap::XYbin cached_XYbin
Definition: TkHistoMap.h:59
TkDetMap * tkdetmap_
Definition: TkHistoMap.h:56
Definition: value.py:1
#define LogTrace(id)
ii
Definition: cuy.py:588
int16_t FindLayer(uint32_t &detid, uint32_t &cached_detid, int16_t &cached_layer, TkLayerMap::XYbin &cached_XYbin) const
Definition: TkDetMap.cc:664
const TkLayerMap::XYbin & getXY(uint32_t &, uint32_t &cached_detid, int16_t &cached_layer, TkLayerMap::XYbin &cached_XYbin) const
Definition: TkDetMap.cc:652

Member Data Documentation

uint32_t TkHistoMap::cached_detid
private

Definition at line 57 of file TkHistoMap.h.

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

int16_t TkHistoMap::cached_layer
private

Definition at line 58 of file TkHistoMap.h.

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

TkLayerMap::XYbin TkHistoMap::cached_XYbin
private

Definition at line 59 of file TkHistoMap.h.

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

DQMStore* TkHistoMap::dqmStore_
private

Definition at line 55 of file TkHistoMap.h.

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

int TkHistoMap::HistoNumber
private

Definition at line 61 of file TkHistoMap.h.

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

std::string TkHistoMap::MapName_
private

Definition at line 62 of file TkHistoMap.h.

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

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