/*
$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)
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():
}
//_____________________________________________________________________________
+
+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;
+
+
+}
+//_____________________________________________________________________________
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;};
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() {};
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;
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];};
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
};
/*
$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)
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.;
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.;
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)
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);
+
+}