]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - TPC/AliTPCmapper.h
Using switch for- Tot charge/Max charge
[u/mrichter/AliRoot.git] / TPC / AliTPCmapper.h
index fe068ebf9c0e5dedb12c15c911979360ffaf1935..b086cd0a7eb8cd665561e154c8aece1c05a4d3dc 100644 (file)
@@ -3,50 +3,60 @@
 /* Copyright(c) 1998-2006, ALICE Experiment at CERN, All rights reserved. *
  * See cxx source for full Copyright notice                               */
 
+////////////////////////////////////////////////////////////////////////
+//
+// AliTPCmapper class
+// Class for all mapping functions (hardware coordinates <-> pad coordinates)
+// Author: Christian Lippmann
+//       
+/////////////////////////////////////////////////////////////////////////
+
 #include <TObject.h>
 
 class AliTPCAltroMapping;
-class AliTPCROC;
 
 class AliTPCmapper : public TObject{
 
 public:
 
   AliTPCmapper();
+  AliTPCmapper(const char * dirname);
   virtual ~AliTPCmapper();
 
   AliTPCmapper& operator = (const AliTPCmapper& mapper);
   AliTPCmapper(const AliTPCmapper& mapper);
 
-  void Init();
+  void Init(const char * dirname);
+  //
+  AliTPCAltroMapping **GetAltroMapping() { return fMapping; };
 
   // ALTRO mapping functions
   Int_t GetPad(Int_t patch, Int_t hwAddress) const;
   Int_t GetPad(Int_t patch, Int_t branch, Int_t fec, Int_t chip, Int_t channel) const;
+  Int_t GetPadRow(Int_t patch, Int_t hwAddress) const;
+  Int_t GetPadRow(Int_t patch, Int_t branch, Int_t fec, Int_t chip, Int_t channel) const;
 
   // ALTRO mapping functions on roc level (padrow = 0 ... kNpadrowIROC, kNpadrowOROC)
   Int_t GetHWAddress(Int_t roc, Int_t padrow, Int_t pad) const;
   Int_t GetRcu(Int_t roc, Int_t padrow, Int_t pad) const;
   Int_t GetPatch(Int_t roc, Int_t padrow, Int_t pad) const;
-  Int_t GetPadRow(Int_t roc, Int_t hwAddress) const;
-  Int_t GetPadRow(Int_t roc, Int_t branch, Int_t fec, Int_t chip, Int_t channel) const;
   Int_t GetBranch(Int_t roc, Int_t padrow, Int_t pad) const;
   Int_t GetFEChw(Int_t roc, Int_t padrow, Int_t pad) const;
   Int_t GetFEC(Int_t roc, Int_t padrow, Int_t pad) const;
   Int_t GetChip(Int_t roc, Int_t padrow, Int_t pad) const;
   Int_t GetChannel(Int_t roc, Int_t padrow, Int_t pad) const;
 
-  // ALTRO mapping functions on sector level (sectorpadrow = 0 ... kNpadrow)
-  Int_t GetSectorPadRow(Int_t patch, Int_t hwAddress) const;
-  Int_t GetSectorPadRow(Int_t patch, Int_t branch, Int_t fec, Int_t chip, Int_t channel) const;
-  Int_t GetHWAddressSector(Int_t sectorpadrow, Int_t pad) const;
-  Int_t GetRcuSector(Int_t sectorpadrow, Int_t pad) const;
-  Int_t GetPatchSector(Int_t sectorpadrow, Int_t pad) const;
-  Int_t GetBranchSector(Int_t sectorpadrow, Int_t pad) const;
-  Int_t GetFEChwSector(Int_t sectorpadrow, Int_t pad) const;
-  Int_t GetFECSector(Int_t sectorpadrow, Int_t pad) const;
-  Int_t GetChipSector(Int_t sectorpadrow, Int_t pad) const;
-  Int_t GetChannelSector(Int_t sectorpadrow, Int_t pad) const;
+  // ALTRO mapping functions on sector level (globalpadrow = 0 ... kNpadrow)
+  Int_t GetGlobalPadRow(Int_t patch, Int_t hwAddress) const;
+  Int_t GetGlobalPadRow(Int_t patch, Int_t branch, Int_t fec, Int_t chip, Int_t channel) const;
+  Int_t GetHWAddressSector(Int_t globalpadrow, Int_t pad) const;
+  Int_t GetRcuSector(Int_t globalpadrow, Int_t pad) const;
+  Int_t GetPatchSector(Int_t globalpadrow, Int_t pad) const;
+  Int_t GetBranchSector(Int_t globalpadrow, Int_t pad) const;
+  Int_t GetFEChwSector(Int_t globalpadrow, Int_t pad) const;
+  Int_t GetFECSector(Int_t globalpadrow, Int_t pad) const;
+  Int_t GetChipSector(Int_t globalpadrow, Int_t pad) const;
+  Int_t GetChannelSector(Int_t globalpadrow, Int_t pad) const;
 
   // Coding and decoding of hardware addresses
   Int_t CodeHWAddress(Int_t branch,  Int_t fec,  Int_t chip, Int_t channel) const;
@@ -57,15 +67,15 @@ public:
 
   // Pad Geometry on sector level (padrow = 0 ... kNpadrow)
   Int_t    GetNpads(Int_t roc, Int_t padrow) const;
-  Int_t    GetNpads(Int_t sectorpadrow) const;
+  Int_t    GetNpads(Int_t globalpadrow) const;
   Int_t    GetNpadrows(Int_t roc) const;
   /*
-  Double_t GetPadXlocal(Int_t sectorpadrow) const;
-  Double_t GetPadYlocal(Int_t sectorpadrow, Int_t pad) const;
-  Double_t GetPadXglobal(Int_t sectorpadrow, Int_t pad, Int_t sector) const;
-  Double_t GetPadYglobal(Int_t sectorpadrow, Int_t pad, Int_t sector) const;
-  Double_t GetPadWidth(Int_t sectorpadrow) const;
-  Double_t GetPadLength(Int_t sectorpadrow) const;
+  Double_t GetPadXlocal(Int_t globalpadrow) const;
+  Double_t GetPadYlocal(Int_t globalpadrow, Int_t pad) const;
+  Double_t GetPadXglobal(Int_t globalpadrow, Int_t pad, Int_t sector) const;
+  Double_t GetPadYglobal(Int_t globalpadrow, Int_t pad, Int_t sector) const;
+  Double_t GetPadWidth(Int_t globalpadrow) const;
+  Double_t GetPadLength(Int_t globalpadrow) const;
   */
 
   // Conversion between hardware FEC numbering and official numbering
@@ -75,12 +85,12 @@ public:
 
   // More mapping functions
   Int_t GetEquipmentID(Int_t roc, Int_t padrow, Int_t pad) const;
-  Int_t GetEquipmentIDsector(Int_t side, Int_t sector, Int_t sectorpadrow, Int_t pad) const;
+  Int_t GetEquipmentIDsector(Int_t side, Int_t sector, Int_t globalpadrow, Int_t pad) const;
   Int_t GetEquipmentIDfromPatch(Int_t side, Int_t sector, Int_t patch) const;
   Int_t GetSectorFromRoc(Int_t roc) const;
   Int_t GetSideFromRoc(Int_t roc) const;
   Int_t GetRocFromPatch(Int_t side, Int_t sector, Int_t patch) const;
-  Int_t GetRoc(Int_t side, Int_t sector, Int_t sectorpadrow, Int_t pad) const;
+  Int_t GetRoc(Int_t side, Int_t sector, Int_t globalpadrow, Int_t pad) const;
   Int_t GetSideFromEquipmentID(Int_t equipmentID) const;
   Int_t GetSectorFromEquipmentID(Int_t equipmentID) const;
   Int_t GetRocFromEquipmentID(Int_t equipmentID) const;
@@ -94,20 +104,21 @@ public:
 
  private:
 
-  Int_t fNside;
-  Int_t fNsector;
-  Int_t fNrcu;
-  Int_t fNbranch;
-  Int_t fNaltro;
-  Int_t fNchannel;
-  Int_t fNpadrow;
-  Int_t fNpadrowIROC;
-  Int_t fNpadrowOROC;
+  Int_t fNside;        // TPC has 2 sides
+  Int_t fNsector;      // TPC side has 18 sectors
+  Int_t fNrcu;         // Sector has 6 RCUs (patches)
+  Int_t fNbranch;      // RCU has 2 branches
+  Int_t fNaltro;       // FEC has 8 ALTROs
+  Int_t fNchannel;     // ALTRO has 16 channels
+  Int_t fNpadrow;      // Sector has 159 padrows
+  Int_t fNpadrowIROC;  // IROC has 63 padrows
+  Int_t fNpadrowOROC;  // OROC has 96 padrows
+
+  Int_t fTpcDdlOffset; // DDL offset for TPC
 
   AliTPCAltroMapping *fMapping[6];    // The ALTRO mapping for each patch (rcu)
-  AliTPCROC *fROC;                    // ROC object containing some relevant functions
 
-  ClassDef(AliTPCmapper,1)
+  ClassDef(AliTPCmapper,2)
 
 };