]> git.uio.no Git - u/mrichter/AliRoot.git/commitdiff
geometry accessed via AliITSgeomTGeo
authormasera <masera@f7af4fe6-9843-0410-8265-dc069ae4e863>
Tue, 12 Jun 2007 08:04:40 +0000 (08:04 +0000)
committermasera <masera@f7af4fe6-9843-0410-8265-dc069ae4e863>
Tue, 12 Jun 2007 08:04:40 +0000 (08:04 +0000)
ITS/AliITSVertexer.cxx
ITS/AliITSVertexer3D.cxx
ITS/AliITSVertexerIons.cxx
ITS/AliITSVertexerZ.cxx

index 5f1d5b75972faf99a82d83cc55cfcad657777674..59a0f0631eb6211ecefaebd2c6d246c64effb47d 100644 (file)
@@ -1,5 +1,5 @@
 #include <AliESDVertex.h>
-#include "AliITSgeom.h"
+#include "AliITSgeomTGeo.h"
 #include "AliITSVertexer.h"
 #include "AliRunLoader.h"
 #include "AliITSLoader.h"
@@ -144,27 +144,27 @@ void AliITSVertexer::SetLaddersOnLayer2(Int_t ladwid){
   fLadOnLay2=ladwid;
   AliRunLoader *rl =AliRunLoader::GetRunLoader();
   AliITSLoader* itsLoader = (AliITSLoader*)rl->GetLoader("ITSLoader");
-  AliITSgeom* geom = itsLoader->GetITSgeom();
-  Int_t ladtot1=geom->GetNladders(1);
+  //  AliITSgeom* geom = itsLoader->GetITSgeom();
+  Int_t ladtot1=AliITSgeomTGeo::GetNLadders(1);
   if(fLadders) delete [] fLadders;
   fLadders=new UShort_t[ladtot1];
 
 
   Double_t pos1[3],pos2[3];
-  Int_t mod1=geom->GetModuleIndex(2,1,1);
-  geom->GetTrans(mod1,pos1);  // position of the module in the MRS 
+  Int_t mod1=AliITSgeomTGeo::GetModuleIndex(2,1,1);
+  AliITSgeomTGeo::GetTranslation(mod1,pos1);  // position of the module in the MRS 
   Double_t phi0=TMath::ATan2(pos1[1],pos1[0]);
   if(phi0<0) phi0+=2*TMath::Pi();
-  Int_t mod2=geom->GetModuleIndex(2,2,1);
-  geom->GetTrans(mod2,pos2);
+  Int_t mod2=AliITSgeomTGeo::GetModuleIndex(2,2,1);
+  AliITSgeomTGeo::GetTranslation(mod2,pos2);
   Double_t phi2=TMath::ATan2(pos2[1],pos2[0]); 
   if(phi2<0) phi2+=2*TMath::Pi();
   Double_t deltaPhi= phi0-phi2; // phi width of a layer2 module
 
   for(Int_t i= 0; i<ladtot1;i++){
-    Int_t modlad= geom->GetModuleIndex(1,i+1,1);
+    Int_t modlad= AliITSgeomTGeo::GetModuleIndex(1,i+1,1);
     Double_t posmod[3];
-    geom->GetTrans(modlad,posmod);
+    AliITSgeomTGeo::GetTranslation(modlad,posmod);
     Double_t phimod=TMath::ATan2(posmod[1],posmod[0]); 
     if(phimod<0) phimod+=2*TMath::Pi();
     Double_t phi1= phimod+deltaPhi*double(fLadOnLay2);
index 1736c7a1cadb74275c632f9f966763449f6802d9..f62a0318ba2f4f33ce745eb0befe56eee202f581 100644 (file)
@@ -25,6 +25,7 @@
 #include "AliITSLoader.h"
 #include "AliITSDetTypeRec.h"
 #include "AliITSRecPoint.h"
+#include "AliITSgeomTGeo.h"
 /////////////////////////////////////////////////////////////////
 // this class implements a method to determine
 // the 3 coordinates of the primary vertex
@@ -149,7 +150,7 @@ Int_t AliITSVertexer3D::FindTracklets(Int_t evnumber, Int_t optCuts){
   // The tracklets are processed in Prepare3DVertex
   AliRunLoader *rl =AliRunLoader::GetRunLoader();
   AliITSLoader* itsLoader = (AliITSLoader*)rl->GetLoader("ITSLoader");
-  AliITSgeom* geom = itsLoader->GetITSgeom();
+  //  AliITSgeom* geom = itsLoader->GetITSgeom();
   itsLoader->LoadRecPoints();
   rl->GetEvent(evnumber);
 
@@ -187,16 +188,16 @@ Int_t AliITSVertexer3D::FindTracklets(Int_t evnumber, Int_t optCuts){
   Int_t nrpL2 = 0;    // number of rec points on layer 2
 
   // By default irstL1=0 and lastL1=79
-  Int_t irstL1 = geom->GetStartDet(0);
-  Int_t lastL1 = geom->GetModuleIndex(2,1,1)-1;
+  Int_t irstL1 = AliITSgeomTGeo::GetModuleIndex(1,1,1);
+  Int_t lastL1 = AliITSgeomTGeo::GetModuleIndex(2,1,1)-1;
   for(Int_t module= irstL1; module<=lastL1;module++){  // count number of recopints on layer 1
     branch->GetEvent(module);
     nrpL1+= itsRec->GetEntries();
     detTypeRec.ResetRecPoints();
   }
   //By default irstL2=80 and lastL2=239
-  Int_t irstL2 = geom->GetModuleIndex(2,1,1);
-  Int_t lastL2 = geom->GetLastDet(0);
+  Int_t irstL2 = AliITSgeomTGeo::GetModuleIndex(2,1,1);
+  Int_t lastL2 = AliITSgeomTGeo::GetModuleIndex(3,1,1)-1;
   for(Int_t module= irstL2; module<=lastL2;module++){  // count number of recopints on layer 2
     branch->GetEvent(module);
     nrpL2+= itsRec->GetEntries();
@@ -229,23 +230,29 @@ Int_t AliITSVertexer3D::FindTracklets(Int_t evnumber, Int_t optCuts){
     for(Int_t j=0;j<nrecp1;j++){
       AliITSRecPoint *recp = (AliITSRecPoint*)prpl1->At(j);
       // Local coordinates of this recpoint
+      /*
       lc[0]=recp->GetDetLocalX();
       lc[2]=recp->GetDetLocalZ();
       geom->LtoG(modul1,lc,gc); // global coordinates
+      */
+      recp->GetGlobalXYZ(gc);
       Double_t phi1 = TMath::ATan2(gc[1]-ybeam,gc[0]-xbeam);
       if(phi1<0)phi1=2*TMath::Pi()+phi1;
       for(Int_t ladl2=0 ; ladl2<fLadOnLay2*2+1;ladl2++){
        for(Int_t k=0;k<4;k++){
          Int_t ladmod=fLadders[ladder-1]+ladl2;
-         if(ladmod>geom->GetNladders(2)) ladmod=ladmod-geom->GetNladders(2);
-         Int_t modul2=geom->GetModuleIndex(2,ladmod,k+1);
+         if(ladmod>AliITSgeomTGeo::GetNLadders(2)) ladmod=ladmod-AliITSgeomTGeo::GetNLadders(2);
+         Int_t modul2=AliITSgeomTGeo::GetModuleIndex(2,ladmod,k+1);
          branch->GetEvent(modul2);
          Int_t nrecp2 = itsRec->GetEntries();
          for(Int_t j2=0;j2<nrecp2;j2++){
            recp = (AliITSRecPoint*)itsRec->At(j2);
+           /*
            lc2[0]=recp->GetDetLocalX();
            lc2[2]=recp->GetDetLocalZ();
            geom->LtoG(modul2,lc2,gc2);
+           */
+           recp->GetGlobalXYZ(gc2);
            Double_t phi2 = TMath::ATan2(gc2[1]-ybeam,gc2[0]-xbeam);
            if(phi2<0)phi2=2*TMath::Pi()+phi2;
            Double_t diff = TMath::Abs(phi2-phi1); 
index bc4c01a3f3d03fabaf55aa84ad1a9ca734a34f99..dfd8176af57a02044489f529ae8a228d2ef0d441 100644 (file)
@@ -2,7 +2,7 @@
 #include "AliITSVertexerIons.h"
 #include "AliITSVertexerZ.h"
 #include "AliESDVertex.h"
-#include "AliITSgeom.h"
+#include "AliITSgeomTGeo.h"
 #include "AliITSLoader.h"
 #include "AliITSRecPoint.h"
 #include "AliLog.h"
@@ -85,10 +85,12 @@ AliESDVertex* AliITSVertexerIons::FindVertexForCurrentEvent(Int_t evnumber){
 
   AliRunLoader *rl = AliRunLoader::GetRunLoader();
   AliITSLoader* itsloader = (AliITSLoader*)rl->GetLoader("ITSLoader");
+  /*
   TDirectory * olddir = gDirectory;
   rl->CdGAFile();
   AliITSgeom* g2  = (AliITSgeom*)gDirectory->Get("AliITSgeom");
   olddir->cd(); 
+  */
 
   TTree *tr =  itsloader->TreeR();
   AliITSDetTypeRec detTypeRec;
@@ -102,7 +104,7 @@ AliESDVertex* AliITSVertexerIons::FindVertexForCurrentEvent(Int_t evnumber){
   Int_t npoints=0;
   Int_t nopoints1=40000;
   Int_t nopoints2=40000;
-  Float_t l[3], p[3];
+  Float_t p[3];
 
   Double_t *z1, *z2, *y1, *y2, *x1, *x2, *phi1, *phi2, *r1, *r2;
   z1=new Double_t[nopoints1];
@@ -123,16 +125,19 @@ AliESDVertex* AliITSVertexerIons::FindVertexForCurrentEvent(Int_t evnumber){
   Double_t r=0;
 
   Int_t np1=0, np2=0;
-  for(Int_t i=g2->GetStartSPD();i<=g2->GetLastSPD();i++) {
+  for(Int_t i=AliITSgeomTGeo::GetModuleIndex(1,1,1);i<=AliITSgeomTGeo::GetModuleIndex(2,1,1)-1;i++) {
     detTypeRec.ResetRecPoints();
     tr->GetEvent(i);
     npoints = recpoints->GetEntries();
     for (Int_t ipoint=0;ipoint<npoints;ipoint++) {
       pnt = (AliITSRecPoint*)recpoints->UncheckedAt(ipoint);
+      /*
       l[0]=pnt->GetDetLocalX();
       l[1]=0;
       l[2]=pnt->GetDetLocalZ();
       g2->LtoG(i, l, p);
+      */
+      pnt->GetGlobalXYZ(p);
       r=TMath::Sqrt(TMath::Power(p[0],2)+TMath::Power(p[1],2));
 
       if(i<80 && TMath::Abs(p[2])<14.35)  {
index d1577a1a3ffc04e04f048d9520aefb17e189fc66..c3fc37104d2dc9161bca0780d5a1c2868ce9a1ad 100644 (file)
@@ -19,7 +19,7 @@
 #include <TString.h>
 #include<TTree.h>
 #include "AliITSLoader.h"
-#include "AliITSgeom.h"
+#include "AliITSgeomTGeo.h"
 #include "AliITSDetTypeRec.h"
 #include "AliITSRecPoint.h"
 #include "AliITSZPoint.h"
@@ -219,7 +219,7 @@ void AliITSVertexerZ::VertexZFinder(Int_t evnumber){
   fCurrentVertex = 0;
   AliRunLoader *rl =AliRunLoader::GetRunLoader();
   AliITSLoader* itsLoader = (AliITSLoader*)rl->GetLoader("ITSLoader");
-  AliITSgeom* geom = itsLoader->GetITSgeom();
+  //  AliITSgeom* geom = itsLoader->GetITSgeom();
   itsLoader->LoadRecPoints();
   rl->GetEvent(evnumber);
 
@@ -297,10 +297,13 @@ void AliITSVertexerZ::VertexZFinder(Int_t evnumber){
     detTypeRec.ResetRecPoints();
     for(Int_t j1=0;j1<nrecp1;j1++){
       AliITSRecPoint *recp = (AliITSRecPoint*)prpl1->At(j1);
+      /*
       lc1[0]=recp->GetDetLocalX();
       lc1[2]=recp->GetDetLocalZ();
       geom->LtoG(modul1,lc1,gc1);
       // Global coordinates of this recpoints
+      */
+      recp->GetGlobalXYZ(gc1);
       gc1[0]-=fNominalPos[0]; // Possible beam offset in the bending plane
       gc1[1]-=fNominalPos[1]; //   "               "
       Float_t r1=TMath::Sqrt(gc1[0]*gc1[0]+gc1[1]*gc1[1]);
@@ -311,15 +314,18 @@ void AliITSVertexerZ::VertexZFinder(Int_t evnumber){
       for(Int_t ladl2=0 ; ladl2<fLadOnLay2*2+1;ladl2++){
        for(Int_t k=0;k<4;k++){
          Int_t ladmod=fLadders[ladder-1]+ladl2;
-         if(ladmod>geom->GetNladders(2)) ladmod=ladmod-geom->GetNladders(2);
-         Int_t modul2=geom->GetModuleIndex(2,ladmod,k+1);
+         if(ladmod>AliITSgeomTGeo::GetNLadders(2)) ladmod=ladmod-AliITSgeomTGeo::GetNLadders(2);
+         Int_t modul2=AliITSgeomTGeo::GetModuleIndex(2,ladmod,k+1);
          branch->GetEvent(modul2);
          Int_t nrecp2 = itsRec->GetEntries();
          for(Int_t j2=0;j2<nrecp2;j2++){
            recp = (AliITSRecPoint*)itsRec->At(j2);
+           /*
            lc2[0]=recp->GetDetLocalX();
            lc2[2]=recp->GetDetLocalZ();
            geom->LtoG(modul2,lc2,gc2);
+           */
+           recp->GetGlobalXYZ(gc2);
            gc2[0]-=fNominalPos[0];
            gc2[1]-=fNominalPos[1];
            Float_t r2=TMath::Sqrt(gc2[0]*gc2[0]+gc2[1]*gc2[1]);