bug fixed for alignment, removed alignment database access from AliPMDUtility class
authorbasanta <basanta@f7af4fe6-9843-0410-8265-dc069ae4e863>
Tue, 14 Sep 2010 16:46:19 +0000 (16:46 +0000)
committerbasanta <basanta@f7af4fe6-9843-0410-8265-dc069ae4e863>
Tue, 14 Sep 2010 16:46:19 +0000 (16:46 +0000)
PMD/AliPMDUtility.cxx
PMD/AliPMDtracker.cxx

index fd59ea6..d550504 100644 (file)
 #include "TMath.h"
 #include "TText.h"
 #include "TLine.h"
-#include <TClonesArray.h>
 
 #include <stdio.h>
 #include <math.h>
 
 #include "AliPMDUtility.h"
-#include "AliAlignObjMatrix.h"
-#include "AliCDBManager.h"
-#include "AliCDBEntry.h"
-#include "AliLog.h"
-
 
 ClassImp(AliPMDUtility)
 
 AliPMDUtility::AliPMDUtility():
-  fAlObj(GetAlignObj()),
   fPx(0.),
   fPy(0.),
   fPz(0.),
@@ -61,7 +54,6 @@ AliPMDUtility::AliPMDUtility():
 }
 
 AliPMDUtility::AliPMDUtility(Float_t px, Float_t py, Float_t pz):
-  fAlObj(GetAlignObj()),
   fPx(px),
   fPy(py),
   fPz(pz),
@@ -82,7 +74,6 @@ AliPMDUtility::AliPMDUtility(Float_t px, Float_t py, Float_t pz):
 }
 AliPMDUtility::AliPMDUtility(const AliPMDUtility &pmdutil):
   TObject(pmdutil),
-  fAlObj(pmdutil.GetAlignObj()),
   fPx(pmdutil.fPx),
   fPy(pmdutil.fPy),
   fPz(pmdutil.fPz),
@@ -614,22 +605,15 @@ void AliPMDUtility::ApplyVertexCorrection(Float_t vertex[], Float_t xpos,
   fPy = ypos - vertex[1];
   fPz = zpos - vertex[2];
 }
-void AliPMDUtility::ApplyAlignment()
+void AliPMDUtility::ApplyAlignment(Double_t sectr[][3])
 {
   // Get the alignment stuff here
 
-  AliAlignObjMatrix * aam;
-  Double_t tr[3];
-  //Double_t secTr[4][3];
-
   for (Int_t isector=0; isector<4; isector++)
     {
-      aam = (AliAlignObjMatrix*)fAlObj->UncheckedAt(isector);
-      aam->GetTranslation(tr);
-      
       for(Int_t ixyz=0; ixyz < 3; ixyz++)
        {
-         fSecTr[isector][ixyz] = (Float_t) tr[ixyz];
+         fSecTr[isector][ixyz] = (Float_t) sectr[isector][ixyz];
        }
     }
 }
@@ -756,20 +740,3 @@ Float_t AliPMDUtility::GetZ() const
   return fPz;
 }
 //--------------------------------------------------------------------//
-TClonesArray* AliPMDUtility::GetAlignObj() const
-{
-  // The run number will be centralized in AliCDBManager,
-  // you don't need to set it here!
-  AliCDBEntry  *entry = AliCDBManager::Instance()->Get("PMD/Align/Data");
-  
-  if(!entry) AliFatal("Alignment object retrieval failed!");
-  
-  TClonesArray *alobj = 0;
-  if (entry) alobj = (TClonesArray*) entry->GetObject();
-  
-  if (!alobj)  AliFatal("No alignment data from  database !");
-  
-  return alobj;
-}
-
-
index ccef6f2..9d9da19 100644 (file)
 #include <TNtuple.h>
 #include <TParticle.h>
 
+#include <TGeoMatrix.h>
+
+#include "AliGeomManager.h"
+
 #include "AliPMDcluster.h"
 #include "AliPMDclupid.h"
 #include "AliPMDrecpoint1.h"
@@ -243,6 +247,29 @@ void AliPMDtracker::Clusters2Tracks(AliESDEvent *event)
   AliPMDEmpDiscriminator pmddiscriminator;
   pmddiscriminator.Discrimination(fPMDcontin,fPMDcontout);
 
+  // alignment implemention
+
+  Double_t sectr[4][3] = { {0.,0.,0.},{0.,0.,0.},{0.,0.,0.},{0.,0.,0.}};
+  TString snsector="PMD/Sector";
+  TString symname;
+  TGeoHMatrix gpmdor;
+  
+  for(Int_t isector=1; isector<=4; isector++)
+    {
+      symname = snsector;
+      symname += isector;
+      TGeoHMatrix *gpmdal = AliGeomManager::GetMatrix(symname);
+      Double_t *tral = gpmdal->GetTranslation();
+
+      AliGeomManager::GetOrigGlobalMatrix(symname, gpmdor);
+      Double_t *tror = gpmdor.GetTranslation();
+      
+      for(Int_t ixyz=0; ixyz<3; ixyz++)
+       {
+         sectr[isector-1][ixyz] = tral[ixyz] - tror[ixyz];
+       }
+    }
+
   const Float_t kzpos = 361.5;    // middle of the PMD
 
   Int_t   ix = -1, iy = -1;
@@ -252,7 +279,7 @@ void AliPMDtracker::Clusters2Tracks(AliESDEvent *event)
   Float_t xglobal = 0., yglobal = 0., zglobal = 0;
   Float_t pid = 0.;
 
-  fPMDutil->ApplyAlignment();
+  fPMDutil->ApplyAlignment(sectr);
 
   Int_t nentries2 = fPMDcontout->GetEntries();
   AliDebug(1,Form("Number of clusters coming after discrimination = %d"