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)
 
 ~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)
 
void createTkHistoMap (DQMStore::IBooker &ibooker, const std::string &path, const std::string &MapName, float baseline, bool mechanicalView)
 
std::string folderDefinition (std::string path, const std::string &MapName, int layer, bool mechanicalView, std::string &fullName)
 

Private Attributes

DetId cached_detid
 
int16_t cached_layer
 
TkLayerMap::XYbin cached_XYbin
 
DQMStoredqmStore_
 
int HistoNumber
 
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 cached_detid, cached_layer, createTkHistoMap(), loadServices(), LogTrace, MapName_, and tkdetmap_.

29  :
30  HistoNumber(35),
31  MapName_(MapName)
32 {
33  cached_detid=0;
34  cached_layer=0;
35  LogTrace("TkHistoMap") <<"TkHistoMap::constructor with parameters";
36  loadServices();
37  tkdetmap_ = tkDetMap;
38  createTkHistoMap(ibooker , path,MapName_, baseline, mechanicalView);
39 }
void loadServices()
Definition: TkHistoMap.cc:41
DetId cached_detid
Definition: TkHistoMap.h:58
int16_t cached_layer
Definition: TkHistoMap.h:59
int HistoNumber
Definition: TkHistoMap.h:62
void createTkHistoMap(const std::string &path, const std::string &MapName, float baseline, bool mechanicalView)
Definition: TkHistoMap.cc:75
std::string MapName_
Definition: TkHistoMap.h:63
#define LogTrace(id)
const TkDetMap * tkdetmap_
Definition: TkHistoMap.h:57
TkHistoMap::TkHistoMap ( const TkDetMap tkDetMap,
const std::string &  path,
const std::string &  MapName,
float  baseline = 0,
bool  mechanicalView = false 
)

Definition at line 17 of file TkHistoMap.cc.

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

17  :
18  HistoNumber(35),
19  MapName_(MapName)
20 {
21  cached_detid=0;
22  cached_layer=0;
23  LogTrace("TkHistoMap") <<"TkHistoMap::constructor with parameters";
24  loadServices();
25  tkdetmap_ = tkDetMap;
26  createTkHistoMap(path,MapName_, baseline, mechanicalView);
27 }
void loadServices()
Definition: TkHistoMap.cc:41
DetId cached_detid
Definition: TkHistoMap.h:58
int16_t cached_layer
Definition: TkHistoMap.h:59
int HistoNumber
Definition: TkHistoMap.h:62
void createTkHistoMap(const std::string &path, const std::string &MapName, float baseline, bool mechanicalView)
Definition: TkHistoMap.cc:75
std::string MapName_
Definition: TkHistoMap.h:63
#define LogTrace(id)
const TkDetMap * tkdetmap_
Definition: TkHistoMap.h:57
TkHistoMap::TkHistoMap ( const TkDetMap tkDetMap)

Definition at line 6 of file TkHistoMap.cc.

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

6  :
7  HistoNumber(35){
8  cached_detid=0;
9  cached_layer=0;
10 
11  LogTrace("TkHistoMap") <<"TkHistoMap::constructor without parameters";
12  loadServices();
13  tkdetmap_ = tkDetMap;
14 }
void loadServices()
Definition: TkHistoMap.cc:41
DetId cached_detid
Definition: TkHistoMap.h:58
int16_t cached_layer
Definition: TkHistoMap.h:59
int HistoNumber
Definition: TkHistoMap.h:62
#define LogTrace(id)
const TkDetMap * tkdetmap_
Definition: TkHistoMap.h:57
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, TkDetMap::findLayer(), TkDetMap::getXY(), TkLayerMap::XYbin::ix, TkLayerMap::XYbin::iy, 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);
213  setBinContent(detid,tkHistoMap_[layer]->getTProfile2D()->GetBinContent(tkHistoMap_[layer]->getTProfile2D()->GetBin(xybin.ix,xybin.iy))+value);
214 
215 }
DetId cached_detid
Definition: TkHistoMap.h:58
void setBinContent(DetId detid, float value)
Definition: TkHistoMap.cc:190
int16_t cached_layer
Definition: TkHistoMap.h:59
std::vector< MonitorElement * > tkHistoMap_
Definition: TkHistoMap.h:61
TkLayerMap::XYbin cached_XYbin
Definition: TkHistoMap.h:60
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:57
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 75 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().

