]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - MONITOR/AliMonitorV0s.cxx
Bug fix to differ high gain and low gain addresses.
[u/mrichter/AliRoot.git] / MONITOR / AliMonitorV0s.cxx
index b1f6baa1d8af8950f9902b467039f9acad60915a..7d2770aa47459203874d4c45a33235a739c30437 100644 (file)
 
 #include "AliMonitorV0s.h"
 #include "AliMonitorHisto.h"
-#include "AliITSLoader.h"
-#include "AliV0vertex.h"
-#include "AliRunLoader.h"
+#include "AliESDEvent.h"
+#include "AliESDv0.h"
+#include "AliLog.h"
 #include <TFolder.h>
-#include <TTree.h>
 #include <TPDGCode.h>
+#include <TMath.h>
 
 
 ClassImp(AliMonitorV0s) 
 
 
 //_____________________________________________________________________________
-AliMonitorV0s::AliMonitorV0s()
+AliMonitorV0s::AliMonitorV0s():
+  AliMonitor(),
+  fRadius(NULL),
+  fMassK0(NULL),
+  fMassLambda(NULL),
+  fMassAntiLambda(NULL)
 {
 // create a monitor object for V0s
 
 }
 
-//_____________________________________________________________________________
-AliMonitorV0s::AliMonitorV0s(const AliMonitorV0s& monitor) :
-  AliMonitor(monitor)
-{
-  Fatal("AliMonitorV0s", "copy constructor not implemented");
-}
-
-//_____________________________________________________________________________
-AliMonitorV0s& AliMonitorV0s::operator = (const AliMonitorV0s& /*monitor*/)
-{
-  Fatal("operator =", "assignment operator not implemented");
-  return *this;
-}
-
-
 //_____________________________________________________________________________
 void AliMonitorV0s::CreateHistos(TFolder* folder)
 {
@@ -86,33 +76,22 @@ void AliMonitorV0s::CreateHistos(TFolder* folder)
 
 
 //_____________________________________________________________________________
-void AliMonitorV0s::FillHistos(AliRunLoader* runLoader
-                              AliRawReader*)
+void AliMonitorV0s::FillHistos(AliRunLoader* /*runLoader*/
+                              AliRawReader*, AliESDEvent* 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();
 }