]> git.uio.no Git - u/mrichter/AliRoot.git/commitdiff
Added getter methods for volume path (for Event Display)
authordecaro <decaro@f7af4fe6-9843-0410-8265-dc069ae4e863>
Mon, 19 Feb 2007 18:55:26 +0000 (18:55 +0000)
committerdecaro <decaro@f7af4fe6-9843-0410-8265-dc069ae4e863>
Mon, 19 Feb 2007 18:55:26 +0000 (18:55 +0000)
TOF/AliTOFGeometry.cxx
TOF/AliTOFGeometry.h
TOF/AliTOFGeometryV5.cxx
TOF/AliTOFGeometryV5.h

index c2819860473a687699256ee5f35a03fcfb91efaa..f176104bb82aaab75f1d5dcab1fcc02a267918ff 100644 (file)
 
 /*
 $Log$
+Revision 1.17.1  2006/12/15 
+         Added method DetToStripRF(...) to get
+         a pad corner coordinates in its strip reference frame
+         (A.De Caro, M.Di Stefano)
+Revision 1.17  2006/08/22 13:30:02  arcelli
+removal of effective c++ warnings (C.Zampolli)
+
 Revision 1.16  2006/04/20 22:30:50  hristov
 Coding conventions (Annalisa)
 
@@ -103,7 +110,8 @@ const Float_t AliTOFGeometry::fgkStripLength = 122.;// Strip Length (rho X phi d
 const Float_t AliTOFGeometry::fgkSigmaForTail1= 2.; //Sig1 for simulation of TDC tails 
 const Float_t AliTOFGeometry::fgkSigmaForTail2= 0.5;//Sig2 for simulation of TDC tails
 
-const Float_t AliTOFGeometry::fgkTdcBin = 24.4;     // time-window for the TDC bins [ps]
+const Float_t AliTOFGeometry::fgkTdcBin = 24.4;     // time-of-flight bin width [ps]
+const Float_t AliTOFGeometry::fgkToTBin = 48.8;     // time-over-threshold  bin width [ps]
 
 //_____________________________________________________________________________
 AliTOFGeometry::AliTOFGeometry():
@@ -222,3 +230,28 @@ void AliTOFGeometry::GetDetID( Float_t *pos, Int_t *det) const
   
 }
 //_____________________________________________________________________________
+
+void AliTOFGeometry::DetToStripRF(Int_t nPadX, Int_t nPadZ, Float_t &x,  Float_t &z) const
+{
+  //
+  // Returns the local coordinates (x, z) in strip reference frame
+  // for the bottom corner of the pad number (nPadX, nPadZ)
+  //
+  /*
+  const Float_t xCenterStrip = kNpadX * fgkXPad / 2.;
+  const Float_t zCenterStrip = kNpadZ * fgkZPad / 2.;
+
+  const Float_t xCenterPad = nPadX*fgkXPad + fgkXPad / 2.;
+  const Float_t zCenterPad = nPadZ*fgkZPad + fgkZPad / 2.;
+
+  x = xCenterPad - xCenterStrip;
+  z = zCenterPad - zCenterStrip;
+  */
+
+
+  x = (nPadX - kNpadX*0.5) * fgkXPad;
+  z = (nPadZ - kNpadZ*0.5) * fgkZPad;
+
+
+}
+//_____________________________________________________________________________
index 852e1ea3e36ea5c1d9db8fda0486f0d833dd1646..0e7632ea11e6e8600dccd520e5d095f15294f3d6 100644 (file)
@@ -30,6 +30,8 @@ class AliTOFGeometry: public TObject{
   static  Int_t NpadXStrip()  { return kNpadX*kNpadZ;};
   static  Int_t NSectors()    { return kNSectors;};
   static  Int_t NPlates()     { return kNPlates;};
+  virtual Int_t NStripXSector() const { return (kNStripA + 2*kNStripB +
+                                               2*fNStripC);};
   virtual Int_t NPadXSector() const { return (kNStripA + 2*kNStripB +
                                        2*fNStripC)*kNpadX*kNpadZ;};
 
@@ -63,7 +65,7 @@ class AliTOFGeometry: public TObject{
   static  Double_t GetAlpha()  { return 2 * 3.14159265358979323846 / kNSectors; }; 
  
   static Float_t TdcBinWidth() {return fgkTdcBin;};
-
+  static Float_t ToTBinWidth() {return fgkToTBin;};
 
   virtual void    Init();
   virtual void    ImportGeometry() {};
@@ -74,6 +76,8 @@ class AliTOFGeometry: public TObject{
   virtual Bool_t  IsInsideThePad(Int_t */*det*/,TGeoHMatrix /*mat*/, Float_t */*pos*/) const {return kFALSE;};
   virtual Float_t DistanceToPad(Int_t */*det*/,TGeoHMatrix /*mat*/, Float_t */*pos*/, Float_t *dist3d=0) const {return dist3d[0];};
   virtual void    GetVolumePath(Int_t */*ind*/, Char_t */*path*/ ){};
+  virtual void    GetVolumePath(Int_t /*sector*/, Char_t */*path*/ ){};
+  virtual void    GetVolumePath(Int_t /*sector*/, Int_t /*plate*/, Int_t /*strip*/, Char_t */*path*/ ){};
   virtual void    GetPos(Int_t */*det*/,Float_t */*pos*/){};
   virtual void    GetPosPar(Int_t *det,Float_t *pos) const;
   virtual void    GetDetID(Float_t *pos,Int_t *det) const;
@@ -85,6 +89,9 @@ class AliTOFGeometry: public TObject{
   virtual Float_t GetX(Int_t */*det*/) const {return -500.;};
   virtual Float_t GetY(Int_t */*det*/) const {return -500.;};
   virtual Float_t GetZ(Int_t */*det*/) const {return -500.;};
+  virtual void    DetToStripRF(Int_t nPadX, Int_t nPadZ,
+                              Float_t &x,  Float_t &z) const;
+  virtual void    DetToSectorRF(Int_t /*vol*/[5], Double_t ** /*coord*/) { };
 
   Float_t GetAngles(Int_t iplate, Int_t istrip)  const {return fAngles[iplate][istrip];};
   Float_t GetHeights(Int_t iplate, Int_t istrip) const {return fHeights[iplate][istrip];};
@@ -144,7 +151,8 @@ class AliTOFGeometry: public TObject{
 
   Float_t fPhiSec; //sector Phi width (deg)
 
-  static const Float_t fgkTdcBin;   // time-window for the TDC bins [ps]
+  static const Float_t fgkTdcBin;   // time-of-flight bin width [ps]
+  static const Float_t fgkToTBin;   // time-over-threshold bin width [ps]
 
   ClassDef(AliTOFGeometry,4) // TOF Geometry base class
 };
index f1b2b180b5a205c1a350ff7c030d0b61f7e465db..1e62a114dcf6dea2f0bd21098a254677f9b9bd89 100644 (file)
 
 /*
 $Log$
+Revision 1.17.1  2006/12/15
+         Added methods:
+            DetToSectorRF(...) to get pad corners
+          coordinates in its sector reference frame;
+            GetVolumePath(Int_t sector, Char_t *path)
+          to get the volume path for a sector
+            GetVolumePath(Int_t sector, Int_t plate, Int_t strip, Char_t *path)
+          to get the volume path for a strip
+         (A.De Caro, M.Di Stefano)
+Revision 1.7  2006/07/12 16:03:59  arcelli
+updates to match the new numbering of the TOF/TRD mother volumes in FRAME (ALICE convention)
+
 Revision 1.6  2006/05/04 19:41:42  hristov
 Possibility for partial TOF geometry (S.Arcelli)
 
@@ -1280,7 +1292,7 @@ Float_t AliTOFGeometryV5::GetPadDx(Float_t *pos)
 Float_t AliTOFGeometryV5::GetPadDy(Float_t *pos)
 {
   //
-  // Returns the x coordinate in the Pad reference frame
+  // Returns the y coordinate in the Pad reference frame
   //
 
   Float_t ypad = -2.;
@@ -1381,7 +1393,7 @@ Float_t AliTOFGeometryV5::GetPadDy(Float_t *pos)
 Float_t AliTOFGeometryV5::GetPadDz(Float_t *pos)
 {
   //
-  // Returns the x coordinate in the Pad reference frame
+  // Returns the z coordinate in the Pad reference frame
   //
 
   Float_t zpad = -2.;
@@ -1596,6 +1608,57 @@ void AliTOFGeometryV5::GetVolumePath(Int_t *ind, Char_t *path ) {
   sprintf(string3,"FPCB_1/FSEN_1/FSEZ_%i/FPAD_%i",padz,padx);
   sprintf(path,"%s/%s/%s",string1,string2,string3); 
 
+}
+//_____________________________________________________________________________
+void AliTOFGeometryV5::GetVolumePath(Int_t sector, Char_t *path ){
+  //--------------------------------------------------------------------
+  // This function returns the colume path of a given sector 
+  //--------------------------------------------------------------------
+
+  Char_t string[100];
+
+  Int_t icopy = sector;
+  // Old 6h convention
+  // if(sector<13){
+  //    icopy=sector+5;}  
+  // else{ icopy=sector-13;}
+
+  sprintf(string,"/ALIC_1/B077_1/BSEGMO%i_1/BTOF%i_1",icopy,icopy);
+  sprintf(path,"%s",string);
+
+}
+//_____________________________________________________________________________
+void AliTOFGeometryV5::GetVolumePath(Int_t sector, Int_t plate, Int_t strip, Char_t *path ) {
+  //--------------------------------------------------------------------
+  // This function returns the colume path of a given strip 
+  //--------------------------------------------------------------------
+
+  Char_t string1[100];
+  Char_t string2[100];
+  Char_t string3[100];
+  
+  Int_t icopy = sector;
+  // Old 6h convention
+  // if(sector<13){
+  //    icopy=sector+5;}  
+  // else{ icopy=sector-13;}
+  sprintf(string1,"/ALIC_1/B077_1/BSEGMO%i_1/BTOF%i_1/FTOA_0/FLTA_0",icopy,icopy);
+  
+  if(plate==0) icopy=strip; 
+  if(plate==1) icopy=strip+NStripC(); 
+  if(plate==2) icopy=strip+NStripC()+NStripB(); 
+  if(plate==3) icopy=strip+NStripC()+NStripB()+NStripA(); 
+  if(plate==4) icopy=strip+NStripC()+2*NStripB()+NStripA(); 
+  icopy++;
+  sprintf(string2,"FSTR_%i",icopy);
+  if(fHoles && (sector==11 || sector==12)) {
+    if(plate<2)  sprintf(string2,"FTOB_0/FLTB_0/FSTR_%i",icopy);
+    if(plate>2)  sprintf(string2,"FTOC_0/FLTC_0/FSTR_%i",icopy);
+  }
+
+  sprintf(string3,"FPCB_1/FSEN_1");
+  sprintf(path,"%s/%s/%s",string1,string2,string3); 
+
 }
 //_____________________________________________________________________________
 void AliTOFGeometryV5::GetPos(Int_t *det, Float_t *pos) 
@@ -1619,3 +1682,68 @@ void AliTOFGeometryV5::GetPos(Int_t *det, Float_t *pos)
   pos[2]=tr[2];
 }
 //_____________________________________________________________________________
+
+void AliTOFGeometryV5::DetToSectorRF(Int_t vol[5], Double_t **coord)
+{
+  //
+  // Returns the local coordinates (x, y, z) in sector reference frame
+  // for the 4 corners of each sector pad (vol[1], vol[2], vol[3], vol[4])
+  //
+
+  if (!gGeoManager) printf("ERROR: no TGeo\n");
+
+  // ALICE -> TOF Sector
+  Char_t path1[100]="";
+  GetVolumePath(vol[0],path1);
+  gGeoManager->cd(path1);
+  TGeoHMatrix aliceToSector;
+  aliceToSector = *gGeoManager->GetCurrentMatrix();
+
+  // TOF Sector -> ALICE
+  //TGeoHMatrix sectorToALICE = aliceToSector.Inverse();
+
+  // ALICE -> TOF Pad
+  Char_t path2[100]="";
+  GetVolumePath(vol,path2);
+  gGeoManager->cd(path2);
+  TGeoHMatrix aliceToPad;
+  aliceToPad = *gGeoManager->GetCurrentMatrix();
+
+  // TOF Pad -> ALICE
+  TGeoHMatrix padToALICE = aliceToPad.Inverse();
+
+  // TOF Pad -> TOF Sector
+  TGeoHMatrix padToSector = padToALICE*aliceToSector;
+
+  // TOF Sector -> TOF Pad
+  //TGeoHMatrix sectorToPad = sectorToALICE*aliceToPad;
+
+  // coordinates of the pad bottom corner
+  Double_t **cornerPad = new Double_t*[4];
+  for (Int_t ii=0; ii<4; ii++) cornerPad[ii] = new Double_t[3];
+
+  cornerPad[0][0] = -fgkXPad/2.;
+  cornerPad[0][1] =  0.;
+  cornerPad[0][2] = -fgkZPad/2.;
+
+  cornerPad[1][0] =  fgkXPad/2.;
+  cornerPad[1][1] =  0.;
+  cornerPad[1][2] = -fgkZPad/2.;
+
+  cornerPad[2][0] =  fgkXPad/2.;
+  cornerPad[2][1] =  0.;
+  cornerPad[2][2] =  fgkZPad/2.;
+
+  cornerPad[3][0] = -fgkXPad/2.;
+  cornerPad[3][1] =  0.;
+  cornerPad[3][2] =  fgkZPad/2.;
+
+  for(Int_t aa=0; aa<4; aa++) for(Int_t bb=0; bb<3; bb++) coord[aa][bb]=0.;
+
+  for (Int_t jj=0; jj<4; jj++) padToSector.MasterToLocal(&cornerPad[jj][0], &coord[jj][0]);
+
+  delete cornerPad;
+
+  //sectorToPad.LocalToMaster(cornerPad, coord);
+
+}
index a76fbe9ff42511362761505809bfca73ccf546d2..e3bfc42eae3321450a65186eccec5982dcf8adc4 100644 (file)
@@ -25,6 +25,8 @@ class AliTOFGeometryV5: public AliTOFGeometry {
   Bool_t  IsInsideThePadPar(Int_t *det, Float_t *pos) const; 
   Float_t DistanceToPadPar(Int_t *det, Float_t *pos, Float_t *dist3d=0) const;
   void    GetVolumePath(Int_t *ind, Char_t *path );
+  void    GetVolumePath(Int_t sector, Char_t *path );
+  void    GetVolumePath(Int_t sector, Int_t plate, Int_t strip, Char_t *path );
   Int_t   GetPlate(Float_t *pos) const;
   Int_t   GetStrip(Float_t *pos) const;
   Int_t   GetSector(Float_t *pos) const;
@@ -55,6 +57,8 @@ class AliTOFGeometryV5: public AliTOFGeometry {
   void Rotation(Float_t *xyz, Double_t rotationAngles[6]) const;
   void InverseRotation(Float_t *xyz, Double_t rotationAngles[6]) const;
 
+  void DetToSectorRF(Int_t vol[5], Double_t **coord);
+
   protected:
 
   enum {