![]() |
![]() |
#include <VisReco/VisCustomTracker/interface/VisCuTkMap2D.h>
Definition at line 33 of file VisCuTkMap2D.h.
VisCuTkMap2D::VisCuTkMap2D | ( | QWidget * | parent = 0 , |
|
const char * | name = 0 , |
|||
VisCuTrackerSimHit * | simhitdr = 0 , |
|||
VisCuTrackerDigi * | digidr = 0 , |
|||
VisCuTrackerCluster * | clusterdr = 0 , |
|||
VisCuTrackerRecHit * | rechitdr = 0 | |||
) |
Definition at line 55 of file VisCuTkMap2D.cc.
References acc, clusterdraw, deltax, deltay, digidraw, drawall, drawclusters, drawdigis, drawrechits, drawsimhits, firsteventloaded, edm::ParameterSet::getUntrackedParameter(), horizontal_view, ix, iy, nev, nevToIntegrate, p, printer, printing, VisConfigurationService::pSet(), python::EventAnalyzer_cfg::pset, rechitdraw, separated, simhitdraw, startintegrate, stopintegrate, VisConfigurationService_cff::VisConfigurationService, x_win, ximg, xmax, xmin, xsize, yimg, ymax, ymin, ysize, zoom, and zoom_in_out.
00056 : QWidget( parent, name ) 00057 { 00058 const edm::ParameterSet *pset=VisConfigurationService::pSet(); 00059 if(!pset) 00060 { 00061 edm::ParameterSet p; 00062 VisConfigurationService *visService = new VisConfigurationService(p); 00063 pset = visService->pSet(); 00064 delete visService; 00065 } 00066 setPalette( QPalette( QColor( 250, 250, 250) ) ); 00067 xmin = -3.0; xmax = 3.0; ymin = -0.1; ymax =1.0; 00068 ximg=600; yimg=600; x_win = 600; 00069 deltax=0; deltay=0; 00070 setMinimumSize( 600, 600 ); 00071 setMaximumSize( 600, 600 ); 00072 separated = false; 00073 drawall=false; 00074 drawsimhits=false; 00075 drawdigis=false; 00076 drawclusters=false; 00077 drawrechits=false; 00078 printing=false; 00079 acc = false; 00080 firsteventloaded = false; 00081 xsize = pset->getUntrackedParameter<unsigned int>("xsize", 320); 00082 ysize = pset->getUntrackedParameter<unsigned int>("ysize", 200); 00083 nevToIntegrate = pset->getUntrackedParameter<unsigned int>("nevToIntegrate", 100); 00084 nev = 0; 00085 ix=0;iy=0;zoom=1; 00086 zoom_in_out =false; 00087 printer = new QPrinter(QPrinter::HighResolution); 00088 startintegrate=false; 00089 stopintegrate=false; 00090 simhitdraw=simhitdr; 00091 digidraw=digidr; 00092 clusterdraw=clusterdr; 00093 rechitdraw=rechitdr; 00094 horizontal_view = true; 00095 }
void VisCuTkMap2D::computemodule | ( | VisCuTkModule * | mod, | |
int | nlay, | |||
QPointArray & | a | |||
) | [private] |
Definition at line 571 of file VisCuTkMap2D.cc.
References funct::cos(), VisCuTkSubLayer::getId(), VisCuTkModule::getId(), VisCuTkModule::getOwner(), horizontal_view, VisCuTkSubLayer::isStereo(), j, VisCuTkModule::length, phi, phival(), VisCuTkModule::posx, VisCuTkModule::posy, VisCuTkModule::posz, pv1, r, separated, funct::sin(), sl, funct::sqrt(), VisCuTkModule::width, VisCuTkModule::widthAtHalfLength, x, x_win, xpixel(), y, and ypixel().
Referenced by pan().
00571 { 00572 int x,y; 00573 double phi,r,dx,dy,dy1; 00574 double xp[4],yp[4],xp1,yp1; 00575 double vhbot,vhtop,vhapo; 00576 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}; 00577 double xt1,yt1,xs1=0.,ys1=0.,xt2,yt2,xs2,ys2,pv1,pv2; 00578 00579 phi = phival(mod->posx,mod->posy); 00580 r = sqrt(mod->posx*mod->posx+mod->posy*mod->posy); 00581 00582 vhbot = mod->width; 00583 vhtop=mod->width; 00584 vhapo=mod->length; 00585 if(nlay < 31){//endcap 00586 vhbot = mod->widthAtHalfLength/2.-(mod->width/2.-mod->widthAtHalfLength/2.); 00587 vhtop=mod->width/2.; 00588 vhapo=mod->length/2.; 00589 if(nlay >12 && nlay <19){//pix endcap 00590 if(separated)r = r+r; 00591 xp[0]=r-vhtop;yp[0]=-vhapo; 00592 xp[1]=r+vhtop;yp[1]=-vhapo; 00593 xp[2]=r+vhtop;yp[2]=vhapo; 00594 xp[3]=r-vhtop;yp[3]=vhapo; 00595 }else{ 00596 if(separated)r = r + r/3.; 00597 xp[0]=r-vhapo;yp[0]=-vhbot; 00598 xp[1]=r+vhapo;yp[1]=-vhtop; 00599 xp[2]=r+vhapo;yp[2]=vhtop; 00600 xp[3]=r-vhapo;yp[3]=vhbot; 00601 } 00602 for(int j=0;j<4;j++){ 00603 xp1 = xp[j]*cos(phi)-yp[j]*sin(phi); 00604 yp1 = xp[j]*sin(phi)+yp[j]*cos(phi); 00605 xp[j] = xp1;yp[j]=yp1; 00606 } 00607 } else { //barrel 00608 int numod; 00609 numod=mod->getId();if(numod>100)numod=numod-100; 00610 int vane = mod->getOwner()->getId(); 00611 if(separated){ 00612 dx = vhapo; 00613 phi=M_PI; 00614 xt1=rmedio[nlay-31]; yt1=-vhtop/2.; 00615 xs1 = xt1*cos(phi)-yt1*sin(phi); 00616 ys1 = xt1*sin(phi)+yt1*cos(phi); 00617 xt2=rmedio[nlay-31]; yt2=vhtop/2.; 00618 xs2 = xt2*cos(phi)-yt2*sin(phi); 00619 ys2 = xt2*sin(phi)+yt2*cos(phi); 00620 dy=phival(xs2,ys2)-phival(xs1,ys1); 00621 dy1 = dy; 00622 if(nlay==31)dy1=0.39; 00623 if(nlay==32)dy1=0.23; 00624 if(nlay==33)dy1=0.16; 00625 xp[0]=vane*(dx+dx/8.);yp[0]=numod*(dy1); 00626 xp[1]=vane*(dx+dx/8.)+dx;yp[1]=numod*(dy1); 00627 xp[2]=vane*(dx+dx/8.)+dx;yp[2]=numod*(dy1)+dy; 00628 xp[3]=vane*(dx+dx/8.);yp[3]=numod*(dy1)+dy; 00629 }else{ 00630 xt1=r; yt1=-vhtop/2.; 00631 xs1 = xt1*cos(phi)-yt1*sin(phi); 00632 ys1 = xt1*sin(phi)+yt1*cos(phi); 00633 xt2=r; yt2=vhtop/2.; 00634 xs2 = xt2*cos(phi)-yt2*sin(phi); 00635 ys2 = xt2*sin(phi)+yt2*cos(phi); 00636 pv1=phival(xs1,ys1); 00637 pv2=phival(xs2,ys2); 00638 if(fabs(pv1-pv2)>M_PI && numod==1)pv1=pv1-2.*M_PI; 00639 if(fabs(pv1-pv2)>M_PI && numod!=1)pv2=pv2+2.*M_PI; 00640 xp[0]=mod->posz-vhapo/2.;yp[0]=4.2*pv1; 00641 xp[1]=mod->posz+vhapo/2.;yp[1]=4.2*pv1; 00642 xp[2]=mod->posz+vhapo/2. ;yp[2]=4.2*pv2; 00643 xp[3]=mod->posz-vhapo/2.;yp[3]=4.2*pv2; 00644 } 00645 } 00646 VisCuTkSubLayer* sl = mod->getOwner(); 00647 if(sl->isStereo()&&separated) 00648 { 00649 if(mod->getId()>100 ){ 00650 for(int j=0;j<3;j++){ 00651 x=xpixel(xp[j]);y=ypixel(yp[j]); 00652 if(!horizontal_view)a.setPoint(j,x,y);else a.setPoint(j,y,x_win-x); 00653 } 00654 if(!horizontal_view)a.setPoint(3,x,y);else a.setPoint(3,y,x_win-x); 00655 }else { 00656 x=xpixel(xp[2]);y=ypixel(yp[2]); 00657 if(!horizontal_view)a.setPoint(0,x,y);else a.setPoint(0,y,x_win-x); 00658 x=xpixel(xp[3]);y=ypixel(yp[3]); 00659 if(!horizontal_view)a.setPoint(1,x,y);else a.setPoint(1,y,x_win-x); 00660 x=xpixel(xp[0]);y=ypixel(yp[0]); 00661 if(!horizontal_view)a.setPoint(2,x,y);else a.setPoint(2,y,x_win-x); 00662 if(!horizontal_view)a.setPoint(3,x,y);else a.setPoint(3,y,x_win-x); 00663 } 00664 } else { 00665 for(int j=0;j<4;j++){ 00666 x=xpixel(xp[j]);y=ypixel(yp[j]); 00667 if(!horizontal_view)a.setPoint(j,x,y);else a.setPoint(j,y,x_win-x); 00668 } 00669 } 00670 }
Definition at line 218 of file VisCuTkMap2D.cc.
References deltax, deltay, drawall, horizontal_view, int, ix, iy, separated, ximg, xmax, xmin, xsize, yimg, ymax, ymin, ysize, zoom, and zoom_in_out.
Referenced by paintEvent(), pan(), and print().
00218 { 00219 if(separated){ // separated modules 00220 setPalette( QPalette( QColor( 158, 185, 225 ) )); 00221 xmin=-2.;ymin=-2.;xmax=2.;ymax=2.; 00222 if(nlay >12 && nlay < 19){ 00223 xmin=-.40;xmax=.40;ymin=-.40;ymax=.40; 00224 } 00225 if(nlay>30){ 00226 xmin=-0.1;xmax=3.;ymin=-0.1;ymax=8.5; 00227 if(nlay<34){xmin=-0.3;xmax=1.0;} 00228 if(nlay>33&&nlay<38){xmax=2.0;} 00229 if(nlay>37){ymax=8.;}//inner 00230 } 00231 }else{ //overlayed modules 00232 setPalette( QPalette( QColor( 255, 255, 255) ) ); 00233 xmin=-1.3;ymin=-1.3;xmax=1.3;ymax=1.3; 00234 if(nlay >12 && nlay < 19){ 00235 xmin=-.20;xmax=.20;ymin=-.20;ymax=.20; 00236 } 00237 if(nlay>30){ 00238 xmin=-1.5;xmax=1.5;ymin=-1.;ymax=28.; 00239 if(nlay<34){xmin=-0.5;xmax=0.5;} 00240 if(nlay>33&&nlay<38){xmin=-1.;xmax=1.;} 00241 } 00242 } 00243 if(zoom_in_out){ 00244 float xmin1,xmax1,ymin1,ymax1; 00245 xmin1=xmin+(xmax-xmin)/2.-(xmax-xmin)*zoom/2.; 00246 xmax1=xmin+(xmax-xmin)/2.+(xmax-xmin)*zoom/2.; 00247 ymin1=ymin+(ymax-ymin)/2.-(ymax-ymin)*zoom/2.; 00248 ymax1=ymin+(ymax-ymin)/2.+(ymax-ymin)*zoom/2.; 00249 xmin=xmin1;xmax=xmax1;ymin=ymin1;ymax=ymax1; 00250 } 00251 if(!drawall && (deltax!=0 || deltay!=0)){ 00252 float xmin1,xmax1,ymin1,ymax1; 00253 float movex= (float)deltax/ximg; 00254 float movey=(float) deltay/yimg; 00255 if(horizontal_view){ 00256 movex= (float)deltay/yimg; 00257 movey= (float)deltax/ximg; 00258 } 00259 xmin1=xmin-movex*(xmax-xmin); 00260 xmax1=xmax-movex*(xmax-xmin); 00261 ymin1=ymin-movey*(ymax-ymin); 00262 ymax1=ymax-movey*(ymax-ymin); 00263 xmin=xmin1;xmax=xmax1;ymin=ymin1;ymax=ymax1; 00264 } 00265 if(drawall){ 00266 if(nlay<16){ 00267 ix=0;iy=(15-nlay)*ysize;} 00268 if(nlay>15&&nlay<31){ 00269 ix=3*xsize;iy=(nlay-16)*ysize;} 00270 if(nlay>30){ 00271 if(nlay==31){ix=(int)(1.5*xsize);iy=0;} 00272 if(nlay>31 && nlay%2==0){int il=(nlay-30)/2;ix=xsize;iy=il*2*ysize;} 00273 if(nlay>31 && nlay%2!=0){int il=(nlay-30)/2;ix=2*xsize;iy=il*2*ysize;} 00274 } 00275 } 00276 }
void VisCuTkMap2D::drawAllTracker | ( | ) |
Definition at line 376 of file VisCuTkMap2D.cc.
References acc, deltax, deltay, drawall, horizontal_view, ix, iy, separated, startintegrate, x_win, ximg, xsize, yimg, ysize, zoom, and zoom_in_out.
00376 { 00377 zoom_in_out =false; 00378 deltax=0; deltay=0; 00379 zoom=1.; 00380 if(drawall){ 00381 drawall=false;ix=0;iy=0; 00382 ximg=600; yimg=600; x_win = 600; 00383 setMinimumSize( x_win, 600 ); 00384 setMaximumSize( x_win, 600 ); 00385 } 00386 else { 00387 drawall=true; 00388 if(!horizontal_view){ 00389 ximg=4*xsize; yimg=15*ysize; 00390 setMinimumSize( 4*xsize, 15*ysize ); 00391 setMaximumSize( 4*xsize, 15*ysize ); 00392 } else{ 00393 ximg=15*ysize; yimg=4*xsize; x_win = 4*xsize; 00394 setMinimumSize( 15*ysize, x_win ); 00395 setMaximumSize( 15*ysize, x_win ); 00396 } 00397 } 00398 if(acc&& !separated)startintegrate=true; 00399 repaint(); 00400 }
void VisCuTkMap2D::drawCluster | ( | ) |
Definition at line 314 of file VisCuTkMap2D.cc.
References acc, drawclusters, and reset_val().
00314 { 00315 if(drawclusters)drawclusters=false;else 00316 {drawclusters=true;if(!acc)reset_val();} 00317 repaint(); 00318 }
void VisCuTkMap2D::drawDigi | ( | ) |
Definition at line 309 of file VisCuTkMap2D.cc.
References acc, drawdigis, and reset_val().
00309 { 00310 if(drawdigis)drawdigis=false;else 00311 { drawdigis=true;if(!acc)reset_val();} 00312 repaint(); 00313 }
void VisCuTkMap2D::drawmodule | ( | VisCuTkModule * | mod, | |
int | nlay, | |||
QPainter * | p | |||
) | [private] |
Definition at line 457 of file VisCuTkMap2D.cc.
References a, funct::cos(), drawclusters, drawdigis, drawrechits, drawsimhits, VisCuTkSubLayer::getId(), VisCuTkModule::getId(), VisCuTkModule::getOwner(), cmsRelvalreport::green(), horizontal_view, VisCuTkSubLayer::isStereo(), j, VisCuTkModule::length, phi, phival(), VisCuTkModule::posx, VisCuTkModule::posy, VisCuTkModule::posz, pv1, r, separated, funct::sin(), sl, funct::sqrt(), VisCuTkModule::value, VisCuTkModule::width, VisCuTkModule::widthAtHalfLength, x, x_win, xpixel(), y, cmsRelvalreport::yellow(), and ypixel().
Referenced by paintEvent(), and print().
00457 { 00458 int x,y; 00459 double phi,r,dx,dy,dy1; 00460 double xp[4],yp[4],xp1,yp1; 00461 double vhbot,vhtop,vhapo; 00462 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}; 00463 double xt1,yt1,xs1=0.,ys1=0.,xt2,yt2,xs2,ys2,pv1,pv2; 00464 00465 QPointArray a = QPointArray(4); 00466 phi = phival(mod->posx,mod->posy); 00467 r = sqrt(mod->posx*mod->posx+mod->posy*mod->posy); 00468 00469 vhbot = mod->width; 00470 vhtop=mod->width; 00471 vhapo=mod->length; 00472 if(nlay < 31){//endcap 00473 vhbot = mod->widthAtHalfLength/2.-(mod->width/2.-mod->widthAtHalfLength/2.); 00474 vhtop=mod->width/2.; 00475 vhapo=mod->length/2.; 00476 if(nlay >12 && nlay <19){//pix endcap 00477 if(separated)r = r+r; 00478 xp[0]=r-vhtop;yp[0]=-vhapo; 00479 xp[1]=r+vhtop;yp[1]=-vhapo; 00480 xp[2]=r+vhtop;yp[2]=vhapo; 00481 xp[3]=r-vhtop;yp[3]=vhapo; 00482 }else{ 00483 if(separated)r = r + r/3.; 00484 xp[0]=r-vhapo;yp[0]=-vhbot; 00485 xp[1]=r+vhapo;yp[1]=-vhtop; 00486 xp[2]=r+vhapo;yp[2]=vhtop; 00487 xp[3]=r-vhapo;yp[3]=vhbot; 00488 } 00489 for(int j=0;j<4;j++){ 00490 xp1 = xp[j]*cos(phi)-yp[j]*sin(phi); 00491 yp1 = xp[j]*sin(phi)+yp[j]*cos(phi); 00492 xp[j] = xp1;yp[j]=yp1; 00493 } 00494 } else { //barrel 00495 int numod; 00496 numod=mod->getId();if(numod>100)numod=numod-100; 00497 int vane = mod->getOwner()->getId(); 00498 if(separated){ 00499 dx = vhapo; 00500 phi=M_PI; 00501 xt1=rmedio[nlay-31]; yt1=-vhtop/2.; 00502 xs1 = xt1*cos(phi)-yt1*sin(phi); 00503 ys1 = xt1*sin(phi)+yt1*cos(phi); 00504 xt2=rmedio[nlay-31]; yt2=vhtop/2.; 00505 xs2 = xt2*cos(phi)-yt2*sin(phi); 00506 ys2 = xt2*sin(phi)+yt2*cos(phi); 00507 dy=phival(xs2,ys2)-phival(xs1,ys1); 00508 dy1 = dy; 00509 if(nlay==31)dy1=0.39; 00510 if(nlay==32)dy1=0.23; 00511 if(nlay==33)dy1=0.16; 00512 xp[0]=vane*(dx+dx/8.);yp[0]=numod*(dy1); 00513 xp[1]=vane*(dx+dx/8.)+dx;yp[1]=numod*(dy1); 00514 xp[2]=vane*(dx+dx/8.)+dx;yp[2]=numod*(dy1)+dy; 00515 xp[3]=vane*(dx+dx/8.);yp[3]=numod*(dy1)+dy; 00516 }else{ 00517 xt1=r; yt1=-vhtop/2.; 00518 xs1 = xt1*cos(phi)-yt1*sin(phi); 00519 ys1 = xt1*sin(phi)+yt1*cos(phi); 00520 xt2=r; yt2=vhtop/2.; 00521 xs2 = xt2*cos(phi)-yt2*sin(phi); 00522 ys2 = xt2*sin(phi)+yt2*cos(phi); 00523 pv1=phival(xs1,ys1); 00524 pv2=phival(xs2,ys2); 00525 if(fabs(pv1-pv2)>M_PI && numod==1)pv1=pv1-2.*M_PI; 00526 if(fabs(pv1-pv2)>M_PI && numod!=1)pv2=pv2+2.*M_PI; 00527 xp[0]=mod->posz-vhapo/2.;yp[0]=4.2*pv1; 00528 xp[1]=mod->posz+vhapo/2.;yp[1]=4.2*pv1; 00529 xp[2]=mod->posz+vhapo/2. ;yp[2]=4.2*pv2; 00530 xp[3]=mod->posz-vhapo/2.;yp[3]=4.2*pv2; 00531 } 00532 } 00533 VisCuTkSubLayer* sl = mod->getOwner(); 00534 if(sl->isStereo()&&separated) 00535 { 00536 if(mod->getId()>100 ){ 00537 for(int j=0;j<3;j++){ 00538 x=xpixel(xp[j]);y=ypixel(yp[j]); 00539 if(!horizontal_view)a.setPoint(j,x,y);else a.setPoint(j,y,x_win-x); 00540 } 00541 if(!horizontal_view)a.setPoint(3,x,y);else a.setPoint(3,y,x_win-x); 00542 }else { 00543 x=xpixel(xp[2]);y=ypixel(yp[2]); 00544 if(!horizontal_view)a.setPoint(0,x,y);else a.setPoint(0,y,x_win-x); 00545 x=xpixel(xp[3]);y=ypixel(yp[3]); 00546 if(!horizontal_view)a.setPoint(1,x,y);else a.setPoint(1,y,x_win-x); 00547 x=xpixel(xp[0]);y=ypixel(yp[0]); 00548 if(!horizontal_view)a.setPoint(2,x,y);else a.setPoint(2,y,x_win-x); 00549 if(!horizontal_view)a.setPoint(3,x,y);else a.setPoint(3,y,x_win-x); 00550 } 00551 } else { 00552 for(int j=0;j<4;j++){ 00553 x=xpixel(xp[j]);y=ypixel(yp[j]); 00554 if(!horizontal_view)a.setPoint(j,x,y);else a.setPoint(j,y,x_win-x); 00555 } 00556 } 00557 if(separated){ 00558 if(drawdigis||drawsimhits||drawclusters||drawrechits){ 00559 p->setPen(QColor( 158, 185, 225)); 00560 int green = 255-mod->value; if (green < 0)green = 0;if(green > 255)green=255; 00561 p->setBrush(QColor(255,green,0)); 00562 if(mod->value==0)p->setBrush(white); 00563 } else { 00564 00565 p->setBrush(yellow); 00566 if(mod->getId()>100) p->setBrush(blue); 00567 } 00568 } 00569 p->drawPolygon(a); 00570 }
void VisCuTkMap2D::drawpalette | ( | QPainter * | p | ) | [private] |
Definition at line 672 of file VisCuTkMap2D.cc.
References drawclusters, drawdigis, drawrechits, drawsimhits, cmsRelvalreport::green(), separated, and value.
Referenced by paintEvent(), and print().
00672 { 00673 int posx = 200, posy=15,thickness=20, htext = 30; 00674 if(separated&&(drawsimhits||drawdigis||drawclusters||drawrechits)){ 00675 for(int value=0;value<255;value++){ 00676 int green=255-value; 00677 if (green < 0)green = 0;if(green > 255)green=255; 00678 p->setPen(QColor(255,green,0)); 00679 p->drawRect( posx+value, posy, 1,thickness ); 00680 if(value%100 == 0 ){ 00681 QString colnum=QString::number(value); 00682 p->setPen(black); 00683 p->drawText( posx+value, posy, colnum ); 00684 p->drawRect( posx+value, posy, 1,thickness ); 00685 } 00686 } 00687 p->setPen(black); 00688 p->drawRect( posx+255, posy, 1,thickness ); 00689 p->drawText( posx+255, posy,">255" ); 00690 if(drawsimhits)p->drawText( posx, posy+htext , " # of SimHits per module" ); 00691 if(drawdigis)p->drawText( posx, posy+htext , " # of digi per module" ); 00692 if(drawclusters)p->drawText( posx, posy+htext , " # of clusters per module" ); 00693 if(drawrechits)p->drawText( posx, posy+htext , " # of rechits per module" ); 00694 } 00695 }
void VisCuTkMap2D::drawrechit | ( | VisCuTkModule * | mod, | |
int | nlay, | |||
QPainter * | p | |||
) | [private] |
void VisCuTkMap2D::drawRechit | ( | ) |
Definition at line 319 of file VisCuTkMap2D.cc.
References acc, drawrechits, and reset_val().
00319 { 00320 if(drawrechits)drawrechits=false;else 00321 {drawrechits=true;if(!acc)reset_val();} 00322 repaint(); 00323 }
void VisCuTkMap2D::drawSimHits | ( | ) |
Definition at line 304 of file VisCuTkMap2D.cc.
References acc, drawsimhits, and reset_val().
00304 { 00305 if(drawsimhits)drawsimhits=false;else 00306 {drawsimhits=true;if(!acc)reset_val();} 00307 repaint(); 00308 }
Definition at line 402 of file VisCuTkMap2D.cc.
References res, xsize, and ysize.
Referenced by pan().
00402 { 00403 int add; 00404 int res=0; 00405 if(iy <= xsize){//endcap+z 00406 add = 15; 00407 res = ix/ysize; 00408 res = res+add+1; 00409 } 00410 if(iy > xsize && iy< 3*xsize){//barrel 00411 add=30; 00412 if(ix < 2*ysize){ 00413 res=1; 00414 }else { 00415 res = ix/(2*ysize); 00416 if(iy < 2*xsize)res=res*2+1; else res=res*2; 00417 } 00418 res = res+add; 00419 } 00420 if(iy >= 3*xsize){ //endcap-z 00421 res = ix/ysize; 00422 res = 15-res; 00423 } 00424 return res; 00425 }
Definition at line 325 of file VisCuTkMap2D.cc.
References acc, reset_val(), startintegrate, and stopintegrate.
00326 { 00327 acc=acc1; 00328 if(acc ){ 00329 startintegrate=true; 00330 reset_val(); 00331 } else stopintegrate=true; 00332 repaint(); 00333 }
void VisCuTkMap2D::paintEvent | ( | QPaintEvent * | ) | [protected] |
Definition at line 160 of file VisCuTkMap2D.cc.
References acc, ASSERT, VisCuTkModule::cluster_size, clusterdraw, VisCuTkCompositeDetector< T >::components(), GenMuonPlsPt100GeV_cfg::cout, defwindow(), VisCuTkModule::digi_size, digidraw, VisCuTrackerCluster::drawcluster(), drawclusters, VisCuTrackerDigi::drawdigi(), drawdigis, drawmodule(), drawpalette(), VisCuTrackerRecHit::drawrechit(), drawrechits, VisCuTrackerSimHit::drawsimhit(), drawsimhits, lat::endl(), VisCuTkCompositeDetector< T >::getComponent(), i, image, VisCuTkModule::isVisible(), j, k, edm::es::l(), m, nlay, VisCuTracker::nlayer(), VisCuTkModule::notInUse(), p, pm, VisCuTkModule::rechit_size, rechitdraw, separated, VisCuTkModule::simhit_size, simhitdraw, startintegrate, stopintegrate, tracker, x, ximg, y, and yimg.
00161 { 00162 cout << "Starting paint" << endl; 00163 QPainter *p = new QPainter( this ); 00164 drawpalette(p); 00165 if(stopintegrate){if(!separated){delete image;delete pm;}stopintegrate=false;} 00166 if(startintegrate){ 00167 if(!separated){ 00168 image = new QImage(ximg,yimg,8,256); 00169 pm = new QPixmap(ximg,yimg); 00170 for ( int i=1; i<256; i++ )image->setColor( i, qRgb(255,i,0) ); 00171 image->setColor( 0, qRgb(255,255,255) ); 00172 for ( int y=0; y<yimg; y++ ) { // set image pixels 00173 uchar *p = image->scanLine(y); 00174 for ( int x=0; x<ximg; x++ ) 00175 *p++ = 0; 00176 } 00177 } 00178 startintegrate=false; 00179 } 00180 p->setPen(black); 00181 ASSERT (tracker); 00182 for(unsigned int i=0; i<tracker->components(); i++){ 00183 VisCuTkSubDetector* subDetector = tracker->getComponent(i+1); 00184 for(unsigned int j=0; j<subDetector->components(); j++ ){ 00185 VisCuTkPartDetector* partDetector = subDetector->getComponent(j+1); 00186 for(unsigned int k=0; k<partDetector->components(); k++ ){ 00187 nlay=VisCuTracker::nlayer(i+1,j+1,k+1); 00188 defwindow(nlay); 00189 VisCuTkLayer* layer = partDetector->getComponent(k+1); 00190 for(unsigned int l=0; l<layer->components(); l++ ){ 00191 VisCuTkSubLayer* sublayer = layer->getComponent(l+1); 00192 for(unsigned int m=0; m<sublayer->components(); m++ ){ 00193 VisCuTkModule* module = sublayer->getComponent(m+1); 00194 if (module->isVisible()&&!module->notInUse()){ 00195 if(!(!separated && acc)) drawmodule(module,nlay,p); 00196 if(drawsimhits&&module->simhit_size>0)simhitdraw->drawsimhit(module,nlay,p); 00197 if(drawdigis &&module->digi_size>0)digidraw->drawdigi(module,nlay,p); 00198 if(drawclusters&&module->cluster_size>0)clusterdraw->drawcluster(module,nlay,p); 00199 if(drawrechits&&module->rechit_size>0)rechitdraw->drawrechit(module,nlay,p); 00200 } 00201 } 00202 } 00203 } 00204 } 00205 } 00206 if(acc && !separated){ 00207 //pm = new QPixmap(ximg,yimg); 00208 *pm = *image; 00209 bitBlt(this,0,0,pm); 00210 } 00211 }
Definition at line 335 of file VisCuTkMap2D.cc.
References a, VisCuTkCompositeDetector< T >::components(), computemodule(), GenMuonPlsPt100GeV_cfg::cout, defwindow(), deltax, deltay, drawall, lat::endl(), VisCuTkCompositeDetector< T >::getComponent(), getLayer(), VisCuTkModule::getName(), gp, i, VisCuTkModule::isVisible(), j, k, edm::es::l(), m, nlay, VisCuTracker::nlayer(), VisCuTkModule::notInUse(), VisCuTkMapWindow::selectedModuleInfo, and tracker.
00335 { 00336 if(!drawall && (dx!=0 || dy!=0)) 00337 { 00338 deltax=deltax+dx; deltay=deltay+dy; 00339 repaint(); 00340 } else { 00341 if(dx==0 && dy==0) { 00342 for(unsigned int i=0; i<tracker->components(); i++){ 00343 VisCuTkSubDetector* subDetector = tracker->getComponent(i+1); 00344 for(unsigned int j=0; j<subDetector->components(); j++ ){ 00345 VisCuTkPartDetector* partDetector = subDetector->getComponent(j+1); 00346 for(unsigned int k=0; k<partDetector->components(); k++ ){ 00347 nlay=VisCuTracker::nlayer(i+1,j+1,k+1); 00348 if(!drawall || (drawall && nlay==getLayer(p.x(),p.y()))){ 00349 defwindow(nlay); 00350 VisCuTkLayer* layer = partDetector->getComponent(k+1); 00351 for(unsigned int l=0; l<layer->components(); l++ ){ 00352 VisCuTkSubLayer* sublayer = layer->getComponent(l+1); 00353 for(unsigned int m=0; m<sublayer->components(); m++ ){ 00354 VisCuTkModule* module = sublayer->getComponent(m+1); 00355 if (module->isVisible()&&!module->notInUse()){ 00356 QPointArray a = QPointArray(4); 00357 computemodule(module,nlay,a); 00358 QRegion q(a,false); 00359 if(q.contains(p)){ 00360 cout << module->getName() << endl; 00361 gp->selectedModuleInfo->setText(module->getName()); 00362 break; 00363 } 00364 } 00365 } 00366 } 00367 } 00368 } 00369 } 00370 } 00371 00372 } 00373 } 00374 }
static double VisCuTkMap2D::phival | ( | double | x, | |
double | y | |||
) | [inline, static] |
Definition at line 53 of file VisCuTkMap2D.h.
References phi.
Referenced by computemodule(), VisCuTrackerCluster::drawcluster(), VisCuTrackerDigi::drawdigi(), drawmodule(), VisCuTkLayerSelection::drawmodule(), VisCuTrackerRecHit::drawrechit(), and VisCuTrackerSimHit::drawsimhit().
00053 { 00054 double phi; 00055 double phi1=atan(y/x); 00056 phi = phi1; 00057 if(y<0. && x>0) phi = phi1+2.*M_PI; 00058 if(x<0.)phi=phi1+M_PI; 00059 if(fabs(y)<0.000001 && x>0)phi=0; 00060 if(fabs(y)<0.000001&&x<0)phi=M_PI; 00061 if(fabs(x)<0.000001&&y>0)phi=M_PI/2.; 00062 if(fabs(x)<0.000001&&y<0)phi=3.*M_PI/2.; 00063 return phi; 00064 }
Definition at line 118 of file VisCuTkMap2D.cc.
References VisCuTkModule::cluster_size, clusterdraw, VisCuTkCompositeDetector< T >::components(), GenMuonPlsPt100GeV_cfg::cout, defwindow(), VisCuTkModule::digi_size, digidraw, VisCuTrackerCluster::drawcluster(), drawclusters, VisCuTrackerDigi::drawdigi(), drawdigis, drawmodule(), drawpalette(), VisCuTrackerRecHit::drawrechit(), drawrechits, VisCuTrackerSimHit::drawsimhit(), drawsimhits, lat::endl(), VisCuTkCompositeDetector< T >::getComponent(), i, j, k, edm::es::l(), m, nlay, VisCuTracker::nlayer(), VisCuTkModule::notInUse(), p, printer, printing, VisCuTkModule::rechit_size, rechitdraw, VisCuTkModule::simhit_size, simhitdraw, and tracker.
00118 { 00119 if ( printer->setup(this) ) { 00120 std::cout << "Printing..."<<endl; 00121 printing=true; 00122 QPainter *p = new QPainter( this ); 00123 p->end(); // send job to printer 00124 if( !p->begin( printer ) ) // paint on printer 00125 return; 00126 drawpalette(p); 00127 p->setPen(black); 00128 for(unsigned int i=0; i<tracker->components(); i++){ 00129 VisCuTkSubDetector* subDetector = tracker->getComponent(i+1); 00130 for(unsigned int j=0; j<subDetector->components(); j++ ){ 00131 VisCuTkPartDetector* partDetector = subDetector->getComponent(j+1); 00132 for(unsigned int k=0; k<partDetector->components(); k++ ){ 00133 nlay=VisCuTracker::nlayer(i+1,j+1,k+1); 00134 defwindow(nlay); 00135 VisCuTkLayer* layer = partDetector->getComponent(k+1); 00136 for(unsigned int l=0; l<layer->components(); l++ ){ 00137 VisCuTkSubLayer* sublayer = layer->getComponent(l+1); 00138 for(unsigned int m=0; m<sublayer->components(); m++ ){ 00139 VisCuTkModule* module = sublayer->getComponent(m+1); 00140 if (!module->notInUse()){ 00141 drawmodule(module,nlay,p); 00142 if(drawsimhits&&module->simhit_size>0)simhitdraw->drawsimhit(module,nlay,p); 00143 if(drawdigis&&module->digi_size>0)digidraw->drawdigi(module,nlay,p); 00144 if(drawclusters&&module->cluster_size>0)clusterdraw->drawcluster(module,nlay,p); 00145 if(drawrechits&&module->rechit_size>0)rechitdraw->drawrechit(module,nlay,p); 00146 } 00147 } 00148 } 00149 } 00150 } 00151 } 00152 p->end(); // send job to printer 00153 cout << "Printing completed"<<endl; 00154 printing=false; 00155 } else { 00156 cout << "Printing aborted"<<endl; 00157 } 00158 }
void VisCuTkMap2D::reset_val | ( | ) | [private] |
Definition at line 697 of file VisCuTkMap2D.cc.
References begin, VisCuTkModule::bufvalue, mod(), VisCuTkModuleMap::moduleMap, and VisCuTkModule::value.
Referenced by drawCluster(), drawDigi(), drawRechit(), drawSimHits(), integratedSignal(), and setEvent().
00697 { 00698 map<const GeomDetUnit * , VisCuTkModule *>::iterator imod; 00699 for (imod=VisCuTkModuleMap::moduleMap.begin();imod != VisCuTkModuleMap::moduleMap.end(); imod++){ 00700 VisCuTkModule* mod = imod->second; 00701 mod->value = 0; 00702 mod->bufvalue = 0; 00703 } 00704 }
void VisCuTkMap2D::separateModules | ( | ) |
Definition at line 298 of file VisCuTkMap2D.cc.
References acc, separated, and startintegrate.
00298 { 00299 if(separated)separated=false;else separated=true; 00300 if(acc) startintegrate=true; 00301 repaint(); 00302 }
void VisCuTkMap2D::setEvent | ( | const edm::Event & | iEvent, | |
const edm::EventSetup & | eventSetup | |||
) |
Definition at line 105 of file VisCuTkMap2D.cc.
References acc, firsteventloaded, nev, nevToIntegrate, reset_val(), separated, and switch_val().
00106 { 00107 firsteventloaded =true; 00108 nev++; 00109 if(!acc)reset_val(); 00110 if(acc && separated && (nev%nevToIntegrate)==0)switch_val(); 00111 }
void VisCuTkMap2D::setParent | ( | VisCuTkMapWindow * | pw | ) |
void VisCuTkMap2D::setTracker | ( | VisCuCmsTracker * | tr | ) | [inline] |
QSizePolicy VisCuTkMap2D::sizePolicy | ( | ) | const [private] |
void VisCuTkMap2D::switch_val | ( | ) | [private] |
Definition at line 705 of file VisCuTkMap2D.cc.
References begin, VisCuTkModule::bufvalue, mod(), VisCuTkModuleMap::moduleMap, and VisCuTkModule::value.
Referenced by setEvent().
00705 { 00706 map<const GeomDetUnit * , VisCuTkModule *>::iterator imod; 00707 for (imod=VisCuTkModuleMap::moduleMap.begin();imod != VisCuTkModuleMap::moduleMap.end(); imod++){ 00708 VisCuTkModule* mod = imod->second; 00709 mod->value = mod->bufvalue; 00710 mod->bufvalue = 0; 00711 } 00712 }
int VisCuTkMap2D::xpixel | ( | double | x | ) |
Definition at line 427 of file VisCuTkMap2D.cc.
References drawall, int, ix, printing, res, width, xmax, xmin, and xsize.
Referenced by computemodule(), and drawmodule().
00427 { 00428 int res; 00429 if(drawall) {res= (int)((x-xmin)/(xmax-xmin)*xsize)+ix; 00430 if(printing)res=res*3;return res;} 00431 else{ 00432 res= (int)((x-xmin)/(xmax-xmin)*width()); 00433 if(printing)res=res*7;return res; 00434 } 00435 }
int VisCuTkMap2D::ypixel | ( | double | y | ) |
Definition at line 436 of file VisCuTkMap2D.cc.
References drawall, int, iy, nlay, printing, res, tracker, VisCuCmsTracker::type, yimg, ymax, ymin, ysize, and zoom.
Referenced by computemodule(), and drawmodule().
00436 { 00437 int res; 00438 double y1; 00439 y1 = (y-ymin)/(ymax-ymin); 00440 if(drawall){if(nlay>30) res= 2*ysize - (int)(y1*2*ysize)+iy; 00441 else res= ysize - (int)(y1*ysize)+iy; 00442 if(printing)res=res*2;} 00443 //else {res= height() - (int)(y1*height()); 00444 else {res= height() - (int)(y1*yimg); 00445 if(printing)res=res*7;} 00446 if (tracker->type==2){ 00447 if(!drawall){ 00448 if(nlay==34)res=res+(int)(50/zoom); 00449 if(nlay==35)res=res-(int)(50/zoom); 00450 if(nlay==38)res=res-(int)(150/zoom); 00451 if(nlay==39)res=res -(int)(200/zoom); 00452 } 00453 } 00454 return res; 00455 }
Definition at line 278 of file VisCuTkMap2D.cc.
References acc, deltax, deltay, startintegrate, zoom, and zoom_in_out.
00279 { 00280 zoom = zoom*0.5; 00281 if(deltax!=0)deltax=deltax*2; 00282 if(deltay!=0)deltay=deltay*2; 00283 zoom_in_out = true; 00284 if(acc)startintegrate=true; 00285 repaint(); 00286 }
Definition at line 288 of file VisCuTkMap2D.cc.
References acc, deltax, deltay, int, startintegrate, zoom, and zoom_in_out.
00289 { 00290 zoom = zoom*2; 00291 if(deltax!=0)deltax=(int)(deltax*0.5); 00292 if(deltay!=0)deltay=(int)(deltay*0.5); 00293 zoom_in_out = true; 00294 if(acc)startintegrate=true; 00295 repaint(); 00296 }
Definition at line 69 of file VisCuTkMap2D.h.
Referenced by drawAllTracker(), drawCluster(), drawDigi(), drawRechit(), drawSimHits(), integratedSignal(), paintEvent(), separateModules(), setEvent(), VisCuTkMap2D(), zoomIn(), and zoomOut().
std::vector<SiStripCluster> VisCuTkMap2D::cdigi [private] |
Definition at line 88 of file VisCuTkMap2D.h.
VisCuTrackerCluster* VisCuTkMap2D::clusterdraw [private] |
Definition at line 96 of file VisCuTkMap2D.h.
Referenced by paintEvent(), print(), and VisCuTkMap2D().
int VisCuTkMap2D::deltax [private] |
Definition at line 100 of file VisCuTkMap2D.h.
Referenced by defwindow(), drawAllTracker(), pan(), VisCuTkMap2D(), zoomIn(), and zoomOut().
int VisCuTkMap2D::deltay [private] |
Definition at line 100 of file VisCuTkMap2D.h.
Referenced by defwindow(), drawAllTracker(), pan(), VisCuTkMap2D(), zoomIn(), and zoomOut().
VisCuTrackerDigi* VisCuTkMap2D::digidraw [private] |
Definition at line 95 of file VisCuTkMap2D.h.
Referenced by paintEvent(), print(), and VisCuTkMap2D().
bool VisCuTkMap2D::drawall [private] |
Definition at line 110 of file VisCuTkMap2D.h.
Referenced by defwindow(), drawAllTracker(), pan(), VisCuTkMap2D(), xpixel(), and ypixel().
bool VisCuTkMap2D::drawclusters [private] |
Definition at line 111 of file VisCuTkMap2D.h.
Referenced by drawCluster(), drawmodule(), drawpalette(), paintEvent(), print(), and VisCuTkMap2D().
bool VisCuTkMap2D::drawdigis [private] |
Definition at line 111 of file VisCuTkMap2D.h.
Referenced by drawDigi(), drawmodule(), drawpalette(), paintEvent(), print(), and VisCuTkMap2D().
bool VisCuTkMap2D::drawrechits [private] |
Definition at line 111 of file VisCuTkMap2D.h.
Referenced by drawmodule(), drawpalette(), drawRechit(), paintEvent(), print(), and VisCuTkMap2D().
bool VisCuTkMap2D::drawsimhits [private] |
Definition at line 111 of file VisCuTkMap2D.h.
Referenced by drawmodule(), drawpalette(), drawSimHits(), paintEvent(), print(), and VisCuTkMap2D().
bool VisCuTkMap2D::firsteventloaded [private] |
bool VisCuTkMap2D::horizontal_view [private] |
Definition at line 110 of file VisCuTkMap2D.h.
Referenced by computemodule(), defwindow(), drawAllTracker(), drawmodule(), and VisCuTkMap2D().
QImage* VisCuTkMap2D::image |
int VisCuTkMap2D::ix [private] |
Definition at line 101 of file VisCuTkMap2D.h.
Referenced by defwindow(), drawAllTracker(), VisCuTkMap2D(), and xpixel().
int VisCuTkMap2D::iy [private] |
Definition at line 101 of file VisCuTkMap2D.h.
Referenced by defwindow(), drawAllTracker(), VisCuTkMap2D(), and ypixel().
int VisCuTkMap2D::nev [private] |
int VisCuTkMap2D::nevToIntegrate [private] |
int VisCuTkMap2D::nlay [private] |
Definition at line 116 of file VisCuTkMap2D.h.
Referenced by paintEvent(), pan(), print(), and ypixel().
QPixmap* VisCuTkMap2D::pm |
QPrinter* VisCuTkMap2D::printer [private] |
bool VisCuTkMap2D::printing [private] |
Definition at line 112 of file VisCuTkMap2D.h.
Referenced by print(), VisCuTkMap2D(), xpixel(), and ypixel().
std::vector<LocalPoint> VisCuTkMap2D::rdigi [private] |
Definition at line 89 of file VisCuTkMap2D.h.
VisCuTrackerRecHit* VisCuTkMap2D::rechitdraw [private] |
Definition at line 97 of file VisCuTkMap2D.h.
Referenced by paintEvent(), print(), and VisCuTkMap2D().
std::vector<SiStripDigi> VisCuTkMap2D::sdigi [private] |
Definition at line 87 of file VisCuTkMap2D.h.
Definition at line 68 of file VisCuTkMap2D.h.
Referenced by computemodule(), defwindow(), drawAllTracker(), drawmodule(), drawpalette(), paintEvent(), separateModules(), setEvent(), and VisCuTkMap2D().
VisCuTrackerSimHit* VisCuTkMap2D::simhitdraw [private] |
Definition at line 94 of file VisCuTkMap2D.h.
Referenced by paintEvent(), print(), and VisCuTkMap2D().
bool VisCuTkMap2D::startintegrate [private] |
Definition at line 115 of file VisCuTkMap2D.h.
Referenced by drawAllTracker(), integratedSignal(), paintEvent(), separateModules(), VisCuTkMap2D(), zoomIn(), and zoomOut().
bool VisCuTkMap2D::stopintegrate [private] |
Definition at line 115 of file VisCuTkMap2D.h.
Referenced by integratedSignal(), paintEvent(), and VisCuTkMap2D().
std::vector<PSimHit> VisCuTkMap2D::theTrackerHits [private] |
Definition at line 117 of file VisCuTkMap2D.h.
VisCuCmsTracker* VisCuTkMap2D::tracker [private] |
Definition at line 93 of file VisCuTkMap2D.h.
Referenced by paintEvent(), pan(), print(), setTracker(), and ypixel().
Definition at line 72 of file VisCuTkMap2D.h.
Referenced by computemodule(), drawAllTracker(), drawmodule(), and VisCuTkMap2D().
Definition at line 72 of file VisCuTkMap2D.h.
Referenced by defwindow(), drawAllTracker(), paintEvent(), and VisCuTkMap2D().
double VisCuTkMap2D::xmax [private] |
Definition at line 99 of file VisCuTkMap2D.h.
Referenced by defwindow(), VisCuTkMap2D(), and xpixel().
double VisCuTkMap2D::xmin [private] |
Definition at line 99 of file VisCuTkMap2D.h.
Referenced by defwindow(), VisCuTkMap2D(), and xpixel().
int VisCuTkMap2D::xsize [private] |
Definition at line 101 of file VisCuTkMap2D.h.
Referenced by defwindow(), drawAllTracker(), getLayer(), VisCuTkMap2D(), and xpixel().
Definition at line 72 of file VisCuTkMap2D.h.
Referenced by defwindow(), drawAllTracker(), paintEvent(), VisCuTkMap2D(), and ypixel().
double VisCuTkMap2D::ymax [private] |
Definition at line 99 of file VisCuTkMap2D.h.
Referenced by defwindow(), VisCuTkMap2D(), and ypixel().
double VisCuTkMap2D::ymin [private] |
Definition at line 99 of file VisCuTkMap2D.h.
Referenced by defwindow(), VisCuTkMap2D(), and ypixel().
int VisCuTkMap2D::ysize [private] |
Definition at line 101 of file VisCuTkMap2D.h.
Referenced by defwindow(), drawAllTracker(), getLayer(), VisCuTkMap2D(), and ypixel().
double VisCuTkMap2D::zoom [private] |
Definition at line 99 of file VisCuTkMap2D.h.
Referenced by defwindow(), drawAllTracker(), VisCuTkMap2D(), ypixel(), zoomIn(), and zoomOut().
bool VisCuTkMap2D::zoom_in_out [private] |
Definition at line 114 of file VisCuTkMap2D.h.
Referenced by defwindow(), drawAllTracker(), VisCuTkMap2D(), zoomIn(), and zoomOut().