//____________________________________________________________
-Bool_t AliTRDseedV1::Init(AliTRDtrackV1 *track)
+Bool_t AliTRDseedV1::Init(const AliTRDtrackV1 *track)
{
// Initialize this tracklet using the track information
//
AliTRDcluster *c(NULL); Float_t qt(0.);
for(int ic=0; ic<kNclusters; ic++){
if(!(c=fClusters[ic])) continue;
- if(c->IsInChamber() && !useOutliers) continue;
+ if(!c->IsInChamber() && !useOutliers) continue;
qt += TMath::Abs(c->GetQ());
}
return qt;
}
+//____________________________________________________________________
+Int_t AliTRDseedV1::GetChargeGaps(Float_t sz[kNtb], Float_t pos[kNtb], Int_t isz[kNtb]) const
+{
+// Find number, size and position of charge gaps (consecutive missing time bins).
+// Returns the number of gaps and fills their size in input array "sz" and position in array "pos"
+
+ Bool_t gap(kFALSE);
+ Int_t n(0);
+ Int_t ipos[kNtb]; memset(isz, 0, kNtb*sizeof(Int_t));memset(ipos, 0, kNtb*sizeof(Int_t));
+ for(int ic(0); ic<kNtb; ic++){
+ if(fClusters[ic] || fClusters[ic+kNtb]){
+ if(gap) n++;
+ continue;
+ }
+ gap = kTRUE;
+ isz[n]++;
+ ipos[n] = ic;
+ }
+ if(!n) return 0;
+
+ // write calibrated values
+ AliTRDcluster fake;
+ for(Int_t igap(0); igap<n; igap++){
+ sz[igap] = isz[igap]*fVD/AliTRDCommonParam::Instance()->GetSamplingFrequency();
+ fake.SetPadTime(ipos[igap]);
+ pos[igap] = fake.GetXloc(fT0, fVD);
+ if(isz[igap]>1){
+ fake.SetPadTime(ipos[igap]-isz[igap]+1);
+ pos[igap] += fake.GetXloc(fT0, fVD);
+ pos[igap] /= 2.;
+ }
+ }
+ return n;
+}
+
+
//____________________________________________________________________
Bool_t AliTRDseedV1::GetEstimatedCrossPoint(Float_t &x, Float_t &z) const
{
//
// Charge of the clusters at timebin
//
- Float_t Q = 0;
+ Float_t q = 0;
if(fClusters[tb] /*&& fClusters[tb]->IsInChamber()*/)
- Q += TMath::Abs(fClusters[tb]->GetQ());
+ q += TMath::Abs(fClusters[tb]->GetQ());
if(fClusters[tb+kNtb] /*&& fClusters[tb+kNtb]->IsInChamber()*/)
- Q += TMath::Abs(fClusters[tb+kNtb]->GetQ());
- return Q/TMath::Sqrt(1. + fYref[1]*fYref[1] + fZref[1]*fZref[1]);
+ q += TMath::Abs(fClusters[tb+kNtb]->GetQ());
+ return q/TMath::Sqrt(1. + fYref[1]*fYref[1] + fZref[1]*fZref[1]);
}
//____________________________________________________________________