75  {
76 
77  int nchX;
78  int nchY;
79  double lowX,highX;
80  double lowY, highY;
81  std::string fullName, folder;
82 
83  tkHistoMap_.resize(HistoNumber);
84  for(int layer=1;layer<HistoNumber;++layer){
85  folder=folderDefinition(path,MapName,layer,mechanicalView,fullName);
86  tkdetmap_->getComponents(layer,nchX,lowX,highX,nchY,lowY,highY);
87  MonitorElement* me = dqmStore_->bookProfile2D(fullName.c_str(),fullName.c_str(),
88  nchX,lowX,highX,
89  nchY,lowY,highY,
90  0.0, 0.0);
91  //initialize bin content for the not assigned bins
92  if(baseline!=0){
93  for(size_t ix = 1; ix <= (unsigned int) nchX; ++ix)
94  for(size_t iy = 1;iy <= (unsigned int) nchY; ++iy)
95  if(!tkdetmap_->getDetFromBin(layer,ix,iy))
96  me->Fill(1.*(lowX+ix-.5),1.*(lowY+iy-.5),baseline);
97  }
98 
99  tkHistoMap_[layer]=me;
100 #ifdef debug_TkHistoMap
101  LogTrace("TkHistoMap") << "[TkHistoMap::createTkHistoMap] folder " << folder << " histoName " << fullName << " layer " << layer << " ptr " << tkHistoMap_[layer];
102 #endif
103  }
104 }
int HistoNumber
Definition: TkHistoMap.h:62
DQMStore * dqmStore_
Definition: TkHistoMap.h:56
std::vector< MonitorElement * > tkHistoMap_
Definition: TkHistoMap.h:61
void Fill(long long x)
std::string folderDefinition(std::string path, const std::string &MapName, int layer, bool mechanicalView, std::string &fullName)
Definition: TkHistoMap.cc:137
#define LogTrace(id)
void getComponents(int layer, int &nchX, double &lowX, double &highX, int &nchY, double &lowY, double &highY) const
Definition: TkDetMap.cc:581
const TkDetMap * tkdetmap_
Definition: TkHistoMap.h:57
DetId getDetFromBin(int layer, int ix, int iy) const
Definition: TkDetMap.h:139
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:1516
void TkHistoMap::createTkHistoMap ( DQMStore::IBooker ibooker,
const std::string &  path,
const std::string &  MapName,
float  baseline,
bool  mechanicalView 
)
private

Definition at line 106 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_.

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

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

228  {
229  for(int layer=1;layer<HistoNumber;++layer){
230  std::vector<DetId> dets = tkdetmap_->getDetsForLayer(layer);
231  for(size_t i=0;i<dets.size();++i){
232  if(dets[i]>0){
233  if(getEntries(dets[i])>0) {
234  tkmap->fill(dets[i],
235  dumpEntries ? getEntries(dets[i]) : getValue(dets[i])
236  );
237  }
238  }
239  }
240  }
241 }
int HistoNumber
Definition: TkHistoMap.h:62
std::vector< DetId > getDetsForLayer(int layer) const
Definition: TkDetMap.h:144
const TkDetMap * tkdetmap_
Definition: TkHistoMap.h:57
float getEntries(DetId detid)
Definition: TkHistoMap.cc:222
float getValue(DetId detid)
Definition: TkHistoMap.cc:217
void fill(int layer, int ring, int nmod, float x)
Definition: TrackerMap.cc:2786
void TkHistoMap::fill ( DetId  detid,
float  value 
)

Definition at line 174 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, DetId::rawId(), tkdetmap_, tkHistoMap_, TkLayerMap::XYbin::x, and TkLayerMap::XYbin::y.

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

174  {
175  int16_t layer=tkdetmap_->findLayer(detid , cached_detid , cached_layer , cached_XYbin);
177 #ifdef debug_TkHistoMap
178  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();
179 #endif
180  tkHistoMap_[layer]->getTProfile2D()->Fill(xybin.x,xybin.y,value);
181 
182 #ifdef debug_TkHistoMap
183  LogTrace("TkHistoMap") << "[TkHistoMap::fill] " << tkHistoMap_[layer]->getTProfile2D()->GetBinContent(xybin.ix,xybin.iy);
184  for(size_t ii=0;ii<4;ii++)
185  for(size_t jj=0;jj<11;jj++)
186  LogTrace("TkHistoMap") << "[TkHistoMap::fill] " << ii << " " << jj << " " << tkHistoMap_[layer]->getTProfile2D()->GetBinContent(ii,jj);
187 #endif
188 }
DetId cached_detid
Definition: TkHistoMap.h:58
int16_t cached_layer
Definition: TkHistoMap.h:59
std::vector< MonitorElement * > tkHistoMap_
Definition: TkHistoMap.h:61
uint32_t rawId() const
get the raw id
Definition: DetId.h:43
TkLayerMap::XYbin cached_XYbin
Definition: TkHistoMap.h:60
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:57
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 162 of file TkHistoMap.cc.

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

