CMS 3D CMS Logo

Public Member Functions | Private Attributes

SiPixelTrackerMap Class Reference

#include <SiPixelTrackerMap.h>

Inheritance diagram for SiPixelTrackerMap:
TrackerMap

List of all members.

Public Member Functions

void drawModule (TmModule *mod, int key, int nlay, bool print_total)
void print (bool print_total=true, std::string TKType="Averages", float minval=0., float maxval=0.)
 SiPixelTrackerMap (std::string s=" ", int xsize1=340, int ysize1=200)
 ~SiPixelTrackerMap (void)

Private Attributes

int dummy
std::string title

Detailed Description

Definition at line 24 of file SiPixelTrackerMap.h.


Constructor & Destructor Documentation

SiPixelTrackerMap::SiPixelTrackerMap ( std::string  s = " ",
int  xsize1 = 340,
int  ysize1 = 200 
)

Definition at line 34 of file SiPixelTrackerMap.cc.

References asciidump::s, and title.

                                                                    : TrackerMap(s,xsize1,ysize1) 
{
// cout << ACBlue << ACBold
//      << "[SiPixelTrackerMap::SiPixelTrackerMap()]" 
//      << endl ;
  title = s ;
 // cout<<"created a new Tracker Map! the title is: "<<s<<endl;
}
SiPixelTrackerMap::~SiPixelTrackerMap ( void  ) [inline]

Definition at line 31 of file SiPixelTrackerMap.h.

{;} 

Member Function Documentation

void SiPixelTrackerMap::drawModule ( TmModule mod,
int  key,
int  nlay,
bool  print_total 
)

Definition at line 44 of file SiPixelTrackerMap.cc.

References funct::cos(), funct::false, TmModule::idex, TmModule::idModule, TrackerMap::isRingStereo(), j, gen::k, TmModule::length, M_PI, TmModule::name, runTheMatrix::np, phi, TrackerMap::phival(), TrackerMap::posrel, TmModule::posx, TmModule::posy, TmModule::posz, csvReporter::r, TmModule::ring, funct::sin(), mathSSE::sqrt(), TrackerMap::svgfile, TmModule::text, TmModule::width, TmModule::widthAtHalfLength, TrackerMap::xdpixel(), and TrackerMap::ydpixel().

{
  //int x,y;
  double phi,r,dx,dy, dy1;
  double xp[4],yp[4],xp1,yp1;
  double vhbot,vhtop,vhapo;
  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};
  double xt1,yt1,xs1=0.,ys1=0.,xt2,yt2,xs2,ys2,pv1,pv2;
//  int green = 0;
  double xd[4],yd[4];
  int np = 4;
  //int numrec=0;
  int numod=0;
  phi = phival(mod->posx,mod->posy);
  r = sqrt(mod->posx*mod->posx+mod->posy*mod->posy);
  vhbot = mod->width;
  vhtop=mod->width;
  vhapo=mod->length;
  if(nlay < 31){ //endcap
    vhbot = mod->widthAtHalfLength/2.-(mod->width/2.-mod->widthAtHalfLength/2.); 
    vhtop=mod->width/2.;
    vhapo=mod->length/2.;
    if(nlay >12 && nlay <19){
      if(posrel)r = r+r;
      xp[0]=r-vhtop;yp[0]=-vhapo;
      xp[1]=r+vhtop;yp[1]=-vhapo;
      xp[2]=r+vhtop;yp[2]=vhapo;
      xp[3]=r-vhtop;yp[3]=vhapo;
    }else{
      if(posrel)r = r + r/3.;
      xp[0]=r-vhapo;yp[0]=-vhbot;
      xp[1]=r+vhapo;yp[1]=-vhtop;
      xp[2]=r+vhapo;yp[2]=vhtop;
      xp[3]=r-vhapo;yp[3]=vhbot;
    }
    for(int j=0;j<4;j++){
      xp1 = xp[j]*cos(phi)-yp[j]*sin(phi);
      yp1 = xp[j]*sin(phi)+yp[j]*cos(phi);
      xp[j] = xp1;yp[j]=yp1;
    }
  } else { //barrel
    numod=mod->idModule;if(numod>100)numod=numod-100;
    int vane = mod->ring;
    if(posrel){
      dx = vhapo;
      phi=M_PI;
      xt1=rmedio[nlay-31]; yt1=-vhtop/2.;
      xs1 = xt1*cos(phi)-yt1*sin(phi);
      ys1 = xt1*sin(phi)+yt1*cos(phi);
      xt2=rmedio[nlay-31]; yt2=vhtop/2.;
      xs2 = xt2*cos(phi)-yt2*sin(phi);
      ys2 = xt2*sin(phi)+yt2*cos(phi);
      dy=phival(xs2,ys2)-phival(xs1,ys1);
         dy1 = dy;
      if(nlay==31)dy1=0.39;
      if(nlay==32)dy1=0.23;
      if(nlay==33)dy1=0.16;
      xp[0]=vane*(dx+dx/8.);yp[0]=numod*(dy1);
      xp[1]=vane*(dx+dx/8.)+dx;yp[1]=numod*(dy1);
      xp[2]=vane*(dx+dx/8.)+dx;yp[2]=numod*(dy1)+dy;
      xp[3]=vane*(dx+dx/8.);yp[3]=numod*(dy1)+dy;
    }else{
      xt1=r; yt1=-vhtop/2.;
      xs1 = xt1*cos(phi)-yt1*sin(phi);
      ys1 = xt1*sin(phi)+yt1*cos(phi);
      xt2=r; yt2=vhtop/2.;
      xs2 = xt2*cos(phi)-yt2*sin(phi);
      ys2 = xt2*sin(phi)+yt2*cos(phi);
      pv1=phival(xs1,ys1);
      pv2=phival(xs2,ys2);
      if(fabs(pv1-pv2)>M_PI && numod==1)pv1=pv1-2.*M_PI;
      if(fabs(pv1-pv2)>M_PI && numod!=1)pv2=pv2+2.*M_PI;
      xp[0]=mod->posz-vhapo/2.;yp[0]=4.2*pv1;
      xp[1]=mod->posz+vhapo/2.;yp[1]=4.2*pv1;
      xp[2]=mod->posz+vhapo/2. ;yp[2]=4.2*pv2;
          xp[3]=mod->posz-vhapo/2.;yp[3]=4.2*pv2;
    }
  }
  if(isRingStereo(key))
        {
          np = 3;
          if(mod->idModule>100 ){for(int j=0;j<3;j++){
              xd[j]=xdpixel(xp[j]);yd[j]=ydpixel(yp[j]);
            }
          }else {
            xd[0]=xdpixel(xp[2]);yd[0]=ydpixel(yp[2]);
            xd[1]=xdpixel(xp[3]);yd[1]=ydpixel(yp[3]);
            xd[2]=xdpixel(xp[0]);yd[2]=ydpixel(yp[0]);
          }
        } else {
    for(int j=0;j<4;j++){
      xd[j]=xdpixel(xp[j]);yd[j]=ydpixel(yp[j]);
    }
  }
  char buffer [20];
  sprintf(buffer,"%X",mod->idex);

