New Global2Local
authorkir <kir@f7af4fe6-9843-0410-8265-dc069ae4e863>
Wed, 22 Oct 2003 21:18:33 +0000 (21:18 +0000)
committerkir <kir@f7af4fe6-9843-0410-8265-dc069ae4e863>
Wed, 22 Oct 2003 21:18:33 +0000 (21:18 +0000)
RICH/AliRICHChamber.h
RICH/AliRICHParam.cxx
RICH/AliRICHParam.h
RICH/AliRICHv0.cxx
RICH/ConfigRich.C

index 1fa893be7a896954e686fba04dd972c87539807e..7b81bcce7bc8b3a4baed7215a035307afc4556b0 100644 (file)
@@ -53,15 +53,14 @@ public:
   Double_t    Z()                  const{return fCenterV3.Z();}
   TVector3    L2G(TVector3 x3)                       const{x3.Transform(fRot);x3+=fCenterV3;return x3;}
   TVector3    G2L(TVector3 x3)                       const{x3-=fCenterV3;x3.Transform(fRot.Inverse()); return x3;}
   Double_t    Z()                  const{return fCenterV3.Z();}
   TVector3    L2G(TVector3 x3)                       const{x3.Transform(fRot);x3+=fCenterV3;return x3;}
   TVector3    G2L(TVector3 x3)                       const{x3-=fCenterV3;x3.Transform(fRot.Inverse()); return x3;}
+  inline TVector3  Global2Local(TVector3 x3, Bool_t isVector=kFALSE) const;
+  TVector3    Global2Local(TLorentzVector x4,Bool_t isVector=kFALSE) const{return Global2Local(x4.Vect(),isVector);}
   TVector3    L2G(Double_t x,Double_t y,Double_t z)  const{return L2G(TVector3(x,y,z));}
   TVector3    G2L(TLorentzVector x4)                 const{return G2L(x4.Vect());}
   Float_t     G2Ly(TLorentzVector x4)                const{TVector3 x3=G2L(x4.Vect()); return x3.Z();}
   TVector3    G2L(Double_t x,Double_t y,Double_t z)  const{return G2L(TVector3(x,y,z));}
   Float_t     G2Lx(Double_t x,Double_t y,Double_t z) const{TVector3 x3=G2L(x,y,z); return x3.X();}
   Float_t     G2Ly(Double_t x,Double_t y,Double_t z) const{TVector3 x3=G2L(x,y,z); return x3.Z();}
   TVector3    L2G(Double_t x,Double_t y,Double_t z)  const{return L2G(TVector3(x,y,z));}
   TVector3    G2L(TLorentzVector x4)                 const{return G2L(x4.Vect());}
   Float_t     G2Ly(TLorentzVector x4)                const{TVector3 x3=G2L(x4.Vect()); return x3.Z();}
   TVector3    G2L(Double_t x,Double_t y,Double_t z)  const{return G2L(TVector3(x,y,z));}
   Float_t     G2Lx(Double_t x,Double_t y,Double_t z) const{TVector3 x3=G2L(x,y,z); return x3.X();}
   Float_t     G2Ly(Double_t x,Double_t y,Double_t z) const{TVector3 x3=G2L(x,y,z); return x3.Z();}
-  TVector3    L2Gvector(TVector3 x3)                 const{x3.Transform(fRot);return x3;}
-  TVector3    G2Lvector(TVector3 x3)                 const{x3.Transform(fRot.Inverse()); return x3;}
-//  TLorentzVector L2G(TLorentzVector v4)  const{v4.Transform(fRot.Inverse());v4+=fCenterV3;return v4;}???
   void        Print(Option_t *sOption)const;//virtual      
    
   void LocaltoGlobal(Float_t pos[3],Float_t Localpos[3]);//Transformation from local to global coordinates, chamber-dependant
   void        Print(Option_t *sOption)const;//virtual      
    
   void LocaltoGlobal(Float_t pos[3],Float_t Localpos[3]);//Transformation from local to global coordinates, chamber-dependant
@@ -105,5 +104,13 @@ void AliRICHChamber::SetCenter(Double_t x,Double_t y,Double_t z)
   fCenterV3.SetXYZ(x,y,z);
   fX=x;fY=y;fZ=z;
 }
   fCenterV3.SetXYZ(x,y,z);
   fX=x;fY=y;fZ=z;
 }
