1 // ----------------------------------------------------//
3 // This is a macro to read PMD.SDigits.root //
5 // ----------------------------------------------------//
8 void AliPMDSDigitsRead(Int_t nevt = 1)
13 //FILE *fpw = fopen("sdigits.dat","w");
15 TH2F *h2 = new TH2F("h2","Y vs. X",200,-100.,100.,200,-100.,100.);
17 AliRunLoader *fRunLoader = AliRunLoader::Open("galice.root");
21 Error("Open","Can not open session for file %s.",file);
25 Int_t nEvent = fRunLoader->GetNumberOfEvents();
27 fPMDLoader = fRunLoader->GetLoader("PMDLoader");
29 if (fPMDLoader == 0x0)
31 cerr<<"OpengAlice : Can not find PMD or PMDLoader\n";
34 fPMDLoader->LoadSDigits("READ");
35 TClonesArray *fSDigits = 0x0;
37 // -------------------------------------------------------------- //
39 Int_t det = 0,smn = 0;
48 AliPMDsdigit *pmdsdigit = 0x0;
54 printf("Input number is more than the number of events, set to number of events = %d\n",nevt);
57 for (Int_t ievt = 0; ievt <nevt; ievt++)
59 fRunLoader->GetEvent(ievt);
60 fTreeS = fPMDLoader->TreeS();
63 cout << " Can not get TreeD" << endl;
66 branch = fTreeS->GetBranch("PMDSDigit");
67 branch->SetAddress(&fSDigits);
69 Int_t nmodules = (Int_t) fTreeS->GetEntries();
71 for (Int_t imodule = 0; imodule < nmodules; imodule++)
73 fTreeS->GetEntry(imodule);
74 Int_t nentries = fSDigits->GetLast();
75 for (Int_t ient = 0; ient < nentries+1; ient++)
77 pmdsdigit = (AliPMDsdigit*)fSDigits->UncheckedAt(ient);
79 det = pmdsdigit->GetDetector();
80 smn = pmdsdigit->GetSMNumber();
81 xpos = pmdsdigit->GetRow();
82 ypos = pmdsdigit->GetColumn();
83 edep = pmdsdigit->GetCellEdep();
84 Int_t trno = pmdsdigit->GetTrackNumber();
86 //if (ievt == 0) fprintf(fpw,"Track # = %d\n",trno);
93 else if(smn >=12 && smn < 24)
101 cc.RectGeomCellPos(smn,xpad,ypad,xx,yy);