use ESD based tracking methods
authortkuhr <tkuhr@f7af4fe6-9843-0410-8265-dc069ae4e863>
Thu, 29 Apr 2004 13:26:23 +0000 (13:26 +0000)
committertkuhr <tkuhr@f7af4fe6-9843-0410-8265-dc069ae4e863>
Thu, 29 Apr 2004 13:26:23 +0000 (13:26 +0000)
13 files changed:
MONITOR/AliMonitor.h
MONITOR/AliMonitorHLT.cxx
MONITOR/AliMonitorHLT.h
MONITOR/AliMonitorHLTHough.cxx
MONITOR/AliMonitorHLTHough.h
MONITOR/AliMonitorITS.cxx
MONITOR/AliMonitorITS.h
MONITOR/AliMonitorProcess.cxx
MONITOR/AliMonitorProcess.h
MONITOR/AliMonitorTPC.cxx
MONITOR/AliMonitorTPC.h
MONITOR/AliMonitorV0s.cxx
MONITOR/AliMonitorV0s.h

index ffb22ac..50cd022 100644 (file)
@@ -12,6 +12,7 @@ class TFolder;
 class TTree;
 class AliRunLoader;
 class AliRawReader;
+class AliESD;
 class AliMonitorTrend;
 
 
@@ -25,7 +26,8 @@ public:
   virtual void     CreateHistos(TFolder* folder) = 0;
   virtual void     CreateBranches(TTree* tree);
   virtual void     FillHistos(AliRunLoader* runLoader, 
-                             AliRawReader* rawReader) = 0;
+                             AliRawReader* rawReader,
+                             AliESD* esd) = 0;
 
 protected:
   TFolder*         fFolder;    // sub folder for monitor histograms
index 60e7b20..6c11905 100644 (file)
@@ -147,7 +147,7 @@ void AliMonitorHLT::CreateHistos(TFolder* folder)
 
 //_____________________________________________________________________________
 void AliMonitorHLT::FillHistos(AliRunLoader* /*runLoader*/, 
-                              AliRawReader* /*rawReader*/)
+                              AliRawReader* /*rawReader*/, AliESD* /*esd*/)
 {
 // fill the HLT monitor histogrms
 
index 17a188b..bef927b 100644 (file)
@@ -19,7 +19,7 @@ public:
 
   virtual void     CreateHistos(TFolder* folder);
   virtual void     FillHistos(AliRunLoader* runLoader, 
-                             AliRawReader* rawReader);
+                             AliRawReader* rawReader, AliESD* esd);
 
 private:
   AliTPCParam*     fParam;              // TPC parameters
index da310f5..4255353 100644 (file)
@@ -129,7 +129,8 @@ void AliMonitorHLTHough::CreateHistos(TFolder* folder)
 
 //_____________________________________________________________________________
 void AliMonitorHLTHough::FillHistos(AliRunLoader* /*runLoader*/, 
-                                   AliRawReader* /*rawReader*/)
+                                   AliRawReader* /*rawReader*/, 
+                                   AliESD* /*esd*/)
 {
 // fill the HLT Hough transform monitor histograms
 
index 2ad266b..bf73bcf 100644 (file)
@@ -17,7 +17,7 @@ public:
 
   virtual void     CreateHistos(TFolder* folder);
   virtual void     FillHistos(AliRunLoader* runLoader, 
-                             AliRawReader* rawReader);
+                             AliRawReader* rawReader, AliESD* esd);
 
 private:
   AliTPCParam*     fParam;              // TPC parameters
index 2252608..1e87fe7 100644 (file)
@@ -28,9 +28,9 @@
 #include "AliITSRawStreamSDD.h"
 #include "AliITSRawStreamSSD.h"
 #include "AliITSclusterV2.h"
-#include "AliITStrackV2.h"
 #include "AliRunLoader.h"
 #include "AliRawReader.h"
+#include "AliESD.h"
 #include <TFolder.h>
 #include <TTree.h>
 
