]> git.uio.no Git - u/mrichter/AliRoot.git/blob - PWG2/UNICOR/AliUnicorAnalGlobal.cxx
Changing once more (hopefully we get it correct this time...) the logic to trig the...
[u/mrichter/AliRoot.git] / PWG2 / UNICOR / AliUnicorAnalGlobal.cxx
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
31 class TH2;
32 ClassImp(AliUnicorAnalGlobal)
33   
34 //=============================================================================
35 AliUnicorAnalGlobal::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 }
54 //=============================================================================
55 void AliUnicorAnalGlobal::Process(AliUnicorEvent *ev) const
56 {
57   // fill event variable histograms
58
59   TH1D *mult = (TH1D*) fHistos.At(0);
60   TH1D *cent = (TH1D*) fHistos.At(1);
61   TH2D *dire = (TH2D*) fHistos.At(2);
62   TH1D *zver = (TH1D*) fHistos.At(3);
63
64   mult->Fill(ev->NParticles(),1.0);
65   cent->Fill(ev->Centrality(),1.0);
66   Double_t qx,qy;
67   ev->RP(qx,qy);
68   dire->Fill(qx,qy,1.0);
69   zver->Fill(ev->Zver(),1.0);
70 }
71 //=============================================================================