-//
-void AliPMDRawDataRead()
-{
- // To read PMD raw data
+// To read PMD raw data
- Int_t ievt = 0;
- AliRawReaderFile reader(ievt);
- AliPMDRawStream stream(&reader);
+void AliPMDRawDataRead(Int_t iEvent)
+{
+ TObjArray pmdddlcont;
+
+ TH2F *h2 = new TH2F("h2"," ",100,-100.,100.,100,-100.,100.);
+ Float_t xx, yy;
+ Int_t xpad, ypad;
- // FILE *fpw2 = fopen("rawread2.txt","w");
+ AliPMDUtility cc;
- while(stream.Next())
+ for(Int_t ievt = 0; ievt < iEvent; ievt++)
{
- printf("%d %d %d %d\n",stream.GetModule(),stream.GetRow(),
- stream.GetColumn(),stream.GetSignal());
+ AliRawReaderFile reader(ievt);
+ AliPMDRawStream stream(&reader);
+
+ Int_t iddl = -1;
+ while ((iddl = stream.DdlData(&pmdddlcont)) >=0)
+ {
+ //cout << " inside the macro DDLNO = " << iddl << endl;
+ Int_t ientries = pmdddlcont.GetEntries();
+ 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 chno = pmdddl->GetChannel();
+ Int_t row = pmdddl->GetRow();
+ Int_t col = pmdddl->GetColumn();
+ Int_t sig = pmdddl->GetSignal();
+ //cout<<sig<<endl;
+ if(smn <12)
+ {
+ xpad = col;
+ ypad = row;
+ }
+ else if(smn >=12 && smn < 24)
+ {
+ xpad = row;
+ ypad = col;
+ }
+
+ if (det == 1)
+ {
+ // Draw only for PRE plane
+ cc.RectGeomCellPos(smn,xpad,ypad,xx,yy);
+
+ h2->Fill(xx,yy);
+ }
+
- Int_t det = stream.GetDetector();
- Int_t smn = stream.GetSMN();
- Int_t mcm = stream.GetMCM();
- Int_t chno = stream.GetChannel();
- Int_t row = stream.GetRow();
- Int_t col = stream.GetColumn();
- Int_t sig = stream.GetSignal();
- // fprintf(fpw2,"%d %d %d %d %d %d %d\n",det, smn, row, col,
- // mcm, chno, sig);
+ }
+ pmdddlcont.Clear();
+
+ }
}
+ h2->Draw();
}