From: loizides Date: Mon, 2 Feb 2004 15:00:34 +0000 (+0000) Subject: Moved to the latest version of the HLT code in Bergen. X-Git-Url: http://git.uio.no/git/?a=commitdiff_plain;h=1f1942b884daeb657585e71f3cb005ffb6f85e2e;p=u%2Fmrichter%2FAliRoot.git Moved to the latest version of the HLT code in Bergen. Most important changes, since last checkin are: a) Static Index in AliL3Filehandler to speed up IO b) LUT Hough transformation improving track candidate finding by a factor of 3 c) Changes related to how the track parameters are calculated and stored. There should be no changes for normal use, i.e. the function calls are still the same. The changes are the following: - Most importantly, the first point on a track (accessible via AliL3Track::GetFirstPoint()) is now calculated as the point lying on the helix fit. Earlier, this point was just the coordinates of the innermost assigned cluster of the track. This is in principle ok if you just want the quick "global" coordinates of the track; momentum etc. However, for precisce local calculations such as residuals, this point should be the point of closest approach lying on the helix fit. If not, the calculated track parameters (such as center of curvature) will be slightly shifted. The tracks are updated to the first point if the AliLevel3::fIsTracksAtFirstPoint is set to true (which is default). If this is not desired, and the track should be defined at the vertex (not DCAO!), you can still do AliLevel3::SetTracks2Vertex(). d) A new static boolean has been introduced in AliLevel3::fDoVertexFit, which tells the track fitter to include the vertex in the fit or not. e)Change in interface of updating tracks, instead of using the fitter class, use track->UpdatetoFistPoint (see deconvoluter macro). --- diff --git a/HLT/Makefile.conf b/HLT/Makefile.conf index 3c2426415f3..833be2e2360 100644 --- a/HLT/Makefile.conf +++ b/HLT/Makefile.conf @@ -6,6 +6,9 @@ # Constantin Loizide # ################################ +#Added for MACOSX +ARCH = $(shell uname) + #Specify the directory where the level3code tree is located. ifndef ALIHLT_TOPDIR ALIHLT_TOPDIR = $(HOME)/workcode/level3code @@ -66,18 +69,33 @@ endif #own setting by defining them outside (make -e) #---------------------------------------------------- -CXX = g++ -LD = $(CXX) GCCVERSION = $(shell $(CXX) --version | head -n 1 | cut -d" " -f 3 | cut -d. -f 1 | cut -d" " -f1) - CXXGCC3FLAGS = -DGCCVERSION=$(GCCVERSION) + +ifeq ($(ARCH),Darwin) +FINKDIR = /sw +CXX = g++ +CXXFLAGS = -O -pipe -Wall -fsigned-char $(CXXGCC3FLAGS) $(EXTRACXXFLAGS) +LD = $(CXX) +#SOFLAGS = -bundle -flat_namespace -Xlinker -bind_at_load -undefined suppress +SOFLAGS = -bundle -flat_namespace -undefined suppress +DYFLAGS = -dynamiclib -flat_namespace -undefined suppress \ + -compatibility_version 1 -current_version 1.0.0 +LDFLAGS = -O $(EXTRALDFLAGS) -L/sw/lib -ldl + +CINTCXXFLAGS = -pipe -W -Wall -fsigned-char \ + -DG__REGEXP -DG__UNIX -DG__SHAREDLIB \ + -DG__ROOT -DG__REDIRECTIO -DG__OSFDLL +else +CXX = g++ +LD = $(CXX) #CXXGCC3FLAGS += -pedantic #CXXGCC3FLAGS += -Wno-deprecated #CXXGCC3FLAGS += -Woverloaded-virtual #If you are compiling on the alpha, use this flag: #EXTRACXXFLAGS += -mcpu=ev6 - CXXFLAGS = -O2 -Wall -fPIC $(CXXGCC3FLAGS) $(EXTRACXXFLAGS) LDFLAGS = -O2 $(EXTRALDFLAGS) SOFLAGS = -shared +endif diff --git a/HLT/Makefile.rules b/HLT/Makefile.rules index ed82709c9a4..a97d819a75d 100644 --- a/HLT/Makefile.rules +++ b/HLT/Makefile.rules @@ -13,7 +13,7 @@ DEFSTR = -Dno_root OBJDIR = lib_alone -INCLUDES = -I$(ALIHLT_TOPDIR)/hough -I$(ALIHLT_TOPDIR)/src -I$(ALIHLT_TOPDIR)/comp -I$(ALIHLT_TOPDIR)/misc -I$(ALIHLT_TOPDIR)/trigger -I$(ALIHLT_TOPDIR)/kalman +INCLUDES = -I$(ALIHLT_TOPDIR)/src -I$(ALIHLT_TOPDIR)/hough -I$(ALIHLT_TOPDIR)/comp -I$(ALIHLT_TOPDIR)/misc -I$(ALIHLT_TOPDIR)/trigger -I$(ALIHLT_TOPDIR)/kalman ifeq ($(ALIHLT_USEPACKAGE),ROOT) INCLUDES += -I$(ROOTSYS)/include @@ -54,7 +54,7 @@ INCLUDES += -I/prog/alice/level3/kip/MLUC/include endif endif -DEFSTR += $(EXTRADEF) +DEFSTR += -D$(ARCH) $(EXTRADEF) DICT = $(MODNAME)Cint-$(ALIHLT_USEPACKAGE).cxx DICTH = $(MODNAME)Cint-$(ALIHLT_USEPACKAGE).h @@ -71,6 +71,7 @@ endif endif ALIHLT_LIBSO = $(ALIHLT_LIBDIR)/lib$(MODNAME).so +ALIHLT_DYLIB = $(ALIHLT_LIBDIR)/lib$(MODNAME).dylib #Default Targets # @@ -78,11 +79,16 @@ ALIHLT_LIBSO = $(ALIHLT_LIBDIR)/lib$(MODNAME).so all: $(OBJDIR) $(ALIHLT_LIBDIR) $(ALIHLT_LIBSO) $(ALIHLT_LIBSO): $(OBJS) - $(LD) $(SOFLAGS) $(LDFLAGS) $^ -o $@ +ifeq ($(ARCH),Darwin) + $(LD) $(DYFLAGS) $^ $(LDFLAGS) -o $(ALIHLT_DYLIB) +endif + $(LD) $(SOFLAGS) $^ $(LDFLAGS) -o $@ + $(DICT): $(HDRS) @echo "Generating dictionary..." - rootcint -f $(DICT) -c $(INCLUDES) -DGCCVERSION=$(GCCVERSION) $(DEFSTR) -include AliL3StandardIncludes.h $(HDRS) + rootcint -f $(DICT) -c $(CINTCXXFLAGS) $(INCLUDES) -DGCCVERSION=$(GCCVERSION) \ + $(DEFSTR) -include AliL3StandardIncludes.h $(HDRS) $(OBJDIR)/%.o: %.cxx $(CXX) $(CXXFLAGS) $(DEFSTR) -c $(INCLUDES) -o $@ $< @@ -124,7 +130,7 @@ clean: rm -rf $(OBJDIR) so: - rm -f $(ALIHLT_LIBSO) + rm -f $(ALIHLT_LIBSO) $(ALIHLT_DYLIB) realclean: clean so diff --git a/HLT/comp/AliL3ClusterFitter.cxx b/HLT/comp/AliL3ClusterFitter.cxx index 72d7179b5a3..b4002a9890c 100644 --- a/HLT/comp/AliL3ClusterFitter.cxx +++ b/HLT/comp/AliL3ClusterFitter.cxx @@ -710,7 +710,8 @@ Bool_t AliL3ClusterFitter::IsMaximum(Int_t pad,Int_t time) void AliL3ClusterFitter::CalculateWeightedMean(AliL3ModelTrack *track,Int_t *padrange,Int_t *timerange) { - Float_t sum=0,npads=0; + Float_t sum=0; + Int_t npads=0; Float_t pad=0,time=0; Int_t nt = AliL3Transform::GetNTimeBins()+1; for(Int_t i=padrange[0]; i<=padrange[1]; i++) @@ -1122,8 +1123,8 @@ void AliL3ClusterFitter::AddClusters() tr->CalculateClusterWidths(i,kTRUE); //Parametrize errors - tr->GetXYWidth(i,xywidth); - tr->GetZWidth(i,zwidth); + tr->GetSigmaY2(i,xywidth); + tr->GetSigmaZ2(i,zwidth); Float_t xyz[3]; Int_t sector,row; AliL3Transform::Slice2Sector(fSlice,i,sector,row); diff --git a/HLT/comp/AliL3CompLinkDef.h b/HLT/comp/AliL3CompLinkDef.h index 69530250bb6..f812c49ae4c 100644 --- a/HLT/comp/AliL3CompLinkDef.h +++ b/HLT/comp/AliL3CompLinkDef.h @@ -7,11 +7,16 @@ #pragma link off all functions; #pragma link C++ class AliL3Modeller; +#ifndef Darwin #pragma link C++ class AliL3ModelTrack; +#endif #pragma link C++ class AliL3Compress; #pragma link C++ class AliL3ClusterFitter; #pragma link C++ class AliL3DataCompressor; - +#pragma link C++ class AliL3ClusterModel; +#ifndef Darwin +#pragma link C++ class AliL3DataCompressorHelper; +#endif #ifdef use_aliroot #pragma link C++ class AliL3OfflineDataCompressor; #endif diff --git a/HLT/comp/AliL3Compress.cxx b/HLT/comp/AliL3Compress.cxx index 370bb524233..d3a289f6e91 100644 --- a/HLT/comp/AliL3Compress.cxx +++ b/HLT/comp/AliL3Compress.cxx @@ -14,6 +14,7 @@ #include "AliL3ModelTrack.h" #include "AliL3Transform.h" #include "AliL3MemHandler.h" +#include "AliL3DataCompressorHelper.h" #include "AliL3DataCompressor.h" #include "AliL3SpacePointData.h" @@ -254,13 +255,14 @@ Bool_t AliL3Compress::CompressFile() OutputBit(output,0); else OutputBit(output,1); - power = 1<<(AliL3DataCompressor::GetNTimeBits()-1); + power = 1<<(AliL3DataCompressorHelper::GetNTimeBits()-1); if(abs(temp)>=power) { + //cout<=power) { pado++; temp=power - 1; } - OutputBits(output,abs(temp),(AliL3DataCompressor::GetNPadBits()-1)); + OutputBits(output,abs(temp),(AliL3DataCompressorHelper::GetNPadBits()-1)); //Write charge information: temp = (Int_t)cluster.fDCharge; - power = 1<<(AliL3DataCompressor::GetNChargeBits()); + power = 1<<(AliL3DataCompressorHelper::GetNChargeBits()); if(abs(temp)>=power) { chargeo++; temp=power - 1; } - OutputBits(output,abs(temp),(AliL3DataCompressor::GetNChargeBits())); + OutputBits(output,abs(temp),(AliL3DataCompressorHelper::GetNChargeBits())); if(fWriteShape) { //Write shape information: - temp = (Int_t)cluster.fDSigmaY2; + temp = (Int_t)cluster.fDSigmaY; if(temp<0) OutputBit(output,0); else OutputBit(output,1); - power = 1<<(AliL3DataCompressor::GetNPadShapeBits()-1); + power = 1<<(AliL3DataCompressorHelper::GetNShapeBits()-1); if(abs(temp) >= power) { padshapeo++; temp = power - 1; } - OutputBits(output,abs(temp),(AliL3DataCompressor::GetNPadShapeBits()-1)); + OutputBits(output,abs(temp),(AliL3DataCompressorHelper::GetNShapeBits()-1)); - temp = (Int_t)cluster.fDSigmaZ2; + temp = (Int_t)cluster.fDSigmaZ; if(temp<0) OutputBit(output,0); else OutputBit(output,1); - power = 1<<(AliL3DataCompressor::GetNTimeShapeBits()-1); + power = 1<<(AliL3DataCompressorHelper::GetNShapeBits()-1); if(abs(temp) >= power) { timeshapeo++; temp=power - 1; } - OutputBits(output,abs(temp),(AliL3DataCompressor::GetNTimeShapeBits()-1)); + OutputBits(output,abs(temp),(AliL3DataCompressorHelper::GetNShapeBits()-1)); } clustercount++; @@ -404,36 +406,36 @@ Bool_t AliL3Compress::ExpandFile() //Read time information: sign=InputBit(input); - temp = InputBits(input,(AliL3DataCompressor::GetNTimeBits()-1)); + temp = InputBits(input,(AliL3DataCompressorHelper::GetNTimeBits()-1)); if(!sign) temp*=-1; clusters[i].fDTime = temp; //Read pad information: sign=InputBit(input); - temp = InputBits(input,(AliL3DataCompressor::GetNPadBits()-1)); + temp = InputBits(input,(AliL3DataCompressorHelper::GetNPadBits()-1)); if(!sign) temp*=-1; clusters[i].fDPad = temp; //Read charge information: - temp=InputBits(input,(AliL3DataCompressor::GetNChargeBits())); + temp=InputBits(input,(AliL3DataCompressorHelper::GetNChargeBits())); clusters[i].fDCharge = temp; if(fWriteShape) { //Read shape information: sign = InputBit(input); - temp = InputBits(input,(AliL3DataCompressor::GetNPadShapeBits()-1)); + temp = InputBits(input,(AliL3DataCompressorHelper::GetNShapeBits()-1)); if(!sign) temp*=-1; - clusters[i].fDSigmaY2 = temp; + clusters[i].fDSigmaY = temp; sign = InputBit(input); - temp = InputBits(input,(AliL3DataCompressor::GetNTimeShapeBits()-1)); + temp = InputBits(input,(AliL3DataCompressorHelper::GetNShapeBits()-1)); if(!sign) temp*=-1; - clusters[i].fDSigmaZ2 = temp; + clusters[i].fDSigmaZ = temp; } clustercount++; } @@ -507,8 +509,8 @@ void AliL3Compress::CompressRemaining(AliL3SpacePointData *clusters[36][6],UInt_ AliL3Transform::Slice2Sector(slice,padrow,sector,row); AliL3Transform::Global2Raw(xyz,sector,row); - Float_t padw = cl[i].fSigmaY2 / AliL3Transform::GetPadPitchWidth(AliL3Transform::GetPatch(padrow)); - Float_t timew = cl[i].fSigmaZ2 / AliL3Transform::GetZWidth(); + Float_t padw = sqrt(cl[i].fSigmaY2) / AliL3Transform::GetPadPitchWidth(AliL3Transform::GetPatch(padrow)); + Float_t timew = sqrt(cl[i].fSigmaZ2) / AliL3Transform::GetZWidth(); //Write pad buff = (Int_t)rint(xyz[1]*10); @@ -589,9 +591,9 @@ void AliL3Compress::ExpandRemaining(TempCluster **clusters,Int_t *ncl,const Int_ //Read widths buff = InputBits(input,8); - clusters[slice][ncl[slice]].sigmaY2 = (Float_t)buff/100.; + clusters[slice][ncl[slice]].sigmaY2 = pow((Float_t)buff/100.,2); buff = InputBits(input,8); - clusters[slice][ncl[slice]].sigmaZ2 = (Float_t)buff/100.; + clusters[slice][ncl[slice]].sigmaZ2 = pow((Float_t)buff/100.,2); //Read charge buff = InputBits(input,14); @@ -644,17 +646,65 @@ void AliL3Compress::PrintCompRatio(ofstream *outfile) } Float_t compratio = (Float_t)(compress_size + remain_size)/(Float_t)digit_size; + Float_t entropy[2]; + GetEntropy(entropy[0],entropy[1]); if(outfile) { ofstream &out = *outfile; - out<GetNTracks(); i++) + { + AliL3ModelTrack *track = (AliL3ModelTrack*)fTracks->GetCheckedTrack(i); + if(!track) continue; + for(Int_t padrow=0; padrowIsPresent(padrow)) continue; + Int_t dpad = abs((Int_t)rint(track->GetClusterModel(padrow)->fDPad)); + Int_t dtime = abs((Int_t)rint(track->GetClusterModel(padrow)->fDTime)); + if(dpad >= nmax || dtime >= nmax) + { + cerr<<"AliL3Compress::GetEntropy : Quantization out of range: "<0) + pad_entropy += (pads[i]/counter)*(log(pads[i]/counter)/log(2.0)); + if(times[i]>0) + time_entropy += (times[i]/counter)*(log(times[i]/counter)/log(2.0)); + } + + pad_entropy*=-1; + time_entropy*=-1; +} diff --git a/HLT/comp/AliL3Compress.h b/HLT/comp/AliL3Compress.h index 84f91b8ae89..31b40e95288 100644 --- a/HLT/comp/AliL3Compress.h +++ b/HLT/comp/AliL3Compress.h @@ -3,6 +3,7 @@ #ifndef AliL3_Compress #define AliL3_Compress +#include "AliL3RootTypes.h" #include "AliL3DataCompressor.h" class AliL3Compress { @@ -28,6 +29,7 @@ class AliL3Compress { void CompressRemaining(AliL3SpacePointData *points[36][6],UInt_t npoints[36][6]); void ExpandRemaining(TempCluster **clusters,Int_t *ncl,Int_t maxclusters); void PrintCompRatio(ofstream *outfile=0); + void GetEntropy(Float_t &pad_entropy,Float_t &time_entropy); AliL3TrackArray *GetTracks() {return fTracks;} diff --git a/HLT/comp/AliL3DataCompressor.cxx b/HLT/comp/AliL3DataCompressor.cxx index 3aa8afae74f..ff7f9d9960f 100644 --- a/HLT/comp/AliL3DataCompressor.cxx +++ b/HLT/comp/AliL3DataCompressor.cxx @@ -37,6 +37,7 @@ #include #endif +#include "AliL3DataCompressorHelper.h" #include "AliL3DataCompressor.h" #if GCCVERSION == 3 @@ -53,22 +54,6 @@ using namespace std; ClassImp(AliL3DataCompressor) -Int_t AliL3DataCompressor::fNumTimeBits = 12; -Int_t AliL3DataCompressor::fNumPadBits = 12; -Int_t AliL3DataCompressor::fNumChargeBits = 14; -Int_t AliL3DataCompressor::fNumPadShapeBits = 14; -Int_t AliL3DataCompressor::fNumTimeShapeBits = 14; -Float_t AliL3DataCompressor::fPadResidualStep1 = 0.03; -Float_t AliL3DataCompressor::fPadResidualStep2 = 0.03; -Float_t AliL3DataCompressor::fPadResidualStep3 = 0.03; -Float_t AliL3DataCompressor::fTimeResidualStep1 = 0.05; -Float_t AliL3DataCompressor::fTimeResidualStep2 = 0.05; -Float_t AliL3DataCompressor::fTimeResidualStep3 = 0.05; -Float_t AliL3DataCompressor::fPadSigma2Step1 = 0.005; -Float_t AliL3DataCompressor::fPadSigma2Step2 = 0.005; -Float_t AliL3DataCompressor::fTimeSigma2Step = 0.005; -Int_t AliL3DataCompressor::fClusterCharge = 100; - AliL3DataCompressor::AliL3DataCompressor() { fBenchmark=0; @@ -124,62 +109,6 @@ void AliL3DataCompressor::DoBench(Char_t *fname) fBenchmark->Analyze(fname); } -void AliL3DataCompressor::SetBitNumbers(Int_t pad,Int_t time,Int_t charge,Int_t shapepad,Int_t shapetime) -{ - fNumPadBits = pad; - fNumTimeBits = time; - fNumChargeBits = charge; - fNumPadShapeBits = shapepad; - fNumTimeShapeBits = shapetime; -} - -void AliL3DataCompressor::SetTransverseResolutions(Float_t res1,Float_t res2,Float_t res3,Float_t width) -{ - fPadResidualStep1 = res1/AliL3Transform::GetPadPitchWidth(0); - fPadResidualStep2 = res2/AliL3Transform::GetPadPitchWidth(2); - fPadResidualStep3 = res3/AliL3Transform::GetPadPitchWidth(2); - fPadSigma2Step1 = width*width/pow(AliL3Transform::GetPadPitchWidth(0),2); - fPadSigma2Step2 = width*width/pow(AliL3Transform::GetPadPitchWidth(2),2); -} - -void AliL3DataCompressor::SetLongitudinalResolutions(Float_t res1,Float_t res2,Float_t res3,Float_t width) -{ - fTimeResidualStep1 = res1/AliL3Transform::GetZWidth(); - fTimeResidualStep2 = res2/AliL3Transform::GetZWidth(); - fTimeResidualStep3 = res3/AliL3Transform::GetZWidth(); - fTimeSigma2Step = width*width/pow(AliL3Transform::GetZWidth(),2); -} - -const Float_t AliL3DataCompressor::GetPadResidualStep(Int_t row) -{ - if(row < AliL3Transform::GetNRowLow()) - return fPadResidualStep1; - else if(row < AliL3Transform::GetNRowLow() + AliL3Transform::GetNRowUp1()) - return fPadResidualStep2; - else if(row < AliL3Transform::GetNRowLow() + AliL3Transform::GetNRowUp1() + AliL3Transform::GetNRowUp2()) - return fPadResidualStep3; - else - { - cerr<<"AliL3DataCompressor::GetXYResidualStep : Wrong row number "<GetNHits()GetPt()<0.1) continue; + intrack->CalculateHelix(); AliL3ModelTrack *outtrack = (AliL3ModelTrack*)comptracks->NextTrack(); @@ -298,6 +228,7 @@ void AliL3DataCompressor::FillData(Int_t min_hits,Bool_t expand) UInt_t *hitids = intrack->GetHitNumbers(); Int_t origslice = (hitids[nhits-1]>>25)&0x7f; outtrack->Init(origslice,-1); + for(Int_t j=nhits-1; j>=0; j--) { UInt_t id=hitids[j]; @@ -322,7 +253,7 @@ void AliL3DataCompressor::FillData(Int_t min_hits,Bool_t expand) } Float_t xyz_cross[3] = {intrack->GetPointX(),intrack->GetPointY(),intrack->GetPointZ()}; - + Int_t sector,row; AliL3Transform::Slice2Sector(slice,padrow,sector,row); AliL3Transform::Global2Raw(xyz_cross,sector,row); @@ -330,10 +261,10 @@ void AliL3DataCompressor::FillData(Int_t min_hits,Bool_t expand) outtrack->SetPadHit(padrow,xyz_cross[1]); outtrack->SetTimeHit(padrow,xyz_cross[2]); - + outtrack->SetCrossingAngleLUT(padrow,intrack->GetCrossingAngle(padrow,slice)); outtrack->CalculateClusterWidths(padrow,kTRUE); - + if(fWriteClusterShape) { Int_t patch = AliL3Transform::GetPatch(padrow); @@ -352,7 +283,6 @@ void AliL3DataCompressor::FillData(Int_t min_hits,Bool_t expand) if(!expand) outtrack->SetNClusters(AliL3Transform::GetNRows(-1)); } - if(expand) ExpandTrackData(comptracks); @@ -427,12 +357,12 @@ void AliL3DataCompressor::ExpandTrackData(AliL3TrackArray *tracks) AliL3Transform::Global2Local(xyz,last_slice,kTRUE); //Check for overflow: - Int_t temp = (Int_t)rint((xyz_cross[1]-xyz[1])/GetPadResidualStep(padrow)); - if( abs(temp) > 1<<(GetNPadBits()-1)) + Int_t temp = (Int_t)rint((xyz_cross[1]-xyz[1])/AliL3DataCompressorHelper::GetXYResidualStep(padrow)); + if( abs(temp) > 1<<(AliL3DataCompressorHelper::GetNPadBits()-1)) continue; - temp = (Int_t)rint((xyz_cross[2]-xyz[2])/GetTimeResidualStep(padrow)); - if( abs(temp) > 1<<(GetNTimeBits()-1)) + temp = (Int_t)rint((xyz_cross[2]-xyz[2])/AliL3DataCompressorHelper::GetZResidualStep(padrow)); + if( abs(temp) > 1<<(AliL3DataCompressorHelper::GetNTimeBits()-1)) continue; Float_t dist = sqrt( pow(xyz_cross[1]-xyz[1],2) + pow(xyz_cross[2]-xyz[2],2) ); @@ -478,6 +408,57 @@ void AliL3DataCompressor::ExpandTrackData(AliL3TrackArray *tracks) } +void AliL3DataCompressor::DetermineMinBits() +{ + //Make a pass through the modelled data (after FillData has been done) to determine + //how many bits is needed to encode the residuals _without_ overflows. + + AliL3Compress *comp = new AliL3Compress(-1,-1,fPath,fWriteClusterShape,fEvent); + comp->ReadFile('m'); + AliL3TrackArray *tracks = comp->GetTracks(); + if(tracks->GetNTracks()==0) + { + delete comp; + return; + } + + Int_t maxtime=0,maxpad=0,maxsigma=0,maxcharge=0; + Int_t dpad,dtime,charge,dsigmaY,dsigmaZ,npadbits,ntimebits,nchargebits,nshapebits=0; + for(Int_t i=0; iGetNTracks(); i++) + { + AliL3ModelTrack *track = (AliL3ModelTrack*)tracks->GetCheckedTrack(i); + if(!track) continue; + for(Int_t padrow=0; padrowIsPresent(padrow)) continue; + dpad = TMath::Abs(TMath::Nint(track->GetClusterModel(padrow)->fDPad)); + dtime = TMath::Abs(TMath::Nint(track->GetClusterModel(padrow)->fDTime)); + charge = TMath::Abs((Int_t)track->GetClusterModel(padrow)->fDCharge); + dsigmaY = TMath::Abs(TMath::Nint(track->GetClusterModel(padrow)->fDSigmaY)); + dsigmaZ = TMath::Abs(TMath::Nint(track->GetClusterModel(padrow)->fDSigmaZ)); + if(dpad > maxpad) + maxpad=dpad; + if(dtime > maxtime) + maxtime=dtime; + if(charge > maxcharge) + maxcharge=charge; + if(dsigmaY > maxsigma) + maxsigma=dsigmaY; + if(dsigmaZ > maxsigma) + maxsigma=dsigmaZ; + } + } + cout<<"maxpad "<CompressRemaining(fClusters,fNcl); delete comp; return; - - cout<<"Writing remaining clusters "<fNClusters) - { - cerr<<"AliL3DataCompressor::WriteRemaining : Mismatching clustercounter "<fNClusters<fPadRow<<" with "<<(int)tempPt->fNClusters<<" clusters"<fPadRow = padrow; - tempPt->fNClusters = npoints[padrow]; - last_row = padrow; - } - if(localcounter >= npoints[padrow]) - { - cerr<<"AliL3DataCompressor::WriteRemaining : Cluster counter out of range: " - <fClusters[localcounter].fPad = (UShort_t)(xyz[1]*100); - tempPt->fClusters[localcounter].fTime = (UShort_t)(xyz[2]*100); - tempPt->fClusters[localcounter].fCharge = points[j].fCharge; - tempPt->fClusters[localcounter].fSigmaY2 = (Byte_t)(padw*100); - tempPt->fClusters[localcounter].fSigmaZ2 = (Byte_t)(timew*100); - localcounter++; - fNunusedClusters++; - } - - //Write the last row: - fwrite(tempPt,size,1,outfile); - if(data) - delete [] data; - fclose(outfile); - } - } - delete [] npoints; } void AliL3DataCompressor::SelectRemainingClusters() @@ -628,9 +509,9 @@ void AliL3DataCompressor::SelectRemainingClusters() Int_t padrow = (Int_t)points[i].fPadRow; //Check the widths (errors) of the cluster, and remove big bastards: - Float_t xyw = points[i].fSigmaY2 / pow(AliL3Transform::GetPadPitchWidth(AliL3Transform::GetPatch(padrow)),2); - Float_t zw = points[i].fSigmaZ2 / pow(AliL3Transform::GetZWidth(),2); - if(xyw >= 2.55 || zw >= 2.55)//Because we use 1 byte to store + Float_t padw = sqrt(points[i].fSigmaY2) / AliL3Transform::GetPadPitchWidth(AliL3Transform::GetPatch(padrow)); + Float_t timew = sqrt(points[i].fSigmaZ2) / AliL3Transform::GetZWidth(); + if(padw >= 2.55 || timew >= 2.55)//Because we use 1 byte to store { points[i].fCharge = 0; continue; @@ -671,9 +552,13 @@ void AliL3DataCompressor::CompressAndExpand() comp->PrintCompRatio(fCompRatioFile); delete comp; - //Write the ratio between used and unused clusters to comp file: ofstream &out = *fCompRatioFile; + out<GetPad(padrow,pad); track->GetTime(padrow,time); track->GetClusterCharge(padrow,charge); - track->GetXYWidth(padrow,sigmaY2); - track->GetZWidth(padrow,sigmaZ2); + track->GetSigmaY2(padrow,sigmaY2); + track->GetSigmaZ2(padrow,sigmaZ2); Int_t slice = track->GetClusterModel(padrow)->fSlice; /* if(pad < -1 || pad > AliL3Transform::GetNPads(padrow) || time < -1 || time > AliL3Transform::GetNTimeBins()) @@ -878,83 +763,12 @@ void AliL3DataCompressor::ReadUncompressedData(TempCluster **clusters,Int_t *ncl void AliL3DataCompressor::ReadRemaining(TempCluster **clusters,Int_t *ncl,const Int_t maxpoints) { - Char_t filename[1024]; cout<<"Reading remaining clusters "<ExpandRemaining(clusters,ncl,maxpoints); delete comp; return; - - AliL3MemHandler mem; - - for(Int_t slice=0; slice<=35; slice++) - { - for(Int_t p=0; p<1; p++) - { - sprintf(filename,"%s/comp/remains_%d_%d_%d.raw",fPath,fEvent,slice,-1); - - mem.SetBinaryInput(filename); - AliL3RemainingRow *tempPt = (AliL3RemainingRow*)mem.Allocate(); - - Int_t nrows=0; - FILE *infile = mem.GetFilePointer(); - while(!feof(infile)) - { - Byte_t *dPt = (Byte_t*)tempPt; - if(fread(tempPt,sizeof(AliL3RemainingRow),1,infile)!=1) break; - - dPt += sizeof(AliL3RemainingRow); - - Int_t size = sizeof(AliL3RemainingCluster)*tempPt->fNClusters; - - fread(dPt,size,1,infile); - dPt += size; - tempPt = (AliL3RemainingRow*)dPt; - nrows++; - } - - mem.CloseBinaryInput(); - UInt_t dummy; - tempPt = (AliL3RemainingRow*)mem.GetDataPointer(dummy); - - for(Int_t i=0; ifClusters; - Int_t padrow = (Int_t)tempPt->fPadRow; - //Int_t sector,row; - //AliL3Transform::Slice2Sector(slice,padrow,sector,row); - //cout<<"Loading slice "<fNClusters<<" clusters "<fNClusters; j++) - { - - //Float_t xyz[3] = {AliL3Transform::Row2X(padrow),points[j].fY,points[j].fZ}; - //AliL3Transform::Local2Raw(xyz,sector,row); - - if(ncl[slice] >= maxpoints) - { - cerr<<"AliL3DataCompressor::ReadRemaining : Too many clusters"<fNClusters*sizeof(AliL3RemainingCluster); - dPt += size; - tempPt = (AliL3RemainingRow*)dPt; - } - - mem.Free(); - } - } } void AliL3DataCompressor::QSort(TempCluster **a, Int_t first, Int_t last) @@ -997,26 +811,6 @@ void AliL3DataCompressor::QSort(TempCluster **a, Int_t first, Int_t last) Int_t AliL3DataCompressor::Compare(TempCluster *a,TempCluster *b) { - /* - if(a->padrow < 0 || a->padrow > AliL3Transform::GetNRows(-1) || - b->padrow < 0 || b->padrow > AliL3Transform::GetNRows(-1)) - { - cerr<<"AliL3Compressor::Compare : Wrong padrows "<padrow<<" "<padrow<pad < 0 || a->pad > AliL3Transform::GetNPads(a->padrow) || - b->pad < 0 || b->pad > AliL3Transform::GetNPads(b->padrow)) - { - cerr<<"AliL3Compressor::Compare : Wrong pads "<pad<<" "<pad<time < 0 || a->time > AliL3Transform::GetNTimeBins() || - b->time < 0 || b->time > AliL3Transform::GetNTimeBins()) - { - cerr<<"AliL3Compressor::Compare : Wrong timebins "<time<<" "<time<padrow < b->padrow) return -1; if(a->padrow > b->padrow) return 1; diff --git a/HLT/comp/AliL3DataCompressor.h b/HLT/comp/AliL3DataCompressor.h index ea011d56e2e..5f51e35ebfe 100644 --- a/HLT/comp/AliL3DataCompressor.h +++ b/HLT/comp/AliL3DataCompressor.h @@ -3,6 +3,8 @@ #ifndef AliL3_DataCompressor #define AliL3_DataCompressor +#include "AliL3RootTypes.h" + class AliL3SpacePointData; class AliL3Benchmark; class AliL3TrackArray; @@ -37,6 +39,7 @@ class AliL3DataCompressor { UInt_t fNcl[36][6]; + /* static Int_t fNumPadBits; static Int_t fNumTimeBits; static Int_t fNumChargeBits; @@ -53,7 +56,8 @@ class AliL3DataCompressor { static Float_t fPadSigma2Step2; static Float_t fTimeSigma2Step; static Int_t fClusterCharge; - + */ + void SelectRemainingClusters(); void ExpandTrackData(AliL3TrackArray *tracks); void ReadUncompressedData(TempCluster **clusters,Int_t *ncl,const Int_t maxpoints); @@ -64,7 +68,7 @@ class AliL3DataCompressor { void CloseOutputFile(); protected: - Char_t fPath[1024]; //! + Char_t fPath[1024]; //! Int_t fEvent; Int_t fNusedClusters; Int_t fNunusedClusters; @@ -82,17 +86,20 @@ class AliL3DataCompressor { virtual void LoadData(Int_t event,Bool_t sp=kTRUE); virtual void FillData(Int_t minhits,Bool_t expand); virtual void WriteRemaining(Bool_t select); + void DetermineMinBits(); void CompressAndExpand(); void RestoreData(Bool_t remaining_only=kFALSE); void DoBench(Char_t *fname="benchmark"); + /* void SetBitNumbers(Int_t pad,Int_t time,Int_t charge,Int_t shapepad,Int_t shapetime); void SetTransverseResolutions(Float_t res1,Float_t res2,Float_t res3,Float_t width=0.005); void SetLongitudinalResolutions(Float_t res1,Float_t res2,Float_t res3,Float_t width=0.005); - + */ Int_t GetNusedClusters() {return fNusedClusters;} Int_t GetNunusedClusters() {return fNunusedClusters;} + /* static const Int_t GetNPadBits() {return fNumPadBits;} static const Int_t GetNTimeBits() {return fNumTimeBits;} static const Int_t GetNChargeBits() {return fNumChargeBits;} @@ -103,7 +110,7 @@ class AliL3DataCompressor { static const Int_t GetClusterCharge() {return fClusterCharge;} static const Float_t GetPadResidualStep(Int_t row); static const Float_t GetTimeResidualStep(Int_t row); - + */ ClassDef(AliL3DataCompressor,1) diff --git a/HLT/comp/AliL3DataCompressorHelper.cxx b/HLT/comp/AliL3DataCompressorHelper.cxx new file mode 100644 index 00000000000..9042b85333f --- /dev/null +++ b/HLT/comp/AliL3DataCompressorHelper.cxx @@ -0,0 +1,95 @@ +// @(#) $Id$ + +// Author: Anders Vestbo +//*-- Copyright © ALICE HLT Group + +#include "AliL3StandardIncludes.h" + +#include "AliL3RootTypes.h" +#include "AliL3Transform.h" + +#include "AliL3DataCompressorHelper.h" + +#if GCCVERSION == 3 +using namespace std; +#endif + +//_____________________________________________________________ +// +// AliL3DataCompression +// +// Interface class; binary <-> AliROOT handling of TPC data compression classes. +// + + +ClassImp(AliL3DataCompressorHelper) + + +Int_t AliL3DataCompressorHelper::fNumTimeBits = 12; +Int_t AliL3DataCompressorHelper::fNumPadBits = 12; +Int_t AliL3DataCompressorHelper::fNumChargeBits = 14; +Int_t AliL3DataCompressorHelper::fNumShapeBits = 14; +Float_t AliL3DataCompressorHelper::fXYResidualStep1 = 0.03; +Float_t AliL3DataCompressorHelper::fXYResidualStep2 = 0.03; +Float_t AliL3DataCompressorHelper::fXYResidualStep3 = 0.03; +Float_t AliL3DataCompressorHelper::fZResidualStep1 = 0.05; +Float_t AliL3DataCompressorHelper::fZResidualStep2 = 0.05; +Float_t AliL3DataCompressorHelper::fZResidualStep3 = 0.05; +Float_t AliL3DataCompressorHelper::fXYWidthStep = 0.005; +Float_t AliL3DataCompressorHelper::fZWidthStep = 0.005; +Int_t AliL3DataCompressorHelper::fClusterCharge = 100; + + +void AliL3DataCompressorHelper::SetBitNumbers(Int_t pad,Int_t time,Int_t charge,Int_t shape) +{ + fNumPadBits = pad; + fNumTimeBits = time; + fNumChargeBits = charge; + fNumShapeBits = shape; +} + +void AliL3DataCompressorHelper::SetTransverseResolutions(Float_t res1,Float_t res2,Float_t res3,Float_t width) +{ + fXYResidualStep1 = res1; + fXYResidualStep2 = res2; + fXYResidualStep3 = res3; + fXYWidthStep = width; +} + +void AliL3DataCompressorHelper::SetLongitudinalResolutions(Float_t res1,Float_t res2,Float_t res3,Float_t width) +{ + fZResidualStep1 = res1; + fZResidualStep2 = res2; + fZResidualStep3 = res3; + fZWidthStep = width; +} + +const Float_t AliL3DataCompressorHelper::GetXYResidualStep(Int_t row) +{ + if(row < AliL3Transform::GetNRowLow()) + return fXYResidualStep1; + else if(row < AliL3Transform::GetNRowLow() + AliL3Transform::GetNRowUp1()) + return fXYResidualStep2; + else if(row < AliL3Transform::GetNRowLow() + AliL3Transform::GetNRowUp1() + AliL3Transform::GetNRowUp2()) + return fXYResidualStep3; + else + { + cerr<<"AliL3DataCompressorHelper::GetXYResidualStep : Wrong row number "<fPresent |= 0x2; //set second bit to true, because a fit attempt has been made + Int_t patch = AliL3Transform::GetPatch(row); if(!charge || npads == 1) { cl->fPresent &= ~0x1; //set first bit to false @@ -153,18 +155,20 @@ void AliL3ModelTrack::SetCluster(Int_t row,Float_t fpad,Float_t ftime,Float_t ch else { cl->fPresent|=0x1;//set first bit to true - cl->fDPad = QuantizePad(row,fpad); - cl->fDTime = QuantizeTime(row,ftime); + cl->fDPad = (fpad - GetPadHit(row))/(AliL3DataCompressorHelper::GetXYResidualStep(row)/AliL3Transform::GetPadPitchWidth(patch)); + cl->fDTime = (ftime - GetTimeHit(row))/(AliL3DataCompressorHelper::GetZResidualStep(row)/AliL3Transform::GetZWidth()); cl->fDCharge = charge; if(sigmaY2==0 && sigmaZ2==0) { - cl->fDSigmaY2=0;//if width is zero, shape is not supposed to be written - cl->fDSigmaZ2=0; + cl->fDSigmaY=0;//if width is zero, shape is not supposed to be written + cl->fDSigmaZ=0; } else { - cl->fDSigmaY2 = QuantizeSigmaY2(row,sigmaY2); - cl->fDSigmaZ2 = QuantizeSigmaZ2(row,sigmaZ2); + //cl->fDSigmaY2 = (sigmaY2 - GetParSigmaY2(row))/(pow(AliL3DataCompressorHelper::GetXYWidthStep(),2)/pow(AliL3Transform::GetPadPitchWidth(patch),2)); + //cl->fDSigmaZ2 = (sigmaZ2 - GetParSigmaZ2(row))/(pow(AliL3DataCompressorHelper::GetZWidthStep(),2)/pow(AliL3Transform::GetZWidth(),2)); + cl->fDSigmaY = (sqrt(sigmaY2) - sqrt(GetParSigmaY2(row)))/(AliL3DataCompressorHelper::GetXYWidthStep()/AliL3Transform::GetPadPitchWidth(patch)); + cl->fDSigmaZ = (sqrt(sigmaZ2) - sqrt(GetParSigmaZ2(row)))/(AliL3DataCompressorHelper::GetZWidthStep()/AliL3Transform::GetZWidth()); } cl->fNPads = npads; } @@ -329,58 +333,6 @@ void AliL3ModelTrack::FillTrack() } } -Float_t AliL3ModelTrack::QuantizePad(Int_t row,Float_t pad) -{ - Float_t diff = pad - GetPadHit(row); - Float_t step = AliL3DataCompressor::GetPadResidualStep(row); - return diff/step; -} - -Float_t AliL3ModelTrack::RetrievePad(Int_t row,Float_t dpad) -{ - Float_t step = AliL3DataCompressor::GetPadResidualStep(row); - return dpad*step + GetPadHit(row); -} - -Float_t AliL3ModelTrack::QuantizeTime(Int_t row,Float_t time) -{ - Float_t diff = time - GetTimeHit(row); - Float_t step = AliL3DataCompressor::GetTimeResidualStep(row); - return diff/step; -} - -Float_t AliL3ModelTrack::RetrieveTime(Int_t row,Float_t dtime) -{ - Float_t step = AliL3DataCompressor::GetTimeResidualStep(row); - return dtime*step + GetTimeHit(row); -} - -Float_t AliL3ModelTrack::QuantizeSigmaY2(Int_t row,Float_t sigmaY2) -{ - Float_t diff = sigmaY2 - GetParSigmaY2(row); - Float_t step = AliL3DataCompressor::GetPadSigma2Step(AliL3Transform::GetPatch(row)); - return diff/step; -} - -Float_t AliL3ModelTrack::RetrieveSigmaY2(Int_t row,Float_t dsigmaY2) -{ - Float_t step = AliL3DataCompressor::GetPadSigma2Step(AliL3Transform::GetPatch(row)); - return dsigmaY2*step + GetParSigmaY2(row); -} - -Float_t AliL3ModelTrack::QuantizeSigmaZ2(Int_t row,Float_t sigmaZ2) -{ - Float_t diff = sigmaZ2 - GetParSigmaZ2(row); - Float_t step = AliL3DataCompressor::GetTimeSigma2Step(); - return diff/step; -} - -Float_t AliL3ModelTrack::RetrieveSigmaZ2(Int_t row,Float_t dsigmaZ2) -{ - Float_t step = AliL3DataCompressor::GetTimeSigma2Step(); - return dsigmaZ2*step + GetParSigmaZ2(row); -} - void AliL3ModelTrack::SetPadHit(Int_t row,Float_t pad) { Int_t index = row-AliL3Transform::GetFirstRow(fPatch); @@ -447,64 +399,73 @@ Int_t AliL3ModelTrack::GetNPads(Int_t row) Bool_t AliL3ModelTrack::GetPad(Int_t row,Float_t &pad) { + //(fpad - GetPadHit(row))/(AliL3DataCompressorHelper::GetXYResidualStep(row)/AliL3Transform::GetPadPitchWidth(patch)); AliL3ClusterModel *cl = GetClusterModel(row); - pad = RetrievePad(row,cl->fDPad); + Int_t patch = AliL3Transform::GetPatch(row); + pad = cl->fDPad*(AliL3DataCompressorHelper::GetXYResidualStep(row)/AliL3Transform::GetPadPitchWidth(patch)) + GetPadHit(row); return IsPresent(row); } Bool_t AliL3ModelTrack::GetTime(Int_t row,Float_t &time) { AliL3ClusterModel *cl = GetClusterModel(row); - time = RetrieveTime(row,cl->fDTime); + time = cl->fDTime*(AliL3DataCompressorHelper::GetZResidualStep(row)/AliL3Transform::GetZWidth()) + GetTimeHit(row); return IsPresent(row); } Bool_t AliL3ModelTrack::GetClusterCharge(Int_t row,Int_t &charge) { AliL3ClusterModel *cl = GetClusterModel(row); - charge = (Int_t)cl->fDCharge;// + AliL3DataCompressor::GetClusterCharge(); + charge = (Int_t)cl->fDCharge;// + AliL3DataCompressorHelperHelper::GetClusterCharge(); return IsPresent(row); } -Bool_t AliL3ModelTrack::GetXYWidth(Int_t row,Float_t &width) +Bool_t AliL3ModelTrack::GetSigmaY2(Int_t row,Float_t &sigma2) { + //cl->fDSigmaY = (sqrt(sigmaY2) - sqrt(GetParSigmaY2(row)))/(AliL3DataCompressorHelper::GetXYWidthStep()/AliL3Transform::GetPadPitchWidth(patch)); AliL3ClusterModel *cl = GetClusterModel(row); - width = RetrieveSigmaY2(row,cl->fDSigmaY2); + Int_t patch = AliL3Transform::GetPatch(row); + Float_t sigma = cl->fDSigmaY*(AliL3DataCompressorHelper::GetXYWidthStep()/AliL3Transform::GetPadPitchWidth(patch)) + sqrt(GetParSigmaY2(row)); + sigma2 = sigma*sigma; return IsPresent(row); } -Bool_t AliL3ModelTrack::GetZWidth(Int_t row,Float_t &width) +Bool_t AliL3ModelTrack::GetSigmaZ2(Int_t row,Float_t &sigma2) { + //cl->fDSigmaZ = (sqrt(sigmaZ2) - sqrt(GetParSigmaZ2(row)))/(AliL3DataCompressorHelper::GetZWidthStep()/AliL3Transform::GetZWidth()); AliL3ClusterModel *cl = GetClusterModel(row); - RetrieveSigmaZ2(row,cl->fDSigmaZ2); + Float_t sigma = cl->fDSigmaZ*(AliL3DataCompressorHelper::GetZWidthStep()/AliL3Transform::GetZWidth()) + sqrt(GetParSigmaZ2(row)); + sigma2 = sigma*sigma; return IsPresent(row); } Bool_t AliL3ModelTrack::GetPadResidual(Int_t row,Float_t &res) { AliL3ClusterModel *cl = GetClusterModel(row); - res = cl->fDPad; + Int_t patch = AliL3Transform::GetPatch(row); + res = cl->fDPad*(AliL3DataCompressorHelper::GetXYResidualStep(row)/AliL3Transform::GetPadPitchWidth(patch)); return IsPresent(row); } Bool_t AliL3ModelTrack::GetTimeResidual(Int_t row,Float_t &res) { AliL3ClusterModel *cl = GetClusterModel(row); - res = cl->fDTime; + res = cl->fDTime*(AliL3DataCompressorHelper::GetZResidualStep(row)/AliL3Transform::GetZWidth()); return IsPresent(row); } Bool_t AliL3ModelTrack::GetXYWidthResidual(Int_t row,Float_t &res) { AliL3ClusterModel *cl = GetClusterModel(row); - res = cl->fDSigmaY2; + Int_t patch = AliL3Transform::GetPatch(row); + res = cl->fDSigmaY*(AliL3DataCompressorHelper::GetXYWidthStep()/AliL3Transform::GetPadPitchWidth(patch)); return IsPresent(row); } Bool_t AliL3ModelTrack::GetZWidthResidual(Int_t row,Float_t &res) { AliL3ClusterModel *cl = GetClusterModel(row); - res = cl->fDSigmaZ2; + res = cl->fDSigmaZ*(AliL3DataCompressorHelper::GetZWidthStep()/AliL3Transform::GetZWidth()); return IsPresent(row); } @@ -617,7 +578,7 @@ void AliL3ModelTrack::Print(Bool_t everything) cout<<"Clusters:"<fSlice; else if(cl->fSlice != origslice) cout<<"Change in slice "<fSlice<<" "<fSlice<<" Dpad "<fDPad<<" Dtime "<fDTime<<" Dcharge "<fDCharge; - cout<<" sigmaY2 "< #include #include -#include +#include #include "AliL3Transform.h" #include "AliL3ModelTrack.h" @@ -89,6 +89,12 @@ void AliL3OfflineDataCompressor::LoadData(Int_t event,Bool_t sp) else sprintf(filename,"%s/offline/AliTPCclustersMI.root",fPath); + bool compressed=0; + if(compressed) + { + cout<<"AliL3OfflineDataCompressor::LoadData : Taking compressed offline files!!"<Get("75x40_100x60_150x60"); @@ -102,8 +108,8 @@ void AliL3OfflineDataCompressor::LoadData(Int_t event,Bool_t sp) #endif if(fMarian==kTRUE) { - AliTPCtrackerMI *mitracker = (AliTPCtrackerMI*)fTracker; #ifdef asvversion + AliTPCtrackerMI *mitracker = (AliTPCtrackerMI*)fTracker; mitracker->LoadInnerSectors(); mitracker->LoadOuterSectors(); #endif @@ -115,6 +121,10 @@ void AliL3OfflineDataCompressor::LoadData(Int_t event,Bool_t sp) sprintf(filename,"%s/offline/AliTPCtracks.root",fPath); else sprintf(filename,"%s/offline/AliTPCtracksMI.root",fPath); + + if(compressed) + sprintf(filename,"%s/comp/offline/AliTPCtracks.root",fPath); + TFile *tf=TFile::Open(filename); char tname[100]; sprintf(tname,"TreeT_TPC_%d",event); @@ -137,6 +147,7 @@ void AliL3OfflineDataCompressor::LoadData(Int_t event,Bool_t sp) cout<<"Loaded "<GetClusterMI(idx); } first[0] = xk; - first[1] = fcl->GetY(); - first[2] = fcl->GetZ(); + first[1] = par[0]; + first[2] = par[1]; AliL3Transform::Local2Global(first,slice); @@ -261,7 +272,7 @@ void AliL3OfflineDataCompressor::LoadData(Int_t event,Bool_t sp) cout<<"Track hit "<CalculateReferencePoint(angle,AliL3Transform::Row2X(padrow))) @@ -270,6 +281,7 @@ void AliL3OfflineDataCompressor::LoadData(Int_t event,Bool_t sp) <GetPointX(),outtrack->GetPointY(),outtrack->GetPointZ()}; AliL3Transform::Global2Raw(xyz_cross,sec,row); /* @@ -310,7 +322,7 @@ void AliL3OfflineDataCompressor::LoadData(Int_t event,Bool_t sp) comp->WriteFile(comptracks); delete comp; delete comptracks; - + } void AliL3OfflineDataCompressor::WriteRemaining(Bool_t select) @@ -340,7 +352,9 @@ void AliL3OfflineDataCompressor::WriteRemaining(Bool_t select) cout<<"Writing remaining clusters "<GetZ() < 0 && slice < 18) continue; if(cluster->GetZ() > 0 && slice > 17) continue; if(cluster->IsUsed()) - continue; + continue; if(fWriteIdsToFile) idfile << cluster->GetLabel(0)<<' '; @@ -463,7 +477,10 @@ void AliL3OfflineDataCompressor::SelectRemainingClusters() Int_t gap=(Int_t)(0.125*nrows), shift=(Int_t)(0.5*gap); Int_t sector,row,sec; + +#ifdef asvversion AliTPCtracker *tracker = (AliTPCtracker*)fTracker; +#endif for(Int_t slice=0; slice<36; slice++) { for(Int_t padrow=0; padrow < nrows; padrow++) diff --git a/HLT/comp/AliL3OfflineDataCompressor.h b/HLT/comp/AliL3OfflineDataCompressor.h index 97e48f4ec2f..50bfbc7010e 100644 --- a/HLT/comp/AliL3OfflineDataCompressor.h +++ b/HLT/comp/AliL3OfflineDataCompressor.h @@ -3,6 +3,7 @@ #ifndef AliL3_OfflineDataCompressor #define AliL3_OfflineDataCompressor +#include "AliL3RootTypes.h" #include "AliL3DataCompressor.h" class AliTracker; diff --git a/HLT/comp/Makefile b/HLT/comp/Makefile index ff26a592254..94158af0d13 100644 --- a/HLT/comp/Makefile +++ b/HLT/comp/Makefile @@ -14,8 +14,12 @@ endif include $(ALIHLT_TOPDIR)/Makefile.conf -SRCS = AliL3Modeller.cxx AliL3ModelTrack.cxx AliL3ClusterFitter.cxx \ - AliL3Compress.cxx AliL3DataCompressor.cxx +SRCS = AliL3Modeller.cxx AliL3ClusterFitter.cxx \ + AliL3Compress.cxx AliL3DataCompressor.cxx + +ifneq ($(ARCH),Darwin) +SRCS += AliL3DataCompressorHelper.cxx AliL3ModelTrack.cxx +endif ADD_C_OBJS = $(OBJDIR)/bitio.o $(OBJDIR)/errhand.o $(OBJDIR)/AliL3FitUtilities.o diff --git a/HLT/doc/changelog.comp b/HLT/doc/changelog.comp index 553b610cb3e..ddcf4e2d281 100644 --- a/HLT/doc/changelog.comp +++ b/HLT/doc/changelog.comp @@ -1,3 +1,58 @@ +2004-01-28 Anders Strand Vestbo + + * /alice/cvs/hltcvs/level3code/comp/AliL3ClusterFitter.cxx, /alice/cvs/hltcvs/level3code/comp/AliL3Compress.cxx, /alice/cvs/hltcvs/level3code/comp/AliL3DataCompressor.cxx, /alice/cvs/hltcvs/level3code/comp/AliL3Models.h, /alice/cvs/hltcvs/level3code/comp/AliL3ModelTrack.cxx, /alice/cvs/hltcvs/level3code/comp/AliL3ModelTrack.h: + Changing the names of data members AliL3ClusterModel::fDSigmaY2 and fDSigmaZ2 + to fDSigmaY and fDSigmaZ, in order to reflect the fact that their are really + the sigmas and not sigma squared. + + * /alice/cvs/hltcvs/level3code/comp/AliL3Compress.cxx: Bugfix. + +2004-01-25 Anders Strand Vestbo + + * /alice/cvs/hltcvs/level3code/comp/AliL3DataCompressor.cxx: Bugfix. + +2004-01-24 Anders Strand Vestbo + + * /alice/cvs/hltcvs/level3code/comp/AliL3OfflineDataCompressor.cxx: + Bugfix + + * /alice/cvs/hltcvs/level3code/comp/AliL3DataCompressor.cxx, /alice/cvs/hltcvs/level3code/comp/AliL3DataCompressor.h: + Added function to make a pass over the data and calculate how many bits + is required to encode the residuals (assuming no further compression). + + * /alice/cvs/hltcvs/level3code/comp/AliL3Compress.cxx, /alice/cvs/hltcvs/level3code/comp/AliL3Compress.h: + Added function to calculate entropy of the quantized residuals. + +2004-01-23 Anders Strand Vestbo + + * /alice/cvs/hltcvs/level3code/comp/AliL3CompLinkDef.h, /alice/cvs/hltcvs/level3code/comp/AliL3Compress.cxx, /alice/cvs/hltcvs/level3code/comp/AliL3DataCompressor.cxx, /alice/cvs/hltcvs/level3code/comp/AliL3DataCompressor.h, /alice/cvs/hltcvs/level3code/comp/AliL3DataCompressorHelper.cxx, /alice/cvs/hltcvs/level3code/comp/AliL3DataCompressorHelper.h, /alice/cvs/hltcvs/level3code/comp/AliL3ModelTrack.cxx, /alice/cvs/hltcvs/level3code/comp/AliL3ModelTrack.h: + - Changed back to the old method for quantizing the residuals, since + there appeared some strange behaviour when running the code in multi-event + mode. It still remains a mystery, so this problem has been postponed and will + be solved sometime in the future. + - Removed some obsolute code as a result of moving the handling of remaining + clusters from AliL3DataCompressor to AliL3Compress. + +2004-01-22 Constantin Loizides + + * /alice/cvs/hltcvs/level3code/comp/AliL3Compress.cxx, /alice/cvs/hltcvs/level3code/comp/AliL3Compress.h, /alice/cvs/hltcvs/level3code/comp/AliL3DataCompressor.cxx, /alice/cvs/hltcvs/level3code/comp/AliL3DataCompressor.h, /alice/cvs/hltcvs/level3code/comp/AliL3DataCompressorHelper.cxx, /alice/cvs/hltcvs/level3code/comp/AliL3DataCompressorHelper.h, /alice/cvs/hltcvs/level3code/comp/AliL3FitUtilities.h, /alice/cvs/hltcvs/level3code/comp/AliL3ModelTrack.cxx, /alice/cvs/hltcvs/level3code/comp/AliL3OfflineDataCompressor.cxx, /alice/cvs/hltcvs/level3code/comp/AliL3OfflineDataCompressor.h: + Introduced new class AliL3DataCompressorHandler, which is static + and capsulates all static calls from the former Compressor + class in order to remove some very nasty dependencies. + The other classes had to be adapter to call the + right static function. + + * /alice/cvs/hltcvs/level3code/comp/AliL3CompLinkDef.h, /alice/cvs/hltcvs/level3code/comp/Makefile: + Changes to compile for MACOSX at core Makefiles. Check for + $(ARCH) and -D$(ARCH). In order to solve cyclic dependencies + for libs (which is _very_ bad, but the Linux linker is friendly) + a few changes have to be done (moving files around) which + we dont do at the moment. SO: Linux users should see _NO_ + difference!!! + + * /alice/cvs/hltcvs/level3code/comp/AliL3ClusterFitter.cxx: + Paranoic change :-) + 2004-01-09 Anders Strand Vestbo * /alice/cvs/hltcvs/level3code/comp/AliL3ModelTrack.cxx, /alice/cvs/hltcvs/level3code/comp/AliL3ModelTrack.h: diff --git a/HLT/doc/changelog.doc b/HLT/doc/changelog.doc index 21b54b8952a..ecf461f760b 100644 --- a/HLT/doc/changelog.doc +++ b/HLT/doc/changelog.doc @@ -1,3 +1,7 @@ +2004-01-22 Constantin Loizides + + * /alice/cvs/hltcvs/level3code/doc/taginfo: Added new tag. + 2003-11-18 Constantin Loizides * /alice/cvs/hltcvs/level3code/doc/README: Added newio define. diff --git a/HLT/doc/changelog.exa b/HLT/doc/changelog.exa index 92b318b9a1d..b0ccd39ea0a 100644 --- a/HLT/doc/changelog.exa +++ b/HLT/doc/changelog.exa @@ -1,3 +1,8 @@ +2004-02-02 Constantin Loizides + + * /alice/cvs/hltcvs/level3code/exa/deconvclusters.C, /alice/cvs/hltcvs/level3code/exa/rootlogon.C, /alice/cvs/hltcvs/level3code/exa/runhough.C, /alice/cvs/hltcvs/level3code/exa/runtracker.C, /alice/cvs/hltcvs/level3code/exa/SetFitParameters.C, /alice/cvs/hltcvs/level3code/exa/SetHoughParameters.C: + Updated macros to latest parameter settings, added compiled version of runhough, deconvcluster and runtracker. Added static index support, loading if possible and some benchmark info. + 2003-11-18 Constantin Loizides * /alice/cvs/hltcvs/level3code/exa/SetFitParameters.C, /alice/cvs/hltcvs/level3code/exa/SetHoughParameters.C, /alice/cvs/hltcvs/level3code/exa/runhough.C: diff --git a/HLT/doc/changelog.hough b/HLT/doc/changelog.hough index 10309c84a40..eff84e70f57 100644 --- a/HLT/doc/changelog.hough +++ b/HLT/doc/changelog.hough @@ -1,3 +1,21 @@ +2004-02-02 Constantin Loizides + + * /alice/cvs/hltcvs/level3code/hough/AliL3HoughBaseTransformer.cxx, /alice/cvs/hltcvs/level3code/hough/AliL3HoughBaseTransformer.h, /alice/cvs/hltcvs/level3code/hough/AliL3Hough.cxx, /alice/cvs/hltcvs/level3code/hough/AliL3HoughTransformer.cxx, /alice/cvs/hltcvs/level3code/hough/AliL3HoughTransformerLUT.cxx, /alice/cvs/hltcvs/level3code/hough/AliL3HoughTransformerLUT.h, /alice/cvs/hltcvs/level3code/hough/AliL3HoughTransformerNew.cxx, /alice/cvs/hltcvs/level3code/hough/AliL3HoughTransformerVhdl.h: + Reworked the LUT version of the Hough Transform. This should be the default transformer now, it is 3 times faster than the normal transformer. It produces almost the same peaks, in a central event, a few differ. The reason seems to be due to rounding. The efficiency of the deconvoluter is verified to be the same, too. + + * /alice/cvs/hltcvs/level3code/hough/AliL3HistogramAdaptive.cxx, /alice/cvs/hltcvs/level3code/hough/AliL3HistogramAdaptive.h, /alice/cvs/hltcvs/level3code/hough/AliL3Histogram.cxx, /alice/cvs/hltcvs/level3code/hough/AliL3Histogram.h: + Added ostream& < + + * /alice/cvs/hltcvs/level3code/hough/AliL3HoughLinkDef.h, /alice/cvs/hltcvs/level3code/hough/Makefile: + Changes to compile for MACOSX at core Makefiles. Check for + $(ARCH) and -D$(ARCH). In order to solve cyclic dependencies + for libs (which is _very_ bad, but the Linux linker is friendly) + a few changes have to be done (moving files around) which + we dont do at the moment. SO: Linux users should see _NO_ + difference!!! + 2003-11-18 Anders Strand Vestbo * /alice/cvs/hltcvs/level3code/hough/AliL3Hough.cxx, /alice/cvs/hltcvs/level3code/hough/AliL3HoughMaxFinder.cxx, /alice/cvs/hltcvs/level3code/hough/AliL3HoughMaxFinder.h: diff --git a/HLT/doc/changelog.kalman b/HLT/doc/changelog.kalman index 00f72cca29f..443ec451c42 100644 --- a/HLT/doc/changelog.kalman +++ b/HLT/doc/changelog.kalman @@ -1,3 +1,8 @@ +2004-02-02 Thomas Vik + + * /alice/cvs/hltcvs/level3code/kalman/AliL3Kalman.cxx: + Added track label to rootfile with the kalman cariables. + 2003-10-13 Thomas Vik * /alice/cvs/hltcvs/level3code/kalman/AliL3KalmanTrack.h, /alice/cvs/hltcvs/level3code/kalman/AliL3KalmanTrack.cxx: diff --git a/HLT/doc/changelog.misc b/HLT/doc/changelog.misc index 286c347b473..53cecb79958 100644 --- a/HLT/doc/changelog.misc +++ b/HLT/doc/changelog.misc @@ -1,3 +1,16 @@ +2004-01-22 Constantin Loizides + + * /alice/cvs/hltcvs/level3code/misc/AliL3MiscLinkDef.h, /alice/cvs/hltcvs/level3code/misc/Makefile: + Changes to compile for MACOSX at core Makefiles. Check for + $(ARCH) and -D$(ARCH). In order to solve cyclic dependencies + for libs (which is _very_ bad, but the Linux linker is friendly) + a few changes have to be done (moving files around) which + we dont do at the moment. SO: Linux users should see _NO_ + difference!!! + + * /alice/cvs/hltcvs/level3code/misc/AliL3DDLRawReaderFile.h, /alice/cvs/hltcvs/level3code/misc/AliL3DDLRawReader.h, /alice/cvs/hltcvs/level3code/misc/AliL3DDLTPCRawStream.h: + Update to ALIROOT head version. + 2003-11-25 Constantin Loizides * /alice/cvs/hltcvs/level3code/misc/AliL3DDLDataFileHandler.cxx: diff --git a/HLT/doc/changelog.src b/HLT/doc/changelog.src index da1a2564a4f..cbd2b52d462 100644 --- a/HLT/doc/changelog.src +++ b/HLT/doc/changelog.src @@ -1,3 +1,58 @@ +2004-02-02 Constantin Loizides + + * /alice/cvs/hltcvs/level3code/src/AliLevel3.cxx: + Added static index support for aliroot files. + + * /alice/cvs/hltcvs/level3code/src/AliL3FileHandler.cxx, /alice/cvs/hltcvs/level3code/src/AliL3FileHandler.h: + Added static index support. This means, that if you are working with several filehandlers on one rootfile, only once the index will be created. Be careful, only one such static index exists per session, so if you want to use two input digit root files, it would not why (but why would you need two?). Also you can load/store the index to a file (see the exa example) which decreases debugging time. + +2004-01-27 Anders Strand Vestbo + + * /alice/cvs/hltcvs/level3code/src/AliL3ConfMapFit.cxx, /alice/cvs/hltcvs/level3code/src/AliL3ConfMapTrack.cxx, /alice/cvs/hltcvs/level3code/src/AliL3Fitter.cxx, /alice/cvs/hltcvs/level3code/src/AliL3Fitter.h, /alice/cvs/hltcvs/level3code/src/AliL3TrackArray.cxx, /alice/cvs/hltcvs/level3code/src/AliL3Track.cxx, /alice/cvs/hltcvs/level3code/src/AliLevel3.cxx, /alice/cvs/hltcvs/level3code/src/AliLevel3.h: + Changes related to how the track parameters are calculated and stored. + There should be no changes for normal use, i.e. the function calls are + still the same. The changes are the following: + + - Most importantly, the first point on a track (accessible via + AliL3Track::GetFirstPoint()) is now calculated as the point lying on the helix + fit. Earlier, this point was just the coordinates of the innermost assigned + cluster of the track. This is in principle ok if you just want the quick + "global" coordinates of the track; momentum etc. However, for precisce local + calculations such as residuals, this point should be the point of closest + approach lying on the helix fit. If not, the calculated track parameters (such + as center of curvature) will be slightly shifted. The tracks are updated to the + first point if the AliLevel3::fIsTracksAtFirstPoint is set to true (which is + default). If this is not desired, and the track should be defined at the vertex + (not DCAO!), you can still do AliLevel3::SetTracks2Vertex(). + + - A new static boolean has been introduced in AliLevel3::fDoVertexFit, which + tells the track fitter to include the vertex in the fit or not. + + - A (minor) bugfix was also done in AliL3TrackArray. + +2004-01-23 Constantin Loizides + + * /alice/cvs/hltcvs/level3code/src/Makefile: Fixed dep for linux. + +2004-01-22 Constantin Loizides + + * /alice/cvs/hltcvs/level3code/src/AliL3SrcLinkDef.h, /alice/cvs/hltcvs/level3code/src/Makefile: + Changes to compile for MACOSX at core Makefiles. Check for + $(ARCH) and -D$(ARCH). In order to solve cyclic dependencies + for libs (which is _very_ bad, but the Linux linker is friendly) + a few changes have to be done (moving files around) which + we dont do at the moment. SO: Linux users should see _NO_ + difference!!! + + * /alice/cvs/hltcvs/level3code/src/AliL3GlobalMerger.h, /alice/cvs/hltcvs/level3code/src/AliL3InterMerger.h, /alice/cvs/hltcvs/level3code/src/AliL3TrackMerger.h: + Changed to compile with gcc-3.4 + + * /alice/cvs/hltcvs/level3code/src/AliL3FileHandler.cxx: + Changed to avoid warning of gcc-3.4. + + * /alice/cvs/hltcvs/level3code/src/AliL3Transform.h: + Changed order to avoid warning of gcc-3.4. + 2003-11-26 Anders Strand Vestbo * /alice/cvs/hltcvs/level3code/src/AliL3ConfMapTrack.cxx, /alice/cvs/hltcvs/level3code/src/AliL3Fitter.cxx, /alice/cvs/hltcvs/level3code/src/AliLevel3.cxx, /alice/cvs/hltcvs/level3code/src/AliLevel3.h: diff --git a/HLT/doc/changelog.top b/HLT/doc/changelog.top index a46cbcf79d8..cdef080eee2 100644 --- a/HLT/doc/changelog.top +++ b/HLT/doc/changelog.top @@ -1,3 +1,13 @@ +2004-01-22 Constantin Loizides + + * /alice/cvs/hltcvs/level3code/Makefile.conf, /alice/cvs/hltcvs/level3code/Makefile.rules: + Changes to compile for MACOSX at core Makefiles. Check for + $(ARCH) and -D$(ARCH). In order to solve cyclic dependencies + for libs (which is _very_ bad, but the Linux linker is friendly) + a few changes have to be done (moving files around) which + we dont do at the moment. SO: Linux users should see _NO_ + difference!!! + 2003-11-18 Constantin Loizides * /alice/cvs/hltcvs/level3code/Makefile.conf, /alice/cvs/hltcvs/level3code/Makefile.rules: diff --git a/HLT/exa/SetFitParameters.C b/HLT/exa/SetFitParameters.C index 3335a3f3705..20004be5f54 100644 --- a/HLT/exa/SetFitParameters.C +++ b/HLT/exa/SetFitParameters.C @@ -2,12 +2,11 @@ void SetFitParameters(AliL3ClusterFitter *fitter) { - - fitter->SetInnerWidthFactor(1,1.5); - fitter->SetOuterWidthFactor(1,1.5); + fitter->SetInnerWidthFactor(1,1); + fitter->SetOuterWidthFactor(1,1); fitter->SetNmaxOverlaps(5); - - //fitter->SetChiSqMax(5,kFALSE); //isolated clusters - fitter->SetChiSqMax(5,kTRUE); //overlapping clusters + fitter->SetChiSqMax(5,0); + fitter->SetChiSqMax(5,1); + fitter->SetChiSqMax(5,2); } diff --git a/HLT/exa/SetHoughParameters.C b/HLT/exa/SetHoughParameters.C index 141744962e7..9d68bbe63ea 100644 --- a/HLT/exa/SetHoughParameters.C +++ b/HLT/exa/SetHoughParameters.C @@ -1,8 +1,7 @@ //$Id$ -void SetHoughParameters(AliL3Hough *hough,Char_t *path) +void SetHoughParameters(AliL3Hough *hough,Char_t *path,Int_t tversion=1) { - bool binary = kTRUE; //binary files input int n_eta_segments=100; double histptmin = 0.5; //mininum pt to find (controls the histogram range) @@ -10,20 +9,14 @@ void SetHoughParameters(AliL3Hough *hough,Char_t *path) int threshold=6000; //peak threshold int nxbins = 140; int nybins = 150; + //Int_t threshold=5000; //peak threshold + //Int_t nxbins = 190; + //Int_t nybins = 200; int patch=-1; //-1 -> Hough transform on slices (means adding histograms) hough->SetThreshold(4); //noise threshold on single digits hough->SetTransformerParams(nxbins,nybins,histptmin,patch); - -/* - hough->SetTransformerParams(0.068,histptmin,histptmax,20,0); - hough->SetTransformerParams(0.043,histptmin,histptmax,23,1); - hough->SetTransformerParams(0.03,histptmin,histptmax,25,2); - hough->SetTransformerParams(0.02,histptmin,histptmax,25,3); - hough->SetTransformerParams(0.016,histptmin,histptmax,30,4); - hough->SetTransformerParams(0.012,histptmin,histptmax,30,5); -*/ hough->SetPeakThreshold(threshold,patch); - hough->Init(path,binary,n_eta_segments); + hough->Init(path,binary,n_eta_segments,kFALSE,tversion); } diff --git a/HLT/exa/deconvclusters.C b/HLT/exa/deconvclusters.C index f0630a9cb73..c2e4caabe8e 100644 --- a/HLT/exa/deconvclusters.C +++ b/HLT/exa/deconvclusters.C @@ -6,7 +6,7 @@ The path "path" should contain the link to the digitsfile, and the directories called fitter (for the results) and hough (for the track files). For NEWIO, make sure that the file - TPC.Digits.root is in the path! + TPC.Digits.root is in the path (symlink)! Also provide the neccessary parameters in SetFitParameters.C. @@ -14,99 +14,151 @@ supported right now. */ -void deconvclusters(char *path,int minslice=0,int maxslice=35,int nevent=1) +#ifndef __CINT__ +#include "AliL3Logger.h" +#include "AliL3FileHandler.h" +#include "AliL3DigitData.h" +#include "AliL3Track.h" +#include "AliL3Transform.h" +#include "AliL3Hough.h" +#include "AliL3Fitter.h" +#include "AliL3ClusterFitter.h" +#include "AliL3Vertex.h" +#include "AliL3TrackArray.h" +#include +#include +#include +#include +#include +#include +#include +#endif + +void deconvclusters(Char_t *path,Int_t minslice=0,Int_t maxslice=35,Int_t nevent=1) { AliL3Transform::Init(path,kTRUE); - char filename[1024]; - AliL3FileHandler *file = new AliL3FileHandler(); + Char_t filename[1024]; + AliL3FileHandler *file = new AliL3FileHandler(kTRUE); //static index UInt_t ndigits=0; sprintf(filename,"%s/digitfile.root",path); - file->SetAliInput(filename); - int index=0; - AliL3ClusterFitter *fitter = new AliL3ClusterFitter(path); - char macroname[1024]; +#ifdef __CINT__ + Char_t macroname[1024]; gROOT->LoadMacro("SetFitParameters.C"); SetFitParameters(fitter); - - int patch=-1; - int rowrange[2] = {0,AliL3Transform::GetNRows()-1}; - - for(int ev=0; evSetInnerWidthFactor(1,1); + fitter->SetOuterWidthFactor(1,1); + fitter->SetNmaxOverlaps(5); + + fitter->SetChiSqMax(5,0); + fitter->SetChiSqMax(5,1); + fitter->SetChiSqMax(5,2); +#endif + + TStopwatch tloader;tloader.Stop(); + TStopwatch tfinder;tfinder.Stop(); + TStopwatch trefitter;trefitter.Stop(); + + Int_t patch=-1; + Int_t rowrange[2] = {0,AliL3Transform::GetNRows()-1}; + for(Int_t ev=0; evLoadSeeds(rowrange,kFALSE,ev);//Takes input from global hough tracks + AliL3FileHandler::LoadStaticIndex(0,ev); + fitter->LoadSeeds(rowrange,kFALSE,ev); //Takes input from global hough tracks - for(int slice=minslice; slice<=maxslice; slice++) + for(Int_t slice=minslice; slice<=maxslice; slice++) { + tloader.Start(0); file->Init(slice,-1); cout<<"Processing event "<AliAltroDigits2Memory(ndigits,ev); - fitter->Init(slice,patch); fitter->SetInputData(digits); + tloader.Stop(); + tfinder.Start(0); fitter->FindClusters(); - fitter->WriteClusters(); - + tfinder.Stop(); + + tloader.Start(0); file->Free(); - + tloader.Stop(); } //If you want a refit of the clusters;------------------------- + tloader.Start(0); AliL3Vertex vertex; - AliL3TrackArray *tracks = fitter->GetSeeds(); //The seeds are the input tracks from circle HT + AliL3TrackArray *tracks = fitter->GetSeeds(); //The seeds are the + //input tracks from circle HT AliL3Fitter *ft = new AliL3Fitter(&vertex,1); sprintf(filename,"%s/fitter/",path); ft->LoadClusters(filename,0,kTRUE); + tloader.Stop(); + + trefitter.Start(0); for(Int_t i=0; iGetNTracks(); i++) { - track = tracks->GetCheckedTrack(i); + AliL3Track *track = tracks->GetCheckedTrack(i); if(!track) continue; if(track->GetNHits() < 40) continue; ft->SortTrackClusters(track); ft->FitHelix(track); - ft->UpdateTrack(track); + track->UpdateToFirstPoint(); } - delete ft; + trefitter.Stop(); //------------------------------------------------------------- - + tloader.Start(0); + delete ft; fitter->WriteTracks(5); //Write the final tracks file->FreeDigitsTree(); + tloader.Stop(); } + cout << " --- Timing values --- " << endl; + cout << "Data Loading: "; tloader.Print("m"); + cout << "Cluster Deconvolution "; tfinder.Print("m"); + cout << "Track ReFitter "; trefitter.Print("m"); + delete fitter; } - -void deconvlocally(char *path,int minslice=0,int maxslice=17) +void deconvlocally(Char_t *path,Int_t minslice=0,Int_t maxslice=17) { AliL3Transform::Init(path,kTRUE); - char filename[1024]; - AliL3FileHandler *file = new AliL3FileHandler(); + Char_t filename[1024]; + AliL3FileHandler *file = new AliL3FileHandler(kTRUE); UInt_t ndigits=0; sprintf(filename,"%s/digitfile.root",path); - file->SetAliInput(filename); - int index=0; - AliL3ClusterFitter *fitter = new AliL3ClusterFitter(path); - char macroname[1024]; +#ifdef __CINT__ + Char_t macroname[1024]; sprintf(macroname,"%s/SetFitParameters.C",path); gROOT->LoadMacro(macroname); SetFitParameters(fitter); +#else /*compiled version */ + fitter->SetInnerWidthFactor(1,1); + fitter->SetOuterWidthFactor(1,1); + fitter->SetNmaxOverlaps(5); + + fitter->SetChiSqMax(5,0); + fitter->SetChiSqMax(5,1); + fitter->SetChiSqMax(5,2); +#endif - int patch=-1; + Int_t patch=-1; - for(int slice=minslice; slice<=maxslice; slice++) + for(Int_t slice=minslice; slice<=maxslice; slice++) { file->Init(slice,patch); cout<<"Processing slice "<Load("MakePileup_C.so"); gSystem->Load("Read_C.so"); + gSystem->Load("runhough_C.so"); + gSystem->Load("deconvclusters_C.so"); + gSystem->Load("runtracker_C.so"); gErrorIgnoreLevel=saveErrIgLevel; if(strcmp("true",getenv("ALIHLT_DOMC"))==0) gSystem->SetIncludePath(" -Ddo_mc"); diff --git a/HLT/exa/runhough.C b/HLT/exa/runhough.C index 773abee299f..786e4a95d2a 100644 --- a/HLT/exa/runhough.C +++ b/HLT/exa/runhough.C @@ -10,7 +10,8 @@ to the rootfile containing AliROOT digits tree and a symbolic link "alirunfile.root" pointing to a file containing the ALIROOT geometry (TPC param). - For NEWIO, make sure that the file TPC.Digits.root is in the path! + For NEWIO, make sure that the file TPC.Digits.root is in the + path (or make a symlink to it)! Also provide the neccessary parameters in SetHoughParameters.C. @@ -18,7 +19,25 @@ */ -void runhough(Char_t *path,Char_t *outpath,int s1=0,int s2=35,int nevent=1) +#ifndef __CINT__ +#include "AliL3Logger.h" +#include "AliL3FileHandler.h" +#include "AliL3DigitData.h" +#include "AliL3Transform.h" +#include "AliL3Hough.h" +#include "AliL3TrackArray.h" +#include "AliL3Track.h" +#include "AliL3HoughTrack.h" +#include +#include +#include +#include +#include +#include +#include +#endif + +void runhough(Char_t *path,Char_t *outpath,Int_t s1=0,Int_t s2=35,Int_t nevent=1) { Bool_t isinit=AliL3Transform::Init(path,kTRUE); @@ -26,29 +45,70 @@ void runhough(Char_t *path,Char_t *outpath,int s1=0,int s2=35,int nevent=1) cerr << "Could not create transform settings, please check log for error messages!" << endl; return; } - - hough = new AliL3Hough(); - char macroname[1024]; - sprintf(macroname,"SetHoughParameters.C",path); + Int_t tversion=1; //0 = normal transformer + //1 = LUT transformer + + AliL3Hough *hough = new AliL3Hough(); +#ifdef __CINT__ + Char_t macroname[1024]; + sprintf(macroname,"SetHoughParameters.C"); gROOT->LoadMacro(macroname); - SetHoughParameters(hough,path); + SetHoughParameters(hough,path,tversion); +#else /*compiled version*/ + Bool_t binary = kFALSE; //binary files input + Int_t n_eta_segments=100; + Double_t histptmin = 0.5; //mininum pt to find (controls the histogram range) + Int_t threshold=6000; //peak threshold + //Int_t threshold=5000; //peak threshold + Int_t nxbins = 140; + Int_t nybins = 150; + //Int_t nxbins = 190; + //Int_t nybins = 200; + Int_t patch=-1; //-1 -> Hough transform on slices (means adding histograms) + hough->SetThreshold(4); //noise threshold on single digits + hough->SetTransformerParams(nxbins,nybins,histptmin,patch); + hough->SetPeakThreshold(threshold,patch); + hough->Init(path,binary,n_eta_segments,kFALSE,tversion); +#endif - for(int ev=0; evReadData(slice,ev); - hough->Transform(); + tloader.Start(0);hough->ReadData(slice,ev);tloader.Stop(); + ttransform.Start(0);hough->Transform();ttransform.Stop(); + tfinder.Start(0); hough->AddAllHistograms(); hough->FindTrackCandidates(); hough->AddTracks(); + tfinder.Stop(); +#if 0 /*print track list */ + AliL3TrackArray *tracks = (AliL3TrackArray*)hough->GetTracks(0); + tracks->QSort(); + for(int i=0; iGetNTracks(); i++) + { + AliL3HoughTrack *track = (AliL3HoughTrack*)tracks->GetCheckedTrack(i); + if(!track) continue; + cout<<"pt "<GetPt()<<" psi "<GetPsi()<<" eta "<GetEta()<<" etaindex "<GetEtaIndex()<<" weight "<GetWeight()<WriteTracks(outpath); + AliL3FileHandler::SaveStaticIndex(0,ev); } + + cout << " --- Timing values --- " << endl; + cout << "Data Loading: "; tloader.Print("m"); + cout << "Hough Transforming "; ttransform.Print("m"); + cout << "Track Finding "; tfinder.Print("m"); delete hough; - } diff --git a/HLT/exa/runtracker.C b/HLT/exa/runtracker.C index d9728e78adb..a10f6bd42a6 100644 --- a/HLT/exa/runtracker.C +++ b/HLT/exa/runtracker.C @@ -8,23 +8,38 @@ make a symbolic link "digitfile.root", which points to the rootfile containing AliROOT digits tree and a symbolic link "alirunfile.root" pointing to a file containing the ALIROOT geometry (TPC param). For NEWIO, make sure that the - file TPC.Digits.root is in the path! + file TPC.Digits.root is in the path (symlink)! RUN with ALIROOT (not ROOT) if using root files. */ -void runtracker(Int_t minslice=0,Int_t maxslice=35,Char_t* path="./",Int_t nevent=1,Char_t *opath="./") +#ifndef __CINT__ +#include "AliL3Logger.h" +#include "AliL3FileHandler.h" +#include "AliL3DigitData.h" +#include "AliL3Transform.h" +#include "AliLevel3.h" +#include +#include +#include +#include +#include +#include +#endif + +void runtracker(Int_t minslice=0,Int_t maxslice=35,Char_t* path="./",Int_t nevent=1,Char_t *opath="./tracker/") { //Set your configuration here: AliLevel3::EFileType filetype=AliLevel3::kRoot; //Input is RLE binary files or rootfile. Bool_t pileup=kFALSE; //Assume input is pileup event = non RLE binary files. Int_t npatches = 1; //Options; 1, 2 and 6. +#ifdef __CINT__ Char_t trackparams[] = "SetTrackingParameters_4000bf04.C"; //Set this to correspond //with mult. and BField +#endif //for aliroot the path should point to a file //containing the tpc geometry called alirunfile.root - //Bool_t isinit=AliL3Transform::Init(path,!binary); Bool_t isinit=AliL3Transform::Init(path,(filetype!=AliLevel3::kBinary)); if(!isinit){ cerr << "Could not create transform settings, please check log for error messages!" << endl; @@ -33,6 +48,7 @@ void runtracker(Int_t minslice=0,Int_t maxslice=35,Char_t* path="./",Int_t neven for(Int_t ev=0; evInit(path,filetype,npatches); - if(pileup) - a->DoPileup(); - +#ifdef __CINT__ gROOT->LoadMacro(trackparams); SetTrackingParameters(a); +#else /* compiled for 4000 and 0.4 */ + Int_t phi_segments,eta_segments,trackletlength,tracklength; + Int_t rowscopetracklet,rowscopetrack; + Double_t min_pt_fit,maxangle,goodDist,hitChi2Cut,xyerror,zerror; + Double_t goodHitChi2,trackChi2Cut,maxphi,maxeta; -#if 0 /* little comments */ - phi_segments = 50; //devide the space into phi_segments and eta_segments - eta_segments = 100; //to access the search of points to that area! - trackletlength = 3; //number of hits a tracklet has to have - tracklength = 5; //number of hits a track has to have - rowscopetracklet = 2;//search range of rows for a tracklet - rowscopetrack = 2; //search range of rows for a track + phi_segments = 50; //devide the space into phi_segments and eta_segments + eta_segments = 100; //to access the search of points to that area! + trackletlength = 3; //number of hits a tracklet has to have + tracklength = 10; //number of hits a track has to have + rowscopetracklet = 2; //search range of rows for a tracklet + rowscopetrack = 10; //search range of rows for a track min_pt_fit = 0; - maxangle = 1.31; //maximum angle for the three point look ahead + maxangle = 0.1745; //AliL3Transform::Deg2Rad(10); + //maximum angle for the three point look ahead goodDist = 5; //threshold distance between two hits when building tracklets - maxphi=100; //maximum phi difference for neighboring hits - maxeta=100; //maximum eta difference for neighboring hits - hitChi2Cut = 100; //maximum chi2 of added hit to track - goodHitChi2 = 20; //stop looking for next hit to add if chi2 is less than goodHitChi2 - trackChi2Cut = 50; //maximum chi2 for track after final fit + maxphi=0.1; //maximum phi difference for neighboring hits + maxeta=0.1; //maximum eta difference for neighboring hits + hitChi2Cut = 20; //maximum chi2 of added hit to track + goodHitChi2 = 5; //stop looking for next hit to add if chi2 is less than goodHitChi2 + trackChi2Cut = 10; //maximum chi2 for track after final fit + xyerror = -1; + zerror = -1; + + a->SetClusterFinderParam(xyerror,zerror,kTRUE); + a->SetTrackerParam(phi_segments,eta_segments,trackletlength,tracklength, + rowscopetracklet,rowscopetrack, + min_pt_fit,maxangle,goodDist,hitChi2Cut, + goodHitChi2,trackChi2Cut,50,maxphi,maxeta,kTRUE); #endif - + if(pileup) + a->DoPileup(); //a->DoRoi(); /*do region of interest*/ //a->DoMc(); /*do monte carlo identification*/ a->WriteFiles(opath); /*enable output*/ - a->ProcessEvent(minslice,maxslice); - //a->DoBench("benchmark_0"); + a->DoBench("benchmark_0"); delete a; - } + } // event loop } diff --git a/HLT/hough/AliL3Histogram.cxx b/HLT/hough/AliL3Histogram.cxx index 55403cf0185..779119c7c11 100644 --- a/HLT/hough/AliL3Histogram.cxx +++ b/HLT/hough/AliL3Histogram.cxx @@ -3,7 +3,10 @@ // Author: Anders Vestbo //*-- Copyright © ALICE HLT Group +#include + #include "AliL3StandardIncludes.h" + #include "AliL3Logging.h" #include "AliL3Histogram.h" @@ -99,7 +102,7 @@ void AliL3Histogram::Fill(Double_t x,Double_t y,Int_t weight) AddBinContent(bin,weight); } -Int_t AliL3Histogram::FindBin(Double_t x,Double_t y) +Int_t AliL3Histogram::FindBin(Double_t x,Double_t y) const { Int_t xbin = FindXbin(x); Int_t ybin = FindYbin(y); @@ -109,7 +112,7 @@ Int_t AliL3Histogram::FindBin(Double_t x,Double_t y) return GetBin(xbin,ybin); } -Int_t AliL3Histogram::FindXbin(Double_t x) +Int_t AliL3Histogram::FindXbin(Double_t x) const { if(x < fXmin || x > fXmax) return 0; @@ -117,7 +120,7 @@ Int_t AliL3Histogram::FindXbin(Double_t x) return 1 + (Int_t)(fNxbins*(x-fXmin)/(fXmax-fXmin)); } -Int_t AliL3Histogram::FindYbin(Double_t y) +Int_t AliL3Histogram::FindYbin(Double_t y) const { if(y < fYmin || y > fYmax) return 0; @@ -125,7 +128,7 @@ Int_t AliL3Histogram::FindYbin(Double_t y) return 1 + (Int_t)(fNybins*(y-fYmin)/(fYmax-fYmin)); } -Int_t AliL3Histogram::GetBin(Int_t xbin,Int_t ybin) +Int_t AliL3Histogram::GetBin(Int_t xbin,Int_t ybin) const { if(xbin < fFirstXbin || xbin > fLastXbin) return 0; @@ -135,7 +138,7 @@ Int_t AliL3Histogram::GetBin(Int_t xbin,Int_t ybin) return xbin + ybin*(fNxbins+2); } -Int_t AliL3Histogram::GetBinContent(Int_t bin) +Int_t AliL3Histogram::GetBinContent(Int_t bin) const { if(bin >= fNcells) { @@ -225,7 +228,7 @@ void AliL3Histogram::Add(AliL3Histogram *h1,Double_t weight) fEntries += h1->GetNEntries(); } -Double_t AliL3Histogram::GetBinCenterX(Int_t xbin) +Double_t AliL3Histogram::GetBinCenterX(Int_t xbin) const { if(xbin < fFirstXbin || xbin > fLastXbin) { @@ -233,11 +236,11 @@ Double_t AliL3Histogram::GetBinCenterX(Int_t xbin) <<"Bin-value out of range "< fLastYbin) { @@ -245,7 +248,7 @@ Double_t AliL3Histogram::GetBinCenterY(Int_t ybin) <<"Bin-value out of range "< #endif +class ostream; + class AliL3Histogram { private: @@ -45,11 +47,11 @@ class AliL3Histogram { void Reset(); virtual void Fill(Double_t x,Double_t y,Int_t weight=1); - virtual Int_t FindBin(Double_t x,Double_t y); - virtual Int_t FindXbin(Double_t x); - virtual Int_t FindYbin(Double_t y); - Int_t GetBin(Int_t xbin,Int_t ybin); - Int_t GetBinContent(Int_t bin); + virtual Int_t FindBin(Double_t x,Double_t y) const; + virtual Int_t FindXbin(Double_t x) const; + virtual Int_t FindYbin(Double_t y) const; + Int_t GetBin(Int_t xbin,Int_t ybin) const; + Int_t GetBinContent(Int_t bin) const; void SetBinContent(Int_t xbin,Int_t ybin,Int_t value); void SetBinContent(Int_t bin,Int_t value); void AddBinContent(Int_t xbin,Int_t ybin,Int_t weight); @@ -60,27 +62,29 @@ class AliL3Histogram { virtual void Draw(Char_t *option="hist"); virtual void Print() {}; + friend ostream& operator<< (ostream &o, const AliL3Histogram &h); + #ifdef use_root TH2F *GetRootHisto(); #else void *GetRootHisto(); #endif - Double_t GetXmin() {return fXmin;} - Double_t GetXmax() {return fXmax;} - Double_t GetYmin() {return fYmin;} - Double_t GetYmax() {return fYmax;} - virtual Double_t GetBinCenterX(Int_t xbin); - virtual Double_t GetBinCenterY(Int_t ybin); - Double_t GetBinWidthX() {return fBinwidthX;} - Double_t GetBinWidthY() {return fBinwidthY;} - Int_t GetFirstXbin() {return fFirstXbin;} - Int_t GetLastXbin() {return fLastXbin;} - Int_t GetFirstYbin() {return fFirstYbin;} - Int_t GetLastYbin() {return fLastYbin;} - Int_t GetNbinsX() {return fNxbins;} - Int_t GetNbinsY() {return fNybins;} - Int_t GetNEntries() {return fEntries;} + Double_t GetXmin() const {return fXmin;} + Double_t GetXmax() const {return fXmax;} + Double_t GetYmin() const {return fYmin;} + Double_t GetYmax() const {return fYmax;} + virtual Double_t GetBinCenterX(Int_t xbin) const; + virtual Double_t GetBinCenterY(Int_t ybin) const; + Double_t GetBinWidthX() const {return fBinwidthX;} + Double_t GetBinWidthY() const {return fBinwidthY;} + Int_t GetFirstXbin() const {return fFirstXbin;} + Int_t GetLastXbin() const {return fLastXbin;} + Int_t GetFirstYbin() const {return fFirstYbin;} + Int_t GetLastYbin() const {return fLastYbin;} + Int_t GetNbinsX() const {return fNxbins;} + Int_t GetNbinsY() const {return fNybins;} + Int_t GetNEntries() const {return fEntries;} ClassDef(AliL3Histogram,1) //2D histogram class diff --git a/HLT/hough/AliL3HistogramAdaptive.cxx b/HLT/hough/AliL3HistogramAdaptive.cxx index 373dcfe5a5f..8bb7c85e485 100644 --- a/HLT/hough/AliL3HistogramAdaptive.cxx +++ b/HLT/hough/AliL3HistogramAdaptive.cxx @@ -105,7 +105,7 @@ void AliL3HistogramAdaptive::Fill(Double_t x,Double_t y,Int_t weight) } -Int_t AliL3HistogramAdaptive::FindBin(Double_t x,Double_t y) +Int_t AliL3HistogramAdaptive::FindBin(Double_t x,Double_t y) const { Int_t xbin = FindXbin(x); @@ -116,7 +116,7 @@ Int_t AliL3HistogramAdaptive::FindBin(Double_t x,Double_t y) return GetBin(xbin,ybin); } -Int_t AliL3HistogramAdaptive::FindXbin(Double_t x) +Int_t AliL3HistogramAdaptive::FindXbin(Double_t x) const { if(x < fXmin || x > fXmax || fabs(x) < fKappaBins[(fNxbins/2-1)]) @@ -140,7 +140,7 @@ Int_t AliL3HistogramAdaptive::FindXbin(Double_t x) } -Int_t AliL3HistogramAdaptive::FindYbin(Double_t y) +Int_t AliL3HistogramAdaptive::FindYbin(Double_t y) const { if(y < fYmin || y > fYmax) return 0; @@ -148,7 +148,7 @@ Int_t AliL3HistogramAdaptive::FindYbin(Double_t y) return 1 + (Int_t)(fNybins*(y-fYmin)/(fYmax-fYmin)); } -Double_t AliL3HistogramAdaptive::GetBinCenterX(Int_t xbin) +Double_t AliL3HistogramAdaptive::GetBinCenterX(Int_t xbin) const { if(xbin < fFirstXbin || xbin > fLastXbin) { @@ -177,7 +177,7 @@ Double_t AliL3HistogramAdaptive::GetBinCenterX(Int_t xbin) } -Double_t AliL3HistogramAdaptive::GetBinCenterY(Int_t ybin) +Double_t AliL3HistogramAdaptive::GetBinCenterY(Int_t ybin) const { if(ybin < fFirstYbin || ybin > fLastYbin) { diff --git a/HLT/hough/AliL3HistogramAdaptive.h b/HLT/hough/AliL3HistogramAdaptive.h index 22926cbc729..56eb46de819 100644 --- a/HLT/hough/AliL3HistogramAdaptive.h +++ b/HLT/hough/AliL3HistogramAdaptive.h @@ -23,14 +23,14 @@ class AliL3HistogramAdaptive : public AliL3Histogram { ~AliL3HistogramAdaptive(); void Fill(Double_t x,Double_t y,Int_t weight=1); - Int_t FindBin(Double_t x,Double_t y); - Int_t FindXbin(Double_t x); - Int_t FindYbin(Double_t x); + Int_t FindBin(Double_t x,Double_t y) const; + Int_t FindXbin(Double_t x) const; + Int_t FindYbin(Double_t x) const; void Draw(Char_t *option = "hist"); void Print(); - Double_t GetBinCenterX(Int_t xbin); - Double_t GetBinCenterY(Int_t ybin); + Double_t GetBinCenterX(Int_t xbin) const; + Double_t GetBinCenterY(Int_t ybin) const; ClassDef(AliL3HistogramAdaptive,1) //2D histogram class diff --git a/HLT/hough/AliL3Hough.cxx b/HLT/hough/AliL3Hough.cxx index ad04c42352f..f8c301c813c 100644 --- a/HLT/hough/AliL3Hough.cxx +++ b/HLT/hough/AliL3Hough.cxx @@ -86,12 +86,14 @@ AliL3Hough::AliL3Hough() SetThreshold(); SetNSaveIterations(); SetPeakThreshold(); +#ifdef use_aliroot + //just be sure that index is empty for new event + AliL3FileHandler::CleanStaticIndex(); +#endif } AliL3Hough::AliL3Hough(Char_t *path,Bool_t binary,Int_t n_eta_segments,Bool_t bit8,Int_t tv,Char_t *infile) { - //Default ctor. - fBinary = binary; strcpy(fPath,path); fNEtaSegments = n_eta_segments; @@ -104,6 +106,11 @@ AliL3Hough::AliL3Hough(Char_t *path,Bool_t binary,Int_t n_eta_segments,Bool_t bi fInputFile = infile; else fInputFile = 0; + +#ifdef use_aliroot + //just be sure that index is empty for new event + AliL3FileHandler::CleanStaticIndex(); +#endif } AliL3Hough::~AliL3Hough() @@ -113,16 +120,22 @@ AliL3Hough::~AliL3Hough() CleanUp(); if(fMerger) delete fMerger; + //cout << "Cleaned class merger " << endl; if(fInterMerger) delete fInterMerger; + //cout << "Cleaned class inter " << endl; if(fPeakFinder) delete fPeakFinder; + //cout << "Cleaned class peak " << endl; if(fGlobalMerger) delete fGlobalMerger; + //cout << "Cleaned class global " << endl; if(fBenchmark) delete fBenchmark; + //cout << "Cleaned class bench " << endl; if(fGlobalTracks) delete fGlobalTracks; + //cout << "Cleaned class globaltracks " << endl; } void AliL3Hough::CleanUp() @@ -132,16 +145,23 @@ void AliL3Hough::CleanUp() for(Int_t i=0; iCreateHistograms(fNBinX[i],fLowPt[i],fNBinY[i],-fPhi[i],fPhi[i]); //fHoughTransformer[i]->CreateHistograms(fLowPt[i],fUpperPt[i],fPtRes[i],fNBinY[i],fPhi[i]); + fHoughTransformer[i]->SetLowerThreshold(fThreshold[i]); fHoughTransformer[i]->SetUpperThreshold(100); @@ -208,7 +229,7 @@ void AliL3Hough::Init(Bool_t doit, Bool_t addhists) { if(!fInputFile) { /* In case of reading digits file */ - fMemHandler[i] = new AliL3FileHandler(); + fMemHandler[i] = new AliL3FileHandler(kTRUE); //use static index if(!fBinary) { Char_t filename[1024]; sprintf(filename,"%s/digitfile.root",fPath); @@ -356,8 +377,13 @@ void AliL3Hough::ReadData(Int_t slice,Int_t eventnr) { //Read data from files, binary or root. +#ifdef use_aliroot + if(fEvent!=eventnr) //just be sure that index is empty for new event + AliL3FileHandler::CleanStaticIndex(); +#endif fEvent=eventnr; fCurrentSlice = slice; + for(Int_t i=0; iFree(); diff --git a/HLT/hough/AliL3HoughBaseTransformer.cxx b/HLT/hough/AliL3HoughBaseTransformer.cxx index 88b6f3197db..74d2efe879a 100644 --- a/HLT/hough/AliL3HoughBaseTransformer.cxx +++ b/HLT/hough/AliL3HoughBaseTransformer.cxx @@ -6,10 +6,10 @@ #include "AliL3StandardIncludes.h" #include "AliL3Logging.h" -#include "AliL3HoughBaseTransformer.h" #include "AliL3MemHandler.h" #include "AliL3DigitData.h" #include "AliL3Histogram.h" +#include "AliL3HoughBaseTransformer.h" //_____________________________________________________________ diff --git a/HLT/hough/AliL3HoughBaseTransformer.h b/HLT/hough/AliL3HoughBaseTransformer.h index 6d4555b02f2..411ac7d53e0 100644 --- a/HLT/hough/AliL3HoughBaseTransformer.h +++ b/HLT/hough/AliL3HoughBaseTransformer.h @@ -39,14 +39,25 @@ class AliL3HoughBaseTransformer { void SetInputData(UInt_t ndigits,AliL3DigitRowData *ptr) {fDigitRowData = ptr;} - virtual void CreateHistograms(Float_t ptmin,Float_t ptmax,Float_t pres,Int_t nybin,Float_t psi) {return;} + //this is for adaptave histograms + virtual void CreateHistograms(Float_t ptmin,Float_t ptmax,Float_t pres,Int_t nybin,Float_t psi) + {STDCERR<<"Adaptive histograms are not supported for this Transformer!"< //_____________________________________________________________ // AliL3HoughTransformer // // Hough transformation class // + +*/ ClassImp(AliL3HoughTransformer) @@ -42,16 +46,6 @@ AliL3HoughTransformer::AliL3HoughTransformer(Int_t slice,Int_t patch,Int_t n_eta fDoMC = kFALSE; fEtaOverlap = DoEtaOverlap; fDoMC=kFALSE; - /* - if(DoMC==kTRUE) - { - if(patch==0) - -fDoMC = kTRUE; - else - fDoMC = kFALSE; - } - */ #ifdef do_mc fTrackID = 0; #endif @@ -94,7 +88,7 @@ void AliL3HoughTransformer::CreateHistograms(Float_t ptmin,Float_t ptmax,Float_t if(ptmin > ptmax) { - cerr<<"AliL3HoughTransformer.:CreateHistograms: Error in ptrange "< //_____________________________________________________________ // AliL3HoughTransformerLUT // // Hough transformation class using Look-UP-Tables // +// +*/ ClassImp(AliL3HoughTransformerLUT) AliL3HoughTransformerLUT::AliL3HoughTransformerLUT() : AliL3HoughBaseTransformer() { + fParamSpace=0; fMinRow=0; fMaxRow=0; @@ -55,12 +59,12 @@ AliL3HoughTransformerLUT::AliL3HoughTransformerLUT() : AliL3HoughBaseTransformer fLastPad=0; fLastIndex=0; fAccCharge=0; - - fDoMC = kFALSE; + fX=fY=0.; } AliL3HoughTransformerLUT::AliL3HoughTransformerLUT(Int_t slice,Int_t patch,Int_t n_eta_segments) : AliL3HoughBaseTransformer(slice,patch,n_eta_segments) { + fParamSpace=0; fMinRow=0; fMaxRow=0; @@ -87,7 +91,7 @@ AliL3HoughTransformerLUT::AliL3HoughTransformerLUT(Int_t slice,Int_t patch,Int_t fLastPad=0; fLastIndex=0; fAccCharge=0; - fDoMC=kFALSE; + fX=fY=0.; Init(slice,patch,n_eta_segments); } @@ -160,7 +164,7 @@ void AliL3HoughTransformerLUT::Init(Int_t slice,Int_t patch,Int_t n_eta_segments } AliL3Transform::Slice2Sector(slice,fMinRow,fSector,fSectorRow); - fZSign = slice < 18 ? 1:-1; + fZSign = slice < 18 ? 1:-1; //see AliL3Transformer fSlice = slice; fZLengthPlusOff=AliL3Transform::GetZLength()+AliL3Transform::GetZOffset(); fTimeWidth=AliL3Transform::GetZWidth(); @@ -185,6 +189,7 @@ void AliL3HoughTransformerLUT::Init(Int_t slice,Int_t patch,Int_t n_eta_segments } //lookup tables for rz2s <=> etas + //will only be used ifdef FULLLUT fLUTEta=new Float_t[fNEtas]; fLUTEtaReal=new Float_t[fNEtas]; for(Int_t rr=0;rr ptmax) + { + cerr<<"AliL3HoughTransformerLUT::CreateHistograms: Error in ptrange "<GetFirstYbin(); b<=hist->GetLastYbin(); b++) + { + Float_t phi0 = hist->GetBinCenterY(b); + fLUTphi0[i]=phi0; + fLUT2sinphi0[i]=2.*sin(phi0); + fLUT2cosphi0[i]=2.*cos(phi0); + fLUTKappa[i]=0.; + i++; + //cout << i << ": " << fLUTphi0[i] << " " << fLUT2sinphi0[i] << " " << fLUT2cosphi0[i] << endl; + } +} + void AliL3HoughTransformerLUT::CreateHistograms(Int_t nxbin,Float_t pt_min,Int_t nybin,Float_t phimin,Float_t phimax) { //Create the histograms (parameter space). @@ -207,8 +258,8 @@ void AliL3HoughTransformerLUT::CreateHistograms(Int_t nxbin,Float_t pt_min,Int_t //phi_max = maximum phi0 (degrees) Double_t x = AliL3Transform::GetBFact()*AliL3Transform::GetBField()/pt_min; - Double_t torad = AliL3Transform::Pi()/180; - CreateHistograms(nxbin,-1.*x,x,nybin,phimin*torad,phimax*torad); + //Double_t torad = AliL3Transform::Pi()/180; + CreateHistograms(nxbin,-1.*x,x,nybin,phimin/**torad*/,phimax/**torad*/); } void AliL3HoughTransformerLUT::CreateHistograms(Int_t nxbin,Float_t xmin,Float_t xmax,Int_t nybin,Float_t ymin,Float_t ymax) @@ -223,22 +274,24 @@ void AliL3HoughTransformerLUT::CreateHistograms(Int_t nxbin,Float_t xmin,Float_t } //create lookup table for sin and cos - fNPhi0=nybin+1; - + fNPhi0=nybin; fLUTphi0=new Float_t[fNPhi0]; fLUT2sinphi0=new Float_t[fNPhi0]; fLUT2cosphi0=new Float_t[fNPhi0]; fLUTKappa=new Float_t[fNPhi0]; - Float_t diff=(ymax-ymin)/nybin; - Float_t phi0=ymin-0.5*diff; - for(Int_t i=0; iGetFirstYbin(); b<=hist->GetLastYbin(); b++) + { + Float_t phi0 = hist->GetBinCenterY(b); + fLUTphi0[i]=phi0; + fLUT2sinphi0[i]=2.*sin(phi0); + fLUT2cosphi0[i]=2.*cos(phi0); + fLUTKappa[i]=0.; + //cout << i << ": " << fLUTphi0[i] << " " << fLUT2sinphi0[i] << " " << fLUT2cosphi0[i] << endl; + i++; + } } void AliL3HoughTransformerLUT::Reset() @@ -271,28 +324,7 @@ Int_t AliL3HoughTransformerLUT::GetEtaIndex(Double_t eta) #endif } -Int_t AliL3HoughTransformerLUT::FindIndex(Float_t rz2, Int_t start) -{ - //could improve search through devide and conquere strategy - - Int_t index=start; - if(index==-100){ - index=0; - while((index=0)&&(rz2>fLUTEta[index])){ - index--; - } - index++; - } - //cout << start << " - " << index << " " << ": " << rz2 << " " << fLUTEta[index] << endl; - - return index; -} - -inline AliL3Histogram *AliL3HoughTransformerLUT::GetHistogram(Int_t eta_index) +AliL3Histogram *AliL3HoughTransformerLUT::GetHistogram(Int_t eta_index) { if(!fParamSpace || eta_index >= fNEtas || eta_index < 0) return 0; @@ -301,75 +333,20 @@ inline AliL3Histogram *AliL3HoughTransformerLUT::GetHistogram(Int_t eta_index) return fParamSpace[eta_index]; } -Float_t AliL3HoughTransformerLUT::CalcRoverZ2(Float_t eta) -{ - Float_t e=exp(2*eta); - Float_t ret=(e+1)/(e-1); - ret*=ret; - return ret; -} - -Float_t AliL3HoughTransformerLUT::CalcEta(Float_t roverz2) -{ - Float_t rz=sqrt(roverz2); - if(fZSign<0) rz=-rz; - Float_t ret=(1+rz)/(rz-1); - ret=0.5*log(ret); - return ret; -} - -Float_t AliL3HoughTransformerLUT::CalcX(Int_t row) -{ - return fLUTX[row]; -} - -Float_t AliL3HoughTransformerLUT::CalcY(Int_t pad,Int_t row) -{ - return pad*fPadPitch-fLUTY[row]; -} - -Float_t AliL3HoughTransformerLUT::CalcZ(Int_t time) -{ - Float_t ret=time*fTimeWidth; - if(fZSign>0) ret=fZLengthPlusOff-ret; - else ret=ret-fZLengthPlusOff; - return ret; -} - Double_t AliL3HoughTransformerLUT::GetEta(Int_t eta_index,Int_t slice) { if(eta_index >= fNEtas || eta_index < 0){ - //LOG(AliL3Log::kWarning,"AliL3HoughTransformerLUT::GetEta","Index") << "Index out of range."<Fill(fLUTKappa[b],fLUTphi0[b],fAccCharge); - //cout << kappa << " " << fLUTphi0[b] << " " << fAccCharge << endl; - } - - fAccCharge=0; - fLastIndex=new_eta_index; -} - void AliL3HoughTransformerLUT::TransformCircle() { //Transform the input data with a circle HT. @@ -379,9 +356,7 @@ void AliL3HoughTransformerLUT::TransformCircle() // //where R^2 = x^2 + y^2 // - //Each pixel then transforms into a curve in the (kappa,phi0)-space. In order to find - //which histogram in which the pixel should be transformed, the eta-value is calcluated - //and the proper histogram index is found by GetEtaIndex(eta). + //After a day of testing it is proven that this h AliL3DigitRowData *tempPt = GetDataPointer(); if(!tempPt) @@ -390,7 +365,10 @@ void AliL3HoughTransformerLUT::TransformCircle() <<"No input data "<0) cerr << "Big error " << endl; - - //accumulate charge per histogram + //store x for this row + fX = CalcX(row); + //accumulate charge per etaslice fAccCharge=0; - fLastIndex=-1; + //last histogram + fLastIndex=-1; //Loop over the data on this padrow: for(UInt_t j=0; jfNDigit; j++) @@ -423,63 +397,46 @@ void AliL3HoughTransformerLUT::TransformCircle() UShort_t charge = digPt[j].fCharge; //check threshold - if((Int_t)charge <= GetLowerThreshold() || (Int_t)charge > GetUpperThreshold()) + if((Int_t)charge <= lowch) continue; + if ((Int_t)charge > highch) + charge=highch; UChar_t pad = digPt[j].fPad; UShort_t time = digPt[j].fTime; if(fLastPad!=pad){ //only update if necessary - //if there is accumalated charge, put it in the right histogram - if(fAccCharge>0) AddCurveToHistogram(-1); + //if there is accumalated charge, + //put it in the old histogram + //using the old X and Y values + if(fAccCharge>0) AddCurveToHistogram(-1); //fLastIndex will be set to -1 #ifdef FULLLUT fLastIndex=fNEtas-1; #endif - //calculate hough for the new pad - Float_t y = CalcY(pad,row); - Float_t y2 = y*y; - r2 = x2 + y2; - Float_t xr2=x/r2; - Float_t yr2=y/r2; - - //AliL3Histogram *hist = fParamSpace[0]; - //Int_t bb=hist->GetFirstYbin(); - //if(fNPhi0-1!=hist->GetLastYbin()) cerr << "should not be" << endl; - for(Int_t b=0; bGetBinCenterY(bb); - //Float_t R=sqrt(r2); - //Float_t kappa = 2*sin(phi - phi0)/R; - //cout << fLUTKappa[b] << " " << kappa << endl; - //bb++; - //Int_t bina=hist->FindBin(fLUTphi0[b],fLUTKappa[b]); - //Int_t binb=hist->FindBin(phi0,kappa); - //if(bina!=binb) cout << bina << " " << binb << endl; - } - + //calculate Y for the new pad + fY = CalcY(pad,row); + //remember new pad fLastPad=pad; } +#ifdef FULLLUT //find eta slice Float_t z = CalcZ(time); - Float_t z2=z*z; -#ifdef FULLLUT + Float_t z2=z*z; Float_t rz2 = 1 + r2/z2; Int_t eta_index = FindIndex(rz2,fLastIndex); #else - Double_t r = sqrt(r2+z2); - Double_t etaval = 0.5 * log((r+z)/(r-z)); - Int_t eta_index = GetEtaIndex(etaval); + Float_t z = CalcZ(time); + Double_t r = sqrt(fX*fX+fY*fY+z*z); + Double_t eta = 0.5 * log((r+z)/(r-z)); + Int_t eta_index = GetEtaIndex(eta); #endif - //cout << row << " " << (int)pad << " " << (int)time << " " << eta_index << " " << fLastIndex << endl; if(eta_index < 0 || eta_index >= fNEtas){ - //LOG(AliL3Log::kWarning,"AliL3HoughTransformerLUT::TransformCircle","Histograms")<<"No histograms corresponding to eta index value of "<0) cerr << "Big error " << endl; -} - -Int_t AliL3HoughTransformerLUT::GetTrackID(Int_t eta_index,Double_t kappa,Double_t psi) -{ - if(fDoMC) - { - cerr<<"AliL3HoughTransformerLUT does not provide MC information..."<0) ret=fZLengthPlusOff-ret; + else ret=ret-fZLengthPlusOff; + return ret; +} + +inline void AliL3HoughTransformerLUT::AddCurveToHistogram(Int_t new_eta_index) +{ + //get correct histogrampointer + AliL3Histogram *hist = fParamSpace[fLastIndex]; + + //Fill the histogram along the phirange + Float_t r2=fX*fX+fY*fY; + for(Int_t b=0; bFill(kappa,fLUTphi0[b],fAccCharge); + //cout << kappa << " " << fLUTphi0[b] << " " << fAccCharge << endl; + } + + fAccCharge=0; + fLastIndex=new_eta_index; +} + +inline Int_t AliL3HoughTransformerLUT::FindIndex(Float_t rz2, Int_t start) +{ + //could improve search through devide and conquere strategy + + Int_t index=start; + if(index==-100){ + index=0; + while((index=0)&&(rz2>fLUTEta[index])){ + index--; + } + index++; + } + //cout << start << " - " << index << " " << ": " << rz2 << " " << fLUTEta[index] << endl; + + return index; +} + + + + #endif diff --git a/HLT/hough/AliL3HoughTransformerNew.cxx b/HLT/hough/AliL3HoughTransformerNew.cxx index 073ebc302f2..fa2904b9270 100644 --- a/HLT/hough/AliL3HoughTransformerNew.cxx +++ b/HLT/hough/AliL3HoughTransformerNew.cxx @@ -125,10 +125,12 @@ struct Digit { Float_t z; Digit *next; }; + struct EtaContainer { void *first; void *last; }; + void AliL3HoughTransformerNew::TransformLineC(Int_t *rowrange,Float_t *phirange) { AliL3DigitRowData *tempPt = GetDataPointer(); diff --git a/HLT/hough/AliL3HoughTransformerVhdl.h b/HLT/hough/AliL3HoughTransformerVhdl.h index 0821f571f87..116132adfa5 100644 --- a/HLT/hough/AliL3HoughTransformerVhdl.h +++ b/HLT/hough/AliL3HoughTransformerVhdl.h @@ -39,7 +39,7 @@ class AliL3HoughTransformerVhdl : public AliL3HoughTransformerLUT void Print(); void PrintVhdl(); - ClassDef(AliL3HoughTransformerVhdl,1) //Normal Hough transformation class + ClassDef(AliL3HoughTransformerVhdl,1) //VHDL Hough transformation class }; diff --git a/HLT/hough/Makefile b/HLT/hough/Makefile index a711ab43b40..70ad7a2a1c8 100644 --- a/HLT/hough/Makefile +++ b/HLT/hough/Makefile @@ -14,13 +14,18 @@ endif include $(ALIHLT_TOPDIR)/Makefile.conf -SRCS = AliL3HoughTransformer.cxx AliL3HoughTrack.cxx AliL3HoughClusterTransformer.cxx \ +SRCS = AliL3HoughTransformer.cxx AliL3HoughClusterTransformer.cxx \ AliL3HoughEval.cxx AliL3HoughMerger.cxx AliL3HoughBaseTransformer.cxx \ AliL3HoughIntMerger.cxx AliL3HoughGlobalMerger.cxx AliL3HoughTransformerVhdl.cxx \ AliL3Histogram.cxx AliL3Histogram1D.cxx AliL3HoughMaxFinder.cxx AliL3Hough.cxx \ AliL3HoughTransformerLUT.cxx AliL3HistogramAdaptive.cxx -EXTRA_SRCS = AliL3HoughDisplay.cxx AliL3HoughTransformerNew.cxx AliL3HoughTest.cxx +ifeq ($(ARCH),Darwin) +## AliL3HoughTrack put into src as symbolic link +EXTRA_SRCS = AliL3HoughDisplay.cxx AliL3HoughTransformerNew.cxx +else +EXTRA_SRCS = AliL3HoughDisplay.cxx AliL3HoughTransformerNew.cxx AliL3HoughTrack.cxx AliL3HoughTest.cxx +endif ifeq ($(ALIHLT_USEPACKAGE),ROOT) SRCS += $(EXTRA_SRCS) diff --git a/HLT/kalman/AliL3Kalman.cxx b/HLT/kalman/AliL3Kalman.cxx index 152d783463e..54a793c928f 100644 --- a/HLT/kalman/AliL3Kalman.cxx +++ b/HLT/kalman/AliL3Kalman.cxx @@ -153,10 +153,33 @@ void AliL3Kalman::ProcessTracks() fKalmanTracks = new AliL3TrackArray(); - // Make a ntuple to store state vector, covariance matrix and chisquare + // Make a tree to store state vector, covariance matrix and chisquare // Will eventually not need a TTree?? - TNtuple *kalmanTree = new TNtuple("kalmanTree","kalmantracks","x0:x1:x2:x3:x4:c0:c1:c2:c3:c4:c5:c6:c7:c8:c9:c10:c11:c12:c13:c14:chisq"); + TTree *kalmanTree = new TTree("kalmanTree","kalmantracks"); Float_t meas[21]; + Int_t lab = 123456789; + kalmanTree->Branch("x0",&meas[0],"x0/F"); + kalmanTree->Branch("x1",&meas[1],"x1/F"); + kalmanTree->Branch("x2",&meas[2],"x2/F"); + kalmanTree->Branch("x3",&meas[3],"x3/F"); + kalmanTree->Branch("x4",&meas[4],"x4/F"); + kalmanTree->Branch("c0",&meas[5],"c0/F"); + kalmanTree->Branch("c1",&meas[6],"c1/F"); + kalmanTree->Branch("c2",&meas[7],"c2/F"); + kalmanTree->Branch("c3",&meas[8],"c3/F"); + kalmanTree->Branch("c4",&meas[9],"c4/F"); + kalmanTree->Branch("c5",&meas[10],"c5/F"); + kalmanTree->Branch("c6",&meas[11],"c6/F"); + kalmanTree->Branch("c7",&meas[12],"c7/F"); + kalmanTree->Branch("c8",&meas[13],"c8/F"); + kalmanTree->Branch("c9",&meas[14],"c9/F"); + kalmanTree->Branch("c10",&meas[15],"c10/F"); + kalmanTree->Branch("c11",&meas[16],"c11/F"); + kalmanTree->Branch("c12",&meas[17],"c12/F"); + kalmanTree->Branch("c13",&meas[18],"c13/F"); + kalmanTree->Branch("c14",&meas[19],"c14/F"); + kalmanTree->Branch("chisq",&meas[20],"chisq/F"); + kalmanTree->Branch("lab",&lab,"lab/I"); // Go through the tracks from conformal or hough tracker for (Int_t iTrack = 0; iTrack < fTracks->GetNTracks(); iTrack++) @@ -169,6 +192,17 @@ void AliL3Kalman::ProcessTracks() if (!track) continue; if (track->GetNumberOfPoints() < fMinPointsOnTrack) continue; + UInt_t *hitnum = track->GetHitNumbers(); + UInt_t id; + + id = hitnum[0]; + Int_t slice = (id>>25) & 0x7f; + Int_t patch = (id>>22) & 0x7; + UInt_t pos = id&0x3fffff; + AliL3SpacePointData *points = fClusters[slice][patch]; + lab=points[pos].fTrackID[0]; + //cout << lab << endl; + AliL3KalmanTrack *kalmantrack = new AliL3KalmanTrack(); Bool_t save = kTRUE; @@ -192,6 +226,7 @@ void AliL3Kalman::ProcessTracks() if (Propagate(kalmantrack, track) == 0) { save = kFALSE; + continue; } if (save) { @@ -227,8 +262,8 @@ void AliL3Kalman::ProcessTracks() outtrack->Set(track); // Fill the ntuple with the state vector, covariance matrix and - // chisquare - kalmanTree->Fill(meas); + // chisquare and track label + kalmanTree->Fill(); } delete track; diff --git a/HLT/misc/AliL3DDLRawReader.h b/HLT/misc/AliL3DDLRawReader.h index efc224d9bde..a23e97322ef 100644 --- a/HLT/misc/AliL3DDLRawReader.h +++ b/HLT/misc/AliL3DDLRawReader.h @@ -3,6 +3,8 @@ #ifndef ALIL3DDLRAWREADER_H #define ALIL3DDLRAWREADER_H +#include "AliL3RootTypes.h" + // see description in upcoming ALICE note // by D.Favretto and A.K.Mohanty struct AliL3DDLMiniHeader diff --git a/HLT/misc/AliL3DDLRawReaderFile.h b/HLT/misc/AliL3DDLRawReaderFile.h index 525e270751d..fdd1470cc1e 100644 --- a/HLT/misc/AliL3DDLRawReaderFile.h +++ b/HLT/misc/AliL3DDLRawReaderFile.h @@ -3,6 +3,7 @@ #ifndef ALIL3DDLRAWREADERFILE_H #define ALIL3DDLRAWREADERFILE_H +#include "AliL3RootTypes.h" #include "AliL3DDLRawReader.h" class AliL3DDLRawReaderFile: public AliL3DDLRawReader diff --git a/HLT/misc/AliL3DDLTPCRawStream.h b/HLT/misc/AliL3DDLTPCRawStream.h index 5566a43b035..d03a2179382 100644 --- a/HLT/misc/AliL3DDLTPCRawStream.h +++ b/HLT/misc/AliL3DDLTPCRawStream.h @@ -3,6 +3,8 @@ #ifndef ALIL3DDLTPCRAWSTREAM_H #define ALIL3DDLTPCRAWSTREAM_H +#include "AliL3RootTypes.h" + class AliL3DDLRawReader; class AliL3DDLTPCRawStream diff --git a/HLT/misc/AliL3MiscLinkDef.h b/HLT/misc/AliL3MiscLinkDef.h index 998943a5d84..dde779380e7 100644 --- a/HLT/misc/AliL3MiscLinkDef.h +++ b/HLT/misc/AliL3MiscLinkDef.h @@ -6,17 +6,21 @@ #pragma link off all classes; #pragma link off all functions; +#ifndef Darwin #pragma link C++ class AliL3TransBit; #pragma link C++ class AliL3TransBit_v1; #pragma link C++ class AliL3TransBit_v2; -#pragma link C++ class AliL3AltroMemHandler; #pragma link C++ class AliL3DataHandler; +#endif +#pragma link C++ class AliL3AltroMemHandler; #pragma link C++ class AliL3VHDLClusterFinder; #pragma link C++ class AliL3TPCMapping; #pragma link C++ class AliL3DDLRawReader; #pragma link C++ class AliL3DDLRawReaderFile; #pragma link C++ class AliL3DDLTPCRawStream; +#ifndef Darwin #pragma link C++ class AliL3DDLDataFileHandler; +#endif #ifdef USEFFLOAT #pragma link C++ class AliL3FFloat; diff --git a/HLT/misc/Makefile b/HLT/misc/Makefile index 68364a4be5a..c42b254cb35 100644 --- a/HLT/misc/Makefile +++ b/HLT/misc/Makefile @@ -14,9 +14,13 @@ endif include $(ALIHLT_TOPDIR)/Makefile.conf -SRCS = AliL3TransBit.cxx AliL3AltroMemHandler.cxx AliL3DataHandler.cxx \ +SRCS = AliL3TransBit.cxx AliL3AltroMemHandler.cxx \ AliL3VHDLClusterFinder.cxx AliL3TPCMapping.cxx \ AliL3FFloat.cxx AliL3Stopwatch.cxx AliL3DDLRawReader.cxx \ - AliL3DDLRawReaderFile.cxx AliL3DDLTPCRawStream.cxx AliL3DDLDataFileHandler.cxx + AliL3DDLRawReaderFile.cxx AliL3DDLTPCRawStream.cxx + +ifneq ($(ARCH),Darwin) +SRCS += AliL3DDLDataFileHandler.cxx AliL3DataHandler.cxx +endif include $(ALIHLT_TOPDIR)/Makefile.rules diff --git a/HLT/src/AliL3ConfMapFit.cxx b/HLT/src/AliL3ConfMapFit.cxx index cfe55c910f0..ca4453c4313 100644 --- a/HLT/src/AliL3ConfMapFit.cxx +++ b/HLT/src/AliL3ConfMapFit.cxx @@ -371,15 +371,24 @@ Int_t AliL3ConfMapFit::FitCircle() r0 = sqrt ( lHit->GetX() * lHit->GetX() + lHit->GetY() * lHit->GetY() ) ; fTrack->SetPhi0(phi0); fTrack->SetR0(r0); + } - // + + //Set the first point on the track to the space point coordinates of the innermost track + //This will be updated to lie on the fit later on (AliL3Track::UpdateToFirstPoint). + fTrack->SetFirstPoint(x0,y0,0); //Z-value is set in FitLine + psi = (Double_t)atan2(bcent-y0,acent-x0) ; psi = psi + q * 0.5F * pi ; if ( psi < 0 ) psi = psi + 2*pi; - pt = (Double_t)(BFACT * AliL3Transform::GetBField() * radius ) ; + + //Update the track parameters with the parameters from this fit: fTrack->SetPsi(psi); fTrack->SetPt(pt); + fTrack->SetRadius(radius); + fTrack->SetCenterX(acent); + fTrack->SetCenterY(bcent); // // Get errors from fast fit diff --git a/HLT/src/AliL3ConfMapTrack.cxx b/HLT/src/AliL3ConfMapTrack.cxx index 934d57e3461..c018710305c 100644 --- a/HLT/src/AliL3ConfMapTrack.cxx +++ b/HLT/src/AliL3ConfMapTrack.cxx @@ -175,26 +175,18 @@ void AliL3ConfMapTrack::Fill(AliL3Vertex *vertex,Double_t max_Dca) if(GetPt() > max_Dca) //go for fit of helix in real space { AliL3ConfMapFit *fit = new AliL3ConfMapFit(this,vertex); + ComesFromMainVertex(AliLevel3::DoVertexFit()); fit->FitHelix(); - AliL3ConfMapPoint *lHit = (AliL3ConfMapPoint*)lastHit; + //AliL3ConfMapPoint *lHit = (AliL3ConfMapPoint*)lastHit; AliL3ConfMapPoint *fHit = (AliL3ConfMapPoint*)firstHit; + SetLastPoint(fHit->GetX(),fHit->GetY(),fHit->GetZ()); - if(AliLevel3::IsTracksAtFirstPoint()) + if(AliLevel3::IsTracksAtFirstPoint())//Set the track fit parameter at the innermost most point { - //Z0 should not be overwritten here, since it is used as a starting - //point for the track swim in UpdateToFirstPoint. fFirstPointX and Y - //will be overwritten in UpdateToFirstPoint with the track fit - //crossing point. - SetFirstPoint(lHit->GetX(),lHit->GetY(),GetZ0()); UpdateToFirstPoint(); } - else - { - SetFirstPoint(vertex->GetX(),vertex->GetY(),vertex->GetZ()); - } - SetLastPoint(fHit->GetX(),fHit->GetY(),fHit->GetZ()); delete fit; } else if(GetPt() == 0) @@ -206,74 +198,7 @@ void AliL3ConfMapTrack::Fill(AliL3Vertex *vertex,Double_t max_Dca) "Track with ptLast(); - AliL3ConfMapPoint *lHit = (AliL3ConfMapPoint*)lastHit; - Double_t radius = sqrt(lHit->GetX()*lHit->GetX()+lHit->GetY()*lHit->GetY()); - - //Get the track parameters - - Double_t tPhi0 = GetPsi() + GetCharge() * 0.5 * pi / abs(GetCharge()) ; - Double_t x0 = GetR0() * cos(GetPhi0()) ; - Double_t y0 = GetR0() * sin(GetPhi0()) ; - Double_t rc = fabs(GetPt()) / ( BFACT * AliL3Transform::GetBField() ) ; - Double_t xc = x0 - rc * cos(tPhi0) ; - Double_t yc = y0 - rc * sin(tPhi0) ; - - //Check helix and cylinder intersect - - Double_t fac1 = xc*xc + yc*yc ; - Double_t sfac = sqrt( fac1 ) ; - - if ( fabs(sfac-rc) > radius || fabs(sfac+rc) < radius ) { - LOG(AliL3Log::kError,"AliL3ConfMapTrack::UpdateToLastPoint","Tracks")< 2.*pi ) deltat -= 2. * pi ; - Double_t z = GetZ0() + rc * GetTgl() * deltat ; - - - Double_t xExtra = radius * cos(phi) ; - Double_t yExtra = radius * sin(phi) ; - - Double_t tPhi = atan2(yExtra-yc,xExtra-xc); - - //if ( tPhi < 0 ) tPhi += 2. * M_PI ; - - Double_t tPsi = tPhi - GetCharge() * 0.5 * pi / abs(GetCharge()) ; - if ( tPsi > 2. * pi ) tPsi -= 2. * pi ; - if ( tPsi < 0. ) tPsi += 2. * pi ; - - //And finally, update the track parameters - - SetCenterX(xc); - SetCenterY(yc); - SetR0(radius); - SetPhi0(phi); - SetZ0(z); - SetPsi(tPsi); -} -*/ + Int_t AliL3ConfMapTrack::GetMCLabel() { //For evaluation study. diff --git a/HLT/src/AliL3FileHandler.cxx b/HLT/src/AliL3FileHandler.cxx index d3f8314ecc9..04bedb32c4b 100644 --- a/HLT/src/AliL3FileHandler.cxx +++ b/HLT/src/AliL3FileHandler.cxx @@ -71,7 +71,71 @@ using namespace std; ClassImp(AliL3FileHandler) -AliL3FileHandler::AliL3FileHandler() +// of course on start up the index is not created +Bool_t AliL3FileHandler::fStaticIndexCreated=kFALSE; +Int_t AliL3FileHandler::fStaticIndex[36][159]; + +void AliL3FileHandler::CleanStaticIndex() +{ // use this static call to clean static index after + // running over one event + + for(Int_t i=0;i> fStaticIndex[i][j]; + } + file.close(); + + fStaticIndexCreated=kTRUE; + return 0; +} + +AliL3FileHandler::AliL3FileHandler(Bool_t b) { //Default constructor fInAli = 0; @@ -79,11 +143,14 @@ AliL3FileHandler::AliL3FileHandler() fMC =0; fDigits=0; fDigitsTree=0; - for(Int_t i=0;iGetEntries(); n++){ - Int_t sector, row; - Int_t lslice,lrow; - fDigitsTree->GetEvent(n); - fParam->AdjustSectorRow(fDigits->GetID(),sector,row); - if(!AliL3Transform::Sector2Slice(lslice,lrow,sector,row)){ - LOG(AliL3Log::kError,"AliL3FileHandler::CreateIndex","Slice/Row") - <GetEntries(); n++) { + Int_t sector, row; + Int_t lslice,lrow; + fDigitsTree->GetEvent(n); + fParam->AdjustSectorRow(fDigits->GetID(),sector,row); + if(!AliL3Transform::Sector2Slice(lslice,lrow,sector,row)){ + LOG(AliL3Log::kError,"AliL3FileHandler::CreateIndex","Slice/Row") + <GetEvent(eventn); tpcLoader->LoadRecPoints(); diff --git a/HLT/src/AliL3FileHandler.h b/HLT/src/AliL3FileHandler.h index 5e70d9577a7..0b916b8e4b0 100644 --- a/HLT/src/AliL3FileHandler.h +++ b/HLT/src/AliL3FileHandler.h @@ -32,23 +32,30 @@ class AliL3FileHandler:public AliL3MemHandler{ #endif AliTPCParam *fParam; virtual Bool_t SetAliInput(); - // Int_t fLastIndex; AliSimDigits *fDigits; + TTree *fDigitsTree; FILE *fMC;//! Bool_t fIndexCreated; //is index created Int_t fIndex[36][159]; //stores index over digitstree //for faster access w/o ASVVERSION + Bool_t fUseStaticIndex; //take static index + static Bool_t fStaticIndexCreated; //global index created + static Int_t fStaticIndex[36][159]; //global index Bool_t GetDigitsTree(Int_t event); Bool_t CreateIndex(); //create the index public: - AliL3FileHandler(); + AliL3FileHandler(Bool_t b=kFALSE); ~AliL3FileHandler(); void FreeDigitsTree(); + static void CleanStaticIndex(); + static Int_t SaveStaticIndex(Char_t *prefix=0,Int_t event=0); + static Int_t LoadStaticIndex(Char_t *prefix=0,Int_t event=0); + Bool_t SetAliInput(Char_t *name); Bool_t SetAliInput(TFile *file); #ifdef use_newio diff --git a/HLT/src/AliL3Fitter.cxx b/HLT/src/AliL3Fitter.cxx index 0562441bb4c..ee414eed11d 100644 --- a/HLT/src/AliL3Fitter.cxx +++ b/HLT/src/AliL3Fitter.cxx @@ -134,31 +134,6 @@ void AliL3Fitter::SortTrackClusters(AliL3Track *track) delete [] mk; } -void AliL3Fitter::UpdateTrack(AliL3Track *track) -{ - //Update the track parameters to the first point on the track. - //This function should be called after the track fit has been - //done, in order to calculate the track parameters at the - //first point on the track. - - UInt_t *ids = track->GetHitNumbers(); - Int_t nhits = track->GetNHits(); - UInt_t id=ids[nhits-1]; - Int_t slice = (id>>25) & 0x7f; - Int_t patch = (id>>22) & 0x7; - UInt_t pos = id&0x3fffff; - AliL3SpacePointData *points = fClusters[slice][patch]; - if(AliLevel3::IsTracksAtFirstPoint()) - { - track->SetFirstPoint(points[pos].fX,points[pos].fY,track->GetZ0()); - track->UpdateToFirstPoint(); - } - else - { - track->SetFirstPoint(fVertex->GetX(),fVertex->GetY(),fVertex->GetZ()); - } -} - Int_t AliL3Fitter::FitHelix(AliL3Track *track) { fTrack = track; @@ -208,7 +183,6 @@ Int_t AliL3Fitter::FitCircle() wsum += fXYWeight[i]; xav += fXYWeight[i]*points[pos].fX; yav += fXYWeight[i]*points[pos].fY; - } if (fVertexConstraint == kTRUE) { @@ -509,7 +483,11 @@ Int_t AliL3Fitter::FitCircle() fTrack->SetPhi0(phi0); fTrack->SetR0(r0); } - // + + //Set the first point on the track to the space point coordinates of the innermost track + //This will be updated to lie on the fit later on (AliL3Track::UpdateToFirstPoint). + fTrack->SetFirstPoint(x0,y0,0); //Z-value is set in FitLine + psi = (Double_t)atan2(bcent-y0,acent-x0) ; psi = psi + q * 0.5F * AliL3Transform::Pi() ; if ( psi < 0 ) psi = psi + 2*AliL3Transform::Pi(); @@ -517,7 +495,9 @@ Int_t AliL3Fitter::FitCircle() pt = (Double_t)(AliL3Transform::GetBFact() * AliL3Transform::GetBField() * radius ) ; fTrack->SetPsi(psi); fTrack->SetPt(pt); - //fTrack->SetFirstPoint(x0,y0,0); + fTrack->SetRadius(radius); + fTrack->SetCenterX(acent); + fTrack->SetCenterY(bcent); // // Get errors from fast fit // diff --git a/HLT/src/AliL3Fitter.h b/HLT/src/AliL3Fitter.h index 73a75f6c827..6bd2566022c 100644 --- a/HLT/src/AliL3Fitter.h +++ b/HLT/src/AliL3Fitter.h @@ -25,7 +25,6 @@ class AliL3Fitter { void LoadClusters(Char_t *path,Int_t event=0,Bool_t sp=kFALSE); void SortTrackClusters(AliL3Track *track); - void UpdateTrack(AliL3Track *track); Int_t FitHelix(AliL3Track *track); Int_t FitCircle(); Int_t FitLine(); diff --git a/HLT/src/AliL3GlobalMerger.h b/HLT/src/AliL3GlobalMerger.h index 61cf25e55f5..b933ab7b21e 100644 --- a/HLT/src/AliL3GlobalMerger.h +++ b/HLT/src/AliL3GlobalMerger.h @@ -7,6 +7,8 @@ #include "AliL3Merger.h" #endif +#include "AliL3RootTypes.h" + class AliL3GlobalMerger : public AliL3Merger{ private: diff --git a/HLT/src/AliL3InterMerger.h b/HLT/src/AliL3InterMerger.h index 104ace2eee8..ee0ece0ba21 100644 --- a/HLT/src/AliL3InterMerger.h +++ b/HLT/src/AliL3InterMerger.h @@ -7,6 +7,8 @@ #include "AliL3Merger.h" #endif +#include "AliL3RootTypes.h" + class AliL3InterMerger : public AliL3Merger { private: diff --git a/HLT/src/AliL3SrcLinkDef.h b/HLT/src/AliL3SrcLinkDef.h index 2d657147ddc..600d6d0e01d 100644 --- a/HLT/src/AliL3SrcLinkDef.h +++ b/HLT/src/AliL3SrcLinkDef.h @@ -32,6 +32,18 @@ #pragma link C++ class AliL3Fitter; #pragma link C++ class AliL3RawDataFileHandler; +#ifdef Darwin +//new to solve dep problem +#pragma link C++ class AliL3HoughTrack; +#pragma link C++ class AliL3ModelTrack; +#pragma link C++ class AliL3DataCompressorHelper; +#pragma link C++ class AliL3DDLDataFileHandler; +#pragma link C++ class AliL3DataHandler; +#pragma link C++ class AliL3TransBit; +#pragma link C++ class AliL3TransBit_v1; +#pragma link C++ class AliL3TransBit_v2; +#endif + #ifdef use_aliroot #pragma link C++ class AliL3FileHandler; #pragma link C++ class AliL3Evaluate; diff --git a/HLT/src/AliL3Track.cxx b/HLT/src/AliL3Track.cxx index 67c46466f0b..994547ec1d3 100644 --- a/HLT/src/AliL3Track.cxx +++ b/HLT/src/AliL3Track.cxx @@ -408,74 +408,62 @@ Bool_t AliL3Track::CalculatePoint(Double_t xplane){ void AliL3Track::UpdateToFirstPoint() { //Update track parameters to the innermost point on the track. - //Basically it justs calculates the intersection of the track, and a cylinder - //with radius = r(innermost point). Then the parameters are updated to this point. - //Should be called after the helixfit (in FillTracks). - - Double_t radius = sqrt(GetFirstPointX()*GetFirstPointX() + GetFirstPointY()*GetFirstPointY()); - - //Get the track parameters - - Double_t tPhi0 = GetPsi() + GetCharge() * 0.5 * pi / abs(GetCharge()) ; - - Double_t x0 = GetR0() * cos(GetPhi0()) ; - Double_t y0 = GetR0() * sin(GetPhi0()) ; - Double_t rc = fabs(GetPt()) / ( BFACT * AliL3Transform::GetBField() ) ; - Double_t xc = x0 - rc * cos(tPhi0) ; - Double_t yc = y0 - rc * sin(tPhi0) ; + //This means that the parameters of the track will be given in the point + //of closest approach to the first innermost point, i.e. the point + //lying on the track fit (and not the coordinates of the innermost point itself). + //This function assumes that fFirstPoint is already set to the coordinates of the innermost + //assigned cluster. + // + //During the helix-fit, the first point on the track is set to the coordinates + //of the innermost assigned cluster. This may be ok, if you just want a fast + //estimate of the "global" track parameters; such as the momentum etc. + //However, if you later on want to do more precise local calculations, such + //as impact parameter, residuals etc, you need to give the track parameters + //according to the actual fit. - //Check helix and cylinder intersect - - Double_t fac1 = xc*xc + yc*yc ; - Double_t sfac = sqrt( fac1 ) ; - - if ( fabs(sfac-rc) > radius || fabs(sfac+rc) < radius ) { - LOG(AliL3Log::kError,"AliL3ConfMapTrack::UpdateToLastPoint","Tracks")< 2.*pi ) deltat -= 2. * pi ; - Double_t z = GetZ0() + rc * GetTgl() * deltat ; - - - Double_t xExtra = radius * cos(phi) ; - Double_t yExtra = radius * sin(phi) ; + Double_t dist_x1 = xc*(1 + GetRadius()/sqrt(xc*xc + yc*yc)); + Double_t dist_y1 = yc*(1 + GetRadius()/sqrt(xc*xc + yc*yc)); + Double_t distance1 = sqrt(dist_x1*dist_x1 + dist_y1*dist_y1); - Double_t tPhi = atan2(yExtra-yc,xExtra-xc); + Double_t dist_x2 = xc*(1 - GetRadius()/sqrt(xc*xc + yc*yc)); + Double_t dist_y2 = yc*(1 - GetRadius()/sqrt(xc*xc + yc*yc)); + Double_t distance2 = sqrt(dist_x2*dist_x2 + dist_y2*dist_y2); - //if ( tPhi < 0 ) tPhi += 2. * M_PI ; + //Choose the closest: + Double_t point[2]; + if(distance1 < distance2) + { + point[0] = dist_x1 + GetFirstPointX(); + point[1] = dist_y1 + GetFirstPointY(); + } + else + { + point[0] = dist_x2 + GetFirstPointX(); + point[1] = dist_y2 + GetFirstPointY(); + } + + Double_t pointpsi = atan2(point[1]-GetCenterY(),point[0]-GetCenterX()); + pointpsi -= GetCharge()*0.5*AliL3Transform::Pi(); + if(pointpsi < 0) pointpsi += 2*AliL3Transform::Pi(); - Double_t tPsi = tPhi - GetCharge() * 0.5 * pi / abs(GetCharge()) ; - if ( tPsi > 2. * pi ) tPsi -= 2. * pi ; - if ( tPsi < 0. ) tPsi += 2. * pi ; + //Update the track parameters + SetR0(sqrt(point[0]*point[0]+point[1]*point[1])); + SetPhi0(atan2(point[1],point[0])); + SetFirstPoint(point[0],point[1],GetZ0()); + SetPsi(pointpsi); - //And finally, update the track parameters - SetCenterX(xc); - SetCenterY(yc); - SetR0(radius); - SetPhi0(phi); - SetFirstPoint(radius*cos(phi),radius*sin(phi),z); - SetPsi(tPsi); } void AliL3Track::GetClosestPoint(AliL3Vertex *vertex,Double_t &closest_x,Double_t &closest_y,Double_t &closest_z) { //Calculate the point of closest approach to the vertex + //This function calculates the minimum distance from the helix to the vertex, and choose + //the corresponding point lying on the helix as the point of closest approach. - - Double_t xc = GetCenterX() - vertex->GetX();//Shift the center of curvature with respect to the vertex + Double_t xc = GetCenterX() - vertex->GetX(); Double_t yc = GetCenterY() - vertex->GetY(); Double_t dist_x1 = xc*(1 + GetRadius()/sqrt(xc*xc + yc*yc)); diff --git a/HLT/src/AliL3TrackArray.cxx b/HLT/src/AliL3TrackArray.cxx index 373d7351733..5646fe19df9 100644 --- a/HLT/src/AliL3TrackArray.cxx +++ b/HLT/src/AliL3TrackArray.cxx @@ -252,7 +252,7 @@ UInt_t AliL3TrackArray::WriteTracks(UInt_t & ntracks,AliL3TrackSegmentData* tr){ } UInt_t AliL3TrackArray::WriteTracks(AliL3TrackSegmentData* tr){ - if(GetTrackType()=='c') return WriteConfMapTracks(tr); + //if(GetTrackType()=='c') return WriteConfMapTracks(tr); AliL3TrackSegmentData *tP = tr; UInt_t *pP; UInt_t size = 0; diff --git a/HLT/src/AliL3TrackMerger.h b/HLT/src/AliL3TrackMerger.h index 41c3bfa814c..3c8240d40e4 100644 --- a/HLT/src/AliL3TrackMerger.h +++ b/HLT/src/AliL3TrackMerger.h @@ -7,6 +7,8 @@ #include "AliL3Merger.h" #endif +#include "AliL3RootTypes.h" + class AliL3Merger; class AliL3TrackMerger : public AliL3Merger { diff --git a/HLT/src/AliL3Transform.h b/HLT/src/AliL3Transform.h index 315160c54d2..f597dbc005a 100644 --- a/HLT/src/AliL3Transform.h +++ b/HLT/src/AliL3Transform.h @@ -11,9 +11,9 @@ class AliL3Transform { enum VersionType { fV_default=0, fV_deprecated=1, fV_aliroot=10, fV_cosmics=100}; private: - const static Double_t fBFACT; - const static Double_t fPi; - const static Double_t fAnodeWireSpacing; + static const Double_t fBFACT; + static const Double_t fPi; + static const Double_t fAnodeWireSpacing; static Int_t fNPatches; //6 (dont change this) static Int_t fRows[6][2]; diff --git a/HLT/src/AliLevel3.cxx b/HLT/src/AliLevel3.cxx index d2b5bb22e65..3a5495483d3 100644 --- a/HLT/src/AliLevel3.cxx +++ b/HLT/src/AliLevel3.cxx @@ -56,6 +56,7 @@ ClassImp(AliLevel3) Bool_t AliLevel3::fSetTracks2FirstPoint = kTRUE;//Define track parameters at first point +Bool_t AliLevel3::fDoVertexFit = kTRUE;//Include the vertex in the final track fit AliLevel3::AliLevel3() { @@ -72,7 +73,6 @@ AliLevel3::AliLevel3(Char_t *infile) //meaning rootfiles or raw files. fInputFile = infile; - } void AliLevel3::Init(Char_t *path,EFileType filetype,Int_t npatches) @@ -99,6 +99,9 @@ void AliLevel3::Init(Char_t *path,EFileType filetype,Int_t npatches) fEta[1] = 1.1; fEvent=0; +#ifdef use_aliroot /*just to be sure*/ + AliL3FileHandler::CleanStaticIndex(); +#endif switch(npatches){ case 0: @@ -143,7 +146,7 @@ void AliLevel3::Init(Char_t *path,EFileType filetype,Int_t npatches) SetMergerParameters();//Set default merger parameters #ifdef use_aliroot if(filetype==kRoot){ - fFileHandler = new AliL3FileHandler(); + fFileHandler = new AliL3FileHandler(kTRUE); //static version fFileHandler->SetAliInput(fInputFile); }else if(filetype==kRaw){ fFileHandler = new AliL3DDLDataFileHandler(); @@ -202,7 +205,8 @@ void AliLevel3::SetTrackerParam(Int_t phi_segments, Int_t eta_segments, Double_t min_pt_fit, Double_t maxangle, Double_t goodDist, Double_t hitChi2Cut, Double_t goodHitChi2, Double_t trackChi2Cut, - Int_t maxdist,Double_t maxphi,Double_t maxeta,Bool_t vertexconstraint) + Int_t maxdist,Double_t maxphi,Double_t maxeta, + Bool_t vertexconstraint) { //Set parameters input to the tracker //If no arguments are given, default parameters will be used @@ -230,6 +234,9 @@ void AliLevel3::ProcessEvent(Int_t first,Int_t last,Int_t event){ //inner=2 + outer=38. fGlobalMerger->Setup(first,last); +#ifdef use_aliroot + if(fEvent!=event) AliL3FileHandler::CleanStaticIndex(); +#endif fEvent=event; for(Int_t i=first; i<=last; i++){ ProcessSlice(i); @@ -547,7 +554,7 @@ void AliLevel3::ProcessSlice(Int_t slice){ void AliLevel3::FitGlobalTracks() { - AliL3Fitter *fitter = new AliL3Fitter(fVertex); + AliL3Fitter *fitter = new AliL3Fitter(fVertex,AliLevel3::DoVertexFit()); if(fNPatch==1) fitter->LoadClusters(fWriteOutPath,fEvent,kTRUE); else @@ -560,7 +567,8 @@ void AliLevel3::FitGlobalTracks() AliL3Track *tr = tracks->GetCheckedTrack(i); if(!tr) continue; fitter->FitHelix(tr); - fitter->UpdateTrack(tr); + if(AliLevel3::IsTracksAtFirstPoint()) + tr->UpdateToFirstPoint(); } fBenchmark->Stop("Global track fitter"); delete fitter; diff --git a/HLT/src/AliLevel3.h b/HLT/src/AliLevel3.h index 42cb6be7dda..0553bff7c54 100644 --- a/HLT/src/AliLevel3.h +++ b/HLT/src/AliLevel3.h @@ -71,6 +71,7 @@ class AliLevel3 : public TObject { //Define whether track parameters should be given at first point on track (default) //If not, the parameters will be given at the vertex. static Bool_t fSetTracks2FirstPoint; + static Bool_t fDoVertexFit; Bool_t fClusterDeconv; Float_t fXYClusterError; @@ -116,8 +117,10 @@ class AliLevel3 : public TObject { static void SetTracks2FirstPoint() {fSetTracks2FirstPoint = kTRUE;} static void SetTracks2Vertex() {fSetTracks2FirstPoint = kFALSE;} + static void SetVertexFit(Bool_t f) {fDoVertexFit=f;} static Bool_t IsTracksAtFirstPoint() {return fSetTracks2FirstPoint;} - + static Bool_t DoVertexFit() {return fDoVertexFit;} + ClassDef(AliLevel3,1) //Interface class for Level3-tracking }; diff --git a/HLT/src/Makefile b/HLT/src/Makefile index 6a8eb3d532d..bfebc3aaafd 100644 --- a/HLT/src/Makefile +++ b/HLT/src/Makefile @@ -20,8 +20,16 @@ SRCS = AliL3ConfMapper.cxx AliL3ConfMapPoint.cxx \ AliL3Vertex.cxx AliL3VertexFinder.cxx \ AliL3Merger.cxx AliL3GlobalMerger.cxx AliL3ClustFinderNew.cxx \ AliL3TrackArray.cxx AliL3InterMerger.cxx AliL3Logger.cxx \ - AliL3MemHandler.cxx AliLevel3.cxx AliL3Benchmark.cxx AliL3Fitter.cxx \ - AliL3RawDataFileHandler.cxx + AliL3MemHandler.cxx AliLevel3.cxx AliL3Benchmark.cxx \ + AliL3Fitter.cxx AliL3RawDataFileHandler.cxx + +ifeq ($(ARCH),Darwin) +EXTRA_SRCS = AliL3HoughTrack.cxx AliL3ModelTrack.cxx \ + AliL3DataCompressorHelper.cxx AliL3DataHandler.cxx \ + AliL3TransBit.cxx AliL3DDLDataFileHandler.cxx +endif + +SRCS += $(EXTRA_SRCS) ifeq ($(ALIHLT_USEPACKAGE),ROOT) SRCS += AliL3Display.cxx