]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - PMD/AliPMDRootDataRead.C
- Rebbined ratios in the TOF range
[u/mrichter/AliRoot.git] / PMD / AliPMDRootDataRead.C
index cbcab981dc87bb8432efe74d24579c0cbf5de1fd..e9d54dcdcde3873f47ca3f69a72e55d79c2f0ed2 100644 (file)
@@ -1,11 +1,15 @@
 // To read PMD raw root data and fetch the adc value for each cell
-void AliPMDRootDataRead(Int_t NEVT = 10)
+void AliPMDRootDataRead(Char_t *file="rawfile.root",Int_t runNr = 0,
+                       Int_t NEVT = 10)
 {
   TObjArray pmdddlcont;
 
+  AliCDBManager *man = AliCDBManager::Instance();
+  man->SetDefaultStorage("local://$ALICE_ROOT/OCDB");
+  man->SetRun(runNr);
+
   gBenchmark->Start("");
-  
-  Bool_t junk;
+  gStyle->SetOptStat(0);
 
   Int_t   xpad, ypad;
   Float_t xx, yy;
@@ -13,71 +17,74 @@ void AliPMDRootDataRead(Int_t NEVT = 10)
   AliPMDUtility cc;
   TH2F *h2 = new TH2F("h2","Y vs. X",200,-100.,100.,200,-100.,100.);
 
+  TH1F *h1 = new TH1F("h1","",200,0.,200.);
 
-  for(Int_t ievt=3; ievt < NEVT; ievt++)
-  {
-  
-  AliRawReaderRoot reader("08000033646024.10.root",ievt);
-  // reader.NextEvent();
-  cout<<" Processing Event No  : "<<ievt<<endl;
-  /*
-    reader.ReadHeader();
-    cout << "LDC ID =       " << reader.GetLDCId()       << endl;
-    cout << "Equipment ID = " << reader.GetEquipmentId() << endl;
-    cout << "Data Size =    " << reader.GetDataSize()    << endl;
-  */
-
-
-  AliPMDRawStream stream(&reader);
 
-  Int_t iddl = -1;
-  while((iddl = stream.DdlData(&pmdddlcont)) >= 0)
-  {
-      Int_t ientries = pmdddlcont.GetEntries();
+  for(Int_t ievt=495; ievt < NEVT; ievt++)
+    {
+  
+      //AliRawReaderRoot reader("09000095029017.10.root",ievt);
+      AliRawReaderRoot reader(file,ievt);
 
-      //cout << "iddl = " << iddl << " ientries = " << ientries << endl;
+      cout<<" Processing Event No  : "<<ievt<<endl;
 
-      for (Int_t ient = 0; ient < ientries; ient++)
+      AliPMDRawStream stream(&reader);
+      
+      Int_t iddl = -1;
+      
+      while((iddl = stream.DdlData(&pmdddlcont)) >= 0)
        {
-         AliPMDddldata *pmdddl = (AliPMDddldata*)pmdddlcont.UncheckedAt(ient);
-         
-         Int_t det = pmdddl->GetDetector();
-         Int_t smn = pmdddl->GetSMN();
-         //Int_t mcm = pmdddl->GetMCM();
-         //Int_t chno = pmdddl->GetChannel();
-         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;
-         }
+         Int_t ientries = pmdddlcont.GetEntries();
+         
+         cout << "iddl = " << iddl << " ientries = " << ientries << endl;
          
-         if (det == 0)
-         {
-             cc.RectGeomCellPos(smn,xpad,ypad,xx,yy);
-             h2->Fill(xx,yy); 
-         }
+         for (Int_t ient = 0; ient < ientries; ient++)
+           {
+             AliPMDddldata *pmdddl = (AliPMDddldata*)pmdddlcont.UncheckedAt(ient);
          
+             Int_t det = pmdddl->GetDetector();
+             Int_t smn = pmdddl->GetSMN();
+             Int_t mcm = pmdddl->GetMCM();
+             Int_t pbus = pmdddl->GetPatchBusId();
+             //Int_t chno = pmdddl->GetChannel();
+             
+             Int_t row = pmdddl->GetRow();
+             Int_t col = pmdddl->GetColumn();
+             Int_t sig = pmdddl->GetSignal();
+
+             //if (iddl == 5)
+             //printf("%d %d %d %d %d %d\n",iddl,det,smn,pbus,row,col);
+             
+             if(mcm == 0) continue;
+             
+
+             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,sig); 
+                 h1->Fill(sig);
+               }
+             
+           }
+         
+      pmdddlcont.Delete();
        }
-
-      pmdddlcont.Clear();
-    }
-
-  }
+      
+    }//event loop
   h2->Draw();
-
+  cc.SetWriteModule(1);  // set here 0 not to print the module no
+  cc.DrawPMDModule(0);   // 0 : for preshower, 1:for CPV plane
   gBenchmark->Show("");
-
-
 }