1 // ----------------------------------------------------//
3 // This is a macro to read PMD.Digits.root //
5 // ----------------------------------------------------//
7 void AliPMDDigitsRead(Int_t nevt = 1)
12 AliRunLoader *fRunLoader = AliRunLoader::Open("galice.root");
16 Error("Open","Can not open session for file %s.",file);
19 fRunLoader->LoadgAlice();
20 fRunLoader->LoadHeader();
21 gAlice = fRunLoader->GetAliRun();
25 printf("AliRun object found on file.\n");
29 printf("Could not find AliRun object.\n");
31 fPMD = (AliPMD*)gAlice->GetDetector("PMD");
32 fPMDLoader = fRunLoader->GetLoader("PMDLoader");
33 if (fPMDLoader == 0x0)
35 cerr<<"OpengAlice : Can not find PMD or PMDLoader\n";
38 fPMDLoader->LoadDigits("READ");
39 TClonesArray *fDigits;
42 TH2F *h2 = new TH2F("h2","Y vs. X",200,-100.,100.,200,-100.,100.);
44 // -------------------------------------------------------------- //
46 Int_t det = 0,smn = 0;
47 Int_t xpos, ypos, xpad, ypad;
51 for (Int_t ievt = 2; ievt <nevt; ievt++)
53 fRunLoader->GetEvent(ievt);
55 fTreeD = fPMDLoader->TreeD();
58 cout << " Can not get TreeD" << endl;
60 AliPMDdigit *pmddigit;
61 TBranch *branch = fTreeD->GetBranch("PMDDigit");
62 branch->SetAddress(&fDigits);
64 Int_t nmodules = (Int_t) fTreeD->GetEntries();
66 cout << " Total number of modules in an event = " << nmodules << endl;
68 for (Int_t imodule = 0; imodule < nmodules; imodule++)
70 fTreeD->GetEntry(imodule);
71 Int_t nentries = fDigits->GetLast();
72 cout << "nentries = " << nentries << endl;
73 for (Int_t ient = 0; ient < nentries+1; ient++)
75 pmddigit = (AliPMDdigit*)fDigits->UncheckedAt(ient);
77 det = pmddigit->GetDetector();
78 smn = pmddigit->GetSMNumber();
79 xpos = pmddigit->GetRow();
80 ypos = pmddigit->GetColumn();
81 adc = pmddigit->GetADC();
82 Int_t trno = pmddigit->GetTrackNumber();
88 else if(smn >=12 && smn < 24)
96 cc.RectGeomCellPos(smn,xpad,ypad,xx,yy);