15 #include "TPolyLine.h"
36 jsfilename=
"CommonTools/TrackerMap/data/trackermap.txt";
37 infilename=
"CommonTools/TrackerMap/data/tracker.dat";
39 if(tkmapPset.
exists(
"trackermaptxtPath")){
56 }
else std::cout <<
"no parameters found" << std::endl;
61 const std::vector<unsigned short> feds = tkFed->feds();
62 std::cout<<
"SiStripFedCabling has "<< feds.size()<<
" active FEDS"<<std::endl;
65 for(std::vector<unsigned short>::const_iterator ifed = feds.begin();ifed<feds.end();ifed++){
66 const std::vector<FedChannelConnection> theconn = tkFed->connections( *ifed );
68 for(std::vector<FedChannelConnection>::const_iterator iconn = theconn.begin();iconn<theconn.end();iconn++){
79 int key = iconn->fedId()*1000+iconn->fedCh();
81 if(apvpair!=0)
std::cout <<
"Fed "<< iconn->fedId() <<
" channel " << iconn->fedCh() <<
" seem to be already loaded!"<<std::endl;
86 if(
fedMap[iconn->fedId()]==0){num_crate=num_board/18+1;
fedMap[iconn->fedId()]=num_crate;num_board++;}
90 apvpair->
mpos=iconn->apvPairNumber();
92 apvModuleMap.insert(std::make_pair(iconn->detId(),apvpair));
95 apvpair->
text=s.str();
100 std::cout << num_crate <<
" crates used "<< std::endl;
102 std::map<int , TmModule *>::iterator i_mod;
106 std::ostringstream outs,outs1;
107 outs <<
" connected to ";
112 std::multimap<const int, TmApvPair*>::iterator
pos;
118 outs1 << apvpair->
idex+apvpair->
crate*1000000<<
",";
123 outs<<
"("<<nchan<<
")";
125 std::string
s = outs1.str(); s.erase(s.end()-1,s.end());
132 int nfec=0;
int nccu;
int nmod;
136 std::string Ccufilename=tkmapPset.
getUntrackedParameter<std::string>(
"trackerdatPath",
"")+
"cculist.txt";
139 while(!Ccufile.eof()) {
140 Ccufile >> crate >> slot >> ring >> addr >>
pos;
141 getline(Ccufile,dummys);
142 int key =crate*10000000+slot*100000+ring*1000+addr;
145 ccu =
new TmCcu(crate,slot,ring,addr);
151 for ( std::vector<SiStripFecCrate>::const_iterator icrate = fecCabling_->
crates().begin(); icrate != fecCabling_->
crates().end(); icrate++ ) {
152 for ( std::vector<SiStripFec>::const_iterator ifec = icrate->fecs().begin(); ifec != icrate->fecs().end(); ifec++ ) {
153 for ( std::vector<SiStripRing>::const_iterator iring = ifec->rings().begin(); iring != ifec->rings().end(); iring++ ) {
155 for ( std::vector<SiStripCcu>::const_iterator iccu = iring->ccus().begin(); iccu != iring->ccus().end(); iccu++ ) {
157 int key = icrate->fecCrate()*10000000+ifec->fecSlot()*100000+iring->fecRing()*1000+iccu->ccuAddr();
160 for ( std::vector<SiStripModule>::const_iterator imod = iccu->modules().begin(); imod != iccu->modules().end(); imod++ ) {
167 if(ccu==0)
std::cout <<key<<
" This ccu seems to have not been stored! " << std::endl;
else{ ccu->
nmod=nmod;ccu->
layer=layer;}
175 std::map<int , TmCcu *>::iterator i_ccu;
176 std::multimap<TmCcu*, TmModule*>::iterator it;
177 std::pair<std::multimap<TmCcu*, TmModule*>::iterator,std::multimap<TmCcu*, TmModule*>::iterator>
ret;
179 for( i_ccu=
ccuMap.begin();i_ccu !=
ccuMap.end(); i_ccu++){
180 TmCcu * ccu= i_ccu->second;
183 std::ostringstream outs;
184 std::ostringstream outs1;
188 for (it = ret.first; it != ret.second; ++it)
190 outs << (*it).second->idex <<
" ";
191 outs1 << (*it).second->getKey() <<
",";
194 ccu->
text=outs.str();
209 int npsu=0;
int nmod,nmodHV2,nmodHV3;
210 int modId1,modId2, dcuId;
211 int dcs,branch,crate,board;
213 std::string channelstr1;
221 std::string LVfilename=tkmapPset.
getUntrackedParameter<std::string>(
"trackerdatPath",
"")+
"psdcumap.dat";
222 std::string HVfilename=tkmapPset.
getUntrackedParameter<std::string>(
"trackerdatPath",
"")+
"hvmap.dat";
226 std::cout<<LVfilename<<
" "<<HVfilename<<std::endl;
232 while(!HVfile.eof()) {
233 HVfile >> modId2 >> channelstr1;
234 std::string channelstr2 = channelstr1.substr(9,1);
235 channel= atoi(channelstr2.c_str());
238 imod->HVchannel=channel;
245 while(!LVfile.eof()) {
246 LVfile >> modId1 >> dcuId >> psinfo;
248 int length=psinfo.length();
249 std::string dcsinfo = psinfo.substr(39,1);
251 std::string crateinfo= psinfo.substr(69,1);
252 std::string boardinfo = psinfo.substr(80,2);
253 std::string psIdinfo = psinfo.substr(83,length-83);
255 dcs= atoi(dcsinfo.c_str());
256 branch= atoi(branchinfo.c_str());
257 crate= atoi(crateinfo.c_str())+1;
258 board= atoi(boardinfo.c_str())+1;
260 if(dcs==1)rack=(branch+1)/2;
261 if(dcs==2)rack=(branch+1)/2 + 7;
262 if(dcs==3)rack=(branch+1)/2 + 15;
263 if(dcs==4)rack=(branch+1)/2 + 22;
265 int key = rack*1000+crate*100+board;
270 psu =
new TmPsu(dcs,branch,rack,crate,board);
282 std::map<int , TmPsu *>::iterator ipsu;
283 std::multimap<TmPsu*, TmModule*>::iterator it;
284 std::pair<std::multimap<TmPsu*, TmModule*>::iterator,std::multimap<TmPsu*, TmModule*>::iterator>
ret;
288 TmPsu * psu= ipsu->second;
293 std::ostringstream outs;
294 std::ostringstream outs1;
296 std::ostringstream outs3;
297 std::ostringstream outs4;
299 std::ostringstream outs5;
300 std::ostringstream outs6;
317 for (it = ret.first; it != ret.second; ++it)
320 outs << (*it).second->idex <<
", ";
321 outs1 << (*it).second->getKey() <<
",";
324 if((*it).second->HVchannel==2){
326 outs3 << (*it).second->idex <<
", ";
327 outs4 << (*it).second->getKey() <<
",";}
328 else if((*it).second->HVchannel==3){
330 outs5 << (*it).second->idex <<
", ";
331 outs6 << (*it).second->getKey() <<
",";}
338 outs <<
"(" << psu->
nmod <<
")";
339 psu->
text=outs.str();
346 outs3 <<
"(" << psu->
nmodHV2 <<
")";
347 outs5 <<
"(" << psu->
nmodHV3 <<
")";
366 jsfilename=
"CommonTools/TrackerMap/data/trackermap.txt";
367 infilename=
"CommonTools/TrackerMap/data/tracker.dat";
370 if(tkmapPset.
exists(
"trackermaptxtPath")){
375 }
else std::cout <<
"no parameters found" << std::endl;
383 jsfilename=
"CommonTools/TrackerMap/data/trackermap.txt";
384 infilename=
"CommonTools/TrackerMap/data/tracker.dat";
391 std::map<int , TmModule *>::iterator i_mod;
415 for (
int subdet=1; subdet <
ndet+1; subdet++){
416 for (
int detpart=1; detpart <
npart+1; detpart++){
418 for(
int layer=1; layer < nlayers+1; layer++){
421 int layer_g =
nlayer(subdet,detpart,layer);
424 if(subdet==3 && detpart!=2)
firstRing[layer_g-1]= 8-nrings;
450 for (
int layer=1; layer < 44; layer++){
455 if(mod !=0 )
delete mod;
465 std::map<int , TmApvPair *>::iterator i_apv;
466 for( i_apv=
apvMap.begin();i_apv !=
apvMap.end(); i_apv++){
472 std::map<int , TmCcu *>::iterator i_ccu;
473 for( i_ccu=
ccuMap.begin();i_ccu !=
ccuMap.end(); i_ccu++){
474 TmCcu * ccu= i_ccu->second;
478 std::map<int , TmPsu *>::iterator ipsu;
480 TmPsu * psu= ipsu->second;
497 double phi,
r,dx,dy, dy1;
498 double xp[4],yp[4],xp1,yp1;
499 double vhbot,vhtop,vhapo;
500 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};
501 double xt1,yt1,xs1=0.,ys1=0.,xt2,yt2,xs2,ys2,pv1,pv2;
518 if(nlay >12 && nlay <19){
520 xp[0]=r-vhtop;yp[0]=-vhapo;
521 xp[1]=r+vhtop;yp[1]=-vhapo;
522 xp[2]=r+vhtop;yp[2]=vhapo;
523 xp[3]=r-vhtop;yp[3]=vhapo;
526 xp[0]=r-vhapo;yp[0]=-vhbot;
527 xp[1]=r+vhapo;yp[1]=-vhtop;
528 xp[2]=r+vhapo;yp[2]=vhtop;
529 xp[3]=r-vhapo;yp[3]=vhbot;
531 for(
int j=0;
j<4;
j++){
532 xp1 = xp[
j]*
cos(phi)-yp[
j]*
sin(phi);
533 yp1 = xp[
j]*
sin(phi)+yp[
j]*
cos(phi);
534 xp[
j] = xp1;yp[
j]=yp1;
537 numod=mod->
idModule;
if(numod>100)numod=numod-100;
538 int vane = mod->
ring;
542 xt1=rmedio[nlay-31]; yt1=-vhtop/2.;
543 xs1 = xt1*
cos(phi)-yt1*
sin(phi);
544 ys1 = xt1*
sin(phi)+yt1*
cos(phi);
545 xt2=rmedio[nlay-31]; yt2=vhtop/2.;
546 xs2 = xt2*
cos(phi)-yt2*
sin(phi);
547 ys2 = xt2*
sin(phi)+yt2*
cos(phi);
550 if(nlay==31)dy1=0.39;
551 if(nlay==32)dy1=0.23;
552 if(nlay==33)dy1=0.16;
553 xp[0]=vane*(dx+dx/8.);yp[0]=numod*(dy1);
554 xp[1]=vane*(dx+dx/8.)+dx;yp[1]=numod*(dy1);
555 xp[2]=vane*(dx+dx/8.)+dx;yp[2]=numod*(dy1)+dy;
556 xp[3]=vane*(dx+dx/8.);yp[3]=numod*(dy1)+dy;
558 xt1=
r; yt1=-vhtop/2.;
559 xs1 = xt1*
cos(phi)-yt1*
sin(phi);
560 ys1 = xt1*
sin(phi)+yt1*
cos(phi);
562 xs2 = xt2*
cos(phi)-yt2*
sin(phi);
563 ys2 = xt2*
sin(phi)+yt2*
cos(phi);
566 if(fabs(pv1-pv2)>
M_PI && numod==1)pv1=pv1-2.*
M_PI;
567 if(fabs(pv1-pv2)>
M_PI && numod!=1)pv2=pv2+2.*
M_PI;
568 xp[0]=mod->
posz-vhapo/2.;yp[0]=4.2*pv1;
569 xp[1]=mod->
posz+vhapo/2.;yp[1]=4.2*pv1;
570 xp[2]=mod->
posz+vhapo/2. ;yp[2]=4.2*pv2;
571 xp[3]=mod->
posz-vhapo/2.;yp[3]=4.2*pv2;
586 for(
int j=0;
j<4;
j++){
591 sprintf(buffer,
"%X",mod->
idex);
595 red=(color>>16)&0xFF;
596 green=(color>>8)&0xFF;
602 if(
temporary_file) *svgfile << red <<
" " << green <<
" " << blue <<
" ";
else
603 *svgfile <<
"<svg:polygon detid=\""<<mod->
idex<<
"\" count=\""<<mod->
count <<
"\" value=\""<<mod->
value<<
"\" id=\""<<key<<
"\" capvids=\""<<mod->
capvids<<
"\" lv=\""<<mod->
psuIdex<<
"\" hv=\""<<mod->
psuIdex*10 + mod->
HVchannel<<
"\" fec=\""<<mod->
CcuId<<
"\" onclick=\"showData(evt);\" onmouseover=\"showData(evt);\" onmouseout=\"showData(evt);\" MESSAGE=\""<<mod->
text<<
"\" POS=\""<<mod->
name<<
" \" fill=\"rgb("<<red<<
","<<green<<
","<<blue<<
")\" points=\"";
605 if(
temporary_file) *svgfile << 255 <<
" " << 255 <<
" " << 255 <<
" ";
else
606 *svgfile <<
"<svg:polygon detid=\""<<mod->
idex<<
"\" count=\""<<mod->
count <<
"\" value=\""<<mod->
value<<
"\" id=\""<<key<<
"\" capvids=\""<<mod->
capvids<<
"\" lv=\""<<mod->
psuIdex<<
"\" hv=\""<<mod->
psuIdex*10 + mod->
HVchannel<<
"\" fec=\""<<mod->
CcuId<<
"\" onclick=\"showData(evt);\" onmouseover=\"showData(evt);\" onmouseout=\"showData(evt);\" MESSAGE=\""<<mod->
text<<
"\" POS=\""<<mod->
name<<
" \" fill=\"white\" points=\"";
608 for(
int k=0;
k<
np;
k++){
610 *svgfile << xd[
k] <<
"," << yd[
k] <<
" " ;
612 if(
temporary_file)*svgfile << std::endl;
else *svgfile <<
"\" />" <<std::endl;
614 if(mod->
red>255)mod->
red=255;
618 *svgfile <<
"<svg:polygon detid=\""<<mod->
idex<<
"\" count=\""<<mod->
count <<
"\" value=\""<<mod->
value<<
"\" id=\""<<key<<
"\" capvids=\""<<mod->
capvids<<
"\" lv=\""<<mod->
psuIdex<<
"\" hv=\""<<mod->
psuIdex*10 + mod->
HVchannel<<
"\" fec=\""<<mod->
CcuId<<
"\" onclick=\"showData(evt);\" onmouseover=\"showData(evt);\" onmouseout=\"showData(evt);\" MESSAGE=\""<<mod->
text<<
"\" POS=\""<<mod->
name<<
" \" fill=\"rgb("<<mod->
red<<
","<<mod->
green<<
","<<mod->
blue<<
")\" points=\"";
620 for(
int k=0;
k<
np;
k++){
622 *svgfile << xd[
k] <<
"," << yd[
k] <<
" " ;
624 if(
temporary_file)*svgfile << std::endl;
else *svgfile <<
"\" />" <<std::endl;
635 std::vector<TPolyLine*> vp;
637 size_t found=filetype.find_last_of(
".");
638 filetype=filetype.substr(found+1);
639 found=outputfilename.find_last_of(
".");
640 outputfilename=outputfilename.substr(0,found);
644 std::ostringstream outs;
646 outs << outputfilename <<
".coor";
649 for (
int layer=1; layer < 44; layer++){
665 for (
int layer=1; layer < 44; layer++){
680 *
savefile <<
"<?xml version=\"1.0\" standalone=\"no\" ?>"<<std::endl;
681 *
savefile <<
"<svg xmlns=\"http://www.w3.org/2000/svg\""<<std::endl;
682 *
savefile <<
"xmlns:svg=\"http://www.w3.org/2000/svg\" "<<std::endl;
683 *
savefile <<
"xmlns:xlink=\"http://www.w3.org/1999/xlink\">"<<std::endl;
684 *
savefile <<
"<svg:svg id=\"mainMap\" x=\"0\" y=\"0\" viewBox=\"0 0 3100 1600"<<
"\" width=\""<<width<<
"\" height=\""<<height<<
"\">"<<std::endl;
685 *
savefile <<
"<svg:rect fill=\"lightblue\" stroke=\"none\" x=\"0\" y=\"0\" width=\"3100\" height=\"1600\" /> "<<std::endl;
686 *
savefile <<
"<svg:g id=\"tracker\" transform=\"translate(10,1500) rotate(270)\" style=\"fill:none;stroke:black;stroke-width:0;\"> "<<std::endl;
688 for (
int layer=1; layer < 44; layer++){
704 *
savefile <<
" <svg:text id=\"Title\" class=\"normalText\" x=\"300\" y=\"0\">"<<
title<<
"</svg:text>"<<std::endl;
709 *
savefile <<
"</svg:svg>"<<std::endl;
714 const char * command1;
715 std::string tempfilename = outputfilename +
".coor";
717 std::string
command =
"mv "+tempfilename +
" " +outputfilename +
".svg";
718 command1=command.c_str();
719 std::cout <<
"Executing " << command1 << std::endl;
724 int red,
green,blue,npoints,colindex,ncolor;
727 TCanvas *MyC =
new TCanvas(
"MyC",
"TrackerMap",width,height);
728 gPad->SetFillColor(38);
730 if(
addPixelFlag)gPad->Range(0,0,3800,1600);
else gPad->Range(800,0,3800,1600);
734 typedef std::map<int,int> ColorList;
736 ColorList::iterator
pos;
738 std::cout<<
"tempfilename "<<tempfilename<<std::endl;
739 while(!tempfile.eof()) {
740 tempfile >> red >> green >> blue >> npoints;
741 colindex=red+green*1000+blue*1000000;
742 pos=colorList.find(colindex);
743 if(pos == colorList.end()){ colorList[colindex]=ncolor+100; col =gROOT->GetColor(ncolor+100);
744 if(col) col->SetRGB((Double_t)(red/255.),(Double_t)(green/255.),(Double_t)(blue/255.));
else c =
new TColor(ncolor+100,(Double_t)(red/255.),(Double_t)(green/255.),(Double_t)(blue/255.));
vc.push_back(c); ncolor++;}
745 for (
int i=0;
i<npoints;
i++){
746 tempfile >> x[
i] >> y[
i];
750 if(ncolor>0 && ncolor<10000){
752 for(
int i=0;
i<ncolor;
i++){colors[
i]=
i+100;}
753 gStyle->SetPalette(ncolor,colors);
757 tempfile.seekg(0,std::ios::beg);
758 std::cout <<
"created palette with " << ncolor <<
" colors" << std::endl;
760 while(!tempfile.eof()) {
761 tempfile >> red >> green >> blue >> npoints;
762 for (
int i=0;
i<npoints;
i++){
763 tempfile >> x[
i] >> y[
i];
765 colindex=red+green*1000+blue*1000000;
766 pos=colorList.find(colindex);
767 if(pos != colorList.end()){
768 TPolyLine* pline =
new TPolyLine(npoints,y,x);
770 pline->SetFillColor(colorList[colindex]);
771 pline->SetLineWidth(0);
777 axis->SetLabelSize(0.02);
782 l.DrawLatex(950,1330,
"TID");
783 l.DrawLatex(2300,1330,
"TEC");
784 l.DrawLatex(300,1330,
"FPIX");
785 l.DrawLatex(20,560,
"BPIX L1");
786 l.DrawLatex(500,385,
"BPIX L2");
787 l.DrawLatex(500,945,
"BPIX L3");
789 l.DrawLatex(850,1500,
title.c_str());
790 l.DrawLatex(1730,40,
"-z");
791 l.DrawLatex(1730,1360,
"+z");
792 l.DrawLatex(1085,330,
"TIB L1");
793 l.DrawLatex(1085,1000,
"TIB L2");
794 l.DrawLatex(1585,330,
"TIB L3");
795 l.DrawLatex(1585,1000,
"TIB L4");
796 l.DrawLatex(2085,330,
"TOB L1");
797 l.DrawLatex(2085,1000,
"TOB L2");
798 l.DrawLatex(2585,330,
"TOB L3");
799 l.DrawLatex(2585,1000,
"TOB L4");
800 l.DrawLatex(3085,330,
"TOB L5");
801 l.DrawLatex(3085,1000,
"TOB L6");
802 TArrow arx(3448,1190,3448,1350,0.01,
"|>");
803 l.DrawLatex(3460,1350,
"x");
804 TArrow ary(3448,1190,3312,1190,0.01,
"|>");
805 l.DrawLatex(3312,1210,
"y");
806 TArrow arz(3485,373,3485,676,0.01,
"|>");
807 l.DrawLatex(3510,667,
"z");
808 TArrow arphi(3485,511,3037,511,0.01,
"|>");
809 l.DrawLatex(3023,520,
"#Phi");
813 arphi.SetLineWidth(3);
821 std::string
filename = outputfilename +
".png";
822 std::cout <<
"printing " <<filename<< std::endl;
823 MyC->Print(filename.c_str());
826 std::string
filename = outputfilename +
".jpg";
827 MyC->Print(filename.c_str());
830 std::string
filename = outputfilename +
".pdf";
831 MyC->Print(filename.c_str());
833 std::string
command =
"rm "+tempfilename ;
834 command1=command.c_str();
835 std::cout <<
"Executing " << command1 << std::endl;
840 for(std::vector<TPolyLine*>::iterator pos1=vp.begin();pos1!=vp.end();pos1++){
856 double boxinitx=0., boxinity=0.;
858 int numfedch_incolumn = 12;
859 int numfedch_inrow = 8;
860 int numfed_incolumn = 5;
861 int numfed_inrow = 4;
862 boxinitx=boxinitx+(numfed_incolumn-(numfed_incrate-1)/numfed_inrow)*14.;
863 boxinity=boxinity+(numfed_inrow-(numfed_incrate-1)%numfed_inrow)*9.;
864 boxinity=boxinity+numfedch_inrow-(apvPair->
getFedCh()/numfedch_incolumn);
865 boxinitx = boxinitx+numfedch_incolumn-(int)(apvPair->
getFedCh()%numfedch_incolumn);
867 xp[0]=boxinitx;yp[0]=boxinity;
868 xp[1]=boxinitx+dx;yp[1]=boxinity;
869 xp[2]=boxinitx+dx;yp[2]=boxinity + dy;
870 xp[3]=boxinitx;yp[3]=boxinity + dy;
871 for(
int j=0;
j<4;
j++){
877 sprintf(buffer,
"%X",apvPair->
mod->
idex);
879 s.erase(s.begin()+s.find(
"connected"),s.end());
882 if(apvPair->
red < 0){
883 if(apvPair->
count > 0) {
885 red=(color>>16)&0xFF;
886 green=(color>>8)&0xFF;
889 if(
temporary_file)*svgfile << red <<
" " << green <<
" " << blue <<
" ";
890 else *svgfile <<
"<svg:polygon detid=\""<<apvPair->
idex<<
"\" count=\""<<apvPair->
count <<
"\" value=\""<<apvPair->
value<<
"\" id=\""<<apvPair->
idex+crate*1000000<<
"\" cmodid=\""<<apvPair->
mod->
getKey()<<
"\" onclick=\"showData(evt);\" onmouseover=\"showData(evt);\" onmouseout=\"showData(evt);\" MESSAGE=\"""\" POS=\"Fed/Ch "<<apvPair->
getFedId()<<
"/"<<apvPair->
getFedCh()<<
" connected to "<<s<<
" Id "<<buffer<<
" \" fill=\"rgb("<<red<<
","<<green<<
","<<blue<<
")\" points=\"";
892 if(
temporary_file)*svgfile << 255 <<
" " << 255 <<
" " << 255 <<
" ";
893 else *svgfile <<
"<svg:polygon detid=\""<<apvPair->
idex<<
"\" count=\""<<apvPair->
count <<
"\" value=\""<<apvPair->
value<<
"\" id=\""<<apvPair->
idex+crate*1000000<<
"\" cmodid=\""<<apvPair->
mod->
getKey()<<
"\" onclick=\"showData(evt);\" onmouseover=\"showData(evt);\" onmouseout=\"showData(evt);\" MESSAGE=\"""\" POS=\"Fed/Ch "<<apvPair->
getFedId()<<
"/"<<apvPair->
getFedCh()<<
" connected to "<<s<<
" Id "<<buffer<<
" \" fill=\"white\" points=\"";
896 if(apvPair->
red>255)apvPair->
red=255;
898 if(apvPair->
blue>255)apvPair->
blue=255;
900 else *svgfile <<
"<svg:polygon detid=\""<<apvPair->
idex<<
"\" count=\""<<apvPair->
count <<
"\" value=\""<<apvPair->
value<<
"\" id=\""<<apvPair->
idex+crate*1000000<<
"\" cmodid=\""<<apvPair->
mod->
getKey()<<
"\" onclick=\"showData(evt);\" onmouseover=\"showData(evt);\" onmouseout=\"showData(evt);\" MESSAGE=\"""\" POS=\"Fed/Ch "<<apvPair->
getFedId()<<
"/"<<apvPair->
getFedCh()<<
" connected to "<<s<<
" Id "<<buffer<<
" \" fill=\"rgb("<<apvPair->
red<<
","<<apvPair->
green<<
","<<apvPair->
blue<<
")\" points=\"";
903 if(apvPair->
mod->
red < 0){
906 red=(color>>16)&0xFF;
907 green=(color>>8)&0xFF;
909 if(
temporary_file)*svgfile << red <<
" " << green <<
" " << blue <<
" ";
910 else *svgfile <<
"<svg:polygon detid=\""<<apvPair->
idex<<
"\" count=\""<<apvPair->
count <<
"\" value=\""<<apvPair->
value<<
"\" id=\""<<apvPair->
idex+crate*1000000<<
"\" cmodid=\""<<apvPair->
mod->
getKey()<<
"\" onclick=\"showData(evt);\" onmouseover=\"showData(evt);\" onmouseout=\"showData(evt);\" MESSAGE=\"""\" POS=\"Fed/Ch "<<apvPair->
getFedId()<<
"/"<<apvPair->
getFedCh()<<
" connected to "<<s<<
" Id "<<buffer<<
" \" fill=\"rgb("<<red<<
","<<green<<
","<<blue<<
")\" points=\"";
912 if(
temporary_file)*svgfile << 255 <<
" " << 255 <<
" " << 255 <<
" ";
913 else *svgfile <<
"<svg:polygon detid=\""<<apvPair->
idex<<
"\" count=\""<<apvPair->
count <<
"\" value=\""<<apvPair->
value<<
"\" id=\""<<apvPair->
idex+crate*1000000<<
"\" cmodid=\""<<apvPair->
mod->
getKey()<<
"\" onclick=\"showData(evt);\" onmouseover=\"showData(evt);\" onmouseout=\"showData(evt);\" MESSAGE=\"""\" POS=\"Fed/Ch "<<apvPair->
getFedId()<<
"/"<<apvPair->
getFedCh()<<
" connected to "<<s<<
" Id "<<buffer<<
" \" fill=\"white\" points=\"";
920 else *svgfile <<
"<svg:polygon detid=\""<<apvPair->
idex<<
"\" count=\""<<apvPair->
count <<
"\" value=\""<<apvPair->
value<<
"\" id=\""<<apvPair->
idex+crate*1000000<<
"\" cmodid=\""<<apvPair->
mod->
getKey()<<
"\" onclick=\"showData(evt);\" onmouseover=\"showData(evt);\" onmouseout=\"showData(evt);\" MESSAGE=\"""\" POS=\"Fed/Ch "<<apvPair->
getFedId()<<
"/"<<apvPair->
getFedCh()<<
" connected to "<<s<<
" Id "<<buffer<<
" \" fill=\"rgb("<<apvPair->
mod->
red<<
","<<apvPair->
mod->
green<<
","<<apvPair->
mod->
blue<<
")\" points=\"";
924 for(
int k=0;
k<
np;
k++){
926 else *svgfile << xd[
k] <<
"," << yd[
k] <<
" " ;
929 else *svgfile <<
"\" />" <<std::endl;
940 double boxinitx=0., boxinity=0.;
942 int numccu_incolumn = 8;
943 int numccu_inrow = 15;
944 int numfed_incolumn = 5;
945 int numfed_inrow = 4;
946 boxinitx=boxinitx+(numfed_incolumn-(numfec_incrate-1)/numfed_inrow)*14.;
947 boxinity=boxinity+(numfed_inrow-(numfec_incrate-1)%numfed_inrow)*16.;
948 boxinity=boxinity+numccu_inrow-ccu->
mpos;
949 boxinitx = boxinitx+numccu_incolumn-(int)(ccu->
getCcuRing()%numccu_incolumn);
951 xp[0]=boxinitx;yp[0]=boxinity;
952 xp[1]=boxinitx+dx;yp[1]=boxinity;
953 xp[2]=boxinitx+dx;yp[2]=boxinity + dy;
954 xp[3]=boxinitx;yp[3]=boxinity + dy;
955 for(
int j=0;
j<4;
j++){
961 sprintf(buffer,
"%X",ccu->
idex);
964 std::string
s = ccu->
text;
965 s.erase(s.begin()+s.find(
"connected"),s.end());
970 red=(color>>16)&0xFF;
971 green=(color>>8)&0xFF;
974 if(
temporary_file)*svgfile << red <<
" " << green <<
" " << blue <<
" ";
975 else *svgfile <<
"<svg:polygon detid=\""<<ccu->
idex<<
"\" count=\""<<ccu->
count <<
"\" value=\""<<ccu->
value<<
"\" id=\""<<ccu->
idex+crate*1000000<<
"\" cmodid=\""<<ccu->
cmodid<<
"\" layer=\""<<ccu->
layer<<
"\" onclick=\"showData(evt);\" onmouseover=\"showData(evt);\" onmouseout=\"showData(evt);\" MESSAGE=\"""\" POS=\"Slot/Ring"<<ccu->
getCcuSlot()<<
"/"<<ccu->
getCcuRing()<<
" connected to "<<s<<
" Id "<<buffer<<
" \" fill=\"rgb("<<red<<
","<<green<<
","<<blue<<
")\" points=\"";
977 if(
temporary_file)*svgfile << 255 <<
" " << 255 <<
" " << 255 <<
" ";
978 else *svgfile <<
"<svg:polygon detid=\""<<ccu->
idex<<
"\" count=\""<<ccu->
count <<
"\" value=\""<<ccu->
value<<
"\" id=\""<<ccu->
idex+crate*1000000<<
"\" cmodid=\""<<ccu->
cmodid<<
"\" layer=\""<<ccu->
layer<<
"\" onclick=\"showData(evt);\" onmouseover=\"showData(evt);\" onmouseout=\"showData(evt);\" MESSAGE=\"""\" POS=\"Slot/Ring "<<ccu->
getCcuSlot()<<
"/"<<ccu->
getCcuRing()<<
" connected to "<<s<<
" Id "<<buffer<<
" \" fill=\"white\" points=\"";
981 if(ccu->
red>255)ccu->
red=255;
985 else *svgfile <<
"<svg:polygon detid=\""<<ccu->
idex<<
"\" count=\""<<ccu->
count <<
"\" value=\""<<ccu->
value<<
"\" id=\""<<ccu->
idex+crate*1000000<<
"\" cmodid=\""<<ccu->
cmodid<<
"\" layer=\""<<ccu->
layer<<
"\" onclick=\"showData(evt);\" onmouseover=\"showData(evt);\" onmouseout=\"showData(evt);\" MESSAGE=\"""\" POS=\"Slot/Ring "<<ccu->
getCcuSlot()<<
"/"<<ccu->
getCcuRing()<<
" connected to "<<s<<
" Id "<<buffer<<
" \" fill=\"rgb("<<ccu->
red<<
","<<ccu->
green<<
","<<ccu->
blue<<
")\" points=\"";
988 for(
int k=0;
k<
np;
k++){
990 else *svgfile << xd[
k] <<
"," << yd[
k] <<
" " ;
993 else *svgfile <<
"\" />" <<std::endl;
1005 double boxinitx=35, boxinity=12;
1008 boxinitx= boxinitx+(5 - numcrate_inrack)*5;
1009 boxinity= boxinity+(18 - psu->
getPsuBoard())*1.75;
1011 xp[0]=boxinitx;yp[0]=boxinity;
1012 xp[1]=boxinitx+dx;yp[1]=boxinity;
1013 xp[2]=boxinitx+dx;yp[2]=boxinity + dy;
1014 xp[3]=boxinitx;yp[3]=boxinity + dy;
1017 for(
int j=0;
j<4;
j++){
1023 sprintf(buffer,
"%X",psu->
idex);
1024 std::string
s = psu->
text;
1025 s.erase(s.begin()+s.find(
"connected"),s.end());
1030 red=(color>>16)&0xFF;
1031 green=(color>>8)&0xFF;
1034 if(
temporary_file)*svgfile << red <<
" " << green <<
" " << blue <<
" ";
1035 else *svgfile <<
"<svg:polygon detid=\""<<psu->
idex<<
"\" count=\""<<psu->
count <<
"\" value=\""<<psu->
value<<
"\" id=\""<< psu->
idex <<
"\" cmodid=\""<<psu->
cmodid_LV<<
"\" onclick=\"showData(evt);\" onmouseover=\"showData(evt);\" onmouseout=\"showData(evt);\" MESSAGE=\"""\" POS=\"easyCrate/easyBoard "<<psu->
getPsuCrate()<<
"/"<<psu->
getPsuBoard()<<
" connected to "<<s<<
" \" fill=\"rgb("<<red<<
","<<green<<
","<<blue<<
")\" points=\"";
1039 if(
temporary_file)*svgfile << 255 <<
" " << 255 <<
" " << 255 <<
" ";
1040 else *svgfile <<
"<svg:polygon detid=\""<<psu->
idex<<
"\" count=\""<<psu->
count <<
"\" value=\""<<psu->
value<<
"\" id=\""<< psu->
idex <<
"\" cmodid=\""<<psu->
cmodid_LV<<
"\" onclick=\"showData(evt);\" onmouseover=\"showData(evt);\" onmouseout=\"showData(evt);\" MESSAGE=\"""\" POS=\"easyCrate/easyBoard "<<psu->
getPsuCrate()<<
"/"<<psu->
getPsuBoard()<<
" connected to "<<s<<
" \" fill=\"white\" points=\"";
1045 if(psu->
red>255)psu->
red=255;
1049 else *svgfile <<
"<svg:polygon detid=\""<<psu->
idex<<
"\" count=\""<<psu->
count <<
"\" value=\""<<psu->
value<<
"\" id=\""<< psu->
idex <<
"\" cmodid=\""<<psu->
cmodid_LV<<
"\" onclick=\"showData(evt);\" onmouseover=\"showData(evt);\" onmouseout=\"showData(evt);\" MESSAGE=\"""\" POS=\"easyCrate/easyBoard "<<psu->
getPsuCrate()<<
"/"<<psu->
getPsuBoard()<<
" connected to "<<s<<
" \" fill=\"rgb("<<psu->
red<<
","<<psu->
green<<
","<<psu->
blue<<
")\" points=\"";
1053 for(
int k=0;
k<
np;
k++){
1055 else *svgfile << xd[
k] <<
"," << yd[
k] <<
" " ;
1058 else *svgfile <<
"\" />" <<std::endl;
1071 double boxinitx=35, boxinity=12;
1072 double dx=1.1,dy=1.3;
1074 boxinitx= boxinitx+(5 - numcrate_inrack)*5;
1075 boxinity= boxinity+(18 - psu->
getPsuBoard())*1.75;
1077 xp[0]=boxinitx;yp[0]=boxinity;
1078 xp[1]=boxinitx+dx;yp[1]=boxinity;
1079 xp[2]=boxinitx+dx;yp[2]=boxinity + dy;
1080 xp[3]=boxinitx;yp[3]=boxinity + dy;
1083 for(
int j=0;
j<4;
j++){
1089 sprintf(buffer,
"%X",psu->
idex);
1091 s.erase(s.begin()+s.find(
"connected"),s.end());
1097 redHV2=(color>>16)&0xFF;
1098 greenHV2=(color>>8)&0xFF;
1099 blueHV2=(color)&0xFF;
1101 if(
temporary_file)*svgfile << redHV2 <<
" " << greenHV2 <<
" " << blueHV2 <<
" ";
1102 else *svgfile <<
"<svg:polygon detid=\""<<psu->
idex<<
"\" count=\""<<psu->
countHV2 <<
"\" value=\""<<psu->
valueHV2<<
"\" id=\""<< psu->
idex*10+2 <<
"\" cmodid=\""<<psu->
cmodid_HV2<<
"\" onclick=\"showData(evt);\" onmouseover=\"showData(evt);\" onmouseout=\"showData(evt);\" MESSAGE=\"""\" POS=\"easyCrate/easyBoard "<<psu->
getPsuCrate()<<
"/"<<psu->
getPsuBoard()<<
" connected to "<<s<<
" \" fill=\"rgb("<<redHV2<<
","<<greenHV2<<
","<<blueHV2<<
")\" points=\"";
1105 if(
temporary_file)*svgfile << 255 <<
" " << 255 <<
" " << 255 <<
" ";
1106 else *svgfile <<
"<svg:polygon detid=\""<<psu->
idex<<
"\" count=\""<<psu->
countHV2 <<
"\" value=\""<<psu->
valueHV2<<
"\" id=\""<< psu->
idex*10+2 <<
"\" cmodid=\""<<psu->
cmodid_HV2<<
"\" onclick=\"showData(evt);\" onmouseover=\"showData(evt);\" onmouseout=\"showData(evt);\" MESSAGE=\"""\" POS=\"easyCrate/easyBoard "<<psu->
getPsuCrate()<<
"/"<<psu->
getPsuBoard()<<
" connected to "<<s<<
" \" fill=\"white\" points=\"";
1115 else *svgfile <<
"<svg:polygon detid=\""<<psu->
idex<<
"\" count=\""<<psu->
countHV2 <<
"\" value=\""<<psu->
valueHV2<<
"\" id=\""<< psu->
idex*10+2 <<
"\" cmodid=\""<<psu->
cmodid_HV2<<
"\" onclick=\"showData(evt);\" onmouseover=\"showData(evt);\" onmouseout=\"showData(evt);\" MESSAGE=\"""\" POS=\"easyCrate/easyBoard "<<psu->
getPsuCrate()<<
"/"<<psu->
getPsuBoard()<<
" connected to "<<s<<
" \" fill=\"rgb("<<psu->
redHV2<<
","<<psu->
greenHV2<<
","<<psu->
blueHV2<<
")\" points=\"";
1119 for(
int k=0;
k<
np;
k++){
1121 else *svgfile << xd[
k] <<
"," << yd[
k] <<
" " ;
1124 else *svgfile <<
"\" />" <<std::endl;
1138 double boxinitx=36.5, boxinity=12;
1139 double dx=1.1,dy=1.3;
1141 boxinitx= boxinitx+(5 - numcrate_inrack)*5;
1142 boxinity= boxinity+(18 - psu->
getPsuBoard())*1.75;
1144 xp[0]=boxinitx;yp[0]=boxinity;
1145 xp[1]=boxinitx+dx;yp[1]=boxinity;
1146 xp[2]=boxinitx+dx;yp[2]=boxinity + dy;
1147 xp[3]=boxinitx;yp[3]=boxinity + dy;
1150 for(
int j=0;
j<4;
j++){
1156 sprintf(buffer,
"%X",psu->
idex);
1158 s.erase(s.begin()+s.find(
"connected"),s.end());
1163 redHV3=(color>>16)&0xFF;
1164 greenHV3=(color>>8)&0xFF;
1165 blueHV3=(color)&0xFF;
1167 if(
temporary_file)*svgfile << redHV3 <<
" " << greenHV3 <<
" " << blueHV3 <<
" ";
1168 else *svgfile <<
"<svg:polygon detid=\""<<psu->
idex<<
"\" count=\""<<psu->
countHV3 <<
"\" value=\""<<psu->
valueHV3<<
"\" id=\""<< psu->
idex*10+3 <<
"\" cmodid=\""<<psu->
cmodid_HV3<<
"\" onclick=\"showData(evt);\" onmouseover=\"showData(evt);\" onmouseout=\"showData(evt);\" MESSAGE=\"""\" POS=\"easyCrate/easyBoard"<<psu->
getPsuCrate()<<
"/"<<psu->
getPsuBoard()<<
" connected to "<<s<<
" \" fill=\"rgb("<<redHV3<<
","<<greenHV3<<
","<<blueHV3<<
")\" points=\"";
1171 if(
temporary_file)*svgfile << 255 <<
" " << 255 <<
" " << 255 <<
" ";
1172 else *svgfile <<
"<svg:polygon detid=\""<<psu->
idex<<
"\" count=\""<<psu->
countHV3 <<
"\" value=\""<<psu->
valueHV3<<
"\" id=\""<< psu->
idex*10+3 <<
"\" cmodid=\""<<psu->
cmodid_HV3<<
"\" onclick=\"showData(evt);\" onmouseover=\"showData(evt);\" onmouseout=\"showData(evt);\" MESSAGE=\"""\" POS=\"easyCrate/easyBoard "<<psu->
getPsuCrate()<<
"/"<<psu->
getPsuBoard()<<
" connected to "<<s<<
" \" fill=\"white\" points=\"";
1181 else *svgfile <<
"<svg:polygon detid=\""<<psu->
idex<<
"\" count=\""<<psu->
countHV3 <<
"\" value=\""<<psu->
valueHV3<<
"\" id=\""<< psu->
idex*10+3 <<
"\" cmodid=\""<<psu->
cmodid_HV3<<
"\" onclick=\"showData(evt);\" onmouseover=\"showData(evt);\" onmouseout=\"showData(evt);\" MESSAGE=\"""\" POS=\"easyCrate/easyBoard "<<psu->
getPsuCrate()<<
"/"<<psu->
getPsuBoard()<<
" connected to "<<s<<
" \" fill=\"rgb("<<psu->
redHV3<<
","<<psu->
greenHV3<<
","<<psu->
blueHV3<<
")\" points=\"";
1185 for(
int k=0;
k<
np;
k++){
1187 else *svgfile << xd[
k] <<
"," << yd[
k] <<
" " ;
1190 else *svgfile <<
"\" />" <<std::endl;
1197 std::vector<TPolyLine*> vp;
1198 size_t found=filetype.find_last_of(
".");
1199 filetype=filetype.substr(found+1);
1200 found=outputfilename.find_last_of(
".");
1201 outputfilename=outputfilename.substr(0,found);
1204 std::ostringstream outs;
1206 outs << outputfilename <<
".coor";
1208 std::map<int , TmCcu *>::iterator i_ccu;
1209 std::multimap<TmCcu*, TmModule*>::iterator it;
1210 std::pair<std::multimap<TmCcu*, TmModule*>::iterator,std::multimap<TmCcu*, TmModule*>::iterator>
ret;
1212 bool useCcuValue=
false;
1215 for( i_ccu=
ccuMap.begin();i_ccu !=
ccuMap.end(); i_ccu++){
1216 TmCcu * ccu= i_ccu->second;
1218 if(ccu->
count > 0 || ccu->
red!=-1) { useCcuValue=
true;
break;}
1224 for( i_ccu=
ccuMap.begin();i_ccu !=
ccuMap.end(); i_ccu++){
1225 TmCcu * ccu= i_ccu->second;
1228 for (it = ret.first; it != ret.second; ++it)
1230 if( (*it).second->count>0){ccu->
value=ccu->
value+(*it).second->value;ccu->
count++;}
1238 if(
title==
" Tracker Map from QTestAlarm"){
1239 for( i_ccu=
ccuMap.begin();i_ccu !=
ccuMap.end(); i_ccu++){
1240 TmCcu * ccu= i_ccu->second;
1244 for (it = ret.first; it != ret.second; ++it) {
1245 if( !( (*it).second->red==0 && (*it).second->green==255 && (*it).second->blue==0 ) && !( (*it).second->red==255 && (*it).second->green==255 && (*it).second->blue==255 ) ){
1256 for( i_ccu=
ccuMap.begin();i_ccu !=
ccuMap.end(); i_ccu++){
1257 TmCcu * ccu= i_ccu->second;
1269 for( i_ccu=
ccuMap.begin();i_ccu !=
ccuMap.end(); i_ccu++){
1270 TmCcu * ccu= i_ccu->second;
1280 if(filetype==
"svg"){
1282 std::ostringstream outs;
1283 outs << outputfilename<<
".svg";
1285 *
savefile <<
"<?xml version=\"1.0\" standalone=\"no\" ?>"<<std::endl;
1286 *
savefile <<
"<svg xmlns=\"http://www.w3.org/2000/svg\""<<std::endl;
1287 *
savefile <<
"xmlns:svg=\"http://www.w3.org/2000/svg\" "<<std::endl;
1288 *
savefile <<
"xmlns:xlink=\"http://www.w3.org/1999/xlink\">"<<std::endl;
1289 *
savefile <<
"<svg:svg id=\"mainMap\" x=\"0\" y=\"0\" viewBox=\"0 0 3000 1600"<<
"\" width=\""<<width<<
"\" height=\""<<height<<
"\">"<<std::endl;
1290 *
savefile <<
"<svg:rect fill=\"lightblue\" stroke=\"none\" x=\"0\" y=\"0\" width=\"3000\" height=\"1600\" /> "<<std::endl;
1291 *
savefile <<
"<svg:g id=\"fedtrackermap\" transform=\"translate(10,1500) rotate(270)\" style=\"fill:none;stroke:black;stroke-width:0;\"> "<<std::endl;
1293 for (
int crate=1; crate < (
nfeccrates+1); crate++){
1294 if(filetype==
"xml"){
1296 std::ostringstream outs;
1297 outs << outputfilename<<
"feccrate" <<crate<<
".xml";
1299 *
savefile <<
"<?xml version=\"1.0\" standalone=\"no\"?>"<<std::endl;
1300 *
savefile <<
"<svg xmlns=\"http://www.w3.org/2000/svg\""<<std::endl;
1301 *
savefile <<
"xmlns:svg=\"http://www.w3.org/2000/svg\""<<std::endl;
1302 *
savefile <<
"xmlns:xlink=\"http://www.w3.org/1999/xlink\" >"<<std::endl;
1303 *
savefile <<
"<script type=\"text/ecmascript\" xlink:href=\"feccrate.js\" />"<<std::endl;
1304 *
savefile <<
"<svg id=\"mainMap\" x=\"0\" y=\"0\" viewBox=\"0 0 500 500\" width=\"700\" height=\"700\" onload=\"TrackerCrate.init()\">"<<std::endl;
1305 *
savefile <<
"<rect fill=\"lightblue\" stroke=\"none\" x=\"0\" y=\"0\" width=\"700\" height=\"700\" />"<<std::endl;
1306 *
savefile <<
"<g id=\"crate\" transform=\" translate(280,580) rotate(270) scale(.7,.8)\" > "<<std::endl;
1311 for ( i_ccu=
ccuMap.begin();i_ccu !=
ccuMap.end(); i_ccu++){
1312 TmCcu * ccu= i_ccu->second;
1322 if(filetype==
"xml"){
1323 *
savefile <<
"</g> </svg> <text id=\"currentElementText\" x=\"40\" y=\"30\"> " << std::endl;
1324 *
savefile <<
"<tspan id=\"line1\" x=\"40\" y=\"30\"> </tspan> " << std::endl;
1325 *
savefile <<
"<tspan id=\"line2\" x=\"40\" y=\"60\"> </tspan> " << std::endl;
1326 *
savefile <<
" </text> </svg>" << std::endl;
1332 if(filetype==
"svg"){
1333 *
savefile <<
"</g> </svg> </svg> " << std::endl;
1336 if(!print_total && !useCcuValue){
1338 for( i_ccu=
ccuMap.begin();i_ccu !=
ccuMap.end(); i_ccu++){
1339 TmCcu * ccu= i_ccu->second;
1349 const char * command1;
1350 std::string tempfilename = outputfilename +
".coor";
1351 int red,
green,blue,npoints,colindex,ncolor;
1354 TCanvas *MyC =
new TCanvas(
"MyC",
"TrackerMap",width,height);
1355 gPad->SetFillColor(38);
1357 gPad->Range(0,0,3700,1600);
1361 typedef std::map<int,int> ColorList;
1362 ColorList colorList;
1363 ColorList::iterator
pos;
1365 while(!tempfile.eof()) {
1366 tempfile >> red >> green >> blue >> npoints;
1367 colindex=red+green*1000+blue*1000000;
1368 pos=colorList.find(colindex);
1369 if(pos == colorList.end()){
1370 colorList[colindex]=ncolor+100;
1371 col =gROOT->GetColor(ncolor+100);
1373 col->SetRGB((Double_t)(red/255.),(Double_t)(green/255.),(Double_t)(blue/255.));
1375 c =
new TColor(ncolor+100,(Double_t)(red/255.),(Double_t)(green/255.),(Double_t)(blue/255.));
1379 for (
int i=0;
i<npoints;
i++){
1380 tempfile >> x[
i] >> y[
i];
1383 if(ncolor>0 && ncolor<10000){
1385 for(
int i=0;
i<ncolor;
i++){colors[
i]=
i+100;}
1386 gStyle->SetPalette(ncolor,colors);
1389 tempfile.seekg(0,std::ios::beg);
1390 std::cout <<
"created palette with " << ncolor <<
" colors" << std::endl;
1391 while(!tempfile.eof()) {
1392 tempfile >> red >> green >> blue >> npoints;
1393 for (
int i=0;
i<npoints;
i++){
1394 tempfile >> x[
i] >> y[
i];
1396 colindex=red+green*1000+blue*1000000;
1397 pos=colorList.find(colindex);
1398 if(pos != colorList.end()){
1399 TPolyLine* pline =
new TPolyLine(npoints,y,x);
1400 vp.push_back(pline);
1401 pline->SetFillColor(colorList[colindex]);
1402 pline->SetLineWidth(0);
1407 std::cout <<
"Filetype " << filetype << std::endl;
1408 if(filetype==
"png"){
1409 std::string
filename = outputfilename +
".png";
1410 MyC->Print(filename.c_str());
1412 if(filetype==
"jpg"){
1413 std::string
filename = outputfilename +
".jpg";
1414 MyC->Print(filename.c_str());
1416 if(filetype==
"pdf"){
1417 std::string
filename = outputfilename +
".pdf";
1418 MyC->Print(filename.c_str());
1420 std::string
command =
"rm "+tempfilename ;
1421 command1=command.c_str();
1422 std::cout <<
"Executing " << command1 << std::endl;
1426 for(std::vector<TPolyLine*>::iterator pos1=vp.begin();pos1!=vp.end();pos1++){
1439 std::vector<TPolyLine*> vp;
1441 size_t found=filetype.find_last_of(
".");
1442 filetype=filetype.substr(found+1);
1443 found=outputfilename.find_last_of(
".");
1444 outputfilename=outputfilename.substr(0,found);
1451 std::ostringstream outs;
1453 outs << outputfilename <<
".coor";
1456 std::map<int , TmPsu *>::iterator ipsu;
1457 std::multimap<TmPsu*, TmModule*>::iterator it;
1458 std::pair<std::multimap<TmPsu*, TmModule*>::iterator,std::multimap<TmPsu*, TmModule*>::iterator>
ret;
1461 bool usePsuValue=
false;
1464 TmPsu* psu= ipsu->second;
1473 TmPsu * psu= ipsu->second;
1476 for(it = ret.first; it != ret.second; ++it){
1477 if((*it).second->HVchannel==2){ psu->
valueHV2=psu->
valueHV2+(*it).second->value;}
1478 if((*it).second->HVchannel==3){ psu->
valueHV3=psu->
valueHV3+(*it).second->value;}
1490 if(
title==
" Tracker Map from QTestAlarm"){
1492 TmPsu * psu= ipsu->second;
1497 for (it = ret.first; it != ret.second; ++it) {
1498 if((*it).second->HVchannel==2){
1499 if( !( (*it).second->red==0 && (*it).second->green==255 && (*it).second->blue==0 ) && !( (*it).second->red==255 && (*it).second->green==255 && (*it).second->blue==255 ) ){
1503 if((*it).second->HVchannel==3){
1504 if( !( (*it).second->red==0 && (*it).second->green==255 && (*it).second->blue==0 ) && !( (*it).second->red==255 && (*it).second->green==255 && (*it).second->blue==255 ) ){
1515 TmPsu * psu= ipsu->second;
1531 TmPsu * psu= ipsu->second;
1541 if(filetype==
"svg"){
1543 std::ostringstream outs;
1544 outs << outputfilename<<
".svg";
1546 *
savefile <<
"<?xml version=\"1.0\" standalone=\"no\" ?>"<<std::endl;
1547 *
savefile <<
"<svg xmlns=\"http://www.w3.org/2000/svg\""<<std::endl;
1548 *
savefile <<
"xmlns:svg=\"http://www.w3.org/2000/svg\" "<<std::endl;
1549 *
savefile <<
"xmlns:xlink=\"http://www.w3.org/1999/xlink\">"<<std::endl;
1550 *
savefile <<
"<svg:svg id=\"mainMap\" x=\"0\" y=\"0\" viewBox=\"0 0 3000 1600"<<
"\" width=\""<<width<<
"\" height=\""<<height<<
"\">"<<std::endl;
1551 *
savefile <<
"<svg:rect fill=\"lightblue\" stroke=\"none\" x=\"0\" y=\"0\" width=\"3000\" height=\"1600\" /> "<<std::endl;
1552 *
savefile <<
"<svg:g id=\"HVtrackermap\" transform=\"translate(10,1500) rotate(270)\" style=\"fill:none;stroke:black;stroke-width:0;\"> "<<std::endl;
1555 for (
int irack=1; irack < (
npsuracks+1); irack++){
1556 if(filetype==
"xml"){
1558 std::ostringstream outs;
1559 outs << outputfilename<<
"HVrack" <<irack<<
".xml";
1561 *
savefile <<
"<?xml version=\"1.0\" standalone=\"no\"?>"<<std::endl;
1562 *
savefile <<
"<svg xmlns=\"http://www.w3.org/2000/svg\""<<std::endl;
1563 *
savefile <<
"xmlns:svg=\"http://www.w3.org/2000/svg\""<<std::endl;
1564 *
savefile <<
"xmlns:xlink=\"http://www.w3.org/1999/xlink\" >"<<std::endl;
1565 *
savefile <<
"<script type=\"text/ecmascript\" xlink:href=\"rackhv.js\" />"<<std::endl;
1566 *
savefile <<
"<svg id=\"mainMap\" x=\"0\" y=\"0\" viewBox=\"0 0 500 500\" width=\"700\" height=\"700\" onload=\"TrackerRackhv.init()\">"<<std::endl;
1567 *
savefile <<
"<rect fill=\"lightblue\" stroke=\"none\" x=\"0\" y=\"0\" width=\"700\" height=\"700\" />"<<std::endl;
1568 *
savefile <<
"<g id=\"rackhv\" transform=\" translate(150,500) rotate(270) scale(1.,1.)\" > "<<std::endl;
1573 for ( ipsu=
psuMap.begin();ipsu !=
psuMap.end(); ipsu++){
1574 TmPsu * psu= ipsu->second;
1577 drawHV3(irack,psu->getPsuCrate(),print_total,psu,
savefile,usePsuValue);
1583 if(filetype==
"xml"){
1584 *
savefile <<
"</g> </svg> <text id=\"currentElementText\" x=\"40\" y=\"30\"> " << std::endl;
1585 *
savefile <<
"<tspan id=\"line1\" x=\"40\" y=\"30\"> </tspan> " << std::endl;
1586 *
savefile <<
"<tspan id=\"line2\" x=\"40\" y=\"60\"> </tspan> " << std::endl;
1587 *
savefile <<
" </text> </svg>" << std::endl;
1593 if(filetype==
"svg"){
1594 *
savefile <<
"</g> </svg> </svg> " << std::endl;
1599 if(!print_total && !usePsuValue){
1601 TmPsu *psu = ipsu->second;
1614 const char * command1;
1615 std::string tempfilename = outputfilename +
".coor";
1616 int red,
green,blue,npoints,colindex,ncolor;
1619 TCanvas *MyC =
new TCanvas(
"MyC",
"TrackerMap",width,height);
1620 gPad->SetFillColor(38);
1622 gPad->Range(0,0,3700,1600);
1626 typedef std::map<int,int> ColorList;
1627 ColorList colorList;
1628 ColorList::iterator
pos;
1630 while(!tempfile.eof()) {
1631 tempfile >> red >> green >> blue >> npoints;
1632 colindex=red+green*1000+blue*1000000;
1633 pos=colorList.find(colindex);
1634 if(pos == colorList.end()){
1635 colorList[colindex]=ncolor+100;
1636 col =gROOT->GetColor(ncolor+100);
1638 col->SetRGB((Double_t)(red/255.),(Double_t)(green/255.),(Double_t)(blue/255.));
1640 c =
new TColor(ncolor+100,(Double_t)(red/255.),(Double_t)(green/255.),(Double_t)(blue/255.));
1644 for (
int i=0;
i<npoints;
i++){
1645 tempfile >> x[
i] >> y[
i];
1648 if(ncolor>0 && ncolor<10000){
1650 for(
int i=0;
i<ncolor;
i++){colors[
i]=
i+100;}
1651 gStyle->SetPalette(ncolor,colors);
1654 tempfile.seekg(0,std::ios::beg);
1655 std::cout <<
"created palette with " << ncolor <<
" colors" << std::endl;
1656 while(!tempfile.eof()) {
1657 tempfile >> red >> green >> blue >> npoints;
1658 for (
int i=0;
i<npoints;
i++){
1659 tempfile >> x[
i] >> y[
i];
1661 colindex=red+green*1000+blue*1000000;
1662 pos=colorList.find(colindex);
1663 if(pos != colorList.end()){
1664 TPolyLine* pline =
new TPolyLine(npoints,y,x);
1665 vp.push_back(pline);
1666 pline->SetFillColor(colorList[colindex]);
1667 pline->SetLineWidth(0);
1672 std::cout <<
"Filetype " << filetype << std::endl;
1673 if(filetype==
"png"){
1674 std::string
filename = outputfilename +
".png";
1675 MyC->Print(filename.c_str());
1677 if(filetype==
"jpg"){
1678 std::string
filename = outputfilename +
".jpg";
1679 MyC->Print(filename.c_str());
1681 if(filetype==
"pdf"){
1682 std::string
filename = outputfilename +
".pdf";
1683 MyC->Print(filename.c_str());
1685 std::string
command =
"rm "+tempfilename ;
1686 command1=command.c_str();
1687 std::cout <<
"Executing " << command1 << std::endl;
1691 for(std::vector<TPolyLine*>::iterator pos1=vp.begin();pos1!=vp.end();pos1++){
1705 std::vector<TPolyLine*> vp;
1707 size_t found=filetype.find_last_of(
".");
1708 filetype=filetype.substr(found+1);
1709 found=outputfilename.find_last_of(
".");
1710 outputfilename=outputfilename.substr(0,found);
1718 std::ostringstream outs;
1720 outs << outputfilename <<
".coor";
1723 std::map<int , TmPsu *>::iterator ipsu;
1724 std::multimap<TmPsu*, TmModule*>::iterator it;
1725 std::pair<std::multimap<TmPsu*, TmModule*>::iterator,std::multimap<TmPsu*, TmModule*>::iterator>
ret;
1728 bool usePsuValue=
false;
1731 TmPsu* psu= ipsu->second;
1733 if(psu->
count > 0 || psu->
red!=-1) { usePsuValue=
true;
break;}
1739 TmPsu * psu= ipsu->second;
1742 for(it = ret.first; it != ret.second; ++it){
1753 if(
title==
" Tracker Map from QTestAlarm"){
1755 TmPsu * psu= ipsu->second;
1759 for (it = ret.first; it != ret.second; ++it) {
1760 if( !( (*it).second->red==0 && (*it).second->green==255 && (*it).second->blue==0 ) && !( (*it).second->red==255 && (*it).second->green==255 && (*it).second->blue==255 ) ){
1772 TmPsu * psu= ipsu->second;
1785 TmPsu * psu= ipsu->second;
1793 if(filetype==
"svg"){
1795 std::ostringstream outs;
1796 outs << outputfilename<<
".svg";
1798 *
savefile <<
"<?xml version=\"1.0\" standalone=\"no\" ?>"<<std::endl;
1799 *
savefile <<
"<svg xmlns=\"http://www.w3.org/2000/svg\""<<std::endl;
1800 *
savefile <<
"xmlns:svg=\"http://www.w3.org/2000/svg\" "<<std::endl;
1801 *
savefile <<
"xmlns:xlink=\"http://www.w3.org/1999/xlink\">"<<std::endl;
1802 *
savefile <<
"<svg:svg id=\"mainMap\" x=\"0\" y=\"0\" viewBox=\"0 0 3000 1600"<<
"\" width=\""<<width<<
"\" height=\""<<height<<
"\">"<<std::endl;
1803 *
savefile <<
"<svg:rect fill=\"lightblue\" stroke=\"none\" x=\"0\" y=\"0\" width=\"3000\" height=\"1600\" /> "<<std::endl;
1804 *
savefile <<
"<svg:g id=\"psutrackermap\" transform=\"translate(10,1500) rotate(270)\" style=\"fill:none;stroke:black;stroke-width:0;\"> "<<std::endl;
1807 for (
int irack=1; irack < (
npsuracks+1); irack++){
1808 if(filetype==
"xml"){
1810 outs << outputfilename<<
"psurack" <<irack<<
".xml";
1812 *
savefile <<
"<?xml version=\"1.0\" standalone=\"no\"?>"<<std::endl;
1813 *
savefile <<
"<svg xmlns=\"http://www.w3.org/2000/svg\""<<std::endl;
1814 *
savefile <<
"xmlns:svg=\"http://www.w3.org/2000/svg\""<<std::endl;
1815 *
savefile <<
"xmlns:xlink=\"http://www.w3.org/1999/xlink\" >"<<std::endl;
1816 *
savefile <<
"<script type=\"text/ecmascript\" xlink:href=\"rack.js\" />"<<std::endl;
1817 *
savefile <<
"<svg id=\"mainMap\" x=\"0\" y=\"0\" viewBox=\"0 0 500 500\" width=\"700\" height=\"700\" onload=\"TrackerCrate.init()\">"<<std::endl;
1818 *
savefile <<
"<rect fill=\"lightblue\" stroke=\"none\" x=\"0\" y=\"0\" width=\"700\" height=\"700\" />"<<std::endl;
1819 *
savefile <<
"<g id=\"rack\" transform=\" translate(150,500) rotate(270) scale(1.,1.)\" > "<<std::endl;
1825 for ( ipsu=
psuMap.begin();ipsu !=
psuMap.end(); ipsu++){
1826 TmPsu * psu= ipsu->second;
1835 if(filetype==
"xml"){
1836 *
savefile <<
"</g> </svg> <text id=\"currentElementText\" x=\"40\" y=\"30\"> " << std::endl;
1837 *
savefile <<
"<tspan id=\"line1\" x=\"40\" y=\"30\"> </tspan> " << std::endl;
1838 *
savefile <<
"<tspan id=\"line2\" x=\"40\" y=\"60\"> </tspan> " << std::endl;
1839 *
savefile <<
" </text> </svg>" << std::endl;
1845 if(filetype==
"svg"){
1846 *
savefile <<
"</g> </svg> </svg> " << std::endl;
1851 if(!print_total && !usePsuValue){
1853 TmPsu *psu = ipsu->second;
1865 const char * command1;
1866 std::string tempfilename = outputfilename +
".coor";
1867 int red,
green,blue,npoints,colindex,ncolor;
1870 TCanvas *MyC =
new TCanvas(
"MyC",
"TrackerMap",width,height);
1871 gPad->SetFillColor(38);
1873 gPad->Range(0,0,3700,1600);
1877 typedef std::map<int,int> ColorList;
1878 ColorList colorList;
1879 ColorList::iterator
pos;
1881 while(!tempfile.eof()) {
1882 tempfile >> red >> green >> blue >> npoints;
1883 colindex=red+green*1000+blue*1000000;
1884 pos=colorList.find(colindex);
1885 if(pos == colorList.end()){
1886 colorList[colindex]=ncolor+100;
1887 col =gROOT->GetColor(ncolor+100);
1889 col->SetRGB((Double_t)(red/255.),(Double_t)(green/255.),(Double_t)(blue/255.));
1891 c =
new TColor(ncolor+100,(Double_t)(red/255.),(Double_t)(green/255.),(Double_t)(blue/255.));
1895 for (
int i=0;
i<npoints;
i++){
1896 tempfile >> x[
i] >> y[
i];
1899 if(ncolor>0 && ncolor<10000){
1901 for(
int i=0;
i<ncolor;
i++){colors[
i]=
i+100;}
1902 gStyle->SetPalette(ncolor,colors);
1905 tempfile.seekg(0,std::ios::beg);
1906 std::cout <<
"created palette with " << ncolor <<
" colors" << std::endl;
1907 while(!tempfile.eof()) {
1908 tempfile >> red >> green >> blue >> npoints;
1909 for (
int i=0;
i<npoints;
i++){
1910 tempfile >> x[
i] >> y[
i];
1912 colindex=red+green*1000+blue*1000000;
1913 pos=colorList.find(colindex);
1914 if(pos != colorList.end()){
1915 TPolyLine* pline =
new TPolyLine(npoints,y,x);
1916 vp.push_back(pline);
1917 pline->SetFillColor(colorList[colindex]);
1918 pline->SetLineWidth(0);
1923 std::cout <<
"Filetype " << filetype << std::endl;
1924 if(filetype==
"png"){
1925 std::string
filename = outputfilename +
".png";
1926 MyC->Print(filename.c_str());
1928 if(filetype==
"jpg"){
1929 std::string
filename = outputfilename +
".jpg";
1930 MyC->Print(filename.c_str());
1932 if(filetype==
"pdf"){
1933 std::string
filename = outputfilename +
".pdf";
1934 MyC->Print(filename.c_str());
1936 std::string
command =
"rm "+tempfilename ;
1937 command1=command.c_str();
1938 std::cout <<
"Executing " << command1 << std::endl;
1942 for(std::vector<TPolyLine*>::iterator pos1=vp.begin();pos1!=vp.end();pos1++){
1952 std::vector<TPolyLine*> vp;
1954 size_t found=filetype.find_last_of(
".");
1955 filetype=filetype.substr(found+1);
1956 found=outputfilename.find_last_of(
".");
1957 outputfilename=outputfilename.substr(0,found);
1961 std::ostringstream outs;
1963 outs << outputfilename <<
".coor";
1965 std::map<int , TmApvPair *>::iterator i_apv;
1966 std::map<int , int>::iterator i_fed;
1968 bool useApvPairValue=
false;
1969 for( i_apv=
apvMap.begin();i_apv !=
apvMap.end(); i_apv++){
1973 if(apv_mod !=0 && !apv_mod->
notInUse()){
1974 if(apvPair->
count > 0 || apvPair->
red!=-1) { useApvPairValue=
true;
break;}
1979 for( i_apv=
apvMap.begin();i_apv !=
apvMap.end(); i_apv++){
1983 if(apv_mod !=0 && !apv_mod->
notInUse()){
1994 for(i_apv=
apvMap.begin();i_apv !=
apvMap.end(); i_apv++){
1998 if( apv_mod !=0 && !apv_mod->
notInUse()){
1999 if(useApvPairValue){
2010 if(filetype==
"svg"){
2012 std::ostringstream outs;
2013 outs << outputfilename<<
".svg";
2015 *
savefile <<
"<?xml version=\"1.0\" standalone=\"no\" ?>"<<std::endl;
2016 *
savefile <<
"<svg xmlns=\"http://www.w3.org/2000/svg\""<<std::endl;
2017 *
savefile <<
"xmlns:svg=\"http://www.w3.org/2000/svg\" "<<std::endl;
2018 *
savefile <<
"xmlns:xlink=\"http://www.w3.org/1999/xlink\">"<<std::endl;
2019 *
savefile <<
"<svg:svg id=\"mainMap\" x=\"0\" y=\"0\" viewBox=\"0 0 3000 1600"<<
"\" width=\""<<width<<
"\" height=\""<<height<<
"\">"<<std::endl;
2020 *
savefile <<
"<svg:rect fill=\"lightblue\" stroke=\"none\" x=\"0\" y=\"0\" width=\"3000\" height=\"1600\" /> "<<std::endl;
2021 *
savefile <<
"<svg:g id=\"fedtrackermap\" transform=\"translate(10,1500) rotate(270)\" style=\"fill:none;stroke:black;stroke-width:0;\"> "<<std::endl;
2023 for (
int crate=1; crate < (
ncrates+1); crate++){
2024 if(filetype==
"xml"){
2026 std::ostringstream outs;
2027 outs << outputfilename<<
"crate" <<crate<<
".xml";
2029 *
savefile <<
"<?xml version=\"1.0\" standalone=\"no\"?>"<<std::endl;
2030 *
savefile <<
"<svg xmlns=\"http://www.w3.org/2000/svg\""<<std::endl;
2031 *
savefile <<
"xmlns:svg=\"http://www.w3.org/2000/svg\""<<std::endl;
2032 *
savefile <<
"xmlns:xlink=\"http://www.w3.org/1999/xlink\" >"<<std::endl;
2033 *
savefile <<
"<script type=\"text/ecmascript\" xlink:href=\"crate.js\" />"<<std::endl;
2034 *
savefile <<
"<svg id=\"mainMap\" x=\"0\" y=\"0\" viewBox=\"0 0 500 500\" width=\"700\" height=\"700\" onload=\"TrackerCrate.init()\">"<<std::endl;
2035 *
savefile <<
"<rect fill=\"lightblue\" stroke=\"none\" x=\"0\" y=\"0\" width=\"700\" height=\"700\" />"<<std::endl;
2036 *
savefile <<
"<g id=\"crate\" transform=\" translate(150,500) rotate(270) scale(1.,1.)\" > "<<std::endl;
2040 int numfed_incrate=0;
2041 for (i_fed=
fedMap.begin();i_fed !=
fedMap.end(); i_fed++){
2042 if(i_fed->second == crate){
2043 int fedId = i_fed->first;
2045 for (
int nconn=0;nconn<96;nconn++){
2046 int key = fedId*1000+nconn;
2050 if(apv_mod !=0 && !apv_mod->
notInUse()){
2058 if(filetype==
"xml"){
2059 *
savefile <<
"</g> </svg> <text id=\"currentElementText\" x=\"40\" y=\"30\"> " << std::endl;
2060 *
savefile <<
"<tspan id=\"line1\" x=\"40\" y=\"30\"> </tspan> " << std::endl;
2061 *
savefile <<
"<tspan id=\"line2\" x=\"40\" y=\"60\"> </tspan> " << std::endl;
2062 *
savefile <<
" </text> </svg>" << std::endl;
2068 if(filetype==
"svg"){
2069 *
savefile <<
"</g> </svg> </svg> " << std::endl;
2072 if(!print_total && !useApvPairValue){
2074 for( i_apv=
apvMap.begin();i_apv !=
apvMap.end(); i_apv++){
2078 if(apv_mod !=0 && apvPair->
mpos==0 && !apv_mod->
notInUse()){
2089 const char * command1;
2090 std::string tempfilename = outputfilename +
".coor";
2091 int red,
green,blue,npoints,colindex,ncolor;
2094 TCanvas *MyC =
new TCanvas(
"MyC",
"TrackerMap",width,height);
2095 gPad->SetFillColor(38);
2097 gPad->Range(0,0,3750,1600);
2101 typedef std::map<int,int> ColorList;
2102 ColorList colorList;
2103 ColorList::iterator
pos;
2105 while(!tempfile.eof()) {
2106 tempfile >> red >> green >> blue >> npoints;
2107 colindex=red+green*1000+blue*1000000;
2108 pos=colorList.find(colindex);
2109 if(pos == colorList.end()){
2110 colorList[colindex]=ncolor+100;
2111 col =gROOT->GetColor(ncolor+100);
2113 col->SetRGB((Double_t)(red/255.),(Double_t)(green/255.),(Double_t)(blue/255.));
2115 c =
new TColor(ncolor+100,(Double_t)(red/255.),(Double_t)(green/255.),(Double_t)(blue/255.));
2119 for (
int i=0;
i<npoints;
i++){
2120 tempfile >> x[
i] >> y[
i];
2123 if(ncolor>0 && ncolor<10000){
2125 for(
int i=0;
i<ncolor;
i++){colors[
i]=
i+100;}
2126 gStyle->SetPalette(ncolor,colors);
2129 tempfile.seekg(0,std::ios::beg);
2130 std::cout <<
"created palette with " << ncolor <<
" colors" << std::endl;
2131 while(!tempfile.eof()) {
2132 tempfile >> red >> green >> blue >> npoints;
2133 for (
int i=0;
i<npoints;
i++){
2134 tempfile >> x[
i] >> y[
i];
2136 colindex=red+green*1000+blue*1000000;
2137 pos=colorList.find(colindex);
2138 if(pos != colorList.end()){
2139 TPolyLine* pline =
new TPolyLine(npoints,y,x);
2140 vp.push_back(pline);
2141 pline->SetFillColor(colorList[colindex]);
2142 pline->SetLineWidth(0);
2147 std::cout <<
"Filetype " << filetype << std::endl;
2148 if(filetype==
"png"){
2149 std::string
filename = outputfilename +
".png";
2150 MyC->Print(filename.c_str());
2152 if(filetype==
"jpg"){
2153 std::string
filename = outputfilename +
".jpg";
2154 MyC->Print(filename.c_str());
2156 if(filetype==
"pdf"){
2157 std::string
filename = outputfilename +
".pdf";
2158 MyC->Print(filename.c_str());
2160 std::string
command =
"rm "+tempfilename ;
2161 command1=command.c_str();
2162 std::cout <<
"Executing " << command1 << std::endl;
2166 for(std::vector<TPolyLine*>::iterator pos1=vp.begin();pos1!=vp.end();pos1++){
2177 int ipos,ipos1,ipos2,
id=0,val=0;
2181 ipos1 = line.find(
"value=\"");
2183 value = line.substr(ipos1+7,10);
2184 ipos = value.find(
"\"");
2185 value = value.substr(0,ipos);
2186 val=atoi(value.c_str());
2188 ipos2 = line.find(
"detid=\"");
2190 value = line.substr(ipos2+7,10);
2191 ipos = value.find(
"\"");
2192 value = value.substr(0,ipos);
2193 id = atoi(value.c_str());
2195 if(ipos1>0 && ipos2>0 && val>0)this->
fill(
id,val);
2196 if(ipos1>0 && ipos2>0)nline++;
2200 std::cout << nline <<
" modules found in this svg file " << std::endl;
2211 std::ostringstream outs;
2213 outs << outputfilename <<
".xml";
2219 while (getline( *jsfile, line ))
2221 *
svgfile << line << std::endl;
2223 jsfile->close();
delete jsfile;
2226 for (
int layer=1; layer < 44; layer++){
2241 for (
int layer=1; layer < 44; layer++){
2254 for (
int layer=1; layer < 44; layer++){
2267 *
svgfile <<
"</svg:g></svg:svg>"<<std::endl;
2268 *
svgfile <<
" <svg:text id=\"Title\" class=\"normalText\" x=\"300\" y=\"0\">"<<
title<<
"</svg:text>"<<std::endl;
2270 *
svgfile <<
"</svg:svg>"<<std::endl;
2271 *
svgfile <<
"</body></html>"<<std::endl;
2279 int paletteLength = 250;
2281 for(
int i=0;
i<paletteLength;
i++){
2283 red=(color>>16)&0xFF;
2284 green=(color>>8)&0xFF;
2296 if(!
temporary_file)*svgfile <<
"<svg:rect x=\"3610\" y=\""<<(1550-6*
i)<<
"\" width=\"50\" height=\"6\" fill=\"rgb("<<red<<
","<<green<<
","<<blue<<
")\" />\n";
2297 else *svgfile << red <<
" " << green <<
" " << blue <<
" 4 " << (6*
i)+40 <<
" 3610. " <<
2298 (6*
i)+40 <<
" 3660. " <<
2299 (6*(
i-1))+40 <<
" 3660. " <<
2300 (6*(
i-1))+40 <<
" 3610. " << std::endl;
2303 if(!
temporary_file)*svgfile <<
"<svg:rect x=\"3610\" y=\""<<(1550-6*
i)<<
"\" width=\"50\" height=\"1\" fill=\"black\" />\n";
2304 if(
i%50==0&&!
temporary_file)*svgfile <<
" <svg:text class=\"normalText\" x=\"3660\" y=\""<<(1560-6*
i)<<
"\">" <<val<<
"</svg:text>"<<std::endl;
2311 int key = fedId*1000+fedCh;
2318 std::cout <<
"*** error in FedTrackerMap fillc method ***";
2323 std::multimap<const int, TmApvPair*>::iterator
pos;
2333 std::cout <<
"*** error in FedTrackerMap fill by module method ***";
2338 int key = fedId*1000+fedCh;
2341 if(apvpair!=0) {apvpair->
value=current_val; apvpair->
count=1; apvpair->
red=-1;}
2343 std::cout <<
"*** error in FedTrackerMap fill_current_val method ***";
2349 int key =crate*10000000+slot*100000+ring*1000+addr;
2357 std::cout <<
"*** error in FecTrackerMap fillc method ***";
2362 int key =crate*10000000+slot*100000+ring*1000+addr;
2370 std::cout <<
"*** error in FecTrackerMap fill by module method ***";
2378 int key = rack*1000+crate*100+board;
2386 std::cout <<
"*** error in LVTrackerMap fillc method ***";
2391 int key = rack*1000+crate*100+board;
2399 std::cout <<
"*** error in LVTrackerMap fill by module method ***";
2405 int key = rack*1000+crate*100+board;
2413 std::cout <<
"*** error in HVTrackerMap (channel 2) fillc method ***";
2418 int key = rack*1000+crate*100+board;
2426 std::cout <<
"*** error in HVTrackerMap (channel 3) fillc method ***";
2432 int key = rack*1000+crate*100+board;
2440 std::cout <<
"*** error in HVTrackerMap fill by module method ***";
2444 int key = rack*1000+crate*100+board;
2452 std::cout <<
"*** error in HVTrackerMap fill by module method ***";
2461 int key = fedId*1000+fedCh;
2467 std::cout <<
"*** error in FedTrackerMap module method ***";
2471 int key = fedId*1000+fedCh;
2478 std::cout <<
"*** error inFedTrackerMap fill method ***";
2489 std::cout <<
"**************************error in fill method **************module "<<idmod<<std::endl;
2493 int key = layer*10000+ring*1000+nmod;
2500 std::cout <<
"**************************error in fill method **************"<< std::endl;
2505 std::map<const int , TmModule *>::iterator imod;
2507 fillc(imod->first,255,255,255);
2513 std::map<const int , TmModule *>::iterator imod;
2524 if(mod!=0) {mod->
value=current_val; mod->
count=1; mod->
red=-1;}
2525 else std::cout <<
"**error in fill_current_val method ***module "<<idmod<<std::endl;
2538 if(mod1!=0 && mod2!=0){
2545 std::cout <<
"**************************error in fill method **************module "<<idmod<<std::endl;
2550 int key = layer*100000+ring*1000+nmod;
2556 else std::cout <<
"**************************error in SvgModuleMap **************";
2565 else std::cout <<
"**************************error in IdModuleMap **************";
2571 int key = layer*100000+ring*1000+nmod;
2576 else std::cout <<
"**************************error in SvgModuleMap **************";
2582 int nmods, pix_sil, fow_bar,
ring, nmod, layer;
2584 float posx, posy, posz, length,
width, thickness, widthAtHalfLength;
2585 int iModule=0,old_layer=0, ntotMod =0;
2586 std::string
name,dummys;
2588 while(!infile.eof()) {
2589 infile >> nmods >> pix_sil >> fow_bar >> layer >> ring >> nmod >> posx >> posy
2590 >> posz>> length >> width >> thickness
2591 >> widthAtHalfLength >> idex ;
2592 getline(infile,dummys);
2593 getline(infile,name);
2594 if(old_layer!=layer){old_layer=layer;iModule=0;}
2597 int key=layer*100000+ring*1000+nmod;
2602 if(mod==0)
std::cout <<
"error in module "<<key <<std::endl;
2624 red=0;green=0;blue=0;
2628 if(value<
minvalue){red=0;green=0;blue=255;}
2629 if(value>
maxvalue){red=255;green=0;blue=0;}
2631 red = (int) ( x<(delta/2) ? 0 : ( x > ((3./4.)*
delta) ? 255 : 255/(delta/4) * (x-(2./4.)*
delta) ) );
2632 green= (int) ( x<delta/4 ? (x*255/(delta/4)) : ( x > ((3./4.)*
delta) ? 255-255/(delta/4) *(x-(3./4.)*
delta) : 255 ) );
2633 blue = (int) ( x<delta/4 ? 255 : ( x > ((1./2.)*
delta) ? 0 : 255-255/(delta/4) * (x-(1./4.)*
delta) ) );
2638 if (green > 255) green=255;
2639 red = 255; blue=0;green=255-
green;
2641 return(blue|(green<<8)|(red<<16));
2645 std::ofstream * ofilename;
2646 std::ifstream * ifilename;
2647 std::ostringstream ofname;
2651 std::string outputfilename=
"dqmtmap";
2652 ifilename=
findfile(
"viewerHeader.xhtml");
2653 ofname << outputfilename <<
"viewer.html";
2654 ofilename =
new std::ofstream(ofname.str().c_str(),
std::ios::out);
2655 while (getline( *ifilename, line )) { *ofilename << line << std::endl; }
2656 *ofilename <<
" var tmapname=\"" <<outputfilename <<
"\""<<std::endl;
2657 *ofilename <<
" var tmaptitle=\"" <<
title <<
"\""<<std::endl;
2658 *ofilename <<
" var ncrates=" <<
ncrates <<
";"<<std::endl;
2659 *ofilename <<
" var nfeccrates=" <<
nfeccrates <<
";"<<std::endl;
2660 *ofilename <<
" var npsuracks=" <<
npsuracks <<
";"<<std::endl;
2662 ifilename->close();
delete ifilename;
2664 ifilename=
findfile(
"viewerTrailer.xhtml");
2665 while (getline( *ifilename, line )) { *ofilename << line << std::endl; }
2666 ofilename->close();
delete ofilename;
2667 command =
"sed -i \"s/XtmapnameX/"+outputfilename+
"/g\" "+ ofname.str();
2668 std::cout <<
"Executing " << command << std::endl;
2669 system(command.c_str());
2670 command =
"sed -i \"s/XtmaptitleX/"+
title+
"/g\" "+ ofname.str();
2671 std::cout <<
"Executing " << command << std::endl;
2672 system(command.c_str());
2674 ifilename->close();
delete ifilename;
2677 ofname <<
"jqviewer.js";
2678 ofilename =
new std::ofstream(ofname.str().c_str(),
std::ios::out);
2679 while (getline( *ifilename, line )) { *ofilename << line << std::endl; }
2681 ofilename->close();
delete ofilename;
2682 ifilename->close();
delete ifilename;
2685 ofname <<
"crate.js";
2686 ofilename =
new std::ofstream(ofname.str().c_str(),
std::ios::out);
2687 while (getline( *ifilename, line )) { *ofilename << line << std::endl; }
2689 ofilename->close();
delete ofilename;
2690 ifilename->close();
delete ifilename;
2693 ofname <<
"feccrate.js";
2694 ofilename =
new std::ofstream(ofname.str().c_str(),
std::ios::out);
2695 while (getline( *ifilename, line )) { *ofilename << line << std::endl; }
2697 ofilename->close();
delete ofilename;
2698 ifilename->close();
delete ifilename;
2701 ofname <<
"layer.js";
2702 ofilename =
new std::ofstream(ofname.str().c_str(),
std::ios::out);
2703 while (getline( *ifilename, line )) { *ofilename << line << std::endl; }
2705 ofilename->close();
delete ofilename;
2706 ifilename->close();
delete ifilename;
2709 ofname <<
"rack.js";
2710 ofilename =
new std::ofstream(ofname.str().c_str(),
std::ios::out);
2711 while (getline( *ifilename, line )) { *ofilename << line << std::endl; }
2713 ofilename->close();
delete ofilename;
2714 ifilename->close();
delete ifilename;
2718 ofname <<
"rackhv.js";
2719 ofilename =
new std::ofstream(ofname.str().c_str(),
std::ios::out);
2720 while (getline( *ifilename, line )) { *ofilename << line << std::endl; }
2722 ofilename->close();
delete ofilename;
2723 ifilename->close();
delete ifilename;
2728 std::ostringstream outs,outs1,outs2;
2729 outs << outputfilename<<
".png";
2736 for (
int layer=1; layer < 44; layer++){
2737 std::ostringstream outs;
2738 outs << outputfilename <<
"layer"<<layer<<
".html";
2739 txtfile =
new std::ofstream(outs.str().c_str(),
std::ios::out);
2740 *txtfile <<
"<html><head></head> <body>" << std::endl;
2746 int idmod=mod->
idex;
2748 *txtfile <<
"<a name="<<idmod<<
"><pre>"<<std::endl;
2749 std::multimap<const int, TmApvPair*>::iterator
pos;
2755 *txtfile << apvpair->
text << std::endl;
2759 *txtfile <<
"</pre><h3>"<< mod->
name<<
"</h3>"<<std::endl;
2763 *txtfile <<
"</body></html>" << std::endl;
2764 txtfile->close();
delete txtfile;
2767 outs1 << outputfilename<<
"fed.png";
2769 outs2 << outputfilename<<
".xml";
2772 std::map<int , int>::iterator i_fed;
2774 for (
int crate=1; crate < (
ncrates+1); crate++){
2775 std::ostringstream outs;
2776 outs << outputfilename <<
"crate"<<crate<<
".html";
2777 txtfile =
new std::ofstream(outs.str().c_str(),
std::ios::out);
2778 *txtfile <<
"<html><head></head> <body>" << std::endl;
2779 for (i_fed=
fedMap.begin();i_fed !=
fedMap.end(); i_fed++){
2780 if(i_fed->second == crate){
2781 int fedId = i_fed->first;
2782 for (
int nconn=0;nconn<96;nconn++){
2783 int key = fedId*1000+nconn;
2786 int idmod=apvPair->
idex;
2787 *txtfile <<
"<a name="<<idmod<<
"><pre>"<<std::endl;
2788 *txtfile << apvPair->
text << std::endl;
2789 std::ostringstream outs;
2790 outs <<
"fedchannel " <<apvPair->
getFedId() <<
"/"<<apvPair->
getFedCh()<<
" connects to module " << apvPair->
mod->
idex ;
2791 *txtfile <<
"</pre><h3>"<< outs.str()<<
"</h3>"<<std::endl;
2796 *txtfile <<
"</body></html>" << std::endl;
2797 txtfile->close();
delete txtfile;
2801 std::ostringstream outs1,outs2;
2802 outs1 << outputfilename<<
"fec.png";
2804 outs2 << outputfilename<<
".xml";
2808 std::map<int , TmCcu *>::iterator i_ccu;
2809 std::multimap<TmCcu*, TmModule*>::iterator it;
2810 std::pair<std::multimap<TmCcu*, TmModule*>::iterator,std::multimap<TmCcu*, TmModule*>::iterator>
ret;
2811 for (
int crate=1; crate < (
nfeccrates+1); crate++){
2812 std::ostringstream outs;
2813 outs << outputfilename <<
"feccrate"<<crate<<
".html";
2814 txtfile =
new std::ofstream(outs.str().c_str(),
std::ios::out);
2815 *txtfile <<
"<html><head></head> <body>" << std::endl;
2816 for( i_ccu=
ccuMap.begin();i_ccu !=
ccuMap.end(); i_ccu++){
2817 TmCcu * ccu= i_ccu->second;
2819 int idmod=ccu->
idex;
2820 *txtfile <<
"<a name="<<idmod<<
"><pre>"<<std::endl;
2821 *txtfile << ccu->
text << std::endl;
2822 std::ostringstream outs;
2823 if(ccu->
nmod==0)outs <<
"ccu is in position" << ccu->
mpos<<
"in ring but doesn't seem to have any module connected";
else
2825 outs <<
"ccu is in position " << ccu->
mpos<<
" in ring and connects " <<ccu->
nmod<<
" modules" << std::endl;
2827 for (it = ret.first; it != ret.second; ++it)
2829 outs << (*it).second->idex<<
" " << (*it).second->name <<
" value= "<< (*it).second->value<<
"\n\n";
2832 *txtfile <<
"</pre><h4>"<< outs.str()<<
"</h4>"<<std::endl;
2836 *txtfile <<
"</body></html>" << std::endl;
2837 txtfile->close();
delete txtfile;
2841 std::ostringstream outs3,outs4;
2842 outs3 << outputfilename<<
"psu.png";
2845 outs4 << outputfilename<<
".xml";
2850 std::map<int , TmPsu *>::iterator ipsu;
2851 std::multimap<TmPsu*, TmModule*>::iterator it;
2852 std::pair<std::multimap<TmPsu*, TmModule*>::iterator,std::multimap<TmPsu*, TmModule*>::iterator>
ret;
2853 for (
int rack=1; rack < (
npsuracks+1); rack++){
2854 std::ostringstream outs;
2856 outs << outputfilename <<
"psurack"<<rack<<
".html";
2857 txtfile =
new std::ofstream(outs.str().c_str(),
std::ios::out);
2858 *txtfile <<
"<html><head></head> <body>" << std::endl;
2859 for ( ipsu=
psuMap.begin();ipsu !=
psuMap.end(); ipsu++){
2860 TmPsu * psu= ipsu->second;
2862 *txtfile <<
"<a name="<<psu->
idex<<
"><pre>"<<std::endl;
2863 *txtfile << psu->
text << std::endl;
2864 std::ostringstream outs;
2865 if(psu->
nmod==0)outs <<
"Ps is in position" << psu->
getPsuBoard()<<
"in crate but doesn't seem to have any module connected";
else
2867 outs<<
"PS is in position " <<psu->
getPsuBoard()<<
" in crate and connects to "<<psu->
nmod<<
" modules. "<<std::endl;
2870 for (it = ret.first; it != ret.second; ++it)
2872 outs <<(*it).second->idex <<
" "<< (*it).second->name<<
" value= "<<(*it).second->value<<
" <br>"<<std::endl;
2875 *txtfile <<
"</pre><h4>"<< outs.str()<<
"</h4>"<<std::endl;
2879 *txtfile <<
"</body></html>" << std::endl;
2880 txtfile->close();
delete txtfile;
2886 std::ostringstream outs5,outs6;
2887 outs5 << outputfilename<<
"hv.png";
2890 outs6 << outputfilename<<
".xml";
2895 std::map<int , TmPsu *>::iterator ipsu;
2896 std::multimap<TmPsu*, TmModule*>::iterator it;
2897 std::pair<std::multimap<TmPsu*, TmModule*>::iterator,std::multimap<TmPsu*, TmModule*>::iterator>
ret;
2898 for (
int rack=1; rack < (
npsuracks+1); rack++){
2899 std::ostringstream outs;
2901 outs << outputfilename <<
"HVrack"<<rack<<
".html";
2902 txtfile =
new std::ofstream(outs.str().c_str(),
std::ios::out);
2903 *txtfile <<
"<html><head></head> <body>" << std::endl;
2904 for ( ipsu=
psuMap.begin();ipsu !=
psuMap.end(); ipsu++){
2905 TmPsu * psu= ipsu->second;
2907 *txtfile <<
"<a name="<<psu->
idex<<
"><pre>"<<std::endl;
2908 *txtfile << psu->
textHV2 << std::endl;
2909 std::ostringstream outsHV2;
2910 if(psu->
nmodHV2==0)outsHV2 <<
"HV Channel002 is in position" << psu->
getPsuBoard()<<
"in crate but doesn't seem to have any module connected";
else
2912 outsHV2<<
"HV Channel002 is in position " <<psu->
getPsuBoard()<<
" in crate and connects to "<<psu->
nmodHV2<<
" modules. "<<
" <br>"<<std::endl;
2915 for (it = ret.first; it != ret.second; ++it)
2917 if((*it).second->HVchannel==2){outsHV2 <<(*it).second->idex <<
" "<< (*it).second->name<<
" value= "<<(*it).second->value<<
" <br>"<<std::endl;}
2919 *txtfile <<
"</pre><h4>"<< outsHV2.str()<<
"</h4>"<<std::endl;
2922 *txtfile << psu->
textHV3 << std::endl;
2923 std::ostringstream outsHV3;
2924 if(psu->
nmodHV3==0)outsHV3 <<
"HV Channel003 is in position" << psu->
getPsuBoard()<<
"in crate but doesn't seem to have any module connected";
else
2926 outsHV3<<
"HV Channel003 is in position " <<psu->
getPsuBoard()<<
" in crate and connects to "<<psu->
nmodHV3<<
" modules. "<<
" <br>"<<std::endl;
2929 for (it = ret.first; it != ret.second; ++it)
2931 if((*it).second->HVchannel==3){outsHV3 <<(*it).second->idex <<
" "<< (*it).second->name<<
" value= "<<(*it).second->value<<
" <br>"<<std::endl;}
2933 *txtfile <<
"</pre><h4>"<< outsHV3.str()<<
"</h4>"<<std::endl;
2938 *txtfile <<
"</body></html>" << std::endl;
2939 txtfile->close();
delete txtfile;
2946 std::ofstream * ofilename;
2947 std::ifstream * ifilename;
2948 std::ostringstream ofname;
2953 ifilename=
findfile(
"viewerHeader.xhtml");
2954 ofname << outputfilename <<
"viewer.html";
2955 ofilename =
new std::ofstream(ofname.str().c_str(),
std::ios::out);
2956 while (getline( *ifilename, line )) { *ofilename << line << std::endl; }
2957 *ofilename <<
" var tmapname=\"" <<outputfilename <<
"\""<<std::endl;
2958 *ofilename <<
" var tmaptitle=\"" <<
title <<
"\""<<std::endl;
2959 *ofilename <<
" var ncrates=" <<
ncrates <<
";"<<std::endl;
2960 *ofilename <<
" var nfeccrates=" <<
nfeccrates <<
";"<<std::endl;
2961 *ofilename <<
" var npsuracks=" <<
npsuracks <<
";"<<std::endl;
2962 ifilename->close();
delete ifilename;
2963 ifilename=
findfile(
"viewerTrailer.xhtml");
2964 while (getline( *ifilename, line )) { *ofilename << line << std::endl; }
2965 ofilename->close();
delete ofilename;
2966 ifilename->close();
delete ifilename;
2967 command =
"sed -i \"s/XtmapnameX/"+outputfilename+
"/g\" "+ ofname.str();
2968 std::cout <<
"Executing " << command << std::endl;
2969 system(command.c_str());
2970 command =
"sed -i \"s/XtmaptitleX/"+
title+
"/g\" "+ ofname.str();
2971 std::cout <<
"Executing " << command << std::endl;
2972 system(command.c_str());
2976 ofname <<
"jqviewer.js";
2977 ofilename =
new std::ofstream(ofname.str().c_str(),
std::ios::out);
2978 while (getline( *ifilename, line )) { *ofilename << line << std::endl; }
2979 ofilename->close();
delete ofilename;
2980 ifilename->close();
delete ifilename;
2984 ofname <<
"crate.js";
2985 ofilename =
new std::ofstream(ofname.str().c_str(),
std::ios::out);
2986 while (getline( *ifilename, line )) { *ofilename << line << std::endl; }
2987 ofilename->close();
delete ofilename;
2988 ifilename->close();
delete ifilename;
2992 ofname <<
"feccrate.js";
2993 ofilename =
new std::ofstream(ofname.str().c_str(),
std::ios::out);
2994 while (getline( *ifilename, line )) { *ofilename << line << std::endl; }
2995 ofilename->close();
delete ofilename;
2996 ifilename->close();
delete ifilename;
3000 ofname <<
"rack.js";
3001 ofilename =
new std::ofstream(ofname.str().c_str(),
std::ios::out);
3002 while (getline( *ifilename, line )) { *ofilename << line << std::endl; }
3003 ofilename->close();
delete ofilename;
3004 ifilename->close();
delete ifilename;
3008 ofname <<
"rackhv.js";
3009 ofilename =
new std::ofstream(ofname.str().c_str(),
std::ios::out);
3010 while (getline( *ifilename, line )) { *ofilename << line << std::endl; }
3011 ofilename->close();
delete ofilename;
3012 ifilename->close();
delete ifilename;
3016 ofname <<
"layer.js";
3017 ofilename =
new std::ofstream(ofname.str().c_str(),
std::ios::out);
3018 while (getline( *ifilename, line )) { *ofilename << line << std::endl; }
3019 ofilename->close();
delete ofilename;
3020 ifilename->close();
delete ifilename;
3022 command =
"scp -r ../../DQM/TrackerCommon/test/jquery/ .";
3023 std::cout <<
"Executing " << command << std::endl;
3024 system(command.c_str());
3025 command =
"scp -r ../../CommonTools/TrackerMap/data/images/ .";
3026 std::cout <<
"Executing " << command << std::endl;
3027 system(command.c_str());
3030 std::ostringstream outs;
3031 outs << outputfilename<<
".png";
3032 save(
true,minval,maxval,outs.str(),3000,1600);
3038 for (
int layer=1; layer < 44; layer++){
3039 std::ostringstream outs;
3040 outs << outputfilename <<
"layer"<<layer<<
".html";
3041 txtfile =
new std::ofstream(outs.str().c_str(),
std::ios::out);
3042 *txtfile <<
"<html><head></head> <body>" << std::endl;
3048 int idmod=mod->
idex;
3050 *txtfile <<
"<a name="<<idmod<<
"><pre>"<<std::endl;
3051 std::multimap<const int, TmApvPair*>::iterator
pos;
3057 *txtfile << apvpair->
text << std::endl;
3061 *txtfile <<
"</pre><h3>"<< mod->
name<<
"</h3>"<<std::endl;
3065 *txtfile <<
"</body></html>" << std::endl;
3066 txtfile->close();
delete txtfile;
3069 std::ostringstream outs1,outs2;
3070 outs1 << outputfilename<<
"fed.png";
3072 outs2 << outputfilename<<
".xml";
3075 std::map<int , int>::iterator i_fed;
3077 for (
int crate=1; crate < (
ncrates+1); crate++){
3078 std::ostringstream outs;
3079 outs << outputfilename <<
"crate"<<crate<<
".html";
3080 txtfile =
new std::ofstream(outs.str().c_str(),
std::ios::out);
3081 *txtfile <<
"<html><head></head> <body>" << std::endl;
3082 for (i_fed=
fedMap.begin();i_fed !=
fedMap.end(); i_fed++){
3083 if(i_fed->second == crate){
3084 int fedId = i_fed->first;
3085 for (
int nconn=0;nconn<96;nconn++){
3086 int key = fedId*1000+nconn;
3089 int idmod=apvPair->
idex;
3090 *txtfile <<
"<a name="<<idmod<<
"><pre>"<<std::endl;
3091 *txtfile << apvPair->
text << std::endl;
3092 std::ostringstream outs;
3093 outs <<
"fedchannel " <<apvPair->
getFedId() <<
"/"<<apvPair->
getFedCh()<<
" connects to module " << apvPair->
mod->
idex ;
3094 *txtfile <<
"</pre><h3>"<< outs.str()<<
"</h3>"<<std::endl;
3099 *txtfile <<
"</body></html>" << std::endl;
3100 txtfile->close();
delete txtfile;
3104 std::ostringstream outs1,outs2;
3105 outs1 << outputfilename<<
"fec.png";
3107 outs2 << outputfilename<<
".xml";
3111 std::map<int , TmCcu *>::iterator i_ccu;
3112 std::multimap<TmCcu*, TmModule*>::iterator it;
3113 std::pair<std::multimap<TmCcu*, TmModule*>::iterator,std::multimap<TmCcu*, TmModule*>::iterator>
ret;
3114 for (
int crate=1; crate < (
nfeccrates+1); crate++){
3115 std::ostringstream outs;
3116 outs << outputfilename <<
"feccrate"<<crate<<
".html";
3117 txtfile =
new std::ofstream(outs.str().c_str(),
std::ios::out);
3118 *txtfile <<
"<html><head></head> <body>" << std::endl;
3119 for( i_ccu=
ccuMap.begin();i_ccu !=
ccuMap.end(); i_ccu++){
3120 TmCcu * ccu= i_ccu->second;
3122 int idmod=ccu->
idex;
3123 *txtfile <<
"<a name="<<idmod<<
"><pre>"<<std::endl;
3124 *txtfile << ccu->
text << std::endl;
3125 std::ostringstream outs;
3126 if(ccu->
nmod==0)outs <<
"ccu is in position" << ccu->
mpos<<
"in ring but doesn't seem to have any module connected";
else
3128 outs <<
"ccu is in position " << ccu->
mpos<<
" in ring and connects " <<ccu->
nmod<<
" modules" << std::endl;
3130 for (it = ret.first; it != ret.second; ++it)
3132 outs << (*it).second->idex<<
" " << (*it).second->name <<
" value= "<< (*it).second->value<<
"\n\n";
3135 *txtfile <<
"</pre><h4>"<< outs.str()<<
"</h4>"<<std::endl;
3139 *txtfile <<
"</body></html>" << std::endl;
3144 std::ostringstream outs3,outs4;
3145 outs3 << outputfilename<<
"psu.png";
3148 outs4 << outputfilename<<
".xml";
3153 std::map<int , TmPsu *>::iterator ipsu;
3154 std::multimap<TmPsu*, TmModule*>::iterator it;
3155 std::pair<std::multimap<TmPsu*, TmModule*>::iterator,std::multimap<TmPsu*, TmModule*>::iterator>
ret;
3156 for (
int rack=1; rack < (
npsuracks+1); rack++){
3157 std::ostringstream outs;
3159 outs << outputfilename <<
"psurack"<<rack<<
".html";
3160 txtfile =
new std::ofstream(outs.str().c_str(),
std::ios::out);
3161 *txtfile <<
"<html><head></head> <body>" << std::endl;
3162 for ( ipsu=
psuMap.begin();ipsu !=
psuMap.end(); ipsu++){
3163 TmPsu * psu= ipsu->second;
3165 *txtfile <<
"<a name="<<psu->
idex<<
"><pre>"<<std::endl;
3166 *txtfile << psu->
text << std::endl;
3167 std::ostringstream outs;
3168 if(psu->
nmod==0)outs <<
"Ps is in position" << psu->
getPsuBoard()<<
"in crate but doesn't seem to have any module connected";
else
3170 outs<<
"PS is in position " <<psu->
getPsuBoard()<<
" in crate and connects to "<<psu->
nmod<<
" modules. "<<std::endl;
3173 for (it = ret.first; it != ret.second; ++it)
3175 outs <<(*it).second->idex <<
" "<< (*it).second->name<<
" value= "<<(*it).second->value<<
" <br>"<<std::endl;
3178 *txtfile <<
"</pre><h4>"<< outs.str()<<
"</h4>"<<std::endl;
3182 *txtfile <<
"</body></html>" << std::endl;
3189 std::ostringstream outs5,outs6;
3190 outs5 << outputfilename<<
"hv.png";
3193 outs6 << outputfilename<<
".xml";
3198 std::map<int , TmPsu *>::iterator ipsu;
3199 std::multimap<TmPsu*, TmModule*>::iterator it;
3200 std::pair<std::multimap<TmPsu*, TmModule*>::iterator,std::multimap<TmPsu*, TmModule*>::iterator>
ret;
3201 for (
int rack=1; rack < (
npsuracks+1); rack++){
3202 std::ostringstream outs;
3204 outs << outputfilename <<
"HVrack"<<rack<<
".html";
3205 txtfile =
new std::ofstream(outs.str().c_str(),
std::ios::out);
3206 *txtfile <<
"<html><head></head> <body>" << std::endl;
3207 for ( ipsu=
psuMap.begin();ipsu !=
psuMap.end(); ipsu++){
3208 TmPsu * psu= ipsu->second;
3210 *txtfile <<
"<a name="<<psu->
idex<<
"><pre>"<<std::endl;
3211 *txtfile << psu->
textHV2 << std::endl;
3212 std::ostringstream outsHV2;
3213 if(psu->
nmodHV2==0)outsHV2 <<
"HV Channel002 is in position" << psu->
getPsuBoard()<<
"in crate but doesn't seem to have any module connected";
else
3215 outsHV2<<
"HV Channel002 is in position " <<psu->
getPsuBoard()<<
" in crate and connects to "<<psu->
nmodHV2<<
" modules. "<<
" <br>"<<std::endl;
3218 for (it = ret.first; it != ret.second; ++it)
3220 if((*it).second->HVchannel==2){outsHV2 <<(*it).second->idex <<
" "<< (*it).second->name<<
" value= "<<(*it).second->value<<
" <br>"<<std::endl;}
3222 *txtfile <<
"</pre><h4>"<< outsHV2.str()<<
"</h4>"<<std::endl;
3225 *txtfile << psu->
textHV3 << std::endl;
3226 std::ostringstream outsHV3;
3227 if(psu->
nmodHV3==0)outsHV3 <<
"HV Channel003 is in position" << psu->
getPsuBoard()<<
"in crate but doesn't seem to have any module connected";
else
3229 outsHV3<<
"HV Channel003 is in position " <<psu->
getPsuBoard()<<
" in crate and connects to "<<psu->
nmodHV3<<
" modules. "<<
" <br>"<<std::endl;
3232 for (it = ret.first; it != ret.second; ++it)
3234 if((*it).second->HVchannel==3){outsHV3 <<(*it).second->idex <<
" "<< (*it).second->name<<
" value= "<<(*it).second->value<<
" <br>"<<std::endl;}
3236 *txtfile <<
"</pre><h4>"<< outsHV3.str()<<
"</h4>"<<std::endl;
3241 *txtfile <<
"</body></html>" << std::endl;
3251 std::ifstream * ifilename;
3257 ifname=
"CommonTools/TrackerMap/data/"+
filename;
3261 ifname=
"CommonTools/TrackerMap/data/"+
filename;
3264 if(!ifilename)
std::cout <<
"File " << filename <<
" missing" << std::endl;
3268 std::ofstream * xmlfile;
3271 for (
int layer=1; layer < 44; layer++){
3286 for (
int layer=1; layer < 44; layer++){
3299 for (
int layer=1; layer < 44; layer++){
3300 std::ostringstream outs;
3301 outs << outputfilename <<
"layer"<<layer<<
".xml";
3302 xmlfile =
new std::ofstream(outs.str().c_str(),
std::ios::out);
3303 *xmlfile <<
"<?xml version=\"1.0\" standalone=\"no\"?>"<<std::endl;
3304 *xmlfile <<
"<svg xmlns=\"http://www.w3.org/2000/svg\""<<std::endl;
3305 *xmlfile <<
"xmlns:svg=\"http://www.w3.org/2000/svg\""<<std::endl;
3306 *xmlfile <<
"xmlns:xlink=\"http://www.w3.org/1999/xlink\" >"<<std::endl;
3307 *xmlfile <<
"<script type=\"text/ecmascript\" xlink:href=\"layer.js\" />"<<std::endl;
3308 *xmlfile <<
"<svg id=\"mainMap\" x=\"0\" y=\"0\" viewBox=\"0 0 500 500\" width=\"700\" height=\"700\" onload=\"TrackerLayer.init()\">"<<std::endl;
3309 if(layer<31)*xmlfile <<
"<g id=\"layer\" transform=\" translate(0,400) rotate(270) scale(1.,1.)\" > "<<std::endl;
3310 else *xmlfile <<
"<g id=\"layer\" transform=\" translate(0,400) rotate(270) scale(1.,0.8)\" > "<<std::endl;
3311 *xmlfile <<
"<rect fill=\"lightblue\" stroke=\"none\" x=\"0\" y=\"0\" width=\"700\" height=\"700\" />"<<std::endl;
3312 *xmlfile <<
"<svg:polygon id=\"fed\" mapAttribute=\"fed\" points=\"250,40 250,10 230,10 230,40\" onclick=\"chooseMap(evt);\" onmouseover=\"chooseMap(evt);\" onmouseout=\"chooseMap(evt);\" fill=\"rgb(0,127,255)\"/>"<<std::endl;
3313 *xmlfile <<
"<svg:polygon id=\"fec\" mapAttribute=\"fec\" points=\"228,40 228,10 208,10 208,40\" onclick=\"chooseMap(evt);\" onmouseover=\"chooseMap(evt);\" onmouseout=\"chooseMap(evt);\" fill=\"rgb(0,127,255)\"/>"<<std::endl;
3314 *xmlfile <<
"<svg:polygon id=\"lv\" mapAttribute=\"lv\" points=\"206,40 206,10 186,10 186,40\" onclick=\"chooseMap(evt);\" onmouseover=\"chooseMap(evt);\" onmouseout=\"chooseMap(evt);\" fill=\"rgb(0,127,255)\"/>"<<std::endl;
3315 *xmlfile <<
"<svg:polygon id=\"hv\" mapAttribute=\"hv\" points=\"184,40 184,10 164,10 164,40\" onclick=\"chooseMap(evt);\" onmouseover=\"chooseMap(evt);\" onmouseout=\"chooseMap(evt);\" fill=\"rgb(0,127,255)\"/>"<<std::endl;
3316 *xmlfile <<
"<svg:polygon id=\"plot\" mapAttribute=\"plot\" points=\"155,45 155,5 135,5 135,45\" onclick=\"chooseMap(evt);\" onmouseover=\"chooseMap(evt);\" onmouseout=\"chooseMap(evt);\" fill=\"rgb(200,0,0)\"/>"<<std::endl;
3325 drawModule(mod,key,layer,print_total,xmlfile);
3329 *xmlfile <<
"</g> </svg> <text id=\"currentElementText\" x=\"40\" y=\"30\">" << std::endl;
3330 *xmlfile <<
"<tspan id=\"line1\" x=\"40\" y=\"30\"> </tspan> " << std::endl;
3331 *xmlfile <<
"<tspan id=\"line2\" x=\"40\" y=\"60\"> </tspan> " << std::endl;
3332 *xmlfile <<
"<tspan id=\"line3\" x=\"40\" y=\"90\"> </tspan> " << std::endl;
3333 *xmlfile <<
"<tspan id=\"line4\" x=\"40\" y=\"120\"> </tspan> " << std::endl;
3335 *xmlfile <<
"<tspan mapAttribute=\"fed\" onclick=\"chooseMap(evt);\" onmouseover=\"chooseMap(evt);\" onmouseout=\"chooseMap(evt);\" x=\"15\" y=\"228\" font-size=\"12\" font-family=\"arial\" fill=\"white\">FED</tspan> " <<std::endl;
3336 *xmlfile <<
"<tspan mapAttribute=\"fec\" onclick=\"chooseMap(evt);\" onmouseover=\"chooseMap(evt);\" onmouseout=\"chooseMap(evt);\" x=\"15\" y=\"258\" font-size=\"12\" font-family=\"arial\" fill=\"white\">FEC</tspan> " <<std::endl;
3337 *xmlfile <<
"<tspan mapAttribute=\"lv\" onclick=\"chooseMap(evt);\" onmouseover=\"chooseMap(evt);\" onmouseout=\"chooseMap(evt);\" x=\"18\" y=\"289\" font-size=\"12\" font-family=\"arial\" fill=\"white\">LV</tspan> " <<std::endl;
3338 *xmlfile <<
"<tspan mapAttribute=\"hv\" onclick=\"chooseMap(evt);\" onmouseover=\"chooseMap(evt);\" onmouseout=\"chooseMap(evt);\" x=\"18\" y=\"319\" font-size=\"12\" font-family=\"arial\" fill=\"white\">HV</tspan> " <<std::endl;
3339 *xmlfile <<
"<tspan mapAttribute=\"plot\" onclick=\"chooseMap(evt);\" onmouseover=\"chooseMap(evt);\" onmouseout=\"chooseMap(evt);\" x=\"12\" y=\"360\" font-size=\"12\" font-family=\"arial\" fill=\"white\">PLOT</tspan> " <<std::endl;
3342 *xmlfile <<
"<tspan mapAttribute=\"fed\" onclick=\"chooseMap(evt);\" onmouseover=\"chooseMap(evt);\" onmouseout=\"chooseMap(evt);\" x=\"21\" y=\"228\" font-size=\"12\" font-family=\"arial\" fill=\"white\">FED</tspan> " <<std::endl;
3343 *xmlfile <<
"<tspan mapAttribute=\"fec\" onclick=\"chooseMap(evt);\" onmouseover=\"chooseMap(evt);\" onmouseout=\"chooseMap(evt);\" x=\"21\" y=\"258\" font-size=\"12\" font-family=\"arial\" fill=\"white\">FEC</tspan> " <<std::endl;
3344 *xmlfile <<
"<tspan mapAttribute=\"lv\" onclick=\"chooseMap(evt);\" onmouseover=\"chooseMap(evt);\" onmouseout=\"chooseMap(evt);\" x=\"24\" y=\"289\" font-size=\"12\" font-family=\"arial\" fill=\"white\">LV</tspan> " <<std::endl;
3345 *xmlfile <<
"<tspan mapAttribute=\"hv\" onclick=\"chooseMap(evt);\" onmouseover=\"chooseMap(evt);\" onmouseout=\"chooseMap(evt);\" x=\"24\" y=\"319\" font-size=\"12\" font-family=\"arial\" fill=\"white\">HV</tspan> " <<std::endl;
3346 *xmlfile <<
"<tspan mapAttribute=\"plot\" onclick=\"chooseMap(evt);\" onmouseover=\"chooseMap(evt);\" onmouseout=\"chooseMap(evt);\" x=\"17\" y=\"360\" font-size=\"12\" font-family=\"arial\" fill=\"white\">PLOT</tspan> " <<std::endl;
3348 *xmlfile <<
" </text> </svg>" << std::endl;
3349 xmlfile->close();
delete xmlfile;
void drawHV3(int rack, int numcrate_inrack, bool print_total, TmPsu *psu, ofstream *svgfile, bool usePsuValue)
void fill_hv_channel2(int rack, int crate, int board, float qty)
T getUntrackedParameter(std::string const &, T const &) const
TrackerMap(std::string s=" ", int xsize1=340, int ysize1=200)
double ydpixelc(double y)
std::ifstream * findfile(std::string filename)
double ydpixelfec(double y)
int getmoduleCount(int subdet, int partdet, int layer, int ring)
void save_as_psutrackermap(bool print_total=true, float minval=0., float maxval=0., std::string s="psu_svgmap.svg", int width=1500, int height=800)
void fillc_hv_channel2(int rack, int crate, int board, int red, int green, int blue)
std::ifstream * inputfile
~TrackerMap()
default destructor
static const uint32_t invalid32_
void drawPsu(int rack, int numcrate_inrack, bool print_total, TmPsu *psu, ofstream *svgfile, bool usePsuValue)
int module(int fedId, int fedCh)
void defwindow(int num_lay)
Sin< T >::type sin(const T &t)
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)
bool exists(std::string const ¶meterName) const
checks if a parameter exists
std::vector< Color_t > colors
void fill_current_val_fed_channel(int fedId, int fedCh, float current_val)
const std::vector< SiStripFecCrate > & crates() const
void fillc_fec_channel(int crate, int slot, int ring, int addr, int red, int green, int blue)
double xdpixelfec(double x)
double phival(double x, double y)
void fillc_lv_channel(int rack, int crate, int board, int red, int green, int blue)
int getringCount(int subdet, int partdet, int layer)
double xdpixelpsu(double x)
const T & max(const T &a, const T &b)
void save(bool print_total=true, float minval=0., float maxval=0., std::string s="svgmap.svg", int width=1500, int height=800)
void drawHV2(int rack, int numcrate_inrack, bool print_total, TmPsu *psu, ofstream *svgfile, bool usePsuValue)
Cos< T >::type cos(const T &t)
void deffecwindow(int num_crate)
void drawPalette(std::ofstream *file)
void load(std::string s="tmap.svg")
void drawModule(TmModule *mod, int key, int layer, bool total, std::ofstream *file)
void drawApvPair(int crate, int numfed_incrate, bool total, TmApvPair *apvPair, std::ofstream *file, bool useApvPairValue)
void fillc_fed_channel(int fedId, int fedCh, int red, int green, int blue)
int getcolor(float value, int palette)
void fillc(int idmod, int RGBcode)
void printlayers(bool print_total=true, float minval=0., float maxval=0., std::string s="layer")
void 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)
static const uint16_t invalid_
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 save_as_fedtrackermap(bool print_total=true, float minval=0., float maxval=0., std::string s="fed_svgmap.svg", int width=1500, int height=800)
void fill_fec_channel(int crate, int slot, int ring, int addr, float qty)
void fill_current_val(int idmod, float current_val)
void setText(int idmod, std::string s)
static bool isRingStereo(int key)
void defcwindow(int num_crate)
T mod(const T &a, const T &b)
void fill_lv_channel(int rack, int crate, int board, float qty)
std::vector< TColor * > vc
void fill(int layer, int ring, int nmod, float x)
double ydpixelpsu(double y)
void save_as_fectrackermap(bool print_total=true, float minval=0., float maxval=0., std::string s="fec_svgmap.svg", int width=1500, int height=800)
void printall(bool print_total=true, float minval=0., float maxval=0., std::string s="svgmap")
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)