]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - PMD/AliPMDUtility.cxx
New version of the PMD geometry (Basanta)
[u/mrichter/AliRoot.git] / PMD / AliPMDUtility.cxx
index 86498729aa6bdd8d154adb12db0a85171ca69f3a..1f7425425f074872c30c00ba2e899b45bd29443a 100644 (file)
@@ -56,84 +56,6 @@ AliPMDUtility::~AliPMDUtility()
 {
   // Default destructor
 }
-void AliPMDUtility::HexGeomCellPos(Int_t ism, Int_t xpad, Int_t ypad, Float_t &xpos, Float_t &ypos)
-{
-  // This converts PMD cluster or CELL coordinates
-  // to Global coordinates.
-  // Written by Prof. S.C. Phatak
-
-  const Float_t  kCellDia = 0.5;
-  const Float_t  kPi      = TMath::Pi();    //3.14159;
-  const Double_t kSqroot3by2   = 0.8660254;  // sqrth = sqrt(3.)/2.
-
-  Int_t i;
-  Int_t j = xpad;
-  Int_t k = ypad;
-
-  /*
-    Supermodeule number starting from 0
-    ism --> supermodule no ( 0 - 26 )
-    idet --> detector ( pmd or cpv : not required now )
-    j --> xpad ( goes from 1 to 72 )
-    k --> ypad ( goes from 1 to 72 )
-    xp --> global x coordinate
-    yp --> global y coordinate
-    
-    (xp0,yp0) corner positions of all supermodules in global
-    coordinate system. That is the origin
-    of the local ( supermodule ) coordinate system.
-  */ 
-  
-  Float_t xp0[27] = 
-  {
-    -17.9084, 18.2166, 54.3416, -35.9709, 0.154144, 
-    36.2791, -54.0334, -17.9084, 18.2166, 36.7791, 
-    18.7166, 0.654194, 72.9041, 54.8416, 36.7792, 
-    109.029, 90.9666, 72.9042, -18.8708, -36.9334, 
-    -54.996, -36.9332, -54.9958, -73.0584, -54.9956, 
-    -73.0582, -91.1208
-  };
-
-  Float_t yp0[27] = 
-  {
-    -32.1395, -32.1395, -32.1395, -63.4247, -63.4247, 
-    -63.4247, -94.7098, -94.7098, -94.7098, 0.545689, 
-    31.8309, 63.1161, 0.545632, 31.8308, 63.116, 
-    0.545573, 31.8308, 63.116, 31.5737, 0.288616, 
-    -30.9965, 62.859, 31.5738, 0.288733, 94.1442, 
-    62.8591, 31.574
-  };
-
-  /* 
-     angles of rotation for three sets of supermodules
-     The angle is same for first nine, next nine and last nine 
-     supermodules 
-  */
-  
-  Float_t th[3] = {0., -2.*kPi/3., 2.*kPi/3.};
-  Float_t xr, yr, xinit, yinit, cs, sn;
-  
-  /* 
-     xinit and yinit are coordinates of the cell in local coordinate system
-  */
-  
-  xinit = (j)*kCellDia+(k)/2.*kCellDia;
-  yinit = kSqroot3by2*(k)/2.;
-  i=ism/9;
-  cs=cos(th[i]);
-  sn=sin(th[i]);
-  //
-  // rotate first
-  //
-  xr=cs*xinit+sn*yinit;
-  yr=-sn*xinit+cs*yinit;
-  //
-  // then translate
-  //
-  xpos=xr+xp0[ism];
-  ypos=yr+yp0[ism];
-
-}
 
 void AliPMDUtility::RectGeomCellPos(Int_t ism, Int_t ium, Int_t xpad, Int_t ypad, Float_t &xpos, Float_t &ypos)
 {
@@ -157,26 +79,38 @@ void AliPMDUtility::RectGeomCellPos(Int_t ism, Int_t ium, Int_t xpad, Int_t ypad
   Int_t icol  = ypad;
 
   // Corner positions (x,y) of the 24 unit moudles in ALICE PMD
+
+
+
+  double xcorner[24] =
+    {
+      74.8833,  53.0045, 31.1255,    //Type-A
+      74.8833,  53.0045, 31.1255,    //Type-A
+      -74.8833, -53.0044, -31.1255,  //Type-AR
+      -74.8833, -53.0044, -31.1255,  //Type-AR
+      8.9165, -33.7471,            //Type-B
+      8.9165, -33.7471,            //Type-B
+      8.9165, -33.7471,            //Type-B
+      -8.9165, 33.7471,            //Type-BR
+      -8.9165, 33.7471,            //Type-BR
+      -8.9165, 33.7471,            //Type-BR
+    };
+
   
-  Double_t xcorner[24] =
-  {
-    85.15,  60.85,  36.55,  85.15,  60.85,  36.55, //SMA 
-    -85.15, -60.85, -36.55, -85.15, -60.85, -36.55, //SMAR
-    84.90,  36.60,  84.90,  36.60,  84.90,  36.60, //SMB
-    -84.90, -36.60, -84.90, -36.60, -84.90, -36.60  //SMBR
-  };
-  
-  Double_t ycorner[24] =
-  { 
-    32.45708755,  32.45708755,  32.45708755,        //SMA
-    -9.30645245,  -9.30645245,  -9.30645245,        //SMA
-    -32.45708755, -32.45708755, -32.45708755,        //SMAR
-    9.30645245,   9.30645245,   9.30645245,        //SMAR
-    -31.63540818, -31.63540818, -52.61435544,        //SMB
-    -52.61435544, -73.59330270, -73.59330270,        //SMB
-    31.63540818,  31.63540818,  52.61435544,        //SMBR
-    52.61435544,  73.59330270,  73.59330270         //SMBR
-  };
+  double ycorner[24] =
+    {
+      86.225,  86.225,  86.225,      //Type-A
+      37.075,  37.075,  37.075,      //Type-A
+      -86.225, -86.225, -86.225,     //Type-AR
+      -37.075, -37.075, -37.075,     //Type-AR
+      86.225,  86.225,               //Type-B
+      61.075,  61.075,               //Type-B
+      35.925,  35.925,               //Type-B
+      -86.225, -86.225,              //Type-BR
+      -61.075, -61.075,              //Type-BR
+      -35.925, -35.925               //Type-BR
+    };
+
   
   const Float_t kSqroot3      = 1.73205;  // sqrt(3.);
   const Float_t kCellRadius   = 0.25;
@@ -185,31 +119,38 @@ void AliPMDUtility::RectGeomCellPos(Int_t ism, Int_t ium, Int_t xpad, Int_t ypad
   //Every even row of cells is shifted and placed
   //in geant so this condition
   //
+  Float_t cellRadius = 0.25;
   Float_t shift = 0.0;
   if(irow%2 == 0)
     {
-      shift = 0.25;
+      shift = -cellRadius/2.0;
     }
   else
     {
       shift = 0.0;
     }
-  if(ism == 0 || ism == 2)
-    {
-      ypos = ycorner[gbum] + 
-       irow*kCellRadius*kSqroot3;
 
-      xpos = xcorner[gbum] - 
-       icol*2.0*kCellRadius - shift;
+  if(ism == 0)
+    {
+      ypos = ycorner[gbum] - irow*kCellRadius*2.0 + shift;
+      xpos = xcorner[gbum] - icol*kSqroot3*kCellRadius;
     }
-  else if(ism == 1 || ism == 3)
+  else if(ism == 1)
     {
-      ypos = ycorner[gbum] -
-       irow*kCellRadius*kSqroot3;
-
-      xpos = xcorner[gbum] +
-       icol*2.0*kCellRadius + shift;
+      ypos = ycorner[gbum] + irow*kCellRadius*2.0 + shift;
+      xpos = xcorner[gbum] + icol*kSqroot3*kCellRadius;
+    }
+  else if(ism == 2)
+    {
+      ypos = ycorner[gbum] - irow*kCellRadius*2.0 + shift;
+      xpos = xcorner[gbum] - icol*kSqroot3*kCellRadius;
     }
+  else if(ism == 3)
+    {
+      ypos = ycorner[gbum] + irow*kCellRadius*2.0 + shift;
+      xpos = xcorner[gbum] + icol*kSqroot3*kCellRadius;
+    }
+
 }
 
 void AliPMDUtility::RectGeomCellPos(Int_t ism, Int_t ium, Float_t xpad, Float_t ypad, Float_t &xpos, Float_t &ypos)
@@ -236,27 +177,39 @@ void AliPMDUtility::RectGeomCellPos(Int_t ism, Int_t ium, Float_t xpad, Float_t
   Float_t icol  = ypad;
 
   // Corner positions (x,y) of the 24 unit moudles in ALICE PMD
+
+
+  double xcorner[24] =
+    {
+      74.8833,  53.0045, 31.1255,    //Type-A
+      74.8833,  53.0045, 31.1255,    //Type-A
+      -74.8833, -53.0044, -31.1255,  //Type-AR
+      -74.8833, -53.0044, -31.1255,  //Type-AR
+      8.9165, -33.7471,            //Type-B
+      8.9165, -33.7471,            //Type-B
+      8.9165, -33.7471,            //Type-B
+      -8.9165, 33.7471,            //Type-BR
+      -8.9165, 33.7471,            //Type-BR
+      -8.9165, 33.7471,            //Type-BR
+    };
+
   
-  Double_t xcorner[24] =
-  {
-    85.15,  60.85,  36.55,  85.15,  60.85,  36.55, //SMA 
-    -85.15, -60.85, -36.55, -85.15, -60.85, -36.55, //SMAR
-    84.90,  36.60,  84.90,  36.60,  84.90,  36.60, //SMB
-    -84.90, -36.60, -84.90, -36.60, -84.90, -36.60  //SMBR
-  };
-  
-  Double_t ycorner[24] =
-  { 
-    32.45708755,  32.45708755,  32.45708755,        //SMA
-    -9.30645245,  -9.30645245,  -9.30645245,        //SMA
-    -32.45708755, -32.45708755, -32.45708755,        //SMAR
-    9.30645245,   9.30645245,   9.30645245,        //SMAR
-    -31.63540818, -31.63540818, -52.61435544,        //SMB
-    -52.61435544, -73.59330270, -73.59330270,        //SMB
-    31.63540818,  31.63540818,  52.61435544,        //SMBR
-    52.61435544,  73.59330270,  73.59330270         //SMBR
-  };
-  
+
+  double ycorner[24] =
+    {
+      86.225,  86.225,  86.225,      //Type-A
+      37.075,  37.075,  37.075,      //Type-A
+      -86.225, -86.225, -86.225,     //Type-AR
+      -37.075, -37.075, -37.075,     //Type-AR
+      86.225,  86.225,               //Type-B
+      61.075,  61.075,               //Type-B
+      35.925,  35.925,               //Type-B
+      -86.225, -86.225,              //Type-BR
+      -61.075, -61.075,              //Type-BR
+      -35.925, -35.925               //Type-BR
+    };
+
+
   const Float_t kSqroot3    = 1.73205;  // sqrt(3.);
   const Float_t kCellRadius = 0.25;
   
@@ -264,32 +217,42 @@ void AliPMDUtility::RectGeomCellPos(Int_t ism, Int_t ium, Float_t xpad, Float_t
   //Every even row of cells is shifted and placed
   //in geant so this condition
   //
+  Float_t cellRadius = 0.25;
   Float_t shift = 0.0;
   Int_t iirow = (Int_t) (irow+0.5);
   if(iirow%2 == 0)
     {
-      shift = 0.25;
+      shift = -cellRadius/2.0;
     }
   else
     {
       shift = 0.0;
     }
-  if(ism == 0 || ism == 2)
-    {
-      ypos = ycorner[gbum] + 
-       irow*kCellRadius*kSqroot3;
 
-      xpos = xcorner[gbum] - 
-       icol*2.0*kCellRadius - shift;
+
+  if(ism == 0)
+    {
+      ypos = ycorner[gbum] - irow*kCellRadius*2.0 + shift;
+      xpos = xcorner[gbum] - icol*kSqroot3*kCellRadius;
     }
-  else if(ism == 1 || ism == 3)
+  else if(ism == 1)
     {
-      ypos = ycorner[gbum] -
-       irow*kCellRadius*kSqroot3;
-
-      xpos = xcorner[gbum] +
-       icol*2.0*kCellRadius + shift;
+      ypos = ycorner[gbum] + irow*kCellRadius*2.0 + shift;
+      xpos = xcorner[gbum] + icol*kSqroot3*kCellRadius;
+    }
+  else if(ism == 2)
+    {
+      ypos = ycorner[gbum] - irow*kCellRadius*2.0 + shift;
+      xpos = xcorner[gbum] - icol*kSqroot3*kCellRadius;
+    }
+  else if(ism == 3)
+    {
+      ypos = ycorner[gbum] + irow*kCellRadius*2.0 + shift;
+      xpos = xcorner[gbum] + icol*kSqroot3*kCellRadius;
     }
+
+
+
 }
 
 void AliPMDUtility::SetPxPyPz(Float_t px, Float_t py, Float_t pz)