]> git.uio.no Git - u/mrichter/AliRoot.git/blame - ZDC/AliZDCRecoParamPbPb.cxx
Warning removal
[u/mrichter/AliRoot.git] / ZDC / AliZDCRecoParamPbPb.cxx
CommitLineData
7bff3766 1/**************************************************************************
2 * Copyright(c) 2007-2009, 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///////////////////////////////////////////////////////////////////////////////
17// //
18// Class with ZDC reconstruction parameters //
19// Origin: Chiara.Oppedisano@to.infn.it //
20// //
21///////////////////////////////////////////////////////////////////////////////
22
73bc3a3f 23#include <TFile.h>
24#include <TTree.h>
25#include <TH2F.h>
26#include <TH1D.h>
7bff3766 27
7bff3766 28#include "AliZDCRecoParam.h"
29#include "AliZDCRecoParamPbPb.h"
30
31ClassImp(AliZDCRecoParamPbPb)
32
33//_____________________________________________________________________________
34AliZDCRecoParamPbPb::AliZDCRecoParamPbPb() :
35 AliZDCRecoParam(),
73bc3a3f 36 fhZDCvsZEM(0x0),
37 fhZDCCvsZEM(0x0),
38 fhZDCAvsZEM(0x0),
39 fhNpartDist(0x0),
40 fhbDist(0x0),
41 fClkCenter(0)
7bff3766 42{
43 //
44 //Default constructor
45}
46//_____________________________________________________________________________
73bc3a3f 47AliZDCRecoParamPbPb::AliZDCRecoParamPbPb(TH2F *hZDCvsZEM, TH2F *hZDCCvsZEM, TH2F *hZDCAvsZEM) :
48 AliZDCRecoParam(),
49 fhZDCvsZEM(hZDCvsZEM),
50 fhZDCCvsZEM(hZDCCvsZEM),
51 fhZDCAvsZEM(hZDCAvsZEM),
52 fhNpartDist(0x0),
53 fhbDist(0x0),
54 fClkCenter(0.1)
7bff3766 55{
73bc3a3f 56 //
57 //Standard constructor
58 SetGlauberMCDist();
59}
60//_____________________________________________________________________________
61AliZDCRecoParamPbPb::AliZDCRecoParamPbPb(TH2F *hZDCvsZEM, TH2F *hZDCCvsZEM, TH2F *hZDCAvsZEM,
62 TH1D *hNpart, TH1D *hb, Float_t clkCent) :
63 AliZDCRecoParam(),
64 fhZDCvsZEM(hZDCvsZEM),
65 fhZDCCvsZEM(hZDCCvsZEM),
66 fhZDCAvsZEM(hZDCAvsZEM),
67 fhNpartDist(hNpart),
68 fhbDist(hb),
69 fClkCenter(clkCent)
70{
71 //
72 //Standard constructor
73}
7bff3766 74
73bc3a3f 75//______________________________________________________________________________
76AliZDCRecoParamPbPb::AliZDCRecoParamPbPb(const AliZDCRecoParamPbPb &oldrecopar) :
77 AliZDCRecoParam(),
78 fhZDCvsZEM(0x0),
79 fhZDCCvsZEM(0x0),
80 fhZDCAvsZEM(0x0),
81 fhNpartDist(0x0),
82 fhbDist(0x0),
83 fClkCenter(oldrecopar.fClkCenter)
84{
85 //Copy constructor
86 if(oldrecopar.fhZDCvsZEM){
87 fhZDCvsZEM = new TH2F(*oldrecopar.fhZDCvsZEM);
88 fhZDCvsZEM->SetDirectory(0);
89 }
90 if(oldrecopar.fhZDCCvsZEM){
91 fhZDCCvsZEM = new TH2F(*oldrecopar.fhZDCCvsZEM);
92 fhZDCCvsZEM->SetDirectory(0);
93 }
94 if(oldrecopar.fhZDCAvsZEM){
95 fhZDCAvsZEM = new TH2F(*oldrecopar.fhZDCAvsZEM);
96 fhZDCAvsZEM->SetDirectory(0);
97 }
98 if(oldrecopar.fhNpartDist){
99 fhNpartDist = new TH1D(*oldrecopar.fhNpartDist);
100 fhNpartDist->SetDirectory(0);
101 }
102 if(oldrecopar.fhbDist){
103 fhbDist = new TH1D(*oldrecopar.fhbDist);
104 fhbDist->SetDirectory(0);
105 }
106}
db0907f4 107
108//_____________________________________________________________________________
109AliZDCRecoParamPbPb &AliZDCRecoParamPbPb::operator =(const AliZDCRecoParamPbPb &recpar)
110{
111 //assignment operator
112 fhZDCvsZEM = recpar.GethZDCvsZEM();
113 fhZDCCvsZEM = recpar.GethZDCCvsZEM();
114 fhZDCAvsZEM = recpar.GethZDCAvsZEM();
115 fhNpartDist = recpar.GethNpartDist();
116 fhbDist = recpar.GethbDist();
117 fClkCenter = recpar.GetClkCenter();
118
119}
73bc3a3f 120
121//_____________________________________________________________________________
122AliZDCRecoParamPbPb::~AliZDCRecoParamPbPb()
123{
124 // destructor
7bff3766 125
73bc3a3f 126 if(fhZDCvsZEM) delete fhZDCvsZEM;
127 if(fhZDCCvsZEM) delete fhZDCCvsZEM;
128 if(fhZDCAvsZEM) delete fhZDCAvsZEM;
129 if(fhNpartDist) delete fhNpartDist;
130 if(fhbDist) delete fhbDist;
7bff3766 131}
132
133//_____________________________________________________________________________
73bc3a3f 134AliZDCRecoParamPbPb *AliZDCRecoParamPbPb::GetPbPbRecoParam() const
7bff3766 135{
136 //
73bc3a3f 137 // Makes default reconstruction parameters for Pb-Pb collisions
7bff3766 138 //
73bc3a3f 139 AliZDCRecoParamPbPb *param = new AliZDCRecoParamPbPb();
7bff3766 140 return param;
141
142}
143
144//_____________________________________________________________________________
73bc3a3f 145void AliZDCRecoParamPbPb::SetGlauberMCDist()
7bff3766 146{
73bc3a3f 147 // Setting Glauber MC distributions
148 // from histos file stored in $ALICE_ROOT/ZDC
149 TFile * fileHistos = TFile::Open("$ALICE_ROOT/ZDC/GlauberMCHistos.root");
7bff3766 150 //
73bc3a3f 151 fhNpartDist = (TH1D*) fileHistos->Get("hDist");
152 fhNpartDist->SetDirectory(0);
153 fhbDist = (TH1D*) fileHistos->Get("hbDist");
154 fhbDist->SetDirectory(0);
7bff3766 155
73bc3a3f 156 fileHistos->Close();
7bff3766 157}