#include "AliTRDcluster.h"
#include "AliTRDrecPoint.h"
#include "AliTRDgeometry.h"
-#include "AliTRDparameter.h"
+#include "AliTRDcalibDB.h"
ClassImp(AliTRDclusterizer)
fClusterTree = NULL;
fRecPoints = 0;
fVerbose = 0;
- fPar = 0;
}
fClusterTree = NULL;
fRecPoints = 0;
fVerbose = 0;
- fPar = 0;
}
((AliTRDclusterizer &) c).fClusterTree = NULL;
((AliTRDclusterizer &) c).fRecPoints = NULL;
((AliTRDclusterizer &) c).fVerbose = fVerbose;
- ((AliTRDclusterizer &) c).fPar = 0;
}
AliTRDgeometry *geo = fTRD->GetGeometry();
geo->SetName("TRDgeometry");
geo->Write();
- fPar->Write();
*/
AliLoader* loader = fRunLoader->GetLoader("TRDLoader");
loader->WriteRecPoints("OVERWRITE");
//_____________________________________________________________________________
-void AliTRDclusterizer::AddCluster(Double_t *pos, Int_t det, Double_t amp
+AliTRDcluster* AliTRDclusterizer::AddCluster(Double_t *pos, Int_t timebin, Int_t det, Double_t amp
, Int_t *tracks, Double_t *sig, Int_t iType, Float_t center)
{
//
c->SetDetector(det);
c->AddTrackIndex(tracks);
c->SetQ(amp);
+ c->SetX(pos[2]);
c->SetY(pos[0]);
c->SetZ(pos[1]);
c->SetSigmaY2(sig[0]);
c->SetSigmaZ2(sig[1]);
- c->SetLocalTimeBin(((Int_t) pos[2]));
+ c->SetLocalTimeBin(timebin);
c->SetCenter(center);
switch (iType) {
case 0:
};
RecPoints()->Add(c);
+ return c;
+}
+
+//_____________________________________________________________________________
+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
+ // and t0
+ //
+
+ AliTRDcalibDB* calibration = AliTRDcalibDB::Instance();
+ if (!calibration)
+ return -1;
+
+ Float_t vdrift = calibration->GetVdrift(idet, col, row);
+ Float_t t0 = calibration->GetT0(idet, col, row);
+ Float_t samplingFrequency = calibration->GetSamplingFrequency();
+
+ timebin -= t0;
+ return timebin / samplingFrequency * vdrift;
}