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())
111 ncrates = iconn->fedCrate();
117 apvpair =
new TmApvPair(key, 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 <<
")";
153 s.erase(s.end() - 1, s.end());
169 while (!Ccufile.eof()) {
170 Ccufile >> crate >> slot >> ring >> addr >> pos;
171 getline(Ccufile, dummys);
172 int key = crate * 10000000 + slot * 100000 + ring * 1000 +
addr;
174 if (ccu ==
nullptr) {
175 ccu =
new TmCcu(crate, slot, ring, addr);
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();
202 layer = imod1->
layer;
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) {
321 psu =
new TmPsu(dcs, branch, rack, crate, board);
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: ";
359 if (enableHVProcessing) {
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() <<
",";
380 if (enableHVProcessing) {
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();
398 if (enableHVProcessing) {
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)
510 key = layer_g * 100000 +
ring * 1000 +
module;
517 int key = layer_g * 100000 +
ring * 1000 +
module + 100;
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;
573 double xp[4], yp[4], xp1, yp1;
574 double vhbot, vhtop, vhapo;
575 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};
576 double xt1, yt1, xs1 = 0., ys1 = 0., xt2, yt2, xs2, ys2, pv1, pv2;
590 vhtop = mod->
width / 2.;
592 if (mlay > 12 && mlay < 19) {
615 for (
int j = 0;
j < 4;
j++) {
616 xp1 = xp[
j] *
cos(phi) - yp[
j] *
sin(phi);
617 yp1 = xp[
j] *
sin(phi) + yp[
j] *
cos(phi);
625 int vane = mod->
ring;
629 xt1 = rmedio[mlay - 31];
631 xs1 = xt1 *
cos(phi) - yt1 *
sin(phi);
632 ys1 = xt1 *
sin(phi) + yt1 *
cos(phi);
633 xt2 = rmedio[mlay - 31];
635 xs2 = xt2 *
cos(phi) - yt2 *
sin(phi);
636 ys2 = xt2 *
sin(phi) + yt2 *
cos(phi);
645 xp[0] = vane * (dx + dx / 8.);
646 yp[0] = numod * (dy1);
647 xp[1] = vane * (dx + dx / 8.) +
dx;
648 yp[1] = numod * (dy1);
649 xp[2] = vane * (dx + dx / 8.) +
dx;
650 yp[2] = numod * (dy1) + dy;
651 xp[3] = vane * (dx + dx / 8.);
652 yp[3] = numod * (dy1) + dy;
656 xs1 = xt1 *
cos(phi) - yt1 *
sin(phi);
657 ys1 = xt1 *
sin(phi) + yt1 *
cos(phi);
660 xs2 = xt2 *
cos(phi) - yt2 *
sin(phi);
661 ys2 = xt2 *
sin(phi) + yt2 *
cos(phi);
664 if (fabs(pv1 - pv2) >
M_PI && numod == 1)
665 pv1 = pv1 - 2. *
M_PI;
666 if (fabs(pv1 - pv2) >
M_PI && numod != 1)
667 pv2 = pv2 + 2. *
M_PI;
668 xp[0] = mod->
posz - vhapo / 2.;
670 xp[1] = mod->
posz + vhapo / 2.;
672 xp[2] = mod->
posz + vhapo / 2.;
674 xp[3] = mod->
posz - vhapo / 2.;
681 for (
int j = 0;
j < 3;
j++) {
694 for (
int j = 0;
j < 4;
j++) {
700 sprintf(buffer,
"%X", mod->
idex);
704 red = (color >> 16) & 0xFF;
705 green = (color >> 8) & 0xFF;
713 *svgfile << red <<
" " << green <<
" " << blue <<
" ";
716 <<
"<svg:polygon detid=\"" << mod->
idex <<
"\" count=\"" << mod->
count <<
"\" value=\"" << mod->
value
717 <<
"\" id=\"" << key <<
"\" capvids=\"" << mod->
capvids <<
"\" lv=\"" << mod->
psuIdex <<
"\" hv=\""
719 <<
"\" onclick=\"showData(evt);\" onmouseover=\"showData(evt);\" onmouseout=\"showData(evt);\" MESSAGE=\""
720 << mod->
text <<
"\" POS=\"" << mod->
name <<
" \" fill=\"rgb(" << red <<
"," << green <<
"," << blue
723 *svgfile << 255 <<
" " << 255 <<
" " << 255 <<
" ";
726 <<
"<svg:polygon detid=\"" << mod->
idex <<
"\" count=\"" << mod->
count <<
"\" value=\"" << mod->
value
727 <<
"\" id=\"" << key <<
"\" capvids=\"" << mod->
capvids <<
"\" lv=\"" << mod->
psuIdex <<
"\" hv=\""
729 <<
"\" onclick=\"showData(evt);\" onmouseover=\"showData(evt);\" onmouseout=\"showData(evt);\" MESSAGE=\""
730 << mod->
text <<
"\" POS=\"" << mod->
name <<
" \" fill=\"white\" points=\"";
732 *svgfile << np <<
" ";
733 for (
int k = 0;
k <
np;
k++) {
735 *svgfile << xd[
k] <<
" " << yd[
k] <<
" ";
737 *svgfile << xd[
k] <<
"," << yd[
k] <<
" ";
740 *svgfile << std::endl;
742 *svgfile <<
"\" />" << std::endl;
746 if (mod->
green > 255)
751 *svgfile << mod->
red <<
" " << mod->
green <<
" " << mod->
blue <<
" ";
754 <<
"<svg:polygon detid=\"" << mod->
idex <<
"\" count=\"" << mod->
count <<
"\" value=\"" << mod->
value
755 <<
"\" id=\"" << key <<
"\" capvids=\"" << mod->
capvids <<
"\" lv=\"" << mod->
psuIdex <<
"\" hv=\""
757 <<
"\" onclick=\"showData(evt);\" onmouseover=\"showData(evt);\" onmouseout=\"showData(evt);\" MESSAGE=\""
758 << mod->
text <<
"\" POS=\"" << mod->
name <<
" \" fill=\"rgb(" << mod->
red <<
"," << mod->
green <<
","
759 << mod->
blue <<
")\" points=\"";
761 *svgfile << np <<
" ";
762 for (
int k = 0;
k <
np;
k++) {
764 *svgfile << xd[
k] <<
" " << yd[
k] <<
" ";
766 *svgfile << xd[
k] <<
"," << yd[
k] <<
" ";
769 *svgfile << std::endl;
771 *svgfile <<
"\" />" << std::endl;
784 float minval, maxval;
793 if (minval > mod->
value)
795 if (maxval < mod->
value)
802 minval =
log(minval) /
log(10);
803 maxval =
log(maxval) /
log(10);
805 return std::make_pair(minval, maxval);
813 bool rangefound =
true;
816 std::vector<TPolyLine *> vp;
817 TGaxis *axis =
nullptr;
818 size_t found = filetype.find_last_of(
'.');
819 filetype = filetype.substr(found + 1);
820 found = outputfilename.find_last_of(
'.');
821 outputfilename = outputfilename.substr(0, found);
824 if (filetype ==
"svg")
826 std::ostringstream outs;
829 outs << outputfilename <<
".coor";
837 if (mod !=
nullptr && !mod->
notInUse()) {
858 if (maxvalue < mod->
value)
868 *
savefile <<
"<?xml version=\"1.0\" standalone=\"no\" ?>" << std::endl;
869 *
savefile <<
"<svg xmlns=\"http://www.w3.org/2000/svg\"" << std::endl;
870 *
savefile <<
"xmlns:svg=\"http://www.w3.org/2000/svg\" " << std::endl;
871 *
savefile <<
"xmlns:xlink=\"http://www.w3.org/1999/xlink\">" << std::endl;
872 *
savefile <<
"<svg:svg id=\"mainMap\" x=\"0\" y=\"0\" viewBox=\"0 0 3100 1600"
873 <<
"\" width=\"" << width <<
"\" height=\"" << height <<
"\">" << std::endl;
874 *
savefile <<
"<svg:rect fill=\"lightblue\" stroke=\"none\" x=\"0\" y=\"0\" width=\"3100\" height=\"1600\" /> "
876 *
savefile <<
"<svg:g id=\"tracker\" transform=\"translate(10,1500) rotate(270)\" "
877 "style=\"fill:none;stroke:black;stroke-width:0;\"> "
887 if (mod !=
nullptr && !mod->
notInUse()) {
895 *
savefile <<
"</svg:g>" << std::endl;
896 *
savefile <<
" <svg:text id=\"Title\" class=\"normalText\" x=\"300\" y=\"0\">" <<
title <<
"</svg:text>"
908 *
savefile <<
"</svg:svg>" << std::endl;
914 const char *command1;
915 std::string tempfilename = outputfilename +
".coor";
916 if (filetype ==
"svg") {
918 command1 = command.c_str();
919 std::cout <<
"Executing " << command1 << std::endl;
926 std::ifstream tempfile(tempfilename.c_str(),
std::ios::in);
927 TCanvas *MyC =
new TCanvas(
"MyC",
"TrackerMap", width, height);
928 gPad->SetFillColor(38);
931 gPad->Range(0, 0, 3800, 1600);
933 gPad->Range(-100, 0, 800, 1600);
935 gPad->Range(800, 0, 3800, 1600);
940 typedef std::map<int, int> ColorList;
942 ColorList::iterator pos;
944 std::cout <<
"tempfilename " << tempfilename << std::endl;
945 while (!tempfile.eof()) {
946 tempfile >> red >> green >> blue >>
npoints;
947 colindex = red + green * 1000 + blue * 1000000;
948 pos = colorList.find(colindex);
949 if (pos == colorList.end()) {
950 colorList[colindex] = ncolor + 100;
951 col = gROOT->GetColor(ncolor + 100);
953 col->SetRGB((Double_t)(red / 255.), (Double_t)(green / 255.), (Double_t)(blue / 255.));
955 c =
new TColor(ncolor + 100, (Double_t)(red / 255.), (Double_t)(green / 255.), (Double_t)(blue / 255.));
960 tempfile >> x[
i] >> y[
i];
964 if (ncolor > 0 && ncolor < 10000) {
966 for (
int i = 0;
i < ncolor;
i++) {
969 gStyle->SetPalette(ncolor, colors);
973 tempfile.seekg(0, std::ios::beg);
974 std::cout <<
"created palette with " << ncolor <<
" colors" << std::endl;
976 while (!tempfile.eof()) {
977 tempfile >> red >> green >> blue >>
npoints;
979 tempfile >> x[
i] >> y[
i];
981 colindex = red + green * 1000 + blue * 1000000;
982 pos = colorList.find(colindex);
983 if (pos != colorList.end()) {
984 TPolyLine *pline =
new TPolyLine(npoints, y, x);
986 pline->SetFillColor(colorList[colindex]);
987 pline->SetLineWidth(0);
999 axis =
new TGaxis(-30, 36, -30, 1530, lminvalue, lmaxvalue, 510,
"+L");
1001 axis =
new TGaxis(3660, 36, 3660, 1530, lminvalue, lmaxvalue, 510,
"+L");
1003 axis->SetLabelSize(0.02);
1007 l.SetTextSize(0.03);
1008 l.DrawLatex(950, 1330,
"TID");
1009 l.DrawLatex(2300, 1330,
"TEC");
1010 l.DrawLatex(300, 1330,
"FPIX");
1011 l.DrawLatex(20, 560,
"BPIX L1");
1012 l.DrawLatex(500, 385,
"BPIX L2");
1013 l.DrawLatex(500, 945,
"BPIX L3");
1014 l.SetTextSize(0.04);
1016 if (
tkMapLog && (fulltitle.find(
"Log10 scale") == std::string::npos))
1017 fulltitle +=
": Log10 scale";
1019 l.DrawLatex(30, 1500, fulltitle.c_str());
1021 l.DrawLatex(850, 1500, fulltitle.c_str());
1024 l.DrawLatex(380, 40,
"-z");
1026 l.DrawLatex(1730, 40,
"-z");
1029 l.DrawLatex(380, 1330,
"+z");
1031 l.DrawLatex(1730, 1360,
"+z");
1033 l.DrawLatex(1085, 330,
"TIB L1");
1034 l.DrawLatex(1085, 1000,
"TIB L2");
1035 l.DrawLatex(1585, 330,
"TIB L3");
1036 l.DrawLatex(1585, 1000,
"TIB L4");
1037 l.DrawLatex(2085, 330,
"TOB L1");
1038 l.DrawLatex(2085, 1000,
"TOB L2");
1039 l.DrawLatex(2585, 330,
"TOB L3");
1040 l.DrawLatex(2585, 1000,
"TOB L4");
1041 l.DrawLatex(3085, 330,
"TOB L5");
1042 l.DrawLatex(3085, 1000,
"TOB L6");
1043 TArrow arx(3448, 1190, 3448, 1350, 0.01,
"|>");
1044 l.DrawLatex(3460, 1350,
"x");
1045 TArrow ary(3448, 1190, 3312, 1190, 0.01,
"|>");
1046 l.DrawLatex(3312, 1210,
"y");
1047 TArrow arz(3485, 373, 3485, 676, 0.01,
"|>");
1048 l.DrawLatex(3510, 667,
"z");
1049 TArrow arphi(3485, 511, 3037, 511, 0.01,
"|>");
1050 l.DrawLatex(3023, 520,
"#Phi");
1051 arx.SetLineWidth(3);
1052 ary.SetLineWidth(3);
1053 arz.SetLineWidth(3);
1054 arphi.SetLineWidth(3);
1060 l.DrawLatex(570 + 12, 1190 + 160,
"x");
1062 ary.SetX2(570 - 160);
1065 l.DrawLatex(570 - 160, 1190 + 30,
"y");
1068 arz.SetY1(683 - 100);
1069 arz.SetY2(683 + 100);
1070 l.DrawLatex(380 + 15, 683 + 100 - 9,
"z");
1072 arphi.SetX2(380 - 390);
1075 l.DrawLatex(380 - 390 - 14, 683 + 9,
"#Phi");
1083 if (
title.find(
"QTestAlarm") != std::string::npos) {
1087 if (filetype ==
"png") {
1089 std::cout <<
"printing " << filename << std::endl;
1090 MyC->Print(filename.c_str());
1092 if (filetype ==
"jpg") {
1094 MyC->Print(filename.c_str());
1096 if (filetype ==
"pdf") {
1098 MyC->Print(filename.c_str());
1101 command1 = command.c_str();
1102 std::cout <<
"Executing " << command1 << std::endl;
1109 for (std::vector<TPolyLine *>::iterator pos1 = vp.begin(); pos1 != vp.end(); pos1++) {
1117 int crate,
int numfed_incrate,
bool print_total,
TmApvPair *apvPair, std::ofstream *svgfile,
bool useApvPairValue) {
1118 double xp[4], yp[4];
1123 double xd[4], yd[4];
1125 double boxinitx = 0., boxinity = 0.;
1126 double dx = .9,
dy = .9;
1140 xp[1] = boxinitx +
dx;
1142 xp[2] = boxinitx +
dx;
1143 yp[2] = boxinity +
dy;
1145 yp[3] = boxinity +
dy;
1146 for (
int j = 0;
j < 4;
j++) {
1153 sprintf(buffer,
"%X", apvPair->
mod->
idex);
1155 s.erase(s.begin() + s.find(
"connected"), s.end());
1157 if (useApvPairValue) {
1158 if (apvPair->
red < 0) {
1159 if (apvPair->
count > 0) {
1161 red = (color >> 16) & 0xFF;
1162 green = (color >> 8) & 0xFF;
1163 blue = (color)&0xFF;
1167 *svgfile << red <<
" " << green <<
" " << blue <<
" ";
1170 <<
"<svg:polygon detid=\"" << apvPair->
idex <<
"\" count=\"" << apvPair->
count <<
"\" value=\""
1171 << apvPair->
value <<
"\" id=\"" << apvPair->
idex + crate * 1000000 <<
"\" cmodid=\""
1173 <<
"\" onclick=\"showData(evt);\" onmouseover=\"showData(evt);\" onmouseout=\"showData(evt);\" MESSAGE=\""
1175 << apvPair->
getFedId() <<
"/" << apvPair->
getFedCh() <<
" connected to " << s <<
" Id " << buffer
1176 <<
" \" fill=\"rgb(" << red <<
"," << green <<
"," << blue <<
")\" points=\"";
1179 *svgfile << 255 <<
" " << 255 <<
" " << 255 <<
" ";
1182 <<
"<svg:polygon detid=\"" << apvPair->
idex <<
"\" count=\"" << apvPair->
count <<
"\" value=\""
1183 << apvPair->
value <<
"\" id=\"" << apvPair->
idex + crate * 1000000 <<
"\" cmodid=\""
1185 <<
"\" onclick=\"showData(evt);\" onmouseover=\"showData(evt);\" onmouseout=\"showData(evt);\" MESSAGE=\""
1187 << apvPair->
getFedId() <<
"/" << apvPair->
getFedCh() <<
" connected to " << s <<
" Id " << buffer
1188 <<
" \" fill=\"white\" points=\"";
1191 if (apvPair->
red > 255)
1193 if (apvPair->
green > 255)
1194 apvPair->
green = 255;
1195 if (apvPair->
blue > 255)
1196 apvPair->
blue = 255;
1198 *svgfile << apvPair->
red <<
" " << apvPair->
green <<
" " << apvPair->
blue <<
" ";
1201 <<
"<svg:polygon detid=\"" << apvPair->
idex <<
"\" count=\"" << apvPair->
count <<
"\" value=\""
1202 << apvPair->
value <<
"\" id=\"" << apvPair->
idex + crate * 1000000 <<
"\" cmodid=\""
1204 <<
"\" onclick=\"showData(evt);\" onmouseover=\"showData(evt);\" onmouseout=\"showData(evt);\" MESSAGE=\""
1206 << apvPair->
getFedId() <<
"/" << apvPair->
getFedCh() <<
" connected to " << s <<
" Id " << buffer
1207 <<
" \" fill=\"rgb(" << apvPair->
red <<
"," << apvPair->
green <<
"," << apvPair->
blue <<
")\" points=\"";
1210 if (apvPair->
mod->
red < 0) {
1213 red = (color >> 16) & 0xFF;
1214 green = (color >> 8) & 0xFF;
1215 blue = (color)&0xFF;
1217 *svgfile << red <<
" " << green <<
" " << blue <<
" ";
1220 <<
"<svg:polygon detid=\"" << apvPair->
idex <<
"\" count=\"" << apvPair->
count <<
"\" value=\""
1221 << apvPair->
value <<
"\" id=\"" << apvPair->
idex + crate * 1000000 <<
"\" cmodid=\""
1223 <<
"\" onclick=\"showData(evt);\" onmouseover=\"showData(evt);\" onmouseout=\"showData(evt);\" MESSAGE=\""
1225 << apvPair->
getFedId() <<
"/" << apvPair->
getFedCh() <<
" connected to " << s <<
" Id " << buffer
1226 <<
" \" fill=\"rgb(" << red <<
"," << green <<
"," << blue <<
")\" points=\"";
1229 *svgfile << 255 <<
" " << 255 <<
" " << 255 <<
" ";
1232 <<
"<svg:polygon detid=\"" << apvPair->
idex <<
"\" count=\"" << apvPair->
count <<
"\" value=\""
1233 << apvPair->
value <<
"\" id=\"" << apvPair->
idex + crate * 1000000 <<
"\" cmodid=\""
1235 <<
"\" onclick=\"showData(evt);\" onmouseover=\"showData(evt);\" onmouseout=\"showData(evt);\" MESSAGE=\""
1237 << apvPair->
getFedId() <<
"/" << apvPair->
getFedCh() <<
" connected to " << s <<
" Id " << buffer
1238 <<
" \" fill=\"white\" points=\"";
1241 if (apvPair->
mod->
red > 255)
1251 <<
"<svg:polygon detid=\"" << apvPair->
idex <<
"\" count=\"" << apvPair->
count <<
"\" value=\""
1252 << apvPair->
value <<
"\" id=\"" << apvPair->
idex + crate * 1000000 <<
"\" cmodid=\""
1254 <<
"\" onclick=\"showData(evt);\" onmouseover=\"showData(evt);\" onmouseout=\"showData(evt);\" MESSAGE=\""
1256 << apvPair->
getFedId() <<
"/" << apvPair->
getFedCh() <<
" connected to " << s <<
" Id " << buffer
1257 <<
" \" fill=\"rgb(" << apvPair->
mod->
red <<
"," << apvPair->
mod->
green <<
"," << apvPair->
mod->
blue
1262 *svgfile << np <<
" ";
1263 for (
int k = 0;
k <
np;
k++) {
1265 *svgfile << xd[
k] <<
" " << yd[
k] <<
" ";
1267 *svgfile << xd[
k] <<
"," << yd[
k] <<
" ";
1270 *svgfile << std::endl;
1272 *svgfile <<
"\" />" << std::endl;
1275 int crate,
int numfec_incrate,
bool print_total,
TmCcu *ccu, std::ofstream *svgfile,
bool useCcuValue) {
1276 double xp[4], yp[4];
1281 double xd[4], yd[4];
1283 double boxinitx = 0., boxinity = 0.;
1284 double dx = .9,
dy = .9;
1285 int numccu_incolumn = 8;
1286 int numccu_inrow = 15;
1287 int numfec_incolumn = 5;
1288 int numfec_inrow = 4;
1289 boxinitx = boxinitx + (numfec_incolumn - (numfec_incrate - 1) / numfec_inrow) * 14.;
1290 boxinity = boxinity + (numfec_inrow - (numfec_incrate - 1) % numfec_inrow) * 16.;
1291 boxinity = boxinity + numccu_inrow - ccu->
mpos;
1292 boxinitx = boxinitx + numccu_incolumn - (int)(ccu->
getCcuRing() % numccu_incolumn);
1296 xp[1] = boxinitx +
dx;
1298 xp[2] = boxinitx +
dx;
1299 yp[2] = boxinity +
dy;
1301 yp[3] = boxinity +
dy;
1302 for (
int j = 0;
j < 4;
j++) {
1309 sprintf(buffer,
"%X", ccu->
idex);
1313 s.erase(s.begin() + s.find(
"connected"), s.end());
1316 if (ccu->
count > 0) {
1318 red = (color >> 16) & 0xFF;
1319 green = (color >> 8) & 0xFF;
1320 blue = (color)&0xFF;
1324 *svgfile << red <<
" " << green <<
" " << blue <<
" ";
1327 <<
"<svg:polygon detid=\"" << ccu->
idex <<
"\" count=\"" << ccu->
count <<
"\" value=\"" << ccu->
value
1328 <<
"\" id=\"" << ccu->
idex + crate * 1000000 <<
"\" cmodid=\"" << ccu->
cmodid <<
"\" layer=\"" << ccu->
layer
1329 <<
"\" onclick=\"showData(evt);\" onmouseover=\"showData(evt);\" onmouseout=\"showData(evt);\" MESSAGE=\""
1330 "\" POS=\"Slot/Ring"
1332 <<
" \" fill=\"rgb(" << red <<
"," << green <<
"," << blue <<
")\" points=\"";
1335 *svgfile << 255 <<
" " << 255 <<
" " << 255 <<
" ";
1338 <<
"<svg:polygon detid=\"" << ccu->
idex <<
"\" count=\"" << ccu->
count <<
"\" value=\"" << ccu->
value
1339 <<
"\" id=\"" << ccu->
idex + crate * 1000000 <<
"\" cmodid=\"" << ccu->
cmodid <<
"\" layer=\""
1341 <<
"\" onclick=\"showData(evt);\" onmouseover=\"showData(evt);\" onmouseout=\"showData(evt);\" MESSAGE=\""
1342 "\" POS=\"Slot/Ring "
1344 <<
" \" fill=\"white\" points=\"";
1349 if (ccu->
green > 255)
1351 if (ccu->
blue > 255)
1354 *svgfile << ccu->
red <<
" " << ccu->
green <<
" " << ccu->
blue <<
" ";
1357 <<
"<svg:polygon detid=\"" << ccu->
idex <<
"\" count=\"" << ccu->
count <<
"\" value=\"" << ccu->
value
1358 <<
"\" id=\"" << ccu->
idex + crate * 1000000 <<
"\" cmodid=\"" << ccu->
cmodid <<
"\" layer=\"" << ccu->
layer
1359 <<
"\" onclick=\"showData(evt);\" onmouseover=\"showData(evt);\" onmouseout=\"showData(evt);\" MESSAGE=\""
1360 "\" POS=\"Slot/Ring "
1362 <<
" \" fill=\"rgb(" << ccu->
red <<
"," << ccu->
green <<
"," << ccu->
blue <<
")\" points=\"";
1365 *svgfile << np <<
" ";
1366 for (
int k = 0;
k <
np;
k++) {
1368 *svgfile << xd[
k] <<
" " << yd[
k] <<
" ";
1370 *svgfile << xd[
k] <<
"," << yd[
k] <<
" ";
1373 *svgfile << std::endl;
1375 *svgfile <<
"\" />" << std::endl;
1378 int rack,
int numcrate_inrack,
bool print_total,
TmPsu *psu, std::ofstream *svgfile,
bool usePsuValue) {
1379 double xp[4], yp[4];
1384 double xd[4], yd[4];
1386 double boxinitx = 0., boxinity = 0.;
1387 double dx = .9,
dy = .9;
1394 xp[1] = boxinitx +
dx;
1396 xp[2] = boxinitx +
dx;
1397 yp[2] = boxinity +
dy;
1399 yp[3] = boxinity +
dy;
1401 for (
int j = 0;
j < 4;
j++) {
1419 sprintf(buffer,
"%X", psu->
idex);
1421 s.erase(s.begin() + s.find(
"connected"), s.end());
1424 if (psu->
count > 0) {
1426 red = (color >> 16) & 0xFF;
1427 green = (color >> 8) & 0xFF;
1428 blue = (color)&0xFF;
1432 *svgfile << red <<
" " << green <<
" " << blue <<
" ";
1435 <<
"<svg:polygon detid=\"" << psu->
idex <<
"\" count=\"" << psu->
count <<
"\" value=\"" << psu->
value
1436 <<
"\" id=\"" << psu->
idex <<
"\" cmodid=\"" << psu->
cmodid_LV
1437 <<
"\" onclick=\"showData(evt);\" onmouseover=\"showData(evt);\" onmouseout=\"showData(evt);\" MESSAGE=\""
1438 "\" POS=\"easyCrate/easyBoard "
1440 <<
"," << green <<
"," << blue <<
")\" points=\"";
1443 *svgfile << 255 <<
" " << 255 <<
" " << 255 <<
" ";
1446 <<
"<svg:polygon detid=\"" << psu->
idex <<
"\" count=\"" << psu->
count <<
"\" value=\"" << psu->
value
1447 <<
"\" id=\"" << psu->
idex <<
"\" cmodid=\"" << psu->
cmodid_LV
1448 <<
"\" onclick=\"showData(evt);\" onmouseover=\"showData(evt);\" onmouseout=\"showData(evt);\" MESSAGE=\""
1449 "\" POS=\"easyCrate/easyBoard "
1451 <<
" \" fill=\"white\" points=\"";
1458 if (psu->
green > 255)
1460 if (psu->
blue > 255)
1463 *svgfile << psu->
red <<
" " << psu->
green <<
" " << psu->
blue <<
" ";
1466 <<
"<svg:polygon detid=\"" << psu->
idex <<
"\" count=\"" << psu->
count <<
"\" value=\"" << psu->
value
1467 <<
"\" id=\"" << psu->
idex <<
"\" cmodid=\"" << psu->
cmodid_LV
1468 <<
"\" onclick=\"showData(evt);\" onmouseover=\"showData(evt);\" onmouseout=\"showData(evt);\" MESSAGE=\""
1469 "\" POS=\"easyCrate/easyBoard "
1471 <<
"," << psu->
green <<
"," << psu->
blue <<
")\" points=\"";
1475 *svgfile << np <<
" ";
1476 for (
int k = 0;
k <
np;
k++) {
1478 *svgfile << xd[
k] <<
" " << yd[
k] <<
" ";
1480 *svgfile << xd[
k] <<
"," << yd[
k] <<
" ";
1483 *svgfile << std::endl;
1485 *svgfile <<
"\" />" << std::endl;
1489 int rack,
int numcrate_inrack,
bool print_total,
TmPsu *psu, std::ofstream *svgfile,
bool usePsuValue) {
1490 double xp[4], yp[4];
1495 double xd[4], yd[4];
1497 double boxinitx = 35, boxinity = 12;
1498 double dx = 1.1,
dy = 1.3;
1500 boxinitx = boxinitx + (5 - psu->
getPsuCrate()) * 5;
1501 boxinity = boxinity + (18 - psu->
getPsuBoard()) * 1.75;
1505 xp[1] = boxinitx +
dx;
1507 xp[2] = boxinitx +
dx;
1508 yp[2] = boxinity +
dy;
1510 yp[3] = boxinity +
dy;
1512 for (
int j = 0;
j < 4;
j++) {
1519 sprintf(buffer,
"%X", psu->
idex);
1521 s.erase(s.begin() + s.find(
"connected"), s.end());
1527 redHV2 = (color >> 16) & 0xFF;
1528 greenHV2 = (color >> 8) & 0xFF;
1529 blueHV2 = (color)&0xFF;
1533 *svgfile << redHV2 <<
" " << greenHV2 <<
" " << blueHV2 <<
" ";
1536 <<
"<svg:polygon detid=\"" << psu->
idex <<
"\" count=\"" << psu->
countHV2 <<
"\" value=\"" << psu->
valueHV2
1537 <<
"\" id=\"" << psu->
idex * 10 + 2 <<
"\" cmodid=\"" << psu->
cmodid_HV2
1538 <<
"\" onclick=\"showData(evt);\" onmouseover=\"showData(evt);\" onmouseout=\"showData(evt);\" MESSAGE=\""
1539 "\" POS=\"easyCrate/easyBoard "
1540 << psu->
getPsuCrate() <<
"/" << psu->
getPsuBoard() <<
" connected to " << s <<
" \" fill=\"rgb(" << redHV2
1541 <<
"," << greenHV2 <<
"," << blueHV2 <<
")\" points=\"";
1544 *svgfile << 255 <<
" " << 255 <<
" " << 255 <<
" ";
1547 <<
"<svg:polygon detid=\"" << psu->
idex <<
"\" count=\"" << psu->
countHV2 <<
"\" value=\"" << psu->
valueHV2
1548 <<
"\" id=\"" << psu->
idex * 10 + 2 <<
"\" cmodid=\"" << psu->
cmodid_HV2
1549 <<
"\" onclick=\"showData(evt);\" onmouseover=\"showData(evt);\" onmouseout=\"showData(evt);\" MESSAGE=\""
1550 "\" POS=\"easyCrate/easyBoard "
1552 <<
" \" fill=\"white\" points=\"";
1567 <<
"<svg:polygon detid=\"" << psu->
idex <<
"\" count=\"" << psu->
countHV2 <<
"\" value=\"" << psu->
valueHV2
1568 <<
"\" id=\"" << psu->
idex * 10 + 2 <<
"\" cmodid=\"" << psu->
cmodid_HV2
1569 <<
"\" onclick=\"showData(evt);\" onmouseover=\"showData(evt);\" onmouseout=\"showData(evt);\" MESSAGE=\""
1570 "\" POS=\"easyCrate/easyBoard "
1576 *svgfile << np <<
" ";
1577 for (
int k = 0;
k <
np;
k++) {
1579 *svgfile << xd[
k] <<
" " << yd[
k] <<
" ";
1581 *svgfile << xd[
k] <<
"," << yd[
k] <<
" ";
1584 *svgfile << std::endl;
1586 *svgfile <<
"\" />" << std::endl;
1590 int rack,
int numcrate_inrack,
bool print_total,
TmPsu *psu, std::ofstream *svgfile,
bool usePsuValue) {
1591 double xp[4], yp[4];
1596 double xd[4], yd[4];
1598 double boxinitx = 36.5, boxinity = 12;
1599 double dx = 1.1,
dy = 1.3;
1601 boxinitx = boxinitx + (5 - psu->
getPsuCrate()) * 5;
1602 boxinity = boxinity + (18 - psu->
getPsuBoard()) * 1.75;
1606 xp[1] = boxinitx +
dx;
1608 xp[2] = boxinitx +
dx;
1609 yp[2] = boxinity +
dy;
1611 yp[3] = boxinity +
dy;
1613 for (
int j = 0;
j < 4;
j++) {
1620 sprintf(buffer,
"%X", psu->
idex);
1622 s.erase(s.begin() + s.find(
"connected"), s.end());
1627 redHV3 = (color >> 16) & 0xFF;
1628 greenHV3 = (color >> 8) & 0xFF;
1629 blueHV3 = (color)&0xFF;
1633 *svgfile << redHV3 <<
" " << greenHV3 <<
" " << blueHV3 <<
" ";
1636 <<
"<svg:polygon detid=\"" << psu->
idex <<
"\" count=\"" << psu->
countHV3 <<
"\" value=\"" << psu->
valueHV3
1637 <<
"\" id=\"" << psu->
idex * 10 + 3 <<
"\" cmodid=\"" << psu->
cmodid_HV3
1638 <<
"\" onclick=\"showData(evt);\" onmouseover=\"showData(evt);\" onmouseout=\"showData(evt);\" MESSAGE=\""
1639 "\" POS=\"easyCrate/easyBoard"
1640 << psu->
getPsuCrate() <<
"/" << psu->
getPsuBoard() <<
" connected to " << s <<
" \" fill=\"rgb(" << redHV3
1641 <<
"," << greenHV3 <<
"," << blueHV3 <<
")\" points=\"";
1644 *svgfile << 255 <<
" " << 255 <<
" " << 255 <<
" ";
1647 <<
"<svg:polygon detid=\"" << psu->
idex <<
"\" count=\"" << psu->
countHV3 <<
"\" value=\"" << psu->
valueHV3
1648 <<
"\" id=\"" << psu->
idex * 10 + 3 <<
"\" cmodid=\"" << psu->
cmodid_HV3
1649 <<
"\" onclick=\"showData(evt);\" onmouseover=\"showData(evt);\" onmouseout=\"showData(evt);\" MESSAGE=\""
1650 "\" POS=\"easyCrate/easyBoard "
1652 <<
" \" fill=\"white\" points=\"";
1667 <<
"<svg:polygon detid=\"" << psu->
idex <<
"\" count=\"" << psu->
countHV3 <<
"\" value=\"" << psu->
valueHV3
1668 <<
"\" id=\"" << psu->
idex * 10 + 3 <<
"\" cmodid=\"" << psu->
cmodid_HV3
1669 <<
"\" onclick=\"showData(evt);\" onmouseover=\"showData(evt);\" onmouseout=\"showData(evt);\" MESSAGE=\""
1670 "\" POS=\"easyCrate/easyBoard "
1676 *svgfile << np <<
" ";
1677 for (
int k = 0;
k <
np;
k++) {
1679 *svgfile << xd[
k] <<
" " << yd[
k] <<
" ";
1681 *svgfile << xd[
k] <<
"," << yd[
k] <<
" ";
1684 *svgfile << std::endl;
1686 *svgfile <<
"\" />" << std::endl;
1690 bool print_total,
float minval,
float maxval,
std::string s,
int width,
int height) {
1693 std::vector<TPolyLine *> vp;
1694 TGaxis *axis =
nullptr;
1695 size_t found = filetype.find_last_of(
'.');
1696 filetype = filetype.substr(found + 1);
1697 found = outputfilename.find_last_of(
'.');
1698 outputfilename = outputfilename.substr(0, found);
1700 if (filetype ==
"xml" || filetype ==
"svg")
1702 std::ostringstream outs;
1705 outs << outputfilename <<
".coor";
1708 std::map<int, TmCcu *>::iterator i_ccu;
1709 std::multimap<TmCcu *, TmModule *>::iterator it;
1710 std::pair<std::multimap<TmCcu *, TmModule *>::iterator, std::multimap<TmCcu *, TmModule *>::iterator>
ret;
1712 bool useCcuValue =
false;
1714 for (i_ccu =
ccuMap.begin(); i_ccu !=
ccuMap.end(); i_ccu++) {
1715 TmCcu *ccu = i_ccu->second;
1716 if (ccu !=
nullptr) {
1717 if (ccu->
count > 0 || ccu->
red != -1) {
1725 for (i_ccu =
ccuMap.begin(); i_ccu !=
ccuMap.end(); i_ccu++) {
1726 TmCcu *ccu = i_ccu->second;
1727 if (ccu !=
nullptr) {
1729 for (it = ret.first; it != ret.second; ++it) {
1730 if ((*it).second->count > 0) {
1731 ccu->
value = ccu->
value + (*it).second->value;
1737 if (ccu->
nmod == 0) {
1745 if (
title.find(
"QTestAlarm") != std::string::npos) {
1746 for (i_ccu =
ccuMap.begin(); i_ccu !=
ccuMap.end(); i_ccu++) {
1747 TmCcu *ccu = i_ccu->second;
1748 if (ccu !=
nullptr) {
1753 for (it = ret.first; it != ret.second; ++it) {
1754 if (!((*it).second->red == 0 && (*it).second->green == 255 && (*it).second->blue == 0) &&
1755 !((*it).second->red == 255 && (*it).second->green == 255 && (*it).second->blue == 255)) {
1766 for (i_ccu =
ccuMap.begin(); i_ccu !=
ccuMap.end(); i_ccu++) {
1767 TmCcu *ccu = i_ccu->second;
1768 if (ccu !=
nullptr) {
1778 for (i_ccu =
ccuMap.begin(); i_ccu !=
ccuMap.end(); i_ccu++) {
1779 TmCcu *ccu = i_ccu->second;
1780 if (ccu !=
nullptr && ccu->
count > 0) {
1783 if (maxvalue < ccu->
value)
1789 if (filetype ==
"svg") {
1791 std::ostringstream outs;
1792 outs << outputfilename <<
".svg";
1794 *
savefile <<
"<?xml version=\"1.0\" standalone=\"no\" ?>" << std::endl;
1795 *
savefile <<
"<svg xmlns=\"http://www.w3.org/2000/svg\"" << std::endl;
1796 *
savefile <<
"xmlns:svg=\"http://www.w3.org/2000/svg\" " << std::endl;
1797 *
savefile <<
"xmlns:xlink=\"http://www.w3.org/1999/xlink\">" << std::endl;
1798 *
savefile <<
"<svg:svg id=\"mainMap\" x=\"0\" y=\"0\" viewBox=\"0 0 3000 1600"
1799 <<
"\" width=\"" << width <<
"\" height=\"" << height <<
"\">" << std::endl;
1800 *
savefile <<
"<svg:rect fill=\"lightblue\" stroke=\"none\" x=\"0\" y=\"0\" width=\"3000\" height=\"1600\" /> "
1802 *
savefile <<
"<svg:g id=\"fedtrackermap\" transform=\"translate(10,1500) rotate(270)\" "
1803 "style=\"fill:none;stroke:black;stroke-width:0;\"> "
1806 for (
int crate = 1; crate < (
nfeccrates + 1); crate++) {
1807 if (filetype ==
"xml") {
1809 std::ostringstream outs;
1810 outs << outputfilename <<
"feccrate" << crate <<
".xml";
1812 *
savefile <<
"<?xml version=\"1.0\" standalone=\"no\"?>" << std::endl;
1813 *
savefile <<
"<svg xmlns=\"http://www.w3.org/2000/svg\"" << std::endl;
1814 *
savefile <<
"xmlns:svg=\"http://www.w3.org/2000/svg\"" << std::endl;
1815 *
savefile <<
"xmlns:xlink=\"http://www.w3.org/1999/xlink\" >" << std::endl;
1816 *
savefile <<
"<script type=\"text/ecmascript\" xlink:href=\"feccrate.js\" />" << std::endl;
1817 *
savefile <<
"<svg id=\"mainMap\" x=\"0\" y=\"0\" viewBox=\"0 0 500 500\" width=\"700\" height=\"700\" "
1818 "onload=\"TrackerCrate.init()\">"
1820 *
savefile <<
"<rect fill=\"lightblue\" stroke=\"none\" x=\"0\" y=\"0\" width=\"700\" height=\"700\" />"
1822 *
savefile <<
"<g id=\"crate\" transform=\" translate(280,580) rotate(270) scale(.7,.8)\" > " << std::endl;
1827 for (i_ccu =
ccuMap.begin(); i_ccu !=
ccuMap.end(); i_ccu++) {
1828 TmCcu *ccu = i_ccu->second;
1829 if (ccu !=
nullptr) {
1837 if (filetype ==
"xml") {
1838 *
savefile <<
"</g> </svg> <text id=\"currentElementText\" x=\"40\" y=\"30\"> " << std::endl;
1839 *
savefile <<
"<tspan id=\"line1\" x=\"40\" y=\"30\"> </tspan> " << std::endl;
1840 *
savefile <<
"<tspan id=\"line2\" x=\"40\" y=\"60\"> </tspan> " << std::endl;
1841 *
savefile <<
" </text> </svg>" << std::endl;
1847 if (filetype ==
"svg") {
1848 *
savefile <<
"</g> </svg> </svg> " << std::endl;
1851 if (!print_total && !useCcuValue) {
1853 for (i_ccu =
ccuMap.begin(); i_ccu !=
ccuMap.end(); i_ccu++) {
1854 TmCcu *ccu = i_ccu->second;
1855 if (ccu !=
nullptr) {
1865 const char *command1;
1866 std::string tempfilename = outputfilename +
".coor";
1869 std::ifstream tempfile(tempfilename.c_str(),
std::ios::in);
1870 TCanvas *MyC =
new TCanvas(
"MyC",
"TrackerMap", width, height);
1871 gPad->SetFillColor(38);
1874 gPad->Range(0, 0, 3700, 1600);
1876 gPad->Range(0, 0, 3800, 1600);
1880 typedef std::map<int, int> ColorList;
1881 ColorList colorList;
1882 ColorList::iterator pos;
1884 while (!tempfile.eof()) {
1885 tempfile >> red >> green >> blue >>
npoints;
1886 colindex = red + green * 1000 + blue * 1000000;
1887 pos = colorList.find(colindex);
1888 if (pos == colorList.end()) {
1889 colorList[colindex] = ncolor + 100;
1890 col = gROOT->GetColor(ncolor + 100);
1892 col->SetRGB((Double_t)(red / 255.), (Double_t)(green / 255.), (Double_t)(blue / 255.));
1894 c =
new TColor(ncolor + 100, (Double_t)(red / 255.), (Double_t)(green / 255.), (Double_t)(blue / 255.));
1900 tempfile >> x[
i] >> y[
i];
1903 if (ncolor > 0 && ncolor < 10000) {
1905 for (
int i = 0;
i < ncolor;
i++) {
1906 colors[
i] =
i + 100;
1908 gStyle->SetPalette(ncolor, colors);
1911 tempfile.seekg(0, std::ios::beg);
1912 std::cout <<
"created palette with " << ncolor <<
" colors" << std::endl;
1913 while (!tempfile.eof()) {
1914 tempfile >> red >> green >> blue >>
npoints;
1916 tempfile >> x[
i] >> y[
i];
1918 colindex = red + green * 1000 + blue * 1000000;
1919 pos = colorList.find(colindex);
1920 if (pos != colorList.end()) {
1921 TPolyLine *pline =
new TPolyLine(npoints, y, x);
1922 vp.push_back(pline);
1923 pline->SetFillColor(colorList[colindex]);
1924 pline->SetLineWidth(0);
1935 axis =
new TGaxis(3660, 36, 3660, 1530, lminvalue, lmaxvalue, 510,
"+L");
1936 axis->SetLabelSize(0.02);
1942 l.SetTextSize(0.05);
1944 if (
tkMapLog && (fulltitle.find(
"Log10 scale") == std::string::npos))
1945 fulltitle +=
": Log10 scale";
1946 l.DrawLatex(50, 1530, fulltitle.c_str());
1949 std::cout <<
"Filetype " << filetype << std::endl;
1950 if (filetype ==
"png") {
1952 MyC->Print(filename.c_str());
1954 if (filetype ==
"jpg") {
1956 MyC->Print(filename.c_str());
1958 if (filetype ==
"pdf") {
1960 MyC->Print(filename.c_str());
1963 command1 = command.c_str();
1964 std::cout <<
"Executing " << command1 << std::endl;
1970 for (std::vector<TPolyLine *>::iterator pos1 = vp.begin(); pos1 != vp.end(); pos1++) {
1978 bool print_total,
float minval,
float maxval,
std::string s,
int width,
int height) {
1981 std::vector<TPolyLine *> vp;
1982 TGaxis *axis =
nullptr;
1983 size_t found = filetype.find_last_of(
'.');
1984 filetype = filetype.substr(found + 1);
1985 found = outputfilename.find_last_of(
'.');
1986 outputfilename = outputfilename.substr(0, found);
1990 if (filetype ==
"xml" || filetype ==
"svg")
1993 std::ostringstream outs;
1996 outs << outputfilename <<
".coor";
2000 std::map<int, TmPsu *>::iterator ipsu;
2001 std::multimap<TmPsu *, TmModule *>::iterator it;
2002 std::pair<std::multimap<TmPsu *, TmModule *>::iterator, std::multimap<TmPsu *, TmModule *>::iterator>
ret;
2004 bool usePsuValue =
false;
2006 for (ipsu =
psuMap.begin(); ipsu !=
psuMap.end(); ipsu++) {
2007 TmPsu *psu = ipsu->second;
2008 if (psu !=
nullptr) {
2018 for (ipsu =
psuMap.begin(); ipsu !=
psuMap.end(); ipsu++) {
2019 TmPsu *psu = ipsu->second;
2020 if (psu !=
nullptr) {
2024 for (it = ret.first; it != ret.second; ++it) {
2025 if ((*it).second->HVchannel == 2 && (*it).second->count > 0) {
2029 if ((*it).second->HVchannel == 3 && (*it).second->count > 0) {
2034 if (psu->
nmodHV2 != 0 && nconn1 > 0) {
2038 if (psu->
nmodHV3 != 0 && nconn2 > 0) {
2046 if (
title.find(
"QTestAlarm") != std::string::npos) {
2047 for (ipsu =
psuMap.begin(); ipsu !=
psuMap.end(); ipsu++) {
2048 TmPsu *psu = ipsu->second;
2049 if (psu !=
nullptr) {
2057 for (it = ret.first; it != ret.second; ++it) {
2058 if ((*it).second->HVchannel == 2) {
2059 if (!((*it).second->red == 0 && (*it).second->green == 255 && (*it).second->blue == 0) &&
2060 !((*it).second->red == 255 && (*it).second->green == 255 && (*it).second->blue == 255)) {
2066 if ((*it).second->HVchannel == 3) {
2067 if (!((*it).second->red == 0 && (*it).second->green == 255 && (*it).second->blue == 0) &&
2068 !((*it).second->red == 255 && (*it).second->green == 255 && (*it).second->blue == 255)) {
2080 for (ipsu =
psuMap.begin(); ipsu !=
psuMap.end(); ipsu++) {
2081 TmPsu *psu = ipsu->second;
2082 if (psu !=
nullptr) {
2095 for (ipsu =
psuMap.begin(); ipsu !=
psuMap.end(); ipsu++) {
2096 TmPsu *psu = ipsu->second;
2100 if (maxvalue < psu->valueHV2 || maxvalue < psu->valueHV3)
2106 if (filetype ==
"svg") {
2108 std::ostringstream outs;
2109 outs << outputfilename <<
".svg";
2111 *
savefile <<
"<?xml version=\"1.0\" standalone=\"no\" ?>" << std::endl;
2112 *
savefile <<
"<svg xmlns=\"http://www.w3.org/2000/svg\"" << std::endl;
2113 *
savefile <<
"xmlns:svg=\"http://www.w3.org/2000/svg\" " << std::endl;
2114 *
savefile <<
"xmlns:xlink=\"http://www.w3.org/1999/xlink\">" << std::endl;
2115 *
savefile <<
"<svg:svg id=\"mainMap\" x=\"0\" y=\"0\" viewBox=\"0 0 3000 1600"
2116 <<
"\" width=\"" << width <<
"\" height=\"" << height <<
"\">" << std::endl;
2117 *
savefile <<
"<svg:rect fill=\"lightblue\" stroke=\"none\" x=\"0\" y=\"0\" width=\"3000\" height=\"1600\" /> "
2119 *
savefile <<
"<svg:g id=\"HVtrackermap\" transform=\"translate(10,1500) rotate(270)\" "
2120 "style=\"fill:none;stroke:black;stroke-width:0;\"> "
2124 for (
int irack = 1; irack < (
npsuracks + 1); irack++) {
2125 if (filetype ==
"xml") {
2127 std::ostringstream outs;
2128 outs << outputfilename <<
"HVrack" << irack <<
".xml";
2130 *
savefile <<
"<?xml version=\"1.0\" standalone=\"no\"?>" << std::endl;
2131 *
savefile <<
"<svg xmlns=\"http://www.w3.org/2000/svg\"" << std::endl;
2132 *
savefile <<
"xmlns:svg=\"http://www.w3.org/2000/svg\"" << std::endl;
2133 *
savefile <<
"xmlns:xlink=\"http://www.w3.org/1999/xlink\" >" << std::endl;
2134 *
savefile <<
"<script type=\"text/ecmascript\" xlink:href=\"rackhv.js\" />" << std::endl;
2135 *
savefile <<
"<svg id=\"mainMap\" x=\"0\" y=\"0\" viewBox=\"0 0 500 500\" width=\"700\" height=\"700\" "
2136 "onload=\"TrackerRackhv.init()\">"
2138 *
savefile <<
"<rect fill=\"lightblue\" stroke=\"none\" x=\"0\" y=\"0\" width=\"700\" height=\"700\" />"
2140 *
savefile <<
"<g id=\"rackhv\" transform=\" translate(150,500) rotate(270) scale(1.,1.)\" > " << std::endl;
2145 for (ipsu =
psuMap.begin(); ipsu !=
psuMap.end(); ipsu++) {
2146 TmPsu *psu = ipsu->second;
2149 drawHV3(irack, psu->getPsuCrate(), print_total, psu,
savefile, usePsuValue);
2154 if (filetype ==
"xml") {
2155 *
savefile <<
"</g> </svg> <text id=\"currentElementText\" x=\"40\" y=\"30\"> " << std::endl;
2156 *
savefile <<
"<tspan id=\"line1\" x=\"40\" y=\"30\"> </tspan> " << std::endl;
2157 *
savefile <<
"<tspan id=\"line2\" x=\"40\" y=\"60\"> </tspan> " << std::endl;
2158 *
savefile <<
" </text> </svg>" << std::endl;
2164 if (filetype ==
"svg") {
2165 *
savefile <<
"</g> </svg> </svg> " << std::endl;
2170 if (!print_total && !usePsuValue) {
2171 for (ipsu =
psuMap.begin(); ipsu !=
psuMap.end(); ipsu++) {
2172 TmPsu *psu = ipsu->second;
2173 if (psu !=
nullptr) {
2185 const char *command1;
2186 std::string tempfilename = outputfilename +
".coor";
2189 std::ifstream tempfile(tempfilename.c_str(),
std::ios::in);
2190 TCanvas *MyC =
new TCanvas(
"MyC",
"TrackerMap", width, height);
2191 gPad->SetFillColor(38);
2194 gPad->Range(0, 0, 3700, 1600);
2196 gPad->Range(0, 0, 3800, 1600);
2200 typedef std::map<int, int> ColorList;
2201 ColorList colorList;
2202 ColorList::iterator pos;
2204 while (!tempfile.eof()) {
2205 tempfile >> red >> green >> blue >>
npoints;
2206 colindex = red + green * 1000 + blue * 1000000;
2207 pos = colorList.find(colindex);
2208 if (pos == colorList.end()) {
2209 colorList[colindex] = ncolor + 100;
2210 col = gROOT->GetColor(ncolor + 100);
2212 col->SetRGB((Double_t)(red / 255.), (Double_t)(green / 255.), (Double_t)(blue / 255.));
2214 c =
new TColor(ncolor + 100, (Double_t)(red / 255.), (Double_t)(green / 255.), (Double_t)(blue / 255.));
2220 tempfile >> x[
i] >> y[
i];
2223 if (ncolor > 0 && ncolor < 10000) {
2225 for (
int i = 0;
i < ncolor;
i++) {
2226 colors[
i] =
i + 100;
2228 gStyle->SetPalette(ncolor, colors);
2231 tempfile.seekg(0, std::ios::beg);
2232 std::cout <<
"created palette with " << ncolor <<
" colors" << std::endl;
2233 while (!tempfile.eof()) {
2234 tempfile >> red >> green >> blue >>
npoints;
2236 tempfile >> x[
i] >> y[
i];
2238 colindex = red + green * 1000 + blue * 1000000;
2239 pos = colorList.find(colindex);
2240 if (pos != colorList.end()) {
2241 TPolyLine *pline =
new TPolyLine(npoints, y, x);
2242 vp.push_back(pline);
2243 pline->SetFillColor(colorList[colindex]);
2244 pline->SetLineWidth(0);
2255 axis =
new TGaxis(3660, 36, 3660, 1530, lminvalue, lmaxvalue, 510,
"+L");
2256 axis->SetLabelSize(0.02);
2262 l.SetTextSize(0.05);
2264 if (
tkMapLog && (fulltitle.find(
"Log10 scale") == std::string::npos))
2265 fulltitle +=
": Log10 scale";
2266 l.DrawLatex(50, 1530, fulltitle.c_str());
2269 std::cout <<
"Filetype " << filetype << std::endl;
2270 if (filetype ==
"png") {
2272 MyC->Print(filename.c_str());
2274 if (filetype ==
"jpg") {
2276 MyC->Print(filename.c_str());
2278 if (filetype ==
"pdf") {
2280 MyC->Print(filename.c_str());
2283 command1 = command.c_str();
2284 std::cout <<
"Executing " << command1 << std::endl;
2290 for (std::vector<TPolyLine *>::iterator pos1 = vp.begin(); pos1 != vp.end(); pos1++) {
2299 bool print_total,
float minval,
float maxval,
std::string s,
int width,
int height) {
2302 bool rangefound =
true;
2304 std::vector<TPolyLine *> vp;
2305 TGaxis *axis =
nullptr;
2307 size_t found = filetype.find_last_of(
'.');
2308 filetype = filetype.substr(found + 1);
2309 found = outputfilename.find_last_of(
'.');
2310 outputfilename = outputfilename.substr(0, found);
2314 if (filetype ==
"xml" || filetype ==
"svg")
2317 std::ostringstream outs;
2320 outs << outputfilename <<
".coor";
2324 std::map<int, TmPsu *>::iterator ipsu;
2325 std::multimap<TmPsu *, TmModule *>::iterator it;
2326 std::pair<std::multimap<TmPsu *, TmModule *>::iterator, std::multimap<TmPsu *, TmModule *>::iterator>
ret;
2329 bool usePsuValue =
false;
2331 for (ipsu =
psuMap.begin(); ipsu !=
psuMap.end(); ipsu++) {
2332 TmPsu *psu = ipsu->second;
2333 if (psu !=
nullptr) {
2334 if (psu->
count > 0 || psu->
red != -1) {
2342 for (ipsu =
psuMap.begin(); ipsu !=
psuMap.end(); ipsu++) {
2343 TmPsu *psu = ipsu->second;
2344 if (psu !=
nullptr) {
2347 for (it = ret.first; it != ret.second; ++it) {
2348 if ((*it).second->count > 0) {
2350 psu->
value = psu->
value + (*it).second->value;
2361 if (
title.find(
"QTestAlarm") != std::string::npos) {
2362 for (ipsu =
psuMap.begin(); ipsu !=
psuMap.end(); ipsu++) {
2363 TmPsu *psu = ipsu->second;
2364 if (psu !=
nullptr) {
2369 for (it = ret.first; it != ret.second; ++it) {
2370 if (!((*it).second->red == 0 && (*it).second->green == 255 && (*it).second->blue == 0) &&
2371 !((*it).second->red == 255 && (*it).second->green == 255 && (*it).second->blue == 255)) {
2385 for (ipsu =
psuMap.begin(); ipsu !=
psuMap.end(); ipsu++) {
2386 TmPsu *psu = ipsu->second;
2387 if (psu !=
nullptr) {
2398 for (ipsu =
psuMap.begin(); ipsu !=
psuMap.end(); ipsu++) {
2399 TmPsu *psu = ipsu->second;
2400 if (psu !=
nullptr && psu->
count > 0) {
2404 if (maxvalue < psu->
value)
2412 if (filetype ==
"svg") {
2414 std::ostringstream outs;
2415 outs << outputfilename <<
".svg";
2417 *
savefile <<
"<?xml version=\"1.0\" standalone=\"no\" ?>" << std::endl;
2418 *
savefile <<
"<svg xmlns=\"http://www.w3.org/2000/svg\"" << std::endl;
2419 *
savefile <<
"xmlns:svg=\"http://www.w3.org/2000/svg\" " << std::endl;
2420 *
savefile <<
"xmlns:xlink=\"http://www.w3.org/1999/xlink\">" << std::endl;
2421 *
savefile <<
"<svg:svg id=\"mainMap\" x=\"0\" y=\"0\" viewBox=\"0 0 3000 1600"
2422 <<
"\" width=\"" << width <<
"\" height=\"" << height <<
"\">" << std::endl;
2423 *
savefile <<
"<svg:rect fill=\"lightblue\" stroke=\"none\" x=\"0\" y=\"0\" width=\"3000\" height=\"1600\" /> "
2425 *
savefile <<
"<svg:g id=\"psutrackermap\" transform=\"translate(10,1500) rotate(270)\" "
2426 "style=\"fill:none;stroke:black;stroke-width:0;\"> "
2430 for (
int irack = 1; irack < (
npsuracks + 1); irack++) {
2431 if (filetype ==
"xml") {
2433 std::ostringstream outs;
2434 outs << outputfilename <<
"psurack" << irack <<
".xml";
2436 *
savefile <<
"<?xml version=\"1.0\" standalone=\"no\"?>" << std::endl;
2437 *
savefile <<
"<svg xmlns=\"http://www.w3.org/2000/svg\"" << std::endl;
2438 *
savefile <<
"xmlns:svg=\"http://www.w3.org/2000/svg\"" << std::endl;
2439 *
savefile <<
"xmlns:xlink=\"http://www.w3.org/1999/xlink\" >" << std::endl;
2440 *
savefile <<
"<script type=\"text/ecmascript\" xlink:href=\"rack.js\" />" << std::endl;
2441 *
savefile <<
"<svg id=\"mainMap\" x=\"0\" y=\"0\" viewBox=\"0 0 500 500\" width=\"700\" height=\"700\" "
2442 "onload=\"TrackerCrate.init()\">"
2444 *
savefile <<
"<rect fill=\"lightblue\" stroke=\"none\" x=\"0\" y=\"0\" width=\"700\" height=\"700\" />"
2446 *
savefile <<
"<g id=\"rack\" transform=\" translate(150,500) rotate(270) scale(1.,1.)\" > " << std::endl;
2451 for (ipsu =
psuMap.begin(); ipsu !=
psuMap.end(); ipsu++) {
2452 TmPsu *psu = ipsu->second;
2459 if (filetype ==
"xml") {
2460 *
savefile <<
"</g> </svg> <text id=\"currentElementText\" x=\"40\" y=\"30\"> " << std::endl;
2461 *
savefile <<
"<tspan id=\"line1\" x=\"40\" y=\"30\"> </tspan> " << std::endl;
2462 *
savefile <<
"<tspan id=\"line2\" x=\"40\" y=\"60\"> </tspan> " << std::endl;
2463 *
savefile <<
" </text> </svg>" << std::endl;
2469 if (filetype ==
"svg") {
2470 *
savefile <<
"</g> </svg> </svg> " << std::endl;
2475 if (!print_total && !usePsuValue) {
2476 for (ipsu =
psuMap.begin(); ipsu !=
psuMap.end(); ipsu++) {
2477 TmPsu *psu = ipsu->second;
2478 if (psu !=
nullptr) {
2492 const char *command1;
2493 std::string tempfilename = outputfilename +
".coor";
2496 std::ifstream tempfile(tempfilename.c_str(),
std::ios::in);
2497 TCanvas *MyC =
new TCanvas(
"MyC",
"TrackerMap", width, height);
2498 gPad->SetFillColor(38);
2501 std::cout <<
" range x " << rangex << std::endl;
2502 std::cout <<
" range y " << rangey << std::endl;
2503 gPad->Range(0, 0, rangex, rangey);
2507 typedef std::map<int, int> ColorList;
2508 ColorList colorList;
2509 ColorList::iterator pos;
2511 while (!tempfile.eof()) {
2512 tempfile >> red >> green >> blue >>
npoints;
2513 colindex = red + green * 1000 + blue * 1000000;
2514 pos = colorList.find(colindex);
2515 if (pos == colorList.end()) {
2516 colorList[colindex] = ncolor + 100;
2517 col = gROOT->GetColor(ncolor + 100);
2519 col->SetRGB((Double_t)(red / 255.), (Double_t)(green / 255.), (Double_t)(blue / 255.));
2521 c =
new TColor(ncolor + 100, (Double_t)(red / 255.), (Double_t)(green / 255.), (Double_t)(blue / 255.));
2526 tempfile >> x[
i] >> y[
i];
2529 if (ncolor > 0 && ncolor < 10000) {
2531 for (
int i = 0;
i < ncolor;
i++) {
2532 colors[
i] =
i + 100;
2534 gStyle->SetPalette(ncolor, colors);
2537 tempfile.seekg(0, std::ios::beg);
2538 std::cout <<
"created palette with " << ncolor <<
" colors" << std::endl;
2539 while (!tempfile.eof()) {
2540 tempfile >> red >> green >> blue >>
npoints;
2542 tempfile >> x[
i] >> y[
i];
2544 colindex = red + green * 1000 + blue * 1000000;
2545 pos = colorList.find(colindex);
2546 if (pos != colorList.end()) {
2547 TPolyLine *pline =
new TPolyLine(npoints, y, x);
2548 vp.push_back(pline);
2549 pline->SetFillColor(colorList[colindex]);
2550 pline->SetLineWidth(0);
2561 axis =
new TGaxis(rangex - 140, 34, rangex - 140, rangey - 106, lminvalue, lmaxvalue, 510,
"+L");
2562 axis->SetLabelSize(0.02);
2568 l.SetTextSize(0.05);
2570 if (
tkMapLog && (fulltitle.find(
"Log10 scale") == std::string::npos))
2571 fulltitle +=
": Log10 scale";
2572 l.DrawLatex(50, rangey - 200, fulltitle.c_str());
2575 std::cout <<
"Filetype " << filetype << std::endl;
2576 if (filetype ==
"png") {
2578 MyC->Print(filename.c_str());
2580 if (filetype ==
"jpg") {
2582 MyC->Print(filename.c_str());
2584 if (filetype ==
"pdf") {
2586 MyC->Print(filename.c_str());
2589 command1 = command.c_str();
2590 std::cout <<
"Executing " << command1 << std::endl;
2596 for (std::vector<TPolyLine *>::iterator pos1 = vp.begin(); pos1 != vp.end(); pos1++) {
2605 bool print_total,
float minval,
float maxval,
std::string s,
int width,
int height) {
2608 bool rangefound =
true;
2610 std::vector<TPolyLine *> vp;
2611 TGaxis *axis =
nullptr;
2613 size_t found = filetype.find_last_of(
'.');
2614 filetype = filetype.substr(found + 1);
2615 found = outputfilename.find_last_of(
'.');
2616 outputfilename = outputfilename.substr(0, found);
2619 if (filetype ==
"xml" || filetype ==
"svg")
2621 std::ostringstream outs;
2624 outs << outputfilename <<
".coor";
2627 std::map<int, TmApvPair *>::iterator i_apv;
2628 std::map<int, int>::iterator i_fed;
2630 bool useApvPairValue =
false;
2631 for (i_apv =
apvMap.begin(); i_apv !=
apvMap.end(); i_apv++) {
2633 if (apvPair !=
nullptr) {
2635 if (apv_mod !=
nullptr && !apv_mod->
notInUse()) {
2636 if (apvPair->
count > 0 || apvPair->
red != -1) {
2637 useApvPairValue =
true;
2644 for (i_apv =
apvMap.begin(); i_apv !=
apvMap.end(); i_apv++) {
2646 if (apvPair !=
nullptr) {
2648 if (apv_mod !=
nullptr && !apv_mod->
notInUse()) {
2649 if (useApvPairValue)
2651 else if (apvPair->
mpos == 0 && apv_mod->
count > 0)
2661 for (i_apv =
apvMap.begin(); i_apv !=
apvMap.end(); i_apv++) {
2663 if (apvPair !=
nullptr) {
2665 if (apv_mod !=
nullptr && !apv_mod->
notInUse()) {
2666 if (useApvPairValue) {
2670 if (maxvalue < apvPair->
value)
2673 if (apv_mod->
count > 0) {
2677 if (maxvalue < apv_mod->
value)
2688 if (filetype ==
"svg") {
2690 std::ostringstream outs;
2691 outs << outputfilename <<
".svg";
2693 *
savefile <<
"<?xml version=\"1.0\" standalone=\"no\" ?>" << std::endl;
2694 *
savefile <<
"<svg xmlns=\"http://www.w3.org/2000/svg\"" << std::endl;
2695 *
savefile <<
"xmlns:svg=\"http://www.w3.org/2000/svg\" " << std::endl;
2696 *
savefile <<
"xmlns:xlink=\"http://www.w3.org/1999/xlink\">" << std::endl;
2697 *
savefile <<
"<svg:svg id=\"mainMap\" x=\"0\" y=\"0\" viewBox=\"0 0 3000 1600"
2698 <<
"\" width=\"" << width <<
"\" height=\"" << height <<
"\">" << std::endl;
2699 *
savefile <<
"<svg:rect fill=\"lightblue\" stroke=\"none\" x=\"0\" y=\"0\" width=\"3000\" height=\"1600\" /> "
2701 *
savefile <<
"<svg:g id=\"fedtrackermap\" transform=\"translate(10,1500) rotate(270)\" "
2702 "style=\"fill:none;stroke:black;stroke-width:0;\"> "
2706 if (filetype ==
"xml") {
2708 std::ostringstream outs;
2709 outs << outputfilename <<
"crate" << crate <<
".xml";
2711 *
savefile <<
"<?xml version=\"1.0\" standalone=\"no\"?>" << std::endl;
2712 *
savefile <<
"<svg xmlns=\"http://www.w3.org/2000/svg\"" << std::endl;
2713 *
savefile <<
"xmlns:svg=\"http://www.w3.org/2000/svg\"" << std::endl;
2714 *
savefile <<
"xmlns:xlink=\"http://www.w3.org/1999/xlink\" >" << std::endl;
2715 *
savefile <<
"<script type=\"text/ecmascript\" xlink:href=\"crate.js\" />" << std::endl;
2716 *
savefile <<
"<svg id=\"mainMap\" x=\"0\" y=\"0\" viewBox=\"0 0 500 500\" width=\"700\" height=\"700\" "
2717 "onload=\"TrackerCrate.init()\">"
2719 *
savefile <<
"<rect fill=\"lightblue\" stroke=\"none\" x=\"0\" y=\"0\" width=\"700\" height=\"700\" />"
2721 *
savefile <<
"<g id=\"crate\" transform=\" translate(150,500) rotate(270) scale(1.,1.)\" > " << std::endl;
2725 int numfed_incrate = 0;
2726 for (i_fed =
fedMap.begin(); i_fed !=
fedMap.end(); i_fed++) {
2727 if (i_fed->second == crate) {
2728 int fedId = i_fed->first;
2746 for (
int nconn = 0; nconn < 96; nconn++) {
2747 int key = fedId * 1000 + nconn;
2749 if (apvPair !=
nullptr) {
2751 if (apv_mod !=
nullptr && !apv_mod->
notInUse()) {
2759 if (filetype ==
"xml") {
2760 *
savefile <<
"</g> </svg> <text id=\"currentElementText\" x=\"40\" y=\"30\"> " << std::endl;
2761 *
savefile <<
"<tspan id=\"line1\" x=\"40\" y=\"30\"> </tspan> " << std::endl;
2762 *
savefile <<
"<tspan id=\"line2\" x=\"40\" y=\"60\"> </tspan> " << std::endl;
2763 *
savefile <<
" </text> </svg>" << std::endl;
2770 if (filetype ==
"svg") {
2771 *
savefile <<
"</g> </svg> </svg> " << std::endl;
2775 if (!print_total && !useApvPairValue) {
2777 for (i_apv =
apvMap.begin(); i_apv !=
apvMap.end(); i_apv++) {
2779 if (apvPair !=
nullptr) {
2781 if (apv_mod !=
nullptr && apvPair->
mpos == 0 && !apv_mod->
notInUse()) {
2797 const char *command1;
2798 std::string tempfilename = outputfilename +
".coor";
2801 std::ifstream tempfile(tempfilename.c_str(),
std::ios::in);
2802 TCanvas *MyC =
new TCanvas(
"MyC",
"TrackerMap", width, height);
2803 gPad->SetFillColor(38);
2806 std::cout <<
" range x " << rangex << std::endl;
2807 std::cout <<
" range y " << rangey << std::endl;
2808 gPad->Range(0, 0, rangex, rangey);
2812 typedef std::map<int, int> ColorList;
2813 ColorList colorList;
2814 ColorList::iterator pos;
2816 while (!tempfile.eof()) {
2817 tempfile >> red >> green >> blue >>
npoints;
2818 colindex = red + green * 1000 + blue * 1000000;
2819 pos = colorList.find(colindex);
2820 if (pos == colorList.end()) {
2821 colorList[colindex] = ncolor + 100;
2822 col = gROOT->GetColor(ncolor + 100);
2824 col->SetRGB((Double_t)(red / 255.), (Double_t)(green / 255.), (Double_t)(blue / 255.));
2826 c =
new TColor(ncolor + 100, (Double_t)(red / 255.), (Double_t)(green / 255.), (Double_t)(blue / 255.));
2831 tempfile >> x[
i] >> y[
i];
2834 if (ncolor > 0 && ncolor < 10000) {
2836 for (
int i = 0;
i < ncolor;
i++) {
2837 colors[
i] =
i + 100;
2839 gStyle->SetPalette(ncolor, colors);
2842 tempfile.seekg(0, std::ios::beg);
2843 std::cout <<
"created palette with " << ncolor <<
" colors" << std::endl;
2844 while (!tempfile.eof()) {
2845 tempfile >> red >> green >> blue >>
npoints;
2847 tempfile >> x[
i] >> y[
i];
2849 colindex = red + green * 1000 + blue * 1000000;
2850 pos = colorList.find(colindex);
2851 if (pos != colorList.end()) {
2852 TPolyLine *pline =
new TPolyLine(npoints, y, x);
2853 vp.push_back(pline);
2854 pline->SetFillColor(colorList[colindex]);
2855 pline->SetLineWidth(0);
2866 axis =
new TGaxis(rangex - 140, 34, rangex - 140, rangey - 106, lminvalue, lmaxvalue, 510,
"+L");
2867 axis->SetLabelSize(0.02);
2873 l.SetTextSize(0.05);
2875 if (
tkMapLog && (fulltitle.find(
"Log10 scale") == std::string::npos))
2876 fulltitle +=
": Log10 scale";
2877 l.DrawLatex(50, rangey - 200, fulltitle.c_str());
2880 std::cout <<
"Filetype " << filetype << std::endl;
2881 if (filetype ==
"png") {
2883 MyC->Print(filename.c_str());
2885 if (filetype ==
"jpg") {
2887 MyC->Print(filename.c_str());
2889 if (filetype ==
"pdf") {
2891 MyC->Print(filename.c_str());
2894 command1 = command.c_str();
2895 std::cout <<
"Executing " << command1 << std::endl;
2901 for (std::vector<TPolyLine *>::iterator pos1 = vp.begin(); pos1 != vp.end(); pos1++) {
2912 int ipos, ipos1, ipos2,
id = 0,
val = 0;
2915 ipos1 = line.find(
"value=\"");
2917 value = line.substr(ipos1 + 7, 10);
2918 ipos = value.find(
'\"');
2919 value = value.substr(0, ipos);
2920 val = atoi(value.c_str());
2922 ipos2 = line.find(
"detid=\"");
2924 value = line.substr(ipos2 + 7, 10);
2925 ipos = value.find(
'\"');
2926 value = value.substr(0, ipos);
2927 id = atoi(value.c_str());
2929 if (ipos1 > 0 && ipos2 > 0 &&
val > 0)
2931 if (ipos1 > 0 && ipos2 > 0)
2935 std::cout << nline <<
" modules found in this svg file " << std::endl;
2945 std::ostringstream outs;
2948 outs << outputfilename <<
".xml";
2954 while (getline(*jsfile, line)) {
2955 *
svgfile << line << std::endl;
2966 if (mod !=
nullptr && !mod->
notInUse()) {
2981 if (mod !=
nullptr && !mod->
notInUse()) {
2984 if (maxvalue < mod->
value)
2998 if (mod !=
nullptr && !mod->
notInUse()) {
3004 *
svgfile <<
"</svg:g></svg:svg>" << std::endl;
3005 *
svgfile <<
" <svg:text id=\"Title\" class=\"normalText\" x=\"300\" y=\"0\">" <<
title <<
"</svg:text>" << std::endl;
3008 *
svgfile <<
"</svg:svg>" << std::endl;
3009 *
svgfile <<
"</body></html>" << std::endl;
3015 std::cout <<
"preparing the palette" << std::endl;
3018 int paletteLength = 250;
3019 int width = 50 * (yoffset - 40) / 1500;
3024 float step = float(yoffset - 40) / float(paletteLength);
3025 for (
int i = 1;
i < paletteLength + 1;
i++) {
3027 red = (color >> 16) & 0xFF;
3028 green = (color >> 8) & 0xFF;
3029 blue = (color)&0xFF;
3041 *svgfile <<
"<svg:rect x=\"3610\" y=\"" << (1550 - 6 *
i) <<
"\" width=\"50\" height=\"6\" fill=\"rgb(" << red
3042 <<
"," << green <<
"," << blue <<
")\" />\n";
3044 *svgfile << red <<
" " << green <<
" " << blue <<
" 4 " << int(step *
i) + 34 <<
" " << xoffset - width <<
". "
3046 int(step * i) + 34 <<
" " << xoffset <<
". " <<
3047 int(step * (i - 1)) + 34 <<
" " << xoffset <<
". " <<
3048 int(step * (i - 1)) + 34 <<
" " << xoffset - width <<
". " << std::endl;
3052 *svgfile <<
"<svg:rect x=\"3610\" y=\"" << (1550 - 6 *
i)
3053 <<
"\" width=\"50\" height=\"1\" fill=\"black\" />\n";
3055 *svgfile <<
" <svg:text class=\"normalText\" x=\"3660\" y=\"" << (1560 - 6 *
i) <<
"\">" << val
3056 <<
"</svg:text>" << std::endl;
3063 int key = fedId * 1000 + fedCh;
3066 if (apvpair !=
nullptr) {
3068 apvpair->
green = green;
3072 std::cout <<
"*** error in FedTrackerMap fillc method ***";
3076 std::multimap<const int, TmApvPair *>::iterator pos;
3079 if (apvpair !=
nullptr) {
3085 std::cout <<
"*** error in FedTrackerMap fill by module method ***";
3089 int key = fedId * 1000 + fedCh;
3092 if (apvpair !=
nullptr) {
3093 apvpair->
value = current_val;
3097 std::cout <<
"*** error in FedTrackerMap fill_current_val method ***";
3101 int key = crate * 10000000 + slot * 100000 + ring * 1000 +
addr;
3105 if (ccu !=
nullptr) {
3111 std::cout <<
"*** error in FecTrackerMap fillc method ***";
3115 int key = crate * 10000000 + slot * 100000 + ring * 1000 +
addr;
3117 if (ccu !=
nullptr) {
3123 std::cout <<
"*** error in FecTrackerMap fill by module method ***";
3127 int key = rack * 1000 + crate * 100 + board;
3131 if (psu !=
nullptr) {
3137 std::cout <<
"*** error in LVTrackerMap fillc method ***";
3141 int key = rack * 1000 + crate * 100 + board;
3143 if (psu !=
nullptr) {
3149 std::cout <<
"*** error in LVTrackerMap fill by module method ***";
3153 int key = rack * 1000 + crate * 100 + board;
3157 if (psu !=
nullptr) {
3163 std::cout <<
"*** error in HVTrackerMap (channel 2) fillc method ***";
3166 int key = rack * 1000 + crate * 100 + board;
3170 if (psu !=
nullptr) {
3176 std::cout <<
"*** error in HVTrackerMap (channel 3) fillc method ***";
3180 int key = rack * 1000 + crate * 100 + board;
3182 if (psu !=
nullptr) {
3188 std::cout <<
"*** error in HVTrackerMap fill by module method ***";
3191 int key = rack * 1000 + crate * 100 + board;
3193 if (psu !=
nullptr) {
3199 std::cout <<
"*** error in HVTrackerMap fill by module method ***";
3203 int key = fedId * 1000 + fedCh;
3205 if (apvpair !=
nullptr) {
3209 std::cout <<
"*** error in FedTrackerMap module method ***";
3212 int key = fedId * 1000 + fedCh;
3214 if (apvpair !=
nullptr) {
3219 std::cout <<
"*** error inFedTrackerMap fill method ***";
3224 if (mod !=
nullptr) {
3230 std::cout <<
"**************************error in fill method **************module " << idmod << std::endl;
3233 int key = layer * 10000 + ring * 1000 + nmod;
3236 if (mod !=
nullptr) {
3242 std::cout <<
"**************************error in fill method **************" << std::endl;
3246 std::map<const int, TmModule *>::iterator imod;
3248 fillc(imod->first, 255, 255, 255);
3253 std::map<const int, TmModule *>::iterator imod;
3261 if (mod !=
nullptr) {
3262 mod->
value = current_val;
3266 std::cout <<
"**error in fill_current_val method ***module " << idmod << std::endl;
3271 if (mod !=
nullptr) {
3278 if (mod1 !=
nullptr && mod2 !=
nullptr) {
3286 std::cout <<
"**************************error in fill method **************module " << idmod << std::endl;
3290 int key = layer * 100000 + ring * 1000 + nmod;
3292 if (mod !=
nullptr) {
3296 std::cout <<
"**************************error in SvgModuleMap **************";
3301 if (mod !=
nullptr) {
3304 std::cout <<
"**************************error in IdModuleMap **************";
3308 int key = layer * 100000 + ring * 1000 + nmod;
3310 if (mod !=
nullptr) {
3313 std::cout <<
"**************************error in SvgModuleMap **************";
3319 int nmods, pix_sil, fow_bar,
ring, nmod,
layer;
3321 float posx, posy, posz, length, width,
thickness, widthAtHalfLength;
3322 int iModule = 0, old_layer = 0, ntotMod = 0;
3325 while (!infile.eof()) {
3326 infile >> nmods >> pix_sil >> fow_bar >> layer >> ring >> nmod >> posx >> posy >> posz >> length >> width >>
3327 thickness >> widthAtHalfLength >> idex;
3328 getline(infile, dummys);
3329 getline(infile, name);
3330 if (old_layer != layer) {
3336 int key = layer * 100000 + ring * 1000 + nmod;
3342 std::cout <<
"error in module " << key << std::endl;
3363 float lminvalue, lmaxvalue;
3369 value =
log(value) /
log(10);
3376 float delta = (lmaxvalue - lminvalue);
3377 float x = (value - lminvalue);
3378 if (value < lminvalue) {
3383 if (value > lmaxvalue) {
3388 if (value >= lminvalue && value <= lmaxvalue) {
3389 red = (int)(x < (delta / 2) ? 0 : (x > ((3. / 4.) *
delta) ? 255 : 255 / (delta / 4) * (x - (2. / 4.) *
delta)));
3391 (int)(x < delta / 4 ? (x * 255 / (delta / 4))
3392 : (x > ((3. / 4.) *
delta) ? 255 - 255 / (delta / 4) * (x - (3. / 4.) *
delta) : 255));
3393 blue = (int)(x < delta / 4 ? 255
3394 : (x > ((1. / 2.) *
delta) ? 0 : 255 - 255 / (delta / 4) * (x - (1. / 4.) *
delta)));
3398 green = (int)((value - lminvalue) / (lmaxvalue - lminvalue) * 256.);
3403 green = 255 - green;
3406 return (blue | (green << 8) | (red << 16));
3410 std::ofstream *ofilename;
3411 std::ifstream *ifilename;
3412 std::ostringstream
ofname;
3417 ifilename =
findfile(
"viewerHeader.xhtml");
3418 ofname << outputfilename <<
"viewer.html";
3419 ofilename =
new std::ofstream(ofname.str().c_str(),
std::ios::out);
3420 while (getline(*ifilename, line)) {
3421 *ofilename << line << std::endl;
3423 *ofilename <<
" var tmapname=\"" << outputfilename <<
"\"" << std::endl;
3424 *ofilename <<
" var tmaptitle=\"" <<
title <<
"\"" << std::endl;
3425 *ofilename <<
" var ncrates=" <<
ncrates <<
";" << std::endl;
3426 *ofilename <<
" var nfeccrates=" <<
nfeccrates <<
";" << std::endl;
3427 *ofilename <<
" var npsuracks=" <<
npsuracks <<
";" << std::endl;
3432 ifilename =
findfile(
"viewerTrailer.xhtml");
3433 while (getline(*ifilename, line)) {
3434 *ofilename << line << std::endl;
3438 command =
"sed -i \"s/XtmapnameX/" + outputfilename +
"/g\" " + ofname.str();
3439 std::cout <<
"Executing " << command << std::endl;
3440 system(command.c_str());
3441 command =
"sed -i \"s/XtmaptitleX/" +
title +
"/g\" " + ofname.str();
3442 std::cout <<
"Executing " << command << std::endl;
3443 system(command.c_str());
3448 ifilename =
findfile(
"jqviewer.js");
3449 ofname <<
"jqviewer.js";
3450 ofilename =
new std::ofstream(ofname.str().c_str(),
std::ios::out);
3451 while (getline(*ifilename, line)) {
3452 *ofilename << line << std::endl;
3461 ofname <<
"crate.js";
3462 ofilename =
new std::ofstream(ofname.str().c_str(),
std::ios::out);
3463 while (getline(*ifilename, line)) {
3464 *ofilename << line << std::endl;
3472 ifilename =
findfile(
"feccrate.js");
3473 ofname <<
"feccrate.js";
3474 ofilename =
new std::ofstream(ofname.str().c_str(),
std::ios::out);
3475 while (getline(*ifilename, line)) {
3476 *ofilename << line << std::endl;
3485 ofname <<
"layer.js";
3486 ofilename =
new std::ofstream(ofname.str().c_str(),
std::ios::out);
3487 while (getline(*ifilename, line)) {
3488 *ofilename << line << std::endl;
3497 ofname <<
"rack.js";
3498 ofilename =
new std::ofstream(ofname.str().c_str(),
std::ios::out);
3499 while (getline(*ifilename, line)) {
3500 *ofilename << line << std::endl;
3510 ofname <<
"rackhv.js";
3511 ofilename =
new std::ofstream(ofname.str().c_str(),
std::ios::out);
3512 while (getline(*ifilename, line)) {
3513 *ofilename << line << std::endl;
3521 std::ostringstream outs, outs1, outs2;
3522 outs << outputfilename <<
".png";
3530 std::ostringstream outs;
3531 outs << outputfilename <<
"layer" <<
layer <<
".html";
3532 txtfile =
new std::ofstream(outs.str().c_str(),
std::ios::out);
3533 *txtfile <<
"<html><head></head> <body>" << std::endl;
3538 if (mod !=
nullptr && !mod->
notInUse()) {
3541 *txtfile <<
"<a name=" << idmod <<
"><pre>" << std::endl;
3542 std::multimap<const int, TmApvPair *>::iterator pos;
3545 if (apvpair !=
nullptr) {
3547 *txtfile << apvpair->
text << std::endl;
3550 *txtfile <<
"</pre><h3>" << mod->
name <<
"</h3>" << std::endl;
3554 *txtfile <<
"</body></html>" << std::endl;
3559 outs1 << outputfilename <<
"fed.png";
3561 outs2 << outputfilename <<
".xml";
3564 std::map<int, int>::iterator i_fed;
3567 std::ostringstream outs;
3568 outs << outputfilename <<
"crate" << crate <<
".html";
3569 txtfile =
new std::ofstream(outs.str().c_str(),
std::ios::out);
3570 *txtfile <<
"<html><head></head> <body>" << std::endl;
3571 for (i_fed =
fedMap.begin(); i_fed !=
fedMap.end(); i_fed++) {
3572 if (i_fed->second == crate) {
3573 int fedId = i_fed->first;
3574 for (
int nconn = 0; nconn < 96; nconn++) {
3575 int key = fedId * 1000 + nconn;
3577 if (apvPair !=
nullptr) {
3579 *txtfile <<
"<a name=" << idmod <<
"><pre>" << std::endl;
3580 *txtfile << apvPair->
text << std::endl;
3581 std::ostringstream outs;
3582 outs <<
"fedchannel " << apvPair->
getFedId() <<
"/" << apvPair->
getFedCh() <<
" connects to module "
3584 *txtfile <<
"</pre><h3>" << outs.str() <<
"</h3>" << std::endl;
3589 *txtfile <<
"</body></html>" << std::endl;
3595 std::ostringstream outs1, outs2;
3596 outs1 << outputfilename <<
"fec.png";
3598 outs2 << outputfilename <<
".xml";
3602 std::map<int, TmCcu *>::iterator i_ccu;
3603 std::multimap<TmCcu *, TmModule *>::iterator it;
3604 std::pair<std::multimap<TmCcu *, TmModule *>::iterator, std::multimap<TmCcu *, TmModule *>::iterator>
ret;
3605 for (
int crate = 1; crate < (
nfeccrates + 1); crate++) {
3606 std::ostringstream outs;
3607 outs << outputfilename <<
"feccrate" << crate <<
".html";
3608 txtfile =
new std::ofstream(outs.str().c_str(),
std::ios::out);
3609 *txtfile <<
"<html><head></head> <body>" << std::endl;
3610 for (i_ccu =
ccuMap.begin(); i_ccu !=
ccuMap.end(); i_ccu++) {
3611 TmCcu *ccu = i_ccu->second;
3612 if (ccu !=
nullptr && ccu->
getCcuCrate() == crate) {
3614 *txtfile <<
"<a name=" << idmod <<
"><pre>" << std::endl;
3615 *txtfile << ccu->
text << std::endl;
3616 std::ostringstream outs;
3618 outs <<
"ccu is in position" << ccu->
mpos <<
"in ring but doesn't seem to have any module connected";
3620 outs <<
"ccu is in position " << ccu->
mpos <<
" in ring and connects " << ccu->
nmod <<
" modules"
3623 for (it = ret.first; it != ret.second; ++it) {
3624 outs << (*it).second->idex <<
" " << (*it).second->name <<
" value= " << (*it).second->value <<
"\n\n";
3627 *txtfile <<
"</pre><h4>" << outs.str() <<
"</h4>" << std::endl;
3631 *txtfile <<
"</body></html>" << std::endl;
3637 std::ostringstream outs3, outs4;
3638 outs3 << outputfilename <<
"psu.png";
3641 outs4 << outputfilename <<
".xml";
3646 std::map<int, TmPsu *>::iterator ipsu;
3647 std::multimap<TmPsu *, TmModule *>::iterator it;
3648 std::pair<std::multimap<TmPsu *, TmModule *>::iterator, std::multimap<TmPsu *, TmModule *>::iterator>
ret;
3649 for (
int rack = 1; rack < (
npsuracks + 1); rack++) {
3650 std::ostringstream outs;
3652 outs << outputfilename <<
"psurack" << rack <<
".html";
3653 txtfile =
new std::ofstream(outs.str().c_str(),
std::ios::out);
3654 *txtfile <<
"<html><head></head> <body>" << std::endl;
3655 for (ipsu =
psuMap.begin(); ipsu !=
psuMap.end(); ipsu++) {
3656 TmPsu *psu = ipsu->second;
3657 if (psu !=
nullptr && psu->
getPsuRack() == rack) {
3658 *txtfile <<
"<a name=" << psu->
idex <<
"><pre>" << std::endl;
3659 *txtfile << psu->
text << std::endl;
3660 std::ostringstream outs;
3663 <<
"in crate but doesn't seem to have any module connected";
3665 outs <<
"PS is in position " << psu->
getPsuBoard() <<
" in crate and connects to " << psu->
nmod
3666 <<
" modules. " << std::endl;
3669 for (it = ret.first; it != ret.second; ++it) {
3670 outs << (*it).second->idex <<
" " << (*it).second->name <<
" value= " << (*it).second->value <<
" <br>"
3673 *txtfile <<
"</pre><h4>" << outs.str() <<
"</h4>" << std::endl;
3677 *txtfile <<
"</body></html>" << std::endl;
3684 std::ostringstream outs5, outs6;
3685 outs5 << outputfilename <<
"hv.png";
3688 outs6 << outputfilename <<
".xml";
3693 std::map<int, TmPsu *>::iterator ipsu;
3694 std::multimap<TmPsu *, TmModule *>::iterator it;
3695 std::pair<std::multimap<TmPsu *, TmModule *>::iterator, std::multimap<TmPsu *, TmModule *>::iterator>
ret;
3696 for (
int rack = 1; rack < (
npsuracks + 1); rack++) {
3697 std::ostringstream outs;
3699 outs << outputfilename <<
"HVrack" << rack <<
".html";
3700 txtfile =
new std::ofstream(outs.str().c_str(),
std::ios::out);
3701 *txtfile <<
"<html><head></head> <body>" << std::endl;
3702 for (ipsu =
psuMap.begin(); ipsu !=
psuMap.end(); ipsu++) {
3703 TmPsu *psu = ipsu->second;
3704 if (psu !=
nullptr && psu->
getPsuRack() == rack) {
3705 *txtfile <<
"<a name=" << psu->
idex <<
"><pre>" << std::endl;
3706 *txtfile << psu->
textHV2 << std::endl;
3707 std::ostringstream outsHV2;
3709 outsHV2 <<
"HV Channel002 is in position" << psu->
getPsuBoard()
3710 <<
"in crate but doesn't seem to have any module connected";
3712 outsHV2 <<
"HV Channel002 is in position " << psu->
getPsuBoard() <<
" in crate and connects to "
3713 << psu->
nmodHV2 <<
" modules. "
3714 <<
" <br>" << std::endl;
3717 for (it = ret.first; it != ret.second; ++it) {
3718 if ((*it).second->HVchannel == 2) {
3719 outsHV2 << (*it).second->idex <<
" " << (*it).second->name <<
" value= " << (*it).second->value
3720 <<
" <br>" << std::endl;
3723 *txtfile <<
"</pre><h4>" << outsHV2.str() <<
"</h4>" << std::endl;
3726 *txtfile << psu->
textHV3 << std::endl;
3727 std::ostringstream outsHV3;
3729 outsHV3 <<
"HV Channel003 is in position" << psu->
getPsuBoard()
3730 <<
"in crate but doesn't seem to have any module connected";
3732 outsHV3 <<
"HV Channel003 is in position " << psu->
getPsuBoard() <<
" in crate and connects to "
3733 << psu->
nmodHV3 <<
" modules. "
3734 <<
" <br>" << std::endl;
3737 for (it = ret.first; it != ret.second; ++it) {
3738 if ((*it).second->HVchannel == 3) {
3739 outsHV3 << (*it).second->idex <<
" " << (*it).second->name <<
" value= " << (*it).second->value
3740 <<
" <br>" << std::endl;
3743 *txtfile <<
"</pre><h4>" << outsHV3.str() <<
"</h4>" << std::endl;
3747 *txtfile <<
"</body></html>" << std::endl;
3755 float minval, maxval;
3758 if (
tkMapLog && (minval < maxval)) {
3759 minval =
pow(10., minval1);
3760 maxval =
pow(10., maxval1);
3767 size_t found = filetype.find_last_of(
'.');
3768 filetype = filetype.substr(found + 1);
3769 found = outputfilename.find_last_of(
'.');
3770 outputfilename = outputfilename.substr(0, found);
3772 std::ofstream *ofilename;
3773 std::ifstream *ifilename;
3774 std::ostringstream
ofname;
3779 ifilename =
findfile(
"viewerHeader.xhtml");
3780 ofname << outputfilename <<
"viewer.html";
3781 ofilename =
new std::ofstream(ofname.str().c_str(),
std::ios::out);
3782 while (getline(*ifilename, line)) {
3783 *ofilename << line << std::endl;
3785 *ofilename <<
" var tmapname=\"" << outputfilename <<
"\"" << std::endl;
3786 *ofilename <<
" var tmaptitle=\"" <<
title <<
"\"" << std::endl;
3787 *ofilename <<
" var ncrates=" <<
ncrates <<
";" << std::endl;
3788 *ofilename <<
" var nfeccrates=" <<
nfeccrates <<
";" << std::endl;
3789 *ofilename <<
" var npsuracks=" <<
npsuracks <<
";" << std::endl;
3792 ifilename =
findfile(
"viewerTrailer.xhtml");
3793 while (getline(*ifilename, line)) {
3794 *ofilename << line << std::endl;
3800 command =
"sed -i \"s/XtmapnameX/" + outputfilename +
"/g\" " + ofname.str();
3801 std::cout <<
"Executing " << command << std::endl;
3802 system(command.c_str());
3803 command =
"sed -i \"s/XtmaptitleX/" +
title +
"/g\" " + ofname.str();
3804 std::cout <<
"Executing " << command << std::endl;
3805 system(command.c_str());
3808 ifilename =
findfile(
"jqviewer.js");
3809 ofname <<
"jqviewer.js";
3810 ofilename =
new std::ofstream(ofname.str().c_str(),
std::ios::out);
3811 while (getline(*ifilename, line)) {
3812 *ofilename << line << std::endl;
3821 ofname <<
"crate.js";
3822 ofilename =
new std::ofstream(ofname.str().c_str(),
std::ios::out);
3823 while (getline(*ifilename, line)) {
3824 *ofilename << line << std::endl;
3832 ifilename =
findfile(
"feccrate.js");
3833 ofname <<
"feccrate.js";
3834 ofilename =
new std::ofstream(ofname.str().c_str(),
std::ios::out);
3835 while (getline(*ifilename, line)) {
3836 *ofilename << line << std::endl;
3845 ofname <<
"rack.js";
3846 ofilename =
new std::ofstream(ofname.str().c_str(),
std::ios::out);
3847 while (getline(*ifilename, line)) {
3848 *ofilename << line << std::endl;
3857 ofname <<
"rackhv.js";
3858 ofilename =
new std::ofstream(ofname.str().c_str(),
std::ios::out);
3859 while (getline(*ifilename, line)) {
3860 *ofilename << line << std::endl;
3869 ofname <<
"layer.js";
3870 ofilename =
new std::ofstream(ofname.str().c_str(),
std::ios::out);
3871 while (getline(*ifilename, line)) {
3872 *ofilename << line << std::endl;
3879 command =
"scp -r ../../DQM/TrackerCommon/test/jquery/ .";
3880 std::cout <<
"Executing " << command << std::endl;
3881 system(command.c_str());
3882 command =
"scp -r ../../CommonTools/TrackerMap/data/images/ .";
3883 std::cout <<
"Executing " << command << std::endl;
3884 system(command.c_str());
3887 std::ostringstream outs;
3888 outs << outputfilename <<
".png";
3890 save(
true, minval, maxval, outs.str(), 3000, 1600);
3893 save(
true, minval, maxval, s, width, height);
3896 std::ostringstream outs;
3897 outs << outputfilename <<
".png";
3899 printlayers(
true, minval, maxval, outputfilename);
3904 std::ostringstream outs;
3905 outs << outputfilename <<
"layer" <<
layer <<
".html";
3906 txtfile =
new std::ofstream(outs.str().c_str(),
std::ios::out);
3907 *txtfile <<
"<html><head></head> <body>" << std::endl;
3912 if (mod !=
nullptr && !mod->
notInUse()) {
3915 *txtfile <<
"<a name=" << idmod <<
"><pre>" << std::endl;
3916 std::multimap<const int, TmApvPair *>::iterator pos;
3919 if (apvpair !=
nullptr) {
3921 *txtfile << apvpair->
text << std::endl;
3924 *txtfile <<
"</pre><h3>" << mod->
name <<
"</h3>" << std::endl;
3928 *txtfile <<
"</body></html>" << std::endl;
3934 std::ostringstream outs1, outs2;
3936 outs1 << outputfilename <<
"fed.png";
3938 outs1 << outputfilename <<
"fed." <<
filetype;
3941 outs2 << outputfilename <<
".xml";
3944 std::map<int, int>::iterator i_fed;
3947 std::ostringstream outs;
3948 outs << outputfilename <<
"crate" << crate <<
".html";
3949 txtfile =
new std::ofstream(outs.str().c_str(),
std::ios::out);
3950 *txtfile <<
"<html><head></head> <body>" << std::endl;
3951 for (i_fed =
fedMap.begin(); i_fed !=
fedMap.end(); i_fed++) {
3952 if (i_fed->second == crate) {
3953 int fedId = i_fed->first;
3954 for (
int nconn = 0; nconn < 96; nconn++) {
3955 int key = fedId * 1000 + nconn;
3957 if (apvPair !=
nullptr) {
3959 *txtfile <<
"<a name=" << idmod <<
"><pre>" << std::endl;
3960 *txtfile << apvPair->
text << std::endl;
3961 std::ostringstream outs;
3962 outs <<
"fedchannel " << apvPair->
getFedId() <<
"/" << apvPair->
getFedCh() <<
" connects to module "
3964 *txtfile <<
"</pre><h3>" << outs.str() <<
"</h3>" << std::endl;
3969 *txtfile <<
"</body></html>" << std::endl;
3976 std::ostringstream outs1, outs2;
3978 outs1 << outputfilename <<
"fec.png";
3980 outs1 << outputfilename <<
"fec." <<
filetype;
3983 outs2 << outputfilename <<
".xml";
3987 std::map<int, TmCcu *>::iterator i_ccu;
3988 std::multimap<TmCcu *, TmModule *>::iterator it;
3989 std::pair<std::multimap<TmCcu *, TmModule *>::iterator, std::multimap<TmCcu *, TmModule *>::iterator>
ret;
3990 for (
int crate = 1; crate < (
nfeccrates + 1); crate++) {
3991 std::ostringstream outs;
3992 outs << outputfilename <<
"feccrate" << crate <<
".html";
3993 txtfile =
new std::ofstream(outs.str().c_str(),
std::ios::out);
3994 *txtfile <<
"<html><head></head> <body>" << std::endl;
3995 for (i_ccu =
ccuMap.begin(); i_ccu !=
ccuMap.end(); i_ccu++) {
3996 TmCcu *ccu = i_ccu->second;
3997 if (ccu !=
nullptr && ccu->
getCcuCrate() == crate) {
3999 *txtfile <<
"<a name=" << idmod <<
"><pre>" << std::endl;
4000 *txtfile << ccu->
text << std::endl;
4001 std::ostringstream outs;
4003 outs <<
"ccu is in position" << ccu->
mpos <<
"in ring but doesn't seem to have any module connected";
4005 outs <<
"ccu is in position " << ccu->
mpos <<
" in ring and connects " << ccu->
nmod <<
" modules"
4008 for (it = ret.first; it != ret.second; ++it) {
4009 outs << (*it).second->idex <<
" " << (*it).second->name <<
" value= " << (*it).second->value <<
"\n\n";
4012 *txtfile <<
"</pre><h4>" << outs.str() <<
"</h4>" << std::endl;
4016 *txtfile <<
"</body></html>" << std::endl;
4022 std::ostringstream outs3, outs4;
4024 outs3 << outputfilename <<
"psu.png";
4026 outs3 << outputfilename <<
"psu." <<
filetype;
4029 outs4 << outputfilename <<
".xml";
4034 std::map<int, TmPsu *>::iterator ipsu;
4035 std::multimap<TmPsu *, TmModule *>::iterator it;
4036 std::pair<std::multimap<TmPsu *, TmModule *>::iterator, std::multimap<TmPsu *, TmModule *>::iterator>
ret;
4037 for (
int rack = 1; rack < (
npsuracks + 1); rack++) {
4038 std::ostringstream outs;
4040 outs << outputfilename <<
"psurack" << rack <<
".html";
4041 txtfile =
new std::ofstream(outs.str().c_str(),
std::ios::out);
4042 *txtfile <<
"<html><head></head> <body>" << std::endl;
4043 for (ipsu =
psuMap.begin(); ipsu !=
psuMap.end(); ipsu++) {
4044 TmPsu *psu = ipsu->second;
4045 if (psu !=
nullptr && psu->
getPsuRack() == rack) {
4046 *txtfile <<
"<a name=" << psu->
idex <<
"><pre>" << std::endl;
4047 *txtfile << psu->
text << std::endl;
4048 std::ostringstream outs;
4051 <<
"in crate but doesn't seem to have any module connected";
4053 outs <<
"PS is in position " << psu->
getPsuBoard() <<
" in crate and connects to " << psu->
nmod
4054 <<
" modules. " << std::endl;
4057 for (it = ret.first; it != ret.second; ++it) {
4058 outs << (*it).second->idex <<
" " << (*it).second->name <<
" value= " << (*it).second->value <<
" <br>"
4061 *txtfile <<
"</pre><h4>" << outs.str() <<
"</h4>" << std::endl;
4065 *txtfile <<
"</body></html>" << std::endl;
4072 std::ostringstream outs5, outs6;
4074 outs5 << outputfilename <<
"hv.png";
4076 outs5 << outputfilename <<
"hv." <<
filetype;
4079 outs6 << outputfilename <<
".xml";
4084 std::map<int, TmPsu *>::iterator ipsu;
4085 std::multimap<TmPsu *, TmModule *>::iterator it;
4086 std::pair<std::multimap<TmPsu *, TmModule *>::iterator, std::multimap<TmPsu *, TmModule *>::iterator>
ret;
4087 for (
int rack = 1; rack < (
npsuracks + 1); rack++) {
4088 std::ostringstream outs;
4090 outs << outputfilename <<
"HVrack" << rack <<
".html";
4091 txtfile =
new std::ofstream(outs.str().c_str(),
std::ios::out);
4092 *txtfile <<
"<html><head></head> <body>" << std::endl;
4093 for (ipsu =
psuMap.begin(); ipsu !=
psuMap.end(); ipsu++) {
4094 TmPsu *psu = ipsu->second;
4095 if (psu !=
nullptr && psu->
getPsuRack() == rack) {
4096 *txtfile <<
"<a name=" << psu->
idex <<
"><pre>" << std::endl;
4097 *txtfile << psu->
textHV2 << std::endl;
4098 std::ostringstream outsHV2;
4100 outsHV2 <<
"HV Channel002 is in position" << psu->
getPsuBoard()
4101 <<
"in crate but doesn't seem to have any module connected";
4103 outsHV2 <<
"HV Channel002 is in position " << psu->
getPsuBoard() <<
" in crate and connects to "
4104 << psu->
nmodHV2 <<
" modules. "
4105 <<
" <br>" << std::endl;
4108 for (it = ret.first; it != ret.second; ++it) {
4109 if ((*it).second->HVchannel == 2) {
4110 outsHV2 << (*it).second->idex <<
" " << (*it).second->name <<
" value= " << (*it).second->value
4111 <<
" <br>" << std::endl;
4114 *txtfile <<
"</pre><h4>" << outsHV2.str() <<
"</h4>" << std::endl;
4117 *txtfile << psu->
textHV3 << std::endl;
4118 std::ostringstream outsHV3;
4120 outsHV3 <<
"HV Channel003 is in position" << psu->
getPsuBoard()
4121 <<
"in crate but doesn't seem to have any module connected";
4123 outsHV3 <<
"HV Channel003 is in position " << psu->
getPsuBoard() <<
" in crate and connects to "
4124 << psu->
nmodHV3 <<
" modules. "
4125 <<
" <br>" << std::endl;
4128 for (it = ret.first; it != ret.second; ++it) {
4129 if ((*it).second->HVchannel == 3) {
4130 outsHV3 << (*it).second->idex <<
" " << (*it).second->name <<
" value= " << (*it).second->value
4131 <<
" <br>" << std::endl;
4134 *txtfile <<
"</pre><h4>" << outsHV3.str() <<
"</h4>" << std::endl;
4138 *txtfile <<
"</body></html>" << std::endl;
4146 std::ifstream *ifilename;
4152 ifname =
"CommonTools/TrackerMap/data/" +
filename;
4156 ifname =
"CommonTools/TrackerMap/data/" +
filename;
4160 std::cout <<
"File " << filename <<
" missing" << std::endl;
4172 if (mod !=
nullptr && !mod->
notInUse()) {
4187 if (mod !=
nullptr && !mod->
notInUse()) {
4190 if (maxvalue < mod->
value)
4198 std::ostringstream outs;
4199 outs << outputfilename <<
"layer" <<
layer <<
".xml";
4200 xmlfile =
new std::ofstream(outs.str().c_str(),
std::ios::out);
4201 *xmlfile <<
"<?xml version=\"1.0\" standalone=\"no\"?>" << std::endl;
4202 *xmlfile <<
"<svg xmlns=\"http://www.w3.org/2000/svg\"" << std::endl;
4203 *xmlfile <<
"xmlns:svg=\"http://www.w3.org/2000/svg\"" << std::endl;
4204 *xmlfile <<
"xmlns:xlink=\"http://www.w3.org/1999/xlink\" >" << std::endl;
4205 *xmlfile <<
"<script type=\"text/ecmascript\" xlink:href=\"layer.js\" />" << std::endl;
4206 *xmlfile <<
"<svg id=\"mainMap\" x=\"0\" y=\"0\" viewBox=\"0 0 500 500\" width=\"700\" height=\"700\" "
4207 "onload=\"TrackerLayer.init()\">"
4210 *xmlfile <<
"<g id=\"layer\" transform=\" translate(0,400) rotate(270) scale(1.,1.)\" > " << std::endl;
4212 *xmlfile <<
"<g id=\"layer\" transform=\" translate(0,400) rotate(270) scale(1.,0.8)\" > " << std::endl;
4213 *xmlfile <<
"<rect fill=\"lightblue\" stroke=\"none\" x=\"0\" y=\"0\" width=\"700\" height=\"700\" />" << std::endl;
4214 *xmlfile <<
"<svg:polygon id=\"fed\" mapAttribute=\"fed\" points=\"250,40 250,10 230,10 230,40\" "
4215 "onclick=\"chooseMap(evt);\" onmouseover=\"chooseMap(evt);\" onmouseout=\"chooseMap(evt);\" "
4216 "fill=\"rgb(0,127,255)\"/>"
4218 *xmlfile <<
"<svg:polygon id=\"fec\" mapAttribute=\"fec\" points=\"228,40 228,10 208,10 208,40\" "
4219 "onclick=\"chooseMap(evt);\" onmouseover=\"chooseMap(evt);\" onmouseout=\"chooseMap(evt);\" "
4220 "fill=\"rgb(0,127,255)\"/>"
4222 *xmlfile <<
"<svg:polygon id=\"lv\" mapAttribute=\"lv\" points=\"206,40 206,10 186,10 186,40\" "
4223 "onclick=\"chooseMap(evt);\" onmouseover=\"chooseMap(evt);\" onmouseout=\"chooseMap(evt);\" "
4224 "fill=\"rgb(0,127,255)\"/>"
4226 *xmlfile <<
"<svg:polygon id=\"hv\" mapAttribute=\"hv\" points=\"184,40 184,10 164,10 164,40\" "
4227 "onclick=\"chooseMap(evt);\" onmouseover=\"chooseMap(evt);\" onmouseout=\"chooseMap(evt);\" "
4228 "fill=\"rgb(0,127,255)\"/>"
4230 *xmlfile <<
"<svg:polygon id=\"plot\" mapAttribute=\"plot\" points=\"155,45 155,5 135,5 135,45\" "
4231 "onclick=\"chooseMap(evt);\" onmouseover=\"chooseMap(evt);\" onmouseout=\"chooseMap(evt);\" "
4232 "fill=\"rgb(200,0,0)\"/>"
4241 if (mod !=
nullptr && !mod->
notInUse()) {
4242 drawModule(mod, key, layer, print_total, xmlfile);
4246 *xmlfile <<
"</g> </svg> <text id=\"currentElementText\" x=\"40\" y=\"30\">" << std::endl;
4247 *xmlfile <<
"<tspan id=\"line1\" x=\"40\" y=\"30\"> </tspan> " << std::endl;
4248 *xmlfile <<
"<tspan id=\"line2\" x=\"40\" y=\"60\"> </tspan> " << std::endl;
4249 *xmlfile <<
"<tspan id=\"line3\" x=\"40\" y=\"90\"> </tspan> " << std::endl;
4250 *xmlfile <<
"<tspan id=\"line4\" x=\"40\" y=\"120\"> </tspan> " << std::endl;
4252 *xmlfile <<
"<tspan mapAttribute=\"fed\" onclick=\"chooseMap(evt);\" onmouseover=\"chooseMap(evt);\" "
4253 "onmouseout=\"chooseMap(evt);\" x=\"15\" y=\"228\" font-size=\"12\" font-family=\"arial\" "
4254 "fill=\"white\">FED</tspan> "
4256 *xmlfile <<
"<tspan mapAttribute=\"fec\" onclick=\"chooseMap(evt);\" onmouseover=\"chooseMap(evt);\" "
4257 "onmouseout=\"chooseMap(evt);\" x=\"15\" y=\"258\" font-size=\"12\" font-family=\"arial\" "
4258 "fill=\"white\">FEC</tspan> "
4260 *xmlfile <<
"<tspan mapAttribute=\"lv\" onclick=\"chooseMap(evt);\" onmouseover=\"chooseMap(evt);\" "
4261 "onmouseout=\"chooseMap(evt);\" x=\"18\" y=\"289\" font-size=\"12\" font-family=\"arial\" "
4262 "fill=\"white\">LV</tspan> "
4264 *xmlfile <<
"<tspan mapAttribute=\"hv\" onclick=\"chooseMap(evt);\" onmouseover=\"chooseMap(evt);\" "
4265 "onmouseout=\"chooseMap(evt);\" x=\"18\" y=\"319\" font-size=\"12\" font-family=\"arial\" "
4266 "fill=\"white\">HV</tspan> "
4268 *xmlfile <<
"<tspan mapAttribute=\"plot\" onclick=\"chooseMap(evt);\" onmouseover=\"chooseMap(evt);\" "
4269 "onmouseout=\"chooseMap(evt);\" x=\"12\" y=\"360\" font-size=\"12\" font-family=\"arial\" "
4270 "fill=\"white\">PLOT</tspan> "
4273 *xmlfile <<
"<tspan mapAttribute=\"fed\" onclick=\"chooseMap(evt);\" onmouseover=\"chooseMap(evt);\" "
4274 "onmouseout=\"chooseMap(evt);\" x=\"21\" y=\"228\" font-size=\"12\" font-family=\"arial\" "
4275 "fill=\"white\">FED</tspan> "
4277 *xmlfile <<
"<tspan mapAttribute=\"fec\" onclick=\"chooseMap(evt);\" onmouseover=\"chooseMap(evt);\" "
4278 "onmouseout=\"chooseMap(evt);\" x=\"21\" y=\"258\" font-size=\"12\" font-family=\"arial\" "
4279 "fill=\"white\">FEC</tspan> "
4281 *xmlfile <<
"<tspan mapAttribute=\"lv\" onclick=\"chooseMap(evt);\" onmouseover=\"chooseMap(evt);\" "
4282 "onmouseout=\"chooseMap(evt);\" x=\"24\" y=\"289\" font-size=\"12\" font-family=\"arial\" "
4283 "fill=\"white\">LV</tspan> "
4285 *xmlfile <<
"<tspan mapAttribute=\"hv\" onclick=\"chooseMap(evt);\" onmouseover=\"chooseMap(evt);\" "
4286 "onmouseout=\"chooseMap(evt);\" x=\"24\" y=\"319\" font-size=\"12\" font-family=\"arial\" "
4287 "fill=\"white\">HV</tspan> "
4289 *xmlfile <<
"<tspan mapAttribute=\"plot\" onclick=\"chooseMap(evt);\" onmouseover=\"chooseMap(evt);\" "
4290 "onmouseout=\"chooseMap(evt);\" x=\"17\" y=\"360\" font-size=\"12\" font-family=\"arial\" "
4291 "fill=\"white\">PLOT</tspan> "
4294 *xmlfile <<
" </text> </svg>" << std::endl;
4308 legInfos_.back()->SetFillColor(kBlue - 9);
4310 legInfos_.back()->SetFillColor(kRed + 2);
4312 legInfos_.back()->SetFillColor(kPink - 9);
4314 legInfos_.back()->SetFillColor(kOrange + 2);
4316 legInfos_.back()->SetFillColor(kYellow);
4318 legInfos_.back()->SetFillColor(kRed + 1);
4320 legInfos_.back()->SetFillColor(kViolet - 5);
4327 "# Clusters & Digis",
4331 TLegend *myL =
new TLegend(0.56, 0.87, 0.95, 0.99);
4332 myL->SetNColumns(2);
4333 myL->SetBorderSize(0);
4334 myL->SetFillColor(38);
std::vector< TPolyLine * > legInfos_
void fill_hv_channel2(int rack, int crate, int board, float qty)
T getUntrackedParameter(std::string const &, T const &) const
#define NUMFEDCRATE_INCOLUMN
tuple ret
prodAgent to be discontinued
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)
static std::vector< std::string > checklist log
const edm::EventSetup & c
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
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)
~TrackerMap()
default destructor
static const uint32_t invalid32_
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)
const std::vector< SiStripFecCrate > & crates() const
tuple txtfile
Delete all three files at once to make sure the user never sees stale data (e.g.
#define NUMFEDCRATE_INROW
void fillc_fec_channel(int crate, int slot, int ring, int addr, int red, int green, int blue)
tuple xmlfile
Make an XML representation of the misalignment.
double xdpixelfec(double x)
constexpr std::array< uint8_t, layerIndexSize > layer
const std::vector< const FedChannelConnection * > & getConnections(uint32_t det_id) const
double phival(double x, double y)
void fillc_lv_channel(int rack, int crate, int board, int red, int green, int blue)
std::vector< std::string > legKeys_
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)
FedsConstIterRange fedIds() const
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)
tuple key
prepare the HTCondor submission files and eventually submit them
void load(std::string s="tmap.svg")
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)
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 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 fill_hv_channel3(int rack, int crate, int board, float qty)
#define NUMPSUCRATE_INCOLUMN
static const uint16_t invalid_
ConnsConstIterRange fedConnections(uint16_t fed_id) const
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)
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)
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()