#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?
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");
+}
+//__________________________________________________________________________________________________
+*/
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:
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()