@@ -135,7 +135,7 @@ void AliMonitorITS::CreateHistos(TFolder* folder)
                           AliMonitorHisto::kNormEntries);
 
   fTrackPhi = CreateHisto1("TrackPhi", "phi distribution of tracks", 
-                          120, 0, 360, "#phi [#circ]", "#Delta N/N",
+                          120, -180, 180, "#phi [#circ]", "#Delta N/N",
                           AliMonitorHisto::kNormEntries);
 
   fTrackDEdxVsP = CreateHisto2("TrackDEdxVsP", "dE/dx of tracks", 
@@ -147,7 +147,7 @@ void AliMonitorITS::CreateHistos(TFolder* folder)
 
 //_____________________________________________________________________________
 void AliMonitorITS::FillHistos(AliRunLoader* runLoader, 
-                              AliRawReader* rawReader)
+                              AliRawReader* rawReader, AliESD* esd)
 {
 // fill the ITS monitor histogrms
 
@@ -204,31 +204,23 @@ void AliMonitorITS::FillHistos(AliRunLoader* runLoader,
   itsLoader->UnloadRecPoints();
 
 
-  itsLoader->LoadTracks();
-  TTree* tracks = itsLoader->TreeT();
-  if (!tracks) return;
-  AliITStrackV2* track = new AliITStrackV2;
-  tracks->SetBranchAddress("tracks", &track);
-
-  fNTracks->Fill(tracks->GetEntries());
-  for (Int_t i = 0; i < tracks->GetEntries(); i++) {
-    tracks->GetEntry(i);
-    fTrackPt->Fill(track->Pt());
-    fTrackEta->Fill(track->Eta());
-    fTrackPhi->Fill(track->Phi() * TMath::RadToDeg());
-    fTrackDEdxVsP->Fill(track->P(), track->GetdEdx());
+  Int_t nTracks = 0;
+  Int_t nTPCTracks = 0;
+  for (Int_t i = 0; i < esd->GetNumberOfTracks(); i++) {
+    AliESDtrack* track = esd->GetTrack(i);
+    if (!track) continue;
+    if ((track->GetStatus() | AliESDtrack::kTPCin) != 0) nTPCTracks++;
+    if ((track->GetStatus() | AliESDtrack::kITSin) == 0) continue;
+    nTracks++;
+
+    Double_t pxyz[3];
+    track->GetPxPyPz(pxyz);
+    TVector3 pTrack(pxyz);
+    fTrackPt->Fill(pTrack.Pt());
+    fTrackEta->Fill(pTrack.Eta());
+    fTrackPhi->Fill(pTrack.Phi() * TMath::RadToDeg());
+    fTrackDEdxVsP->Fill(pTrack.Mag(), track->GetITSsignal());
   }
-
-  AliLoader* tpcLoader = runLoader->GetLoader("TPCLoader");
-  if (tpcLoader) {
-    tpcLoader->LoadTracks();
-    TTree* tracksTPC = tpcLoader->TreeT();
-    if (tracksTPC) {
-      fNTracksITSTPC->Fill(tracks->GetEntries(), tracksTPC->GetEntries());
-    }
-    tpcLoader->UnloadTracks();
-  }
-
-  delete track;
-  itsLoader->UnloadTracks();
+  fNTracks->Fill(nTracks);
+  fNTracksITSTPC->Fill(nTracks, nTPCTracks);
 }
index 7909847..4135338 100644 (file)
@@ -19,7 +19,7 @@ public:
 
   virtual void     CreateHistos(TFolder* folder);
   virtual void     FillHistos(AliRunLoader* runLoader, 
-                             AliRawReader* rawReader);
+                             AliRawReader* rawReader, AliESD* esd);
 
 private:
   AliITSgeom*      fGeom;               // ITS geometry
index 9097d42..4034f78 100644 (file)
@@ -33,6 +33,7 @@
 #include <TServerSocket.h>
 #include <TSocket.h>
 
+#include "AliESD.h"
 #include "AliITS.h"
 #include "AliITSLoader.h"
 #include "AliITSclustererV2.h"
@@ -420,14 +421,15 @@ Bool_t AliMonitorProcess::ProcessFile()
     Info("ProcessFile", "run: %d  event: %d %d\n", rawReader.GetRunNumber(), 
         rawReader.GetEventId()[0], rawReader.GetEventId()[1]);
 
+    AliESD esd;
     CheckForConnections();
-    if (!ReconstructTPC(&rawReader)) return kFALSE;
+    if (!ReconstructTPC(&rawReader, &esd)) return kFALSE;
     if (fStopping) break;
     CheckForConnections();
-    if (!ReconstructITS(&rawReader)) return kFALSE;
+    if (!ReconstructITS(&rawReader, &esd)) return kFALSE;
     if (fStopping) break;
     CheckForConnections();
-    if (!ReconstructV0s()) return kFALSE;
+    if (!ReconstructV0s(&esd)) return kFALSE;
     if (fStopping) break;
     CheckForConnections();
     if (!ReconstructHLT(iEvent)) return kFALSE;
@@ -442,7 +444,8 @@ Bool_t AliMonitorProcess::ProcessFile()
     for (Int_t iMonitor = 0; iMonitor < fMonitors.GetEntriesFast(); iMonitor++) {
       CheckForConnections();
       SetStatus(kFilling);
-      ((AliMonitor*) fMonitors[iMonitor])->FillHistos(fRunLoader, &rawReader);
+      ((AliMonitor*) fMonitors[iMonitor])->FillHistos(fRunLoader, &rawReader, 
+                                                     &esd);
       if (fStopping) break;
     }
     if (fStopping) break;
@@ -543,7 +546,7 @@ Int_t AliMonitorProcess::GetNumberOfEvents(const char* fileName) const
 }
 
 //_____________________________________________________________________________
