1 /**************************************************************************
2 * Copyright(c) 2007-2009, ALICE Experiment at CERN, All rights reserved. *
4 * Author: The ALICE Off-line Project. *
5 * Contributors are mentioned in the code where appropriate. *
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 **************************************************************************/
16 ///////////////////////////////////////////////////////////////////////////////
18 // Class with ZDC reconstruction parameters //
19 // Origin: Chiara.Oppedisano@to.infn.it //
21 ///////////////////////////////////////////////////////////////////////////////
28 #include "AliZDCRecoParam.h"
29 #include "AliZDCRecoParamPbPb.h"
31 ClassImp(AliZDCRecoParamPbPb)
33 //_____________________________________________________________________________
34 AliZDCRecoParamPbPb::AliZDCRecoParamPbPb() :
43 //_____________________________________________________________________________
44 AliZDCRecoParamPbPb::AliZDCRecoParamPbPb(TH1D *hNpart, TH1D *hb, Float_t clkCent) :
51 //Standard constructor
54 //______________________________________________________________________________
55 AliZDCRecoParamPbPb::AliZDCRecoParamPbPb(const AliZDCRecoParamPbPb &oldrecopar) :
59 fClkCenter(oldrecopar.fClkCenter)
62 if(oldrecopar.fhNpartDist){
63 fhNpartDist = new TH1D(*oldrecopar.fhNpartDist);
64 fhNpartDist->SetDirectory(0);
66 if(oldrecopar.fhbDist){
67 fhbDist = new TH1D(*oldrecopar.fhbDist);
68 fhbDist->SetDirectory(0);
72 //_____________________________________________________________________________
73 AliZDCRecoParamPbPb &AliZDCRecoParamPbPb::operator =(const AliZDCRecoParamPbPb &recpar)
76 this->~AliZDCRecoParamPbPb();
77 new(this) AliZDCRecoParamPbPb(recpar);
82 //_____________________________________________________________________________
83 AliZDCRecoParamPbPb::~AliZDCRecoParamPbPb()
87 if(fhNpartDist) delete fhNpartDist;
88 if(fhbDist) delete fhbDist;
91 //_____________________________________________________________________________
92 void AliZDCRecoParamPbPb::SetGlauberMCDist(Float_t beamEnergy)
94 // Setting Glauber MC distributions
95 // from histos file stored in $ALICE_ROOT/ZDC
99 TFile *fileGlauberMC = TFile::Open("$ALICE_ROOT/ZDC/GlauberMCDist.root");
101 AliError((" Opening file $ALICE_ROOT/ZDC/GlauberMCDist.root failed\n"));
105 Float_t sqrtS = 2*beamEnergy;
107 if(TMath::Abs(sqrtS-5500) < 100.){
108 AliDebug(2, " ZDC -> Looking for energy5500 in file $ALICE_ROOT/ZDC/GlauberMCDist.root");
109 fileGlauberMC->cd("energy5500");
110 fileGlauberMC->GetObject("energy5500/hbGlauber;1", fhbDist);
111 if(!fhbDist) AliError(" PROBLEM!!! Can't get Glauber MC b distribution from file GlauberMCDist.root\n");
112 fileGlauberMC->GetObject("energy5500/hNpartGlauber;1", fhNpartDist);
113 if(!fhNpartDist) AliError(" PROBLEM!!! Can't get Glauber MC Npart distribution from file GlauberMCDist.root\n");
115 else if(TMath::Abs(sqrtS-2760) < 100.){
116 AliDebug(2, " ZDC -> Looking for energy2760 in file $ALICE_ROOT/ZDC/GlauberMCDist.root");
117 fileGlauberMC->cd("energy2760");
118 fileGlauberMC->GetObject("energy2760/hbGlauber;1", fhbDist);
119 if(!fhbDist) AliError(" PROBLEM!!! Can't get Glauber MC b distribution from file GlauberMCDist.root\n");
120 fileGlauberMC->GetObject("energy2760/hNpartGlauber;1", fhNpartDist);
121 if(!fhNpartDist) AliError(" PROBLEM!!! Can't get Glauber MC Npart distribution from file GlauberMCDist.root\n");
123 else AliError(Form(" No AliZDCRecoParam provided for Pb-Pb @ sqrt(s) = %1.0f GeV\n", sqrtS));
125 fhNpartDist->SetDirectory(0);
126 fhbDist->SetDirectory(0);
128 fileGlauberMC->Close();
131 //_____________________________________________________________________________
132 AliZDCRecoParamPbPb *AliZDCRecoParamPbPb::GetHighFluxParam(Float_t beamEnergy)
134 // Create high flux reco parameter
135 TH1::AddDirectory(0);
136 TH2::AddDirectory(0);
138 TFile *fileGlauberMC = TFile::Open("$ALICE_ROOT/ZDC/GlauberMCDist.root");
140 printf(" Opening file $ALICE_ROOT/ZDC/GlauberMCDist.root failed\n");
144 Float_t sqrtS = 2*beamEnergy;
146 TH1D *hNpartDist=0x0, *hbDist=0x0;
147 if(TMath::Abs(sqrtS-5500)<100.){
148 fileGlauberMC->cd("energy5500");
149 fileGlauberMC->GetObject("energy5500/hNpartGlauber;1", hNpartDist);
150 if(!hNpartDist) printf(" AliZDCRecoParamPbPb::GetHighFluxParam() PROBLEM!!! Can't get Glauber MC Npart distribution from file GlauberMCDist.root\n");
151 fileGlauberMC->GetObject("energy5500/hbGlauber;1", hbDist);
152 if(!hbDist) printf(" AliZDCRecoParamPbPb::GetHighFluxParam() PROBLEM!!! Can't get Glauber MC b distribution from file GlauberMCDist.root\n");
154 else if(TMath::Abs(sqrtS-2760)<100.){
155 fileGlauberMC->cd("energy2760");
156 fileGlauberMC->GetObject("energy2760/hNpartGlauber;1", hNpartDist);
157 if(!hNpartDist) printf(" PROBLEM!!! Can't get Glauber MC Npart distribution from file GlauberMCDist.root\n");
158 fileGlauberMC->GetObject("energy2760/hbGlauber;1", hbDist);
159 if(!hbDist) printf(" AliZDCRecoParamPbPb::GetHighFluxParam() PROBLEM!!! Can't get Glauber MC b distribution from file GlauberMCDist.root\n");
161 else printf(" No AliZDCRecoParam provided for Pb-Pb @ sqrt(s) = %1.0f GeV\n", sqrtS);
163 if(hNpartDist) hNpartDist->SetDirectory(0);
164 if(hbDist) hbDist->SetDirectory(0);
166 AliZDCRecoParamPbPb* zdcRecoParam = new AliZDCRecoParamPbPb(hNpartDist, hbDist, 0.1);
168 fileGlauberMC->Close();