Bugs in rename same Reset methods. Improvement in display
authordibari <dibari@f7af4fe6-9843-0410-8265-dc069ae4e863>
Thu, 2 Jun 2005 09:24:33 +0000 (09:24 +0000)
committerdibari <dibari@f7af4fe6-9843-0410-8265-dc069ae4e863>
Thu, 2 Jun 2005 09:24:33 +0000 (09:24 +0000)
event

RICH/AliRICH.cxx
RICH/AliRICHClusterFinder.cxx
RICH/AliRICHDigitizer.cxx
RICH/AliRICHParam.cxx
RICH/AliRICHParam.h
RICH/AliRICHTracker.cxx
RICH/RichMenu.C

index 8e8f641..ba30540 100644 (file)
@@ -43,6 +43,8 @@
 #include <TLatex.h> //Display()
 #include <TCanvas.h> //Display()
 #include <TGraph.h> //Display()
+#include <TStyle.h> //Display()
+#include <TMarker.h> //Display()
  
 ClassImp(AliRICH)    
 //__________________________________________________________________________________________________
@@ -918,8 +920,8 @@ void AliRICH::DisplayEvent(Int_t iEvtNmin,Int_t iEvtNmax)const
   Bool_t isDigits  =!GetLoader()->LoadDigits();
   if(!isDigits){Error("ShoEvent","No digits. Nothing to display.");return;}
   
-  TCanvas *canvas = new TCanvas("RICHDisplay","RICH Display",0,0,1226,900);   canvas->Divide(3,3);  
-//  gStyle->SetPalette(1);
+  TCanvas *canvas = new TCanvas("RICHDisplay","RICH Display",0,0,1226,900);     
+  gStyle->SetPalette(1);
 
   
   for(Int_t iChamber=1;iChamber<=7;iChamber++) {
@@ -928,12 +930,14 @@ void AliRICH::DisplayEvent(Int_t iEvtNmin,Int_t iEvtNmax)const
     pDigitsH2[iChamber]->SetMarkerStyle(29); 
     pDigitsH2[iChamber]->SetMarkerSize(0.4);
     pDigitsH2[iChamber]->SetStats(kFALSE);
+    pDigitsH2[iChamber]->SetMaximum(300);
   }
   
-  if(iEvtNmax>gAlice->GetEventsPerRun()) iEvtNmax=gAlice->GetEventsPerRun();
+  if(iEvtNmax>gAlice->GetEventsPerRun()||iEvtNmax==0) iEvtNmax=gAlice->GetEventsPerRun()-1;
 
   TLatex t;  t.SetTextSize(0.1);
   for(Int_t iEventN=iEvtNmin;iEventN<=iEvtNmax;iEventN++) {//events loop
+    canvas->Divide(3,3);    
     canvas->cd(1);
     t.DrawText(0.2,0.4,Form("Event Number %i",iEventN));        
 
@@ -944,7 +948,7 @@ void AliRICH::DisplayEvent(Int_t iEvtNmin,Int_t iEvtNmax)const
       for(Int_t j=0;j<Digits(iChamber)->GetEntries();j++) {//digits loop
         AliRICHDigit *pDig = (AliRICHDigit*)Digits(iChamber)->At(j);
         TVector2 x2=AliRICHParam::Pad2Loc(pDig->Pad());
-        pDigitsH2[iChamber]->Fill(x2.X(),x2.Y());
+        pDigitsH2[iChamber]->Fill(x2.X(),x2.Y(),pDig->Q());
       }//digits loop
       if(iChamber==1) canvas->cd(7);
       if(iChamber==2) canvas->cd(8);
@@ -953,12 +957,14 @@ void AliRICH::DisplayEvent(Int_t iEvtNmin,Int_t iEvtNmax)const
       if(iChamber==5) canvas->cd(6);
       if(iChamber==6) canvas->cd(2);
       if(iChamber==7) canvas->cd(3);
-      pDigitsH2[iChamber]->Draw();
+      pDigitsH2[iChamber]->Draw("col");
+      ReadESD(iEventN,iChamber);
+      AliRICHParam::DrawSectors();
     }//chambers loop
     canvas->Update();
     canvas->Modified();
-    
-    if(iEvtNmin<iEvtNmax) gPad->WaitPrimitive();
+
+    if(iEventN<iEvtNmax) {gPad->WaitPrimitive();canvas->Clear();}
   }//events loop
 }//ShowEvent()
 //__________________________________________________________________________________________________
@@ -1006,10 +1012,9 @@ void AliRICH::Display()const
       }//TreeH loop
       pHitsH2->SetTitle(Form("event %i chamber %2i",iEventN,iChamber));
       pHitsH2->SetMarkerColor(kRed); pHitsH2->SetMarkerStyle(29); pHitsH2->SetMarkerSize(0.4);
