From: morsch Date: Tue, 20 Apr 2010 14:44:08 +0000 (+0000) Subject: The "static" was removed from the definition of some variables, X-Git-Url: http://git.uio.no/git/?a=commitdiff_plain;h=5cc3bcd28d14a7175ab23a6224958c79de7df84b;p=u%2Fmrichter%2FAliRoot.git The "static" was removed from the definition of some variables, which was not working in the cocktail generator. Bogdan Vulpescu --- diff --git a/EVGEN/AliGenCorrHF.cxx b/EVGEN/AliGenCorrHF.cxx index cba94a1a499..bc348259846 100644 --- a/EVGEN/AliGenCorrHF.cxx +++ b/EVGEN/AliGenCorrHF.cxx @@ -31,10 +31,11 @@ // Sept 09: added hadron pair composition probabilities via 2D histo (X.M. Zhang) // Oct 09: added energy choice between 7, 10, 14 TeV (for p-p), 4 TeV (for Pb-Pb), // 9 TeV (for p-Pb) and -9 TeV (for Pb-p) (S. Grigoryan) +// April 10: removed "static" from definition of some variables (B. Vulpescu) //------------------------------------------------------------------------- // How it works (for the given flavor and p-p energy): // -// 1) Reads QQbar kinematical grid from the Input file and generates +// 1) Reads QQbar kinematical grid (TTree) from the Input file and generates // quark pairs according to the weights of the cells. // It is a 5D grid in y1,y2,pt1,pt2 and deltaphi, with occupancy weights // of the cells obtained from Pythia (see details in GetQuarkPair). @@ -123,8 +124,6 @@ Int_t AliGenCorrHF::fgnptbins = 12; Double_t AliGenCorrHF::fgptbmin[12] = {0, 0.5, 1, 1.5, 2, 2.5, 3, 4, 5, 6, 7, 9}; Double_t AliGenCorrHF::fgptbmax[12] = {0.5, 1, 1.5, 2, 2.5, 3, 4, 5, 6, 7, 9, 100}; -Double_t* AliGenCorrHF::fgIntegral = 0; - //____________________________________________________________ AliGenCorrHF::AliGenCorrHF(): fFileName(0), @@ -133,7 +132,8 @@ Double_t* AliGenCorrHF::fgIntegral = 0; fEnergy(0), fBias(0.), fTrials(0), - fDecayer(0) + fDecayer(0), + fgIntegral(0) { // Default constructor } @@ -148,7 +148,8 @@ AliGenCorrHF::AliGenCorrHF(Int_t npart, Int_t idquark, Int_t energy): fBias(0.), fTrials(0), // fDecayer(new AliDecayerPythia()) - fDecayer(0) + fDecayer(0), + fgIntegral(0) { // Constructor using particle number, quark type, energy & default InputFile // @@ -202,7 +203,8 @@ AliGenCorrHF::AliGenCorrHF(char* tname, Int_t npart, Int_t idquark, Int_t energy fBias(0.), fTrials(0), // fDecayer(new AliDecayerPythia()) - fDecayer(0) + fDecayer(0), + fgIntegral(0) { // Constructor using particle number, quark type, energy & user-defined InputFile // @@ -292,9 +294,7 @@ void AliGenCorrHF::Generate() if (fQuark == 4) qm = 1.20; else qm = 4.75; - static TClonesArray *particles; - // - if(!particles) particles = new TClonesArray("TParticle",1000); + TClonesArray *particles = new TClonesArray("TParticle",1000); TDatabasePDG *pDataBase = TDatabasePDG::Instance(); // @@ -580,6 +580,8 @@ void AliGenCorrHF::Generate() header->SetNProduced(fNprimaries); AddHeader(header); + delete particles; + } //____________________________________________________________________________________ void AliGenCorrHF::IpCharm(TH2F *hProbHH, Int_t &pdg3, Int_t &pdg4) @@ -747,3 +749,4 @@ void AliGenCorrHF::GetHadronPair(TFile* fG, Int_t idq, Double_t y1, Double_t y2, pz4 = pz3; } } + diff --git a/EVGEN/AliGenCorrHF.h b/EVGEN/AliGenCorrHF.h index e4e1929bf05..4341e080102 100644 --- a/EVGEN/AliGenCorrHF.h +++ b/EVGEN/AliGenCorrHF.h @@ -39,7 +39,7 @@ class AliGenCorrHF : public AliGenMC static void IpBeauty(TH2F *hProbHH, Int_t &pdg3, Int_t &pdg4); // Computation of cumulative sums of cell wght-s, needed by GetQuarkPair - static Double_t ComputeIntegral(TFile* fG); + Double_t ComputeIntegral(TFile* fG); // fG - input file with QQbar kinematical grid (TTree) and fragm. functions (24 TH2-s) static void GetQuarkPair(TFile* fG, Double_t* fInt, Double_t &y1, Double_t &y2, Double_t &pt1, Double_t &pt2, Double_t &dphi); @@ -58,7 +58,7 @@ class AliGenCorrHF : public AliGenMC AliGenCorrHF(const AliGenCorrHF &CorrHF); AliGenCorrHF & operator=(const AliGenCorrHF & rhs); - static Double_t* fgIntegral; //! Pointer to array of cumulative sums of wght-s + Double_t* fgIntegral; //! Pointer to array of cumulative sums of wght-s static Int_t fgnptbins; // =12 Number of bins for the fragm. // function dependence on quark pt // Number of the grid bins in deltaphi, y and pt: 18, 30 and 50 @@ -81,3 +81,4 @@ class AliGenCorrHF : public AliGenMC +