1 void AliITSPrintRecPoints(Int_t outtype=1,TString rfn="galice.root",
2 Int_t mod=-1,Int_t evnt=-1){
3 // Macro to print out the recpoints for all or a specific module
5 // Dynamically link some shared libs
6 if (gClassTable->GetID("AliRun") < 0) {
7 gROOT->LoadMacro("loadlibs.C");
12 delete gAlice->GetRunLoader();
18 gROOT->LoadMacro("$(ALICE_ROOT)/ITS/AliITSstandard.C");
20 AliRunLoader *rl = AccessFile(rfn); // Set up to read in Data
21 Int_t retval = rl->LoadHeader();
23 cerr<<"AliITSPrintRecPoints.C : LoadHeader returned error"<<endl;
27 AliITSLoader* ITSloader = (AliITSLoader*) rl->GetLoader("ITSLoader");
30 cerr<<"AliITSPrintRecPoints.C : ITS loader not found"<<endl;
33 cout <<"ITSloader ok"<<endl;
36 gGeoManger = new TGeoManager();
37 gGeoManager->Import("geometry.root","");
39 ITSloader->LoadHits("read");
40 ITSloader->LoadDigits("read");
41 ITSloader->LoadRecPoints("read");
42 cout << "loaded hits, digits, and RecPoints"<< endl;
44 ITS = (AliITS*)(gAlice->GetDetector("ITS"));
46 cout << "Error: no ITS found. Aborting"<<endl;
49 cout <<"ITS="<<ITS<<endl;
50 if(!(ITS->GetDetTypeSim())){
51 cout <<"No AliITSDetTypeSim object found in ITS"<<endl;
55 gm = ITS->GetITSgeom();
57 cout <<"No AliITSgeom object found in ITS"<<endl;
59 cout <<"No gGeoManger. Aborting"<<endl;
62 ITS->UpdateInternalGeometry(gGeoManager);
64 } // end if !AliITSgeom
67 Int_t evNumber2 = gAlice->GetEventsPerRun();
73 Int_t mod2 = gm->GetIndexMax();
79 AliITSRecPoint *rp = 0;
80 AliITSDetTypeRec* rec = new AliITSDetTypeRec(ITSloader);
81 //rec->SetITSgeom(gm);
86 for(event = evNumber1; event < evNumber2; event++){
88 rec->SetTreeAddress();
89 for(m=mod1;m<mod2;m++){
90 rec->ResetRecPoints();
91 TTree *TR = ITSloader->TreeR();
93 rpa = rec->RecPoints();
94 i2 = rpa->GetEntriesFast();
95 cout << "Event=" << event << " module=" << m <<
96 " Number of Recpoints=" << i2 <<endl;
98 rp = (AliITSRecPoint*)(rpa->At(i));
101 rp->GetGlobalXYZ(xyz);
102 cout << i << " lx=" << rp->GetDetLocalX()
103 << " lz=" << rp->GetDetLocalZ()
104 << " x=" << rp->GetX()
105 << " y=" << rp->GetY()<< " z=" << rp->GetZ()
106 <<" gx=" << xyz[0] << " gy="<< xyz[1] <<" gz="<<xyz[2]
111 rp->Print((ostream*)cout);