+      ReadESD(iEventN,iChamber);
       pHitsH2->Draw();
-
       ReadESD(iEventN,iChamber);
-
       AliRICHParam::DrawSectors();
       TLatex l; l.SetNDC(); l.SetTextSize(0.02);
       if(!isHits)     {l.SetTextColor(kRed)  ;l.DrawLatex(0.1,0.01,"No Hits"    );}
@@ -1069,13 +1074,13 @@ Int_t AliRICH::Nparticles(Int_t iPartID,Int_t iEvtN,AliRunLoader *pRL)
 void AliRICH::ReadESD(Int_t iEventN, Int_t iChamber)const
 {
 //
-//  AliInfo("Start.");
+  AliInfo("Start.");
   TFile *pFile=TFile::Open("AliESDs.root","read");
   if(!pFile || !pFile->IsOpen()) {AliInfo("ESD file not open.");return;}      //open AliESDs.root                                                                    
   TTree *pTree = (TTree*) pFile->Get("esdTree");
   if(!pTree){AliInfo("ESD not found.");return;}                               //get ESD tree
   
-//  AliInfo("ESD found. Try to draw ring");
+  AliInfo("ESD found. Try to draw ring");
                                                                  
   AliESD *pESD=new AliESD;  pTree->SetBranchAddress("ESD", &pESD);
   
@@ -1089,7 +1094,8 @@ void AliRICH::ReadESD(Int_t iEventN, Int_t iChamber)const
     AliESDtrack *pTrack = pESD->GetTrack(iTrackN);// get next reconstructed track
     Int_t iChTrack = pTrack->GetRICHcluster()/100000;
     if(iChTrack==iChamber) {
-      if(pTrack->GetRICHsignal()<0) continue;
+      Double_t thetaCer = pTrack->GetRICHsignal();
+      if(thetaCer<0) continue;
       Int_t charge = (Int_t)(-TMath::Sign(1.,pTrack->GetSign()*b));
       AliRICHHelix helix(pTrack->X3(),pTrack->P3(),charge,b);
       helix.RichIntersect(P());        
@@ -1098,12 +1104,19 @@ void AliRICH::ReadESD(Int_t iEventN, Int_t iChamber)const
       pTrack->GetRICHthetaPhi(thetaTrack,phiTrack);
       TVector3 vectorTrack;
       vectorTrack.SetMagThetaPhi(pTrack->GetP(),thetaTrack,phiTrack);
-//      vectorTrack.SetMagThetaPhi(pTrack->GetP(),thetaTrack,1.5*TMath::Pi());
-//      AliInfo("Draw ring started");
-      DrawRing(entrance,vectorTrack,pTrack->GetRICHsignal());
+      AliInfo(Form("Draw ring started for track %i on chamber %i",iTrackN,iChamber));
+      AliInfo(Form("ThetaCer %f TrackTheta %f TrackPhi %f Momentum %f",thetaCer,thetaTrack,phiTrack,pTrack->GetP()));
+      Double_t dx,dy;
+      pTrack->GetRICHdxdy(dx,dy);
+      AliInfo(Form("dx %f dy %f ",dx,dy));
+      DrawRing(entrance,vectorTrack,thetaCer);
+      TMarker *trackImpact = new TMarker(helix.PosPc().X(),helix.PosPc().Y(),kStar);
+      trackImpact->SetMarkerColor(kRed);
+      trackImpact->Draw();
     }
   }
   delete pESD;  pFile->Close();//close AliESDs.root
+  AliInfo("Stop.");
 }
 //__________________________________________________________________________________________________
 void AliRICH::DrawRing(TVector3 entrance,TVector3 vectorTrack,Double_t thetaCer)const
@@ -1113,10 +1126,10 @@ void AliRICH::DrawRing(TVector3 entrance,TVector3 vectorTrack,Double_t thetaCer)
   for(Int_t i=0;i<100;i++) {
     Double_t phiCer = 2*TMath::Pi()*i/100;
     TVector3 pos = AliRICHParam::ForwardTracing(entrance,vectorTrack,thetaCer,phiCer);
-    if(pos.X()==-999.) continue;
+    if(pos.X()==-999) continue;
     xGraph[nPointsToDraw] = pos.X();yGraph[nPointsToDraw] = pos.Y();nPointsToDraw++;
   }
-//  AliInfo(Form("Npoints per ring %i",nPointsToDraw));
+  AliInfo(Form("Npoints per ring %i",nPointsToDraw));
   TGraph *gra = new TGraph(nPointsToDraw,xGraph,yGraph);
-  gra->Draw("C");
+  gra->Draw("C");  
 }
