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,*vl;
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");
100 pMenu->AddButton("Display single chambers" ,"r->Display();" , "Display Fast");
101 pMenu->AddButton("Display ALL chambers" ,"r->DisplayEvent(0,0);" , "Display Fast");
102 pMenu->AddButton("Print hits" ,"r->HitsPrint();" ,"????");
103 pMenu->AddButton("Print sdigits" ,"r->SDigitsPrint();" ,"????");
104 pMenu->AddButton("Print digits" ,"r->DigitsPrint();" ,"????");
105 pMenu->AddButton("Print clusters" ,"r->ClustersPrint();" ,"????");
106 pMenu->AddButton("Print occupancy" ,"r->OccupancyPrint();" ,"????");
107 pMenu->AddButton("Hits plots" ,"r->ControlPlots()" ,"????");
108 pMenu->AddButton("Recon with stack" ,"r->CheckPR()" , "Create RSR.root with ntuple hn");
111 //__________________________________________________________________________________________________
114 TControlBar *pMenu = new TControlBar("vertical","MAIN");
116 if(AliceRead()){//it's from file, show some info
117 if(r) pMenu->AddButton("RICH submenu" , "MenuRich()" , "Show RICH submenu" );
118 }else{//it's aliroot, simulate
119 pMenu->AddButton("Debug ON", "DebugON();", "Switch debug on-off");
120 pMenu->AddButton("Debug OFF", "DebugOFF();", "Switch debug on-off");
121 pMenu->AddButton("Run", "a()->Run(1)", "Process!");
123 pMenu->AddButton("Test segmentation" ,"rp->TestSeg()" ,"Test AliRICHParam segmentation methods" );
124 pMenu->AddButton("Test response" ,"rp->TestResp()" ,"Test AliRICHParam response methods" );
125 pMenu->AddButton("Test transformation","rp->TestTrans()","Test AliRICHParam transformation methods" );
126 pMenu->AddButton("Test opticals" ,".x Opticals.h" ,"Test optical properties" );
127 pMenu->AddButton("Geo GUI" ,"GeomGui()" ,"Shows geometry" );
128 pMenu->AddButton("Browser" ,"new TBrowser;" ,"Start ROOT TBrowser" );
129 pMenu->AddButton("Quit" ,".q" ,"Close session" );
132 //__________________________________________________________________________________________________
133 void DebugOFF(){ Info("DebugOFF",""); AliLog::SetGlobalDebugLevel(0);}
134 void DebugON() { Info("DebugON",""); AliLog::SetGlobalDebugLevel(AliLog::kDebug);}
135 //__________________________________________________________________________________________________
139 gGeoManager->GetTopVolume()->Draw();
140 AliRICHParam::DrawAxis();
145 AliRun *a() {return al->GetAliRun();} //provides pointer to main AliRun object (aka gAlice)
146 AliRICH *r() {return (AliRICH*) a()->GetDetector("RICH");} //provides pointer to RICH detector
147 AliLoader *rl(){return al->GetLoader("RICHLoader");}
149 void rt(Int_t event=0) {r->PrintTracks (event);} //utility print tracks
150 Int_t nem(Int_t event=0) {AliRICH::Nparticles(kElectron ,event,al);} //utility number of electrons
151 Int_t nep(Int_t event=0) {AliRICH::Nparticles(kPositron ,event,al);} //utility number of positrons
152 Int_t nmup(Int_t event=0) {AliRICH::Nparticles(kMuonPlus ,event,al);} //utility number of positive muons
153 Int_t nmum(Int_t event=0) {AliRICH::Nparticles(kMuonMinus ,event,al);} //utility number of negative muons
154 Int_t npi0(Int_t event=0) {AliRICH::Nparticles(kPi0 ,event,al);} //utility number of neutral pions
155 Int_t npip(Int_t event=0) {AliRICH::Nparticles(kPiPlus ,event,al);} //utility number of positive pions
156 Int_t npim(Int_t event=0) {AliRICH::Nparticles(kPiMinus ,event,al);} //utility number of negative pions
157 Int_t nk0(Int_t event=0) {AliRICH::Nparticles(kK0 ,event,al);} //utility number of neutral kaons
158 Int_t nkp(Int_t event=0) {AliRICH::Nparticles(kKPlus ,event,al);} //utility number of positive kaons
159 Int_t nkm(Int_t event=0) {AliRICH::Nparticles(kKMinus ,event,al);} //utility number of negative kaons
160 Int_t npp(Int_t event=0) {AliRICH::Nparticles(kProton ,event,al);} //utility number of protons
161 Int_t npm(Int_t event=0) {AliRICH::Nparticles(kProtonBar ,event,al);} //utility number of antiprotons