//cout<<"drawModule: xp= "<<xp<<" , yp= "<<yp<<endl;
  bool FPIX_M_1 = false ;
  bool FPIX_M_2 = false ;
  bool FPIX_P_1 = false ;
  bool FPIX_P_2 = false ;
  bool BPIX_L_1 = false ;
  bool BPIX_L_2 = false ;
  bool BPIX_L_3 = false ;
  string moduleName = mod->name;
  if(moduleName.find("PixelEndcap")!=string::npos || moduleName.find("PixelBarrel")!=string::npos) {
    FPIX_M_1 = false ;
    FPIX_M_2 = false ;
    FPIX_P_1 = false ;
    FPIX_P_2 = false ;
    BPIX_L_1 = false ;
    BPIX_L_2 = false ;
    BPIX_L_3 = false ;
    if( moduleName.find("PixelEndcap 3")!=string::npos ) {FPIX_M_1 = true;}
    if( moduleName.find("PixelEndcap 4")!=string::npos ) {FPIX_M_2 = true;}
    if( moduleName.find("PixelEndcap 1")!=string::npos ) {FPIX_P_1 = true;}
    if( moduleName.find("PixelEndcap 2")!=string::npos ) {FPIX_P_2 = true;}
    if( moduleName.find("PixelBarrel 1")!=string::npos ) {BPIX_L_1 = true;}
    if( moduleName.find("PixelBarrel 2")!=string::npos ) {BPIX_L_2 = true;}
    if( moduleName.find("PixelBarrel 3")!=string::npos ) {BPIX_L_3 = true;}
   //}
   *svgfile << "      <svg:polygon detid=\"" 
            << mod->idex
            << "\" id=\""
            << mod->idex
            << "\" onclick=\"SvgMap.showData(evt);\" onmouseover=\"SvgMap.showData(evt);\" onmouseout=\"SvgMap.showData(evt);\" entries=\""
            << mod->text
            << "\" POS=\""
            << mod->name
            << " Id "
            << mod->idex
            << " \" fill=\"rgb("
            << 146
            << ","
            << 0
            << ","
            << 255
            << ")\" points=\"";
   for(int k=0;k<np;k++)
   {
    if( FPIX_M_1 )
    {
     xd[k] = xd[k] * 1.8 -   60 ;
     yd[k] = yd[k] * 2.0 -   30 ;
    }
    if( FPIX_M_2 )
    {
     xd[k] = xd[k] * 1.8 -   60 ;
     yd[k] = yd[k] * 2.0 -   60 ;
    }
    if( FPIX_P_1 )
    {
     xd[k] = xd[k] * 1.8 - 1020 ;
     yd[k] = yd[k] * 2.0 -   30 ;
    }
    if( FPIX_P_2 )
    {
     xd[k] = xd[k] * 1.8 - 1020 ;
     yd[k] = yd[k] * 2.0 -   60 ;
    }
    if( BPIX_L_1 ) 
    { 
     xd[k] = xd[k] * 1.2 -  130 ;
    }
    if( BPIX_L_2 )
    {
     xd[k] = xd[k] * 1.2 -   30 ;
    }
    if( BPIX_L_3 )
    {
     xd[k] = xd[k] * 1.2 -  240 ;
     yd[k] = yd[k]       -    5 ;
    }
    *svgfile << xd[k] << "," << yd[k] << " " ;
   }
   *svgfile <<"\" />" <<endl;
   return ;
  }

}
void SiPixelTrackerMap::print ( bool  print_total = true,
std::string  TKType = "Averages",
float  minval = 0.,
float  maxval = 0. 
)

Member Data Documentation

int SiPixelTrackerMap::dummy [private]

Definition at line 44 of file SiPixelTrackerMap.h.

std::string SiPixelTrackerMap::title [private]

Reimplemented from TrackerMap.

Definition at line 45 of file SiPixelTrackerMap.h.

Referenced by SiPixelTrackerMap().