]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - ITS/UPGRADE/AliITSUGeomTGeo.h
Switching to the TDR naming schema (I cross my fingers)
[u/mrichter/AliRoot.git] / ITS / UPGRADE / AliITSUGeomTGeo.h
index 1b6dbfc6278cae57584b8b69e19a33b425cca45c..3f98c5d1a4b1f5aabdf1dd370da7cb493a57d85f 100644 (file)
@@ -5,7 +5,7 @@
  * See cxx source for full Copyright notice                               */
 
 /////////////////////////////////////////////////////////////////////////
-//  AliITSUGeomTGeo is a simple interface class to TGeoManager       //
+//  AliITSUGeomTGeo is a simple interface class to TGeoManager         //
 //  It is used in the simulation and reconstruction in order to        //
 //  query the TGeo ITS geometry                                        //
 //                                                                     //
 //  method if the structures are initialized. To be converted to       //
 //  singleton at later stage.                                          //
 //                                                                     //
-//  Note on the upgrade detector types:                                //
-//  The coarse type defines detectors served by different classes,     //
-//  like Pix. Each such a detector type can have kMaxSegmPerDetType    //
+//  Note on the upgrade chip types:                                    //
+//  The coarse type defines chips served by different classes,         //
+//  like Pix. Each such a chip type can have kMaxSegmPerChipType       //
 //  segmentations (pitch etc.) whose parameteres are stored in the     //
 //  AliITSsegmentation derived class (like AliITSUSegmentationPix)     //
-//  This allows to have in the setup modules served by the same        //
+//  This allows to have in the setup chips served by the same          //
 //  classes but with different segmentations.                          //
-//  The full detector type is composed as:                             //
-//  CoarseType*kMaxSegmPerDetType + segmentationType                   //
+//  The full chip type is composed as:                                 //
+//  CoarseType*kMaxSegmPerChipType + segmentationType                  //
 //  The only requirement on the segmentationType that should be        //
-//  < kMaxSegmPerDetType.                                              //
-//  The methods like GetLayerDetTypeID return the full detector type   //
+//  < kMaxSegmPerChipType.                                             //
+//  The methods like GetLayerChipTypeID return the full chip type      //
 //                                                                     //
 //                                                                     //
 /////////////////////////////////////////////////////////////////////////
