-void Digits2Recos()
-{
- AliRICHPatRec *detect = new AliRICHPatRec("RICH patrec algorithm","Reconstruction");
-
+AliRICH * Rich() {return r;}
- for (int nev=0; nev<= a->GetEventsPerRun(); nev++) { // Event Loop
- al->GetEvent(nev);
- cout <<endl<< "Processing event:" <<nev<<endl;
- detect->PatRec();
- } // event loop
-}
+Int_t countContrib[7][3];
-
-
-void Hits2Digits()
+void ControlPlots()
+{
+ Int_t iChamber=1;
+
+ TFile *pFile = new TFile("$(HOME)/plots.root","RECREATE");
+ Bool_t isDig =!Rich()->GetLoader()->LoadDigits();
+ Bool_t isClus=!Rich()->GetLoader()->LoadRecPoints();
+ TH1F *pHxD,*pHyD,*pCqH1,*pCsH1,pCqMipH1,*pCsMipH1,*pCqCerH1,*pCsCerH1,*pCqFeeH1,*pCsFeeH1;
+ TH2F *pCmH2,*pCmMipH2,*pCmCerH2,*pCmFeeH2;
+ if(isDig){
+ pHxD=new TH1F("HitDigitDiffX","Hit-Digits diff X all chambers;diff [cm]",20,-2,2);
+ pHyD=new TH1F("HitDigitDiffY","Hit-Digits diff Y all chambers;diff [cm]",20,-2,2);
+ }//isDig
+
+ if(isClus){
+ pCqH1=new TH1F("ClusQ", "Cluster Charge all chambers;q [QDC]",Rich()->P()->MaxQdc(),0,Rich()->P()->MaxQdc());
+ pCsH1=new TH1F("ClusSize","Cluster size all chambers;size [number of pads in cluster]",100,0,100);
+ pCmH2=new TH2F("ClusMap", "Cluster map;x [cm];y [cm]",1000,-Rich()->P()->PcSizeX()/2,Rich()->P()->PcSizeX()/2,
+ 1000,-Rich()->P()->PcSizeY()/2,Rich()->P()->PcSizeY()/2);
+
+ pCqMipH1=new TH1F("MipClusQ", "MIP Cluster Charge all chambers;q [QDC]",r->P()->MaxQdc(),0,r->P()->MaxQdc());
+ pCsMipH1=new TH1F("MipClusSize","MIP Cluster size all chambers;size [number of pads in cluster]",100,0,100);
+ pCmMipH2=new TH2F("MipClusMap", "MIP Cluster map;x [cm];y [cm]",1000,-r->P()->PcSizeX()/2,r->P()->PcSizeX()/2,
+ 1000,-r->P()->PcSizeY()/2,r->P()->PcSizeY()/2);
+
+ pCqCerH1=new TH1F("CerClusQ", "Cerenkov Cluster Charge all chambers;q [QDC]",r->P()->MaxQdc(),0,r->P()->MaxQdc());
+ pCsCerH1=new TH1F("CerClusSize","Cernekov Cluster size all chambers;size [number of pads in cluster]",100,0,100);
+ pCmCerH2=new TH2F("CerClusMap", "Cerenkov Cluster map;x [cm];y [cm]",1000,-r->P()->PcSizeX()/2,r->P()->PcSizeX()/2,
+ 1000,-r->P()->PcSizeY()/2,r->P()->PcSizeY()/2);
+
+ pCqFeeH1=new TH1F("FeeClusQ", "Feedback Cluster Charge all chambers;q [QDC]",r->P()->MaxQdc(),0,r->P()->MaxQdc());
+ pCsFeeH1=new TH1F("FeeClusSize","Feedback Cluster size all chambers;size [number of pads in cluster]",100,0,100);
+ pCmFeeH2=new TH2F("FeeClusMap", "Feedback Cluster map;x [cm];y [cm]",1000,-r->P()->PcSizeX()/2,r->P()->PcSizeX()/2,
+ 1000,-r->P()->PcSizeY()/2,r->P()->PcSizeY()/2);
+ }//isClus
+
+ for(Int_t iEvtN=0;iEvtN<a->GetEventsPerRun();iEvtN++){//events loop
+ al->GetEvent(iEvtN);
+ for(Int_t iChamN=1;iChamN<=7;iChamN++){//chambers loop
+ if(isClus){
+ Rich()->GetLoader()->TreeR()->GetEntry(0);
+ for(Int_t iClusN=0;iClusN<r->Clusters(iChamN)->GetEntries();iClusN++){//clusters loop
+ AliRICHcluster *pClus=(AliRICHcluster*)r->Clusters(iChamN)->At(iClusN);
+ countContrib[i-1][0] += pClus->Nmips();countContrib[i-1][1] += pClus->Ncerenkovs();countContrib[i-1][2] += pClus->Nfeedbacks();
+ pCqH1->Fill(pClus->Q()); pCsH1->Fill(pClus->Size()); pCmH2->Fill(pClus->X(),pClus->Y()); //common
+ if(pClus->IsPureMip()) {pCqMipH1->Fill(pClus->Q());pCsMipH1->Fill(pClus->Size());pCmMipH2->Fill(pClus->X(),pClus->Y());}//Pure Mips
+ if(pClus->IsPureCerenkov()){pCqCerH1->Fill(pClus->Q());pCsCerH1->Fill(pClus->Size());pCmCerH2->Fill(pClus->X(),pClus->Y());}//Pure Photons
+ if(pClus->IsPureFeedback()){pCqFeeH1->Fill(pClus->Q());pCsFeeH1->Fill(pClus->Size());pCmFeeH2->Fill(pClus->X(),pClus->Y());}//Pure Feedbacks
+ }//clusters loop
+ }//isClus
+ if(isDig){
+ Rich()->GetLoader()->TreeD()->GetEntry(0);
+ for(Int_t iDigN=0;iDigN<r->Digits(iChamN)->GetEntries();iDigN++){//digits loop
+ AliRICHdigit *pDig=(AliRICHdigit*)r->Digits(iChamN)->At(iDigN);
+ AliRICHhit *pHit=hit(pDig->Tid(0));
+ cout<<"chamber "<<iChamN<<" digit "<<iDigN<<endl;
+ TVector2 hitV2=Rich()->C(iChamN)->Glob2Loc(pHit->OutX3()); TVector2 digV2=Rich()->P()->Pad2Loc(pDig->X(),pDig->Y());
+ pHxD->Fill(hitV2.X()-digV2.X()); pHyD->Fill(hitV2.Y()-digV2.Y());
+ }//digits loop
+ }//isDig
+ }//chambers loop
+ Info("ControlPlots","Event %i processed.",iEvtN);
+ }//events loop
+
+ if(isDig) Rich()->GetLoader()->UnloadDigits();
+ if(isClus) Rich()->GetLoader()->UnloadRecPoints();
+
+ pHxD->Draw(); pHyD->SetLineColor(kRed);pHyD->Draw("same");
+
+ pFile->Write(); delete pFile;
+ for(Int_t i=0;i<7;i++) cout<<" chamber "<<i+1<<" n. mips "<<countContrib[i][0]<<" n. ckovs "<<countContrib[i][1]<<" n. fdbks "<<countContrib[i][2]<<endl;
+}//void ControlPlots()
+//__________________________________________________________________________________________________
+void MainTrank()
{
TStopwatch sw;TDatime time;
- r->Hits2SDigits();r->SDigits2Digits();
- cout<<"\nInfo in <hits->digits>: Start time: ";time.Print();
- cout<<"Info in <hits->digits>: Stop time: ";time.Set(); time.Print();
- cout<<"Info in <hits->digits>: Time used: ";sw.Print();
+ H_SD(); SD_D(); AliRICHClusterFinder *z=new AliRICHClusterFinder(r); z->Exec();//delete z;
+ cout<<"\nInfo in <MainTrank>: Start time: ";time.Print();
+ cout<<"Info in <MainTrank>: Stop time: ";time.Set(); time.Print();
+ cout<<"Info in <MainTrank>: Time used: ";sw.Print();
}
-
-void DigitsOLD2RawClustersOLD()
+//__________________________________________________________________________________________________
+void sh()
{
- AliRICHClusterFinder *z=new AliRICHClusterFinder(r);
- z->Exec();
+ Rich()->GetLoader()->LoadHits();
+
+ Int_t iTotalHits=0;
+ for(Int_t iPrimN=0;iPrimN<rl->TreeH()->GetEntries();iPrimN++){//prims loop
+ Rich()->GetLoader()->TreeH()->GetEntry(iPrimN);
+ Rich()->Hits()->Print();
+ iTotalHits+=r->Hits()->GetEntries();
+ }
+ Info("sh","totally %i hits",iTotalHits);
+ Rich()->GetLoader()->UnloadHits();
}
-
-void Specials2DigitsOLD()
+//__________________________________________________________________________________________________
+AliRICHhit* hit(Int_t tid)
+{//print hits for given tid
+ Rich()->GetLoader()->LoadHits();
+ for(Int_t iPrimN=0;iPrimN<Rich()->GetLoader()->TreeH()->GetEntries();iPrimN++){//prims loop
+ Rich()->GetLoader()->TreeH()->GetEntry(iPrimN);
+ for(Int_t iHitN=0;iHitN<Rich()->Hits()->GetEntries();iHitN++){
+ AliRICHhit *pHit=(AliRICHhit*)Rich()->Hits()->At(iHitN);
+ if(tid==pHit->Track()) {Rich()->GetLoader()->UnloadHits();return pHit;}
+ }//hits
+ }//prims loop
+ Rich()->GetLoader()->UnloadHits();
+}
+//__________________________________________________________________________________________________
+void ss()
{
- Info("OLDspec2d","Start.");
-
-// delete gAlice;
-
- AliRunDigitizer *pManager = new AliRunDigitizer(1,1);
- pManager->SetDebug(10);
- pManager->SetInputStream(0,"galice.root");
- new AliRICHDigitizer(pManager);
- pManager->Exec("deb");
- delete pManager;
- Info("OLDspec2d","Stop.");
+ if(rl->LoadSDigits()) return;
+ rl->TreeS()->GetEntry(0);
+ r->SDigits()->Print();
+ Info("ss","totally %i sdigits",r->SDigits()->GetEntries());
+ rl->UnloadSDigits();
}
-
-void Specials2Sdigits()
+//__________________________________________________________________________________________________
+void sd()
{
- Info("Specials2Sdigits","Start.");
-
- rl->LoadHits();
-
- for(Int_t iEventN=0;iEventN<a->GetEventsPerRun();iEventN++){//events loop
- al->GetEvent(iEventN);
-
- rl->MakeTree("S"); r->MakeBranch("S");
- r->ResetSdigits(); r->ResetSpecialsOld();
-
- for(Int_t iPrimN=0;iPrimN<rl->TreeH()->GetEntries();iPrimN++){//prims loop
- rl->TreeH()->GetEntry(iPrimN);
- for(Int_t i=0;i<r->Specials()->GetEntries();i++){//specials loop
- Int_t padx= ((AliRICHSDigit*)r->Specials()->At(i))->PadX();
- Int_t pady= ((AliRICHSDigit*)r->Specials()->At(i))->PadY();
- Int_t qdc= ((AliRICHSDigit*)r->Specials()->At(i))->QPad();
- Int_t hitN= ((AliRICHSDigit*)r->Specials()->At(i))->HitNumber()-1;//!!! important -1
- Int_t chamber=((AliRICHhit*)r->Hits()->At(hitN))->C();
- Int_t track=((AliRICHhit*)r->Hits()->At(hitN))->GetTrack();
- r->AddSdigit(chamber,padx+r->Param()->NpadsX()/2,pady+r->Param()->NpadsY()/2,qdc,track);
- }//specials loop
- }//prims loop
- rl->TreeS()->Fill();
- rl->WriteSDigits("OVERWRITE");
- }//events loop
- rl->UnloadHits(); rl->UnloadSDigits();
- Info("Specials2Sdigits","Stop.");
-}//Specials2Sdigits()
+ if(rl->LoadDigits()) return;
+ rl->TreeD()->GetEntry(0);
+ Int_t iTotalDigits=0;
+ for(int i=1;i<=7;i++){
+ r->Digits(i)->Print();
+ iTotalDigits+=r->Digits(i)->GetEntries();
+ }
+ Info("sd","totally %i digits",iTotalDigits);
+ rl->UnloadDigits();
+}
//__________________________________________________________________________________________________
-void Hits2Sdigits()
+void sc()
{
- Info("Hits2Sdigits","Start.");
-
- for(Int_t iEventN=0;iEventN<a->GetEventsPerRun();iEventN++){//events loop
- al->GetEvent(iEventN);
+ if(rl->LoadRecPoints()) return;
+ r->SetTreeAddress();
+ rl->TreeR()->GetEntry(0);
+ for(int i=1;i<=7;i++) r->Clusters(i)->Print();
+ rl->UnloadRecPoints();
+}
+//__________________________________________________________________________________________________
+void sp(int tid)
+{
+ Rich()->GetLoader()->GetRunLoader()->LoadHeader(); Rich()->GetLoader()->GetRunLoader()->LoadKinematics();
- if(!rl->TreeH()) rl->LoadHits();//from
- if(!rl->TreeS()) rl->MakeTree("S"); r->MakeBranch("S");//to
-
- NOT YET DONE!
- for(Int_t iPrimN=0;iPrimN<rl->TreeH()->GetEntries();iPrimN++){//prims loop
- rl->TreeH()->GetEntry(iPrimN);
- for(Int_t iHitN=0;iHitN<r->Hits()->GetEntries();iHitN++){//hits loop
- AliRICHhit *pHit=r->Hits()->At(iHitN);
- r->Param()->G2Px
- r->AddSdigit(pHit->C(),padx+r->Param()->NpadsX()/2,pady+r->Param()->NpadsY()/2,qdc,track);
- }
- }
- rl->TreeS()->Fill();
- rl->WriteSDigits("OVERWRITE");
- }//events loop
+ if(tid<0||tid>=Rich()->GetLoader()->GetRunLoader()->Stack()->GetNtrack())
+ cout<<"Valid tid number is 0-"<<Rich()->GetLoader()->GetRunLoader()->Stack()->GetNtrack()-1<<" for this event.\n";
+ else
+ PrintParticleInfo(tid);
- rl->UnloadHits();
- rl->UnloadSDigits();
- Info("Hits2Sdigits","Stop.");
-}//Hits2Sdigits()
+ Rich()->GetLoader()->GetRunLoader()->UnloadKinematics(); Rich()->GetLoader()->GetRunLoader()->UnloadHeader();
+}
//__________________________________________________________________________________________________
-void Sdigits2Digits()
+void PrintParticleInfo(int tid)
{
- Info("Sdigits2Digits","Start.");
-
- rl->LoadSDigits();
+ TParticle *p=al->Stack()->Particle(tid);
+ cout<<p->GetName()<<"("<<tid<<")";
+ if(p->GetMother(0)!=-1){cout<<" from "; PrintParticleInfo(p->GetMother(0));}
+ else {cout<<endl;}
+}
+//__________________________________________________________________________________________________
+Int_t prim(Int_t tid)
+{
+ Rich()->GetLoader()->GetRunLoader()->LoadHeader(); Rich()->GetLoader()->GetRunLoader()->LoadKinematics();
- for(Int_t iEventN=0;iEventN<a->GetEventsPerRun();iEventN++){//events loop
- al->GetEvent(iEventN);
-
- rl->MakeTree("D");r->MakeBranch("D"); //create TreeD with RICH branches
- r->ResetSdigits();r->ResetDigits();//reset lists of sdigits and digits
- rl->TreeS()->GetEntry(0);
- r->Sdigits()->Sort();
-
- Int_t kBad=-101;
- Int_t chamber,x,y,qdc,tr[3],id;
- chamber=x=y=qdc=tr[0]=tr[1]=tr[2]=id=kBad;
- Int_t iNdigitsPerPad=kBad;//how many sdigits for a given pad
-
- for(Int_t i=0;i<r->Sdigits()->GetEntries();i++){//sdigits loop (sorted)
- AliRICHdigit *pSdig=(AliRICHdigit*)r->Sdigits()->At(i);
- if(pSdig->Id()==id){//still the same pad
- iNdigitsPerPad++;
- qdc+=pSdig->Qdc();
- if(iNdigitsPerPad<=3)
- tr[iNdigitsPerPad-1]=pSdig->T(0);
- else
- Info("","More then 3 sdigits for the given pad");
- }else{//new pad, add the pevious one
- if(id!=kBad) r->AddDigit(chamber,x,y,qdc,tr[0],tr[1],tr[2]);//ch-xpad-ypad-qdc-tr1-2-3
- chamber=pSdig->C();x=pSdig->X();y=pSdig->Y();qdc=pSdig->Qdc();tr[0]=pSdig->T(0);id=pSdig->Id();
- iNdigitsPerPad=1;tr[1]=tr[2]=kBad;
- }
- }//sdigits loop (sorted)
+ if(tid<0||tid>=Rich()->GetLoader()->GetRunLoader()->Stack()->GetNtrack())
+ cout<<"Valid tid number is 0-"<<Rich()->GetLoader()->GetRunLoader()->Stack()->GetNtrack()-1<<" for this event.\n";
+ else
+ while(1){
+ TParticle *p=Rich()->GetLoader()->GetRunLoader()->GetAliRun()->Stack()->Particle(tid);
+ if(p->GetMother(0)==-1) break;
+ tid=p->GetMother(0);
+ }
- r->AddDigit(chamber,x,y,qdc,tr[0],tr[1],tr[2]);//add the last digit
-
- rl->TreeD()->Fill();
- rl->WriteDigits("OVERWRITE");
- }//events loop
- rl->UnloadSDigits(); rl->UnloadDigits();
- r->ResetSdigits();r->ResetDigits();//reset lists of sdigits and digits
- Info("Sdigits2Digits","Stop.");
+ Rich()->GetLoader()->GetRunLoader()->UnloadKinematics(); Rich()->GetLoader()->GetRunLoader()->UnloadHeader();
+ return tid;
}
+//__________________________________________________________________________________________________
+Double_t r2d = TMath::RadToDeg();
+Double_t d2r = TMath::DegToRad();
+void DisplFast(){ AliRICHDisplFast *d = new AliRICHDisplFast(); d->Exec();}
-void Sdigits2DigitsOLD()
+
+void C_R()
{
- Info("Sdigits2DigitsOLD","Start.");
+ AliRICHRecon *detect = new AliRICHRecon("RICH patrec algorithm","Reconstruction");
+
+
+ for (int nev=0; nev< a->GetEventsPerRun(); nev++) { // Event Loop
+ al->GetEvent(nev);
+ cout <<endl<< "Processing event:" <<nev<<endl;
+ detect->StartProcessEvent();
+ } // event loop
+ delete detect;
+}
+//__________________________________________________________________________________________________
+void D_C()
+{
+ TStopwatch sw;TDatime time;
+
+ AliRICHClusterFinder *z=new AliRICHClusterFinder(r); z->Exec();
+ cout << endl;
+ cout << "Info in Digits->Clusters: Start time: ";time.Print();
+ cout << "Info in Digits->Clusters: Stop time: ";time.Set(); time.Print();
+ cout << "Info in Digits->Clusters: Time used: ";sw.Print();
+}
+//__________________________________________________________________________________________________
+
+void SD_D()
+{
+ Info("SD_D","Start.");
+ extern Int_t kBad;
+ Rich()->Param()->GenSigmaThMap();
rl->LoadSDigits();
for(Int_t iEventN=0;iEventN<a->GetEventsPerRun();iEventN++){//events loop
- al->GetEvent(iEventN);
-
- rl->MakeTree("D");r->MakeBranch("D"); //create TreeD with RICH branches
- r->ResetSdigits();r->ResetDigitsOld();//reset lists of sdigits and digits
- rl->TreeS()->GetEntry(0);
- r->Sdigits()->Sort();
-
- Int_t kBad=-101;
-
- 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;
- Int_t chamber=kBad,id=kBad,iNdigitsPerPad=kBad;//how many sdigits for a given pad
-
- for(Int_t i=0;i<r->Sdigits()->GetEntries();i++){//sdigits loop (sorted)
- AliRICHdigit *pSdig=(AliRICHdigit*)r->Sdigits()->At(i);
+ al->GetEvent(iEventN); cout<<"Event "<<iEventN<<endl;
+ rl->MakeTree("D"); Rich()->MakeBranch("D"); //create TreeD with RICH branches
+ Rich()->ResetSDigits(); Rich()->ResetDigits(); //reset lists of sdigits and digits
+ rl->TreeS()->GetEntry(0); //get sdigits to memory container
+ Rich()->SDigits()->Sort();
+
+ Int_t combiPid=0,chamber=0,x=0,y=0,tid[3],id=0; Double_t q=0;
+ Int_t iNdigitsPerPad;//how many sdigits for a given pad
+ const int kBad=-101;//??? to be removed in code
+ for(Int_t i=0;i<Rich()->SDigits()->GetEntries();i++){//sdigits loop (sorted)
+ AliRICHdigit *pSdig=(AliRICHdigit*)Rich()->SDigits()->At(i);
if(pSdig->Id()==id){//still the same pad
- iNdigitsPerPad++;
- dig[2]+=pSdig->Qdc();//sum up qdc
+ iNdigitsPerPad++; q+=pSdig->Q(); combiPid+=pSdig->CombiPid();
if(iNdigitsPerPad<=3)
- tr[iNdigitsPerPad-1]=pSdig->T(0);
+ tid[iNdigitsPerPad-1]=pSdig->Tid(0);
else
- Info("","More then 3 sdigits for the given pad");
+ Warning("SDigits2Digits","More then 3 sdigits for the given pad");
}else{//new pad, add the pevious one
- if(id!=kBad) r->AddDigitOld(chamber,tr,q,dig);
- chamber=pSdig->C();dig[0]=pSdig->X();dig[1]=pSdig->Y();dig[2]=pSdig->Qdc();tr[0]=pSdig->T(0);id=pSdig->Id();
- iNdigitsPerPad=1;tr[1]=tr[2]=kBad;
+ if(id!=kBad&&Rich()->Param()->IsOverTh(chamber,x,y,q)) {
+ Rich()->AddDigit(chamber,x,y,q,combiPid,tid);
+ }
+ combiPid=pSdig->CombiPid();chamber=pSdig->C();id=pSdig->Id();
+ x=pSdig->X();y=pSdig->Y();
+ q=pSdig->Q();
+ tid[0]=pSdig->Tid(0);
+ iNdigitsPerPad=1;tid[1]=tid[2]=kBad;
}
}//sdigits loop (sorted)
- r->AddDigitOld(chamber,tr,q,dig);//add the last digit
+
+ if(Rich()->SDigits()->GetEntries() && Rich()->Param()->IsOverTh(chamber,x,y,q))
+ Rich()->AddDigit(chamber,x,y,q,combiPid,tid);//add the last digit
rl->TreeD()->Fill();
rl->WriteDigits("OVERWRITE");
}//events loop
rl->UnloadSDigits(); rl->UnloadDigits();
- r->ResetSdigits();r->ResetDigitsOld();//reset lists of sdigits and digits
- Info("Sdigits2DigitsOLD","Stop.");
-}
-
-
-void Show3()
+ Rich()->ResetSDigits(); Rich()->ResetDigits();//reset lists of sdigits and digits
+ Info("SD_D","Stop.");
+}//SD_D()
+//__________________________________________________________________________________________________
+void Show()
{
cout<<endl;
al->LoadHeader(); al->LoadKinematics();
- rl->LoadHits(); Bool_t isSdigits=!rl->LoadSDigits(); Bool_t isDigits=!rl->LoadDigits();//loaders
+ rl->LoadHits();
+ Bool_t isSdigits=!rl->LoadSDigits();
+ Bool_t isClusters=!rl->LoadRecPoints();
+ Bool_t isDigits=!rl->LoadDigits();//loaders
cout<<endl; cout<<endl;
for(Int_t iEventN=0;iEventN<a->GetEventsPerRun();iEventN++){//events loop
Int_t iNparticles=a->GetEvent(iEventN);
Int_t iNprims=rl->TreeH()->GetEntries();
- Int_t iTotalHits=0,iTotalCerenkovs=0,iTotalSpecials=0;
+ Int_t iTotalHits=0;
for(Int_t iPrimN=0;iPrimN<iNprims;iPrimN++){//prims loop
rl->TreeH()->GetEntry(iPrimN);
iTotalHits+=r->Hits()->GetEntries();
- iTotalCerenkovs+=r->Cerenkovs()->GetEntries();
- iTotalSpecials+=r->Specials()->GetEntries();
TParticle *pPrim=al->Stack()->Particle(iPrimN);
- Info("Show","Evt %4i prim %4i has %4i hits %5i cerenkovs and %5i specials from %s (,%7.2f,%7.2f)",
- iEventN,
- iPrimN,
- r->Hits()->GetEntries(),
- r->Cerenkovs()->GetEntries(),
- r->Specials()->GetEntries(),
- pPrim->GetName(),
- pPrim->Theta()*r2d,pPrim->Phi()*r2d);
+ if(iPrimN<10) Info("Show","Evt %4i prim %4i has %4i hits from %s (,%7.2f,%7.2f)",
+ iEventN,iPrimN, r->Hits()->GetEntries(), pPrim->GetName(), pPrim->Theta()*r2d,pPrim->Phi()*r2d);
}//prims loop
- Info("Show-HITS","Evt %i total: %i particles %i primaries %i hits %i cerenkovs %i specials",
- iEventN, iNparticles, iNprims, iTotalHits,iTotalCerenkovs,iTotalSpecials);
+ Info("Show-HITS","Evt %i total: %i particles %i primaries %i hits",
+ iEventN, iNparticles, iNprims, iTotalHits);
if(isSdigits){
rl->TreeS()->GetEntry(0);
- Info("Show-SDIGITS","Evt %i contains %5i sdigits",iEventN,r->Sdigits()->GetEntries());
+ Info("Show-SDIGITS","Evt %i contains %5i sdigits",iEventN,r->SDigits()->GetEntries());
}
if(isDigits){
rl->TreeD()->GetEntry(0);
for(int i=1;i<=7;i++)
- Info("Show-DIGITS","Evt %i chamber %i contains %5i NEW digits and %5i OLD",
- iEventN, i, r->Digits(i)->GetEntries(),r->DigitsOld(i)->GetEntries());
+ Info("Show-DIGITS","Evt %i chamber %i contains %5i digits",
+ iEventN, i, r->Digits(i)->GetEntries());
+ }else
+ Info("Show-DIGITS","There is no digits for this event");
+ if(isClusters){
+ rl->TreeR()->GetEntry(0);
+ for(int i=1;i<=7;i++)
+ Info("Show-CLUSTERS","Evt %i chamber %i contains %5i clusters",
+ iEventN, i, r->Clusters(i)->GetEntries());
}
cout<<endl;
}//events loop
- rl->UnloadHits(); if(isSdigits) rl->UnloadSDigits(); if(isDigits) rl->UnloadDigits();
+ rl->UnloadHits();
+ if(isSdigits) rl->UnloadSDigits();
+ if(isDigits) rl->UnloadDigits();
+ if(isClusters) rl->UnloadRecPoints();
al->UnloadHeader();
al->UnloadKinematics();
cout<<endl;
}//void Show()
-
-
-
-void DebugOFF()
-{
- Info("DebugOFF","");
- a->SetDebug(0);
- r->SetDebug(0);
- AliLoader::SetDebug(0);
-}//void DebugOFF()
-
-void DebugON()
-{
- Info("DebugON","");
- a->SetDebug(1);
- r->SetDebug(1);
- AliLoader::SetDebug(1);
-}//void DebugON()
+//__________________________________________________________________________________________________
AliRun *a;
AliRICH *r;
-Bool_t CheckAlice()
-{
- if(gAlice){//it's aliroot
- if(gSystem->Exec("ls galice.root")){
- Info("CheckAlice","It's AliRoot, and no galice.root: SIMULATION");
- gAlice->SetDebug(-1);
- gAlice->Init("AliceConfig.C");
- r=(AliRICH*)gAlice->GetDetector("RICH");
- return kFALSE;
- }else{//galice.root is present we want to read alice from file
- ReadAlice();
- return kTRUE;
- }
- }else{//it's root with ALICE libs loaded
- ReadAlice();
- return kTRUE;
- }
-}//void CheckAlice()
-
-void ReadAlice()
+Bool_t ReadAlice()
{
- Info("ReadAlice","Reading ALICE from SIMULATED FILE.");
+ Info("ReadAlice","Tring to read ALICE from SIMULATED FILE.");
AliLoader::SetDebug(0);
if(gAlice) delete gAlice;
if(!(al=AliRunLoader::Open("galice.root","AlicE","update"))){
gSystem->Exec("rm -rf *.root *.dat");
- Fatal("ReadAlice","galice.root broken, removing all this garbage");
+ Error("ReadAlice","galice.root broken, removing all this garbage then init new one");
+ new AliRun("gAlice","Alice experiment system");
+ gAlice->SetDebug(-1);
+ gAlice->Init("Config.C");
+ r=(AliRICH*)gAlice->GetDetector("RICH");
+ return kFALSE;
}
al->LoadgAlice();
if(!gAlice) Fatal("ReadAlice","No gAlice in file");
if(!(rl=al->GetLoader("RICHLoader"))) Warning("RICH/menu.C::ReadAlice","No RICH loader in file");
Info("ReadAlice","Run contains %i event(s)",gAlice->GetEventsPerRun());
+ return kTRUE;
}
//__________________________________________________________________________________________________
-void RingViewer()
-{
- gStyle->SetPalette(1);
- TCanvas *view=new TCanvas("Display","ALICE RICH Display",0,0,600,600);
-
- TH2F *pH2=new TH2F("pH2F","RICH DISPLAY",r->Param()->Nx(),0,r->Param()->Nx(),r->Param()->Ny(),0,r->Param()->Ny());
- pH2->SetStats(0);
- pH2->SetMaximum(100);
-
- Int_t Nevents = gAlice->GetEventsPerRun();
-}
-//______________________________________________________________________________
-//__________________________________________________________________________________________________
-void GeoTest()
-{
-
- TBRIK *pAliceBRIK=new TBRIK("aliceBRIK","ALICE mother volume","void",500,500,500);
- TBRIK *pArmBRIK=new TBRIK("armBRIK","RICH arm1","void",pRICH->GetSizeX(),pRICH->GetSizeY(),pRICH->GetSizeZ());
-
- TNode *pAliceNode=new TNode("aliceNode","Mother volume","aliceBRIK");
- pAliceNode->cd();
-
-// ARM 1 LEFT
- TRotation rot1;
- TVector3 v1(0,pRICH->GetOffset(),0);
-
-
- rot1.RotateX(pRICH->GetYZAngle()*kDegrad); v1.RotateX(pRICH->GetYZAngle()*kDegrad);
- rot1.RotateZ(pRICH->GetXYAngle()*kDegrad); v1.RotateZ(pRICH->GetXYAngle()*kDegrad);
- rot1.RotateZ(pRICH->GetRotAngle()*kDegrad); v1.RotateZ(pRICH->GetRotAngle()*kDegrad);
-
- TRotMatrix *pArm1RotMatrix=new TRotMatrix("rotArm1","rotArm1",rot1.ThetaX()*kRaddeg, rot1.PhiX()*kRaddeg,
- rot1.ThetaY()*kRaddeg, rot1.PhiY()*kRaddeg,
- rot1.ThetaZ()*kRaddeg, rot1.PhiZ()*kRaddeg);
-
- TNode *pArm1Node=new TNode("arm1Node","Left arm","armBRIK",v1.X(),v1.Y(),v1.Z(),"rotArm1");
- arm1Node->SetLineColor(kRed);
-
-// ARM 2 LEFT
- TRotation rot2;
- TVector3 v2(0,pRICH->GetOffset(),0);
-
-
- rot2.RotateX( pRICH->YZAngle()*kDegrad); v2.RotateX(pRICH->GetYZAngle()*kDegrad);
- rot2.RotateZ(-pRICH->XYAngle()*kDegrad); v2.RotateZ(-pRICH->GetXYAngle()*kDegrad);
- rot2.RotateZ( pRICH->RotAngle()*kDegrad); v2.RotateZ(pRICH->GetRotAngle()*kDegrad);
-
- TRotMatrix *pArm2RotMatrix=new TRotMatrix("rotArm2","rotArm2",rot2.ThetaX()*kRaddeg, rot2.PhiX()*kRaddeg,
- rot2.ThetaY()*kRaddeg, rot2.PhiY()*kRaddeg,
- rot2.ThetaZ()*kRaddeg, rot2.PhiZ()*kRaddeg);
-
- TNode *pArm2Node=new TNode("arm2Node","Left arm","armBRIK",v2.X(),v2.Y(),v2.Z(),"rotArm2");
- arm2Node->SetLineColor(kBlue);
-
- aliceNode->Draw();
-}//void GeoTest()
-//__________________________________________________________________________________________________
-void PrintGeo(Float_t rotDeg=0)
+void TestResponse()
{
- AliRICHParam *p=new AliRICHParam;
- Double_t r=p->Offset();
- Double_t kP=p->AngleXY();
- Double_t kT=p->AngleYZ();
- Double_t kRot;
-
- if(rotDeg==0)
- kRot=p->AngleRot();
- else
- kRot=rotDeg*deg;
+ TCanvas *pC=new TCanvas("c","Amplification test",900,800);
+ pC->Divide(1,2);
+ pC->cd(1);
+ TF1 *pF1=new TF1("f1",Gain,-70,70,1); pF1->SetParameters(1,1);pF1->SetParNames("Sector");
+ TF1 *pF2=new TF1("f2",Gain,-70,70,1); pF2->SetParameters(2,1);pF2->SetParNames("Sector");
+ pF1->Draw();pF2->Draw("same");
+
+ pC->cd(2);
+
+ const Int_t nPoints=8;
+ THStack *pStack=new THStack("stack","photons");
+ TLegend *pLeg=new TLegend(0.6,0.2,0.9,0.5,"legend");
+ TH1F *apH[nPoints];
+
+ Double_t starty=AliRICHParam::DeadZone()/2;
+ Double_t deltay=AliRICHParam::SectorSizeY()/nPoints;
+
+ for(int i=0;i<nPoints;i++){
+ apH[i]=new TH1F(Form("h%i",i),"Qdc for Photon;QDC;Counts",500,0,500); apH[i]->SetLineColor(i);
+ pStack->Add(apH[i]);
+ pLeg->AddEntry(apH[i],Form("@(0,%5.2f->%5.2f)",starty+i*deltay,starty+i*deltay-AliRICHParam::SectorSizeY()/2));
+ }
- cout<<endl;
- Double_t phi=90*deg+kRot+kP,theta=90*deg+kT;
- Info(" menu for 1","r=%8.3f theta=%5.1f phi=%5.1f x=%8.3f y=%8.3f z=%8.3f",
- r, theta*r2d, phi*r2d,
- r*sin(theta)*cos(phi),
- r*sin(theta)*sin(phi),
- r*cos(theta));
-
- phi=90*deg+kRot+kP,theta=90*deg;
- Info(" menu for 2","r=%8.3f theta=%5.1f phi=%5.1f x=%8.3f y=%8.3f z=%8.3f",
- r, theta*r2d, phi*r2d,
- r*sin(theta)*cos(phi),
- r*sin(theta)*sin(phi),
- r*cos(theta));
-
- phi=90*deg+kRot,theta=90*deg-kT;
- Info(" menu for 3","r=%8.3f theta=%5.1f phi=%5.1f x=%8.3f y=%8.3f z=%8.3f",
- r, theta*r2d, phi*r2d,
- r*sin(theta)*cos(phi),
- r*sin(theta)*sin(phi),
- r*cos(theta));
-
-
- phi=90*deg+kRot,theta=90*deg;
- Info(" menu for 4","r=%8.3f theta=%5.1f phi=%5.1f x=%8.3f y=%8.3f z=%8.3f",
- r, theta*r2d, phi*r2d,
- r*sin(theta)*cos(phi),
- r*sin(theta)*sin(phi),
- r*cos(theta));
-
- phi=90*deg+kRot,theta=90*deg+kT;
- Info(" menu for 5","r=%8.3f theta=%5.1f phi=%5.1f x=%8.3f y=%8.3f z=%8.3f",
- r, theta*r2d, phi*r2d,
- r*sin(theta)*cos(phi),
- r*sin(theta)*sin(phi),
- r*cos(theta));
-
-
- phi=90*deg+kRot-kP,theta=90*deg;
- Info(" menu for 6","r=%8.3f theta=%5.1f phi=%5.1f x=%8.3f y=%8.3f z=%8.3f",
- r, theta*r2d, phi*r2d,
- r*sin(theta)*cos(phi),
- r*sin(theta)*sin(phi),
- r*cos(theta));
-
- phi=90*deg+kRot-kP,theta=90*deg+kT;
- Info(" menu for 7","r=%8.3f theta=%5.1f phi=%5.1f x=%8.3f y=%8.3f z=%8.3f",
- r, theta*r2d, phi*r2d,
- r*sin(theta)*cos(phi),
- r*sin(theta)*sin(phi),
- r*cos(theta));
-
- delete p;
-}//void PrintGeo()
-
-
-
-//__________________________________________________________________________________________________
-void TestGain()
-{
- AliRICHParam *pParam=new AliRICHParam;
- AliRICHResponseV0 *pRes=new AliRICHResponseV0;
-
- TLegend *pLegend=new TLegend(0.6,0.3,0.85,0.5);
- TH1F *pH0=new TH1F("pH1","Gain",100,0,600);
- TH1F *pH10=new TH1F("pH10","Gain",100,0,600);
- TH1F *pH20=new TH1F("pH20","Gain",100,0,600);
- TH1F *pH30=new TH1F("pH30","Gain",100,0,600);
- TH1F *pHold=new TH1F("pHold","Mip Charge",100,0,2000);
- for(int i=0;i<1000;i++){
- pH0 ->Fill(pParam->Gain(0));
- pH10->Fill(pParam->Gain(10));
- pH20->Fill(pParam->Gain(20));
- pH30->Fill(pParam->Gain(30));
- pHold->Fill(pRes->IntPH(30));
- }
- pH0->Draw();
- pH10->Draw("same");
- pH20->Draw("same");
- pH30->Draw("same");
- pHold->Draw("same");
- pLegend->AddEntry(pH0,"y=0");
- pLegend->AddEntry(pH10,"y=10");pH10->SetLineColor(kRed);
- pLegend->AddEntry(pH20,"y=20");pH20->SetLineColor(kBlue);
- pLegend->AddEntry(pH30,"y=30");pH30->SetLineColor(kGreen);
- pLegend->AddEntry(pHold,"res");pHold->SetLineColor(kMagenta);
- pLegend->Draw();
-}//void TestGain()
-//__________________________________________________________________________________________________
-void TestMipCharge()
-{
- AliRICHParam *pParam=new AliRICHParam;
- AliRICHResponseV0 *pRes=new AliRICHResponseV0;
-
- TLegend *pLegend=new TLegend(0.6,0.3,0.85,0.5);
- TH1F *pH0= new TH1F("pH1", "Mip Charge",100,0,500);
- TH1F *pH10=new TH1F("pH10","Mip Charge",100,0,500);
- TH1F *pH20=new TH1F("pH20","Mip Charge",100,0,500);
- TH1F *pH30=new TH1F("pH30","Mip Charge",100,0,500);
- TH1F *pHold=new TH1F("pHold","Mip Charge",100,0,500);
- for(int i=0;i<1000;i++){
- pH0 ->Fill(pParam->TotalCharge(kPiPlus,0.5e-9,0));
- pH10->Fill(pParam->TotalCharge(kPiPlus,0.5e-9,10));
- pH20->Fill(pParam->TotalCharge(kPiPlus,0.5e-9,20));
- pH30->Fill(pParam->TotalCharge(kPiPlus,0.5e-9,30));
- pHold->Fill(pRes->IntPH(0.5e-9,-30));
+ TVector2 x2(0,0);
+// AliRICHParam::ResetWireSag();
+ for(Int_t i=0;i<10000;i++){//events loop
+ for(int j=0;j<nPoints;j++){
+ x2.Set(0,starty-j*deltay);
+ apH[j]->Fill(AliRICHParam::TotQdc(x2,0));
+ }
}
- pH0->Draw();
- pH10->Draw("same");
- pH20->Draw("same");
- pH30->Draw("same");
- pHold->Draw("same");
- pLegend->AddEntry(pH0,"y=0");
- pLegend->AddEntry(pH10,"y=10");pH10->SetLineColor(kRed);
- pLegend->AddEntry(pH20,"y=20");pH20->SetLineColor(kBlue);
- pLegend->AddEntry(pH30,"y=30");pH30->SetLineColor(kGreen);
- pLegend->AddEntry(pHold,"res");pHold->SetLineColor(kMagenta);
- pLegend->Draw();
-}//void TestGain()
-//__________________________________________________________________________________________________
-void TestDigitsOLD()
-{
- Info("TestDigitsOLD","Creating test digits.");
- rl->MakeTree("D");r->MakeBranch("D");
-
-
- Int_t t[10];
- Int_t c[10];
- Int_t d[5];
- t[0]=100;t[1]=200;t[2]=300;
- c[0]=10;c[1]=20;c[2]=30;
-
-
- d[0]=1;d[1]=1;d[2]=10;d[3]=3;d[4]=4;r->AddDigitOld(1,t,c,d);
-
- d[0]=2;d[1]=2;d[2]=10;d[3]=3;d[4]=4;r->AddDigitOld(2,t,c,d);
- d[0]=2;d[1]=3;d[2]=10;d[3]=3;d[4]=4;r->AddDigitOld(2,t,c,d);
-
- d[0]=2;d[1]=2;d[2]=50;d[3]=3;d[4]=4;r->AddDigitOld(3,t,c,d);
- d[0]=2;d[1]=3;d[2]=100;d[3]=3;d[4]=4;r->AddDigitOld(3,t,c,d);
- d[0]=3;d[1]=2;d[2]=100;d[3]=3;d[4]=4;r->AddDigitOld(3,t,c,d);
-
- d[0]=2;d[1]=2;d[2]=100;d[3]=3;d[4]=4;r->AddDigitOld(4,t,c,d);
- d[0]=2;d[1]=3;d[2]=50;d[3]=3;d[4]=4;r->AddDigitOld(4,t,c,d);
- d[0]=3;d[1]=2;d[2]=50;d[3]=3;d[4]=4;r->AddDigitOld(4,t,c,d);
- d[0]=3;d[1]=3;d[2]=100;d[3]=3;d[4]=4;r->AddDigitOld(4,t,c,d);
-
- rl->TreeD()->Fill();
- rl->WriteDigits("OVERWRITE");
- rl->UnloadDigits();
- r->ResetDigitsOld();
- Info("TestDigitsOLD","Stop.");
-}//void TestDigits()
+ pStack->Draw("nostack");
+ pLeg->Draw();
+}//TestResponse()
//__________________________________________________________________________________________________
-void TestSdigits()
+void TestSD()
{
- Info("TestSdigits","Creating test sdigits.");
- rl->MakeTree("S");r->MakeBranch("S");
-//totally 19 must be trasformd to 6 digits
- 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);
- 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);
-
- r->AddSdigit(1,20,20,10,20); r->AddSdigit(1,20,20,10,21);
- r->AddSdigit(1,25,25,10,25); r->AddSdigit(1,25,25,10,25);
-
- r->AddSdigit(1,30,30,10,30); r->AddSdigit(1,30,30,10,31); r->AddSdigit(1,30,30,10,32);
- r->AddSdigit(1,35,35,10,35); r->AddSdigit(1,35,35,10,35); r->AddSdigit(1,35,35,10,35);
-
-
- r->AddSdigit(1,10,10,10,10);
-
-
- rl->TreeS()->Fill();
- rl->WriteSDigits("OVERWRITE");
- rl->UnloadSDigits();
- cout<<endl;r->Sdigits()->Print();
- r->ResetSDigits();
- Info("TestSdigits","Stop.");
+ Info("TestSD","Creating test sdigits.");
+ TVector3 hit(426.55,246.28,17.21);
+ TVector2 x2=r->C(4)->Glob2Loc(hit);
+ Int_t iTotQdc=r->Param()->TotQdc(x2,624e-9);
+ Int_t iPadXmin,iPadXmax,iPadYmin,iPadYmax;
+ Int_t padx,pady;
+ Int_t sec=r->Param()->Loc2Pad(x2,padx,pady);
+ r->Param()->Loc2Area(x2,iPadXmin,iPadYmin,iPadXmax,iPadYmax);
+ Info("TestSD","Initial hit (%7.2f,%7.2f,%7.2f)->(%7.2f,%7.2f)->(%4i,%4i,%4i) gives %i charge",
+ hit.X(),hit.Y(),hit.Z(),x2.X(),x2.Y(),sec,padx,pady,iTotQdc);
+
+ cout<<"left-down=("<<iPadXmin<<","<<iPadYmin<<") right-up=("<<iPadXmax<<','<<iPadYmax<<')'<<endl;
+ for(Int_t iPadY=iPadYmin;iPadY<=iPadYmax;iPadY++)
+ for(Int_t iPadX=iPadXmin;iPadX<=iPadXmax;iPadX++)
+ cout<<r->Param()->FracQdc(x2,iPadX,iPadY)<<endl;
+ Info("TestSD","Stop.");
}//void TestSdigits()
//__________________________________________________________________________________________________
-void TestClustersOLD()
+void TestC()
{
- Info("TestClusters","Creating test clusters.");
+ Info("TestC","Creating test clusters.");
rl->MakeTree("R");r->MakeBranch("R");
- AliRICHRawCluster c;
- r->AddClusterOld(1,c);
+ AliRICHcluster c;
+ c.AddDigit(new AliRICHdigit(1,20,21,200,1,2,3));
+ c.AddDigit(new AliRICHdigit(1,22,21,250,1,2,3));
+ c.CoG();
+
+ r->AddCluster(c);
+
rl->TreeR()->Fill();
rl->WriteRecPoints("OVERWRITE");
rl->UnloadRecPoints();
- r->ResetRawClusters();
+ r->ResetClusters();
- Info("TestClusters","Stop.");
-}//void TestClustersOLD()
+ Info("TestC","Stop.");
+}//TestC()
//__________________________________________________________________________________________________
void TestSeg()
{
AliRICHParam *p=r->Param();
- Int_t padx,pady;
- Float_t x,y;
- Float_t dz=p->DeadZone();
- Float_t sx=p->SectorSizeX(); Float_t sy=p->SectorSizeY(); Float_t px=p->PcSizeX(); Float_t py=p->PcSizeY();
- cout<<endl;
- Info(" 1- 1","sec=%i padx=%3i pady=%3i",p->Local2Pad(-px/2 , -py/2 ,padx,pady),padx,pady);
- Info(" 48- 1","sec=%i padx=%3i pady=%3i",p->Local2Pad(-sx/2-dz , -py/2 ,padx,pady),padx,pady);
- Info(" 49- 1","sec=%i padx=%3i pady=%3i",p->Local2Pad(-sx/2 , -py/2 ,padx,pady),padx,pady);
- Info(" 96- 1","sec=%i padx=%3i pady=%3i",p->Local2Pad( sx/2 , -py/2 ,padx,pady),padx,pady);
- Info(" 97- 1","sec=%i padx=%3i pady=%3i",p->Local2Pad( sx/2+dz , -py/2 ,padx,pady),padx,pady);
- Info("144- 1","sec=%i padx=%3i pady=%3i",p->Local2Pad( px/2 , -py/2 ,padx,pady),padx,pady);
- cout<<endl;
- Info(" 1- 80","sec=%i padx=%3i pady=%3i",p->Local2Pad(-px/2 , -dz/2 ,padx,pady),padx,pady);
- Info(" 48- 80","sec=%i padx=%3i pady=%3i",p->Local2Pad(-sx/2-dz , -dz/2 ,padx,pady),padx,pady);
- Info(" 49- 80","sec=%i padx=%3i pady=%3i",p->Local2Pad(-sx/2 , -dz/2 ,padx,pady),padx,pady);
- Info(" 96- 80","sec=%i padx=%3i pady=%3i",p->Local2Pad( sx/2 , -dz/2 ,padx,pady),padx,pady);
- Info(" 97- 80","sec=%i padx=%3i pady=%3i",p->Local2Pad( sx/2+dz , -dz/2 ,padx,pady),padx,pady);
- Info("144- 80","sec=%i padx=%3i pady=%3i",p->Local2Pad( px/2 , -dz/2 ,padx,pady),padx,pady);
- cout<<endl;
- Info(" 1- 81","sec=%i padx=%3i pady=%3i",p->Local2Pad(-px/2 , dz/2 ,padx,pady),padx,pady);
- Info(" 48- 81","sec=%i padx=%3i pady=%3i",p->Local2Pad(-sx/2-dz , dz/2 ,padx,pady),padx,pady);
- Info(" 49- 81","sec=%i padx=%3i pady=%3i",p->Local2Pad(-sx/2 , dz/2 ,padx,pady),padx,pady);
- Info(" 96- 81","sec=%i padx=%3i pady=%3i",p->Local2Pad( sx/2 , dz/2 ,padx,pady),padx,pady);
- Info(" 97- 81","sec=%i padx=%3i pady=%3i",p->Local2Pad( sx/2+dz , dz/2 ,padx,pady),padx,pady);
- Info("144- 81","sec=%i padx=%3i pady=%3i",p->Local2Pad( px/2 , dz/2 ,padx,pady),padx,pady);
- cout<<endl;
- Info(" 1-160","sec=%i padx=%3i pady=%3i",p->Local2Pad(-px/2 , py/2 ,padx,pady),padx,pady);
- Info(" 48-160","sec=%i padx=%3i pady=%3i",p->Local2Pad(-sx/2-dz , py/2 ,padx,pady),padx,pady);
- Info(" 49-160","sec=%i padx=%3i pady=%3i",p->Local2Pad(-sx/2 , py/2 ,padx,pady),padx,pady);
- Info(" 96-160","sec=%i padx=%3i pady=%3i",p->Local2Pad( sx/2 , py/2 ,padx,pady),padx,pady);
- Info(" 97-160","sec=%i padx=%3i pady=%3i",p->Local2Pad( sx/2+dz , py/2 ,padx,pady),padx,pady);
- Info("144-160","sec=%i padx=%3i pady=%3i",p->Local2Pad( px/2 , py/2 ,padx,pady),padx,pady);
- cout<<endl;
- Info(" 73-160","sec=%i padx=%3i pady=%3i",p->Local2Pad( 0 , py/2 ,padx,pady),padx,pady);
- Info(" 73- 81","sec=%i padx=%3i pady=%3i",p->Local2Pad( 0 , dz/2 ,padx,pady),padx,pady);
- Info("0-0dead","sec=%i padx=%3i pady=%3i",p->Local2Pad( 0 , 0 ,padx,pady),padx,pady);
- Info(" 73- 80","sec=%i padx=%3i pady=%3i",p->Local2Pad( 0 , -dz/2 ,padx,pady),padx,pady);
- Info(" 73- 1","sec=%i padx=%3i pady=%3i",p->Local2Pad( 0 , -py/2 ,padx,pady),padx,pady);
- cout<<endl;
- p->Pad2Local(padx= 1,pady=1,x,y); cout<<"padx="<<padx<<" pady="<<pady<<" x="<<x<<" y="<<y<<endl;
- p->Pad2Local(padx= 48,pady=1,x,y); cout<<"padx="<<padx<<" pady="<<pady<<" x="<<x<<" y="<<y<<endl;
- p->Pad2Local(padx= 49,pady=1,x,y); cout<<"padx="<<padx<<" pady="<<pady<<" x="<<x<<" y="<<y<<endl;
- p->Pad2Local(padx= 96,pady=1,x,y); cout<<"padx="<<padx<<" pady="<<pady<<" x="<<x<<" y="<<y<<endl;
- p->Pad2Local(padx= 97,pady=1,x,y); cout<<"padx="<<padx<<" pady="<<pady<<" x="<<x<<" y="<<y<<endl;
- p->Pad2Local(padx=144,pady=1,x,y); cout<<"padx="<<padx<<" pady="<<pady<<" x="<<x<<" y="<<y<<endl;
- cout<<endl;
- p->Pad2Local(padx= 1,pady=80,x,y); cout<<"padx="<<padx<<" pady="<<pady<<" x="<<x<<" y="<<y<<endl;
- p->Pad2Local(padx= 48,pady=80,x,y); cout<<"padx="<<padx<<" pady="<<pady<<" x="<<x<<" y="<<y<<endl;
- p->Pad2Local(padx= 49,pady=80,x,y); cout<<"padx="<<padx<<" pady="<<pady<<" x="<<x<<" y="<<y<<endl;
- p->Pad2Local(padx= 96,pady=80,x,y); cout<<"padx="<<padx<<" pady="<<pady<<" x="<<x<<" y="<<y<<endl;
- p->Pad2Local(padx= 97,pady=80,x,y); cout<<"padx="<<padx<<" pady="<<pady<<" x="<<x<<" y="<<y<<endl;
- p->Pad2Local(padx=144,pady=80,x,y); cout<<"padx="<<padx<<" pady="<<pady<<" x="<<x<<" y="<<y<<endl;
- cout<<endl;
- p->Pad2Local(padx= 1,pady=81,x,y); cout<<"padx="<<padx<<" pady="<<pady<<" x="<<x<<" y="<<y<<endl;
- p->Pad2Local(padx= 48,pady=81,x,y); cout<<"padx="<<padx<<" pady="<<pady<<" x="<<x<<" y="<<y<<endl;
- p->Pad2Local(padx= 49,pady=81,x,y); cout<<"padx="<<padx<<" pady="<<pady<<" x="<<x<<" y="<<y<<endl;
- p->Pad2Local(padx= 96,pady=81,x,y); cout<<"padx="<<padx<<" pady="<<pady<<" x="<<x<<" y="<<y<<endl;
- p->Pad2Local(padx= 97,pady=81,x,y); cout<<"padx="<<padx<<" pady="<<pady<<" x="<<x<<" y="<<y<<endl;
- p->Pad2Local(padx=144,pady=81,x,y); cout<<"padx="<<padx<<" pady="<<pady<<" x="<<x<<" y="<<y<<endl;
- cout<<endl;
- p->Pad2Local(padx= 1,pady=160,x,y); cout<<"padx="<<padx<<" pady="<<pady<<" x="<<x<<" y="<<y<<endl;
- p->Pad2Local(padx= 48,pady=160,x,y); cout<<"padx="<<padx<<" pady="<<pady<<" x="<<x<<" y="<<y<<endl;
- p->Pad2Local(padx= 49,pady=160,x,y); cout<<"padx="<<padx<<" pady="<<pady<<" x="<<x<<" y="<<y<<endl;
- p->Pad2Local(padx= 96,pady=160,x,y); cout<<"padx="<<padx<<" pady="<<pady<<" x="<<x<<" y="<<y<<endl;
- p->Pad2Local(padx= 97,pady=160,x,y); cout<<"padx="<<padx<<" pady="<<pady<<" x="<<x<<" y="<<y<<endl;
- p->Pad2Local(padx=144,pady=160,x,y); cout<<"padx="<<padx<<" pady="<<pady<<" x="<<x<<" y="<<y<<endl;
+ Int_t padx,pady,sec;
+ Double_t x,y;
+ Double_t eps=0.0000001;
+ 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;
+ 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;
+ Double_t y1=-0.5*p->PcSizeY()+eps; Double_t y2=-0.5*p->DeadZone()-eps;
+ Double_t y4= 0.5*p->PcSizeY()-eps; Double_t y3= 0.5*p->DeadZone()+eps;
+ TVector2 v2;
+
+ AliRICHParam::Print();
+
+ 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());
+ 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());
+ 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());
+ 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());
+ 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());
+
+ 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());
+ 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());
+ 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());
+ 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());
+ 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());
+ 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());
+
+ 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());
+ 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());
+ 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());
+ 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());
+ 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());
+ 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());
+
+ 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());
+ 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());
+ 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());
+ 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());
+ 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());
+ 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());
+
+ 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());
+ 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());
+ 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());
+ 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());
+ 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());
+ 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());
+
}//void TestSeg()
//__________________________________________________________________________________________________
void TestMenu()
{
TControlBar *pMenu = new TControlBar("vertical","RICH test");
- pMenu->AddButton("Test segmentation", "TestSeg()", "Test AliRICHParam::L2P() method");
- pMenu->AddButton("Test transform", "TestTransform()", "Test ALiRICHChamber::L2G() and G2L methods");
- pMenu->AddButton("Test gain", "TestGain()", "Test AliRICHParam::Gain() method");
- pMenu->AddButton("Test MIP charge", "TestMipCharge()", "Test AliRICHParam::TotalCharge() method");
- pMenu->AddButton("Test Sdigits", "TestSdigits()", "Create test set of sdigits");
- pMenu->AddButton("Test Digits OLD", "TestDigitsOLD()", "Create test set of OLD digits");
- pMenu->AddButton("Test Clusters OLD", "TestClustersOLD()", "Create test set of OLD clusters");
+ pMenu->AddButton("Test segmentation", "TestSeg()", "Test AliRICHParam segmentation methods");
+ pMenu->AddButton("Test response", "TestResponse()", "Test AliRICHParam response methods");
+ pMenu->AddButton("Test sdigits", "TestSD()", "Create test set of sdigits");
+ pMenu->AddButton("Test clusters", "TestC()", "Create test set of clusters");
+ pMenu->AddButton("Test digits OLD", "TestDigitsOLD()", "Create test set of OLD digits");
pMenu->Show();
}//TestMenu()
//__________________________________________________________________________________________________
-void GeoMenu()
-{
- TControlBar *pMenu = new TControlBar("vertical","RICH draw");
- pMenu->AddButton("RICH Isometry", "gMC->Gdraw(\"ALIC\", 60,40,0, 10,10, 0.008,0.008)","Draws ALIC volume in isometry");
- pMenu->AddButton("RICH Front XY", "gMC->Gdraw(\"ALIC\", 0,0,0, 10,10, 0.01,0.01)","Draws ALIC volume in XY view");
- pMenu->AddButton("RICH Side YZ", "gMC->Gdraw(\"ALIC\",90,180, 0, 10,10, 0.01,0.01)","Draws ALIC volume in YZ view");
- pMenu->AddButton("RICH Top XZ", "gMC->Gdraw(\"ALIC\",90, 90, 0, 10,10, 0.01,0.01)","Draws ALIC volume in XZ view");
- pMenu->AddButton("Module Isometry","gMC->Gdraw(\"SRIC\", 30,60,0, 10,10, 0.1,0.1)","Draws SRIC volume in isometry");
- pMenu->AddButton("Module Front XY","gMC->Gdraw(\"SRIC\", 0,0,0, 10,10, 0.1,0.1)","Draws SRIC volume in XY view");
- pMenu->AddButton("Module Top XZ", "gMC->Gdraw(\"SRIC\",90, 90, 0, 10,10, 0.1,0.1)","Draws SRIC volume in XZ view");
- pMenu->AddButton("ALICE Tree", "((TGeant3*)gMC)->Gdtree(\"ALIC\")","Draws ALICE tree");
- pMenu->AddButton("RICH Tree", "((TGeant3*)gMC)->Gdtree(\"RICH\")","Draws RICH tree");
- pMenu->AddButton("Geo test", "GeoTest()", "Draw RICH geo as a macro");
- pMenu->AddButton("Print ref", "PrintGeo()", "Print RICH chambers default position");
- pMenu->AddButton("AliRICH::Print", "r->Print();", "Print RICH chambers default position");
- pMenu->AddButton("Test transform","TestTransform()","Test L2G and G2L methods");
- pMenu->AddButton("Geo GUI", "new G3GeometryGUI;","Create instance of G4GeometryGUI");
- pMenu->Show();
-}//GeoMenu()
-//__________________________________________________________________________________________________
void menu()
{
TControlBar *pMenu = new TControlBar("vertical","RICH main");
- pMenu->AddButton("Debug ON", "DebugON();", "Switch debug on-off");
- pMenu->AddButton("Debug OFF", "DebugOFF();", "Switch debug on-off");
- if(CheckAlice()){//it's from file, reconstruct
- pMenu->AddButton("Hits->Sdigits->Digits","Hits2Digits()","Convert");
- pMenu->AddButton("Digits->Recos", "Digits2Recos()","Convert");
- pMenu->AddButton("Show","Show3()","Shows the structure of events in files");
- pMenu->AddButton("Hits->Sdigits", "Hits2Sdigits()", "Perform first phase converstion");
- pMenu->AddButton("Specials->Sdigits","Specials2Sdigits()", "Perform first phase converstion");
- pMenu->AddButton("Sdigits->Digits", "Sdigits2Digits()", "Perform first phase converstion");
- pMenu->AddButton("Digits->Clusters", "Digits2Clusters()", "Perform first phase converstion");
-
- pMenu->AddButton("Sdigits->DigitsOLD", "Sdigits2DigitsOLD()","Perform second phase converstion");
- pMenu->AddButton("DigitsOLD->RawClustersOLD", "DigitsOLD2RawClustersOLD()", "Perform second phase converstion");
+ if(ReadAlice()){//it's from file, reconstruct
+ pMenu->AddButton("hits->sdigits->digits->clusters","MainTrank()","Convert");
+
+ pMenu->AddButton("sdigits->digits" ,"SD_D()" ,"AliRICHDigitizer");
+ pMenu->AddButton("digits->clusters" ,"D_C()" ,"AliRICHClusterFinder");
+ pMenu->AddButton("clusters->recos" ,"C_R()" ,"AliRICHRecon");
+
+ pMenu->AddButton("Show", "Show()","Shows the structure of events in files");
+ pMenu->AddButton("Display Fast", "DisplFast()", "Display Fast");
+ pMenu->AddButton("Control Plots", "ControlPlots()", "Display some control histograms");
+ pMenu->AddButton("OLD specials->sdigits", "OLD_S_SD()", "Perform first phase converstion");
}else{//it's aliroot, simulate
pMenu->AddButton("Run", "a->Run(1)", "Process!");
+ pMenu->AddButton("Geo GUI", "new G3GeometryGUI;","Create instance of G4GeometryGUI");
}
- pMenu->AddButton("Geo submenu", "GeoMenu()", "Shows geomentry submenu");
pMenu->AddButton("Test submenu", "TestMenu()", "Shows test submenu");
pMenu->AddButton("Browser", "new TBrowser;", "Start ROOT TBrowser");
+ pMenu->AddButton("Debug ON", "DebugON();", "Switch debug on-off");
+ pMenu->AddButton("Debug OFF", "DebugOFF();", "Switch debug on-off");
pMenu->AddButton("Quit", ".q", "Close session");
pMenu->Show();
a=gAlice;//for manual manipulation convinience
}//menu()
//__________________________________________________________________________________________________
+void DebugOFF(){ Info("DebugOFF",""); a->SetDebug(0); r->SetDebug(0); AliLoader::SetDebug(0);}
+void DebugON() { Info("DebugON",""); a->SetDebug(1); r->SetDebug(1); AliLoader::SetDebug(1);}