]> git.uio.no Git - u/mrichter/AliRoot.git/blame - PMD/AliPMDRootDataRead.C
skip if the MCM number is wrong
[u/mrichter/AliRoot.git] / PMD / AliPMDRootDataRead.C
CommitLineData
9f35f7b3 1// To read PMD raw root data and fetch the adc value for each cell
722ccc67 2void AliPMDRootDataRead(Int_t NEVT = 10)
1f86361b 3{
1f86361b 4 TObjArray pmdddlcont;
722ccc67 5
6 gBenchmark->Start("");
2c08d1c1 7 gStyle->SetOptStat(0);
8
722ccc67 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 {
9f35f7b3 19
722ccc67 20 AliRawReaderRoot reader("08000033646024.10.root",ievt);
9f35f7b3 21 // reader.NextEvent();
22 cout<<" Processing Event No : "<<ievt<<endl;
1f86361b 23 /*
9f35f7b3 24 reader.ReadHeader();
25 cout << "LDC ID = " << reader.GetLDCId() << endl;
26 cout << "Equipment ID = " << reader.GetEquipmentId() << endl;
27 cout << "Data Size = " << reader.GetDataSize() << endl;
1f86361b 28 */
29
722ccc67 30
1f86361b 31 AliPMDRawStream stream(&reader);
722ccc67 32
33 Int_t iddl = -1;
34 while((iddl = stream.DdlData(&pmdddlcont)) >= 0)
35 {
1f86361b 36 Int_t ientries = pmdddlcont.GetEntries();
722ccc67 37
38 //cout << "iddl = " << iddl << " ientries = " << ientries << endl;
39
1f86361b 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();
722ccc67 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 }
9f35f7b3 71
1f86361b 72 }
722ccc67 73
1f86361b 74 pmdddlcont.Clear();
1f86361b 75 }
722ccc67 76
77 }
78 h2->Draw();
2c08d1c1 79 cc->SetWriteModule(1);
80 cc->DrawPMDModule();
722ccc67 81 gBenchmark->Show("");
82
83
84}