17 #include "TPolyLine.h" 28 #include "TPaletteAxis.h" 45 jsfilename =
"CommonTools/TrackerMap/data/trackermap.txt";
46 infilename =
"CommonTools/TrackerMap/data/tracker.dat";
63 std::cout <<
"ERROR:fed trackermap requested but no valid fedCabling is available!!!" << std::endl;
69 std::cout <<
"ERROR:fec trackermap requested but no valid fedCabling is available!!!" << std::endl;
84 std::cout <<
"SiStripFedCabling has " <<
feds.size() <<
" active FEDS" << std::endl;
87 for (std::vector<unsigned short>::const_iterator ifed =
feds.begin(); ifed <
feds.end(); ifed++) {
90 for (
auto iconn = theconn.begin(); iconn < theconn.end(); iconn++) {
98 int key = iconn->fedId() * 1000 + iconn->fedCh();
100 if (apvpair !=
nullptr)
101 std::cout <<
"Fed " << iconn->fedId() <<
" channel " << iconn->fedCh() <<
" seem to be already loaded!" 107 if (
fedMap[iconn->fedId()] == 0) {
108 fedMap[iconn->fedId()] = iconn->fedCrate();
110 if (
slotMap[iconn->fedId()] == 0) {
111 slotMap[iconn->fedId()] = iconn->fedSlot();
113 if (
ncrates == 0 || ncrates < iconn->fedCrate())
122 apvpair->
mpos = iconn->apvPairNumber();
124 apvModuleMap.insert(std::make_pair(iconn->detId(), apvpair));
127 apvpair->
text =
s.str();
134 std::map<int, TmModule *>::iterator i_mod;
137 if (
mod !=
nullptr) {
138 std::ostringstream outs, outs1;
139 outs <<
" connected to ";
144 std::multimap<const int, TmApvPair *>::iterator
pos;
147 if (apvpair !=
nullptr) {
149 outs1 << apvpair->
idex + apvpair->
crate * 1000000 <<
",";
153 outs <<
"(" << nchan <<
")";
154 mod->name =
mod->name + outs.str();
156 s.erase(
s.end() - 1,
s.end());
157 mod->capvids =
s +
")";
171 while (!Ccufile.eof()) {
173 getline(Ccufile, dummys);
176 if (ccu ==
nullptr) {
182 for (std::vector<SiStripFecCrate>::const_iterator icrate = fecCabling_->
crates().begin();
183 icrate != fecCabling_->
crates().end();
185 for (std::vector<SiStripFec>::const_iterator ifec = icrate->fecs().begin(); ifec != icrate->fecs().end();
187 for (std::vector<SiStripRing>::const_iterator iring = ifec->rings().begin(); iring != ifec->rings().end();
190 for (std::vector<SiStripCcu>::const_iterator iccu = iring->ccus().begin(); iccu != iring->ccus().end();
195 icrate->fecCrate() * 10000000 + ifec->fecSlot() * 100000 + iring->fecRing() * 1000 + iccu->ccuAddr();
198 for (std::vector<SiStripModule>::const_iterator imod = iccu->modules().begin();
199 imod != iccu->modules().end();
205 if (imod1 !=
nullptr)
209 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 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;
265 int rack_order[54] = {0, 1, 0, 2, 0, 3, 0, 4, 0, 5, 6, 0, 7, 8, 0, 9, 10, 0,
266 11, 12, 0, 13, 14, 0, 15, 0, 0, 0, 0, 0, 0, 16, 0, 17, 18, 0,
267 19, 20, 0, 21, 0, 22, 0, 23, 0, 24, 25, 0, 26, 27, 0, 28, 0, 29};
295 while (!LVfile.eof()) {
296 LVfile >> modId1 >> dcuId >> psIdinfo >> psinfo;
308 dcs = atoi(dcsinfo.c_str());
309 branch = atoi(branchinfo.c_str());
310 crate = atoi(crateinfo.c_str()) + 1;
311 board = atoi(boardinfo.c_str()) + 1;
312 rack = (
branch + 1) + (dcs - 1) * 6;
313 rack = rack_order[rack];
314 channel = atoi(channelinfo.c_str());
316 int key = rack * 1000 +
crate * 100 + board;
320 if (psu ==
nullptr) {
323 psu->
psId = psIdinfo;
327 if (imod !=
nullptr) {
328 imod->
PsuId = psIdinfo;
335 std::map<int, TmPsu *>::iterator ipsu;
336 std::multimap<TmPsu *, TmModule *>::iterator
it;
337 std::pair<std::multimap<TmPsu *, TmModule *>::iterator, std::multimap<TmPsu *, TmModule *>::iterator>
ret;
340 for (ipsu =
psuMap.begin(); ipsu !=
psuMap.end(); ipsu++) {
341 TmPsu *psu = ipsu->second;
344 if (psu !=
nullptr) {
345 std::ostringstream outs;
346 std::ostringstream outs1;
348 std::ostringstream outs3;
349 std::ostringstream outs4;
351 std::ostringstream outs5;
352 std::ostringstream outs6;
354 outs <<
"PSU " << psu->
psId <<
" connected to Mainframe " << psu->
getPsuDcs() <<
" BranchController " 356 <<
" in position " << psu->
getPsuBoard() <<
" with modules: ";
360 outs3 <<
"PSU " << psu->
psId <<
" connected to Mainframe " << psu->
getPsuDcs() <<
" BranchController " 362 <<
" in position " << psu->
getPsuBoard() <<
" and HV channel 002 with modules: ";
365 outs5 <<
"PSU " << psu->
psId <<
" connected to Mainframe " << psu->
getPsuDcs() <<
" BranchController " 367 <<
" in position " << psu->
getPsuBoard() <<
" and HV channel 002 with modules: ";
377 outs << (*it).second->idex <<
", ";
378 outs1 << (*it).second->getKey() <<
",";
381 if ((*it).second->HVchannel == 2) {
383 outs3 << (*it).second->idex <<
", ";
384 outs4 << (*it).second->getKey() <<
",";
385 }
else if ((*it).second->HVchannel == 3) {
387 outs5 << (*it).second->idex <<
", ";
388 outs6 << (*it).second->getKey() <<
",";
395 outs <<
"(" << psu->
nmod <<
")";
396 psu->
text = outs.str();
403 outs3 <<
"(" << psu->
nmodHV2 <<
")";
404 outs5 <<
"(" << psu->
nmodHV3 <<
")";
423 jsfilename =
"CommonTools/TrackerMap/data/trackermap.txt";
424 infilename =
"CommonTools/TrackerMap/data/tracker.dat";
448 jsfilename =
"CommonTools/TrackerMap/data/trackermap.txt";
449 infilename =
"CommonTools/TrackerMap/data/tracker.dat";
453 jsPath =
"CommonTools/TrackerMap/data/";
463 std::map<int, TmModule *>::iterator i_mod;
491 for (
int subdet = 1; subdet < ndet + 1; subdet++) {
492 for (
int detpart = 1; detpart <
npart + 1; detpart++) {
500 if (subdet == 3 && detpart != 2)
542 std::map<int, TmApvPair *>::iterator i_apv;
543 for (i_apv =
apvMap.begin(); i_apv !=
apvMap.end(); i_apv++) {
548 std::map<int, TmCcu *>::iterator i_ccu;
549 for (i_ccu =
ccuMap.begin(); i_ccu !=
ccuMap.end(); i_ccu++) {
550 TmCcu *ccu = i_ccu->second;
554 std::map<int, TmPsu *>::iterator ipsu;
555 for (ipsu =
psuMap.begin(); ipsu !=
psuMap.end(); ipsu++) {
556 TmPsu *psu = ipsu->second;
565 double xp[4], yp[4], xp1, yp1;
566 double vhbot, vhtop, vhapo;
567 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};
568 double xt1, yt1, xs1 = 0., ys1 = 0., xt2, yt2, xs2, ys2, pv1, pv2;
581 vhbot =
mod->widthAtHalfLength / 2. - (
mod->width / 2. -
mod->widthAtHalfLength / 2.);
582 vhtop =
mod->width / 2.;
583 vhapo =
mod->length / 2.;
584 if (mlay > 12 && mlay < 19) {
607 for (
int j = 0;
j < 4;
j++) {
614 numod =
mod->idModule;
617 int vane =
mod->ring;
621 xt1 = rmedio[mlay - 31];
625 xt2 = rmedio[mlay - 31];
637 xp[0] = vane * (
dx +
dx / 8.);
638 yp[0] = numod * (dy1);
639 xp[1] = vane * (
dx +
dx / 8.) +
dx;
640 yp[1] = numod * (dy1);
641 xp[2] = vane * (
dx +
dx / 8.) +
dx;
642 yp[2] = numod * (dy1) +
dy;
643 xp[3] = vane * (
dx +
dx / 8.);
644 yp[3] = numod * (dy1) +
dy;
656 if (fabs(pv1 - pv2) >
M_PI && numod == 1)
657 pv1 = pv1 - 2. *
M_PI;
658 if (fabs(pv1 - pv2) >
M_PI && numod != 1)
659 pv2 = pv2 + 2. *
M_PI;
660 xp[0] =
mod->posz - vhapo / 2.;
662 xp[1] =
mod->posz + vhapo / 2.;
664 xp[2] =
mod->posz + vhapo / 2.;
666 xp[3] =
mod->posz - vhapo / 2.;
672 if (
mod->idModule > 100) {
673 for (
int j = 0;
j < 3;
j++) {
686 for (
int j = 0;
j < 4;
j++) {
695 float vals =
mod->value;
703 nams.erase(std::remove_if(nams.begin(), nams.end(), [](
char c) {
return std::islower(
c); }), nams.end());
704 size_t found = nams.find(
'/');
705 if (
found != std::string::npos) {
708 found = nams.find(
')');
711 found = nams.find(
") ");
712 while (
found != std::string::npos) {
713 nams.erase(
found + 1, 4);
716 found = nams.find(
" -");
717 while (
found != std::string::npos) {
718 nams.erase(
found, 2);
721 found = nams.find(
" ");
722 while (
found != std::string::npos) {
723 nams.erase(
found, 2);
726 found = nams.find(
" ");
727 while (
found != std::string::npos) {
728 nams.erase(
found, 1);
731 std::replace_if(nams.begin(), nams.end(), [](
char c) {
return c ==
' '; },
'_');
735 red = (color >> 16) & 0xFF;
736 green = (color >> 8) & 0xFF;
737 blue = (color) & 0xFF;
745 *
svgfile << nams <<
" " << vals <<
" " <<
red <<
" " << green <<
" " <<
blue <<
" ";
748 <<
"<svg:polygon detid=\"" <<
mod->idex <<
"\" count=\"" <<
mod->count <<
"\" value=\"" <<
mod->value
749 <<
"\" id=\"" <<
key <<
"\" capvids=\"" <<
mod->capvids <<
"\" lv=\"" <<
mod->psuIdex <<
"\" hv=\"" 750 <<
mod->psuIdex * 10 +
mod->HVchannel <<
"\" fec=\"" <<
mod->CcuId
751 <<
"\" onclick=\"showData(evt);\" onmouseover=\"showData(evt);\" onmouseout=\"showData(evt);\" MESSAGE=\"" 752 <<
mod->text <<
"\" POS=\"" <<
mod->name <<
" \" fill=\"rgb(" <<
red <<
"," << green <<
"," <<
blue 755 *
svgfile << nams <<
" " << vals <<
" " << 255 <<
" " << 255 <<
" " << 255 <<
" ";
758 <<
"<svg:polygon detid=\"" <<
mod->idex <<
"\" count=\"" <<
mod->count <<
"\" value=\"" <<
mod->value
759 <<
"\" id=\"" <<
key <<
"\" capvids=\"" <<
mod->capvids <<
"\" lv=\"" <<
mod->psuIdex <<
"\" hv=\"" 760 <<
mod->psuIdex * 10 +
mod->HVchannel <<
"\" fec=\"" <<
mod->CcuId
761 <<
"\" onclick=\"showData(evt);\" onmouseover=\"showData(evt);\" onmouseout=\"showData(evt);\" MESSAGE=\"" 762 <<
mod->text <<
"\" POS=\"" <<
mod->name <<
" \" fill=\"white\" points=\"";
765 for (
int k = 0;
k <
np;
k++) {
767 *
svgfile << xd[
k] <<
" " << yd[
k] <<
" ";
769 *
svgfile << xd[
k] <<
"," << yd[
k] <<
" ";
774 *
svgfile <<
"\" />" << std::endl;
778 if (
mod->green > 255)
783 *
svgfile << nams <<
" " << vals <<
" " <<
mod->red <<
" " <<
mod->green <<
" " <<
mod->blue <<
" ";
786 <<
"<svg:polygon detid=\"" <<
mod->idex <<
"\" count=\"" <<
mod->count <<
"\" value=\"" <<
mod->value
787 <<
"\" id=\"" <<
key <<
"\" capvids=\"" <<
mod->capvids <<
"\" lv=\"" <<
mod->psuIdex <<
"\" hv=\"" 788 <<
mod->psuIdex * 10 +
mod->HVchannel <<
"\" fec=\"" <<
mod->CcuId
789 <<
"\" onclick=\"showData(evt);\" onmouseover=\"showData(evt);\" onmouseout=\"showData(evt);\" MESSAGE=\"" 790 <<
mod->text <<
"\" POS=\"" <<
mod->name <<
" \" fill=\"rgb(" <<
mod->red <<
"," <<
mod->green <<
"," 791 <<
mod->blue <<
")\" points=\"";
794 for (
int k = 0;
k <
np;
k++) {
796 *
svgfile << xd[
k] <<
" " << yd[
k] <<
" ";
798 *
svgfile << xd[
k] <<
"," << yd[
k] <<
" ";
803 *
svgfile <<
"\" />" << std::endl;
816 float minval, maxval;
824 if (
mod !=
nullptr && !
mod->notInUse() &&
mod->count > 0) {
825 if (minval >
mod->value)
827 if (maxval < mod->
value)
834 minval =
log(minval) /
log(10);
835 maxval =
log(maxval) /
log(10);
837 return std::make_pair(minval, maxval);
845 bool rangefound =
true;
848 std::vector<TPolyLine *> vp;
849 TGaxis *axis =
nullptr;
863 std::ostringstream outs;
874 if (
mod !=
nullptr && !
mod->notInUse()) {
891 if (
mod !=
nullptr && !
mod->notInUse() &&
mod->count > 0) {
895 if (maxvalue < mod->
value)
905 *
savefile <<
"<?xml version=\"1.0\" standalone=\"no\" ?>" << std::endl;
906 *
savefile <<
"<svg xmlns=\"http://www.w3.org/2000/svg\"" << std::endl;
907 *
savefile <<
"xmlns:svg=\"http://www.w3.org/2000/svg\" " << std::endl;
908 *
savefile <<
"xmlns:xlink=\"http://www.w3.org/1999/xlink\">" << std::endl;
909 *
savefile <<
"<svg:svg id=\"mainMap\" x=\"0\" y=\"0\" viewBox=\"0 0 3100 1600" 910 <<
"\" width=\"" <<
width <<
"\" height=\"" << height <<
"\">" << std::endl;
911 *
savefile <<
"<svg:rect fill=\"lightblue\" stroke=\"none\" x=\"0\" y=\"0\" width=\"3100\" height=\"1600\" /> " 913 *
savefile <<
"<svg:g id=\"tracker\" transform=\"translate(10,1500) rotate(270)\" " 914 "style=\"fill:none;stroke:black;stroke-width:0;\"> " 924 if (
mod !=
nullptr && !
mod->notInUse()) {
932 *
savefile <<
"</svg:g>" << std::endl;
933 *
savefile <<
" <svg:text id=\"Title\" class=\"normalText\" x=\"300\" y=\"0\">" <<
title <<
"</svg:text>" 945 *
savefile <<
"</svg:svg>" << std::endl;
951 const char *command1;
956 std::cout <<
"Executing " << command1 << std::endl;
967 std::ifstream tempfile(tempfilename.c_str(),
std::ios::in);
968 TCanvas *MyC =
new TCanvas(
"MyC",
"TrackerMap",
width, height);
969 gPad->SetFillColor(38);
972 gPad->Range(0, 0, 3800, 1600);
974 gPad->Range(-100, 0, 800, 1600);
976 gPad->Range(800, 0, 3800, 1600);
981 typedef std::map<int, int> ColorList;
983 ColorList::iterator
pos;
985 std::cout <<
"tempfilename " << tempfilename << std::endl;
986 while (!tempfile.eof()) {
988 colindex =
red + green * 1000 +
blue * 1000000;
989 pos = colorList.find(colindex);
990 if (
pos == colorList.end()) {
991 colorList[colindex] = ncolor + 100;
992 col = gROOT->GetColor(ncolor + 100);
994 col->SetRGB((Double_t)(
red / 255.), (Double_t)(green / 255.), (Double_t)(
blue / 255.));
996 c =
new TColor(ncolor + 100, (Double_t)(
red / 255.), (Double_t)(green / 255.), (Double_t)(
blue / 255.));
1001 tempfile >>
x[
i] >>
y[
i];
1005 if (ncolor > 0 && ncolor < 10000) {
1007 for (
int i = 0;
i < ncolor;
i++) {
1010 gStyle->SetPalette(ncolor,
colors);
1014 tempfile.seekg(0, std::ios::beg);
1015 std::cout <<
"created palette with " << ncolor <<
" colors" << std::endl;
1018 TH2Poly *StripMap =
new TH2Poly(
"StripSummary",
"", 775, 3600, 0, 1350);
1019 StripMap->SetFloat(
true);
1020 StripMap->GetXaxis()->SetTitle(
"");
1021 StripMap->GetYaxis()->SetTitle(
"");
1022 StripMap->SetStats(
false);
1025 while (!tempfile.eof()) {
1031 tempfile >>
x[
i] >>
y[
i];
1033 colindex =
red + green * 1000 +
blue * 1000000;
1034 pos = colorList.find(colindex);
1035 if (
pos != colorList.end()) {
1036 TPolyLine *pline =
new TPolyLine(
npoints,
y,
x);
1037 vp.push_back(pline);
1038 pline->SetFillColor(colorList[colindex]);
1042 if ((siterator >= 1 && siterator <= 3608) || (siterator >= 4281 && siterator <= 7888) ||
1043 (siterator >= 8657 && siterator <= 16588)) {
1044 bin->SetName(named.c_str());
1045 StripMap->AddBin(
bin);
1046 StripMap->Fill(named.c_str(),
content);
1049 pline->SetLineWidth(0);
1061 axis =
new TGaxis(-30, 36, -30, 1530, lminvalue, lmaxvalue, 510,
"+L");
1063 axis =
new TGaxis(3660, 36, 3660, 1530, lminvalue, lmaxvalue, 510,
"+L");
1065 axis->SetLabelSize(0.02);
1069 l.SetTextSize(0.03);
1070 l.DrawLatex(950, 1330,
"TID");
1071 l.DrawLatex(2300, 1330,
"TEC");
1072 l.DrawLatex(300, 1330,
"FPIX");
1073 l.DrawLatex(20, 560,
"BPIX L1");
1074 l.DrawLatex(500, 385,
"BPIX L2");
1075 l.DrawLatex(500, 945,
"BPIX L3");
1076 l.SetTextSize(0.04);
1078 if (
tkMapLog && (fulltitle.find(
"Log10 scale") == std::string::npos))
1079 fulltitle +=
": Log10 scale";
1081 l.DrawLatex(30, 1500, fulltitle.c_str());
1083 l.DrawLatex(850, 1500, fulltitle.c_str());
1086 l.DrawLatex(380, 40,
"-z");
1088 l.DrawLatex(1730, 40,
"-z");
1091 l.DrawLatex(380, 1330,
"+z");
1093 l.DrawLatex(1730, 1360,
"+z");
1095 l.DrawLatex(1085, 330,
"TIB L1");
1096 l.DrawLatex(1085, 1000,
"TIB L2");
1097 l.DrawLatex(1585, 330,
"TIB L3");
1098 l.DrawLatex(1585, 1000,
"TIB L4");
1099 l.DrawLatex(2085, 330,
"TOB L1");
1100 l.DrawLatex(2085, 1000,
"TOB L2");
1101 l.DrawLatex(2585, 330,
"TOB L3");
1102 l.DrawLatex(2585, 1000,
"TOB L4");
1103 l.DrawLatex(3085, 330,
"TOB L5");
1104 l.DrawLatex(3085, 1000,
"TOB L6");
1105 TArrow arx(3448, 1190, 3448, 1350, 0.01,
"|>");
1106 l.DrawLatex(3460, 1350,
"x");
1107 TArrow ary(3448, 1190, 3312, 1190, 0.01,
"|>");
1108 l.DrawLatex(3312, 1210,
"y");
1109 TArrow arz(3485, 373, 3485, 676, 0.01,
"|>");
1110 l.DrawLatex(3510, 667,
"z");
1111 TArrow arphi(3485, 511, 3037, 511, 0.01,
"|>");
1112 l.DrawLatex(3023, 520,
"#Phi");
1113 arx.SetLineWidth(3);
1114 ary.SetLineWidth(3);
1115 arz.SetLineWidth(3);
1116 arphi.SetLineWidth(3);
1122 l.DrawLatex(570 + 12, 1190 + 160,
"x");
1124 ary.SetX2(570 - 160);
1127 l.DrawLatex(570 - 160, 1190 + 30,
"y");
1130 arz.SetY1(683 - 100);
1131 arz.SetY2(683 + 100);
1132 l.DrawLatex(380 + 15, 683 + 100 - 9,
"z");
1134 arphi.SetX2(380 - 390);
1137 l.DrawLatex(380 - 390 - 14, 683 + 9,
"#Phi");
1145 if (
title.find(
"QTestAlarm") != std::string::npos) {
1164 std::cout <<
"Executing " << command1 << std::endl;
1171 TCanvas *MyT =
new TCanvas(
"MyT",
"MyT", 3500, 1500);
1173 StripMap->SetLineColor(kBlack);
1174 StripMap->SetLineWidth(0);
1175 StripMap->Draw(
"AL COLZ");
1179 gStyle->SetPalette(kRainBow);
1180 TPaletteAxis *realPalette = (TPaletteAxis *)StripMap->GetListOfFunctions()->FindObject(
"palette");
1181 realPalette->SetX1NDC(0.92);
1182 realPalette->SetX2NDC(0.94);
1183 realPalette->SetY1NDC(0.02);
1184 realPalette->SetY2NDC(0.91);
1185 gPad->SetRightMargin(0.08);
1186 gPad->SetLeftMargin(0.01);
1187 gPad->SetTopMargin(0.09);
1188 gPad->SetBottomMargin(0.02);
1193 l2.SetTextSize(0.06);
1196 if (std::isdigit(
c))
1199 l2.DrawLatex(800, 1380, striptitle.c_str());
1200 l2.SetTextSize(0.05);
1201 l2.DrawLatex(1200, 40,
"-z");
1202 l2.DrawLatex(1200, 1300,
"+z");
1203 l2.DrawLatex(1085, 310,
"TIB L1");
1204 l2.DrawLatex(1085, 1000,
"TIB L2");
1205 l2.DrawLatex(1585, 310,
"TIB L3");
1206 l2.DrawLatex(1585, 1000,
"TIB L4");
1207 l2.DrawLatex(2085, 310,
"TOB L1");
1208 l2.DrawLatex(2085, 1000,
"TOB L2");
1209 l2.DrawLatex(2585, 310,
"TOB L3");
1210 l2.DrawLatex(2585, 1000,
"TOB L4");
1211 l2.DrawLatex(3085, 310,
"TOB L5");
1212 l2.DrawLatex(3085, 1000,
"TOB L6");
1213 l2.DrawLatex(3460, 1320,
"x");
1214 l2.DrawLatex(3315, 1210,
"y");
1215 l2.DrawLatex(3510, 667,
"z");
1216 l2.DrawLatex(3023, 530,
"#Phi");
1234 for (std::vector<TPolyLine *>::iterator pos1 = vp.begin(); pos1 != vp.end(); pos1++) {
1242 int crate,
int numfed_incrate,
bool print_total,
TmApvPair *apvPair, std::ofstream *svgfile,
bool useApvPairValue) {
1243 double xp[4], yp[4];
1248 double xd[4], yd[4];
1250 double boxinitx = 0., boxinity = 0.;
1251 double dx = .9,
dy = .9;
1265 xp[1] = boxinitx +
dx;
1267 xp[2] = boxinitx +
dx;
1268 yp[2] = boxinity +
dy;
1270 yp[3] = boxinity +
dy;
1271 for (
int j = 0;
j < 4;
j++) {
1280 s.erase(
s.begin() +
s.find(
"connected"),
s.end());
1282 if (useApvPairValue) {
1283 if (apvPair->
red < 0) {
1284 if (apvPair->
count > 0) {
1285 float vals = apvPair->
value;
1289 red = (color >> 16) & 0xFF;
1290 green = (color >> 8) & 0xFF;
1291 blue = (color) & 0xFF;
1295 *
svgfile << nams <<
" " << vals <<
" " <<
red <<
" " << green <<
" " <<
blue <<
" ";
1298 <<
"<svg:polygon detid=\"" << apvPair->
idex <<
"\" count=\"" << apvPair->
count <<
"\" value=\"" 1299 << apvPair->
value <<
"\" id=\"" << apvPair->
idex +
crate * 1000000 <<
"\" cmodid=\"" 1301 <<
"\" onclick=\"showData(evt);\" onmouseover=\"showData(evt);\" onmouseout=\"showData(evt);\" MESSAGE=\"" 1304 <<
" \" fill=\"rgb(" <<
red <<
"," << green <<
"," <<
blue <<
")\" points=\"";
1307 *
svgfile << 0 <<
" " << 0 <<
" " << 255 <<
" " << 255 <<
" " << 255 <<
" ";
1310 <<
"<svg:polygon detid=\"" << apvPair->
idex <<
"\" count=\"" << apvPair->
count <<
"\" value=\"" 1311 << apvPair->
value <<
"\" id=\"" << apvPair->
idex +
crate * 1000000 <<
"\" cmodid=\"" 1313 <<
"\" onclick=\"showData(evt);\" onmouseover=\"showData(evt);\" onmouseout=\"showData(evt);\" MESSAGE=\"" 1316 <<
" \" fill=\"white\" points=\"";
1319 if (apvPair->
red > 255)
1321 if (apvPair->
green > 255)
1322 apvPair->
green = 255;
1323 if (apvPair->
blue > 255)
1324 apvPair->
blue = 255;
1326 *
svgfile << 0 <<
" " << 0 <<
" " << apvPair->
red <<
" " << apvPair->
green <<
" " << apvPair->
blue <<
" ";
1329 <<
"<svg:polygon detid=\"" << apvPair->
idex <<
"\" count=\"" << apvPair->
count <<
"\" value=\"" 1330 << apvPair->
value <<
"\" id=\"" << apvPair->
idex +
crate * 1000000 <<
"\" cmodid=\"" 1332 <<
"\" onclick=\"showData(evt);\" onmouseover=\"showData(evt);\" onmouseout=\"showData(evt);\" MESSAGE=\"" 1335 <<
" \" fill=\"rgb(" << apvPair->
red <<
"," << apvPair->
green <<
"," << apvPair->
blue <<
")\" points=\"";
1338 if (apvPair->
mod->
red < 0) {
1344 red = (color >> 16) & 0xFF;
1345 green = (color >> 8) & 0xFF;
1346 blue = (color) & 0xFF;
1348 *
svgfile << nams <<
" " << vals <<
" " <<
red <<
" " << green <<
" " <<
blue <<
" ";
1351 <<
"<svg:polygon detid=\"" << apvPair->
idex <<
"\" count=\"" << apvPair->
count <<
"\" value=\"" 1352 << apvPair->
value <<
"\" id=\"" << apvPair->
idex +
crate * 1000000 <<
"\" cmodid=\"" 1354 <<
"\" onclick=\"showData(evt);\" onmouseover=\"showData(evt);\" onmouseout=\"showData(evt);\" MESSAGE=\"" 1357 <<
" \" fill=\"rgb(" <<
red <<
"," << green <<
"," <<
blue <<
")\" points=\"";
1360 *
svgfile << 0 <<
" " << 0 <<
" " << 255 <<
" " << 255 <<
" " << 255 <<
" ";
1363 <<
"<svg:polygon detid=\"" << apvPair->
idex <<
"\" count=\"" << apvPair->
count <<
"\" value=\"" 1364 << apvPair->
value <<
"\" id=\"" << apvPair->
idex +
crate * 1000000 <<
"\" cmodid=\"" 1366 <<
"\" onclick=\"showData(evt);\" onmouseover=\"showData(evt);\" onmouseout=\"showData(evt);\" MESSAGE=\"" 1369 <<
" \" fill=\"white\" points=\"";
1372 if (apvPair->
mod->
red > 255)
1383 <<
"<svg:polygon detid=\"" << apvPair->
idex <<
"\" count=\"" << apvPair->
count <<
"\" value=\"" 1384 << apvPair->
value <<
"\" id=\"" << apvPair->
idex +
crate * 1000000 <<
"\" cmodid=\"" 1386 <<
"\" onclick=\"showData(evt);\" onmouseover=\"showData(evt);\" onmouseout=\"showData(evt);\" MESSAGE=\"" 1389 <<
" \" fill=\"rgb(" << apvPair->
mod->
red <<
"," << apvPair->
mod->
green <<
"," << apvPair->
mod->
blue 1395 for (
int k = 0;
k <
np;
k++) {
1397 *
svgfile << xd[
k] <<
" " << yd[
k] <<
" ";
1399 *
svgfile << xd[
k] <<
"," << yd[
k] <<
" ";
1404 *
svgfile <<
"\" />" << std::endl;
1407 int crate,
int numfec_incrate,
bool print_total,
TmCcu *ccu, std::ofstream *svgfile,
bool useCcuValue) {
1408 double xp[4], yp[4];
1413 double xd[4], yd[4];
1415 double boxinitx = 0., boxinity = 0.;
1416 double dx = .9,
dy = .9;
1417 int numccu_incolumn = 8;
1418 int numccu_inrow = 15;
1419 int numfec_incolumn = 5;
1420 int numfec_inrow = 4;
1421 boxinitx = boxinitx + (numfec_incolumn - (numfec_incrate - 1) / numfec_inrow) * 14.;
1422 boxinity = boxinity + (numfec_inrow - (numfec_incrate - 1) % numfec_inrow) * 16.;
1423 boxinity = boxinity + numccu_inrow - ccu->
mpos;
1424 boxinitx = boxinitx + numccu_incolumn - (
int)(ccu->
getCcuRing() % numccu_incolumn);
1428 xp[1] = boxinitx +
dx;
1430 xp[2] = boxinitx +
dx;
1431 yp[2] = boxinity +
dy;
1433 yp[3] = boxinity +
dy;
1434 for (
int j = 0;
j < 4;
j++) {
1445 s.erase(
s.begin() +
s.find(
"connected"),
s.end());
1448 if (ccu->
count > 0) {
1449 float vals = ccu->
value;
1453 red = (color >> 16) & 0xFF;
1454 green = (color >> 8) & 0xFF;
1455 blue = (color) & 0xFF;
1459 *
svgfile << nams <<
" " << vals <<
" " <<
red <<
" " << green <<
" " <<
blue <<
" ";
1462 <<
"<svg:polygon detid=\"" << ccu->
idex <<
"\" count=\"" << ccu->
count <<
"\" value=\"" << ccu->
value 1463 <<
"\" id=\"" << ccu->
idex +
crate * 1000000 <<
"\" cmodid=\"" << ccu->
cmodid <<
"\" layer=\"" << ccu->
layer 1464 <<
"\" onclick=\"showData(evt);\" onmouseover=\"showData(evt);\" onmouseout=\"showData(evt);\" MESSAGE=\"" 1465 "\" POS=\"Slot/Ring" 1467 <<
" \" fill=\"rgb(" <<
red <<
"," << green <<
"," <<
blue <<
")\" points=\"";
1470 *
svgfile << 0 <<
" " << 0 <<
" " << 255 <<
" " << 255 <<
" " << 255 <<
" ";
1473 <<
"<svg:polygon detid=\"" << ccu->
idex <<
"\" count=\"" << ccu->
count <<
"\" value=\"" << ccu->
value 1474 <<
"\" id=\"" << ccu->
idex +
crate * 1000000 <<
"\" cmodid=\"" << ccu->
cmodid <<
"\" layer=\"" 1476 <<
"\" onclick=\"showData(evt);\" onmouseover=\"showData(evt);\" onmouseout=\"showData(evt);\" MESSAGE=\"" 1477 "\" POS=\"Slot/Ring " 1479 <<
" \" fill=\"white\" points=\"";
1484 if (ccu->
green > 255)
1486 if (ccu->
blue > 255)
1489 *
svgfile << 0 <<
" " << 0 <<
" " << ccu->
red <<
" " << ccu->
green <<
" " << ccu->
blue <<
" ";
1492 <<
"<svg:polygon detid=\"" << ccu->
idex <<
"\" count=\"" << ccu->
count <<
"\" value=\"" << ccu->
value 1493 <<
"\" id=\"" << ccu->
idex +
crate * 1000000 <<
"\" cmodid=\"" << ccu->
cmodid <<
"\" layer=\"" << ccu->
layer 1494 <<
"\" onclick=\"showData(evt);\" onmouseover=\"showData(evt);\" onmouseout=\"showData(evt);\" MESSAGE=\"" 1495 "\" POS=\"Slot/Ring " 1497 <<
" \" fill=\"rgb(" << ccu->
red <<
"," << ccu->
green <<
"," << ccu->
blue <<
")\" points=\"";
1501 for (
int k = 0;
k <
np;
k++) {
1503 *
svgfile << xd[
k] <<
" " << yd[
k] <<
" ";
1505 *
svgfile << xd[
k] <<
"," << yd[
k] <<
" ";
1510 *
svgfile <<
"\" />" << std::endl;
1513 int rack,
int numcrate_inrack,
bool print_total,
TmPsu *psu, std::ofstream *svgfile,
bool usePsuValue) {
1514 double xp[4], yp[4];
1519 double xd[4], yd[4];
1521 double boxinitx = 0., boxinity = 0.;
1522 double dx = .9,
dy = .9;
1529 xp[1] = boxinitx +
dx;
1531 xp[2] = boxinitx +
dx;
1532 yp[2] = boxinity +
dy;
1534 yp[3] = boxinity +
dy;
1536 for (
int j = 0;
j < 4;
j++) {
1556 s.erase(
s.begin() +
s.find(
"connected"),
s.end());
1559 if (psu->
count > 0) {
1560 float vals = psu->
value;
1564 red = (color >> 16) & 0xFF;
1565 green = (color >> 8) & 0xFF;
1566 blue = (color) & 0xFF;
1570 *
svgfile << nams <<
" " << vals <<
" " <<
red <<
" " << green <<
" " <<
blue <<
" ";
1573 <<
"<svg:polygon detid=\"" << psu->
idex <<
"\" count=\"" << psu->
count <<
"\" value=\"" << psu->
value 1574 <<
"\" id=\"" << psu->
idex <<
"\" cmodid=\"" << psu->
cmodid_LV 1575 <<
"\" onclick=\"showData(evt);\" onmouseover=\"showData(evt);\" onmouseout=\"showData(evt);\" MESSAGE=\"" 1576 "\" POS=\"easyCrate/easyBoard " 1578 <<
"," << green <<
"," <<
blue <<
")\" points=\"";
1581 *
svgfile << 0 <<
" " << 0 <<
" " << 255 <<
" " << 255 <<
" " << 255 <<
" ";
1584 <<
"<svg:polygon detid=\"" << psu->
idex <<
"\" count=\"" << psu->
count <<
"\" value=\"" << psu->
value 1585 <<
"\" id=\"" << psu->
idex <<
"\" cmodid=\"" << psu->
cmodid_LV 1586 <<
"\" onclick=\"showData(evt);\" onmouseover=\"showData(evt);\" onmouseout=\"showData(evt);\" MESSAGE=\"" 1587 "\" POS=\"easyCrate/easyBoard " 1589 <<
" \" fill=\"white\" points=\"";
1596 if (psu->
green > 255)
1598 if (psu->
blue > 255)
1601 *
svgfile << 0 <<
" " << 0 <<
" " << psu->
red <<
" " << psu->
green <<
" " << psu->
blue <<
" ";
1604 <<
"<svg:polygon detid=\"" << psu->
idex <<
"\" count=\"" << psu->
count <<
"\" value=\"" << psu->
value 1605 <<
"\" id=\"" << psu->
idex <<
"\" cmodid=\"" << psu->
cmodid_LV 1606 <<
"\" onclick=\"showData(evt);\" onmouseover=\"showData(evt);\" onmouseout=\"showData(evt);\" MESSAGE=\"" 1607 "\" POS=\"easyCrate/easyBoard " 1609 <<
"," << psu->
green <<
"," << psu->
blue <<
")\" points=\"";
1614 for (
int k = 0;
k <
np;
k++) {
1616 *
svgfile << xd[
k] <<
" " << yd[
k] <<
" ";
1618 *
svgfile << xd[
k] <<
"," << yd[
k] <<
" ";
1623 *
svgfile <<
"\" />" << std::endl;
1627 int rack,
int numcrate_inrack,
bool print_total,
TmPsu *psu, std::ofstream *svgfile,
bool usePsuValue) {
1628 double xp[4], yp[4];
1633 double xd[4], yd[4];
1635 double boxinitx = 35, boxinity = 12;
1636 double dx = 1.1,
dy = 1.3;
1638 boxinitx = boxinitx + (5 - psu->
getPsuCrate()) * 5;
1639 boxinity = boxinity + (18 - psu->
getPsuBoard()) * 1.75;
1643 xp[1] = boxinitx +
dx;
1645 xp[2] = boxinitx +
dx;
1646 yp[2] = boxinity +
dy;
1648 yp[3] = boxinity +
dy;
1650 for (
int j = 0;
j < 4;
j++) {
1659 s.erase(
s.begin() +
s.find(
"connected"),
s.end());
1668 redHV2 = (color >> 16) & 0xFF;
1669 greenHV2 = (color >> 8) & 0xFF;
1670 blueHV2 = (color) & 0xFF;
1674 *
svgfile << nams <<
" " << vals <<
" " << redHV2 <<
" " << greenHV2 <<
" " << blueHV2 <<
" ";
1677 <<
"<svg:polygon detid=\"" << psu->
idex <<
"\" count=\"" << psu->
countHV2 <<
"\" value=\"" << psu->
valueHV2 1678 <<
"\" id=\"" << psu->
idex * 10 + 2 <<
"\" cmodid=\"" << psu->
cmodid_HV2 1679 <<
"\" onclick=\"showData(evt);\" onmouseover=\"showData(evt);\" onmouseout=\"showData(evt);\" MESSAGE=\"" 1680 "\" POS=\"easyCrate/easyBoard " 1682 <<
"," << greenHV2 <<
"," << blueHV2 <<
")\" points=\"";
1685 *
svgfile << 0 <<
" " << 0 <<
" " << 255 <<
" " << 255 <<
" " << 255 <<
" ";
1688 <<
"<svg:polygon detid=\"" << psu->
idex <<
"\" count=\"" << psu->
countHV2 <<
"\" value=\"" << psu->
valueHV2 1689 <<
"\" id=\"" << psu->
idex * 10 + 2 <<
"\" cmodid=\"" << psu->
cmodid_HV2 1690 <<
"\" onclick=\"showData(evt);\" onmouseover=\"showData(evt);\" onmouseout=\"showData(evt);\" MESSAGE=\"" 1691 "\" POS=\"easyCrate/easyBoard " 1693 <<
" \" fill=\"white\" points=\"";
1708 <<
"<svg:polygon detid=\"" << psu->
idex <<
"\" count=\"" << psu->
countHV2 <<
"\" value=\"" << psu->
valueHV2 1709 <<
"\" id=\"" << psu->
idex * 10 + 2 <<
"\" cmodid=\"" << psu->
cmodid_HV2 1710 <<
"\" onclick=\"showData(evt);\" onmouseover=\"showData(evt);\" onmouseout=\"showData(evt);\" MESSAGE=\"" 1711 "\" POS=\"easyCrate/easyBoard " 1718 for (
int k = 0;
k <
np;
k++) {
1720 *
svgfile << xd[
k] <<
" " << yd[
k] <<
" ";
1722 *
svgfile << xd[
k] <<
"," << yd[
k] <<
" ";
1727 *
svgfile <<
"\" />" << std::endl;
1731 int rack,
int numcrate_inrack,
bool print_total,
TmPsu *psu, std::ofstream *svgfile,
bool usePsuValue) {
1732 double xp[4], yp[4];
1737 double xd[4], yd[4];
1739 double boxinitx = 36.5, boxinity = 12;
1740 double dx = 1.1,
dy = 1.3;
1742 boxinitx = boxinitx + (5 - psu->
getPsuCrate()) * 5;
1743 boxinity = boxinity + (18 - psu->
getPsuBoard()) * 1.75;
1747 xp[1] = boxinitx +
dx;
1749 xp[2] = boxinitx +
dx;
1750 yp[2] = boxinity +
dy;
1752 yp[3] = boxinity +
dy;
1754 for (
int j = 0;
j < 4;
j++) {
1763 s.erase(
s.begin() +
s.find(
"connected"),
s.end());
1771 redHV3 = (color >> 16) & 0xFF;
1772 greenHV3 = (color >> 8) & 0xFF;
1773 blueHV3 = (color) & 0xFF;
1777 *
svgfile << nams <<
" " << vals <<
" " << redHV3 <<
" " << greenHV3 <<
" " << blueHV3 <<
" ";
1780 <<
"<svg:polygon detid=\"" << psu->
idex <<
"\" count=\"" << psu->
countHV3 <<
"\" value=\"" << psu->
valueHV3 1781 <<
"\" id=\"" << psu->
idex * 10 + 3 <<
"\" cmodid=\"" << psu->
cmodid_HV3 1782 <<
"\" onclick=\"showData(evt);\" onmouseover=\"showData(evt);\" onmouseout=\"showData(evt);\" MESSAGE=\"" 1783 "\" POS=\"easyCrate/easyBoard" 1785 <<
"," << greenHV3 <<
"," << blueHV3 <<
")\" points=\"";
1788 *
svgfile << 0 <<
" " << 255 <<
" " << 255 <<
" " << 255 <<
" ";
1791 <<
"<svg:polygon detid=\"" << psu->
idex <<
"\" count=\"" << psu->
countHV3 <<
"\" value=\"" << psu->
valueHV3 1792 <<
"\" id=\"" << psu->
idex * 10 + 3 <<
"\" cmodid=\"" << psu->
cmodid_HV3 1793 <<
"\" onclick=\"showData(evt);\" onmouseover=\"showData(evt);\" onmouseout=\"showData(evt);\" MESSAGE=\"" 1794 "\" POS=\"easyCrate/easyBoard " 1796 <<
" \" fill=\"white\" points=\"";
1811 <<
"<svg:polygon detid=\"" << psu->
idex <<
"\" count=\"" << psu->
countHV3 <<
"\" value=\"" << psu->
valueHV3 1812 <<
"\" id=\"" << psu->
idex * 10 + 3 <<
"\" cmodid=\"" << psu->
cmodid_HV3 1813 <<
"\" onclick=\"showData(evt);\" onmouseover=\"showData(evt);\" onmouseout=\"showData(evt);\" MESSAGE=\"" 1814 "\" POS=\"easyCrate/easyBoard " 1821 for (
int k = 0;
k <
np;
k++) {
1823 *
svgfile << xd[
k] <<
" " << yd[
k] <<
" ";
1825 *
svgfile << xd[
k] <<
"," << yd[
k] <<
" ";
1830 *
svgfile <<
"\" />" << std::endl;
1834 bool print_total,
float minval,
float maxval,
std::string s,
int width,
int height) {
1837 std::vector<TPolyLine *> vp;
1838 TGaxis *axis =
nullptr;
1846 std::ostringstream outs;
1852 std::map<int, TmCcu *>::iterator i_ccu;
1853 std::multimap<TmCcu *, TmModule *>::iterator
it;
1854 std::pair<std::multimap<TmCcu *, TmModule *>::iterator, std::multimap<TmCcu *, TmModule *>::iterator>
ret;
1856 bool useCcuValue =
false;
1858 for (i_ccu =
ccuMap.begin(); i_ccu !=
ccuMap.end(); i_ccu++) {
1859 TmCcu *ccu = i_ccu->second;
1860 if (ccu !=
nullptr) {
1861 if (ccu->
count > 0 || ccu->
red != -1) {
1869 for (i_ccu =
ccuMap.begin(); i_ccu !=
ccuMap.end(); i_ccu++) {
1870 TmCcu *ccu = i_ccu->second;
1871 if (ccu !=
nullptr) {
1874 if ((*it).second->count > 0) {
1875 ccu->
value = ccu->
value + (*it).second->value;
1881 if (ccu->
nmod == 0) {
1889 if (
title.find(
"QTestAlarm") != std::string::npos) {
1890 for (i_ccu =
ccuMap.begin(); i_ccu !=
ccuMap.end(); i_ccu++) {
1891 TmCcu *ccu = i_ccu->second;
1892 if (ccu !=
nullptr) {
1898 if (!((*it).second->red == 0 && (*it).second->green == 255 && (*it).second->blue == 0) &&
1899 !((*it).second->red == 255 && (*it).second->green == 255 && (*it).second->blue == 255)) {
1910 for (i_ccu =
ccuMap.begin(); i_ccu !=
ccuMap.end(); i_ccu++) {
1911 TmCcu *ccu = i_ccu->second;
1912 if (ccu !=
nullptr) {
1922 for (i_ccu =
ccuMap.begin(); i_ccu !=
ccuMap.end(); i_ccu++) {
1923 TmCcu *ccu = i_ccu->second;
1924 if (ccu !=
nullptr && ccu->
count > 0) {
1927 if (maxvalue < ccu->
value)
1935 std::ostringstream outs;
1938 *
savefile <<
"<?xml version=\"1.0\" standalone=\"no\" ?>" << std::endl;
1939 *
savefile <<
"<svg xmlns=\"http://www.w3.org/2000/svg\"" << std::endl;
1940 *
savefile <<
"xmlns:svg=\"http://www.w3.org/2000/svg\" " << std::endl;
1941 *
savefile <<
"xmlns:xlink=\"http://www.w3.org/1999/xlink\">" << std::endl;
1942 *
savefile <<
"<svg:svg id=\"mainMap\" x=\"0\" y=\"0\" viewBox=\"0 0 3000 1600" 1943 <<
"\" width=\"" <<
width <<
"\" height=\"" << height <<
"\">" << std::endl;
1944 *
savefile <<
"<svg:rect fill=\"lightblue\" stroke=\"none\" x=\"0\" y=\"0\" width=\"3000\" height=\"1600\" /> " 1946 *
savefile <<
"<svg:g id=\"fedtrackermap\" transform=\"translate(10,1500) rotate(270)\" " 1947 "style=\"fill:none;stroke:black;stroke-width:0;\"> " 1953 std::ostringstream outs;
1956 *
savefile <<
"<?xml version=\"1.0\" standalone=\"no\"?>" << std::endl;
1957 *
savefile <<
"<svg xmlns=\"http://www.w3.org/2000/svg\"" << std::endl;
1958 *
savefile <<
"xmlns:svg=\"http://www.w3.org/2000/svg\"" << std::endl;
1959 *
savefile <<
"xmlns:xlink=\"http://www.w3.org/1999/xlink\" >" << std::endl;
1960 *
savefile <<
"<script type=\"text/ecmascript\" xlink:href=\"feccrate.js\" />" << std::endl;
1961 *
savefile <<
"<svg id=\"mainMap\" x=\"0\" y=\"0\" viewBox=\"0 0 500 500\" width=\"700\" height=\"700\" " 1962 "onload=\"TrackerCrate.init()\">" 1964 *
savefile <<
"<rect fill=\"lightblue\" stroke=\"none\" x=\"0\" y=\"0\" width=\"700\" height=\"700\" />" 1966 *
savefile <<
"<g id=\"crate\" transform=\" translate(280,580) rotate(270) scale(.7,.8)\" > " << std::endl;
1971 for (i_ccu =
ccuMap.begin(); i_ccu !=
ccuMap.end(); i_ccu++) {
1972 TmCcu *ccu = i_ccu->second;
1973 if (ccu !=
nullptr) {
1982 *
savefile <<
"</g> </svg> <text id=\"currentElementText\" x=\"40\" y=\"30\"> " << std::endl;
1983 *
savefile <<
"<tspan id=\"line1\" x=\"40\" y=\"30\"> </tspan> " << std::endl;
1984 *
savefile <<
"<tspan id=\"line2\" x=\"40\" y=\"60\"> </tspan> " << std::endl;
1985 *
savefile <<
" </text> </svg>" << std::endl;
1992 *
savefile <<
"</g> </svg> </svg> " << std::endl;
1995 if (!print_total && !useCcuValue) {
1997 for (i_ccu =
ccuMap.begin(); i_ccu !=
ccuMap.end(); i_ccu++) {
1998 TmCcu *ccu = i_ccu->second;
1999 if (ccu !=
nullptr) {
2011 const char *command1;
2015 std::ifstream tempfile(tempfilename.c_str(),
std::ios::in);
2016 TCanvas *MyC =
new TCanvas(
"MyC",
"TrackerMap",
width, height);
2017 gPad->SetFillColor(38);
2020 gPad->Range(0, 0, 3700, 1600);
2022 gPad->Range(0, 0, 3800, 1600);
2026 typedef std::map<int, int> ColorList;
2027 ColorList colorList;
2028 ColorList::iterator
pos;
2030 while (!tempfile.eof()) {
2032 colindex =
red + green * 1000 +
blue * 1000000;
2033 pos = colorList.find(colindex);
2034 if (
pos == colorList.end()) {
2035 colorList[colindex] = ncolor + 100;
2036 col = gROOT->GetColor(ncolor + 100);
2038 col->SetRGB((Double_t)(
red / 255.), (Double_t)(green / 255.), (Double_t)(
blue / 255.));
2040 c =
new TColor(ncolor + 100, (Double_t)(
red / 255.), (Double_t)(green / 255.), (Double_t)(
blue / 255.));
2046 tempfile >>
x[
i] >>
y[
i];
2049 if (ncolor > 0 && ncolor < 10000) {
2051 for (
int i = 0;
i < ncolor;
i++) {
2054 gStyle->SetPalette(ncolor,
colors);
2057 tempfile.seekg(0, std::ios::beg);
2058 std::cout <<
"created palette with " << ncolor <<
" colors" << std::endl;
2059 while (!tempfile.eof()) {
2062 tempfile >>
x[
i] >>
y[
i];
2064 colindex =
red + green * 1000 +
blue * 1000000;
2065 pos = colorList.find(colindex);
2066 if (
pos != colorList.end()) {
2067 TPolyLine *pline =
new TPolyLine(
npoints,
y,
x);
2068 vp.push_back(pline);
2069 pline->SetFillColor(colorList[colindex]);
2070 pline->SetLineWidth(0);
2081 axis =
new TGaxis(3660, 36, 3660, 1530, lminvalue, lmaxvalue, 510,
"+L");
2082 axis->SetLabelSize(0.02);
2088 l.SetTextSize(0.05);
2090 if (
tkMapLog && (fulltitle.find(
"Log10 scale") == std::string::npos))
2091 fulltitle +=
": Log10 scale";
2092 l.DrawLatex(50, 1530, fulltitle.c_str());
2110 std::cout <<
"Executing " << command1 << std::endl;
2116 for (std::vector<TPolyLine *>::iterator pos1 = vp.begin(); pos1 != vp.end(); pos1++) {
2124 bool print_total,
float minval,
float maxval,
std::string s,
int width,
int height) {
2127 std::vector<TPolyLine *> vp;
2128 TGaxis *axis =
nullptr;
2139 std::ostringstream outs;
2146 std::map<int, TmPsu *>::iterator ipsu;
2147 std::multimap<TmPsu *, TmModule *>::iterator
it;
2148 std::pair<std::multimap<TmPsu *, TmModule *>::iterator, std::multimap<TmPsu *, TmModule *>::iterator>
ret;
2150 bool usePsuValue =
false;
2152 for (ipsu =
psuMap.begin(); ipsu !=
psuMap.end(); ipsu++) {
2153 TmPsu *psu = ipsu->second;
2154 if (psu !=
nullptr) {
2164 for (ipsu =
psuMap.begin(); ipsu !=
psuMap.end(); ipsu++) {
2165 TmPsu *psu = ipsu->second;
2166 if (psu !=
nullptr) {
2171 if ((*it).second->HVchannel == 2 && (*it).second->count > 0) {
2175 if ((*it).second->HVchannel == 3 && (*it).second->count > 0) {
2180 if (psu->
nmodHV2 != 0 && nconn1 > 0) {
2184 if (psu->
nmodHV3 != 0 && nconn2 > 0) {
2192 if (
title.find(
"QTestAlarm") != std::string::npos) {
2193 for (ipsu =
psuMap.begin(); ipsu !=
psuMap.end(); ipsu++) {
2194 TmPsu *psu = ipsu->second;
2195 if (psu !=
nullptr) {
2204 if ((*it).second->HVchannel == 2) {
2205 if (!((*it).second->red == 0 && (*it).second->green == 255 && (*it).second->blue == 0) &&
2206 !((*it).second->red == 255 && (*it).second->green == 255 && (*it).second->blue == 255)) {
2212 if ((*it).second->HVchannel == 3) {
2213 if (!((*it).second->red == 0 && (*it).second->green == 255 && (*it).second->blue == 0) &&
2214 !((*it).second->red == 255 && (*it).second->green == 255 && (*it).second->blue == 255)) {
2226 for (ipsu =
psuMap.begin(); ipsu !=
psuMap.end(); ipsu++) {
2227 TmPsu *psu = ipsu->second;
2228 if (psu !=
nullptr) {
2241 for (ipsu =
psuMap.begin(); ipsu !=
psuMap.end(); ipsu++) {
2242 TmPsu *psu = ipsu->second;
2246 if (maxvalue < psu->valueHV2 || maxvalue < psu->valueHV3)
2254 std::ostringstream outs;
2257 *
savefile <<
"<?xml version=\"1.0\" standalone=\"no\" ?>" << std::endl;
2258 *
savefile <<
"<svg xmlns=\"http://www.w3.org/2000/svg\"" << std::endl;
2259 *
savefile <<
"xmlns:svg=\"http://www.w3.org/2000/svg\" " << std::endl;
2260 *
savefile <<
"xmlns:xlink=\"http://www.w3.org/1999/xlink\">" << std::endl;
2261 *
savefile <<
"<svg:svg id=\"mainMap\" x=\"0\" y=\"0\" viewBox=\"0 0 3000 1600" 2262 <<
"\" width=\"" <<
width <<
"\" height=\"" << height <<
"\">" << std::endl;
2263 *
savefile <<
"<svg:rect fill=\"lightblue\" stroke=\"none\" x=\"0\" y=\"0\" width=\"3000\" height=\"1600\" /> " 2265 *
savefile <<
"<svg:g id=\"HVtrackermap\" transform=\"translate(10,1500) rotate(270)\" " 2266 "style=\"fill:none;stroke:black;stroke-width:0;\"> " 2270 for (
int irack = 1; irack < (
npsuracks + 1); irack++) {
2273 std::ostringstream outs;
2276 *
savefile <<
"<?xml version=\"1.0\" standalone=\"no\"?>" << std::endl;
2277 *
savefile <<
"<svg xmlns=\"http://www.w3.org/2000/svg\"" << std::endl;
2278 *
savefile <<
"xmlns:svg=\"http://www.w3.org/2000/svg\"" << std::endl;
2279 *
savefile <<
"xmlns:xlink=\"http://www.w3.org/1999/xlink\" >" << std::endl;
2280 *
savefile <<
"<script type=\"text/ecmascript\" xlink:href=\"rackhv.js\" />" << std::endl;
2281 *
savefile <<
"<svg id=\"mainMap\" x=\"0\" y=\"0\" viewBox=\"0 0 500 500\" width=\"700\" height=\"700\" " 2282 "onload=\"TrackerRackhv.init()\">" 2284 *
savefile <<
"<rect fill=\"lightblue\" stroke=\"none\" x=\"0\" y=\"0\" width=\"700\" height=\"700\" />" 2286 *
savefile <<
"<g id=\"rackhv\" transform=\" translate(150,500) rotate(270) scale(1.,1.)\" > " << std::endl;
2291 for (ipsu =
psuMap.begin(); ipsu !=
psuMap.end(); ipsu++) {
2292 TmPsu *psu = ipsu->second;
2295 drawHV3(irack, psu->getPsuCrate(), print_total, psu,
savefile, usePsuValue);
2301 *
savefile <<
"</g> </svg> <text id=\"currentElementText\" x=\"40\" y=\"30\"> " << std::endl;
2302 *
savefile <<
"<tspan id=\"line1\" x=\"40\" y=\"30\"> </tspan> " << std::endl;
2303 *
savefile <<
"<tspan id=\"line2\" x=\"40\" y=\"60\"> </tspan> " << std::endl;
2304 *
savefile <<
" </text> </svg>" << std::endl;
2311 *
savefile <<
"</g> </svg> </svg> " << std::endl;
2316 if (!print_total && !usePsuValue) {
2317 for (ipsu =
psuMap.begin(); ipsu !=
psuMap.end(); ipsu++) {
2318 TmPsu *psu = ipsu->second;
2319 if (psu !=
nullptr) {
2333 const char *command1;
2337 std::ifstream tempfile(tempfilename.c_str(),
std::ios::in);
2338 TCanvas *MyC =
new TCanvas(
"MyC",
"TrackerMap",
width, height);
2339 gPad->SetFillColor(38);
2342 gPad->Range(0, 0, 3700, 1600);
2344 gPad->Range(0, 0, 3800, 1600);
2348 typedef std::map<int, int> ColorList;
2349 ColorList colorList;
2350 ColorList::iterator
pos;
2352 while (!tempfile.eof()) {
2354 colindex =
red + green * 1000 +
blue * 1000000;
2355 pos = colorList.find(colindex);
2356 if (
pos == colorList.end()) {
2357 colorList[colindex] = ncolor + 100;
2358 col = gROOT->GetColor(ncolor + 100);
2360 col->SetRGB((Double_t)(
red / 255.), (Double_t)(green / 255.), (Double_t)(
blue / 255.));
2362 c =
new TColor(ncolor + 100, (Double_t)(
red / 255.), (Double_t)(green / 255.), (Double_t)(
blue / 255.));
2368 tempfile >>
x[
i] >>
y[
i];
2371 if (ncolor > 0 && ncolor < 10000) {
2373 for (
int i = 0;
i < ncolor;
i++) {
2376 gStyle->SetPalette(ncolor,
colors);
2379 tempfile.seekg(0, std::ios::beg);
2380 std::cout <<
"created palette with " << ncolor <<
" colors" << std::endl;
2381 while (!tempfile.eof()) {
2384 tempfile >>
x[
i] >>
y[
i];
2386 colindex =
red + green * 1000 +
blue * 1000000;
2387 pos = colorList.find(colindex);
2388 if (
pos != colorList.end()) {
2389 TPolyLine *pline =
new TPolyLine(
npoints,
y,
x);
2390 vp.push_back(pline);
2391 pline->SetFillColor(colorList[colindex]);
2392 pline->SetLineWidth(0);
2403 axis =
new TGaxis(3660, 36, 3660, 1530, lminvalue, lmaxvalue, 510,
"+L");
2404 axis->SetLabelSize(0.02);
2410 l.SetTextSize(0.05);
2412 if (
tkMapLog && (fulltitle.find(
"Log10 scale") == std::string::npos))
2413 fulltitle +=
": Log10 scale";
2414 l.DrawLatex(50, 1530, fulltitle.c_str());
2432 std::cout <<
"Executing " << command1 << std::endl;
2438 for (std::vector<TPolyLine *>::iterator pos1 = vp.begin(); pos1 != vp.end(); pos1++) {
2447 bool print_total,
float minval,
float maxval,
std::string s,
int width,
int height) {
2450 bool rangefound =
true;
2452 std::vector<TPolyLine *> vp;
2453 TGaxis *axis =
nullptr;
2465 std::ostringstream outs;
2472 std::map<int, TmPsu *>::iterator ipsu;
2473 std::multimap<TmPsu *, TmModule *>::iterator
it;
2474 std::pair<std::multimap<TmPsu *, TmModule *>::iterator, std::multimap<TmPsu *, TmModule *>::iterator>
ret;
2477 bool usePsuValue =
false;
2479 for (ipsu =
psuMap.begin(); ipsu !=
psuMap.end(); ipsu++) {
2480 TmPsu *psu = ipsu->second;
2481 if (psu !=
nullptr) {
2482 if (psu->
count > 0 || psu->
red != -1) {
2490 for (ipsu =
psuMap.begin(); ipsu !=
psuMap.end(); ipsu++) {
2491 TmPsu *psu = ipsu->second;
2492 if (psu !=
nullptr) {
2496 if ((*it).second->count > 0) {
2498 psu->
value = psu->
value + (*it).second->value;
2509 if (
title.find(
"QTestAlarm") != std::string::npos) {
2510 for (ipsu =
psuMap.begin(); ipsu !=
psuMap.end(); ipsu++) {
2511 TmPsu *psu = ipsu->second;
2512 if (psu !=
nullptr) {
2518 if (!((*it).second->red == 0 && (*it).second->green == 255 && (*it).second->blue == 0) &&
2519 !((*it).second->red == 255 && (*it).second->green == 255 && (*it).second->blue == 255)) {
2533 for (ipsu =
psuMap.begin(); ipsu !=
psuMap.end(); ipsu++) {
2534 TmPsu *psu = ipsu->second;
2535 if (psu !=
nullptr) {
2546 for (ipsu =
psuMap.begin(); ipsu !=
psuMap.end(); ipsu++) {
2547 TmPsu *psu = ipsu->second;
2548 if (psu !=
nullptr && psu->
count > 0) {
2552 if (maxvalue < psu->
value)
2562 std::ostringstream outs;
2565 *
savefile <<
"<?xml version=\"1.0\" standalone=\"no\" ?>" << std::endl;
2566 *
savefile <<
"<svg xmlns=\"http://www.w3.org/2000/svg\"" << std::endl;
2567 *
savefile <<
"xmlns:svg=\"http://www.w3.org/2000/svg\" " << std::endl;
2568 *
savefile <<
"xmlns:xlink=\"http://www.w3.org/1999/xlink\">" << std::endl;
2569 *
savefile <<
"<svg:svg id=\"mainMap\" x=\"0\" y=\"0\" viewBox=\"0 0 3000 1600" 2570 <<
"\" width=\"" <<
width <<
"\" height=\"" << height <<
"\">" << std::endl;
2571 *
savefile <<
"<svg:rect fill=\"lightblue\" stroke=\"none\" x=\"0\" y=\"0\" width=\"3000\" height=\"1600\" /> " 2573 *
savefile <<
"<svg:g id=\"psutrackermap\" transform=\"translate(10,1500) rotate(270)\" " 2574 "style=\"fill:none;stroke:black;stroke-width:0;\"> " 2578 for (
int irack = 1; irack < (
npsuracks + 1); irack++) {
2581 std::ostringstream outs;
2584 *
savefile <<
"<?xml version=\"1.0\" standalone=\"no\"?>" << std::endl;
2585 *
savefile <<
"<svg xmlns=\"http://www.w3.org/2000/svg\"" << std::endl;
2586 *
savefile <<
"xmlns:svg=\"http://www.w3.org/2000/svg\"" << std::endl;
2587 *
savefile <<
"xmlns:xlink=\"http://www.w3.org/1999/xlink\" >" << std::endl;
2588 *
savefile <<
"<script type=\"text/ecmascript\" xlink:href=\"rack.js\" />" << std::endl;
2589 *
savefile <<
"<svg id=\"mainMap\" x=\"0\" y=\"0\" viewBox=\"0 0 500 500\" width=\"700\" height=\"700\" " 2590 "onload=\"TrackerCrate.init()\">" 2592 *
savefile <<
"<rect fill=\"lightblue\" stroke=\"none\" x=\"0\" y=\"0\" width=\"700\" height=\"700\" />" 2594 *
savefile <<
"<g id=\"rack\" transform=\" translate(150,500) rotate(270) scale(1.,1.)\" > " << std::endl;
2599 for (ipsu =
psuMap.begin(); ipsu !=
psuMap.end(); ipsu++) {
2600 TmPsu *psu = ipsu->second;
2608 *
savefile <<
"</g> </svg> <text id=\"currentElementText\" x=\"40\" y=\"30\"> " << std::endl;
2609 *
savefile <<
"<tspan id=\"line1\" x=\"40\" y=\"30\"> </tspan> " << std::endl;
2610 *
savefile <<
"<tspan id=\"line2\" x=\"40\" y=\"60\"> </tspan> " << std::endl;
2611 *
savefile <<
" </text> </svg>" << std::endl;
2618 *
savefile <<
"</g> </svg> </svg> " << std::endl;
2623 if (!print_total && !usePsuValue) {
2624 for (ipsu =
psuMap.begin(); ipsu !=
psuMap.end(); ipsu++) {
2625 TmPsu *psu = ipsu->second;
2626 if (psu !=
nullptr) {
2642 const char *command1;
2646 std::ifstream tempfile(tempfilename.c_str(),
std::ios::in);
2647 TCanvas *MyC =
new TCanvas(
"MyC",
"TrackerMap",
width, height);
2648 gPad->SetFillColor(38);
2651 std::cout <<
" range x " << rangex << std::endl;
2652 std::cout <<
" range y " << rangey << std::endl;
2653 gPad->Range(0, 0, rangex, rangey);
2657 typedef std::map<int, int> ColorList;
2658 ColorList colorList;
2659 ColorList::iterator
pos;
2661 while (!tempfile.eof()) {
2663 colindex =
red + green * 1000 +
blue * 1000000;
2664 pos = colorList.find(colindex);
2665 if (
pos == colorList.end()) {
2666 colorList[colindex] = ncolor + 100;
2667 col = gROOT->GetColor(ncolor + 100);
2669 col->SetRGB((Double_t)(
red / 255.), (Double_t)(green / 255.), (Double_t)(
blue / 255.));
2671 c =
new TColor(ncolor + 100, (Double_t)(
red / 255.), (Double_t)(green / 255.), (Double_t)(
blue / 255.));
2676 tempfile >>
x[
i] >>
y[
i];
2679 if (ncolor > 0 && ncolor < 10000) {
2681 for (
int i = 0;
i < ncolor;
i++) {
2684 gStyle->SetPalette(ncolor,
colors);
2687 tempfile.seekg(0, std::ios::beg);
2688 std::cout <<
"created palette with " << ncolor <<
" colors" << std::endl;
2689 while (!tempfile.eof()) {
2692 tempfile >>
x[
i] >>
y[
i];
2694 colindex =
red + green * 1000 +
blue * 1000000;
2695 pos = colorList.find(colindex);
2696 if (
pos != colorList.end()) {
2697 TPolyLine *pline =
new TPolyLine(
npoints,
y,
x);
2698 vp.push_back(pline);
2699 pline->SetFillColor(colorList[colindex]);
2700 pline->SetLineWidth(0);
2711 axis =
new TGaxis(rangex - 140, 34, rangex - 140, rangey - 106, lminvalue, lmaxvalue, 510,
"+L");
2712 axis->SetLabelSize(0.02);
2718 l.SetTextSize(0.05);
2720 if (
tkMapLog && (fulltitle.find(
"Log10 scale") == std::string::npos))
2721 fulltitle +=
": Log10 scale";
2722 l.DrawLatex(50, rangey - 200, fulltitle.c_str());
2740 std::cout <<
"Executing " << command1 << std::endl;
2746 for (std::vector<TPolyLine *>::iterator pos1 = vp.begin(); pos1 != vp.end(); pos1++) {
2755 bool print_total,
float minval,
float maxval,
std::string s,
int width,
int height) {
2758 bool rangefound =
true;
2760 std::vector<TPolyLine *> vp;
2761 TGaxis *axis =
nullptr;
2771 std::ostringstream outs;
2777 std::map<int, TmApvPair *>::iterator i_apv;
2778 std::map<int, int>::iterator i_fed;
2780 bool useApvPairValue =
false;
2781 for (i_apv =
apvMap.begin(); i_apv !=
apvMap.end(); i_apv++) {
2783 if (apvPair !=
nullptr) {
2785 if (apv_mod !=
nullptr && !apv_mod->
notInUse()) {
2786 if (apvPair->
count > 0 || apvPair->
red != -1) {
2787 useApvPairValue =
true;
2794 for (i_apv =
apvMap.begin(); i_apv !=
apvMap.end(); i_apv++) {
2796 if (apvPair !=
nullptr) {
2798 if (apv_mod !=
nullptr && !apv_mod->
notInUse()) {
2799 if (useApvPairValue)
2801 else if (apvPair->
mpos == 0 && apv_mod->
count > 0)
2811 for (i_apv =
apvMap.begin(); i_apv !=
apvMap.end(); i_apv++) {
2813 if (apvPair !=
nullptr) {
2815 if (apv_mod !=
nullptr && !apv_mod->
notInUse()) {
2816 if (useApvPairValue) {
2820 if (maxvalue < apvPair->
value)
2823 if (apv_mod->
count > 0) {
2827 if (maxvalue < apv_mod->
value)
2840 std::ostringstream outs;
2843 *
savefile <<
"<?xml version=\"1.0\" standalone=\"no\" ?>" << std::endl;
2844 *
savefile <<
"<svg xmlns=\"http://www.w3.org/2000/svg\"" << std::endl;
2845 *
savefile <<
"xmlns:svg=\"http://www.w3.org/2000/svg\" " << std::endl;
2846 *
savefile <<
"xmlns:xlink=\"http://www.w3.org/1999/xlink\">" << std::endl;
2847 *
savefile <<
"<svg:svg id=\"mainMap\" x=\"0\" y=\"0\" viewBox=\"0 0 3000 1600" 2848 <<
"\" width=\"" <<
width <<
"\" height=\"" << height <<
"\">" << std::endl;
2849 *
savefile <<
"<svg:rect fill=\"lightblue\" stroke=\"none\" x=\"0\" y=\"0\" width=\"3000\" height=\"1600\" /> " 2851 *
savefile <<
"<svg:g id=\"fedtrackermap\" transform=\"translate(10,1500) rotate(270)\" " 2852 "style=\"fill:none;stroke:black;stroke-width:0;\"> " 2858 std::ostringstream outs;
2861 *
savefile <<
"<?xml version=\"1.0\" standalone=\"no\"?>" << std::endl;
2862 *
savefile <<
"<svg xmlns=\"http://www.w3.org/2000/svg\"" << std::endl;
2863 *
savefile <<
"xmlns:svg=\"http://www.w3.org/2000/svg\"" << std::endl;
2864 *
savefile <<
"xmlns:xlink=\"http://www.w3.org/1999/xlink\" >" << std::endl;
2865 *
savefile <<
"<script type=\"text/ecmascript\" xlink:href=\"crate.js\" />" << std::endl;
2866 *
savefile <<
"<svg id=\"mainMap\" x=\"0\" y=\"0\" viewBox=\"0 0 500 500\" width=\"700\" height=\"700\" " 2867 "onload=\"TrackerCrate.init()\">" 2869 *
savefile <<
"<rect fill=\"lightblue\" stroke=\"none\" x=\"0\" y=\"0\" width=\"700\" height=\"700\" />" 2871 *
savefile <<
"<g id=\"crate\" transform=\" translate(150,500) rotate(270) scale(1.,1.)\" > " << std::endl;
2875 int numfed_incrate = 0;
2876 for (i_fed =
fedMap.begin(); i_fed !=
fedMap.end(); i_fed++) {
2877 if (i_fed->second ==
crate) {
2878 int fedId = i_fed->first;
2896 for (
int nconn = 0; nconn < 96; nconn++) {
2899 if (apvPair !=
nullptr) {
2901 if (apv_mod !=
nullptr && !apv_mod->
notInUse()) {
2910 *
savefile <<
"</g> </svg> <text id=\"currentElementText\" x=\"40\" y=\"30\"> " << std::endl;
2911 *
savefile <<
"<tspan id=\"line1\" x=\"40\" y=\"30\"> </tspan> " << std::endl;
2912 *
savefile <<
"<tspan id=\"line2\" x=\"40\" y=\"60\"> </tspan> " << std::endl;
2913 *
savefile <<
" </text> </svg>" << std::endl;
2926 if (!print_total && !useApvPairValue) {
2928 for (i_apv =
apvMap.begin(); i_apv !=
apvMap.end(); i_apv++) {
2930 if (apvPair !=
nullptr) {
2932 if (apv_mod !=
nullptr && apvPair->
mpos == 0 && !apv_mod->
notInUse()) {
2952 const char *command1;
2956 std::ifstream tempfile(tempfilename.c_str(),
std::ios::in);
2957 TCanvas *MyC =
new TCanvas(
"MyC",
"TrackerMap",
width, height);
2958 gPad->SetFillColor(38);
2961 std::cout <<
" range x " << rangex << std::endl;
2962 std::cout <<
" range y " << rangey << std::endl;
2963 gPad->Range(0, 0, rangex, rangey);
2967 typedef std::map<int, int> ColorList;
2968 ColorList colorList;
2969 ColorList::iterator
pos;
2971 while (!tempfile.eof()) {
2973 colindex =
red + green * 1000 +
blue * 1000000;
2974 pos = colorList.find(colindex);
2975 if (
pos == colorList.end()) {
2976 colorList[colindex] = ncolor + 100;
2977 col = gROOT->GetColor(ncolor + 100);
2979 col->SetRGB((Double_t)(
red / 255.), (Double_t)(green / 255.), (Double_t)(
blue / 255.));
2981 c =
new TColor(ncolor + 100, (Double_t)(
red / 255.), (Double_t)(green / 255.), (Double_t)(
blue / 255.));
2986 tempfile >>
x[
i] >>
y[
i];
2989 if (ncolor > 0 && ncolor < 10000) {
2991 for (
int i = 0;
i < ncolor;
i++) {
2994 gStyle->SetPalette(ncolor,
colors);
2997 tempfile.seekg(0, std::ios::beg);
2998 std::cout <<
"created palette with " << ncolor <<
" colors" << std::endl;
2999 while (!tempfile.eof()) {
3002 tempfile >>
x[
i] >>
y[
i];
3004 colindex =
red + green * 1000 +
blue * 1000000;
3005 pos = colorList.find(colindex);
3006 if (
pos != colorList.end()) {
3007 TPolyLine *pline =
new TPolyLine(
npoints,
y,
x);
3008 vp.push_back(pline);
3009 pline->SetFillColor(colorList[colindex]);
3010 pline->SetLineWidth(0);
3021 axis =
new TGaxis(rangex - 140, 34, rangex - 140, rangey - 106, lminvalue, lmaxvalue, 510,
"+L");
3022 axis->SetLabelSize(0.02);
3028 l.SetTextSize(0.05);
3030 if (
tkMapLog && (fulltitle.find(
"Log10 scale") == std::string::npos))
3031 fulltitle +=
": Log10 scale";
3032 l.DrawLatex(50, rangey - 200, fulltitle.c_str());
3050 std::cout <<
"Executing " << command1 << std::endl;
3056 for (std::vector<TPolyLine *>::iterator pos1 = vp.begin(); pos1 != vp.end(); pos1++) {
3067 int ipos, ipos1, ipos2,
id = 0,
val = 0;
3070 ipos1 =
line.find(
"value=\"");
3073 ipos =
value.find(
'\"');
3077 ipos2 =
line.find(
"detid=\"");
3080 ipos =
value.find(
'\"');
3082 id = atoi(
value.c_str());
3084 if (ipos1 > 0 && ipos2 > 0 &&
val > 0)
3086 if (ipos1 > 0 && ipos2 > 0)
3090 std::cout << nline <<
" modules found in this svg file " << std::endl;
3100 std::ostringstream outs;
3121 if (
mod !=
nullptr && !
mod->notInUse()) {
3136 if (
mod !=
nullptr && !
mod->notInUse()) {
3139 if (maxvalue < mod->
value)
3153 if (
mod !=
nullptr && !
mod->notInUse()) {
3159 *
svgfile <<
"</svg:g></svg:svg>" << std::endl;
3160 *
svgfile <<
" <svg:text id=\"Title\" class=\"normalText\" x=\"300\" y=\"0\">" <<
title <<
"</svg:text>" << std::endl;
3163 *
svgfile <<
"</svg:svg>" << std::endl;
3164 *
svgfile <<
"</body></html>" << std::endl;
3170 std::cout <<
"preparing the palette" << std::endl;
3174 int paletteLength = 250;
3181 for (
int i = 1;
i < paletteLength + 1;
i++) {
3183 red = (color >> 16) & 0xFF;
3184 green = (color >> 8) & 0xFF;
3185 blue = (color) & 0xFF;
3197 *
svgfile <<
"<svg:rect x=\"3610\" y=\"" << (1550 - 6 *
i) <<
"\" width=\"50\" height=\"6\" fill=\"rgb(" <<
red 3198 <<
"," << green <<
"," <<
blue <<
")\" />\n";
3200 *
svgfile << 0 <<
" " << 0 <<
" " <<
red <<
" " << green <<
" " <<
blue <<
" 4 " <<
int(
step *
i) + 34 <<
" " 3208 *
svgfile <<
"<svg:rect x=\"3610\" y=\"" << (1550 - 6 *
i)
3209 <<
"\" width=\"50\" height=\"1\" fill=\"black\" />\n";
3211 *
svgfile <<
" <svg:text class=\"normalText\" x=\"3660\" y=\"" << (1560 - 6 *
i) <<
"\">" <<
val 3212 <<
"</svg:text>" << std::endl;
3222 if (apvpair !=
nullptr) {
3224 apvpair->
green = green;
3228 std::cout <<
"*** error in FedTrackerMap fillc method ***";
3232 std::multimap<const int, TmApvPair *>::iterator
pos;
3235 if (apvpair !=
nullptr) {
3241 std::cout <<
"*** error in FedTrackerMap fill by module method ***";
3248 if (apvpair !=
nullptr) {
3249 apvpair->
value = current_val;
3253 std::cout <<
"*** error in FedTrackerMap fill_current_val method ***";
3261 if (ccu !=
nullptr) {
3267 std::cout <<
"*** error in FecTrackerMap fillc method ***";
3273 if (ccu !=
nullptr) {
3279 std::cout <<
"*** error in FecTrackerMap fill by module method ***";
3283 int key = rack * 1000 +
crate * 100 + board;
3287 if (psu !=
nullptr) {
3293 std::cout <<
"*** error in LVTrackerMap fillc method ***";
3297 int key = rack * 1000 +
crate * 100 + board;
3299 if (psu !=
nullptr) {
3305 std::cout <<
"*** error in LVTrackerMap fill by module method ***";
3309 int key = rack * 1000 +
crate * 100 + board;
3313 if (psu !=
nullptr) {
3319 std::cout <<
"*** error in HVTrackerMap (channel 2) fillc method ***";
3322 int key = rack * 1000 +
crate * 100 + board;
3326 if (psu !=
nullptr) {
3332 std::cout <<
"*** error in HVTrackerMap (channel 3) fillc method ***";
3336 int key = rack * 1000 +
crate * 100 + board;
3338 if (psu !=
nullptr) {
3344 std::cout <<
"*** error in HVTrackerMap fill by module method ***";
3347 int key = rack * 1000 +
crate * 100 + board;
3349 if (psu !=
nullptr) {
3355 std::cout <<
"*** error in HVTrackerMap fill by module method ***";
3361 if (apvpair !=
nullptr) {
3369 if (apvpair !=
nullptr) {
3374 std::cout <<
"*** error inFedTrackerMap fill method ***";
3379 if (
mod !=
nullptr) {
3385 std::cout <<
"**************************error in fill method **************module " <<
idmod << std::endl;
3391 if (
mod !=
nullptr) {
3397 std::cout <<
"**************************error in fill method **************" << std::endl;
3401 std::map<const int, TmModule *>::iterator imod;
3403 fillc(imod->first, 255, 255, 255);
3408 std::map<const int, TmModule *>::iterator imod;
3416 if (
mod !=
nullptr) {
3417 mod->value = current_val;
3421 std::cout <<
"**error in fill_current_val method ***module " <<
idmod << std::endl;
3426 if (
mod !=
nullptr) {
3427 mod->value =
mod->value + qty;
3433 if (mod1 !=
nullptr && mod2 !=
nullptr) {
3441 std::cout <<
"**************************error in fill method **************module " <<
idmod << std::endl;
3447 if (
mod !=
nullptr) {
3448 mod->value =
mod->value + qty;
3451 std::cout <<
"**************************error in SvgModuleMap **************";
3456 if (
mod !=
nullptr) {
3459 std::cout <<
"**************************error in IdModuleMap **************";
3465 if (
mod !=
nullptr) {
3468 std::cout <<
"**************************error in SvgModuleMap **************";
3474 int nmods, pix_sil, fow_bar,
ring, nmod,
layer;
3476 float posx, posy, posz, length,
width,
thickness, widthAtHalfLength;
3477 int old_layer = 0, ntotMod = 0;
3481 infile >> nmods >> pix_sil >> fow_bar >>
layer >>
ring >> nmod >> posx >> posy >> posz >> length >>
width >>
3485 if (old_layer !=
layer) {
3503 mod->length = length;
3506 mod->widthAtHalfLength = widthAtHalfLength;
3516 float lminvalue, lmaxvalue;
3529 float delta = (lmaxvalue - lminvalue);
3530 float x = (
value - lminvalue);
3531 if (
value < lminvalue) {
3536 if (
value > lmaxvalue) {
3541 if (
value >= lminvalue &&
value <= lmaxvalue) {
3545 : (
x > ((3. / 4.) *
delta) ? 255 - 255 / (
delta / 4) * (
x - (3. / 4.) *
delta) : 255));
3547 : (
x > ((1. / 2.) *
delta) ? 0 : 255 - 255 / (
delta / 4) * (
x - (1. / 4.) *
delta)));
3551 green = (
int)((
value - lminvalue) / (lmaxvalue - lminvalue) * 256.);
3556 green = 255 - green;
3559 return (
blue | (green << 8) | (
red << 16));
3563 std::ofstream *ofilename;
3564 std::ifstream *ifilename;
3565 std::ostringstream
ofname;
3570 ifilename =
findfile(
"viewerHeader.xhtml");
3573 while (getline(*ifilename,
line)) {
3574 *ofilename <<
line << std::endl;
3576 *ofilename <<
" var tmapname=\"" <<
outputfilename <<
"\"" << std::endl;
3577 *ofilename <<
" var tmaptitle=\"" <<
title <<
"\"" << std::endl;
3578 *ofilename <<
" var ncrates=" <<
ncrates <<
";" << std::endl;
3579 *ofilename <<
" var nfeccrates=" <<
nfeccrates <<
";" << std::endl;
3580 *ofilename <<
" var npsuracks=" <<
npsuracks <<
";" << std::endl;
3585 ifilename =
findfile(
"viewerTrailer.xhtml");
3586 while (getline(*ifilename,
line)) {
3587 *ofilename <<
line << std::endl;
3601 ifilename =
findfile(
"jqviewer.js");
3604 while (getline(*ifilename,
line)) {
3605 *ofilename <<
line << std::endl;
3616 while (getline(*ifilename,
line)) {
3617 *ofilename <<
line << std::endl;
3625 ifilename =
findfile(
"feccrate.js");
3628 while (getline(*ifilename,
line)) {
3629 *ofilename <<
line << std::endl;
3640 while (getline(*ifilename,
line)) {
3641 *ofilename <<
line << std::endl;
3652 while (getline(*ifilename,
line)) {
3653 *ofilename <<
line << std::endl;
3665 while (getline(*ifilename,
line)) {
3666 *ofilename <<
line << std::endl;
3674 std::ostringstream outs, outs1, outs2;
3683 std::ostringstream outs;
3686 *
txtfile <<
"<html><head></head> <body>" << std::endl;
3691 if (
mod !=
nullptr && !
mod->notInUse()) {
3693 *
txtfile <<
"<a name=" <<
idmod <<
"><pre>" << std::endl;
3694 std::multimap<const int, TmApvPair *>::iterator
pos;
3697 if (apvpair !=
nullptr) {
3701 *
txtfile <<
"</pre><h3>" <<
mod->name <<
"</h3>" << std::endl;
3705 *
txtfile <<
"</body></html>" << std::endl;
3715 std::map<int, int>::iterator i_fed;
3718 std::ostringstream outs;
3721 *
txtfile <<
"<html><head></head> <body>" << std::endl;
3722 for (i_fed =
fedMap.begin(); i_fed !=
fedMap.end(); i_fed++) {
3723 if (i_fed->second ==
crate) {
3724 int fedId = i_fed->first;
3725 for (
int nconn = 0; nconn < 96; nconn++) {
3728 if (apvPair !=
nullptr) {
3730 *
txtfile <<
"<a name=" <<
idmod <<
"><pre>" << std::endl;
3732 std::ostringstream outs;
3733 outs <<
"fedchannel " << apvPair->
getFedId() <<
"/" << apvPair->
getFedCh() <<
" connects to module " 3735 *
txtfile <<
"</pre><h3>" << outs.str() <<
"</h3>" << std::endl;
3740 *
txtfile <<
"</body></html>" << std::endl;
3746 std::ostringstream outs1, outs2;
3753 std::map<int, TmCcu *>::iterator i_ccu;
3754 std::multimap<TmCcu *, TmModule *>::iterator
it;
3755 std::pair<std::multimap<TmCcu *, TmModule *>::iterator, std::multimap<TmCcu *, TmModule *>::iterator>
ret;
3757 std::ostringstream outs;
3760 *
txtfile <<
"<html><head></head> <body>" << std::endl;
3761 for (i_ccu =
ccuMap.begin(); i_ccu !=
ccuMap.end(); i_ccu++) {
3762 TmCcu *ccu = i_ccu->second;
3765 *
txtfile <<
"<a name=" <<
idmod <<
"><pre>" << std::endl;
3767 std::ostringstream outs;
3769 outs <<
"ccu is in position" << ccu->
mpos <<
"in ring but doesn't seem to have any module connected";
3771 outs <<
"ccu is in position " << ccu->
mpos <<
" in ring and connects " << ccu->
nmod <<
" modules" 3775 outs << (*it).second->idex <<
" " << (*it).second->name <<
" value= " << (*it).second->value <<
"\n\n";
3778 *
txtfile <<
"</pre><h4>" << outs.str() <<
"</h4>" << std::endl;
3782 *
txtfile <<
"</body></html>" << std::endl;
3788 std::ostringstream outs3, outs4;
3797 std::map<int, TmPsu *>::iterator ipsu;
3798 std::multimap<TmPsu *, TmModule *>::iterator
it;
3799 std::pair<std::multimap<TmPsu *, TmModule *>::iterator, std::multimap<TmPsu *, TmModule *>::iterator>
ret;
3800 for (
int rack = 1; rack < (
npsuracks + 1); rack++) {
3801 std::ostringstream outs;
3805 *
txtfile <<
"<html><head></head> <body>" << std::endl;
3806 for (ipsu =
psuMap.begin(); ipsu !=
psuMap.end(); ipsu++) {
3807 TmPsu *psu = ipsu->second;
3808 if (psu !=
nullptr && psu->
getPsuRack() == rack) {
3809 *
txtfile <<
"<a name=" << psu->
idex <<
"><pre>" << std::endl;
3811 std::ostringstream outs;
3814 <<
"in crate but doesn't seem to have any module connected";
3816 outs <<
"PS is in position " << psu->
getPsuBoard() <<
" in crate and connects to " << psu->
nmod 3817 <<
" modules. " << std::endl;
3821 outs << (*it).second->idex <<
" " << (*it).second->name <<
" value= " << (*it).second->value <<
" <br>" 3824 *
txtfile <<
"</pre><h4>" << outs.str() <<
"</h4>" << std::endl;
3828 *
txtfile <<
"</body></html>" << std::endl;
3835 std::ostringstream outs5, outs6;
3844 std::map<int, TmPsu *>::iterator ipsu;
3845 std::multimap<TmPsu *, TmModule *>::iterator
it;
3846 std::pair<std::multimap<TmPsu *, TmModule *>::iterator, std::multimap<TmPsu *, TmModule *>::iterator>
ret;
3847 for (
int rack = 1; rack < (
npsuracks + 1); rack++) {
3848 std::ostringstream outs;
3852 *
txtfile <<
"<html><head></head> <body>" << std::endl;
3853 for (ipsu =
psuMap.begin(); ipsu !=
psuMap.end(); ipsu++) {
3854 TmPsu *psu = ipsu->second;
3855 if (psu !=
nullptr && psu->
getPsuRack() == rack) {
3856 *
txtfile <<
"<a name=" << psu->
idex <<
"><pre>" << std::endl;
3858 std::ostringstream outsHV2;
3860 outsHV2 <<
"HV Channel002 is in position" << psu->
getPsuBoard()
3861 <<
"in crate but doesn't seem to have any module connected";
3863 outsHV2 <<
"HV Channel002 is in position " << psu->
getPsuBoard() <<
" in crate and connects to " 3864 << psu->
nmodHV2 <<
" modules. " 3865 <<
" <br>" << std::endl;
3869 if ((*it).second->HVchannel == 2) {
3870 outsHV2 << (*it).second->idex <<
" " << (*it).second->name <<
" value= " << (*it).second->value
3871 <<
" <br>" << std::endl;
3874 *
txtfile <<
"</pre><h4>" << outsHV2.str() <<
"</h4>" << std::endl;
3878 std::ostringstream outsHV3;
3880 outsHV3 <<
"HV Channel003 is in position" << psu->
getPsuBoard()
3881 <<
"in crate but doesn't seem to have any module connected";
3883 outsHV3 <<
"HV Channel003 is in position " << psu->
getPsuBoard() <<
" in crate and connects to " 3884 << psu->
nmodHV3 <<
" modules. " 3885 <<
" <br>" << std::endl;
3889 if ((*it).second->HVchannel == 3) {
3890 outsHV3 << (*it).second->idex <<
" " << (*it).second->name <<
" value= " << (*it).second->value
3891 <<
" <br>" << std::endl;
3894 *
txtfile <<
"</pre><h4>" << outsHV3.str() <<
"</h4>" << std::endl;
3898 *
txtfile <<
"</body></html>" << std::endl;
3906 float minval, maxval;
3909 if (
tkMapLog && (minval < maxval)) {
3910 minval =
pow(10., minval1);
3911 maxval =
pow(10., maxval1);
3923 std::ofstream *ofilename;
3924 std::ifstream *ifilename;
3925 std::ostringstream
ofname;
3930 ifilename =
findfile(
"viewerHeader.xhtml");
3933 while (getline(*ifilename,
line)) {
3934 *ofilename <<
line << std::endl;
3936 *ofilename <<
" var tmapname=\"" <<
outputfilename <<
"\"" << std::endl;
3937 *ofilename <<
" var tmaptitle=\"" <<
title <<
"\"" << std::endl;
3938 *ofilename <<
" var ncrates=" <<
ncrates <<
";" << std::endl;
3939 *ofilename <<
" var nfeccrates=" <<
nfeccrates <<
";" << std::endl;
3940 *ofilename <<
" var npsuracks=" <<
npsuracks <<
";" << std::endl;
3943 ifilename =
findfile(
"viewerTrailer.xhtml");
3944 while (getline(*ifilename,
line)) {
3945 *ofilename <<
line << std::endl;
3959 ifilename =
findfile(
"jqviewer.js");
3962 while (getline(*ifilename,
line)) {
3963 *ofilename <<
line << std::endl;
3974 while (getline(*ifilename,
line)) {
3975 *ofilename <<
line << std::endl;
3983 ifilename =
findfile(
"feccrate.js");
3986 while (getline(*ifilename,
line)) {
3987 *ofilename <<
line << std::endl;
3998 while (getline(*ifilename,
line)) {
3999 *ofilename <<
line << std::endl;
4010 while (getline(*ifilename,
line)) {
4011 *ofilename <<
line << std::endl;
4022 while (getline(*ifilename,
line)) {
4023 *ofilename <<
line << std::endl;
4030 command =
"scp -r ../../DQM/TrackerCommon/test/jquery/ .";
4033 command =
"scp -r ../../CommonTools/TrackerMap/data/images/ .";
4038 std::ostringstream outs;
4041 save(
true, minval, maxval, outs.str(), 3000, 1600);
4044 save(
true, minval, maxval,
s,
width, height);
4047 std::ostringstream outs;
4055 std::ostringstream outs;
4058 *
txtfile <<
"<html><head></head> <body>" << std::endl;
4063 if (
mod !=
nullptr && !
mod->notInUse()) {
4065 *
txtfile <<
"<a name=" <<
idmod <<
"><pre>" << std::endl;
4066 std::multimap<const int, TmApvPair *>::iterator
pos;
4069 if (apvpair !=
nullptr) {
4073 *
txtfile <<
"</pre><h3>" <<
mod->name <<
"</h3>" << std::endl;
4077 *
txtfile <<
"</body></html>" << std::endl;
4083 std::ostringstream outs1, outs2;
4093 std::map<int, int>::iterator i_fed;
4096 std::ostringstream outs;
4099 *
txtfile <<
"<html><head></head> <body>" << std::endl;
4100 for (i_fed =
fedMap.begin(); i_fed !=
fedMap.end(); i_fed++) {
4101 if (i_fed->second ==
crate) {
4102 int fedId = i_fed->first;
4103 for (
int nconn = 0; nconn < 96; nconn++) {
4106 if (apvPair !=
nullptr) {
4108 *
txtfile <<
"<a name=" <<
idmod <<
"><pre>" << std::endl;
4110 std::ostringstream outs;
4111 outs <<
"fedchannel " << apvPair->
getFedId() <<
"/" << apvPair->
getFedCh() <<
" connects to module " 4113 *
txtfile <<
"</pre><h3>" << outs.str() <<
"</h3>" << std::endl;
4118 *
txtfile <<
"</body></html>" << std::endl;
4125 std::ostringstream outs1, outs2;
4136 std::map<int, TmCcu *>::iterator i_ccu;
4137 std::multimap<TmCcu *, TmModule *>::iterator
it;
4138 std::pair<std::multimap<TmCcu *, TmModule *>::iterator, std::multimap<TmCcu *, TmModule *>::iterator>
ret;
4140 std::ostringstream outs;
4143 *
txtfile <<
"<html><head></head> <body>" << std::endl;
4144 for (i_ccu =
ccuMap.begin(); i_ccu !=
ccuMap.end(); i_ccu++) {
4145 TmCcu *ccu = i_ccu->second;
4148 *
txtfile <<
"<a name=" <<
idmod <<
"><pre>" << std::endl;
4150 std::ostringstream outs;
4152 outs <<
"ccu is in position" << ccu->
mpos <<
"in ring but doesn't seem to have any module connected";
4154 outs <<
"ccu is in position " << ccu->
mpos <<
" in ring and connects " << ccu->
nmod <<
" modules" 4158 outs << (*it).second->idex <<
" " << (*it).second->name <<
" value= " << (*it).second->value <<
"\n\n";
4161 *
txtfile <<
"</pre><h4>" << outs.str() <<
"</h4>" << std::endl;
4165 *
txtfile <<
"</body></html>" << std::endl;
4171 std::ostringstream outs3, outs4;
4183 std::map<int, TmPsu *>::iterator ipsu;
4184 std::multimap<TmPsu *, TmModule *>::iterator
it;
4185 std::pair<std::multimap<TmPsu *, TmModule *>::iterator, std::multimap<TmPsu *, TmModule *>::iterator>
ret;
4186 for (
int rack = 1; rack < (
npsuracks + 1); rack++) {
4187 std::ostringstream outs;
4191 *
txtfile <<
"<html><head></head> <body>" << std::endl;
4192 for (ipsu =
psuMap.begin(); ipsu !=
psuMap.end(); ipsu++) {
4193 TmPsu *psu = ipsu->second;
4194 if (psu !=
nullptr && psu->
getPsuRack() == rack) {
4195 *
txtfile <<
"<a name=" << psu->
idex <<
"><pre>" << std::endl;
4197 std::ostringstream outs;
4200 <<
"in crate but doesn't seem to have any module connected";
4202 outs <<
"PS is in position " << psu->
getPsuBoard() <<
" in crate and connects to " << psu->
nmod 4203 <<
" modules. " << std::endl;
4207 outs << (*it).second->idex <<
" " << (*it).second->name <<
" value= " << (*it).second->value <<
" <br>" 4210 *
txtfile <<
"</pre><h4>" << outs.str() <<
"</h4>" << std::endl;
4214 *
txtfile <<
"</body></html>" << std::endl;
4221 std::ostringstream outs5, outs6;
4233 std::map<int, TmPsu *>::iterator ipsu;
4234 std::multimap<TmPsu *, TmModule *>::iterator
it;
4235 std::pair<std::multimap<TmPsu *, TmModule *>::iterator, std::multimap<TmPsu *, TmModule *>::iterator>
ret;
4236 for (
int rack = 1; rack < (
npsuracks + 1); rack++) {
4237 std::ostringstream outs;
4241 *
txtfile <<
"<html><head></head> <body>" << std::endl;
4242 for (ipsu =
psuMap.begin(); ipsu !=
psuMap.end(); ipsu++) {
4243 TmPsu *psu = ipsu->second;
4244 if (psu !=
nullptr && psu->
getPsuRack() == rack) {
4245 *
txtfile <<
"<a name=" << psu->
idex <<
"><pre>" << std::endl;
4247 std::ostringstream outsHV2;
4249 outsHV2 <<
"HV Channel002 is in position" << psu->
getPsuBoard()
4250 <<
"in crate but doesn't seem to have any module connected";
4252 outsHV2 <<
"HV Channel002 is in position " << psu->
getPsuBoard() <<
" in crate and connects to " 4253 << psu->
nmodHV2 <<
" modules. " 4254 <<
" <br>" << std::endl;
4258 if ((*it).second->HVchannel == 2) {
4259 outsHV2 << (*it).second->idex <<
" " << (*it).second->name <<
" value= " << (*it).second->value
4260 <<
" <br>" << std::endl;
4263 *
txtfile <<
"</pre><h4>" << outsHV2.str() <<
"</h4>" << std::endl;
4267 std::ostringstream outsHV3;
4269 outsHV3 <<
"HV Channel003 is in position" << psu->
getPsuBoard()
4270 <<
"in crate but doesn't seem to have any module connected";
4272 outsHV3 <<
"HV Channel003 is in position " << psu->
getPsuBoard() <<
" in crate and connects to " 4273 << psu->
nmodHV3 <<
" modules. " 4274 <<
" <br>" << std::endl;
4278 if ((*it).second->HVchannel == 3) {
4279 outsHV3 << (*it).second->idex <<
" " << (*it).second->name <<
" value= " << (*it).second->value
4280 <<
" <br>" << std::endl;
4283 *
txtfile <<
"</pre><h4>" << outsHV3.str() <<
"</h4>" << std::endl;
4287 *
txtfile <<
"</body></html>" << std::endl;
4295 std::ifstream *ifilename;
4301 ifname =
"CommonTools/TrackerMap/data/" +
filename;
4305 ifname =
"CommonTools/TrackerMap/data/" +
filename;
4321 if (
mod !=
nullptr && !
mod->notInUse()) {
4336 if (
mod !=
nullptr && !
mod->notInUse()) {
4339 if (maxvalue < mod->
value)
4347 std::ostringstream outs;
4350 *
xmlfile <<
"<?xml version=\"1.0\" standalone=\"no\"?>" << std::endl;
4351 *
xmlfile <<
"<svg xmlns=\"http://www.w3.org/2000/svg\"" << std::endl;
4352 *
xmlfile <<
"xmlns:svg=\"http://www.w3.org/2000/svg\"" << std::endl;
4353 *
xmlfile <<
"xmlns:xlink=\"http://www.w3.org/1999/xlink\" >" << std::endl;
4354 *
xmlfile <<
"<script type=\"text/ecmascript\" xlink:href=\"layer.js\" />" << std::endl;
4355 *
xmlfile <<
"<svg id=\"mainMap\" x=\"0\" y=\"0\" viewBox=\"0 0 500 500\" width=\"700\" height=\"700\" " 4356 "onload=\"TrackerLayer.init()\">" 4359 *
xmlfile <<
"<g id=\"layer\" transform=\" translate(0,400) rotate(270) scale(1.,1.)\" > " << std::endl;
4361 *
xmlfile <<
"<g id=\"layer\" transform=\" translate(0,400) rotate(270) scale(1.,0.8)\" > " << std::endl;
4362 *
xmlfile <<
"<rect fill=\"lightblue\" stroke=\"none\" x=\"0\" y=\"0\" width=\"700\" height=\"700\" />" << std::endl;
4363 *
xmlfile <<
"<svg:polygon id=\"fed\" mapAttribute=\"fed\" points=\"250,40 250,10 230,10 230,40\" " 4364 "onclick=\"chooseMap(evt);\" onmouseover=\"chooseMap(evt);\" onmouseout=\"chooseMap(evt);\" " 4365 "fill=\"rgb(0,127,255)\"/>" 4367 *
xmlfile <<
"<svg:polygon id=\"fec\" mapAttribute=\"fec\" points=\"228,40 228,10 208,10 208,40\" " 4368 "onclick=\"chooseMap(evt);\" onmouseover=\"chooseMap(evt);\" onmouseout=\"chooseMap(evt);\" " 4369 "fill=\"rgb(0,127,255)\"/>" 4371 *
xmlfile <<
"<svg:polygon id=\"lv\" mapAttribute=\"lv\" points=\"206,40 206,10 186,10 186,40\" " 4372 "onclick=\"chooseMap(evt);\" onmouseover=\"chooseMap(evt);\" onmouseout=\"chooseMap(evt);\" " 4373 "fill=\"rgb(0,127,255)\"/>" 4375 *
xmlfile <<
"<svg:polygon id=\"hv\" mapAttribute=\"hv\" points=\"184,40 184,10 164,10 164,40\" " 4376 "onclick=\"chooseMap(evt);\" onmouseover=\"chooseMap(evt);\" onmouseout=\"chooseMap(evt);\" " 4377 "fill=\"rgb(0,127,255)\"/>" 4379 *
xmlfile <<
"<svg:polygon id=\"plot\" mapAttribute=\"plot\" points=\"155,45 155,5 135,5 135,45\" " 4380 "onclick=\"chooseMap(evt);\" onmouseover=\"chooseMap(evt);\" onmouseout=\"chooseMap(evt);\" " 4381 "fill=\"rgb(200,0,0)\"/>" 4390 if (
mod !=
nullptr && !
mod->notInUse()) {
4395 *
xmlfile <<
"</g> </svg> <text id=\"currentElementText\" x=\"40\" y=\"30\">" << std::endl;
4396 *
xmlfile <<
"<tspan id=\"line1\" x=\"40\" y=\"30\"> </tspan> " << std::endl;
4397 *
xmlfile <<
"<tspan id=\"line2\" x=\"40\" y=\"60\"> </tspan> " << std::endl;
4398 *
xmlfile <<
"<tspan id=\"line3\" x=\"40\" y=\"90\"> </tspan> " << std::endl;
4399 *
xmlfile <<
"<tspan id=\"line4\" x=\"40\" y=\"120\"> </tspan> " << std::endl;
4401 *
xmlfile <<
"<tspan mapAttribute=\"fed\" onclick=\"chooseMap(evt);\" onmouseover=\"chooseMap(evt);\" " 4402 "onmouseout=\"chooseMap(evt);\" x=\"15\" y=\"228\" font-size=\"12\" font-family=\"arial\" " 4403 "fill=\"white\">FED</tspan> " 4405 *
xmlfile <<
"<tspan mapAttribute=\"fec\" onclick=\"chooseMap(evt);\" onmouseover=\"chooseMap(evt);\" " 4406 "onmouseout=\"chooseMap(evt);\" x=\"15\" y=\"258\" font-size=\"12\" font-family=\"arial\" " 4407 "fill=\"white\">FEC</tspan> " 4409 *
xmlfile <<
"<tspan mapAttribute=\"lv\" onclick=\"chooseMap(evt);\" onmouseover=\"chooseMap(evt);\" " 4410 "onmouseout=\"chooseMap(evt);\" x=\"18\" y=\"289\" font-size=\"12\" font-family=\"arial\" " 4411 "fill=\"white\">LV</tspan> " 4413 *
xmlfile <<
"<tspan mapAttribute=\"hv\" onclick=\"chooseMap(evt);\" onmouseover=\"chooseMap(evt);\" " 4414 "onmouseout=\"chooseMap(evt);\" x=\"18\" y=\"319\" font-size=\"12\" font-family=\"arial\" " 4415 "fill=\"white\">HV</tspan> " 4417 *
xmlfile <<
"<tspan mapAttribute=\"plot\" onclick=\"chooseMap(evt);\" onmouseover=\"chooseMap(evt);\" " 4418 "onmouseout=\"chooseMap(evt);\" x=\"12\" y=\"360\" font-size=\"12\" font-family=\"arial\" " 4419 "fill=\"white\">PLOT</tspan> " 4422 *
xmlfile <<
"<tspan mapAttribute=\"fed\" onclick=\"chooseMap(evt);\" onmouseover=\"chooseMap(evt);\" " 4423 "onmouseout=\"chooseMap(evt);\" x=\"21\" y=\"228\" font-size=\"12\" font-family=\"arial\" " 4424 "fill=\"white\">FED</tspan> " 4426 *
xmlfile <<
"<tspan mapAttribute=\"fec\" onclick=\"chooseMap(evt);\" onmouseover=\"chooseMap(evt);\" " 4427 "onmouseout=\"chooseMap(evt);\" x=\"21\" y=\"258\" font-size=\"12\" font-family=\"arial\" " 4428 "fill=\"white\">FEC</tspan> " 4430 *
xmlfile <<
"<tspan mapAttribute=\"lv\" onclick=\"chooseMap(evt);\" onmouseover=\"chooseMap(evt);\" " 4431 "onmouseout=\"chooseMap(evt);\" x=\"24\" y=\"289\" font-size=\"12\" font-family=\"arial\" " 4432 "fill=\"white\">LV</tspan> " 4434 *
xmlfile <<
"<tspan mapAttribute=\"hv\" onclick=\"chooseMap(evt);\" onmouseover=\"chooseMap(evt);\" " 4435 "onmouseout=\"chooseMap(evt);\" x=\"24\" y=\"319\" font-size=\"12\" font-family=\"arial\" " 4436 "fill=\"white\">HV</tspan> " 4438 *
xmlfile <<
"<tspan mapAttribute=\"plot\" onclick=\"chooseMap(evt);\" onmouseover=\"chooseMap(evt);\" " 4439 "onmouseout=\"chooseMap(evt);\" x=\"17\" y=\"360\" font-size=\"12\" font-family=\"arial\" " 4440 "fill=\"white\">PLOT</tspan> " 4443 *
xmlfile <<
" </text> </svg>" << std::endl;
4457 legInfos_.back()->SetFillColor(kBlue - 9);
4459 legInfos_.back()->SetFillColor(kRed + 2);
4461 legInfos_.back()->SetFillColor(kPink - 9);
4463 legInfos_.back()->SetFillColor(kOrange + 2);
4465 legInfos_.back()->SetFillColor(kYellow);
4467 legInfos_.back()->SetFillColor(kRed + 1);
4469 legInfos_.back()->SetFillColor(kViolet - 5);
4476 "# Clusters & Digis",
4480 TLegend *myL =
new TLegend(0.56, 0.87, 0.95, 0.99);
4481 myL->SetNColumns(2);
4482 myL->SetBorderSize(0);
4483 myL->SetFillColor(38);
std::vector< TPolyLine * > legInfos_
void fill_hv_channel2(int rack, int crate, int board, float qty)
#define NUMFEDCRATE_INCOLUMN
TrackerMap(std::string s=" ", int xsize1=340, int ysize1=200)
double ydpixelc(double y)
std::ifstream * findfile(std::string filename)
#define NUMPSURACK_INCOLUMN
double ydpixelfec(double y)
int getmoduleCount(int subdet, int partdet, int layer, int ring)
void fillc_hv_channel2(int rack, int crate, int board, int red, int green, int blue)
std::ifstream * inputfile
const std::vector< const FedChannelConnection * > & getConnections(uint32_t det_id) const
~TrackerMap()
default destructor
static const uint32_t invalid32_
ret
prodAgent to be discontinued
int module(int fedId, int fedCh)
void defwindow(int num_lay)
Sin< T >::type sin(const T &t)
#define NUMFEDCH_INCOLUMN
void save_as_HVtrackermap(bool print_total=true, float minval=0., float maxval=0., std::string s="psu_svgmap.svg", int width=1500, int height=800)
double xdpixelc(double x)
void defpsuwindow(int num_rack)
int getlayerCount(int subdet, int partdet)
void fill_current_val_fed_channel(int fedId, int fedCh, float current_val)
#define NUMFEDCRATE_INROW
void fillc_fec_channel(int crate, int slot, int ring, int addr, int red, int green, int blue)
double xdpixelfec(double x)
T getUntrackedParameter(std::string const &, T const &) const
double phival(double x, double y)
txtfile
Delete all three files at once to make sure the user never sees stale data (e.g.
void fillc_lv_channel(int rack, int crate, int board, int red, int green, int blue)
std::vector< std::string > legKeys_
void save_as_psutrackermap(bool print_total=true, float minval=0., float maxval=0., std::string s="psu_svgmap.svg", int width=100+(360+100) *5+300, int height=50+(150+50) *6+300)
int getringCount(int subdet, int partdet, int layer)
double xdpixelpsu(double x)
void drawHV3(int rack, int numcrate_inrack, bool print_total, TmPsu *psu, std::ofstream *svgfile, bool usePsuValue)
void save_as_fedtrackermap(bool print_total=true, float minval=0., float maxval=0., std::string s="fed_svgmap.svg", int width=100+(90+100) *31+300, int height=150+(2940+150) *1+300)
void save(bool print_total=true, float minval=0., float maxval=0., std::string s="svgmap.svg", int width=1500, int height=800)
Cos< T >::type cos(const T &t)
void deffecwindow(int num_crate)
void load(std::string s="tmap.svg")
key
prepare the HTCondor submission files and eventually submit them
const std::vector< SiStripFecCrate > & crates() const
void drawModule(TmModule *mod, int key, int layer, bool total, std::ofstream *file)
void drawApvPair(int crate, int numfed_incrate, bool total, TmApvPair *apvPair, std::ofstream *file, bool useApvPairValue)
void fillc_fed_channel(int fedId, int fedCh, int red, int green, int blue)
xmlfile
Make an XML representation of the misalignment.
int getcolor(float value, int palette)
void fillc(int idmod, int RGBcode)
void printlayers(bool print_total=true, float minval=0., float maxval=0., std::string s="layer")
void drawHV2(int rack, int numcrate_inrack, bool print_total, TmPsu *psu, std::ofstream *svgfile, bool usePsuValue)
void drawCcu(int crate, int numfed_incrate, bool total, TmCcu *ccu, std::ofstream *file, bool useCcuValue)
void fill_hv_channel3(int rack, int crate, int board, float qty)
#define NUMPSUCRATE_INCOLUMN
static const uint16_t invalid_
Contains cabling info at the device level, including DetId, APV pair numbers, hardware addresses...
void setRange(float min, float max)
void drawPalette(std::ofstream *file, int xoffset=3660, int yoffset=1540)
int nlayer(int det, int part, int lay)
void print(bool print_total=true, float minval=0., float maxval=0., std::string s="svgmap")
void fill_fec_channel(int crate, int slot, int ring, int addr, float qty)
void fill_current_val(int idmod, float current_val)
void setText(int idmod, std::string s)
static bool isRingStereo(int key)
void defcwindow(int num_crate)
T mod(const T &a, const T &b)
FedsConstIterRange fedIds() const
void fill_lv_channel(int rack, int crate, int board, float qty)
std::vector< TColor * > vc
void printall(bool print_total=true, float minval=0., float maxval=0., std::string s="svgmap", int width=6000, int height=3200)
Power< A, B >::type pow(const A &a, const B &b)
void drawPsu(int rack, int numcrate_inrack, bool print_total, TmPsu *psu, std::ofstream *svgfile, bool usePsuValue)
void fill(int layer, int ring, int nmod, float x)
double ydpixelpsu(double y)
ConnsConstIterRange fedConnections(uint16_t fed_id) const
void save_as_fectrackermap(bool print_total=true, float minval=0., float maxval=0., std::string s="fec_svgmap.svg", int width=1500, int height=800)
void fill_fed_channel(int fedId, int fedCh, float qty)
void fillc_hv_channel3(int rack, int crate, int board, int red, int green, int blue)
std::pair< float, float > getAutomaticRange()