1 // To read PMD raw root data and fetch the adc value for each cell
2 void AliPMDRootDataRead(Int_t NEVT = 10)
9 TFile *pedfile = new TFile("PMD_PED.root");
13 printf("ERROR --- NO PEDESTAL (PMD_PED.root) FILE IS FOUND IN THE CURRENT DIRECTORY--- STOP GAIN DA\n");
18 Float_t fPedMeanRMS[2][24][48][96];
20 for(Int_t i = 0; i < 2; i++)
22 for(Int_t j = 0; j < 24; j++)
24 for(Int_t k = 0; k < 48; k++)
26 for(Int_t l = 0; l < 96; l++)
28 fPedMeanRMS[i][j][k][l] = 0.;
34 Int_t det, sm, row, col;
37 TTree *ped =(TTree*)pedfile->Get("ped");
39 ped->SetBranchAddress("det",&det);
40 ped->SetBranchAddress("sm",&sm);
41 ped->SetBranchAddress("row",&row);
42 ped->SetBranchAddress("col",&col);
43 ped->SetBranchAddress("mean",&mean);
44 ped->SetBranchAddress("rms",&rms);
46 Int_t nentries = (Int_t)ped->GetEntries();
48 for (Int_t ient = 0; ient < nentries; ient++)
51 fPedMeanRMS[det][sm][row][col] = mean + 10.*rms;
52 //printf("Mean= %f, RMS= %f, PedMeanRMS=%f\n",mean,rms,fPedMeanRMS[det][sm][row][col]);
67 TH2F *h2 = new TH2F("h2","Y vs. X",200,-100.,100.,200,-100.,100.);
69 TH1F *h1 = new TH1F("h1","",200,0.,200.);
72 for(Int_t ievt=3; ievt < NEVT; ievt++)
75 AliRawReaderRoot reader("08000042184000.10.root",ievt);
77 cout<<" Processing Event No : "<<ievt<<endl;
79 AliPMDRawStream stream(&reader);
83 while((iddl = stream.DdlData(&pmdddlcont)) >= 0)
86 Int_t ientries = pmdddlcont.GetEntries();
88 //cout << "iddl = " << iddl << " ientries = " << ientries << endl;
90 for (Int_t ient = 0; ient < ientries; ient++)
92 AliPMDddldata *pmdddl = (AliPMDddldata*)pmdddlcont.UncheckedAt(ient);
94 det = pmdddl->GetDetector();
95 Int_t smn = pmdddl->GetSMN();
96 Int_t mcm = pmdddl->GetMCM();
97 Int_t pbus = pmdddl->GetPatchBusId();
98 //Int_t chno = pmdddl->GetChannel();
100 row = pmdddl->GetRow();
101 col = pmdddl->GetColumn();
102 Int_t sig = pmdddl->GetSignal();
104 if(mcm == 0) continue;
106 Int_t sig1 = sig - (Int_t)fPedMeanRMS[det][smn][row][col];
114 if (ievt == 159 && sig > 0) cout << row << " " << col << " " << sig << endl;
122 else if(smn >=12 && smn < 24)
130 cc.RectGeomCellPos(smn,xpad,ypad,xx,yy);
142 cc.SetWriteModule(1);
144 gBenchmark->Show("");