19 "\n------------------------------------------"
20 "\nUnAvailable Service TkHistoMap: please insert in the configuration file an instance like"
21 "\n\tprocess.TkDetMap = cms.Service(\"TkDetMap\")"
22 "\n------------------------------------------";
40 std::string tmap_title =
" Tracker Map from " + map_type;
47 if (map_type ==
"QTestAlarm") {
49 const std::vector<uint16_t>& feds = fedcabling->feds();
50 uint32_t detId_save = 0;
51 for(std::vector<unsigned short>::const_iterator ifed = feds.begin();
52 ifed < feds.end(); ifed++){
53 const std::vector<FedChannelConnection> fedChannels = fedcabling->connections( *ifed );
54 for(std::vector<FedChannelConnection>::const_iterator iconn = fedChannels.begin(); iconn < fedChannels.end(); iconn++){
56 uint32_t detId = iconn->detId();
57 if (detId == 0 || detId == 0xFFFFFFFF)
continue;
58 if (detId_save != detId) {
77 DQMStore* dqm_store, std::string& map_type){
81 std::string tmap_title =
" Tracker Map from " + map_type;
101 int rval, gval, bval;
112 std::string mdir =
"MechanicalView";
114 std::string mechanicalview_dir = dqm_store->
pwd();
116 std::vector<std::string> subdet_folder;
117 subdet_folder.push_back(
"TIB");
118 subdet_folder.push_back(
"TOB");
119 subdet_folder.push_back(
"TEC/side_1");
120 subdet_folder.push_back(
"TEC/side_2");
121 subdet_folder.push_back(
"TID/side_1");
122 subdet_folder.push_back(
"TID/side_2");
128 for (std::vector<std::string>::const_iterator it = subdet_folder.begin(); it != subdet_folder.end(); it++) {
129 std::string dname = mechanicalview_dir +
"/" + (*it);
130 if (!dqm_store->
dirExists(dname))
continue;
131 dqm_store->
cd(dname);
132 std::vector<std::string> layerVec = dqm_store->
getSubdirs();
133 for (std::vector<std::string>::const_iterator iLayer = layerVec.begin(); iLayer != layerVec.end(); iLayer++) {
134 if ((*iLayer).find(
"BadModuleList") !=std::string::npos)
continue;
135 std::vector<MonitorElement*> meVec = dqm_store->
getContents((*iLayer));
138 for (std::vector<MonitorElement*>::const_iterator itkh = meVec.begin(); itkh != meVec.end(); itkh++) {
139 name = (*itkh)->getName();
140 if (name.find(
"TkHMap") == std::string::npos)
continue;
141 if (htype ==
"QTestAlarm" ){
144 }
else if (name.find(htype) != std::string::npos) {
149 if (tkhmap_me != 0) {
153 dqm_store->
cd(mechanicalview_dir);
159 std::string lname = name.substr(name.find(
"TkHMap_")+7);
160 lname = lname.substr(lname.find(
"_T")+1);
161 std::vector<uint32_t> layer_detids;
163 for (std::vector<uint32_t>::const_iterator idet = layer_detids.begin(); idet != layer_detids.end(); idet++) {
164 uint32_t det_id= (*idet);
165 if (det_id <= 0)
continue;
173 if ( (name.find(
"NumberOfOfffTrackCluster") != std::string::npos) ||
174 (name.find(
"NumberOfOnTrackCluster") != std::string::npos) ) {
177 fval = tp->GetBinEntries(tp->GetBin(xyval.
ix, xyval.
iy)) * tp->GetBinContent(xyval.
ix, xyval.
iy);
180 if (htype ==
"QTestAlarm") {
181 int rval, gval, bval;
199 if (map_type.find(
"FractionOfBadChannels") != std::string::npos)
tkMapMax = 1.0;
200 else if (map_type.find(
"NumberOfCluster") != std::string::npos)
tkMapMax = 0.01;
201 else if (map_type.find(
"NumberOfDigi") != std::string::npos)
tkMapMax = 0.6;
202 else if (map_type.find(
"NumberOfOffTrackCluster") != std::string::npos)
tkMapMax = 100.0;
203 else if (map_type.find(
"NumberOfOnTrackCluster") != std::string::npos)
tkMapMax = 50.0;
204 else if (map_type.find(
"StoNCorrOnTrack") != std::string::npos)
tkMapMax = 200.0;
215 comment <<
" DetId " << det_id <<
" : ";
219 std::string subdet_folder, badmodule_folder;
222 if (dqm_store->
dirExists(subdet_folder)){
223 badmodule_folder = subdet_folder +
"/BadModuleList";
225 badmodule_folder = dqm_store->
pwd() +
"/BadModuleList";
227 if (!dqm_store->
dirExists(badmodule_folder))
return flag;
229 std::ostringstream badmodule_path;
230 badmodule_path << badmodule_folder <<
"/" << det_id;
237 comment << message.c_str();
const std::string & getName(void) const
get name of ME
void getSubDetFolder(const uint32_t &detid, std::string &folder_name)
std::vector< std::string > getSubdirs(void) const
void setTkMapFromHistogram(DQMStore *dqm_store, std::string &htype)
TProfile2D * getTProfile2D(void) const
void cd(void)
go to top directory (ie. root)
static void getDetectorStatusColor(int status, int &rval, int &gval, int &bval)
void paintTkMapFromHistogram(DQMStore *dqm_store, MonitorElement *me, std::string &map_type)
~SiStripTrackerMapCreator()
static void getBadModuleStatus(uint16_t flag, std::string &message)
void setTitle(std::string s)
int getLayerNum(std::string &in)
void getDetsForLayer(int layer, std::vector< uint32_t > &output)
void save(bool print_total=true, float minval=0., float maxval=0., std::string s="svgmap.svg", int width=1500, int height=800)
Kind kind(void) const
Get the type of the monitor element.
MonitorElement * get(const std::string &path) const
get ME from full pathname (e.g. "my/long/dir/my_histo")
std::vector< MonitorElement * > getContents(const std::string &path) const
void paintTkMapFromAlarm(uint32_t det_id, DQMStore *dqm_store)
void fillc(int idmod, int RGBcode)
SiStripTrackerMapCreator()
bool dirExists(const std::string &path) const
true if directory exists
unsigned long long int rval
int64_t getIntValue(void) const
void setRange(float min, float max)
void createForOffline(const edm::ParameterSet &tkmapPset, DQMStore *dqm_store, std::string &htype)
double getBinContent(int binx) const
get content of bin (1-D)
const TkLayerMap::XYbin & getXY(uint32_t &)
void fill_current_val(int idmod, float current_val)
void setText(int idmod, std::string s)
void create(const edm::ParameterSet &tkmapPset, const edm::ESHandle< SiStripFedCabling > &fedcabling, DQMStore *dqm_store, std::string &htype)
static bool goToDir(DQMStore *dqm_store, std::string name)
void setTkMapRange(std::string &map_type)
uint16_t getDetectorFlagAndComment(DQMStore *dqm_store, uint32_t det_id, std::ostringstream &comment)
const std::string & pwd(void) const