]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - TRD/AliTRDmodule.cxx
more methods use the correction framework
[u/mrichter/AliRoot.git] / TRD / AliTRDmodule.cxx
index f901b3d7d8345e4c6f5a4397ca0625339ec7c086..8989c7866b380aa457800abd2ff5f7130d6ac44c 100644 (file)
@@ -23,6 +23,7 @@
 
 #include <TObject.h>
 
+#include "AliRun.h"
 #include "AliLog.h"
 
 #include "AliTRDgeometry.h"
@@ -36,11 +37,11 @@ ClassImp(AliTRDmodule)
 
 //_____________________________________________________________________________
 AliTRDmodule::AliTRDmodule()
-  :TObject() 
+  :TObject()
   ,fXprojPlane(0)
   ,fField(0)
-  ,fTracklets(NULL)
-  ,fTracks(NULL)
+  ,fTracklets(new TObjArray(400))
+  ,fTracks(new TObjArray(400))
   ,fDeltaY(0)
   ,fDeltaS(0)
   ,fLTUtrk(0)
@@ -50,29 +51,21 @@ AliTRDmodule::AliTRDmodule()
   // AliTRDmodule default constructor
   //
 
-}
+  fXprojPlane = AliTRDtrigParam::Instance()->GetXprojPlane();
+  fDeltaY     = AliTRDtrigParam::Instance()->GetDeltaY();
+  fDeltaS     = AliTRDtrigParam::Instance()->GetDeltaS();
 
