]> git.uio.no Git - u/mrichter/AliRoot.git/commitdiff
Bug in reset Sdigits. Fixed (+minor changes)
authordibari <dibari@f7af4fe6-9843-0410-8265-dc069ae4e863>
Wed, 1 Jun 2005 11:29:16 +0000 (11:29 +0000)
committerdibari <dibari@f7af4fe6-9843-0410-8265-dc069ae4e863>
Wed, 1 Jun 2005 11:29:16 +0000 (11:29 +0000)
RICH/AliRICH.cxx
RICH/AliRICHParam.cxx
RICH/AliRICHParam.h
RICH/AliRICHRecon.cxx
RICH/RichMenu.C

index fda8903551b9139971bcada6542ddd1e1a8a8531..25905a5d503e3597ff0b3bc1fa15a889fd1665c8 100644 (file)
@@ -94,7 +94,7 @@ void AliRICH::Hits2SDigits()
     GetLoader()->GetRunLoader()->GetEvent(iEventN);//get next event
   
     if(!GetLoader()->TreeH()) GetLoader()->LoadHits();    GetLoader()->GetRunLoader()->LoadHeader(); 
-             if(!GetLoader()->GetRunLoader()->TreeK())    GetLoader()->GetRunLoader()->LoadKinematics();//from
+    if(!GetLoader()->GetRunLoader()->TreeK())             GetLoader()->GetRunLoader()->LoadKinematics();//from
     if(!GetLoader()->TreeS()) GetLoader()->MakeTree("S"); MakeBranch("S");//to
           
     for(Int_t iPrimN=0;iPrimN<GetLoader()->TreeH()->GetEntries();iPrimN++){//prims loop
@@ -126,7 +126,7 @@ void AliRICH::Hits2SDigits()
     }//prims loop
     GetLoader()->TreeS()->Fill();
     GetLoader()->WriteSDigits("OVERWRITE");
-    ResetSDigits();
+    SDigitsReset();
   }//events loop  
   GetLoader()->UnloadHits(); GetLoader()->GetRunLoader()->UnloadHeader(); GetLoader()->GetRunLoader()->UnloadKinematics();
   GetLoader()->UnloadSDigits();  
@@ -930,8 +930,7 @@ void AliRICH::DisplayEvent(Int_t iEvtNmin,Int_t iEvtNmax)const
   
   if(iEvtNmax>gAlice->GetEventsPerRun()) iEvtNmax=gAlice->GetEventsPerRun();
 
-  TLatex t;  t.SetTextSize(0.10);
-  t.DrawText(0.1,0.6,"RICH Display");
+  TLatex t;  t.SetTextSize(0.1);
   for(Int_t iEventN=iEvtNmin;iEventN<=iEvtNmax;iEventN++) {//events loop
     canvas->cd(1);
     t.DrawText(0.2,0.4,Form("Event Number %i",iEventN));        
@@ -1061,5 +1060,3 @@ Int_t AliRICH::Nparticles(Int_t iPartID,Int_t iEvtN,AliRunLoader *pRL)
   pRL->UnloadKinematics();
   return iCounter;
 }
-//__________________________________________________________________________________________________
-
index 11a8724aebe7e0206e08fd4a12ab730eeab4e580..a8662388605e9212863b81cebe69adfb19ef7422 100644 (file)
 #include <TPolyLine3D.h>
 #include <TPolyLine.h>
 #include <TSystem.h>
+#include <TVector2.h>
+#include <TVector3.h>
+#include <TRotation.h>
+
 
 ClassImp(AliRICHParam)
 Bool_t   AliRICHParam::fgIsWireSag            =kTRUE;   //take ware sagita into account?
@@ -336,3 +340,155 @@ Double_t AliRICHParam::Interpolate(Double_t par[4][330], Double_t x, Double_t y,
   Double_t u = (y-bj)/(bj1-bj);
   return (1-u)*gj+u*gj1;
 }//Interpolate
