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