-//Author: Anders Strand Vestbo
-//Last Modified: 17.08.2001
+//$Id$
+
+// Author: Anders Vestbo <mailto:vestbo@fi.uib.no>
+//*-- Copyright © ASV
#include <iostream.h>
+#include <math.h>
#include "AliL3Logging.h"
#include "AliL3ClustFinderNew.h"
#include "AliL3DigitData.h"
#include "AliL3Transform.h"
#include "AliL3SpacePointData.h"
+#include "AliL3MemHandler.h"
+
+//_____________________________________________________________
+// AliL3ClustFinderNew
+//
+// The current cluster finder for HLT
+// Based on STAR L3
ClassImp(AliL3ClustFinderNew)
tmp += size;
tempPt = (AliL3DigitRowData*)tmp;
}
+ LOG(AliL3Log::kInformational,"AliL3ClustFinderNew::WriteClusters","Space points")
+ <<"Cluster finder found "<<fNClusters<<" clusters in slice "<<fCurrentSlice
+ <<" patch "<<fCurrentPatch<<ENDLOG;
+
+
}
while(1) //Loop over current sequence
{
+ if(data[bin].fTime >= fTransform->GetNTimeBins())
+ {
+ LOG(AliL3Log::kFatal,"AliL3ClustFinderNew::ProcessRow","Digits")
+ <<"Timebin out of range "<<(Int_t)data[bin].fTime<<ENDLOG;
+ break;
+ }
+
//Get the current ADC-value
UInt_t charge = data[bin].fCharge;
seq_mean = seq_average/seq_charge;
else
{
- printf("\nCF: Should not happen\n");
+ LOG(AliL3Log::kFatal,"AliL3ClustFinderNew::ProcessRow","Data")
+ <<"Error in data given to the cluster finder"<<ENDLOG;
seq_mean = 1;
seq_charge = 1;
}
<<AliL3Log::kDec<<"Too many clusters"<<ENDLOG;
return;
}
+ fSpacePointData[counter].fCharge = list[j].fTotalCharge;
fSpacePointData[counter].fX = xyz[0];
fSpacePointData[counter].fY = xyz[1];
fSpacePointData[counter].fZ = xyz[2];
fSpacePointData[counter].fZErr = fZErr;
fSpacePointData[counter].fID = counter
+((fCurrentSlice&0x7f)<<25)+((fCurrentPatch&0x7)<<22);//uli
-
+#ifdef do_mc
+ Int_t trackID[3];
+ GetTrackID((Int_t)rint(fpad),(Int_t)rint(ftime),trackID);
+ //cout<<"padrow "<<fCurrentRow<<" pad "<<(Int_t)rint(fpad)<<" time "<<(Int_t)rint(ftime)<<" Trackid "<<trackID[0]<<endl;
+ fSpacePointData[counter].fTrackID[0] = trackID[0];
+ fSpacePointData[counter].fTrackID[1] = trackID[1];
+ fSpacePointData[counter].fTrackID[2] = trackID[2];
+#endif
fNClusters++;
counter++;
}
+
+}
+
+#ifdef do_mc
+void AliL3ClustFinderNew::GetTrackID(Int_t pad,Int_t time,Int_t *trackID)
+{
+ AliL3DigitRowData *rowPt = (AliL3DigitRowData*)fDigitRowData;
+
+ trackID[0]=trackID[1]=trackID[2]=-2;
+ //cout<<"Looking for pad "<<pad<<" time "<<time<<endl;
+ for(Int_t i=fFirstRow; i<=fLastRow; i++)
+ {
+ if(rowPt->fRow < (UInt_t)fCurrentRow)
+ {
+ AliL3MemHandler::UpdateRowPointer(rowPt);
+ continue;
+ }
+ AliL3DigitData *digPt = (AliL3DigitData*)rowPt->fDigitData;
+ for(UInt_t j=0; j<rowPt->fNDigit; j++)
+ {
+ Int_t cpad = digPt[j].fPad;
+ Int_t ctime = digPt[j].fTime;
+ if(cpad != pad) continue;
+ if(ctime != time) continue;
+ //if(cpad != pad && ctime != ctime) continue;
+ //cout<<"Reading row "<<fCurrentRow<<" pad "<<cpad<<" time "<<ctime<<" trackID "<<digPt[j].fTrackID[0]<<endl;
+ trackID[0] = digPt[j].fTrackID[0];
+ trackID[1] = digPt[j].fTrackID[1];
+ trackID[2] = digPt[j].fTrackID[2];
+ break;
+ //cout<<"Reading trackID "<<trackID[0]<<endl;
+ }
+ break;
+ }
+
}
+#endif