+//__________________________________________________________________________________________________
+void AliRICHParam::FowardTracing(TVector3 entranceTrackPoint, TVector3 vectorTrack, Double_t thetaC, Double_t phiC)
+{
+//
+  TVector3 nPlane(0,0,1);
+  Double_t planeZposition = 0.5*Zfreon();
+  TVector3 planePoint(0,0,planeZposition);
+  TVector3 emissionPoint = PlaneIntersect(vectorTrack,entranceTrackPoint,nPlane,planePoint);
+  emissionPoint.Dump();
+  Double_t thetaout,phiout;
+  AnglesInDRS(vectorTrack.Theta(),vectorTrack.Phi(),thetaC,phiC,thetaout,phiout);
+//  cout << "thetaout "<<thetaout << " phiout " << phiout << endl;
+  TVector3 vectorPhotonInC6F14;  
+  vectorPhotonInC6F14.SetMagThetaPhi(1,thetaout,phiout);
+  vectorPhotonInC6F14.Dump();
+//  planeZposition=AliRICHParam::C6F14Thickness();
+  planeZposition=Zfreon();
+  planePoint.SetXYZ(0,0,planeZposition);
+  TVector3 entranceToSiO2Point = PlaneIntersect(vectorPhotonInC6F14,emissionPoint,nPlane,planePoint);
+  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());
+  TVector3 vectorPhotonInSiO2;
+  vectorPhotonInSiO2.SetMagThetaPhi(1,angleInSiO2,phiC);
+//  planeZposition+=AliRICHParam::SiO2Thickness();
+  planeZposition+=Zwin();
+  planePoint.SetXYZ(0,0,planeZposition);
+  TVector3 entranceToCH4 = PlaneIntersect(vectorPhotonInSiO2,entranceToSiO2Point,nPlane,planePoint);
+  entranceToCH4.Dump();
+
+  //  Double_t angleInCH4 = SnellAngle(AliRICHParam::IndOfRefSiO2(6.755),AliRICHParam::IndOfRefCH4,angleInSiO2);
+  Double_t angleInCH4 = SnellAngle(RefIdxSiO2(photonEn),RefIdxCH4(photonEn),vectorPhotonInSiO2.Theta());
+  TVector3 vectorPhotonInCH4;
+  vectorPhotonInCH4.SetMagThetaPhi(1,angleInCH4,phiC);
+//  planeZposition+=AliRICHParam::GapProx();
+  planeZposition+=Pc2Win();
+  planePoint.SetXYZ(0,0,planeZposition);
+  TVector3 impactToPC = PlaneIntersect(vectorPhotonInCH4,entranceToCH4,nPlane,planePoint);
+  impactToPC.Dump();
+}//FowardTracing
+//__________________________________________________________________________________________________
+TVector3 AliRICHParam::PlaneIntersect(TVector3 vstart,TVector3 p0,TVector3 n,TVector3 v0)
+{
+//
+  TVector3 parallel(-999,-999,-999);
+  // vstart = given vector
+  // p0 = origin of the given vector
+  // n = normal to a given plane
+  // v0 = point of the given plane
+//  cout << " n*vstart = " << n*vstart << endl;
+  if(n*vstart==0) return parallel;
+  TVector3 diff=v0-p0;
+  Double_t sint=(n*diff)/(n*vstart);
+  return p0+sint*vstart;
+}//PlaneIntersect
+//__________________________________________________________________________________________________ 
+Double_t AliRICHParam::SnellAngle(Float_t n1, Float_t n2, Float_t theta1)
+{
+// Snell law
+// Compute the Snell angle
+
+  Double_t sinrefractangle;
+  Double_t refractangle;
+
+  sinrefractangle = (n1/n2)*sin(theta1);
+
+  if(sinrefractangle>1.) {
+    //    cout << " PROBLEMS IN SNELL ANGLE !!!!! " << endl;
+    refractangle = 999.;
+    return refractangle;
+  }
+
+  refractangle = asin(sinrefractangle);
+  return refractangle;
+}//SnellAngle
+//__________________________________________________________________________________________________
+void AliRICHParam::AnglesInDRS(Double_t trackTheta,Double_t trackPhi,Double_t thetaCerenkov,Double_t phiCerenkov,Double_t &tout,Double_t &pout)
+{
+// Setup the rotation matrix of the track...
+
+  TRotation mtheta;
+  TRotation mphi;
+  TRotation minv;
+  TRotation mrot;
+  
+  mtheta.RotateY(trackTheta);
+  mphi.RotateZ(trackPhi);
+  
+  mrot = mphi * mtheta;
+    //  minv = mrot.Inverse();
+
+  TVector3 photonInRadiator(1,1,1);
+
+  photonInRadiator.SetTheta(thetaCerenkov);
+  photonInRadiator.SetPhi(phiCerenkov);
+  photonInRadiator = mrot * photonInRadiator;
+  tout=photonInRadiator.Theta();
+  pout=photonInRadiator.Phi();
+}//AnglesInDRS
+//__________________________________________________________________________________________________
+//__________________________________________________________________________________________________
+/*
+void DrawRing()
+{
+
+  //  Float_t xGraph[1000],yGraph[1000];
+
+  Float_t type;
+  Float_t MassOfParticle;
+  Float_t beta;
+  Float_t nfreon;
+
+  Float_t ThetaCerenkov;
+
+  Float_t Xtoentr = GetEntranceX();
+  Float_t Ytoentr = GetEntranceY();
+
+  Float_t pmod = GetTrackMomentum();
+  Float_t TrackTheta = GetTrackTheta();
+  Float_t TrackPhi = GetTrackPhi();
+
+  SetPhotonEnergy(AliRICHParam::MeanCkovEnergy());
+  SetFreonRefractiveIndex();
+
+  SetEmissionPoint(RadiatorWidth/2.);
+
+  ThetaCerenkov = GetThetaCerenkov();
+  FindBetaFromTheta(ThetaCerenkov);
+  nfreon = GetFreonRefractiveIndex();
+  
+  Int_t nPoints = 100;
+
+  Int_t nPointsToDraw = 0;
+  for(Int_t i=0;i<nPoints;i++)
+    {
+      Float_t phpad = 2*TMath::Pi()*i/nPoints;
+      SetThetaPhotonInTRS(thetacer);
+      SetPhiPhotonInTRS(phpad);
+      FindPhotonAnglesInDRS();
+      Float_t Radius = FromEmissionToCathode();
+      if (Radius == 999.) continue;
+      xGraph[nPointsToDraw] = GetXPointOnCathode() + GetShiftX();
+      yGraph[nPointsToDraw] = GetYPointOnCathode() + GetShiftY();
+      nPointsToDraw++;
+    }
+  gra = new TGraph(nPointsToDraw,xGraph,yGraph);
+  gra->Draw("AC"); 
+}
+//__________________________________________________________________________________________________
+*/
index cd9e8257dbc0cc28ba91fd66ea17a8c3e66812de..9aeabe29a31312d8bdc17ba500c0bc604eacd755 100644 (file)
@@ -131,10 +131,15 @@ 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);}
-         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 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
          
