]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - TRD/AliTRDclusterizer.cxx
Moving place of smell-detector
[u/mrichter/AliRoot.git] / TRD / AliTRDclusterizer.cxx
index 16aea8a5b4b2c3a32e8cd7aed909e173f6e6489f..87af305108a4d6ecfe1caaf4c99cff3994025bdc 100644 (file)
@@ -33,7 +33,6 @@
 #include "AliTRDcluster.h"
 #include "AliTRDrecPoint.h"
 #include "AliTRDgeometry.h"
-#include "AliTRDparameter.h"
 #include "AliTRDcalibDB.h"
 
 ClassImp(AliTRDclusterizer)
@@ -48,7 +47,6 @@ AliTRDclusterizer::AliTRDclusterizer():TNamed()
   fClusterTree = NULL;
   fRecPoints   = 0;
   fVerbose     = 0;
-  fPar         = 0;
 
 }
 
@@ -63,7 +61,6 @@ AliTRDclusterizer::AliTRDclusterizer(const Text_t* name, const Text_t* title)
   fClusterTree = NULL;
   fRecPoints   = 0;
   fVerbose     = 0;
-  fPar         = 0;
 
 }
 
@@ -113,7 +110,6 @@ void AliTRDclusterizer::Copy(TObject &c) const
   ((AliTRDclusterizer &) c).fClusterTree = NULL;
   ((AliTRDclusterizer &) c).fRecPoints   = NULL;  
   ((AliTRDclusterizer &) c).fVerbose     = fVerbose;  
-  ((AliTRDclusterizer &) c).fPar         = 0;
 
 }
 
@@ -241,7 +237,6 @@ Bool_t AliTRDclusterizer::WriteClusters(Int_t det)
     AliTRDgeometry *geo = fTRD->GetGeometry();
     geo->SetName("TRDgeometry");
     geo->Write();
-    fPar->Write();
     */
     AliLoader* loader = fRunLoader->GetLoader("TRDLoader");
     loader->WriteRecPoints("OVERWRITE");
@@ -304,18 +299,22 @@ AliTRDcluster* AliTRDclusterizer::AddCluster(Double_t *pos, Int_t timebin, Int_t
 }
 
 //_____________________________________________________________________________
-Double_t AliTRDclusterizer::CalcXposFromTimebin(Float_t timebin, Float_t vdrift)
+Double_t AliTRDclusterizer::CalcXposFromTimebin(Float_t timebin, Int_t idet, Int_t col, Int_t row)
 {
   //
   // Calculates the local x position in the detector from the timebin, depends on the drift velocity
-  // The timebin has to be t0 corrected already
+  // and t0
   //
   
   AliTRDcalibDB* calibration = AliTRDcalibDB::Instance();
   if (!calibration)
     return -1;
-    
-  Int_t totalTimebins = calibration->GetNumberOfTimeBins();
+
+  Float_t vdrift = calibration->GetVdrift(idet, col, row);  
+  Float_t t0 = calibration->GetT0(idet, col, row);
   Float_t samplingFrequency = calibration->GetSamplingFrequency();
-  return (totalTimebins - timebin) / samplingFrequency * vdrift;
+
+  timebin -= t0;
+
+  return timebin / samplingFrequency * vdrift;
 }