]> git.uio.no Git - u/mrichter/AliRoot.git/blame - ITS/AliITSPrintGeom.C
A bug concerning the calculation of the track length and time-of-flight hypotheses...
[u/mrichter/AliRoot.git] / ITS / AliITSPrintGeom.C
CommitLineData
7f7b1c24 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/AliITSHit.h"
10*/
11void AliITSPrintGeom(TString hfn="galice.root",Int_t mod=-1){
12 // Macro to print out the information kept in the AliITSgeom class, for
13 //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
21 TFile *hf = (TFile*)gROOT->GetListOfFiles()->FindObject(hfn);
22 if(hf) {
23 hf->Close();
24 delete hf;
25 hf = 0;
26 } // end if file
27 hf = new TFile(hfn,"READ");
28 // Get AliRun object from file or return if not on file
29 if (gAlice) {delete gAlice; gAlice = 0;}
30 gAlice = (AliRun*)hf->Get("gAlice");
31 if (!gAlice) {
32 cerr << "AliRun object not found on file "<< FileName << "!" << endl;
33 file->Close(); // close file and return error.
34 return;
35 } // end if !gAlice
36
37/*
38 gROOT->LoadMacro("$(ALICE_ROOT)/ITS/AliITSstandard.C");
39 TFile *hf=0;
40 hf = AccessFile(hfn,"R"); // Set up to read in Data
41*/
42 AliITS *ITS = (AliITS*)gAlice->GetDetector("ITS");
43 if(!ITS){
44 cout << "Error: no ITS found. Aborting"<<endl;
45 return;
46 } // end if !ITS
47 AliITSgeom *gm = ITS->GetITSgeom();
48 Int_t mod1 = 0;
49 Int_t mod2 = gm->GetIndexMax();
50 if(mod>=0){
51 mod1 = mod;
52 mod2 = mode+1;
53 } // end if mod>=0
54 AliITSgeomMatrix *gmm = gm->GetGeomMatrix(0);
55 Int_t m;
56 gmm->PrintComment(&cout); cout << endl;
57 for(m=mod1;m<mod2;m++){
58 gmm = gm->GetGeomMatrix(m);
59 gmm->Print(&cout); cout << endl;
60 } // end for m
61}