resolving new library dependency libAOD
[u/mrichter/AliRoot.git] / PMD / AliPMDRootDataRead.C
CommitLineData
9f35f7b3 1// To read PMD raw root data and fetch the adc value for each cell
27f6261d 2void AliPMDRootDataRead(Char_t *file="rawfile.root",Int_t runNr = 0,
3 Int_t NEVT = 10)
1f86361b 4{
1f86361b 5 TObjArray pmdddlcont;
722ccc67 6
27f6261d 7 AliCDBManager *man = AliCDBManager::Instance();
8 man->SetDefaultStorage("local://$ALICE_ROOT/OCDB");
9 man->SetRun(runNr);
10
722ccc67 11 gBenchmark->Start("");
2c08d1c1 12 gStyle->SetOptStat(0);
13
722ccc67 14 Int_t xpad, ypad;
15 Float_t xx, yy;
16
17 AliPMDUtility cc;
18 TH2F *h2 = new TH2F("h2","Y vs. X",200,-100.,100.,200,-100.,100.);
19
17de6334 20 TH1F *h1 = new TH1F("h1","",200,0.,200.);
21
722ccc67 22
27f6261d 23 for(Int_t ievt=495; ievt < NEVT; ievt++)
24 {
9f35f7b3 25
27f6261d 26 //AliRawReaderRoot reader("09000095029017.10.root",ievt);
27 AliRawReaderRoot reader(file,ievt);
722ccc67 28
27f6261d 29 cout<<" Processing Event No : "<<ievt<<endl;
722ccc67 30
27f6261d 31 AliPMDRawStream stream(&reader);
32
33 Int_t iddl = -1;
34
35 while((iddl = stream.DdlData(&pmdddlcont)) >= 0)
1f86361b 36 {
17de6334 37
27f6261d 38 Int_t ientries = pmdddlcont.GetEntries();
722ccc67 39
27f6261d 40 cout << "iddl = " << iddl << " ientries = " << ientries << endl;
41
42 for (Int_t ient = 0; ient < ientries; ient++)
43 {
44 AliPMDddldata *pmdddl = (AliPMDddldata*)pmdddlcont.UncheckedAt(ient);
45
46 Int_t det = pmdddl->GetDetector();
47 Int_t smn = pmdddl->GetSMN();
48 Int_t mcm = pmdddl->GetMCM();
49 Int_t pbus = pmdddl->GetPatchBusId();
50 //Int_t chno = pmdddl->GetChannel();
51
52 Int_t row = pmdddl->GetRow();
53 Int_t col = pmdddl->GetColumn();
54 Int_t sig = pmdddl->GetSignal();
55
56 //if (iddl == 5)
57 //printf("%d %d %d %d %d %d\n",iddl,det,smn,pbus,row,col);
58
59 if(mcm == 0) continue;
60
61
62 if(smn <12)
63 {
64 xpad = col;
65 ypad = row;
66 }
67 else if(smn >=12 && smn < 24)
68 {
69 xpad = row;
70 ypad = col;
71 }
72
73 if (det == 0)
74 {
75 cc.RectGeomCellPos(smn,xpad,ypad,xx,yy);
76 h2->Fill(xx,yy,sig);
77 h1->Fill(sig);
78 }
79
80 }
9f35f7b3 81
17de6334 82 pmdddlcont.Delete();
27f6261d 83 }
84
85 }//event loop
722ccc67 86 h2->Draw();
27f6261d 87 cc.SetWriteModule(1); // set here 0 not to print the module no
88 cc.DrawPMDModule(0); // 0 : for preshower, 1:for CPV plane
722ccc67 89 gBenchmark->Show("");
722ccc67 90}