From 3bc7f4d6cb6be58bd8087bee71b218f64f2d26a3 Mon Sep 17 00:00:00 2001 From: morsch Date: Wed, 4 Feb 2009 15:40:50 +0000 Subject: [PATCH] Fast generator for prompt photons (Serguei Kiselev) --- EVGEN/AliGenPromptPhotons.cxx | 428 ++++++++++++++++++++++++++++++++++ EVGEN/AliGenPromptPhotons.h | 95 ++++++++ EVGEN/EVGENLinkDef.h | 1 + EVGEN/libEVGEN.pkg | 2 +- 4 files changed, 525 insertions(+), 1 deletion(-) create mode 100644 EVGEN/AliGenPromptPhotons.cxx create mode 100644 EVGEN/AliGenPromptPhotons.h diff --git a/EVGEN/AliGenPromptPhotons.cxx b/EVGEN/AliGenPromptPhotons.cxx new file mode 100644 index 00000000000..235ed7497f1 --- /dev/null +++ b/EVGEN/AliGenPromptPhotons.cxx @@ -0,0 +1,428 @@ +/************************************************************************** + * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. * + * * + * Author: The ALICE Off-line Project. * + * Contributors are mentioned in the code where appropriate. * + * * + * Permission to use, copy, modify and distribute this software and its * + * documentation strictly for non-commercial purposes is hereby granted * + * without fee, provided that the above copyright notice appears in all * + * copies and that both the copyright notice and this permission notice * + * appear in the supporting documentation. The authors make no claims * + * about the suitability of this software for any purpose. It is * + * provided "as is" without express or implied warranty. * + **************************************************************************/ + +//------------------------------------------------------------------------- +// author: Sergey Kiselev, ITEP, Moscow +// e-mail: Sergey.Kiselev@cern.ch +// tel.: 007 495 129 95 45 +//------------------------------------------------------------------------- +// Generator of prompt photons for the reaction A+B, sqrt(S) +// +// main assumptions: +// 1. flat rapidity distribution +// 2. all existing p+p(pbar) data at y_{c.m.} can be described by the function +// F(x_T) = (sqrt(s))^5 Ed^3sigma/d^3p, x_T = 2p_t/sqrt(s) +// all data points cover the region x_T: 0.01 - 0.6 +// see Nucl.Phys.A783:577-582,2007, hep-ex/0609037 +// 3. binary scaling: for A+B at the impact parameter b +// Ed^3N^{AB}(b)/d^3p = Ed^3sigma^{pp}/d^3p A B T_{AB}(b), +// T_{AB}(b) - nuclear overlapping fuction, calculated in the Glauber approach, +// nuclear density is parametrized by a Woods-Saxon with nuclear radius +// R_A = 1.19 A^{1/3} - 1.61 A^{-1/3} fm and surface thickness a=0.54 fm +// 4. nuclear effects (Cronin, shadowing, ...) are ignored +// +// input parameters: +// fAProjectile, fATarget - number of nucleons in a nucleus A and B +// fMinImpactParam - minimal impct parameter, fm +// fMaxImpactParam - maximal impct parameter, fm +// fEnergyCMS - sqrt(S) per nucleon pair, AGeV +// +// fYMin - minimal rapidity of photons +// fYMax - maximal rapidity of photons +// fPtMin - minimal p_t value of gamma, GeV/c +// fPtMax - maximal p_t value of gamma, GeV/c +//------------------------------------------------------------------------- +// comparison with SPS and RHIC data, prediction for LHC can be found in +// arXiv:0811.2634 [nucl-th] +//------------------------------------------------------------------------- + +//Begin_Html +/* + + +
+ +

The responsible person for this module is +Andreas Morsch. + +

