Fixes in order to treat correctly event and sub-event header extensions.
[u/mrichter/AliRoot.git] / MONITOR / AliMonitorV0s.cxx
CommitLineData
04fa961a 1/**************************************************************************
2 * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
3 * *
4 * Author: The ALICE Off-line Project. *
5 * Contributors are mentioned in the code where appropriate. *
6 * *
7 * Permission to use, copy, modify and distribute this software and its *
8 * documentation strictly for non-commercial purposes is hereby granted *
9 * without fee, provided that the above copyright notice appears in all *
10 * copies and that both the copyright notice and this permission notice *
11 * appear in the supporting documentation. The authors make no claims *
12 * about the suitability of this software for any purpose. It is *
13 * provided "as is" without express or implied warranty. *
14 **************************************************************************/
15
16/* $Id$ */
17
18///////////////////////////////////////////////////////////////////////////////
19// //
20// This class creates and fills the monitor histograms for V0s //
21// //
22///////////////////////////////////////////////////////////////////////////////
23
24
25#include "AliMonitorV0s.h"
26#include "AliMonitorHisto.h"
af885e0f 27#include "AliESDEvent.h"
7b4414a8 28#include "AliESDv0.h"
7ba8900c 29#include "AliLog.h"
c4bd737c 30#include <TFolder.h>
04fa961a 31#include <TPDGCode.h>
7b4414a8 32#include <TMath.h>
04fa961a 33
34
35ClassImp(AliMonitorV0s)
36
37
38//_____________________________________________________________________________
17c3cc9e 39AliMonitorV0s::AliMonitorV0s():
40 AliMonitor(),
41 fRadius(NULL),
42 fMassK0(NULL),
43 fMassLambda(NULL),
44 fMassAntiLambda(NULL)
04fa961a 45{
46// create a monitor object for V0s
47
48}
49
c4bd737c 50//_____________________________________________________________________________
04fa961a 51void AliMonitorV0s::CreateHistos(TFolder* folder)
52{
53// create the V0s monitor histograms
54
55 fFolder = folder->AddFolder("V0s", "V0s");
56
57 fRadius = CreateHisto1("Radius", "radius of V0 vertices",
58 90, 0., 3., "r_{xy} [cm]",
59 "#Delta N/N", AliMonitorHisto::kNormEvents);
60
61 fMassK0 = CreateHisto1("MassK0", "invariant mass of K^{0} candidates",
62 50, 0.4, 0.6, "m_{#pi^{+}#pi^{-}} [GeV/c^{2}]",
63 "#Delta N/N", AliMonitorHisto::kNormEvents);
64
65 fMassLambda = CreateHisto1("MassLambda",
66 "invariant mass of #Lambda candidates",
67 50, 1.0, 1.2, "m_{p#pi^{-}} [GeV/c^{2}]",
68 "#Delta N/N", AliMonitorHisto::kNormEvents);
69
70 fMassAntiLambda = CreateHisto1("MassAntiLambda",
71 "invariant mass of #bar{#Lambda} candidates",
72 50, 1.0, 1.2,
73 "m_{#bar{p}#pi^{+}} [GeV/c^{2}]",
74 "#Delta N/N", AliMonitorHisto::kNormEvents);
75}
76
77
78//_____________________________________________________________________________
b6a3610d 79void AliMonitorV0s::FillHistos(AliRunLoader* /*runLoader*/,
af885e0f 80 AliRawReader*, AliESDEvent* esd)
04fa961a 81{
b6a3610d 82// fill the V0s monitor histogrms
04fa961a 83
b6a3610d 84 for (Int_t i = 0; i < esd->GetNumberOfV0s(); i++) {
85 AliESDv0* v0 = esd->GetV0(i);
86 if (!v0) continue;
04fa961a 87 Double_t x, y, z;
b6a3610d 88 v0->GetXYZ(x, y, z);
04fa961a 89 fRadius->Fill(TMath::Sqrt(x*x + y*y));
b6a3610d 90 v0->ChangeMassHypothesis(kK0Short);
91 fMassK0->Fill(v0->GetEffMass());
92 v0->ChangeMassHypothesis(kLambda0);
93 fMassLambda->Fill(v0->GetEffMass());
94 v0->ChangeMassHypothesis(kLambda0Bar);
95 fMassAntiLambda->Fill(v0->GetEffMass());
04fa961a 96 }
04fa961a 97}