@@ -47,65 +47,76 @@ class AliITSUGeomTGeo : public TObject {
 
  public:
   enum {kITSVNA, kITSVUpg}; // ITS version
-  enum {kDetTypePix=0, kNDetTypes, kMaxSegmPerDetType=10}; // defined detector types (each one can have different segmentations)
+  enum {kChipTypePix=0, kNChipTypes, kMaxSegmPerChipType=10}; // defined detector chip types (each one can have different segmentations)
   //
   AliITSUGeomTGeo(Bool_t build = kFALSE, Bool_t loadSegmentations = kTRUE);
   virtual ~AliITSUGeomTGeo(); 
   AliITSUGeomTGeo(const AliITSUGeomTGeo &src);
   AliITSUGeomTGeo& operator=(const AliITSUGeomTGeo &geom);
   //
-  Int_t  GetNModules()                                                    const {return fNModules;}
-  Int_t  GetNDetectors(Int_t lay)                                         const {return fNDetectors[lay];}
-  Int_t  GetNLadders(Int_t lay)                                           const {return fNLadders[lay];}
-  Int_t  GetNLayers()                                                     const {return fNLayers;}
+  Int_t  GetNChips()                                                    const {return fNChips;}
+  Int_t  GetNChipsPerModule(Int_t lay)                                  const {return fNChipsPerModule[lay];}
+  Int_t  GetNChipsPerSubStave(Int_t lay)                                const {return fNChipsPerSubStave[lay];}
+  Int_t  GetNChipsPerStave(Int_t lay)                                   const {return fNChipsPerStave[lay];}
+  Int_t  GetNChipsPerLayer(Int_t lay)                                   const {return fNChipsPerLayer[lay];}
+  Int_t  GetNModules(Int_t lay)                                         const {return fNModules[lay];}
+  Int_t  GetNSubStaves(Int_t lay)                                       const {return fNSubStaves[lay];}
+  Int_t  GetNStaves(Int_t lay)                                          const {return fNStaves[lay];}
+  Int_t  GetNLayers()                                                   const {return fNLayers;}
   
-  Int_t  GetModuleIndex(Int_t lay,int detInLay)                           const {return GetFirstModIndex(lay)+detInLay;}
-  Int_t  GetModuleIndex(Int_t lay,Int_t lad,Int_t det)                    const;
-  Bool_t GetModuleId(Int_t index,Int_t &lay,Int_t &lad,Int_t &det)        const;
-  Int_t  GetLayer(Int_t index)                                            const;
-  Int_t  GetLadder(Int_t index)                                           const;
-  Int_t  GetModIdInLayer(Int_t index)                                     const;
-  Int_t  GetModIdInLadder(Int_t index)                                    const;
+  Int_t  GetChipIndex(Int_t lay,int detInLay)                           const {return GetFirstChipIndex(lay)+detInLay;}
+  Int_t  GetChipIndex(Int_t lay,Int_t sta,Int_t detInSta)               const;
+  Int_t  GetChipIndex(Int_t lay,Int_t sta, Int_t subSta, Int_t detInSubSta) const;
+  Int_t  GetChipIndex(Int_t lay,Int_t sta, Int_t subSta, Int_t md, Int_t detInMod) const;
+  Bool_t GetChipId(Int_t index,Int_t &lay,Int_t &sta,Int_t &ssta,Int_t &mod,Int_t &chip)        const;
+  Int_t  GetLayer(Int_t index)                                          const;
+  Int_t  GetStave(Int_t index)                                          const;
+  Int_t  GetSubStave(Int_t index)                                       const;
+  Int_t  GetModule(Int_t index)                                         const;
+  Int_t  GetChipIdInLayer(Int_t index)                                  const;
+  Int_t  GetChipIdInStave(Int_t index)                                  const;
+  Int_t  GetChipIdInSubStave(Int_t index)                               const;
+  Int_t  GetChipIdInModule(Int_t index)                                 const;
   //
-  Int_t  GetLastModIndex(Int_t lay)                                       const {return fLastModIndex[lay];}
-  Int_t  GetFirstModIndex(Int_t lay)                                      const {return (lay==0) ? 0:fLastModIndex[lay-1]+1;}
+  Int_t  GetLastChipIndex(Int_t lay)                                       const {return fLastChipIndex[lay];}
+  Int_t  GetFirstChipIndex(Int_t lay)                                      const {return (lay==0) ? 0:fLastChipIndex[lay-1]+1;}
   //  
   const char *GetSymName(Int_t index)                                     const;
-  const char *GetSymName(Int_t lay,Int_t lad,Int_t det)                   const;
+  const char *GetSymName(Int_t lay,Int_t sta,Int_t det)                   const;
   //
-  // Attention: these are the matrices for the alignable volumes of the modules, i.e. not necessarily the sensors
+  // Attention: these are the matrices for the alignable volumes of the chips, i.e. not necessarily the sensors
   TGeoHMatrix* GetMatrix(Int_t index)                                     const;
-  TGeoHMatrix* GetMatrix(Int_t lay,Int_t lad,Int_t det)                   const;
+  TGeoHMatrix* GetMatrix(Int_t lay,Int_t sta,Int_t det)                   const;
   Bool_t GetTranslation(Int_t index, Double_t t[3])                       const;
-  Bool_t GetTranslation(Int_t lay,Int_t lad,Int_t det, Double_t t[3])     const;
+  Bool_t GetTranslation(Int_t lay,Int_t sta,Int_t det, Double_t t[3])     const;
   Bool_t GetRotation(Int_t index, Double_t r[9])                          const;
-  Bool_t GetRotation(Int_t lay,Int_t lad,Int_t det, Double_t r[9])        const;
+  Bool_t GetRotation(Int_t lay,Int_t sta,Int_t det, Double_t r[9])        const;
   Bool_t GetOrigMatrix(Int_t index, TGeoHMatrix &m)                       const;
-  Bool_t GetOrigMatrix(Int_t lay,Int_t lad,Int_t det, TGeoHMatrix &m)     const;
+  Bool_t GetOrigMatrix(Int_t lay,Int_t sta,Int_t det, TGeoHMatrix &m)     const;
   Bool_t GetOrigTranslation(Int_t index, Double_t t[3])                   const;
-  Bool_t GetOrigTranslation(Int_t lay,Int_t lad,Int_t det, Double_t t[3]) const;
+  Bool_t GetOrigTranslation(Int_t lay,Int_t sta,Int_t det, Double_t t[3]) const;
   Bool_t GetOrigRotation(Int_t index, Double_t r[9])                      const;
-  Bool_t GetOrigRotation(Int_t lay,Int_t lad,Int_t det, Double_t r[9])    const;
+  Bool_t GetOrigRotation(Int_t lay,Int_t sta,Int_t det, Double_t r[9])    const;
   //
   const TGeoHMatrix* GetMatrixT2L(Int_t index);
-  const TGeoHMatrix* GetMatrixT2L(Int_t lay,Int_t lad,Int_t det)  {return GetMatrixT2L( GetModuleIndex(lay,lad,det) );}
+  const TGeoHMatrix* GetMatrixT2L(Int_t lay,Int_t sta,Int_t det)  {return GetMatrixT2L( GetChipIndex(lay,sta,det) );}
   const TGeoHMatrix* GetMatrixSens(Int_t index);
-  const TGeoHMatrix* GetMatrixSens(Int_t lay,Int_t lad,Int_t det) {return GetMatrixSens( GetModuleIndex(lay,lad,det) );}
+  const TGeoHMatrix* GetMatrixSens(Int_t lay,Int_t sta,Int_t det) {return GetMatrixSens( GetChipIndex(lay,sta,det) );}
   //
   Bool_t GetTrackingMatrix(Int_t index, TGeoHMatrix &m);
-  Bool_t GetTrackingMatrix(Int_t lay,Int_t lad,Int_t det, TGeoHMatrix &m);
+  Bool_t GetTrackingMatrix(Int_t lay,Int_t sta,Int_t det, TGeoHMatrix &m);
   //
   // Attention: these are transformations wrt sensitive volume!
   void   LocalToGlobal(Int_t index, const Double_t *loc, Double_t *glob);
-  void   LocalToGlobal(Int_t lay, Int_t lad, Int_t det,const Double_t *loc, Double_t *glob);
+  void   LocalToGlobal(Int_t lay, Int_t sta, Int_t det,const Double_t *loc, Double_t *glob);
   //
   void   GlobalToLocal(Int_t index, const Double_t *glob, Double_t *loc);
-  void   GlobalToLocal(Int_t lay, Int_t lad, Int_t det,const Double_t *glob, Double_t *loc);
+  void   GlobalToLocal(Int_t lay, Int_t sta, Int_t det,const Double_t *glob, Double_t *loc);
   //
   void   LocalToGlobalVect(Int_t index, const Double_t *loc, Double_t *glob);
   void   GlobalToLocalVect(Int_t index, const Double_t *glob, Double_t *loc);
-  Int_t  GetLayerDetTypeID(Int_t lr)                                         const;
-  Int_t  GetModuleDetTypeID(Int_t id)                                        const;
+  Int_t  GetLayerChipTypeID(Int_t lr)                                         const;
+  Int_t  GetChipChipTypeID(Int_t id)                                        const;
   //
   const AliITSsegmentation* GetSegmentationByID(Int_t id)                    const;
   const AliITSsegmentation* GetSegmentation(Int_t lr)                        const;
@@ -115,25 +126,39 @@ class AliITSUGeomTGeo : public TObject {
   static      UInt_t GetUIDShift()                                      {return fgUIDShift;}
   static      void   SetUIDShift(UInt_t s=16)                           {fgUIDShift = s<16 ? s:16;}
   //
-  static const char* GetITSVolPattern()                                 {return fgkITSVolName;}
-  static const char* GetITSLayerPattern()                               {return fgkITSLrName;}
-  static const char* GetITSWrapVolPattern()                             {return fgkITSWrapVolName;}
-  static const char* GetITSLadderPattern()                              {return fgkITSLadName;}
-  static const char* GetITSModulePattern()                              {return fgkITSModName;}
-  static const char* GetITSSensorPattern()                              {return fgkITSSensName;}
+  static const char* GetITSVolPattern()                                 {return fgITSVolName.Data();}
+  static const char* GetITSLayerPattern()                               {return fgITSLrName.Data();}
+  static const char* GetITSWrapVolPattern()                             {return fgITSWrapVolName.Data();}
+  static const char* GetITSStavePattern()                               {return fgITSStaveName.Data();}
+  static const char* GetITSSubStavePattern()                            {return fgITSSubStaveName.Data();}
+  static const char* GetITSModulePattern()                              {return fgITSModuleName.Data();}
+  static const char* GetITSChipPattern()                                {return fgITSChipName.Data();}
+  static const char* GetITSSensorPattern()                              {return fgITSSensName.Data();}
   static const char* GetITSsegmentationFileName()                       {return fgITSsegmFileName.Data();}
-  static const char* GetDetTypeName(Int_t i);
+  static const char* GetChipTypeName(Int_t i);
+
+  static void        SetITSVolPattern(const char* nm)                   {fgITSVolName = nm;}
+  static void        SetITSLayerPattern(const char* nm)                 {fgITSLrName = nm;}
+  static void        SetITSWrapVolPattern(const char* nm)               {fgITSWrapVolName = nm;}
+  static void        SetITSStavePattern(const char* nm)                 {fgITSStaveName = nm;}
+  static void        SetITSSubStavePattern(const char* nm)              {fgITSSubStaveName = nm;}
+  static void        SetITSModulePattern(const char* nm)                {fgITSModuleName = nm;}
+  static void        SetITSChipPattern(const char* nm)                  {fgITSChipName = nm;}
+  static void        SetITSSensorPattern(const char* nm)                {fgITSSensName = nm;}
+  static void        SetChipTypeName(Int_t i,const char* nm);
   static void        SetITSsegmentationFileName(const char* nm)         {fgITSsegmFileName = nm;}
-  static UInt_t      ComposeDetTypeID(UInt_t segmId);
+  static UInt_t      ComposeChipTypeID(UInt_t segmId);
   //
   static const char *ComposeSymNameITS();
   static const char *ComposeSymNameLayer(Int_t lr);
-  static const char *ComposeSymNameLadder(Int_t lr, Int_t lad);
-  static const char *ComposeSymNameModule(Int_t lr, Int_t lad, int det);
+  static const char *ComposeSymNameStave(Int_t lr, Int_t sta);
+  static const char *ComposeSymNameSubStave(Int_t lr, Int_t sta, Int_t ssta);
+  static const char *ComposeSymNameModule(Int_t lr, Int_t sta, Int_t ssta, Int_t mod);
+  static const char *ComposeSymNameChip(Int_t lr, Int_t sta, Int_t ssta, Int_t mod, Int_t chip);
   //
   // hack to avoid using AliGeomManager
-  Int_t              LayerToVolUID(Int_t lay,int detInLay)        const {return ModuleVolUID(GetModuleIndex(lay,detInLay));}
-  static Int_t       ModuleVolUID(Int_t mod)                            {return (mod&0xffff)<<fgUIDShift;}
+  Int_t              LayerToVolUID(Int_t lay,int detInLay)        const {return ChipVolUID(GetChipIndex(lay,detInLay));}
+  static Int_t       ChipVolUID(Int_t mod)                            {return (mod&0xffff)<<fgUIDShift;}
   //
  protected:
   void         FetchMatrices();
@@ -142,9 +167,11 @@ class AliITSUGeomTGeo : public TObject {
   TGeoHMatrix* ExtractMatrixSens(Int_t index)                     const;
   Bool_t       GetLayer(Int_t index,Int_t &lay,Int_t &index2)     const;
   TGeoPNEntry* GetPNEntry(Int_t index)                            const;
-  Int_t        ExtractNumberOfDetectors(Int_t lay)                const;
-  Int_t        ExtractNumberOfLadders(Int_t lay)                  const;
-  Int_t        ExtractLayerDetType(Int_t lay)                     const;
+  Int_t        ExtractNChipsPerModule(Int_t lay)                  const;
+  Int_t        ExtractNumberOfStaves(Int_t lay)                   const;
+  Int_t        ExtractNumberOfSubStaves(Int_t lay)                const;
+  Int_t        ExtractNumberOfModules(Int_t lay)                  const;
+  Int_t        ExtractLayerChipType(Int_t lay)                    const;
   Int_t        ExtractNumberOfLayers();
   void         BuildITS(Bool_t loadSegm);
   //
@@ -153,99 +180,108 @@ class AliITSUGeomTGeo : public TObject {
   //
   Int_t  fVersion;             // ITS Version 
   Int_t  fNLayers;             // number of layers
-  Int_t  fNModules;            // The total number of modules
-  Int_t *fNLadders;            //[fNLayers] Array of the number of ladders/layer(layer)
-  Int_t *fLrDetType;           //[fNLayers] Array of layer detector types
-  Int_t *fNDetectors;          //[fNLayers] Array of the number of detector/ladder(layer)
-  Int_t *fLastModIndex;        //[fNLayers] max ID of the detctor in the layer
+  Int_t  fNChips;              // The total number of chips
+  Int_t *fNStaves;             //[fNLayers] Array of the number of staves/layer(layer)
+  Int_t *fNSubStaves;          //[fNLayers] Array of the number of substaves/stave(layer)
+  Int_t *fNModules;            //[fNLayers] Array of the number of modules/substave(layer)
+  Int_t *fNChipsPerModule;     //[fNLayers] Array of the number of chips per module (group of chips on the substaves)
+  Int_t *fNChipsPerSubStave;   //[fNLayers] Array of the number of chips per substave
+  Int_t *fNChipsPerStave;      //[fNLayers] Array of the number of chips per stave
+  Int_t *fNChipsPerLayer;      //[fNLayers] Array of the number of chips per stave
+
+  //
+  Int_t *fLrChipType;          //[fNLayers] Array of layer chip types
+  Int_t *fLastChipIndex;       //[fNLayers] max ID of the detctor in the layer
   Char_t fLr2Wrapper[AliITSUAux::kMaxLayers]; // layer -> wrapper correspondence
   //
   TObjArray* fMatSens;         // Sensor's matrices pointers in the geometry
   TObjArray* fMatT2L;          // Tracking to Local matrices pointers in the geometry
   TObjArray* fSegm;            // segmentations
   //
-  static       UInt_t fgUIDShift;                // bit shift to go from mod.id to modUUID for TGeo
-  static const char*  fgkITSVolName;             // ITS mother volume name
-  static const char*  fgkITSLrName;              // ITS Layer name
-  static const char*  fgkITSLadName;             // ITS Ladder name 
-  static const char*  fgkITSModName;             // ITS Module name 
-  static const char*  fgkITSSensName;            // ITS Sensor name 
-  static const char*  fgkITSWrapVolName;         // ITS Wrapper volume name 
-  static const char*  fgkITSDetTypeName[kNDetTypes]; // ITS upg detType Names
+  static UInt_t   fgUIDShift;               // bit shift to go from mod.id to modUUID for TGeo
+  static TString  fgITSVolName;             // ITS mother volume name
+  static TString  fgITSLrName;              // ITS Layer name
+  static TString  fgITSStaveName;           // ITS Stave name 
+  static TString  fgITSSubStaveName;        // ITS SubStave name 
+  static TString  fgITSModuleName;          // ITS Module name 
+  static TString  fgITSChipName;            // ITS Chip name 
+  static TString  fgITSSensName;            // ITS Sensor name 
+  static TString  fgITSWrapVolName;         // ITS Wrapper volume name 
+  static TString  fgITSChipTypeName[kNChipTypes]; // ITS upg detType Names
   //
-  static TString      fgITSsegmFileName;         // file name for segmentations
+  static TString  fgITSsegmFileName;         // file name for segmentations
   //
   ClassDef(AliITSUGeomTGeo, 2) // ITS geometry based on TGeo
 };
 
 //_____________________________________________________________________________________________
-inline const char *AliITSUGeomTGeo::GetSymName(Int_t lay,Int_t lad,Int_t det) const    
+inline const char *AliITSUGeomTGeo::GetSymName(Int_t lay,Int_t sta,Int_t det) const    
 {
   // sym name
-  return GetSymName(GetModuleIndex(lay,lad,det));
+  return GetSymName(GetChipIndex(lay,sta,det));
 }
 
 //_____________________________________________________________________________________________
-inline TGeoHMatrix* AliITSUGeomTGeo::GetMatrix(Int_t lay,Int_t lad,Int_t det) const    
+inline TGeoHMatrix* AliITSUGeomTGeo::GetMatrix(Int_t lay,Int_t sta,Int_t det) const    
 {
-  // module current matrix
-  return GetMatrix(GetModuleIndex(lay,lad,det));
+  // chip current matrix
+  return GetMatrix(GetChipIndex(lay,sta,det));
 }
 
 //_____________________________________________________________________________________________
-inline Bool_t AliITSUGeomTGeo::GetTranslation(Int_t lay,Int_t lad,Int_t det, Double_t t[3]) const    
+inline Bool_t AliITSUGeomTGeo::GetTranslation(Int_t lay,Int_t sta,Int_t det, Double_t t[3]) const    
 {
   // translation
-  return GetTranslation(GetModuleIndex(lay,lad,det),t); 
+  return GetTranslation(GetChipIndex(lay,sta,det),t); 
 }
 
 //_____________________________________________________________________________________________
-inline Bool_t AliITSUGeomTGeo::GetRotation(Int_t lay,Int_t lad,Int_t det, Double_t r[9]) const    
+inline Bool_t AliITSUGeomTGeo::GetRotation(Int_t lay,Int_t sta,Int_t det, Double_t r[9]) const    
 {
   // rot
-  return GetRotation(GetModuleIndex(lay,lad,det),r); 
+  return GetRotation(GetChipIndex(lay,sta,det),r); 
 }
 
 //_____________________________________________________________________________________________
-inline Bool_t AliITSUGeomTGeo::GetOrigMatrix(Int_t lay,Int_t lad,Int_t det, TGeoHMatrix &m) const    
+inline Bool_t AliITSUGeomTGeo::GetOrigMatrix(Int_t lay,Int_t sta,Int_t det, TGeoHMatrix &m) const    
 {
   // orig matrix
-  return GetOrigMatrix(GetModuleIndex(lay,lad,det),m); 
+  return GetOrigMatrix(GetChipIndex(lay,sta,det),m); 
 }
 
 //_____________________________________________________________________________________________
-inline Bool_t AliITSUGeomTGeo::GetOrigTranslation(Int_t lay,Int_t lad,Int_t det, Double_t t[3]) const    
+inline Bool_t AliITSUGeomTGeo::GetOrigTranslation(Int_t lay,Int_t sta,Int_t det, Double_t t[3]) const    
 {
   // orig trans
-  return GetOrigTranslation(GetModuleIndex(lay,lad,det),t); 
+  return GetOrigTranslation(GetChipIndex(lay,sta,det),t); 
 }
 
 //_____________________________________________________________________________________________
-inline Bool_t AliITSUGeomTGeo::GetOrigRotation(Int_t lay,Int_t lad,Int_t det, Double_t r[9]) const    
+inline Bool_t AliITSUGeomTGeo::GetOrigRotation(Int_t lay,Int_t sta,Int_t det, Double_t r[9]) const    
 {
   // orig rot
-  return GetOrigRotation(GetModuleIndex(lay,lad,det),r); 
+  return GetOrigRotation(GetChipIndex(lay,sta,det),r); 
 }
 
 //_____________________________________________________________________________________________
-inline Bool_t AliITSUGeomTGeo::GetTrackingMatrix(Int_t lay,Int_t lad,Int_t det, TGeoHMatrix &m)
+inline Bool_t AliITSUGeomTGeo::GetTrackingMatrix(Int_t lay,Int_t sta,Int_t det, TGeoHMatrix &m)
 {
   // tracking mat
-  return GetTrackingMatrix(GetModuleIndex(lay,lad,det),m); 
+  return GetTrackingMatrix(GetChipIndex(lay,sta,det),m); 
 }
 
 //_____________________________________________________________________________________________
-inline Int_t  AliITSUGeomTGeo::GetLayerDetTypeID(Int_t lr) const  
+inline Int_t  AliITSUGeomTGeo::GetLayerChipTypeID(Int_t lr) const  
 {
   // detector type ID of layer
-  return fLrDetType[lr];
+  return fLrChipType[lr];
 }
 
 //_____________________________________________________________________________________________
-inline Int_t  AliITSUGeomTGeo::GetModuleDetTypeID(Int_t id) const  
+inline Int_t  AliITSUGeomTGeo::GetChipChipTypeID(Int_t id) const  
 {
-  // detector type ID of module
-  return GetLayerDetTypeID(GetLayer(id));
+  // detector type ID of chip
+  return GetLayerChipTypeID(GetLayer(id));
 } 
 
 //_____________________________________________________________________________________________
@@ -293,24 +329,31 @@ inline void AliITSUGeomTGeo::GlobalToLocalVect(Int_t index, const Double_t *glob
 }
 
 //_____________________________________________________________________________________________
-inline void AliITSUGeomTGeo::LocalToGlobal(Int_t lay, Int_t lad, Int_t det,const Double_t *loc, Double_t *glob)
+inline void AliITSUGeomTGeo::LocalToGlobal(Int_t lay, Int_t sta, Int_t det,const Double_t *loc, Double_t *glob)
 {
   // Local2Master (sensor)
-  LocalToGlobal(GetModuleIndex(lay,lad,det), loc, glob);
+  LocalToGlobal(GetChipIndex(lay,sta,det), loc, glob);
 }
 
 //_____________________________________________________________________________________________
-inline void AliITSUGeomTGeo::GlobalToLocal(Int_t lay, Int_t lad, Int_t det,const Double_t *glob, Double_t *loc)
+inline void AliITSUGeomTGeo::GlobalToLocal(Int_t lay, Int_t sta, Int_t det,const Double_t *glob, Double_t *loc)
 {
   // master2local (sensor)
-  GlobalToLocal(GetModuleIndex(lay,lad,det), glob, loc);
+  GlobalToLocal(GetChipIndex(lay,sta,det), glob, loc);
+}
+
+//_____________________________________________________________________________________________
+inline const char* AliITSUGeomTGeo::GetChipTypeName(Int_t i)
+{
+  if (i>=kNChipTypes) i/=kMaxSegmPerChipType; // full type is provided
+  return fgITSChipTypeName[i].Data();
 }
 
 //_____________________________________________________________________________________________
-inline const char* AliITSUGeomTGeo::GetDetTypeName(Int_t i)
+inline void AliITSUGeomTGeo::SetChipTypeName(Int_t i, const char* nm)
 {
-  if (i>=kNDetTypes) i/=kMaxSegmPerDetType; // full type is provided
-  return fgkITSDetTypeName[i];
+  if (i>=kNChipTypes) i/=kMaxSegmPerChipType; // full type is provided
+  fgITSChipTypeName[i] = nm;
 }
 
 //_____________________________________________________________________________________________
@@ -324,7 +367,7 @@ inline const AliITSsegmentation* AliITSUGeomTGeo::GetSegmentationByID(Int_t id)
 inline const AliITSsegmentation* AliITSUGeomTGeo::GetSegmentation(Int_t lr) const 
 {
   // get segmentation of layer
-  return fSegm ? (AliITSsegmentation*)fSegm->At( GetLayerDetTypeID(lr) ) : 0;
+  return fSegm ? (AliITSsegmentation*)fSegm->At( GetLayerChipTypeID(lr) ) : 0;
 }
 
 #endif