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);
174 int key = crate * 10000000 + slot * 100000 +
ring * 1000 +
addr;
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 234 for (it =
ret.first; it !=
ret.second; ++it) {
235 outs << (*it).second->idex <<
" ";
236 outs1 << (*it).second->getKey() <<
",";
239 ccu->
text = outs.str();
240 ccu->
cmodid = outs1.str();
257 int nmod, nmodHV2, nmodHV3;
259 int dcs,
branch, crate, board;
265 int rack_order[54] = {0, 1, 0, 2, 0, 3, 0, 4, 0, 5, 6, 0, 7, 8, 0, 9, 10, 0,
266 11, 12, 0, 13, 14, 0, 15, 0, 0, 0, 0, 0, 0, 16, 0, 17, 18, 0,
267 19, 20, 0, 21, 0, 22, 0, 23, 0, 24, 25, 0, 26, 27, 0, 28, 0, 29};
295 while (!LVfile.eof()) {
296 LVfile >> modId1 >> dcuId >> psIdinfo >> psinfo;
308 dcs = atoi(dcsinfo.c_str());
309 branch = atoi(branchinfo.c_str());
310 crate = atoi(crateinfo.c_str()) + 1;
311 board = atoi(boardinfo.c_str()) + 1;
312 rack = (
branch + 1) + (dcs - 1) * 6;
313 rack = rack_order[rack];
314 channel = atoi(channelinfo.c_str());
316 int key = rack * 1000 + crate * 100 + board;
320 if (psu ==
nullptr) {
323 psu->
psId = psIdinfo;
327 if (imod !=
nullptr) {
328 imod->
PsuId = psIdinfo;
335 std::map<int, TmPsu *>::iterator ipsu;
336 std::multimap<TmPsu *, TmModule *>::iterator it;
337 std::pair<std::multimap<TmPsu *, TmModule *>::iterator, std::multimap<TmPsu *, TmModule *>::iterator>
ret;
340 for (ipsu =
psuMap.begin(); ipsu !=
psuMap.end(); ipsu++) {
341 TmPsu *psu = ipsu->second;
344 if (psu !=
nullptr) {
345 std::ostringstream outs;
346 std::ostringstream outs1;
348 std::ostringstream outs3;
349 std::ostringstream outs4;
351 std::ostringstream outs5;
352 std::ostringstream outs6;
354 outs <<
"PSU " << psu->
psId <<
" connected to Mainframe " << psu->
getPsuDcs() <<
" BranchController " 356 <<
" in position " << psu->
getPsuBoard() <<
" with modules: ";
360 outs3 <<
"PSU " << psu->
psId <<
" connected to Mainframe " << psu->
getPsuDcs() <<
" BranchController " 362 <<
" in position " << psu->
getPsuBoard() <<
" and HV channel 002 with modules: ";
365 outs5 <<
"PSU " << psu->
psId <<
" connected to Mainframe " << psu->
getPsuDcs() <<
" BranchController " 367 <<
" in position " << psu->
getPsuBoard() <<
" and HV channel 002 with modules: ";
375 for (it =
ret.first; it !=
ret.second; ++it) {
377 outs << (*it).second->idex <<
", ";
378 outs1 << (*it).second->getKey() <<
",";
381 if ((*it).second->HVchannel == 2) {
383 outs3 << (*it).second->idex <<
", ";
384 outs4 << (*it).second->getKey() <<
",";
385 }
else if ((*it).second->HVchannel == 3) {
387 outs5 << (*it).second->idex <<
", ";
388 outs6 << (*it).second->getKey() <<
",";
395 outs <<
"(" << psu->
nmod <<
")";
396 psu->
text = outs.str();
403 outs3 <<
"(" << psu->
nmodHV2 <<
")";
404 outs5 <<
"(" << psu->
nmodHV3 <<
")";
423 jsfilename =
"CommonTools/TrackerMap/data/trackermap.txt";
424 infilename =
"CommonTools/TrackerMap/data/tracker.dat";
448 jsfilename =
"CommonTools/TrackerMap/data/trackermap.txt";
449 infilename =
"CommonTools/TrackerMap/data/tracker.dat";
453 jsPath =
"CommonTools/TrackerMap/data/";
463 std::map<int, TmModule *>::iterator i_mod;
487 int constexpr ndet = 3;
488 int constexpr
npart = 3;
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);
732 nams.begin(), nams.end(), [](
char c) {
return c ==
' '; },
'_');
736 red = (color >> 16) & 0xFF;
737 green = (color >> 8) & 0xFF;
746 *
svgfile << nams <<
" " << vals <<
" " <<
red <<
" " << green <<
" " <<
blue <<
" ";
749 <<
"<svg:polygon detid=\"" <<
mod->idex <<
"\" count=\"" <<
mod->count <<
"\" value=\"" <<
mod->value
750 <<
"\" id=\"" <<
key <<
"\" capvids=\"" <<
mod->capvids <<
"\" lv=\"" <<
mod->psuIdex <<
"\" hv=\"" 751 <<
mod->psuIdex * 10 +
mod->HVchannel <<
"\" fec=\"" <<
mod->CcuId
752 <<
"\" onclick=\"showData(evt);\" onmouseover=\"showData(evt);\" onmouseout=\"showData(evt);\" MESSAGE=\"" 753 <<
mod->text <<
"\" POS=\"" <<
mod->name <<
" \" fill=\"rgb(" <<
red <<
"," << green <<
"," <<
blue 756 *
svgfile << nams <<
" " << vals <<
" " << 255 <<
" " << 255 <<
" " << 255 <<
" ";
759 <<
"<svg:polygon detid=\"" <<
mod->idex <<
"\" count=\"" <<
mod->count <<
"\" value=\"" <<
mod->value
760 <<
"\" id=\"" <<
key <<
"\" capvids=\"" <<
mod->capvids <<
"\" lv=\"" <<
mod->psuIdex <<
"\" hv=\"" 761 <<
mod->psuIdex * 10 +
mod->HVchannel <<
"\" fec=\"" <<
mod->CcuId
762 <<
"\" onclick=\"showData(evt);\" onmouseover=\"showData(evt);\" onmouseout=\"showData(evt);\" MESSAGE=\"" 763 <<
mod->text <<
"\" POS=\"" <<
mod->name <<
" \" fill=\"white\" points=\"";
766 for (
int k = 0;
k <
np;
k++) {
768 *
svgfile << xd[
k] <<
" " << yd[
k] <<
" ";
770 *
svgfile << xd[
k] <<
"," << yd[
k] <<
" ";
775 *
svgfile <<
"\" />" << std::endl;
779 if (
mod->green > 255)
784 *
svgfile << nams <<
" " << vals <<
" " <<
mod->red <<
" " <<
mod->green <<
" " <<
mod->blue <<
" ";
787 <<
"<svg:polygon detid=\"" <<
mod->idex <<
"\" count=\"" <<
mod->count <<
"\" value=\"" <<
mod->value
788 <<
"\" id=\"" <<
key <<
"\" capvids=\"" <<
mod->capvids <<
"\" lv=\"" <<
mod->psuIdex <<
"\" hv=\"" 789 <<
mod->psuIdex * 10 +
mod->HVchannel <<
"\" fec=\"" <<
mod->CcuId
790 <<
"\" onclick=\"showData(evt);\" onmouseover=\"showData(evt);\" onmouseout=\"showData(evt);\" MESSAGE=\"" 791 <<
mod->text <<
"\" POS=\"" <<
mod->name <<
" \" fill=\"rgb(" <<
mod->red <<
"," <<
mod->green <<
"," 792 <<
mod->blue <<
")\" points=\"";
795 for (
int k = 0;
k <
np;
k++) {
797 *
svgfile << xd[
k] <<
" " << yd[
k] <<
" ";
799 *
svgfile << xd[
k] <<
"," << yd[
k] <<
" ";
804 *
svgfile <<
"\" />" << std::endl;
817 float minval, maxval;
825 if (
mod !=
nullptr && !
mod->notInUse() &&
mod->count > 0) {
826 if (minval >
mod->value)
828 if (maxval < mod->
value)
835 minval =
log(minval) /
log(10);
836 maxval =
log(maxval) /
log(10);
838 return std::make_pair(minval, maxval);
846 bool rangefound =
true;
849 std::vector<TPolyLine *> vp;
850 TGaxis *axis =
nullptr;
864 std::ostringstream outs;
875 if (
mod !=
nullptr && !
mod->notInUse()) {
892 if (
mod !=
nullptr && !
mod->notInUse() &&
mod->count > 0) {
896 if (maxvalue < mod->
value)
906 *
savefile <<
"<?xml version=\"1.0\" standalone=\"no\" ?>" << std::endl;
907 *
savefile <<
"<svg xmlns=\"http://www.w3.org/2000/svg\"" << std::endl;
908 *
savefile <<
"xmlns:svg=\"http://www.w3.org/2000/svg\" " << std::endl;
909 *
savefile <<
"xmlns:xlink=\"http://www.w3.org/1999/xlink\">" << std::endl;
910 *
savefile <<
"<svg:svg id=\"mainMap\" x=\"0\" y=\"0\" viewBox=\"0 0 3100 1600" 911 <<
"\" width=\"" <<
width <<
"\" height=\"" << height <<
"\">" << std::endl;
912 *
savefile <<
"<svg:rect fill=\"lightblue\" stroke=\"none\" x=\"0\" y=\"0\" width=\"3100\" height=\"1600\" /> " 914 *
savefile <<
"<svg:g id=\"tracker\" transform=\"translate(10,1500) rotate(270)\" " 915 "style=\"fill:none;stroke:black;stroke-width:0;\"> " 925 if (
mod !=
nullptr && !
mod->notInUse()) {
933 *
savefile <<
"</svg:g>" << std::endl;
934 *
savefile <<
" <svg:text id=\"Title\" class=\"normalText\" x=\"300\" y=\"0\">" <<
title <<
"</svg:text>" 946 *
savefile <<
"</svg:svg>" << std::endl;
952 const char *command1;
957 std::cout <<
"Executing " << command1 << std::endl;
968 std::ifstream tempfile(tempfilename.c_str(),
std::ios::in);
969 TCanvas *MyC =
new TCanvas(
"MyC",
"TrackerMap",
width, height);
970 gPad->SetFillColor(38);
973 gPad->Range(0, 0, 3800, 1600);
975 gPad->Range(-100, 0, 800, 1600);
977 gPad->Range(800, 0, 3800, 1600);
982 typedef std::map<int, int> ColorList;
984 ColorList::iterator
pos;
986 std::cout <<
"tempfilename " << tempfilename << std::endl;
987 while (!tempfile.eof()) {
989 colindex =
red + green * 1000 +
blue * 1000000;
990 pos = colorList.find(colindex);
991 if (
pos == colorList.end()) {
992 colorList[colindex] = ncolor + 100;
993 col = gROOT->GetColor(ncolor + 100);
995 col->SetRGB((Double_t)(
red / 255.), (Double_t)(green / 255.), (Double_t)(
blue / 255.));
997 c =
new TColor(ncolor + 100, (Double_t)(
red / 255.), (Double_t)(green / 255.), (Double_t)(
blue / 255.));
1002 tempfile >>
x[
i] >>
y[
i];
1006 if (ncolor > 0 && ncolor < 10000) {
1008 for (
int i = 0;
i < ncolor;
i++) {
1011 gStyle->SetPalette(ncolor,
colors);
1015 tempfile.seekg(0, std::ios::beg);
1016 std::cout <<
"created palette with " << ncolor <<
" colors" << std::endl;
1019 TH2Poly *StripMap =
new TH2Poly(
"StripSummary",
"", 775, 3600, 0, 1350);
1020 StripMap->SetFloat(
true);
1021 StripMap->GetXaxis()->SetTitle(
"");
1022 StripMap->GetYaxis()->SetTitle(
"");
1023 StripMap->SetStats(
false);
1026 while (!tempfile.eof()) {
1032 tempfile >>
x[
i] >>
y[
i];
1034 colindex =
red + green * 1000 +
blue * 1000000;
1035 pos = colorList.find(colindex);
1036 if (
pos != colorList.end()) {
1037 TPolyLine *pline =
new TPolyLine(
npoints,
y,
x);
1038 vp.push_back(pline);
1039 pline->SetFillColor(colorList[colindex]);
1043 if ((siterator >= 1 && siterator <= 3608) || (siterator >= 4281 && siterator <= 7888) ||
1044 (siterator >= 8657 && siterator <= 16588)) {
1045 bin->SetName(named.c_str());
1046 StripMap->AddBin(
bin);
1047 StripMap->Fill(named.c_str(),
content);
1050 pline->SetLineWidth(0);
1062 axis =
new TGaxis(-30, 36, -30, 1530, lminvalue, lmaxvalue, 510,
"+L");
1064 axis =
new TGaxis(3660, 36, 3660, 1530, lminvalue, lmaxvalue, 510,
"+L");
1066 axis->SetLabelSize(0.02);
1070 l.SetTextSize(0.03);
1071 l.DrawLatex(950, 1330,
"TID");
1072 l.DrawLatex(2300, 1330,
"TEC");
1073 l.DrawLatex(300, 1330,
"FPIX");
1074 l.DrawLatex(20, 560,
"BPIX L1");
1075 l.DrawLatex(500, 385,
"BPIX L2");
1076 l.DrawLatex(500, 945,
"BPIX L3");
1077 l.SetTextSize(0.04);
1079 if (
tkMapLog && (fulltitle.find(
"Log10 scale") == std::string::npos))
1080 fulltitle +=
": Log10 scale";
1082 l.DrawLatex(30, 1500, fulltitle.c_str());
1084 l.DrawLatex(850, 1500, fulltitle.c_str());
1087 l.DrawLatex(380, 40,
"-z");
1089 l.DrawLatex(1730, 40,
"-z");
1092 l.DrawLatex(380, 1330,
"+z");
1094 l.DrawLatex(1730, 1360,
"+z");
1096 l.DrawLatex(1085, 330,
"TIB L1");
1097 l.DrawLatex(1085, 1000,
"TIB L2");
1098 l.DrawLatex(1585, 330,
"TIB L3");
1099 l.DrawLatex(1585, 1000,
"TIB L4");
1100 l.DrawLatex(2085, 330,
"TOB L1");
1101 l.DrawLatex(2085, 1000,
"TOB L2");
1102 l.DrawLatex(2585, 330,
"TOB L3");
1103 l.DrawLatex(2585, 1000,
"TOB L4");
1104 l.DrawLatex(3085, 330,
"TOB L5");
1105 l.DrawLatex(3085, 1000,
"TOB L6");
1106 TArrow arx(3448, 1190, 3448, 1350, 0.01,
"|>");
1107 l.DrawLatex(3460, 1350,
"x");
1108 TArrow ary(3448, 1190, 3312, 1190, 0.01,
"|>");
1109 l.DrawLatex(3312, 1210,
"y");
1110 TArrow arz(3485, 373, 3485, 676, 0.01,
"|>");
1111 l.DrawLatex(3510, 667,
"z");
1112 TArrow arphi(3485, 511, 3037, 511, 0.01,
"|>");
1113 l.DrawLatex(3023, 520,
"#Phi");
1114 arx.SetLineWidth(3);
1115 ary.SetLineWidth(3);
1116 arz.SetLineWidth(3);
1117 arphi.SetLineWidth(3);
1123 l.DrawLatex(570 + 12, 1190 + 160,
"x");
1125 ary.SetX2(570 - 160);
1128 l.DrawLatex(570 - 160, 1190 + 30,
"y");
1131 arz.SetY1(683 - 100);
1132 arz.SetY2(683 + 100);
1133 l.DrawLatex(380 + 15, 683 + 100 - 9,
"z");
1135 arphi.SetX2(380 - 390);
1138 l.DrawLatex(380 - 390 - 14, 683 + 9,
"#Phi");
1146 if (
title.find(
"QTestAlarm") != std::string::npos) {
1165 std::cout <<
"Executing " << command1 << std::endl;
1172 TCanvas *MyT =
new TCanvas(
"MyT",
"MyT", 3500, 1500);
1174 StripMap->SetLineColor(kBlack);
1175 StripMap->SetLineWidth(0);
1176 StripMap->Draw(
"AL COLZ");
1180 gStyle->SetPalette(kRainBow);
1181 TPaletteAxis *realPalette = (TPaletteAxis *)StripMap->GetListOfFunctions()->FindObject(
"palette");
1182 realPalette->SetX1NDC(0.92);
1183 realPalette->SetX2NDC(0.94);
1184 realPalette->SetY1NDC(0.02);
1185 realPalette->SetY2NDC(0.91);
1186 gPad->SetRightMargin(0.08);
1187 gPad->SetLeftMargin(0.01);
1188 gPad->SetTopMargin(0.09);
1189 gPad->SetBottomMargin(0.02);
1194 l2.SetTextSize(0.06);
1197 if (std::isdigit(
c))
1200 l2.DrawLatex(800, 1380, striptitle.c_str());
1201 l2.SetTextSize(0.05);
1202 l2.DrawLatex(1200, 40,
"-z");
1203 l2.DrawLatex(1200, 1300,
"+z");
1204 l2.DrawLatex(1085, 310,
"TIB L1");
1205 l2.DrawLatex(1085, 1000,
"TIB L2");
1206 l2.DrawLatex(1585, 310,
"TIB L3");
1207 l2.DrawLatex(1585, 1000,
"TIB L4");
1208 l2.DrawLatex(2085, 310,
"TOB L1");
1209 l2.DrawLatex(2085, 1000,
"TOB L2");
1210 l2.DrawLatex(2585, 310,
"TOB L3");
1211 l2.DrawLatex(2585, 1000,
"TOB L4");
1212 l2.DrawLatex(3085, 310,
"TOB L5");
1213 l2.DrawLatex(3085, 1000,
"TOB L6");
1214 l2.DrawLatex(3460, 1320,
"x");
1215 l2.DrawLatex(3315, 1210,
"y");
1216 l2.DrawLatex(3510, 667,
"z");
1217 l2.DrawLatex(3023, 530,
"#Phi");
1235 for (std::vector<TPolyLine *>::iterator pos1 = vp.begin(); pos1 != vp.end(); pos1++) {
1243 int crate,
int numfed_incrate,
bool print_total,
TmApvPair *apvPair, std::ofstream *svgfile,
bool useApvPairValue) {
1244 double xp[4], yp[4];
1249 double xd[4], yd[4];
1251 double boxinitx = 0., boxinity = 0.;
1252 double dx = .9,
dy = .9;
1266 xp[1] = boxinitx +
dx;
1268 xp[2] = boxinitx +
dx;
1269 yp[2] = boxinity +
dy;
1271 yp[3] = boxinity +
dy;
1272 for (
int j = 0;
j < 4;
j++) {
1281 s.erase(
s.begin() +
s.find(
"connected"),
s.end());
1283 if (useApvPairValue) {
1284 if (apvPair->
red < 0) {
1285 if (apvPair->
count > 0) {
1286 float vals = apvPair->
value;
1290 red = (color >> 16) & 0xFF;
1291 green = (color >> 8) & 0xFF;
1292 blue = (color)&0xFF;
1296 *
svgfile << nams <<
" " << vals <<
" " <<
red <<
" " << green <<
" " <<
blue <<
" ";
1299 <<
"<svg:polygon detid=\"" << apvPair->
idex <<
"\" count=\"" << apvPair->
count <<
"\" value=\"" 1300 << apvPair->
value <<
"\" id=\"" << apvPair->
idex + crate * 1000000 <<
"\" cmodid=\"" 1302 <<
"\" onclick=\"showData(evt);\" onmouseover=\"showData(evt);\" onmouseout=\"showData(evt);\" MESSAGE=\"" 1305 <<
" \" fill=\"rgb(" <<
red <<
"," << green <<
"," <<
blue <<
")\" points=\"";
1308 *
svgfile << 0 <<
" " << 0 <<
" " << 255 <<
" " << 255 <<
" " << 255 <<
" ";
1311 <<
"<svg:polygon detid=\"" << apvPair->
idex <<
"\" count=\"" << apvPair->
count <<
"\" value=\"" 1312 << apvPair->
value <<
"\" id=\"" << apvPair->
idex + crate * 1000000 <<
"\" cmodid=\"" 1314 <<
"\" onclick=\"showData(evt);\" onmouseover=\"showData(evt);\" onmouseout=\"showData(evt);\" MESSAGE=\"" 1317 <<
" \" fill=\"white\" points=\"";
1320 if (apvPair->
red > 255)
1322 if (apvPair->
green > 255)
1323 apvPair->
green = 255;
1324 if (apvPair->
blue > 255)
1325 apvPair->
blue = 255;
1327 *
svgfile << 0 <<
" " << 0 <<
" " << apvPair->
red <<
" " << apvPair->
green <<
" " << apvPair->
blue <<
" ";
1330 <<
"<svg:polygon detid=\"" << apvPair->
idex <<
"\" count=\"" << apvPair->
count <<
"\" value=\"" 1331 << apvPair->
value <<
"\" id=\"" << apvPair->
idex + crate * 1000000 <<
"\" cmodid=\"" 1333 <<
"\" onclick=\"showData(evt);\" onmouseover=\"showData(evt);\" onmouseout=\"showData(evt);\" MESSAGE=\"" 1336 <<
" \" fill=\"rgb(" << apvPair->
red <<
"," << apvPair->
green <<
"," << apvPair->
blue <<
")\" points=\"";
1339 if (apvPair->
mod->
red < 0) {
1345 red = (color >> 16) & 0xFF;
1346 green = (color >> 8) & 0xFF;
1347 blue = (color)&0xFF;
1349 *
svgfile << nams <<
" " << vals <<
" " <<
red <<
" " << green <<
" " <<
blue <<
" ";
1352 <<
"<svg:polygon detid=\"" << apvPair->
idex <<
"\" count=\"" << apvPair->
count <<
"\" value=\"" 1353 << apvPair->
value <<
"\" id=\"" << apvPair->
idex + crate * 1000000 <<
"\" cmodid=\"" 1355 <<
"\" onclick=\"showData(evt);\" onmouseover=\"showData(evt);\" onmouseout=\"showData(evt);\" MESSAGE=\"" 1358 <<
" \" fill=\"rgb(" <<
red <<
"," << green <<
"," <<
blue <<
")\" points=\"";
1361 *
svgfile << 0 <<
" " << 0 <<
" " << 255 <<
" " << 255 <<
" " << 255 <<
" ";
1364 <<
"<svg:polygon detid=\"" << apvPair->
idex <<
"\" count=\"" << apvPair->
count <<
"\" value=\"" 1365 << apvPair->
value <<
"\" id=\"" << apvPair->
idex + crate * 1000000 <<
"\" cmodid=\"" 1367 <<
"\" onclick=\"showData(evt);\" onmouseover=\"showData(evt);\" onmouseout=\"showData(evt);\" MESSAGE=\"" 1370 <<
" \" fill=\"white\" points=\"";
1373 if (apvPair->
mod->
red > 255)
1384 <<
"<svg:polygon detid=\"" << apvPair->
idex <<
"\" count=\"" << apvPair->
count <<
"\" value=\"" 1385 << apvPair->
value <<
"\" id=\"" << apvPair->
idex + crate * 1000000 <<
"\" cmodid=\"" 1387 <<
"\" onclick=\"showData(evt);\" onmouseover=\"showData(evt);\" onmouseout=\"showData(evt);\" MESSAGE=\"" 1390 <<
" \" fill=\"rgb(" << apvPair->
mod->
red <<
"," << apvPair->
mod->
green <<
"," << apvPair->
mod->
blue 1396 for (
int k = 0;
k <
np;
k++) {
1398 *
svgfile << xd[
k] <<
" " << yd[
k] <<
" ";
1400 *
svgfile << xd[
k] <<
"," << yd[
k] <<
" ";
1405 *
svgfile <<
"\" />" << std::endl;
1408 int crate,
int numfec_incrate,
bool print_total,
TmCcu *ccu, std::ofstream *svgfile,
bool useCcuValue) {
1409 double xp[4], yp[4];
1414 double xd[4], yd[4];
1416 double boxinitx = 0., boxinity = 0.;
1417 double dx = .9,
dy = .9;
1418 int numccu_incolumn = 8;
1419 int numccu_inrow = 15;
1420 int numfec_incolumn = 5;
1421 int numfec_inrow = 4;
1422 boxinitx = boxinitx + (numfec_incolumn - (numfec_incrate - 1) / numfec_inrow) * 14.;
1423 boxinity = boxinity + (numfec_inrow - (numfec_incrate - 1) % numfec_inrow) * 16.;
1424 boxinity = boxinity + numccu_inrow - ccu->
mpos;
1425 boxinitx = boxinitx + numccu_incolumn - (
int)(ccu->
getCcuRing() % numccu_incolumn);
1429 xp[1] = boxinitx +
dx;
1431 xp[2] = boxinitx +
dx;
1432 yp[2] = boxinity +
dy;
1434 yp[3] = boxinity +
dy;
1435 for (
int j = 0;
j < 4;
j++) {
1446 s.erase(
s.begin() +
s.find(
"connected"),
s.end());
1449 if (ccu->
count > 0) {
1450 float vals = ccu->
value;
1454 red = (color >> 16) & 0xFF;
1455 green = (color >> 8) & 0xFF;
1456 blue = (color)&0xFF;
1460 *
svgfile << nams <<
" " << vals <<
" " <<
red <<
" " << green <<
" " <<
blue <<
" ";
1463 <<
"<svg:polygon detid=\"" << ccu->
idex <<
"\" count=\"" << ccu->
count <<
"\" value=\"" << ccu->
value 1464 <<
"\" id=\"" << ccu->
idex + crate * 1000000 <<
"\" cmodid=\"" << ccu->
cmodid <<
"\" layer=\"" << ccu->
layer 1465 <<
"\" onclick=\"showData(evt);\" onmouseover=\"showData(evt);\" onmouseout=\"showData(evt);\" MESSAGE=\"" 1466 "\" POS=\"Slot/Ring" 1468 <<
" \" fill=\"rgb(" <<
red <<
"," << green <<
"," <<
blue <<
")\" points=\"";
1471 *
svgfile << 0 <<
" " << 0 <<
" " << 255 <<
" " << 255 <<
" " << 255 <<
" ";
1474 <<
"<svg:polygon detid=\"" << ccu->
idex <<
"\" count=\"" << ccu->
count <<
"\" value=\"" << ccu->
value 1475 <<
"\" id=\"" << ccu->
idex + crate * 1000000 <<
"\" cmodid=\"" << ccu->
cmodid <<
"\" layer=\"" 1477 <<
"\" onclick=\"showData(evt);\" onmouseover=\"showData(evt);\" onmouseout=\"showData(evt);\" MESSAGE=\"" 1478 "\" POS=\"Slot/Ring " 1480 <<
" \" fill=\"white\" points=\"";
1485 if (ccu->
green > 255)
1487 if (ccu->
blue > 255)
1490 *
svgfile << 0 <<
" " << 0 <<
" " << ccu->
red <<
" " << ccu->
green <<
" " << ccu->
blue <<
" ";
1493 <<
"<svg:polygon detid=\"" << ccu->
idex <<
"\" count=\"" << ccu->
count <<
"\" value=\"" << ccu->
value 1494 <<
"\" id=\"" << ccu->
idex + crate * 1000000 <<
"\" cmodid=\"" << ccu->
cmodid <<
"\" layer=\"" << ccu->
layer 1495 <<
"\" onclick=\"showData(evt);\" onmouseover=\"showData(evt);\" onmouseout=\"showData(evt);\" MESSAGE=\"" 1496 "\" POS=\"Slot/Ring " 1498 <<
" \" fill=\"rgb(" << ccu->
red <<
"," << ccu->
green <<
"," << ccu->
blue <<
")\" points=\"";
1502 for (
int k = 0;
k <
np;
k++) {
1504 *
svgfile << xd[
k] <<
" " << yd[
k] <<
" ";
1506 *
svgfile << xd[
k] <<
"," << yd[
k] <<
" ";
1511 *
svgfile <<
"\" />" << std::endl;
1514 int rack,
int numcrate_inrack,
bool print_total,
TmPsu *psu, std::ofstream *svgfile,
bool usePsuValue) {
1515 double xp[4], yp[4];
1520 double xd[4], yd[4];
1522 double boxinitx = 0., boxinity = 0.;
1523 double dx = .9,
dy = .9;
1530 xp[1] = boxinitx +
dx;
1532 xp[2] = boxinitx +
dx;
1533 yp[2] = boxinity +
dy;
1535 yp[3] = boxinity +
dy;
1537 for (
int j = 0;
j < 4;
j++) {
1557 s.erase(
s.begin() +
s.find(
"connected"),
s.end());
1560 if (psu->
count > 0) {
1561 float vals = psu->
value;
1565 red = (color >> 16) & 0xFF;
1566 green = (color >> 8) & 0xFF;
1567 blue = (color)&0xFF;
1571 *
svgfile << nams <<
" " << vals <<
" " <<
red <<
" " << green <<
" " <<
blue <<
" ";
1574 <<
"<svg:polygon detid=\"" << psu->
idex <<
"\" count=\"" << psu->
count <<
"\" value=\"" << psu->
value 1575 <<
"\" id=\"" << psu->
idex <<
"\" cmodid=\"" << psu->
cmodid_LV 1576 <<
"\" onclick=\"showData(evt);\" onmouseover=\"showData(evt);\" onmouseout=\"showData(evt);\" MESSAGE=\"" 1577 "\" POS=\"easyCrate/easyBoard " 1579 <<
"," << green <<
"," <<
blue <<
")\" points=\"";
1582 *
svgfile << 0 <<
" " << 0 <<
" " << 255 <<
" " << 255 <<
" " << 255 <<
" ";
1585 <<
"<svg:polygon detid=\"" << psu->
idex <<
"\" count=\"" << psu->
count <<
"\" value=\"" << psu->
value 1586 <<
"\" id=\"" << psu->
idex <<
"\" cmodid=\"" << psu->
cmodid_LV 1587 <<
"\" onclick=\"showData(evt);\" onmouseover=\"showData(evt);\" onmouseout=\"showData(evt);\" MESSAGE=\"" 1588 "\" POS=\"easyCrate/easyBoard " 1590 <<
" \" fill=\"white\" points=\"";
1597 if (psu->
green > 255)
1599 if (psu->
blue > 255)
1602 *
svgfile << 0 <<
" " << 0 <<
" " << psu->
red <<
" " << psu->
green <<
" " << psu->
blue <<
" ";
1605 <<
"<svg:polygon detid=\"" << psu->
idex <<
"\" count=\"" << psu->
count <<
"\" value=\"" << psu->
value 1606 <<
"\" id=\"" << psu->
idex <<
"\" cmodid=\"" << psu->
cmodid_LV 1607 <<
"\" onclick=\"showData(evt);\" onmouseover=\"showData(evt);\" onmouseout=\"showData(evt);\" MESSAGE=\"" 1608 "\" POS=\"easyCrate/easyBoard " 1610 <<
"," << psu->
green <<
"," << psu->
blue <<
")\" points=\"";
1615 for (
int k = 0;
k <
np;
k++) {
1617 *
svgfile << xd[
k] <<
" " << yd[
k] <<
" ";
1619 *
svgfile << xd[
k] <<
"," << yd[
k] <<
" ";
1624 *
svgfile <<
"\" />" << std::endl;
1628 int rack,
int numcrate_inrack,
bool print_total,
TmPsu *psu, std::ofstream *svgfile,
bool usePsuValue) {
1629 double xp[4], yp[4];
1634 double xd[4], yd[4];
1636 double boxinitx = 35, boxinity = 12;
1637 double dx = 1.1,
dy = 1.3;
1639 boxinitx = boxinitx + (5 - psu->
getPsuCrate()) * 5;
1640 boxinity = boxinity + (18 - psu->
getPsuBoard()) * 1.75;
1644 xp[1] = boxinitx +
dx;
1646 xp[2] = boxinitx +
dx;
1647 yp[2] = boxinity +
dy;
1649 yp[3] = boxinity +
dy;
1651 for (
int j = 0;
j < 4;
j++) {
1660 s.erase(
s.begin() +
s.find(
"connected"),
s.end());
1669 redHV2 = (color >> 16) & 0xFF;
1670 greenHV2 = (color >> 8) & 0xFF;
1671 blueHV2 = (color)&0xFF;
1675 *
svgfile << nams <<
" " << vals <<
" " << redHV2 <<
" " << greenHV2 <<
" " << blueHV2 <<
" ";
1678 <<
"<svg:polygon detid=\"" << psu->
idex <<
"\" count=\"" << psu->
countHV2 <<
"\" value=\"" << psu->
valueHV2 1679 <<
"\" id=\"" << psu->
idex * 10 + 2 <<
"\" cmodid=\"" << psu->
cmodid_HV2 1680 <<
"\" onclick=\"showData(evt);\" onmouseover=\"showData(evt);\" onmouseout=\"showData(evt);\" MESSAGE=\"" 1681 "\" POS=\"easyCrate/easyBoard " 1683 <<
"," << greenHV2 <<
"," << blueHV2 <<
")\" points=\"";
1686 *
svgfile << 0 <<
" " << 0 <<
" " << 255 <<
" " << 255 <<
" " << 255 <<
" ";
1689 <<
"<svg:polygon detid=\"" << psu->
idex <<
"\" count=\"" << psu->
countHV2 <<
"\" value=\"" << psu->
valueHV2 1690 <<
"\" id=\"" << psu->
idex * 10 + 2 <<
"\" cmodid=\"" << psu->
cmodid_HV2 1691 <<
"\" onclick=\"showData(evt);\" onmouseover=\"showData(evt);\" onmouseout=\"showData(evt);\" MESSAGE=\"" 1692 "\" POS=\"easyCrate/easyBoard " 1694 <<
" \" fill=\"white\" points=\"";
1709 <<
"<svg:polygon detid=\"" << psu->
idex <<
"\" count=\"" << psu->
countHV2 <<
"\" value=\"" << psu->
valueHV2 1710 <<
"\" id=\"" << psu->
idex * 10 + 2 <<
"\" cmodid=\"" << psu->
cmodid_HV2 1711 <<
"\" onclick=\"showData(evt);\" onmouseover=\"showData(evt);\" onmouseout=\"showData(evt);\" MESSAGE=\"" 1712 "\" POS=\"easyCrate/easyBoard " 1719 for (
int k = 0;
k <
np;
k++) {
1721 *
svgfile << xd[
k] <<
" " << yd[
k] <<
" ";
1723 *
svgfile << xd[
k] <<
"," << yd[
k] <<
" ";
1728 *
svgfile <<
"\" />" << std::endl;
1732 int rack,
int numcrate_inrack,
bool print_total,
TmPsu *psu, std::ofstream *svgfile,
bool usePsuValue) {
1733 double xp[4], yp[4];
1738 double xd[4], yd[4];
1740 double boxinitx = 36.5, boxinity = 12;
1741 double dx = 1.1,
dy = 1.3;
1743 boxinitx = boxinitx + (5 - psu->
getPsuCrate()) * 5;
1744 boxinity = boxinity + (18 - psu->
getPsuBoard()) * 1.75;
1748 xp[1] = boxinitx +
dx;
1750 xp[2] = boxinitx +
dx;
1751 yp[2] = boxinity +
dy;
1753 yp[3] = boxinity +
dy;
1755 for (
int j = 0;
j < 4;
j++) {
1764 s.erase(
s.begin() +
s.find(
"connected"),
s.end());
1772 redHV3 = (color >> 16) & 0xFF;
1773 greenHV3 = (color >> 8) & 0xFF;
1774 blueHV3 = (color)&0xFF;
1778 *
svgfile << nams <<
" " << vals <<
" " << redHV3 <<
" " << greenHV3 <<
" " << blueHV3 <<
" ";
1781 <<
"<svg:polygon detid=\"" << psu->
idex <<
"\" count=\"" << psu->
countHV3 <<
"\" value=\"" << psu->
valueHV3 1782 <<
"\" id=\"" << psu->
idex * 10 + 3 <<
"\" cmodid=\"" << psu->
cmodid_HV3 1783 <<
"\" onclick=\"showData(evt);\" onmouseover=\"showData(evt);\" onmouseout=\"showData(evt);\" MESSAGE=\"" 1784 "\" POS=\"easyCrate/easyBoard" 1786 <<
"," << greenHV3 <<
"," << blueHV3 <<
")\" points=\"";
1789 *
svgfile << 0 <<
" " << 255 <<
" " << 255 <<
" " << 255 <<
" ";
1792 <<
"<svg:polygon detid=\"" << psu->
idex <<
"\" count=\"" << psu->
countHV3 <<
"\" value=\"" << psu->
valueHV3 1793 <<
"\" id=\"" << psu->
idex * 10 + 3 <<
"\" cmodid=\"" << psu->
cmodid_HV3 1794 <<
"\" onclick=\"showData(evt);\" onmouseover=\"showData(evt);\" onmouseout=\"showData(evt);\" MESSAGE=\"" 1795 "\" POS=\"easyCrate/easyBoard " 1797 <<
" \" fill=\"white\" points=\"";
1812 <<
"<svg:polygon detid=\"" << psu->
idex <<
"\" count=\"" << psu->
countHV3 <<
"\" value=\"" << psu->
valueHV3 1813 <<
"\" id=\"" << psu->
idex * 10 + 3 <<
"\" cmodid=\"" << psu->
cmodid_HV3 1814 <<
"\" onclick=\"showData(evt);\" onmouseover=\"showData(evt);\" onmouseout=\"showData(evt);\" MESSAGE=\"" 1815 "\" POS=\"easyCrate/easyBoard " 1822 for (
int k = 0;
k <
np;
k++) {
1824 *
svgfile << xd[
k] <<
" " << yd[
k] <<
" ";
1826 *
svgfile << xd[
k] <<
"," << yd[
k] <<
" ";
1831 *
svgfile <<
"\" />" << std::endl;
1835 bool print_total,
float minval,
float maxval,
std::string s,
int width,
int height) {
1838 std::vector<TPolyLine *> vp;
1839 TGaxis *axis =
nullptr;
1847 std::ostringstream outs;
1853 std::map<int, TmCcu *>::iterator i_ccu;
1854 std::multimap<TmCcu *, TmModule *>::iterator it;
1855 std::pair<std::multimap<TmCcu *, TmModule *>::iterator, std::multimap<TmCcu *, TmModule *>::iterator>
ret;
1857 bool useCcuValue =
false;
1859 for (i_ccu =
ccuMap.begin(); i_ccu !=
ccuMap.end(); i_ccu++) {
1860 TmCcu *ccu = i_ccu->second;
1861 if (ccu !=
nullptr) {
1862 if (ccu->
count > 0 || ccu->
red != -1) {
1870 for (i_ccu =
ccuMap.begin(); i_ccu !=
ccuMap.end(); i_ccu++) {
1871 TmCcu *ccu = i_ccu->second;
1872 if (ccu !=
nullptr) {
1874 for (it =
ret.first; it !=
ret.second; ++it) {
1875 if ((*it).second->count > 0) {
1876 ccu->
value = ccu->
value + (*it).second->value;
1882 if (ccu->
nmod == 0) {
1890 if (
title.find(
"QTestAlarm") != std::string::npos) {
1891 for (i_ccu =
ccuMap.begin(); i_ccu !=
ccuMap.end(); i_ccu++) {
1892 TmCcu *ccu = i_ccu->second;
1893 if (ccu !=
nullptr) {
1898 for (it =
ret.first; it !=
ret.second; ++it) {
1899 if (!((*it).second->red == 0 && (*it).second->green == 255 && (*it).second->blue == 0) &&
1900 !((*it).second->red == 255 && (*it).second->green == 255 && (*it).second->blue == 255)) {
1911 for (i_ccu =
ccuMap.begin(); i_ccu !=
ccuMap.end(); i_ccu++) {
1912 TmCcu *ccu = i_ccu->second;
1913 if (ccu !=
nullptr) {
1923 for (i_ccu =
ccuMap.begin(); i_ccu !=
ccuMap.end(); i_ccu++) {
1924 TmCcu *ccu = i_ccu->second;
1925 if (ccu !=
nullptr && ccu->
count > 0) {
1928 if (maxvalue < ccu->
value)
1936 std::ostringstream outs;
1939 *
savefile <<
"<?xml version=\"1.0\" standalone=\"no\" ?>" << std::endl;
1940 *
savefile <<
"<svg xmlns=\"http://www.w3.org/2000/svg\"" << std::endl;
1941 *
savefile <<
"xmlns:svg=\"http://www.w3.org/2000/svg\" " << std::endl;
1942 *
savefile <<
"xmlns:xlink=\"http://www.w3.org/1999/xlink\">" << std::endl;
1943 *
savefile <<
"<svg:svg id=\"mainMap\" x=\"0\" y=\"0\" viewBox=\"0 0 3000 1600" 1944 <<
"\" width=\"" <<
width <<
"\" height=\"" << height <<
"\">" << std::endl;
1945 *
savefile <<
"<svg:rect fill=\"lightblue\" stroke=\"none\" x=\"0\" y=\"0\" width=\"3000\" height=\"1600\" /> " 1947 *
savefile <<
"<svg:g id=\"fedtrackermap\" transform=\"translate(10,1500) rotate(270)\" " 1948 "style=\"fill:none;stroke:black;stroke-width:0;\"> " 1951 for (
int crate = 1; crate < (
nfeccrates + 1); crate++) {
1954 std::ostringstream outs;
1957 *
savefile <<
"<?xml version=\"1.0\" standalone=\"no\"?>" << std::endl;
1958 *
savefile <<
"<svg xmlns=\"http://www.w3.org/2000/svg\"" << std::endl;
1959 *
savefile <<
"xmlns:svg=\"http://www.w3.org/2000/svg\"" << std::endl;
1960 *
savefile <<
"xmlns:xlink=\"http://www.w3.org/1999/xlink\" >" << std::endl;
1961 *
savefile <<
"<script type=\"text/ecmascript\" xlink:href=\"feccrate.js\" />" << std::endl;
1962 *
savefile <<
"<svg id=\"mainMap\" x=\"0\" y=\"0\" viewBox=\"0 0 500 500\" width=\"700\" height=\"700\" " 1963 "onload=\"TrackerCrate.init()\">" 1965 *
savefile <<
"<rect fill=\"lightblue\" stroke=\"none\" x=\"0\" y=\"0\" width=\"700\" height=\"700\" />" 1967 *
savefile <<
"<g id=\"crate\" transform=\" translate(280,580) rotate(270) scale(.7,.8)\" > " << std::endl;
1972 for (i_ccu =
ccuMap.begin(); i_ccu !=
ccuMap.end(); i_ccu++) {
1973 TmCcu *ccu = i_ccu->second;
1974 if (ccu !=
nullptr) {
1983 *
savefile <<
"</g> </svg> <text id=\"currentElementText\" x=\"40\" y=\"30\"> " << std::endl;
1984 *
savefile <<
"<tspan id=\"line1\" x=\"40\" y=\"30\"> </tspan> " << std::endl;
1985 *
savefile <<
"<tspan id=\"line2\" x=\"40\" y=\"60\"> </tspan> " << std::endl;
1986 *
savefile <<
" </text> </svg>" << std::endl;
1993 *
savefile <<
"</g> </svg> </svg> " << std::endl;
1996 if (!print_total && !useCcuValue) {
1998 for (i_ccu =
ccuMap.begin(); i_ccu !=
ccuMap.end(); i_ccu++) {
1999 TmCcu *ccu = i_ccu->second;
2000 if (ccu !=
nullptr) {
2012 const char *command1;
2016 std::ifstream tempfile(tempfilename.c_str(),
std::ios::in);
2017 TCanvas *MyC =
new TCanvas(
"MyC",
"TrackerMap",
width, height);
2018 gPad->SetFillColor(38);
2021 gPad->Range(0, 0, 3700, 1600);
2023 gPad->Range(0, 0, 3800, 1600);
2027 typedef std::map<int, int> ColorList;
2028 ColorList colorList;
2029 ColorList::iterator
pos;
2031 while (!tempfile.eof()) {
2033 colindex =
red + green * 1000 +
blue * 1000000;
2034 pos = colorList.find(colindex);
2035 if (
pos == colorList.end()) {
2036 colorList[colindex] = ncolor + 100;
2037 col = gROOT->GetColor(ncolor + 100);
2039 col->SetRGB((Double_t)(
red / 255.), (Double_t)(green / 255.), (Double_t)(
blue / 255.));
2041 c =
new TColor(ncolor + 100, (Double_t)(
red / 255.), (Double_t)(green / 255.), (Double_t)(
blue / 255.));
2047 tempfile >>
x[
i] >>
y[
i];
2050 if (ncolor > 0 && ncolor < 10000) {
2052 for (
int i = 0;
i < ncolor;
i++) {
2055 gStyle->SetPalette(ncolor,
colors);
2058 tempfile.seekg(0, std::ios::beg);
2059 std::cout <<
"created palette with " << ncolor <<
" colors" << std::endl;
2060 while (!tempfile.eof()) {
2063 tempfile >>
x[
i] >>
y[
i];
2065 colindex =
red + green * 1000 +
blue * 1000000;
2066 pos = colorList.find(colindex);
2067 if (
pos != colorList.end()) {
2068 TPolyLine *pline =
new TPolyLine(
npoints,
y,
x);
2069 vp.push_back(pline);
2070 pline->SetFillColor(colorList[colindex]);
2071 pline->SetLineWidth(0);
2082 axis =
new TGaxis(3660, 36, 3660, 1530, lminvalue, lmaxvalue, 510,
"+L");
2083 axis->SetLabelSize(0.02);
2089 l.SetTextSize(0.05);
2091 if (
tkMapLog && (fulltitle.find(
"Log10 scale") == std::string::npos))
2092 fulltitle +=
": Log10 scale";
2093 l.DrawLatex(50, 1530, fulltitle.c_str());
2111 std::cout <<
"Executing " << command1 << std::endl;
2117 for (std::vector<TPolyLine *>::iterator pos1 = vp.begin(); pos1 != vp.end(); pos1++) {
2125 bool print_total,
float minval,
float maxval,
std::string s,
int width,
int height) {
2128 std::vector<TPolyLine *> vp;
2129 TGaxis *axis =
nullptr;
2140 std::ostringstream outs;
2147 std::map<int, TmPsu *>::iterator ipsu;
2148 std::multimap<TmPsu *, TmModule *>::iterator it;
2149 std::pair<std::multimap<TmPsu *, TmModule *>::iterator, std::multimap<TmPsu *, TmModule *>::iterator>
ret;
2151 bool usePsuValue =
false;
2153 for (ipsu =
psuMap.begin(); ipsu !=
psuMap.end(); ipsu++) {
2154 TmPsu *psu = ipsu->second;
2155 if (psu !=
nullptr) {
2165 for (ipsu =
psuMap.begin(); ipsu !=
psuMap.end(); ipsu++) {
2166 TmPsu *psu = ipsu->second;
2167 if (psu !=
nullptr) {
2171 for (it =
ret.first; it !=
ret.second; ++it) {
2172 if ((*it).second->HVchannel == 2 && (*it).second->count > 0) {
2176 if ((*it).second->HVchannel == 3 && (*it).second->count > 0) {
2181 if (psu->
nmodHV2 != 0 && nconn1 > 0) {
2185 if (psu->
nmodHV3 != 0 && nconn2 > 0) {
2193 if (
title.find(
"QTestAlarm") != std::string::npos) {
2194 for (ipsu =
psuMap.begin(); ipsu !=
psuMap.end(); ipsu++) {
2195 TmPsu *psu = ipsu->second;
2196 if (psu !=
nullptr) {
2204 for (it =
ret.first; it !=
ret.second; ++it) {
2205 if ((*it).second->HVchannel == 2) {
2206 if (!((*it).second->red == 0 && (*it).second->green == 255 && (*it).second->blue == 0) &&
2207 !((*it).second->red == 255 && (*it).second->green == 255 && (*it).second->blue == 255)) {
2213 if ((*it).second->HVchannel == 3) {
2214 if (!((*it).second->red == 0 && (*it).second->green == 255 && (*it).second->blue == 0) &&
2215 !((*it).second->red == 255 && (*it).second->green == 255 && (*it).second->blue == 255)) {
2227 for (ipsu =
psuMap.begin(); ipsu !=
psuMap.end(); ipsu++) {
2228 TmPsu *psu = ipsu->second;
2229 if (psu !=
nullptr) {
2242 for (ipsu =
psuMap.begin(); ipsu !=
psuMap.end(); ipsu++) {
2243 TmPsu *psu = ipsu->second;
2247 if (maxvalue < psu->valueHV2 || maxvalue < psu->valueHV3)
2255 std::ostringstream outs;
2258 *
savefile <<
"<?xml version=\"1.0\" standalone=\"no\" ?>" << std::endl;
2259 *
savefile <<
"<svg xmlns=\"http://www.w3.org/2000/svg\"" << std::endl;
2260 *
savefile <<
"xmlns:svg=\"http://www.w3.org/2000/svg\" " << std::endl;
2261 *
savefile <<
"xmlns:xlink=\"http://www.w3.org/1999/xlink\">" << std::endl;
2262 *
savefile <<
"<svg:svg id=\"mainMap\" x=\"0\" y=\"0\" viewBox=\"0 0 3000 1600" 2263 <<
"\" width=\"" <<
width <<
"\" height=\"" << height <<
"\">" << std::endl;
2264 *
savefile <<
"<svg:rect fill=\"lightblue\" stroke=\"none\" x=\"0\" y=\"0\" width=\"3000\" height=\"1600\" /> " 2266 *
savefile <<
"<svg:g id=\"HVtrackermap\" transform=\"translate(10,1500) rotate(270)\" " 2267 "style=\"fill:none;stroke:black;stroke-width:0;\"> " 2271 for (
int irack = 1; irack < (
npsuracks + 1); irack++) {
2274 std::ostringstream outs;
2277 *
savefile <<
"<?xml version=\"1.0\" standalone=\"no\"?>" << std::endl;
2278 *
savefile <<
"<svg xmlns=\"http://www.w3.org/2000/svg\"" << std::endl;
2279 *
savefile <<
"xmlns:svg=\"http://www.w3.org/2000/svg\"" << std::endl;
2280 *
savefile <<
"xmlns:xlink=\"http://www.w3.org/1999/xlink\" >" << std::endl;
2281 *
savefile <<
"<script type=\"text/ecmascript\" xlink:href=\"rackhv.js\" />" << std::endl;
2282 *
savefile <<
"<svg id=\"mainMap\" x=\"0\" y=\"0\" viewBox=\"0 0 500 500\" width=\"700\" height=\"700\" " 2283 "onload=\"TrackerRackhv.init()\">" 2285 *
savefile <<
"<rect fill=\"lightblue\" stroke=\"none\" x=\"0\" y=\"0\" width=\"700\" height=\"700\" />" 2287 *
savefile <<
"<g id=\"rackhv\" transform=\" translate(150,500) rotate(270) scale(1.,1.)\" > " << std::endl;
2292 for (ipsu =
psuMap.begin(); ipsu !=
psuMap.end(); ipsu++) {
2293 TmPsu *psu = ipsu->second;
2296 drawHV3(irack, psu->getPsuCrate(), print_total, psu,
savefile, usePsuValue);
2302 *
savefile <<
"</g> </svg> <text id=\"currentElementText\" x=\"40\" y=\"30\"> " << std::endl;
2303 *
savefile <<
"<tspan id=\"line1\" x=\"40\" y=\"30\"> </tspan> " << std::endl;
2304 *
savefile <<
"<tspan id=\"line2\" x=\"40\" y=\"60\"> </tspan> " << std::endl;
2305 *
savefile <<
" </text> </svg>" << std::endl;
2312 *
savefile <<
"</g> </svg> </svg> " << std::endl;
2317 if (!print_total && !usePsuValue) {
2318 for (ipsu =
psuMap.begin(); ipsu !=
psuMap.end(); ipsu++) {
2319 TmPsu *psu = ipsu->second;
2320 if (psu !=
nullptr) {
2334 const char *command1;
2338 std::ifstream tempfile(tempfilename.c_str(),
std::ios::in);
2339 TCanvas *MyC =
new TCanvas(
"MyC",
"TrackerMap",
width, height);
2340 gPad->SetFillColor(38);
2343 gPad->Range(0, 0, 3700, 1600);
2345 gPad->Range(0, 0, 3800, 1600);
2349 typedef std::map<int, int> ColorList;
2350 ColorList colorList;
2351 ColorList::iterator
pos;
2353 while (!tempfile.eof()) {
2355 colindex =
red + green * 1000 +
blue * 1000000;
2356 pos = colorList.find(colindex);
2357 if (
pos == colorList.end()) {
2358 colorList[colindex] = ncolor + 100;
2359 col = gROOT->GetColor(ncolor + 100);
2361 col->SetRGB((Double_t)(
red / 255.), (Double_t)(green / 255.), (Double_t)(
blue / 255.));
2363 c =
new TColor(ncolor + 100, (Double_t)(
red / 255.), (Double_t)(green / 255.), (Double_t)(
blue / 255.));
2369 tempfile >>
x[
i] >>
y[
i];
2372 if (ncolor > 0 && ncolor < 10000) {
2374 for (
int i = 0;
i < ncolor;
i++) {
2377 gStyle->SetPalette(ncolor,
colors);
2380 tempfile.seekg(0, std::ios::beg);
2381 std::cout <<
"created palette with " << ncolor <<
" colors" << std::endl;
2382 while (!tempfile.eof()) {
2385 tempfile >>
x[
i] >>
y[
i];
2387 colindex =
red + green * 1000 +
blue * 1000000;
2388 pos = colorList.find(colindex);
2389 if (
pos != colorList.end()) {
2390 TPolyLine *pline =
new TPolyLine(
npoints,
y,
x);
2391 vp.push_back(pline);
2392 pline->SetFillColor(colorList[colindex]);
2393 pline->SetLineWidth(0);
2404 axis =
new TGaxis(3660, 36, 3660, 1530, lminvalue, lmaxvalue, 510,
"+L");
2405 axis->SetLabelSize(0.02);
2411 l.SetTextSize(0.05);
2413 if (
tkMapLog && (fulltitle.find(
"Log10 scale") == std::string::npos))
2414 fulltitle +=
": Log10 scale";
2415 l.DrawLatex(50, 1530, fulltitle.c_str());
2433 std::cout <<
"Executing " << command1 << std::endl;
2439 for (std::vector<TPolyLine *>::iterator pos1 = vp.begin(); pos1 != vp.end(); pos1++) {
2448 bool print_total,
float minval,
float maxval,
std::string s,
int width,
int height) {
2451 bool rangefound =
true;
2453 std::vector<TPolyLine *> vp;
2454 TGaxis *axis =
nullptr;
2466 std::ostringstream outs;
2473 std::map<int, TmPsu *>::iterator ipsu;
2474 std::multimap<TmPsu *, TmModule *>::iterator it;
2475 std::pair<std::multimap<TmPsu *, TmModule *>::iterator, std::multimap<TmPsu *, TmModule *>::iterator>
ret;
2478 bool usePsuValue =
false;
2480 for (ipsu =
psuMap.begin(); ipsu !=
psuMap.end(); ipsu++) {
2481 TmPsu *psu = ipsu->second;
2482 if (psu !=
nullptr) {
2483 if (psu->
count > 0 || psu->
red != -1) {
2491 for (ipsu =
psuMap.begin(); ipsu !=
psuMap.end(); ipsu++) {
2492 TmPsu *psu = ipsu->second;
2493 if (psu !=
nullptr) {
2496 for (it =
ret.first; it !=
ret.second; ++it) {
2497 if ((*it).second->count > 0) {
2499 psu->
value = psu->
value + (*it).second->value;
2510 if (
title.find(
"QTestAlarm") != std::string::npos) {
2511 for (ipsu =
psuMap.begin(); ipsu !=
psuMap.end(); ipsu++) {
2512 TmPsu *psu = ipsu->second;
2513 if (psu !=
nullptr) {
2518 for (it =
ret.first; it !=
ret.second; ++it) {
2519 if (!((*it).second->red == 0 && (*it).second->green == 255 && (*it).second->blue == 0) &&
2520 !((*it).second->red == 255 && (*it).second->green == 255 && (*it).second->blue == 255)) {
2534 for (ipsu =
psuMap.begin(); ipsu !=
psuMap.end(); ipsu++) {
2535 TmPsu *psu = ipsu->second;
2536 if (psu !=
nullptr) {
2547 for (ipsu =
psuMap.begin(); ipsu !=
psuMap.end(); ipsu++) {
2548 TmPsu *psu = ipsu->second;
2549 if (psu !=
nullptr && psu->
count > 0) {
2553 if (maxvalue < psu->
value)
2563 std::ostringstream outs;
2566 *
savefile <<
"<?xml version=\"1.0\" standalone=\"no\" ?>" << std::endl;
2567 *
savefile <<
"<svg xmlns=\"http://www.w3.org/2000/svg\"" << std::endl;
2568 *
savefile <<
"xmlns:svg=\"http://www.w3.org/2000/svg\" " << std::endl;
2569 *
savefile <<
"xmlns:xlink=\"http://www.w3.org/1999/xlink\">" << std::endl;
2570 *
savefile <<
"<svg:svg id=\"mainMap\" x=\"0\" y=\"0\" viewBox=\"0 0 3000 1600" 2571 <<
"\" width=\"" <<
width <<
"\" height=\"" << height <<
"\">" << std::endl;
2572 *
savefile <<
"<svg:rect fill=\"lightblue\" stroke=\"none\" x=\"0\" y=\"0\" width=\"3000\" height=\"1600\" /> " 2574 *
savefile <<
"<svg:g id=\"psutrackermap\" transform=\"translate(10,1500) rotate(270)\" " 2575 "style=\"fill:none;stroke:black;stroke-width:0;\"> " 2579 for (
int irack = 1; irack < (
npsuracks + 1); irack++) {
2582 std::ostringstream outs;
2585 *
savefile <<
"<?xml version=\"1.0\" standalone=\"no\"?>" << std::endl;
2586 *
savefile <<
"<svg xmlns=\"http://www.w3.org/2000/svg\"" << std::endl;
2587 *
savefile <<
"xmlns:svg=\"http://www.w3.org/2000/svg\"" << std::endl;
2588 *
savefile <<
"xmlns:xlink=\"http://www.w3.org/1999/xlink\" >" << std::endl;
2589 *
savefile <<
"<script type=\"text/ecmascript\" xlink:href=\"rack.js\" />" << std::endl;
2590 *
savefile <<
"<svg id=\"mainMap\" x=\"0\" y=\"0\" viewBox=\"0 0 500 500\" width=\"700\" height=\"700\" " 2591 "onload=\"TrackerCrate.init()\">" 2593 *
savefile <<
"<rect fill=\"lightblue\" stroke=\"none\" x=\"0\" y=\"0\" width=\"700\" height=\"700\" />" 2595 *
savefile <<
"<g id=\"rack\" transform=\" translate(150,500) rotate(270) scale(1.,1.)\" > " << std::endl;
2600 for (ipsu =
psuMap.begin(); ipsu !=
psuMap.end(); ipsu++) {
2601 TmPsu *psu = ipsu->second;
2609 *
savefile <<
"</g> </svg> <text id=\"currentElementText\" x=\"40\" y=\"30\"> " << std::endl;
2610 *
savefile <<
"<tspan id=\"line1\" x=\"40\" y=\"30\"> </tspan> " << std::endl;
2611 *
savefile <<
"<tspan id=\"line2\" x=\"40\" y=\"60\"> </tspan> " << std::endl;
2612 *
savefile <<
" </text> </svg>" << std::endl;
2619 *
savefile <<
"</g> </svg> </svg> " << std::endl;
2624 if (!print_total && !usePsuValue) {
2625 for (ipsu =
psuMap.begin(); ipsu !=
psuMap.end(); ipsu++) {
2626 TmPsu *psu = ipsu->second;
2627 if (psu !=
nullptr) {
2643 const char *command1;
2647 std::ifstream tempfile(tempfilename.c_str(),
std::ios::in);
2648 TCanvas *MyC =
new TCanvas(
"MyC",
"TrackerMap",
width, height);
2649 gPad->SetFillColor(38);
2652 std::cout <<
" range x " << rangex << std::endl;
2653 std::cout <<
" range y " << rangey << std::endl;
2654 gPad->Range(0, 0, rangex, rangey);
2658 typedef std::map<int, int> ColorList;
2659 ColorList colorList;
2660 ColorList::iterator
pos;
2662 while (!tempfile.eof()) {
2664 colindex =
red + green * 1000 +
blue * 1000000;
2665 pos = colorList.find(colindex);
2666 if (
pos == colorList.end()) {
2667 colorList[colindex] = ncolor + 100;
2668 col = gROOT->GetColor(ncolor + 100);
2670 col->SetRGB((Double_t)(
red / 255.), (Double_t)(green / 255.), (Double_t)(
blue / 255.));
2672 c =
new TColor(ncolor + 100, (Double_t)(
red / 255.), (Double_t)(green / 255.), (Double_t)(
blue / 255.));
2677 tempfile >>
x[
i] >>
y[
i];
2680 if (ncolor > 0 && ncolor < 10000) {
2682 for (
int i = 0;
i < ncolor;
i++) {
2685 gStyle->SetPalette(ncolor,
colors);
2688 tempfile.seekg(0, std::ios::beg);
2689 std::cout <<
"created palette with " << ncolor <<
" colors" << std::endl;
2690 while (!tempfile.eof()) {
2693 tempfile >>
x[
i] >>
y[
i];
2695 colindex =
red + green * 1000 +
blue * 1000000;
2696 pos = colorList.find(colindex);
2697 if (
pos != colorList.end()) {
2698 TPolyLine *pline =
new TPolyLine(
npoints,
y,
x);
2699 vp.push_back(pline);
2700 pline->SetFillColor(colorList[colindex]);
2701 pline->SetLineWidth(0);
2712 axis =
new TGaxis(rangex - 140, 34, rangex - 140, rangey - 106, lminvalue, lmaxvalue, 510,
"+L");
2713 axis->SetLabelSize(0.02);
2719 l.SetTextSize(0.05);
2721 if (
tkMapLog && (fulltitle.find(
"Log10 scale") == std::string::npos))
2722 fulltitle +=
": Log10 scale";
2723 l.DrawLatex(50, rangey - 200, fulltitle.c_str());
2741 std::cout <<
"Executing " << command1 << std::endl;
2747 for (std::vector<TPolyLine *>::iterator pos1 = vp.begin(); pos1 != vp.end(); pos1++) {
2756 bool print_total,
float minval,
float maxval,
std::string s,
int width,
int height) {
2759 bool rangefound =
true;
2761 std::vector<TPolyLine *> vp;
2762 TGaxis *axis =
nullptr;
2772 std::ostringstream outs;
2778 std::map<int, TmApvPair *>::iterator i_apv;
2779 std::map<int, int>::iterator i_fed;
2781 bool useApvPairValue =
false;
2782 for (i_apv =
apvMap.begin(); i_apv !=
apvMap.end(); i_apv++) {
2784 if (apvPair !=
nullptr) {
2786 if (apv_mod !=
nullptr && !apv_mod->
notInUse()) {
2787 if (apvPair->
count > 0 || apvPair->
red != -1) {
2788 useApvPairValue =
true;
2795 for (i_apv =
apvMap.begin(); i_apv !=
apvMap.end(); i_apv++) {
2797 if (apvPair !=
nullptr) {
2799 if (apv_mod !=
nullptr && !apv_mod->
notInUse()) {
2800 if (useApvPairValue)
2802 else if (apvPair->
mpos == 0 && apv_mod->
count > 0)
2812 for (i_apv =
apvMap.begin(); i_apv !=
apvMap.end(); i_apv++) {
2814 if (apvPair !=
nullptr) {
2816 if (apv_mod !=
nullptr && !apv_mod->
notInUse()) {
2817 if (useApvPairValue) {
2821 if (maxvalue < apvPair->
value)
2824 if (apv_mod->
count > 0) {
2828 if (maxvalue < apv_mod->
value)
2841 std::ostringstream outs;
2844 *
savefile <<
"<?xml version=\"1.0\" standalone=\"no\" ?>" << std::endl;
2845 *
savefile <<
"<svg xmlns=\"http://www.w3.org/2000/svg\"" << std::endl;
2846 *
savefile <<
"xmlns:svg=\"http://www.w3.org/2000/svg\" " << std::endl;
2847 *
savefile <<
"xmlns:xlink=\"http://www.w3.org/1999/xlink\">" << std::endl;
2848 *
savefile <<
"<svg:svg id=\"mainMap\" x=\"0\" y=\"0\" viewBox=\"0 0 3000 1600" 2849 <<
"\" width=\"" <<
width <<
"\" height=\"" << height <<
"\">" << std::endl;
2850 *
savefile <<
"<svg:rect fill=\"lightblue\" stroke=\"none\" x=\"0\" y=\"0\" width=\"3000\" height=\"1600\" /> " 2852 *
savefile <<
"<svg:g id=\"fedtrackermap\" transform=\"translate(10,1500) rotate(270)\" " 2853 "style=\"fill:none;stroke:black;stroke-width:0;\"> " 2859 std::ostringstream outs;
2862 *
savefile <<
"<?xml version=\"1.0\" standalone=\"no\"?>" << std::endl;
2863 *
savefile <<
"<svg xmlns=\"http://www.w3.org/2000/svg\"" << std::endl;
2864 *
savefile <<
"xmlns:svg=\"http://www.w3.org/2000/svg\"" << std::endl;
2865 *
savefile <<
"xmlns:xlink=\"http://www.w3.org/1999/xlink\" >" << std::endl;
2866 *
savefile <<
"<script type=\"text/ecmascript\" xlink:href=\"crate.js\" />" << std::endl;
2867 *
savefile <<
"<svg id=\"mainMap\" x=\"0\" y=\"0\" viewBox=\"0 0 500 500\" width=\"700\" height=\"700\" " 2868 "onload=\"TrackerCrate.init()\">" 2870 *
savefile <<
"<rect fill=\"lightblue\" stroke=\"none\" x=\"0\" y=\"0\" width=\"700\" height=\"700\" />" 2872 *
savefile <<
"<g id=\"crate\" transform=\" translate(150,500) rotate(270) scale(1.,1.)\" > " << std::endl;
2876 int numfed_incrate = 0;
2877 for (i_fed =
fedMap.begin(); i_fed !=
fedMap.end(); i_fed++) {
2878 if (i_fed->second == crate) {
2879 int fedId = i_fed->first;
2897 for (
int nconn = 0; nconn < 96; nconn++) {
2900 if (apvPair !=
nullptr) {
2902 if (apv_mod !=
nullptr && !apv_mod->
notInUse()) {
2911 *
savefile <<
"</g> </svg> <text id=\"currentElementText\" x=\"40\" y=\"30\"> " << std::endl;
2912 *
savefile <<
"<tspan id=\"line1\" x=\"40\" y=\"30\"> </tspan> " << std::endl;
2913 *
savefile <<
"<tspan id=\"line2\" x=\"40\" y=\"60\"> </tspan> " << std::endl;
2914 *
savefile <<
" </text> </svg>" << std::endl;
2922 *
savefile <<
"</g> </svg> </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()) {
2950 const char *command1;
2954 std::ifstream tempfile(tempfilename.c_str(),
std::ios::in);
2955 TCanvas *MyC =
new TCanvas(
"MyC",
"TrackerMap",
width, height);
2956 gPad->SetFillColor(38);
2959 std::cout <<
" range x " << rangex << std::endl;
2960 std::cout <<
" range y " << rangey << std::endl;
2961 gPad->Range(0, 0, rangex, rangey);
2965 typedef std::map<int, int> ColorList;
2966 ColorList colorList;
2967 ColorList::iterator
pos;
2969 while (!tempfile.eof()) {
2971 colindex =
red + green * 1000 +
blue * 1000000;
2972 pos = colorList.find(colindex);
2973 if (
pos == colorList.end()) {
2974 colorList[colindex] = ncolor + 100;
2975 col = gROOT->GetColor(ncolor + 100);
2977 col->SetRGB((Double_t)(
red / 255.), (Double_t)(green / 255.), (Double_t)(
blue / 255.));
2979 c =
new TColor(ncolor + 100, (Double_t)(
red / 255.), (Double_t)(green / 255.), (Double_t)(
blue / 255.));
2984 tempfile >>
x[
i] >>
y[
i];
2987 if (ncolor > 0 && ncolor < 10000) {
2989 for (
int i = 0;
i < ncolor;
i++) {
2992 gStyle->SetPalette(ncolor,
colors);
2995 tempfile.seekg(0, std::ios::beg);
2996 std::cout <<
"created palette with " << ncolor <<
" colors" << std::endl;
2997 while (!tempfile.eof()) {
3000 tempfile >>
x[
i] >>
y[
i];
3002 colindex =
red + green * 1000 +
blue * 1000000;
3003 pos = colorList.find(colindex);
3004 if (
pos != colorList.end()) {
3005 TPolyLine *pline =
new TPolyLine(
npoints,
y,
x);
3006 vp.push_back(pline);
3007 pline->SetFillColor(colorList[colindex]);
3008 pline->SetLineWidth(0);
3019 axis =
new TGaxis(rangex - 140, 34, rangex - 140, rangey - 106, lminvalue, lmaxvalue, 510,
"+L");
3020 axis->SetLabelSize(0.02);
3026 l.SetTextSize(0.05);
3028 if (
tkMapLog && (fulltitle.find(
"Log10 scale") == std::string::npos))
3029 fulltitle +=
": Log10 scale";
3030 l.DrawLatex(50, rangey - 200, fulltitle.c_str());
3048 std::cout <<
"Executing " << command1 << std::endl;
3054 for (std::vector<TPolyLine *>::iterator pos1 = vp.begin(); pos1 != vp.end(); pos1++) {
3065 int ipos, ipos1, ipos2,
id = 0,
val = 0;
3068 ipos1 =
line.find(
"value=\"");
3071 ipos =
value.find(
'\"');
3075 ipos2 =
line.find(
"detid=\"");
3078 ipos =
value.find(
'\"');
3080 id = atoi(
value.c_str());
3082 if (ipos1 > 0 && ipos2 > 0 &&
val > 0)
3084 if (ipos1 > 0 && ipos2 > 0)
3088 std::cout << nline <<
" modules found in this svg file " << std::endl;
3098 std::ostringstream outs;
3119 if (
mod !=
nullptr && !
mod->notInUse()) {
3134 if (
mod !=
nullptr && !
mod->notInUse()) {
3137 if (maxvalue < mod->
value)
3151 if (
mod !=
nullptr && !
mod->notInUse()) {
3157 *
svgfile <<
"</svg:g></svg:svg>" << std::endl;
3158 *
svgfile <<
" <svg:text id=\"Title\" class=\"normalText\" x=\"300\" y=\"0\">" <<
title <<
"</svg:text>" << std::endl;
3161 *
svgfile <<
"</svg:svg>" << std::endl;
3162 *
svgfile <<
"</body></html>" << std::endl;
3168 std::cout <<
"preparing the palette" << std::endl;
3172 int paletteLength = 250;
3179 for (
int i = 1;
i < paletteLength + 1;
i++) {
3181 red = (color >> 16) & 0xFF;
3182 green = (color >> 8) & 0xFF;
3183 blue = (color)&0xFF;
3195 *
svgfile <<
"<svg:rect x=\"3610\" y=\"" << (1550 - 6 *
i) <<
"\" width=\"50\" height=\"6\" fill=\"rgb(" <<
red 3196 <<
"," << green <<
"," <<
blue <<
")\" />\n";
3198 *
svgfile << 0 <<
" " << 0 <<
" " <<
red <<
" " << green <<
" " <<
blue <<
" 4 " <<
int(
step *
i) + 34 <<
" " 3206 *
svgfile <<
"<svg:rect x=\"3610\" y=\"" << (1550 - 6 *
i)
3207 <<
"\" width=\"50\" height=\"1\" fill=\"black\" />\n";
3209 *
svgfile <<
" <svg:text class=\"normalText\" x=\"3660\" y=\"" << (1560 - 6 *
i) <<
"\">" <<
val 3210 <<
"</svg:text>" << std::endl;
3220 if (apvpair !=
nullptr) {
3222 apvpair->
green = green;
3226 std::cout <<
"*** error in FedTrackerMap fillc method ***";
3230 std::multimap<const int, TmApvPair *>::iterator
pos;
3233 if (apvpair !=
nullptr) {
3239 std::cout <<
"*** error in FedTrackerMap fill by module method ***";
3246 if (apvpair !=
nullptr) {
3247 apvpair->
value = current_val;
3251 std::cout <<
"*** error in FedTrackerMap fill_current_val method ***";
3255 int key = crate * 10000000 + slot * 100000 +
ring * 1000 +
addr;
3259 if (ccu !=
nullptr) {
3265 std::cout <<
"*** error in FecTrackerMap fillc method ***";
3269 int key = crate * 10000000 + slot * 100000 +
ring * 1000 +
addr;
3271 if (ccu !=
nullptr) {
3277 std::cout <<
"*** error in FecTrackerMap fill by module method ***";
3281 int key = rack * 1000 + crate * 100 + board;
3285 if (psu !=
nullptr) {
3291 std::cout <<
"*** error in LVTrackerMap fillc method ***";
3295 int key = rack * 1000 + crate * 100 + board;
3297 if (psu !=
nullptr) {
3303 std::cout <<
"*** error in LVTrackerMap fill by module method ***";
3307 int key = rack * 1000 + crate * 100 + board;
3311 if (psu !=
nullptr) {
3317 std::cout <<
"*** error in HVTrackerMap (channel 2) fillc method ***";
3320 int key = rack * 1000 + crate * 100 + board;
3324 if (psu !=
nullptr) {
3330 std::cout <<
"*** error in HVTrackerMap (channel 3) fillc method ***";
3334 int key = rack * 1000 + crate * 100 + board;
3336 if (psu !=
nullptr) {
3342 std::cout <<
"*** error in HVTrackerMap fill by module method ***";
3345 int key = rack * 1000 + crate * 100 + board;
3347 if (psu !=
nullptr) {
3353 std::cout <<
"*** error in HVTrackerMap fill by module method ***";
3359 if (apvpair !=
nullptr) {
3363 std::cout <<
"*** error in FedTrackerMap module method ***";
3368 if (apvpair !=
nullptr) {
3373 std::cout <<
"*** error inFedTrackerMap fill method ***";
3378 if (
mod !=
nullptr) {
3384 std::cout <<
"**************************error in fill method **************module " <<
idmod << std::endl;
3390 if (
mod !=
nullptr) {
3396 std::cout <<
"**************************error in fill method **************" << std::endl;
3400 std::map<const int, TmModule *>::iterator imod;
3402 fillc(imod->first, 255, 255, 255);
3407 std::map<const int, TmModule *>::iterator imod;
3415 if (
mod !=
nullptr) {
3416 mod->value = current_val;
3420 std::cout <<
"**error in fill_current_val method ***module " <<
idmod << std::endl;
3425 if (
mod !=
nullptr) {
3426 mod->value =
mod->value + qty;
3432 if (mod1 !=
nullptr && mod2 !=
nullptr) {
3440 std::cout <<
"**************************error in fill method **************module " <<
idmod << std::endl;
3446 if (
mod !=
nullptr) {
3447 mod->value =
mod->value + qty;
3450 std::cout <<
"**************************error in SvgModuleMap **************";
3455 if (
mod !=
nullptr) {
3458 std::cout <<
"**************************error in IdModuleMap **************";
3464 if (
mod !=
nullptr) {
3467 std::cout <<
"**************************error in SvgModuleMap **************";
3473 int nmods, pix_sil, fow_bar,
ring, nmod,
layer;
3475 float posx, posy, posz, length,
width,
thickness, widthAtHalfLength;
3476 int old_layer = 0, ntotMod = 0;
3480 infile >> nmods >> pix_sil >> fow_bar >>
layer >>
ring >> nmod >> posx >> posy >> posz >> length >>
width >>
3484 if (old_layer !=
layer) {
3502 mod->length = length;
3505 mod->widthAtHalfLength = widthAtHalfLength;
3515 float lminvalue, lmaxvalue;
3528 float delta = (lmaxvalue - lminvalue);
3529 float x = (
value - lminvalue);
3530 if (
value < lminvalue) {
3535 if (
value > lmaxvalue) {
3540 if (
value >= lminvalue &&
value <= lmaxvalue) {
3544 : (
x > ((3. / 4.) *
delta) ? 255 - 255 / (
delta / 4) * (
x - (3. / 4.) *
delta) : 255));
3546 : (
x > ((1. / 2.) *
delta) ? 0 : 255 - 255 / (
delta / 4) * (
x - (1. / 4.) *
delta)));
3550 green = (
int)((
value - lminvalue) / (lmaxvalue - lminvalue) * 256.);
3555 green = 255 - green;
3558 return (
blue | (green << 8) | (
red << 16));
3562 std::ofstream *ofilename;
3563 std::ifstream *ifilename;
3564 std::ostringstream
ofname;
3569 ifilename =
findfile(
"viewerHeader.xhtml");
3572 while (getline(*ifilename,
line)) {
3573 *ofilename <<
line << std::endl;
3575 *ofilename <<
" var tmapname=\"" <<
outputfilename <<
"\"" << std::endl;
3576 *ofilename <<
" var tmaptitle=\"" <<
title <<
"\"" << std::endl;
3577 *ofilename <<
" var ncrates=" <<
ncrates <<
";" << std::endl;
3578 *ofilename <<
" var nfeccrates=" <<
nfeccrates <<
";" << std::endl;
3579 *ofilename <<
" var npsuracks=" <<
npsuracks <<
";" << std::endl;
3584 ifilename =
findfile(
"viewerTrailer.xhtml");
3585 while (getline(*ifilename,
line)) {
3586 *ofilename <<
line << std::endl;
3600 ifilename =
findfile(
"jqviewer.js");
3603 while (getline(*ifilename,
line)) {
3604 *ofilename <<
line << std::endl;
3615 while (getline(*ifilename,
line)) {
3616 *ofilename <<
line << std::endl;
3624 ifilename =
findfile(
"feccrate.js");
3627 while (getline(*ifilename,
line)) {
3628 *ofilename <<
line << std::endl;
3639 while (getline(*ifilename,
line)) {
3640 *ofilename <<
line << std::endl;
3651 while (getline(*ifilename,
line)) {
3652 *ofilename <<
line << std::endl;
3664 while (getline(*ifilename,
line)) {
3665 *ofilename <<
line << std::endl;
3673 std::ostringstream outs, outs1, outs2;
3682 std::ostringstream outs;
3685 *
txtfile <<
"<html><head></head> <body>" << std::endl;
3690 if (
mod !=
nullptr && !
mod->notInUse()) {
3692 *
txtfile <<
"<a name=" <<
idmod <<
"><pre>" << std::endl;
3693 std::multimap<const int, TmApvPair *>::iterator
pos;
3696 if (apvpair !=
nullptr) {
3700 *
txtfile <<
"</pre><h3>" <<
mod->name <<
"</h3>" << std::endl;
3704 *
txtfile <<
"</body></html>" << std::endl;
3714 std::map<int, int>::iterator i_fed;
3717 std::ostringstream outs;
3720 *
txtfile <<
"<html><head></head> <body>" << std::endl;
3721 for (i_fed =
fedMap.begin(); i_fed !=
fedMap.end(); i_fed++) {
3722 if (i_fed->second == crate) {
3723 int fedId = i_fed->first;
3724 for (
int nconn = 0; nconn < 96; nconn++) {
3727 if (apvPair !=
nullptr) {
3729 *
txtfile <<
"<a name=" <<
idmod <<
"><pre>" << std::endl;
3731 std::ostringstream outs;
3732 outs <<
"fedchannel " << apvPair->
getFedId() <<
"/" << apvPair->
getFedCh() <<
" connects to module " 3734 *
txtfile <<
"</pre><h3>" << outs.str() <<
"</h3>" << std::endl;
3739 *
txtfile <<
"</body></html>" << std::endl;
3745 std::ostringstream outs1, outs2;
3752 std::map<int, TmCcu *>::iterator i_ccu;
3753 std::multimap<TmCcu *, TmModule *>::iterator it;
3754 std::pair<std::multimap<TmCcu *, TmModule *>::iterator, std::multimap<TmCcu *, TmModule *>::iterator>
ret;
3755 for (
int crate = 1; crate < (
nfeccrates + 1); crate++) {
3756 std::ostringstream outs;
3759 *
txtfile <<
"<html><head></head> <body>" << std::endl;
3760 for (i_ccu =
ccuMap.begin(); i_ccu !=
ccuMap.end(); i_ccu++) {
3761 TmCcu *ccu = i_ccu->second;
3762 if (ccu !=
nullptr && ccu->
getCcuCrate() == crate) {
3764 *
txtfile <<
"<a name=" <<
idmod <<
"><pre>" << std::endl;
3766 std::ostringstream outs;
3768 outs <<
"ccu is in position" << ccu->
mpos <<
"in ring but doesn't seem to have any module connected";
3770 outs <<
"ccu is in position " << ccu->
mpos <<
" in ring and connects " << ccu->
nmod <<
" modules" 3773 for (it =
ret.first; it !=
ret.second; ++it) {
3774 outs << (*it).second->idex <<
" " << (*it).second->name <<
" value= " << (*it).second->value <<
"\n\n";
3777 *
txtfile <<
"</pre><h4>" << outs.str() <<
"</h4>" << std::endl;
3781 *
txtfile <<
"</body></html>" << std::endl;
3787 std::ostringstream outs3, outs4;
3796 std::map<int, TmPsu *>::iterator ipsu;
3797 std::multimap<TmPsu *, TmModule *>::iterator it;
3798 std::pair<std::multimap<TmPsu *, TmModule *>::iterator, std::multimap<TmPsu *, TmModule *>::iterator>
ret;
3799 for (
int rack = 1; rack < (
npsuracks + 1); rack++) {
3800 std::ostringstream outs;
3804 *
txtfile <<
"<html><head></head> <body>" << std::endl;
3805 for (ipsu =
psuMap.begin(); ipsu !=
psuMap.end(); ipsu++) {
3806 TmPsu *psu = ipsu->second;
3807 if (psu !=
nullptr && psu->
getPsuRack() == rack) {
3808 *
txtfile <<
"<a name=" << psu->
idex <<
"><pre>" << std::endl;
3810 std::ostringstream outs;
3813 <<
"in crate but doesn't seem to have any module connected";
3815 outs <<
"PS is in position " << psu->
getPsuBoard() <<
" in crate and connects to " << psu->
nmod 3816 <<
" modules. " << std::endl;
3819 for (it =
ret.first; it !=
ret.second; ++it) {
3820 outs << (*it).second->idex <<
" " << (*it).second->name <<
" value= " << (*it).second->value <<
" <br>" 3823 *
txtfile <<
"</pre><h4>" << outs.str() <<
"</h4>" << std::endl;
3827 *
txtfile <<
"</body></html>" << std::endl;
3834 std::ostringstream outs5, outs6;
3843 std::map<int, TmPsu *>::iterator ipsu;
3844 std::multimap<TmPsu *, TmModule *>::iterator it;
3845 std::pair<std::multimap<TmPsu *, TmModule *>::iterator, std::multimap<TmPsu *, TmModule *>::iterator>
ret;
3846 for (
int rack = 1; rack < (
npsuracks + 1); rack++) {
3847 std::ostringstream outs;
3851 *
txtfile <<
"<html><head></head> <body>" << std::endl;
3852 for (ipsu =
psuMap.begin(); ipsu !=
psuMap.end(); ipsu++) {
3853 TmPsu *psu = ipsu->second;
3854 if (psu !=
nullptr && psu->
getPsuRack() == rack) {
3855 *
txtfile <<
"<a name=" << psu->
idex <<
"><pre>" << std::endl;
3857 std::ostringstream outsHV2;
3859 outsHV2 <<
"HV Channel002 is in position" << psu->
getPsuBoard()
3860 <<
"in crate but doesn't seem to have any module connected";
3862 outsHV2 <<
"HV Channel002 is in position " << psu->
getPsuBoard() <<
" in crate and connects to " 3863 << psu->
nmodHV2 <<
" modules. " 3864 <<
" <br>" << std::endl;
3867 for (it =
ret.first; it !=
ret.second; ++it) {
3868 if ((*it).second->HVchannel == 2) {
3869 outsHV2 << (*it).second->idex <<
" " << (*it).second->name <<
" value= " << (*it).second->value
3870 <<
" <br>" << std::endl;
3873 *
txtfile <<
"</pre><h4>" << outsHV2.str() <<
"</h4>" << std::endl;
3877 std::ostringstream outsHV3;
3879 outsHV3 <<
"HV Channel003 is in position" << psu->
getPsuBoard()
3880 <<
"in crate but doesn't seem to have any module connected";
3882 outsHV3 <<
"HV Channel003 is in position " << psu->
getPsuBoard() <<
" in crate and connects to " 3883 << psu->
nmodHV3 <<
" modules. " 3884 <<
" <br>" << std::endl;
3887 for (it =
ret.first; it !=
ret.second; ++it) {
3888 if ((*it).second->HVchannel == 3) {
3889 outsHV3 << (*it).second->idex <<
" " << (*it).second->name <<
" value= " << (*it).second->value
3890 <<
" <br>" << std::endl;
3893 *
txtfile <<
"</pre><h4>" << outsHV3.str() <<
"</h4>" << std::endl;
3897 *
txtfile <<
"</body></html>" << std::endl;
3905 float minval, maxval;
3908 if (
tkMapLog && (minval < maxval)) {
3909 minval =
pow(10., minval1);
3910 maxval =
pow(10., maxval1);
3922 std::ofstream *ofilename;
3923 std::ifstream *ifilename;
3924 std::ostringstream
ofname;
3929 ifilename =
findfile(
"viewerHeader.xhtml");
3932 while (getline(*ifilename,
line)) {
3933 *ofilename <<
line << std::endl;
3935 *ofilename <<
" var tmapname=\"" <<
outputfilename <<
"\"" << std::endl;
3936 *ofilename <<
" var tmaptitle=\"" <<
title <<
"\"" << std::endl;
3937 *ofilename <<
" var ncrates=" <<
ncrates <<
";" << std::endl;
3938 *ofilename <<
" var nfeccrates=" <<
nfeccrates <<
";" << std::endl;
3939 *ofilename <<
" var npsuracks=" <<
npsuracks <<
";" << std::endl;
3942 ifilename =
findfile(
"viewerTrailer.xhtml");
3943 while (getline(*ifilename,
line)) {
3944 *ofilename <<
line << std::endl;
3958 ifilename =
findfile(
"jqviewer.js");
3961 while (getline(*ifilename,
line)) {
3962 *ofilename <<
line << std::endl;
3973 while (getline(*ifilename,
line)) {
3974 *ofilename <<
line << std::endl;
3982 ifilename =
findfile(
"feccrate.js");
3985 while (getline(*ifilename,
line)) {
3986 *ofilename <<
line << std::endl;
3997 while (getline(*ifilename,
line)) {
3998 *ofilename <<
line << std::endl;
4009 while (getline(*ifilename,
line)) {
4010 *ofilename <<
line << std::endl;
4021 while (getline(*ifilename,
line)) {
4022 *ofilename <<
line << std::endl;
4029 command =
"scp -r ../../DQM/TrackerCommon/test/jquery/ .";
4032 command =
"scp -r ../../CommonTools/TrackerMap/data/images/ .";
4037 std::ostringstream outs;
4040 save(
true, minval, maxval, outs.str(), 3000, 1600);
4043 save(
true, minval, maxval,
s,
width, height);
4046 std::ostringstream outs;
4054 std::ostringstream outs;
4057 *
txtfile <<
"<html><head></head> <body>" << std::endl;
4062 if (
mod !=
nullptr && !
mod->notInUse()) {
4064 *
txtfile <<
"<a name=" <<
idmod <<
"><pre>" << std::endl;
4065 std::multimap<const int, TmApvPair *>::iterator
pos;
4068 if (apvpair !=
nullptr) {
4072 *
txtfile <<
"</pre><h3>" <<
mod->name <<
"</h3>" << std::endl;
4076 *
txtfile <<
"</body></html>" << std::endl;
4082 std::ostringstream outs1, outs2;
4092 std::map<int, int>::iterator i_fed;
4095 std::ostringstream outs;
4098 *
txtfile <<
"<html><head></head> <body>" << std::endl;
4099 for (i_fed =
fedMap.begin(); i_fed !=
fedMap.end(); i_fed++) {
4100 if (i_fed->second == crate) {
4101 int fedId = i_fed->first;
4102 for (
int nconn = 0; nconn < 96; nconn++) {
4105 if (apvPair !=
nullptr) {
4107 *
txtfile <<
"<a name=" <<
idmod <<
"><pre>" << std::endl;
4109 std::ostringstream outs;
4110 outs <<
"fedchannel " << apvPair->
getFedId() <<
"/" << apvPair->
getFedCh() <<
" connects to module " 4112 *
txtfile <<
"</pre><h3>" << outs.str() <<
"</h3>" << std::endl;
4117 *
txtfile <<
"</body></html>" << std::endl;
4124 std::ostringstream outs1, outs2;
4135 std::map<int, TmCcu *>::iterator i_ccu;
4136 std::multimap<TmCcu *, TmModule *>::iterator it;
4137 std::pair<std::multimap<TmCcu *, TmModule *>::iterator, std::multimap<TmCcu *, TmModule *>::iterator>
ret;
4138 for (
int crate = 1; crate < (
nfeccrates + 1); crate++) {
4139 std::ostringstream outs;
4142 *
txtfile <<
"<html><head></head> <body>" << std::endl;
4143 for (i_ccu =
ccuMap.begin(); i_ccu !=
ccuMap.end(); i_ccu++) {
4144 TmCcu *ccu = i_ccu->second;
4145 if (ccu !=
nullptr && ccu->
getCcuCrate() == crate) {
4147 *
txtfile <<
"<a name=" <<
idmod <<
"><pre>" << std::endl;
4149 std::ostringstream outs;
4151 outs <<
"ccu is in position" << ccu->
mpos <<
"in ring but doesn't seem to have any module connected";
4153 outs <<
"ccu is in position " << ccu->
mpos <<
" in ring and connects " << ccu->
nmod <<
" modules" 4156 for (it =
ret.first; it !=
ret.second; ++it) {
4157 outs << (*it).second->idex <<
" " << (*it).second->name <<
" value= " << (*it).second->value <<
"\n\n";
4160 *
txtfile <<
"</pre><h4>" << outs.str() <<
"</h4>" << std::endl;
4164 *
txtfile <<
"</body></html>" << std::endl;
4170 std::ostringstream outs3, outs4;
4182 std::map<int, TmPsu *>::iterator ipsu;
4183 std::multimap<TmPsu *, TmModule *>::iterator it;
4184 std::pair<std::multimap<TmPsu *, TmModule *>::iterator, std::multimap<TmPsu *, TmModule *>::iterator>
ret;
4185 for (
int rack = 1; rack < (
npsuracks + 1); rack++) {
4186 std::ostringstream outs;
4190 *
txtfile <<
"<html><head></head> <body>" << std::endl;
4191 for (ipsu =
psuMap.begin(); ipsu !=
psuMap.end(); ipsu++) {
4192 TmPsu *psu = ipsu->second;
4193 if (psu !=
nullptr && psu->
getPsuRack() == rack) {
4194 *
txtfile <<
"<a name=" << psu->
idex <<
"><pre>" << std::endl;
4196 std::ostringstream outs;
4199 <<
"in crate but doesn't seem to have any module connected";
4201 outs <<
"PS is in position " << psu->
getPsuBoard() <<
" in crate and connects to " << psu->
nmod 4202 <<
" modules. " << std::endl;
4205 for (it =
ret.first; it !=
ret.second; ++it) {
4206 outs << (*it).second->idex <<
" " << (*it).second->name <<
" value= " << (*it).second->value <<
" <br>" 4209 *
txtfile <<
"</pre><h4>" << outs.str() <<
"</h4>" << std::endl;
4213 *
txtfile <<
"</body></html>" << std::endl;
4220 std::ostringstream outs5, outs6;
4232 std::map<int, TmPsu *>::iterator ipsu;
4233 std::multimap<TmPsu *, TmModule *>::iterator it;
4234 std::pair<std::multimap<TmPsu *, TmModule *>::iterator, std::multimap<TmPsu *, TmModule *>::iterator>
ret;
4235 for (
int rack = 1; rack < (
npsuracks + 1); rack++) {
4236 std::ostringstream outs;
4240 *
txtfile <<
"<html><head></head> <body>" << std::endl;
4241 for (ipsu =
psuMap.begin(); ipsu !=
psuMap.end(); ipsu++) {
4242 TmPsu *psu = ipsu->second;
4243 if (psu !=
nullptr && psu->
getPsuRack() == rack) {
4244 *
txtfile <<
"<a name=" << psu->
idex <<
"><pre>" << std::endl;
4246 std::ostringstream outsHV2;
4248 outsHV2 <<
"HV Channel002 is in position" << psu->
getPsuBoard()
4249 <<
"in crate but doesn't seem to have any module connected";
4251 outsHV2 <<
"HV Channel002 is in position " << psu->
getPsuBoard() <<
" in crate and connects to " 4252 << psu->
nmodHV2 <<
" modules. " 4253 <<
" <br>" << std::endl;
4256 for (it =
ret.first; it !=
ret.second; ++it) {
4257 if ((*it).second->HVchannel == 2) {
4258 outsHV2 << (*it).second->idex <<
" " << (*it).second->name <<
" value= " << (*it).second->value
4259 <<
" <br>" << std::endl;
4262 *
txtfile <<
"</pre><h4>" << outsHV2.str() <<
"</h4>" << std::endl;
4266 std::ostringstream outsHV3;
4268 outsHV3 <<
"HV Channel003 is in position" << psu->
getPsuBoard()
4269 <<
"in crate but doesn't seem to have any module connected";
4271 outsHV3 <<
"HV Channel003 is in position " << psu->
getPsuBoard() <<
" in crate and connects to " 4272 << psu->
nmodHV3 <<
" modules. " 4273 <<
" <br>" << std::endl;
4276 for (it =
ret.first; it !=
ret.second; ++it) {
4277 if ((*it).second->HVchannel == 3) {
4278 outsHV3 << (*it).second->idex <<
" " << (*it).second->name <<
" value= " << (*it).second->value
4279 <<
" <br>" << std::endl;
4282 *
txtfile <<
"</pre><h4>" << outsHV3.str() <<
"</h4>" << std::endl;
4286 *
txtfile <<
"</body></html>" << std::endl;
4294 std::ifstream *ifilename;
4300 ifname =
"CommonTools/TrackerMap/data/" +
filename;
4304 ifname =
"CommonTools/TrackerMap/data/" +
filename;
4320 if (
mod !=
nullptr && !
mod->notInUse()) {
4335 if (
mod !=
nullptr && !
mod->notInUse()) {
4338 if (maxvalue < mod->
value)
4346 std::ostringstream outs;
4349 *
xmlfile <<
"<?xml version=\"1.0\" standalone=\"no\"?>" << std::endl;
4350 *
xmlfile <<
"<svg xmlns=\"http://www.w3.org/2000/svg\"" << std::endl;
4351 *
xmlfile <<
"xmlns:svg=\"http://www.w3.org/2000/svg\"" << std::endl;
4352 *
xmlfile <<
"xmlns:xlink=\"http://www.w3.org/1999/xlink\" >" << std::endl;
4353 *
xmlfile <<
"<script type=\"text/ecmascript\" xlink:href=\"layer.js\" />" << std::endl;
4354 *
xmlfile <<
"<svg id=\"mainMap\" x=\"0\" y=\"0\" viewBox=\"0 0 500 500\" width=\"700\" height=\"700\" " 4355 "onload=\"TrackerLayer.init()\">" 4358 *
xmlfile <<
"<g id=\"layer\" transform=\" translate(0,400) rotate(270) scale(1.,1.)\" > " << std::endl;
4360 *
xmlfile <<
"<g id=\"layer\" transform=\" translate(0,400) rotate(270) scale(1.,0.8)\" > " << std::endl;
4361 *
xmlfile <<
"<rect fill=\"lightblue\" stroke=\"none\" x=\"0\" y=\"0\" width=\"700\" height=\"700\" />" << std::endl;
4362 *
xmlfile <<
"<svg:polygon id=\"fed\" mapAttribute=\"fed\" points=\"250,40 250,10 230,10 230,40\" " 4363 "onclick=\"chooseMap(evt);\" onmouseover=\"chooseMap(evt);\" onmouseout=\"chooseMap(evt);\" " 4364 "fill=\"rgb(0,127,255)\"/>" 4366 *
xmlfile <<
"<svg:polygon id=\"fec\" mapAttribute=\"fec\" points=\"228,40 228,10 208,10 208,40\" " 4367 "onclick=\"chooseMap(evt);\" onmouseover=\"chooseMap(evt);\" onmouseout=\"chooseMap(evt);\" " 4368 "fill=\"rgb(0,127,255)\"/>" 4370 *
xmlfile <<
"<svg:polygon id=\"lv\" mapAttribute=\"lv\" points=\"206,40 206,10 186,10 186,40\" " 4371 "onclick=\"chooseMap(evt);\" onmouseover=\"chooseMap(evt);\" onmouseout=\"chooseMap(evt);\" " 4372 "fill=\"rgb(0,127,255)\"/>" 4374 *
xmlfile <<
"<svg:polygon id=\"hv\" mapAttribute=\"hv\" points=\"184,40 184,10 164,10 164,40\" " 4375 "onclick=\"chooseMap(evt);\" onmouseover=\"chooseMap(evt);\" onmouseout=\"chooseMap(evt);\" " 4376 "fill=\"rgb(0,127,255)\"/>" 4378 *
xmlfile <<
"<svg:polygon id=\"plot\" mapAttribute=\"plot\" points=\"155,45 155,5 135,5 135,45\" " 4379 "onclick=\"chooseMap(evt);\" onmouseover=\"chooseMap(evt);\" onmouseout=\"chooseMap(evt);\" " 4380 "fill=\"rgb(200,0,0)\"/>" 4389 if (
mod !=
nullptr && !
mod->notInUse()) {
4394 *
xmlfile <<
"</g> </svg> <text id=\"currentElementText\" x=\"40\" y=\"30\">" << std::endl;
4395 *
xmlfile <<
"<tspan id=\"line1\" x=\"40\" y=\"30\"> </tspan> " << std::endl;
4396 *
xmlfile <<
"<tspan id=\"line2\" x=\"40\" y=\"60\"> </tspan> " << std::endl;
4397 *
xmlfile <<
"<tspan id=\"line3\" x=\"40\" y=\"90\"> </tspan> " << std::endl;
4398 *
xmlfile <<
"<tspan id=\"line4\" x=\"40\" y=\"120\"> </tspan> " << std::endl;
4400 *
xmlfile <<
"<tspan mapAttribute=\"fed\" onclick=\"chooseMap(evt);\" onmouseover=\"chooseMap(evt);\" " 4401 "onmouseout=\"chooseMap(evt);\" x=\"15\" y=\"228\" font-size=\"12\" font-family=\"arial\" " 4402 "fill=\"white\">FED</tspan> " 4404 *
xmlfile <<
"<tspan mapAttribute=\"fec\" onclick=\"chooseMap(evt);\" onmouseover=\"chooseMap(evt);\" " 4405 "onmouseout=\"chooseMap(evt);\" x=\"15\" y=\"258\" font-size=\"12\" font-family=\"arial\" " 4406 "fill=\"white\">FEC</tspan> " 4408 *
xmlfile <<
"<tspan mapAttribute=\"lv\" onclick=\"chooseMap(evt);\" onmouseover=\"chooseMap(evt);\" " 4409 "onmouseout=\"chooseMap(evt);\" x=\"18\" y=\"289\" font-size=\"12\" font-family=\"arial\" " 4410 "fill=\"white\">LV</tspan> " 4412 *
xmlfile <<
"<tspan mapAttribute=\"hv\" onclick=\"chooseMap(evt);\" onmouseover=\"chooseMap(evt);\" " 4413 "onmouseout=\"chooseMap(evt);\" x=\"18\" y=\"319\" font-size=\"12\" font-family=\"arial\" " 4414 "fill=\"white\">HV</tspan> " 4416 *
xmlfile <<
"<tspan mapAttribute=\"plot\" onclick=\"chooseMap(evt);\" onmouseover=\"chooseMap(evt);\" " 4417 "onmouseout=\"chooseMap(evt);\" x=\"12\" y=\"360\" font-size=\"12\" font-family=\"arial\" " 4418 "fill=\"white\">PLOT</tspan> " 4421 *
xmlfile <<
"<tspan mapAttribute=\"fed\" onclick=\"chooseMap(evt);\" onmouseover=\"chooseMap(evt);\" " 4422 "onmouseout=\"chooseMap(evt);\" x=\"21\" y=\"228\" font-size=\"12\" font-family=\"arial\" " 4423 "fill=\"white\">FED</tspan> " 4425 *
xmlfile <<
"<tspan mapAttribute=\"fec\" onclick=\"chooseMap(evt);\" onmouseover=\"chooseMap(evt);\" " 4426 "onmouseout=\"chooseMap(evt);\" x=\"21\" y=\"258\" font-size=\"12\" font-family=\"arial\" " 4427 "fill=\"white\">FEC</tspan> " 4429 *
xmlfile <<
"<tspan mapAttribute=\"lv\" onclick=\"chooseMap(evt);\" onmouseover=\"chooseMap(evt);\" " 4430 "onmouseout=\"chooseMap(evt);\" x=\"24\" y=\"289\" font-size=\"12\" font-family=\"arial\" " 4431 "fill=\"white\">LV</tspan> " 4433 *
xmlfile <<
"<tspan mapAttribute=\"hv\" onclick=\"chooseMap(evt);\" onmouseover=\"chooseMap(evt);\" " 4434 "onmouseout=\"chooseMap(evt);\" x=\"24\" y=\"319\" font-size=\"12\" font-family=\"arial\" " 4435 "fill=\"white\">HV</tspan> " 4437 *
xmlfile <<
"<tspan mapAttribute=\"plot\" onclick=\"chooseMap(evt);\" onmouseover=\"chooseMap(evt);\" " 4438 "onmouseout=\"chooseMap(evt);\" x=\"17\" y=\"360\" font-size=\"12\" font-family=\"arial\" " 4439 "fill=\"white\">PLOT</tspan> " 4442 *
xmlfile <<
" </text> </svg>" << std::endl;
4456 legInfos_.back()->SetFillColor(kBlue - 9);
4458 legInfos_.back()->SetFillColor(kRed + 2);
4460 legInfos_.back()->SetFillColor(kPink - 9);
4462 legInfos_.back()->SetFillColor(kOrange + 2);
4464 legInfos_.back()->SetFillColor(kYellow);
4466 legInfos_.back()->SetFillColor(kRed + 1);
4468 legInfos_.back()->SetFillColor(kViolet - 5);
4475 "# Clusters & Digis",
4479 TLegend *myL =
new TLegend(0.56, 0.87, 0.95, 0.99);
4480 myL->SetNColumns(2);
4481 myL->SetBorderSize(0);
4482 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")
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)
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()