Referenced by getLayerNum().

162  {
163  std::ifstream file;
164  file.open(filename.c_str());
165  float value;
166  uint32_t detid;
167  while (file.good()){
168  file >> detid >> value;
169  fill(detid,value);
170  }
171  file.close();
172 }
void fill(DetId detid, float value)
Definition: TkHistoMap.cc:174
std::string TkHistoMap::folderDefinition ( std::string  path,
const std::string &  MapName,
int  layer,
bool  mechanicalView,
std::string &  fullName 
)
private

Definition at line 137 of file TkHistoMap.cc.

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

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

137  {
138 
139  std::string name = MapName+std::string("_");
140  fullName=name+TkDetMap::getLayerName(layer);
141  // std::cout << "[TkHistoMap::folderDefinition] fullName: " << fullName << std::endl;
142 
143  if(mechanicalView){
144  std::stringstream ss;
145 
146  SiStripFolderOrganizer folderOrg;
147  folderOrg.setSiStripFolderName(folder);
148 
150  uint32_t subdetlayer = 0, side = 0;
151  TkDetMap::getSubDetLayerSide(layer,subDet,subdetlayer,side);
152  folderOrg.getSubDetLayerFolderName(ss,subDet,subdetlayer,side);
153 
154  folder = ss.str();
155  // std::cout << "[TkHistoMap::folderDefinition] folder: " << folder << std::endl;
156  }
158  return folder;
159 }
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 * dqmStore_
Definition: TkHistoMap.h:56
void getSubDetLayerFolderName(std::stringstream &ss, SiStripDetId::SubDetector subDet, uint32_t layer, uint32_t side=0)
void setCurrentFolder(const std::string &fullpath)
Definition: DQMStore.cc:746
const std::vector<MonitorElement*>& TkHistoMap::getAllMaps ( ) const
inline

Definition at line 28 of file TkHistoMap.h.

References tkHistoMap_.

Referenced by BuildTrackerMapPlugin::subtractMap().

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

Definition at line 29 of file TkHistoMap.h.

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

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

Definition at line 33 of file TkHistoMap.h.

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

Referenced by getDetId().

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

Definition at line 34 of file TkHistoMap.h.

References TkDetMap::getDetFromBin(), and tkdetmap_.

34 {return tkdetmap_->getDetFromBin(layer,ix,iy);}
const TkDetMap * tkdetmap_
Definition: TkHistoMap.h:57
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 35 of file TkHistoMap.h.

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

Referenced by getDetId().

