17 #include "TPolyLine.h" 42 jsfilename =
"CommonTools/TrackerMap/data/trackermap.txt";
43 infilename =
"CommonTools/TrackerMap/data/tracker.dat";
60 std::cout <<
"ERROR:fed trackermap requested but no valid fedCabling is available!!!" << std::endl;
66 std::cout <<
"ERROR:fec trackermap requested but no valid fedCabling is available!!!" << std::endl;
81 std::cout <<
"SiStripFedCabling has " <<
feds.size() <<
" active FEDS" << std::endl;
84 for (std::vector<unsigned short>::const_iterator ifed =
feds.begin(); ifed <
feds.end(); ifed++) {
87 for (
auto iconn = theconn.begin(); iconn < theconn.end(); iconn++) {
95 int key = iconn->fedId() * 1000 + iconn->fedCh();
97 if (apvpair !=
nullptr)
98 std::cout <<
"Fed " << iconn->fedId() <<
" channel " << iconn->fedCh() <<
" seem to be already loaded!" 104 if (
fedMap[iconn->fedId()] == 0) {
105 fedMap[iconn->fedId()] = iconn->fedCrate();
107 if (
slotMap[iconn->fedId()] == 0) {
108 slotMap[iconn->fedId()] = iconn->fedSlot();
110 if (
ncrates == 0 || ncrates < iconn->fedCrate())
119 apvpair->
mpos = iconn->apvPairNumber();
121 apvModuleMap.insert(std::make_pair(iconn->detId(), apvpair));
124 apvpair->
text =
s.str();
131 std::map<int, TmModule *>::iterator i_mod;
134 if (
mod !=
nullptr) {
135 std::ostringstream outs, outs1;
136 outs <<
" connected to ";
141 std::multimap<const int, TmApvPair *>::iterator
pos;
144 if (apvpair !=
nullptr) {
146 outs1 << apvpair->
idex + apvpair->
crate * 1000000 <<
",";
150 outs <<
"(" << nchan <<
")";
151 mod->name =
mod->name + outs.str();
153 s.erase(
s.end() - 1,
s.end());
154 mod->capvids =
s +
")";
169 while (!Ccufile.eof()) {
171 getline(Ccufile, dummys);
172 int key = crate * 10000000 + slot * 100000 +
ring * 1000 +
addr;
174 if (ccu ==
nullptr) {
180 for (std::vector<SiStripFecCrate>::const_iterator icrate = fecCabling_->
crates().begin();
181 icrate != fecCabling_->
crates().end();
183 for (std::vector<SiStripFec>::const_iterator ifec = icrate->fecs().begin(); ifec != icrate->fecs().end();
185 for (std::vector<SiStripRing>::const_iterator iring = ifec->rings().begin(); iring != ifec->rings().end();
189 for (std::vector<SiStripCcu>::const_iterator iccu = iring->ccus().begin(); iccu != iring->ccus().end();
194 icrate->fecCrate() * 10000000 + ifec->fecSlot() * 100000 + iring->fecRing() * 1000 + iccu->ccuAddr();
197 for (std::vector<SiStripModule>::const_iterator imod = iccu->modules().begin();
198 imod != iccu->modules().end();
204 if (imod1 !=
nullptr)
208 std::cout <<
key <<
" This ccu seems to have not been stored! " << std::endl;
219 std::map<int, TmCcu *>::iterator i_ccu;
220 std::multimap<TmCcu *, TmModule *>::iterator it;
221 std::pair<std::multimap<TmCcu *, TmModule *>::iterator, std::multimap<TmCcu *, TmModule *>::iterator>
ret;
223 for (i_ccu =
ccuMap.begin(); i_ccu !=
ccuMap.end(); i_ccu++) {
224 TmCcu *ccu = i_ccu->second;
226 if (ccu !=
nullptr) {
227 std::ostringstream outs;
228 std::ostringstream outs1;
230 <<
" in crate " << ccu->
getCcuCrate() <<
" at position " << ccu->
mpos <<
" with " << ccu->
nmod 234 for (it =
ret.first; it !=
ret.second; ++it) {
235 outs << (*it).second->idex <<
" ";
236 outs1 << (*it).second->getKey() <<
",";
239 ccu->
text = outs.str();
240 ccu->
cmodid = outs1.str();
257 int nmod, nmodHV2, nmodHV3;
259 int dcs,
branch, crate, board;
265 int rack_order[54] = {0, 1, 0, 2, 0, 3, 0, 4, 0, 5, 6, 0, 7, 8, 0, 9, 10, 0,
266 11, 12, 0, 13, 14, 0, 15, 0, 0, 0, 0, 0, 0, 16, 0, 17, 18, 0,
267 19, 20, 0, 21, 0, 22, 0, 23, 0, 24, 25, 0, 26, 27, 0, 28, 0, 29};
295 while (!LVfile.eof()) {
296 LVfile >> modId1 >> dcuId >> psIdinfo >> psinfo;
308 dcs = atoi(dcsinfo.c_str());
309 branch = atoi(branchinfo.c_str());
310 crate = atoi(crateinfo.c_str()) + 1;
311 board = atoi(boardinfo.c_str()) + 1;
312 rack = (
branch + 1) + (dcs - 1) * 6;
313 rack = rack_order[rack];
314 channel = atoi(channelinfo.c_str());
316 int key = rack * 1000 + crate * 100 + board;
320 if (psu ==
nullptr) {
323 psu->
psId = psIdinfo;
327 if (imod !=
nullptr) {
328 imod->
PsuId = psIdinfo;
335 std::map<int, TmPsu *>::iterator ipsu;
336 std::multimap<TmPsu *, TmModule *>::iterator it;
337 std::pair<std::multimap<TmPsu *, TmModule *>::iterator, std::multimap<TmPsu *, TmModule *>::iterator>
ret;
340 for (ipsu =
psuMap.begin(); ipsu !=
psuMap.end(); ipsu++) {
341 TmPsu *psu = ipsu->second;
344 if (psu !=
nullptr) {
345 std::ostringstream outs;
346 std::ostringstream outs1;
348 std::ostringstream outs3;
349 std::ostringstream outs4;
351 std::ostringstream outs5;
352 std::ostringstream outs6;
354 outs <<
"PSU " << psu->
psId <<
" connected to Mainframe " << psu->
getPsuDcs() <<
" BranchController " 356 <<
" in position " << psu->
getPsuBoard() <<
" with modules: ";
360 outs3 <<
"PSU " << psu->
psId <<
" connected to Mainframe " << psu->
getPsuDcs() <<
" BranchController " 362 <<
" in position " << psu->
getPsuBoard() <<
" and HV channel 002 with modules: ";
365 outs5 <<
"PSU " << psu->
psId <<
" connected to Mainframe " << psu->
getPsuDcs() <<
" BranchController " 367 <<
" in position " << psu->
getPsuBoard() <<
" and HV channel 002 with modules: ";
375 for (it =
ret.first; it !=
ret.second; ++it) {
377 outs << (*it).second->idex <<
", ";
378 outs1 << (*it).second->getKey() <<
",";
381 if ((*it).second->HVchannel == 2) {
383 outs3 << (*it).second->idex <<
", ";
384 outs4 << (*it).second->getKey() <<
",";
385 }
else if ((*it).second->HVchannel == 3) {
387 outs5 << (*it).second->idex <<
", ";
388 outs6 << (*it).second->getKey() <<
",";
395 outs <<
"(" << psu->
nmod <<
")";
396 psu->
text = outs.str();
403 outs3 <<
"(" << psu->
nmodHV2 <<
")";
404 outs5 <<
"(" << psu->
nmodHV3 <<
")";
423 jsfilename =
"CommonTools/TrackerMap/data/trackermap.txt";
424 infilename =
"CommonTools/TrackerMap/data/tracker.dat";
448 jsfilename =
"CommonTools/TrackerMap/data/trackermap.txt";
449 infilename =
"CommonTools/TrackerMap/data/tracker.dat";
453 jsPath =
"CommonTools/TrackerMap/data/";
463 std::map<int, TmModule *>::iterator i_mod;
492 for (
int subdet = 1; subdet <
ndet + 1; subdet++) {
493 for (
int detpart = 1; detpart <
npart + 1; detpart++) {
501 if (subdet == 3 && detpart != 2)
545 std::map<int, TmApvPair *>::iterator i_apv;
546 for (i_apv =
apvMap.begin(); i_apv !=
apvMap.end(); i_apv++) {
551 std::map<int, TmCcu *>::iterator i_ccu;
552 for (i_ccu =
ccuMap.begin(); i_ccu !=
ccuMap.end(); i_ccu++) {
553 TmCcu *ccu = i_ccu->second;
557 std::map<int, TmPsu *>::iterator ipsu;
558 for (ipsu =
psuMap.begin(); ipsu !=
psuMap.end(); ipsu++) {
559 TmPsu *psu = ipsu->second;
568 double xp[4], yp[4], xp1, yp1;
569 double vhbot, vhtop, vhapo;
570 double rmedio[] = {0.041, 0.0701, 0.0988, 0.255, 0.340, 0.430, 0.520, 0.610, 0.696, 0.782, 0.868, 0.965, 1.080};
571 double xt1, yt1, xs1 = 0., ys1 = 0., xt2, yt2, xs2, ys2, pv1, pv2;
584 vhbot =
mod->widthAtHalfLength / 2. - (
mod->width / 2. -
mod->widthAtHalfLength / 2.);
585 vhtop =
mod->width / 2.;
586 vhapo =
mod->length / 2.;
587 if (mlay > 12 && mlay < 19) {
610 for (
int j = 0;
j < 4;
j++) {
617 numod =
mod->idModule;
620 int vane =
mod->ring;
624 xt1 = rmedio[mlay - 31];
628 xt2 = rmedio[mlay - 31];
640 xp[0] = vane * (
dx +
dx / 8.);
641 yp[0] = numod * (dy1);
642 xp[1] = vane * (
dx +
dx / 8.) +
dx;
643 yp[1] = numod * (dy1);
644 xp[2] = vane * (
dx +
dx / 8.) +
dx;
645 yp[2] = numod * (dy1) +
dy;
646 xp[3] = vane * (
dx +
dx / 8.);
647 yp[3] = numod * (dy1) +
dy;
659 if (fabs(pv1 - pv2) >
M_PI && numod == 1)
660 pv1 = pv1 - 2. *
M_PI;
661 if (fabs(pv1 - pv2) >
M_PI && numod != 1)
662 pv2 = pv2 + 2. *
M_PI;
663 xp[0] =
mod->posz - vhapo / 2.;
665 xp[1] =
mod->posz + vhapo / 2.;
667 xp[2] =
mod->posz + vhapo / 2.;
669 xp[3] =
mod->posz - vhapo / 2.;
675 if (
mod->idModule > 100) {
676 for (
int j = 0;
j < 3;
j++) {
689 for (
int j = 0;
j < 4;
j++) {
699 red = (color >> 16) & 0xFF;
700 green = (color >> 8) & 0xFF;
711 <<
"<svg:polygon detid=\"" <<
mod->idex <<
"\" count=\"" <<
mod->count <<
"\" value=\"" <<
mod->value
712 <<
"\" id=\"" <<
key <<
"\" capvids=\"" <<
mod->capvids <<
"\" lv=\"" <<
mod->psuIdex <<
"\" hv=\"" 713 <<
mod->psuIdex * 10 +
mod->HVchannel <<
"\" fec=\"" <<
mod->CcuId
714 <<
"\" onclick=\"showData(evt);\" onmouseover=\"showData(evt);\" onmouseout=\"showData(evt);\" MESSAGE=\"" 715 <<
mod->text <<
"\" POS=\"" <<
mod->name <<
" \" fill=\"rgb(" <<
red <<
"," << green <<
"," <<
blue 718 *
svgfile << 255 <<
" " << 255 <<
" " << 255 <<
" ";
721 <<
"<svg:polygon detid=\"" <<
mod->idex <<
"\" count=\"" <<
mod->count <<
"\" value=\"" <<
mod->value
722 <<
"\" id=\"" <<
key <<
"\" capvids=\"" <<
mod->capvids <<
"\" lv=\"" <<
mod->psuIdex <<
"\" hv=\"" 723 <<
mod->psuIdex * 10 +
mod->HVchannel <<
"\" fec=\"" <<
mod->CcuId
724 <<
"\" onclick=\"showData(evt);\" onmouseover=\"showData(evt);\" onmouseout=\"showData(evt);\" MESSAGE=\"" 725 <<
mod->text <<
"\" POS=\"" <<
mod->name <<
" \" fill=\"white\" points=\"";
728 for (
int k = 0;
k <
np;
k++) {
730 *
svgfile << xd[
k] <<
" " << yd[
k] <<
" ";
732 *
svgfile << xd[
k] <<
"," << yd[
k] <<
" ";
737 *
svgfile <<
"\" />" << std::endl;
741 if (
mod->green > 255)
749 <<
"<svg:polygon detid=\"" <<
mod->idex <<
"\" count=\"" <<
mod->count <<
"\" value=\"" <<
mod->value
750 <<
"\" id=\"" <<
key <<
"\" capvids=\"" <<
mod->capvids <<
"\" lv=\"" <<
mod->psuIdex <<
"\" hv=\"" 751 <<
mod->psuIdex * 10 +
mod->HVchannel <<
"\" fec=\"" <<
mod->CcuId
752 <<
"\" onclick=\"showData(evt);\" onmouseover=\"showData(evt);\" onmouseout=\"showData(evt);\" MESSAGE=\"" 753 <<
mod->text <<
"\" POS=\"" <<
mod->name <<
" \" fill=\"rgb(" <<
mod->red <<
"," <<
mod->green <<
"," 754 <<
mod->blue <<
")\" points=\"";
757 for (
int k = 0;
k <
np;
k++) {
759 *
svgfile << xd[
k] <<
" " << yd[
k] <<
" ";
761 *
svgfile << xd[
k] <<
"," << yd[
k] <<
" ";
766 *
svgfile <<
"\" />" << std::endl;
779 float minval, maxval;
787 if (
mod !=
nullptr && !
mod->notInUse() &&
mod->count > 0) {
788 if (minval >
mod->value)
790 if (maxval < mod->
value)
797 minval =
log(minval) /
log(10);
798 maxval =
log(maxval) /
log(10);
800 return std::make_pair(minval, maxval);
808 bool rangefound =
true;
811 std::vector<TPolyLine *> vp;
812 TGaxis *axis =
nullptr;
821 std::ostringstream outs;
832 if (
mod !=
nullptr && !
mod->notInUse()) {
849 if (
mod !=
nullptr && !
mod->notInUse() &&
mod->count > 0) {
853 if (maxvalue < mod->
value)
863 *
savefile <<
"<?xml version=\"1.0\" standalone=\"no\" ?>" << std::endl;
864 *
savefile <<
"<svg xmlns=\"http://www.w3.org/2000/svg\"" << std::endl;
865 *
savefile <<
"xmlns:svg=\"http://www.w3.org/2000/svg\" " << std::endl;
866 *
savefile <<
"xmlns:xlink=\"http://www.w3.org/1999/xlink\">" << std::endl;
867 *
savefile <<
"<svg:svg id=\"mainMap\" x=\"0\" y=\"0\" viewBox=\"0 0 3100 1600" 868 <<
"\" width=\"" <<
width <<
"\" height=\"" << height <<
"\">" << std::endl;
869 *
savefile <<
"<svg:rect fill=\"lightblue\" stroke=\"none\" x=\"0\" y=\"0\" width=\"3100\" height=\"1600\" /> " 871 *
savefile <<
"<svg:g id=\"tracker\" transform=\"translate(10,1500) rotate(270)\" " 872 "style=\"fill:none;stroke:black;stroke-width:0;\"> " 882 if (
mod !=
nullptr && !
mod->notInUse()) {
890 *
savefile <<
"</svg:g>" << std::endl;
891 *
savefile <<
" <svg:text id=\"Title\" class=\"normalText\" x=\"300\" y=\"0\">" <<
title <<
"</svg:text>" 903 *
savefile <<
"</svg:svg>" << std::endl;
909 const char *command1;
914 std::cout <<
"Executing " << command1 << std::endl;
921 std::ifstream tempfile(tempfilename.c_str(),
std::ios::in);
922 TCanvas *MyC =
new TCanvas(
"MyC",
"TrackerMap",
width, height);
923 gPad->SetFillColor(38);
926 gPad->Range(0, 0, 3800, 1600);
928 gPad->Range(-100, 0, 800, 1600);
930 gPad->Range(800, 0, 3800, 1600);
935 typedef std::map<int, int> ColorList;
937 ColorList::iterator
pos;
939 std::cout <<
"tempfilename " << tempfilename << std::endl;
940 while (!tempfile.eof()) {
942 colindex =
red + green * 1000 +
blue * 1000000;
943 pos = colorList.find(colindex);
944 if (
pos == colorList.end()) {
945 colorList[colindex] = ncolor + 100;
946 col = gROOT->GetColor(ncolor + 100);
948 col->SetRGB((Double_t)(
red / 255.), (Double_t)(green / 255.), (Double_t)(
blue / 255.));
950 c =
new TColor(ncolor + 100, (Double_t)(
red / 255.), (Double_t)(green / 255.), (Double_t)(
blue / 255.));
955 tempfile >>
x[
i] >>
y[
i];
959 if (ncolor > 0 && ncolor < 10000) {
961 for (
int i = 0;
i < ncolor;
i++) {
964 gStyle->SetPalette(ncolor,
colors);
968 tempfile.seekg(0, std::ios::beg);
969 std::cout <<
"created palette with " << ncolor <<
" colors" << std::endl;
971 while (!tempfile.eof()) {
974 tempfile >>
x[
i] >>
y[
i];
976 colindex =
red + green * 1000 +
blue * 1000000;
977 pos = colorList.find(colindex);
978 if (
pos != colorList.end()) {
979 TPolyLine *pline =
new TPolyLine(
npoints,
y,
x);
981 pline->SetFillColor(colorList[colindex]);
982 pline->SetLineWidth(0);
994 axis =
new TGaxis(-30, 36, -30, 1530, lminvalue, lmaxvalue, 510,
"+L");
996 axis =
new TGaxis(3660, 36, 3660, 1530, lminvalue, lmaxvalue, 510,
"+L");
998 axis->SetLabelSize(0.02);
1002 l.SetTextSize(0.03);
1003 l.DrawLatex(950, 1330,
"TID");
1004 l.DrawLatex(2300, 1330,
"TEC");
1005 l.DrawLatex(300, 1330,
"FPIX");
1006 l.DrawLatex(20, 560,
"BPIX L1");
1007 l.DrawLatex(500, 385,
"BPIX L2");
1008 l.DrawLatex(500, 945,
"BPIX L3");
1009 l.SetTextSize(0.04);
1011 if (
tkMapLog && (fulltitle.find(
"Log10 scale") == std::string::npos))
1012 fulltitle +=
": Log10 scale";
1014 l.DrawLatex(30, 1500, fulltitle.c_str());
1016 l.DrawLatex(850, 1500, fulltitle.c_str());
1019 l.DrawLatex(380, 40,
"-z");
1021 l.DrawLatex(1730, 40,
"-z");
1024 l.DrawLatex(380, 1330,
"+z");
1026 l.DrawLatex(1730, 1360,
"+z");
1028 l.DrawLatex(1085, 330,
"TIB L1");
1029 l.DrawLatex(1085, 1000,
"TIB L2");
1030 l.DrawLatex(1585, 330,
"TIB L3");
1031 l.DrawLatex(1585, 1000,
"TIB L4");
1032 l.DrawLatex(2085, 330,
"TOB L1");
1033 l.DrawLatex(2085, 1000,
"TOB L2");
1034 l.DrawLatex(2585, 330,
"TOB L3");
1035 l.DrawLatex(2585, 1000,
"TOB L4");
1036 l.DrawLatex(3085, 330,
"TOB L5");
1037 l.DrawLatex(3085, 1000,
"TOB L6");
1038 TArrow arx(3448, 1190, 3448, 1350, 0.01,
"|>");
1039 l.DrawLatex(3460, 1350,
"x");
1040 TArrow ary(3448, 1190, 3312, 1190, 0.01,
"|>");
1041 l.DrawLatex(3312, 1210,
"y");
1042 TArrow arz(3485, 373, 3485, 676, 0.01,
"|>");
1043 l.DrawLatex(3510, 667,
"z");
1044 TArrow arphi(3485, 511, 3037, 511, 0.01,
"|>");
1045 l.DrawLatex(3023, 520,
"#Phi");
1046 arx.SetLineWidth(3);
1047 ary.SetLineWidth(3);
1048 arz.SetLineWidth(3);
1049 arphi.SetLineWidth(3);
1055 l.DrawLatex(570 + 12, 1190 + 160,
"x");
1057 ary.SetX2(570 - 160);
1060 l.DrawLatex(570 - 160, 1190 + 30,
"y");
1063 arz.SetY1(683 - 100);
1064 arz.SetY2(683 + 100);
1065 l.DrawLatex(380 + 15, 683 + 100 - 9,
"z");
1067 arphi.SetX2(380 - 390);
1070 l.DrawLatex(380 - 390 - 14, 683 + 9,
"#Phi");
1078 if (
title.find(
"QTestAlarm") != std::string::npos) {
1097 std::cout <<
"Executing " << command1 << std::endl;
1104 for (std::vector<TPolyLine *>::iterator pos1 = vp.begin(); pos1 != vp.end(); pos1++) {
1112 int crate,
int numfed_incrate,
bool print_total,
TmApvPair *apvPair, std::ofstream *svgfile,
bool useApvPairValue) {
1113 double xp[4], yp[4];
1118 double xd[4], yd[4];
1120 double boxinitx = 0., boxinity = 0.;
1121 double dx = .9,
dy = .9;
1135 xp[1] = boxinitx +
dx;
1137 xp[2] = boxinitx +
dx;
1138 yp[2] = boxinity +
dy;
1140 yp[3] = boxinity +
dy;
1141 for (
int j = 0;
j < 4;
j++) {
1150 s.erase(
s.begin() +
s.find(
"connected"),
s.end());
1152 if (useApvPairValue) {
1153 if (apvPair->
red < 0) {
1154 if (apvPair->
count > 0) {
1156 red = (color >> 16) & 0xFF;
1157 green = (color >> 8) & 0xFF;
1158 blue = (color)&0xFF;
1165 <<
"<svg:polygon detid=\"" << apvPair->
idex <<
"\" count=\"" << apvPair->
count <<
"\" value=\"" 1166 << apvPair->
value <<
"\" id=\"" << apvPair->
idex + crate * 1000000 <<
"\" cmodid=\"" 1168 <<
"\" onclick=\"showData(evt);\" onmouseover=\"showData(evt);\" onmouseout=\"showData(evt);\" MESSAGE=\"" 1171 <<
" \" fill=\"rgb(" <<
red <<
"," << green <<
"," <<
blue <<
")\" points=\"";
1174 *
svgfile << 255 <<
" " << 255 <<
" " << 255 <<
" ";
1177 <<
"<svg:polygon detid=\"" << apvPair->
idex <<
"\" count=\"" << apvPair->
count <<
"\" value=\"" 1178 << apvPair->
value <<
"\" id=\"" << apvPair->
idex + crate * 1000000 <<
"\" cmodid=\"" 1180 <<
"\" onclick=\"showData(evt);\" onmouseover=\"showData(evt);\" onmouseout=\"showData(evt);\" MESSAGE=\"" 1183 <<
" \" fill=\"white\" points=\"";
1186 if (apvPair->
red > 255)
1188 if (apvPair->
green > 255)
1189 apvPair->
green = 255;
1190 if (apvPair->
blue > 255)
1191 apvPair->
blue = 255;
1196 <<
"<svg:polygon detid=\"" << apvPair->
idex <<
"\" count=\"" << apvPair->
count <<
"\" value=\"" 1197 << apvPair->
value <<
"\" id=\"" << apvPair->
idex + crate * 1000000 <<
"\" cmodid=\"" 1199 <<
"\" onclick=\"showData(evt);\" onmouseover=\"showData(evt);\" onmouseout=\"showData(evt);\" MESSAGE=\"" 1202 <<
" \" fill=\"rgb(" << apvPair->
red <<
"," << apvPair->
green <<
"," << apvPair->
blue <<
")\" points=\"";
1205 if (apvPair->
mod->
red < 0) {
1208 red = (color >> 16) & 0xFF;
1209 green = (color >> 8) & 0xFF;
1210 blue = (color)&0xFF;
1215 <<
"<svg:polygon detid=\"" << apvPair->
idex <<
"\" count=\"" << apvPair->
count <<
"\" value=\"" 1216 << apvPair->
value <<
"\" id=\"" << apvPair->
idex + crate * 1000000 <<
"\" cmodid=\"" 1218 <<
"\" onclick=\"showData(evt);\" onmouseover=\"showData(evt);\" onmouseout=\"showData(evt);\" MESSAGE=\"" 1221 <<
" \" fill=\"rgb(" <<
red <<
"," << green <<
"," <<
blue <<
")\" points=\"";
1224 *
svgfile << 255 <<
" " << 255 <<
" " << 255 <<
" ";
1227 <<
"<svg:polygon detid=\"" << apvPair->
idex <<
"\" count=\"" << apvPair->
count <<
"\" value=\"" 1228 << apvPair->
value <<
"\" id=\"" << apvPair->
idex + crate * 1000000 <<
"\" cmodid=\"" 1230 <<
"\" onclick=\"showData(evt);\" onmouseover=\"showData(evt);\" onmouseout=\"showData(evt);\" MESSAGE=\"" 1233 <<
" \" fill=\"white\" points=\"";
1236 if (apvPair->
mod->
red > 255)
1246 <<
"<svg:polygon detid=\"" << apvPair->
idex <<
"\" count=\"" << apvPair->
count <<
"\" value=\"" 1247 << apvPair->
value <<
"\" id=\"" << apvPair->
idex + crate * 1000000 <<
"\" cmodid=\"" 1249 <<
"\" onclick=\"showData(evt);\" onmouseover=\"showData(evt);\" onmouseout=\"showData(evt);\" MESSAGE=\"" 1252 <<
" \" fill=\"rgb(" << apvPair->
mod->
red <<
"," << apvPair->
mod->
green <<
"," << apvPair->
mod->
blue 1258 for (
int k = 0;
k <
np;
k++) {
1260 *
svgfile << xd[
k] <<
" " << yd[
k] <<
" ";
1262 *
svgfile << xd[
k] <<
"," << yd[
k] <<
" ";
1267 *
svgfile <<
"\" />" << std::endl;
1270 int crate,
int numfec_incrate,
bool print_total,
TmCcu *ccu, std::ofstream *svgfile,
bool useCcuValue) {
1271 double xp[4], yp[4];
1276 double xd[4], yd[4];
1278 double boxinitx = 0., boxinity = 0.;
1279 double dx = .9,
dy = .9;
1280 int numccu_incolumn = 8;
1281 int numccu_inrow = 15;
1282 int numfec_incolumn = 5;
1283 int numfec_inrow = 4;
1284 boxinitx = boxinitx + (numfec_incolumn - (numfec_incrate - 1) / numfec_inrow) * 14.;
1285 boxinity = boxinity + (numfec_inrow - (numfec_incrate - 1) % numfec_inrow) * 16.;
1286 boxinity = boxinity + numccu_inrow - ccu->
mpos;
1287 boxinitx = boxinitx + numccu_incolumn - (
int)(ccu->
getCcuRing() % numccu_incolumn);
1291 xp[1] = boxinitx +
dx;
1293 xp[2] = boxinitx +
dx;
1294 yp[2] = boxinity +
dy;
1296 yp[3] = boxinity +
dy;
1297 for (
int j = 0;
j < 4;
j++) {
1308 s.erase(
s.begin() +
s.find(
"connected"),
s.end());
1311 if (ccu->
count > 0) {
1313 red = (color >> 16) & 0xFF;
1314 green = (color >> 8) & 0xFF;
1315 blue = (color)&0xFF;
1322 <<
"<svg:polygon detid=\"" << ccu->
idex <<
"\" count=\"" << ccu->
count <<
"\" value=\"" << ccu->
value 1323 <<
"\" id=\"" << ccu->
idex + crate * 1000000 <<
"\" cmodid=\"" << ccu->
cmodid <<
"\" layer=\"" << ccu->
layer 1324 <<
"\" onclick=\"showData(evt);\" onmouseover=\"showData(evt);\" onmouseout=\"showData(evt);\" MESSAGE=\"" 1325 "\" POS=\"Slot/Ring" 1327 <<
" \" fill=\"rgb(" <<
red <<
"," << green <<
"," <<
blue <<
")\" points=\"";
1330 *
svgfile << 255 <<
" " << 255 <<
" " << 255 <<
" ";
1333 <<
"<svg:polygon detid=\"" << ccu->
idex <<
"\" count=\"" << ccu->
count <<
"\" value=\"" << ccu->
value 1334 <<
"\" id=\"" << ccu->
idex + crate * 1000000 <<
"\" cmodid=\"" << ccu->
cmodid <<
"\" layer=\"" 1336 <<
"\" onclick=\"showData(evt);\" onmouseover=\"showData(evt);\" onmouseout=\"showData(evt);\" MESSAGE=\"" 1337 "\" POS=\"Slot/Ring " 1339 <<
" \" fill=\"white\" points=\"";
1344 if (ccu->
green > 255)
1346 if (ccu->
blue > 255)
1352 <<
"<svg:polygon detid=\"" << ccu->
idex <<
"\" count=\"" << ccu->
count <<
"\" value=\"" << ccu->
value 1353 <<
"\" id=\"" << ccu->
idex + crate * 1000000 <<
"\" cmodid=\"" << ccu->
cmodid <<
"\" layer=\"" << ccu->
layer 1354 <<
"\" onclick=\"showData(evt);\" onmouseover=\"showData(evt);\" onmouseout=\"showData(evt);\" MESSAGE=\"" 1355 "\" POS=\"Slot/Ring " 1357 <<
" \" fill=\"rgb(" << ccu->
red <<
"," << ccu->
green <<
"," << ccu->
blue <<
")\" points=\"";
1361 for (
int k = 0;
k <
np;
k++) {
1363 *
svgfile << xd[
k] <<
" " << yd[
k] <<
" ";
1365 *
svgfile << xd[
k] <<
"," << yd[
k] <<
" ";
1370 *
svgfile <<
"\" />" << std::endl;
1373 int rack,
int numcrate_inrack,
bool print_total,
TmPsu *psu, std::ofstream *svgfile,
bool usePsuValue) {
1374 double xp[4], yp[4];
1379 double xd[4], yd[4];
1381 double boxinitx = 0., boxinity = 0.;
1382 double dx = .9,
dy = .9;
1389 xp[1] = boxinitx +
dx;
1391 xp[2] = boxinitx +
dx;
1392 yp[2] = boxinity +
dy;
1394 yp[3] = boxinity +
dy;
1396 for (
int j = 0;
j < 4;
j++) {
1416 s.erase(
s.begin() +
s.find(
"connected"),
s.end());
1419 if (psu->
count > 0) {
1421 red = (color >> 16) & 0xFF;
1422 green = (color >> 8) & 0xFF;
1423 blue = (color)&0xFF;
1430 <<
"<svg:polygon detid=\"" << psu->
idex <<
"\" count=\"" << psu->
count <<
"\" value=\"" << psu->
value 1431 <<
"\" id=\"" << psu->
idex <<
"\" cmodid=\"" << psu->
cmodid_LV 1432 <<
"\" onclick=\"showData(evt);\" onmouseover=\"showData(evt);\" onmouseout=\"showData(evt);\" MESSAGE=\"" 1433 "\" POS=\"easyCrate/easyBoard " 1435 <<
"," << green <<
"," <<
blue <<
")\" points=\"";
1438 *
svgfile << 255 <<
" " << 255 <<
" " << 255 <<
" ";
1441 <<
"<svg:polygon detid=\"" << psu->
idex <<
"\" count=\"" << psu->
count <<
"\" value=\"" << psu->
value 1442 <<
"\" id=\"" << psu->
idex <<
"\" cmodid=\"" << psu->
cmodid_LV 1443 <<
"\" onclick=\"showData(evt);\" onmouseover=\"showData(evt);\" onmouseout=\"showData(evt);\" MESSAGE=\"" 1444 "\" POS=\"easyCrate/easyBoard " 1446 <<
" \" fill=\"white\" points=\"";
1453 if (psu->
green > 255)
1455 if (psu->
blue > 255)
1461 <<
"<svg:polygon detid=\"" << psu->
idex <<
"\" count=\"" << psu->
count <<
"\" value=\"" << psu->
value 1462 <<
"\" id=\"" << psu->
idex <<
"\" cmodid=\"" << psu->
cmodid_LV 1463 <<
"\" onclick=\"showData(evt);\" onmouseover=\"showData(evt);\" onmouseout=\"showData(evt);\" MESSAGE=\"" 1464 "\" POS=\"easyCrate/easyBoard " 1466 <<
"," << psu->
green <<
"," << psu->
blue <<
")\" points=\"";
1471 for (
int k = 0;
k <
np;
k++) {
1473 *
svgfile << xd[
k] <<
" " << yd[
k] <<
" ";
1475 *
svgfile << xd[
k] <<
"," << yd[
k] <<
" ";
1480 *
svgfile <<
"\" />" << std::endl;
1484 int rack,
int numcrate_inrack,
bool print_total,
TmPsu *psu, std::ofstream *svgfile,
bool usePsuValue) {
1485 double xp[4], yp[4];
1490 double xd[4], yd[4];
1492 double boxinitx = 35, boxinity = 12;
1493 double dx = 1.1,
dy = 1.3;
1495 boxinitx = boxinitx + (5 - psu->
getPsuCrate()) * 5;
1496 boxinity = boxinity + (18 - psu->
getPsuBoard()) * 1.75;
1500 xp[1] = boxinitx +
dx;
1502 xp[2] = boxinitx +
dx;
1503 yp[2] = boxinity +
dy;
1505 yp[3] = boxinity +
dy;
1507 for (
int j = 0;
j < 4;
j++) {
1516 s.erase(
s.begin() +
s.find(
"connected"),
s.end());
1522 redHV2 = (color >> 16) & 0xFF;
1523 greenHV2 = (color >> 8) & 0xFF;
1524 blueHV2 = (color)&0xFF;
1528 *
svgfile << redHV2 <<
" " << greenHV2 <<
" " << blueHV2 <<
" ";
1531 <<
"<svg:polygon detid=\"" << psu->
idex <<
"\" count=\"" << psu->
countHV2 <<
"\" value=\"" << psu->
valueHV2 1532 <<
"\" id=\"" << psu->
idex * 10 + 2 <<
"\" cmodid=\"" << psu->
cmodid_HV2 1533 <<
"\" onclick=\"showData(evt);\" onmouseover=\"showData(evt);\" onmouseout=\"showData(evt);\" MESSAGE=\"" 1534 "\" POS=\"easyCrate/easyBoard " 1536 <<
"," << greenHV2 <<
"," << blueHV2 <<
")\" points=\"";
1539 *
svgfile << 255 <<
" " << 255 <<
" " << 255 <<
" ";
1542 <<
"<svg:polygon detid=\"" << psu->
idex <<
"\" count=\"" << psu->
countHV2 <<
"\" value=\"" << psu->
valueHV2 1543 <<
"\" id=\"" << psu->
idex * 10 + 2 <<
"\" cmodid=\"" << psu->
cmodid_HV2 1544 <<
"\" onclick=\"showData(evt);\" onmouseover=\"showData(evt);\" onmouseout=\"showData(evt);\" MESSAGE=\"" 1545 "\" POS=\"easyCrate/easyBoard " 1547 <<
" \" fill=\"white\" points=\"";
1562 <<
"<svg:polygon detid=\"" << psu->
idex <<
"\" count=\"" << psu->
countHV2 <<
"\" value=\"" << psu->
valueHV2 1563 <<
"\" id=\"" << psu->
idex * 10 + 2 <<
"\" cmodid=\"" << psu->
cmodid_HV2 1564 <<
"\" onclick=\"showData(evt);\" onmouseover=\"showData(evt);\" onmouseout=\"showData(evt);\" MESSAGE=\"" 1565 "\" POS=\"easyCrate/easyBoard " 1572 for (
int k = 0;
k <
np;
k++) {
1574 *
svgfile << xd[
k] <<
" " << yd[
k] <<
" ";
1576 *
svgfile << xd[
k] <<
"," << yd[
k] <<
" ";
1581 *
svgfile <<
"\" />" << std::endl;
1585 int rack,
int numcrate_inrack,
bool print_total,
TmPsu *psu, std::ofstream *svgfile,
bool usePsuValue) {
1586 double xp[4], yp[4];
1591 double xd[4], yd[4];
1593 double boxinitx = 36.5, boxinity = 12;
1594 double dx = 1.1,
dy = 1.3;
1596 boxinitx = boxinitx + (5 - psu->
getPsuCrate()) * 5;
1597 boxinity = boxinity + (18 - psu->
getPsuBoard()) * 1.75;
1601 xp[1] = boxinitx +
dx;
1603 xp[2] = boxinitx +
dx;
1604 yp[2] = boxinity +
dy;
1606 yp[3] = boxinity +
dy;
1608 for (
int j = 0;
j < 4;
j++) {
1617 s.erase(
s.begin() +
s.find(
"connected"),
s.end());
1622 redHV3 = (color >> 16) & 0xFF;
1623 greenHV3 = (color >> 8) & 0xFF;
1624 blueHV3 = (color)&0xFF;
1628 *
svgfile << redHV3 <<
" " << greenHV3 <<
" " << blueHV3 <<
" ";
1631 <<
"<svg:polygon detid=\"" << psu->
idex <<
"\" count=\"" << psu->
countHV3 <<
"\" value=\"" << psu->
valueHV3 1632 <<
"\" id=\"" << psu->
idex * 10 + 3 <<
"\" cmodid=\"" << psu->
cmodid_HV3 1633 <<
"\" onclick=\"showData(evt);\" onmouseover=\"showData(evt);\" onmouseout=\"showData(evt);\" MESSAGE=\"" 1634 "\" POS=\"easyCrate/easyBoard" 1636 <<
"," << greenHV3 <<
"," << blueHV3 <<
")\" points=\"";
1639 *
svgfile << 255 <<
" " << 255 <<
" " << 255 <<
" ";
1642 <<
"<svg:polygon detid=\"" << psu->
idex <<
"\" count=\"" << psu->
countHV3 <<
"\" value=\"" << psu->
valueHV3 1643 <<
"\" id=\"" << psu->
idex * 10 + 3 <<
"\" cmodid=\"" << psu->
cmodid_HV3 1644 <<
"\" onclick=\"showData(evt);\" onmouseover=\"showData(evt);\" onmouseout=\"showData(evt);\" MESSAGE=\"" 1645 "\" POS=\"easyCrate/easyBoard " 1647 <<
" \" fill=\"white\" points=\"";
1662 <<
"<svg:polygon detid=\"" << psu->
idex <<
"\" count=\"" << psu->
countHV3 <<
"\" value=\"" << psu->
valueHV3 1663 <<
"\" id=\"" << psu->
idex * 10 + 3 <<
"\" cmodid=\"" << psu->
cmodid_HV3 1664 <<
"\" onclick=\"showData(evt);\" onmouseover=\"showData(evt);\" onmouseout=\"showData(evt);\" MESSAGE=\"" 1665 "\" POS=\"easyCrate/easyBoard " 1672 for (
int k = 0;
k <
np;
k++) {
1674 *
svgfile << xd[
k] <<
" " << yd[
k] <<
" ";
1676 *
svgfile << xd[
k] <<
"," << yd[
k] <<
" ";
1681 *
svgfile <<
"\" />" << std::endl;
1685 bool print_total,
float minval,
float maxval,
std::string s,
int width,
int height) {
1688 std::vector<TPolyLine *> vp;
1689 TGaxis *axis =
nullptr;
1697 std::ostringstream outs;
1703 std::map<int, TmCcu *>::iterator i_ccu;
1704 std::multimap<TmCcu *, TmModule *>::iterator it;
1705 std::pair<std::multimap<TmCcu *, TmModule *>::iterator, std::multimap<TmCcu *, TmModule *>::iterator>
ret;
1707 bool useCcuValue =
false;
1709 for (i_ccu =
ccuMap.begin(); i_ccu !=
ccuMap.end(); i_ccu++) {
1710 TmCcu *ccu = i_ccu->second;
1711 if (ccu !=
nullptr) {
1712 if (ccu->
count > 0 || ccu->
red != -1) {
1720 for (i_ccu =
ccuMap.begin(); i_ccu !=
ccuMap.end(); i_ccu++) {
1721 TmCcu *ccu = i_ccu->second;
1722 if (ccu !=
nullptr) {
1724 for (it =
ret.first; it !=
ret.second; ++it) {
1725 if ((*it).second->count > 0) {
1726 ccu->
value = ccu->
value + (*it).second->value;
1732 if (ccu->
nmod == 0) {
1740 if (
title.find(
"QTestAlarm") != std::string::npos) {
1741 for (i_ccu =
ccuMap.begin(); i_ccu !=
ccuMap.end(); i_ccu++) {
1742 TmCcu *ccu = i_ccu->second;
1743 if (ccu !=
nullptr) {
1748 for (it =
ret.first; it !=
ret.second; ++it) {
1749 if (!((*it).second->red == 0 && (*it).second->green == 255 && (*it).second->blue == 0) &&
1750 !((*it).second->red == 255 && (*it).second->green == 255 && (*it).second->blue == 255)) {
1761 for (i_ccu =
ccuMap.begin(); i_ccu !=
ccuMap.end(); i_ccu++) {
1762 TmCcu *ccu = i_ccu->second;
1763 if (ccu !=
nullptr) {
1773 for (i_ccu =
ccuMap.begin(); i_ccu !=
ccuMap.end(); i_ccu++) {
1774 TmCcu *ccu = i_ccu->second;
1775 if (ccu !=
nullptr && ccu->
count > 0) {
1778 if (maxvalue < ccu->
value)
1786 std::ostringstream outs;
1789 *
savefile <<
"<?xml version=\"1.0\" standalone=\"no\" ?>" << std::endl;
1790 *
savefile <<
"<svg xmlns=\"http://www.w3.org/2000/svg\"" << std::endl;
1791 *
savefile <<
"xmlns:svg=\"http://www.w3.org/2000/svg\" " << std::endl;
1792 *
savefile <<
"xmlns:xlink=\"http://www.w3.org/1999/xlink\">" << std::endl;
1793 *
savefile <<
"<svg:svg id=\"mainMap\" x=\"0\" y=\"0\" viewBox=\"0 0 3000 1600" 1794 <<
"\" width=\"" <<
width <<
"\" height=\"" << height <<
"\">" << std::endl;
1795 *
savefile <<
"<svg:rect fill=\"lightblue\" stroke=\"none\" x=\"0\" y=\"0\" width=\"3000\" height=\"1600\" /> " 1797 *
savefile <<
"<svg:g id=\"fedtrackermap\" transform=\"translate(10,1500) rotate(270)\" " 1798 "style=\"fill:none;stroke:black;stroke-width:0;\"> " 1801 for (
int crate = 1; crate < (
nfeccrates + 1); crate++) {
1804 std::ostringstream outs;
1807 *
savefile <<
"<?xml version=\"1.0\" standalone=\"no\"?>" << std::endl;
1808 *
savefile <<
"<svg xmlns=\"http://www.w3.org/2000/svg\"" << std::endl;
1809 *
savefile <<
"xmlns:svg=\"http://www.w3.org/2000/svg\"" << std::endl;
1810 *
savefile <<
"xmlns:xlink=\"http://www.w3.org/1999/xlink\" >" << std::endl;
1811 *
savefile <<
"<script type=\"text/ecmascript\" xlink:href=\"feccrate.js\" />" << std::endl;
1812 *
savefile <<
"<svg id=\"mainMap\" x=\"0\" y=\"0\" viewBox=\"0 0 500 500\" width=\"700\" height=\"700\" " 1813 "onload=\"TrackerCrate.init()\">" 1815 *
savefile <<
"<rect fill=\"lightblue\" stroke=\"none\" x=\"0\" y=\"0\" width=\"700\" height=\"700\" />" 1817 *
savefile <<
"<g id=\"crate\" transform=\" translate(280,580) rotate(270) scale(.7,.8)\" > " << std::endl;
1822 for (i_ccu =
ccuMap.begin(); i_ccu !=
ccuMap.end(); i_ccu++) {
1823 TmCcu *ccu = i_ccu->second;
1824 if (ccu !=
nullptr) {
1833 *
savefile <<
"</g> </svg> <text id=\"currentElementText\" x=\"40\" y=\"30\"> " << std::endl;
1834 *
savefile <<
"<tspan id=\"line1\" x=\"40\" y=\"30\"> </tspan> " << std::endl;
1835 *
savefile <<
"<tspan id=\"line2\" x=\"40\" y=\"60\"> </tspan> " << std::endl;
1836 *
savefile <<
" </text> </svg>" << std::endl;
1843 *
savefile <<
"</g> </svg> </svg> " << std::endl;
1846 if (!print_total && !useCcuValue) {
1848 for (i_ccu =
ccuMap.begin(); i_ccu !=
ccuMap.end(); i_ccu++) {
1849 TmCcu *ccu = i_ccu->second;
1850 if (ccu !=
nullptr) {
1860 const char *command1;
1864 std::ifstream tempfile(tempfilename.c_str(),
std::ios::in);
1865 TCanvas *MyC =
new TCanvas(
"MyC",
"TrackerMap",
width, height);
1866 gPad->SetFillColor(38);
1869 gPad->Range(0, 0, 3700, 1600);
1871 gPad->Range(0, 0, 3800, 1600);
1875 typedef std::map<int, int> ColorList;
1876 ColorList colorList;
1877 ColorList::iterator
pos;
1879 while (!tempfile.eof()) {
1881 colindex =
red + green * 1000 +
blue * 1000000;
1882 pos = colorList.find(colindex);
1883 if (
pos == colorList.end()) {
1884 colorList[colindex] = ncolor + 100;
1885 col = gROOT->GetColor(ncolor + 100);
1887 col->SetRGB((Double_t)(
red / 255.), (Double_t)(green / 255.), (Double_t)(
blue / 255.));
1889 c =
new TColor(ncolor + 100, (Double_t)(
red / 255.), (Double_t)(green / 255.), (Double_t)(
blue / 255.));
1895 tempfile >>
x[
i] >>
y[
i];
1898 if (ncolor > 0 && ncolor < 10000) {
1900 for (
int i = 0;
i < ncolor;
i++) {
1903 gStyle->SetPalette(ncolor,
colors);
1906 tempfile.seekg(0, std::ios::beg);
1907 std::cout <<
"created palette with " << ncolor <<
" colors" << std::endl;
1908 while (!tempfile.eof()) {
1911 tempfile >>
x[
i] >>
y[
i];
1913 colindex =
red + green * 1000 +
blue * 1000000;
1914 pos = colorList.find(colindex);
1915 if (
pos != colorList.end()) {
1916 TPolyLine *pline =
new TPolyLine(
npoints,
y,
x);
1917 vp.push_back(pline);
1918 pline->SetFillColor(colorList[colindex]);
1919 pline->SetLineWidth(0);
1930 axis =
new TGaxis(3660, 36, 3660, 1530, lminvalue, lmaxvalue, 510,
"+L");
1931 axis->SetLabelSize(0.02);
1937 l.SetTextSize(0.05);
1939 if (
tkMapLog && (fulltitle.find(
"Log10 scale") == std::string::npos))
1940 fulltitle +=
": Log10 scale";
1941 l.DrawLatex(50, 1530, fulltitle.c_str());
1959 std::cout <<
"Executing " << command1 << std::endl;
1965 for (std::vector<TPolyLine *>::iterator pos1 = vp.begin(); pos1 != vp.end(); pos1++) {
1973 bool print_total,
float minval,
float maxval,
std::string s,
int width,
int height) {
1976 std::vector<TPolyLine *> vp;
1977 TGaxis *axis =
nullptr;
1988 std::ostringstream outs;
1995 std::map<int, TmPsu *>::iterator ipsu;
1996 std::multimap<TmPsu *, TmModule *>::iterator it;
1997 std::pair<std::multimap<TmPsu *, TmModule *>::iterator, std::multimap<TmPsu *, TmModule *>::iterator>
ret;
1999 bool usePsuValue =
false;
2001 for (ipsu =
psuMap.begin(); ipsu !=
psuMap.end(); ipsu++) {
2002 TmPsu *psu = ipsu->second;
2003 if (psu !=
nullptr) {
2013 for (ipsu =
psuMap.begin(); ipsu !=
psuMap.end(); ipsu++) {
2014 TmPsu *psu = ipsu->second;
2015 if (psu !=
nullptr) {
2019 for (it =
ret.first; it !=
ret.second; ++it) {
2020 if ((*it).second->HVchannel == 2 && (*it).second->count > 0) {
2024 if ((*it).second->HVchannel == 3 && (*it).second->count > 0) {
2029 if (psu->
nmodHV2 != 0 && nconn1 > 0) {
2033 if (psu->
nmodHV3 != 0 && nconn2 > 0) {
2041 if (
title.find(
"QTestAlarm") != std::string::npos) {
2042 for (ipsu =
psuMap.begin(); ipsu !=
psuMap.end(); ipsu++) {
2043 TmPsu *psu = ipsu->second;
2044 if (psu !=
nullptr) {
2052 for (it =
ret.first; it !=
ret.second; ++it) {
2053 if ((*it).second->HVchannel == 2) {
2054 if (!((*it).second->red == 0 && (*it).second->green == 255 && (*it).second->blue == 0) &&
2055 !((*it).second->red == 255 && (*it).second->green == 255 && (*it).second->blue == 255)) {
2061 if ((*it).second->HVchannel == 3) {
2062 if (!((*it).second->red == 0 && (*it).second->green == 255 && (*it).second->blue == 0) &&
2063 !((*it).second->red == 255 && (*it).second->green == 255 && (*it).second->blue == 255)) {
2075 for (ipsu =
psuMap.begin(); ipsu !=
psuMap.end(); ipsu++) {
2076 TmPsu *psu = ipsu->second;
2077 if (psu !=
nullptr) {
2090 for (ipsu =
psuMap.begin(); ipsu !=
psuMap.end(); ipsu++) {
2091 TmPsu *psu = ipsu->second;
2095 if (maxvalue < psu->valueHV2 || maxvalue < psu->valueHV3)
2103 std::ostringstream outs;
2106 *
savefile <<
"<?xml version=\"1.0\" standalone=\"no\" ?>" << std::endl;
2107 *
savefile <<
"<svg xmlns=\"http://www.w3.org/2000/svg\"" << std::endl;
2108 *
savefile <<
"xmlns:svg=\"http://www.w3.org/2000/svg\" " << std::endl;
2109 *
savefile <<
"xmlns:xlink=\"http://www.w3.org/1999/xlink\">" << std::endl;
2110 *
savefile <<
"<svg:svg id=\"mainMap\" x=\"0\" y=\"0\" viewBox=\"0 0 3000 1600" 2111 <<
"\" width=\"" <<
width <<
"\" height=\"" << height <<
"\">" << std::endl;
2112 *
savefile <<
"<svg:rect fill=\"lightblue\" stroke=\"none\" x=\"0\" y=\"0\" width=\"3000\" height=\"1600\" /> " 2114 *
savefile <<
"<svg:g id=\"HVtrackermap\" transform=\"translate(10,1500) rotate(270)\" " 2115 "style=\"fill:none;stroke:black;stroke-width:0;\"> " 2119 for (
int irack = 1; irack < (
npsuracks + 1); irack++) {
2122 std::ostringstream outs;
2125 *
savefile <<
"<?xml version=\"1.0\" standalone=\"no\"?>" << std::endl;
2126 *
savefile <<
"<svg xmlns=\"http://www.w3.org/2000/svg\"" << std::endl;
2127 *
savefile <<
"xmlns:svg=\"http://www.w3.org/2000/svg\"" << std::endl;
2128 *
savefile <<
"xmlns:xlink=\"http://www.w3.org/1999/xlink\" >" << std::endl;
2129 *
savefile <<
"<script type=\"text/ecmascript\" xlink:href=\"rackhv.js\" />" << std::endl;
2130 *
savefile <<
"<svg id=\"mainMap\" x=\"0\" y=\"0\" viewBox=\"0 0 500 500\" width=\"700\" height=\"700\" " 2131 "onload=\"TrackerRackhv.init()\">" 2133 *
savefile <<
"<rect fill=\"lightblue\" stroke=\"none\" x=\"0\" y=\"0\" width=\"700\" height=\"700\" />" 2135 *
savefile <<
"<g id=\"rackhv\" transform=\" translate(150,500) rotate(270) scale(1.,1.)\" > " << std::endl;
2140 for (ipsu =
psuMap.begin(); ipsu !=
psuMap.end(); ipsu++) {
2141 TmPsu *psu = ipsu->second;
2144 drawHV3(irack, psu->getPsuCrate(), print_total, psu,
savefile, usePsuValue);
2150 *
savefile <<
"</g> </svg> <text id=\"currentElementText\" x=\"40\" y=\"30\"> " << std::endl;
2151 *
savefile <<
"<tspan id=\"line1\" x=\"40\" y=\"30\"> </tspan> " << std::endl;
2152 *
savefile <<
"<tspan id=\"line2\" x=\"40\" y=\"60\"> </tspan> " << std::endl;
2153 *
savefile <<
" </text> </svg>" << std::endl;
2160 *
savefile <<
"</g> </svg> </svg> " << std::endl;
2165 if (!print_total && !usePsuValue) {
2166 for (ipsu =
psuMap.begin(); ipsu !=
psuMap.end(); ipsu++) {
2167 TmPsu *psu = ipsu->second;
2168 if (psu !=
nullptr) {
2180 const char *command1;
2184 std::ifstream tempfile(tempfilename.c_str(),
std::ios::in);
2185 TCanvas *MyC =
new TCanvas(
"MyC",
"TrackerMap",
width, height);
2186 gPad->SetFillColor(38);
2189 gPad->Range(0, 0, 3700, 1600);
2191 gPad->Range(0, 0, 3800, 1600);
2195 typedef std::map<int, int> ColorList;
2196 ColorList colorList;
2197 ColorList::iterator
pos;
2199 while (!tempfile.eof()) {
2201 colindex =
red + green * 1000 +
blue * 1000000;
2202 pos = colorList.find(colindex);
2203 if (
pos == colorList.end()) {
2204 colorList[colindex] = ncolor + 100;
2205 col = gROOT->GetColor(ncolor + 100);
2207 col->SetRGB((Double_t)(
red / 255.), (Double_t)(green / 255.), (Double_t)(
blue / 255.));
2209 c =
new TColor(ncolor + 100, (Double_t)(
red / 255.), (Double_t)(green / 255.), (Double_t)(
blue / 255.));
2215 tempfile >>
x[
i] >>
y[
i];
2218 if (ncolor > 0 && ncolor < 10000) {
2220 for (
int i = 0;
i < ncolor;
i++) {
2223 gStyle->SetPalette(ncolor,
colors);
2226 tempfile.seekg(0, std::ios::beg);
2227 std::cout <<
"created palette with " << ncolor <<
" colors" << std::endl;
2228 while (!tempfile.eof()) {
2231 tempfile >>
x[
i] >>
y[
i];
2233 colindex =
red + green * 1000 +
blue * 1000000;
2234 pos = colorList.find(colindex);
2235 if (
pos != colorList.end()) {
2236 TPolyLine *pline =
new TPolyLine(
npoints,
y,
x);
2237 vp.push_back(pline);
2238 pline->SetFillColor(colorList[colindex]);
2239 pline->SetLineWidth(0);
2250 axis =
new TGaxis(3660, 36, 3660, 1530, lminvalue, lmaxvalue, 510,
"+L");
2251 axis->SetLabelSize(0.02);
2257 l.SetTextSize(0.05);
2259 if (
tkMapLog && (fulltitle.find(
"Log10 scale") == std::string::npos))
2260 fulltitle +=
": Log10 scale";
2261 l.DrawLatex(50, 1530, fulltitle.c_str());
2279 std::cout <<
"Executing " << command1 << std::endl;
2285 for (std::vector<TPolyLine *>::iterator pos1 = vp.begin(); pos1 != vp.end(); pos1++) {
2294 bool print_total,
float minval,
float maxval,
std::string s,
int width,
int height) {
2297 bool rangefound =
true;
2299 std::vector<TPolyLine *> vp;
2300 TGaxis *axis =
nullptr;
2312 std::ostringstream outs;
2319 std::map<int, TmPsu *>::iterator ipsu;
2320 std::multimap<TmPsu *, TmModule *>::iterator it;
2321 std::pair<std::multimap<TmPsu *, TmModule *>::iterator, std::multimap<TmPsu *, TmModule *>::iterator>
ret;
2324 bool usePsuValue =
false;
2326 for (ipsu =
psuMap.begin(); ipsu !=
psuMap.end(); ipsu++) {
2327 TmPsu *psu = ipsu->second;
2328 if (psu !=
nullptr) {
2329 if (psu->
count > 0 || psu->
red != -1) {
2337 for (ipsu =
psuMap.begin(); ipsu !=
psuMap.end(); ipsu++) {
2338 TmPsu *psu = ipsu->second;
2339 if (psu !=
nullptr) {
2342 for (it =
ret.first; it !=
ret.second; ++it) {
2343 if ((*it).second->count > 0) {
2345 psu->
value = psu->
value + (*it).second->value;
2356 if (
title.find(
"QTestAlarm") != std::string::npos) {
2357 for (ipsu =
psuMap.begin(); ipsu !=
psuMap.end(); ipsu++) {
2358 TmPsu *psu = ipsu->second;
2359 if (psu !=
nullptr) {
2364 for (it =
ret.first; it !=
ret.second; ++it) {
2365 if (!((*it).second->red == 0 && (*it).second->green == 255 && (*it).second->blue == 0) &&
2366 !((*it).second->red == 255 && (*it).second->green == 255 && (*it).second->blue == 255)) {
2380 for (ipsu =
psuMap.begin(); ipsu !=
psuMap.end(); ipsu++) {
2381 TmPsu *psu = ipsu->second;
2382 if (psu !=
nullptr) {
2393 for (ipsu =
psuMap.begin(); ipsu !=
psuMap.end(); ipsu++) {
2394 TmPsu *psu = ipsu->second;
2395 if (psu !=
nullptr && psu->
count > 0) {
2399 if (maxvalue < psu->
value)
2409 std::ostringstream outs;
2412 *
savefile <<
"<?xml version=\"1.0\" standalone=\"no\" ?>" << std::endl;
2413 *
savefile <<
"<svg xmlns=\"http://www.w3.org/2000/svg\"" << std::endl;
2414 *
savefile <<
"xmlns:svg=\"http://www.w3.org/2000/svg\" " << std::endl;
2415 *
savefile <<
"xmlns:xlink=\"http://www.w3.org/1999/xlink\">" << std::endl;
2416 *
savefile <<
"<svg:svg id=\"mainMap\" x=\"0\" y=\"0\" viewBox=\"0 0 3000 1600" 2417 <<
"\" width=\"" <<
width <<
"\" height=\"" << height <<
"\">" << std::endl;
2418 *
savefile <<
"<svg:rect fill=\"lightblue\" stroke=\"none\" x=\"0\" y=\"0\" width=\"3000\" height=\"1600\" /> " 2420 *
savefile <<
"<svg:g id=\"psutrackermap\" transform=\"translate(10,1500) rotate(270)\" " 2421 "style=\"fill:none;stroke:black;stroke-width:0;\"> " 2425 for (
int irack = 1; irack < (
npsuracks + 1); irack++) {
2428 std::ostringstream outs;
2431 *
savefile <<
"<?xml version=\"1.0\" standalone=\"no\"?>" << std::endl;
2432 *
savefile <<
"<svg xmlns=\"http://www.w3.org/2000/svg\"" << std::endl;
2433 *
savefile <<
"xmlns:svg=\"http://www.w3.org/2000/svg\"" << std::endl;
2434 *
savefile <<
"xmlns:xlink=\"http://www.w3.org/1999/xlink\" >" << std::endl;
2435 *
savefile <<
"<script type=\"text/ecmascript\" xlink:href=\"rack.js\" />" << std::endl;
2436 *
savefile <<
"<svg id=\"mainMap\" x=\"0\" y=\"0\" viewBox=\"0 0 500 500\" width=\"700\" height=\"700\" " 2437 "onload=\"TrackerCrate.init()\">" 2439 *
savefile <<
"<rect fill=\"lightblue\" stroke=\"none\" x=\"0\" y=\"0\" width=\"700\" height=\"700\" />" 2441 *
savefile <<
"<g id=\"rack\" transform=\" translate(150,500) rotate(270) scale(1.,1.)\" > " << std::endl;
2446 for (ipsu =
psuMap.begin(); ipsu !=
psuMap.end(); ipsu++) {
2447 TmPsu *psu = ipsu->second;
2455 *
savefile <<
"</g> </svg> <text id=\"currentElementText\" x=\"40\" y=\"30\"> " << std::endl;
2456 *
savefile <<
"<tspan id=\"line1\" x=\"40\" y=\"30\"> </tspan> " << std::endl;
2457 *
savefile <<
"<tspan id=\"line2\" x=\"40\" y=\"60\"> </tspan> " << std::endl;
2458 *
savefile <<
" </text> </svg>" << std::endl;
2465 *
savefile <<
"</g> </svg> </svg> " << std::endl;
2470 if (!print_total && !usePsuValue) {
2471 for (ipsu =
psuMap.begin(); ipsu !=
psuMap.end(); ipsu++) {
2472 TmPsu *psu = ipsu->second;
2473 if (psu !=
nullptr) {
2487 const char *command1;
2491 std::ifstream tempfile(tempfilename.c_str(),
std::ios::in);
2492 TCanvas *MyC =
new TCanvas(
"MyC",
"TrackerMap",
width, height);
2493 gPad->SetFillColor(38);
2496 std::cout <<
" range x " << rangex << std::endl;
2497 std::cout <<
" range y " << rangey << std::endl;
2498 gPad->Range(0, 0, rangex, rangey);
2502 typedef std::map<int, int> ColorList;
2503 ColorList colorList;
2504 ColorList::iterator
pos;
2506 while (!tempfile.eof()) {
2508 colindex =
red + green * 1000 +
blue * 1000000;
2509 pos = colorList.find(colindex);
2510 if (
pos == colorList.end()) {
2511 colorList[colindex] = ncolor + 100;
2512 col = gROOT->GetColor(ncolor + 100);
2514 col->SetRGB((Double_t)(
red / 255.), (Double_t)(green / 255.), (Double_t)(
blue / 255.));
2516 c =
new TColor(ncolor + 100, (Double_t)(
red / 255.), (Double_t)(green / 255.), (Double_t)(
blue / 255.));
2521 tempfile >>
x[
i] >>
y[
i];
2524 if (ncolor > 0 && ncolor < 10000) {
2526 for (
int i = 0;
i < ncolor;
i++) {
2529 gStyle->SetPalette(ncolor,
colors);
2532 tempfile.seekg(0, std::ios::beg);
2533 std::cout <<
"created palette with " << ncolor <<
" colors" << std::endl;
2534 while (!tempfile.eof()) {
2537 tempfile >>
x[
i] >>
y[
i];
2539 colindex =
red + green * 1000 +
blue * 1000000;
2540 pos = colorList.find(colindex);
2541 if (
pos != colorList.end()) {
2542 TPolyLine *pline =
new TPolyLine(
npoints,
y,
x);
2543 vp.push_back(pline);
2544 pline->SetFillColor(colorList[colindex]);
2545 pline->SetLineWidth(0);
2556 axis =
new TGaxis(rangex - 140, 34, rangex - 140, rangey - 106, lminvalue, lmaxvalue, 510,
"+L");
2557 axis->SetLabelSize(0.02);
2563 l.SetTextSize(0.05);
2565 if (
tkMapLog && (fulltitle.find(
"Log10 scale") == std::string::npos))
2566 fulltitle +=
": Log10 scale";
2567 l.DrawLatex(50, rangey - 200, fulltitle.c_str());
2585 std::cout <<
"Executing " << command1 << std::endl;
2591 for (std::vector<TPolyLine *>::iterator pos1 = vp.begin(); pos1 != vp.end(); pos1++) {
2600 bool print_total,
float minval,
float maxval,
std::string s,
int width,
int height) {
2603 bool rangefound =
true;
2605 std::vector<TPolyLine *> vp;
2606 TGaxis *axis =
nullptr;
2616 std::ostringstream outs;
2622 std::map<int, TmApvPair *>::iterator i_apv;
2623 std::map<int, int>::iterator i_fed;
2625 bool useApvPairValue =
false;
2626 for (i_apv =
apvMap.begin(); i_apv !=
apvMap.end(); i_apv++) {
2628 if (apvPair !=
nullptr) {
2630 if (apv_mod !=
nullptr && !apv_mod->
notInUse()) {
2631 if (apvPair->
count > 0 || apvPair->
red != -1) {
2632 useApvPairValue =
true;
2639 for (i_apv =
apvMap.begin(); i_apv !=
apvMap.end(); i_apv++) {
2641 if (apvPair !=
nullptr) {
2643 if (apv_mod !=
nullptr && !apv_mod->
notInUse()) {
2644 if (useApvPairValue)
2646 else if (apvPair->
mpos == 0 && apv_mod->
count > 0)
2656 for (i_apv =
apvMap.begin(); i_apv !=
apvMap.end(); i_apv++) {
2658 if (apvPair !=
nullptr) {
2660 if (apv_mod !=
nullptr && !apv_mod->
notInUse()) {
2661 if (useApvPairValue) {
2665 if (maxvalue < apvPair->
value)
2668 if (apv_mod->
count > 0) {
2672 if (maxvalue < apv_mod->
value)
2685 std::ostringstream outs;
2688 *
savefile <<
"<?xml version=\"1.0\" standalone=\"no\" ?>" << std::endl;
2689 *
savefile <<
"<svg xmlns=\"http://www.w3.org/2000/svg\"" << std::endl;
2690 *
savefile <<
"xmlns:svg=\"http://www.w3.org/2000/svg\" " << std::endl;
2691 *
savefile <<
"xmlns:xlink=\"http://www.w3.org/1999/xlink\">" << std::endl;
2692 *
savefile <<
"<svg:svg id=\"mainMap\" x=\"0\" y=\"0\" viewBox=\"0 0 3000 1600" 2693 <<
"\" width=\"" <<
width <<
"\" height=\"" << height <<
"\">" << std::endl;
2694 *
savefile <<
"<svg:rect fill=\"lightblue\" stroke=\"none\" x=\"0\" y=\"0\" width=\"3000\" height=\"1600\" /> " 2696 *
savefile <<
"<svg:g id=\"fedtrackermap\" transform=\"translate(10,1500) rotate(270)\" " 2697 "style=\"fill:none;stroke:black;stroke-width:0;\"> " 2703 std::ostringstream outs;
2706 *
savefile <<
"<?xml version=\"1.0\" standalone=\"no\"?>" << std::endl;
2707 *
savefile <<
"<svg xmlns=\"http://www.w3.org/2000/svg\"" << std::endl;
2708 *
savefile <<
"xmlns:svg=\"http://www.w3.org/2000/svg\"" << std::endl;
2709 *
savefile <<
"xmlns:xlink=\"http://www.w3.org/1999/xlink\" >" << std::endl;
2710 *
savefile <<
"<script type=\"text/ecmascript\" xlink:href=\"crate.js\" />" << std::endl;
2711 *
savefile <<
"<svg id=\"mainMap\" x=\"0\" y=\"0\" viewBox=\"0 0 500 500\" width=\"700\" height=\"700\" " 2712 "onload=\"TrackerCrate.init()\">" 2714 *
savefile <<
"<rect fill=\"lightblue\" stroke=\"none\" x=\"0\" y=\"0\" width=\"700\" height=\"700\" />" 2716 *
savefile <<
"<g id=\"crate\" transform=\" translate(150,500) rotate(270) scale(1.,1.)\" > " << std::endl;
2720 int numfed_incrate = 0;
2721 for (i_fed =
fedMap.begin(); i_fed !=
fedMap.end(); i_fed++) {
2722 if (i_fed->second == crate) {
2723 int fedId = i_fed->first;
2741 for (
int nconn = 0; nconn < 96; nconn++) {
2744 if (apvPair !=
nullptr) {
2746 if (apv_mod !=
nullptr && !apv_mod->
notInUse()) {
2755 *
savefile <<
"</g> </svg> <text id=\"currentElementText\" x=\"40\" y=\"30\"> " << std::endl;
2756 *
savefile <<
"<tspan id=\"line1\" x=\"40\" y=\"30\"> </tspan> " << std::endl;
2757 *
savefile <<
"<tspan id=\"line2\" x=\"40\" y=\"60\"> </tspan> " << std::endl;
2758 *
savefile <<
" </text> </svg>" << std::endl;
2766 *
savefile <<
"</g> </svg> </svg> " << std::endl;
2770 if (!print_total && !useApvPairValue) {
2772 for (i_apv =
apvMap.begin(); i_apv !=
apvMap.end(); i_apv++) {
2774 if (apvPair !=
nullptr) {
2776 if (apv_mod !=
nullptr && apvPair->
mpos == 0 && !apv_mod->
notInUse()) {
2792 const char *command1;
2796 std::ifstream tempfile(tempfilename.c_str(),
std::ios::in);
2797 TCanvas *MyC =
new TCanvas(
"MyC",
"TrackerMap",
width, height);
2798 gPad->SetFillColor(38);
2801 std::cout <<
" range x " << rangex << std::endl;
2802 std::cout <<
" range y " << rangey << std::endl;
2803 gPad->Range(0, 0, rangex, rangey);
2807 typedef std::map<int, int> ColorList;
2808 ColorList colorList;
2809 ColorList::iterator
pos;
2811 while (!tempfile.eof()) {
2813 colindex =
red + green * 1000 +
blue * 1000000;
2814 pos = colorList.find(colindex);
2815 if (
pos == colorList.end()) {
2816 colorList[colindex] = ncolor + 100;
2817 col = gROOT->GetColor(ncolor + 100);
2819 col->SetRGB((Double_t)(
red / 255.), (Double_t)(green / 255.), (Double_t)(
blue / 255.));
2821 c =
new TColor(ncolor + 100, (Double_t)(
red / 255.), (Double_t)(green / 255.), (Double_t)(
blue / 255.));
2826 tempfile >>
x[
i] >>
y[
i];
2829 if (ncolor > 0 && ncolor < 10000) {
2831 for (
int i = 0;
i < ncolor;
i++) {
2834 gStyle->SetPalette(ncolor,
colors);
2837 tempfile.seekg(0, std::ios::beg);
2838 std::cout <<
"created palette with " << ncolor <<
" colors" << std::endl;
2839 while (!tempfile.eof()) {
2842 tempfile >>
x[
i] >>
y[
i];
2844 colindex =
red + green * 1000 +
blue * 1000000;
2845 pos = colorList.find(colindex);
2846 if (
pos != colorList.end()) {
2847 TPolyLine *pline =
new TPolyLine(
npoints,
y,
x);
2848 vp.push_back(pline);
2849 pline->SetFillColor(colorList[colindex]);
2850 pline->SetLineWidth(0);
2861 axis =
new TGaxis(rangex - 140, 34, rangex - 140, rangey - 106, lminvalue, lmaxvalue, 510,
"+L");
2862 axis->SetLabelSize(0.02);
2868 l.SetTextSize(0.05);
2870 if (
tkMapLog && (fulltitle.find(
"Log10 scale") == std::string::npos))
2871 fulltitle +=
": Log10 scale";
2872 l.DrawLatex(50, rangey - 200, fulltitle.c_str());
2890 std::cout <<
"Executing " << command1 << std::endl;
2896 for (std::vector<TPolyLine *>::iterator pos1 = vp.begin(); pos1 != vp.end(); pos1++) {
2907 int ipos, ipos1, ipos2,
id = 0,
val = 0;
2910 ipos1 =
line.find(
"value=\"");
2913 ipos =
value.find(
'\"');
2917 ipos2 =
line.find(
"detid=\"");
2920 ipos =
value.find(
'\"');
2922 id = atoi(
value.c_str());
2924 if (ipos1 > 0 && ipos2 > 0 &&
val > 0)
2926 if (ipos1 > 0 && ipos2 > 0)
2930 std::cout << nline <<
" modules found in this svg file " << std::endl;
2940 std::ostringstream outs;
2961 if (
mod !=
nullptr && !
mod->notInUse()) {
2976 if (
mod !=
nullptr && !
mod->notInUse()) {
2979 if (maxvalue < mod->
value)
2993 if (
mod !=
nullptr && !
mod->notInUse()) {
2999 *
svgfile <<
"</svg:g></svg:svg>" << std::endl;
3000 *
svgfile <<
" <svg:text id=\"Title\" class=\"normalText\" x=\"300\" y=\"0\">" <<
title <<
"</svg:text>" << std::endl;
3003 *
svgfile <<
"</svg:svg>" << std::endl;
3004 *
svgfile <<
"</body></html>" << std::endl;
3010 std::cout <<
"preparing the palette" << std::endl;
3013 int paletteLength = 250;
3020 for (
int i = 1;
i < paletteLength + 1;
i++) {
3022 red = (color >> 16) & 0xFF;
3023 green = (color >> 8) & 0xFF;
3024 blue = (color)&0xFF;
3036 *
svgfile <<
"<svg:rect x=\"3610\" y=\"" << (1550 - 6 *
i) <<
"\" width=\"50\" height=\"6\" fill=\"rgb(" <<
red 3037 <<
"," << green <<
"," <<
blue <<
")\" />\n";
3047 *
svgfile <<
"<svg:rect x=\"3610\" y=\"" << (1550 - 6 *
i)
3048 <<
"\" width=\"50\" height=\"1\" fill=\"black\" />\n";
3050 *
svgfile <<
" <svg:text class=\"normalText\" x=\"3660\" y=\"" << (1560 - 6 *
i) <<
"\">" <<
val 3051 <<
"</svg:text>" << std::endl;
3061 if (apvpair !=
nullptr) {
3063 apvpair->
green = green;
3067 std::cout <<
"*** error in FedTrackerMap fillc method ***";
3071 std::multimap<const int, TmApvPair *>::iterator
pos;
3074 if (apvpair !=
nullptr) {
3080 std::cout <<
"*** error in FedTrackerMap fill by module method ***";
3087 if (apvpair !=
nullptr) {
3088 apvpair->
value = current_val;
3092 std::cout <<
"*** error in FedTrackerMap fill_current_val method ***";
3096 int key = crate * 10000000 + slot * 100000 +
ring * 1000 +
addr;
3100 if (ccu !=
nullptr) {
3106 std::cout <<
"*** error in FecTrackerMap fillc method ***";
3110 int key = crate * 10000000 + slot * 100000 +
ring * 1000 +
addr;
3112 if (ccu !=
nullptr) {
3118 std::cout <<
"*** error in FecTrackerMap fill by module method ***";
3122 int key = rack * 1000 + crate * 100 + board;
3126 if (psu !=
nullptr) {
3132 std::cout <<
"*** error in LVTrackerMap fillc method ***";
3136 int key = rack * 1000 + crate * 100 + board;
3138 if (psu !=
nullptr) {
3144 std::cout <<
"*** error in LVTrackerMap fill by module method ***";
3148 int key = rack * 1000 + crate * 100 + board;
3152 if (psu !=
nullptr) {
3158 std::cout <<
"*** error in HVTrackerMap (channel 2) fillc method ***";
3161 int key = rack * 1000 + crate * 100 + board;
3165 if (psu !=
nullptr) {
3171 std::cout <<
"*** error in HVTrackerMap (channel 3) fillc method ***";
3175 int key = rack * 1000 + crate * 100 + board;
3177 if (psu !=
nullptr) {
3183 std::cout <<
"*** error in HVTrackerMap fill by module method ***";
3186 int key = rack * 1000 + crate * 100 + board;
3188 if (psu !=
nullptr) {
3194 std::cout <<
"*** error in HVTrackerMap fill by module method ***";
3200 if (apvpair !=
nullptr) {
3204 std::cout <<
"*** error in FedTrackerMap module method ***";
3209 if (apvpair !=
nullptr) {
3214 std::cout <<
"*** error inFedTrackerMap fill method ***";
3219 if (
mod !=
nullptr) {
3225 std::cout <<
"**************************error in fill method **************module " <<
idmod << std::endl;
3231 if (
mod !=
nullptr) {
3237 std::cout <<
"**************************error in fill method **************" << std::endl;
3241 std::map<const int, TmModule *>::iterator imod;
3243 fillc(imod->first, 255, 255, 255);
3248 std::map<const int, TmModule *>::iterator imod;
3256 if (
mod !=
nullptr) {
3257 mod->value = current_val;
3261 std::cout <<
"**error in fill_current_val method ***module " <<
idmod << std::endl;
3266 if (
mod !=
nullptr) {
3267 mod->value =
mod->value + qty;
3273 if (mod1 !=
nullptr && mod2 !=
nullptr) {
3281 std::cout <<
"**************************error in fill method **************module " <<
idmod << std::endl;
3287 if (
mod !=
nullptr) {
3288 mod->value =
mod->value + qty;
3291 std::cout <<
"**************************error in SvgModuleMap **************";
3296 if (
mod !=
nullptr) {
3299 std::cout <<
"**************************error in IdModuleMap **************";
3305 if (
mod !=
nullptr) {
3308 std::cout <<
"**************************error in SvgModuleMap **************";
3314 int nmods, pix_sil, fow_bar,
ring, nmod,
layer;
3316 float posx, posy, posz, length,
width,
thickness, widthAtHalfLength;
3317 int iModule = 0, old_layer = 0, ntotMod = 0;
3321 infile >> nmods >> pix_sil >> fow_bar >>
layer >>
ring >> nmod >> posx >> posy >> posz >> length >>
width >>
3325 if (old_layer !=
layer) {
3345 mod->length = length;
3348 mod->widthAtHalfLength = widthAtHalfLength;
3358 float lminvalue, lmaxvalue;
3371 float delta = (lmaxvalue - lminvalue);
3372 float x = (
value - lminvalue);
3373 if (
value < lminvalue) {
3378 if (
value > lmaxvalue) {
3383 if (
value >= lminvalue &&
value <= lmaxvalue) {
3387 : (
x > ((3. / 4.) *
delta) ? 255 - 255 / (
delta / 4) * (
x - (3. / 4.) *
delta) : 255));
3389 : (
x > ((1. / 2.) *
delta) ? 0 : 255 - 255 / (
delta / 4) * (
x - (1. / 4.) *
delta)));
3393 green = (
int)((
value - lminvalue) / (lmaxvalue - lminvalue) * 256.);
3398 green = 255 - green;
3401 return (
blue | (green << 8) | (
red << 16));
3405 std::ofstream *ofilename;
3406 std::ifstream *ifilename;
3407 std::ostringstream
ofname;
3412 ifilename =
findfile(
"viewerHeader.xhtml");
3415 while (getline(*ifilename,
line)) {
3416 *ofilename <<
line << std::endl;
3418 *ofilename <<
" var tmapname=\"" <<
outputfilename <<
"\"" << std::endl;
3419 *ofilename <<
" var tmaptitle=\"" <<
title <<
"\"" << std::endl;
3420 *ofilename <<
" var ncrates=" <<
ncrates <<
";" << std::endl;
3421 *ofilename <<
" var nfeccrates=" <<
nfeccrates <<
";" << std::endl;
3422 *ofilename <<
" var npsuracks=" <<
npsuracks <<
";" << std::endl;
3427 ifilename =
findfile(
"viewerTrailer.xhtml");
3428 while (getline(*ifilename,
line)) {
3429 *ofilename <<
line << std::endl;
3443 ifilename =
findfile(
"jqviewer.js");
3446 while (getline(*ifilename,
line)) {
3447 *ofilename <<
line << std::endl;
3458 while (getline(*ifilename,
line)) {
3459 *ofilename <<
line << std::endl;
3467 ifilename =
findfile(
"feccrate.js");
3470 while (getline(*ifilename,
line)) {
3471 *ofilename <<
line << std::endl;
3482 while (getline(*ifilename,
line)) {
3483 *ofilename <<
line << std::endl;
3494 while (getline(*ifilename,
line)) {
3495 *ofilename <<
line << std::endl;
3507 while (getline(*ifilename,
line)) {
3508 *ofilename <<
line << std::endl;
3516 std::ostringstream outs, outs1, outs2;
3525 std::ostringstream outs;
3528 *
txtfile <<
"<html><head></head> <body>" << std::endl;
3533 if (
mod !=
nullptr && !
mod->notInUse()) {
3536 *
txtfile <<
"<a name=" <<
idmod <<
"><pre>" << std::endl;
3537 std::multimap<const int, TmApvPair *>::iterator
pos;
3540 if (apvpair !=
nullptr) {
3545 *
txtfile <<
"</pre><h3>" <<
mod->name <<
"</h3>" << std::endl;
3549 *
txtfile <<
"</body></html>" << std::endl;
3559 std::map<int, int>::iterator i_fed;
3562 std::ostringstream outs;
3565 *
txtfile <<
"<html><head></head> <body>" << std::endl;
3566 for (i_fed =
fedMap.begin(); i_fed !=
fedMap.end(); i_fed++) {
3567 if (i_fed->second == crate) {
3568 int fedId = i_fed->first;
3569 for (
int nconn = 0; nconn < 96; nconn++) {
3572 if (apvPair !=
nullptr) {
3574 *
txtfile <<
"<a name=" <<
idmod <<
"><pre>" << std::endl;
3576 std::ostringstream outs;
3577 outs <<
"fedchannel " << apvPair->
getFedId() <<
"/" << apvPair->
getFedCh() <<
" connects to module " 3579 *
txtfile <<
"</pre><h3>" << outs.str() <<
"</h3>" << std::endl;
3584 *
txtfile <<
"</body></html>" << std::endl;
3590 std::ostringstream outs1, outs2;
3597 std::map<int, TmCcu *>::iterator i_ccu;
3598 std::multimap<TmCcu *, TmModule *>::iterator it;
3599 std::pair<std::multimap<TmCcu *, TmModule *>::iterator, std::multimap<TmCcu *, TmModule *>::iterator>
ret;
3600 for (
int crate = 1; crate < (
nfeccrates + 1); crate++) {
3601 std::ostringstream outs;
3604 *
txtfile <<
"<html><head></head> <body>" << std::endl;
3605 for (i_ccu =
ccuMap.begin(); i_ccu !=
ccuMap.end(); i_ccu++) {
3606 TmCcu *ccu = i_ccu->second;
3607 if (ccu !=
nullptr && ccu->
getCcuCrate() == crate) {
3609 *
txtfile <<
"<a name=" <<
idmod <<
"><pre>" << std::endl;
3611 std::ostringstream outs;
3613 outs <<
"ccu is in position" << ccu->
mpos <<
"in ring but doesn't seem to have any module connected";
3615 outs <<
"ccu is in position " << ccu->
mpos <<
" in ring and connects " << ccu->
nmod <<
" modules" 3618 for (it =
ret.first; it !=
ret.second; ++it) {
3619 outs << (*it).second->idex <<
" " << (*it).second->name <<
" value= " << (*it).second->value <<
"\n\n";
3622 *
txtfile <<
"</pre><h4>" << outs.str() <<
"</h4>" << std::endl;
3626 *
txtfile <<
"</body></html>" << std::endl;
3632 std::ostringstream outs3, outs4;
3641 std::map<int, TmPsu *>::iterator ipsu;
3642 std::multimap<TmPsu *, TmModule *>::iterator it;
3643 std::pair<std::multimap<TmPsu *, TmModule *>::iterator, std::multimap<TmPsu *, TmModule *>::iterator>
ret;
3644 for (
int rack = 1; rack < (
npsuracks + 1); rack++) {
3645 std::ostringstream outs;
3649 *
txtfile <<
"<html><head></head> <body>" << std::endl;
3650 for (ipsu =
psuMap.begin(); ipsu !=
psuMap.end(); ipsu++) {
3651 TmPsu *psu = ipsu->second;
3652 if (psu !=
nullptr && psu->
getPsuRack() == rack) {
3653 *
txtfile <<
"<a name=" << psu->
idex <<
"><pre>" << std::endl;
3655 std::ostringstream outs;
3658 <<
"in crate but doesn't seem to have any module connected";
3660 outs <<
"PS is in position " << psu->
getPsuBoard() <<
" in crate and connects to " << psu->
nmod 3661 <<
" modules. " << std::endl;
3664 for (it =
ret.first; it !=
ret.second; ++it) {
3665 outs << (*it).second->idex <<
" " << (*it).second->name <<
" value= " << (*it).second->value <<
" <br>" 3668 *
txtfile <<
"</pre><h4>" << outs.str() <<
"</h4>" << std::endl;
3672 *
txtfile <<
"</body></html>" << std::endl;
3679 std::ostringstream outs5, outs6;
3688 std::map<int, TmPsu *>::iterator ipsu;
3689 std::multimap<TmPsu *, TmModule *>::iterator it;
3690 std::pair<std::multimap<TmPsu *, TmModule *>::iterator, std::multimap<TmPsu *, TmModule *>::iterator>
ret;
3691 for (
int rack = 1; rack < (
npsuracks + 1); rack++) {
3692 std::ostringstream outs;
3696 *
txtfile <<
"<html><head></head> <body>" << std::endl;
3697 for (ipsu =
psuMap.begin(); ipsu !=
psuMap.end(); ipsu++) {
3698 TmPsu *psu = ipsu->second;
3699 if (psu !=
nullptr && psu->
getPsuRack() == rack) {
3700 *
txtfile <<
"<a name=" << psu->
idex <<
"><pre>" << std::endl;
3702 std::ostringstream outsHV2;
3704 outsHV2 <<
"HV Channel002 is in position" << psu->
getPsuBoard()
3705 <<
"in crate but doesn't seem to have any module connected";
3707 outsHV2 <<
"HV Channel002 is in position " << psu->
getPsuBoard() <<
" in crate and connects to " 3708 << psu->
nmodHV2 <<
" modules. " 3709 <<
" <br>" << std::endl;
3712 for (it =
ret.first; it !=
ret.second; ++it) {
3713 if ((*it).second->HVchannel == 2) {
3714 outsHV2 << (*it).second->idex <<
" " << (*it).second->name <<
" value= " << (*it).second->value
3715 <<
" <br>" << std::endl;
3718 *
txtfile <<
"</pre><h4>" << outsHV2.str() <<
"</h4>" << std::endl;
3722 std::ostringstream outsHV3;
3724 outsHV3 <<
"HV Channel003 is in position" << psu->
getPsuBoard()
3725 <<
"in crate but doesn't seem to have any module connected";
3727 outsHV3 <<
"HV Channel003 is in position " << psu->
getPsuBoard() <<
" in crate and connects to " 3728 << psu->
nmodHV3 <<
" modules. " 3729 <<
" <br>" << std::endl;
3732 for (it =
ret.first; it !=
ret.second; ++it) {
3733 if ((*it).second->HVchannel == 3) {
3734 outsHV3 << (*it).second->idex <<
" " << (*it).second->name <<
" value= " << (*it).second->value
3735 <<
" <br>" << std::endl;
3738 *
txtfile <<
"</pre><h4>" << outsHV3.str() <<
"</h4>" << std::endl;
3742 *
txtfile <<
"</body></html>" << std::endl;
3750 float minval, maxval;
3753 if (
tkMapLog && (minval < maxval)) {
3754 minval =
pow(10., minval1);
3755 maxval =
pow(10., maxval1);
3767 std::ofstream *ofilename;
3768 std::ifstream *ifilename;
3769 std::ostringstream
ofname;
3774 ifilename =
findfile(
"viewerHeader.xhtml");
3777 while (getline(*ifilename,
line)) {
3778 *ofilename <<
line << std::endl;
3780 *ofilename <<
" var tmapname=\"" <<
outputfilename <<
"\"" << std::endl;
3781 *ofilename <<
" var tmaptitle=\"" <<
title <<
"\"" << std::endl;
3782 *ofilename <<
" var ncrates=" <<
ncrates <<
";" << std::endl;
3783 *ofilename <<
" var nfeccrates=" <<
nfeccrates <<
";" << std::endl;
3784 *ofilename <<
" var npsuracks=" <<
npsuracks <<
";" << std::endl;
3787 ifilename =
findfile(
"viewerTrailer.xhtml");
3788 while (getline(*ifilename,
line)) {
3789 *ofilename <<
line << std::endl;
3803 ifilename =
findfile(
"jqviewer.js");
3806 while (getline(*ifilename,
line)) {
3807 *ofilename <<
line << std::endl;
3818 while (getline(*ifilename,
line)) {
3819 *ofilename <<
line << std::endl;
3827 ifilename =
findfile(
"feccrate.js");
3830 while (getline(*ifilename,
line)) {
3831 *ofilename <<
line << std::endl;
3842 while (getline(*ifilename,
line)) {
3843 *ofilename <<
line << std::endl;
3854 while (getline(*ifilename,
line)) {
3855 *ofilename <<
line << std::endl;
3866 while (getline(*ifilename,
line)) {
3867 *ofilename <<
line << std::endl;
3874 command =
"scp -r ../../DQM/TrackerCommon/test/jquery/ .";
3877 command =
"scp -r ../../CommonTools/TrackerMap/data/images/ .";
3882 std::ostringstream outs;
3885 save(
true, minval, maxval, outs.str(), 3000, 1600);
3888 save(
true, minval, maxval,
s,
width, height);
3891 std::ostringstream outs;
3899 std::ostringstream outs;
3902 *
txtfile <<
"<html><head></head> <body>" << std::endl;
3907 if (
mod !=
nullptr && !
mod->notInUse()) {
3910 *
txtfile <<
"<a name=" <<
idmod <<
"><pre>" << std::endl;
3911 std::multimap<const int, TmApvPair *>::iterator
pos;
3914 if (apvpair !=
nullptr) {
3919 *
txtfile <<
"</pre><h3>" <<
mod->name <<
"</h3>" << std::endl;
3923 *
txtfile <<
"</body></html>" << std::endl;
3929 std::ostringstream outs1, outs2;
3939 std::map<int, int>::iterator i_fed;
3942 std::ostringstream outs;
3945 *
txtfile <<
"<html><head></head> <body>" << std::endl;
3946 for (i_fed =
fedMap.begin(); i_fed !=
fedMap.end(); i_fed++) {
3947 if (i_fed->second == crate) {
3948 int fedId = i_fed->first;
3949 for (
int nconn = 0; nconn < 96; nconn++) {
3952 if (apvPair !=
nullptr) {
3954 *
txtfile <<
"<a name=" <<
idmod <<
"><pre>" << std::endl;
3956 std::ostringstream outs;
3957 outs <<
"fedchannel " << apvPair->
getFedId() <<
"/" << apvPair->
getFedCh() <<
" connects to module " 3959 *
txtfile <<
"</pre><h3>" << outs.str() <<
"</h3>" << std::endl;
3964 *
txtfile <<
"</body></html>" << std::endl;
3971 std::ostringstream outs1, outs2;
3982 std::map<int, TmCcu *>::iterator i_ccu;
3983 std::multimap<TmCcu *, TmModule *>::iterator it;
3984 std::pair<std::multimap<TmCcu *, TmModule *>::iterator, std::multimap<TmCcu *, TmModule *>::iterator>
ret;
3985 for (
int crate = 1; crate < (
nfeccrates + 1); crate++) {
3986 std::ostringstream outs;
3989 *
txtfile <<
"<html><head></head> <body>" << std::endl;
3990 for (i_ccu =
ccuMap.begin(); i_ccu !=
ccuMap.end(); i_ccu++) {
3991 TmCcu *ccu = i_ccu->second;
3992 if (ccu !=
nullptr && ccu->
getCcuCrate() == crate) {
3994 *
txtfile <<
"<a name=" <<
idmod <<
"><pre>" << std::endl;
3996 std::ostringstream outs;
3998 outs <<
"ccu is in position" << ccu->
mpos <<
"in ring but doesn't seem to have any module connected";
4000 outs <<
"ccu is in position " << ccu->
mpos <<
" in ring and connects " << ccu->
nmod <<
" modules" 4003 for (it =
ret.first; it !=
ret.second; ++it) {
4004 outs << (*it).second->idex <<
" " << (*it).second->name <<
" value= " << (*it).second->value <<
"\n\n";
4007 *
txtfile <<
"</pre><h4>" << outs.str() <<
"</h4>" << std::endl;
4011 *
txtfile <<
"</body></html>" << std::endl;
4017 std::ostringstream outs3, outs4;
4029 std::map<int, TmPsu *>::iterator ipsu;
4030 std::multimap<TmPsu *, TmModule *>::iterator it;
4031 std::pair<std::multimap<TmPsu *, TmModule *>::iterator, std::multimap<TmPsu *, TmModule *>::iterator>
ret;
4032 for (
int rack = 1; rack < (
npsuracks + 1); rack++) {
4033 std::ostringstream outs;
4037 *
txtfile <<
"<html><head></head> <body>" << std::endl;
4038 for (ipsu =
psuMap.begin(); ipsu !=
psuMap.end(); ipsu++) {
4039 TmPsu *psu = ipsu->second;
4040 if (psu !=
nullptr && psu->
getPsuRack() == rack) {
4041 *
txtfile <<
"<a name=" << psu->
idex <<
"><pre>" << std::endl;
4043 std::ostringstream outs;
4046 <<
"in crate but doesn't seem to have any module connected";
4048 outs <<
"PS is in position " << psu->
getPsuBoard() <<
" in crate and connects to " << psu->
nmod 4049 <<
" modules. " << std::endl;
4052 for (it =
ret.first; it !=
ret.second; ++it) {
4053 outs << (*it).second->idex <<
" " << (*it).second->name <<
" value= " << (*it).second->value <<
" <br>" 4056 *
txtfile <<
"</pre><h4>" << outs.str() <<
"</h4>" << std::endl;
4060 *
txtfile <<
"</body></html>" << std::endl;
4067 std::ostringstream outs5, outs6;
4079 std::map<int, TmPsu *>::iterator ipsu;
4080 std::multimap<TmPsu *, TmModule *>::iterator it;
4081 std::pair<std::multimap<TmPsu *, TmModule *>::iterator, std::multimap<TmPsu *, TmModule *>::iterator>
ret;
4082 for (
int rack = 1; rack < (
npsuracks + 1); rack++) {
4083 std::ostringstream outs;
4087 *
txtfile <<
"<html><head></head> <body>" << std::endl;
4088 for (ipsu =
psuMap.begin(); ipsu !=
psuMap.end(); ipsu++) {
4089 TmPsu *psu = ipsu->second;
4090 if (psu !=
nullptr && psu->
getPsuRack() == rack) {
4091 *
txtfile <<
"<a name=" << psu->
idex <<
"><pre>" << std::endl;
4093 std::ostringstream outsHV2;
4095 outsHV2 <<
"HV Channel002 is in position" << psu->
getPsuBoard()
4096 <<
"in crate but doesn't seem to have any module connected";
4098 outsHV2 <<
"HV Channel002 is in position " << psu->
getPsuBoard() <<
" in crate and connects to " 4099 << psu->
nmodHV2 <<
" modules. " 4100 <<
" <br>" << std::endl;
4103 for (it =
ret.first; it !=
ret.second; ++it) {
4104 if ((*it).second->HVchannel == 2) {
4105 outsHV2 << (*it).second->idex <<
" " << (*it).second->name <<
" value= " << (*it).second->value
4106 <<
" <br>" << std::endl;
4109 *
txtfile <<
"</pre><h4>" << outsHV2.str() <<
"</h4>" << std::endl;
4113 std::ostringstream outsHV3;
4115 outsHV3 <<
"HV Channel003 is in position" << psu->
getPsuBoard()
4116 <<
"in crate but doesn't seem to have any module connected";
4118 outsHV3 <<
"HV Channel003 is in position " << psu->
getPsuBoard() <<
" in crate and connects to " 4119 << psu->
nmodHV3 <<
" modules. " 4120 <<
" <br>" << std::endl;
4123 for (it =
ret.first; it !=
ret.second; ++it) {
4124 if ((*it).second->HVchannel == 3) {
4125 outsHV3 << (*it).second->idex <<
" " << (*it).second->name <<
" value= " << (*it).second->value
4126 <<
" <br>" << std::endl;
4129 *
txtfile <<
"</pre><h4>" << outsHV3.str() <<
"</h4>" << std::endl;
4133 *
txtfile <<
"</body></html>" << std::endl;
4141 std::ifstream *ifilename;
4147 ifname =
"CommonTools/TrackerMap/data/" +
filename;
4151 ifname =
"CommonTools/TrackerMap/data/" +
filename;
4167 if (
mod !=
nullptr && !
mod->notInUse()) {
4182 if (
mod !=
nullptr && !
mod->notInUse()) {
4185 if (maxvalue < mod->
value)
4193 std::ostringstream outs;
4196 *
xmlfile <<
"<?xml version=\"1.0\" standalone=\"no\"?>" << std::endl;
4197 *
xmlfile <<
"<svg xmlns=\"http://www.w3.org/2000/svg\"" << std::endl;
4198 *
xmlfile <<
"xmlns:svg=\"http://www.w3.org/2000/svg\"" << std::endl;
4199 *
xmlfile <<
"xmlns:xlink=\"http://www.w3.org/1999/xlink\" >" << std::endl;
4200 *
xmlfile <<
"<script type=\"text/ecmascript\" xlink:href=\"layer.js\" />" << std::endl;
4201 *
xmlfile <<
"<svg id=\"mainMap\" x=\"0\" y=\"0\" viewBox=\"0 0 500 500\" width=\"700\" height=\"700\" " 4202 "onload=\"TrackerLayer.init()\">" 4205 *
xmlfile <<
"<g id=\"layer\" transform=\" translate(0,400) rotate(270) scale(1.,1.)\" > " << std::endl;
4207 *
xmlfile <<
"<g id=\"layer\" transform=\" translate(0,400) rotate(270) scale(1.,0.8)\" > " << std::endl;
4208 *
xmlfile <<
"<rect fill=\"lightblue\" stroke=\"none\" x=\"0\" y=\"0\" width=\"700\" height=\"700\" />" << std::endl;
4209 *
xmlfile <<
"<svg:polygon id=\"fed\" mapAttribute=\"fed\" points=\"250,40 250,10 230,10 230,40\" " 4210 "onclick=\"chooseMap(evt);\" onmouseover=\"chooseMap(evt);\" onmouseout=\"chooseMap(evt);\" " 4211 "fill=\"rgb(0,127,255)\"/>" 4213 *
xmlfile <<
"<svg:polygon id=\"fec\" mapAttribute=\"fec\" points=\"228,40 228,10 208,10 208,40\" " 4214 "onclick=\"chooseMap(evt);\" onmouseover=\"chooseMap(evt);\" onmouseout=\"chooseMap(evt);\" " 4215 "fill=\"rgb(0,127,255)\"/>" 4217 *
xmlfile <<
"<svg:polygon id=\"lv\" mapAttribute=\"lv\" points=\"206,40 206,10 186,10 186,40\" " 4218 "onclick=\"chooseMap(evt);\" onmouseover=\"chooseMap(evt);\" onmouseout=\"chooseMap(evt);\" " 4219 "fill=\"rgb(0,127,255)\"/>" 4221 *
xmlfile <<
"<svg:polygon id=\"hv\" mapAttribute=\"hv\" points=\"184,40 184,10 164,10 164,40\" " 4222 "onclick=\"chooseMap(evt);\" onmouseover=\"chooseMap(evt);\" onmouseout=\"chooseMap(evt);\" " 4223 "fill=\"rgb(0,127,255)\"/>" 4225 *
xmlfile <<
"<svg:polygon id=\"plot\" mapAttribute=\"plot\" points=\"155,45 155,5 135,5 135,45\" " 4226 "onclick=\"chooseMap(evt);\" onmouseover=\"chooseMap(evt);\" onmouseout=\"chooseMap(evt);\" " 4227 "fill=\"rgb(200,0,0)\"/>" 4236 if (
mod !=
nullptr && !
mod->notInUse()) {
4241 *
xmlfile <<
"</g> </svg> <text id=\"currentElementText\" x=\"40\" y=\"30\">" << std::endl;
4242 *
xmlfile <<
"<tspan id=\"line1\" x=\"40\" y=\"30\"> </tspan> " << std::endl;
4243 *
xmlfile <<
"<tspan id=\"line2\" x=\"40\" y=\"60\"> </tspan> " << std::endl;
4244 *
xmlfile <<
"<tspan id=\"line3\" x=\"40\" y=\"90\"> </tspan> " << std::endl;
4245 *
xmlfile <<
"<tspan id=\"line4\" x=\"40\" y=\"120\"> </tspan> " << std::endl;
4247 *
xmlfile <<
"<tspan mapAttribute=\"fed\" onclick=\"chooseMap(evt);\" onmouseover=\"chooseMap(evt);\" " 4248 "onmouseout=\"chooseMap(evt);\" x=\"15\" y=\"228\" font-size=\"12\" font-family=\"arial\" " 4249 "fill=\"white\">FED</tspan> " 4251 *
xmlfile <<
"<tspan mapAttribute=\"fec\" onclick=\"chooseMap(evt);\" onmouseover=\"chooseMap(evt);\" " 4252 "onmouseout=\"chooseMap(evt);\" x=\"15\" y=\"258\" font-size=\"12\" font-family=\"arial\" " 4253 "fill=\"white\">FEC</tspan> " 4255 *
xmlfile <<
"<tspan mapAttribute=\"lv\" onclick=\"chooseMap(evt);\" onmouseover=\"chooseMap(evt);\" " 4256 "onmouseout=\"chooseMap(evt);\" x=\"18\" y=\"289\" font-size=\"12\" font-family=\"arial\" " 4257 "fill=\"white\">LV</tspan> " 4259 *
xmlfile <<
"<tspan mapAttribute=\"hv\" onclick=\"chooseMap(evt);\" onmouseover=\"chooseMap(evt);\" " 4260 "onmouseout=\"chooseMap(evt);\" x=\"18\" y=\"319\" font-size=\"12\" font-family=\"arial\" " 4261 "fill=\"white\">HV</tspan> " 4263 *
xmlfile <<
"<tspan mapAttribute=\"plot\" onclick=\"chooseMap(evt);\" onmouseover=\"chooseMap(evt);\" " 4264 "onmouseout=\"chooseMap(evt);\" x=\"12\" y=\"360\" font-size=\"12\" font-family=\"arial\" " 4265 "fill=\"white\">PLOT</tspan> " 4268 *
xmlfile <<
"<tspan mapAttribute=\"fed\" onclick=\"chooseMap(evt);\" onmouseover=\"chooseMap(evt);\" " 4269 "onmouseout=\"chooseMap(evt);\" x=\"21\" y=\"228\" font-size=\"12\" font-family=\"arial\" " 4270 "fill=\"white\">FED</tspan> " 4272 *
xmlfile <<
"<tspan mapAttribute=\"fec\" onclick=\"chooseMap(evt);\" onmouseover=\"chooseMap(evt);\" " 4273 "onmouseout=\"chooseMap(evt);\" x=\"21\" y=\"258\" font-size=\"12\" font-family=\"arial\" " 4274 "fill=\"white\">FEC</tspan> " 4276 *
xmlfile <<
"<tspan mapAttribute=\"lv\" onclick=\"chooseMap(evt);\" onmouseover=\"chooseMap(evt);\" " 4277 "onmouseout=\"chooseMap(evt);\" x=\"24\" y=\"289\" font-size=\"12\" font-family=\"arial\" " 4278 "fill=\"white\">LV</tspan> " 4280 *
xmlfile <<
"<tspan mapAttribute=\"hv\" onclick=\"chooseMap(evt);\" onmouseover=\"chooseMap(evt);\" " 4281 "onmouseout=\"chooseMap(evt);\" x=\"24\" y=\"319\" font-size=\"12\" font-family=\"arial\" " 4282 "fill=\"white\">HV</tspan> " 4284 *
xmlfile <<
"<tspan mapAttribute=\"plot\" onclick=\"chooseMap(evt);\" onmouseover=\"chooseMap(evt);\" " 4285 "onmouseout=\"chooseMap(evt);\" x=\"17\" y=\"360\" font-size=\"12\" font-family=\"arial\" " 4286 "fill=\"white\">PLOT</tspan> " 4289 *
xmlfile <<
" </text> </svg>" << std::endl;
4303 legInfos_.back()->SetFillColor(kBlue - 9);
4305 legInfos_.back()->SetFillColor(kRed + 2);
4307 legInfos_.back()->SetFillColor(kPink - 9);
4309 legInfos_.back()->SetFillColor(kOrange + 2);
4311 legInfos_.back()->SetFillColor(kYellow);
4313 legInfos_.back()->SetFillColor(kRed + 1);
4315 legInfos_.back()->SetFillColor(kViolet - 5);
4322 "# Clusters & Digis",
4326 TLegend *myL =
new TLegend(0.56, 0.87, 0.95, 0.99);
4327 myL->SetNColumns(2);
4328 myL->SetBorderSize(0);
4329 myL->SetFillColor(38);
std::vector< TPolyLine * > legInfos_
void fill_hv_channel2(int rack, int crate, int board, float qty)
#define NUMFEDCRATE_INCOLUMN
TrackerMap(std::string s=" ", int xsize1=340, int ysize1=200)
double ydpixelc(double y)
std::ifstream * findfile(std::string filename)
#define NUMPSURACK_INCOLUMN
double ydpixelfec(double y)
int getmoduleCount(int subdet, int partdet, int layer, int ring)
void fillc_hv_channel2(int rack, int crate, int board, int red, int green, int blue)
std::ifstream * inputfile
const std::vector< const FedChannelConnection * > & getConnections(uint32_t det_id) const
~TrackerMap()
default destructor
static const uint32_t invalid32_
ret
prodAgent to be discontinued
int module(int fedId, int fedCh)
void defwindow(int num_lay)
Sin< T >::type sin(const T &t)
#define NUMFEDCH_INCOLUMN
void save_as_HVtrackermap(bool print_total=true, float minval=0., float maxval=0., std::string s="psu_svgmap.svg", int width=1500, int height=800)
double xdpixelc(double x)
void defpsuwindow(int num_rack)
int getlayerCount(int subdet, int partdet)
void fill_current_val_fed_channel(int fedId, int fedCh, float current_val)
#define NUMFEDCRATE_INROW
void fillc_fec_channel(int crate, int slot, int ring, int addr, int red, int green, int blue)
double xdpixelfec(double x)
T getUntrackedParameter(std::string const &, T const &) const
constexpr std::array< uint8_t, layerIndexSize< TrackerTraits > > layer
double phival(double x, double y)
txtfile
Delete all three files at once to make sure the user never sees stale data (e.g.
void fillc_lv_channel(int rack, int crate, int board, int red, int green, int blue)
std::vector< std::string > legKeys_
void save_as_psutrackermap(bool print_total=true, float minval=0., float maxval=0., std::string s="psu_svgmap.svg", int width=100+(360+100) *5+300, int height=50+(150+50) *6+300)
int getringCount(int subdet, int partdet, int layer)
double xdpixelpsu(double x)
void drawHV3(int rack, int numcrate_inrack, bool print_total, TmPsu *psu, std::ofstream *svgfile, bool usePsuValue)
void save_as_fedtrackermap(bool print_total=true, float minval=0., float maxval=0., std::string s="fed_svgmap.svg", int width=100+(90+100) *31+300, int height=150+(2940+150) *1+300)
void save(bool print_total=true, float minval=0., float maxval=0., std::string s="svgmap.svg", int width=1500, int height=800)
Cos< T >::type cos(const T &t)
void deffecwindow(int num_crate)
void load(std::string s="tmap.svg")
const std::vector< SiStripFecCrate > & crates() const
void drawModule(TmModule *mod, int key, int layer, bool total, std::ofstream *file)
void drawApvPair(int crate, int numfed_incrate, bool total, TmApvPair *apvPair, std::ofstream *file, bool useApvPairValue)
void fillc_fed_channel(int fedId, int fedCh, int red, int green, int blue)
xmlfile
Make an XML representation of the misalignment.
int getcolor(float value, int palette)
void fillc(int idmod, int RGBcode)
void printlayers(bool print_total=true, float minval=0., float maxval=0., std::string s="layer")
void drawHV2(int rack, int numcrate_inrack, bool print_total, TmPsu *psu, std::ofstream *svgfile, bool usePsuValue)
void drawCcu(int crate, int numfed_incrate, bool total, TmCcu *ccu, std::ofstream *file, bool useCcuValue)
void fill_hv_channel3(int rack, int crate, int board, float qty)
#define NUMPSUCRATE_INCOLUMN
static const uint16_t invalid_
Contains cabling info at the device level, including DetId, APV pair numbers, hardware addresses...
void setRange(float min, float max)
void drawPalette(std::ofstream *file, int xoffset=3660, int yoffset=1540)
int nlayer(int det, int part, int lay)
void print(bool print_total=true, float minval=0., float maxval=0., std::string s="svgmap")
void fill_fec_channel(int crate, int slot, int ring, int addr, float qty)
void fill_current_val(int idmod, float current_val)
void setText(int idmod, std::string s)
static bool isRingStereo(int key)
void defcwindow(int num_crate)
T mod(const T &a, const T &b)
FedsConstIterRange fedIds() const
void fill_lv_channel(int rack, int crate, int board, float qty)
std::vector< TColor * > vc
void printall(bool print_total=true, float minval=0., float maxval=0., std::string s="svgmap", int width=6000, int height=3200)
Power< A, B >::type pow(const A &a, const B &b)
void drawPsu(int rack, int numcrate_inrack, bool print_total, TmPsu *psu, std::ofstream *svgfile, bool usePsuValue)
void fill(int layer, int ring, int nmod, float x)
double ydpixelpsu(double y)
ConnsConstIterRange fedConnections(uint16_t fed_id) const
void save_as_fectrackermap(bool print_total=true, float minval=0., float maxval=0., std::string s="fec_svgmap.svg", int width=1500, int height=800)
void fill_fed_channel(int fedId, int fedCh, float qty)
void fillc_hv_channel3(int rack, int crate, int board, int red, int green, int blue)
std::pair< float, float > getAutomaticRange()