]> git.uio.no Git - u/mrichter/AliRoot.git/commitdiff
monitoring of HLT hough transformation added
authortkuhr <tkuhr@f7af4fe6-9843-0410-8265-dc069ae4e863>
Fri, 14 Nov 2003 13:06:27 +0000 (13:06 +0000)
committertkuhr <tkuhr@f7af4fe6-9843-0410-8265-dc069ae4e863>
Fri, 14 Nov 2003 13:06:27 +0000 (13:06 +0000)
MONITOR/AliMonitorHLT.h
MONITOR/AliMonitorHLTHough.cxx [new file with mode: 0644]
MONITOR/AliMonitorHLTHough.h [new file with mode: 0644]
MONITOR/AliMonitorHisto.cxx
MONITOR/AliMonitorITS.cxx
MONITOR/AliMonitorProcess.cxx
MONITOR/AliMonitorProcess.h
MONITOR/AliMonitorTPC.cxx
MONITOR/MONITORLinkDef.h
MONITOR/libMONITOR.pkg

index 66575af07de9ffc2dd884209bd3e1f02d8a1ffc9..17a188b78898b7a90eb3ad07e2b50385bdce4fdd 100644 (file)
@@ -38,8 +38,8 @@ private:
   AliMonitorHisto* fTrackDr0;           // dr0 distribution of HLT tracks
   AliMonitorHisto* fTrackEtaVsPhi;      // phi vs eta for HLT tracks
   AliMonitorHisto* fPtEtaVsPhi;         // phi vs eta for HLT tracks
-  AliMonitorHisto* fTrackZvsNHits;
-  AliMonitorHisto* fTrackXYvsNHits;
+  AliMonitorHisto* fTrackZvsNHits;      // z vs the number of hits per track
+  AliMonitorHisto* fTrackXYvsNHits;     // xy vs the number of hits per track
 
   ClassDef(AliMonitorHLT, 0)   // creation and filling of monitor histograms for HLT
 };
