//_____________________________________________________________________________
AliTRDmcmTracklet::AliTRDmcmTracklet()
{
-
//
// AliTRDmcmTracklet default constructor
//
//_____________________________________________________________________________
AliTRDmcmTracklet::AliTRDmcmTracklet(Int_t det, Int_t row, Int_t n)
{
-
//
// AliTRDmcmTracklet default constructor
//
//_____________________________________________________________________________
AliTRDmcmTracklet::~AliTRDmcmTracklet()
{
-
//
// AliTRDmcmTracklet destructor
//
- delete fGPos;
- delete fGAmp;
+
+ if (fGPos != 0) delete fGPos;
+ if (fGAmp != 0) delete fGAmp;
+
}
//_____________________________________________________________________________
}
//_____________________________________________________________________________
-void AliTRDmcmTracklet::AddCluster(Int_t icol, Int_t itb, Float_t *adc, Int_t *track)
+void AliTRDmcmTracklet::Reset()
{
//
+ // Reset the tracklet information
+ //
+
+ fDetector = -1;
+ fRow = -1;
+
+ for (Int_t time = 0; time < kNtimeBins; time++) {
+ for (Int_t icl = 0; icl < kNclsPads; icl++) {
+ fADC[time][icl] = 0;
+ }
+ for (Int_t it = 0; it < kNdict; it++) {
+ fTrack[time][it] = -1;
+ }
+ fTime[time] = 0;
+ fCol[time] = 0;
+ }
+
+ fNclusters = 0;
+ fN = 0;
+ fTrackLabel = -1;
+
+ fGPos->Set(0);
+ fGAmp->Set(0);
+
+ fSlope = 0.0;
+ fOffset = 0.0;
+ fTime0 = 0.0;
+ fRowz = 0.0;
+ fPt = 0.0;
+ fdQdl = 0.0;
+
+}
+
+//_____________________________________________________________________________
+void AliTRDmcmTracklet::AddCluster(Int_t icol, Int_t itb, Float_t *adc, Int_t *track)
+{
//
+ // Add a cluster to the tracklet
//
if (fNclusters >= kNtimeBins) return;
//_____________________________________________________________________________
void AliTRDmcmTracklet::MakeTrackletGraph(AliTRDgeometry *geo, Float_t field)
{
-
//
// Tracklet graph of positions (global coordinates, rotated [cm])
//
fGPos->Set(npg);
fTime0 = geo->GetTime0(iplan) - AliTRDgeometry::CdrHght() - 0.5*AliTRDgeometry::CamHght();
- fRowz = padPlane->GetRowPos(fRow) - padPlane->GetRowSize(fRow)/2.0;
+ fRowz = 0.5*(padPlane->GetRowPos(fRow) + padPlane->GetRowPos(fRow+1));
Double_t xMin = 0, xMax = 0, x, y;
fGPos->GetPoint(0 ,x,y); xMax = x + 0.1;
// Tracklet graph of cluster charges
//
- AliTRDcalibDB* calibration = AliTRDcalibDB::Instance();
- if (!calibration)
- {
- Error("MakeClusAmpGraph","No instance of AliTRDcalibDB.");
- return;
- }
-
Int_t time;
Float_t amp[3];
Int_t npg = 0;
fTrigParam = NULL;
fMCM = NULL;
fTrk = NULL;
+ fTrkTest = NULL;
fGTUtrk = NULL;
fNtracklets = 0;
fNPrimary = 0;
+ fField = 0.0;
+ fGeo = NULL;
+ fCalib = NULL;
+ fCParam = NULL;
+
}
//_____________________________________________________________________________
fTrigParam = NULL;
fMCM = NULL;
fTrk = NULL;
+ fTrkTest = NULL;
fGTUtrk = NULL;
fNtracklets = 0;
fNPrimary = 0;
+ fField = 0.0;
+ fGeo = NULL;
+ fCalib = NULL;
+ fCParam = NULL;
+
}
//_____________________________________________________________________________
*/
fTracks.Clear();
+ fField = fTrigParam->GetField();
+ fGeo = (AliTRDgeometry*)AliTRDgeometry::GetGeometry(fRunLoader);
+
+ fCalib = AliTRDcalibDB::Instance();
+ if (!fCalib)
+ {
+ Error("Init","No instance of AliTRDcalibDB.");
+ return;
+ }
+
+ fCParam = AliTRDCommonParam::Instance();
+ if (!fCParam)
+ {
+ Error("Init","No common params.");
+ return;
+ }
+
}
//_____________________________________________________________________________
//_____________________________________________________________________________
Bool_t AliTRDtrigger::MakeTracklets(Bool_t makeTracks)
{
-
- AliTRDcalibDB* calibration = AliTRDcalibDB::Instance();
- if (!calibration)
- {
- Error("MakeTracklets","No instance of AliTRDcalibDB.");
- return kFALSE;
- }
-
- AliTRDCommonParam* commonParam = AliTRDCommonParam::Instance();
- if (!commonParam)
- {
- Error("MakeTracklets","No common params.");
- return kFALSE;
- }
-
- AliTRDgeometry *geo = AliTRDgeometry::GetGeometry(fRunLoader);
+ //
+ // Create tracklets from digits
+ //
Int_t chamBeg = 0;
Int_t chamEnd = AliTRDgeometry::Ncham();
Int_t sectBeg = 0;
Int_t sectEnd = AliTRDgeometry::Nsect();
+ fTrkTest = new AliTRDmcmTracklet(0,0,0);
+
fMCM = new AliTRDmcm(fTrigParam,0);
Int_t time, col, row, col1, col2;
Float_t amp;
Int_t idet, iStack, iStackPrev;
- idet = -1;
-
+ idet = -1;
iStack = -1;
iStackPrev = -1;
for (Int_t isect = sectBeg; isect < sectEnd; isect++) {
for (Int_t iplan = planBeg; iplan < planEnd; iplan++) {
- idet = geo->GetDetector(iplan,icham,isect);
+ idet = fGeo->GetDetector(iplan,icham,isect);
ResetTracklets();
if (makeTracks) {
}
}
- Int_t nRowMax = commonParam->GetRowMax(iplan,icham,isect);
- Int_t nColMax = commonParam->GetColMax(iplan);
- Int_t nTimeTotal = calibration->GetNumberOfTimeBins();
+ Int_t nRowMax = fCParam->GetRowMax(iplan,icham,isect);
+ Int_t nColMax = fCParam->GetColMax(iplan);
+ Int_t nTimeTotal = fCalib->GetNumberOfTimeBins();
// Get the digits
fDigits = fDigitsManager->GetDigits(idet);
row = fMCM->GetRow();
- if (row < 0 || row >= nRowMax) {
+ if (row < 0 || row > nRowMax) {
Error("MakeTracklets","MCM row number out of range.");
- continue;
}
fMCM->GetColRange(col1,col2);
}
}
- AddTracklet(idet,row,iSeed,fNtracklets++);
+ if (TestTracklet(idet,row,iSeed,0)) {
+ AddTracklet(idet,row,iSeed,fNtracklets++);
+ }
}
//_____________________________________________________________________________
void AliTRDtrigger::SetMCMcoordinates(Int_t imcm)
{
+ //
+ // Configure MCM position in the pad plane
+ //
Int_t robid = fMCM->GetRobId();
}
//_____________________________________________________________________________
-void AliTRDtrigger::AddTracklet(Int_t det, Int_t row, Int_t seed, Int_t n)
+Bool_t AliTRDtrigger::TestTracklet(Int_t det, Int_t row, Int_t seed, Int_t n)
{
+ //
+ // Check first the tracklet pt
+ //
- Float_t field = fTrigParam->GetField();
- AliTRDgeometry *geo = (AliTRDgeometry*)AliTRDgeometry::GetGeometry(fRunLoader);
+ Int_t nTimeTotal = fCalib->GetNumberOfTimeBins();
+
+ fTrkTest->Reset();
+
+ fTrkTest->SetDetector(det);
+ fTrkTest->SetRow(row);
+ fTrkTest->SetN(n);
+
+ Int_t iCol, iCol1, iCol2, track[3];
+ iCol = fMCM->GetSeedCol()[seed]; // 0....20 (MCM)
+ fMCM->GetColRange(iCol1,iCol2); // range in the pad plane
+
+ Float_t amp[3];
+ for (Int_t iTime = 0; iTime < nTimeTotal; iTime++) {
+
+ amp[0] = fMCM->GetADC(iCol-1,iTime);
+ amp[1] = fMCM->GetADC(iCol ,iTime);
+ amp[2] = fMCM->GetADC(iCol+1,iTime);
+
+ // extract track contribution only from the central pad
+ track[0] = fTrack0->GetDataUnchecked(row,iCol+iCol1,iTime);
+ track[1] = fTrack1->GetDataUnchecked(row,iCol+iCol1,iTime);
+ track[2] = fTrack2->GetDataUnchecked(row,iCol+iCol1,iTime);
+
+ if (fMCM->IsCluster(iCol,iTime)) {
+
+ fTrkTest->AddCluster(iCol+iCol1,iTime,amp,track);
+
+ } else if ((iCol+1+1) < kMcmCol) {
+
+ amp[0] = fMCM->GetADC(iCol-1+1,iTime);
+ amp[1] = fMCM->GetADC(iCol +1,iTime);
+ amp[2] = fMCM->GetADC(iCol+1+1,iTime);
+
+ if (fMCM->IsCluster(iCol+1,iTime)) {
+
+ // extract track contribution only from the central pad
+ track[0] = fTrack0->GetDataUnchecked(row,iCol+1+iCol1,iTime);
+ track[1] = fTrack1->GetDataUnchecked(row,iCol+1+iCol1,iTime);
+ track[2] = fTrack2->GetDataUnchecked(row,iCol+1+iCol1,iTime);
+
+ fTrkTest->AddCluster(iCol+1+iCol1,iTime,amp,track);
+
+ }
+
+ } else {
+ }
- AliTRDcalibDB* calibration = AliTRDcalibDB::Instance();
- if (!calibration)
- {
- Error("AddTracklets","No instance of AliTRDcalibDB.");
- return;
+ }
+
+ fTrkTest->CookLabel(0.8);
+ /*
+ if (fTrkTest->GetLabel() >= fNPrimary) {
+ Info("AddTracklet","Only primaries are stored!");
+ return;
+ }
+ */
+ // LTU Pt cut
+
+ fTrkTest->MakeTrackletGraph(fGeo,fField);
+ fTrkTest->MakeClusAmpGraph();
+ if (TMath::Abs(fTrkTest->GetPt()) < fTrigParam->GetLtuPtCut()) {
+ return kFALSE;
}
- Int_t nTimeTotal = calibration->GetNumberOfTimeBins();
+ return kTRUE;
+
+}
+
+//_____________________________________________________________________________
+void AliTRDtrigger::AddTracklet(Int_t det, Int_t row, Int_t seed, Int_t n)
+{
+ //
+ // Add a found tracklet
+ //
+
+ Int_t nTimeTotal = fCalib->GetNumberOfTimeBins();
fTrk = new AliTRDmcmTracklet(det,row,n);
}
*/
// LTU Pt cut
- fTrk->MakeTrackletGraph(geo,field);
+ fTrk->MakeTrackletGraph(fGeo,fField);
fTrk->MakeClusAmpGraph();
if (TMath::Abs(fTrk->GetPt()) < fTrigParam->GetLtuPtCut()) {
return;
fModule->Reset();
- AliTRDCommonParam* commonParam = AliTRDCommonParam::Instance();
- if (!commonParam)
- {
- Error("MakeTracks","No common params.");
- return;
- }
-
Int_t nRowMax, iplan, icham, isect, row;
- AliTRDgeometry *geo = (AliTRDgeometry*)AliTRDgeometry::GetGeometry(fRunLoader);
-
if ((det < 0) || (det >= AliTRDgeometry::Ndet())) {
Error("MakeTracks","Unexpected detector index %d.",det);
return;
trk = (AliTRDmcmTracklet *) Tracklets()->UncheckedAt(i);
- iplan = geo->GetPlane(trk->GetDetector());
- icham = geo->GetChamber(trk->GetDetector());
- isect = geo->GetSector(trk->GetDetector());
+ iplan = fGeo->GetPlane(trk->GetDetector());
+ icham = fGeo->GetChamber(trk->GetDetector());
+ isect = fGeo->GetSector(trk->GetDetector());
- nRowMax = commonParam->GetRowMax(iplan,icham,isect);
+ nRowMax = fCParam->GetRowMax(iplan,icham,isect);
row = trk->GetRow();
fModule->AddTracklet(trk->GetDetector(),
fModule->SortTracklets();
fModule->RemoveMultipleTracklets();
- fModule->SortZ((Int_t)geo->GetChamber(det));
+ fModule->SortZ((Int_t)fGeo->GetChamber(det));
fModule->FindTracks();
fModule->SortTracks();
fModule->RemoveMultipleTracks();