]> git.uio.no Git - u/mrichter/AliRoot.git/commitdiff
Added fZLength and fZOffset, fixed a few bugs in the new init method.
authorloizides <loizides@f7af4fe6-9843-0410-8265-dc069ae4e863>
Fri, 19 Apr 2002 15:20:42 +0000 (15:20 +0000)
committerloizides <loizides@f7af4fe6-9843-0410-8265-dc069ae4e863>
Fri, 19 Apr 2002 15:20:42 +0000 (15:20 +0000)
HLT/src/AliL3Transform.cxx
HLT/src/AliL3Transform.h

index 50016a5b45c3b9df479495cb907e721c101ff057..a859e1c0f704908dc445c26876a3b914b352a99f 100644 (file)
@@ -49,6 +49,8 @@ void AliL3Transform::Init()
   fPadPitchWidthUp = 0.600000;
   fZWidth = 0.56599998474121093750;
   fZSigma = 0.22880849748219134199;
+  fZLength = 2.5;
+  fZOffset = 0.68642549244657402596;
 
   //slices:
   fNSlice = 36;
@@ -446,6 +448,8 @@ void AliL3Transform::Init(const Char_t* path){
     else if(strcmp(d1,"fPadPitchWidthUp")==0){fscanf(fptr,"%s %lf %s",d2,&ddummy,d3);fPadPitchWidthUp=(Double_t)ddummy;}
     else if(strcmp(d1,"fZWidth")==0){fscanf(fptr,"%s %lf %s",d2,&ddummy,d3);fZWidth=(Double_t)ddummy;}
     else if(strcmp(d1,"fZSigma")==0){fscanf(fptr,"%s %lf %s",d2,&ddummy,d3);fZSigma=(Double_t)ddummy;}
+    else if(strcmp(d1,"fZLength")==0){fscanf(fptr,"%s %lf %s",d2,&ddummy,d3);fZLength=(Double_t)ddummy;}
+    else if(strcmp(d1,"fZOffset")==0){fscanf(fptr,"%s %lf %s",d2,&ddummy,d3);fZOffset=(Double_t)ddummy;}
     else if(strcmp(d1,"fNSlice")==0){fscanf(fptr,"%s %d %s",d2,&dummy,d3);fNSlice=(Int_t)dummy;}
     else if(strcmp(d1,"fNRow")==0){
       fscanf(fptr,"%s %d %s",d2,&dummy,d3);fNRow=(Int_t)dummy;
@@ -457,7 +461,7 @@ void AliL3Transform::Init(const Char_t* path){
     else if(strcmp(d1,"fPi")==0){fscanf(fptr,"%s %lf %s",d2,&ddummy,d3);fPi=(Double_t)ddummy;}
     else if(strcmp(d1,"fX[0]")==0){
       fscanf(fptr,"%s %lf %s",d2,&ddummy,d3);fX[0]=(Double_t)ddummy;
-      for(Int_t i=1;i<fNRow;i++){fscanf(fptr,"%s %s %lf %s",d1,d2,&ddummy,d3);fX[i]=(Double_t)dummy;}
+      for(Int_t i=1;i<fNRow;i++){fscanf(fptr,"%s %s %lf %s",d1,d2,&ddummy,d3);fX[i]=(Double_t)ddummy;}
     }
     else if(strcmp(d1,"fNPads[0]")==0){
       fscanf(fptr,"%s %d %s",d2,&dummy,d3);fNPads[0]=(Int_t)dummy;
@@ -483,6 +487,13 @@ Double_t AliL3Transform::GetEta(Float_t *xyz)
   return eta;
 }
 
+void AliL3Transform::XYZtoRPhiEta(Float_t *rpe, Float_t *xyz)
+{
+  rpe[0] = sqrt(xyz[0]*xyz[0]+xyz[1]*xyz[1]+xyz[2]*xyz[2]);
+  rpe[1] = atan2(xyz[1],xyz[0]);
+  rpe[2] = 0.5 * log((rpe[0]+xyz[2])/(rpe[0]-xyz[2]));
+}
+
 Double_t AliL3Transform::GetEta(Int_t padrow,Int_t pad,Int_t time)
 {
   Float_t xyz[3];
@@ -557,11 +568,11 @@ void AliL3Transform::Local2Global(Float_t *xyz,Int_t slice)
 }
 
 void AliL3Transform::Local2GlobalAngle(Float_t *angle,Int_t slice){
-  angle[0] = fmod(angle[0]+(slice+0.5)*(2*fPi/18),2*fPi);
+  angle[0] = fmod(angle[0]+(slice+fNRotShift)*(2*fPi/18),2*fPi);
 }
 
 void AliL3Transform::Global2LocalAngle(Float_t *angle,Int_t slice){
-  angle[0] = angle[0]-(slice+0.5)*(2*fPi/18);
+  angle[0] = angle[0]-(slice+fNRotShift)*(2*fPi/18);
   if(angle[0]<0) angle[0]+=2*fPi;
 }
 
@@ -572,27 +583,24 @@ void AliL3Transform::Raw2Local(Float_t *xyz,Int_t sector,Int_t row,Float_t pad,F
   Int_t slice,slicerow;
   Sector2Slice(slice, slicerow, sector, row);  
 
+  //X-Value
   xyz[0]=Row2X(slicerow); 
+
+  //Y-Value
   Int_t npads= fNPads[slicerow];
   if(sector<fNSectorLow)
     xyz[1]=(pad-0.5*(npads-1))*fPadPitchWidthLow;
   else
     xyz[1]=(pad-0.5*(npads-1))*fPadPitchWidthUp;
-  xyz[2]=fZWidth*time-3.*fZSigma;
-  Int_t sign=1;
-  
-  
+
+  //Z-Value (remember PULSA Delay)
+  //xyz[2]=fZWidth*time-3.*fZSigma;
+  xyz[2]=fZWidth*time-fZOffset;
   if(slice < 18)
-    sign = 1;
+    xyz[2]=fZLength-xyz[2];
   else
-    sign = -1;
-  
-  xyz[2]=sign*(250.-xyz[2]);
-  
-  //Int_t nis=fNSectorLow;
-  //Int_t nos=fNSectorUp;
-  //if((sector<nis)/2 || ((sector-nis)<nos/2)) sign=1;
-  
+    xyz[2]=xyz[2]-fZLength;
+
 }
 
 void AliL3Transform::Local2Global(Float_t *xyz,Int_t sector,Int_t row)
index e6917680176793a08aa6b98e6246728ae0838555..7bddbcf18184ed2b17755d809f2f323c2dfd22dd 100644 (file)
@@ -20,6 +20,8 @@ class AliL3Transform {
   Int_t fNRow;
   Double_t fPi;
   Double_t fNRotShift;
+  Double_t fZLength;
+  Double_t fZOffset;
   Double_t fCos[36]; //fill this following Init
   Double_t fSin[36]; //fill this following Init
   Double_t fX[176];  //fill this following Init
@@ -30,7 +32,7 @@ class AliL3Transform {
   AliL3Transform();
   AliL3Transform(const char *pathname);
   virtual ~AliL3Transform();
-  Int_t getVersion(){return fVersion;}
+  Int_t GetVersion(){return fVersion;}
   void Init(const Char_t* path); //new init for all AliRoot versions
 
   Double_t GetPadPitchWidthLow() {return fPadPitchWidthLow;}
@@ -51,6 +53,7 @@ class AliL3Transform {
   Double_t GetEta(Int_t row, Int_t pad, Int_t time);
   Double_t GetPhi(Float_t *xyz);
   Double_t GetMaxY(Int_t slicerow);
+  void XYZtoRPhiEta(Float_t *rpe, Float_t *xyz);
   void Local2Global(Float_t *xyz, Int_t slice);
   void Local2GlobalAngle(Float_t *angle, Int_t slice);
   void Global2LocalAngle(Float_t *angle, Int_t slice);