index 8351b10..875cc7a 100644 (file)
@@ -54,7 +54,7 @@ void AliRICHClusterFinder::Exec(const Option_t *)
     R()->GetLoader()->GetRunLoader()->GetEvent(iEventN);
     
     R()->GetLoader()->MakeTree("R");  R()->MakeBranch("R");
-    R()->ResetDigits();               R()->ClustersReset();
+    R()->DigitsReset();               R()->ClustersReset();
     
     R()->GetLoader()->TreeD()->GetEntry(0);
     for(Int_t iChamber=1;iChamber<=kNchambers;iChamber++){//chambers loop
@@ -63,7 +63,7 @@ void AliRICHClusterFinder::Exec(const Option_t *)
     R()->GetLoader()->TreeR()->Fill();  R()->GetLoader()->WriteRecPoints("OVERWRITE");//write out clusters for current event
   }//events loop  
   
-  R()->ResetDigits();//reset and unload everything
+  R()->DigitsReset();//reset and unload everything
   R()->ClustersReset();
   R()->GetLoader()                ->UnloadDigits(); 
   R()->GetLoader()                ->UnloadRecPoints();  
index 18b4d17..84e54fe 100644 (file)
@@ -47,7 +47,7 @@ void AliRICHDigitizer::Exec(Option_t*)
       new(tmpCA[total++]) AliRICHDigit(*(AliRICHDigit*)pInRich->SDigits()->At(i)); 
       ((AliRICHDigit*)tmpCA[total-1])->AddTidOffset(fManager->GetMask(inFileN));//apply TID shift since all inputs count tracks independently starting from 0
     }
-    pInRichLoader->UnloadSDigits();   pInRich->ResetSDigits(); //close current input and reset 
+    pInRichLoader->UnloadSDigits();   pInRich->SDigitsReset(); //close current input and reset 
   }//files loop
   
   tmpCA.Sort();                     //at this point we have a list of all sdigits from all inputs, now sort them according to fPad field
@@ -78,5 +78,5 @@ void AliRICHDigitizer::Exec(Option_t*)
   pOutRichLoader->WriteDigits("OVERWRITE");     //serialize them to file
   
   tmpCA.Clear();                      //remove all tmp sdigits
-  pOutRichLoader->UnloadDigits();   pOutRich->ResetDigits();
+  pOutRichLoader->UnloadDigits();   pOutRich->DigitsReset();
 }//Exec()
