]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - PMD/AliPMDRootDataRead.C
TaskSE inheritancy and structure... no AOD part yet
[u/mrichter/AliRoot.git] / PMD / AliPMDRootDataRead.C
index ae37a8d344503395fb24d74a28e9293b348f196a..b63f28d1d8ce91469b5586bdf381815f44ef4910 100644 (file)
@@ -1,13 +1,23 @@
 // To read PMD raw root data and fetch the adc value for each cell
-void AliPMDRootDataRead()
+void AliPMDRootDataRead(Int_t NEVT = 10)
 {
   TObjArray pmdddlcont;
+
+  gBenchmark->Start("");
+  gStyle->SetOptStat(0);
+
+
+  Int_t   xpad, ypad;
+  Float_t xx, yy;
+
+  AliPMDUtility cc;
+  TH2F *h2 = new TH2F("h2","Y vs. X",200,-100.,100.,200,-100.,100.);
+
+
+  for(Int_t ievt=3; ievt < NEVT; ievt++)
+  {
   
-  Int_t ievt = 2;
-  
-  Bool_t junk;
-  
-  AliRawReaderRoot reader("raw.root",ievt);
+  AliRawReaderRoot reader("08000033646024.10.root",ievt);
   // reader.NextEvent();
   cout<<" Processing Event No  : "<<ievt<<endl;
   /*
@@ -17,16 +27,16 @@ void AliPMDRootDataRead()
     cout << "Data Size =    " << reader.GetDataSize()    << endl;
   */
 
+
   AliPMDRawStream stream(&reader);
-  
-  Int_t indexDDL = 0;
-  
-  for (Int_t iddl = 0; iddl < 6; iddl++)
-    {
-      reader.Select("PMD", iddl, iddl);
-      junk = stream.DdlData(iddl,&pmdddlcont);
-      
+
+  Int_t iddl = -1;
+  while((iddl = stream.DdlData(&pmdddlcont)) >= 0)
+  {
       Int_t ientries = pmdddlcont.GetEntries();
+
+      //cout << "iddl = " << iddl << " ientries = " << ientries << endl;
+
       for (Int_t ient = 0; ient < ientries; ient++)
        {
          AliPMDddldata *pmdddl = (AliPMDddldata*)pmdddlcont.UncheckedAt(ient);
@@ -38,9 +48,37 @@ void AliPMDRootDataRead()
          Int_t row = pmdddl->GetRow();
          Int_t col = pmdddl->GetColumn();
          Int_t sig = pmdddl->GetSignal();
+
+//       cout << iddl<<"  "<<row << " " << col << " " << sig << endl;
+
+
+         if(smn <12)
+         {
+             xpad = col;
+             ypad = row;
+         }
+         else if(smn >=12 && smn < 24)
+         {
+             xpad = row;
+             ypad = col;
+         }
+         
+         if (det == 0)
+         {
+             cc.RectGeomCellPos(smn,xpad,ypad,xx,yy);
+             h2->Fill(xx,yy); 
+         }
          
-         //cout << iddl<<"  "<<row << " " << col << " " << sig << endl;
        }
+
       pmdddlcont.Clear();
     }
-}
\ No newline at end of file
+
+  }
+  h2->Draw();
+  cc->SetWriteModule(1);
+  cc->DrawPMDModule();
+  gBenchmark->Show("");
+
+
+}