-Bool_t AliMonitorProcess::ReconstructTPC(AliRawReader* rawReader)
+Bool_t AliMonitorProcess::ReconstructTPC(AliRawReader* rawReader, AliESD* esd)
 {
 // find TPC clusters and tracks
 
@@ -555,7 +558,6 @@ Bool_t AliMonitorProcess::ReconstructTPC(AliRawReader* rawReader)
     return kFALSE;
   }
   gSystem->Unlink("TPC.RecPoints.root");
-  gSystem->Unlink("TPC.Tracks.root");
 
   // cluster finder
   Info("ReconstructTPC", "reconstructing clusters...");
@@ -568,24 +570,17 @@ Bool_t AliMonitorProcess::ReconstructTPC(AliRawReader* rawReader)
 
   // track finder
   Info("ReconstructTPC", "reconstructing tracks...");
-  tpcLoader->LoadTracks("recreate");
-  {
-    AliTPCtrackerMI tracker(fTPCParam);
-    tracker.SetIO();
-    tracker.LoadClusters();
-    tracker.Clusters2Tracks();
-    tracker.WriteTracks();
-    tracker.UnloadClusters();
-    tpcLoader->WriteTracks("OVERWRITE");
-  }
-
+  AliTPCtrackerMI tracker(fTPCParam);
+  tracker.LoadClusters(tpcLoader->TreeR());
+  tracker.Clusters2Tracks(esd);
+  tracker.UnloadClusters();
   tpcLoader->UnloadRecPoints();
-  tpcLoader->UnloadTracks();
+
   return kTRUE;
 }
 
 //_____________________________________________________________________________
-Bool_t AliMonitorProcess::ReconstructITS(AliRawReader* rawReader)
+Bool_t AliMonitorProcess::ReconstructITS(AliRawReader* rawReader, AliESD* esd)
 {
 // find ITS clusters and tracks
 
@@ -596,13 +591,7 @@ Bool_t AliMonitorProcess::ReconstructITS(AliRawReader* rawReader)
     Error("ReconstructITS", "no ITS loader found");
     return kFALSE;
   }
-  AliLoader* tpcLoader = fRunLoader->GetLoader("TPCLoader");
-  if (!tpcLoader) {
-    Error("ReconstructITS", "no TPC loader found");
-    return kFALSE;
-  }
   gSystem->Unlink("ITS.RecPoints.root");
