]>
Commit | Line | Data |
---|---|---|
6ca65f6a | 1 | #include "iostream.h" |
2 | #include "TFile.h" | |
3 | #include "TString.h" | |
4 | #include "TClonesArray.h" | |
5 | /* | |
6 | #include "$(ALICE_ROOT)/STEER/AliRun.h" | |
7 | #include "$(ALICE_ROOT)/ITS/AliITS.h" | |
8 | #include "$(ALICE_ROOT)/ITS/AliITSgeom.h" | |
9 | #include "$(ALICE_ROOT)/ITS/AliITSpList.h" | |
10 | */ | |
11 | void AliITSPrintSDigits(TString rfn="galice.root",Int_t mod=-1, | |
12 | Int_t evnt=-1){ | |
13 | // Macro to print out the recpoints for all or a specific module | |
14 | ||
15 | // Dynamically link some shared libs | |
16 | if (gClassTable->GetID("AliRun") < 0) { | |
17 | gROOT->LoadMacro("loadlibs.C"); | |
18 | loadlibs(); | |
19 | } // end if | |
20 | gROOT->LoadMacro("$(ALICE_ROOT)/ITS/AliITSstandard.C"); | |
21 | ||
22 | TFile *rf=0; | |
23 | rf = AccessFile(rfn,"R"); // Set up to read in Data | |
24 | AliITS *ITS = (AliITS*)gAlice->GetDetector("ITS"); | |
25 | if(!ITS){ | |
26 | cout << "Error: no ITS found. Aborting"<<endl; | |
27 | return; | |
28 | } // end if !ITS | |
29 | ||
30 | Int_t evNumber1 = 0; | |
31 | Int_t evNumber2 = gAlice->GetEventsPerRun(); | |
32 | if(evnt>=0){ | |
33 | evNumber1 = evnt; | |
34 | evNumber2 = evnt+1; | |
35 | } // end if evnt>=0 | |
36 | Int_t mod1 = 0; | |
37 | Int_t mod2 = ITS->GetITSgeom()->GetIndexMax(); | |
38 | if(mod>=0){ | |
39 | mod1 = mod; | |
40 | mod2 = mode+1; | |
41 | } // end if mod>=0 | |
42 | TClonesArray *sdpa = ITS->GetSDigits(); | |
43 | AliITSpListItem *sdp = 0; | |
44 | ||
45 | Int_t event,m,i,i2; | |
46 | for(event = evNumber1; event < evNumber2; event++){ | |
47 | gAlice->GetEvent(event); | |
48 | for(m=mod1;m<mod2;m++){ | |
49 | ITS->ResetSDigits(); | |
50 | gAlice->TreeS()->GetEvent(m); | |
51 | i2 = sdpa->GetEntriesFast(); | |
52 | cout << "Event=" << event << " module=" << m << | |
53 | " Number of SDigits=" << i2 <<endl; | |
54 | for(i=0;i<i2;i++){ | |
55 | sdp = (AliITSpListItem*)(sdpa->At(i)); | |
56 | cout << i << " "; | |
57 | sdp->Print((ostream*)cout); | |
58 | cout << endl; | |
59 | } // end for i | |
60 | } // end for m | |
61 | } // end for event | |
62 | ||
63 | } |