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;
2921 *
savefile <<
"</g> </svg> </svg> " << std::endl;
2925 if (!print_total && !useApvPairValue) {
2927 for (i_apv =
apvMap.begin(); i_apv !=
apvMap.end(); i_apv++) {
2929 if (apvPair !=
nullptr) {
2931 if (apv_mod !=
nullptr && apvPair->
mpos == 0 && !apv_mod->
notInUse()) {
2949 const char *command1;
2953 std::ifstream tempfile(tempfilename.c_str(),
std::ios::in);
2954 TCanvas *MyC =
new TCanvas(
"MyC",
"TrackerMap",
width, height);
2955 gPad->SetFillColor(38);
2958 std::cout <<
" range x " << rangex << std::endl;
2959 std::cout <<
" range y " << rangey << std::endl;
2960 gPad->Range(0, 0, rangex, rangey);
2964 typedef std::map<int, int> ColorList;
2965 ColorList colorList;
2966 ColorList::iterator
pos;
2968 while (!tempfile.eof()) {
2970 colindex =
red + green * 1000 +
blue * 1000000;
2971 pos = colorList.find(colindex);
2972 if (
pos == colorList.end()) {
2973 colorList[colindex] = ncolor + 100;
2974 col = gROOT->GetColor(ncolor + 100);
2976 col->SetRGB((Double_t)(
red / 255.), (Double_t)(green / 255.), (Double_t)(
blue / 255.));
2978 c =
new TColor(ncolor + 100, (Double_t)(
red / 255.), (Double_t)(green / 255.), (Double_t)(
blue / 255.));
2983 tempfile >>
x[
i] >>
y[
i];
2986 if (ncolor > 0 && ncolor < 10000) {
2988 for (
int i = 0;
i < ncolor;
i++) {
2991 gStyle->SetPalette(ncolor,
colors);
2994 tempfile.seekg(0, std::ios::beg);
2995 std::cout <<
"created palette with " << ncolor <<
" colors" << std::endl;
2996 while (!tempfile.eof()) {
2999 tempfile >>
x[
i] >>
y[
i];
3001 colindex =
red + green * 1000 +
blue * 1000000;
3002 pos = colorList.find(colindex);
3003 if (
pos != colorList.end()) {
3004 TPolyLine *pline =
new TPolyLine(
npoints,
y,
x);
3005 vp.push_back(pline);
3006 pline->SetFillColor(colorList[colindex]);
3007 pline->SetLineWidth(0);
3018 axis =
new TGaxis(rangex - 140, 34, rangex - 140, rangey - 106, lminvalue, lmaxvalue, 510,
"+L");
3019 axis->SetLabelSize(0.02);
3025 l.SetTextSize(0.05);
3027 if (
tkMapLog && (fulltitle.find(
"Log10 scale") == std::string::npos))
3028 fulltitle +=
": Log10 scale";
3029 l.DrawLatex(50, rangey - 200, fulltitle.c_str());
3047 std::cout <<
"Executing " << command1 << std::endl;
3053 for (std::vector<TPolyLine *>::iterator pos1 = vp.begin(); pos1 != vp.end(); pos1++) {
3064 int ipos, ipos1, ipos2,
id = 0,
val = 0;
3067 ipos1 =
line.find(
"value=\"");
3070 ipos =
value.find(
'\"');
3074 ipos2 =
line.find(
"detid=\"");
3077 ipos =
value.find(
'\"');
3079 id = atoi(
value.c_str());
3081 if (ipos1 > 0 && ipos2 > 0 &&
val > 0)
3083 if (ipos1 > 0 && ipos2 > 0)
3087 std::cout << nline <<
" modules found in this svg file " << std::endl;
3097 std::ostringstream outs;
3118 if (
mod !=
nullptr && !
mod->notInUse()) {
3133 if (
mod !=
nullptr && !
mod->notInUse()) {
3136 if (maxvalue < mod->
value)
3150 if (
mod !=
nullptr && !
mod->notInUse()) {
3156 *
svgfile <<
"</svg:g></svg:svg>" << std::endl;
3157 *
svgfile <<
" <svg:text id=\"Title\" class=\"normalText\" x=\"300\" y=\"0\">" <<
title <<
"</svg:text>" << std::endl;
3160 *
svgfile <<
"</svg:svg>" << std::endl;
3161 *
svgfile <<
"</body></html>" << std::endl;
3167 std::cout <<
"preparing the palette" << std::endl;
3171 int paletteLength = 250;
3178 for (
int i = 1;
i < paletteLength + 1;
i++) {
3180 red = (color >> 16) & 0xFF;
3181 green = (color >> 8) & 0xFF;
3182 blue = (color) & 0xFF;
3194 *
svgfile <<
"<svg:rect x=\"3610\" y=\"" << (1550 - 6 *
i) <<
"\" width=\"50\" height=\"6\" fill=\"rgb(" <<
red 3195 <<
"," << green <<
"," <<
blue <<
")\" />\n";
3197 *
svgfile << 0 <<
" " << 0 <<
" " <<
red <<
" " << green <<
" " <<
blue <<
" 4 " <<
int(
step *
i) + 34 <<
" " 3205 *
svgfile <<
"<svg:rect x=\"3610\" y=\"" << (1550 - 6 *
i)
3206 <<
"\" width=\"50\" height=\"1\" fill=\"black\" />\n";
3208 *
svgfile <<
" <svg:text class=\"normalText\" x=\"3660\" y=\"" << (1560 - 6 *
i) <<
"\">" <<
val 3209 <<
"</svg:text>" << std::endl;
3219 if (apvpair !=
nullptr) {
3221 apvpair->
green = green;
3225 std::cout <<
"*** error in FedTrackerMap fillc method ***";
3229 std::multimap<const int, TmApvPair *>::iterator
pos;
3232 if (apvpair !=
nullptr) {
3238 std::cout <<
"*** error in FedTrackerMap fill by module method ***";
3245 if (apvpair !=
nullptr) {
3246 apvpair->
value = current_val;
3250 std::cout <<
"*** error in FedTrackerMap fill_current_val method ***";
3258 if (ccu !=
nullptr) {
3264 std::cout <<
"*** error in FecTrackerMap fillc method ***";
3270 if (ccu !=
nullptr) {
3276 std::cout <<
"*** error in FecTrackerMap fill by module method ***";
3280 int key = rack * 1000 +
crate * 100 + board;
3284 if (psu !=
nullptr) {
3290 std::cout <<
"*** error in LVTrackerMap fillc method ***";
3294 int key = rack * 1000 +
crate * 100 + board;
3296 if (psu !=
nullptr) {
3302 std::cout <<
"*** error in LVTrackerMap fill by module method ***";
3306 int key = rack * 1000 +
crate * 100 + board;
3310 if (psu !=
nullptr) {
3316 std::cout <<
"*** error in HVTrackerMap (channel 2) fillc method ***";
3319 int key = rack * 1000 +
crate * 100 + board;
3323 if (psu !=
nullptr) {
3329 std::cout <<
"*** error in HVTrackerMap (channel 3) fillc method ***";
3333 int key = rack * 1000 +
crate * 100 + board;
3335 if (psu !=
nullptr) {
3341 std::cout <<
"*** error in HVTrackerMap fill by module method ***";
3344 int key = rack * 1000 +
crate * 100 + board;
3346 if (psu !=
nullptr) {
3352 std::cout <<
"*** error in HVTrackerMap fill by module method ***";
3358 if (apvpair !=
nullptr) {
3366 if (apvpair !=
nullptr) {
3371 std::cout <<
"*** error inFedTrackerMap fill method ***";
3376 if (
mod !=
nullptr) {
3382 std::cout <<
"**************************error in fill method **************module " <<
idmod << std::endl;
3388 if (
mod !=
nullptr) {
3394 std::cout <<
"**************************error in fill method **************" << std::endl;
3398 std::map<const int, TmModule *>::iterator imod;
3400 fillc(imod->first, 255, 255, 255);
3405 std::map<const int, TmModule *>::iterator imod;
3413 if (
mod !=
nullptr) {
3414 mod->value = current_val;
3418 std::cout <<
"**error in fill_current_val method ***module " <<
idmod << std::endl;
3423 if (
mod !=
nullptr) {
3424 mod->value =
mod->value + qty;
3430 if (mod1 !=
nullptr && mod2 !=
nullptr) {
3438 std::cout <<
"**************************error in fill method **************module " <<
idmod << std::endl;
3444 if (
mod !=
nullptr) {
3445 mod->value =
mod->value + qty;
3448 std::cout <<
"**************************error in SvgModuleMap **************";
3453 if (
mod !=
nullptr) {
3456 std::cout <<
"**************************error in IdModuleMap **************";
3462 if (
mod !=
nullptr) {
3465 std::cout <<
"**************************error in SvgModuleMap **************";
3471 int nmods, pix_sil, fow_bar,
ring, nmod,
layer;
3473 float posx, posy, posz, length,
width,
thickness, widthAtHalfLength;
3474 int old_layer = 0, ntotMod = 0;
3478 infile >> nmods >> pix_sil >> fow_bar >>
layer >>
ring >> nmod >> posx >> posy >> posz >> length >>
width >>
3482 if (old_layer !=
layer) {
3500 mod->length = length;
3503 mod->widthAtHalfLength = widthAtHalfLength;
3513 float lminvalue, lmaxvalue;
3526 float delta = (lmaxvalue - lminvalue);
3527 float x = (
value - lminvalue);
3528 if (
value < lminvalue) {
3533 if (
value > lmaxvalue) {
3538 if (
value >= lminvalue &&
value <= lmaxvalue) {
3542 : (
x > ((3. / 4.) *
delta) ? 255 - 255 / (
delta / 4) * (
x - (3. / 4.) *
delta) : 255));
3544 : (
x > ((1. / 2.) *
delta) ? 0 : 255 - 255 / (
delta / 4) * (
x - (1. / 4.) *
delta)));
3548 green = (
int)((
value - lminvalue) / (lmaxvalue - lminvalue) * 256.);
3553 green = 255 - green;
3556 return (
blue | (green << 8) | (
red << 16));
3560 std::ofstream *ofilename;
3561 std::ifstream *ifilename;
3562 std::ostringstream
ofname;
3567 ifilename =
findfile(
"viewerHeader.xhtml");
3570 while (getline(*ifilename,
line)) {
3571 *ofilename <<
line << std::endl;
3573 *ofilename <<
" var tmapname=\"" <<
outputfilename <<
"\"" << std::endl;
3574 *ofilename <<
" var tmaptitle=\"" <<
title <<
"\"" << std::endl;
3575 *ofilename <<
" var ncrates=" <<
ncrates <<
";" << std::endl;
3576 *ofilename <<
" var nfeccrates=" <<
nfeccrates <<
";" << std::endl;
3577 *ofilename <<
" var npsuracks=" <<
npsuracks <<
";" << std::endl;
3582 ifilename =
findfile(
"viewerTrailer.xhtml");
3583 while (getline(*ifilename,
line)) {
3584 *ofilename <<
line << std::endl;
3598 ifilename =
findfile(
"jqviewer.js");
3601 while (getline(*ifilename,
line)) {
3602 *ofilename <<
line << std::endl;
3613 while (getline(*ifilename,
line)) {
3614 *ofilename <<
line << std::endl;
3622 ifilename =
findfile(
"feccrate.js");
3625 while (getline(*ifilename,
line)) {
3626 *ofilename <<
line << std::endl;
3637 while (getline(*ifilename,
line)) {
3638 *ofilename <<
line << std::endl;
3649 while (getline(*ifilename,
line)) {
3650 *ofilename <<
line << std::endl;
3662 while (getline(*ifilename,
line)) {
3663 *ofilename <<
line << std::endl;
3671 std::ostringstream outs, outs1, outs2;
3680 std::ostringstream outs;
3683 *
txtfile <<
"<html><head></head> <body>" << std::endl;
3688 if (
mod !=
nullptr && !
mod->notInUse()) {
3690 *
txtfile <<
"<a name=" <<
idmod <<
"><pre>" << std::endl;
3691 std::multimap<const int, TmApvPair *>::iterator
pos;
3694 if (apvpair !=
nullptr) {
3698 *
txtfile <<
"</pre><h3>" <<
mod->name <<
"</h3>" << std::endl;
3702 *
txtfile <<
"</body></html>" << std::endl;
3712 std::map<int, int>::iterator i_fed;
3715 std::ostringstream outs;
3718 *
txtfile <<
"<html><head></head> <body>" << std::endl;
3719 for (i_fed =
fedMap.begin(); i_fed !=
fedMap.end(); i_fed++) {
3720 if (i_fed->second ==
crate) {
3721 int fedId = i_fed->first;
3722 for (
int nconn = 0; nconn < 96; nconn++) {
3725 if (apvPair !=
nullptr) {
3727 *
txtfile <<
"<a name=" <<
idmod <<
"><pre>" << std::endl;
3729 std::ostringstream outs;
3730 outs <<
"fedchannel " << apvPair->
getFedId() <<
"/" << apvPair->
getFedCh() <<
" connects to module " 3732 *
txtfile <<
"</pre><h3>" << outs.str() <<
"</h3>" << std::endl;
3737 *
txtfile <<
"</body></html>" << std::endl;
3743 std::ostringstream outs1, outs2;
3750 std::map<int, TmCcu *>::iterator i_ccu;
3751 std::multimap<TmCcu *, TmModule *>::iterator
it;
3752 std::pair<std::multimap<TmCcu *, TmModule *>::iterator, std::multimap<TmCcu *, TmModule *>::iterator>
ret;
3754 std::ostringstream outs;
3757 *
txtfile <<
"<html><head></head> <body>" << std::endl;
3758 for (i_ccu =
ccuMap.begin(); i_ccu !=
ccuMap.end(); i_ccu++) {
3759 TmCcu *ccu = i_ccu->second;
3762 *
txtfile <<
"<a name=" <<
idmod <<
"><pre>" << std::endl;
3764 std::ostringstream outs;
3766 outs <<
"ccu is in position" << ccu->
mpos <<
"in ring but doesn't seem to have any module connected";
3768 outs <<
"ccu is in position " << ccu->
mpos <<
" in ring and connects " << ccu->
nmod <<
" modules" 3772 outs << (*it).second->idex <<
" " << (*it).second->name <<
" value= " << (*it).second->value <<
"\n\n";
3775 *
txtfile <<
"</pre><h4>" << outs.str() <<
"</h4>" << std::endl;
3779 *
txtfile <<
"</body></html>" << std::endl;
3785 std::ostringstream outs3, outs4;
3794 std::map<int, TmPsu *>::iterator ipsu;
3795 std::multimap<TmPsu *, TmModule *>::iterator
it;
3796 std::pair<std::multimap<TmPsu *, TmModule *>::iterator, std::multimap<TmPsu *, TmModule *>::iterator>
ret;
3797 for (
int rack = 1; rack < (
npsuracks + 1); rack++) {
3798 std::ostringstream outs;
3802 *
txtfile <<
"<html><head></head> <body>" << std::endl;
3803 for (ipsu =
psuMap.begin(); ipsu !=
psuMap.end(); ipsu++) {
3804 TmPsu *psu = ipsu->second;
3805 if (psu !=
nullptr && psu->
getPsuRack() == rack) {
3806 *
txtfile <<
"<a name=" << psu->
idex <<
"><pre>" << std::endl;
3808 std::ostringstream outs;
3811 <<
"in crate but doesn't seem to have any module connected";
3813 outs <<
"PS is in position " << psu->
getPsuBoard() <<
" in crate and connects to " << psu->
nmod 3814 <<
" modules. " << std::endl;
3818 outs << (*it).second->idex <<
" " << (*it).second->name <<
" value= " << (*it).second->value <<
" <br>" 3821 *
txtfile <<
"</pre><h4>" << outs.str() <<
"</h4>" << std::endl;
3825 *
txtfile <<
"</body></html>" << std::endl;
3832 std::ostringstream outs5, outs6;
3841 std::map<int, TmPsu *>::iterator ipsu;
3842 std::multimap<TmPsu *, TmModule *>::iterator
it;
3843 std::pair<std::multimap<TmPsu *, TmModule *>::iterator, std::multimap<TmPsu *, TmModule *>::iterator>
ret;
3844 for (
int rack = 1; rack < (
npsuracks + 1); rack++) {
3845 std::ostringstream outs;
3849 *
txtfile <<
"<html><head></head> <body>" << std::endl;
3850 for (ipsu =
psuMap.begin(); ipsu !=
psuMap.end(); ipsu++) {
3851 TmPsu *psu = ipsu->second;
3852 if (psu !=
nullptr && psu->
getPsuRack() == rack) {
3853 *
txtfile <<
"<a name=" << psu->
idex <<
"><pre>" << std::endl;
3855 std::ostringstream outsHV2;
3857 outsHV2 <<
"HV Channel002 is in position" << psu->
getPsuBoard()
3858 <<
"in crate but doesn't seem to have any module connected";
3860 outsHV2 <<
"HV Channel002 is in position " << psu->
getPsuBoard() <<
" in crate and connects to " 3861 << psu->
nmodHV2 <<
" modules. " 3862 <<
" <br>" << std::endl;
3866 if ((*it).second->HVchannel == 2) {
3867 outsHV2 << (*it).second->idex <<
" " << (*it).second->name <<
" value= " << (*it).second->value
3868 <<
" <br>" << std::endl;
3871 *
txtfile <<
"</pre><h4>" << outsHV2.str() <<
"</h4>" << std::endl;
3875 std::ostringstream outsHV3;
3877 outsHV3 <<
"HV Channel003 is in position" << psu->
getPsuBoard()
3878 <<
"in crate but doesn't seem to have any module connected";
3880 outsHV3 <<
"HV Channel003 is in position " << psu->
getPsuBoard() <<
" in crate and connects to " 3881 << psu->
nmodHV3 <<
" modules. " 3882 <<
" <br>" << std::endl;
3886 if ((*it).second->HVchannel == 3) {
3887 outsHV3 << (*it).second->idex <<
" " << (*it).second->name <<
" value= " << (*it).second->value
3888 <<
" <br>" << std::endl;
3891 *
txtfile <<
"</pre><h4>" << outsHV3.str() <<
"</h4>" << std::endl;
3895 *
txtfile <<
"</body></html>" << std::endl;
3903 float minval, maxval;
3906 if (
tkMapLog && (minval < maxval)) {
3907 minval =
pow(10., minval1);
3908 maxval =
pow(10., maxval1);
3920 std::ofstream *ofilename;
3921 std::ifstream *ifilename;
3922 std::ostringstream
ofname;
3927 ifilename =
findfile(
"viewerHeader.xhtml");
3930 while (getline(*ifilename,
line)) {
3931 *ofilename <<
line << std::endl;
3933 *ofilename <<
" var tmapname=\"" <<
outputfilename <<
"\"" << std::endl;
3934 *ofilename <<
" var tmaptitle=\"" <<
title <<
"\"" << std::endl;
3935 *ofilename <<
" var ncrates=" <<
ncrates <<
";" << std::endl;
3936 *ofilename <<
" var nfeccrates=" <<
nfeccrates <<
";" << std::endl;
3937 *ofilename <<
" var npsuracks=" <<
npsuracks <<
";" << std::endl;
3940 ifilename =
findfile(
"viewerTrailer.xhtml");
3941 while (getline(*ifilename,
line)) {
3942 *ofilename <<
line << std::endl;
3956 ifilename =
findfile(
"jqviewer.js");
3959 while (getline(*ifilename,
line)) {
3960 *ofilename <<
line << std::endl;
3971 while (getline(*ifilename,
line)) {
3972 *ofilename <<
line << std::endl;
3980 ifilename =
findfile(
"feccrate.js");
3983 while (getline(*ifilename,
line)) {
3984 *ofilename <<
line << std::endl;
3995 while (getline(*ifilename,
line)) {
3996 *ofilename <<
line << std::endl;
4007 while (getline(*ifilename,
line)) {
4008 *ofilename <<
line << std::endl;
4019 while (getline(*ifilename,
line)) {
4020 *ofilename <<
line << std::endl;
4027 command =
"scp -r ../../DQM/TrackerCommon/test/jquery/ .";
4030 command =
"scp -r ../../CommonTools/TrackerMap/data/images/ .";
4035 std::ostringstream outs;
4038 save(
true, minval, maxval, outs.str(), 3000, 1600);
4041 save(
true, minval, maxval,
s,
width, height);
4044 std::ostringstream outs;
4052 std::ostringstream outs;
4055 *
txtfile <<
"<html><head></head> <body>" << std::endl;
4060 if (
mod !=
nullptr && !
mod->notInUse()) {
4062 *
txtfile <<
"<a name=" <<
idmod <<
"><pre>" << std::endl;
4063 std::multimap<const int, TmApvPair *>::iterator
pos;
4066 if (apvpair !=
nullptr) {
4070 *
txtfile <<
"</pre><h3>" <<
mod->name <<
"</h3>" << std::endl;
4074 *
txtfile <<
"</body></html>" << std::endl;
4080 std::ostringstream outs1, outs2;
4090 std::map<int, int>::iterator i_fed;
4093 std::ostringstream outs;
4096 *
txtfile <<
"<html><head></head> <body>" << std::endl;
4097 for (i_fed =
fedMap.begin(); i_fed !=
fedMap.end(); i_fed++) {
4098 if (i_fed->second ==
crate) {
4099 int fedId = i_fed->first;
4100 for (
int nconn = 0; nconn < 96; nconn++) {
4103 if (apvPair !=
nullptr) {
4105 *
txtfile <<
"<a name=" <<
idmod <<
"><pre>" << std::endl;
4107 std::ostringstream outs;
4108 outs <<
"fedchannel " << apvPair->
getFedId() <<
"/" << apvPair->
getFedCh() <<
" connects to module " 4110 *
txtfile <<
"</pre><h3>" << outs.str() <<
"</h3>" << std::endl;
4115 *
txtfile <<
"</body></html>" << std::endl;
4122 std::ostringstream outs1, outs2;
4133 std::map<int, TmCcu *>::iterator i_ccu;
4134 std::multimap<TmCcu *, TmModule *>::iterator
it;
4135 std::pair<std::multimap<TmCcu *, TmModule *>::iterator, std::multimap<TmCcu *, TmModule *>::iterator>
ret;
4137 std::ostringstream outs;
4140 *
txtfile <<
"<html><head></head> <body>" << std::endl;
4141 for (i_ccu =
ccuMap.begin(); i_ccu !=
ccuMap.end(); i_ccu++) {
4142 TmCcu *ccu = i_ccu->second;
4145 *
txtfile <<
"<a name=" <<
idmod <<
"><pre>" << std::endl;
4147 std::ostringstream outs;
4149 outs <<
"ccu is in position" << ccu->
mpos <<
"in ring but doesn't seem to have any module connected";
4151 outs <<
"ccu is in position " << ccu->
mpos <<
" in ring and connects " << ccu->
nmod <<
" modules" 4155 outs << (*it).second->idex <<
" " << (*it).second->name <<
" value= " << (*it).second->value <<
"\n\n";
4158 *
txtfile <<
"</pre><h4>" << outs.str() <<
"</h4>" << std::endl;
4162 *
txtfile <<
"</body></html>" << std::endl;
4168 std::ostringstream outs3, outs4;
4180 std::map<int, TmPsu *>::iterator ipsu;
4181 std::multimap<TmPsu *, TmModule *>::iterator
it;
4182 std::pair<std::multimap<TmPsu *, TmModule *>::iterator, std::multimap<TmPsu *, TmModule *>::iterator>
ret;
4183 for (
int rack = 1; rack < (
npsuracks + 1); rack++) {
4184 std::ostringstream outs;
4188 *
txtfile <<
"<html><head></head> <body>" << std::endl;
4189 for (ipsu =
psuMap.begin(); ipsu !=
psuMap.end(); ipsu++) {
4190 TmPsu *psu = ipsu->second;
4191 if (psu !=
nullptr && psu->
getPsuRack() == rack) {
4192 *
txtfile <<
"<a name=" << psu->
idex <<
"><pre>" << std::endl;
4194 std::ostringstream outs;
4197 <<
"in crate but doesn't seem to have any module connected";
4199 outs <<
"PS is in position " << psu->
getPsuBoard() <<
" in crate and connects to " << psu->
nmod 4200 <<
" modules. " << std::endl;
4204 outs << (*it).second->idex <<
" " << (*it).second->name <<
" value= " << (*it).second->value <<
" <br>" 4207 *
txtfile <<
"</pre><h4>" << outs.str() <<
"</h4>" << std::endl;
4211 *
txtfile <<
"</body></html>" << std::endl;
4218 std::ostringstream outs5, outs6;
4230 std::map<int, TmPsu *>::iterator ipsu;
4231 std::multimap<TmPsu *, TmModule *>::iterator
it;
4232 std::pair<std::multimap<TmPsu *, TmModule *>::iterator, std::multimap<TmPsu *, TmModule *>::iterator>
ret;
4233 for (
int rack = 1; rack < (
npsuracks + 1); rack++) {
4234 std::ostringstream outs;
4238 *
txtfile <<
"<html><head></head> <body>" << std::endl;
4239 for (ipsu =
psuMap.begin(); ipsu !=
psuMap.end(); ipsu++) {
4240 TmPsu *psu = ipsu->second;
4241 if (psu !=
nullptr && psu->
getPsuRack() == rack) {
4242 *
txtfile <<
"<a name=" << psu->
idex <<
"><pre>" << std::endl;
4244 std::ostringstream outsHV2;
4246 outsHV2 <<
"HV Channel002 is in position" << psu->
getPsuBoard()
4247 <<
"in crate but doesn't seem to have any module connected";
4249 outsHV2 <<
"HV Channel002 is in position " << psu->
getPsuBoard() <<
" in crate and connects to " 4250 << psu->
nmodHV2 <<
" modules. " 4251 <<
" <br>" << std::endl;
4255 if ((*it).second->HVchannel == 2) {
4256 outsHV2 << (*it).second->idex <<
" " << (*it).second->name <<
" value= " << (*it).second->value
4257 <<
" <br>" << std::endl;
4260 *
txtfile <<
"</pre><h4>" << outsHV2.str() <<
"</h4>" << std::endl;
4264 std::ostringstream outsHV3;
4266 outsHV3 <<
"HV Channel003 is in position" << psu->
getPsuBoard()
4267 <<
"in crate but doesn't seem to have any module connected";
4269 outsHV3 <<
"HV Channel003 is in position " << psu->
getPsuBoard() <<
" in crate and connects to " 4270 << psu->
nmodHV3 <<
" modules. " 4271 <<
" <br>" << std::endl;
4275 if ((*it).second->HVchannel == 3) {
4276 outsHV3 << (*it).second->idex <<
" " << (*it).second->name <<
" value= " << (*it).second->value
4277 <<
" <br>" << std::endl;
4280 *
txtfile <<
"</pre><h4>" << outsHV3.str() <<
"</h4>" << std::endl;
4284 *
txtfile <<
"</body></html>" << std::endl;
4292 std::ifstream *ifilename;
4298 ifname =
"CommonTools/TrackerMap/data/" +
filename;
4302 ifname =
"CommonTools/TrackerMap/data/" +
filename;
4318 if (
mod !=
nullptr && !
mod->notInUse()) {
4333 if (
mod !=
nullptr && !
mod->notInUse()) {
4336 if (maxvalue < mod->
value)
4344 std::ostringstream outs;
4347 *
xmlfile <<
"<?xml version=\"1.0\" standalone=\"no\"?>" << std::endl;
4348 *
xmlfile <<
"<svg xmlns=\"http://www.w3.org/2000/svg\"" << std::endl;
4349 *
xmlfile <<
"xmlns:svg=\"http://www.w3.org/2000/svg\"" << std::endl;
4350 *
xmlfile <<
"xmlns:xlink=\"http://www.w3.org/1999/xlink\" >" << std::endl;
4351 *
xmlfile <<
"<script type=\"text/ecmascript\" xlink:href=\"layer.js\" />" << std::endl;
4352 *
xmlfile <<
"<svg id=\"mainMap\" x=\"0\" y=\"0\" viewBox=\"0 0 500 500\" width=\"700\" height=\"700\" " 4353 "onload=\"TrackerLayer.init()\">" 4356 *
xmlfile <<
"<g id=\"layer\" transform=\" translate(0,400) rotate(270) scale(1.,1.)\" > " << std::endl;
4358 *
xmlfile <<
"<g id=\"layer\" transform=\" translate(0,400) rotate(270) scale(1.,0.8)\" > " << std::endl;
4359 *
xmlfile <<
"<rect fill=\"lightblue\" stroke=\"none\" x=\"0\" y=\"0\" width=\"700\" height=\"700\" />" << std::endl;
4360 *
xmlfile <<
"<svg:polygon id=\"fed\" mapAttribute=\"fed\" points=\"250,40 250,10 230,10 230,40\" " 4361 "onclick=\"chooseMap(evt);\" onmouseover=\"chooseMap(evt);\" onmouseout=\"chooseMap(evt);\" " 4362 "fill=\"rgb(0,127,255)\"/>" 4364 *
xmlfile <<
"<svg:polygon id=\"fec\" mapAttribute=\"fec\" points=\"228,40 228,10 208,10 208,40\" " 4365 "onclick=\"chooseMap(evt);\" onmouseover=\"chooseMap(evt);\" onmouseout=\"chooseMap(evt);\" " 4366 "fill=\"rgb(0,127,255)\"/>" 4368 *
xmlfile <<
"<svg:polygon id=\"lv\" mapAttribute=\"lv\" points=\"206,40 206,10 186,10 186,40\" " 4369 "onclick=\"chooseMap(evt);\" onmouseover=\"chooseMap(evt);\" onmouseout=\"chooseMap(evt);\" " 4370 "fill=\"rgb(0,127,255)\"/>" 4372 *
xmlfile <<
"<svg:polygon id=\"hv\" mapAttribute=\"hv\" points=\"184,40 184,10 164,10 164,40\" " 4373 "onclick=\"chooseMap(evt);\" onmouseover=\"chooseMap(evt);\" onmouseout=\"chooseMap(evt);\" " 4374 "fill=\"rgb(0,127,255)\"/>" 4376 *
xmlfile <<
"<svg:polygon id=\"plot\" mapAttribute=\"plot\" points=\"155,45 155,5 135,5 135,45\" " 4377 "onclick=\"chooseMap(evt);\" onmouseover=\"chooseMap(evt);\" onmouseout=\"chooseMap(evt);\" " 4378 "fill=\"rgb(200,0,0)\"/>" 4387 if (
mod !=
nullptr && !
mod->notInUse()) {
4392 *
xmlfile <<
"</g> </svg> <text id=\"currentElementText\" x=\"40\" y=\"30\">" << std::endl;
4393 *
xmlfile <<
"<tspan id=\"line1\" x=\"40\" y=\"30\"> </tspan> " << std::endl;
4394 *
xmlfile <<
"<tspan id=\"line2\" x=\"40\" y=\"60\"> </tspan> " << std::endl;
4395 *
xmlfile <<
"<tspan id=\"line3\" x=\"40\" y=\"90\"> </tspan> " << std::endl;
4396 *
xmlfile <<
"<tspan id=\"line4\" x=\"40\" y=\"120\"> </tspan> " << std::endl;
4398 *
xmlfile <<
"<tspan mapAttribute=\"fed\" onclick=\"chooseMap(evt);\" onmouseover=\"chooseMap(evt);\" " 4399 "onmouseout=\"chooseMap(evt);\" x=\"15\" y=\"228\" font-size=\"12\" font-family=\"arial\" " 4400 "fill=\"white\">FED</tspan> " 4402 *
xmlfile <<
"<tspan mapAttribute=\"fec\" onclick=\"chooseMap(evt);\" onmouseover=\"chooseMap(evt);\" " 4403 "onmouseout=\"chooseMap(evt);\" x=\"15\" y=\"258\" font-size=\"12\" font-family=\"arial\" " 4404 "fill=\"white\">FEC</tspan> " 4406 *
xmlfile <<
"<tspan mapAttribute=\"lv\" onclick=\"chooseMap(evt);\" onmouseover=\"chooseMap(evt);\" " 4407 "onmouseout=\"chooseMap(evt);\" x=\"18\" y=\"289\" font-size=\"12\" font-family=\"arial\" " 4408 "fill=\"white\">LV</tspan> " 4410 *
xmlfile <<
"<tspan mapAttribute=\"hv\" onclick=\"chooseMap(evt);\" onmouseover=\"chooseMap(evt);\" " 4411 "onmouseout=\"chooseMap(evt);\" x=\"18\" y=\"319\" font-size=\"12\" font-family=\"arial\" " 4412 "fill=\"white\">HV</tspan> " 4414 *
xmlfile <<
"<tspan mapAttribute=\"plot\" onclick=\"chooseMap(evt);\" onmouseover=\"chooseMap(evt);\" " 4415 "onmouseout=\"chooseMap(evt);\" x=\"12\" y=\"360\" font-size=\"12\" font-family=\"arial\" " 4416 "fill=\"white\">PLOT</tspan> " 4419 *
xmlfile <<
"<tspan mapAttribute=\"fed\" onclick=\"chooseMap(evt);\" onmouseover=\"chooseMap(evt);\" " 4420 "onmouseout=\"chooseMap(evt);\" x=\"21\" y=\"228\" font-size=\"12\" font-family=\"arial\" " 4421 "fill=\"white\">FED</tspan> " 4423 *
xmlfile <<
"<tspan mapAttribute=\"fec\" onclick=\"chooseMap(evt);\" onmouseover=\"chooseMap(evt);\" " 4424 "onmouseout=\"chooseMap(evt);\" x=\"21\" y=\"258\" font-size=\"12\" font-family=\"arial\" " 4425 "fill=\"white\">FEC</tspan> " 4427 *
xmlfile <<
"<tspan mapAttribute=\"lv\" onclick=\"chooseMap(evt);\" onmouseover=\"chooseMap(evt);\" " 4428 "onmouseout=\"chooseMap(evt);\" x=\"24\" y=\"289\" font-size=\"12\" font-family=\"arial\" " 4429 "fill=\"white\">LV</tspan> " 4431 *
xmlfile <<
"<tspan mapAttribute=\"hv\" onclick=\"chooseMap(evt);\" onmouseover=\"chooseMap(evt);\" " 4432 "onmouseout=\"chooseMap(evt);\" x=\"24\" y=\"319\" font-size=\"12\" font-family=\"arial\" " 4433 "fill=\"white\">HV</tspan> " 4435 *
xmlfile <<
"<tspan mapAttribute=\"plot\" onclick=\"chooseMap(evt);\" onmouseover=\"chooseMap(evt);\" " 4436 "onmouseout=\"chooseMap(evt);\" x=\"17\" y=\"360\" font-size=\"12\" font-family=\"arial\" " 4437 "fill=\"white\">PLOT</tspan> " 4440 *
xmlfile <<
" </text> </svg>" << std::endl;
4454 legInfos_.back()->SetFillColor(kBlue - 9);
4456 legInfos_.back()->SetFillColor(kRed + 2);
4458 legInfos_.back()->SetFillColor(kPink - 9);
4460 legInfos_.back()->SetFillColor(kOrange + 2);
4462 legInfos_.back()->SetFillColor(kYellow);
4464 legInfos_.back()->SetFillColor(kRed + 1);
4466 legInfos_.back()->SetFillColor(kViolet - 5);
4473 "# Clusters & Digis",
4477 TLegend *myL =
new TLegend(0.56, 0.87, 0.95, 0.99);
4478 myL->SetNColumns(2);
4479 myL->SetBorderSize(0);
4480 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()