diff --git a/MONITOR/AliMonitorHLTHough.cxx b/MONITOR/AliMonitorHLTHough.cxx
new file mode 100644 (file)
index 0000000..a4d8746
--- /dev/null
@@ -0,0 +1,144 @@
+/**************************************************************************
+ * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
+ *                                                                        *
+ * Author: The ALICE Off-line Project.                                    *
+ * Contributors are mentioned in the code where appropriate.              *
+ *                                                                        *
+ * 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.                  *
+ **************************************************************************/
+
+
+///////////////////////////////////////////////////////////////////////////////
+//                                                                           //
+// This class creates and fills monitor histograms for HLT Hough transform   //
+//                                                                           //
+///////////////////////////////////////////////////////////////////////////////
+
+
+#include "AliMonitorHLTHough.h"
+#include "AliMonitorHisto.h"
+#include "AliMonitorTrend.h"
+#include "AliTPCParam.h"
+#include <TFolder.h>
+#ifdef ALI_HLT
+#include <stdlib.h>
+#include <AliL3MemHandler.h>
+#include <AliL3TrackArray.h>
+#include <AliL3HoughTrack.h>
+#endif
+
+//_____________________________________________________________________________
+AliMonitorHLTHough::AliMonitorHLTHough(AliTPCParam* param)
+{
+// create a HLT monitor object with the given parameters
+
+  fParam = param;
+}
+
+//_____________________________________________________________________________
+AliMonitorHLTHough::AliMonitorHLTHough(const AliMonitorHLTHough& monitor) :
+  AliMonitor(monitor)
+{
+  Fatal("AliMonitorHLTHough", "copy constructor not implemented");
+}
+
+//_____________________________________________________________________________
+AliMonitorHLTHough& AliMonitorHLTHough::operator = (const AliMonitorHLTHough& 
+                                                   /*monitor*/)
+{
+  Fatal("operator =", "assignment operator not implemented");
+  return *this;
+}
+
+//_____________________________________________________________________________
+AliMonitorHLTHough::~AliMonitorHLTHough()
+{
+}
+
+
+//_____________________________________________________________________________
+void AliMonitorHLTHough::CreateHistos(TFolder* folder)
+{
+// create the HLT Hough transform monitor histograms
+
+  fFolder = folder->AddFolder("HLTHOUGH", "HLTHOUGH");
+
+  fNTracks = CreateTrend("NTracks", "number of tracks per event", 
+                        "N_{tracks}");
+
+  fTrackPt = CreateHisto1("TrackPt", "pt distribution of tracks", 
+                         90, 0, 3, "p_{t} [GeV/c]", "#Delta N/N",
+                         AliMonitorHisto::kNormNone);
+
+  fTrackEta = CreateHisto1("TrackEta", "eta distribution of tracks", 
+                          100, -2, 2, "#eta", "#Delta N/N",
+                          AliMonitorHisto::kNormEntries);
+
+  fTrackPhi = CreateHisto1("TrackPhi", "phi distribution of tracks", 
+                          120, 0, 360, "#phi [#circ]", "#Delta N/N",
+                          AliMonitorHisto::kNormEntries);
+
+  fTrackEtaVsPhi = CreateHisto2("TrackEtaVsPhi", "#phi vs #eta", 
+                              20, -1, 1, 25, 0, 360, 
+                              "#eta", "#phi", "#Delta N/N",
+                              AliMonitorHisto::kNormNone);
+
+  fPtEtaVsPhi = CreateHisto2("PtEtaVsPhi", "#phi vs #eta", 
+                              20, -1, 1, 25, 0, 360, 
+                              "#eta", "#phi", "#Delta N/N",
+                              AliMonitorHisto::kNormNone);
+
+}
+
+
+//_____________________________________________________________________________
+void AliMonitorHLTHough::FillHistos(AliRunLoader* /*runLoader*/, 
+                                   AliRawReader* /*rawReader*/)
+{
+// fill the HLT Hough transform monitor histograms
+
+#ifndef ALI_HLT
+  Warning("FillHistos", "the code was compiled without HLT support");
+
+#else
+  AliL3MemHandler memHandler[36];
+  Int_t nHoughTracks = 0;
+  for (Int_t iSector = 0; iSector < fParam->GetNInnerSector(); iSector++) {
+    char fileName[256];
+    sprintf(fileName, "hlt/tracks_ho_%d.raw", iSector);
+    if (!memHandler[iSector].SetBinaryInput(fileName)) {
+      Warning("FillHistos", "could not open file hlt/tracks.raw");
+      return;
+    }
+    AliL3TrackArray* tracks = new AliL3TrackArray;
+    memHandler[iSector].Binary2TrackArray(tracks);
+
+    nHoughTracks += tracks->GetNTracks();
+    for (Int_t iTrack = 0; iTrack < tracks->GetNTracks(); iTrack++) {
+      AliL3HoughTrack *track = (AliL3HoughTrack*)tracks->GetCheckedTrack(iTrack);
+      if(!track) continue;
+
+      track->CalculateHelix();
+      track->Rotate(iSector);
+
+      fTrackPt->Fill(track->GetPt());
+      fTrackEta->Fill(track->GetPseudoRapidity());
+      fTrackPhi->Fill(track->GetPsi() * TMath::RadToDeg());
+      if(track->GetPt()>3.) {
+       fTrackEtaVsPhi->Fill(track->GetPseudoRapidity(),track->GetPsi() * TMath::RadToDeg());
+       fPtEtaVsPhi->Fill(track->GetPseudoRapidity(),track->GetPsi() * TMath::RadToDeg(),track->GetPt());
+      }
+    }
+    fNTracks->Fill(nHoughTracks);
+
+    delete tracks;
+    memHandler[iSector].CloseBinaryInput();
+  }
+#endif
+}
diff --git a/MONITOR/AliMonitorHLTHough.h b/MONITOR/AliMonitorHLTHough.h
new file mode 100644 (file)
index 0000000..3819030
--- /dev/null
@@ -0,0 +1,45 @@
+#ifndef ALIMONITORHLTHOUGH_H
+#define ALIMONITORHLTHOUGH_H
+/* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
+ * See cxx source for full Copyright notice                               */
+
+#include "AliMonitor.h"
+
+class AliTPCParam;
+
+
+class AliMonitorHLTHough : public AliMonitor {
+public:
+  AliMonitorHLTHough(AliTPCParam* param);
+  AliMonitorHLTHough(const AliMonitorHLTHough& monitor);
+  AliMonitorHLTHough& operator = (const AliMonitorHLTHough& monitor);
+  virtual ~AliMonitorHLTHough();
+
+  virtual void     CreateHistos(TFolder* folder);
+  virtual void     FillHistos(AliRunLoader* runLoader, 
+                             AliRawReader* rawReader);
+
+private:
+  AliTPCParam*     fParam;              // TPC parameters
+
+  AliMonitorTrend* fNTracks;            // number of HLT tracks per event
+  AliMonitorHisto* fTrackPt;            // pt distribution of HLT tracks
+  AliMonitorHisto* fTrackEta;           // eta distribution of HLT tracks
+  AliMonitorHisto* fTrackPhi;           // phi distribution of HLT tracks
+  AliMonitorHisto* fTrackEtaVsPhi;      // phi vs eta for HLT tracks
+  AliMonitorHisto* fPtEtaVsPhi;         // phi vs eta for HLT tracks
+
+  ClassDef(AliMonitorHLTHough, 0)   // creation and filling of monitor histograms for HLT Hough transform
+};
+
+#endif
+
+
+
+
+
+
+
+
+
index 92ad928d8a551c8e080ee367a497d02181430534..c57eb5589f2d8c0a484d1df9621362a2b204c6aa 100644 (file)
@@ -82,7 +82,7 @@ AliMonitorHisto::AliMonitorHisto(const AliMonitorHisto& histo) :
 //_____________________________________________________________________________
 AliMonitorHisto& AliMonitorHisto::operator =(const AliMonitorHisto& histo)
 {
-// assignment operatore
+// assignment operator
 
   AliMonitorPlot::operator =(histo);
 
index 4c53486f406e0c9eb4d2b32dd05c9d06b426ae66..2252608ef2a1b35a7982d22af922a40be9e920cc 100644 (file)
@@ -30,6 +30,7 @@
 #include "AliITSclusterV2.h"
 #include "AliITStrackV2.h"
 #include "AliRunLoader.h"
+#include "AliRawReader.h"
 #include <TFolder.h>
 #include <TTree.h>
 
index 613b2128257295daa871fbe669becf64737fa30c..b08464ee0ce96081f94153a5f7a4733a29a1e5eb 100644 (file)
@@ -31,6 +31,7 @@
 #include "AliMonitorITS.h"
 #include "AliMonitorV0s.h"
 #include "AliMonitorHLT.h"
+#include "AliMonitorHLTHough.h"
 #include "AliRawReaderRoot.h"
 #include "AliLoader.h"
 #include "AliRun.h"
@@ -51,6 +52,9 @@
 #ifdef ALI_HLT
 #include <AliLevel3.h>
 #include <AliL3Transform.h>
+#include <AliL3StandardIncludes.h>
+#include <AliL3HoughMaxFinder.h>
+#include <AliL3Hough.h>
 #endif
 
 ClassImp(AliMonitorProcess) 
@@ -114,6 +118,7 @@ AliMonitorProcess::AliMonitorProcess(const char* alienDir,
   fMonitors.Add(new AliMonitorV0s);
 #ifdef ALI_HLT
   fMonitors.Add(new AliMonitorHLT(fTPCParam));
+  fMonitors.Add(new AliMonitorHLTHough(fTPCParam));
 #endif
 
   for (Int_t iMonitor = 0; iMonitor < fMonitors.GetEntriesFast(); iMonitor++) {
@@ -314,6 +319,7 @@ Bool_t AliMonitorProcess::ProcessFile()
        nEvents, fFileName.Data());
 #ifdef ALI_HLT
   CreateHLT(fFileName);
+  CreateHLTHough(fFileName);
 #endif
 
   // loop over the events
@@ -340,6 +346,8 @@ Bool_t AliMonitorProcess::ProcessFile()
     if (fStopping) break;
     if (!ReconstructHLT(iEvent)) return kFALSE;
     if (fStopping) break;
+    if (!ReconstructHLTHough(iEvent)) return kFALSE;
+    if (fStopping) break;
 
     if (fDisplaySocket) fDisplaySocket->Send("new event");
 
@@ -598,6 +606,25 @@ void AliMonitorProcess::CreateHLT(const char* fileName)
   
   fHLT->WriteFiles("./hlt/");  
 }
+
+//_____________________________________________________________________________
+void AliMonitorProcess::CreateHLTHough(const char* fileName)
+{
+
+// create the HLT Hough transform (L3Hough) object
+
+  if (fHLTHough) delete fHLTHough;
+
+  char name[256];
+  strcpy(name, fileName);
+
+  fHLTHough = new AliL3Hough();
+  fHLTHough->SetTransformerParams(64,64,0.1,30);
+//  fHLTHough->Init("./", kFALSE, 20, kFALSE,0,name);
+  fHLTHough->SetAddHistograms();
+  fHLTHough->GetMaxFinder()->SetThreshold(55000); // or 14000 ?
+
+}
 #endif
 
 //_____________________________________________________________________________
@@ -638,6 +665,40 @@ Bool_t AliMonitorProcess::ReconstructHLT(
 #endif
 }
 
+//_____________________________________________________________________________
+Bool_t AliMonitorProcess::ReconstructHLTHough(
+#ifdef ALI_HLT
+  Int_t iEvent
+#else
+  Int_t /* iEvent */
+#endif
+)
+{
+// run the HLT Hough transformer
+
+  SetStatus(kRecHLT);
+
+#ifndef ALI_HLT
+  Warning("ReconstructHLTHough", "the code was compiled without HLT support");
+  return kTRUE;
+
+#else
+  if (!fHLTHough) return kFALSE;
+
+  //  fHLTHough->Process(0, 35);
+  // Loop over TPC sectors and process the data
+  for(Int_t i=0; i<=35; i++)
+    {
+      fHLTHough->ReadData(i,iEvent);
+      fHLTHough->Transform();
+      //      if(fHLTHough->fAddHistograms)
+      fHLTHough->AddAllHistograms();
+      fHLTHough->FindTrackCandidates();
+      fHLTHough->WriteTracks(i,"./hlt");
+    }
+  return kTRUE;
+#endif
+}
 
 //_____________________________________________________________________________
 Bool_t AliMonitorProcess::WriteHistos()
index 0184a86ef4f13df537dc3089ba2910769c012b84..a426cdd684a3478dc0bb980480f926bee3a3b0d1 100644 (file)
@@ -22,6 +22,7 @@ class TFolder;
 class TTree;
 #ifdef ALI_HLT
 class AliLevel3;
+class AliL3Hough;
 #endif
 
 
@@ -74,15 +75,17 @@ private:
   Bool_t           ReconstructV0s();
 #ifdef ALI_HLT
   void             CreateHLT(const char* fileName);
+  void             CreateHLTHough(const char* fileName);
 #endif
   Bool_t           ReconstructHLT(Int_t iEvent);
+  Bool_t           ReconstructHLTHough(Int_t iEvent);
 
   Bool_t           WriteHistos();
   void             StartNewRun();
 
   void             CheckForConnections();
   void             BroadcastHistos();
-  void             SetStatus(EStatus);
+  void             SetStatus(EStatus status);
 
   static const Int_t fgkPort;          // port number for client connections
 
@@ -94,6 +97,7 @@ private:
   TString          fFileName;           // physical file name
 #ifdef ALI_HLT
   AliLevel3*       fHLT;                // the HLT tracker
+  AliL3Hough*      fHLTHough;           // the HLT hough transformer
 #endif
 
   UInt_t           fRunNumber;          // current run number
index 876ca0654a503fe11a68da647071f7ccd8b27a90..8d646bf94ff462353600f82944ef4b650e1e3090 100644 (file)
@@ -32,6 +32,7 @@
 #include "AliTPCclusterMI.h"
 #include "AliTPCtrack.h"
 #include "AliRunLoader.h"
+#include "AliRawReader.h"
 #include <TFolder.h>
 #include <TTree.h>
 
index bb9b3dee99ce7acb1c96ad415b2af14e10bb3207..e4ba0b66e24f5f04cde7b2836d5ad70c446a0ea1 100644 (file)
@@ -18,6 +18,7 @@
 #pragma link C++ class  AliMonitorITS+;
 #pragma link C++ class  AliMonitorV0s+;
 #pragma link C++ class  AliMonitorHLT+;
+#pragma link C++ class  AliMonitorHLTHough+;
 #pragma link C++ class  AliMonitorProcess+;
 #pragma link C++ class  AliMonitorControl+;
 #pragma link C++ class  AliMonitorDialog+;
index 7360fad2525272e864d3efa0588b337894c601c9..e87bfebe5cf5119840af815678c38df996f21e03 100644 (file)
@@ -1,7 +1,7 @@
 SRCS:=  AliMonitorPlot.cxx AliMonitorHisto.cxx AliMonitorTrend.cxx \
        AliMonitor.cxx \
        AliMonitorTPC.cxx AliMonitorITS.cxx AliMonitorV0s.cxx \
-       AliMonitorHLT.cxx \
+       AliMonitorHLT.cxx AliMonitorHLTHough.cxx \
        AliMonitorDataTPC.cxx \
        AliMonitorProcess.cxx AliMonitorControl.cxx \
        AliMonitorDialog.cxx AliMonitorClient.cxx