-  gSystem->Unlink("ITS.Tracks.root");
 
   // cluster finder
   Info("ReconstructITS", "reconstructing clusters...");
@@ -613,52 +602,30 @@ Bool_t AliMonitorProcess::ReconstructITS(AliRawReader* rawReader)
 
   // track finder
   Info("ReconstructITS", "reconstructing tracks...");
-  itsLoader->LoadTracks("recreate");
-  itsLoader->MakeTracksContainer();
-  tpcLoader->LoadTracks();
   AliITStrackerV2 tracker(fITSgeom);
   tracker.LoadClusters(itsLoader->TreeR());
-  tracker.Clusters2Tracks(tpcLoader->TreeT(), itsLoader->TreeT());
+  tracker.Clusters2Tracks(esd);
   tracker.UnloadClusters();
-  itsLoader->WriteTracks("OVERWRITE");
 
   itsLoader->UnloadRecPoints();
-  itsLoader->UnloadTracks();
-  tpcLoader->UnloadTracks();
   return kTRUE;
 }
 
 //_____________________________________________________________________________
-Bool_t AliMonitorProcess::ReconstructV0s()
+Bool_t AliMonitorProcess::ReconstructV0s(AliESD* esd)
 {
 // find V0s
 
   SetStatus(kRecV0s);
 
-  AliITSLoader* itsLoader = (AliITSLoader*) fRunLoader->GetLoader("ITSLoader");
-  if (!itsLoader) {
-    Error("ReconstructV0", "no ITS loader found");
-    return kFALSE;
-  }
-  gSystem->Unlink("ITS.V0s.root");
-
   // V0 finder
   Info("ReconstructV0s", "reconstructing V0s...");
-  itsLoader->LoadTracks("read");
-  itsLoader->LoadV0s("recreate");
   AliV0vertexer vertexer;
-  TTree* tracks = itsLoader->TreeT();
-  if (!tracks) {
-    Error("ReconstructV0s", "no ITS tracks tree found");
-    return kFALSE;
-  }
-  if (!itsLoader->TreeV0()) itsLoader->MakeTree("V0");
-  TTree* v0s = itsLoader->TreeV0();
-  vertexer.Tracks2V0vertices(tracks, v0s);
-  itsLoader->WriteV0s("OVERWRITE");
+  Double_t vtx[3];
+  esd->GetVertex()->GetXYZ(vtx);
+  vertexer.SetVertex(vtx);
+  vertexer.Tracks2V0vertices(esd);
 
-  itsLoader->UnloadTracks();
-  itsLoader->UnloadV0s();
   return kTRUE;
 }
 
index 1ccaae2..bc55288 100644 (file)
@@ -18,6 +18,7 @@ class TTree;
 #include <TString.h>
 #include <TSystem.h>
 
+class AliESD;
 class AliITSgeom;
 class AliRawReader;
 class AliRunLoader;
@@ -73,9 +74,9 @@ private:
   Bool_t           CheckForNewFile();
   Bool_t           ProcessFile();
   Int_t            GetNumberOfEvents(const char* fileName) const;
-  Bool_t           ReconstructTPC(AliRawReader* rawReader);
-  Bool_t           ReconstructITS(AliRawReader* rawReader);
-  Bool_t           ReconstructV0s();
+  Bool_t           ReconstructTPC(AliRawReader* rawReader, AliESD* esd);
+  Bool_t           ReconstructITS(AliRawReader* rawReader, AliESD* esd);
+  Bool_t           ReconstructV0s(AliESD* esd);
 #ifdef ALI_HLT
   void             CreateHLT(const char* fileName);
   void             CreateHLTHough(const char* fileName);
@@ -129,6 +130,7 @@ private:
     AliMonitorInterruptHandler(const AliMonitorInterruptHandler& handler);
     AliMonitorInterruptHandler& operator = 
       (const AliMonitorInterruptHandler& handler);
+    virtual ~AliMonitorInterruptHandler() {};
     virtual Bool_t Notify();
   private:
     AliMonitorProcess* fProcess;       // process to notify
