]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - TRD/AliTRDtransform.cxx
Macro to produce SPD vertices with Z and 3D vertexers
[u/mrichter/AliRoot.git] / TRD / AliTRDtransform.cxx
index 89a10cac6c4e718259b06e4318350d873db60c1f..0c725c659232abc0f75cc3438099c2ddac5c1a37 100644 (file)
@@ -90,7 +90,9 @@ AliTRDtransform::AliTRDtransform(Int_t det)
   //
 
   fGeo               = new AliTRDgeometry();
-  fGeo->ReadGeoMatrices();
+  if (!fGeo->CreateClusterMatrixArray()) {
+    AliError("Could not get transformation matrices\n");
+  }
 
   fParam             = AliTRDCommonParam::Instance();
   if (!fParam) {
@@ -139,7 +141,7 @@ AliTRDtransform::AliTRDtransform(const AliTRDtransform &t)
     delete fGeo;
   }
   fGeo               = new AliTRDgeometry();
-  fGeo->ReadGeoMatrices();
+  fGeo->CreateClusterMatrixArray();
 
   fParam             = AliTRDCommonParam::Instance();
   if (!fParam) {
@@ -194,13 +196,12 @@ void AliTRDtransform::SetDetector(Int_t det)
   fZShiftIdeal       = 0.5 * (fPadPlane->GetRow0() + fPadPlane->GetRowEnd());
 
   // Get the current transformation matrix
-  fMatrix            = fGeo->GetCorrectionMatrix(det);
+  fMatrix            = fGeo->GetClusterMatrix(det);
 
 }
 
 //_____________________________________________________________________________
-void AliTRDtransform::Transform(Double_t *x, Int_t *i, UInt_t time
-                             , Int_t  /*coordinateType*/)
+Bool_t AliTRDtransform::Transform(Double_t *x, Int_t *i, UInt_t time, Bool_t &out, Int_t  /*coordinateType*/)
 {
   //
   // Transforms the local cluster coordinates into calibrated 
@@ -246,6 +247,8 @@ void AliTRDtransform::Transform(Double_t *x, Int_t *i, UInt_t time
     x[5] = 0.0;
     i[2] = 0;
 
+    return kFALSE;
+
   }
   else {
  
@@ -299,6 +302,11 @@ void AliTRDtransform::Transform(Double_t *x, Int_t *i, UInt_t time
     x[4] = colSize*colSize * (clusterSigmaY2 + 1.0/12.0);
     x[5] = rowSize*rowSize / 12.0;                                       
     i[2] = TMath::Nint(timeT0Cal);
+               
+               // A.Bercuci for TRD tracking calibration awareness
+               out = (i[2] < 0 || i[2] > Int_t(3.5*fSamplingFrequency/vdrift)) ? kTRUE : kFALSE; 
+
+    return kTRUE;
 
   }
 
@@ -333,12 +341,13 @@ void AliTRDtransform::Recalibrate(AliTRDcluster *c, Bool_t setDet)
   clusterRCT[1] = c->GetPadCol();
   clusterRCT[2] = 0;
   Int_t time    = c->GetPadTime();
-  Transform(clusterXYZ,clusterRCT,((UInt_t) time),0);
+  Bool_t out;
+  Transform(clusterXYZ,clusterRCT,((UInt_t) time), out, 0);
 
   // Set the recalibrated coordinates
   c->SetX(clusterXYZ[0]);
   c->SetY(clusterXYZ[1]);
   c->SetZ(clusterXYZ[2]);
   c->SetLocalTimeBin(((Char_t) clusterRCT[2]));
-
+       c->SetInChamber(!out);
 }