+
+TVector3 AliRICHChamber::Global2Local(TVector3 x3,Bool_t isVector)const
+{
+  if(!isVector) x3-=fCenterV3;
+  x3.Transform(fRot.Inverse()); 
+  Double_t tmp=x3.Y(); x3.SetY(-x3.Z()); x3.SetZ(tmp);
+  return x3;
+}
   
 #endif //AliRICHChamber_h
   
 #endif //AliRICHChamber_h
index db0f04a53a7f24b5201398045bb98eec1537f776..89c9ec859ca1844ea5b748c4d2d054d68d8e02a1 100644 (file)
 
 ClassImp(AliRICHParam)
 
 
 ClassImp(AliRICHParam)
 
+Float_t AliRICHParam::fgAngleRot=-60;
+
 // RICH main parameters manipulator
 //__________________________________________________________________________________________________
 AliRICHParam::AliRICHParam():
 fCurrentPadX(0),fCurrentPadY(0),fCurrentWire(0),
 fSizeZ(0),
 // RICH main parameters manipulator
 //__________________________________________________________________________________________________
 AliRICHParam::AliRICHParam():
 fCurrentPadX(0),fCurrentPadY(0),fCurrentWire(0),
 fSizeZ(0),
-fAngleRot(0),fAngleYZ(0),fAngleXY(0),
-fOffset(0),
 fProximityGapThickness(0),
 fQuartzLength(0),
 fQuartzWidth(0),
 fProximityGapThickness(0),
 fQuartzLength(0),
 fQuartzWidth(0),