index 8d646bf..0fcc98b 100644 (file)
@@ -30,9 +30,9 @@
 #include "AliTPCRawStream.h"
 #include "AliTPCClustersRow.h"
 #include "AliTPCclusterMI.h"
-#include "AliTPCtrack.h"
 #include "AliRunLoader.h"
 #include "AliRawReader.h"
+#include "AliESD.h"
 #include <TFolder.h>
 #include <TTree.h>
 
@@ -112,7 +112,7 @@ void AliMonitorTPC::CreateHistos(TFolder* folder)
                           AliMonitorHisto::kNormEntries);
 
   fTrackPhi = CreateHisto1("TrackPhi", "phi distribution of tracks", 
-                          120, 0, 360, "#phi [#circ]", "#Delta N/N",
+                          120, -180, 180, "#phi [#circ]", "#Delta N/N",
                           AliMonitorHisto::kNormEntries);
   fTrackPhi->SetDescription("The phi distribution should be flat on average.\nIf it is not flat check for dead TPC sectors.");
 
@@ -154,7 +154,7 @@ void AliMonitorTPC::CreateBranches(TTree* tree)
 
 //_____________________________________________________________________________
 void AliMonitorTPC::FillHistos(AliRunLoader* runLoader, 
-                              AliRawReader* rawReader)
+                              AliRawReader* rawReader, AliESD* esd)
 {
 // fill the TPC monitor histogrms
 
@@ -198,33 +198,34 @@ void AliMonitorTPC::FillHistos(AliRunLoader* runLoader,
   tpcLoader->UnloadRecPoints();
 
 
-  tpcLoader->LoadTracks();
-  TTree* tracks = tpcLoader->TreeT();
-  if (!tracks) return;
-  AliTPCtrack* track = new AliTPCtrack;
-  tracks->SetBranchAddress("tracks", &track);
-
-  Int_t nTracks = (Int_t) tracks->GetEntries();
-  fNTracks->Fill(nTracks);
-  fData->SetNTracks(nTracks);
-  for (Int_t i = 0; i < nTracks; i++) {
-    tracks->GetEntry(i);
-    fTrackPt->Fill(track->Pt());
-    fTrackEta->Fill(track->Eta());
-    fTrackPhi->Fill(track->Phi() * TMath::RadToDeg());
-    if(track->Pt()>3.) {
-      fTrackEtaVsPhi->Fill(track->Eta(),track->Phi() * TMath::RadToDeg());
-      fPtEtaVsPhi->Fill(track->Eta(),track->Phi() * TMath::RadToDeg(),track->Pt());
+  Int_t nTracks = 0;
+  for (Int_t i = 0; i < esd->GetNumberOfTracks(); i++) {
+    AliESDtrack* track = esd->GetTrack(i);
+    if (!track || ((track->GetStatus() | AliESDtrack::kTPCin) == 0)) continue;
+    nTracks++;
+
+    Double_t pxyz[3];
+    track->GetInnerPxPyPz(pxyz);
+    TVector3 pTrack(pxyz);
+    Double_t p = pTrack.Mag();
+    Double_t pt = pTrack.Pt();
+    Double_t eta = pTrack.Eta();
+    Double_t phi = pTrack.Phi() * TMath::RadToDeg();
+
+    fTrackPt->Fill(pt);
+    fTrackEta->Fill(eta);
+    fTrackPhi->Fill(phi);
+    if (pt > 3.) {
+      fTrackEtaVsPhi->Fill(eta, phi);
+      fPtEtaVsPhi->Fill(eta, phi, pTrack.Pt());
     }
-    fTrackNCl->Fill(track->GetNumberOfClusters());
-    fTrackDEdxVsP->Fill(track->P(), track->GetdEdx());
-    if(track->P()>0.4 && track->P()<1.0)
-      fTrackDEdx->Fill(track->GetdEdx());
+    fTrackNCl->Fill(track->GetTPCclusters(NULL));
+    fTrackDEdxVsP->Fill(p, track->GetTPCsignal());
+    if(p>0.4 && p<1.0)
+      fTrackDEdx->Fill(track->GetTPCsignal());
 
-    fData->SetData(i, track->Pt(), track->Eta(), 
-                  track->Phi() * TMath::RadToDeg());
+    fData->SetData(i, pt, eta, phi); 
   }
-
-  delete track;
-  tpcLoader->UnloadTracks();
+  fNTracks->Fill(nTracks);
+  fData->SetNTracks(nTracks);
 }
index 823df3c..84fd9fc 100644 (file)
@@ -21,7 +21,7 @@ public:
   virtual void     CreateHistos(TFolder* folder);
   virtual void     CreateBranches(TTree* tree);
   virtual void     FillHistos(AliRunLoader* runLoader, 
-                             AliRawReader* rawReader);
+                             AliRawReader* rawReader, AliESD* esd);
 
 private:
   AliTPCParam*     fParam;              // TPC parameters
index b1f6baa..4fc6d88 100644 (file)
 
 #include "AliMonitorV0s.h"
 #include "AliMonitorHisto.h"
-#include "AliITSLoader.h"
-#include "AliV0vertex.h"
-#include "AliRunLoader.h"
+#include "AliESD.h"
 #include <TFolder.h>
-#include <TTree.h>
 #include <TPDGCode.h>
 
 
@@ -86,33 +83,22 @@ void AliMonitorV0s::CreateHistos(TFolder* folder)
 
 
 //_____________________________________________________________________________
-void AliMonitorV0s::FillHistos(AliRunLoader* runLoader
-                              AliRawReader*)
+void AliMonitorV0s::FillHistos(AliRunLoader* /*runLoader*/
+                              AliRawReader*, AliESD* esd)
 {
-// fill the TPC-ITS correlation monitor histogrms
+// fill the V0s monitor histogrms
 
-  AliITSLoader* itsLoader = (AliITSLoader*) runLoader->GetLoader("ITSLoader");
-  if (!itsLoader) return;
-
-  itsLoader->LoadV0s();
-  TTree* v0s = itsLoader->TreeV0();
-  if (!v0s) return;
-  AliV0vertex* vertex = new AliV0vertex;
-  v0s->SetBranchAddress("vertices", &vertex);
-
-  for (Int_t i = 0; i < v0s->GetEntries(); i++) {
-    v0s->GetEntry(i);
+  for (Int_t i = 0; i < esd->GetNumberOfV0s(); i++) {
+    AliESDv0* v0 = esd->GetV0(i);
+    if (!v0) continue;
     Double_t x, y, z;
-    vertex->GetXYZ(x, y, z);
+    v0->GetXYZ(x, y, z);
     fRadius->Fill(TMath::Sqrt(x*x + y*y));
-    vertex->ChangeMassHypothesis(kK0Short); 
-    fMassK0->Fill(vertex->GetEffMass());
-    vertex->ChangeMassHypothesis(kLambda0); 
-    fMassLambda->Fill(vertex->GetEffMass());
-    vertex->ChangeMassHypothesis(kLambda0Bar); 
-    fMassAntiLambda->Fill(vertex->GetEffMass());
+    v0->ChangeMassHypothesis(kK0Short); 
+    fMassK0->Fill(v0->GetEffMass());
+    v0->ChangeMassHypothesis(kLambda0); 
+    fMassLambda->Fill(v0->GetEffMass());
+    v0->ChangeMassHypothesis(kLambda0Bar); 
+    fMassAntiLambda->Fill(v0->GetEffMass());
   }
-
-  delete vertex;
-  itsLoader->UnloadV0s();
 }
index 7b9f2ce..83f0c51 100644 (file)
@@ -17,7 +17,7 @@ public:
 
   virtual void     CreateHistos(TFolder* folder);
   virtual void     FillHistos(AliRunLoader* runLoader, 
-                             AliRawReader* rawReader);
+                             AliRawReader* rawReader, AliESD* esd);
 
 private:
   AliMonitorHisto* fRadius;             // radius of V0 vertices