+*/
+//End_Html
+//                                                               //
+///////////////////////////////////////////////////////////////////
+
+#include 
+#include 
+
+#include "AliConst.h"
+#include "AliGenEventHeader.h"
+#include "AliGenPromptPhotons.h"
+#include "AliLog.h"
+#include "AliRun.h"
+
+ClassImp(AliGenPromptPhotons)
+
+TF1*    AliGenPromptPhotons::fDataPt        = NULL;
+TF1*    AliGenPromptPhotons::fWSzA          = NULL;
+TF1*    AliGenPromptPhotons::fWSzB          = NULL;
+TF1*    AliGenPromptPhotons::fTA            = NULL;
+TF1*    AliGenPromptPhotons::fTB            = NULL;
+TF1*    AliGenPromptPhotons::fTAxTB         = NULL;
+TF1*    AliGenPromptPhotons::fTAB           = NULL;
+
+//_____________________________________________________________________________
+AliGenPromptPhotons::AliGenPromptPhotons()
+    :AliGenerator(-1),
+        fAProjectile(0.),
+        fATarget(0.),
+        fEnergyCMS(0.),
+        fMinImpactParam(0.),
+        fMaxImpactParam(0.)
+{
+    //
+    // Default constructor
+    //
+    SetCutVertexZ();
+    SetPtRange();
+    SetYRange();
+}
+
+//_____________________________________________________________________________
+AliGenPromptPhotons::AliGenPromptPhotons(Int_t npart)
+    :AliGenerator(npart),
+        fAProjectile(208),
+        fATarget(208),
+        fEnergyCMS(5500.),
+        fMinImpactParam(0.),
+        fMaxImpactParam(0.)
+{
+  // 
+  // Standard constructor
+  //
+
+    fName="PromptPhotons";
+    fTitle="Prompt photons from pp data fit + T_AB";
+
+    SetCutVertexZ();
+    SetPtRange();
+    SetYRange();
+}
+
+//_____________________________________________________________________________
+AliGenPromptPhotons::~AliGenPromptPhotons()
+{
+  //
+  // Standard destructor
+  //
+    delete fDataPt;
+    delete fWSzA;
+    delete fWSzB;
+    delete fTA;
+    delete fTB;
+    delete fTAxTB;
+    delete fTAB;
+}
+
+//_____________________________________________________________________________
+void AliGenPromptPhotons::Init()
+{
+
+  fDataPt = new TF1("fDataPt",fitData,fPtMin,fPtMax,1);
+  fDataPt->SetParameter(0,fEnergyCMS);
+
+  const Double_t d=0.54;  // surface thickness (fm)
+  const Double_t RA=1.19*TMath::Power(fAProjectile,1./3.)-1.61/TMath::Power(fAProjectile,1./3.);
+  const Double_t eps=0.01; // cut WS at RAMAX: WS(RAMAX)/WS(0)=eps
+  const Double_t RAMAX=RA+d*TMath::Log((1.-eps+TMath::Exp(-RA/d))/eps);
+
+  TF1 fWSforNormA("fWSforNormA",&WSforNorm,0,RAMAX,2);
+  fWSforNormA.SetParameters(RA,d);
+  fWSforNormA.SetParNames("RA","d");
+  const Double_t CA=1./fWSforNormA.Integral(0.,RAMAX);
+
+  const Double_t RB=1.19*TMath::Power(fATarget,1./3.)-1.61/TMath::Power(fATarget,1./3.);
+  const Double_t RBMAX=RB+d*TMath::Log((1.-eps+TMath::Exp(-RB/d))/eps);
+
+  TF1 fWSforNormB("fWSforNormB",&WSforNorm,0,RBMAX,2);
+  fWSforNormB.SetParameters(RB,d);
+  fWSforNormB.SetParNames("RB","d");
+  const Double_t CB=1./fWSforNormB.Integral(0.,RBMAX);
+
+  fWSzA = new TF1("fWSzA",WSz,0.,RAMAX,4);
+  fWSzA->SetParameter(0,RA);
+  fWSzA->SetParameter(1,d);
+  fWSzA->SetParameter(2,CA);
+
+  fTA = new TF1("fTA",TA,0.,RAMAX,1);
+  fTA->SetParameter(0,RAMAX);
+
+  fWSzB = new TF1("fWSzB",WSz,0.,RBMAX,4);
+  fWSzB->SetParameter(0,RB);
+  fWSzB->SetParameter(1,d);
+  fWSzB->SetParameter(2,CB);
+
+  fTB = new TF1("fTB",TB,0.,TMath::Pi(),3);
+  fTB->SetParameter(0,RBMAX);
+
+  fTAxTB = new TF1("fTAxTB",TAxTB,0,RAMAX,2);
+  fTAxTB->SetParameter(0,RBMAX);
+
+  fTAB = new TF1("fTAB",TAB,0.,RAMAX+RBMAX,2);
+  fTAB->SetParameter(0,RAMAX);
+  fTAB->SetParameter(1,RBMAX);
+
+}
+
+//_____________________________________________________________________________
+void AliGenPromptPhotons::Generate()
+{
+  //
+  // Generate thermal photons of a event 
+  //
+
+    Float_t polar[3]= {0,0,0};
+    Float_t origin[3];
+    Float_t p[3];
+    Float_t random[6];
+    Int_t nt;
+
+    for (Int_t j=0;j<3;j++) origin[j]=fOrigin[j];
+/*
+    if(fVertexSmear==kPerEvent) {
+      Vertex();
+      for (j=0;j<3;j++) origin[j]=fVertex[j];
+    }
+*/
+    TArrayF eventVertex;
+    eventVertex.Set(3);
+    eventVertex[0] = origin[0];
+    eventVertex[1] = origin[1];
+    eventVertex[2] = origin[2];
+
+    Int_t nGam;
+    Float_t b,pt,rapidity,phi,ww;
+
+    b=TMath::Sqrt(fMinImpactParam*fMinImpactParam+(fMaxImpactParam*fMaxImpactParam-fMinImpactParam*fMinImpactParam)*gRandom->Rndm());
+
+    Double_t dsdyPP=fDataPt->Integral(fPtMin,fPtMax); // pb, fm^2 = 1e10 pb
+    ww=dsdyPP*1.0e-10*(fYMax-fYMin)*fAProjectile*fATarget*fTAB->Eval(b);
+    nGam=Int_t(ww);
+    if(gRandom->Rndm() < (ww-(Float_t)nGam)) nGam++;
+
+      if(nGam) {
+        for(Int_t i=0; iGetRandom();
+          Rndm(random,2);
+          rapidity=(fYMax-fYMin)*random[0]+fYMin;
+          phi=2.*TMath::Pi()*random[1];
+          p[0]=pt*TMath::Cos(phi);
+          p[1]=pt*TMath::Sin(phi);
+          p[2]=pt*TMath::SinH(rapidity);
+
+	  if(fVertexSmear==kPerTrack) {
+            Rndm(random,6);
+	    for (Int_t j=0;j<3;j++) {
+	      origin[j]=fOrigin[j]+fOsigma[j]*TMath::Cos(2*random[2*j]*TMath::Pi())*
+	      TMath::Sqrt(-2*TMath::Log(random[2*j+1]));
+	    }
+	  }
+
+	  PushTrack(fTrackIt,-1,22,p,origin,polar,0,kPPrimary,nt,1.);
+        }
+      }
+
+// Header
+    AliGenEventHeader* header = new AliGenEventHeader("PromptPhotons");
+// Event Vertex
+    header->SetPrimaryVertex(eventVertex);
+    header->SetNProduced(fNpart);
+    gAlice->SetGenEventHeader(header);
+
+}
+
+void AliGenPromptPhotons::SetPtRange(Float_t ptmin, Float_t ptmax) {
+    AliGenerator::SetPtRange(ptmin, ptmax);
+}
+
+void AliGenPromptPhotons::SetYRange(Float_t ymin, Float_t ymax) {
+    AliGenerator::SetYRange(ymin, ymax);
+}
+
+//**********************************************************************************
+Double_t AliGenPromptPhotons::fitData(Double_t* x, Double_t* par) {
+//---------------------------------------------------
+// input:
+// x[0] - p_t (GeV).
+// par[0]=sqrt(s_NN) (GeV),
+//
+// output:
+// d^{2}#sigma/(dp_t dy) (pb/GeV)
+//---------------------------------------------------
+//
+// d^{2}#sigma/(dp_t dy) = (2 pi p_t) Ed^{3}#sigma/d^{3}p 
+//
+// data presentation: Nucl.Phys.A783:577-582,2007, hep-ex/0609037, fig.3
+// F(x_t)=(#sqrt{s})^{5} Ed^{3}#sigma/d^{3}p
+//---------------------------------------------------
+// approximate tabulation of F(x_t)
+  const Int_t nMax=4;
+  const Double_t log10x[nMax]={ -2., -1., -0.6, -0.3};
+  const Double_t log10F[nMax]={ 19., 13.,  9.8,   7.};
+
+  const Double_t xT=2.*x[0]/par[0];
+  const Double_t log10xT=TMath::Log10(xT);
+  Int_t i=0;
+  while(log10xT>log10x[i] && iSetParameter(3,b);
+
+  return 2.*fWSzA->Integral(0.,TMath::Sqrt(RAMAX*RAMAX-b*b));
+}
+
+//**********************************************************************************
+Double_t AliGenPromptPhotons::TB(Double_t* x, Double_t* par) {
+//---------------------------------------------------
+// input:
+// x[0] - phi (rad)
+// par[0] - RBMAX (fm), max. value of target radius
+// par[1] - b (fm), impact parameter
+// par[2] - s (fm)
+//
+// output:
+//  nuclear thickness function T_B(phi)=T_B(sqtr(s**2+b**2-2*s*b*cos(phi)))
+//---------------------------------------------------
+  const Double_t phi=x[0];
+  const Double_t RBMAX=par[0],b=par[1],s=par[2];
+
+  const Double_t w=TMath::Sqrt(s*s+b*b-2.*s*b*TMath::Cos(phi));
+
+  fWSzB->SetParameter(3,w);
+
+  return 2.*fWSzB->Integral(0.,TMath::Sqrt(RBMAX*RBMAX-w*w));;
+}
+
+//**********************************************************************************
+Double_t AliGenPromptPhotons::TAxTB(Double_t* x, Double_t* par) {
+//---------------------------------------------------
+// input:
+// x[0] - s (fm)
+// par[0] - RBMAX (fm), max. value of target radius
+// par[1] - b (fm), impact parameter
+//
+// output:
+//  s * TA(s) * 2 * Integral(0,phiMax) TB(phi(s,b))
+//---------------------------------------------------
+  const Double_t s  = x[0];
+  const Double_t RBMAX=par[0],b=par[1];
+
+  if(s==0.) return 0.;
+
+  fTB->SetParameter(1,b);
+  fTB->SetParameter(2,s);
+
+  Double_t phiMax;
+  if(bEval(s)*2.*fTB->Integral(0.,phiMax);
+}
+
+// ---------------------------------------------------------------------------------
+Double_t AliGenPromptPhotons::TAB(Double_t* x, Double_t* par) {
+//---------------------------------------------------
+// input:
+// x[0] - b (fm), impact parameter
+// par[0] - RAMAX (fm), max. value of projectile radius
+// par[1] - RAMAX (fm), max. value of target radius
+//
+// output:
+// overlap function TAB(b) (1/fm**2)
+//---------------------------------------------------
+  const Double_t b=x[0];
+  const Double_t RAMAX=par[0],RBMAX=par[1];
+
+  Double_t sMin=0.,sMax=RAMAX;
+  if(b>RBMAX) sMin=b-RBMAX;
+  if(b<(RAMAX-RBMAX)) sMax=b+RBMAX;
+
+  fTAxTB->SetParameter(1,b);
+
+  return fTAxTB->Integral(sMin,sMax);
+}
diff --git a/EVGEN/AliGenPromptPhotons.h b/EVGEN/AliGenPromptPhotons.h
new file mode 100644
index 00000000000..8c256726bdb
--- /dev/null
+++ b/EVGEN/AliGenPromptPhotons.h
@@ -0,0 +1,95 @@
+#ifndef ALIGENPROMPTPHOTONS_H
+#define ALIGENPROMPTPHOTONS_H
+/* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
+ * See cxx source for full Copyright notice                               */
+
+//-------------------------------------------------------------------------
+// author: Sergey Kiselev, ITEP, Moscow
+// e-mail: Sergey.Kiselev@cern.ch
+// tel.: 007 495 129 95 45
+//-------------------------------------------------------------------------
+// Generator of prompt photons for the reaction A+B, sqrt(S)
+//
+// main assumptions:
+// 1. flat rapidity distribution
+// 2. all existing p+p(pbar) data at y_{c.m.} can be described by the function
+//           F(x_T) = (sqrt(s))^5 Ed^3sigma/d^3p, x_T = 2p_t/sqrt(s)
+//           all data points cover the region x_T: 0.01 - 0.6
+//    see Nucl.Phys.A783:577-582,2007, hep-ex/0609037
+// 3. binary scaling: for A+B at the impact parameter b
+//    Ed^3N^{AB}(b)/d^3p = Ed^3sigma^{pp}/d^3p A B T_{AB}(b),
+//    T_{AB}(b) - nuclear overlapping fuction, calculated in the Glauber approach,
+//                nuclear density is parametrized by a Woods-Saxon with nuclear radius
+//                R_A = 1.19 A^{1/3} - 1.61 A^{-1/3} fm and surface thickness a=0.54 fm
+// 4. nuclear effects (Cronin, shadowing, ...) are ignored
+//
+// input parameters:
+//       fAProjectile, fATarget - number of nucleons in a nucleus A and B
+//       fMinImpactParam - minimal impct parameter, fm
+//       fMaxImpactParam - maximal impct parameter, fm
+//       fEnergyCMS - sqrt(S) per nucleon pair, AGeV
+//
+//       fYMin - minimal rapidity of photons 
+//       fYMax - maximal rapidity of photons
+//       fPtMin - minimal p_t value of gamma, GeV/c
+//       fPtMax - maximal p_t value of gamma, GeV/c
+//-------------------------------------------------------------------------
+// comparison with SPS and RHIC data, prediction for LHC can be found in
+// arXiv:0811.2634 [nucl-th]
+//-------------------------------------------------------------------------
+
+class TF1;
+
+#include "AliGenerator.h"
+
+class AliGenPromptPhotons : public AliGenerator
+{
+ public:
+
+  AliGenPromptPhotons();
+  AliGenPromptPhotons(Int_t npart);
+  virtual ~AliGenPromptPhotons();
+  virtual void Generate();
+  virtual void Init();
+  virtual void SetPtRange(Float_t ptmin = 0.1, Float_t ptmax=10.);
+  virtual void SetYRange(Float_t ymin = -1., Float_t ymax=1.);
+
+// Setters
+    virtual void SetAProjectile(Float_t a = 208) {fAProjectile = a;}
+    virtual void SetATarget(Float_t a = 208)     {fATarget     = a;}
+    virtual void SetEnergyCMS(Float_t energy = 5500.) {fEnergyCMS = energy;}
+    virtual void    SetImpactParameterRange(Float_t bmin = 0., Float_t bmax = 0.)
+	{fMinImpactParam=bmin; fMaxImpactParam=bmax;}
+
+ protected:
+  Float_t fAProjectile;     // Projectile nucleus mass number
+  Float_t fATarget;         // Target nucleus mass number
+  Float_t fEnergyCMS;       // Center of mass energy
+  Float_t fMinImpactParam;  // minimum impact parameter
+  Float_t fMaxImpactParam;  // maximum impact parameter	
+  
+  static Double_t fitData      (Double_t *xx, Double_t *par);
+  static Double_t WSforNorm    (Double_t *xx, Double_t *par);
+  static Double_t WSz          (Double_t *xx, Double_t *par);
+  static Double_t TA           (Double_t *xx, Double_t *par);
+  static Double_t TB           (Double_t *xx, Double_t *par);
+  static Double_t TAxTB        (Double_t *xx, Double_t *par);
+  static Double_t TAB          (Double_t *xx, Double_t *par);
+
+  static TF1 *fDataPt;             // d^{2}#sigma^{pp}/(dp_t dy) from data fit 
+  static TF1 *fWSzA;               // Wood Saxon parameterisation for nucleus A 
+  static TF1 *fWSzB;               // Wood Saxon parameterisation for nucleus B 
+  static TF1 *fTA;                 // nuclear thickness function T_A(b) (1/fm**2) 
+  static TF1 *fTB;                 // nuclear thickness function T_B(phi)=T_B(sqtr(s**2+b**2-2*s*b*cos(phi))) 
+  static TF1 *fTAxTB;              // s * TA(s) * 2 * Integral(0,phiMax) TB(phi(s,b)) 
+  static TF1 *fTAB;                // overlap function T_AB(b) (1/fm**2) 
+  
+ private:
+
+  AliGenPromptPhotons(const AliGenPromptPhotons & PromptPhotons);
+  AliGenPromptPhotons& operator = (const AliGenPromptPhotons & PromptPhotons) ;
+
+
+  ClassDef(AliGenPromptPhotons, 1) // prompt photon generator
+};
+#endif
diff --git a/EVGEN/EVGENLinkDef.h b/EVGEN/EVGENLinkDef.h
index b93a166d184..ebb4eaaa8d6 100644
--- a/EVGEN/EVGENLinkDef.h
+++ b/EVGEN/EVGENLinkDef.h
@@ -58,5 +58,6 @@
 #pragma link C++ class  AliGenCosmicsParam+;
 #pragma link C++ class  AliGenKrypton+;
 #pragma link C++ class  AliGenThermalPhotons+;
+#pragma link C++ class  AliGenPromptPhotons+;
 #pragma link C++ class  AliGenPileup+;
 #endif
diff --git a/EVGEN/libEVGEN.pkg b/EVGEN/libEVGEN.pkg
index 9ba6a964bec..7ca64eca200 100644
--- a/EVGEN/libEVGEN.pkg
+++ b/EVGEN/libEVGEN.pkg
@@ -20,7 +20,7 @@ SRCS          = AliGenHIJINGpara.cxx AliGenBox.cxx AliGenFixed.cxx \
 		AliSlowNucleonModel.cxx AliSlowNucleonModelExp.cxx \
 		AliGenMUONCocktail.cxx AliGenMUONCocktailpp.cxx AliGenHBTosl.cxx \
 		AliGenReaderEMD.cxx AliDecayerPolarized.cxx AliGenCorrHF.cxx AliGenCosmicsParam.cxx \
-		AliGenKrypton.cxx AliGenThermalPhotons.cxx \
+		AliGenKrypton.cxx AliGenThermalPhotons.cxx AliGenPromptPhotons.cxx\
 		AliGenPileup.cxx
 
 # Headerfiles for this particular package (Path respect to own directory)
-- 
2.43.0