Updated for modifs in AliMpFiles
[u/mrichter/AliRoot.git] / MUON / mapping / macros / testNeighboursPadIterator.C
index f77e7fc5c27d27253b692188fadafe9c1f22c033..6f14e70852848a3fed743ca720a35af1dbd22a61 100644 (file)
@@ -1,18 +1,26 @@
 // $Id$
+// $MpId: testNeighboursPadIterator.C,v 1.10 2005/10/28 15:36:08 ivana Exp $
 //
 // Test macro for reading  sector, and iterate over it
 
 void testNeighboursPadIterator(AliMpStationType station = kStation1,
                                AliMpPlaneType plane = kBendingPlane, 
+                              Bool_t rootInput = false,
                                Int_t i=50, Int_t j=50)
 {
-  if (!gInterpreter->IsLoaded("mlibs.C")){ 
-    gROOT->LoadMacro("mlibs.C");
-    gInterpreter->ProcessLine("mlibs()");
+  AliMpSector *sector = 0;
+  if (!rootInput) {
+    AliMpSectorReader r(station, plane);
+    sector=r.BuildSector();
+  }
+  else  {
+    TString filePath = AliMpFiles::SectorFilePath(station,plane);
+    filePath.ReplaceAll("zones.dat", "sector.root"); 
+
+    TFile f(filePath.Data(), "READ");
+    sector = (AliMpSector*)f.Get("Sector");
   }  
 
-  AliMpReader r(station, plane);
-  AliMpSector* sect = r.BuildSector();
   AliMpSectorSegmentation segm(sect);  
   
   TCanvas *can = new TCanvas("canv");