]> git.uio.no Git - u/mrichter/AliRoot.git/commitdiff
Derived from AliGenEpEmv1 a new generator AliGenQEDBg for QED ep backround studies...
authorshahoian <ruben.shahoyan@cern.ch>
Sat, 13 Sep 2014 20:36:00 +0000 (22:36 +0200)
committershahoian <ruben.shahoyan@cern.ch>
Sat, 13 Sep 2014 20:37:19 +0000 (22:37 +0200)
TEPEMGEN/AliGenEpEmv1.h
TEPEMGEN/AliGenQEDBg.cxx [new file with mode: 0644]
TEPEMGEN/AliGenQEDBg.h [new file with mode: 0644]
TEPEMGEN/CMakelibTEPEMGEN.pkg
TEPEMGEN/TEPEMGENLinkDef.h

index 86cca3dc9fb07951a015c305540cc97a656b3cd5..2309cc64c3441efe32f7c1e8f81d9cedc5c26c92 100644 (file)
@@ -23,8 +23,8 @@ public:
   AliGenEpEmv1();
   
   virtual ~AliGenEpEmv1();
-  void Generate();
-  void Init();
+  virtual void Generate();
+  virtual void Init();
   void SetDebug(Int_t debug) {fDebug=debug;}
   
  protected:
