1 #if !defined( __CINT__) || defined(__MAKECINT__)
5 #include <AliRunLoader.h>
8 #include "AliRICHDisplFast.h"
11 //globals for easy manual manipulations
12 AliRun *a; AliStack *s; AliRunLoader *al;
13 AliRICH *r; AliLoader *rl;
16 //__________________________________________________________________________________________________
20 al->LoadHeader(); al->LoadKinematics();
22 if(tid<0||tid>=al->Stack()->GetNtrack())
23 cout<<"Valid tid number is 0-"<<al->Stack()->GetNtrack()-1<<" for this event.\n";
25 PrintParticleInfo(tid);
27 al->UnloadKinematics(); al->UnloadHeader();
29 //__________________________________________________________________________________________________
30 void PrintParticleInfo(int tid)
32 // Prints particle info for a given TID
33 TParticle *p=al->Stack()->Particle(tid);
34 cout<<p->GetName()<<"("<<tid<<")";
35 if(!p->IsPrimary()){cout<<" from "; PrintParticleInfo(p->GetFirstMother());}
38 //__________________________________________________________________________________________________
39 Int_t mother(Int_t tid)
41 // Who is the mother of given track TID?
42 al->LoadHeader(); al->LoadKinematics();
44 if(tid<0||tid>=al->Stack()->GetNtrack())
45 cout<<"Valid tid number is 0-"<<al->Stack()->GetNtrack()-1<<" for this event.\n";
48 TParticle *p=al->Stack()->Particle(tid);
49 if(p->IsPrimary()) break;
50 tid=p->GetFirstMother();
53 al->UnloadKinematics(); al->UnloadHeader();
56 //__________________________________________________________________________________________________
60 Info("ReadAlice","Tring to read ALICE from SIMULATED FILE...");
62 delete gAlice->GetRunLoader();
66 if(gSystem->Exec("ls galice.root>/dev/null")==256){//there is no galice.root in current directory
69 return kFALSE; //new session
71 if(!(al=AliRunLoader::Open())){//if not possible to read from galice.root, then remove grabage and reinvoke AliceRead()
72 gSystem->Exec("rm -rf *.root *.dat");
75 al->LoadgAlice();//before this gAlice is 0;
76 if(!gAlice) Fatal("menu.C::ReadAlice","No gAlice in file");
77 a=al->GetAliRun();//provides pointer to AliRun object
78 Info("AliceRead","Run contains %i event(s)",a->GetEventsPerRun());
80 return kTRUE; //old session opened from file
83 //__________________________________________________________________________________________________
86 Info("AliceNew","Init new session");
87 new AliRun("gAlice","Alice experiment system"); gAlice->Init(); a=gAlice; al=gAlice->GetRunLoader();
89 //__________________________________________________________________________________________________
92 if(!(r=r())) Warning("RICH/menu.C::ReadAlice","No RICH in file");
93 if(!(rl=rl())) Warning("RICH/menu.C::ReadAlice","No RICH loader in file");
96 //__________________________________________________________________________________________________
99 TControlBar *pMenu = new TControlBar("vertical","RICH");
102 //__________________________________________________________________________________________________
105 TControlBar *pMenu = new TControlBar("vertical","MAIN");
107 if(AliceRead()){//it's from file, show some info
108 pMenu->AddButton("Display single chambers" ,"r->Display();" , "Display Fast");
109 pMenu->AddButton("Display ALL chambers" ,"r->DisplayEvent(0,0);" , "Display Fast");
110 pMenu->AddButton("Hits QA" ,"hqa()" ,"QA plots for hits: hqa()");
111 pMenu->AddButton("Recon with stack" ,"AliRICHReconstructor::CheckPR( )","Create RSR.root with ntuple hn");
112 pMenu->AddButton("RichAna no Recon" ,"AliRICHReconstructor::RichAna(0,0,kFALSE)","Create RichAna.root with ntuple hn without PatRec");
113 pMenu->AddButton("RichAna with Recon" ,"AliRICHReconstructor::RichAna(0,0,kTRUE )","Create RichAna.root with ntuple hn with PatRec");
114 pMenu->AddButton("Print hits" ,"h();" ,"To print hits: h()");
115 pMenu->AddButton("Print sdigits" ,"s();" ,"To print sdigits: s()");
116 pMenu->AddButton("Print digits" ,"d();" ,"To print digits: d()");
117 pMenu->AddButton("Print clusters" ,"c();" ,"To print clusters: c()");
118 pMenu->AddButton("Print occupancy" ,"r->OccupancyPrint(-1);" ,"To print occupancy");
119 pMenu->AddButton("Print event summary " ,"r->SummaryOfEvent();" ,"To print a summary of the event");
120 }else{//it's aliroot, simulate
121 pMenu->AddButton("Debug ON", "DebugON();", "Switch debug on-off");
122 pMenu->AddButton("Debug OFF", "DebugOFF();", "Switch debug on-off");
123 pMenu->AddButton("Run", "a()->Run(1)", "Process!");
125 pMenu->AddButton("Test segmentation" ,"rp->TestSeg()" ,"Test AliRICHParam segmentation methods" );
126 pMenu->AddButton("Test response" ,"rp->TestResp()" ,"Test AliRICHParam response methods" );
127 pMenu->AddButton("Test transformation","rp->TestTrans()","Test AliRICHParam transformation methods" );
128 pMenu->AddButton("Optics" ,"opt()" ,"Shows optical properties");
129 pMenu->AddButton("Geo GUI" ,"geo();" ,"Shows geometry" );
130 pMenu->AddButton("Debug ON" ,"AliLog::SetGlobalDebugLevel(AliLog::kDebug);" ,"Switch debug on" );
131 pMenu->AddButton("Debug OFF" ,"AliLog::SetGlobalDebugLevel(0);" ,"Switch debug off" );
132 pMenu->AddButton("Browser" ,"new TBrowser;" ,"Start ROOT TBrowser" );
133 pMenu->AddButton("Quit" ,".q" ,"Close session" );
136 //__________________________________________________________________________________________________
137 void DebugOFF(){ Info("DebugOFF",""); AliLog::SetGlobalDebugLevel(0);}
138 void DebugON() { Info("DebugON",""); AliLog::SetGlobalDebugLevel(AliLog::kDebug);}
139 //__________________________________________________________________________________________________
143 gGeoManager->GetTopVolume()->Draw();
144 AliRICHParam::DrawAxis();
149 AliRun *a() {return al->GetAliRun();} //provides pointer to main AliRun object (aka gAlice)
150 AliRICH *r() {return (AliRICH*) a()->GetDetector("RICH");} //provides pointer to RICH detector
151 AliLoader *rl(){return al->GetLoader("RICHLoader");}
154 void geo ( ) { gGeoManager->SetVisOption(0);gGeoManager->GetTopVolume()->Draw(); AliRICHParam::DrawAxis();}
155 void opt ( ) { AliRICHParam::Materials(); } //draw optical properties
156 void dis (Int_t evt=-1) {r->Display (evt);} //utility display
157 void dum ( ) {r->Dump ( );} //utility display
159 void h (Int_t evt=0 ) {r->HitsPrint (evt);} //print hits for requested event
160 void s (Int_t evt=0 ) {r->SDigitsPrint (evt);} //print sdigits for requested event
161 void d (Int_t evt=0 ) {r->DigitsPrint (evt);} //print digits for requested event
162 void c (Int_t evt=0 ) {r->ClustersPrint(evt);} //print clusters for requested event
164 void hqa ( ) {r->HitsQA ( );} //hits QA plots for all events
165 void dqa ( ) {r->DigitsQA ( );} //digits QA plots for all events
166 void cqa ( ) {r->ClustersQA ( );} //clusters QA plots for all events
169 Int_t t (Int_t pid,Int_t evt=0) {return (AliRICH*)v())->TrackPrint(pid,evt);} //print track
171 void rt(Int_t event=0) {r->PrintTracks (event);} //utility print tracks
172 Int_t nem(Int_t event=0) {AliRICH::Nparticles(kElectron ,event,al);} //utility number of electrons
173 Int_t nep(Int_t event=0) {AliRICH::Nparticles(kPositron ,event,al);} //utility number of positrons
174 Int_t nmup(Int_t event=0) {AliRICH::Nparticles(kMuonPlus ,event,al);} //utility number of positive muons
175 Int_t nmum(Int_t event=0) {AliRICH::Nparticles(kMuonMinus ,event,al);} //utility number of negative muons
176 Int_t npi0(Int_t event=0) {AliRICH::Nparticles(kPi0 ,event,al);} //utility number of neutral pions
177 Int_t npip(Int_t event=0) {AliRICH::Nparticles(kPiPlus ,event,al);} //utility number of positive pions
178 Int_t npim(Int_t event=0) {AliRICH::Nparticles(kPiMinus ,event,al);} //utility number of negative pions
179 Int_t nk0(Int_t event=0) {AliRICH::Nparticles(kK0 ,event,al);} //utility number of neutral kaons
180 Int_t nkp(Int_t event=0) {AliRICH::Nparticles(kKPlus ,event,al);} //utility number of positive kaons
181 Int_t nkm(Int_t event=0) {AliRICH::Nparticles(kKMinus ,event,al);} //utility number of negative kaons
182 Int_t npp(Int_t event=0) {AliRICH::Nparticles(kProton ,event,al);} //utility number of protons
183 Int_t npm(Int_t event=0) {AliRICH::Nparticles(kProtonBar ,event,al);} //utility number of antiprotons