]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - PMD/AliPMDDigits2Recpoints.C
calibration classes added
[u/mrichter/AliRoot.git] / PMD / AliPMDDigits2Recpoints.C
index 366a26c66995b2bd8019df6ad29c972460485f05..fe7d43a14346c03283a3d32b0521250c1a91def2 100644 (file)
@@ -20,22 +20,57 @@ void AliPMDDigits2Recpoints(Int_t nevt=1)
   TStopwatch timer;
   timer.Start();
 
-  // Input file name
-  Char_t *alifile = "galice.root"; 
+  // Open the AliRoot file
+  AliRunLoader *fRunLoader = AliRunLoader::Open("galice.root");
+  if (!fRunLoader)
+    {
+      cerr<<"Can't load RunLoader"<<endl;
+      return 1;
+    }
+  fRunLoader->LoadgAlice();
+  gAlice = fRunLoader->GetAliRun();
+
+  printf(" Do you want reconstruction from Digits file or RAW data \n");
+  printf(" If RAW,    type 0 \n");
+  printf(" If Digits, type 1 \n");
+  Int_t itype;
+  cin >> itype;
 
   // Create the PMD Cluster Finder 
-  AliPMDClusterFinder *clus = new AliPMDClusterFinder();
-  
-  // Open the AliRoot file
-  clus->OpengAliceFile(alifile,"DR");
-  
-  Int_t ievt;
-  
-  for (ievt = 0; ievt < nevt; ievt++)
+  AliPMDClusterFinder *clus = new AliPMDClusterFinder(fRunLoader);
+  clus->SetDebug(1);
+  if (itype == 0)
+    {
+      clus->Load();
+    }
+  else if (itype == 1)
+    {
+      clus->LoadClusters();
+    }  
+
+
+  for (Int_t ievt = 0; ievt < nevt; ievt++)
+    {
+      if (itype == 0)
+       {
+         // from digits data
+         clus->Digits2RecPoints(ievt);
+       }
+      else if (itype == 1)
+       {
+         // from raw data
+         AliRawReaderFile reader(ievt);
+         clus->Digits2RecPoints(ievt, &reader);
+       }
+    }
+  if (itype == 0)
+    {
+      clus->UnLoad();
+    }
+  else if (itype == 1)
     {
-      clus->Digits2RecPoints(ievt);
+      clus->UnLoadClusters();
     }
-  clus->UnLoad("R");
   timer.Stop();
   timer.Print();
 }