From: cvetan Date: Mon, 28 Feb 2005 12:15:29 +0000 (+0000) Subject: Preparing the code for the CDC. A new library MDCFilter is created. It contains the... X-Git-Url: http://git.uio.no/git/?p=u%2Fmrichter%2FAliRoot.git;a=commitdiff_plain;h=d618608328fdc516715b36ffce1cb976ec2ee631 Preparing the code for the CDC. A new library MDCFilter is created. It contains the whole online tracking code, including TPC and ITS. --- diff --git a/RAW/AliHoughFilter.cxx b/RAW/AliHoughFilter.cxx index e7fca6ed065..a7054d6aa4e 100644 --- a/RAW/AliHoughFilter.cxx +++ b/RAW/AliHoughFilter.cxx @@ -21,7 +21,6 @@ // // /////////////////////////////////////////////////////////////////////////////// - #include #include "AliL3StandardIncludes.h" @@ -29,9 +28,17 @@ #include "AliL3Transform.h" #include "AliL3Hough.h" #include "AliLog.h" +#include +#include +#include #include "AliHoughFilter.h" +#include "AliRawReaderRoot.h" +#include +#include +#include +#include ClassImp(AliHoughFilter) @@ -40,41 +47,126 @@ AliHoughFilter::AliHoughFilter() { // default constructor + // Init debug level AliL3Log::fgLevel = AliL3Log::kError; if (AliDebugLevel() > 0) AliL3Log::fgLevel = AliL3Log::kWarning; if (AliDebugLevel() > 1) AliL3Log::fgLevel = AliL3Log::kInformational; if (AliDebugLevel() > 2) AliL3Log::fgLevel = AliL3Log::kDebug; - if (!AliL3Transform::Init("./", kFALSE)) { + + // Init TPC HLT geometry + const char *path = gSystem->Getenv("ALICE_ROOT"); + Char_t pathname[1024]; + strcpy(pathname,path); + strcat(pathname,"/HLT/src"); + if (!AliL3Transform::Init(pathname, kFALSE)) AliError("HLT initialization failed!"); - } + + // Init magnetic field + AliKalmanTrack::SetConvConst( + 1000/0.299792458/AliL3Transform::GetSolenoidField() + ); + AliMagF* field = new AliMagFMaps("Maps","Maps", 2, 1., 10., AliMagFMaps::k5kG); + AliTracker::SetFieldMap(field); + fPtmin = 0.1*AliL3Transform::GetSolenoidField(); + + // Init ITS geometry + fITSgeom = new AliITSgeom(); + fITSgeom->ReadNewFile("$ALICE_ROOT/ITS/ITSgeometry_vPPRasymmFMD.det"); + if (!fITSgeom) + AliError("ITS geometry not found!"); + } //_____________________________________________________________________________ Bool_t AliHoughFilter::Filter(AliRawEvent* event, AliESD* esd) { -// TPC hough transformation + // Run fast online reconstruction + // based on the HLT tracking algorithms + + TStopwatch globaltimer; + globaltimer.Start(); + + const char *dir = gROOT->GetPath(); + gROOT->cd(); + + TStopwatch timer; + timer.Start(); + + TTree *treeITSclusters = new TTree("TreeL3ITSclusters"," "); //make a tree + RunITSclusterer(event,treeITSclusters); + RunITSvertexer(esd,treeITSclusters); + RunTPCtracking(event,esd); + RunITStracking(esd,treeITSclusters); + delete treeITSclusters; + + gROOT->cd(dir); + AliInfo(Form("Event filter has finished in %f seconds\n\n\n\n\n\n",globaltimer.RealTime())); + + return kTRUE; +} + +//_____________________________________________________________________________ +void AliHoughFilter::RunITSclusterer(AliRawEvent* event, TTree *treeClusters) +{ + // Run ITS Clusterer + // The clusters are stored in a tree + + TStopwatch timer; + timer.Start(); + + if(!fITSgeom) + AliError("ITS geometry not created!"); + AliL3ITSclusterer clusterer(fITSgeom); + AliRawReader *itsrawreader=new AliRawReaderRoot(event); + clusterer.Digits2Clusters(itsrawreader,treeClusters); + delete itsrawreader; + AliInfo(Form("ITS clusterer has finished in %f seconds\n",timer.RealTime())); + +} + + +//_____________________________________________________________________________ +void AliHoughFilter::RunITSvertexer(AliESD* esd, TTree *treeClusters) +{ + // Run SPD vertexerZ + // Store the result in the ESD + + TStopwatch timer; + timer.Start(); + AliL3ITSVertexerZ vertexer; + AliESDVertex *vertex = vertexer.FindVertexForCurrentEvent(fITSgeom,treeClusters); + esd->SetVertex(vertex); + AliInfo(Form("ITS vertexer has finished in %f seconds\n",timer.RealTime())); + +} + +//_____________________________________________________________________________ +void AliHoughFilter::RunTPCtracking(AliRawEvent* event, AliESD* esd) +{ + // Run hough transform tracking in TPC + // The z of the vertex is taken from the ESD + // The result of the tracking is stored in the ESD TStopwatch timer; timer.Start(); - Float_t ptmin = 0.1*AliL3Transform::GetSolenoidField(); + const AliESDVertex *vertex = esd->GetVertex(); + Float_t zvertex = vertex->GetZv(); AliL3Hough *hough1 = new AliL3Hough(); hough1->SetThreshold(4); - hough1->CalcTransformerParams(ptmin); + hough1->CalcTransformerParams(fPtmin); hough1->SetPeakThreshold(70,-1); - // Attention Z of the vertex to be taken from the event head! - // So far for debug purposes it is fixed by hand... - hough1->Init(100,4,event,3.82147); + hough1->Init(100,4,event,zvertex); hough1->SetAddHistograms(); AliL3Hough *hough2 = new AliL3Hough(); - + hough2->SetThreshold(4); - hough2->CalcTransformerParams(ptmin); + hough2->CalcTransformerParams(fPtmin); hough2->SetPeakThreshold(70,-1); - hough2->Init(100,4,event,3.82147); + hough2->Init(100,4,event,zvertex); hough2->SetAddHistograms(); Int_t nglobaltracks = 0; @@ -83,43 +175,66 @@ Bool_t AliHoughFilter::Filter(AliRawEvent* event, AliESD* esd) hough2->StartProcessInThread(18,35); if(hough1->WaitForThreadFinish()) - AliFatal(" Can not join the required thread! "); + ::Fatal("AliL3Hough::WaitForThreadFinish"," Can not join the required thread! "); if(hough2->WaitForThreadFinish()) - AliFatal(" Can not join the required thread! "); - - /* In case we run HLT code in the main thread - for(Int_t slice=0; slice<=17; slice++) - { - hough1->ReadData(slice,0); - hough1->Transform(); - hough1->AddAllHistogramsRows(); - hough1->FindTrackCandidatesRow(); - hough1->AddTracks(); - } - for(Int_t slice=18; slice<=35; slice++) - { - hough2->ReadData(slice,0); - hough2->Transform(); - hough2->AddAllHistogramsRows(); - hough2->FindTrackCandidatesRow(); - hough2->AddTracks(); - } - */ + ::Fatal("AliL3Hough::WaitForThreadFinish"," Can not join the required thread! "); + + /* In case we run HLT code in the main thread + for(Int_t slice=0; slice<=17; slice++) + { + hough1->ReadData(slice,0); + hough1->Transform(); + hough1->AddAllHistogramsRows(); + hough1->FindTrackCandidatesRow(); + hough1->AddTracks(); + } + for(Int_t slice=18; slice<=35; slice++) + { + hough2->ReadData(slice,0); + hough2->Transform(); + hough2->AddAllHistogramsRows(); + hough2->FindTrackCandidatesRow(); + hough2->AddTracks(); + } + */ nglobaltracks += hough1->FillESD(esd); nglobaltracks += hough2->FillESD(esd); - /* In case we want to debug the ESD - gSystem->MakeDirectory("hough1"); - hough1->WriteTracks("./hough1"); - gSystem->MakeDirectory("hough2"); - hough2->WriteTracks("./hough2"); - */ + /* In case we want to debug the ESD + gSystem->MakeDirectory("hough1"); + hough1->WriteTracks("./hough1"); + gSystem->MakeDirectory("hough2"); + hough2->WriteTracks("./hough2"); + */ delete hough1; delete hough2; - printf("Filter has found %d TPC tracks in %f seconds\n", nglobaltracks,timer.RealTime()); + AliInfo(Form("\nHough Transformer has found %d TPC tracks in %f seconds\n\n", nglobaltracks,timer.RealTime())); + +} + +//_____________________________________________________________________________ +void AliHoughFilter::RunITStracking(AliESD* esd, TTree *treeClusters) +{ + // Run the ITS tracker + // The tracks from the HT TPC tracking are used as seeds + // The prologated tracks are updated in the ESD + TStopwatch timer; + timer.Start(); + + Double_t vtxPos[3]; + Double_t vtxErr[3]={0.005,0.005,0.010}; + const AliESDVertex *vertex = esd->GetVertex(); + vertex->GetXYZ(vtxPos); + + AliL3ITStracker itsTracker(fITSgeom); + itsTracker.SetVertex(vtxPos,vtxErr); + + itsTracker.LoadClusters(treeClusters); + itsTracker.Clusters2Tracks(esd); + itsTracker.UnloadClusters(); + AliInfo(Form("ITS tracker has finished in %f seconds\n",timer.RealTime())); - return kFALSE; } diff --git a/RAW/AliHoughFilter.h b/RAW/AliHoughFilter.h index 73414db2939..19871045e05 100644 --- a/RAW/AliHoughFilter.h +++ b/RAW/AliHoughFilter.h @@ -11,6 +11,10 @@ #include "AliFilter.h" +class TTree; + +class AliITSgeom; + class AliHoughFilter: public AliFilter { public: @@ -18,7 +22,15 @@ public: virtual Bool_t Filter(AliRawEvent* event, AliESD* esd); + void RunITSclusterer(AliRawEvent* event, TTree *treeClusters); + void RunITSvertexer(AliESD* esd, TTree *treeClusters); + void RunTPCtracking(AliRawEvent* event, AliESD* esd); + void RunITStracking(AliESD* esd, TTree *treeClusters); private: + Float_t fPtmin; //Low limit on Pt + + AliITSgeom *fITSgeom; //Pointer to the ITS geometry + ClassDef(AliHoughFilter, 0) // TPC hough filter }; diff --git a/RAW/alimdcLinkDef.h b/RAW/MDCFilterLinkDef.h similarity index 100% rename from RAW/alimdcLinkDef.h rename to RAW/MDCFilterLinkDef.h diff --git a/RAW/binalimdc.pkg b/RAW/binalimdc.pkg index 49d9fc0d549..4e3d1ff67bb 100644 --- a/RAW/binalimdc.pkg +++ b/RAW/binalimdc.pkg @@ -7,20 +7,14 @@ PACKCXXFLAGS := ${HLTCXXFLAGS} PACKCFLAGS := ${HLTCLFAGS} PACKDCXXFLAGS:= ${HLTDCXXFLAGS} -ESRCS:= AliHoughFilter.cxx - SRCS:= alimdc_main.cxx ${ESRCS} -HDRS:= $(ESRCS:.cxx=.h) - -DHDR:=alimdcLinkDef.h - #EDEFINE+= -DUSE_EB -EINCLUDE+=TPC CONTAINERS ITS RAW HLT/src HLT/hough HLT/comp +EINCLUDE+=TPC CONTAINERS ITS RAW HLT/src HLT/hough HLT/comp HLT/ITS # -DUSE_DEBUG for alimdc debug printout -ELIBS:=ESD RAW MDC STEER TPCbase TPCsim TPCrec CONTAINERS AliL3Src AliL3Misc AliL3Hough AliL3Comp pythia6 pdf microcern +ELIBS:=ESD RAW MDC MDCFilter STEER TPCbase TPCsim TPCrec CONTAINERS AliL3Src AliL3Misc AliL3Hough AliL3Comp AliL3ITS ITS pythia6 pdf microcern #ifneq (,$(findstring macosx,$(ALICE_TARGET))) ifeq (macosx,$(ALICE_TARGET)) diff --git a/RAW/libMDC.pkg b/RAW/libMDC.pkg index 0f7590927f7..73dd4b4ae33 100644 --- a/RAW/libMDC.pkg +++ b/RAW/libMDC.pkg @@ -18,7 +18,7 @@ EHDRS:=$(shell root-config --incdir)/TH1F.h #EDEFINE+= -DUSE_EB -EINCLUDE+=HLT/src HLT/hough HLT/comp +EINCLUDE+=TPC CONTAINERS ITS RAW HLT/src HLT/hough HLT/comp HLT/ITS DHDR:= MDCLinkDef.h diff --git a/RAW/libMDCFilter.pkg b/RAW/libMDCFilter.pkg new file mode 100644 index 00000000000..33fbb9d9a82 --- /dev/null +++ b/RAW/libMDCFilter.pkg @@ -0,0 +1,24 @@ +#-*- Mode: Makefile -*- + +include HLT/hlt.conf + +EDEFINE := ${HLTDEFS} +PACKCXXFLAGS := ${HLTCXXFLAGS} +PACKCFLAGS := ${HLTCLFAGS} +PACKDCXXFLAGS:= ${HLTDCXXFLAGS} + +SRCS:= AliHoughFilter.cxx + +HDRS:= $(SRCS:.cxx=.h) + +#EHDRS:=$(shell root-config --incdir)/TH1F.h + +#EDEFINE+= -DUSE_EB + +EINCLUDE+=TPC CONTAINERS ITS RAW HLT/src HLT/hough HLT/comp HLT/ITS + +DHDR:= MDCFilterLinkDef.h + +ifdef DATE_ROOT +EINCLUDE+= ${DATE_COMMON_DEFS} +endif diff --git a/RAW/libRAW.pkg b/RAW/libRAW.pkg index 6c9de98f50c..aad3f4af469 100644 --- a/RAW/libRAW.pkg +++ b/RAW/libRAW.pkg @@ -21,7 +21,7 @@ HDRS:= $(SRCS:.cxx=.h) EHDRS:=$(shell root-config --incdir)/TH1F.h -EINCLUDE+=HLT/src HLT/hough HLT/comp +EINCLUDE+=TPC CONTAINERS ITS RAW HLT/src HLT/hough HLT/comp HLT/ITS DHDR:= RAWLinkDef.h