]>
Commit | Line | Data |
---|---|---|
ed3ceb24 | 1 | |
2 | Int_t countContrib[7][3]; | |
3 | ||
3b96aee8 | 4 | void ControlPlots() |
5 | { | |
6 | Int_t iChamber=1; | |
7 | ||
ed3ceb24 | 8 | TFile *pFile = new TFile("$(HOME)/plots.root","RECREATE"); |
9 | TH1F *pCqH1=new TH1F("ClusQ", "Cluster Charge all chambers;q [QDC]",r->P()->MaxQdc(),0,r->P()->MaxQdc()); | |
10 | TH1F *pCsH1=new TH1F("ClusSize","Cluster size all chambers;size [number of pads in cluster]",100,0,100); | |
11 | TH2F *pCmH2=new TH2F("ClusMap", "Cluster map;x [cm];y [cm]",1000,-r->P()->PcSizeX()/2,r->P()->PcSizeX()/2, | |
12 | 1000,-r->P()->PcSizeY()/2,r->P()->PcSizeY()/2); | |
3b96aee8 | 13 | |
ed3ceb24 | 14 | TH1F *pCqMipH1=new TH1F("MipClusQ", "MIP Cluster Charge all chambers;q [QDC]",r->P()->MaxQdc(),0,r->P()->MaxQdc()); |
15 | TH1F *pCsMipH1=new TH1F("MipClusSize","MIP Cluster size all chambers;size [number of pads in cluster]",100,0,100); | |
16 | TH2F *pCmMipH2=new TH2F("MipClusMap", "MIP Cluster map;x [cm];y [cm]",1000,-r->P()->PcSizeX()/2,r->P()->PcSizeX()/2, | |
17 | 1000,-r->P()->PcSizeY()/2,r->P()->PcSizeY()/2); | |
3b96aee8 | 18 | |
ed3ceb24 | 19 | TH1F *pCqCerH1=new TH1F("CerClusQ", "Cerenkov Cluster Charge all chambers;q [QDC]",r->P()->MaxQdc(),0,r->P()->MaxQdc()); |
20 | TH1F *pCsCerH1=new TH1F("CerClusSize","Cernekov Cluster size all chambers;size [number of pads in cluster]",100,0,100); | |
21 | TH2F *pCmCerH2=new TH2F("CerClusMap", "Cerenkov Cluster map;x [cm];y [cm]",1000,-r->P()->PcSizeX()/2,r->P()->PcSizeX()/2, | |
22 | 1000,-r->P()->PcSizeY()/2,r->P()->PcSizeY()/2); | |
23 | TH1F *pCqFeeH1=new TH1F("FeeClusQ", "Feedback Cluster Charge all chambers;q [QDC]",r->P()->MaxQdc(),0,r->P()->MaxQdc()); | |
24 | TH1F *pCsFeeH1=new TH1F("FeeClusSize","Feedback Cluster size all chambers;size [number of pads in cluster]",100,0,100); | |
25 | TH2F *pCmFeeH2=new TH2F("FeeClusMap", "Feedback Cluster map;x [cm];y [cm]",1000,-r->P()->PcSizeX()/2,r->P()->PcSizeX()/2, | |
26 | 1000,-r->P()->PcSizeY()/2,r->P()->PcSizeY()/2); | |
27 | Bool_t isClusters=!rl->LoadRecPoints(); | |
28 | r->SetTreeAddress(); | |
3b96aee8 | 29 | for(Int_t iEventN=0;iEventN<a->GetEventsPerRun();iEventN++){//events loop |
30 | al->GetEvent(iEventN); | |
3b96aee8 | 31 | if(isClusters){ |
32 | rl->TreeR()->GetEntry(0); | |
33 | Int_t iTotalClusters=0; | |
ed3ceb24 | 34 | for(int i=1;i<=7;i++){//chambers loop |
35 | iTotalClusters+=r->Clusters(i)->GetEntries(); | |
36 | for(Int_t iClusterN=0;iClusterN<r->Clusters(i)->GetEntries();iClusterN++){//clusters loop | |
37 | AliRICHcluster *pClus=(AliRICHcluster*)r->Clusters(i)->At(iClusterN); | |
38 | ||
39 | countContrib[i-1][0] += pClus->Nmips(); | |
40 | countContrib[i-1][1] += pClus->Ncerenkovs(); | |
41 | countContrib[i-1][2] += pClus->Nfeedbacks(); | |
42 | ||
43 | pCqH1->Fill(pClus->Q()); | |
44 | pCsH1->Fill(pClus->Size()); | |
45 | pCmH2->Fill(pClus->X(),pClus->Y()); | |
46 | ||
47 | if(pClus->IsPureMip()){ //Pure Mips | |
48 | pCqMipH1->Fill(pClus->Q()); | |
49 | pCsMipH1->Fill(pClus->Size()); | |
50 | pCmMipH2->Fill(pClus->X(),pClus->Y()); | |
51 | } | |
52 | if(pClus->IsPureCerenkov()){ //Pure Photons | |
53 | pCqCerH1->Fill(pClus->Q()); | |
54 | pCsCerH1->Fill(pClus->Size()); | |
55 | pCmCerH2->Fill(pClus->X(),pClus->Y()); | |
56 | } | |
57 | if(pClus->IsPureFeedback()){ //Pure Feedbacks | |
58 | pCqFeeH1->Fill(pClus->Q()); | |
59 | pCsFeeH1->Fill(pClus->Size()); | |
60 | pCmFeeH2->Fill(pClus->X(),pClus->Y()); | |
61 | } | |
62 | }//clusters loop | |
63 | }//chambers loop | |
3b96aee8 | 64 | }//isClusters |
ed3ceb24 | 65 | Info("ControlPlots","Event %i processed.",iEventN); |
3b96aee8 | 66 | }//events loop |
ed3ceb24 | 67 | if(isClusters) rl->UnloadRecPoints(); |
68 | ||
69 | pFile->Write(); | |
70 | delete pFile; | |
71 | for(Int_t i=0;i<7;i++) | |
72 | cout <<" chamber " << i+1 << " n. mips " << countContrib[i][0] << " n. ckovs " << countContrib[i][1] << " n. fdbks " << countContrib[i][2] << endl; | |
3b96aee8 | 73 | }//void ControlPlots() |
74 | //__________________________________________________________________________________________________ | |
c67b2d9f | 75 | void MainTrank() |
76 | { | |
77 | TStopwatch sw;TDatime time; | |
86594bfc | 78 | H_SD(); SD_D(); AliRICHClusterFinder *z=new AliRICHClusterFinder(r); z->Exec();//delete z; |
c67b2d9f | 79 | cout<<"\nInfo in <MainTrank>: Start time: ";time.Print(); |
ed3ceb24 | 80 | cout<<"Info in <MainTrank>: Stop time: ";time.Set(); time.Print(); |
81 | cout<<"Info in <MainTrank>: Time used: ";sw.Print(); | |
c67b2d9f | 82 | } |
3b96aee8 | 83 | //__________________________________________________________________________________________________ |
84 | void sh() | |
85 | { | |
86 | if(rl->LoadHits()) return; | |
87 | ||
88 | Int_t iTotalHits=0; | |
89 | for(Int_t iPrimN=0;iPrimN<rl->TreeH()->GetEntries();iPrimN++){//prims loop | |
90 | rl->TreeH()->GetEntry(iPrimN); | |
91 | r->Hits()->Print(); | |
92 | iTotalHits+=r->Hits()->GetEntries(); | |
93 | } | |
94 | Info("sh","totally %i hits",iTotalHits); | |
95 | rl->UnloadHits(); | |
96 | } | |
97 | //__________________________________________________________________________________________________ | |
d32d34bf | 98 | void ss() |
99 | { | |
c1863e3c | 100 | if(rl->LoadSDigits()) return; |
d32d34bf | 101 | rl->TreeS()->GetEntry(0); |
102 | r->SDigits()->Print(); | |
3b96aee8 | 103 | Info("ss","totally %i sdigits",r->SDigits()->GetEntries()); |
d32d34bf | 104 | rl->UnloadSDigits(); |
105 | } | |
3b96aee8 | 106 | //__________________________________________________________________________________________________ |
c1863e3c | 107 | void sd() |
108 | { | |
109 | if(rl->LoadDigits()) return; | |
110 | rl->TreeD()->GetEntry(0); | |
3b96aee8 | 111 | Int_t iTotalDigits=0; |
112 | for(int i=1;i<=7;i++){ | |
113 | r->Digits(i)->Print(); | |
114 | iTotalDigits+=r->Digits(i)->GetEntries(); | |
115 | } | |
116 | Info("sd","totally %i digits",iTotalDigits); | |
c1863e3c | 117 | rl->UnloadDigits(); |
118 | } | |
09c52ebc | 119 | //__________________________________________________________________________________________________ |
c1863e3c | 120 | void sc() |
121 | { | |
122 | if(rl->LoadRecPoints()) return; | |
c67b2d9f | 123 | r->SetTreeAddress(); |
c1863e3c | 124 | rl->TreeR()->GetEntry(0); |
125 | for(int i=1;i<=7;i++) r->Clusters(i)->Print(); | |
126 | rl->UnloadRecPoints(); | |
127 | } | |
09c52ebc | 128 | //__________________________________________________________________________________________________ |
129 | void sp(int tid) | |
130 | { | |
131 | al->LoadHeader(); al->LoadKinematics(); | |
132 | PrintParticleInfo(tid); | |
133 | al->UnloadKinematics(); al->UnloadHeader(); | |
134 | } | |
135 | //__________________________________________________________________________________________________ | |
136 | void PrintParticleInfo(int tid) | |
137 | { | |
138 | TParticle *p=al->Stack()->Particle(tid); | |
139 | cout<<p->GetName(); | |
140 | if(p->GetMother(0)!=-1){cout<<" from "; PrintParticleInfo(p->GetMother(0));} | |
141 | else {cout<<endl;} | |
142 | } | |
143 | //__________________________________________________________________________________________________ | |
8fc0dab8 | 144 | |
145 | Double_t r2d = TMath::RadToDeg(); | |
146 | Double_t d2r = TMath::DegToRad(); | |
147 | ||
ed3ceb24 | 148 | void DisplFast(){ AliRICHDisplFast *d = new AliRICHDisplFast(); d->Exec();} |
fa49f877 | 149 | |
150 | ||
af3d25a6 | 151 | void C_R() |
c60862bf | 152 | { |
5cb4dfc3 | 153 | AliRICHRecon *detect = new AliRICHRecon("RICH patrec algorithm","Reconstruction"); |
543d5224 | 154 | |
155 | ||
8fc0dab8 | 156 | for (int nev=0; nev< a->GetEventsPerRun(); nev++) { // Event Loop |
543d5224 | 157 | al->GetEvent(nev); |
158 | cout <<endl<< "Processing event:" <<nev<<endl; | |
5cb4dfc3 | 159 | detect->StartProcessEvent(); |
543d5224 | 160 | } // event loop |
fa49f877 | 161 | delete detect; |
543d5224 | 162 | } |
0f72f306 | 163 | //__________________________________________________________________________________________________ |
164 | void D_C() | |
165 | { | |
166 | TStopwatch sw;TDatime time; | |
543d5224 | 167 | |
0f72f306 | 168 | AliRICHClusterFinder *z=new AliRICHClusterFinder(r); z->Exec(); |
543d5224 | 169 | |
0f72f306 | 170 | cout << endl; |
171 | cout << "Info in Digits->Clusters: Start time: ";time.Print(); | |
172 | cout << "Info in Digits->Clusters: Stop time: ";time.Set(); time.Print(); | |
173 | cout << "Info in Digits->Clusters: Time used: ";sw.Print(); | |
174 | } | |
d32d34bf | 175 | //__________________________________________________________________________________________________ |
543d5224 | 176 | |
09c52ebc | 177 | AliRICH * Rich() {return r;} |
d32d34bf | 178 | void SD_D() |
543d5224 | 179 | { |
d32d34bf | 180 | Info("SD_D","Start."); |
ed3ceb24 | 181 | extern Int_t kBad; |
09c52ebc | 182 | Rich()->Param()->GenSigmaThMap(); |
543d5224 | 183 | rl->LoadSDigits(); |
184 | ||
185 | for(Int_t iEventN=0;iEventN<a->GetEventsPerRun();iEventN++){//events loop | |
a239137a | 186 | al->GetEvent(iEventN); cout<<"Event "<<iEventN<<endl; |
09c52ebc | 187 | rl->MakeTree("D"); Rich()->MakeBranch("D"); //create TreeD with RICH branches |
188 | Rich()->ResetSDigits(); Rich()->ResetDigits(); //reset lists of sdigits and digits | |
189 | rl->TreeS()->GetEntry(0); //get sdigits to memory container | |
190 | Rich()->SDigits()->Sort(); | |
ed3ceb24 | 191 | |
09c52ebc | 192 | Int_t combiPid=0,chamber=0,x=0,y=0,tid[3],id=0; Double_t q=0; |
ed3ceb24 | 193 | Int_t iNdigitsPerPad;//how many sdigits for a given pad |
194 | const int kBad=-101;//??? to be removed in code | |
09c52ebc | 195 | for(Int_t i=0;i<Rich()->SDigits()->GetEntries();i++){//sdigits loop (sorted) |
196 | AliRICHdigit *pSdig=(AliRICHdigit*)Rich()->SDigits()->At(i); | |
543d5224 | 197 | if(pSdig->Id()==id){//still the same pad |
09c52ebc | 198 | iNdigitsPerPad++; q+=pSdig->Q(); combiPid+=pSdig->CombiPid(); |
543d5224 | 199 | if(iNdigitsPerPad<=3) |
ed3ceb24 | 200 | tid[iNdigitsPerPad-1]=pSdig->Tid(0); |
3582c1f9 | 201 | else |
202 | Warning("SDigits2Digits","More then 3 sdigits for the given pad"); | |
543d5224 | 203 | }else{//new pad, add the pevious one |
09c52ebc | 204 | if(id!=kBad&&Rich()->Param()->IsOverTh(chamber,x,y,q)) { |
205 | Rich()->AddDigit(chamber,x,y,q,combiPid,tid); | |
af3d25a6 | 206 | } |
ed3ceb24 | 207 | combiPid=pSdig->CombiPid();chamber=pSdig->C();id=pSdig->Id(); |
208 | x=pSdig->X();y=pSdig->Y(); | |
209 | q=pSdig->Q(); | |
210 | tid[0]=pSdig->Tid(0); | |
211 | iNdigitsPerPad=1;tid[1]=tid[2]=kBad; | |
543d5224 | 212 | } |
213 | }//sdigits loop (sorted) | |
214 | ||
09c52ebc | 215 | if(Rich()->SDigits()->GetEntries() && Rich()->Param()->IsOverTh(chamber,x,y,q)) |
216 | Rich()->AddDigit(chamber,x,y,q,combiPid,tid);//add the last digit | |
543d5224 | 217 | |
218 | rl->TreeD()->Fill(); | |
219 | rl->WriteDigits("OVERWRITE"); | |
220 | }//events loop | |
221 | rl->UnloadSDigits(); rl->UnloadDigits(); | |
09c52ebc | 222 | Rich()->ResetSDigits(); Rich()->ResetDigits();//reset lists of sdigits and digits |
d32d34bf | 223 | Info("SD_D","Stop."); |
3b96aee8 | 224 | }//SD_D() |
08479a10 | 225 | //__________________________________________________________________________________________________ |
3b96aee8 | 226 | void Show() |
d48cca74 | 227 | { |
abb44d7c | 228 | cout<<endl; |
c60862bf | 229 | al->LoadHeader(); al->LoadKinematics(); |
abb44d7c | 230 | |
aed240d4 | 231 | rl->LoadHits(); |
232 | Bool_t isSdigits=!rl->LoadSDigits(); | |
233 | Bool_t isClusters=!rl->LoadRecPoints(); | |
234 | Bool_t isDigits=!rl->LoadDigits();//loaders | |
c60862bf | 235 | |
236 | cout<<endl; cout<<endl; | |
237 | for(Int_t iEventN=0;iEventN<a->GetEventsPerRun();iEventN++){//events loop | |
238 | Int_t iNparticles=a->GetEvent(iEventN); | |
abb44d7c | 239 | Int_t iNprims=rl->TreeH()->GetEntries(); |
c60862bf | 240 | |
84365c70 | 241 | Int_t iTotalHits=0; |
abb44d7c | 242 | for(Int_t iPrimN=0;iPrimN<iNprims;iPrimN++){//prims loop |
c60862bf | 243 | rl->TreeH()->GetEntry(iPrimN); |
244 | iTotalHits+=r->Hits()->GetEntries(); | |
abb44d7c | 245 | TParticle *pPrim=al->Stack()->Particle(iPrimN); |
84365c70 | 246 | Info("Show","Evt %4i prim %4i has %4i hits from %s (,%7.2f,%7.2f)", |
09c52ebc | 247 | iEventN,iPrimN, r->Hits()->GetEntries(), pPrim->GetName(), pPrim->Theta()*r2d,pPrim->Phi()*r2d); |
abb44d7c | 248 | }//prims loop |
84365c70 | 249 | Info("Show-HITS","Evt %i total: %i particles %i primaries %i hits", |
250 | iEventN, iNparticles, iNprims, iTotalHits); | |
c60862bf | 251 | if(isSdigits){ |
252 | rl->TreeS()->GetEntry(0); | |
d32d34bf | 253 | Info("Show-SDIGITS","Evt %i contains %5i sdigits",iEventN,r->SDigits()->GetEntries()); |
abb44d7c | 254 | } |
c60862bf | 255 | if(isDigits){ |
256 | rl->TreeD()->GetEntry(0); | |
543d5224 | 257 | for(int i=1;i<=7;i++) |
aed240d4 | 258 | Info("Show-DIGITS","Evt %i chamber %i contains %5i digits", |
259 | iEventN, i, r->Digits(i)->GetEntries()); | |
09c52ebc | 260 | }else |
261 | Info("Show-DIGITS","There is no digits for this event"); | |
aed240d4 | 262 | if(isClusters){ |
263 | rl->TreeR()->GetEntry(0); | |
264 | for(int i=1;i<=7;i++) | |
265 | Info("Show-CLUSTERS","Evt %i chamber %i contains %5i clusters", | |
266 | iEventN, i, r->Clusters(i)->GetEntries()); | |
c60862bf | 267 | } |
268 | cout<<endl; | |
abb44d7c | 269 | }//events loop |
aed240d4 | 270 | rl->UnloadHits(); |
271 | if(isSdigits) rl->UnloadSDigits(); | |
272 | if(isDigits) rl->UnloadDigits(); | |
273 | if(isClusters) rl->UnloadRecPoints(); | |
abb44d7c | 274 | al->UnloadHeader(); |
275 | al->UnloadKinematics(); | |
276 | cout<<endl; | |
d48cca74 | 277 | }//void Show() |
aed240d4 | 278 | //__________________________________________________________________________________________________ |
abb44d7c | 279 | |
d48cca74 | 280 | |
d48cca74 | 281 | AliRun *a; |
853634d3 | 282 | AliRunLoader *al; |
283 | AliLoader *rl,*tl,*il; | |
284 | ||
285 | AliRICH *r; | |
853634d3 | 286 | |
d32d34bf | 287 | Bool_t ReadAlice() |
d48cca74 | 288 | { |
d32d34bf | 289 | Info("ReadAlice","Tring to read ALICE from SIMULATED FILE."); |
abb44d7c | 290 | AliLoader::SetDebug(0); |
291 | if(gAlice) delete gAlice; | |
292 | if(!(al=AliRunLoader::Open("galice.root","AlicE","update"))){ | |
293 | gSystem->Exec("rm -rf *.root *.dat"); | |
d32d34bf | 294 | Error("ReadAlice","galice.root broken, removing all this garbage then init new one"); |
295 | new AliRun("gAlice","Alice experiment system"); | |
296 | gAlice->SetDebug(-1); | |
86594bfc | 297 | gAlice->Init("Config.C"); |
d32d34bf | 298 | r=(AliRICH*)gAlice->GetDetector("RICH"); |
299 | return kFALSE; | |
abb44d7c | 300 | } |
301 | al->LoadgAlice(); | |
302 | if(!gAlice) Fatal("ReadAlice","No gAlice in file"); | |
303 | a=al->GetAliRun(); | |
304 | a->SetDebug(0); | |
305 | //RICH | |
306 | if(!(r=(AliRICH*)gAlice->GetDetector("RICH"))) Warning("RICH/menu.C::ReadAlice","No RICH in file"); | |
307 | r->SetDebug(0); | |
308 | if(!(rl=al->GetLoader("RICHLoader"))) Warning("RICH/menu.C::ReadAlice","No RICH loader in file"); | |
309 | ||
310 | Info("ReadAlice","Run contains %i event(s)",gAlice->GetEventsPerRun()); | |
d32d34bf | 311 | return kTRUE; |
abb44d7c | 312 | } |
313 | //__________________________________________________________________________________________________ | |
c33c49f0 | 314 | void TestResponse() |
abb44d7c | 315 | { |
c33c49f0 | 316 | TCanvas *pC=new TCanvas("c","Amplification test",900,800); |
317 | pC->Divide(1,2); | |
318 | pC->cd(1); | |
86594bfc | 319 | TF1 *pF1=new TF1("f1",Gain,-70,70,1); pF1->SetParameters(1,1);pF1->SetParNames("Sector"); |
320 | TF1 *pF2=new TF1("f2",Gain,-70,70,1); pF2->SetParameters(2,1);pF2->SetParNames("Sector"); | |
321 | pF1->Draw();pF2->Draw("same"); | |
c33c49f0 | 322 | |
323 | pC->cd(2); | |
324 | ||
325 | const Int_t nPoints=8; | |
326 | THStack *pStack=new THStack("stack","photons"); | |
327 | TLegend *pLeg=new TLegend(0.6,0.2,0.9,0.5,"legend"); | |
328 | TH1F *apH[nPoints]; | |
329 | ||
330 | Double_t starty=AliRICHParam::DeadZone()/2; | |
331 | Double_t deltay=AliRICHParam::SectorSizeY()/nPoints; | |
332 | ||
333 | for(int i=0;i<nPoints;i++){ | |
86594bfc | 334 | apH[i]=new TH1F(Form("h%i",i),"Qdc for Photon;QDC;Counts",500,0,500); apH[i]->SetLineColor(i); |
c33c49f0 | 335 | pStack->Add(apH[i]); |
336 | pLeg->AddEntry(apH[i],Form("@(0,%5.2f->%5.2f)",starty+i*deltay,starty+i*deltay-AliRICHParam::SectorSizeY()/2)); | |
abb44d7c | 337 | } |
c33c49f0 | 338 | |
339 | ||
86594bfc | 340 | TVector2 x2(0,0); |
c33c49f0 | 341 | // AliRICHParam::ResetWireSag(); |
342 | for(Int_t i=0;i<10000;i++){//events loop | |
343 | for(int j=0;j<nPoints;j++){ | |
86594bfc | 344 | x2.Set(0,starty-j*deltay); |
345 | apH[j]->Fill(AliRICHParam::TotQdc(x2,0)); | |
c33c49f0 | 346 | } |
abb44d7c | 347 | } |
c33c49f0 | 348 | pStack->Draw("nostack"); |
349 | pLeg->Draw(); | |
350 | }//TestResponse() | |
abb44d7c | 351 | //__________________________________________________________________________________________________ |
d32d34bf | 352 | void TestSD() |
abb44d7c | 353 | { |
d32d34bf | 354 | Info("TestSD","Creating test sdigits."); |
86594bfc | 355 | TVector3 hit(426.55,246.28,17.21); |
356 | TVector2 x2=r->C(4)->Glob2Loc(hit); | |
357 | Int_t iTotQdc=r->Param()->TotQdc(x2,624e-9); | |
358 | Int_t iPadXmin,iPadXmax,iPadYmin,iPadYmax; | |
359 | Int_t padx,pady; | |
360 | Int_t sec=r->Param()->Loc2Pad(x2,padx,pady); | |
361 | r->Param()->Loc2Area(x2,iPadXmin,iPadYmin,iPadXmax,iPadYmax); | |
362 | Info("TestSD","Initial hit (%7.2f,%7.2f,%7.2f)->(%7.2f,%7.2f)->(%4i,%4i,%4i) gives %i charge", | |
363 | hit.X(),hit.Y(),hit.Z(),x2.X(),x2.Y(),sec,padx,pady,iTotQdc); | |
364 | ||
365 | cout<<"left-down=("<<iPadXmin<<","<<iPadYmin<<") right-up=("<<iPadXmax<<','<<iPadYmax<<')'<<endl; | |
366 | for(Int_t iPadY=iPadYmin;iPadY<=iPadYmax;iPadY++) | |
367 | for(Int_t iPadX=iPadXmin;iPadX<=iPadXmax;iPadX++) | |
368 | cout<<r->Param()->FracQdc(x2,iPadX,iPadY)<<endl; | |
369 | Info("TestSD","Stop."); | |
543d5224 | 370 | }//void TestSdigits() |
abb44d7c | 371 | //__________________________________________________________________________________________________ |
c67b2d9f | 372 | void TestC() |
abb44d7c | 373 | { |
c67b2d9f | 374 | Info("TestC","Creating test clusters."); |
543d5224 | 375 | rl->MakeTree("R");r->MakeBranch("R"); |
376 | ||
c67b2d9f | 377 | AliRICHcluster c; |
378 | c.AddDigit(new AliRICHdigit(1,20,21,200,1,2,3)); | |
379 | c.AddDigit(new AliRICHdigit(1,22,21,250,1,2,3)); | |
380 | c.CoG(); | |
381 | ||
382 | r->AddCluster(c); | |
383 | ||
543d5224 | 384 | rl->TreeR()->Fill(); |
385 | rl->WriteRecPoints("OVERWRITE"); | |
386 | rl->UnloadRecPoints(); | |
c67b2d9f | 387 | r->ResetClusters(); |
543d5224 | 388 | |
c67b2d9f | 389 | Info("TestC","Stop."); |
390 | }//TestC() | |
543d5224 | 391 | //__________________________________________________________________________________________________ |
392 | void TestSeg() | |
393 | { | |
394 | AliRICHParam *p=r->Param(); | |
86594bfc | 395 | Int_t padx,pady,sec; |
d32d34bf | 396 | Double_t x,y; |
86594bfc | 397 | Double_t eps=0.0000001; |
398 | Double_t x1=-0.5*p->PcSizeX()+eps; Double_t x2=-0.5*p->SectorSizeX()-p->DeadZone()-eps; Double_t x3=-0.5*p->SectorSizeX()+eps; | |
399 | Double_t x6= 0.5*p->PcSizeX()-eps; Double_t x5= 0.5*p->SectorSizeX()+p->DeadZone()+eps; Double_t x4= 0.5*p->SectorSizeX()-eps; | |
400 | Double_t y1=-0.5*p->PcSizeY()+eps; Double_t y2=-0.5*p->DeadZone()-eps; | |
401 | Double_t y4= 0.5*p->PcSizeY()-eps; Double_t y3= 0.5*p->DeadZone()+eps; | |
402 | TVector2 v2; | |
403 | ||
404 | AliRICHParam::Print(); | |
405 | ||
406 | sec=p->Loc2Pad(TVector2(x= 0,y=y1),padx,pady); v2=p->Pad2Loc(padx,pady); Info(" 73- 1","(%7.2f,%7.2f)->(%5i,%5i,%5i) center=(%7.2f,%7.2f)",x,y,sec,padx,pady,v2.X(),v2.Y()); | |
407 | sec=p->Loc2Pad(TVector2(x= 0,y=y2),padx,pady); v2=p->Pad2Loc(padx,pady); Info(" 73- 80","(%7.2f,%7.2f)->(%5i,%5i,%5i) center=(%7.2f,%7.2f)",x,y,sec,padx,pady,v2.X(),v2.Y()); | |
408 | sec=p->Loc2Pad(TVector2(x= 0,y= 0),padx,pady); v2=p->Pad2Loc(padx,pady); Info(" dead ","(%7.2f,%7.2f)->(%5i,%5i,%5i) center=(%7.2f,%7.2f)",x,y,sec,padx,pady,v2.X(),v2.Y()); | |
409 | sec=p->Loc2Pad(TVector2(x= 0,y=y3),padx,pady); v2=p->Pad2Loc(padx,pady); Info(" 73- 81","(%7.2f,%7.2f)->(%5i,%5i,%5i) center=(%7.2f,%7.2f)",x,y,sec,padx,pady,v2.X(),v2.Y()); | |
410 | sec=p->Loc2Pad(TVector2(x= 0,y=y4),padx,pady); v2=p->Pad2Loc(padx,pady); Info(" 73-160","(%7.2f,%7.2f)->(%5i,%5i,%5i) center=(%7.2f,%7.2f)\n",x,y,sec,padx,pady,v2.X(),v2.Y()); | |
411 | ||
412 | sec=p->Loc2Pad(TVector2(x=x1,y=y4),padx,pady); v2=p->Pad2Loc(padx,pady); Info(" 1-160","(%7.2f,%7.2f)->(%5i,%5i,%5i) center=(%7.2f,%7.2f)",x,y,sec,padx,pady,v2.X(),v2.Y()); | |
413 | sec=p->Loc2Pad(TVector2(x=x2,y=y4),padx,pady); v2=p->Pad2Loc(padx,pady); Info(" 48-160","(%7.2f,%7.2f)->(%5i,%5i,%5i) center=(%7.2f,%7.2f)",x,y,sec,padx,pady,v2.X(),v2.Y()); | |
414 | sec=p->Loc2Pad(TVector2(x=x3,y=y4),padx,pady); v2=p->Pad2Loc(padx,pady); Info(" 49-160","(%7.2f,%7.2f)->(%5i,%5i,%5i) center=(%7.2f,%7.2f)",x,y,sec,padx,pady,v2.X(),v2.Y()); | |
415 | sec=p->Loc2Pad(TVector2(x=x4,y=y4),padx,pady); v2=p->Pad2Loc(padx,pady); Info(" 96-160","(%7.2f,%7.2f)->(%5i,%5i,%5i) center=(%7.2f,%7.2f)",x,y,sec,padx,pady,v2.X(),v2.Y()); | |
416 | sec=p->Loc2Pad(TVector2(x=x5,y=y4),padx,pady); v2=p->Pad2Loc(padx,pady); Info(" 97-160","(%7.2f,%7.2f)->(%5i,%5i,%5i) center=(%7.2f,%7.2f)",x,y,sec,padx,pady,v2.X(),v2.Y()); | |
417 | sec=p->Loc2Pad(TVector2(x=x6,y=y4),padx,pady); v2=p->Pad2Loc(padx,pady); Info("144-160","(%7.2f,%7.2f)->(%5i,%5i,%5i) center=(%7.2f,%7.2f)\n",x,y,sec,padx,pady,v2.X(),v2.Y()); | |
418 | ||
419 | sec=p->Loc2Pad(TVector2(x=x1,y=y3),padx,pady); v2=p->Pad2Loc(padx,pady); Info(" 1- 81","(%7.2f,%7.2f)->(%5i,%5i,%5i) center=(%7.2f,%7.2f)",x,y,sec,padx,pady,v2.X(),v2.Y()); | |
420 | sec=p->Loc2Pad(TVector2(x=x2,y=y3),padx,pady); v2=p->Pad2Loc(padx,pady); Info(" 48- 81","(%7.2f,%7.2f)->(%5i,%5i,%5i) center=(%7.2f,%7.2f)",x,y,sec,padx,pady,v2.X(),v2.Y()); | |
421 | sec=p->Loc2Pad(TVector2(x=x3,y=y3),padx,pady); v2=p->Pad2Loc(padx,pady); Info(" 49- 81","(%7.2f,%7.2f)->(%5i,%5i,%5i) center=(%7.2f,%7.2f)",x,y,sec,padx,pady,v2.X(),v2.Y()); | |
422 | sec=p->Loc2Pad(TVector2(x=x4,y=y3),padx,pady); v2=p->Pad2Loc(padx,pady); Info(" 96- 81","(%7.2f,%7.2f)->(%5i,%5i,%5i) center=(%7.2f,%7.2f)",x,y,sec,padx,pady,v2.X(),v2.Y()); | |
423 | sec=p->Loc2Pad(TVector2(x=x5,y=y3),padx,pady); v2=p->Pad2Loc(padx,pady); Info(" 97- 81","(%7.2f,%7.2f)->(%5i,%5i,%5i) center=(%7.2f,%7.2f)",x,y,sec,padx,pady,v2.X(),v2.Y()); | |
424 | sec=p->Loc2Pad(TVector2(x=x6,y=y3),padx,pady); v2=p->Pad2Loc(padx,pady); Info("144- 81","(%7.2f,%7.2f)->(%5i,%5i,%5i) center=(%7.2f,%7.2f)\n",x,y,sec,padx,pady,v2.X(),v2.Y()); | |
425 | ||
426 | sec=p->Loc2Pad(TVector2(x=x1,y=y2),padx,pady); v2=p->Pad2Loc(padx,pady); Info(" 1- 80","(%7.2f,%7.2f)->(%5i,%5i,%5i) center=(%7.2f,%7.2f)",x,y,sec,padx,pady,v2.X(),v2.Y()); | |
427 | sec=p->Loc2Pad(TVector2(x=x2,y=y2),padx,pady); v2=p->Pad2Loc(padx,pady); Info(" 48- 80","(%7.2f,%7.2f)->(%5i,%5i,%5i) center=(%7.2f,%7.2f)",x,y,sec,padx,pady,v2.X(),v2.Y()); | |
428 | sec=p->Loc2Pad(TVector2(x=x3,y=y2),padx,pady); v2=p->Pad2Loc(padx,pady); Info(" 49- 80","(%7.2f,%7.2f)->(%5i,%5i,%5i) center=(%7.2f,%7.2f)",x,y,sec,padx,pady,v2.X(),v2.Y()); | |
429 | sec=p->Loc2Pad(TVector2(x=x4,y=y2),padx,pady); v2=p->Pad2Loc(padx,pady); Info(" 96- 80","(%7.2f,%7.2f)->(%5i,%5i,%5i) center=(%7.2f,%7.2f)",x,y,sec,padx,pady,v2.X(),v2.Y()); | |
430 | sec=p->Loc2Pad(TVector2(x=x5,y=y2),padx,pady); v2=p->Pad2Loc(padx,pady); Info(" 97- 80","(%7.2f,%7.2f)->(%5i,%5i,%5i) center=(%7.2f,%7.2f)",x,y,sec,padx,pady,v2.X(),v2.Y()); | |
431 | sec=p->Loc2Pad(TVector2(x=x6,y=y2),padx,pady); v2=p->Pad2Loc(padx,pady); Info("144- 80","(%7.2f,%7.2f)->(%5i,%5i,%5i) center=(%7.2f,%7.2f)\n",x,y,sec,padx,pady,v2.X(),v2.Y()); | |
432 | ||
433 | sec=p->Loc2Pad(TVector2(x=x1,y=y1),padx,pady); v2=p->Pad2Loc(padx,pady); Info(" 1- 1","(%7.2f,%7.2f)->(%5i,%5i,%5i) center=(%7.2f,%7.2f)",x,y,sec,padx,pady,v2.X(),v2.Y()); | |
434 | sec=p->Loc2Pad(TVector2(x=x2,y=y1),padx,pady); v2=p->Pad2Loc(padx,pady); Info(" 48- 1","(%7.2f,%7.2f)->(%5i,%5i,%5i) center=(%7.2f,%7.2f)",x,y,sec,padx,pady,v2.X(),v2.Y()); | |
435 | sec=p->Loc2Pad(TVector2(x=x3,y=y1),padx,pady); v2=p->Pad2Loc(padx,pady); Info(" 49- 1","(%7.2f,%7.2f)->(%5i,%5i,%5i) center=(%7.2f,%7.2f)",x,y,sec,padx,pady,v2.X(),v2.Y()); | |
436 | sec=p->Loc2Pad(TVector2(x=x4,y=y1),padx,pady); v2=p->Pad2Loc(padx,pady); Info(" 96- 1","(%7.2f,%7.2f)->(%5i,%5i,%5i) center=(%7.2f,%7.2f)",x,y,sec,padx,pady,v2.X(),v2.Y()); | |
437 | sec=p->Loc2Pad(TVector2(x=x5,y=y1),padx,pady); v2=p->Pad2Loc(padx,pady); Info(" 97- 1","(%7.2f,%7.2f)->(%5i,%5i,%5i) center=(%7.2f,%7.2f)",x,y,sec,padx,pady,v2.X(),v2.Y()); | |
438 | sec=p->Loc2Pad(TVector2(x=x6,y=y1),padx,pady); v2=p->Pad2Loc(padx,pady); Info("144- 1","(%7.2f,%7.2f)->(%5i,%5i,%5i) center=(%7.2f,%7.2f)\n",x,y,sec,padx,pady,v2.X(),v2.Y()); | |
439 | ||
543d5224 | 440 | }//void TestSeg() |
abb44d7c | 441 | //__________________________________________________________________________________________________ |
543d5224 | 442 | void TestMenu() |
abb44d7c | 443 | { |
543d5224 | 444 | TControlBar *pMenu = new TControlBar("vertical","RICH test"); |
c67b2d9f | 445 | pMenu->AddButton("Test segmentation", "TestSeg()", "Test AliRICHParam segmentation methods"); |
c33c49f0 | 446 | pMenu->AddButton("Test response", "TestResponse()", "Test AliRICHParam response methods"); |
d32d34bf | 447 | pMenu->AddButton("Test sdigits", "TestSD()", "Create test set of sdigits"); |
c67b2d9f | 448 | pMenu->AddButton("Test clusters", "TestC()", "Create test set of clusters"); |
86594bfc | 449 | pMenu->AddButton("Test digits OLD", "TestDigitsOLD()", "Create test set of OLD digits"); |
543d5224 | 450 | pMenu->Show(); |
451 | }//TestMenu() | |
452 | //__________________________________________________________________________________________________ | |
543d5224 | 453 | void menu() |
454 | { | |
455 | TControlBar *pMenu = new TControlBar("vertical","RICH main"); | |
456 | ||
d32d34bf | 457 | if(ReadAlice()){//it's from file, reconstruct |
3b96aee8 | 458 | pMenu->AddButton("hits->sdigits->digits->clusters","MainTrank()","Convert"); |
d32d34bf | 459 | |
86594bfc | 460 | pMenu->AddButton("sdigits->digits" ,"SD_D()" ,"AliRICHDigitizer"); |
461 | pMenu->AddButton("digits->clusters" ,"D_C()" ,"AliRICHClusterFinder"); | |
462 | pMenu->AddButton("clusters->recos" ,"C_R()" ,"AliRICHRecon"); | |
543d5224 | 463 | |
86594bfc | 464 | pMenu->AddButton("Show", "Show()","Shows the structure of events in files"); |
465 | pMenu->AddButton("Display Fast", "DisplFast()", "Display Fast"); | |
466 | pMenu->AddButton("Control Plots", "ControlPlots()", "Display some control histograms"); | |
d32d34bf | 467 | pMenu->AddButton("OLD specials->sdigits", "OLD_S_SD()", "Perform first phase converstion"); |
543d5224 | 468 | |
469 | }else{//it's aliroot, simulate | |
470 | pMenu->AddButton("Run", "a->Run(1)", "Process!"); | |
86594bfc | 471 | pMenu->AddButton("Geo GUI", "new G3GeometryGUI;","Create instance of G4GeometryGUI"); |
543d5224 | 472 | } |
543d5224 | 473 | pMenu->AddButton("Test submenu", "TestMenu()", "Shows test submenu"); |
474 | pMenu->AddButton("Browser", "new TBrowser;", "Start ROOT TBrowser"); | |
3b96aee8 | 475 | pMenu->AddButton("Debug ON", "DebugON();", "Switch debug on-off"); |
476 | pMenu->AddButton("Debug OFF", "DebugOFF();", "Switch debug on-off"); | |
543d5224 | 477 | pMenu->AddButton("Quit", ".q", "Close session"); |
478 | pMenu->Show(); | |
479 | a=gAlice;//for manual manipulation convinience | |
480 | }//menu() | |
481 | //__________________________________________________________________________________________________ | |
3b96aee8 | 482 | void DebugOFF(){ Info("DebugOFF",""); a->SetDebug(0); r->SetDebug(0); AliLoader::SetDebug(0);} |
483 | void DebugON() { Info("DebugON",""); a->SetDebug(1); r->SetDebug(1); AliLoader::SetDebug(1);} |