@@ -46,9 +46,7 @@ fWireSag(0),
 fVoltage(0)
 {//defines the default parameters
   Size                 (132.6*kcm,26*kcm,136.7*kcm);  //full length, not GEANT half notation
 fVoltage(0)
 {//defines the default parameters
   Size                 (132.6*kcm,26*kcm,136.7*kcm);  //full length, not GEANT half notation
-  AngleRot             (-60);                         //rotation of the whole RICH around Z, deg
-  Angles               (20,19.5);                     //XY angle, YZ angle  deg  
-  Offset               (490*kcm+1.267*kcm);           //1.267???????cm distance from IP to the center of module 
+  
   ProximityGapThickness(0.4*kcm);            
   QuartzLength         (133*kcm);            
   QuartzWidth          (127.9*kcm);          
   ProximityGapThickness(0.4*kcm);            
   QuartzLength         (133*kcm);            
   QuartzWidth          (127.9*kcm);          
index 82000e8b7ac122b45a1677be084d07651d7024a2..980dacdca652a57a1ba47f6316b52a7b97a72041 100644 (file)
@@ -4,6 +4,8 @@
 #include <TObject.h>
 #include "AliRICHConst.h"
 
 #include <TObject.h>
 #include "AliRICHConst.h"
 
+
+
 class AliRICHParam :public TObject  
 {
 public:
 class AliRICHParam :public TObject  
 {
 public:
@@ -45,14 +47,12 @@ public:
   Float_t SizeX()                       const{return fSizeX;}
   Float_t SizeY()                       const{return fSizeY;}
   Float_t SizeZ()                       const{return fSizeZ;}   
   Float_t SizeX()                       const{return fSizeX;}
   Float_t SizeY()                       const{return fSizeY;}
   Float_t SizeZ()                       const{return fSizeZ;}   
-  void    Offset(Float_t offset)             {       fOffset=offset;}  
-  Float_t Offset()                      const{return fOffset;}  
-  void    Angles(Float_t xy,Float_t yz)      {       fAngleXY=xy;fAngleYZ=yz;} 
-  Float_t AngleYZ()                     const{return fAngleYZ*kD2r;} 
-  Float_t AngleXY()                     const{return fAngleXY*kD2r;} 
-  void    AngleRot(Float_t angle)            {       fAngleRot=angle;}
-  Float_t AngleRot()                    const{return fAngleRot*kD2r;}                
-  static Float_t GapThickness()              {return 8.0;}      
+  static  Float_t Offset()                   {return 490+1.267;}  
+  static  Float_t AngleYZ()                  {return 19.5*TMath::DegToRad();} 
+  static  Float_t AngleXY()                  {return 20*TMath::DegToRad();} 
+  static  void    AngleRot(Float_t angle)    {       fgAngleRot=angle;}
+  static  Float_t AngleRot()                 {return fgAngleRot*kD2r;}                
+  static  Float_t GapThickness()             {return 8.0;}      
   void    ProximityGapThickness(Float_t a)   {       fProximityGapThickness=a;}
   Float_t ProximityGapThickness()       const{return fProximityGapThickness;}    
   void    QuartzLength(Float_t a)            {       fQuartzLength=a;}
   void    ProximityGapThickness(Float_t a)   {       fProximityGapThickness=a;}
   Float_t ProximityGapThickness()       const{return fProximityGapThickness;}    
   void    QuartzLength(Float_t a)            {       fQuartzLength=a;}
@@ -105,10 +105,7 @@ protected:
   Int_t   fCurrentWire;                           //???
     
   Float_t fSizeX;  Float_t fSizeY; Float_t fSizeZ;                                //chamber outer size, cm
   Int_t   fCurrentWire;                           //???
     
   Float_t fSizeX;  Float_t fSizeY; Float_t fSizeZ;                                //chamber outer size, cm
-  Float_t fAngleRot;                                                              //azimuthal rotation XY plane, deg  
-  Float_t fAngleYZ;                                                               //angle between chambers YZ plane, deg
-  Float_t fAngleXY;                                                               //angle between chambers XY plane, deg
-  Float_t fOffset;                                                                //chambers offset from IP, cm   
+  static  Float_t fgAngleRot;                                                     //azimuthal rotation XY plane, deg  
   Float_t fProximityGapThickness;                                                 //proximity gap thickness, cm
   Float_t fQuartzLength;     Float_t fQuartzWidth;                                //quartz window size, cm
   Float_t fOuterFreonLength; Float_t fOuterFreonWidth;                            //freon box outer size, cm
   Float_t fProximityGapThickness;                                                 //proximity gap thickness, cm
   Float_t fQuartzLength;     Float_t fQuartzWidth;                                //quartz window size, cm
   Float_t fOuterFreonLength; Float_t fOuterFreonWidth;                            //freon box outer size, cm
index 99d9c70d8600ad5fcecfe56bfc6bf49d16c63e3b..73004e216aad18c3bae6a9d7ad687dff182ccd19 100644 (file)
@@ -83,7 +83,7 @@ void AliRICHv0::StepManager()
   Float_t glo[3],loc[3];
   glo[0]=x4.X();glo[1]=x4.Y();glo[2]=x4.Z();  
   gMC->Gmtod(glo,loc,1);
   Float_t glo[3],loc[3];
   glo[0]=x4.X();glo[1]=x4.Y();glo[2]=x4.Z();  
   gMC->Gmtod(glo,loc,1);
-  Info("","glo(%+8.3f,%+8.3f,%+8.3f) r=%7.2f theta=%7.2f phi=%7.2f",
+  Info("","glo(%+8.3f,%+8.3f,%+8.3f) r=%8.3f theta=%8.3f phi=%8.3f",
                       glo[0],glo[1],glo[2],x4.Rho(),x4.Theta()*kR2d,x4.Phi()*kR2d);  
   Info("","loc(%+8.3f,%+8.3f,%8.3f) by gMC->Gmtod()",         loc[0],loc[1],loc[2]);  
   if(gMC->VolId("CSI ")==gMC->CurrentVolID(copy0)){
                       glo[0],glo[1],glo[2],x4.Rho(),x4.Theta()*kR2d,x4.Phi()*kR2d);  
   Info("","loc(%+8.3f,%+8.3f,%8.3f) by gMC->Gmtod()",         loc[0],loc[1],loc[2]);  
   if(gMC->VolId("CSI ")==gMC->CurrentVolID(copy0)){
@@ -91,6 +91,8 @@ void AliRICHv0::StepManager()
     gMC->CurrentVolOffID(2,iChamber);
     TVector3 x3=C(iChamber)->G2L(x4);
     Info("","loc(%+8.3f,%+8.3f,%8.3f) by G2L",         x3.X(),x3.Y(),x3.Z());  
     gMC->CurrentVolOffID(2,iChamber);
     TVector3 x3=C(iChamber)->G2L(x4);
     Info("","loc(%+8.3f,%+8.3f,%8.3f) by G2L",         x3.X(),x3.Y(),x3.Z());  
+    x3=C(iChamber)->Global2Local(x4);
+    Info("","loc(%+8.3f,%+8.3f,%8.3f) by Global2Local",         x3.X(),x3.Y(),x3.Z());  
   }
   Info("","end of current step\n");
 }//AliRICHv0::StepManager()
   }
   Info("","end of current step\n");
 }//AliRICHv0::StepManager()
index ec7d65334cd17169eca2a5513853930a579d999c..1238e62b2ba0086fa6711609990696c298656ab4 100644 (file)
@@ -1,9 +1,9 @@
-Int_t   iRICH  =  3;//0-1-3
+const static Int_t   iRICH  =  0;//0-1-3
+const static Bool_t  IsRichUp=kTRUE;
+const static Int_t   kEventsPerFile=50;
 
 
-enum EGenTypes {kGun1,kGun7,kPP7};
-
-static EGenTypes kGen=kGun1;
-static Int_t kEventsPerFile=50;
+enum  EGenTypes {kGun0,kGun1,kGun7,kPP7};
+const static EGenTypes kGen=kGun0;
 
 Int_t   iPIPE  =  0;//central before RICH
 Int_t   iITS   =  0;
 
 Int_t   iPIPE  =  0;//central before RICH
 Int_t   iITS   =  0;
@@ -38,7 +38,9 @@ void Config()
   int n,pid,chamber;
   double p;
   Geant3(); File(); Decayer(); Field(); Other();
   int n,pid,chamber;
   double p;
   Geant3(); File(); Decayer(); Field(); Other();
-   
+  
+
+  if(IsRichUp) AliRICHParam::AngleRot(0); 
   AliRICH *pRICH;
   switch(iRICH){
     case 0:
   AliRICH *pRICH;
   switch(iRICH){
     case 0:
@@ -51,11 +53,11 @@ void Config()
       gRICH=new AliRICHv3("RICH","old parametrised RICH with rotation");
       break;
   }   
       gRICH=new AliRICHv3("RICH","old parametrised RICH with rotation");
       break;
   }   
-
   switch(kGen){
        case kPP7:          Pythia7(pid=kPiPlus,p=4);                break;
         case kGun7:         Gun7(pid=kPiPlus,p=4);                   break;
         case kGun1:         Gun1(n=1,pid=kPiPlus,p=4,chamber=4);     break;
   switch(kGen){
        case kPP7:          Pythia7(pid=kPiPlus,p=4);                break;
         case kGun7:         Gun7(pid=kPiPlus,p=4);                   break;
         case kGun1:         Gun1(n=1,pid=kPiPlus,p=4,chamber=4);     break;
+        case kGun0:         Gun1(n=1,pid=kNeutron,p=4,chamber=4);    break;
         default:            Fatal("Config","No generator");          break;
   }  
   ::Info("kir","Stop.");
         default:            Fatal("Config","No generator");          break;
   }  
   ::Info("kir","Stop.");
@@ -63,12 +65,15 @@ void Config()
 
 void Gun1(Int_t iNprim,Int_t iPID,Double_t p,Int_t iChamber)
 {
 
 void Gun1(Int_t iNprim,Int_t iPID,Double_t p,Int_t iChamber)
 {
-  ::Info("kir-Gun1","%i primaries of %i PID  with p=%f GeV",iNprim,iPID,p);
+  Double_t theta=gRICH->C(iChamber)->ThetaD();
+  Double_t phi  =gRICH->C(iChamber)->PhiD();
+  theta-=2;
+  ::Info("kir-Gun1","%i primarie(s) of %i PID  with p=%f GeV at (%f,%f)",iNprim,iPID,p,theta,phi);
    
   AliGenFixed *pGen=new AliGenFixed(iNprim);
   pGen->SetMomentum(p);
    
   AliGenFixed *pGen=new AliGenFixed(iNprim);
   pGen->SetMomentum(p);
-  pGen->SetPhiRange(gRICH->C(iChamber)->PhiD());
-  pGen->SetThetaRange(gRICH->C(iChamber)->ThetaD()+2);
+  pGen->SetPhiRange(phi);
+  pGen->SetThetaRange(theta);
   pGen->SetOrigin(0,0,0);                 
   pGen->SetPart(iPID);    
   pGen->Init();
   pGen->SetOrigin(0,0,0);                 
   pGen->SetPart(iPID);    
   pGen->Init();