]> git.uio.no Git - u/mrichter/AliRoot.git/blob - PMD/AliPMDRootDataRead.C
fix for the corrupt data
[u/mrichter/AliRoot.git] / PMD / AliPMDRootDataRead.C
1 // To read PMD raw root data and fetch the adc value for each cell
2 void AliPMDRootDataRead(Int_t NEVT = 10)
3 {
4   TObjArray pmdddlcont;
5
6   gBenchmark->Start("");
7   gStyle->SetOptStat(0);
8
9
10   Int_t   xpad, ypad;
11   Float_t xx, yy;
12
13   AliPMDUtility cc;
14   TH2F *h2 = new TH2F("h2","Y vs. X",200,-100.,100.,200,-100.,100.);
15
16
17   for(Int_t ievt=3; ievt < NEVT; ievt++)
18   {
19   
20   AliRawReaderRoot reader("08000033646024.10.root",ievt);
21   // reader.NextEvent();
22   cout<<" Processing Event No  : "<<ievt<<endl;
23   /*
24     reader.ReadHeader();
25     cout << "LDC ID =       " << reader.GetLDCId()       << endl;
26     cout << "Equipment ID = " << reader.GetEquipmentId() << endl;
27     cout << "Data Size =    " << reader.GetDataSize()    << endl;
28   */
29
30
31   AliPMDRawStream stream(&reader);
32
33   Int_t iddl = -1;
34   while((iddl = stream.DdlData(&pmdddlcont)) >= 0)
35   {
36       Int_t ientries = pmdddlcont.GetEntries();
37
38       //cout << "iddl = " << iddl << " ientries = " << ientries << endl;
39
40       for (Int_t ient = 0; ient < ientries; ient++)
41         {
42           AliPMDddldata *pmdddl = (AliPMDddldata*)pmdddlcont.UncheckedAt(ient);
43           
44           Int_t det = pmdddl->GetDetector();
45           Int_t smn = pmdddl->GetSMN();
46           //Int_t mcm = pmdddl->GetMCM();
47           //Int_t chno = pmdddl->GetChannel();
48           Int_t row = pmdddl->GetRow();
49           Int_t col = pmdddl->GetColumn();
50           Int_t sig = pmdddl->GetSignal();
51
52 //        cout << iddl<<"  "<<row << " " << col << " " << sig << endl;
53
54
55           if(smn <12)
56           {
57               xpad = col;
58               ypad = row;
59           }
60           else if(smn >=12 && smn < 24)
61           {
62               xpad = row;
63               ypad = col;
64           }
65           
66           if (det == 0)
67           {
68               cc.RectGeomCellPos(smn,xpad,ypad,xx,yy);
69               h2->Fill(xx,yy); 
70           }
71           
72         }
73
74       pmdddlcont.Clear();
75     }
76
77   }
78   h2->Draw();
79   cc->SetWriteModule(1);
80   cc->DrawPMDModule();
81   gBenchmark->Show("");
82
83
84 }