Preparing the code for the CDC. A new library MDCFilter is created. It contains the...
authorcvetan <cvetan@f7af4fe6-9843-0410-8265-dc069ae4e863>
Mon, 28 Feb 2005 12:15:29 +0000 (12:15 +0000)
committercvetan <cvetan@f7af4fe6-9843-0410-8265-dc069ae4e863>
Mon, 28 Feb 2005 12:15:29 +0000 (12:15 +0000)
RAW/AliHoughFilter.cxx
RAW/AliHoughFilter.h
RAW/MDCFilterLinkDef.h [moved from RAW/alimdcLinkDef.h with 100% similarity]
RAW/binalimdc.pkg
RAW/libMDC.pkg
RAW/libMDCFilter.pkg [new file with mode: 0644]
RAW/libRAW.pkg

index e7fca6e..a7054d6 100644 (file)
@@ -21,7 +21,6 @@
 //                                                                           //
 ///////////////////////////////////////////////////////////////////////////////
 
-
 #include <TStopwatch.h>
 
 #include "AliL3StandardIncludes.h"
 #include "AliL3Transform.h"
 #include "AliL3Hough.h"
 #include "AliLog.h"
+#include <AliL3ITSclusterer.h>
+#include <AliL3ITSVertexerZ.h>
+#include <AliL3ITStracker.h>
 
 #include "AliHoughFilter.h"
 
+#include "AliRawReaderRoot.h"
+#include <AliMagF.h>
+#include <AliMagFMaps.h>
+#include <AliKalmanTrack.h>
+#include <AliITSgeom.h>
 
 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;
 }
index 73414db..1987104 100644 (file)
 
 #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
 };
 
similarity index 100%
rename from RAW/alimdcLinkDef.h
rename to RAW/MDCFilterLinkDef.h
index 49d9fc0..4e3d1ff 100644 (file)
@@ -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))
index 0f75909..73dd4b4 100644 (file)
@@ -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 (file)
index 0000000..33fbb9d
--- /dev/null
@@ -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
index 6c9de98..aad3f4a 100644 (file)
@@ -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