3 //How to get number of events:
4 Info("RICH/menu.C::Show","3 ways to get number of events 1=%i 2=%f 3=%f",
5 gAlice->GetEventsPerRun(),
6 al->TreeE()->GetEntries(),
7 gAlice->TreeE()->GetEntries());
9 for(Int_t iEventN=0;iEventN<gAlice->GetEventsPerRun();iEventN++){// loop on events
10 Int_t iNparticles=gAlice->GetEvent(iEventN);
11 Int_t iNtracks=rl->TreeH()->GetEntries();
12 Info("RICH/menu.C::Show","Event %i contains %i particles in total while %i are primary",
13 iEventN, iNparticles, iNtracks);
14 for(Int_t iTrackN=0;iTrackN<iNtracks;iTrackN++){ // loop on tracks
15 rl->TreeH()->GetEntry(iTrackN);
16 al->Stack()->Particle(iTrackN)->Print();
17 Info("RICH/menu.C::Show","track %i has %i hits",iTrackN,r->Hits()->GetEntries());
18 // for(AliRICHhit *pRichHit=(AliRICHhit*)gpRich->FirstHit(-1);pRichHit;pRichHit=(AliRICHhit*)gpRich->NextHit()){
20 // TVector3 armV3=pRICH->ToArm(mrsV3);
21 // cout<<"After\n";armV3.Dump();
22 // }//loop on hits of given track
27 void menu(Int_t iNevents=5)// How many events to generate.
29 Info("RICH/menu.C","%i event(s) are requested",iNevents);
31 TString runString="gAlice->Run("; runString=runString+iNevents+");";
33 TControlBar *pMenu = new TControlBar("vertical","RICH main");
35 pMenu->AddButton("Debug ON-OFF", "Debug();", "Switch debug on-off");
36 if(GetAlice()){//it's from file, reconstruct
37 pMenu->AddButton("Show","Show()","Shows the structure of events in files");
38 pMenu->AddButton("Hits2SDigits","r->Hits2SDigits()","Perform first phase converstion");
39 pMenu->AddButton("RingViewer","RingViewer()","Show rings with reconstructed info");
40 }else{//it's aliroot, simulate
41 pMenu->AddButton("Run", runString.Data(), "Process!");
43 pMenu->AddButton("Geo", "Geo()", "Geomentry submenu");
44 pMenu->AddButton("Browser", "new TBrowser;", "Start ROOT TBrowser");
45 pMenu->AddButton("Quit", ".q", "Close session");
47 a=gAlice;//for manual manipulation convinience
48 }//void menu(Int_t iNevents)
53 if(gAlice->GetDebug()){
54 Info("RICH/menu.C::Debug","OFF");
58 AliLoader::SetDebug(0);
60 Info("RICH/menu.C::Debug","ON");
64 AliLoader::SetDebug(1);
70 AliLoader *rl,*tl,*il;
79 if(gAlice){//it's aliroot
80 Info("RICH/menu.C::GetAlice","gAlice!=NULL, IT'S ALIROOT, EXECUTE Init()");
81 gAlice->Init("~/my/AliceConfig.C");
82 r=(AliRICH*)gAlice->GetDetector("RICH");
83 t=(AliTPC*)gAlice->GetDetector("TPC");
84 i=(AliITS*)gAlice->GetDetector("ITS");
85 p=(AliPHOS*)gAlice->GetDetector("PHOS");
87 }else{//it's root with ALICE libs loaded
88 Info("RICH/menu.C::GetAlice","gAlice=0, GETTING IT FROM SIMULATED FILE.");
90 if(!(al=AliRunLoader::Open("galice.root","AlicE","update"))) Fatal("RICH/menu.C::GetAlice","Can't get AliRunLoader");
92 if(!gAlice) Fatal("RICH/menu.C::GetAlice","No gAlice in file");
94 al->LoadHeader();//loads events tree
95 al->LoadKinematics();//loads the primaries info
97 if(!(r=(AliRICH*)gAlice->GetDetector("RICH"))) Warning("RICH/menu.C::GetAlice","No RICH in file");
98 if(!(rl=al->GetLoader("RICHLoader"))) Warning("RICH/menu.C::GetAlice","No RICH loader in file");
100 if(!(t=(AliTPC*)gAlice->GetDetector("TPC"))) Warning("RICH/menu.C::GetAlice","No TPC in file");
101 if(!(tl=al->GetLoader("TPCLoader"))) Warning("RICH/menu.C::GetAlice","No TPC loader in file");
103 Info("RICH/menu.C::GetAlice","Run contains %i event(s)",gAlice->GetEventsPerRun());
110 gStyle->SetPalette(1);
111 TCanvas *view=new TCanvas("Display","ALICE RICH Display",0,0,1200,750);
113 TH2F *pH2=new TH2F("pH2F","RICH DISPLAY",160,0,160,144,0,144);
115 pH2->SetMaximum(100);
117 Int_t Nevents = gAlice->GetEventsPerRun();
120 //______________________________________________________________________________
123 TControlBar *pMenu = new TControlBar("vertical","RICH draw");
124 pMenu->AddButton("Draw Front", "gMC->Gdraw(\"ALIC\", 0,0,0, 10,10, 0.01,0.01)","Draws ALIC volume in XY view");
125 pMenu->AddButton("Draw Side", "gMC->Gdraw(\"ALIC\",90,180, 0, 10,10, 0.01,0.01)","Draws ALIC volume in YZ view");
126 pMenu->AddButton("Draw Top", "gMC->Gdraw(\"ALIC\",90, 90, 0, 10,10, 0.03,0.03)","Draws ALIC volume in XZ view");
127 pMenu->AddButton("ALICE Tree", "((TGeant3*)gMC)->Gdtree(\"ALIC\")","Draws ALICE tree");
128 pMenu->AddButton("RICH Tree", "((TGeant3*)gMC)->Gdtree(\"RICH\")","Draws RICH tree");
129 pMenu->AddButton("Geo test", "GeoTest()", "Draw RICH geo as a macro");
130 pMenu->AddButton("Print ref", "PrintGeo()", "Print RICH chambers default position");
131 pMenu->AddButton("Print act", "r->Print();", "Print RICH chambers default position");
138 TBRIK *pAliceBRIK=new TBRIK("aliceBRIK","ALICE mother volume","void",500,500,500);
139 TBRIK *pArmBRIK=new TBRIK("armBRIK","RICH arm1","void",pRICH->GetSizeX(),pRICH->GetSizeY(),pRICH->GetSizeZ());
141 TNode *pAliceNode=new TNode("aliceNode","Mother volume","aliceBRIK");
146 TVector3 v1(0,pRICH->GetOffset(),0);
149 rot1.RotateX(pRICH->GetYZAngle()*kDegrad); v1.RotateX(pRICH->GetYZAngle()*kDegrad);
150 rot1.RotateZ(pRICH->GetXYAngle()*kDegrad); v1.RotateZ(pRICH->GetXYAngle()*kDegrad);
151 rot1.RotateZ(pRICH->GetRotAngle()*kDegrad); v1.RotateZ(pRICH->GetRotAngle()*kDegrad);
153 TRotMatrix *pArm1RotMatrix=new TRotMatrix("rotArm1","rotArm1",rot1.ThetaX()*kRaddeg, rot1.PhiX()*kRaddeg,
154 rot1.ThetaY()*kRaddeg, rot1.PhiY()*kRaddeg,
155 rot1.ThetaZ()*kRaddeg, rot1.PhiZ()*kRaddeg);
157 TNode *pArm1Node=new TNode("arm1Node","Left arm","armBRIK",v1.X(),v1.Y(),v1.Z(),"rotArm1");
158 arm1Node->SetLineColor(kRed);
162 TVector3 v2(0,pRICH->GetOffset(),0);
165 rot2.RotateX(pRICH->GetYZAngle()*kDegrad); v2.RotateX(pRICH->GetYZAngle()*kDegrad);
166 rot2.RotateZ(-pRICH->GetXYAngle()*kDegrad); v2.RotateZ(-pRICH->GetXYAngle()*kDegrad);
167 rot2.RotateZ(pRICH->GetRotAngle()*kDegrad); v2.RotateZ(pRICH->GetRotAngle()*kDegrad);
169 TRotMatrix *pArm2RotMatrix=new TRotMatrix("rotArm2","rotArm2",rot2.ThetaX()*kRaddeg, rot2.PhiX()*kRaddeg,
170 rot2.ThetaY()*kRaddeg, rot2.PhiY()*kRaddeg,
171 rot2.ThetaZ()*kRaddeg, rot2.PhiZ()*kRaddeg);
173 TNode *pArm2Node=new TNode("arm2Node","Left arm","armBRIK",v2.X(),v2.Y(),v2.Z(),"rotArm2");
174 arm2Node->SetLineColor(kBlue);
178 //______________________________________________________________________________
179 void PrintGeo(Float_t rotDeg=0)
181 AliRICHParam *p=new AliRICHParam;
182 Double_t r=p->Offset();
183 Double_t kP=p->AngleXY();
184 Double_t kT=p->AngleYZ();
193 Double_t phi=90*deg+kRot,theta=90*deg-kT;
194 Info(" menu for 0","r=%8.3f theta=%5.1f phi=%5.1f x=%8.3f y=%8.3f z=%8.3f",
195 r, theta*r2d, phi*r2d,
196 r*sin(theta)*cos(phi),
197 r*sin(theta)*sin(phi),
200 phi=90*deg+kRot+kP,theta=90*deg;
201 Info(" menu for 1","r=%8.3f theta=%5.1f phi=%5.1f x=%8.3f y=%8.3f z=%8.3f",
202 r, theta*r2d, phi*r2d,
203 r*sin(theta)*cos(phi),
204 r*sin(theta)*sin(phi),
207 phi=90*deg+kRot,theta=90*deg;
208 Info(" menu for 2","r=%8.3f theta=%5.1f phi=%5.1f x=%8.3f y=%8.3f z=%8.3f",
209 r, theta*r2d, phi*r2d,
210 r*sin(theta)*cos(phi),
211 r*sin(theta)*sin(phi),
215 phi=90*deg+kRot-kP,theta=90*deg;
216 Info(" menu for 3","r=%8.3f theta=%5.1f phi=%5.1f x=%8.3f y=%8.3f z=%8.3f",
217 r, theta*r2d, phi*r2d,
218 r*sin(theta)*cos(phi),
219 r*sin(theta)*sin(phi),
223 phi=90*deg+kRot+kP,theta=90*deg+kT;
224 Info(" menu for 4","r=%8.3f theta=%5.1f phi=%5.1f x=%8.3f y=%8.3f z=%8.3f",
225 r, theta*r2d, phi*r2d,
226 r*sin(theta)*cos(phi),
227 r*sin(theta)*sin(phi),
231 phi=90*deg+kRot,theta=90*deg+kT;
232 Info(" menu for 5","r=%8.3f theta=%5.1f phi=%5.1f x=%8.3f y=%8.3f z=%8.3f",
233 r, theta*r2d, phi*r2d,
234 r*sin(theta)*cos(phi),
235 r*sin(theta)*sin(phi),
238 phi=90*deg+kRot-kP,theta=90*deg+kT;
239 Info(" menu for 6","r=%8.3f theta=%5.1f phi=%5.1f x=%8.3f y=%8.3f z=%8.3f",
240 r, theta*r2d, phi*r2d,
241 r*sin(theta)*cos(phi),
242 r*sin(theta)*sin(phi),