1 void AliITSPrintHits(Int_t track, Int_t hit=-1, Int_t evNumber=0
2 ,const char *filename="galice.root"){
4 This macro will print the a specific hit or all of the hits from a give
11 // Dynamically link some shared libs
12 if(gClassTable->GetID("AliRun") < 0) {
13 gROOT->LoadMacro("loadlibs.C");
17 // Connect the Root Galice file containing Geometry, Kine and Hits
18 TFile *file = (TFile*)gROOT->GetListOfFiles()->FindObject(filename);
19 if(!file) file = new TFile(filename);
21 // Get AliRun object from file or create it if not on file
23 gAlice = (AliRun*)file->Get("gAlice");
24 if(gAlice) printf("AliRun object found on file\n");
25 if(!gAlice) gAlice = new AliRun("gAlice","Alice test program");
28 // Set event pointer to this event
29 Int_t nparticles = gAlice->GetEvent(evNumber);
31 cout << "No particles found for event " << evNumber;
32 cout << " in file " << filename << endl;
34 } // end if nparticles <=0
35 // Pointer to specific detector hits.
37 // Get pointers to ALL Alice detectors and Hits containers
38 AliITS *ITS = (AliITS*) gAlice->GetDetector("ITS");
39 Int_t t,h,ntracks = gAlice->TreeH()->GetEntries();
40 // Start loop on tracks in the hits containers
41 for(t=0; t<ntracks;t++){
43 gAlice->TreeH()->GetEvent(t);
45 for(itsHit=(AliITShit*)ITS->FirstHit(-1);itsHit;
46 itsHit=(AliITShit*)ITS->NextHit()){
47 if((track==itsHit->GetTrack())&&(h==hit||hit<0)){
49 itsHit->Print((ostream*)cout);