From 5578cf606b0f9c5a72de0bee37ebfb2428a75d0e Mon Sep 17 00:00:00 2001 From: richterm Date: Thu, 20 Sep 2007 09:04:59 +0000 Subject: [PATCH] - all digit raw data structures added to AliHLTTPCDigitData.h - AliHLTTPCRawDataFormat.h depricated - TPC agent added - TPCDigitPublisher added - FileHandler and MemHandler cleaned/documented - FileHandler enhanced to read AliRoot digit data into buffer - depricated files removed from the projects (old steering class, depricated CF) --- HLT/TPCLib/AliHLTTPC.cxx | 670 ------------------ HLT/TPCLib/AliHLTTPC.h | 131 ---- HLT/TPCLib/AliHLTTPCAgent.cxx | 75 ++ HLT/TPCLib/AliHLTTPCAgent.h | 67 ++ HLT/TPCLib/AliHLTTPCClustFinderNew.cxx | 505 ------------- HLT/TPCLib/AliHLTTPCClustFinderNew.h | 79 --- .../AliHLTTPCClusterFinderComponent.cxx | 1 - HLT/TPCLib/AliHLTTPCDigitData.h | 54 +- HLT/TPCLib/AliHLTTPCDigitReaderUnpacked.cxx | 1 - HLT/TPCLib/AliHLTTPCFileHandler.cxx | 96 ++- HLT/TPCLib/AliHLTTPCFileHandler.h | 93 ++- HLT/TPCLib/AliHLTTPCMemHandler.cxx | 73 +- HLT/TPCLib/AliHLTTPCMemHandler.h | 53 +- HLT/TPCLib/AliHLTTPCRawDataFormat.h | 31 - .../AliHLTTPCRawDataUnpackerComponent.cxx | 1 - HLT/TPCLib/legacy.txt | 10 + HLT/libAliHLTTPC.pkg | 5 +- 17 files changed, 437 insertions(+), 1508 deletions(-) delete mode 100644 HLT/TPCLib/AliHLTTPC.cxx delete mode 100644 HLT/TPCLib/AliHLTTPC.h create mode 100644 HLT/TPCLib/AliHLTTPCAgent.cxx create mode 100644 HLT/TPCLib/AliHLTTPCAgent.h delete mode 100644 HLT/TPCLib/AliHLTTPCClustFinderNew.cxx delete mode 100644 HLT/TPCLib/AliHLTTPCClustFinderNew.h delete mode 100644 HLT/TPCLib/AliHLTTPCRawDataFormat.h create mode 100644 HLT/TPCLib/legacy.txt diff --git a/HLT/TPCLib/AliHLTTPC.cxx b/HLT/TPCLib/AliHLTTPC.cxx deleted file mode 100644 index ddabe9583ba..00000000000 --- a/HLT/TPCLib/AliHLTTPC.cxx +++ /dev/null @@ -1,670 +0,0 @@ -// @(#) $Id$ -// Original: AliLevel3.cxx,v 1.42 2004/06/11 16:06:33 loizides - -// Author: Anders Vestbo , Uli Frankenfeld -//*-- Copyright © ALICE HLT Group - -#ifndef no_root -#include -#include -#include -#include -#endif - -#include - -#include "AliHLTTPCLogging.h" -#include "AliHLTTPC.h" -#include "AliHLTTPCConfMapper.h" -#include "AliHLTTPCVertex.h" -#include "AliHLTTPCVertexFinder.h" -#include "AliHLTTPCTrackMerger.h" -#include "AliHLTTPCGlobalMerger.h" -#include "AliHLTTPCInterMerger.h" -#include "AliHLTTPCConfMapPoint.h" -#include "AliHLTTPCConfMapTrack.h" -#include "AliHLTTPCTransform.h" -#include "AliHLTTPCClusterFinder.h" -#include "AliHLTTPCDigitReaderUnpacked.h" -#include "AliHLTTPCDigitData.h" -#include "AliHLTTPCTrackArray.h" -#include "AliHLTTPCMemHandler.h" -#include "AliHLTTPCFitter.h" -#include "AliHLTTPCFileHandler.h" -#include "AliHLTTPCBenchmark.h" -#include "AliHLTTPCDigitData.h" -#include "AliHLTTPCTrackSegmentData.h" -#include "AliHLTTPCSpacePointData.h" -#include "AliHLTTPCVertexData.h" -//#include "AliHLTTPCDDLDataFileHandler.h" - -/** \class AliHLTTPC -
-//_____________________________________________________________
-//
-//  AliHLTTPC
-//
-//  Interface class for HLTTPC tracker.
-//  For example how to use, see exa/runtracker.C (root)
-//  or programs/runtracker.cxx (standalone program).
-//Begin_Html 
-//
-//End_Html
-
-*/ - -ClassImp(AliHLTTPC) - -AliHLTTPC::AliHLTTPC() -{ - //Default constructor. Should also be used when input is from binary files. - //In that case the path to where the binary files are located has to be - //passed to the AliLevel::Init function. - - fVertexFinder=0; - fVertex=0; - fTracker=0; - fTrackMerger=0; - fInterMerger=0; - fFileHandler=0; - fGlobalMerger=0; - fInputFile=0; - fRunLoader=0; -} - -AliHLTTPC::AliHLTTPC(Char_t *infile) -{ - //Constructor to use for when input is anything else but binary files, - //meaning rootfiles or raw files. - - fVertexFinder=0; - fVertex=0; - fTracker=0; - fTrackMerger=0; - fInterMerger=0; - fFileHandler=0; - fGlobalMerger=0; - fInputFile = infile; - fRunLoader=0; -} - -AliHLTTPC::AliHLTTPC(AliRunLoader *rl) -{ - //Constructor to use when input is aliroot runloader - fVertexFinder=0; - fVertex=0; - fTracker=0; - fTrackMerger=0; - fInterMerger=0; - fFileHandler=0; - fGlobalMerger=0; - fInputFile=0; - fRunLoader = rl; -} - -Bool_t AliHLTTPC::fgDoVertexFit = kTRUE;//Include the vertex in the final track fit - -void AliHLTTPC::Init(Char_t *path,EFileType filetype,Int_t npatches) -{ - //Init the whole standard tracker chain - - if((filetype!=kBinary) && (filetype!=kDate) - && (filetype!=kRunLoader)&& !fInputFile) - { - LOG(AliHLTTPCLog::kError,"AliHLTTPC::Init","Files") - <<"You have not supplied the input rootfile; use the appropriate ctor!"<SetAliInput(fInputFile); - }else if(filetype==kRaw){ - LOG(AliHLTTPCLog::kFatal,"AliHLTTPC::Init","Files") - <<"AliHLTTPCDDLDataFileHandler not available in this build"<SetReaderInput(fInputFile); - }else if(filetype==kDate){ - LOG(AliHLTTPCLog::kFatal,"AliHLTTPC::Init","Files") - <<"AliHLTTPCDDLDataFileHandler not available in this build"<SetReaderInput(fInputFile,-1); - } - else if(filetype==kRunLoader){ - fFileHandler = new AliHLTTPCFileHandler(kTRUE); //static version - fFileHandler->SetAliInput(fRunLoader); - } - else{ - fFileHandler = new AliHLTTPCMemHandler(); - } - fBenchmark = new AliHLTTPCBenchmark(); -} - -void AliHLTTPC::DoBench(char* name) -{ - //dobench - fBenchmark->Analyze(name); - delete fBenchmark; - fBenchmark = new AliHLTTPCBenchmark(); -} - -void AliHLTTPC::DoMc(char* file) -{ - //domc - if(!fFileHandler->IsDigit(fEvent)) - fFileHandler->SetMCOutput(file); -} - -AliHLTTPC::~AliHLTTPC() -{ - //Destructor - if(fVertexFinder) delete fVertexFinder; - if(fVertex) delete fVertex; - if(fTracker) delete fTracker; - if(fTrackMerger) delete fTrackMerger; - if(fInterMerger) delete fInterMerger; - if(fFileHandler) delete fFileHandler; - if(fGlobalMerger) delete fGlobalMerger; -} - -void AliHLTTPC::SetClusterFinderParam(Float_t fXYError, Float_t fZError, Bool_t deconv) -{ - //set cluster finder parameter - fXYClusterError=fXYError; - fZClusterError=fZError; - fClusterDeconv=deconv; -} - -void AliHLTTPC::SetTrackerParam(Int_t phi_segments, Int_t eta_segments, - Int_t trackletlength, Int_t tracklength, - Int_t rowscopetracklet, Int_t rowscopetrack, - 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) -{ - //Set parameters input to the tracker - //If no arguments are given, default parameters will be used - - fTracker->SetNSegments(phi_segments,eta_segments); - fTracker->SetMaxDca(min_pt_fit); - fTracker->SetTrackCuts(hitChi2Cut,goodHitChi2,trackChi2Cut,maxdist,vertexconstraint); - fTracker->SetTrackletCuts(maxangle,goodDist,vertexconstraint); - if(vertexconstraint) - fTracker->MainVertexSettings(trackletlength,tracklength,rowscopetracklet,rowscopetrack,maxphi,maxeta); - else - fTracker->NonVertexSettings(trackletlength,tracklength,rowscopetracklet,rowscopetrack); - fTracker->InitVolumes(); -} - -void AliHLTTPC::SetMergerParameters(Double_t maxy,Double_t maxz,Double_t maxkappa,Double_t maxpsi,Double_t maxtgl) -{ - //set global merger parameter - fGlobalMerger->SetParameter(maxy,maxz,maxkappa,maxpsi,maxtgl); -} - -void AliHLTTPC::ProcessEvent(Int_t first,Int_t last,Int_t event) -{ - //Do tracking on all slices in region [first,last] - //Slices numbering in TPC goes from 0-35, which means that one slice - //corresponds to inner+outer sector.E.g. slice 2 corresponds to - //inner=2 + outer=38. - - fGlobalMerger->Setup(first,last); - if(fEvent!=event) AliHLTTPCFileHandler::CleanStaticIndex(); - fEvent=event; - for(Int_t i=first; i<=last; i++){ - ProcessSlice(i); - fGlobalMerger->SetVertex(fVertex); - fGlobalMerger->InitSlice(i); - fGlobalMerger->FillTracks(fNTrackData,fTrackData); - fFileHandler->Free(); //free the memory - fNTrackData=0; - fTrackData=0; - } - fBenchmark->Start("Global track merger"); - //fGlobalMerger->AddAllTracks(); - fGlobalMerger->Merge(); - //fGlobalMerger->SlowMerge(fWriteOutPath); - fBenchmark->Stop("Global track merger"); - - FitGlobalTracks(); - - if(fWriteOut) WriteResults(); - fFileHandler->FreeDigitsTree(); -} - -void AliHLTTPC::ProcessSlice(Int_t slice) -{ - //process slice - char name[256]; - Bool_t UseCF = kFALSE; - UseCF = fFileHandler->IsDigit(fEvent); - if(fUseBinary) - UseCF = kTRUE; //In case you are not using aliroot - if(fNoCF == kTRUE) //In case you don't want to run with cluster finder - UseCF = kFALSE; - - const Int_t kmaxpoints=120000; - const Int_t kpointsize = kmaxpoints * sizeof(AliHLTTPCSpacePointData); - AliHLTTPCMemHandler *memory = new AliHLTTPCMemHandler(); - - fTrackMerger->Reset(); - fTrackMerger->SetRows(fRow[0]); - - for(Int_t patch=fNPatch-1;patch>=0;patch--){ - fFileHandler->Init(slice,patch,&fRow[patch][0]); - UInt_t npoints=0; - AliHLTTPCSpacePointData *points =0; - UInt_t ndigits=0; - AliHLTTPCDigitRowData *digits =0; - UInt_t digitSize = 0; - if(UseCF){ - if(fUseBinary) { - if(!fDoRoi) { - if(1){ //Binary to Memory - fFileHandler->Free(); - if(fNPatch == 1) - sprintf(name,"%sdigits_%d_%d_%d.raw",fPath,fEvent,slice,-1); - else - sprintf(name,"%sdigits_%d_%d_%d.raw",fPath,fEvent,slice,patch); - if(!fFileHandler->SetBinaryInput(name)) return; - if(fPileUp) - { //Read binary files which are not RLE - digits = (AliHLTTPCDigitRowData*)fFileHandler->Allocate(); - fFileHandler->Binary2Memory(ndigits,digits, digitSize ); - digitSize = fFileHandler->GetFileSize(); - } - else //Read RLE binary files - { - digits= (AliHLTTPCDigitRowData *)fFileHandler->CompBinary2Memory(ndigits, digitSize); - } - - fFileHandler->CloseBinaryInput(); - } - - if(0){ //Binary to Memory with Benchmark - fFileHandler->Free(); - if(fNPatch == 1) - sprintf(name,"%sdigits_%d_%d_%d.raw",fPath,fEvent,slice,-1); - else - sprintf(name,"%sdigits_%d_%d_%d.raw",fPath,fEvent,slice,patch); - if(!memory->SetBinaryInput(name)) return; - UInt_t compsize=memory->GetFileSize(); - UInt_t *comp=(UInt_t *)memory->Allocate(compsize); - memory->CompBinary2CompMemory(ndigits,comp); - memory->CloseBinaryInput(); - UInt_t datasize=memory->GetMemorySize(ndigits,comp); - digits=(AliHLTTPCDigitRowData *)fFileHandler->Allocate(datasize); - fBenchmark->Start("Unpacker"); - fFileHandler->CompMemory2Memory(ndigits,digits,comp,digitSize); - fBenchmark->Stop("Unpacker"); - memory->Free(); - } - - if(0){ //Binary to Memory with Random - fFileHandler->Free(); - fFileHandler->ResetRandom(); - fFileHandler->SetRandomCluster(100); - fFileHandler->SetNGenerate(100); - if(fNPatch == 1) - sprintf(name,"%sdigits_%d_%d_%d.raw",fPath,fEvent,slice,-1); - else - sprintf(name,"%sdigits_%d_%d_%d.raw",fPath,fEvent,slice,patch); - if(!memory->SetBinaryInput(name)) return; - UInt_t compsize=memory->GetFileSize(); - UInt_t *comp=(UInt_t *)memory->Allocate(compsize); - memory->CompBinary2CompMemory(ndigits,comp); - memory->CloseBinaryInput(); - UInt_t dsize=memory->GetMemorySize(ndigits,comp); - UInt_t rsize=fFileHandler->GetRandomSize(); - digits=(AliHLTTPCDigitRowData*)fFileHandler->Allocate(dsize+rsize); - fBenchmark->Start("Unpacker"); - fFileHandler->CompMemory2Memory(ndigits,digits,comp,digitSize); - fBenchmark->Stop("Unpacker"); - memory->Free(); - } - } - - else{ //Binary to Memory with Roi - fFileHandler->Free(); - Int_t sli[2]={0,0}; - fFileHandler->SetROI(fEta,sli); - if(fNPatch==1) - sprintf(name,"%sdigits_%d_%d_%d.raw",fPath,fEvent,slice,-1); - else - sprintf(name,"%sdigits_%d_%d_%d.raw",fPath,fEvent,slice,patch); - if(!memory->SetBinaryInput(name)) return; - UInt_t compsize=memory->GetFileSize(); - UInt_t *comp=(UInt_t *)memory->Allocate(compsize); - memory->CompBinary2CompMemory(ndigits,comp); - memory->CloseBinaryInput(); - UInt_t datasize=memory->GetMemorySize(ndigits,comp); - digits=(AliHLTTPCDigitRowData *)fFileHandler->Allocate(datasize); - fBenchmark->Start("Unpacker"); - datasize = fFileHandler->CompMemory2Memory(ndigits,digits,comp,digitSize); - fBenchmark->Stop("Unpacker"); - memory->Free(); - } - }//end UseBinary - else{ - fBenchmark->Start("Dummy Unpacker"); - if(fNPatch==1) - sprintf(name,"digits_%d_%d_%d.raw",fEvent,slice,-1); - else - sprintf(name,"digits_%d_%d_%d.raw",fEvent,slice,patch); - fBenchmark->Stop("Dummy Unpacker"); - - if(0){ //Ali to Binary - fFileHandler->SetBinaryOutput(name); - fFileHandler->AliDigits2CompBinary(); - fFileHandler->CloseBinaryOutput(); - } - - if(1){ //Ali to Memory - digits=(AliHLTTPCDigitRowData *)fFileHandler->AliAltroDigits2Memory(ndigits,fEvent); - if(0){ //Memory to Binary - fFileHandler->SetBinaryOutput(name); - fFileHandler->Memory2CompBinary(ndigits,digits); - fFileHandler->CloseBinaryOutput(); - } - } - }//end else UseBinary - - points = (AliHLTTPCSpacePointData *) memory->Allocate(kpointsize); - fClusterFinder = new AliHLTTPCClusterFinder(); - fDigitReader = new AliHLTTPCDigitReaderUnpacked(); - fClusterFinder->InitSlice(slice,patch,fRow[patch][0],fRow[patch][1],kmaxpoints); - fClusterFinder->SetDeconv(fClusterDeconv); - fClusterFinder->SetXYError(fXYClusterError); - fClusterFinder->SetZError(fZClusterError); - if((fXYClusterError>0)&&(fZClusterError>0)) - fClusterFinder->SetCalcErr(kFALSE); - fClusterFinder->SetOutputArray(points); - fClusterFinder->SetReader( fDigitReader ); - fBenchmark->Start("Cluster finder"); - //fClusterFinder->Read(ndigits,digits); - fClusterFinder->Read( (void*)digits, (unsigned long) digitSize ); - fClusterFinder->ProcessDigits(); - fBenchmark->Stop("Cluster finder"); - npoints = fClusterFinder->GetNumberOfClusters(); - delete fClusterFinder; - fClusterFinder = 0; - fFileHandler->Free(); - LOG(AliHLTTPCLog::kInformational,"AliHLTTPC::ProcessSlice","Cluster Finder") - <Free(); - if(fNPatch==1) - sprintf(name,"%s/points_%d_%d_%d.raw",fPath,fEvent,slice,-1); - else - sprintf(name,"%s/points_%d_%d_%d.raw",fPath,fEvent,slice,patch); - if(!memory->SetBinaryInput(name)) return; - points = (AliHLTTPCSpacePointData *) memory->Allocate(); - memory->Binary2Memory(npoints,points); - memory->CloseBinaryInput(); - LOG(AliHLTTPCLog::kInformational,"AliHLTTPC::ProcessSlice","Read Cluster") - <AliPoints2Memory(npoints); - } - fBenchmark->Start("Dummy Unpacker"); - fBenchmark->Stop("Dummy Unpacker"); - fBenchmark->Start("Dummy CF"); - fBenchmark->Stop("Dummy CF"); - } - - if(patch == fNPatch-1){ - // Vertex - if(fFindVertex){ - // Vertex Finder - - fBenchmark->Start("Vertex Finder Read"); - fVertexFinder->Reset(); - fVertexFinder->Read(npoints,points); - fBenchmark->Stop("Vertex Finder Read"); - fBenchmark->Start("Vertex Finder"); - fVertexFinder->Analyze(); - AliHLTTPCVertexData vertex[1]; - fVertexFinder->Write(vertex); - fVertex->Read(vertex); - fBenchmark->Stop("Vertex Finder"); - } - else{ - //use 0,0,0 for vertex - fVertex->SetZero(); - } - fTrackMerger->SetVertex(fVertex); - } - - fTracker->InitSector(slice,fRow[patch],fEta); - fTracker->SetVertex(fVertex); - fBenchmark->Start("Tracker setup"); - fTracker->ReadHits(npoints,points); - fTracker->MainVertexTracking_a(); - fBenchmark->Stop("Tracker setup"); - fBenchmark->Start("Track follower"); - fTracker->MainVertexTracking_b(); - fBenchmark->Stop("Track follower"); - if(fDoNonVertex) - fTracker->NonVertexTracking();//Do a second pass for nonvertex tracks - fBenchmark->Start("Sector track fitting"); - fTracker->FillTracks(); - fBenchmark->Stop("Sector track fitting"); - - if(fWriteOut) - WriteSpacePoints(npoints, points, slice, patch); //do after Tracking - - //free memory - if(UseCF) - memory->Free(); - else - fFileHandler->Free(); - - UInt_t ntracks0 =0; - AliHLTTPCTrackSegmentData *trackdata0 = - (AliHLTTPCTrackSegmentData *) memory->Allocate(fTracker->GetTracks()); - memory->TrackArray2Memory(ntracks0,trackdata0,fTracker->GetTracks()); - - //write tracks - if(fWriteOut){ - if(fNPatch==1) - sprintf(name,"%s/tracks_tr_%d_%d_%d.raw",fWriteOutPath,fEvent,slice,-1); - else - sprintf(name,"%s/tracks_tr_%d_%d_%d.raw",fWriteOutPath,fEvent,slice,patch); - memory->SetBinaryOutput(name); - memory->Memory2Binary(ntracks0,trackdata0); - memory->CloseBinaryOutput(); - } - - fInterMerger->Reset(); - fInterMerger->Init(fRow[patch],patch); - - fInterMerger->FillTracks(ntracks0,trackdata0); - - //fBenchmark->Start("Inter Merger"); - // fInterMerger->Merge(); - // fInterMerger->SlowMerge(); - - //fBenchmark->Stop("Inter Merger"); - /* - //write inter merged tracks - if(fWriteOut){ - sprintf(name,"%stracks_im_%d_%d.raw",fWriteOutPath,slice,patch); - WriteTracks(name,fInterMerger,'i'); //write output of intermerger - } - */ - memory->Free(); - - UInt_t ntracks1 =0; - AliHLTTPCTrackSegmentData *trackdata1 = - (AliHLTTPCTrackSegmentData *) memory->Allocate(fInterMerger->GetInTracks(0)); - memory->TrackArray2Memory(ntracks1,trackdata1,fInterMerger->GetInTracks(0)); - - fTrackMerger->InitSector(slice,patch); - fTrackMerger->FillTracks(ntracks1,trackdata1); - - memory->Free(); - } - //fBenchmark->Start("Patch Merger"); - //fTrackMerger->SlowMerge(); - fTrackMerger->AddAllTracks(); - //fTrackMerger->Merge(); - //fBenchmark->Stop("Patch Merger"); - /* - //write merged tracks - if(fWriteOut){ - sprintf(name,"%stracks_tm_%d.raw",fWriteOutPath,slice); - WriteTracks(name,fTrackMerger,'o'); //write output of trackmerger - } - */ - fTrackData = (AliHLTTPCTrackSegmentData *) - fFileHandler->Allocate(fTrackMerger->GetOutTracks()); - - fFileHandler->TrackArray2Memory(fNTrackData,fTrackData, - fTrackMerger->GetOutTracks()); - - delete memory; -} - -void AliHLTTPC::FitGlobalTracks() -{ - //fit global tracks - AliHLTTPCFitter *fitter = new AliHLTTPCFitter(fVertex,AliHLTTPC::DoVertexFit()); - if(fNPatch==1) - fitter->LoadClusters(fWriteOutPath,fEvent,kTRUE); - else - fitter->LoadClusters(fWriteOutPath,fEvent,kFALSE); - - fBenchmark->Start("Global track fitter"); - AliHLTTPCTrackArray *tracks = fGlobalMerger->GetOutTracks(); - for(Int_t i=0; iGetNTracks(); i++) - { - AliHLTTPCTrack *tr = tracks->GetCheckedTrack(i); - if(!tr) continue; - fitter->FitHelix(tr); - tr->UpdateToFirstPoint(); - } - fBenchmark->Stop("Global track fitter"); - delete fitter; -} - -void AliHLTTPC::WriteSpacePoints(UInt_t npoints,AliHLTTPCSpacePointData *points, - Int_t slice,Int_t patch) const -{ - //write space points - char name[256]; - if(fNPatch==1) - sprintf(name,"%s/points_%d_%d_%d.raw",fWriteOutPath,fEvent,slice,-1); - else - sprintf(name,"%s/points_%d_%d_%d.raw",fWriteOutPath,fEvent,slice,patch); - AliHLTTPCMemHandler * memory = new AliHLTTPCMemHandler(); - memory->SetBinaryOutput(name); - memory->Transform(npoints,points,slice); - memory->Memory2Binary(npoints,points); - memory->CloseBinaryOutput(); - delete memory; -} - -Int_t AliHLTTPC::WriteTracks(char *filename,AliHLTTPCMerger *merger,char opt) const -{ - //write tracks - AliHLTTPCMemHandler *memory = new AliHLTTPCMemHandler(); - memory->SetBinaryOutput(filename); - if(opt=='a'||opt=='i'){ //add intracks - for(Int_t i=0;iGetNIn();i++){ - AliHLTTPCTrackArray *tr=merger->GetInTracks(i); - memory->TrackArray2Binary(tr); - } - } - - if(opt=='o'||opt=='a'){ - AliHLTTPCTrackArray *tr=merger->GetOutTracks(); - memory->TrackArray2Binary(tr); - } - - memory->CloseBinaryOutput(); - delete memory; - return 1; -} - -void AliHLTTPC::WriteResults() -{ - //Write the resulting tracks to outputfile - Char_t fname[256]; - sprintf(fname,"%s/tracks_%d.raw",fWriteOutPath,fEvent); - WriteTracks(fname,fGlobalMerger,'a'); - //WriteTracks("tracks.raw",fGlobalMerger,'a'); - sprintf(fname,"%s/tracks_gl_%d.raw",fWriteOutPath,fEvent); - WriteTracks(fname,fGlobalMerger,'o'); - //WriteTracks("tracks_gl.raw",fGlobalMerger,'o'); -} diff --git a/HLT/TPCLib/AliHLTTPC.h b/HLT/TPCLib/AliHLTTPC.h deleted file mode 100644 index bd69632a892..00000000000 --- a/HLT/TPCLib/AliHLTTPC.h +++ /dev/null @@ -1,131 +0,0 @@ -// @(#) $Id$ -// Original: AliLevel3.h,v 1.24 2004/06/11 16:06:33 loizides - -#ifndef ALIHLTTPC_H -#define ALIHLTTPC_H - -#ifndef no_root -#include -#include -#endif - -class AliRunLoader; - -#include "AliHLTTPCDigitData.h" -#include "AliHLTTPCRootTypes.h" - -class AliHLTTPCSpacePointData; -class AliHLTTPCDigitRowData; -class AliHLTTPCTrackSegmentData; -class AliHLTTPCDigitData; -class AliHLTTPCConfMapper; -class AliHLTTPCVertex; -class AliHLTTPCVertexFinder; -class AliHLTTPCTrackMerger; -class AliHLTTPCGlobalMerger; -#ifndef no_root -class TDirectory; -#endif -class AliHLTTPCClusterFinder; -class AliHLTTPCDigitReaderUnpacked; -class AliHLTTPCMerger; -class AliHLTTPCInterMerger; -class AliHLTTPCFileHandler; -class AliHLTTPCMemHandler; -class AliHLTTPCBenchmark; - -#ifdef no_root -class AliHLTTPC { -#else -class AliHLTTPC : public TObject { -#endif - - private: - UInt_t fNTrackData; //count data - AliHLTTPCTrackSegmentData* fTrackData; //! - AliHLTTPCConfMapper *fTracker; //! - AliHLTTPCVertex *fVertex; //! - AliHLTTPCVertexFinder *fVertexFinder; //! - AliHLTTPCTrackMerger *fTrackMerger; //! - AliHLTTPCGlobalMerger *fGlobalMerger; //! - AliHLTTPCInterMerger *fInterMerger; //! - AliHLTTPCClusterFinder *fClusterFinder; //! - AliHLTTPCDigitReaderUnpacked* fDigitReader; //! - AliHLTTPCMemHandler *fFileHandler; //! - AliHLTTPCBenchmark *fBenchmark;//! - - Int_t fEvent; //event number - Int_t fNPatch; //number of patches - Int_t fRow[6][2];//rows - Float_t fEta[2]; //eta - - Char_t *fInputFile;//! - AliRunLoader *fRunLoader; //runloader - Char_t fPath[256]; //path to aliroot - Char_t fWriteOutPath[256]; //path to store - - Bool_t fDoRoi; //do region of interest - Bool_t fFindVertex; //find vertex - Bool_t fDoNonVertex;//do non vertex pass - Bool_t fPileUp; //do pileup - Bool_t fNoCF; //dont do cluster finder - - Bool_t fUseBinary; //use binary input - Bool_t fWriteOut; //write tracks - - static Bool_t fgDoVertexFit; //do vertex fix - - Bool_t fClusterDeconv; //do cluster deconv - Float_t fXYClusterError; //Cluster error - Float_t fZClusterError; //Cluster error - - void WriteSpacePoints(UInt_t npoints,AliHLTTPCSpacePointData *points, - Int_t slice,Int_t patch) const; - Int_t WriteTracks(char *filename,AliHLTTPCMerger *merger,char opt='o') const; - void WriteResults(); - void FitGlobalTracks(); - void SetPath(char *p){sprintf(fPath,"%s",p);} - - public: - AliHLTTPC (); - AliHLTTPC(Char_t *infile); - AliHLTTPC(AliRunLoader *rl); - virtual ~AliHLTTPC(); - enum EFileType {kBinary, kBinary8, kRoot, kRaw, kDate, kRunLoader}; - void Init(Char_t *path,EFileType filetype=kBinary,Int_t npatches=6); - void SetMergerParameters(Double_t maxy=1.2,Double_t maxz=1.6,Double_t maxkappa=0.003, - Double_t maxpsi=0.02,Double_t maxtgl=0.03); - void SetTrackerParam(Int_t phi_segments=50,Int_t eta_segments=100, - Int_t trackletlength=3,Int_t tracklength=5, - Int_t rowscopetracklet=2,Int_t rowscopetrack=3, - Double_t min_pt_fit=0,Double_t maxangle=1.31, - Double_t goodDist=5,Double_t hitChi2Cut=10, - Double_t goodHitChi2=20,Double_t trackChi2Cut=50, - Int_t maxdist=50,Double_t maxphi=0.1,Double_t maxeta=0.1, - Bool_t vertexconstraint=kTRUE); - void SetClusterFinderParam(Float_t fXYError=0.2,Float_t fZError=0.3,Bool_t deconv=kTRUE); - - void ProcessEvent(Int_t first,Int_t last,Int_t event=0); - void ProcessSlice(Int_t slice); - - void DoMc(char* file="point_mc.dat"); - void DoNonVertexTracking() {fDoNonVertex=kTRUE;} - void FindVertex() {fFindVertex=kTRUE;} - void DoBench(char* name="benchmark"); - void DoPileup() {fPileUp = kTRUE;} - void NoCF() {fNoCF=kTRUE;} - void DoRoi(Float_t e0=0.4,Float_t e1=0.5){fEta[0]=e0;fEta[1]=e1;fDoRoi=kTRUE;} - void WriteFiles(Char_t *path="./"){fWriteOut = kTRUE; sprintf(fWriteOutPath,"%s",path);} - - static void SetVertexFit(Bool_t f) {fgDoVertexFit=f;} - static Bool_t DoVertexFit() {return fgDoVertexFit;} - - ClassDef(AliHLTTPC,1) //Interface class for HLTTPC-tracking -}; - -#endif - - - - - diff --git a/HLT/TPCLib/AliHLTTPCAgent.cxx b/HLT/TPCLib/AliHLTTPCAgent.cxx new file mode 100644 index 00000000000..d326c83fa9c --- /dev/null +++ b/HLT/TPCLib/AliHLTTPCAgent.cxx @@ -0,0 +1,75 @@ +// @(#) $Id$ + +/************************************************************************** + * This file is property of and copyright by the ALICE HLT Project * + * ALICE Experiment at CERN, All rights reserved. * + * * + * Primary Authors: Matthias Richter * + * for The ALICE HLT Project. * + * * + * Permission to use, copy, modify and distribute this software and its * + * documentation strictly for non-commercial purposes is hereby granted * + * without fee, provided that the above copyright notice appears in all * + * copies and that both the copyright notice and this permission notice * + * appear in the supporting documentation. The authors make no claims * + * about the suitability of this software for any purpose. It is * + * provided "as is" without express or implied warranty. * + **************************************************************************/ + +/** @file AliHLTTPCAgent.cxx + @author Matthias Richter + @date + @brief Agent of the libAliHLTTPC library +*/ + +#include "AliHLTTPCAgent.h" +#include "AliHLTConfiguration.h" + +/** global instance for agent registration */ +AliHLTTPCAgent gAliHLTTPCAgent; + +/** ROOT macro for the implementation of ROOT specific class methods */ +ClassImp(AliHLTTPCAgent) + +AliHLTTPCAgent::AliHLTTPCAgent() +{ + // see header file for class documentation + // or + // refer to README to build package + // or + // visit http://web.ift.uib.no/~kjeks/doc/alice-hlt +} + +AliHLTTPCAgent::~AliHLTTPCAgent() +{ + // see header file for class documentation +} + +int AliHLTTPCAgent::CreateConfigurations(AliHLTConfigurationHandler* handler, + AliRunLoader* runloader) const +{ + // see header file for class documentation + if (handler) { + // digit publisher configuration + TString arg("-slice 0 -partition 0"); + HLTDebug(arg.Data()); + handler->CreateConfiguration("digit-publisher" , "TPCDigitPublisher", NULL , arg.Data()); + + // the writer configuration + handler->CreateConfiguration("sink1", "FileWriter" , "digit-publisher" , NULL); + } + return 0; +} + +const char* AliHLTTPCAgent::GetLocalRecConfigurations(AliRunLoader* runloader) const +{ + // see header file for class documentation + return NULL; + //return "sink1"; +} + +const char* AliHLTTPCAgent::GetRequiredComponentLibraries() const +{ + // see header file for class documentation + return NULL; +} diff --git a/HLT/TPCLib/AliHLTTPCAgent.h b/HLT/TPCLib/AliHLTTPCAgent.h new file mode 100644 index 00000000000..af07b83e719 --- /dev/null +++ b/HLT/TPCLib/AliHLTTPCAgent.h @@ -0,0 +1,67 @@ +// @(#) $Id$ + +#ifndef ALIHLTTPCAGENT_H +#define ALIHLTTPCAGENT_H +/* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. * + * See cxx source for full Copyright notice */ + +/** @file AliHLTTPCAgent.h + @author Matthias Richter + @date + @brief Agent of the libAliHLTTPC library +*/ + +#include "AliHLTModuleAgent.h" + +/** + * @class AliHLTTPCAgent + * This is the agent for the AliHLTTPC library. + * + * @ingroup alihlt_system + */ +class AliHLTTPCAgent : public AliHLTModuleAgent { + public: + /** + * standard constructor. The agent is automatically registered in the + * global agent manager + */ + AliHLTTPCAgent(); + /** destructor */ + virtual ~AliHLTTPCAgent(); + + /** + * Register all configurations belonging to this module with the + * AliHLTConfigurationHandler. The agent can adapt the configurations + * to be registered to the current AliRoot setup by checking the + * runloader. + * @param handler the configuration handler + * @param runloader AliRoot runloader + * @return neg. error code if failed + */ + int CreateConfigurations(AliHLTConfigurationHandler* handler, + AliRunLoader* runloader=NULL) const; + + /** + * Get the top configurations belonging to this module. + * A top configuration describes a processing chain. It can simply be + * described by the last configuration(s) in the chain. + * The agent can adapt the configurations to be registered to the current + * AliRoot setup by checking the runloader. + * @param runloader AliRoot runloader + * @return number of configurations, neg. error code if failed + */ + const char* GetLocalRecConfigurations(AliRunLoader* runloader=NULL) const; + + /** + * Component libraries which the configurations of this agent depend on. + * @return list of component libraries as a blank-separated string. + */ + const char* GetRequiredComponentLibraries() const; + + protected: + + private: + ClassDef(AliHLTTPCAgent, 0); +}; + +#endif diff --git a/HLT/TPCLib/AliHLTTPCClustFinderNew.cxx b/HLT/TPCLib/AliHLTTPCClustFinderNew.cxx deleted file mode 100644 index 68da982e028..00000000000 --- a/HLT/TPCLib/AliHLTTPCClustFinderNew.cxx +++ /dev/null @@ -1,505 +0,0 @@ -// @(#) $Id$ -//Original: AliHLTClustFinderNew.cxx,v 1.29 2005/06/14 10:55:21 cvetan - -// Author: Anders Vestbo , Constantin Loizides -//*-- Copyright © ALICE HLT Group - -#include "AliHLTTPCRootTypes.h" -#include "AliHLTTPCLogging.h" -#include "AliHLTTPCClustFinderNew.h" -#include "AliHLTTPCDigitData.h" -#include "AliHLTTPCTransform.h" -#include "AliHLTTPCSpacePointData.h" -#include "AliHLTTPCMemHandler.h" - -#if __GNUC__ >= 3 -using namespace std; -#endif - -/** \class AliHLTTPCClustFinderNew -
-//_____________________________________________________________
-// AliHLTTPCClustFinderNew
-//
-// The current cluster finder for HLT
-// (Based on STAR L3)
-// 
-// The cluster finder is initialized with the Init function, 
-// providing the slice and patch information to work on. 
-// The input is a AliHLTTPCDigitRowData structure using the 
-// Read function. The resulting space points will be in the
-// array given by the SetOutputArray function.
-// 
-// There are several setters which control the behaviour:
-//
-// - SetXYError(Float_t):   set fixed error in XY direction
-// - SetZError(Float_t):    set fixed error in Z  direction
-//                            (used if errors are not calculated) 
-// - SetDeconv(Bool_t):     switch on/off deconvolution
-// - SetThreshold(UInt_t):  set charge threshold for cluster
-// - SetMatchWidth(UInt_t): set the match distance in 
-//                            time for sequences to be merged 
-// - SetSTDOutput(Bool_t):  switch on/off output about found clusters   
-// - SetCalcErr(Bool_t):    switch on/off calculation of 
-//                          space point errors (or widths in raw system)
-// - SetRawSP(Bool_t):      switch on/off convertion to raw system
-//
-//
-// Example Usage:
-//
-// AliHLTTPCFileHandler *file = new AliHLTTPCFileHandler();
-// file->SetAliInput(digitfile); //give some input file
-// for(int slice=0; slice<=35; slice++){
-//   for(int patch=0; pat<6; pat++){
-//     file->Init(slice,patch);
-//     UInt_t ndigits=0;
-//     UInt_t maxclusters=100000;
-//     UInt_t pointsize = maxclusters*sizeof(AliHLTTPCSpacePointData);
-//     AliHLTTPCSpacePointData *points = (AliHLTTPCSpacePointData*)memory->Allocate(pointsize);
-//     AliHLTTPCDigitRowData *digits = (AliHLTTPCDigitRowData*)file->AliAltroDigits2Memory(ndigits,event);
-//     AliHLTTPCClustFinderNew *cf = new AliHLTTPCClustFinderNew();
-//     cf->SetMatchWidth(2);
-//     cf->InitSlice(slice,patch,maxclusters);
-//     cf->SetSTDOutput(kTRUE);    //Some output to standard IO
-//     cf->SetRawSP(kFALSE);       //Convert space points to local system
-//     cf->SetThreshold(5);        //Threshold of cluster charge
-//     cf->SetDeconv(kTRUE);       //Deconv in pad and time direction
-//     cf->SetCalcErr(kTRUE);      //Calculate the errors of the spacepoints
-//     cf->SetOutputArray(points); //Move the spacepoints to the array
-//     cf->Read(ndigits,digits);   //give the data to the cf
-//     cf->ProcessDigits();        //process the rows given by init
-//     Int_t npoints = cf->GetNumberOfClusters();
-//     AliHLTTPCMemHandler *out= new AliHLTTPCMemHandler();
-//     out->SetBinaryOutput(fname);
-//     out->Memory2Binary(npoints,points); //store the spacepoints
-//     out->CloseBinaryOutput();
-//     delete out;
-//     file->free();
-//     delete cf;
-//   }
-// }
-
-*/ - -ClassImp(AliHLTTPCClustFinderNew) - -AliHLTTPCClustFinderNew::AliHLTTPCClustFinderNew() -{ - //constructor - fMatch = 1; - fThreshold = 10; - fXYErr = 0.2; - fZErr = 0.3; - fDeconvPad = kTRUE; - fDeconvTime = kTRUE; - fStdout = kFALSE; - fCalcerr = kTRUE; - fRawSP = kFALSE; - fFirstRow=0; - fLastRow=0; -} - -AliHLTTPCClustFinderNew::~AliHLTTPCClustFinderNew() -{ - //destructor - ; -} - -void AliHLTTPCClustFinderNew::InitSlice(Int_t slice,Int_t patch,Int_t firstrow, Int_t lastrow,Int_t nmaxpoints) -{ - //init slice - fNClusters = 0; - fMaxNClusters = nmaxpoints; - fCurrentSlice = slice; - fCurrentPatch = patch; - fFirstRow = firstrow; - fLastRow = lastrow; -} - -void AliHLTTPCClustFinderNew::InitSlice(Int_t slice,Int_t patch,Int_t nmaxpoints) -{ - //init slice - fNClusters = 0; - fMaxNClusters = nmaxpoints; - fCurrentSlice = slice; - fCurrentPatch = patch; - fFirstRow=AliHLTTPCTransform::GetFirstRow(patch); - fLastRow=AliHLTTPCTransform::GetLastRow(patch); -} - -void AliHLTTPCClustFinderNew::SetOutputArray(AliHLTTPCSpacePointData *pt) -{ - //set pointer to output - fSpacePointData = pt; -} - -void AliHLTTPCClustFinderNew::Read(UInt_t ndigits,AliHLTTPCDigitRowData *ptr) -{ - //set input pointer - fNDigitRowData = ndigits; - fDigitRowData = ptr; -} - -void AliHLTTPCClustFinderNew::ProcessDigits() -{ - //Loop over rows, and call processrow - AliHLTTPCDigitRowData *tempPt = (AliHLTTPCDigitRowData*)fDigitRowData; - fNClusters = 0; - for(Int_t i=fFirstRow; i<=fLastRow; i++) - { - fCurrentRow = i; - if((Int_t)tempPt->fRow!=fCurrentRow){ - LOG(AliHLTTPCLog::kWarning,"AliHLTTPCClustFinderNew::ProcessDigits","Digits") - <<"Row number should match! "<fRow<<" "<fNDigit*sizeof(AliHLTTPCDigitData); - tmp += size; - tempPt = (AliHLTTPCDigitRowData*)tmp; - } - LOG(AliHLTTPCLog::kInformational,"AliHLTTPCClustFinderNew::ProcessDigits","Space points") - <<"Cluster finder found "<fNDigit; bin++) - { - AliHLTTPCDigitData *data = tempPt->fDigitData; - if(data[bin].fPad != lastpad) - { - //This is a new pad - - //Switch the lists: - if(currentPt == pad2) - { - currentPt = pad1; - previousPt = pad2; - } - else - { - currentPt = pad2; - previousPt = pad1; - } - nprevious = ncurrent; - ncurrent = 0; - if(bin[data].fPad != lastpad+1) - { - //this happens if there is a pad with no signal. - nprevious = ncurrent = 0; - } - lastpad = data[bin].fPad; - } - - Bool_t newcluster = kTRUE; - UInt_t seqcharge=0,seqaverage=0,seqerror=0; - UInt_t lastcharge=0,lastwas_falling=0; - Int_t newbin=-1; - - if(fDeconvTime) - { - redo: //This is a goto. - if(newbin > -1) - { - bin = newbin; - newbin = -1; - } - - lastcharge=0; - lastwas_falling = 0; - } - - while(1) //Loop over current sequence - { - if(data[bin].fTime >= AliHLTTPCTransform::GetNTimeBins()) - { - LOG(AliHLTTPCLog::kFatal,"AliHLTTPCClustFinderNew::ProcessRow","Digits") - <<"Timebin out of range "<<(Int_t)data[bin].fTime< lastcharge) - { - if(lastwas_falling) - { - newbin = bin; - break; - } - } - else lastwas_falling = 1; //last pixel was larger than this - lastcharge = charge; - } - - //Sum the total charge of this sequence - seqcharge += charge; - seqaverage += data[bin].fTime*charge; - seqerror += data[bin].fTime*data[bin].fTime*charge; - - //Check where to stop: - if(bin >= tempPt->fNDigit - 1) //out of range - break; - if(data[bin+1].fPad != data[bin].fPad) //new pad - break; - if(data[bin+1].fTime != data[bin].fTime+1) //end of sequence - break; - - bin++; - }//end loop over sequence - - //Calculate mean of sequence: - Int_t seqmean=0; - if(seqcharge) - seqmean = seqaverage/seqcharge; - else - { - LOG(AliHLTTPCLog::kFatal,"AliHLTTPCClustFinderNew::ProcessRow","Data") - <<"Error in data given to the cluster finder"<fLastMergedPad==data[bin].fPad) continue; - - Int_t difference = seqmean - previousPt[p]->fMean; - if(difference < -fMatch) break; - - if(difference <= fMatch) //There is a match here!! - { - AliClusterData *local = previousPt[p]; - - if(fDeconvPad) - { - if(seqcharge > local->fLastCharge) - { - if(local->fChargeFalling) //The previous pad was falling - { - break; //create a new cluster - } - } - else - local->fChargeFalling = 1; - local->fLastCharge = seqcharge; - } - - //Don't create a new cluster, because we found a match - newcluster = kFALSE; - - //Update cluster on current pad with the matching one: - local->fTotalCharge += seqcharge; - local->fPad += padmean; - local->fPad2 += paderror; - local->fTime += seqaverage; - local->fTime2 += seqerror; - local->fMean = seqmean; - local->fFlags++; //means we have more than one pad - local->fLastMergedPad = data[bin].fPad; - - currentPt[ncurrent] = local; - ncurrent++; - - break; - } //Checking for match at previous pad - } //Loop over results on previous pad. - - if(newcluster) - { - //Start a new cluster. Add it to the clusterlist, and update - //the list of pointers to clusters in current pad. - //current pad will be previous pad on next pad. - - //Add to the clusterlist: - AliClusterData *tmp = &clusterlist[ntotal]; - tmp->fTotalCharge = seqcharge; - tmp->fPad = padmean; - tmp->fPad2 = paderror; - tmp->fTime = seqaverage; - tmp->fTime2 = seqerror; - tmp->fMean = seqmean; - tmp->fFlags = 0; //flags for single pad clusters - tmp->fLastMergedPad = data[bin].fPad; - - if(fDeconvPad) - { - tmp->fChargeFalling = 0; - tmp->fLastCharge = seqcharge; - } - - //Update list of pointers to previous pad: - currentPt[ncurrent] = &clusterlist[ntotal]; - ntotal++; - ncurrent++; - } - - if(fDeconvTime) - if(newbin >= 0) goto redo; - }//Loop over digits on this padrow - - WriteClusters(ntotal,clusterlist); -} - -void AliHLTTPCClustFinderNew::WriteClusters(Int_t nclusters,AliClusterData *list) -{ - //write cluster to output pointer - Int_t thisrow,thissector; - UInt_t counter = fNClusters; - - for(int j=0; j= fMaxNClusters) - { - LOG(AliHLTTPCLog::kError,"AliHLTTPCClustFinder::WriteClusters","Cluster Finder") - <fRow < (UInt_t)fCurrentRow){ - AliHLTTPCMemHandler::UpdateRowPointer(rowPt); - continue; - } - AliHLTTPCDigitData *digPt = (AliHLTTPCDigitData*)rowPt->fDigitData; - for(UInt_t j=0; jfNDigit; j++){ - Int_t cpad = digPt[j].fPad; - Int_t ctime = digPt[j].fTime; - if(cpad != pad) continue; - if(ctime != time) continue; - - trackID[0] = digPt[j].fTrackID[0]; - trackID[1] = digPt[j].fTrackID[1]; - trackID[2] = digPt[j].fTrackID[2]; - - //cout<<"Reading row "< + * The hight of the signal is given by the charge.
+ * This structure is only used while runnig HLT analysis in the offline + * framework. Thats why it comes with a MC track id by default. + * + * The exact meaning of the 3 track ID fields is currently not known to me. + * (Matthias 18.09.2007) + * @ingroup alihlt-tpc-datastructs + */ struct AliHLTTPCDigitData { -#ifdef do_mc - Int_t fTrackID[3]; -#endif UShort_t fCharge; - UChar_t fPad; + UChar_t fPad; UShort_t fTime; -#ifdef IA64 - UChar_t dummy1; - UChar_t dummy2; -#endif + Int_t fTrackID[3]; }; typedef struct AliHLTTPCDigitData AliHLTTPCDigitData; +/** + * @struct AliHLTTPCDigitRowData + * A container for TPC raw data organized in rows. + * This is the 3rd coordinate which is missing in @ref AliHLTTPCDigitData. + * @ingroup alihlt-tpc-datastructs + */ struct AliHLTTPCDigitRowData { UInt_t fNDigit; @@ -33,6 +45,16 @@ struct AliHLTTPCDigitRowData }; typedef struct AliHLTTPCDigitRowData AliHLTTPCDigitRowData; +/** + * @struct AliHLTTPCRandomDigitData + * Raw data structure for TPC data. A digit corresponds to one + * measured signal in r coordinates: row, pad and time
+ * The hight of the signal is given by the charge.
+ * + * The structure is not used for data exchange between components, + * it's here for legacy reasons. + * @ingroup alihlt-tpc-datastructs + */ struct AliHLTTPCRandomDigitData{ UChar_t fRow; UShort_t fCharge; @@ -40,4 +62,20 @@ struct AliHLTTPCRandomDigitData{ UShort_t fTime; }; typedef struct AliHLTTPCRandomDigitData AliHLTTPCRandomDigitData; + +/** + * @struct AliHLTTPCPackedRawData + * Container structure for TPC data. + * It contains an array of TPC data objects, organized by pad rows. + * @ingroup alihlt-tpc-datastructs + */ +struct AliHLTTPCUnpackedRawData +{ +#ifndef __SUNPRO_CC + AliHLTTPCDigitRowData fDigits[]; +#else + AliHLTTPCDigitRowData fDigits[1]; +#endif +}; + #endif /* _ALIHLTTPCDIGITDATA_H_ */ diff --git a/HLT/TPCLib/AliHLTTPCDigitReaderUnpacked.cxx b/HLT/TPCLib/AliHLTTPCDigitReaderUnpacked.cxx index 87e851e228d..f5159cf0153 100644 --- a/HLT/TPCLib/AliHLTTPCDigitReaderUnpacked.cxx +++ b/HLT/TPCLib/AliHLTTPCDigitReaderUnpacked.cxx @@ -30,7 +30,6 @@ using namespace std; #include "AliHLTTPCDigitReaderUnpacked.h" #include "AliHLTTPCDigitData.h" -#include "AliHLTTPCRawDataFormat.h" #include "AliHLTTPCTransform.h" #include "AliHLTStdIncludes.h" diff --git a/HLT/TPCLib/AliHLTTPCFileHandler.cxx b/HLT/TPCLib/AliHLTTPCFileHandler.cxx index 012810aaf7a..535792e6cce 100644 --- a/HLT/TPCLib/AliHLTTPCFileHandler.cxx +++ b/HLT/TPCLib/AliHLTTPCFileHandler.cxx @@ -1,8 +1,36 @@ // @(#) $Id$ // Original: AliHLTFileHandler.cxx,v 1.49 2005/06/23 17:46:55 hristov -// Author: Uli Frankenfeld , Anders Vestbo , C. Loizides -//*-- Copyright © ALICE HLT Group +/************************************************************************** + * This file is property of and copyright by the ALICE HLT Project * + * ALICE Experiment at CERN, All rights reserved. * + * * + * Primary Authors: U. Frankenfeld, A. Vestbo, C. Loizides * + * Matthias Richter * + * for The ALICE HLT Project. * + * * + * Permission to use, copy, modify and distribute this software and its * + * documentation strictly for non-commercial purposes is hereby granted * + * without fee, provided that the above copyright notice appears in all * + * copies and that both the copyright notice and this permission notice * + * appear in the supporting documentation. The authors make no claims * + * about the suitability of this software for any purpose. It is * + * provided "as is" without express or implied warranty. * + **************************************************************************/ + +/** @file AliHLTTPCFileHandler.cxx + @author U. Frankenfeld, A. Vestbo, C. Loizides, maintained by + Matthias Richter + @date + @brief file input for the TPC tracking code before migration to the + HLT component framework + +// see below for class documentation +// or +// refer to README to build package +// or +// visit http://web.ift.uib.no/~kjeks/doc/alice-hlt + */ #include #include @@ -91,26 +119,6 @@ AliHLTTPCFileHandler::AliHLTTPCFileHandler(Bool_t b) if(fUseStaticIndex&&!fgStaticIndexCreated) CleanStaticIndex(); } -AliHLTTPCFileHandler::AliHLTTPCFileHandler(const AliHLTTPCFileHandler& ref) - : - fInAli(NULL), - fUseRunLoader(kFALSE), - fParam(NULL), - fDigits(NULL), - fDigitsTree(NULL), - fMC(NULL), - fIndexCreated(kFALSE), - fUseStaticIndex(ref.fUseStaticIndex) -{ - HLTFatal("copy constructor untested"); -} - -AliHLTTPCFileHandler& AliHLTTPCFileHandler::operator=(const AliHLTTPCFileHandler&) -{ - HLTFatal("assignment operator untested"); - return *this; -} - AliHLTTPCFileHandler::~AliHLTTPCFileHandler() { //Destructor @@ -333,7 +341,7 @@ Bool_t AliHLTTPCFileHandler::IsDigit(Int_t event) } ///////////////////////////////////////// Digit IO -Bool_t AliHLTTPCFileHandler::AliDigits2Binary(Int_t event,Bool_t altro) +Bool_t AliHLTTPCFileHandler::AliDigits2BinaryFile(Int_t event,Bool_t altro) { //save alidigits as binary Bool_t out = kTRUE; @@ -343,7 +351,7 @@ Bool_t AliHLTTPCFileHandler::AliDigits2Binary(Int_t event,Bool_t altro) data = AliAltroDigits2Memory(nrow,event); else data = AliDigits2Memory(nrow,event); - out = Memory2Binary(nrow,data); + out = Memory2BinaryFile(nrow,data); Free(); return out; } @@ -413,9 +421,10 @@ Bool_t AliHLTTPCFileHandler::CreateIndex() return kTRUE; } -AliHLTTPCDigitRowData * AliHLTTPCFileHandler::AliDigits2Memory(UInt_t & nrow,Int_t event) +AliHLTTPCDigitRowData * AliHLTTPCFileHandler::AliDigits2Memory(UInt_t & nrow,Int_t event, Byte_t* tgtBuffer, UInt_t *pTgtSize) { - //Read data from AliROOT file into memory, and store it in the HLT data format. + //Read data from AliROOT file into memory, and store it in the HLT data format + //in the provided buffer or an allocated buffer. //Returns a pointer to the data. AliHLTTPCDigitRowData *data = 0; @@ -441,22 +450,38 @@ AliHLTTPCDigitRowData * AliHLTTPCFileHandler::AliDigits2Memory(UInt_t & nrow,Int <<"No TPC digits (entries==0)!"<0) { + if (size<=*pTgtSize) { + data=reinterpret_cast(tgtBuffer); + } else { + } + } else { + data=reinterpret_cast(Allocate(size)); + } AliHLTTPCDigitRowData *tempPt = data; + if (data) { + if (pTgtSize) *pTgtSize=size; for(Int_t r=fRowMin;r<=fRowMax;r++){ tempPt->fRow = r; tempPt->fNDigit = 0; tempPt++; } + } return data; } Int_t * ndigits = new Int_t[fRowMax+1]; Float_t xyz[3]; + // The digits of the current event have been indexed: all digits are organized in + // rows, all digits of one row are stored in a AliSimDigits object (fDigit) which + // are stored in the digit tree. + // The index map relates the AliSimDigits objects in the tree to dedicated pad rows + // in the TPC + // This loop filters the pad rows according to the slice no set via Init for(Int_t r=fRowMin;r<=fRowMax;r++){ Int_t n=fIndex[fSlice][r]; - if(n!=-1){ //data on that row + if(n!=-1){ // there is data on that row available fDigitsTree->GetEvent(n); fParam->AdjustSectorRow(fDigits->GetID(),sector,row); AliHLTTPCTransform::Sector2Slice(lslice,lrow,sector,row); @@ -496,7 +521,16 @@ AliHLTTPCDigitRowData * AliHLTTPCFileHandler::AliDigits2Memory(UInt_t & nrow,Int LOG(AliHLTTPCLog::kDebug,"AliHLTTPCFileHandler::AliDigits2Memory","Digits") <0) { + if (size<=*pTgtSize) { + data=reinterpret_cast(tgtBuffer); + } else { + } + } else { + data=reinterpret_cast(Allocate(size)); + } + if (pTgtSize) *pTgtSize=size; + if (data==NULL) return NULL; nrow = (UInt_t)nrows; AliHLTTPCDigitRowData *tempPt = data; @@ -540,11 +574,9 @@ AliHLTTPCDigitRowData * AliHLTTPCFileHandler::AliDigits2Memory(UInt_t & nrow,Int tempPt->fDigitData[localcount].fCharge=dig; tempPt->fDigitData[localcount].fPad=pad; tempPt->fDigitData[localcount].fTime=time; -#ifdef do_mc tempPt->fDigitData[localcount].fTrackID[0] = fDigits->GetTrackID(time,pad,0); tempPt->fDigitData[localcount].fTrackID[1] = fDigits->GetTrackID(time,pad,1); tempPt->fDigitData[localcount].fTrackID[2] = fDigits->GetTrackID(time,pad,2); -#endif localcount++; } while (fDigits->Next()); } @@ -876,7 +908,6 @@ AliHLTTPCDigitRowData * AliHLTTPCFileHandler::AliAltroDigits2Memory(UInt_t & nro tempPt->fDigitData[localcount].fCharge=dig; tempPt->fDigitData[localcount].fPad=pad; tempPt->fDigitData[localcount].fTime=time; -#ifdef do_mc tempPt->fDigitData[localcount].fTrackID[0] = (fDigits->GetTrackIDFast(time,pad,0)-2); tempPt->fDigitData[localcount].fTrackID[1] = (fDigits->GetTrackIDFast(time,pad,1)-2); tempPt->fDigitData[localcount].fTrackID[2] = (fDigits->GetTrackIDFast(time,pad,2)-2); @@ -889,7 +920,6 @@ AliHLTTPCDigitRowData * AliHLTTPCFileHandler::AliAltroDigits2Memory(UInt_t & nro tempPt->fDigitData[localcount].fTrackID[1] += ((event&0x3ff)<<22); tempPt->fDigitData[localcount].fTrackID[2] += ((event&0x3ff)<<22); } -#endif localcount++; } } diff --git a/HLT/TPCLib/AliHLTTPCFileHandler.h b/HLT/TPCLib/AliHLTTPCFileHandler.h index 5b887fd3117..3745207e3f5 100644 --- a/HLT/TPCLib/AliHLTTPCFileHandler.h +++ b/HLT/TPCLib/AliHLTTPCFileHandler.h @@ -3,7 +3,23 @@ #ifndef ALIHLTTPCFILEHANDLER_H #define ALIHLTTPCFILEHANDLER_H - +/* This file is property of and copyright by the ALICE HLT Project * + * ALICE Experiment at CERN, All rights reserved. * + * See cxx source for full Copyright notice */ + +/** @file AliHLTTPCFileHandler.h + @author U. Frankenfeld, A. Vestbo, C. Loizides, maintained by + Matthias Richter + @date + @brief file input for the TPC tracking code before migration to the + HLT component framework + +// see below for class documentation +// or +// refer to README to build package +// or +// visit http://web.ift.uib.no/~kjeks/doc/alice-hlt + */ #include "AliHLTTPCMemHandler.h" class TClonesArray; @@ -15,7 +31,6 @@ class AliTPCParam; class TObject; class TFile; class TTree; -#include "AliHLTLogging.h" class AliHLTTPCSpacePointData; class AliHLTTPCDigitRowData; @@ -28,15 +43,11 @@ class AliHLTTPCTrackArray; * the HLT component framework. * */ -class AliHLTTPCFileHandler:public AliHLTTPCMemHandler, public AliHLTLogging { +class AliHLTTPCFileHandler:public AliHLTTPCMemHandler { public: /** standard constructor */ AliHLTTPCFileHandler(Bool_t b=kFALSE); - /** not a valid copy constructor, defined according to effective C++ style */ - AliHLTTPCFileHandler(const AliHLTTPCFileHandler&); - /** not a valid assignment op, but defined according to effective C++ style */ - AliHLTTPCFileHandler& operator=(const AliHLTTPCFileHandler&); /** destructor */ virtual ~AliHLTTPCFileHandler(); @@ -55,11 +66,67 @@ class AliHLTTPCFileHandler:public AliHLTTPCMemHandler, public AliHLTLogging { void CloseMCOutput(); //Digit IO - Bool_t AliDigits2Binary(Int_t event=0,Bool_t altro=kFALSE); - AliHLTTPCDigitRowData *AliDigits2Memory(UInt_t & nrow,Int_t event=0); //Allocates Memory + + /** + * Write AliDigits from AliRoot file to binary file. + * @param event event no + * @param altro use @ref AliDigits2Memory if kFALSE and @ref + * AliDigits2Memory if kTRUE + * + * Calls the @ref AliHLTTPCMemHandler::Memory2BinaryFile to write the file. + */ + Bool_t AliDigits2BinaryFile(Int_t event=0,Bool_t altro=kFALSE); + + /** + * Convert AliDigits from AliRoot file to HLT Digit data in memory. + * Read and convert/write digits to memory buffer. If no target buffer available, + * an appropriate buffer is allocated.
+ * If the variable pTgtSize is prvided, the total size of the result array is + * returned. \b Note: the total size differs as the @ref AliHLTTPCDigitRowData + * structs are variable in size depending on the no of digits for that particular + * row. + * @param nrow [OUT] number of rows + * @param event the event no + * @param tgtBuffer target buffer (optional) + * @param pTgtSize size of target buffer (optional) + * @return pointer to array, size in nrow
+ * NULL in case of failure, required size in pTgtSize + */ + AliHLTTPCDigitRowData *AliDigits2Memory(UInt_t & nrow,Int_t event=0, Byte_t* tgtBuffer=NULL, UInt_t* pTgtSize=NULL); + + /** + * Convert and filetr AliDigits from AliRoot file to HLT Digit data in memory. + * This functions is the same as @ref AliDigits2Memory but in addition it + * filters out single timebins, which is noise. The timebins which + * are removed are timebins which have the 4 zero neighbours; + * (pad-1,time),(pad+1,time),(pad,time-1),(pad,time+1). + * + * This is legacy code, the two function contain big portions of identical code + * will be merged. + * See @ref AliDigits2Memory for detailed description. + */ AliHLTTPCDigitRowData *AliAltroDigits2Memory(UInt_t & nrow,Int_t event=0,Bool_t eventmerge=kFALSE); - //Allocates Memory + + /** + * Write AliDigits from AliRoot file to binary file. + * @param event event no + * @param altro use @ref AliDigits2Memory if kFALSE and @ref + * AliDigits2Memory if kTRUE + * + * \b Note: pretty much the same as @ref AliDigits2BinaryFile. + * Calls the @ref AliHLTTPCMemHandler::Memory2CompBinary to write the file. + */ Bool_t AliDigits2CompBinary(Int_t event=0,Bool_t altro=kFALSE); + + /** + * Write the data stored in rowPt, into a new AliROOT file. + * The data is stored in the AliROOT format + * This is specially a nice thing if you have modified data, and wants to run it + * through the offline reconstruction chain. + * The arguments is a pointer to the data, and the name of the new AliROOT file. + * Remember to pass the original AliROOT file (the one that contains the original + * simulated data) to this object, in order to retrieve the MC id's of the digits. + */ void AliDigits2RootFile(AliHLTTPCDigitRowData *rowPt,Char_t *newDigitsfile); //Point IO @@ -87,6 +154,12 @@ class AliHLTTPCFileHandler:public AliHLTTPCMemHandler, public AliHLTLogging { Bool_t GetDigitsTree(Int_t event); Bool_t CreateIndex(); //create the index + private: + /** copy constructor prohibited */ + AliHLTTPCFileHandler(const AliHLTTPCFileHandler&); + /** assignment operator prohibited */ + AliHLTTPCFileHandler& operator=(const AliHLTTPCFileHandler&); + ClassDef(AliHLTTPCFileHandler,1) //Filehandler class }; diff --git a/HLT/TPCLib/AliHLTTPCMemHandler.cxx b/HLT/TPCLib/AliHLTTPCMemHandler.cxx index 0b1f9840349..9f69b913c3b 100644 --- a/HLT/TPCLib/AliHLTTPCMemHandler.cxx +++ b/HLT/TPCLib/AliHLTTPCMemHandler.cxx @@ -1,9 +1,36 @@ // @(#) $Id$ // Original: AliHLTMemHandler.cxx,v 1.52 2005/06/14 10:55:21 cvetan -// Author: Uli Frankenfeld , Anders Vestbo , Constantin Loizides -//*-- Copyright © ALICE HLT Group - +/************************************************************************** + * This file is property of and copyright by the ALICE HLT Project * + * ALICE Experiment at CERN, All rights reserved. * + * * + * Primary Authors: U. Frankenfeld, A. Vestbo, C. Loizides * + * Matthias Richter * + * for The ALICE HLT Project. * + * * + * Permission to use, copy, modify and distribute this software and its * + * documentation strictly for non-commercial purposes is hereby granted * + * without fee, provided that the above copyright notice appears in all * + * copies and that both the copyright notice and this permission notice * + * appear in the supporting documentation. The authors make no claims * + * about the suitability of this software for any purpose. It is * + * provided "as is" without express or implied warranty. * + **************************************************************************/ + +/** @file AliHLTTPCMemHandler.cxx + @author U. Frankenfeld, A. Vestbo, C. Loizides, maintained by + Matthias Richter + @date + @brief input interface base class for the TPC tracking code before + migration to the HLT component framework + +// see below for class documentation +// or +// refer to README to build package +// or +// visit http://web.ift.uib.no/~kjeks/doc/alice-hlt + */ /** \class AliHLTTPCMemHandler
 //_____________________________________________________________
@@ -102,32 +129,6 @@ AliHLTTPCMemHandler::AliHLTTPCMemHandler()
   ResetROI();
 }
 
-AliHLTTPCMemHandler::AliHLTTPCMemHandler(const AliHLTTPCMemHandler& src)
-  :
-  fRowMin(0),
-  fRowMax(0),
-  fSlice(0),
-  fPatch(0),
-  fInBinary(NULL),
-  fOutBinary(NULL),
-  fPt(NULL),
-  fSize(0),
-  fIsRandom(kFALSE),
-  fNRandom(0),
-  fNGenerate(0),
-  fNUsed(0),
-  fNDigits(0),
-  fDPt(NULL),
-  fRandomDigits(NULL),
-  fDummy(0)
-{
-}
-
-AliHLTTPCMemHandler& AliHLTTPCMemHandler::operator=(const AliHLTTPCMemHandler& src)
-{
-  return (*this);
-}
-
 AliHLTTPCMemHandler::~AliHLTTPCMemHandler()
 {
   //Destructor
@@ -472,10 +473,10 @@ void AliHLTTPCMemHandler::DigitizePoint(Int_t row, Int_t pad,
 }
 
 ///////////////////////////////////////// Digit IO  
-Bool_t AliHLTTPCMemHandler::Memory2Binary(UInt_t nrow,AliHLTTPCDigitRowData *data)
+Bool_t AliHLTTPCMemHandler::Memory2BinaryFile(UInt_t nrow,AliHLTTPCDigitRowData *data)
 {
   //Write data to the outputfile as is. No run-length encoding is done.
-  
+
   if(!fOutBinary){
     LOG(AliHLTTPCLog::kWarning,"AliHLTTPCMemHandler::Memory2Binary","File")
       <<"No Output File"<fNDigit;
 
+    if (sz
diff --git a/HLT/TPCLib/legacy.txt b/HLT/TPCLib/legacy.txt
new file mode 100644
index 00000000000..cd61ee4da3d
--- /dev/null
+++ b/HLT/TPCLib/legacy.txt
@@ -0,0 +1,10 @@
+Some files have been kept for the sake of legacy and are now 
+removed from the repository:
+- AliHLTTPCClustFinderNew.h/.cxx removed 20.09.2007
+  was the active cluster finder when the TPC HLT code was migrated to the new
+  component interface and project scheme. Unfortunately it got the name "New"
+  when it was developed. The present AliHLTTPCClusterFinder originates from it.
+- AliHLTTPC.cxx/.h  removed 20.09.2007
+  old steering class of TPC reconstruction
+- AliHLTTPCRawDataFormat.h removed 20.09.2007
+  the structure has been added to AliHLTTPCDigitData.h
diff --git a/HLT/libAliHLTTPC.pkg b/HLT/libAliHLTTPC.pkg
index c86a6e77554..6c6efa90abe 100644
--- a/HLT/libAliHLTTPC.pkg
+++ b/HLT/libAliHLTTPC.pkg
@@ -4,6 +4,7 @@
 include $(MODDIR)/hlt.conf
 
 MODULE_SRCS= 	AliHLTTPCLog.cxx \
+		AliHLTTPCAgent.cxx \
 		AliHLTTPCTransform.cxx \
 		AliHLTTPCMemHandler.cxx \
 		AliHLTTPCDataCompressorHelper.cxx \
@@ -31,6 +32,7 @@ MODULE_SRCS= 	AliHLTTPCLog.cxx \
 		tracking/AliHLTTPCHistogram.cxx \
 		tracking/AliHLTTPCHistogram1D.cxx \
 		tracking/AliHLTTPCHistogramAdaptive.cxx \
+		offline/AliHLTTPCDigitPublisherComponent.cxx \
 		AliHLTTPCClusters.cxx \
 		AliHLTTPCConfMapFit.cxx \
 		AliHLTTPCConfMapTrack.cxx \
@@ -58,6 +60,7 @@ MODULE_SRCS= 	AliHLTTPCLog.cxx \
 # 		AliHLTTPCDDLDataFileHandler.cxx
 
 CLASS_HDRS:=  	AliHLTTPCTransform.h \
+		AliHLTTPCAgent.h \
 		AliHLTTPCMemHandler.h \
 		AliHLTTPCDataCompressorHelper.h \
 		AliHLTTPCFitter.h \
@@ -84,6 +87,7 @@ CLASS_HDRS:=  	AliHLTTPCTransform.h \
 		tracking/AliHLTTPCHistogram.h \
 		tracking/AliHLTTPCHistogram1D.h \
 		tracking/AliHLTTPCHistogramAdaptive.h \
+		offline/AliHLTTPCDigitPublisherComponent.h \
 		AliHLTTPCClusters.h \
 		AliHLTTPCConfMapFit.h \
 		AliHLTTPCConfMapTrack.h \
@@ -121,7 +125,6 @@ MODULE_HDRS:= 	$(CLASS_HDRS) \
 		AliHLTTPCTrackSegmentData.h \
 		AliHLTTPCVertexData.h \
 		AliHLTTPCTrackletDataFormat.h \
-		AliHLTTPCRawDataFormat.h \
 		AliHLTTPCClusterDataFormat.h \
 		AliHLTTPCModels.h
 
-- 
2.43.0