+         static void     FowardTracing(TVector3 entranceTrackPoint,TVector3 vectorTrack, Double_t thetaC, Double_t phiC); //it traces foward a photon from Emission Point to PC
+         static TVector3 PlaneIntersect(TVector3 vstart,TVector3 p0,TVector3 n,TVector3 v0);              //it finds intersection between straight track and plane
+         static Double_t SnellAngle(Float_t n1, Float_t n2, Float_t theta1);                              // Snell law
+         static void     AnglesInDRS(Double_t trackTheta,Double_t trackPhi,Double_t thetaCerenkov,Double_t phiCerenkov,Double_t &tout,Double_t &pout);//It finds photon angles in 
+                                                                                                                                                      //Detector Reference System
   
   static Bool_t     fgIsAerogel;                            //aerogel geometry instead of normal RICH flag
 protected:
index fb06eed2b3d512ecbd0610774e3a17cf114865be..da26ee6722551fc0da253cd2c203c4376c74f529 100644 (file)
@@ -414,7 +414,7 @@ void AliRICHRecon::FindThetaPhotonCerenkov()
 
       nIteration++;
       if(nIteration>=50) {
-       AliDebug(1,Form(" max iterations in FindPhotonCerenkov ",nIteration));
+//     AliDebug(1,Form(" max iterations in FindPhotonCerenkov ",nIteration));
        SetThetaPhotonCerenkov(999.);
        return;
       }
index 6daacbc6de2c7abcb4a4fe40e7beea4aa21b6818..0fa9fa225a742df32ce89eed1e9d4d096bef3f90 100644 (file)
@@ -97,12 +97,13 @@ void RichGet()
 void MenuRich()
 {
   TControlBar *pMenu = new TControlBar("vertical","RICH");
-  pMenu->AddButton("Display"          ,"r->Display();"  , "Display Fast");
-  pMenu->AddButton("Print hits"       ,"rh();"          ,"????");
-  pMenu->AddButton("Print sdigits"    ,"rs();"          ,"????");
-  pMenu->AddButton("Print digits"     ,"rd();"          ,"????");
-  pMenu->AddButton("Print clusters"   ,"rc();"          ,"????");  
-  pMenu->AddButton("Hits plots"       ,"r->AnaHits()"   ,"????");
+  pMenu->AddButton("Display single chambers"          ,"r->Display();"  , "Display Fast");
+  pMenu->AddButton("Display ALL chambers"          ,"r->DisplayEvent(0,0);"  , "Display Fast");
+  pMenu->AddButton("Print hits"       ,"r->HitsPrint();"      ,"????");
+  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("Recon with stack" ,"r->CheckPR()"                                           , "Create RSR.root with ntuple hn");    
   pMenu->Show();  
 }//TestMenu()