-//_____________________________________________________________________________
-AliTRDmodule::AliTRDmodule(AliTRDtrigParam *trigp) 
-  :TObject()
-  ,fXprojPlane(trigp->GetXprojPlane())
-  ,fField(trigp->GetField())
-  ,fTracklets(new TObjArray(400))
-  ,fTracks(new TObjArray(400))
-  ,fDeltaY(trigp->GetDeltaY())
-  ,fDeltaS(trigp->GetDeltaS())
-  ,fLTUtrk(0)
-  ,fGTUtrk(0)
-{
-  //
-  // AliTRDmodule constructor
-  //
+  // The magnetic field strength
+  Double_t x[3] = { 0.0, 0.0, 0.0 };
+  Double_t b[3];
+  gAlice->Field(x,b);  // b[] is in kilo Gauss
+  fField = b[2] * 0.1; // Tesla
 
-  for (Int_t iPlan = 0; iPlan < AliTRDgeometry::Nplan(); iPlan++) {
+  for (Int_t iLayer = 0; iLayer < AliTRDgeometry::Nlayer(); iLayer++) {
     for (Int_t i = 0; i < kNsubZchan; i++) {
-      fZnchan[iPlan][i] = 0;
+      fZnchan[iLayer][i] = 0;
       for (Int_t j = 0; j < kNmaxZchan; j++) {
-        fZtrkid[iPlan][j][i] = -1;
+        fZtrkid[iLayer][j][i] = -1;
       }
     }
   }
@@ -95,11 +88,11 @@ AliTRDmodule::AliTRDmodule(const AliTRDmodule &m)
   // AliTRDmodule copy constructor
   //
 
-  for (Int_t iPlan = 0; iPlan < AliTRDgeometry::Nplan(); iPlan++) {
+  for (Int_t iLayer = 0; iLayer < AliTRDgeometry::Nlayer(); iLayer++) {
     for (Int_t i = 0; i < kNsubZchan; i++) {
-      ((AliTRDmodule &) m).fZnchan[iPlan][i] = 0;
+      ((AliTRDmodule &) m).fZnchan[iLayer][i] = 0;
       for (Int_t j = 0; j < kNmaxZchan; j++) {
-        ((AliTRDmodule &) m).fZtrkid[iPlan][j][i] = -1;
+        ((AliTRDmodule &) m).fZtrkid[iLayer][j][i] = -1;
       }
     }
   }
@@ -143,11 +136,11 @@ void AliTRDmodule::Copy(TObject &m) const
   ((AliTRDmodule &) m).fLTUtrk     = NULL;
   ((AliTRDmodule &) m).fGTUtrk     = NULL;
 
-  for (Int_t iPlan = 0; iPlan < AliTRDgeometry::Nplan(); iPlan++) {
+  for (Int_t iLayer = 0; iLayer < AliTRDgeometry::Nlayer(); iLayer++) {
     for (Int_t i = 0; i < kNsubZchan; i++) {
-      ((AliTRDmodule &) m).fZnchan[iPlan][i] = 0;
+      ((AliTRDmodule &) m).fZnchan[iLayer][i] = 0;
       for (Int_t j = 0; j < kNmaxZchan; j++) {
-        ((AliTRDmodule &) m).fZtrkid[iPlan][j][i] = -1;
+        ((AliTRDmodule &) m).fZtrkid[iLayer][j][i] = -1;
       }
     }
   }
@@ -195,7 +188,7 @@ void AliTRDmodule::ResetTracks()
 }
 
 //_____________________________________________________________________________
-AliTRDgtuTrackAliTRDmodule::GetTrack(Int_t pos) const
+AliTRDgtuTrack *AliTRDmodule::GetTrack(Int_t pos) const
 {
   //
   // Return track at position "pos"
@@ -245,7 +238,7 @@ void AliTRDmodule::AddTracklet(Int_t det, Int_t row, Float_t rowz, Float_t slope
 }
 
 //_____________________________________________________________________________
-AliTRDltuTrackletAliTRDmodule::GetTracklet(Int_t pos) const
+AliTRDltuTracklet *AliTRDmodule::GetTracklet(Int_t pos) const
 {
   //
   // Get the tracklet at position "pos"
@@ -363,11 +356,11 @@ void AliTRDmodule::InitZLUT()
   // Initialize the pad row sorting look-up-table
   //
 
-  for (Int_t iPlan = 0; iPlan < AliTRDgeometry::Nplan(); iPlan++) {
+  for (Int_t iLayer = 0; iLayer < AliTRDgeometry::Nlayer(); iLayer++) {
     for (Int_t i = 0; i < kNsubZchan; i++) {
-      fZnchan[iPlan][i] = 0;
+      fZnchan[iLayer][i] = 0;
       for (Int_t j = 0; j < kNmaxZchan; j++) {
-        fZtrkid[iPlan][j][i] = -1;
+        fZtrkid[iLayer][j][i] = -1;
       }
     }
   }
@@ -396,9 +389,24 @@ void AliTRDmodule::FindTracksCombi(Int_t zchan)
   
   static Int_t trkTrack[12];
   
-  Int_t   nTracklets, nPlanes;
-  Int_t   ntrk1, trkId1, ntrk2, trkId2;
-  Float_t y1, y1min, y1max, s1, z1, s1min, s1max, y2, s2, z2;
+  Int_t   nTracklets;
+  Int_t   nPlanes;
+  Int_t   ntrk1;
+  Int_t   trkId1;
+  Int_t   ntrk2;
+  Int_t   trkId2;
+
+  Float_t y1;
+  Float_t y1min;
+  Float_t y1max;
+  Float_t s1;
+  Float_t z1;
+  Float_t s1min;
+  Float_t s1max;
+  Float_t y2;
+  Float_t s2;
+  Float_t z2;
+
   AliTRDltuTracklet *trk1;
   AliTRDltuTracklet *trk2;
   AliTRDltuTracklet *trk ;
@@ -537,8 +545,12 @@ void AliTRDmodule::RemoveMultipleTracks()
   AliTRDgtuTrack *trk1;
   AliTRDgtuTrack *trk2;
 
-  Float_t yproj1, yproj2, alpha1, alpha2;
-  Int_t   ntrk1, ntrk2;
+  Float_t yproj1;
+  Float_t yproj2;
+  Float_t alpha1;
+  Float_t alpha2;
+  Int_t   ntrk1;
+  Int_t   ntrk2;
   Int_t   iTrack = 0;
 
   while (iTrack < (GetNtracks()-1)) {
@@ -571,7 +583,7 @@ void AliTRDmodule::RemoveMultipleTracks()
 }
 
 //_____________________________________________________________________________
-TObjArrayAliTRDmodule::Tracklets() 
+TObjArray *AliTRDmodule::Tracklets() 
 { 
   //
   // Returns the list of tracklets
@@ -627,7 +639,7 @@ Int_t AliTRDmodule::GetNtracklets() const
 }
 
 //_____________________________________________________________________________
-TObjArrayAliTRDmodule::Tracks() 
+TObjArray *AliTRDmodule::Tracks() 
 {
   //
   // Returns the list of tracks