diff --git a/TEPEMGEN/AliGenQEDBg.cxx b/TEPEMGEN/AliGenQEDBg.cxx
new file mode 100644 (file)
index 0000000..6b3a9ba
--- /dev/null
@@ -0,0 +1,189 @@
+/**************************************************************************
+ * Copyright(c) 1998-2002, 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.                  *
+ *                                                                        *
+ *                                                                        *
+ * Copyright(c) 1997, 1998, 2002, Adrian Alscher and Kai Hencken          *
+ * See $ALICE_ROOT/EpEmGen/diffcross.f for full Copyright notice          *
+ *                                                                        *
+ *                                                                        *
+ * Copyright(c) 2002 Kai Hencken, Yuri Kharlov, Serguei Sadovsky          *
+ * See $ALICE_ROOT/EpEmGen/epemgen.f for full Copyright notice            *
+ *                                                                        *
+ **************************************************************************/
+
+/* $Id$ */
+
+// Event generator for background from e+e- pair production in ultraperipheral PbPb collisions
+// at 5.5 TeV/nucleon, integrated over specific readout cycle
+// Derived from AliGenEpEmv1
+// Author: ruben.shahoyan@cern.ch
+//%
+// References:
+// [1] "Multiple electromagnetic electron positron pair production in
+//      relativistic heavy ion collisions".
+//      Adrian Alscher, Kai Hencken, Dirk Trautmann, and Gerhard Baur,
+//      Phys. Rev. A55 (1997) 396.
+// [2] K.Hencken, Yu.Kharlov, S.Sadovsky, Internal ALICE Note 2002-27.
+//%
+// Usage:
+// Initialization:
+//    AliGenQEDBg *gener = new AliGenQEDBg();
+//    gener->SetXXXRange(); // Set kinematics range
+//    gener->SetLumiIntTime(double lumi, double sec); // luminosity and intergration time in seconds
+//    gener->Init();
+// Event generation:
+//    gener->Generate(); // Produce poissonian number of e+e- pair with average number
+//    corresponding to requested integration time with given beam luminosity
+//    Each pair has its own vertex, and time randomly distributed at originT 
+//    and originT+ integration time                    
+//
+//    For details of generation see AliGenEpEmv1.cxx by Yuri.Kharlov@cern.ch
+
+#include "AliLog.h"
+#include "AliGenQEDBg.h"
+#include <TParticle.h>
+#include <TParticlePDG.h>
+#include <TDatabasePDG.h>
+#include <TEpEmGen.h>
+
+ClassImp(AliGenQEDBg)
+
+//------------------------------------------------------------
+
+AliGenQEDBg::AliGenQEDBg()
+:  fLumi(0)
+  ,fXSection(0)
+  ,fXSectionEps(1e-2)
+  ,fIntTime(0)
+  ,fPairsInt(-1)
+  ,fMinXSTest(1e3)
+  ,fMaxXSTest(1e7)
+{
+}
+
+//____________________________________________________________
+AliGenQEDBg::~AliGenQEDBg()
+{
+  // Destructor
+}
+
+//____________________________________________________________
+void AliGenQEDBg::Init()
+{
+  // Initialisation:
+  AliInfo(Form("Will estimate QED bg. for L=%e cm^-2*s^-1 and Integration Time of %e s.",fLumi,fIntTime));
+  if (fLumi<=0 || fIntTime<=0) {
+    AliWarning("One of parameters is not set properly, no pairs will be generated");
+    return;
+  }
+  //
+  // initialize the generator of e+e- pair production
+  AliGenEpEmv1::Init();
+  //
+  fPairsInt = 0;
+  int ngen = 0;
+  AliInfo(Form("Estimating x-section with min.relative precision of %f and min/max test: %d/%d",
+              fXSectionEps,int(fMinXSTest),int(fMaxXSTest)));
+  //
+  double yElectron,yPositron,xElectron,xPositron,phi12,weight,err;
+  fXSection = -1;
+  do {
+    fEpEmGen->GenerateEvent(fYMin,fYMax,fPtMin,fPtMax,yElectron,yPositron,xElectron,xPositron,phi12,weight);
+    if (++ngen>fMinXSTest) { // ensure min number of tests
+      fXSection = fEpEmGen->GetXsection();
+      err = fEpEmGen->GetDsection();
+    }
+  } while(!((fXSection>0 && err/fXSection<fXSectionEps) || ngen>fMaxXSTest));
+  //
+  if (fXSection<=0) {
+    AliError(Form("X-section = %e after %d trials, cannot generate",fXSection,ngen));
+    return;
+  }
+  fPairsInt = fXSection*1e-21*fLumi*fIntTime; // xsestion is in kbarn!
+  AliInfo(Form("Estimated x-secion: %e+-%ekb in %d tests, <Npairs>=%e per %e time interval",
+              fXSection,err,ngen,fPairsInt,fIntTime));
+  //
+}
+
+//____________________________________________________________
+void AliGenQEDBg::Generate()
+{
+  //
+  // Generate poissian <fPairsInt> e+e- pairs, each one with its vertex
+  //
+  Float_t polar[3]= {0,0,0};
+  Float_t origin[3];
+  Float_t time = 0.;
+  Float_t p[3];
+  //
+  int npairs,nt,id;;
+  if (fPairsInt<=0 || (npairs=gRandom->Poisson(fPairsInt))<1) return;
+  //
+  Double_t ptElectron,ptPositron, phiElectron,phiPositron, mt, ms2 = fMass*fMass;
+  Double_t phi12=0,xElectron=0,xPositron=0,yElectron=0,yPositron=0,weight=0;
+  //
+  for (int i=0;i<npairs;i++) {
+    // each pair has its own vertex and time
+    Vertex();
+    for (int j=0;j<3;j++) origin[j] = fVertex[j];
+    time = fTimeOrigin+gRandom->Rndm()*fIntTime;
+    //
+    fEpEmGen->GenerateEvent(fYMin,fYMax,fPtMin,fPtMax,yElectron,yPositron,xElectron,xPositron,phi12,weight);
+    ptElectron  = TMath::Power(10,xElectron) * 1.e-03;;
+    ptPositron  = TMath::Power(10,xPositron) * 1.e-03;;
+    phiElectron = fPhiMin + gRandom->Rndm() * (fPhiMax-fPhiMin);
+    phiPositron = phiElectron + phi12;
+    // Produce electron
+    mt = TMath::Sqrt(ptElectron*ptElectron + ms2);
+    p[0] = ptElectron*TMath::Cos(phiElectron);
+    p[1] = ptElectron*TMath::Sin(phiElectron);
+    p[2] = mt*TMath::SinH(yElectron);
+    id =  11;
+    PushTrack(fTrackIt,-1, id,p,origin,polar,time,kPPrimary,nt,1);    
+    //
+    // Produce positron
+    mt = TMath::Sqrt(ptPositron*ptPositron + ms2);
+    p[0] = ptPositron*TMath::Cos(phiPositron);
+    p[1] = ptPositron*TMath::Sin(phiPositron);
+    p[2] = mt*TMath::SinH(yPositron);
+    id = -11;
+    PushTrack(fTrackIt,-1, id,p,origin,polar,time,kPPrimary,nt,1);
+    //
+  }
+  fEvent++;
+  //
+  fHeader.SetNProduced(2*npairs);
+  fHeader.SetEventWeight(1);
+  fHeader.SetInteractionTime(fTimeOrigin);
+  AddHeader(&fHeader);
+}
+
+//__________________________________________________________
+void AliGenQEDBg::SetLumiIntTime(double lumi, double intTime)
+{
+  // assign luminosity and integration time
+  if (lumi<=0)    AliFatal(Form("Luminosity must be positive, in cm^-2*s^-1, %e asked",lumi));
+  if (intTime<=0) AliFatal(Form("Integration time must be positive, in seconnds, %e asked",intTime));
+  fLumi = lumi;
+  fIntTime = intTime;
+  //
+}
+
+//__________________________________________________________
+void AliGenQEDBg::SetMinMaxXSTest(double mn,double mx)
+{
+  // set min,max number of generator calls for xsection estimates
+  fMinXSTest = mn>100 ? mn : 100.;
+  fMaxXSTest = mx>mx ? mx : mx+100.;
+}
diff --git a/TEPEMGEN/AliGenQEDBg.h b/TEPEMGEN/AliGenQEDBg.h
new file mode 100644 (file)
index 0000000..ea4a5f2
--- /dev/null
@@ -0,0 +1,53 @@
+#ifndef ALIGENQEDBG_H
+#define ALIGENQEDBG_H
+/* Copyright(c) 1998-2002, ALICE Experiment at CERN, All rights reserved. *
+ * Copyright(c) 1997, 1998, 2002, Adrian Alscher and Kai Hencken          *
+ * Copyright(c) 2002 Kai Hencken, Yuri Kharlov, Serguei Sadovsky          *
+ * See cxx source for full Copyright notice                               */
+
+/* $Id$ */
+// Event generator of single e+e- pair production in ultraperipheral PbPb collisions
+// at 5.5 TeV/nucleon.
+// Author: Yuri.Kharlov@cern.ch
+// 9 October 2002
+
+#include "AliGenMC.h"
+#include "AliGenEventHeader.h"
+#include "AliGenEpEmv1.h"
+
+//-------------------------------------------------------------
+class AliGenQEDBg : public AliGenEpEmv1
+{
+public:
+  AliGenQEDBg();
+  
+  virtual ~AliGenQEDBg();
+  virtual void Generate();
+  virtual void Init();
+  //
+  Double_t  GetLuminosity()       const {return fLumi;}
+  Double_t  GetIntegrationTime()  const {return fIntTime;}
+  Double_t  GetXSection()         const {return fXSection;}
+  Double_t  GetXSectionEps()      const {return fXSectionEps;}
+  Double_t  GetMeanNPairs()       const {return fPairsInt;}
+  //
+  void      SetLumiIntTime(double lumi, double intTime);
+  void      SetXSectionEps(double eps=1e-2)  {fXSectionEps = eps>0 ? eps:1e-2;}
+  void      SetMinMaxXSTest(double mn,double mx);
+  //
+ protected:
+  AliGenQEDBg(const AliGenQEDBg & gen);
+  AliGenQEDBg & operator=(const AliGenQEDBg & gen);
+  //
+  Double_t   fLumi;         // beam luminsity
+  Double_t   fXSection;     // estimated cross section in k-barns
+  Double_t   fXSectionEps;  // error with wich Xsection is calculated
+  Double_t   fIntTime;      // integration time in seconds
+  Double_t   fPairsInt;     // estimated average number of pairs in IntTime
+  Double_t   fMinXSTest;    // min number of generator calls for Xsection estimate
+  Double_t   fMaxXSTest;    // max number of generator calls for Xsection estimate
+
+  //
+  ClassDef(AliGenQEDBg,1) // Generator e+e- pair background from PbPb QED interactions
+};
+#endif
index a5b09b1636a4721013bf5042eb89d46542f80e2a..f6f2b3ece60d7f7b7547b4197053417ef5f207b9 100644 (file)
@@ -26,9 +26,9 @@
 # SHLIBS - Shared Libraries and objects for linking (Executables only)           #
 #--------------------------------------------------------------------------------#
 
-set ( SRCS  TEpEmGen.cxx AliGenEpEmv1.cxx)
+set ( SRCS  TEpEmGen.cxx AliGenEpEmv1.cxx AliGenQEDBg.cxx)
 
-set ( HDRS  TEpEmGen.h AliGenEpEmv1.h)
+set ( HDRS  TEpEmGen.h AliGenEpEmv1.h AliGenQEDBg.h)
 
 set ( DHDR TEPEMGENLinkDef.h)
 
index 0de7193f0febd07692854a537e3be413d7b25961..1a16dc1a54d22fbcf10a27c1ee09b7583991a9be 100644 (file)
@@ -6,5 +6,5 @@
  
 #pragma link C++ class TEpEmGen+;
 #pragma link C++ class AliGenEpEmv1+;
-
+#pragma link C++ class AliGenQEDBg+;
 #endif