1 // ----------------------------------------------------//
3 // This is a macro to read PMD.SDigits.root //
5 // ----------------------------------------------------//
7 void AliPMDSDigitsRead(Int_t nevt = 1)
13 TH2F *h2 = new TH2F("h2","Y vs. X",200,-100.,100.,200,-100.,100.);
14 AliRunLoader *fRunLoader = AliRunLoader::Open("galice.root");
17 Error("Open","Can not open session for file %s.",file);
20 // fRunLoader->LoadgAlice();
21 fRunLoader->LoadHeader();
22 gAlice = fRunLoader->GetAliRun();
26 printf("AliRun object found on file.\n");
30 printf("Could not find AliRun object.\n");
32 fPMD = (AliPMD*)gAlice->GetDetector("PMD");
33 fPMDLoader = fRunLoader->GetLoader("PMDLoader");
34 if (fPMDLoader == 0x0)
36 cerr<<"OpengAlice : Can not find PMD or PMDLoader\n";
39 fPMDLoader->LoadSDigits("READ");
40 TClonesArray *fSDigits;
42 // -------------------------------------------------------------- //
44 Int_t det = 0,smn = 0;
52 for (Int_t ievt = 0; ievt <nevt; ievt++)
54 fRunLoader->GetEvent(ievt);
55 fTreeS = fPMDLoader->TreeS();
58 cout << " Can not get TreeD" << endl;
60 AliPMDsdigit *pmdsdigit;
61 TBranch *branch = fTreeS->GetBranch("PMDSDigit");
62 branch->SetAddress(&fSDigits);
64 Int_t nmodules = (Int_t) fTreeS->GetEntries();
66 for (Int_t imodule = 0; imodule < nmodules; imodule++)
68 fTreeS->GetEntry(imodule);
69 Int_t nentries = fSDigits->GetLast();
70 for (Int_t ient = 0; ient < nentries+1; ient++)
72 pmdsdigit = (AliPMDsdigit*)fSDigits->UncheckedAt(ient);
74 det = pmdsdigit->GetDetector();
75 smn = pmdsdigit->GetSMNumber();
76 xpos = pmdsdigit->GetRow();
77 ypos = pmdsdigit->GetColumn();
78 edep = pmdsdigit->GetCellEdep();
79 Int_t trno = pmdsdigit->GetTrackNumber();
86 else if(smn >=12 && smn < 24)
94 cc.RectGeomCellPos(smn,xpad,ypad,xx,yy);