index 296af99..241f810 100644 (file)
@@ -344,6 +344,7 @@ Double_t AliRICHParam::Interpolate(Double_t par[4][330], Double_t x, Double_t y,
 TVector3 AliRICHParam::ForwardTracing(TVector3 entranceTrackPoint, TVector3 vectorTrack, Double_t thetaC, Double_t phiC)
 {
 //
+  TVector3 vBad(-999,-999,-999);
   TVector3 nPlane(0,0,1);
   Double_t planeZposition = 0.5*Zfreon();
   TVector3 planePoint(0,0,planeZposition);
@@ -362,8 +363,7 @@ TVector3 AliRICHParam::ForwardTracing(TVector3 entranceTrackPoint, TVector3 vect
 //  entranceToSiO2Point.Dump();
 
   Double_t photonEn = MeanCkovEnergy();
-  //  Double_t angleInSiO2 = SnellAngle(AliRICHParam::IndOfRefC6F14(6.755),AliRICHParam::IndOfRefSiO2(6.755),thetaC);
-  Double_t angleInSiO2 = SnellAngle(RefIdxC6F14(photonEn),RefIdxSiO2(photonEn),vectorPhotonInC6F14.Theta());
+  Double_t angleInSiO2 = SnellAngle(RefIdxC6F14(photonEn),RefIdxSiO2(photonEn),vectorPhotonInC6F14.Theta());if(angleInSiO2<0) return vBad;
   TVector3 vectorPhotonInSiO2;
   vectorPhotonInSiO2.SetMagThetaPhi(1,angleInSiO2,phiout);
 //  planeZposition+=AliRICHParam::SiO2Thickness();
@@ -373,7 +373,7 @@ TVector3 AliRICHParam::ForwardTracing(TVector3 entranceTrackPoint, TVector3 vect
 //  entranceToCH4.Dump();
 
   //  Double_t angleInCH4 = SnellAngle(AliRICHParam::IndOfRefSiO2(6.755),AliRICHParam::IndOfRefCH4,angleInSiO2);
-  Double_t angleInCH4 = SnellAngle(RefIdxSiO2(photonEn),RefIdxCH4(photonEn),vectorPhotonInSiO2.Theta());
+  Double_t angleInCH4 = SnellAngle(RefIdxSiO2(photonEn),RefIdxCH4(photonEn),vectorPhotonInSiO2.Theta());if(angleInCH4<0) return vBad;
   TVector3 vectorPhotonInCH4;
   vectorPhotonInCH4.SetMagThetaPhi(1,angleInCH4,phiout);
 //  planeZposition+=AliRICHParam::GapProx();
@@ -411,7 +411,7 @@ Double_t AliRICHParam::SnellAngle(Float_t n1, Float_t n2, Float_t theta1)
 
   if(sinrefractangle>1.) {
     //    cout << " PROBLEMS IN SNELL ANGLE !!!!! " << endl;
-    refractangle = 999.;
+    refractangle = -999.;
     return refractangle;
   }
 
index d1b3961..b41b68d 100644 (file)
@@ -130,7 +130,7 @@ public:
                 
          static Double_t CogCorr(Double_t x) {return 3.31267e-2*TMath::Sin(2*TMath::Pi()/PadSizeX()*x) //correction of cluster CoG due to sinoidal
                                                     -2.66575e-3*TMath::Sin(4*TMath::Pi()/PadSizeX()*x)
-                                                    +2.80553e-3*TMath::Sin(6*TMath::Pi()/PadSizeX()*x);}
+                                                    +2.80553e-3*TMath::Sin(6*TMath::Pi()/PadSizeX()*x)+0.0070;}
          static void     ReadErrFiles();                                                                  //Read Err file parameters
          static TVector3 SigmaSinglePhoton(Int_t Npart, Double_t mom, Double_t theta, Double_t phi);      //Find Sigma for single photon
          static Double_t Interpolate(Double_t par[4][330],Double_t x, Double_t y, Double_t phi);          //Find the error value from interpolation
index af0a1ed..22edb92 100644 (file)
@@ -51,7 +51,8 @@ void AliRICHTracker::RecWithESD(AliESD *pESD)
     if(!iChamber) continue;//intersection with no chamber found
 //find MIP cluster candidate (cluster which is closest to track intersection point)    
     Double_t distMip=9999,distX=0,distY=0; //min distance between clusters and track position on PC 
-    Int_t iMipId=0; //index of that min distance cluster 
+    Int_t iMipId=0; //index of that min distance cluster
+    Double_t chargeMip=0; //charge of the MIP
     for(Int_t iClusN=0;iClusN<pRich->Clusters(iChamber)->GetEntries();iClusN++){//clusters loop for intersected chamber
       AliRICHCluster *pClus=(AliRICHCluster*)pRich->Clusters(iChamber)->UncheckedAt(iClusN);//get pointer to current cluster
       Double_t distCurrent=pClus->DistTo(helix.PosPc());//distance between current cluster and helix intersection with PC
@@ -60,13 +61,22 @@ void AliRICHTracker::RecWithESD(AliESD *pESD)
         iMipId=iClusN;
         distX=pClus->DistX(helix.PosPc());
         distY=pClus->DistY(helix.PosPc());
+        chargeMip=pClus->Q();
       }//find cluster nearest to the track       
       AliDebug(1,Form("Ploc (%f,%f,%f) dist= %f",helix.Ploc().Mag(),helix.Ploc().Theta()*TMath::RadToDeg(),
                                        helix.Ploc().Phi()*TMath::RadToDeg(),pClus->DistTo(helix.PosPc())));
     }//clusters loop for intersected chamber
     
     AliDebug(1,Form("Min distance cluster: %i dist is %f",iMipId,distMip));
-    
+//
+// HERE CUTS ON GOLD RINGS....
+//
+    if(distMip>1||chargeMip<100) {
+      //track not accepted for pattern recognition
+      pTrack->SetRICHsignal(-999.); //to be improved by flags...
+      continue;
+    }
+//
     AliRICHRecon recon(&helix,pRich->Clusters(iChamber),iMipId); //actual job is done there
 
     Double_t thetaCerenkov=recon.ThetaCerenkov(); //search for mean Cerenkov angle for this track
index 0fa9fa2..bdff392 100644 (file)
@@ -103,7 +103,7 @@ void MenuRich()
   pMenu->AddButton("Print sdigits"    ,"r->SDigitsPrint();"   ,"????");
   pMenu->AddButton("Print digits"     ,"r->DigitsPrint();"    ,"????");
   pMenu->AddButton("Print clusters"   ,"r->ClustersPrint();"  ,"????");  
-  pMenu->AddButton("Hits plots"       ,"r->AnaHits()"         ,"????");
+  pMenu->AddButton("Hits plots"       ,"r->ControlPlots()"    ,"????");
   pMenu->AddButton("Recon with stack" ,"r->CheckPR()"                                           , "Create RSR.root with ntuple hn");    
   pMenu->Show();  
 }//TestMenu()