]> git.uio.no Git - u/mrichter/AliRoot.git/commitdiff
Adding getter for AliTPCAltroMapping
authormarian <marian@f7af4fe6-9843-0410-8265-dc069ae4e863>
Sun, 25 Nov 2007 00:40:07 +0000 (00:40 +0000)
committermarian <marian@f7af4fe6-9843-0410-8265-dc069ae4e863>
Sun, 25 Nov 2007 00:40:07 +0000 (00:40 +0000)
Optional parameter in constructor - path to the altro mapping text files
(Marian)

TPC/AliTPCmapper.cxx
TPC/AliTPCmapper.h

index 6dcafb71cf68bb49a07171f290d6f293a4f6eb33..384a079a180c545c920396835d4bfd1d1bbbd74c 100644 (file)
@@ -48,7 +48,7 @@
 ClassImp(AliTPCmapper)
 
 //______________________________________________________________
-AliTPCmapper::AliTPCmapper() :
+AliTPCmapper::AliTPCmapper(const char * dirname) :
   fNside(0),
   fNsector(0),
   fNrcu(0),
@@ -61,8 +61,12 @@ AliTPCmapper::AliTPCmapper() :
   fTpcDdlOffset(0),
   fROC(NULL)
 {
+  //
   // Constructor
-  Init();
+  //
+  // dirname - specify the directory with the ascii Altro mapping files
+  //
+  Init(dirname);
 }
 
 //______________________________________________________________
@@ -124,7 +128,7 @@ AliTPCmapper& AliTPCmapper::operator = (const AliTPCmapper& mapper)
 }
 
 //______________________________________________________________
-void AliTPCmapper::Init()
+void AliTPCmapper::Init(const char *dirname)
 {
   // Initialize all
   fNside    = 2;
@@ -136,8 +140,15 @@ void AliTPCmapper::Init()
 
   // Load and read mapping files. AliTPCAltroMapping contains the mapping for
   // each patch (rcu).
-  TString path = gSystem->Getenv("ALICE_ROOT");
-  path += "/TPC/mapping/Patch";
+  TString path;
+  if (dirname==0){
+    path  =gSystem->Getenv("ALICE_ROOT");
+    path += "/TPC/mapping/Patch";
+  }else{
+    path  = dirname;
+    path +="Patch";
+  }
+
   TString path2;
   for(Int_t i = 0; i < fNrcu; i++) {
     path2 = path;
index e70720effb69144754a110862ac6cf8d6b684873..2ea21d291337acc987aca5ab5098f8c3608f234d 100644 (file)
@@ -20,13 +20,15 @@ class AliTPCmapper : public TObject{
 
 public:
 
-  AliTPCmapper();
+  AliTPCmapper(const char * dirname=0);
   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;