]> git.uio.no Git - u/mrichter/AliRoot.git/blame - PWG2/UNICOR/AliUnicorAnalGlobal.cxx
Bug coreected in PTM gain array indexes
[u/mrichter/AliRoot.git] / PWG2 / UNICOR / AliUnicorAnalGlobal.cxx
CommitLineData
621688e4 1/*************************************************************************
2* Copyright(c) 1998-2048, 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// Author: Dariusz Miskowiec <mailto:d.miskowiec@gsi.de> 2007
17
18//=============================================================================
19// event global variable analyzer
20// Histogram the event variables like multiplicity, flow vector, vertex z,
21// etc.
22//=============================================================================
23
24#include <TROOT.h>
25#include <TH1.h>
26#include <TH2.h>
27#include "AliUnicorEvent.h"
28#include "AliUnicorAnalGlobal.h"
29
30
31class TH2;
32ClassImp(AliUnicorAnalGlobal)
33
34//=============================================================================
35AliUnicorAnalGlobal::AliUnicorAnalGlobal(Char_t *nam) : AliUnicorAnal(nam)
36{
37 // constructor
38
39 TH1D *mult = new TH1D("mult","mult",5000,-0.5,4999.5);
40 mult->SetXTitle("multiplicity");
41 TH1D *cent = new TH1D("cent","cent",100,0,1);
42 cent->SetXTitle("centrality");
43 TH2D *dire = new TH2D("dire","dire",100,-40,40,100,-40,40);
44 dire->SetXTitle("Qx (GeV)");
45 dire->SetYTitle("Qy (GeV)");
46 TH1D *zver = new TH1D("zver","zver",120,-1.2,1.2);
47 zver->SetXTitle("normalized z-vertex");
48 fHistos.Add(mult);
49 fHistos.Add(cent);
50 fHistos.Add(dire);
51 fHistos.Add(zver);
52 gROOT->cd();
53 printf("%s object named %s created\n",ClassName(),GetName());
54}
55//=============================================================================
56void AliUnicorAnalGlobal::Process(AliUnicorEvent *ev) const
57{
58 // fill event variable histograms
59
60 TH1D *mult = (TH1D*) fHistos.At(0);
61 TH1D *cent = (TH1D*) fHistos.At(1);
62 TH2D *dire = (TH2D*) fHistos.At(2);
63 TH1D *zver = (TH1D*) fHistos.At(3);
64
65 mult->Fill(ev->NParticles(),1.0);
66 cent->Fill(ev->Centrality(),1.0);
67 Double_t qx,qy;
68 ev->RP(qx,qy);
69 dire->Fill(qx,qy,1.0);
70 zver->Fill(ev->Zver(),1.0);
71}
72//=============================================================================