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) {
3367 if (apvpair !=
nullptr) {
3372 std::cout <<
"*** error inFedTrackerMap fill method ***";
3377 if (
mod !=
nullptr) {
3383 std::cout <<
"**************************error in fill method **************module " <<
idmod << std::endl;
3389 if (
mod !=
nullptr) {
3395 std::cout <<
"**************************error in fill method **************" << std::endl;
3399 std::map<const int, TmModule *>::iterator imod;
3401 fillc(imod->first, 255, 255, 255);
3406 std::map<const int, TmModule *>::iterator imod;
3414 if (
mod !=
nullptr) {
3415 mod->value = current_val;
3419 std::cout <<
"**error in fill_current_val method ***module " <<
idmod << std::endl;
3424 if (
mod !=
nullptr) {
3425 mod->value =
mod->value + qty;
3431 if (mod1 !=
nullptr && mod2 !=
nullptr) {
3439 std::cout <<
"**************************error in fill method **************module " <<
idmod << std::endl;
3445 if (
mod !=
nullptr) {
3446 mod->value =
mod->value + qty;
3449 std::cout <<
"**************************error in SvgModuleMap **************";
3454 if (
mod !=
nullptr) {
3457 std::cout <<
"**************************error in IdModuleMap **************";
3463 if (
mod !=
nullptr) {
3466 std::cout <<
"**************************error in SvgModuleMap **************";
3472 int nmods, pix_sil, fow_bar,
ring, nmod,
layer;
3474 float posx, posy, posz, length,
width,
thickness, widthAtHalfLength;
3475 int old_layer = 0, ntotMod = 0;
3479 infile >> nmods >> pix_sil >> fow_bar >>
layer >>
ring >> nmod >> posx >> posy >> posz >> length >>
width >>
3483 if (old_layer !=
layer) {
3501 mod->length = length;
3504 mod->widthAtHalfLength = widthAtHalfLength;
3514 float lminvalue, lmaxvalue;
3527 float delta = (lmaxvalue - lminvalue);
3528 float x = (
value - lminvalue);
3529 if (
value < lminvalue) {
3534 if (
value > lmaxvalue) {
3539 if (
value >= lminvalue &&
value <= lmaxvalue) {
3543 : (
x > ((3. / 4.) *
delta) ? 255 - 255 / (
delta / 4) * (
x - (3. / 4.) *
delta) : 255));
3545 : (
x > ((1. / 2.) *
delta) ? 0 : 255 - 255 / (
delta / 4) * (
x - (1. / 4.) *
delta)));
3549 green = (
int)((
value - lminvalue) / (lmaxvalue - lminvalue) * 256.);
3554 green = 255 - green;
3557 return (
blue | (green << 8) | (
red << 16));
3561 std::ofstream *ofilename;
3562 std::ifstream *ifilename;
3563 std::ostringstream
ofname;
3568 ifilename =
findfile(
"viewerHeader.xhtml");
3571 while (getline(*ifilename,
line)) {
3572 *ofilename <<
line << std::endl;
3574 *ofilename <<
" var tmapname=\"" <<
outputfilename <<
"\"" << std::endl;
3575 *ofilename <<
" var tmaptitle=\"" <<
title <<
"\"" << std::endl;
3576 *ofilename <<
" var ncrates=" <<
ncrates <<
";" << std::endl;
3577 *ofilename <<
" var nfeccrates=" <<
nfeccrates <<
";" << std::endl;
3578 *ofilename <<
" var npsuracks=" <<
npsuracks <<
";" << std::endl;
3583 ifilename =
findfile(
"viewerTrailer.xhtml");
3584 while (getline(*ifilename,
line)) {
3585 *ofilename <<
line << std::endl;
3599 ifilename =
findfile(
"jqviewer.js");
3602 while (getline(*ifilename,
line)) {
3603 *ofilename <<
line << std::endl;
3614 while (getline(*ifilename,
line)) {
3615 *ofilename <<
line << std::endl;
3623 ifilename =
findfile(
"feccrate.js");
3626 while (getline(*ifilename,
line)) {
3627 *ofilename <<
line << std::endl;
3638 while (getline(*ifilename,
line)) {
3639 *ofilename <<
line << std::endl;
3650 while (getline(*ifilename,
line)) {
3651 *ofilename <<
line << std::endl;
3663 while (getline(*ifilename,
line)) {
3664 *ofilename <<
line << std::endl;
3672 std::ostringstream outs, outs1, outs2;
3681 std::ostringstream outs;
3684 *
txtfile <<
"<html><head></head> <body>" << std::endl;
3689 if (
mod !=
nullptr && !
mod->notInUse()) {
3691 *
txtfile <<
"<a name=" <<
idmod <<
"><pre>" << std::endl;
3692 std::multimap<const int, TmApvPair *>::iterator
pos;
3695 if (apvpair !=
nullptr) {
3699 *
txtfile <<
"</pre><h3>" <<
mod->name <<
"</h3>" << std::endl;
3703 *
txtfile <<
"</body></html>" << std::endl;
3713 std::map<int, int>::iterator i_fed;
3716 std::ostringstream outs;
3719 *
txtfile <<
"<html><head></head> <body>" << std::endl;
3720 for (i_fed =
fedMap.begin(); i_fed !=
fedMap.end(); i_fed++) {
3721 if (i_fed->second == crate) {
3722 int fedId = i_fed->first;
3723 for (
int nconn = 0; nconn < 96; nconn++) {
3726 if (apvPair !=
nullptr) {
3728 *
txtfile <<
"<a name=" <<
idmod <<
"><pre>" << std::endl;
3730 std::ostringstream outs;
3731 outs <<
"fedchannel " << apvPair->
getFedId() <<
"/" << apvPair->
getFedCh() <<
" connects to module " 3733 *
txtfile <<
"</pre><h3>" << outs.str() <<
"</h3>" << std::endl;
3738 *
txtfile <<
"</body></html>" << std::endl;
3744 std::ostringstream outs1, outs2;
3751 std::map<int, TmCcu *>::iterator i_ccu;
3752 std::multimap<TmCcu *, TmModule *>::iterator it;
3753 std::pair<std::multimap<TmCcu *, TmModule *>::iterator, std::multimap<TmCcu *, TmModule *>::iterator>
ret;
3754 for (
int crate = 1; crate < (
nfeccrates + 1); crate++) {
3755 std::ostringstream outs;
3758 *
txtfile <<
"<html><head></head> <body>" << std::endl;
3759 for (i_ccu =
ccuMap.begin(); i_ccu !=
ccuMap.end(); i_ccu++) {
3760 TmCcu *ccu = i_ccu->second;
3761 if (ccu !=
nullptr && ccu->
getCcuCrate() == crate) {
3763 *
txtfile <<
"<a name=" <<
idmod <<
"><pre>" << std::endl;
3765 std::ostringstream outs;
3767 outs <<
"ccu is in position" << ccu->
mpos <<
"in ring but doesn't seem to have any module connected";
3769 outs <<
"ccu is in position " << ccu->
mpos <<
" in ring and connects " << ccu->
nmod <<
" modules" 3772 for (it =
ret.first; it !=
ret.second; ++it) {
3773 outs << (*it).second->idex <<
" " << (*it).second->name <<
" value= " << (*it).second->value <<
"\n\n";
3776 *
txtfile <<
"</pre><h4>" << outs.str() <<
"</h4>" << std::endl;
3780 *
txtfile <<
"</body></html>" << std::endl;
3786 std::ostringstream outs3, outs4;
3795 std::map<int, TmPsu *>::iterator ipsu;
3796 std::multimap<TmPsu *, TmModule *>::iterator it;
3797 std::pair<std::multimap<TmPsu *, TmModule *>::iterator, std::multimap<TmPsu *, TmModule *>::iterator>
ret;
3798 for (
int rack = 1; rack < (
npsuracks + 1); rack++) {
3799 std::ostringstream outs;
3803 *
txtfile <<
"<html><head></head> <body>" << std::endl;
3804 for (ipsu =
psuMap.begin(); ipsu !=
psuMap.end(); ipsu++) {
3805 TmPsu *psu = ipsu->second;
3806 if (psu !=
nullptr && psu->
getPsuRack() == rack) {
3807 *
txtfile <<
"<a name=" << psu->
idex <<
"><pre>" << std::endl;
3809 std::ostringstream outs;
3812 <<
"in crate but doesn't seem to have any module connected";
3814 outs <<
"PS is in position " << psu->
getPsuBoard() <<
" in crate and connects to " << psu->
nmod 3815 <<
" modules. " << std::endl;
3818 for (it =
ret.first; it !=
ret.second; ++it) {
3819 outs << (*it).second->idex <<
" " << (*it).second->name <<
" value= " << (*it).second->value <<
" <br>" 3822 *
txtfile <<
"</pre><h4>" << outs.str() <<
"</h4>" << std::endl;
3826 *
txtfile <<
"</body></html>" << std::endl;
3833 std::ostringstream outs5, outs6;
3842 std::map<int, TmPsu *>::iterator ipsu;
3843 std::multimap<TmPsu *, TmModule *>::iterator it;
3844 std::pair<std::multimap<TmPsu *, TmModule *>::iterator, std::multimap<TmPsu *, TmModule *>::iterator>
ret;
3845 for (
int rack = 1; rack < (
npsuracks + 1); rack++) {
3846 std::ostringstream outs;
3850 *
txtfile <<
"<html><head></head> <body>" << std::endl;
3851 for (ipsu =
psuMap.begin(); ipsu !=
psuMap.end(); ipsu++) {
3852 TmPsu *psu = ipsu->second;
3853 if (psu !=
nullptr && psu->
getPsuRack() == rack) {
3854 *
txtfile <<
"<a name=" << psu->
idex <<
"><pre>" << std::endl;
3856 std::ostringstream outsHV2;
3858 outsHV2 <<
"HV Channel002 is in position" << psu->
getPsuBoard()
3859 <<
"in crate but doesn't seem to have any module connected";
3861 outsHV2 <<
"HV Channel002 is in position " << psu->
getPsuBoard() <<
" in crate and connects to " 3862 << psu->
nmodHV2 <<
" modules. " 3863 <<
" <br>" << std::endl;
3866 for (it =
ret.first; it !=
ret.second; ++it) {
3867 if ((*it).second->HVchannel == 2) {
3868 outsHV2 << (*it).second->idex <<
" " << (*it).second->name <<
" value= " << (*it).second->value
3869 <<
" <br>" << std::endl;
3872 *
txtfile <<
"</pre><h4>" << outsHV2.str() <<
"</h4>" << std::endl;
3876 std::ostringstream outsHV3;
3878 outsHV3 <<
"HV Channel003 is in position" << psu->
getPsuBoard()
3879 <<
"in crate but doesn't seem to have any module connected";
3881 outsHV3 <<
"HV Channel003 is in position " << psu->
getPsuBoard() <<
" in crate and connects to " 3882 << psu->
nmodHV3 <<
" modules. " 3883 <<
" <br>" << std::endl;
3886 for (it =
ret.first; it !=
ret.second; ++it) {
3887 if ((*it).second->HVchannel == 3) {
3888 outsHV3 << (*it).second->idex <<
" " << (*it).second->name <<
" value= " << (*it).second->value
3889 <<
" <br>" << std::endl;
3892 *
txtfile <<
"</pre><h4>" << outsHV3.str() <<
"</h4>" << std::endl;
3896 *
txtfile <<
"</body></html>" << std::endl;
3904 float minval, maxval;
3907 if (
tkMapLog && (minval < maxval)) {
3908 minval =
pow(10., minval1);
3909 maxval =
pow(10., maxval1);
3921 std::ofstream *ofilename;
3922 std::ifstream *ifilename;
3923 std::ostringstream
ofname;
3928 ifilename =
findfile(
"viewerHeader.xhtml");
3931 while (getline(*ifilename,
line)) {
3932 *ofilename <<
line << std::endl;
3934 *ofilename <<
" var tmapname=\"" <<
outputfilename <<
"\"" << std::endl;
3935 *ofilename <<
" var tmaptitle=\"" <<
title <<
"\"" << std::endl;
3936 *ofilename <<
" var ncrates=" <<
ncrates <<
";" << std::endl;
3937 *ofilename <<
" var nfeccrates=" <<
nfeccrates <<
";" << std::endl;
3938 *ofilename <<
" var npsuracks=" <<
npsuracks <<
";" << std::endl;
3941 ifilename =
findfile(
"viewerTrailer.xhtml");
3942 while (getline(*ifilename,
line)) {
3943 *ofilename <<
line << std::endl;
3957 ifilename =
findfile(
"jqviewer.js");
3960 while (getline(*ifilename,
line)) {
3961 *ofilename <<
line << std::endl;
3972 while (getline(*ifilename,
line)) {
3973 *ofilename <<
line << std::endl;
3981 ifilename =
findfile(
"feccrate.js");
3984 while (getline(*ifilename,
line)) {
3985 *ofilename <<
line << std::endl;
3996 while (getline(*ifilename,
line)) {
3997 *ofilename <<
line << std::endl;
4008 while (getline(*ifilename,
line)) {
4009 *ofilename <<
line << std::endl;
4020 while (getline(*ifilename,
line)) {
4021 *ofilename <<
line << std::endl;
4028 command =
"scp -r ../../DQM/TrackerCommon/test/jquery/ .";
4031 command =
"scp -r ../../CommonTools/TrackerMap/data/images/ .";
4036 std::ostringstream outs;
4039 save(
true, minval, maxval, outs.str(), 3000, 1600);
4042 save(
true, minval, maxval,
s,
width, height);
4045 std::ostringstream outs;
4053 std::ostringstream outs;
4056 *
txtfile <<
"<html><head></head> <body>" << std::endl;
4061 if (
mod !=
nullptr && !
mod->notInUse()) {
4063 *
txtfile <<
"<a name=" <<
idmod <<
"><pre>" << std::endl;
4064 std::multimap<const int, TmApvPair *>::iterator
pos;
4067 if (apvpair !=
nullptr) {
4071 *
txtfile <<
"</pre><h3>" <<
mod->name <<
"</h3>" << std::endl;
4075 *
txtfile <<
"</body></html>" << std::endl;
4081 std::ostringstream outs1, outs2;
4091 std::map<int, int>::iterator i_fed;
4094 std::ostringstream outs;
4097 *
txtfile <<
"<html><head></head> <body>" << std::endl;
4098 for (i_fed =
fedMap.begin(); i_fed !=
fedMap.end(); i_fed++) {
4099 if (i_fed->second == crate) {
4100 int fedId = i_fed->first;
4101 for (
int nconn = 0; nconn < 96; nconn++) {
4104 if (apvPair !=
nullptr) {
4106 *
txtfile <<
"<a name=" <<
idmod <<
"><pre>" << std::endl;
4108 std::ostringstream outs;
4109 outs <<
"fedchannel " << apvPair->
getFedId() <<
"/" << apvPair->
getFedCh() <<
" connects to module " 4111 *
txtfile <<
"</pre><h3>" << outs.str() <<
"</h3>" << std::endl;
4116 *
txtfile <<
"</body></html>" << std::endl;
4123 std::ostringstream outs1, outs2;
4134 std::map<int, TmCcu *>::iterator i_ccu;
4135 std::multimap<TmCcu *, TmModule *>::iterator it;
4136 std::pair<std::multimap<TmCcu *, TmModule *>::iterator, std::multimap<TmCcu *, TmModule *>::iterator>
ret;
4137 for (
int crate = 1; crate < (
nfeccrates + 1); crate++) {
4138 std::ostringstream outs;
4141 *
txtfile <<
"<html><head></head> <body>" << std::endl;
4142 for (i_ccu =
ccuMap.begin(); i_ccu !=
ccuMap.end(); i_ccu++) {
4143 TmCcu *ccu = i_ccu->second;
4144 if (ccu !=
nullptr && ccu->
getCcuCrate() == crate) {
4146 *
txtfile <<
"<a name=" <<
idmod <<
"><pre>" << std::endl;
4148 std::ostringstream outs;
4150 outs <<
"ccu is in position" << ccu->
mpos <<
"in ring but doesn't seem to have any module connected";
4152 outs <<
"ccu is in position " << ccu->
mpos <<
" in ring and connects " << ccu->
nmod <<
" modules" 4155 for (it =
ret.first; it !=
ret.second; ++it) {
4156 outs << (*it).second->idex <<
" " << (*it).second->name <<
" value= " << (*it).second->value <<
"\n\n";
4159 *
txtfile <<
"</pre><h4>" << outs.str() <<
"</h4>" << std::endl;
4163 *
txtfile <<
"</body></html>" << std::endl;
4169 std::ostringstream outs3, outs4;
4181 std::map<int, TmPsu *>::iterator ipsu;
4182 std::multimap<TmPsu *, TmModule *>::iterator it;
4183 std::pair<std::multimap<TmPsu *, TmModule *>::iterator, std::multimap<TmPsu *, TmModule *>::iterator>
ret;
4184 for (
int rack = 1; rack < (
npsuracks + 1); rack++) {
4185 std::ostringstream outs;
4189 *
txtfile <<
"<html><head></head> <body>" << std::endl;
4190 for (ipsu =
psuMap.begin(); ipsu !=
psuMap.end(); ipsu++) {
4191 TmPsu *psu = ipsu->second;
4192 if (psu !=
nullptr && psu->
getPsuRack() == rack) {
4193 *
txtfile <<
"<a name=" << psu->
idex <<
"><pre>" << std::endl;
4195 std::ostringstream outs;
4198 <<
"in crate but doesn't seem to have any module connected";
4200 outs <<
"PS is in position " << psu->
getPsuBoard() <<
" in crate and connects to " << psu->
nmod 4201 <<
" modules. " << std::endl;
4204 for (it =
ret.first; it !=
ret.second; ++it) {
4205 outs << (*it).second->idex <<
" " << (*it).second->name <<
" value= " << (*it).second->value <<
" <br>" 4208 *
txtfile <<
"</pre><h4>" << outs.str() <<
"</h4>" << std::endl;
4212 *
txtfile <<
"</body></html>" << std::endl;
4219 std::ostringstream outs5, outs6;
4231 std::map<int, TmPsu *>::iterator ipsu;
4232 std::multimap<TmPsu *, TmModule *>::iterator it;
4233 std::pair<std::multimap<TmPsu *, TmModule *>::iterator, std::multimap<TmPsu *, TmModule *>::iterator>
ret;
4234 for (
int rack = 1; rack < (
npsuracks + 1); rack++) {
4235 std::ostringstream outs;
4239 *
txtfile <<
"<html><head></head> <body>" << std::endl;
4240 for (ipsu =
psuMap.begin(); ipsu !=
psuMap.end(); ipsu++) {
4241 TmPsu *psu = ipsu->second;
4242 if (psu !=
nullptr && psu->
getPsuRack() == rack) {
4243 *
txtfile <<
"<a name=" << psu->
idex <<
"><pre>" << std::endl;
4245 std::ostringstream outsHV2;
4247 outsHV2 <<
"HV Channel002 is in position" << psu->
getPsuBoard()
4248 <<
"in crate but doesn't seem to have any module connected";
4250 outsHV2 <<
"HV Channel002 is in position " << psu->
getPsuBoard() <<
" in crate and connects to " 4251 << psu->
nmodHV2 <<
" modules. " 4252 <<
" <br>" << std::endl;
4255 for (it =
ret.first; it !=
ret.second; ++it) {
4256 if ((*it).second->HVchannel == 2) {
4257 outsHV2 << (*it).second->idex <<
" " << (*it).second->name <<
" value= " << (*it).second->value
4258 <<
" <br>" << std::endl;
4261 *
txtfile <<
"</pre><h4>" << outsHV2.str() <<
"</h4>" << std::endl;
4265 std::ostringstream outsHV3;
4267 outsHV3 <<
"HV Channel003 is in position" << psu->
getPsuBoard()
4268 <<
"in crate but doesn't seem to have any module connected";
4270 outsHV3 <<
"HV Channel003 is in position " << psu->
getPsuBoard() <<
" in crate and connects to " 4271 << psu->
nmodHV3 <<
" modules. " 4272 <<
" <br>" << std::endl;
4275 for (it =
ret.first; it !=
ret.second; ++it) {
4276 if ((*it).second->HVchannel == 3) {
4277 outsHV3 << (*it).second->idex <<
" " << (*it).second->name <<
" value= " << (*it).second->value
4278 <<
" <br>" << std::endl;
4281 *
txtfile <<
"</pre><h4>" << outsHV3.str() <<
"</h4>" << std::endl;
4285 *
txtfile <<
"</body></html>" << std::endl;
4293 std::ifstream *ifilename;
4299 ifname =
"CommonTools/TrackerMap/data/" +
filename;
4303 ifname =
"CommonTools/TrackerMap/data/" +
filename;
4319 if (
mod !=
nullptr && !
mod->notInUse()) {
4334 if (
mod !=
nullptr && !
mod->notInUse()) {
4337 if (maxvalue < mod->
value)
4345 std::ostringstream outs;
4348 *
xmlfile <<
"<?xml version=\"1.0\" standalone=\"no\"?>" << std::endl;
4349 *
xmlfile <<
"<svg xmlns=\"http://www.w3.org/2000/svg\"" << std::endl;
4350 *
xmlfile <<
"xmlns:svg=\"http://www.w3.org/2000/svg\"" << std::endl;
4351 *
xmlfile <<
"xmlns:xlink=\"http://www.w3.org/1999/xlink\" >" << std::endl;
4352 *
xmlfile <<
"<script type=\"text/ecmascript\" xlink:href=\"layer.js\" />" << std::endl;
4353 *
xmlfile <<
"<svg id=\"mainMap\" x=\"0\" y=\"0\" viewBox=\"0 0 500 500\" width=\"700\" height=\"700\" " 4354 "onload=\"TrackerLayer.init()\">" 4357 *
xmlfile <<
"<g id=\"layer\" transform=\" translate(0,400) rotate(270) scale(1.,1.)\" > " << std::endl;
4359 *
xmlfile <<
"<g id=\"layer\" transform=\" translate(0,400) rotate(270) scale(1.,0.8)\" > " << std::endl;
4360 *
xmlfile <<
"<rect fill=\"lightblue\" stroke=\"none\" x=\"0\" y=\"0\" width=\"700\" height=\"700\" />" << std::endl;
4361 *
xmlfile <<
"<svg:polygon id=\"fed\" mapAttribute=\"fed\" points=\"250,40 250,10 230,10 230,40\" " 4362 "onclick=\"chooseMap(evt);\" onmouseover=\"chooseMap(evt);\" onmouseout=\"chooseMap(evt);\" " 4363 "fill=\"rgb(0,127,255)\"/>" 4365 *
xmlfile <<
"<svg:polygon id=\"fec\" mapAttribute=\"fec\" points=\"228,40 228,10 208,10 208,40\" " 4366 "onclick=\"chooseMap(evt);\" onmouseover=\"chooseMap(evt);\" onmouseout=\"chooseMap(evt);\" " 4367 "fill=\"rgb(0,127,255)\"/>" 4369 *
xmlfile <<
"<svg:polygon id=\"lv\" mapAttribute=\"lv\" points=\"206,40 206,10 186,10 186,40\" " 4370 "onclick=\"chooseMap(evt);\" onmouseover=\"chooseMap(evt);\" onmouseout=\"chooseMap(evt);\" " 4371 "fill=\"rgb(0,127,255)\"/>" 4373 *
xmlfile <<
"<svg:polygon id=\"hv\" mapAttribute=\"hv\" points=\"184,40 184,10 164,10 164,40\" " 4374 "onclick=\"chooseMap(evt);\" onmouseover=\"chooseMap(evt);\" onmouseout=\"chooseMap(evt);\" " 4375 "fill=\"rgb(0,127,255)\"/>" 4377 *
xmlfile <<
"<svg:polygon id=\"plot\" mapAttribute=\"plot\" points=\"155,45 155,5 135,5 135,45\" " 4378 "onclick=\"chooseMap(evt);\" onmouseover=\"chooseMap(evt);\" onmouseout=\"chooseMap(evt);\" " 4379 "fill=\"rgb(200,0,0)\"/>" 4388 if (
mod !=
nullptr && !
mod->notInUse()) {
4393 *
xmlfile <<
"</g> </svg> <text id=\"currentElementText\" x=\"40\" y=\"30\">" << std::endl;
4394 *
xmlfile <<
"<tspan id=\"line1\" x=\"40\" y=\"30\"> </tspan> " << std::endl;
4395 *
xmlfile <<
"<tspan id=\"line2\" x=\"40\" y=\"60\"> </tspan> " << std::endl;
4396 *
xmlfile <<
"<tspan id=\"line3\" x=\"40\" y=\"90\"> </tspan> " << std::endl;
4397 *
xmlfile <<
"<tspan id=\"line4\" x=\"40\" y=\"120\"> </tspan> " << std::endl;
4399 *
xmlfile <<
"<tspan mapAttribute=\"fed\" onclick=\"chooseMap(evt);\" onmouseover=\"chooseMap(evt);\" " 4400 "onmouseout=\"chooseMap(evt);\" x=\"15\" y=\"228\" font-size=\"12\" font-family=\"arial\" " 4401 "fill=\"white\">FED</tspan> " 4403 *
xmlfile <<
"<tspan mapAttribute=\"fec\" onclick=\"chooseMap(evt);\" onmouseover=\"chooseMap(evt);\" " 4404 "onmouseout=\"chooseMap(evt);\" x=\"15\" y=\"258\" font-size=\"12\" font-family=\"arial\" " 4405 "fill=\"white\">FEC</tspan> " 4407 *
xmlfile <<
"<tspan mapAttribute=\"lv\" onclick=\"chooseMap(evt);\" onmouseover=\"chooseMap(evt);\" " 4408 "onmouseout=\"chooseMap(evt);\" x=\"18\" y=\"289\" font-size=\"12\" font-family=\"arial\" " 4409 "fill=\"white\">LV</tspan> " 4411 *
xmlfile <<
"<tspan mapAttribute=\"hv\" onclick=\"chooseMap(evt);\" onmouseover=\"chooseMap(evt);\" " 4412 "onmouseout=\"chooseMap(evt);\" x=\"18\" y=\"319\" font-size=\"12\" font-family=\"arial\" " 4413 "fill=\"white\">HV</tspan> " 4415 *
xmlfile <<
"<tspan mapAttribute=\"plot\" onclick=\"chooseMap(evt);\" onmouseover=\"chooseMap(evt);\" " 4416 "onmouseout=\"chooseMap(evt);\" x=\"12\" y=\"360\" font-size=\"12\" font-family=\"arial\" " 4417 "fill=\"white\">PLOT</tspan> " 4420 *
xmlfile <<
"<tspan mapAttribute=\"fed\" onclick=\"chooseMap(evt);\" onmouseover=\"chooseMap(evt);\" " 4421 "onmouseout=\"chooseMap(evt);\" x=\"21\" y=\"228\" font-size=\"12\" font-family=\"arial\" " 4422 "fill=\"white\">FED</tspan> " 4424 *
xmlfile <<
"<tspan mapAttribute=\"fec\" onclick=\"chooseMap(evt);\" onmouseover=\"chooseMap(evt);\" " 4425 "onmouseout=\"chooseMap(evt);\" x=\"21\" y=\"258\" font-size=\"12\" font-family=\"arial\" " 4426 "fill=\"white\">FEC</tspan> " 4428 *
xmlfile <<
"<tspan mapAttribute=\"lv\" onclick=\"chooseMap(evt);\" onmouseover=\"chooseMap(evt);\" " 4429 "onmouseout=\"chooseMap(evt);\" x=\"24\" y=\"289\" font-size=\"12\" font-family=\"arial\" " 4430 "fill=\"white\">LV</tspan> " 4432 *
xmlfile <<
"<tspan mapAttribute=\"hv\" onclick=\"chooseMap(evt);\" onmouseover=\"chooseMap(evt);\" " 4433 "onmouseout=\"chooseMap(evt);\" x=\"24\" y=\"319\" font-size=\"12\" font-family=\"arial\" " 4434 "fill=\"white\">HV</tspan> " 4436 *
xmlfile <<
"<tspan mapAttribute=\"plot\" onclick=\"chooseMap(evt);\" onmouseover=\"chooseMap(evt);\" " 4437 "onmouseout=\"chooseMap(evt);\" x=\"17\" y=\"360\" font-size=\"12\" font-family=\"arial\" " 4438 "fill=\"white\">PLOT</tspan> " 4441 *
xmlfile <<
" </text> </svg>" << std::endl;
4455 legInfos_.back()->SetFillColor(kBlue - 9);
4457 legInfos_.back()->SetFillColor(kRed + 2);
4459 legInfos_.back()->SetFillColor(kPink - 9);
4461 legInfos_.back()->SetFillColor(kOrange + 2);
4463 legInfos_.back()->SetFillColor(kYellow);
4465 legInfos_.back()->SetFillColor(kRed + 1);
4467 legInfos_.back()->SetFillColor(kViolet - 5);
4474 "# Clusters & Digis",
4478 TLegend *myL =
new TLegend(0.56, 0.87, 0.95, 0.99);
4479 myL->SetNColumns(2);
4480 myL->SetBorderSize(0);
4481 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()