35 {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:33
float TkHistoMap::getEntries ( DetId  detid)

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

222  {
223  int16_t layer=tkdetmap_->findLayer(detid , cached_detid , cached_layer , cached_XYbin);
225  return tkHistoMap_[layer]->getTProfile2D()->GetBinEntries(tkHistoMap_[layer]->getTProfile2D()->GetBin(xybin.ix,xybin.iy));
226 }
DetId cached_detid
Definition: TkHistoMap.h:58
int16_t cached_layer
Definition: TkHistoMap.h:59
std::vector< MonitorElement * > tkHistoMap_
Definition: TkHistoMap.h:61
TkLayerMap::XYbin cached_XYbin
Definition: TkHistoMap.h:60
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:57
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 36 of file TkHistoMap.h.

References MapName_.

Referenced by getDetId().

36 {return title.erase(0,MapName_.size()+1);}
std::string MapName_
Definition: TkHistoMap.h:63
uint16_t TkHistoMap::getLayerNum ( const 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:61
float TkHistoMap::getValue ( DetId  detid)

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

217  {
218  int16_t layer=tkdetmap_->findLayer(detid , cached_detid , cached_layer , cached_XYbin);
220  return tkHistoMap_[layer]->getTProfile2D()->GetBinContent(tkHistoMap_[layer]->getTProfile2D()->GetBin(xybin.ix,xybin.iy));
221 }
DetId cached_detid
Definition: TkHistoMap.h:58
int16_t cached_layer
Definition: TkHistoMap.h:59
std::vector< MonitorElement * > tkHistoMap_
Definition: TkHistoMap.h:61
TkLayerMap::XYbin cached_XYbin
Definition: TkHistoMap.h:60
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:57
const TkLayerMap::XYbin & getXY(DetId detid, DetId &cached_detid, int16_t &cached_layer, TkLayerMap::XYbin &cached_XYbin) const
Definition: TkDetMap.cc:549
void TkHistoMap::loadServices ( )

Definition at line 41 of file TkHistoMap.cc.

References dqmStore_, and Utilities::operator.

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

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

Definition at line 56 of file TkHistoMap.cc.

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

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

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

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

52  {
54 }
DQMStore * dqmStore_
Definition: TkHistoMap.h:56
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:2702
void TkHistoMap::saveAsCanvas ( const std::string &  filename,
const std::string &  options = "",
const std::string &  mode = "RECREATE" 
)

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

245  {
246  // TCanvas C(MapName_,MapName_,200,10,900,700);
247  TCanvas* CTIB=new TCanvas(std::string("Canvas_"+MapName_+"TIB").c_str(),std::string("Canvas_"+MapName_+"TIB").c_str());
248  TCanvas* CTOB=new TCanvas(std::string("Canvas_"+MapName_+"TOB").c_str(),std::string("Canvas_"+MapName_+"TOB").c_str());
249  TCanvas* CTIDP=new TCanvas(std::string("Canvas_"+MapName_+"TIDP").c_str(),std::string("Canvas_"+MapName_+"TIDP").c_str());
250  TCanvas* CTIDM=new TCanvas(std::string("Canvas_"+MapName_+"TIDM").c_str(),std::string("Canvas_"+MapName_+"TIDM").c_str());
251  TCanvas* CTECP=new TCanvas(std::string("Canvas_"+MapName_+"TECP").c_str(),std::string("Canvas_"+MapName_+"TECP").c_str());
252  TCanvas* CTECM=new TCanvas(std::string("Canvas_"+MapName_+"TECM").c_str(),std::string("Canvas_"+MapName_+"TECM").c_str());
253  CTIB->Divide(2,2);
254  CTOB->Divide(2,3);
255  CTIDP->Divide(1,3);
256  CTIDM->Divide(1,3);
257  CTECP->Divide(3,3);
258  CTECM->Divide(3,3);
259 
260 
261  int i;
262  i=0;
263  CTIB->cd(++i);tkHistoMap_[TkLayerMap::TIB_L1]->getTProfile2D()->Draw(options.c_str());
264  CTIB->cd(++i);tkHistoMap_[TkLayerMap::TIB_L2]->getTProfile2D()->Draw(options.c_str());
265  CTIB->cd(++i);tkHistoMap_[TkLayerMap::TIB_L3]->getTProfile2D()->Draw(options.c_str());
266  CTIB->cd(++i);tkHistoMap_[TkLayerMap::TIB_L4]->getTProfile2D()->Draw(options.c_str());
267 
268  i=0;
269  CTIDP->cd(++i);tkHistoMap_[TkLayerMap::TIDP_D1]->getTProfile2D()->Draw(options.c_str());
270  CTIDP->cd(++i);tkHistoMap_[TkLayerMap::TIDP_D2]->getTProfile2D()->Draw(options.c_str());
271  CTIDP->cd(++i);tkHistoMap_[TkLayerMap::TIDP_D3]->getTProfile2D()->Draw(options.c_str());
272 
273  i=0;
274  CTIDM->cd(++i);tkHistoMap_[TkLayerMap::TIDM_D1]->getTProfile2D()->Draw(options.c_str());
275  CTIDM->cd(++i);tkHistoMap_[TkLayerMap::TIDM_D2]->getTProfile2D()->Draw(options.c_str());
276  CTIDM->cd(++i);tkHistoMap_[TkLayerMap::TIDM_D3]->getTProfile2D()->Draw(options.c_str());
277 
278  i=0;
279  CTOB->cd(++i);tkHistoMap_[TkLayerMap::TOB_L1]->getTProfile2D()->Draw(options.c_str());
280  CTOB->cd(++i);tkHistoMap_[TkLayerMap::TOB_L2]->getTProfile2D()->Draw(options.c_str());
281  CTOB->cd(++i);tkHistoMap_[TkLayerMap::TOB_L3]->getTProfile2D()->Draw(options.c_str());
282  CTOB->cd(++i);tkHistoMap_[TkLayerMap::TOB_L4]->getTProfile2D()->Draw(options.c_str());
283  CTOB->cd(++i);tkHistoMap_[TkLayerMap::TOB_L5]->getTProfile2D()->Draw(options.c_str());
284  CTOB->cd(++i);tkHistoMap_[TkLayerMap::TOB_L6]->getTProfile2D()->Draw(options.c_str());
285 
286  i=0;
287  CTECP->cd(++i);tkHistoMap_[TkLayerMap::TECP_W1]->getTProfile2D()->Draw(options.c_str());
288  CTECP->cd(++i);tkHistoMap_[TkLayerMap::TECP_W2]->getTProfile2D()->Draw(options.c_str());
289  CTECP->cd(++i);tkHistoMap_[TkLayerMap::TECP_W3]->getTProfile2D()->Draw(options.c_str());
290  CTECP->cd(++i);tkHistoMap_[TkLayerMap::TECP_W4]->getTProfile2D()->Draw(options.c_str());
291  CTECP->cd(++i);tkHistoMap_[TkLayerMap::TECP_W5]->getTProfile2D()->Draw(options.c_str());
292  CTECP->cd(++i);tkHistoMap_[TkLayerMap::TECP_W6]->getTProfile2D()->Draw(options.c_str());
293  CTECP->cd(++i);tkHistoMap_[TkLayerMap::TECP_W7]->getTProfile2D()->Draw(options.c_str());
294  CTECP->cd(++i);tkHistoMap_[TkLayerMap::TECP_W8]->getTProfile2D()->Draw(options.c_str());
295  CTECP->cd(++i);tkHistoMap_[TkLayerMap::TECP_W9]->getTProfile2D()->Draw(options.c_str());
296 
297  i=0;
298  CTECM->cd(++i);tkHistoMap_[TkLayerMap::TECM_W1]->getTProfile2D()->Draw(options.c_str());
299  CTECM->cd(++i);tkHistoMap_[TkLayerMap::TECM_W2]->getTProfile2D()->Draw(options.c_str());
300  CTECM->cd(++i);tkHistoMap_[TkLayerMap::TECM_W3]->getTProfile2D()->Draw(options.c_str());
301  CTECM->cd(++i);tkHistoMap_[TkLayerMap::TECM_W4]->getTProfile2D()->Draw(options.c_str());
302  CTECM->cd(++i);tkHistoMap_[TkLayerMap::TECM_W5]->getTProfile2D()->Draw(options.c_str());
303  CTECM->cd(++i);tkHistoMap_[TkLayerMap::TECM_W6]->getTProfile2D()->Draw(options.c_str());
304  CTECM->cd(++i);tkHistoMap_[TkLayerMap::TECM_W7]->getTProfile2D()->Draw(options.c_str());
305  CTECM->cd(++i);tkHistoMap_[TkLayerMap::TECM_W8]->getTProfile2D()->Draw(options.c_str());
306  CTECM->cd(++i);tkHistoMap_[TkLayerMap::TECM_W9]->getTProfile2D()->Draw(options.c_str());
307 
308  TFile *f = new TFile(filename.c_str(),mode.c_str());
309  CTIB->Write();
310  CTIDP->Write();
311  CTIDM->Write();
312  CTOB->Write();
313  CTECP->Write();
314  CTECM->Write();
315  f->Close();
316  delete f;
317 }
std::vector< MonitorElement * > tkHistoMap_
Definition: TkHistoMap.h:61
std::string MapName_
Definition: TkHistoMap.h:63
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, TkDetMap::findLayer(), TkDetMap::getXY(), cuy::ii, TkLayerMap::XYbin::ix, TkLayerMap::XYbin::iy, findQualityFiles::jj, 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);
193  tkHistoMap_[layer]->getTProfile2D()->SetBinEntries(tkHistoMap_[layer]->getTProfile2D()->GetBin(xybin.ix,xybin.iy),1);
194  tkHistoMap_[layer]->getTProfile2D()->SetBinContent(tkHistoMap_[layer]->getTProfile2D()->GetBin(xybin.ix,xybin.iy),value);
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:58
int16_t cached_layer
Definition: TkHistoMap.h:59
std::vector< MonitorElement * > tkHistoMap_
Definition: TkHistoMap.h:61
uint32_t rawId() const
get the raw id
Definition: DetId.h:43
TkLayerMap::XYbin cached_XYbin
Definition: TkHistoMap.h:60
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:57
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 58 of file TkHistoMap.h.

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

int16_t TkHistoMap::cached_layer
private

Definition at line 59 of file TkHistoMap.h.

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

TkLayerMap::XYbin TkHistoMap::cached_XYbin
private

Definition at line 60 of file TkHistoMap.h.

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

DQMStore* TkHistoMap::dqmStore_
private

Definition at line 56 of file TkHistoMap.h.

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

int TkHistoMap::HistoNumber
private

Definition at line 62 of file TkHistoMap.h.

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

std::string TkHistoMap::MapName_
private

Definition at line 63 of file TkHistoMap.h.

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

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