]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - MONITOR/AliMonitorV0s.cxx
DP:Possibility to use actual vertex position added
[u/mrichter/AliRoot.git] / MONITOR / AliMonitorV0s.cxx
index eebbd54ba115757fbe8170cb4a11ecde4f4a2e0b..e89455707d1583c7ef8b5afd72d32dcf5a17d1aa 100644 (file)
@@ -24,8 +24,9 @@
 
 #include "AliMonitorV0s.h"
 #include "AliMonitorHisto.h"
-#include "AliITSLoader.h"
-#include "AliV0vertex.h"
+#include "AliESD.h"
+#include "AliLog.h"
+#include <TFolder.h>
 #include <TPDGCode.h>
 
 
@@ -33,13 +34,17 @@ ClassImp(AliMonitorV0s)
 
 
 //_____________________________________________________________________________
-AliMonitorV0s::AliMonitorV0s()
+AliMonitorV0s::AliMonitorV0s():
+  AliMonitor(),
+  fRadius(NULL),
+  fMassK0(NULL),
+  fMassLambda(NULL),
+  fMassAntiLambda(NULL)
 {
 // create a monitor object for V0s
 
 }
 
-
 //_____________________________________________________________________________
 void AliMonitorV0s::CreateHistos(TFolder* folder)
 {
@@ -69,33 +74,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
-
-  AliITSLoader* itsLoader = (AliITSLoader*) runLoader->GetLoader("ITSLoader");
-  if (!itsLoader) return;
+// fill the V0s monitor histogrms
 
-  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();
 }