]> git.uio.no Git - u/mrichter/AliRoot.git/blame - RICH/menu.C
Removed
[u/mrichter/AliRoot.git] / RICH / menu.C
CommitLineData
543d5224 1void Digits2Recos()
c60862bf 2{
543d5224 3 AliRICHPatRec *detect = new AliRICHPatRec("RICH patrec algorithm","Reconstruction");
4
5
6 for (int nev=0; nev<= a->GetEventsPerRun(); nev++) { // Event Loop
7 al->GetEvent(nev);
8 cout <<endl<< "Processing event:" <<nev<<endl;
9 detect->PatRec();
10 } // event loop
11}
12
13
14
15void Hits2Digits()
16{
17 TStopwatch sw;TDatime time;
18 r->Hits2SDigits();r->SDigits2Digits();
19 cout<<"\nInfo in <hits->digits>: Start time: ";time.Print();
20 cout<<"Info in <hits->digits>: Stop time: ";time.Set(); time.Print();
21 cout<<"Info in <hits->digits>: Time used: ";sw.Print();
22}
23
24void DigitsOLD2RawClustersOLD()
25{
26 AliRICHClusterFinder *z=new AliRICHClusterFinder(r);
27 z->Exec();
28}
29
30void Specials2DigitsOLD()
31{
32 Info("OLDspec2d","Start.");
c60862bf 33
543d5224 34// delete gAlice;
c60862bf 35
36 AliRunDigitizer *pManager = new AliRunDigitizer(1,1);
543d5224 37 pManager->SetDebug(10);
c60862bf 38 pManager->SetInputStream(0,"galice.root");
39 new AliRICHDigitizer(pManager);
40 pManager->Exec("deb");
543d5224 41 delete pManager;
42 Info("OLDspec2d","Stop.");
c60862bf 43}
44
543d5224 45void Specials2Sdigits()
c60862bf 46{
543d5224 47 Info("Specials2Sdigits","Start.");
c60862bf 48
543d5224 49 rl->LoadHits();
c60862bf 50
51 for(Int_t iEventN=0;iEventN<a->GetEventsPerRun();iEventN++){//events loop
52 al->GetEvent(iEventN);
c60862bf 53
543d5224 54 rl->MakeTree("S"); r->MakeBranch("S");
55 r->ResetSdigits(); r->ResetSpecialsOld();
56
c60862bf 57 for(Int_t iPrimN=0;iPrimN<rl->TreeH()->GetEntries();iPrimN++){//prims loop
58 rl->TreeH()->GetEntry(iPrimN);
59 for(Int_t i=0;i<r->Specials()->GetEntries();i++){//specials loop
60 Int_t padx= ((AliRICHSDigit*)r->Specials()->At(i))->PadX();
61 Int_t pady= ((AliRICHSDigit*)r->Specials()->At(i))->PadY();
62 Int_t qdc= ((AliRICHSDigit*)r->Specials()->At(i))->QPad();
543d5224 63 Int_t hitN= ((AliRICHSDigit*)r->Specials()->At(i))->HitNumber()-1;//!!! important -1
64 Int_t chamber=((AliRICHhit*)r->Hits()->At(hitN))->C();
65 Int_t track=((AliRICHhit*)r->Hits()->At(hitN))->GetTrack();
66 r->AddSdigit(chamber,padx+r->Param()->NpadsX()/2,pady+r->Param()->NpadsY()/2,qdc,track);
c60862bf 67 }//specials loop
68 }//prims loop
69 rl->TreeS()->Fill();
70 rl->WriteSDigits("OVERWRITE");
c60862bf 71 }//events loop
72 rl->UnloadHits(); rl->UnloadSDigits();
543d5224 73 Info("Specials2Sdigits","Stop.");
74}//Specials2Sdigits()
75//__________________________________________________________________________________________________
76void Hits2Sdigits()
c60862bf 77{
543d5224 78 Info("Hits2Sdigits","Start.");
c60862bf 79
80 for(Int_t iEventN=0;iEventN<a->GetEventsPerRun();iEventN++){//events loop
81 al->GetEvent(iEventN);
82
83 if(!rl->TreeH()) rl->LoadHits();//from
84 if(!rl->TreeS()) rl->MakeTree("S"); r->MakeBranch("S");//to
543d5224 85
86 NOT YET DONE!
c60862bf 87 for(Int_t iPrimN=0;iPrimN<rl->TreeH()->GetEntries();iPrimN++){//prims loop
88 rl->TreeH()->GetEntry(iPrimN);
89 for(Int_t iHitN=0;iHitN<r->Hits()->GetEntries();iHitN++){//hits loop
90 AliRICHhit *pHit=r->Hits()->At(iHitN);
91 r->Param()->G2Px
92 r->AddSdigit(pHit->C(),padx+r->Param()->NpadsX()/2,pady+r->Param()->NpadsY()/2,qdc,track);
93 }
94 }
95 rl->TreeS()->Fill();
96 rl->WriteSDigits("OVERWRITE");
97 }//events loop
98
99 rl->UnloadHits();
100 rl->UnloadSDigits();
543d5224 101 Info("Hits2Sdigits","Stop.");
102}//Hits2Sdigits()
103//__________________________________________________________________________________________________
104void Sdigits2Digits()
105{
106 Info("Sdigits2Digits","Start.");
107
108 rl->LoadSDigits();
109
110 for(Int_t iEventN=0;iEventN<a->GetEventsPerRun();iEventN++){//events loop
111 al->GetEvent(iEventN);
112
113 rl->MakeTree("D");r->MakeBranch("D"); //create TreeD with RICH branches
114 r->ResetSdigits();r->ResetDigits();//reset lists of sdigits and digits
115 rl->TreeS()->GetEntry(0);
116 r->Sdigits()->Sort();
117
118 Int_t kBad=-101;
119 Int_t chamber,x,y,qdc,tr[3],id;
120 chamber=x=y=qdc=tr[0]=tr[1]=tr[2]=id=kBad;
121 Int_t iNdigitsPerPad=kBad;//how many sdigits for a given pad
122
123 for(Int_t i=0;i<r->Sdigits()->GetEntries();i++){//sdigits loop (sorted)
124 AliRICHdigit *pSdig=(AliRICHdigit*)r->Sdigits()->At(i);
125 if(pSdig->Id()==id){//still the same pad
126 iNdigitsPerPad++;
127 qdc+=pSdig->Qdc();
128 if(iNdigitsPerPad<=3)
129 tr[iNdigitsPerPad-1]=pSdig->T(0);
130 else
131 Info("","More then 3 sdigits for the given pad");
132 }else{//new pad, add the pevious one
133 if(id!=kBad) r->AddDigit(chamber,x,y,qdc,tr[0],tr[1],tr[2]);//ch-xpad-ypad-qdc-tr1-2-3
134 chamber=pSdig->C();x=pSdig->X();y=pSdig->Y();qdc=pSdig->Qdc();tr[0]=pSdig->T(0);id=pSdig->Id();
135 iNdigitsPerPad=1;tr[1]=tr[2]=kBad;
136 }
137 }//sdigits loop (sorted)
138
139 r->AddDigit(chamber,x,y,qdc,tr[0],tr[1],tr[2]);//add the last digit
140
141 rl->TreeD()->Fill();
142 rl->WriteDigits("OVERWRITE");
143 }//events loop
144 rl->UnloadSDigits(); rl->UnloadDigits();
145 r->ResetSdigits();r->ResetDigits();//reset lists of sdigits and digits
146 Info("Sdigits2Digits","Stop.");
c60862bf 147}
148
543d5224 149
150
151void Sdigits2DigitsOLD()
abb44d7c 152{
543d5224 153 Info("Sdigits2DigitsOLD","Start.");
154
abb44d7c 155 rl->LoadSDigits();
abb44d7c 156
543d5224 157 for(Int_t iEventN=0;iEventN<a->GetEventsPerRun();iEventN++){//events loop
158 al->GetEvent(iEventN);
159
160 rl->MakeTree("D");r->MakeBranch("D"); //create TreeD with RICH branches
161 r->ResetSdigits();r->ResetDigitsOld();//reset lists of sdigits and digits
162 rl->TreeS()->GetEntry(0);
163 r->Sdigits()->Sort();
abb44d7c 164
543d5224 165 Int_t kBad=-101;
166
167 Int_t tr[3],q[3],dig[5]; for(Int_t i=0;i<3;i++) tr[i]=q[i]=kBad; for(Int_t i=0;i<5;i++) dig[i]=kBad;
168 Int_t chamber=kBad,id=kBad,iNdigitsPerPad=kBad;//how many sdigits for a given pad
abb44d7c 169
543d5224 170 for(Int_t i=0;i<r->Sdigits()->GetEntries();i++){//sdigits loop (sorted)
171 AliRICHdigit *pSdig=(AliRICHdigit*)r->Sdigits()->At(i);
172 if(pSdig->Id()==id){//still the same pad
173 iNdigitsPerPad++;
174 dig[2]+=pSdig->Qdc();//sum up qdc
175 if(iNdigitsPerPad<=3)
176 tr[iNdigitsPerPad-1]=pSdig->T(0);
177 else
178 Info("","More then 3 sdigits for the given pad");
179 }else{//new pad, add the pevious one
180 if(id!=kBad) r->AddDigitOld(chamber,tr,q,dig);
181 chamber=pSdig->C();dig[0]=pSdig->X();dig[1]=pSdig->Y();dig[2]=pSdig->Qdc();tr[0]=pSdig->T(0);id=pSdig->Id();
182 iNdigitsPerPad=1;tr[1]=tr[2]=kBad;
183 }
184 }//sdigits loop (sorted)
185 r->AddDigitOld(chamber,tr,q,dig);//add the last digit
abb44d7c 186
543d5224 187 rl->TreeD()->Fill();
188 rl->WriteDigits("OVERWRITE");
189 }//events loop
190 rl->UnloadSDigits(); rl->UnloadDigits();
191 r->ResetSdigits();r->ResetDigitsOld();//reset lists of sdigits and digits
192 Info("Sdigits2DigitsOLD","Stop.");
abb44d7c 193}
194
543d5224 195
abb44d7c 196void Show3()
d48cca74 197{
abb44d7c 198 cout<<endl;
c60862bf 199 al->LoadHeader(); al->LoadKinematics();
abb44d7c 200
c60862bf 201 rl->LoadHits(); Bool_t isSdigits=!rl->LoadSDigits(); Bool_t isDigits=!rl->LoadDigits();//loaders
202
203 cout<<endl; cout<<endl;
204 for(Int_t iEventN=0;iEventN<a->GetEventsPerRun();iEventN++){//events loop
205 Int_t iNparticles=a->GetEvent(iEventN);
abb44d7c 206 Int_t iNprims=rl->TreeH()->GetEntries();
c60862bf 207
208 Int_t iTotalHits=0,iTotalCerenkovs=0,iTotalSpecials=0;
abb44d7c 209 for(Int_t iPrimN=0;iPrimN<iNprims;iPrimN++){//prims loop
c60862bf 210 rl->TreeH()->GetEntry(iPrimN);
211 iTotalHits+=r->Hits()->GetEntries();
212 iTotalCerenkovs+=r->Cerenkovs()->GetEntries();
213 iTotalSpecials+=r->Specials()->GetEntries();
abb44d7c 214 TParticle *pPrim=al->Stack()->Particle(iPrimN);
543d5224 215 Info("Show","Evt %4i prim %4i has %4i hits %5i cerenkovs and %5i specials from %s (,%7.2f,%7.2f)",
c60862bf 216 iEventN,
217 iPrimN,
218 r->Hits()->GetEntries(),
219 r->Cerenkovs()->GetEntries(),
220 r->Specials()->GetEntries(),
221 pPrim->GetName(),
222 pPrim->Theta()*r2d,pPrim->Phi()*r2d);
abb44d7c 223 }//prims loop
543d5224 224 Info("Show-HITS","Evt %i total: %i particles %i primaries %i hits %i cerenkovs %i specials",
c60862bf 225 iEventN, iNparticles, iNprims, iTotalHits,iTotalCerenkovs,iTotalSpecials);
226 if(isSdigits){
227 rl->TreeS()->GetEntry(0);
543d5224 228 Info("Show-SDIGITS","Evt %i contains %5i sdigits",iEventN,r->Sdigits()->GetEntries());
abb44d7c 229 }
c60862bf 230 if(isDigits){
231 rl->TreeD()->GetEntry(0);
543d5224 232 for(int i=1;i<=7;i++)
233 Info("Show-DIGITS","Evt %i chamber %i contains %5i NEW digits and %5i OLD",
234 iEventN, i, r->Digits(i)->GetEntries(),r->DigitsOld(i)->GetEntries());
c60862bf 235 }
236 cout<<endl;
abb44d7c 237 }//events loop
c60862bf 238 rl->UnloadHits(); if(isSdigits) rl->UnloadSDigits(); if(isDigits) rl->UnloadDigits();
abb44d7c 239 al->UnloadHeader();
240 al->UnloadKinematics();
241 cout<<endl;
d48cca74 242}//void Show()
243
d48cca74 244
853634d3 245
abb44d7c 246void DebugOFF()
247{
248 Info("DebugOFF","");
249 a->SetDebug(0);
250 r->SetDebug(0);
251 AliLoader::SetDebug(0);
252}//void DebugOFF()
253
254void DebugON()
255{
256 Info("DebugON","");
257 a->SetDebug(1);
258 r->SetDebug(1);
259 AliLoader::SetDebug(1);
260}//void DebugON()
261
d48cca74 262
d48cca74 263AliRun *a;
853634d3 264AliRunLoader *al;
265AliLoader *rl,*tl,*il;
266
267AliRICH *r;
853634d3 268
abb44d7c 269Bool_t CheckAlice()
d48cca74 270{
271 if(gAlice){//it's aliroot
abb44d7c 272 if(gSystem->Exec("ls galice.root")){
273 Info("CheckAlice","It's AliRoot, and no galice.root: SIMULATION");
c60862bf 274 gAlice->SetDebug(-1);
abb44d7c 275 gAlice->Init("AliceConfig.C");
276 r=(AliRICH*)gAlice->GetDetector("RICH");
277 return kFALSE;
278 }else{//galice.root is present we want to read alice from file
279 ReadAlice();
280 return kTRUE;
281 }
d48cca74 282 }else{//it's root with ALICE libs loaded
abb44d7c 283 ReadAlice();
d48cca74 284 return kTRUE;
285 }
abb44d7c 286}//void CheckAlice()
d48cca74 287
abb44d7c 288void ReadAlice()
289{
290 Info("ReadAlice","Reading ALICE from SIMULATED FILE.");
291 AliLoader::SetDebug(0);
292 if(gAlice) delete gAlice;
293 if(!(al=AliRunLoader::Open("galice.root","AlicE","update"))){
294 gSystem->Exec("rm -rf *.root *.dat");
295 Fatal("ReadAlice","galice.root broken, removing all this garbage");
296 }
297 al->LoadgAlice();
298 if(!gAlice) Fatal("ReadAlice","No gAlice in file");
299 a=al->GetAliRun();
300 a->SetDebug(0);
301//RICH
302 if(!(r=(AliRICH*)gAlice->GetDetector("RICH"))) Warning("RICH/menu.C::ReadAlice","No RICH in file");
303 r->SetDebug(0);
304 if(!(rl=al->GetLoader("RICHLoader"))) Warning("RICH/menu.C::ReadAlice","No RICH loader in file");
305
306 Info("ReadAlice","Run contains %i event(s)",gAlice->GetEventsPerRun());
307}
308//__________________________________________________________________________________________________
853634d3 309void RingViewer()
310{
311 gStyle->SetPalette(1);
3ea9cb08 312 TCanvas *view=new TCanvas("Display","ALICE RICH Display",0,0,600,600);
853634d3 313
3ea9cb08 314 TH2F *pH2=new TH2F("pH2F","RICH DISPLAY",r->Param()->Nx(),0,r->Param()->Nx(),r->Param()->Ny(),0,r->Param()->Ny());
853634d3 315 pH2->SetStats(0);
316 pH2->SetMaximum(100);
d48cca74 317
853634d3 318 Int_t Nevents = gAlice->GetEventsPerRun();
319}
853634d3 320//______________________________________________________________________________
abb44d7c 321//__________________________________________________________________________________________________
d48cca74 322void GeoTest()
323{
324
3ea9cb08 325 TBRIK *pAliceBRIK=new TBRIK("aliceBRIK","ALICE mother volume","void",500,500,500);
326 TBRIK *pArmBRIK=new TBRIK("armBRIK","RICH arm1","void",pRICH->GetSizeX(),pRICH->GetSizeY(),pRICH->GetSizeZ());
d48cca74 327
328 TNode *pAliceNode=new TNode("aliceNode","Mother volume","aliceBRIK");
329 pAliceNode->cd();
330
331// ARM 1 LEFT
332 TRotation rot1;
333 TVector3 v1(0,pRICH->GetOffset(),0);
334
335
336 rot1.RotateX(pRICH->GetYZAngle()*kDegrad); v1.RotateX(pRICH->GetYZAngle()*kDegrad);
337 rot1.RotateZ(pRICH->GetXYAngle()*kDegrad); v1.RotateZ(pRICH->GetXYAngle()*kDegrad);
338 rot1.RotateZ(pRICH->GetRotAngle()*kDegrad); v1.RotateZ(pRICH->GetRotAngle()*kDegrad);
339
340 TRotMatrix *pArm1RotMatrix=new TRotMatrix("rotArm1","rotArm1",rot1.ThetaX()*kRaddeg, rot1.PhiX()*kRaddeg,
341 rot1.ThetaY()*kRaddeg, rot1.PhiY()*kRaddeg,
342 rot1.ThetaZ()*kRaddeg, rot1.PhiZ()*kRaddeg);
343
344 TNode *pArm1Node=new TNode("arm1Node","Left arm","armBRIK",v1.X(),v1.Y(),v1.Z(),"rotArm1");
345 arm1Node->SetLineColor(kRed);
346
347// ARM 2 LEFT
348 TRotation rot2;
349 TVector3 v2(0,pRICH->GetOffset(),0);
350
351
3ea9cb08 352 rot2.RotateX( pRICH->YZAngle()*kDegrad); v2.RotateX(pRICH->GetYZAngle()*kDegrad);
353 rot2.RotateZ(-pRICH->XYAngle()*kDegrad); v2.RotateZ(-pRICH->GetXYAngle()*kDegrad);
354 rot2.RotateZ( pRICH->RotAngle()*kDegrad); v2.RotateZ(pRICH->GetRotAngle()*kDegrad);
d48cca74 355
356 TRotMatrix *pArm2RotMatrix=new TRotMatrix("rotArm2","rotArm2",rot2.ThetaX()*kRaddeg, rot2.PhiX()*kRaddeg,
357 rot2.ThetaY()*kRaddeg, rot2.PhiY()*kRaddeg,
358 rot2.ThetaZ()*kRaddeg, rot2.PhiZ()*kRaddeg);
359
360 TNode *pArm2Node=new TNode("arm2Node","Left arm","armBRIK",v2.X(),v2.Y(),v2.Z(),"rotArm2");
361 arm2Node->SetLineColor(kBlue);
362
363 aliceNode->Draw();
364}//void GeoTest()
abb44d7c 365//__________________________________________________________________________________________________
d48cca74 366void PrintGeo(Float_t rotDeg=0)
367{
368 AliRICHParam *p=new AliRICHParam;
369 Double_t r=p->Offset();
370 Double_t kP=p->AngleXY();
371 Double_t kT=p->AngleYZ();
372 Double_t kRot;
373
374 if(rotDeg==0)
375 kRot=p->AngleRot();
376 else
377 kRot=rotDeg*deg;
378
379 cout<<endl;
3ea9cb08 380 Double_t phi=90*deg+kRot+kP,theta=90*deg+kT;
d48cca74 381 Info(" menu for 1","r=%8.3f theta=%5.1f phi=%5.1f x=%8.3f y=%8.3f z=%8.3f",
853634d3 382 r, theta*r2d, phi*r2d,
d48cca74 383 r*sin(theta)*cos(phi),
384 r*sin(theta)*sin(phi),
385 r*cos(theta));
386
3ea9cb08 387 phi=90*deg+kRot+kP,theta=90*deg;
d48cca74 388 Info(" menu for 2","r=%8.3f theta=%5.1f phi=%5.1f x=%8.3f y=%8.3f z=%8.3f",
853634d3 389 r, theta*r2d, phi*r2d,
d48cca74 390 r*sin(theta)*cos(phi),
391 r*sin(theta)*sin(phi),
392 r*cos(theta));
d48cca74 393
3ea9cb08 394 phi=90*deg+kRot,theta=90*deg-kT;
d48cca74 395 Info(" menu for 3","r=%8.3f theta=%5.1f phi=%5.1f x=%8.3f y=%8.3f z=%8.3f",
853634d3 396 r, theta*r2d, phi*r2d,
d48cca74 397 r*sin(theta)*cos(phi),
398 r*sin(theta)*sin(phi),
399 r*cos(theta));
3ea9cb08 400
401
402 phi=90*deg+kRot,theta=90*deg;
d48cca74 403 Info(" menu for 4","r=%8.3f theta=%5.1f phi=%5.1f x=%8.3f y=%8.3f z=%8.3f",
853634d3 404 r, theta*r2d, phi*r2d,
d48cca74 405 r*sin(theta)*cos(phi),
406 r*sin(theta)*sin(phi),
407 r*cos(theta));
3ea9cb08 408
d48cca74 409
410 phi=90*deg+kRot,theta=90*deg+kT;
411 Info(" menu for 5","r=%8.3f theta=%5.1f phi=%5.1f x=%8.3f y=%8.3f z=%8.3f",
853634d3 412 r, theta*r2d, phi*r2d,
d48cca74 413 r*sin(theta)*cos(phi),
414 r*sin(theta)*sin(phi),
415 r*cos(theta));
416
3ea9cb08 417
418 phi=90*deg+kRot-kP,theta=90*deg;
d48cca74 419 Info(" menu for 6","r=%8.3f theta=%5.1f phi=%5.1f x=%8.3f y=%8.3f z=%8.3f",
853634d3 420 r, theta*r2d, phi*r2d,
d48cca74 421 r*sin(theta)*cos(phi),
422 r*sin(theta)*sin(phi),
423 r*cos(theta));
3ea9cb08 424
425 phi=90*deg+kRot-kP,theta=90*deg+kT;
426 Info(" menu for 7","r=%8.3f theta=%5.1f phi=%5.1f x=%8.3f y=%8.3f z=%8.3f",
427 r, theta*r2d, phi*r2d,
428 r*sin(theta)*cos(phi),
429 r*sin(theta)*sin(phi),
430 r*cos(theta));
d48cca74 431
432 delete p;
433}//void PrintGeo()
abb44d7c 434
435
436
543d5224 437//__________________________________________________________________________________________________
abb44d7c 438void TestGain()
439{
440 AliRICHParam *pParam=new AliRICHParam;
441 AliRICHResponseV0 *pRes=new AliRICHResponseV0;
442
443 TLegend *pLegend=new TLegend(0.6,0.3,0.85,0.5);
444 TH1F *pH0=new TH1F("pH1","Gain",100,0,600);
445 TH1F *pH10=new TH1F("pH10","Gain",100,0,600);
446 TH1F *pH20=new TH1F("pH20","Gain",100,0,600);
447 TH1F *pH30=new TH1F("pH30","Gain",100,0,600);
448 TH1F *pHold=new TH1F("pHold","Mip Charge",100,0,2000);
449 for(int i=0;i<1000;i++){
450 pH0 ->Fill(pParam->Gain(0));
451 pH10->Fill(pParam->Gain(10));
452 pH20->Fill(pParam->Gain(20));
453 pH30->Fill(pParam->Gain(30));
454 pHold->Fill(pRes->IntPH(30));
455 }
456 pH0->Draw();
457 pH10->Draw("same");
458 pH20->Draw("same");
459 pH30->Draw("same");
460 pHold->Draw("same");
461 pLegend->AddEntry(pH0,"y=0");
462 pLegend->AddEntry(pH10,"y=10");pH10->SetLineColor(kRed);
463 pLegend->AddEntry(pH20,"y=20");pH20->SetLineColor(kBlue);
464 pLegend->AddEntry(pH30,"y=30");pH30->SetLineColor(kGreen);
465 pLegend->AddEntry(pHold,"res");pHold->SetLineColor(kMagenta);
466 pLegend->Draw();
467}//void TestGain()
468//__________________________________________________________________________________________________
469void TestMipCharge()
470{
471 AliRICHParam *pParam=new AliRICHParam;
472 AliRICHResponseV0 *pRes=new AliRICHResponseV0;
473
474 TLegend *pLegend=new TLegend(0.6,0.3,0.85,0.5);
475 TH1F *pH0= new TH1F("pH1", "Mip Charge",100,0,500);
476 TH1F *pH10=new TH1F("pH10","Mip Charge",100,0,500);
477 TH1F *pH20=new TH1F("pH20","Mip Charge",100,0,500);
478 TH1F *pH30=new TH1F("pH30","Mip Charge",100,0,500);
479 TH1F *pHold=new TH1F("pHold","Mip Charge",100,0,500);
480 for(int i=0;i<1000;i++){
481 pH0 ->Fill(pParam->TotalCharge(kPiPlus,0.5e-9,0));
482 pH10->Fill(pParam->TotalCharge(kPiPlus,0.5e-9,10));
483 pH20->Fill(pParam->TotalCharge(kPiPlus,0.5e-9,20));
484 pH30->Fill(pParam->TotalCharge(kPiPlus,0.5e-9,30));
485 pHold->Fill(pRes->IntPH(0.5e-9,-30));
486 }
487 pH0->Draw();
488 pH10->Draw("same");
489 pH20->Draw("same");
490 pH30->Draw("same");
491 pHold->Draw("same");
492 pLegend->AddEntry(pH0,"y=0");
493 pLegend->AddEntry(pH10,"y=10");pH10->SetLineColor(kRed);
494 pLegend->AddEntry(pH20,"y=20");pH20->SetLineColor(kBlue);
495 pLegend->AddEntry(pH30,"y=30");pH30->SetLineColor(kGreen);
496 pLegend->AddEntry(pHold,"res");pHold->SetLineColor(kMagenta);
497 pLegend->Draw();
498}//void TestGain()
499//__________________________________________________________________________________________________
543d5224 500void TestDigitsOLD()
abb44d7c 501{
543d5224 502 Info("TestDigitsOLD","Creating test digits.");
abb44d7c 503 rl->MakeTree("D");r->MakeBranch("D");
504
abb44d7c 505
c60862bf 506 Int_t t[10];
507 Int_t c[10];
508 Int_t d[5];
509 t[0]=100;t[1]=200;t[2]=300;
510 c[0]=10;c[1]=20;c[2]=30;
abb44d7c 511
543d5224 512
513 d[0]=1;d[1]=1;d[2]=10;d[3]=3;d[4]=4;r->AddDigitOld(1,t,c,d);
514
515 d[0]=2;d[1]=2;d[2]=10;d[3]=3;d[4]=4;r->AddDigitOld(2,t,c,d);
516 d[0]=2;d[1]=3;d[2]=10;d[3]=3;d[4]=4;r->AddDigitOld(2,t,c,d);
517
518 d[0]=2;d[1]=2;d[2]=50;d[3]=3;d[4]=4;r->AddDigitOld(3,t,c,d);
519 d[0]=2;d[1]=3;d[2]=100;d[3]=3;d[4]=4;r->AddDigitOld(3,t,c,d);
520 d[0]=3;d[1]=2;d[2]=100;d[3]=3;d[4]=4;r->AddDigitOld(3,t,c,d);
c60862bf 521
543d5224 522 d[0]=2;d[1]=2;d[2]=100;d[3]=3;d[4]=4;r->AddDigitOld(4,t,c,d);
523 d[0]=2;d[1]=3;d[2]=50;d[3]=3;d[4]=4;r->AddDigitOld(4,t,c,d);
524 d[0]=3;d[1]=2;d[2]=50;d[3]=3;d[4]=4;r->AddDigitOld(4,t,c,d);
525 d[0]=3;d[1]=3;d[2]=100;d[3]=3;d[4]=4;r->AddDigitOld(4,t,c,d);
526
abb44d7c 527 rl->TreeD()->Fill();
528 rl->WriteDigits("OVERWRITE");
529 rl->UnloadDigits();
543d5224 530 r->ResetDigitsOld();
531 Info("TestDigitsOLD","Stop.");
abb44d7c 532}//void TestDigits()
533//__________________________________________________________________________________________________
534void TestSdigits()
535{
543d5224 536 Info("TestSdigits","Creating test sdigits.");
abb44d7c 537 rl->MakeTree("S");r->MakeBranch("S");
538//totally 19 must be trasformd to 6 digits
539 r->AddSdigit(1,40,40,10,40); r->AddSdigit(1,40,40,10,41); r->AddSdigit(1,40,40,10,42); r->AddSdigit(1,40,40,10,43);
540 r->AddSdigit(1,45,45,10,45); r->AddSdigit(1,45,45,10,45); r->AddSdigit(1,45,45,10,45); r->AddSdigit(1,45,45,10,45);
541
542 r->AddSdigit(1,20,20,10,20); r->AddSdigit(1,20,20,10,21);
543 r->AddSdigit(1,25,25,10,25); r->AddSdigit(1,25,25,10,25);
544
545 r->AddSdigit(1,30,30,10,30); r->AddSdigit(1,30,30,10,31); r->AddSdigit(1,30,30,10,32);
546 r->AddSdigit(1,35,35,10,35); r->AddSdigit(1,35,35,10,35); r->AddSdigit(1,35,35,10,35);
547
548
549 r->AddSdigit(1,10,10,10,10);
550
abb44d7c 551
552 rl->TreeS()->Fill();
553 rl->WriteSDigits("OVERWRITE");
554 rl->UnloadSDigits();
555 cout<<endl;r->Sdigits()->Print();
556 r->ResetSDigits();
543d5224 557 Info("TestSdigits","Stop.");
558}//void TestSdigits()
abb44d7c 559//__________________________________________________________________________________________________
543d5224 560void TestClustersOLD()
abb44d7c 561{
543d5224 562 Info("TestClusters","Creating test clusters.");
563 rl->MakeTree("R");r->MakeBranch("R");
564
565 AliRICHRawCluster c;
566 r->AddClusterOld(1,c);
567 rl->TreeR()->Fill();
568 rl->WriteRecPoints("OVERWRITE");
569 rl->UnloadRecPoints();
570 r->ResetRawClusters();
571
572 Info("TestClusters","Stop.");
573}//void TestClustersOLD()
574//__________________________________________________________________________________________________
575void TestSeg()
576{
577 AliRICHParam *p=r->Param();
abb44d7c 578 Int_t padx,pady;
543d5224 579 Float_t x,y;
580 Float_t dz=p->DeadZone();
581 Float_t sx=p->SectorSizeX(); Float_t sy=p->SectorSizeY(); Float_t px=p->PcSizeX(); Float_t py=p->PcSizeY();
582 cout<<endl;
583 Info(" 1- 1","sec=%i padx=%3i pady=%3i",p->Local2Pad(-px/2 , -py/2 ,padx,pady),padx,pady);
584 Info(" 48- 1","sec=%i padx=%3i pady=%3i",p->Local2Pad(-sx/2-dz , -py/2 ,padx,pady),padx,pady);
585 Info(" 49- 1","sec=%i padx=%3i pady=%3i",p->Local2Pad(-sx/2 , -py/2 ,padx,pady),padx,pady);
586 Info(" 96- 1","sec=%i padx=%3i pady=%3i",p->Local2Pad( sx/2 , -py/2 ,padx,pady),padx,pady);
587 Info(" 97- 1","sec=%i padx=%3i pady=%3i",p->Local2Pad( sx/2+dz , -py/2 ,padx,pady),padx,pady);
588 Info("144- 1","sec=%i padx=%3i pady=%3i",p->Local2Pad( px/2 , -py/2 ,padx,pady),padx,pady);
abb44d7c 589 cout<<endl;
543d5224 590 Info(" 1- 80","sec=%i padx=%3i pady=%3i",p->Local2Pad(-px/2 , -dz/2 ,padx,pady),padx,pady);
591 Info(" 48- 80","sec=%i padx=%3i pady=%3i",p->Local2Pad(-sx/2-dz , -dz/2 ,padx,pady),padx,pady);
592 Info(" 49- 80","sec=%i padx=%3i pady=%3i",p->Local2Pad(-sx/2 , -dz/2 ,padx,pady),padx,pady);
593 Info(" 96- 80","sec=%i padx=%3i pady=%3i",p->Local2Pad( sx/2 , -dz/2 ,padx,pady),padx,pady);
594 Info(" 97- 80","sec=%i padx=%3i pady=%3i",p->Local2Pad( sx/2+dz , -dz/2 ,padx,pady),padx,pady);
595 Info("144- 80","sec=%i padx=%3i pady=%3i",p->Local2Pad( px/2 , -dz/2 ,padx,pady),padx,pady);
abb44d7c 596 cout<<endl;
543d5224 597 Info(" 1- 81","sec=%i padx=%3i pady=%3i",p->Local2Pad(-px/2 , dz/2 ,padx,pady),padx,pady);
598 Info(" 48- 81","sec=%i padx=%3i pady=%3i",p->Local2Pad(-sx/2-dz , dz/2 ,padx,pady),padx,pady);
599 Info(" 49- 81","sec=%i padx=%3i pady=%3i",p->Local2Pad(-sx/2 , dz/2 ,padx,pady),padx,pady);
600 Info(" 96- 81","sec=%i padx=%3i pady=%3i",p->Local2Pad( sx/2 , dz/2 ,padx,pady),padx,pady);
601 Info(" 97- 81","sec=%i padx=%3i pady=%3i",p->Local2Pad( sx/2+dz , dz/2 ,padx,pady),padx,pady);
602 Info("144- 81","sec=%i padx=%3i pady=%3i",p->Local2Pad( px/2 , dz/2 ,padx,pady),padx,pady);
abb44d7c 603 cout<<endl;
543d5224 604 Info(" 1-160","sec=%i padx=%3i pady=%3i",p->Local2Pad(-px/2 , py/2 ,padx,pady),padx,pady);
605 Info(" 48-160","sec=%i padx=%3i pady=%3i",p->Local2Pad(-sx/2-dz , py/2 ,padx,pady),padx,pady);
606 Info(" 49-160","sec=%i padx=%3i pady=%3i",p->Local2Pad(-sx/2 , py/2 ,padx,pady),padx,pady);
607 Info(" 96-160","sec=%i padx=%3i pady=%3i",p->Local2Pad( sx/2 , py/2 ,padx,pady),padx,pady);
608 Info(" 97-160","sec=%i padx=%3i pady=%3i",p->Local2Pad( sx/2+dz , py/2 ,padx,pady),padx,pady);
609 Info("144-160","sec=%i padx=%3i pady=%3i",p->Local2Pad( px/2 , py/2 ,padx,pady),padx,pady);
abb44d7c 610 cout<<endl;
543d5224 611 Info(" 73-160","sec=%i padx=%3i pady=%3i",p->Local2Pad( 0 , py/2 ,padx,pady),padx,pady);
612 Info(" 73- 81","sec=%i padx=%3i pady=%3i",p->Local2Pad( 0 , dz/2 ,padx,pady),padx,pady);
613 Info("0-0dead","sec=%i padx=%3i pady=%3i",p->Local2Pad( 0 , 0 ,padx,pady),padx,pady);
614 Info(" 73- 80","sec=%i padx=%3i pady=%3i",p->Local2Pad( 0 , -dz/2 ,padx,pady),padx,pady);
615 Info(" 73- 1","sec=%i padx=%3i pady=%3i",p->Local2Pad( 0 , -py/2 ,padx,pady),padx,pady);
abb44d7c 616 cout<<endl;
543d5224 617 p->Pad2Local(padx= 1,pady=1,x,y); cout<<"padx="<<padx<<" pady="<<pady<<" x="<<x<<" y="<<y<<endl;
618 p->Pad2Local(padx= 48,pady=1,x,y); cout<<"padx="<<padx<<" pady="<<pady<<" x="<<x<<" y="<<y<<endl;
619 p->Pad2Local(padx= 49,pady=1,x,y); cout<<"padx="<<padx<<" pady="<<pady<<" x="<<x<<" y="<<y<<endl;
620 p->Pad2Local(padx= 96,pady=1,x,y); cout<<"padx="<<padx<<" pady="<<pady<<" x="<<x<<" y="<<y<<endl;
621 p->Pad2Local(padx= 97,pady=1,x,y); cout<<"padx="<<padx<<" pady="<<pady<<" x="<<x<<" y="<<y<<endl;
622 p->Pad2Local(padx=144,pady=1,x,y); cout<<"padx="<<padx<<" pady="<<pady<<" x="<<x<<" y="<<y<<endl;
623 cout<<endl;
624 p->Pad2Local(padx= 1,pady=80,x,y); cout<<"padx="<<padx<<" pady="<<pady<<" x="<<x<<" y="<<y<<endl;
625 p->Pad2Local(padx= 48,pady=80,x,y); cout<<"padx="<<padx<<" pady="<<pady<<" x="<<x<<" y="<<y<<endl;
626 p->Pad2Local(padx= 49,pady=80,x,y); cout<<"padx="<<padx<<" pady="<<pady<<" x="<<x<<" y="<<y<<endl;
627 p->Pad2Local(padx= 96,pady=80,x,y); cout<<"padx="<<padx<<" pady="<<pady<<" x="<<x<<" y="<<y<<endl;
628 p->Pad2Local(padx= 97,pady=80,x,y); cout<<"padx="<<padx<<" pady="<<pady<<" x="<<x<<" y="<<y<<endl;
629 p->Pad2Local(padx=144,pady=80,x,y); cout<<"padx="<<padx<<" pady="<<pady<<" x="<<x<<" y="<<y<<endl;
630 cout<<endl;
631 p->Pad2Local(padx= 1,pady=81,x,y); cout<<"padx="<<padx<<" pady="<<pady<<" x="<<x<<" y="<<y<<endl;
632 p->Pad2Local(padx= 48,pady=81,x,y); cout<<"padx="<<padx<<" pady="<<pady<<" x="<<x<<" y="<<y<<endl;
633 p->Pad2Local(padx= 49,pady=81,x,y); cout<<"padx="<<padx<<" pady="<<pady<<" x="<<x<<" y="<<y<<endl;
634 p->Pad2Local(padx= 96,pady=81,x,y); cout<<"padx="<<padx<<" pady="<<pady<<" x="<<x<<" y="<<y<<endl;
635 p->Pad2Local(padx= 97,pady=81,x,y); cout<<"padx="<<padx<<" pady="<<pady<<" x="<<x<<" y="<<y<<endl;
636 p->Pad2Local(padx=144,pady=81,x,y); cout<<"padx="<<padx<<" pady="<<pady<<" x="<<x<<" y="<<y<<endl;
637 cout<<endl;
638 p->Pad2Local(padx= 1,pady=160,x,y); cout<<"padx="<<padx<<" pady="<<pady<<" x="<<x<<" y="<<y<<endl;
639 p->Pad2Local(padx= 48,pady=160,x,y); cout<<"padx="<<padx<<" pady="<<pady<<" x="<<x<<" y="<<y<<endl;
640 p->Pad2Local(padx= 49,pady=160,x,y); cout<<"padx="<<padx<<" pady="<<pady<<" x="<<x<<" y="<<y<<endl;
641 p->Pad2Local(padx= 96,pady=160,x,y); cout<<"padx="<<padx<<" pady="<<pady<<" x="<<x<<" y="<<y<<endl;
642 p->Pad2Local(padx= 97,pady=160,x,y); cout<<"padx="<<padx<<" pady="<<pady<<" x="<<x<<" y="<<y<<endl;
643 p->Pad2Local(padx=144,pady=160,x,y); cout<<"padx="<<padx<<" pady="<<pady<<" x="<<x<<" y="<<y<<endl;
644}//void TestSeg()
abb44d7c 645//__________________________________________________________________________________________________
543d5224 646void TestMenu()
abb44d7c 647{
543d5224 648 TControlBar *pMenu = new TControlBar("vertical","RICH test");
649 pMenu->AddButton("Test segmentation", "TestSeg()", "Test AliRICHParam::L2P() method");
650 pMenu->AddButton("Test transform", "TestTransform()", "Test ALiRICHChamber::L2G() and G2L methods");
651 pMenu->AddButton("Test gain", "TestGain()", "Test AliRICHParam::Gain() method");
652 pMenu->AddButton("Test MIP charge", "TestMipCharge()", "Test AliRICHParam::TotalCharge() method");
653 pMenu->AddButton("Test Sdigits", "TestSdigits()", "Create test set of sdigits");
654 pMenu->AddButton("Test Digits OLD", "TestDigitsOLD()", "Create test set of OLD digits");
655 pMenu->AddButton("Test Clusters OLD", "TestClustersOLD()", "Create test set of OLD clusters");
656 pMenu->Show();
657}//TestMenu()
658//__________________________________________________________________________________________________
659void GeoMenu()
660{
661 TControlBar *pMenu = new TControlBar("vertical","RICH draw");
662 pMenu->AddButton("RICH Isometry", "gMC->Gdraw(\"ALIC\", 60,40,0, 10,10, 0.008,0.008)","Draws ALIC volume in isometry");
663 pMenu->AddButton("RICH Front XY", "gMC->Gdraw(\"ALIC\", 0,0,0, 10,10, 0.01,0.01)","Draws ALIC volume in XY view");
664 pMenu->AddButton("RICH Side YZ", "gMC->Gdraw(\"ALIC\",90,180, 0, 10,10, 0.01,0.01)","Draws ALIC volume in YZ view");
665 pMenu->AddButton("RICH Top XZ", "gMC->Gdraw(\"ALIC\",90, 90, 0, 10,10, 0.01,0.01)","Draws ALIC volume in XZ view");
666 pMenu->AddButton("Module Isometry","gMC->Gdraw(\"SRIC\", 30,60,0, 10,10, 0.1,0.1)","Draws SRIC volume in isometry");
667 pMenu->AddButton("Module Front XY","gMC->Gdraw(\"SRIC\", 0,0,0, 10,10, 0.1,0.1)","Draws SRIC volume in XY view");
668 pMenu->AddButton("Module Top XZ", "gMC->Gdraw(\"SRIC\",90, 90, 0, 10,10, 0.1,0.1)","Draws SRIC volume in XZ view");
669 pMenu->AddButton("ALICE Tree", "((TGeant3*)gMC)->Gdtree(\"ALIC\")","Draws ALICE tree");
670 pMenu->AddButton("RICH Tree", "((TGeant3*)gMC)->Gdtree(\"RICH\")","Draws RICH tree");
671 pMenu->AddButton("Geo test", "GeoTest()", "Draw RICH geo as a macro");
672 pMenu->AddButton("Print ref", "PrintGeo()", "Print RICH chambers default position");
673 pMenu->AddButton("AliRICH::Print", "r->Print();", "Print RICH chambers default position");
674 pMenu->AddButton("Test transform","TestTransform()","Test L2G and G2L methods");
675 pMenu->AddButton("Geo GUI", "new G3GeometryGUI;","Create instance of G4GeometryGUI");
676 pMenu->Show();
677}//GeoMenu()
678//__________________________________________________________________________________________________
679void menu()
680{
681 TControlBar *pMenu = new TControlBar("vertical","RICH main");
682
683 pMenu->AddButton("Debug ON", "DebugON();", "Switch debug on-off");
684 pMenu->AddButton("Debug OFF", "DebugOFF();", "Switch debug on-off");
685 if(CheckAlice()){//it's from file, reconstruct
686 pMenu->AddButton("Hits->Sdigits->Digits","Hits2Digits()","Convert");
687 pMenu->AddButton("Digits->Recos", "Digits2Recos()","Convert");
688 pMenu->AddButton("Show","Show3()","Shows the structure of events in files");
689 pMenu->AddButton("Hits->Sdigits", "Hits2Sdigits()", "Perform first phase converstion");
690 pMenu->AddButton("Specials->Sdigits","Specials2Sdigits()", "Perform first phase converstion");
691 pMenu->AddButton("Sdigits->Digits", "Sdigits2Digits()", "Perform first phase converstion");
692 pMenu->AddButton("Digits->Clusters", "Digits2Clusters()", "Perform first phase converstion");
693
694 pMenu->AddButton("Sdigits->DigitsOLD", "Sdigits2DigitsOLD()","Perform second phase converstion");
695 pMenu->AddButton("DigitsOLD->RawClustersOLD", "DigitsOLD2RawClustersOLD()", "Perform second phase converstion");
696
697 }else{//it's aliroot, simulate
698 pMenu->AddButton("Run", "a->Run(1)", "Process!");
699 }
700 pMenu->AddButton("Geo submenu", "GeoMenu()", "Shows geomentry submenu");
701 pMenu->AddButton("Test submenu", "TestMenu()", "Shows test submenu");
702 pMenu->AddButton("Browser", "new TBrowser;", "Start ROOT TBrowser");
703 pMenu->AddButton("Quit", ".q", "Close session");
704 pMenu->Show();
705 a=gAlice;//for manual manipulation convinience
706}//menu()
707//__________________________________________________________________________________________________