1 #if !defined(__CINT__) || defined(__MAKECINT__)
4 #include<TClassTable.h>
5 #include<TClonesArray.h>
6 #include<TGeoManager.h>
7 #include <TInterpreter.h>
10 #include "AliITSgeom.h"
11 #include "AliGeomManager.h"
12 #include "AliITSDetTypeRec.h"
13 #include "AliITSRecPoint.h"
14 #include "AliITSdigit.h"
15 #include "AliITSdigitSSD.h"
16 #include "AliITShit.h"
17 #include "AliITSmodule.h"
18 #include "AliITSsegmentation.h"
19 #include "AliITSsegmentationSPD.h"
20 #include "AliITSsegmentationSDD.h"
21 #include "AliITSsegmentationSSD.h"
22 #include "AliRunLoader.h"
23 #include "AliITSLoader.h"
24 #include "AliHeader.h"
25 #include "AliCDBManager.h"
26 #include "AliCDBStorage.h"
28 void AliITSPrintRecPoints(Int_t outtype=1,TString rfn="galice.root",
29 Int_t mod=-1,Int_t evnt=-1){
30 // Macro to print out the recpoints for all or a specific module
32 // Dynamically link some shared libs
33 if (gClassTable->GetID("AliRun") < 0) {
34 gInterpreter->ExecuteMacro("loadlibs.C");
38 delete AliRunLoader::Instance();
45 AliCDBManager* man = AliCDBManager::Instance();
46 if (!man->IsDefaultStorageSet()) {
47 printf("Setting a local default storage and run number 0\n");
48 man->SetDefaultStorage("local://$ALICE_ROOT/OCDB");
52 printf("Using deafult storage \n");
55 AliRunLoader* rl = AliRunLoader::Open(rfn.Data());
57 cerr<<"AliITSPrintRecPoints.C : Can not open session RL=NULL"<< endl;
60 Int_t retval = rl->LoadgAlice();
62 cerr<<"AliITSPrintRecPoints.C : LoadgAlice returned error"<<endl;
65 gAlice=rl->GetAliRun();
67 retval = rl->LoadHeader();
69 cerr<<"AliITSPrintRecPoints.C : LoadHeader returned error"<<endl;
73 AliITSLoader* ITSloader = (AliITSLoader*) rl->GetLoader("ITSLoader");
76 cerr<<"AliITSPrintRecPoints.C : ITS loader not found"<<endl;
79 cout <<"ITSloader ok"<<endl;
82 AliGeomManager::LoadGeometry("geometry.root");
84 ITSloader->LoadHits("read");
85 ITSloader->LoadDigits("read");
86 ITSloader->LoadRecPoints("read");
87 cout << "loaded hits, digits, and RecPoints"<< endl;
90 gm = ITSloader->GetITSgeom();
93 Int_t evNumber2 = AliRunLoader::GetNumberOfEvents();
99 Int_t mod2 = gm->GetIndexMax();
105 AliITSRecPoint *rp = 0;
106 AliITSDetTypeRec* rec = new AliITSDetTypeRec();
112 for(event = evNumber1; event < evNumber2; event++){
114 // rec->SetTreeAddress();
115 for(m=mod1;m<mod2;m++){
116 rec->ResetRecPoints();
117 TTree *TR = ITSloader->TreeR();
118 rec->SetTreeAddressR(TR);
120 rpa = rec->RecPoints();
121 i2 = rpa->GetEntriesFast();
122 cout << "Event=" << event << " module=" << m <<
123 " Number of Recpoints=" << i2 <<endl;
125 rp = (AliITSRecPoint*)(rpa->At(i));
128 rp->GetGlobalXYZ(xyz);
129 cout << i << " lx=" << rp->GetDetLocalX()
130 << " lz=" << rp->GetDetLocalZ()
131 << " x=" << rp->GetX()
132 << " y=" << rp->GetY()<< " z=" << rp->GetZ()
133 <<" gx=" << xyz[0] << " gy="<< xyz[1] <<" gz="<<xyz[2]