Page MenuHomeHEPForge

No OneTemporary

This file is larger than 256 KB, so syntax highlighting was skipped.
Index: branches/starlight_1.1/Readme
===================================================================
--- branches/starlight_1.1/Readme (revision 0)
+++ branches/starlight_1.1/Readme (revision 145)
@@ -0,0 +1,130 @@
+The STARlight Monte Carlo models 2-photon and photon-Pomeron interactions
+in ultra-peripheral heavy ion collisions. The physics approach for the photon-Pomeron
+interactions is described in Klein and Nystrand, Phys. Rev. C60, 014903 (1999),
+with the p_t spectrum (including vector meson interference) discussed in Phys. Rev.
+Lett. 84, 2330 (2000). The 2-photon interactions are described in Baltz, Gorbunov,
+Klein, Nystrand, Phys.Rev. C80 (2009) 044902.
+
+STARlight has several input files, all of which are expected to be in the
+same directory as the starlight code. User-specified input parameters are
+read from a file named "slight.in"; these parameters are described
+below.
+
+The output of the STARlight Monte Carlo will be written to an ascii file
+named "slight.out".
+
+----------------------------------------------------------------------------
+
+The contents of a sample slight.in file are listed below, with
+explanation. The user should modify this file according to his or her
+needs.
+BEAM_1_Z = 82 #Z of projectile
+BEAM_1_A = 208 #A of projectile
+BEAM_2_Z = 82 #Z of target
+BEAM_2_A = 208 #A of target
+BEAM_GAMMA = 1470 #Gamma of the colliding ions
+
+W_MAX = 12.0 #Max value of w
+W_MIN = -1 #Min value of w
+W_N_BINS = 40 #Bins i w
+ # maximum and minimum values for w (the gamma-gamma center of mass
+ # energy, w = 4(E1)(E2), (Setting W_MIN = -1 tells STARlight to use the default values
+ # specified in inputParameters.cpp; otherwise, specify wmin here, and the number
+ # of w bins in the lookup tables
+
+RAP_MAX = 8. # max rapidity
+RAP_N_BINS = 80 # Number of y bins used in the cross section calculation
+
+CUT_PT = 0 #Cut in pT? 0 = (no, 1 = yes)
+PT_MIN = 1.0 #Minimum pT in GeV
+PT_MAX = 3.0 #Maximum pT in GeV
+CUT_ETA = 0 #Cut in pseudorapidity? (0 = no, 1 = yes)
+ETA_MIN = -10 #Minimum pseudorapidity
+ETA_MAX = 10 #Maximum pseudorapidity
+
+PROD_MODE = 2 #gg or gP switch (1 = two-photon, 2 = coherent vector meson, 4 = incoherent vector meson )
+
+N_EVENTS = 10 #Number of events produced
+
+PROD_PID = 443013 #Channel of interest (in PDG notation); currently supported options listed below
+RND_SEED = 34533 #Random number seed
+
+OUTPUT_FORMAT = 2 #Form of the output (not considered at this state)
+
+BREAKUP_MODE = 5 #Controls the nuclear breakup
+ # Note that this option only works for lead or gold; it should work at any energy
+ # 1 = hard sphere nuclei (b>2R)
+ # 2 = require that both nuclei break up (Xn,Xn)
+ # 3 = a single neutron from each nucleus (1n,1n)
+ # 4 = require that neither nucleus breaks up (0n,0n)
+ # 5 = require that there be no hadronic break up
+ # (This is similar to option 1, but with the actual hadronic interaction
+ # probability)
+ # 6 = require break up of one or both nuclei (Xn)
+ # 7 = require break up of one nucleus (Xn,0n)
+
+INTERFERENCE = 0 #Interference (0 = off, 1 = on)
+IF_STRENGTH = 1. #% of intefernce (0.0 - 0.1)
+COHERENT = 1 #Coherent=1,Incoherent=0 production for assym collisions
+INCO_FACTOR = 1. #percentage of incoherence
+BFORD = 9.5 #Deuteron slope parameter (dsig/dt = exp(BFORD*t))
+INT_PT_MAX = 0.24 #Maximum pt considered, when interference is turned on
+INT_PT_N_BINS =120 #Number of pt bins when interference is turned on
+
+
+----------------------------------------------------------------------------
+
+Currently supported 2-photon channel options:
+ jetset id particle
+ ---------------------------------
+ 221 eta
+ 331 eta-prime
+ 441 eta-c
+ 9010221 f0(975)
+ 225 f2(1270)
+ 115 a2(1320)
+ 335 f2(1525)
+ 33 rho0 pair
+ 11 e+/e- pair
+ 13 mu+/mu- pair
+ 15 tau+/tau- pair
+
+Currently supported vector meson options:
+ jetset id particle
+ ---------------------------------
+
+ 113 rho0
+ 223 omega
+ 333 phi
+ 443011 J/psi --> e+e-
+ 443013 J/Psi --> mu+mu-
+ 444011 Psi(2S) --> e+e-
+ 444013 Psi(2S) --> mu+mu-
+ 553011 Upsilon(1S) --> e+e-
+ 553013 Upsilon(1S) --> mu+mu-
+ 554011 Upsilon(2S) --> e+e-
+ 554013 Upsilon(2S) --> mu+mu-
+ 555011 Upsilon(3S) --> e+e-
+ 555013 Upsilon(3S) --> mu+mu-
+ 913 rho0 + direct pi+pi- (with interference)
+The direct pi+pi- fraction is from the ZEUS results
+
+
+
+Logs:
+
+fixed types for class Particle
+- Int -> Double
+- fixed Makefile ..
+ autoconfig will appear in the future .. make sure paths are fixed before compiling
+ this is for includes and libraries in Makefile
+- don't forget about link to pythia xml doc
+ This is located in main.cpp
+
+- changed PID of the charged KAON to 321 and neutral kaon to 310 .. it should work now for phi -> kk
+
+- incoherent formfactor was hardcoded for dAu events, it should now accept coherent too.
+- Had hardcoded narrow and wide resonances for VMs. The user can again select gg_or_gp (2 or 3)
+except for the psi family. This is still always narrow.
+- Changed the spin dependence for VMs going to ee/mumu(gammaavectormeson::gettheta). It was only for psi and now upsilon will follow too
+inretrospect, i should probably have done this first and merge psifamily back into gammaavm.cpp
Index: branches/starlight_1.1/Readme.PhotoNuclear
===================================================================
--- branches/starlight_1.1/Readme.PhotoNuclear (revision 0)
+++ branches/starlight_1.1/Readme.PhotoNuclear (revision 145)
@@ -0,0 +1,92 @@
+
+======= Photonuclear Processes =======
+
+Simulation of photonuclear interactions with STARlight is possible through an interface with DPMJet or Pythia.
+These interfaces can be enabled through options passed to cmake during the configuration process. However, due
+to DPMJet depending on a different version of Pythia from what is used in the Pythia interface, both cannot be
+enabled at the same time.
+
+The gfortran compiler is required to use the photonuclear interfaces.
+
+
+ ======= 1. Photonuclear interactions with DPMJet =======
+
+
+ ------- 1.1. Obtaining and installing DPMJet -------
+
+
+ The DPMJet package can be obtained by contacting the authors as explained here:
+ http://sroesler.web.cern.ch/sroesler/dpmjet3.html
+
+ Once you have the code proceed with these steps:
+
+ Changle the line containing the OPT variable in the DPMJet Makefile:
+
+ OPT = -c -C -std=legacy -O -O3 -g -fexpensive-optimizations -funroll-loops -fno-automatic -fbounds-check -v -fPIC
+
+ ----- 64-bit -----
+
+ You should make sure that all -m32 options are removed from the Makefile.
+
+ Unfortunately the DPMJet package depends on a floating point exception trap implementation,
+ and only a 32-bit version of that is included in the package. An example implementation can be found here:
+
+ http://www.arsc.edu/arsc/support/news/hpcnews/hpcnews376/
+
+ Under "Fortran Floating Point Traps for Linux" there is a code example. A file based on this, fpe.c,
+ can be found in the external directory in Starlight. Move that to your DPMJet directory and run:
+
+ $ gcc -o fpe.o fpe.c
+
+ ----- End 64-bit -----
+
+ Then in the DPMJet directory run:
+
+ $ make
+
+ ------- 1.2. Compiling Starlight with DPMJet interface -------
+
+ To enable the compilation of the DPMJet interface please follow these steps:
+
+ CMake uses an environment variable $DPMJETDIR to locate the DPMJet object files.
+
+ $ export DPMJETDIR=<path to dpmjet>
+
+ Then create a build directory for Starlight
+
+ $ mkdir <build-dir>
+
+ and change into it
+
+ $ cd <build-dir>
+
+ Run CMake with the option to enable DPMJet
+
+ $ cmake <path-to-starlight-source> -DENABLE_DPMJET=ON
+
+ Then build it
+
+ $ make
+
+
+ ------- 1.3. Running Starlight with DPMJet interface -------
+
+
+ To run Starlight with the DPMJet interface a couple of files are needed in the directory
+ where you want to run Starlight.
+
+ The files needed are:
+ slight.in (Starlight config file. An example suitable for DPMJet can be found in config/slight.in.dpmjet)
+ my.input (DPMJet config file. An example can be found in config/my.input)
+ dpmjet.dat (Can be found in the DPMJet source directory)
+
+ In the slight.in file the relevant production modes (PROD_MODE) for DPMJET is:
+
+ 5: A+A single excitation
+ 6: A+A double excitation
+ 7: p+A single excitation
+
+ In addition the minimum and maximum gamma energies must be set. It is important that
+ these are within the interval set in the my.input file
+
+
Index: branches/starlight_1.1/utils/analyse.cxx
===================================================================
--- branches/starlight_1.1/utils/analyse.cxx (revision 0)
+++ branches/starlight_1.1/utils/analyse.cxx (revision 145)
@@ -0,0 +1,211 @@
+#include "analyse.h"
+#include <TMath.h>
+#include <iostream>
+
+using namespace std;
+Analyse::Analyse() :
+ fInfile("slight.out"),
+ fNEvents(1)
+{
+ //Constructor
+
+ //Creating histograms
+ fPtEl = new TH1F("PtEl", "Transverse momentum e+/e-", 100, 0, 2.);
+ fPtMu = new TH1F("PtMu", "Transverse momentum mu+/mu-", 100, 0, 2.);
+ fPtPi = new TH1F("PtPi", "Transverse momentum pi+/pi-", 100, 0, 2.);
+
+ fRapEl = new TH1F("RapEl", "Rapidity e+/e-", 200, -10, 10);
+ fRapMu = new TH1F("RapMu", "Rapidity mu+/mu-", 200, -10, 10);
+ fRapPi = new TH1F("RapPi", "Rapidity pi+/pi-", 200, -10, 10);
+
+ fInvMassEl = new TH1F("InvMassEl", "Invariant mass", 100, 0, 5);
+ fInvMassMu = new TH1F("InvMassMu", "Invariant mass", 100, 0, 5);
+ fInvMassPi = new TH1F("InvMassPi", "Invariant mass", 100, 0, 5);
+
+ fPt1 = new TH1F("fPt1", "Transverse momentum track 1", 100, 0, 2.);
+ fPt2 = new TH1F("fPt2", "Transverse momentum track 2", 100, 0, 2.);
+}
+
+Analyse::Analyse(char* infile, Int_t nEvents) :
+ fInfile(infile),
+ fNEvents(nEvents)
+{
+ //Special constructor
+
+ //Creating histograms
+ fPtEl = new TH1F("PtEl", "Transverse momentum e+/e-", 100, 0, 2.);
+ fPtMu = new TH1F("PtMu", "Transverse momentum mu+/mu-", 100, 0, 2.);
+ fPtPi = new TH1F("PtPi", "Transverse momentum pi+/pi-", 100, 0, 2.);
+
+ fRapEl = new TH1F("RapEl", "Rapidity e+/e-", 200, -10, 10);
+ fRapMu = new TH1F("RapMu", "Rapidity mu+/mu-", 200, -10, 10);
+ fRapPi = new TH1F("RapPi", "Rapidity pi+/pi-", 200, -10., 10.);
+
+ fInvMassEl = new TH1F("InvMassEl", "Invariant mass", 100, 0, 5);
+ fInvMassMu = new TH1F("InvMassMu", "Invariant mass", 100, 0, 5);
+ fInvMassPi = new TH1F("InvMassPi", "Invariant mass", 100, 0., 5.);
+
+
+ fPt1 = new TH1F("fPt1", "Transverse momentum track 1", 100, 0, 2.);
+ fPt2 = new TH1F("fPt2", "Transverse momentum track 2", 100, 0, 2.);
+}
+
+Analyse::~Analyse()
+{
+ //Destructor
+ delete fPtEl;
+ delete fPtMu;
+ delete fPtPi;
+
+ delete fRapEl;
+ delete fRapMu;
+ delete fRapPi;
+
+ delete fInvMassEl;
+ delete fInvMassMu;
+ delete fInvMassPi;
+
+ delete fPt1;
+ delete fPt2;
+
+
+}
+
+Int_t Analyse::Init()
+{
+
+
+ cout << "Opening textfile " << fInfile << endl;
+ if( !(filelist=fopen(fInfile,"r")) ){
+ cout<<"Couldn't open input file: "<<fInfile<<endl;
+ return -1;
+ }
+ cout << "Done opening textfile" << endl;
+ return 0;
+}
+
+Int_t Analyse::NextEvent()
+{
+ char linelabel[20];
+ int i1=0;
+ int i2=0;
+ int i3=0;
+ double x1=0.0;
+ double x2=0.0;
+ double x3=0.0;
+ double x4=0.0;
+ int ntrk=0;
+ int nvtx=0;
+ // Event line
+ fscanf(filelist,"%s %d %d %d ",linelabel,&i1,&ntrk,&i2);
+ fNParticles = ntrk;
+ cout<<linelabel<<" "<<i1<<" "<<ntrk<<" "<<i2<<" "<<fNParticles<<endl;
+ // Vertex line
+ fscanf(filelist,"%s %lf %lf %lf %lf %d %d %d %d",
+ linelabel,&x1,&x2,&x3,&x4,&i1,&i2,&i3,&nvtx);
+ cout<<linelabel<<" "<<x1<<" "<<x2<<" "<<x3<<" "<<x4<<" "<<i1<<" "<<i2<<" "<<i3<<" "<<nvtx<<endl;
+ if(ntrk != nvtx)cout<<"ERROR: ntrk = "<<ntrk<<" nvtx = "<<nvtx<<endl;
+ //
+ return fNParticles;
+}
+
+TParticle* Analyse::NextParticle()
+{
+ char tracklabel[20];
+ int i1=0;
+ int i2=0;
+ int i3=0;
+ int i4=0;
+ Int_t idpart = 0;
+ Double_t px = 0.0;
+ Double_t py = 0.0;
+ Double_t pz = 0.0;
+ Double_t ep = 0.0;
+
+ cout<<"In NextParticle: fNparticles = "<<fNParticles<<endl;
+
+ // for ( int itk=0; itk < fNParticles; itk++){
+
+
+ fscanf(filelist,"%s %d %le %le %le %d %d %d %d",
+ tracklabel,&i1,&px,&py,&pz,&i2,&i3,&i4,&idpart);
+ cout<<" "<<tracklabel<<" "<<i1<<" "<<px<<" "<<py<<" "<<pz<<" "<<i2<<" "<<i3<<" "<<i4<<" "<<idpart<<endl;
+
+ TParticle *particle =
+ new TParticle(idpart, 0, -1, -1, -1, -1, px, py, pz, ep, 0., 0., 0., 0.);
+
+ // }
+
+ return particle;
+}
+
+void Analyse::doAnalysis()
+{
+
+ Int_t check = Init();
+ if(check < 0) return;
+ //Doing the analysis
+ for(Int_t ev = 0; ev < fNEvents; ev++){
+
+ const Int_t ntracks = NextEvent();
+ //Array of TLorentzVectors. One vector for each tracks
+ TLorentzVector* vecArr[ntracks];
+ TParticle* partArr[ntracks];
+ //Looping over the tracks of the event
+ for(Int_t tr = 0; tr < ntracks; tr++){
+ //Getting a TParticle from the TClonesArray
+ TParticle *part = NextParticle();
+ Double_t mpi = 0.13957018;
+ Double_t energy = TMath::Sqrt(mpi*mpi+part->Px()*part->Px()+part->Py()*part->Py()+part->Pz()*part->Pz());
+ //Creating a new TLorentzVector and setting px, py, pz and E.
+ vecArr[tr] = new TLorentzVector;
+ vecArr[tr]->SetPxPyPzE(part->Px(), part->Py(), part->Pz(), energy);
+ cout << "particle " << tr << ": px: " << part->Px() << " py: " << part->Py() << " pz: " << part->Pz() << " Energy: " << energy << endl;
+ partArr[tr] = part;
+ }
+
+ fPt1->Fill(vecArr[0]->Pt());
+ fPt2->Fill(vecArr[1]->Pt());
+
+ //Creating a new TLorentzVector, which is the sum of the elements in vecArr
+ TLorentzVector sum;
+ for(Int_t i = 0; i < ntracks; i++){
+ sum += *vecArr[i];
+ }
+ //Filling the histograms depending on particle type
+
+ if(partArr[0]->GetPdgCode() == 11 || partArr[0]->GetPdgCode() == -11){
+ fPtEl->Fill(sum.Pt());
+ fRapEl->Fill(sum.Rapidity());
+ fInvMassEl->Fill(sum.M());
+ }
+ else if(partArr[0]->GetPdgCode() == 13 || partArr[0]->GetPdgCode() == -13){
+ fPtMu->Fill(sum.Pt());
+ fRapMu->Fill(sum.Rapidity());
+ fInvMassMu->Fill(sum.M());
+ }
+ else if(partArr[0]->GetPdgCode() == 211 || partArr[0]->GetPdgCode() == -211){
+ fPtPi->Fill(sum.Pt());
+ cout << "sum.Rapidity: " << sum.Rapidity() << endl;
+ cout << "sum.M(): " << sum.M() << endl;
+ fRapPi->Fill(sum.Rapidity());
+ fInvMassPi->Fill(sum.M());
+ }
+
+ }
+ //Writing the histograms to file
+ TFile file("histograms.root", "RECREATE");
+ fPtEl->Write();
+ fRapEl->Write();
+ fInvMassEl->Write();
+ fPtMu->Write();
+ fRapMu->Write();
+ fInvMassMu->Write();
+ fPtPi->Write();
+ fRapPi->Write();
+ fInvMassPi->Write();
+ fPt1->Write();
+ fPt2->Write();
+
+
+}
Property changes on: branches/starlight_1.1/utils/analyse.cxx
___________________________________________________________________
Added: svn:executable
\ No newline at end of property
Index: branches/starlight_1.1/utils/convertStarlightAsciiToTree.C
===================================================================
--- branches/starlight_1.1/utils/convertStarlightAsciiToTree.C (revision 0)
+++ branches/starlight_1.1/utils/convertStarlightAsciiToTree.C (revision 145)
@@ -0,0 +1,83 @@
+#include <iostream>
+#include <fstream>
+#include <sstream>
+
+#include "TLorentzVector.h"
+#include "TClonesArray.h"
+#include "TTree.h"
+#include "TFile.h"
+
+
+using namespace std;
+
+
+void readStarlightAscii(const char* inFileName = "slight.out",
+ const char* outFileName = "starlight.root")
+{
+ const double daughterMass = 0.13957018; // charged pion [GeV]
+
+ // create output tree
+ TFile* outFile = new TFile(outFileName, "RECREATE");
+ if (!outFile) {
+ cerr << " error: could not create output file '" << outFileName << "'" << endl;
+ return;
+ }
+ TTree* outTree = new TTree("starlightTree", "starlightTree");
+ TLorentzVector* parentParticle = new TLorentzVector();
+ TClonesArray* daughterParticles = new TClonesArray("TLorentzVector");
+ outTree->Branch("parent", "TLorentzVector", &parentParticle, 32000, -1);
+ outTree->Branch("daughters", "TClonesArray", &daughterParticles, 32000, -1);
+
+ ifstream inFile;
+ inFile.open(inFileName);
+ unsigned int countLines = 0;
+ while (inFile.good()) {
+ string line;
+ stringstream lineStream;
+
+ // read EVENT
+ string label;
+ int eventNmb, nmbTracks;
+ if (!getline(inFile, line))
+ break;
+ ++countLines;
+ lineStream.str(line);
+ assert(lineStream >> label >> eventNmb >> nmbTracks);
+ if (!(label == "EVENT:"))
+ continue;
+
+ // read vertex
+ if (!getline(inFile, line))
+ break;
+ ++countLines;
+ lineStream.str(line);
+ assert(lineStream >> label);
+ assert(label == "VERTEX:");
+
+ *parentParticle = TLorentzVector(0, 0, 0, 0);
+ for (int i = 0; i < nmbTracks; ++i) {
+ // read tracks
+ int particleCode;
+ double momentum[3];
+ if (!getline(inFile, line))
+ break;
+ ++countLines;
+ lineStream.str(line);
+ assert(lineStream >> label >> particleCode >> momentum[0] >> momentum[1] >> momentum[2]);
+ assert(label == "TRACK:");
+ const double E = sqrt( momentum[0] * momentum[0] + momentum[1] * momentum[1]
+ + momentum[2] * momentum[2] + daughterMass * daughterMass);
+ new ( (*daughterParticles)[i] ) TLorentzVector(momentum[0], momentum[1], momentum[2], E);
+ *parentParticle += *(static_cast<TLorentzVector*>(daughterParticles->At(i)));
+ }
+
+ daughterParticles->Compress();
+ outTree->Fill();
+ }
+
+ outTree->Write();
+ if (outFile) {
+ outFile->Close();
+ delete outFile;
+ }
+}
Index: branches/starlight_1.1/utils/ana.C
===================================================================
--- branches/starlight_1.1/utils/ana.C (revision 0)
+++ branches/starlight_1.1/utils/ana.C (revision 145)
@@ -0,0 +1,9 @@
+
+#include "analyse.cxx"
+
+
+void ana()
+{
+ Analyse a("slight.out", 20);
+ a.doAnalysis();
+}
Property changes on: branches/starlight_1.1/utils/ana.C
___________________________________________________________________
Added: svn:executable
\ No newline at end of property
Index: branches/starlight_1.1/utils/analyse.h
===================================================================
--- branches/starlight_1.1/utils/analyse.h (revision 0)
+++ branches/starlight_1.1/utils/analyse.h (revision 145)
@@ -0,0 +1,47 @@
+#ifndef ANALYSE_H
+#define ANALYSE_H
+
+#include "TFile.h"
+#include "TTree.h"
+#include "TLorentzVector.h"
+#include "TClonesArray.h"
+#include "TParticle.h"
+#include "TH1F.h"
+#include <string>
+
+class Analyse
+{
+ public:
+ Analyse(); //Constructor
+ Analyse(char* infile, Int_t nEvents); //Special constructor
+ ~Analyse(); //Destructor
+ Int_t Init();
+ Int_t NextEvent();
+ TParticle* NextParticle();
+ void doAnalysis(); //Function doing the analysis
+
+ private:
+
+ TH1F *fPtEl; //Histogram of pt of electrons
+ TH1F *fRapEl; //Histogram of rapidity of electrons
+ TH1F *fInvMassEl; //Histogram of ivariant mass of electrons
+
+ TH1F *fPtMu; //Histogram of pt of muons
+ TH1F *fRapMu; //Histogram of rapidity of muons
+ TH1F *fInvMassMu; //Histogram of ivariant mass of muons
+
+ TH1F *fPtPi; //Histogram of pt of pions
+ TH1F *fRapPi; //Histogram of rapidity of pions
+ TH1F *fInvMassPi; //Histogram of ivariant mass of pions
+
+ TH1F *fPt1;
+ TH1F *fPt2;
+
+ FILE *filelist;
+ char *fInfile;
+ Int_t fNParticles;
+ Int_t fNEvents;
+
+};
+
+#endif
Property changes on: branches/starlight_1.1/utils/analyse.h
___________________________________________________________________
Added: svn:executable
\ No newline at end of property
Index: branches/starlight_1.1/standard/Makefile
===================================================================
--- branches/starlight_1.1/standard/Makefile (revision 0)
+++ branches/starlight_1.1/standard/Makefile (revision 145)
@@ -0,0 +1,89 @@
+
+#
+# The PROGRAM macro defines the name of the program or project. It
+# allows the program name to be changed by editing in only one
+# location
+#
+
+PROGRAM = starlight
+
+# The INCLUDEDIRS macro contains a list of include directories
+# to pass to the compiler so it can find necessary header files.
+#
+# The LIBDIRS macro contains a list of library directories
+# to pass to the linker so it can find necessary libraries.
+#
+# The LIBS macro contains a list of libraries that the the
+# executable must be linked against.
+#
+
+INCLUDEDIRS = \
+ -I/home/gorbunov/pythia/pythia8120/include \
+ -I/usr/local/root/include \
+ -I../include
+
+
+LIBDIRS = \
+ -L/usr/local/root/lib \
+ -L/home/gorbunov/pythia/pythia8120/lib/archive
+
+
+LIBS = -lCore -lCint -lRIO -lGpad -lRint -lGui -lPhysics -lMathCore\
+ -lGraf -lGraf3d -lHist -lHtml -lMatrix -lMinuit -lNet \
+ -lPostscript -lProof -lTree -lThread -lVMC -lGeom \
+ -lEG -ldl -lpthread -lTreePlayer -lProofPlayer -lpythia8 -llhapdfdummy
+
+
+#
+# The CXXSOURCES macro contains a list of source files.
+#
+# The CXXOBJECTS macro converts the CXXSOURCES macro into a list
+# of object files.
+#
+# The CXXFLAGS macro contains a list of options to be passed to
+# the compiler. Adding "-g" to this line will cause the compiler
+# to add debugging information to the executable.
+#
+# The CXX macro defines the C++ compiler.
+#
+# The LDFLAGS macro contains all of the library and library
+# directory information to be passed to the linker.
+#
+OTHERDIR= ../src
+CXXSOURCES = $(OTHERDIR)/main.cpp $(OTHERDIR)/inputparameters.cpp $(OTHERDIR)/nucleus.cpp $(OTHERDIR)/bessel.cpp $(OTHERDIR)/beam.cpp $(OTHERDIR)/beambeamsystem.cpp $(OTHERDIR)/twophotonluminosity.cpp $(OTHERDIR)/upcevent.cpp $(OTHERDIR)/vector3.cpp $(OTHERDIR)/lorentzvector.cpp $(OTHERDIR)/eventfilewriter.cpp $(OTHERDIR)/filewriter.cpp $(OTHERDIR)/eventchannel.cpp $(OTHERDIR)/gammagammaleptonpair.cpp $(OTHERDIR)/readinluminosity.cpp $(OTHERDIR)/randomgenerator.cpp $(OTHERDIR)/gammagammasingle.cpp $(OTHERDIR)/gammaavm.cpp $(OTHERDIR)/gammaaluminosity.cpp $(OTHERDIR)/gammaacrosssection.cpp $(OTHERDIR)/psifamily.cpp $(OTHERDIR)/starlightparticle.cpp $(OTHERDIR)/starlightparticlecodes.cpp $(OTHERDIR)/starlight.cpp $(OTHERDIR)/starlightstandalone.cpp # list of source files
+CXXOBJECTS = $(CXXSOURCES:.cpp=.o) # expands to list of object files
+CXXFLAGS = $(INCLUDEDIRS)
+CXX = g++
+
+LDFLAGS = $(LIBDIRS) $(LIBS)
+
+#
+# Default target: the first target is the default target.
+# Just type "make -f Makefile.Linux" to build it.
+#
+
+all: $(PROGRAM)
+
+#
+# Link target: automatically builds its object dependencies before
+# executing its link command.
+#
+
+$(PROGRAM): $(CXXOBJECTS)
+ $(CXX) -o $@ $(CXXOBJECTS) $(LDFLAGS)
+
+#
+# Object targets: rules that define objects, their dependencies, and
+# a list of commands for compilation.
+#
+#
+#basic_sample.o: basic_sample.cpp basic_sample.h
+# $(CXX) $(CXXFLAGS) -c -o basic_sample.o basic_sample.cpp
+#
+#
+# Clean target: "make -f Makefile.Linux clean" to remove unwanted objects and executables.
+#
+
+clean:
+ $(RM) -f $(CXXOBJECTS) $(PROGRAM)
+
Index: branches/starlight_1.1/standard/slight.in
===================================================================
--- branches/starlight_1.1/standard/slight.in (revision 0)
+++ branches/starlight_1.1/standard/slight.in (revision 145)
@@ -0,0 +1,23 @@
+79
+197
+79
+197
+108.4
+10.
+1.
+40
+8.
+80
+3
+1000
+113
+34533
+2
+2
+0
+1.
+1
+1.
+9.5
+0.24
+120
Index: branches/starlight_1.1/config/slight.in
===================================================================
--- branches/starlight_1.1/config/slight.in (revision 0)
+++ branches/starlight_1.1/config/slight.in (revision 145)
@@ -0,0 +1,33 @@
+BEAM_1_Z = 82 #Z of projectile
+BEAM_1_A = 208 #A of projectile
+BEAM_2_Z = 82 #Z of target
+BEAM_2_A = 208 #A of target
+BEAM_1_GAMMA = 1470.0 #Gamma of the colliding ion 1
+BEAM_2_GAMMA = 1470.0 #Gamma of the colliding ion 2
+W_MAX = 15.0 #Max value of w
+W_MIN = -1 #Min value of w
+W_N_BINS = 50 #Bins i w
+RAP_MAX = 9. #max y
+RAP_N_BINS = 200 #Bins i y
+CUT_PT = 0 #Cut in pT? 0 = (no, 1 = yes)
+PT_MIN = 1.0 #Minimum pT in GeV
+PT_MAX = 3.0 #Maximum pT in GeV
+CUT_ETA = 0 #Cut in pseudorapidity? (0 = no, 1 = yes)
+ETA_MIN = -10 #Minimum pseudorapidity
+ETA_MAX = 10 #Maximum pseudorapidity
+PROD_MODE = 2 #gg or gP switch (1 = 2-photon, 2 = coherent vector meson (narrow), 3 = coherent vector meson (wide), 4 = incoherent vector meson)
+N_EVENTS = 1000 #Number of events
+PROD_PID = 443013 #Channel of interest
+RND_SEED = 5574533 #Random number seed
+OUTPUT_FORMAT = 2 #Form of the output
+BREAKUP_MODE = 5 #Controls the nuclear breakup
+INTERFERENCE = 0 #Interference (0 = off, 1 = on)
+IF_STRENGTH = 1. #% of intefernce (0.0 - 0.1)
+COHERENT = 1 #Coherent=1,Incoherent=0
+INCO_FACTOR = 1. #percentage of incoherence
+BFORD = 9.5
+INT_PT_MAX = 0.24 #Maximum pt considered, when interference is turned on
+INT_PT_N_BINS =120 #Number of pt bins when interference is turned on
+XSEC_METHOD = 1 # Set to 0 to use old method for calculating gamma-gamma luminosity
+N_THREADS = 1 # Number of threads used for calculating luminosity (when using the new method)
+PYTHIA_FULL_EVENTRECORD = 0 # Write full pythia information to output (vertex, parents, daughter etc).
Index: branches/starlight_1.1/config/slight.in.dpmjet
===================================================================
--- branches/starlight_1.1/config/slight.in.dpmjet (revision 0)
+++ branches/starlight_1.1/config/slight.in.dpmjet (revision 145)
@@ -0,0 +1,35 @@
+BEAM_1_Z = 82 #Z of projectile
+BEAM_1_A = 208 #A of projectile
+BEAM_2_Z = 82 #Z of target
+BEAM_2_A = 208 #A of target
+BEAM_GAMMA = 1470 #Gamma of the colliding ions
+W_MAX = 12.0 #Max value of w
+W_MIN = 2.0 #Min value of w
+W_N_BINS = 40 #Bins i w
+RAP_MAX = 8. #max y
+RAP_N_BINS = 80 #Bins i y
+CUT_PT = 0 #Cut in pT? 0 = (no, 1 = yes)
+PT_MIN = 1.0 #Minimum pT in GeV
+PT_MAX = 3.0 #Maximum pT in GeV
+CUT_ETA = 0 #Cut in pseudorapidity? (0 = no, 1 = yes)
+ETA_MIN = -10 #Minimum pseudorapidity
+ETA_MAX = 10 #Maximum pseudorapidity
+PROD_MODE = 5 #gg or gP switch (1 = 2-photon, 2 = coherent vector meson (narrow), 3 = coherent vector meson (wide),
+# 4 = incoherent vector meson, 5 = A+A DPMJet single, 6 = A+A DPMJet double, 7 = p+A DPMJet single, 8 = p+A Pythia single )
+N_EVENTS = 10 #Number of events
+PROD_PID = 443013 #Channel of interest (not relevant for photonuclear processes)
+RND_SEED = 34533 #Random number seed
+OUTPUT_FORMAT = 2 #Form of the output
+BREAKUP_MODE = 5 #Controls the nuclear breakup
+INTERFERENCE = 0 #Interference (0 = off, 1 = on)
+IF_STRENGTH = 1. #% of intefernce (0.0 - 0.1)
+COHERENT = 1 #Coherent=1,Incoherent=0
+INCO_FACTOR = 1. #percentage of incoherence
+BFORD = 9.5
+INT_PT_MAX = 0.24 #Maximum pt considered, when interference is turned on
+INT_PT_N_BINS =120 #Number of pt bins when interference is turned on
+
+# Photonuclear specific options, energies in Lab frame. These values should be within the range of the
+# values specified in the DPMJet input file (when DPMJet is used)
+MIN_GAMMA_ENERGY = 6.0 (for Pythia this need value needs to correspond to a CMS energy of ?)
+MAX_GAMMA_ENERGY = 600000.0
Index: branches/starlight_1.1/config/my.input
===================================================================
--- branches/starlight_1.1/config/my.input (revision 0)
+++ branches/starlight_1.1/config/my.input (revision 145)
@@ -0,0 +1,45 @@
+**********************************************************************
+* Example for a DTUNUC input file.
+* Uncomment the input-cards according to your requirements.
+*
+* Format: A10,6E10.0,A8
+* (except for the section enclosed by "PHOINPUT" and "ENDINPUT"
+* which is format-free)
+* lines starting with "*" are comment lines
+**********************************************************************
+*
+* projectile / target / Energy
+* -------------------
+* 1 2 3 4 5 6 7
+*23456789012345678901234567890123456789012345678901234567890123456789012345678
+PROJPAR 0.0 PHOTON
+TARPAR 208.0 82.0
+ENERGY 6.0 600000.0
+*ENERGY 100.0
+* Initialize the random number generator
+RNDMINIT 55.0 101.0 15.0 73.0
+*
+*
+* PHOJET-specific input
+* ---------------------
+* The following lines control the event-generation with PHOJET for
+* individual photon/nucleon-nucleon collisions.
+* For details see the PHOJET-manual available at
+* http://lepton.bartol.udel.edu/~eng/phojet.html
+* Any options explained in the PHOJET-manual can be used in between
+* the "PHOINPUT" and "ENDINPUT" cards.
+PHOINPUT
+PROCESS 1 0 1 1 1 1 1 1
+ENDINPUT
+*
+* Output
+* ------
+* some default output (particle multiplicities etc.)
+HISTOGRAM 101.0 102.0
+*
+* Start of event generation
+* -------------------------
+*START 5000.0 0.0
+START 100.0 0.0
+STOP
+*...+....1....+....2....+....3....+....4....+....5....+....6....+....7...
Index: branches/starlight_1.1/INSTALL
===================================================================
--- branches/starlight_1.1/INSTALL (revision 0)
+++ branches/starlight_1.1/INSTALL (revision 145)
@@ -0,0 +1,42 @@
+
+To build Starlight:
+
+- First create your build directory (e.g. mkdir <PathToSource>/build)
+- $ cd <BUILDDIR>
+- $ cmake <PathToSource>
+- $ make
+
+This creates an executable file, starlight, in the build directory.
+
+To run starlight a configuration file, slight.in, is needed. Examples of
+this file can be found in the config/ directory.
+
+To run:
+
+$ ./starlight
+
+If you want Pythia support you need to run cmake with an option:
+
+$ cmake <PathToSource> -DENABLE_PYTHIA=ON
+
+In addition the environment variable $PYTHIADIR needs to be pointing
+to the top directory of Pythia8.
+
+P.S. Pythia is disables in this release
+
+//---------------------------------------------------
+
+
+directory standard contains regular Makefile and sample of config file
+
+
+for compilation
+
+1) cd standard
+2) gmake/make
+3) ./starlight
+
+
+enjoy
+
+YG 08/12/2010
\ No newline at end of file
Index: branches/starlight_1.1/cmake_modules/CommonMacros.cmake
===================================================================
--- branches/starlight_1.1/cmake_modules/CommonMacros.cmake (revision 0)
+++ branches/starlight_1.1/cmake_modules/CommonMacros.cmake (revision 145)
@@ -0,0 +1,76 @@
+###########################################################################
+#
+# Copyright 2010
+#
+# This file is part of Starlight.
+#
+# Starlight is free software: you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation, either version 3 of the License, or
+# (at your option) any later version.
+#
+# Starlight is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with Starlight. If not, see <http://www.gnu.org/licenses/>.
+#
+###########################################################################
+#
+# File and Version Information:
+# $Rev:: $: revision of last commit
+# $Author:: $: author of last commit
+# $Date:: $: date of last commit
+#
+# Description:
+# collection of useful cmake macros
+#
+#
+###########################################################################
+
+
+# takes list of file names and returns file name list with new extension
+# example:
+# switch_file_extension("${CC_LIST}" ".cc" ".h" H_LIST)
+function(switch_file_extension IN_FILE_LIST OLD_EXT NEW_EXT OUT_FILE_LIST)
+ set(NEW_FILE_LIST)
+ foreach(_OLD_FILE ${IN_FILE_LIST})
+ string(REGEX REPLACE "^(.*)${OLD_EXT}$" "\\1${NEW_EXT}" _NEW_FILE ${_OLD_FILE})
+ set(NEW_FILE_LIST ${NEW_FILE_LIST} ${_NEW_FILE})
+ endforeach()
+ set(${OUT_FILE_LIST} ${NEW_FILE_LIST})
+endfunction(switch_file_extension)
+
+
+# adds standard shared library
+# additional libraries that should be linked to can be given as optional arguments
+function(make_shared_library LIB_NAME SOURCES)
+ add_library(${LIB_NAME} SHARED ${SOURCES})
+ # proccess link libraries in additional arguments
+ foreach(_LIB ${ARGN})
+ target_link_libraries(${LIB_NAME} ${_LIB})
+ endforeach()
+endfunction(make_shared_library)
+
+
+# adds standard executable
+# additional libraries that should be linked to can be given as optional arguments
+function(make_executable EXE_NAME SOURCES)
+ add_executable(${EXE_NAME} ${SOURCES})
+ # proccess link libraries in additional arguments
+ foreach(_LIB ${ARGN})
+ target_link_libraries(${EXE_NAME} ${_LIB})
+ endforeach()
+endfunction(make_executable)
+
+
+macro(enforce_out_of_source_build)
+ if(${CMAKE_SOURCE_DIR} STREQUAL ${CMAKE_BINARY_DIR})
+ message(FATAL_ERROR "Building this project in the source directory is not allowed. Please remove CMakeCache.txt, create a build directory, and run cmake there, for example:
+rm CMakeCache.txt
+mkdir build && cd build
+cmake ..")
+ endif()
+endmacro(enforce_out_of_source_build)
Property changes on: branches/starlight_1.1/cmake_modules/CommonMacros.cmake
___________________________________________________________________
Added: svn:keywords
## -0,0 +1 ##
+Rev Date Author
\ No newline at end of property
Index: branches/starlight_1.1/cmake_modules/FindLHAPDF.cmake
===================================================================
--- branches/starlight_1.1/cmake_modules/FindLHAPDF.cmake (revision 0)
+++ branches/starlight_1.1/cmake_modules/FindLHAPDF.cmake (revision 145)
@@ -0,0 +1,20 @@
+#Will look for LHAPDF libraries in /usr/lib/ or /usr/local/lib/. If LHAPDF is not found, then look for dummy lhapdf in pythia8.
+
+FIND_PATH(LHAPDF_INCLUDE_DIR Pythia.h /usr/include/ /usr/local/include/ $ENV{PYTHIADIR}/include)
+
+FIND_LIBRARY(LHAPDF_LIBRARIES NAMES lhapdfdummy PATHS /usr/lib /usr/local/lib $ENV{PYTHIADIR}/lib/archive/)
+
+IF (LHAPDF_INCLUDE_DIR AND LHAPDF_LIBRARIES)
+ SET(LHAPDF_FOUND TRUE)
+ENDIF (LHAPDF_INCLUDE_DIR AND LHAPDF_LIBRARIES)
+
+IF (LHAPDF_FOUND)
+ IF (NOT Pythia8_FIND_QUIETLY)
+ MESSAGE(STATUS "Found LHAPDF: ${LHAPDF_LIBRARIES}")
+ ENDIF (NOT Pythia8_FIND_QUIETLY)
+ELSE (LHAPDF_FOUND)
+ IF (Pythia8_FIND_REQUIRED)
+ MESSAGE(FATAL_ERROR "Could not find LHAPDF")
+ ENDIF (Pythia8_FIND_REQUIRED)
+ENDIF (LHAPDF_FOUND)
+
Index: branches/starlight_1.1/cmake_modules/FindDPMJet.cmake
===================================================================
--- branches/starlight_1.1/cmake_modules/FindDPMJet.cmake (revision 0)
+++ branches/starlight_1.1/cmake_modules/FindDPMJet.cmake (revision 145)
@@ -0,0 +1,29 @@
+
+FIND_FILE(DPMJET_OBJECT NAMES dpmjet3.0-5.o PATHS $ENV{DPMJETDIR})
+FIND_FILE(DPMJET_PY_OBJECT NAMES pythia6115dpm3v1.o PATHS $ENV{DPMJETDIR})
+FIND_FILE(DPMJET_PHO_OBJECT NAMES phojet1.12-35c4.o PATHS $ENV{DPMJETDIR})
+
+IF (DPMJET_OBJECT AND DPMJET_PY_OBJECT AND DPMJET_PHO_OBJECT)
+ SET(DPMJET_OBJECTS ${DPMJET_OBJECT} ${DPMJET_PY_OBJECT} ${DPMJET_PHO_OBJECT})
+ SET(DPMJET_FOUND TRUE)
+ SET_SOURCE_FILES_PROPERTIES(
+ ${DPMJET_OBJECTS}
+ PROPERTIES
+ EXTERNAL_OBJECT true
+ )
+ENDIF (DPMJET_OBJECT AND DPMJET_PY_OBJECT AND DPMJET_PHO_OBJECT)
+
+IF (DPMJET_FOUND)
+ IF (NOT DPMJet_FIND_QUIETLY)
+ MESSAGE(STATUS "Found DPMJet: ${DPMJET_OBJECT}")
+ ENDIF (NOT DPMJet_FIND_QUIETLY)
+ELSE (DPMJET_FOUND)
+ IF (DPMJet_FIND_REQUIRED)
+ MESSAGE(FATAL_ERROR "Could not find DPMJet, we look in $DPMJETDIR")
+ ELSE(DPMJet_FIND_REQUIRED)
+ IF(NOT DPMJet_FIND_QUIETLY)
+ MESSAGE(STATUS "Could not find DPMJet, we look in $DPMJETDIR")
+ ENDIF(NOT DPMJet_FIND_QUIETLY)
+ ENDIF (DPMJet_FIND_REQUIRED)
+ENDIF (DPMJET_FOUND)
+
Index: branches/starlight_1.1/cmake_modules/FindROOT.cmake
===================================================================
--- branches/starlight_1.1/cmake_modules/FindROOT.cmake (revision 0)
+++ branches/starlight_1.1/cmake_modules/FindROOT.cmake (revision 145)
@@ -0,0 +1,332 @@
+###########################################################################
+#
+# Copyright 2010
+#
+# This file is part of Starlight.
+#
+# Starlight is free software: you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation, either version 3 of the License, or
+# (at your option) any later version.
+#
+# Starlight is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with Starlight. If not, see <http://www.gnu.org/licenses/>.
+#
+###########################################################################
+#
+# File and Version Information:
+# $Rev:: $: revision of last commit
+# $Author:: $: author of last commit
+# $Date:: $: date of last commit
+#
+# Description:
+# cmake module for finding ROOT installation
+# requires root-config to be in PATH
+# based on AliRoots's FindROOT.cmake (r41015)
+# in https://alisoft.cern.ch/AliRoot/trunk/cmake/modules
+#
+# following variables are defined:
+# ROOT_CONFIG_EXECUTABLE - path to root-config program
+# ROOTSYS - path to root installation directory
+# ROOT_TARGET - target architecture
+# ROOT_F77 - Fortran complier used building ROOT
+# ROOT_CC - C complier used building ROOT
+# ROOT_CPP - C++ complier used building ROOT
+# ROOT_VERSION - ROOT version
+# ROOT_SVN_REVISION - ROOT subversion revision
+# ROOT_BIN_DIR - ROOT executable directory
+# ROOT_INCLUDE_DIR - ROOT header directory
+# ROOT_LIBRARY_DIR - ROOT library directory
+# ROOT_LIBRARIES - linker flags for ROOT libraries
+# ROOT_AUX_LIBRARIES - linker flags for auxiliary libraries
+# ROOTCINT_EXECUTABLE - path to rootcint program
+# ROOT_MAJOR_VERSION - ROOT major version
+# ROOT_MINOR_VERSION - ROOT minor version
+# ROOT_PATCH_VERSION - ROOT patch level
+# ROOT_LIBS - list of ROOT library files
+#
+# Example usage:
+# find_package(ROOT 5.26 REQUIRED Minuit2)
+#
+#
+# The module also provides a function to generate ROOT dictionaries.
+# Example usage:
+# set(ROOTPWA_DICTIONARY ${CMAKE_CURRENT_BINARY_DIR}/someDict.cc) # set dictionary path
+# root_generate_dictionary(
+# "${ROOTPWA_DICTIONARY}" # path to dictionary to generate
+# "${INCLUDE_DIR1};${INCLUDE_DIR2}" # list of includes
+# "class1.h;class2.h;class3.h" # list of classes to process
+# "someLinkDef.h" # ROOT linkDef file
+# )
+# set(SOURCES ${SOURCES} ${ROOTPWA_DICTIONARY}) # append dictionary to sources
+#
+#
+###########################################################################
+
+
+set(ROOT_FOUND FALSE)
+set(ROOT_ERROR_REASON "")
+set(ROOT_DEFINITIONS "")
+set(ROOT_LIBS)
+
+
+find_program(ROOT_CONFIG_EXECUTABLE root-config)
+if(NOT ROOT_CONFIG_EXECUTABLE)
+ set(ROOT_ERROR_REASON "${ROOT_ERROR_REASON} Cannot find root-config.")
+else()
+
+ set(ROOT_FOUND TRUE)
+
+ execute_process(
+ COMMAND ${ROOT_CONFIG_EXECUTABLE} --prefix
+ OUTPUT_VARIABLE ROOTSYS
+ OUTPUT_STRIP_TRAILING_WHITESPACE)
+
+ execute_process(
+ COMMAND ${ROOT_CONFIG_EXECUTABLE} --arch
+ OUTPUT_VARIABLE ROOT_TARGET
+ OUTPUT_STRIP_TRAILING_WHITESPACE)
+
+ execute_process(
+ COMMAND ${ROOT_CONFIG_EXECUTABLE} --f77
+ OUTPUT_VARIABLE ROOT_F77
+ OUTPUT_STRIP_TRAILING_WHITESPACE)
+
+ execute_process(
+ COMMAND ${ROOT_CONFIG_EXECUTABLE} --cc
+ OUTPUT_VARIABLE ROOT_CC
+ OUTPUT_STRIP_TRAILING_WHITESPACE)
+
+ execute_process(
+ COMMAND ${ROOT_CONFIG_EXECUTABLE} --cxx
+ OUTPUT_VARIABLE ROOT_CPP
+ OUTPUT_STRIP_TRAILING_WHITESPACE)
+
+ execute_process(
+ COMMAND ${ROOT_CONFIG_EXECUTABLE} --version
+ OUTPUT_VARIABLE ROOT_VERSION
+ OUTPUT_STRIP_TRAILING_WHITESPACE)
+
+ execute_process(
+ COMMAND ${ROOT_CONFIG_EXECUTABLE} --svn-revision
+ OUTPUT_VARIABLE ROOT_SVN_REVISION
+ OUTPUT_STRIP_TRAILING_WHITESPACE)
+
+ execute_process(
+ COMMAND ${ROOT_CONFIG_EXECUTABLE} --bindir
+ OUTPUT_VARIABLE ROOT_BIN_DIR
+ OUTPUT_STRIP_TRAILING_WHITESPACE)
+ if(NOT EXISTS "${ROOT_BIN_DIR}")
+ set(ROOT_FOUND FALSE)
+ set(ROOT_ERROR_REASON "${ROOT_ERROR_REASON} ROOT executable directory ${ROOT_BIN_DIR} does not exist.")
+ endif()
+
+ execute_process(
+ COMMAND ${ROOT_CONFIG_EXECUTABLE} --incdir
+ OUTPUT_VARIABLE ROOT_INCLUDE_DIR
+ OUTPUT_STRIP_TRAILING_WHITESPACE)
+ if(NOT EXISTS "${ROOT_INCLUDE_DIR}")
+ set(ROOT_FOUND FALSE)
+ set(ROOT_ERROR_REASON "${ROOT_ERROR_REASON} ROOT include directory ${ROOT_INCLUDE_DIR} does not exist.")
+ endif()
+
+ execute_process(
+ COMMAND ${ROOT_CONFIG_EXECUTABLE} --libdir
+ OUTPUT_VARIABLE ROOT_LIBRARY_DIR
+ OUTPUT_STRIP_TRAILING_WHITESPACE)
+ if(NOT EXISTS "${ROOT_LIBRARY_DIR}")
+ set(ROOT_FOUND FALSE)
+ set(ROOT_ERROR_REASON "${ROOT_ERROR_REASON} ROOT library directory ${ROOT_LIBRARY_DIR} does not exist.")
+ endif()
+
+ execute_process(
+ COMMAND ${ROOT_CONFIG_EXECUTABLE} --noauxlibs --glibs
+ OUTPUT_VARIABLE ROOT_LIBRARIES
+ OUTPUT_STRIP_TRAILING_WHITESPACE)
+
+ execute_process(
+ COMMAND ${ROOT_CONFIG_EXECUTABLE} --auxlibs
+ OUTPUT_VARIABLE ROOT_AUX_LIBRARIES
+ OUTPUT_STRIP_TRAILING_WHITESPACE)
+
+ find_program(ROOTCINT_EXECUTABLE rootcint)
+ if(NOT ROOTCINT_EXECUTABLE)
+ set(ROOT_FOUND FALSE)
+ set(ROOT_ERROR_REASON "${ROOT_ERROR_REASON} Cannot find rootcint.")
+ endif()
+
+ # parse version string
+ string(REGEX REPLACE "^([0-9]+)\\.[0-9][0-9]+\\/[0-9][0-9]+.*" "\\1"
+ ROOT_MAJOR_VERSION "${ROOT_VERSION}")
+ string(REGEX REPLACE "^[0-9]+\\.([0-9][0-9])+\\/[0-9][0-9]+.*" "\\1"
+ ROOT_MINOR_VERSION "${ROOT_VERSION}")
+ string(REGEX REPLACE "^[0-9]+\\.[0-9][0-9]+\\/([0-9][0-9]+).*" "\\1"
+ ROOT_PATCH_VERSION "${ROOT_VERSION}")
+ # make sure minor version is specified
+ if(ROOT_FIND_VERSION AND NOT ROOT_FIND_VERSION_MINOR)
+ message(FATAL_ERROR "When requesting a specific version of ROOT, you must provide at least the major and minor version numbers, e.g., 5.22")
+ endif()
+ # set patchlevel to 0, if not specified
+ if(NOT ROOT_FIND_VERSION_PATCH)
+ set(ROOT_FIND_VERSION_PATCH 0)
+ endif()
+ # compute an overall version number which can be compared at once
+ math(EXPR _ROOT_FIND_VERSION "${ROOT_FIND_VERSION_MAJOR} * 10000 + ${ROOT_FIND_VERSION_MINOR} * 100 + ${ROOT_FIND_VERSION_PATCH}")
+ math(EXPR _ROOT_VERSION "${ROOT_MAJOR_VERSION} * 10000 + ${ROOT_MINOR_VERSION} * 100 + ${ROOT_PATCH_VERSION}")
+ # compare version
+ if(ROOT_FIND_VERSION_EXACT)
+ if(NOT _ROOT_VERSION EQUAL "${_ROOT_FIND_VERSION}")
+ set(ROOT_FOUND FALSE)
+ set(ROOT_ERROR_REASON "${ROOT_ERROR_REASON} ROOT version ${ROOT_VERSION} does not match requested version ${ROOT_FIND_VERSION_MAJOR}.${ROOT_FIND_VERSION_MINOR}/${ROOT_FIND_VERSION_PATCH}.")
+ endif()
+ else()
+ if(_ROOT_VERSION LESS "${_ROOT_FIND_VERSION}")
+ set(ROOT_FOUND FALSE)
+ set(ROOT_ERROR_REASON "${ROOT_ERROR_REASON} ROOT version ${ROOT_VERSION} is lower than requested version ${ROOT_FIND_VERSION_MAJOR}.${ROOT_FIND_VERSION_MINOR}/${ROOT_FIND_VERSION_PATCH}.")
+ endif()
+ endif()
+
+endif()
+
+
+# generate list of ROOT libraries
+if(ROOT_FOUND)
+
+ # create list of internal libraries from root-config output
+ set(_LIBRARY_NAMES)
+ set(_EXTERNAL_ZLIB)
+ separate_arguments(ROOT_LIBRARIES)
+ # remove first -L entry
+ list(REMOVE_AT ROOT_LIBRARIES 0)
+ # loop over -l entries
+ foreach(_LIBRARY ${ROOT_LIBRARIES})
+ # extract library name from compiler flag and append to list
+ string(REGEX REPLACE "^-.(.*)$" "\\1" _LIBNAME "${_LIBRARY}")
+ # workaround for root-config inconsistency: if ROOT is built with --disable-builtin-zlib
+ # root-config returns the flag for the external zlib together with the internal libraries
+ if(_LIBNAME STREQUAL "z")
+ set(_EXTERNAL_ZLIB "-lz")
+ else()
+ list(APPEND _LIBRARY_NAMES ${_LIBNAME})
+ endif()
+ endforeach()
+
+ # append components
+ list(REMOVE_DUPLICATES ROOT_FIND_COMPONENTS)
+ if(ROOT_FIND_COMPONENTS)
+ set(_LIBRARY_NAMES "${_LIBRARY_NAMES};${ROOT_FIND_COMPONENTS}")
+ endif()
+
+ # check whether libraries exist
+ foreach(_LIBNAME ${_LIBRARY_NAMES})
+ find_library(_ROOT_LIB_${_LIBNAME}
+ NAMES ${_LIBNAME}
+ PATHS ${ROOT_LIBRARY_DIR}
+ NO_DEFAULT_PATH)
+ if(NOT _ROOT_LIB_${_LIBNAME})
+ set(ROOT_FOUND FALSE)
+ set(ROOT_ERROR_REASON "${ROOT_ERROR_REASON} Cannot find ROOT library ${_LIBNAME} in ${ROOT_LIBRARY_DIR}.")
+ else()
+ list(APPEND ROOT_LIBS ${_ROOT_LIB_${_LIBNAME}})
+ endif()
+ endforeach()
+
+ # create list of external libraries from root-config output
+ separate_arguments(ROOT_AUX_LIBRARIES)
+ # append external zlib to auxiliary libraries
+ if(_EXTERNAL_ZLIB)
+ list(APPEND ROOT_AUX_LIBRARIES ${_EXTERNAL_ZLIB})
+ endif()
+ # loop over -l entries
+ foreach(_LIBRARY ${ROOT_AUX_LIBRARIES})
+ # extract library name from compiler flag
+ string(REGEX MATCH "^-l(.*)$" _LIBNAME "${_LIBRARY}")
+ if(_LIBNAME)
+ string(REGEX REPLACE "^-.(.*)$" "\\1" _LIBNAME "${_LIBNAME}")
+ # check whether libraries exist
+ find_library(_AUX_LIB_${_LIBNAME}
+ NAMES ${_LIBNAME})
+ if(NOT _AUX_LIB_${_LIBNAME})
+ set(ROOT_FOUND FALSE)
+ set(ROOT_ERROR_REASON "${ROOT_ERROR_REASON} Cannot find ROOT library ${_LIBNAME}.")
+ else()
+ list(APPEND ROOT_LIBS ${_AUX_LIB_${_LIBNAME}})
+ endif()
+ endif()
+ endforeach()
+
+endif()
+
+
+# make variables changeable
+mark_as_advanced(
+ ROOT_INCLUDE_DIR
+ ROOT_LIBRARY_DIR
+ ROOT_LIBRARIES
+ ROOT_LIBS
+ ROOT_DEFINITIONS
+)
+
+
+# report result
+if(ROOT_FOUND)
+ message(STATUS "Found ROOT version ${ROOT_VERSION} r${ROOT_SVN_REVISION} in ${ROOTSYS}")
+ message(STATUS "Using ROOT include dir ${ROOT_INCLUDE_DIR}")
+ message(STATUS "Using ROOT library dir ${ROOT_LIBRARY_DIR}")
+ message(STATUS "Using ROOT libraries: ${ROOT_LIBRARIES}")
+ message(STATUS "Using ROOT additional components: ${ROOT_FIND_COMPONENTS}")
+else()
+ if(ROOT_FIND_REQUIRED)
+ message(FATAL_ERROR "Unable to find requested ROOT installation:${ROOT_ERROR_REASON}")
+ else()
+ if(NOT ROOT_FIND_QUIETLY)
+ message(STATUS "ROOT was not found.")
+ endif()
+ endif()
+endif()
+
+
+# macro that generates ROOT dictionary
+function(root_generate_dictionary DICT_FILE INCLUDE_DIRS HEADER_FILES LINKDEF_FILE)
+
+ if(NOT ROOT_FOUND)
+ message(FATAL_ERROR "Impossible to generate dictionary ${DICT_FILE}, because no ROOT installation was found.")
+ endif()
+
+ # prepare command line argument for compiler definitions (put -D in front)
+ set(_DEFINITIONS)
+ get_property(_DEFS DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} PROPERTY COMPILE_DEFINITIONS)
+ foreach(_DEF ${_DEFS})
+ set(_DEFINITIONS "${_DEFINITIONS} -D${_DEF}")
+ endforeach()
+ separate_arguments(_DEFINITIONS)
+
+ # prepare command line argument for include directories (put -I in front)
+ set(_INCLUDES)
+ foreach(_FILE ${INCLUDE_DIRS})
+ set(_INCLUDES ${_INCLUDES} -I${_FILE})
+ endforeach()
+
+ # strip paths from header file names
+ set(_HEADERS)
+ foreach(_FILE ${HEADER_FILES})
+ get_filename_component(_NAME ${_FILE} NAME)
+ set(_HEADERS ${_HEADERS} ${_NAME})
+ endforeach()
+
+ # add dictionary header file to output files
+ string(REGEX REPLACE "^(.*)\\.(.*)$" "\\1.h" _DICT_HEADER "${DICT_FILE}")
+ set(OUTPUT_FILES ${DICT_FILE} ${_DICT_HEADER})
+
+ add_custom_command(OUTPUT ${OUTPUT_FILES}
+ COMMAND ${ROOTCINT_EXECUTABLE}
+ ARGS -f ${DICT_FILE} -c -DHAVE_CONFIG_H ${_DEFINITIONS} ${_INCLUDES} ${_HEADERS} ${LINKDEF_FILE}
+ DEPENDS ${HEADER_FILES} ${LINKDEF_FILE}
+ )
+
+endfunction(root_generate_dictionary)
Property changes on: branches/starlight_1.1/cmake_modules/FindROOT.cmake
___________________________________________________________________
Added: svn:keywords
## -0,0 +1 ##
+Rev Date Author
\ No newline at end of property
Index: branches/starlight_1.1/cmake_modules/FindPythia6.cmake
===================================================================
--- branches/starlight_1.1/cmake_modules/FindPythia6.cmake (revision 0)
+++ branches/starlight_1.1/cmake_modules/FindPythia6.cmake (revision 145)
@@ -0,0 +1,22 @@
+
+FIND_LIBRARY(PYTHIA6_LIBRARY NAMES pythia6 PATHS /usr/lib /usr/lib64 /usr/local/lib $ENV{PYTHIADIR})
+
+IF (PYTHIA6_LIBRARY)
+ SET(PYTHIA6_FOUND TRUE)
+ENDIF (PYTHIA6_LIBRARY)
+
+IF (PYTHIA6_FOUND)
+ IF (NOT Pythia6_FIND_QUIETLY)
+ MESSAGE(STATUS "Found Pythia6: ${PYTHIA6_LIBRARY}")
+ ENDIF (NOT Pythia6_FIND_QUIETLY)
+ELSE (PYTHIA6_FOUND)
+ IF (Pythia6_FIND_REQUIRED)
+ MESSAGE(FATAL_ERROR "Could not find Pythia6. We search first in the normal library paths, then in $PYTHIADIR")
+ ELSE(Pythia6_FIND_REQUIRED)
+ IF(NOT Pythia6_FIND_QUIETLY)
+ MESSAGE(STATUS "Could not find Pythia6. We search first in the normal library paths, then in $PYTHIADIR")
+ ENDIF(NOT Pythia6_FIND_QUIETLY)
+ ENDIF (Pythia6_FIND_REQUIRED)
+
+ENDIF (PYTHIA6_FOUND)
+
Index: branches/starlight_1.1/cmake_modules/FindPythia8.cmake
===================================================================
--- branches/starlight_1.1/cmake_modules/FindPythia8.cmake (revision 0)
+++ branches/starlight_1.1/cmake_modules/FindPythia8.cmake (revision 145)
@@ -0,0 +1,27 @@
+FIND_PATH(PYTHIA8_INCLUDE_DIR Pythia.h /usr/include/ /usr/include/pythia /usr/local/include/ $ENV{PYTHIADIR}/include)
+
+FIND_PATH(PYTHIA8_SETTINGS_DIR Index.xml /usr/share/pythia/xmldoc $ENV{PYTHIADIR}/xmldoc)
+
+FIND_LIBRARY(PYTHIA8_LIBRARY NAMES pythia8 PATHS /usr/lib /usr/lib/pythia /usr/local/lib $ENV{PYTHIADIR}/lib/archive/)
+
+IF (PYTHIA8_INCLUDE_DIR AND PYTHIA8_LIBRARY AND PYTHIA8_SETTINGS_DIR)
+ SET(PYTHIA8_FOUND TRUE)
+ENDIF (PYTHIA8_INCLUDE_DIR AND PYTHIA8_LIBRARY AND PYTHIA8_SETTINGS_DIR)
+
+
+IF (PYTHIA8_FOUND)
+ IF (NOT Pythia8_FIND_QUIETLY)
+ MESSAGE(STATUS "Found Pythia8: ${PYTHIA8_LIBRARY}")
+ MESSAGE(STATUS "Found Pythia8 include: ${PYTHIA8_INCLUDE_DIR}")
+ ENDIF (NOT Pythia8_FIND_QUIETLY)
+ELSE (PYTHIA8_FOUND)
+ IF (Pythia8_FIND_REQUIRED)
+ MESSAGE(FATAL_ERROR "Could not find Pythia8. We search first in the normal library paths, then in $PYTHIADIR")
+ ELSE(Pythia8_FIND_REQUIRED)
+ IF(NOT Pythia8_FIND_QUIETLY)
+ MESSAGE(STATUS "Could not find Pythia8. We search first in the normal library paths, then in $PYTHIADIR")
+ ENDIF(NOT Pythia8_FIND_QUIETLY)
+ ENDIF (Pythia8_FIND_REQUIRED)
+
+ENDIF (PYTHIA8_FOUND)
+
Index: branches/starlight_1.1/CMakeLists.txt
===================================================================
--- branches/starlight_1.1/CMakeLists.txt (revision 0)
+++ branches/starlight_1.1/CMakeLists.txt (revision 145)
@@ -0,0 +1,310 @@
+###########################################################################
+#
+# Copyright 2010
+#
+# This file is part of Starlight.
+#
+# Starlight is free software: you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation, either version 3 of the License, or
+# (at your option) any later version.
+#
+# Starlight is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with Starlight. If not, see <http://www.gnu.org/licenses/>.
+#
+###########################################################################
+#
+# File and Version Information:
+# $Rev:: 111 $: revision of last commit
+# $Author:: odjuvsla $: author of last commit
+# $Date:: 2013-02-05 15:11:52 -0600 #$: date of last commit
+#
+# Description:
+# Starlight build file
+#
+#
+###########################################################################
+
+
+# check if cmake has the required version
+cmake_minimum_required(VERSION 2.6.0 FATAL_ERROR)
+
+
+# set verbosity
+set(CMAKE_VERBOSE_MAKEFILE 0) # if set to 1 compile and link commands are displayed during build
+# the same effect can be achieved by calling 'make VERBOSE=1'
+
+
+# The version number.
+set (Starlight_VERSION_MAJOR 1)
+set (Starlight_VERSION_MINOR 0)
+
+# define project
+project(starlight)
+find_package (Threads)
+
+# load some common cmake macros
+# set path, where to look first for cmake modules, before ${CMAKE_ROOT}/Modules/ is checked
+set(CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/cmake_modules")
+message(STATUS "Using cmake module path '${CMAKE_MODULE_PATH}'")
+include(CommonMacros)
+
+
+# force out-of-source builds.
+enforce_out_of_source_build()
+
+
+# warn user if system is not UNIX
+if(NOT UNIX)
+ message(FATAL_ERROR "This is an unsupported system.")
+endif()
+message(STATUS "Detected host system '${CMAKE_HOST_SYSTEM_NAME}' version '${CMAKE_HOST_SYSTEM_VERSION}' architecture '${CMAKE_HOST_SYSTEM_PROCESSOR}'")
+message(STATUS "Compiling for system '${CMAKE_SYSTEM_NAME}' version '${CMAKE_SYSTEM_VERSION}' architecture '${CMAKE_SYSTEM_PROCESSOR}'")
+
+
+# define build types
+# set a default build type for single-configuration CMake generators, if no build type is set.
+set(CMAKE_BUILD_TYPE Debug)
+if(NOT CMAKE_CONFIGURATION_TYPES AND NOT CMAKE_BUILD_TYPE)
+ message(STATUS "No build type was specified. Setting build type to 'Release'.")
+ set(CMAKE_BUILD_TYPE Release)
+endif()
+# common compiler flags
+if (CMAKE_COMPILER_IS_GNUCC)
+ execute_process(COMMAND ${CMAKE_CXX_COMPILER} -dumpversion OUTPUT_VARIABLE GCC_VERSION)
+ message(STATUS "GCC_VERSTION")
+ message(STATUS ${GCC_VERSION})
+ if (GCC_VERSION VERSION_GREATER 4.6 OR GCC_VERSION VERSION_EQUAL 4.6)
+ message(STATUS "GCC_VERSION>=4.6")
+ set(CMAKE_CXX_FLAGS "-Wall -Wextra -Werror -Wno-error=unused-but-set-variable -Wno-error=unused-but-set-parameter")
+ else()
+ message(STATUS "GCC_VERSION<4.6")
+ set(CMAKE_CXX_FLAGS "-Wall -Wextra -Werror")
+ endif()
+else()
+ message(STATUS "Not GCC")
+ set(CMAKE_CXX_FLAGS "-Wall -Wextra -Werror")
+endif()
+# flags for specific build types
+set(CMAKE_CXX_FLAGS_DEBUG "-g")
+set(CMAKE_CXX_FLAGS_RELEASE "-O3")
+set(CMAKE_CXX_LDFLAGS_DEBUG "-g")
+# report global build settings
+message(STATUS "Using CXX compiler '${CMAKE_CXX_COMPILER}'")
+message(STATUS "Using CXX general compiler flags '${CMAKE_CXX_FLAGS}'")
+foreach(_BUILD_TYPE "DEBUG" "MINSIZEREL" "RELEASE" "RELWITHDEBINFO")
+ message(STATUS "Using CXX compiler flags '${CMAKE_CXX_FLAGS_${_BUILD_TYPE}}' for build type ${_BUILD_TYPE}")
+endforeach()
+message(STATUS "Build type is '${CMAKE_BUILD_TYPE}'")
+
+
+# redirect output files
+#set(LIBRARY_OUTPUT_PATH "${CMAKE_SOURCE_DIR}/lib")
+message(STATUS "Using library output path '${LIBRARY_OUTPUT_PATH}'")
+#set(EXECUTABLE_OUTPUT_PATH "${CMAKE_SOURCE_DIR}/bin")
+message(STATUS "Using executable output path '${EXECUTABLE_OUTPUT_PATH}'")
+
+
+# make CMAKE_SOURCE_DIR accessible in source code via predefined macro CMAKE_SOURCE_DIR
+if(CMAKE_SOURCE_DIR)
+ add_definitions(-D'CMAKE_SOURCE_DIR=\"${CMAKE_SOURCE_DIR}\"')
+else()
+ add_definitions(-D'CMAKE_SOURCE_DIR=\"\"')
+endif()
+
+
+# make SVN version string accessible in source code via predefined macro SVN_VERSION
+find_package(Subversion)
+if(Subversion_FOUND)
+ # unfortunately CMAKE only parses 'svn info'
+ find_program(SVNVERSION_EXECUTABLE
+ svnversion
+ )
+ if(NOT SVNVERSION_EXECUTABLE)
+ message(STATUS "Could not find subversion command 'svnversion'. Repository version unknown.")
+ else()
+ execute_process(
+ COMMAND ${SVNVERSION_EXECUTABLE} "${CMAKE_SOURCE_DIR}"
+ OUTPUT_VARIABLE SVN_VERSION
+ RESULT_VARIABLE _SVNVERSION_RETURN
+ OUTPUT_STRIP_TRAILING_WHITESPACE)
+ if(NOT ${_SVNVERSION_RETURN})
+ message(STATUS "Subversion repository revision is '${SVN_VERSION}'")
+ else()
+ message(STATUS "Error running 'svnversion'. Repository version unknown.")
+ set(SVN_VERSION "")
+ endif()
+ endif()
+else()
+ message(STATUS "Could not find subversion installation. Repository version unknown.")
+endif()
+if(SVN_VERSION)
+ add_definitions(-D'SVN_VERSION=\"${SVN_VERSION}\"')
+else()
+ add_definitions(-D'SVN_VERSION=\"\"')
+endif()
+
+
+# setup doxygen
+find_package(Doxygen)
+if(NOT DOXYGEN_FOUND)
+ message(WARNING "Cannot find Doxygen. No HTML documentation will be generated.")
+else()
+ set(DOXYGEN_TARGET "doxygen")
+ set(DOXYGEN_DOC_DIR "${CMAKE_SOURCE_DIR}/doxygen")
+ set(DOXYGEN_CONF "${CMAKE_SOURCE_DIR}/starlightDoxyfile.conf")
+ message(STATUS "Run 'make ${DOXYGEN_TARGET}' to create Doxygen documentation files in '${DOXYGEN_DOC_DIR}'")
+ add_custom_target(${DOXYGEN_TARGET}
+ COMMAND ${DOXYGEN_EXECUTABLE} ${DOXYGEN_CONF}
+ DEPENDS ${DOXYGEN_CONF}
+ WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}
+ )
+endif()
+
+
+# setup Pythia 8
+option (ENABLE_PYTHIA "Enable compilation against pythia (necessary for certain processes)" OFF)
+if(ENABLE_PYTHIA)
+ find_package(Pythia8)
+ if(PYTHIA8_FOUND)
+ set(optionalLibs ${optionalLibs} ${PYTHIA8_LIBRARY})
+ find_package(LHAPDF REQUIRED) # implemented for dummy version in Pythia8
+ set(optionalLibs ${optionalLibs} ${LHAPDF_LIBRARIES})
+ option(ENABLE_PYTHIA "Should we use the Pythia8 library" ON)
+ else()
+ option(ENABLE_PYTHIA "Should we use the Pythia8 library" OFF)
+ endif()
+endif()
+
+# setup Pythia 6
+option (ENABLE_PYTHIA6 "Enable compilation against pythia 6 (necessary for certain processes)" OFF)
+if(ENABLE_PYTHIA6)
+ find_package(Pythia6 REQUIRED)
+ if(PYTHIA6_FOUND)
+ set(optionalLibs ${optionalLibs} ${PYTHIA6_LIBRARY})
+ option (ENABLE_PYTHIA6 "Enable compilation against pythia 6 (necessary for certain processes)" ON)
+ include_directories(pythia6)
+ else(PYTHIA6_FOUND)
+ option (ENABLE_PYTHIA6 "Enable compilation against pythia 6 (necessary for certain processes)" OFF)
+ endif(PYTHIA6_FOUND)
+endif()
+
+# setup DPMJET
+option (ENABLE_DPMJET "Enable compilation against DPMJet" OFF)
+if(ENABLE_DPMJET)
+ find_package(DPMJet REQUIRED)
+ if(DPMJET_FOUND)
+ option (ENABLE_DPMJET "Enable compilation against DPMJet" ON)
+ else(DPMJET_FOUND)
+ option (ENABLE_DPMJET "Enable compilation against DPMJet" OFF)
+ endif(DPMJET_FOUND)
+ endif(ENABLE_DPMJET)
+
+
+# set include directories
+set(INCLUDE_DIRECTORIES
+ ${CMAKE_SOURCE_DIR}/include
+ ${PROJECT_BINARY_DIR}
+# ${PYTHIA8_INCLUDE_DIR}
+ )
+include_directories(${INCLUDE_DIRECTORIES})
+
+# Set our source files, include the generated dictionary
+set(SOURCES
+ src/bessel.cpp
+ src/beam.cpp
+ src/inputParameters.cpp
+ src/beambeamsystem.cpp
+ src/starlightparticle.cpp
+ src/gammaaluminosity.cpp
+ src/randomgenerator.cpp
+ src/nucleus.cpp
+ src/eventchannel.cpp
+ src/gammaavm.cpp
+ src/psifamily.cpp
+ src/gammagammasingle.cpp
+ src/photonNucleusCrossSection.cpp
+ src/wideResonanceCrossSection.cpp
+ src/narrowResonanceCrossSection.cpp
+ src/readinluminosity.cpp
+ src/twophotonluminosity.cpp
+ src/gammagammaleptonpair.cpp
+ src/starlight.cpp
+ src/upcevent.cpp
+ src/vector3.cpp
+ src/lorentzvector.cpp
+ src/filewriter.cpp
+ src/eventfilewriter.cpp
+ src/starlightparticlecodes.cpp
+ src/starlightStandalone.cpp
+ src/nBodyPhaseSpaceGen.cpp
+ src/inputParser.cpp
+ src/incoherentPhotonNucleusLuminosity.cpp
+ src/incoherentVMCrossSection.cpp
+ )
+if(ENABLE_PYTHIA)
+ set (SOURCES
+ ${SOURCES}
+ #src/PythiaStarlight.cpp
+ src/pythiadecayer.cpp
+ )
+ include_directories(${PYTHIA8_INCLUDE_DIR})
+endif()
+if(ENABLE_PYTHIA6)
+ set (SOURCES
+ ${SOURCES}
+ src/starlightpythia.cpp
+ src/spectrum.cpp
+ src/spectrumprotonnucleus.cpp
+ )
+endif()
+if(ENABLE_DPMJET)
+ set (SOURCES
+ ${SOURCES}
+ src/starlightdpmjet.cpp
+ src/spectrum.cpp
+ src/spectrumprotonnucleus.cpp
+ )
+endif()
+
+# add Starlight library to the build system
+set(THIS_LIB "Starlib")
+add_library(${THIS_LIB} STATIC ${SOURCES})
+#make_shared_library("${THIS_LIB}" "${SOURCES}"
+# "${PYTHIA8_LIBRARY}"
+# "${LHAPDF_LIBRARIES}"
+#)
+
+if(ENABLE_DPMJET)
+ enable_language(Fortran)
+ set(DPMJET_LIB "DpmJetLib")
+ message(STATUS "DPMJet objects: ${DPMJET_OBJECTS}")
+ add_library(${DPMJET_LIB} STATIC dpmjet/dpmjetint.f ${DPMJET_OBJECTS})
+ set(optionalLibs ${optionalLibs} ${DPMJET_LIB})
+
+endif()
+
+if(ENABLE_PYTHIA6)
+ enable_language(Fortran)
+endif()
+
+# add starlight executable to the build system
+add_executable(starlight src/main.cpp)
+#target_link_libraries(starlight Starlib ${PYTHIA8_LIBRARY} ${LHAPDF_LIBRARIES} ${PYTHIA6_LIBRARY} ${DPMJET_LIB} )
+target_link_libraries(starlight Starlib ${optionalLibs} ${CMAKE_THREAD_LIBS_INIT})
+
+#make_executable(starlight src/main.cpp ${THIS_LIB})
+
+configure_file (
+ "${PROJECT_SOURCE_DIR}/starlightconfig.h.in"
+ "${PROJECT_BINARY_DIR}/starlightconfig.h"
+ )
+
+
+message(STATUS "Cmake did not find any errors. run 'make' to build the project.")
+message(STATUS "On multi-core machines 'make -j#', where # is the number of parallel jobs, can speedup compilation considerably.")
Property changes on: branches/starlight_1.1/CMakeLists.txt
___________________________________________________________________
Added: svn:keywords
## -0,0 +1 ##
+Rev Date Author
\ No newline at end of property
Index: branches/starlight_1.1/Makefile
===================================================================
--- branches/starlight_1.1/Makefile (revision 0)
+++ branches/starlight_1.1/Makefile (revision 145)
@@ -0,0 +1,825 @@
+# CMAKE generated file: DO NOT EDIT!
+# Generated by "Unix Makefiles" Generator, CMake Version 2.6
+
+# Default target executed when no arguments are given to make.
+default_target: all
+.PHONY : default_target
+
+#=============================================================================
+# Special targets provided by cmake.
+
+# Disable implicit rules so canoncical targets will work.
+.SUFFIXES:
+
+# Remove some rules from gmake that .SUFFIXES does not remove.
+SUFFIXES =
+
+.SUFFIXES: .hpux_make_needs_suffix_list
+
+# Suppress display of executed commands.
+$(VERBOSE).SILENT:
+
+# A target that is always out of date.
+cmake_force:
+.PHONY : cmake_force
+
+#=============================================================================
+# Set environment variables for the build.
+
+# The shell in which to execute make rules.
+SHELL = /bin/sh
+
+# The CMake executable.
+CMAKE_COMMAND = /usr/local/bin/cmake
+
+# The command to remove a file.
+RM = /usr/local/bin/cmake -E remove -f
+
+# The program to use to edit the cache.
+CMAKE_EDIT_COMMAND = /usr/local/bin/ccmake
+
+# The top-level source directory on which CMake was run.
+CMAKE_SOURCE_DIR = /home/gorbunov/star/starlight/merge/joey1
+
+# The top-level build directory on which CMake was run.
+CMAKE_BINARY_DIR = /home/gorbunov/star/starlight/merge/joey1
+
+#=============================================================================
+# Targets provided globally by CMake.
+
+# Special rule for the target edit_cache
+edit_cache:
+ @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --cyan "Running CMake cache editor..."
+ /usr/local/bin/ccmake -H$(CMAKE_SOURCE_DIR) -B$(CMAKE_BINARY_DIR)
+.PHONY : edit_cache
+
+# Special rule for the target edit_cache
+edit_cache/fast: edit_cache
+.PHONY : edit_cache/fast
+
+# Special rule for the target rebuild_cache
+rebuild_cache:
+ @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --cyan "Running CMake to regenerate build system..."
+ /usr/local/bin/cmake -H$(CMAKE_SOURCE_DIR) -B$(CMAKE_BINARY_DIR)
+.PHONY : rebuild_cache
+
+# Special rule for the target rebuild_cache
+rebuild_cache/fast: rebuild_cache
+.PHONY : rebuild_cache/fast
+
+# The main all target
+all: cmake_check_build_system
+ $(CMAKE_COMMAND) -E cmake_progress_start /home/gorbunov/star/starlight/merge/joey1/CMakeFiles /home/gorbunov/star/starlight/merge/joey1/CMakeFiles/progress.make
+ $(MAKE) -f CMakeFiles/Makefile2 all
+ $(CMAKE_COMMAND) -E cmake_progress_start /home/gorbunov/star/starlight/merge/joey1/CMakeFiles 0
+.PHONY : all
+
+# The main clean target
+clean:
+ $(MAKE) -f CMakeFiles/Makefile2 clean
+.PHONY : clean
+
+# The main clean target
+clean/fast: clean
+.PHONY : clean/fast
+
+# Prepare targets for installation.
+preinstall: all
+ $(MAKE) -f CMakeFiles/Makefile2 preinstall
+.PHONY : preinstall
+
+# Prepare targets for installation.
+preinstall/fast:
+ $(MAKE) -f CMakeFiles/Makefile2 preinstall
+.PHONY : preinstall/fast
+
+# clear depends
+depend:
+ $(CMAKE_COMMAND) -H$(CMAKE_SOURCE_DIR) -B$(CMAKE_BINARY_DIR) --check-build-system CMakeFiles/Makefile.cmake 1
+.PHONY : depend
+
+#=============================================================================
+# Target rules for targets named Starlight
+
+# Build rule for target.
+Starlight: cmake_check_build_system
+ $(MAKE) -f CMakeFiles/Makefile2 Starlight
+.PHONY : Starlight
+
+# fast build rule for target.
+Starlight/fast:
+ $(MAKE) -f CMakeFiles/Starlight.dir/build.make CMakeFiles/Starlight.dir/build
+.PHONY : Starlight/fast
+
+#=============================================================================
+# Target rules for targets named starlight
+
+# Build rule for target.
+starlight: cmake_check_build_system
+ $(MAKE) -f CMakeFiles/Makefile2 starlight
+.PHONY : starlight
+
+# fast build rule for target.
+starlight/fast:
+ $(MAKE) -f CMakeFiles/starlight.dir/build.make CMakeFiles/starlight.dir/build
+.PHONY : starlight/fast
+
+src/beam.o: src/beam.cpp.o
+.PHONY : src/beam.o
+
+# target to build an object file
+src/beam.cpp.o:
+ $(MAKE) -f CMakeFiles/Starlight.dir/build.make CMakeFiles/Starlight.dir/src/beam.cpp.o
+.PHONY : src/beam.cpp.o
+
+src/beam.i: src/beam.cpp.i
+.PHONY : src/beam.i
+
+# target to preprocess a source file
+src/beam.cpp.i:
+ $(MAKE) -f CMakeFiles/Starlight.dir/build.make CMakeFiles/Starlight.dir/src/beam.cpp.i
+.PHONY : src/beam.cpp.i
+
+src/beam.s: src/beam.cpp.s
+.PHONY : src/beam.s
+
+# target to generate assembly for a file
+src/beam.cpp.s:
+ $(MAKE) -f CMakeFiles/Starlight.dir/build.make CMakeFiles/Starlight.dir/src/beam.cpp.s
+.PHONY : src/beam.cpp.s
+
+src/beambeamsystem.o: src/beambeamsystem.cpp.o
+.PHONY : src/beambeamsystem.o
+
+# target to build an object file
+src/beambeamsystem.cpp.o:
+ $(MAKE) -f CMakeFiles/Starlight.dir/build.make CMakeFiles/Starlight.dir/src/beambeamsystem.cpp.o
+.PHONY : src/beambeamsystem.cpp.o
+
+src/beambeamsystem.i: src/beambeamsystem.cpp.i
+.PHONY : src/beambeamsystem.i
+
+# target to preprocess a source file
+src/beambeamsystem.cpp.i:
+ $(MAKE) -f CMakeFiles/Starlight.dir/build.make CMakeFiles/Starlight.dir/src/beambeamsystem.cpp.i
+.PHONY : src/beambeamsystem.cpp.i
+
+src/beambeamsystem.s: src/beambeamsystem.cpp.s
+.PHONY : src/beambeamsystem.s
+
+# target to generate assembly for a file
+src/beambeamsystem.cpp.s:
+ $(MAKE) -f CMakeFiles/Starlight.dir/build.make CMakeFiles/Starlight.dir/src/beambeamsystem.cpp.s
+.PHONY : src/beambeamsystem.cpp.s
+
+src/bessel.o: src/bessel.cpp.o
+.PHONY : src/bessel.o
+
+# target to build an object file
+src/bessel.cpp.o:
+ $(MAKE) -f CMakeFiles/Starlight.dir/build.make CMakeFiles/Starlight.dir/src/bessel.cpp.o
+.PHONY : src/bessel.cpp.o
+
+src/bessel.i: src/bessel.cpp.i
+.PHONY : src/bessel.i
+
+# target to preprocess a source file
+src/bessel.cpp.i:
+ $(MAKE) -f CMakeFiles/Starlight.dir/build.make CMakeFiles/Starlight.dir/src/bessel.cpp.i
+.PHONY : src/bessel.cpp.i
+
+src/bessel.s: src/bessel.cpp.s
+.PHONY : src/bessel.s
+
+# target to generate assembly for a file
+src/bessel.cpp.s:
+ $(MAKE) -f CMakeFiles/Starlight.dir/build.make CMakeFiles/Starlight.dir/src/bessel.cpp.s
+.PHONY : src/bessel.cpp.s
+
+src/eventchannel.o: src/eventchannel.cpp.o
+.PHONY : src/eventchannel.o
+
+# target to build an object file
+src/eventchannel.cpp.o:
+ $(MAKE) -f CMakeFiles/Starlight.dir/build.make CMakeFiles/Starlight.dir/src/eventchannel.cpp.o
+.PHONY : src/eventchannel.cpp.o
+
+src/eventchannel.i: src/eventchannel.cpp.i
+.PHONY : src/eventchannel.i
+
+# target to preprocess a source file
+src/eventchannel.cpp.i:
+ $(MAKE) -f CMakeFiles/Starlight.dir/build.make CMakeFiles/Starlight.dir/src/eventchannel.cpp.i
+.PHONY : src/eventchannel.cpp.i
+
+src/eventchannel.s: src/eventchannel.cpp.s
+.PHONY : src/eventchannel.s
+
+# target to generate assembly for a file
+src/eventchannel.cpp.s:
+ $(MAKE) -f CMakeFiles/Starlight.dir/build.make CMakeFiles/Starlight.dir/src/eventchannel.cpp.s
+.PHONY : src/eventchannel.cpp.s
+
+src/eventfilewriter.o: src/eventfilewriter.cpp.o
+.PHONY : src/eventfilewriter.o
+
+# target to build an object file
+src/eventfilewriter.cpp.o:
+ $(MAKE) -f CMakeFiles/Starlight.dir/build.make CMakeFiles/Starlight.dir/src/eventfilewriter.cpp.o
+.PHONY : src/eventfilewriter.cpp.o
+
+src/eventfilewriter.i: src/eventfilewriter.cpp.i
+.PHONY : src/eventfilewriter.i
+
+# target to preprocess a source file
+src/eventfilewriter.cpp.i:
+ $(MAKE) -f CMakeFiles/Starlight.dir/build.make CMakeFiles/Starlight.dir/src/eventfilewriter.cpp.i
+.PHONY : src/eventfilewriter.cpp.i
+
+src/eventfilewriter.s: src/eventfilewriter.cpp.s
+.PHONY : src/eventfilewriter.s
+
+# target to generate assembly for a file
+src/eventfilewriter.cpp.s:
+ $(MAKE) -f CMakeFiles/Starlight.dir/build.make CMakeFiles/Starlight.dir/src/eventfilewriter.cpp.s
+.PHONY : src/eventfilewriter.cpp.s
+
+src/filewriter.o: src/filewriter.cpp.o
+.PHONY : src/filewriter.o
+
+# target to build an object file
+src/filewriter.cpp.o:
+ $(MAKE) -f CMakeFiles/Starlight.dir/build.make CMakeFiles/Starlight.dir/src/filewriter.cpp.o
+.PHONY : src/filewriter.cpp.o
+
+src/filewriter.i: src/filewriter.cpp.i
+.PHONY : src/filewriter.i
+
+# target to preprocess a source file
+src/filewriter.cpp.i:
+ $(MAKE) -f CMakeFiles/Starlight.dir/build.make CMakeFiles/Starlight.dir/src/filewriter.cpp.i
+.PHONY : src/filewriter.cpp.i
+
+src/filewriter.s: src/filewriter.cpp.s
+.PHONY : src/filewriter.s
+
+# target to generate assembly for a file
+src/filewriter.cpp.s:
+ $(MAKE) -f CMakeFiles/Starlight.dir/build.make CMakeFiles/Starlight.dir/src/filewriter.cpp.s
+.PHONY : src/filewriter.cpp.s
+
+src/gammaacrosssection.o: src/gammaacrosssection.cpp.o
+.PHONY : src/gammaacrosssection.o
+
+# target to build an object file
+src/gammaacrosssection.cpp.o:
+ $(MAKE) -f CMakeFiles/Starlight.dir/build.make CMakeFiles/Starlight.dir/src/gammaacrosssection.cpp.o
+.PHONY : src/gammaacrosssection.cpp.o
+
+src/gammaacrosssection.i: src/gammaacrosssection.cpp.i
+.PHONY : src/gammaacrosssection.i
+
+# target to preprocess a source file
+src/gammaacrosssection.cpp.i:
+ $(MAKE) -f CMakeFiles/Starlight.dir/build.make CMakeFiles/Starlight.dir/src/gammaacrosssection.cpp.i
+.PHONY : src/gammaacrosssection.cpp.i
+
+src/gammaacrosssection.s: src/gammaacrosssection.cpp.s
+.PHONY : src/gammaacrosssection.s
+
+# target to generate assembly for a file
+src/gammaacrosssection.cpp.s:
+ $(MAKE) -f CMakeFiles/Starlight.dir/build.make CMakeFiles/Starlight.dir/src/gammaacrosssection.cpp.s
+.PHONY : src/gammaacrosssection.cpp.s
+
+src/gammaaluminosity.o: src/gammaaluminosity.cpp.o
+.PHONY : src/gammaaluminosity.o
+
+# target to build an object file
+src/gammaaluminosity.cpp.o:
+ $(MAKE) -f CMakeFiles/Starlight.dir/build.make CMakeFiles/Starlight.dir/src/gammaaluminosity.cpp.o
+.PHONY : src/gammaaluminosity.cpp.o
+
+src/gammaaluminosity.i: src/gammaaluminosity.cpp.i
+.PHONY : src/gammaaluminosity.i
+
+# target to preprocess a source file
+src/gammaaluminosity.cpp.i:
+ $(MAKE) -f CMakeFiles/Starlight.dir/build.make CMakeFiles/Starlight.dir/src/gammaaluminosity.cpp.i
+.PHONY : src/gammaaluminosity.cpp.i
+
+src/gammaaluminosity.s: src/gammaaluminosity.cpp.s
+.PHONY : src/gammaaluminosity.s
+
+# target to generate assembly for a file
+src/gammaaluminosity.cpp.s:
+ $(MAKE) -f CMakeFiles/Starlight.dir/build.make CMakeFiles/Starlight.dir/src/gammaaluminosity.cpp.s
+.PHONY : src/gammaaluminosity.cpp.s
+
+src/gammaavm.o: src/gammaavm.cpp.o
+.PHONY : src/gammaavm.o
+
+# target to build an object file
+src/gammaavm.cpp.o:
+ $(MAKE) -f CMakeFiles/Starlight.dir/build.make CMakeFiles/Starlight.dir/src/gammaavm.cpp.o
+.PHONY : src/gammaavm.cpp.o
+
+src/gammaavm.i: src/gammaavm.cpp.i
+.PHONY : src/gammaavm.i
+
+# target to preprocess a source file
+src/gammaavm.cpp.i:
+ $(MAKE) -f CMakeFiles/Starlight.dir/build.make CMakeFiles/Starlight.dir/src/gammaavm.cpp.i
+.PHONY : src/gammaavm.cpp.i
+
+src/gammaavm.s: src/gammaavm.cpp.s
+.PHONY : src/gammaavm.s
+
+# target to generate assembly for a file
+src/gammaavm.cpp.s:
+ $(MAKE) -f CMakeFiles/Starlight.dir/build.make CMakeFiles/Starlight.dir/src/gammaavm.cpp.s
+.PHONY : src/gammaavm.cpp.s
+
+src/gammagammaleptonpair.o: src/gammagammaleptonpair.cpp.o
+.PHONY : src/gammagammaleptonpair.o
+
+# target to build an object file
+src/gammagammaleptonpair.cpp.o:
+ $(MAKE) -f CMakeFiles/Starlight.dir/build.make CMakeFiles/Starlight.dir/src/gammagammaleptonpair.cpp.o
+.PHONY : src/gammagammaleptonpair.cpp.o
+
+src/gammagammaleptonpair.i: src/gammagammaleptonpair.cpp.i
+.PHONY : src/gammagammaleptonpair.i
+
+# target to preprocess a source file
+src/gammagammaleptonpair.cpp.i:
+ $(MAKE) -f CMakeFiles/Starlight.dir/build.make CMakeFiles/Starlight.dir/src/gammagammaleptonpair.cpp.i
+.PHONY : src/gammagammaleptonpair.cpp.i
+
+src/gammagammaleptonpair.s: src/gammagammaleptonpair.cpp.s
+.PHONY : src/gammagammaleptonpair.s
+
+# target to generate assembly for a file
+src/gammagammaleptonpair.cpp.s:
+ $(MAKE) -f CMakeFiles/Starlight.dir/build.make CMakeFiles/Starlight.dir/src/gammagammaleptonpair.cpp.s
+.PHONY : src/gammagammaleptonpair.cpp.s
+
+src/gammagammasingle.o: src/gammagammasingle.cpp.o
+.PHONY : src/gammagammasingle.o
+
+# target to build an object file
+src/gammagammasingle.cpp.o:
+ $(MAKE) -f CMakeFiles/Starlight.dir/build.make CMakeFiles/Starlight.dir/src/gammagammasingle.cpp.o
+.PHONY : src/gammagammasingle.cpp.o
+
+src/gammagammasingle.i: src/gammagammasingle.cpp.i
+.PHONY : src/gammagammasingle.i
+
+# target to preprocess a source file
+src/gammagammasingle.cpp.i:
+ $(MAKE) -f CMakeFiles/Starlight.dir/build.make CMakeFiles/Starlight.dir/src/gammagammasingle.cpp.i
+.PHONY : src/gammagammasingle.cpp.i
+
+src/gammagammasingle.s: src/gammagammasingle.cpp.s
+.PHONY : src/gammagammasingle.s
+
+# target to generate assembly for a file
+src/gammagammasingle.cpp.s:
+ $(MAKE) -f CMakeFiles/Starlight.dir/build.make CMakeFiles/Starlight.dir/src/gammagammasingle.cpp.s
+.PHONY : src/gammagammasingle.cpp.s
+
+src/inputparameters.o: src/inputparameters.cpp.o
+.PHONY : src/inputparameters.o
+
+# target to build an object file
+src/inputparameters.cpp.o:
+ $(MAKE) -f CMakeFiles/Starlight.dir/build.make CMakeFiles/Starlight.dir/src/inputparameters.cpp.o
+.PHONY : src/inputparameters.cpp.o
+
+src/inputparameters.i: src/inputparameters.cpp.i
+.PHONY : src/inputparameters.i
+
+# target to preprocess a source file
+src/inputparameters.cpp.i:
+ $(MAKE) -f CMakeFiles/Starlight.dir/build.make CMakeFiles/Starlight.dir/src/inputparameters.cpp.i
+.PHONY : src/inputparameters.cpp.i
+
+src/inputparameters.s: src/inputparameters.cpp.s
+.PHONY : src/inputparameters.s
+
+# target to generate assembly for a file
+src/inputparameters.cpp.s:
+ $(MAKE) -f CMakeFiles/Starlight.dir/build.make CMakeFiles/Starlight.dir/src/inputparameters.cpp.s
+.PHONY : src/inputparameters.cpp.s
+
+src/lorentzvector.o: src/lorentzvector.cpp.o
+.PHONY : src/lorentzvector.o
+
+# target to build an object file
+src/lorentzvector.cpp.o:
+ $(MAKE) -f CMakeFiles/Starlight.dir/build.make CMakeFiles/Starlight.dir/src/lorentzvector.cpp.o
+.PHONY : src/lorentzvector.cpp.o
+
+src/lorentzvector.i: src/lorentzvector.cpp.i
+.PHONY : src/lorentzvector.i
+
+# target to preprocess a source file
+src/lorentzvector.cpp.i:
+ $(MAKE) -f CMakeFiles/Starlight.dir/build.make CMakeFiles/Starlight.dir/src/lorentzvector.cpp.i
+.PHONY : src/lorentzvector.cpp.i
+
+src/lorentzvector.s: src/lorentzvector.cpp.s
+.PHONY : src/lorentzvector.s
+
+# target to generate assembly for a file
+src/lorentzvector.cpp.s:
+ $(MAKE) -f CMakeFiles/Starlight.dir/build.make CMakeFiles/Starlight.dir/src/lorentzvector.cpp.s
+.PHONY : src/lorentzvector.cpp.s
+
+src/main.o: src/main.cpp.o
+.PHONY : src/main.o
+
+# target to build an object file
+src/main.cpp.o:
+ $(MAKE) -f CMakeFiles/starlight.dir/build.make CMakeFiles/starlight.dir/src/main.cpp.o
+.PHONY : src/main.cpp.o
+
+src/main.i: src/main.cpp.i
+.PHONY : src/main.i
+
+# target to preprocess a source file
+src/main.cpp.i:
+ $(MAKE) -f CMakeFiles/starlight.dir/build.make CMakeFiles/starlight.dir/src/main.cpp.i
+.PHONY : src/main.cpp.i
+
+src/main.s: src/main.cpp.s
+.PHONY : src/main.s
+
+# target to generate assembly for a file
+src/main.cpp.s:
+ $(MAKE) -f CMakeFiles/starlight.dir/build.make CMakeFiles/starlight.dir/src/main.cpp.s
+.PHONY : src/main.cpp.s
+
+src/nucleus.o: src/nucleus.cpp.o
+.PHONY : src/nucleus.o
+
+# target to build an object file
+src/nucleus.cpp.o:
+ $(MAKE) -f CMakeFiles/Starlight.dir/build.make CMakeFiles/Starlight.dir/src/nucleus.cpp.o
+.PHONY : src/nucleus.cpp.o
+
+src/nucleus.i: src/nucleus.cpp.i
+.PHONY : src/nucleus.i
+
+# target to preprocess a source file
+src/nucleus.cpp.i:
+ $(MAKE) -f CMakeFiles/Starlight.dir/build.make CMakeFiles/Starlight.dir/src/nucleus.cpp.i
+.PHONY : src/nucleus.cpp.i
+
+src/nucleus.s: src/nucleus.cpp.s
+.PHONY : src/nucleus.s
+
+# target to generate assembly for a file
+src/nucleus.cpp.s:
+ $(MAKE) -f CMakeFiles/Starlight.dir/build.make CMakeFiles/Starlight.dir/src/nucleus.cpp.s
+.PHONY : src/nucleus.cpp.s
+
+src/psifamily.o: src/psifamily.cpp.o
+.PHONY : src/psifamily.o
+
+# target to build an object file
+src/psifamily.cpp.o:
+ $(MAKE) -f CMakeFiles/Starlight.dir/build.make CMakeFiles/Starlight.dir/src/psifamily.cpp.o
+.PHONY : src/psifamily.cpp.o
+
+src/psifamily.i: src/psifamily.cpp.i
+.PHONY : src/psifamily.i
+
+# target to preprocess a source file
+src/psifamily.cpp.i:
+ $(MAKE) -f CMakeFiles/Starlight.dir/build.make CMakeFiles/Starlight.dir/src/psifamily.cpp.i
+.PHONY : src/psifamily.cpp.i
+
+src/psifamily.s: src/psifamily.cpp.s
+.PHONY : src/psifamily.s
+
+# target to generate assembly for a file
+src/psifamily.cpp.s:
+ $(MAKE) -f CMakeFiles/Starlight.dir/build.make CMakeFiles/Starlight.dir/src/psifamily.cpp.s
+.PHONY : src/psifamily.cpp.s
+
+src/randomgenerator.o: src/randomgenerator.cpp.o
+.PHONY : src/randomgenerator.o
+
+# target to build an object file
+src/randomgenerator.cpp.o:
+ $(MAKE) -f CMakeFiles/Starlight.dir/build.make CMakeFiles/Starlight.dir/src/randomgenerator.cpp.o
+.PHONY : src/randomgenerator.cpp.o
+
+src/randomgenerator.i: src/randomgenerator.cpp.i
+.PHONY : src/randomgenerator.i
+
+# target to preprocess a source file
+src/randomgenerator.cpp.i:
+ $(MAKE) -f CMakeFiles/Starlight.dir/build.make CMakeFiles/Starlight.dir/src/randomgenerator.cpp.i
+.PHONY : src/randomgenerator.cpp.i
+
+src/randomgenerator.s: src/randomgenerator.cpp.s
+.PHONY : src/randomgenerator.s
+
+# target to generate assembly for a file
+src/randomgenerator.cpp.s:
+ $(MAKE) -f CMakeFiles/Starlight.dir/build.make CMakeFiles/Starlight.dir/src/randomgenerator.cpp.s
+.PHONY : src/randomgenerator.cpp.s
+
+src/readinluminosity.o: src/readinluminosity.cpp.o
+.PHONY : src/readinluminosity.o
+
+# target to build an object file
+src/readinluminosity.cpp.o:
+ $(MAKE) -f CMakeFiles/Starlight.dir/build.make CMakeFiles/Starlight.dir/src/readinluminosity.cpp.o
+.PHONY : src/readinluminosity.cpp.o
+
+src/readinluminosity.i: src/readinluminosity.cpp.i
+.PHONY : src/readinluminosity.i
+
+# target to preprocess a source file
+src/readinluminosity.cpp.i:
+ $(MAKE) -f CMakeFiles/Starlight.dir/build.make CMakeFiles/Starlight.dir/src/readinluminosity.cpp.i
+.PHONY : src/readinluminosity.cpp.i
+
+src/readinluminosity.s: src/readinluminosity.cpp.s
+.PHONY : src/readinluminosity.s
+
+# target to generate assembly for a file
+src/readinluminosity.cpp.s:
+ $(MAKE) -f CMakeFiles/Starlight.dir/build.make CMakeFiles/Starlight.dir/src/readinluminosity.cpp.s
+.PHONY : src/readinluminosity.cpp.s
+
+src/starlight.o: src/starlight.cpp.o
+.PHONY : src/starlight.o
+
+# target to build an object file
+src/starlight.cpp.o:
+ $(MAKE) -f CMakeFiles/Starlight.dir/build.make CMakeFiles/Starlight.dir/src/starlight.cpp.o
+.PHONY : src/starlight.cpp.o
+
+src/starlight.i: src/starlight.cpp.i
+.PHONY : src/starlight.i
+
+# target to preprocess a source file
+src/starlight.cpp.i:
+ $(MAKE) -f CMakeFiles/Starlight.dir/build.make CMakeFiles/Starlight.dir/src/starlight.cpp.i
+.PHONY : src/starlight.cpp.i
+
+src/starlight.s: src/starlight.cpp.s
+.PHONY : src/starlight.s
+
+# target to generate assembly for a file
+src/starlight.cpp.s:
+ $(MAKE) -f CMakeFiles/Starlight.dir/build.make CMakeFiles/Starlight.dir/src/starlight.cpp.s
+.PHONY : src/starlight.cpp.s
+
+src/starlightparticle.o: src/starlightparticle.cpp.o
+.PHONY : src/starlightparticle.o
+
+# target to build an object file
+src/starlightparticle.cpp.o:
+ $(MAKE) -f CMakeFiles/Starlight.dir/build.make CMakeFiles/Starlight.dir/src/starlightparticle.cpp.o
+.PHONY : src/starlightparticle.cpp.o
+
+src/starlightparticle.i: src/starlightparticle.cpp.i
+.PHONY : src/starlightparticle.i
+
+# target to preprocess a source file
+src/starlightparticle.cpp.i:
+ $(MAKE) -f CMakeFiles/Starlight.dir/build.make CMakeFiles/Starlight.dir/src/starlightparticle.cpp.i
+.PHONY : src/starlightparticle.cpp.i
+
+src/starlightparticle.s: src/starlightparticle.cpp.s
+.PHONY : src/starlightparticle.s
+
+# target to generate assembly for a file
+src/starlightparticle.cpp.s:
+ $(MAKE) -f CMakeFiles/Starlight.dir/build.make CMakeFiles/Starlight.dir/src/starlightparticle.cpp.s
+.PHONY : src/starlightparticle.cpp.s
+
+src/starlightparticlecodes.o: src/starlightparticlecodes.cpp.o
+.PHONY : src/starlightparticlecodes.o
+
+# target to build an object file
+src/starlightparticlecodes.cpp.o:
+ $(MAKE) -f CMakeFiles/Starlight.dir/build.make CMakeFiles/Starlight.dir/src/starlightparticlecodes.cpp.o
+.PHONY : src/starlightparticlecodes.cpp.o
+
+src/starlightparticlecodes.i: src/starlightparticlecodes.cpp.i
+.PHONY : src/starlightparticlecodes.i
+
+# target to preprocess a source file
+src/starlightparticlecodes.cpp.i:
+ $(MAKE) -f CMakeFiles/Starlight.dir/build.make CMakeFiles/Starlight.dir/src/starlightparticlecodes.cpp.i
+.PHONY : src/starlightparticlecodes.cpp.i
+
+src/starlightparticlecodes.s: src/starlightparticlecodes.cpp.s
+.PHONY : src/starlightparticlecodes.s
+
+# target to generate assembly for a file
+src/starlightparticlecodes.cpp.s:
+ $(MAKE) -f CMakeFiles/Starlight.dir/build.make CMakeFiles/Starlight.dir/src/starlightparticlecodes.cpp.s
+.PHONY : src/starlightparticlecodes.cpp.s
+
+src/starlightstandalone.o: src/starlightstandalone.cpp.o
+.PHONY : src/starlightstandalone.o
+
+# target to build an object file
+src/starlightstandalone.cpp.o:
+ $(MAKE) -f CMakeFiles/Starlight.dir/build.make CMakeFiles/Starlight.dir/src/starlightstandalone.cpp.o
+.PHONY : src/starlightstandalone.cpp.o
+
+src/starlightstandalone.i: src/starlightstandalone.cpp.i
+.PHONY : src/starlightstandalone.i
+
+# target to preprocess a source file
+src/starlightstandalone.cpp.i:
+ $(MAKE) -f CMakeFiles/Starlight.dir/build.make CMakeFiles/Starlight.dir/src/starlightstandalone.cpp.i
+.PHONY : src/starlightstandalone.cpp.i
+
+src/starlightstandalone.s: src/starlightstandalone.cpp.s
+.PHONY : src/starlightstandalone.s
+
+# target to generate assembly for a file
+src/starlightstandalone.cpp.s:
+ $(MAKE) -f CMakeFiles/Starlight.dir/build.make CMakeFiles/Starlight.dir/src/starlightstandalone.cpp.s
+.PHONY : src/starlightstandalone.cpp.s
+
+src/twophotonluminosity.o: src/twophotonluminosity.cpp.o
+.PHONY : src/twophotonluminosity.o
+
+# target to build an object file
+src/twophotonluminosity.cpp.o:
+ $(MAKE) -f CMakeFiles/Starlight.dir/build.make CMakeFiles/Starlight.dir/src/twophotonluminosity.cpp.o
+.PHONY : src/twophotonluminosity.cpp.o
+
+src/twophotonluminosity.i: src/twophotonluminosity.cpp.i
+.PHONY : src/twophotonluminosity.i
+
+# target to preprocess a source file
+src/twophotonluminosity.cpp.i:
+ $(MAKE) -f CMakeFiles/Starlight.dir/build.make CMakeFiles/Starlight.dir/src/twophotonluminosity.cpp.i
+.PHONY : src/twophotonluminosity.cpp.i
+
+src/twophotonluminosity.s: src/twophotonluminosity.cpp.s
+.PHONY : src/twophotonluminosity.s
+
+# target to generate assembly for a file
+src/twophotonluminosity.cpp.s:
+ $(MAKE) -f CMakeFiles/Starlight.dir/build.make CMakeFiles/Starlight.dir/src/twophotonluminosity.cpp.s
+.PHONY : src/twophotonluminosity.cpp.s
+
+src/upcevent.o: src/upcevent.cpp.o
+.PHONY : src/upcevent.o
+
+# target to build an object file
+src/upcevent.cpp.o:
+ $(MAKE) -f CMakeFiles/Starlight.dir/build.make CMakeFiles/Starlight.dir/src/upcevent.cpp.o
+.PHONY : src/upcevent.cpp.o
+
+src/upcevent.i: src/upcevent.cpp.i
+.PHONY : src/upcevent.i
+
+# target to preprocess a source file
+src/upcevent.cpp.i:
+ $(MAKE) -f CMakeFiles/Starlight.dir/build.make CMakeFiles/Starlight.dir/src/upcevent.cpp.i
+.PHONY : src/upcevent.cpp.i
+
+src/upcevent.s: src/upcevent.cpp.s
+.PHONY : src/upcevent.s
+
+# target to generate assembly for a file
+src/upcevent.cpp.s:
+ $(MAKE) -f CMakeFiles/Starlight.dir/build.make CMakeFiles/Starlight.dir/src/upcevent.cpp.s
+.PHONY : src/upcevent.cpp.s
+
+src/vector3.o: src/vector3.cpp.o
+.PHONY : src/vector3.o
+
+# target to build an object file
+src/vector3.cpp.o:
+ $(MAKE) -f CMakeFiles/Starlight.dir/build.make CMakeFiles/Starlight.dir/src/vector3.cpp.o
+.PHONY : src/vector3.cpp.o
+
+src/vector3.i: src/vector3.cpp.i
+.PHONY : src/vector3.i
+
+# target to preprocess a source file
+src/vector3.cpp.i:
+ $(MAKE) -f CMakeFiles/Starlight.dir/build.make CMakeFiles/Starlight.dir/src/vector3.cpp.i
+.PHONY : src/vector3.cpp.i
+
+src/vector3.s: src/vector3.cpp.s
+.PHONY : src/vector3.s
+
+# target to generate assembly for a file
+src/vector3.cpp.s:
+ $(MAKE) -f CMakeFiles/Starlight.dir/build.make CMakeFiles/Starlight.dir/src/vector3.cpp.s
+.PHONY : src/vector3.cpp.s
+
+# Help Target
+help:
+ @echo "The following are some of the valid targets for this Makefile:"
+ @echo "... all (the default if no target is provided)"
+ @echo "... clean"
+ @echo "... depend"
+ @echo "... Starlight"
+ @echo "... edit_cache"
+ @echo "... rebuild_cache"
+ @echo "... starlight"
+ @echo "... src/beam.o"
+ @echo "... src/beam.i"
+ @echo "... src/beam.s"
+ @echo "... src/beambeamsystem.o"
+ @echo "... src/beambeamsystem.i"
+ @echo "... src/beambeamsystem.s"
+ @echo "... src/bessel.o"
+ @echo "... src/bessel.i"
+ @echo "... src/bessel.s"
+ @echo "... src/eventchannel.o"
+ @echo "... src/eventchannel.i"
+ @echo "... src/eventchannel.s"
+ @echo "... src/eventfilewriter.o"
+ @echo "... src/eventfilewriter.i"
+ @echo "... src/eventfilewriter.s"
+ @echo "... src/filewriter.o"
+ @echo "... src/filewriter.i"
+ @echo "... src/filewriter.s"
+ @echo "... src/gammaacrosssection.o"
+ @echo "... src/gammaacrosssection.i"
+ @echo "... src/gammaacrosssection.s"
+ @echo "... src/gammaaluminosity.o"
+ @echo "... src/gammaaluminosity.i"
+ @echo "... src/gammaaluminosity.s"
+ @echo "... src/gammaavm.o"
+ @echo "... src/gammaavm.i"
+ @echo "... src/gammaavm.s"
+ @echo "... src/gammagammaleptonpair.o"
+ @echo "... src/gammagammaleptonpair.i"
+ @echo "... src/gammagammaleptonpair.s"
+ @echo "... src/gammagammasingle.o"
+ @echo "... src/gammagammasingle.i"
+ @echo "... src/gammagammasingle.s"
+ @echo "... src/inputparameters.o"
+ @echo "... src/inputparameters.i"
+ @echo "... src/inputparameters.s"
+ @echo "... src/lorentzvector.o"
+ @echo "... src/lorentzvector.i"
+ @echo "... src/lorentzvector.s"
+ @echo "... src/main.o"
+ @echo "... src/main.i"
+ @echo "... src/main.s"
+ @echo "... src/nucleus.o"
+ @echo "... src/nucleus.i"
+ @echo "... src/nucleus.s"
+ @echo "... src/psifamily.o"
+ @echo "... src/psifamily.i"
+ @echo "... src/psifamily.s"
+ @echo "... src/randomgenerator.o"
+ @echo "... src/randomgenerator.i"
+ @echo "... src/randomgenerator.s"
+ @echo "... src/readinluminosity.o"
+ @echo "... src/readinluminosity.i"
+ @echo "... src/readinluminosity.s"
+ @echo "... src/starlight.o"
+ @echo "... src/starlight.i"
+ @echo "... src/starlight.s"
+ @echo "... src/starlightparticle.o"
+ @echo "... src/starlightparticle.i"
+ @echo "... src/starlightparticle.s"
+ @echo "... src/starlightparticlecodes.o"
+ @echo "... src/starlightparticlecodes.i"
+ @echo "... src/starlightparticlecodes.s"
+ @echo "... src/starlightstandalone.o"
+ @echo "... src/starlightstandalone.i"
+ @echo "... src/starlightstandalone.s"
+ @echo "... src/twophotonluminosity.o"
+ @echo "... src/twophotonluminosity.i"
+ @echo "... src/twophotonluminosity.s"
+ @echo "... src/upcevent.o"
+ @echo "... src/upcevent.i"
+ @echo "... src/upcevent.s"
+ @echo "... src/vector3.o"
+ @echo "... src/vector3.i"
+ @echo "... src/vector3.s"
+.PHONY : help
+
+
+
+#=============================================================================
+# Special targets to cleanup operation of make.
+
+# Special rule to run CMake to check the build system integrity.
+# No rule that depends on this can have commands that come from listfiles
+# because they might be regenerated.
+cmake_check_build_system:
+ $(CMAKE_COMMAND) -H$(CMAKE_SOURCE_DIR) -B$(CMAKE_BINARY_DIR) --check-build-system CMakeFiles/Makefile.cmake 0
+.PHONY : cmake_check_build_system
+
Index: branches/starlight_1.1/external/fpe.c
===================================================================
--- branches/starlight_1.1/external/fpe.c (revision 0)
+++ branches/starlight_1.1/external/fpe.c (revision 145)
@@ -0,0 +1,25 @@
+ #define _GNU_SOURCE
+ #include <stdio.h>
+ #include <stdlib.h>
+ #include <fenv.h>
+
+ void enable_exceptions_()
+ {
+ int retval;
+ /* feenableexcept returns the previous exceptions that were enabled
+ on success, otherwise it returns -1
+ */
+ retval=feenableexcept( FE_DIVBYZERO | FE_INVALID | FE_OVERFLOW | FE_UNDERFLOW );
+ if ( retval == -1 )
+ {
+ fprintf(stderr, "Warning: call to feenableexcept() failed \n");
+ }
+ }
+
+ /* This second routine is for Fortran compilers such as g77 and pathf90
+ which follow the f2c name mangling style
+ */
+ void enable_exceptions__()
+ {
+ enable_exceptions_();
+ }
Index: branches/starlight_1.1/starlightconfig.h.in
===================================================================
--- branches/starlight_1.1/starlightconfig.h.in (revision 0)
+++ branches/starlight_1.1/starlightconfig.h.in (revision 145)
@@ -0,0 +1,8 @@
+// the configured options and settings for Tutorial
+#define Starlight_VERSION_MAJOR @Starlight_VERSION_MAJOR@
+#define Starlight_VERSION_MINOR @Starlight_VERSION_MINOR@
+#define PYTHIA8_SETTINGS_DIR "@PYTHIA8_SETTINGS_DIR@"
+
+#cmakedefine ENABLE_PYTHIA
+#cmakedefine ENABLE_PYTHIA6
+#cmakedefine ENABLE_DPMJET
Index: branches/starlight_1.1/dpmjet/dpmjetint.f
===================================================================
--- branches/starlight_1.1/dpmjet/dpmjetint.f (revision 0)
+++ branches/starlight_1.1/dpmjet/dpmjetint.f (revision 145)
@@ -0,0 +1,155 @@
+*
+*===program crint======================================================*
+*
+C OPTIONS/ EXTEND_SOURCE
+C SUBROUTINE CRINT
+ SUBROUTINE DT_PRODUCEEVENT(ENERGY_SL, NPARTICLES)
+
+
+ IMPLICIT DOUBLE PRECISION (A-H,O-Z)
+ REAL ENERGY_SL
+ INTEGER INIT
+ REAL ne,etest,prob,slump
+ SAVE
+
+* Call the init sub routine in the first event
+ DATA INIT /0/
+
+ PARAMETER (NMXHKK=200000)
+
+ COMMON /DTIONT/ LINP,LOUT,LDAT
+
+ COMMON /DTEVT1/ NHKK,NEVHKK,ISTHKK(NMXHKK),IDHKK(NMXHKK),
+ & JMOHKK(2,NMXHKK),JDAHKK(2,NMXHKK),
+ & PHKK(5,NMXHKK),VHKK(4,NMXHKK),WHKK(4,NMXHKK)
+
+* event flag
+ COMMON /DTEVNO/ NEVENT, ICASCA
+
+ IF(INIT.EQ.0) THEN
+ OPEN (UNIT = 50, file = "my.input")
+ LINP = 50
+ CALL DT_DTUINI(NEVTS,EPN,NPMASS,NPCHAR,NTMASS,NTCHAR,IDP,IEMU)
+* Init called, make sure it's not called again
+ INIT = 1
+ ENDIF
+*-----------------------------------------------------------------------
+* generation of one event
+ NEVENT = 1
+ KKMAT = -1
+
+* If an energy-range has been defined with the ENERGY input-card the
+* laboratory energy ELAB can be set to any value within that range,..
+C ELAB = DT_RNDM(EPN)*(EPN-0.5D7)+0.5D7
+
+* ..otherwise it has to coincide with EPN.
+C ELAB = EPN
+
+ ELAB = ENERGY_SL
+
+* sampling of one event
+
+* TEST
+
+ CALL DT_KKINC(NPMASS,NPCHAR,NTMASS,NTCHAR,IDP,ELAB,KKMAT,IREJ)
+
+ IF (IREJ.NE.0) RETURN
+
+c Return the number of particles produced
+
+c Fill the particle info
+ CALL DT_GETPARTICLES(NPARTICLES)
+
+ END
+
+
+ SUBROUTINE DT_GETPARTICLES(NPARTICLES)
+
+ IMPLICIT DOUBLE PRECISION (A-H,O-Z)
+ INTEGER pid,qch,q_sum,Ntpc,Nfinal,NACCEPT,IPART,RES
+ DOUBLE PRECISION yrap,pt,mass,mt,etot
+ DOUBLE PRECISION pt_cut_tpc
+ PARAMETER(pt_cut_tpc=0.050)
+
+ SAVE
+*
+* COMMON /DTEVT1/ :
+* NHKK number of entries in common block
+* NEVHKK number of the event
+* ISTHKK(i) status code for entry i
+* IDHKK(i) identifier for the entry
+* (for particles: identifier according
+* to the PDG numbering scheme)
+* JMOHKK(1,i) pointer to the entry of the first mother
+* of entry i
+* JMOHKK(2,i) pointer to the entry of the second mother
+* of entry i
+* JDAHKK(1,i) pointer to the entry of the first daughter
+* of entry i
+* JDAHKK(2,i) pointer to the entry of the second daughter
+* of entry i
+* PHKK(1..3,i) 3-momentum
+* PHKK(4,i) energy
+* PHKK(5,i) mass
+*
+* event history
+
+ PARAMETER (NMXHKK=200000)
+
+ COMMON /DTEVT1/ NHKK,NEVHKK,ISTHKK(NMXHKK),IDHKK(NMXHKK),
+ & JMOHKK(2,NMXHKK),JDAHKK(2,NMXHKK),
+ & PHKK(5,NMXHKK),VHKK(4,NMXHKK),WHKK(4,NMXHKK)
+
+* extended event history
+ COMMON /DTEVT2/ IDRES(NMXHKK),IDXRES(NMXHKK),NOBAM(NMXHKK),
+ & IDBAM(NMXHKK),IDCH(NMXHKK),NPOINT(10),
+ & IHIST(2,NMXHKK)
+
+ DOUBLE PRECISION SLPX, SLPY, SLPZ, SLE, SLM
+ INTEGER SLPID, SLCHARGE
+ COMMON /DPMJETPARTICLE/ SLPX(NMXHKK), SLPY(NMXHKK), SLPZ(NMXHKK),
+ & SLE(NMXHKK), SLM(NMXHKK), SLPID(NMXHKK), SLCHARGE(NMXHKK)
+
+
+C >> Set Counter to Zero
+
+ Nfinal=0
+
+ DO 42 I=1, NHKK
+c I = IPART
+
+CC >> Remove all non-final-state particles
+ IF(.not.(ISTHKK(I).eq.1.or.ISTHKK(I).eq.-1.or.
+ $ISTHKK(I).eq.1001)) GOTO 42
+
+C >> Find Particle Charge, qch
+ IF((ABS(ISTHKK(I)).eq.1).and.(IDHKK(I).ne.80000))THEN
+C >> final state ptcles except nuclei
+
+ qch=IPHO_CHR3(IDHKK(I),1)/3
+ ELSEIF(IDHKK(I).eq.80000)THEN
+C >> final state nuclei
+ qch=IDXRES(I)
+ ELSE
+C >> not a final state particle, qch not interesting
+ qch=-999
+ ENDIF
+
+ Nfinal = Nfinal + 1
+ SLPX(Nfinal) = PHKK(1,I)
+ SLPY(Nfinal) = PHKK(2,I)
+ SLPZ(Nfinal) = PHKK(3,I)
+ SLE(Nfinal) = PHKK(4,I)
+ SLM(Nfinal) = PHKK(5,I)
+ SLPID(Nfinal) = IDHKK(I)
+ SLCHARGE(Nfinal) = qch
+
+ 42 CONTINUE
+ NPARTICLES = Nfinal
+
+ END
+
+ SUBROUTINE DT_USRHIS(MODE)
+c Dummy to make the linker happy
+ END
+
Index: branches/starlight_1.1/include/twophotonluminosity.h
===================================================================
--- branches/starlight_1.1/include/twophotonluminosity.h (revision 0)
+++ branches/starlight_1.1/include/twophotonluminosity.h (revision 145)
@@ -0,0 +1,78 @@
+///////////////////////////////////////////////////////////////////////////
+//
+// Copyright 2010
+//
+// This file is part of starlight.
+//
+// starlight is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
+//
+// starlight is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with starlight. If not, see <http://www.gnu.org/licenses/>.
+//
+///////////////////////////////////////////////////////////////////////////
+//
+// File and Version Information:
+// $Rev:: $: revision of last commit
+// $Author:: $: author of last commit
+// $Date:: $: date of last commit
+//
+// Description:
+//
+//
+//
+///////////////////////////////////////////////////////////////////////////
+
+
+#ifndef TWOPHOTONLUMINOSITY_H
+#define TWOPHOTONLUMINOSITY_H
+
+#include "nucleus.h"
+#include "beam.h"
+#include "beambeamsystem.h"
+#include "starlightlimits.h"
+
+
+class twoPhotonLuminosity : public beamBeamSystem
+{
+public:
+ twoPhotonLuminosity(beam beam_1, beam beam_2,inputParameters& input);
+ ~twoPhotonLuminosity();
+
+protected:
+
+
+
+private:
+ struct difflumiargs
+ {
+ twoPhotonLuminosity *self;
+ double m;
+ double y;
+ double res;
+ };
+ void twoPhotonDifferentialLuminosity();
+ double D2LDMDY(double M,double Y,double &Normalize);
+ double D2LDMDY(double M,double Y) const;
+ static void * D2LDMDY_Threaded(void *a);
+
+ double integral(double Normalize);
+ double radmul(int N,double *Lower,double *Upper,int NIterMin,int NIterMax,double EPS,double *WK,int NIter,double &Result,double &ResErr,double &NFNEVL,double &Summary);
+ double integrand(double N,double X[15]);
+ double Nphoton(double W,double gamma,double Rho);
+
+ double _W1; //Energy of photon #1
+ double _W2; //Energy of photon #2
+ double _gamma; //Gamma of the system
+ inputParameters _input2photon;
+};
+
+
+#endif // TWOPHOTONLUMINOSITY_H
Property changes on: branches/starlight_1.1/include/twophotonluminosity.h
___________________________________________________________________
Added: svn:keywords
## -0,0 +1 ##
+Rev Date Author
\ No newline at end of property
Index: branches/starlight_1.1/include/starlightconstants.h
===================================================================
--- branches/starlight_1.1/include/starlightconstants.h (revision 0)
+++ branches/starlight_1.1/include/starlightconstants.h (revision 145)
@@ -0,0 +1,157 @@
+///////////////////////////////////////////////////////////////////////////
+//
+// Copyright 2010
+//
+// This file is part of starlight.
+//
+// starlight is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
+//
+// starlight is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with starlight. If not, see <http://www.gnu.org/licenses/>.
+//
+///////////////////////////////////////////////////////////////////////////
+//
+// File and Version Information:
+// $Rev:: $: revision of last commit
+// $Author:: $: author of last commit
+// $Date:: $: date of last commit
+//
+// Description:
+//
+//
+//
+///////////////////////////////////////////////////////////////////////////
+
+
+#ifndef STARLIGHTCONSTANTS_H_INCLUDE
+#define STARLIGHTCONSTANTS_H_INCLUDE
+
+
+/*
+ * Constants are set here
+ */
+namespace starlightConstants
+{
+
+
+ // constants
+ static const double hbarc = 0.197327053;
+ static const double hbarcmev = hbarc*1000.;
+ static const double pi = 3.141592654;
+ static const double twoPi = 2 * pi;
+ static const double alpha = 1/137.0359895;
+
+ // particle masses
+ static const double protonMass = 0.93827231; // [GeV/c^2]
+ static const double pionChargedMass = 0.13956995; // [GeV/c^2]
+ static const double pionNeutralMass = 0.1349766; // [GeV/c^2]
+ static const double kaonChargedMass = 0.493677; // [GeV/c^2]
+ static const double mel = 0.00051099907; // [GeV/c^2]
+ static const double muonMass = 0.105658389; // [GeV/c^2]
+ static const double tauMass = 1.777; // [GeV/c^2]
+
+ static const double f0Mass = 0.980; // [GeV/c^2]
+ static const double etaMass = 0.54730; // [GeV/c^2]
+ static const double etaPrimeMass = 0.95766; // [GeV/c^2]
+ static const double etaCMass = 2.9803; // [GeV/c^2]
+ static const double f2Mass = 1.2751; // [GeV/c^2]
+ static const double a2Mass = 1.3183; // [GeV/c^2]
+ static const double f2PrimeMass = 1.525; // [GeV/c^2]
+
+ enum particleTypeEnum {
+ UNKNOWN = 0,
+ ELECTRON = 11,
+ MUON = 13,
+ TAUON = 15,
+ PROTON = 212,
+ PION = 211,
+ KAONCHARGE = 321,
+ KAONNEUTRAL = 310,
+ A2 = 115,
+ ETA = 221,
+ F2 = 225,
+ ETAPRIME = 331,
+ F2PRIME = 335,
+ ETAC = 441,
+ F0 = 9010221,
+ ZOVERZ03 = 33,
+ RHO = 113,
+ RHOZEUS = 913,
+ FOURPRONG = 999,
+ OMEGA = 223,
+ PHI = 333,
+ JPSI = 443,
+ JPSI_ee = 443011,
+ JPSI_mumu = 443013,
+ JPSI2S = 444,
+ JPSI2S_ee = 444011,
+ JPSI2S_mumu = 444013,
+ UPSILON = 553,
+ UPSILON_ee = 553011,
+ UPSILON_mumu = 553013,
+ UPSILON2S = 554,
+ UPSILON2S_ee = 554011,
+ UPSILON2S_mumu = 554013,
+ UPSILON3S = 555,
+ UPSILON3S_ee = 555011,
+ UPSILON3S_mumu = 555013
+ };
+
+ enum decayTypeEnum {
+ NOTKNOWN = 0,
+ NARROWVMDEFAULT = 1,
+ WIDEVMDEFAULT = 2,
+ PSIFAMILY = 3,
+ LEPTONPAIR = 4,
+ SINGLEMESON = 5
+ };
+
+ enum interactionTypeEnum {
+ UNSPECIFIED = 0,
+ PHOTONPHOTON = 1,
+ PHOTONPOMERONNARROW = 2,
+ PHOTONPOMERONWIDE = 3,
+ PHOTONPOMERONINCOHERENT = 4,
+ PHOTONUCLEARSINGLE = 5,
+ PHOTONUCLEARDOUBLE = 6,
+ PHOTONUCLEARSINGLEPA = 7,
+ PHOTONUCLEARSINGLEPAPY = 8
+
+ };
+ //Structure for each event's set of tracks.
+ struct event{
+
+ public:
+
+ int _numberOfTracks;
+ //Right now this is set up for a maximum of 4 tracks,if we want more, just increase the arrays
+ //Moved it to 30, this way when pythia returns, it wont complain too much...hedging bets...not sure how many
+ double px[30],py[30],pz[30];
+ //starlightConstants::particleTypeEnum _fsParticle[30];
+ int _fsParticle[30];
+ int _charge[30];
+ //To help track mothers and daughters produced through pythia.
+ int _mother1[30];
+ int _mother2[30];
+ int _daughter1[30];
+ int _daughter2[30];
+ //Normally we just set vertices to 0
+ //But for pythia, we decay additional states
+ int _numberOfVertices;
+ double _vertx[10],_verty[10],_vertz[10];
+ };
+
+
+} // starlightConstants
+
+
+#endif // STARLIGHTCONSTANTS_H_INCLUDE
+
Property changes on: branches/starlight_1.1/include/starlightconstants.h
___________________________________________________________________
Added: svn:keywords
## -0,0 +1 ##
+Rev Date Author
\ No newline at end of property
Index: branches/starlight_1.1/include/beambeamsystem.h
===================================================================
--- branches/starlight_1.1/include/beambeamsystem.h (revision 0)
+++ branches/starlight_1.1/include/beambeamsystem.h (revision 145)
@@ -0,0 +1,97 @@
+///////////////////////////////////////////////////////////////////////////
+//
+// Copyright 2010
+//
+// This file is part of starlight.
+//
+// starlight is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
+//
+// starlight is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with starlight. If not, see <http://www.gnu.org/licenses/>.
+//
+///////////////////////////////////////////////////////////////////////////
+//
+// File and Version Information:
+// $Rev:: $: revision of last commit
+// $Author:: $: author of last commit
+// $Date:: $: date of last commit
+//
+// Description:
+// this class covers a coliding beam system SK
+//
+//
+//
+///////////////////////////////////////////////////////////////////////////
+
+
+#ifndef BEAMBEAMSYSTEM_H
+#define BEAMBEAMSYSTEM_H
+
+
+#include "nucleus.h"
+#include "beam.h"
+#include <vector>
+
+class beamBeamSystem
+{
+
+public:
+
+ beamBeamSystem(const beam& beam1,
+ const beam& beam2,
+ const inputParameters& parameters);
+ beamBeamSystem(const inputParameters& parameters);
+ ~beamBeamSystem();
+
+ const beam& beam1() const { return _beam1; } ///< returns beam particle 1
+ const beam& beam2() const { return _beam2; } ///< returns beam particle 2
+
+ // double getluminosity();
+ double probabilityOfBreakup(const double D) const;
+
+ double cmsBoost() const { return _cmsBoost; }
+
+ double beamLorentzGamma() const { return _beamLorentzGamma; }
+
+ void init(const inputParameters &p);
+
+private:
+ void generateBreakupProbabilities();
+ // int _ibreakup;//temporary solution until read in parameters are done
+ double probabilityOfHadronBreakup(const double impactparameter);
+ double probabilityOfPhotonBreakup(const double impactparameter, const int mode);
+
+ double _pHadronBreakup;
+ double _pPhotonBreakup;
+ //inputParameters inputbbs;
+ // double luminosity;
+
+ double _beamLorentzGamma; ///< Lorentz gamma factor of beams in collider frame
+ int _beamBreakupMode; ///< \brief breakup mode for beam particles
+ ///<
+ ///< 1 = hard sphere nuclei (b > 2R),
+ ///< 2 = both nuclei break up (XnXn),
+ ///< 3 = a single neutron from each nucleus (1n1n),
+ ///< 4 = neither nucleon breaks up (with b > 2R),
+ ///< 5 = no hadronic break up (similar to option 1, but with the actual hadronic interaction)
+
+ beam _beam1; ///< beam particle 1
+ beam _beam2; ///< beam particle 2
+
+ double _cmsBoost; ///< Rapidity boost of the CMS wrt the lab system
+
+ std::vector<double> _breakupProbabilities; ///< Vector containing breakup probabilities for impact parameters
+ double _breakupImpactParameterStep; ///< Step size in the calculation of the breakup probs
+ double _breakupCutOff; ///< Cut off for minimum impact parameter probability
+};
+
+
+#endif // BEAMBEAMSYSTEM_H
Property changes on: branches/starlight_1.1/include/beambeamsystem.h
___________________________________________________________________
Added: svn:keywords
## -0,0 +1 ##
+Rev Date Author
\ No newline at end of property
Index: branches/starlight_1.1/include/starlight.h
===================================================================
--- branches/starlight_1.1/include/starlight.h (revision 0)
+++ branches/starlight_1.1/include/starlight.h (revision 145)
@@ -0,0 +1,87 @@
+///////////////////////////////////////////////////////////////////////////
+//
+// Copyright 2010
+//
+// This file is part of starlight.
+//
+// starlight is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
+//
+// starlight is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with starlight. If not, see <http://www.gnu.org/licenses/>.
+//
+///////////////////////////////////////////////////////////////////////////
+//
+// File and Version Information:
+// $Rev:: $: revision of last commit
+// $Author:: $: author of last commit
+// $Date:: $: date of last commit
+//
+// Description:
+//
+//
+//
+///////////////////////////////////////////////////////////////////////////
+
+
+#ifndef STARLIGHT_H
+#define STARLIGHT_H
+
+
+#include <string>
+
+#include "upcevent.h"
+#include "eventchannel.h"
+
+
+class inputParameters;
+class beam;
+class beamBeamSystem;
+
+
+class starlight {
+
+public:
+
+ starlight();
+ ~starlight();
+
+ bool init();
+
+ upcEvent produceEvent();
+
+ std::string configFileName() const { return _configFileName; }
+ unsigned long nmbAttempts () const { return _eventChannel->nmbAttempts(); }
+ unsigned long nmbAccepted () const { return _eventChannel->nmbAccepted(); }
+
+ void setInputParameters(inputParameters* inputParams) { _inputParameters = inputParams; }
+
+private:
+
+ bool luminosityTableIsValid() const;
+
+ bool createEventChannel();
+
+ inputParameters* _inputParameters;
+ beam* _beam0;
+ beam* _beam1;
+ beamBeamSystem* _beamSystem;
+ eventChannel* _eventChannel;
+ unsigned int _nmbEventsPerFile;
+ unsigned long long _nmbEventsToGenerate;
+ std::string _configFileName;
+ std::string _eventDataFileName;
+ std::string _lumLookUpTableFileName;
+ bool _isInitialised;
+
+};
+
+
+#endif // STARLIGHT_H
Property changes on: branches/starlight_1.1/include/starlight.h
___________________________________________________________________
Added: svn:keywords
## -0,0 +1 ##
+Rev Date Author
\ No newline at end of property
Index: branches/starlight_1.1/include/starlightparticlecodes.h
===================================================================
--- branches/starlight_1.1/include/starlightparticlecodes.h (revision 0)
+++ branches/starlight_1.1/include/starlightparticlecodes.h (revision 145)
@@ -0,0 +1,47 @@
+///////////////////////////////////////////////////////////////////////////
+//
+// Copyright 2010
+//
+// This file is part of starlight.
+//
+// starlight is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
+//
+// starlight is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with starlight. If not, see <http://www.gnu.org/licenses/>.
+//
+///////////////////////////////////////////////////////////////////////////
+//
+// File and Version Information:
+// $Rev:: $: revision of last commit
+// $Author:: $: author of last commit
+// $Date:: $: date of last commit
+//
+// Description:
+//
+//
+//
+///////////////////////////////////////////////////////////////////////////
+
+
+#ifndef STARLIGHTPARTICLECODES_H
+#define STARLIGHTPARTICLECODES_H
+
+
+class starlightParticleCodes
+{
+ public:
+
+ /** Takes a jetset code and converts it into geant codes */
+ static int jetsetToGeant(int jetsetCode);
+};
+
+
+#endif // STARLIGHTPARTICLECODES_H
Property changes on: branches/starlight_1.1/include/starlightparticlecodes.h
___________________________________________________________________
Added: svn:keywords
## -0,0 +1 ##
+Rev Date Author
\ No newline at end of property
Index: branches/starlight_1.1/include/beam.h
===================================================================
--- branches/starlight_1.1/include/beam.h (revision 0)
+++ branches/starlight_1.1/include/beam.h (revision 145)
@@ -0,0 +1,69 @@
+///////////////////////////////////////////////////////////////////////////
+//
+// Copyright 2010
+//
+// This file is part of starlight.
+//
+// starlight is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
+//
+// starlight is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with starlight. If not, see <http://www.gnu.org/licenses/>.
+//
+///////////////////////////////////////////////////////////////////////////
+//
+// File and Version Information:
+// $Rev:: $: revision of last commit
+// $Author:: $: author of last commit
+// $Date:: $: date of last commit
+//
+// Description:
+//
+//
+//
+///////////////////////////////////////////////////////////////////////////
+
+
+#ifndef BEAM_H
+#define BEAM_H
+
+
+//This calls inclues a single beam of nucleons
+#include "nucleus.h"
+#include "inputParameters.h"
+
+
+class beam : public nucleus
+{
+
+public:
+
+ beam(const int Z,
+ const int A,
+ const double bdeuteron,
+ const bool dAuCoherentProduction,
+ const inputParameters& input);
+ ~beam();
+
+ double photonFlux(const double impactparameter,
+ const double photonEnergy) const; ///< calculates photon density (number of photons / (energy * area))
+
+ double rapidity() const { return acosh(_beamLorentzGamma); }
+
+ void setBeamLorentzGamma(double gamma) {_beamLorentzGamma = gamma;}
+protected:
+
+ //inputParameters inputbeam;
+ double _beamLorentzGamma; ///< Lorentz gamma factor of beams in collider frame (from inputParameters)
+
+};
+
+
+#endif // BEAM_H
Property changes on: branches/starlight_1.1/include/beam.h
___________________________________________________________________
Added: svn:keywords
## -0,0 +1 ##
+Rev Date Author
\ No newline at end of property
Index: branches/starlight_1.1/include/narrowResonanceCrossSection.h
===================================================================
--- branches/starlight_1.1/include/narrowResonanceCrossSection.h (revision 0)
+++ branches/starlight_1.1/include/narrowResonanceCrossSection.h (revision 145)
@@ -0,0 +1,61 @@
+///////////////////////////////////////////////////////////////////////////
+//
+// Copyright 2010
+//
+// This file is part of starlight.
+//
+// starlight is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
+//
+// starlight is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with starlight. If not, see <http://www.gnu.org/licenses/>.
+//
+///////////////////////////////////////////////////////////////////////////
+//
+// File and Version Information:
+// $Rev:: $: revision of last commit
+// $Author:: $: author of last commit
+// $Date:: $: date of last commit
+//
+// Description:
+//
+//
+//
+///////////////////////////////////////////////////////////////////////////
+
+
+#ifndef NARROWRESONANCECROSSSECTION_H
+#define NARROWRESONANCECROSSSECTION_H
+
+
+#include "photonNucleusCrossSection.h"
+
+
+class narrowResonanceCrossSection : public photonNucleusCrossSection {
+
+public:
+
+ narrowResonanceCrossSection(const inputParameters& input,
+ const beamBeamSystem& bbsystem);
+ ~narrowResonanceCrossSection();
+
+ void crossSectionCalculation(const double bwnormsave);
+
+private:
+
+ double _Ep;
+ double _narrowYmax;
+ double _narrowYmin;
+ int _narrowNumY;
+
+};
+
+
+#endif // NARROWRESONANCECROSSSECTION_H
Property changes on: branches/starlight_1.1/include/narrowResonanceCrossSection.h
___________________________________________________________________
Added: svn:keywords
## -0,0 +1 ##
+Rev Date Author
\ No newline at end of property
Index: branches/starlight_1.1/include/photonNucleusCrossSection.h
===================================================================
--- branches/starlight_1.1/include/photonNucleusCrossSection.h (revision 0)
+++ branches/starlight_1.1/include/photonNucleusCrossSection.h (revision 145)
@@ -0,0 +1,101 @@
+///////////////////////////////////////////////////////////////////////////
+//
+// Copyright 2010
+//
+// This file is part of starlight.
+//
+// starlight is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
+//
+// starlight is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with starlight. If not, see <http://www.gnu.org/licenses/>.
+//
+///////////////////////////////////////////////////////////////////////////
+//
+// File and Version Information:
+// $Rev:: $: revision of last commit
+// $Author:: $: author of last commit
+// $Date:: $: date of last commit
+//
+// Description:
+//
+//
+//
+///////////////////////////////////////////////////////////////////////////
+
+
+#ifndef PHOTONNUCLEUSCROSSSECTION_H
+#define PHOTONNUCLEUSCROSSSECTION_H
+
+
+#include "starlightconstants.h"
+#include "beambeamsystem.h"
+
+
+class photonNucleusCrossSection {
+
+public:
+
+ photonNucleusCrossSection(const inputParameters& input,
+ const beamBeamSystem& bbsystem);
+ ~photonNucleusCrossSection();
+
+ double slopeParameter () const { return _slopeParameter; } ///< returns slope of t-distribution [(GeV/c)^{-2}]
+ double getChannelMass () const { return _channelMass; } ///< returns mass of the produced system [GeV/c^2]
+ double getBNORM () const { return _BNORM; }
+ double luminosity () const { return _luminosity; } ///< returns luminosity [10^{26} cm^{-2} sec^{-1}]
+ beamBeamSystem getbbs () const { return _bbs; } ///< returns beamBeamSystem
+ double vmPhotonCoupling() const { return _vmPhotonCoupling; } ///< vectormeson-photon coupling constant f_v / 4 pi (cf. Eq. 10 in KN PRC 60 (1999) 014903)
+ double getDefaultC () const { return _defaultC; }
+ double maxPhotonEnergy () const { return _maxPhotonEnergy; } ///< returns max photon energy in lab frame [GeV] (for vectormesons only)
+
+ void crossSectionCalculation(const double bwnormsave);
+ // Will think about it...For VMs we just calculate it
+ // So just use the wide or narrow constructor to calculate it
+ // wide/narrow will inherit this.
+ double getcsgA(const double Egamma,
+ const double W);
+ double photonFlux(const double Egamma);
+ double sigmagp(const double Wgp);
+ double sigma_A(const double sig_N);
+ double sigma_N(const double Wgp);
+ double breitWigner(const double W,
+ const double C);
+ double nepoint(const double Egamma,
+ const double bmin);
+
+private:
+
+ beamBeamSystem _bbs;
+
+ // copied from inputParameters
+ double _protonEnergy;
+ double _beamLorentzGamma; ///< Lorentz gamma factor of beams in collider frame
+ starlightConstants::particleTypeEnum _particleType;
+ int _beamBreakupMode; ///< breakup mode for beam particles
+ bool _coherentProduction; ///< if true, production is coherent, else incoherent
+ double _incoherentFactor; ///< allows to scale the incoherent contribution in vector meson production
+ int _productionMode;
+ int _sigmaNucleus;
+
+ // locally defined parameters
+ double _slopeParameter; ///< slope of t-distribution [(GeV/c)^{-2}]
+ double _vmPhotonCoupling; ///< vectormeson-photon coupling constant f_v / 4 pi (cf. Eq. 10 in KN PRC 60 (1999) 014903)
+ double _ANORM;
+ double _BNORM;
+ double _defaultC;
+ double _luminosity; ///< luminosity [10^{26} cm^{-2} sec^{-1}]
+ double _maxPhotonEnergy; ///< max photon energy in lab frame [GeV] (for vectormesons only)
+ double _width; ///< width of the produced system [GeV/c^2]
+ double _channelMass; ///< mass of the produced system [GeV/c^2]
+};
+
+
+#endif // PHOTONNUCLEUSCROSSSECTION_H
Property changes on: branches/starlight_1.1/include/photonNucleusCrossSection.h
___________________________________________________________________
Added: svn:keywords
## -0,0 +1 ##
+Rev Date Author
\ No newline at end of property
Index: branches/starlight_1.1/include/starlightdpmjet.h
===================================================================
--- branches/starlight_1.1/include/starlightdpmjet.h (revision 0)
+++ branches/starlight_1.1/include/starlightdpmjet.h (revision 145)
@@ -0,0 +1,79 @@
+
+/*
+ <one line to give the program's name and a brief idea of what it does.>
+ Copyright (C) <year> <name of author>
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License along
+ with this program; if not, write to the Free Software Foundation, Inc.,
+ 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+
+*/
+
+#ifndef STARLIGHTDPMJET_H
+#define STARLIGHTDPMJET_H
+
+#include <eventchannel.h>
+#include <spectrum.h>
+
+class starlightDpmJet : public eventChannel
+{
+
+public:
+
+ starlightDpmJet(inputParameters& input, beamBeamSystem& beamsystem);
+
+ int init();
+
+ virtual upcEvent produceEvent();
+
+ virtual upcEvent produceSingleEvent(int zdirection, float egamma);
+
+ virtual upcEvent produceDoubleEvent();
+
+ virtual starlightConstants::event produceEvent(int& /*ievent*/) { return starlightConstants::event(); }
+
+ void setSingleMode() { _doDoubleEvent = false; }
+
+ void setDoubleMode() { _doDoubleEvent = true; }
+
+ void setMinGammaEnergy(double energy) { _minGammaEnergy = energy; }
+
+ void setMaxGammaEnergy(double energy) { _maxGammaEnergy = energy; }
+
+ void setProtonMode(bool v = true) { _protonMode = v; }
+
+
+ private:
+
+ /** Contains the photon spectrum */
+ spectrum *_spectrum;
+
+ /** Should we produce a double event? */
+ bool _doDoubleEvent;
+
+ /** Min gamma energy */
+ double _minGammaEnergy;
+
+ /** Max gamma energy */
+ double _maxGammaEnergy;
+
+
+ /** Proton-nucleus mode */
+ double _protonMode;
+
+ /** Default constructor not implemented */
+ starlightDpmJet();
+
+};
+
+#endif // STARLIGHTDPMJET_H
Index: branches/starlight_1.1/include/starlightStandalone.h
===================================================================
--- branches/starlight_1.1/include/starlightStandalone.h (revision 0)
+++ branches/starlight_1.1/include/starlightStandalone.h (revision 145)
@@ -0,0 +1,77 @@
+///////////////////////////////////////////////////////////////////////////
+//
+// Copyright 2010
+//
+// This file is part of starlight.
+//
+// starlight is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
+//
+// starlight is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with starlight. If not, see <http://www.gnu.org/licenses/>.
+//
+///////////////////////////////////////////////////////////////////////////
+//
+// File and Version Information:
+// $Rev:: $: revision of last commit
+// $Author:: $: author of last commit
+// $Date:: $: date of last commit
+//
+// Description:
+//
+//
+//
+///////////////////////////////////////////////////////////////////////////
+
+
+#ifndef STARLIGHTSTANDALONE_H
+#define STARLIGHTSTANDALONE_H
+
+
+#include <string>
+
+class upcEvent;
+
+class starlight;
+class inputParameters;
+
+
+class starlightStandalone {
+
+public:
+
+ starlightStandalone();
+ ~starlightStandalone();
+
+ bool init(); ///< reads configuration file and initializes startlight
+ bool run (); ///< creates output file and runs starlight
+
+ const std::string& configFileName () const { return _configFileName; } ///< returns path to config file
+ const std::string& eventDataFileName() const { return _eventDataFileName; } ///< returns path to output file
+
+ void setConfigFileName (const std::string& configFileName ) { _configFileName = configFileName; } ///< sets path to config file
+ void setEventDataFileName(const std::string& eventDataFileName) { _eventDataFileName = eventDataFileName; } ///< sets path to output file
+
+ void boostEvent(upcEvent &e); ///< Boost event from beam CMS to lab system
+
+private:
+
+ std::string _configFileName; ///< path to configuration file
+ std::string _eventDataFileName; ///< path to output file
+
+ starlight* _starlight; ///< pointer to starlight instance
+ inputParameters* _inputParameters; ///< pointer to parameter instance
+ unsigned int _nmbEventsTot; ///< total number of events to generate (taken from configuration file)
+ unsigned int _nmbEventsPerFile; ///< maximum number of events written to a single file (not yet implemented)
+
+};
+
+
+#endif // STARLIGHTSTANDALONE_H
Property changes on: branches/starlight_1.1/include/starlightStandalone.h
___________________________________________________________________
Added: svn:keywords
## -0,0 +1 ##
+Rev Date Author
\ No newline at end of property
Index: branches/starlight_1.1/include/bessel.h
===================================================================
--- branches/starlight_1.1/include/bessel.h (revision 0)
+++ branches/starlight_1.1/include/bessel.h (revision 145)
@@ -0,0 +1,51 @@
+///////////////////////////////////////////////////////////////////////////
+//
+// Copyright 2010
+//
+// This file is part of starlight.
+//
+// starlight is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
+//
+// starlight is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with starlight. If not, see <http://www.gnu.org/licenses/>.
+//
+///////////////////////////////////////////////////////////////////////////
+//
+// File and Version Information:
+// $Rev:: $: revision of last commit
+// $Author:: $: author of last commit
+// $Date:: $: date of last commit
+//
+// Description:
+// Bessel functions taken from ROOT
+//
+//
+///////////////////////////////////////////////////////////////////////////
+
+
+#ifndef BESSEL_H
+#define BESSEL_H
+
+
+namespace bessel
+{
+ // No description
+ double besI0(double x);
+ // No description
+ double dbesk0(double x);
+ // No description
+ double dbesk1(double x);
+ // No description
+ double besI1(double x);
+};
+
+
+#endif // BESSEL_H
Property changes on: branches/starlight_1.1/include/bessel.h
___________________________________________________________________
Added: svn:keywords
## -0,0 +1 ##
+Rev Date Author
\ No newline at end of property
Index: branches/starlight_1.1/include/eventfilewriter.h
===================================================================
--- branches/starlight_1.1/include/eventfilewriter.h (revision 0)
+++ branches/starlight_1.1/include/eventfilewriter.h (revision 145)
@@ -0,0 +1,66 @@
+///////////////////////////////////////////////////////////////////////////
+//
+// Copyright 2010
+//
+// This file is part of starlight.
+//
+// starlight is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
+//
+// starlight is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with starlight. If not, see <http://www.gnu.org/licenses/>.
+//
+///////////////////////////////////////////////////////////////////////////
+//
+// File and Version Information:
+// $Rev:: $: revision of last commit
+// $Author:: $: author of last commit
+// $Date:: $: date of last commit
+//
+// Description:
+//
+//
+//
+///////////////////////////////////////////////////////////////////////////
+
+
+#ifndef EVENTFILEWRITER_H
+#define EVENTFILEWRITER_H
+
+
+#include <string>
+
+#include "filewriter.h"
+
+
+class eventFileWriter : public fileWriter
+{
+ public:
+
+ /** Default constructor */
+ eventFileWriter();
+
+ /** Constructor with name */
+ eventFileWriter(std::string filename);
+
+ /** Write an UPC event to file */
+ int writeEvent(upcEvent &event, int eventnumber);
+
+ /** Set if we want to write full pythia information */
+ void writeFullPythiaInfo(bool v) { _writeFullPythia = v; }
+
+private:
+
+ bool _writeFullPythia;
+
+};
+
+
+#endif // EVENTFILEWRITER_H
Property changes on: branches/starlight_1.1/include/eventfilewriter.h
___________________________________________________________________
Added: svn:keywords
## -0,0 +1 ##
+Rev Date Author
\ No newline at end of property
Index: branches/starlight_1.1/include/nucleus.h
===================================================================
--- branches/starlight_1.1/include/nucleus.h (revision 0)
+++ branches/starlight_1.1/include/nucleus.h (revision 145)
@@ -0,0 +1,86 @@
+///////////////////////////////////////////////////////////////////////////
+//
+// Copyright 2010
+//
+// This file is part of starlight.
+//
+// starlight is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
+//
+// starlight is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with starlight. If not, see <http://www.gnu.org/licenses/>.
+//
+///////////////////////////////////////////////////////////////////////////
+//
+// File and Version Information:
+// $Rev:: $: revision of last commit
+// $Author:: $: author of last commit
+// $Date:: $: date of last commit
+//
+// Description:
+//
+//
+//
+///////////////////////////////////////////////////////////////////////////
+
+
+#ifndef NUCLEUS_H
+#define NUCLEUS_H
+
+
+#include <cmath>
+
+
+//This class holds the information for a target nucleus
+class nucleus
+{
+
+public:
+
+ nucleus(const int Z,
+ const int A,
+ const double deuteronSlopePar,
+ const bool dAuCoherentProduction);
+ ~nucleus();
+
+ int Z () const { return _Z; } ///< returns atomic number of nucleus
+ int A () const { return _A; } ///< returns nucleon number of nucleus
+ // double woodSaxonRadius() const { return 1.2 * pow(_A, 1. / 3.); } ///< returns Wood-Saxon nuclear radius [fm] (Fermi model)
+ double nuclearRadius () const; ///< returns nuclear radius [fm]; except for some special nuclei this is the Wood-Saxon radius (Fermi model)
+
+ double formFactor(const double t) const; ///< computes form factor for given squared 4-momentum transfer
+ double dipoleFormFactor(const double t, const double t0) const; // Dipole form factor with t0 as parameter
+ double thickness (const double b) const; ///< calculates nuclear thickness function for given distance b in impact parameter space (Eq. 4 in KN, PRC 60)
+
+ double Q0 () const { return _Q0; }
+ double rho0() const { return _rho0; }
+
+
+private:
+
+ double woodSaxonSkinDepth() const { return 0.53; } ///< returns surface (0.53 fm for Au)
+ double fritiofR0 () const { return _r0 * pow(_A, (1./3.)); } ///< Fritiof _r0 (rws)/formfactor
+
+ double rws(const double r) const
+ { return 1.0 / (1. + exp((r - fritiofR0()) / woodSaxonSkinDepth())); } ///< Wood-Saxon nuclear density
+
+ int _Z; ///< atomic number of nucleus
+ int _A; ///< nucleon number of nucleus
+ double _deuteronSlopePar; ///< slope parameter for deuteron form factor [(GeV/c)^{-2}]
+ bool _dAuCoherentProduction; ///< if true, production in d Au collisions is coherent, else incoherent
+
+ double _r0;
+ double _rho0;
+ double _Q0;
+
+};
+
+
+#endif // NUCLEUS_H
Property changes on: branches/starlight_1.1/include/nucleus.h
___________________________________________________________________
Added: svn:keywords
## -0,0 +1 ##
+Rev Date Author
\ No newline at end of property
Index: branches/starlight_1.1/include/PythiaStarlight.h
===================================================================
--- branches/starlight_1.1/include/PythiaStarlight.h (revision 0)
+++ branches/starlight_1.1/include/PythiaStarlight.h (revision 145)
@@ -0,0 +1,64 @@
+///////////////////////////////////////////////////////////////////////////
+//
+// Copyright 2010
+//
+// This file is part of starlight.
+//
+// starlight is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
+//
+// starlight is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with starlight. If not, see <http://www.gnu.org/licenses/>.
+//
+///////////////////////////////////////////////////////////////////////////
+//
+// File and Version Information:
+// $Rev:: $: revision of last commit
+// $Author:: $: author of last commit
+// $Date:: $: date of last commit
+//
+// Description:
+//
+//
+//
+///////////////////////////////////////////////////////////////////////////
+
+
+#ifndef PYTHIASTARLIGHT_H
+#define PYTHIASTARLIGHT_H
+
+
+#include <string>
+
+#include "Pythia.h"
+
+
+class pythiaStarlight
+{
+ public:
+
+ pythiaStarlight();
+ int init(std::string xmldocpath);
+
+ Pythia8::Pythia* getPythia() const { return _pythia; }
+
+ private:
+
+ Pythia8::Pythia* _pythia;
+
+};
+
+
+ // Generator; shorthand for event.
+ //Pythia pythia("/home/butter/pythia/pythia8120/xmldoc");
+ //Event& event = pythia.event;
+
+
+#endif // PYTHIASTARLIGHT_H
Property changes on: branches/starlight_1.1/include/PythiaStarlight.h
___________________________________________________________________
Added: svn:keywords
## -0,0 +1 ##
+Rev Date Author
\ No newline at end of property
Index: branches/starlight_1.1/include/inputParameters.h
===================================================================
--- branches/starlight_1.1/include/inputParameters.h (revision 0)
+++ branches/starlight_1.1/include/inputParameters.h (revision 145)
@@ -0,0 +1,178 @@
+///////////////////////////////////////////////////////////////////////////
+//
+// Copyright 2010
+//
+// This file is part of starlight.
+//
+// starlight is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
+//
+// starlight is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with starlight. If not, see <http://www.gnu.org/licenses/>.
+//
+///////////////////////////////////////////////////////////////////////////
+//
+// File and Version Information:
+// $Rev:: $: revision of last commit
+// $Author:: $: author of last commit
+// $Date:: $: date of last commit
+//
+// Description:
+//
+//
+//
+///////////////////////////////////////////////////////////////////////////
+
+
+#ifndef INPUTPARAMETERS_H
+#define INPUTPARAMETERS_H
+
+
+#include "starlightconstants.h"
+#include <string>
+//This is where we read in our input values.
+
+
+class inputParameters {
+
+public:
+
+ inputParameters();
+ ~inputParameters();
+
+ bool init(const std::string& configFileName = "./config/slight.in");
+
+ unsigned int beam1Z () const { return _beam1Z; } ///< returns atomic number of beam particle 1
+ unsigned int beam1A () const { return _beam1A; } ///< returns atomic mass number of beam particle 1
+ unsigned int beam2Z () const { return _beam2Z; } ///< returns atomic number of beam particle 2
+ unsigned int beam2A () const { return _beam2A; } ///< returns atomic mass number of beam particle 2
+ double beamLorentzGamma () const { return _beamLorentzGamma; } ///< returns Lorentz gamma factor of both beams in beam CMS frame
+ double beam1LorentzGamma () const { return _beam1LorentzGamma; } ///< returns Lorentz gamma factor of beam 1 in collider frame
+ double beam2LorentzGamma () const { return _beam2LorentzGamma; } ///< returns Lorentz gamma factor of beam 2 in collider frame
+ double maxW () const { return _maxW; } ///< returns maximum mass W of produced hadronic system [GeV/c^2]
+ double minW () const { return _minW; } ///< returns minimum mass W of produced hadronic system [GeV/c^2]
+ unsigned int nmbWBins () const { return _nmbWBins; } ///< returns number of W bins in lookup table
+ double maxRapidity () const { return _maxRapidity; } ///< returns maximum absolute value of rapidity
+ unsigned int nmbRapidityBins () const { return _nmbRapidityBins; } ///< returns number of rapidity bins in lookup table
+ bool ptCutEnabled () const { return _ptCutEnabled; } ///< returns cut in pt
+ double ptCutMin () const { return _ptCutMin; } ///< returns minimum pt
+ double ptCutMax () const { return _ptCutMax; } ///< returns maximum pt
+ bool etaCutEnabled () const { return _etaCutEnabled; } ///< returns cut in eta
+ double etaCutMin () const { return _etaCutMin; } ///< returns minimum eta
+ double etaCutMax () const { return _etaCutMax; } ///< returns maximum eta
+ int productionMode () const { return _productionMode; } ///< returns production mode
+ unsigned int nmbEvents () const { return _nmbEventsTot; } ///< returns total number of events to generate
+ int prodParticleId () const { return _prodParticleId; } ///< returns PDG particle ID of produced particle
+ int randomSeed () const { return _randomSeed; } ///< returns seed for random number generator
+ int outputFormat () const { return _outputFormat; } ///< returns output format
+ int beamBreakupMode () const { return _beamBreakupMode; } ///< returns breakup mode for beam particles
+ bool interferenceEnabled () const { return _interferenceEnabled; } ///< returns whether interference is taken into account
+ double interferenceStrength () const { return _interferenceStrength; } ///< returns percentage of interference
+ bool coherentProduction () const { return _coherentProduction; } ///< returns whether production is coherent or incoherent
+ double incoherentFactor () const { return _incoherentFactor; } ///< returns incoherent contribution in vector meson production
+ double deuteronSlopePar () const { return _deuteronSlopePar; } ///< returns slope parameter for deuteron form factor [(GeV/c)^{-2}]
+ double maxPtInterference () const { return _maxPtInterference; } ///< returns maximum p_T for interference calculation [GeV/c]
+ int nmbPtBinsInterference () const { return _nmbPtBinsInterference; } ///< returns number of p_T bins for interference calculation
+ double ptBinWidthInterference() const { return _ptBinWidthInterference; } ///< returns width of p_T bins for interference calculation [GeV/c]
+ double minGammaEnergy () const { return _minGammaEnergy; } ///< returns minimum gamma energy in case of photo nuclear processes [GeV]
+ double maxGammaEnergy () const { return _maxGammaEnergy; } ///< returns maximum gamma energy in case of photo nuclear processes [GeV]
+ std::string pythiaParams () const { return _pythiaParams; } ///< returns parameters to be passed to pythia
+ bool pythiaFullEventRecord () const { return _pythiaFullEventRecord; } ///< returns if the full pythia event record should be printed
+ int xsecCalcMethod () const { return _xsecCalcMethod; } ///< returns the method used for the x-sec calculation
+ int nThreads () const { return _nThreads; } ///< returns the number of threads in case method 1 is used for the x-sec calc
+
+ starlightConstants::particleTypeEnum prodParticleType () const { return _particleType; } ///< returns type of produced particle
+ starlightConstants::decayTypeEnum prodParticleDecayType() const { return _decayType; } ///< returns decay type of produced particle
+ starlightConstants::interactionTypeEnum interactionType () const { return _interactionType; } ///< returns interaction type
+ // double vmPhotonCoupling();
+ // double slopeParameter();
+ double getProtonEnergy() const { return _protonEnergy; }
+
+ std::ostream& print(std::ostream& out) const; ///< prints parameter summary
+ std::ostream& write(std::ostream& out) const; ///< writes parameters back to an ostream
+
+
+private:
+
+ std::string _configFileName; ///< path to configuration file (default = ./config/slight.in)
+
+ // config file parameters
+ unsigned int _beam1Z; ///< atomic number of beam particle 1
+ unsigned int _beam1A; ///< atomic mass number of beam particle 1
+ unsigned int _beam2Z; ///< atomic number of beam particle 2
+ unsigned int _beam2A; ///< atomic mass number of beam particle 2
+ double _beamLorentzGamma; ///< Lorentz gamma factor of the beams in CMS frame
+ double _beam1LorentzGamma; ///< Lorentz gamma factor of beam 1 in collider frame
+ double _beam2LorentzGamma; ///< Lorentz gamma factor of beam 2 in collider frame
+ double _maxW; ///< maximum mass W of produced hadronic system [GeV/c^2]
+ double _minW; ///< minimum mass W of produced hadronic system; if set to -1 default value is taken [GeV/c^2]
+ unsigned int _nmbWBins; ///< number of W bins in lookup table
+ double _maxRapidity; ///< maximum absolute value of rapidity
+ unsigned int _nmbRapidityBins; ///< number of rapidity bins in lookup table
+ bool _ptCutEnabled; ///< en/disables cut in pt
+ double _ptCutMin; ///< minimum pt, if cut is enabled
+ double _ptCutMax; ///< maximum pt, if cut is enabled
+ bool _etaCutEnabled; ///< en/disables cut in eta
+ double _etaCutMin; ///< minimum eta, if cut is enabled
+ double _etaCutMax; ///< maximum eta, if cut is enabled
+ int _productionMode; ///< \brief production mode
+ ///<
+ ///< 1 = photon-photon fusion,
+ ///< 2 = narrow vector meson resonance in photon-Pomeron fusion,
+ ///< 3 = Breit-Wigner vector meson resonance in photon-Pomeron fusion
+ unsigned int _nmbEventsTot; ///< total number of events to generate
+ int _prodParticleId; ///< PDG particle ID of produced particle
+ int _randomSeed; ///< seed for random number generator
+ int _outputFormat; ///< \brief output format
+ ///<
+ ///< 1 = ASCII
+ ///< 2 = GSTARtext,
+ ///< 3 = PAW ntuple (not working)
+ int _beamBreakupMode; ///< \brief breakup mode for beam particles
+ ///<
+ ///< 1 = hard sphere nuclei (b > 2R),
+ ///< 2 = both nuclei break up (XnXn),
+ ///< 3 = a single neutron from each nucleus (1n1n),
+ ///< 4 = neither nucleon breaks up (with b > 2R),
+ ///< 5 = no hadronic break up (similar to option 1, but with the actual hadronic interaction)
+ bool _interferenceEnabled; ///< if true, interference is taken into account
+ double _interferenceStrength; ///< percentage of interference: from 0 = none to 1 = full
+ bool _coherentProduction; ///< if true, production is coherent, else incoherent
+ double _incoherentFactor; ///< allows to scale the incoherent contribution in vector meson production
+ double _deuteronSlopePar; ///< slope parameter for deuteron form factor [(GeV/c)^{-2}]
+ double _maxPtInterference; ///< maximum p_T for interference calculation [GeV/c]
+ int _nmbPtBinsInterference; ///< number of p_T bins for interference calculation
+ double _ptBinWidthInterference; ///< width of p_T bins for interference calculation [GeV/c]
+ double _protonEnergy;
+ double _minGammaEnergy; ///< minimum gamma energy in case of photo nuclear processes [GeV]
+ double _maxGammaEnergy; ///< maximum gamma energy in case of photo nuclear processes [GeV]
+ std::string _pythiaParams; ///< semi-colon separated parameters to pass to pythia, e.g. "mstj(1)=0;paru(13)=0.1"
+ bool _pythiaFullEventRecord; ///< if the full pythia event record should be in the outputu
+ int _xsecCalcMethod; ///< Select x-sec calc method. (0 is standard starlight method, 1 must be used for assym. collisions (e.g. p-A), but is slow)
+ int _nThreads; ///< Number of threads used in the case of using method 1 for calculating the x-sections
+
+
+ starlightConstants::particleTypeEnum _particleType;
+ starlightConstants::decayTypeEnum _decayType;
+ starlightConstants::interactionTypeEnum _interactionType;
+
+};
+
+
+inline
+std::ostream&
+operator <<(std::ostream& out,
+ const inputParameters& par)
+{
+ return par.print(out);
+}
+
+
+#endif // INPUTPARAMETERS_H
Property changes on: branches/starlight_1.1/include/inputParameters.h
___________________________________________________________________
Added: svn:keywords
## -0,0 +1 ##
+Rev Date Author
\ No newline at end of property
Index: branches/starlight_1.1/include/wideResonanceCrossSection.h
===================================================================
--- branches/starlight_1.1/include/wideResonanceCrossSection.h (revision 0)
+++ branches/starlight_1.1/include/wideResonanceCrossSection.h (revision 145)
@@ -0,0 +1,62 @@
+///////////////////////////////////////////////////////////////////////////
+//
+// Copyright 2010
+//
+// This file is part of starlight.
+//
+// starlight is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
+//
+// starlight is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with starlight. If not, see <http://www.gnu.org/licenses/>.
+//
+///////////////////////////////////////////////////////////////////////////
+//
+// File and Version Information:
+// $Rev:: $: revision of last commit
+// $Author:: $: author of last commit
+// $Date:: $: date of last commit
+//
+// Description:
+//
+//
+//
+///////////////////////////////////////////////////////////////////////////
+
+
+#ifndef WIDERESONANCECROSSSECTION_H
+#define WIDERESONANCECROSSSECTION_H
+
+
+#include "photonNucleusCrossSection.h"
+
+
+class wideResonanceCrossSection : public photonNucleusCrossSection {
+
+public:
+
+ wideResonanceCrossSection(const inputParameters& input,
+ const beamBeamSystem& bbsystem);
+ ~wideResonanceCrossSection();
+
+ void crossSectionCalculation(const double bwnormsave);
+
+private:
+
+ double _Ep; // Proton Energy
+ double _wideWmax;
+ double _wideWmin;
+ double _wideYmax;
+ double _wideYmin;
+
+};
+
+
+#endif // WIDERESONANCECROSSSECTION_H
Property changes on: branches/starlight_1.1/include/wideResonanceCrossSection.h
___________________________________________________________________
Added: svn:keywords
## -0,0 +1 ##
+Rev Date Author
\ No newline at end of property
Index: branches/starlight_1.1/include/randomgenerator.h
===================================================================
--- branches/starlight_1.1/include/randomgenerator.h (revision 0)
+++ branches/starlight_1.1/include/randomgenerator.h (revision 145)
@@ -0,0 +1,51 @@
+///////////////////////////////////////////////////////////////////////////
+//
+// Copyright 2010
+//
+// This file is part of starlight.
+//
+// starlight is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
+//
+// starlight is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with starlight. If not, see <http://www.gnu.org/licenses/>.
+//
+///////////////////////////////////////////////////////////////////////////
+//
+// File and Version Information:
+// $Rev:: $: revision of last commit
+// $Author:: $: author of last commit
+// $Date:: $: date of last commit
+//
+// Description:
+//
+//
+//
+///////////////////////////////////////////////////////////////////////////
+
+
+#ifndef RANDOMGENERATOR_H
+#define RANDOMGENERATOR_H
+
+
+class randomGenerator
+{
+ public:
+ void SetSeed(unsigned int seed);
+ double Rndom(int i=0);
+
+ private:
+ unsigned int _Mt[624];
+ int _count624;
+};
+
+
+#endif // RANDOMGENERATOR_H
+
Property changes on: branches/starlight_1.1/include/randomgenerator.h
___________________________________________________________________
Added: svn:keywords
## -0,0 +1 ##
+Rev Date Author
\ No newline at end of property
Index: branches/starlight_1.1/include/gammagammasingle.h
===================================================================
--- branches/starlight_1.1/include/gammagammasingle.h (revision 0)
+++ branches/starlight_1.1/include/gammagammasingle.h (revision 145)
@@ -0,0 +1,92 @@
+///////////////////////////////////////////////////////////////////////////
+//
+// Copyright 2010
+//
+// This file is part of starlight.
+//
+// starlight is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
+//
+// starlight is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with starlight. If not, see <http://www.gnu.org/licenses/>.
+//
+///////////////////////////////////////////////////////////////////////////
+//
+// File and Version Information:
+// $Rev:: $: revision of last commit
+// $Author:: $: author of last commit
+// $Date:: $: date of last commit
+//
+// Description:
+//
+//
+//
+///////////////////////////////////////////////////////////////////////////
+
+
+#ifndef GAMMAGAMMASINGLE_H
+#define GAMMAGAMMASINGLE_H
+
+
+#include <vector>
+
+#include "starlightconstants.h"
+#include "readinluminosity.h"
+#include "beambeamsystem.h"
+#include "randomgenerator.h"
+#include "eventchannel.h"
+#include "starlightconfig.h"
+#ifdef ENABLE_PYTHIA
+#include "pythiadecayer.h"
+#endif
+
+class Gammagammasingle : public eventChannel
+{
+ public:
+ Gammagammasingle(inputParameters& input,beamBeamSystem& bbsystem);
+ ~Gammagammasingle();
+
+ void singleCrossSection();
+ starlightConstants::event produceEvent(int &ievent);
+
+ upcEvent produceEvent();
+
+ private:
+ double _sigmax[starlightLimits::MAXWBINS][starlightLimits::MAXYBINS];//=new double[500][500]; //decreased from 1000*1000; too big! causes fault!
+ double _sigmaSum;
+ double _wdelta; //Added 7/26/07 for passing sigmadelta to pickw
+ double _remainwd;// "
+ int _ivalwd; // "
+
+ void pickw(double &w);
+ void picky(double &y);
+
+ void parentMomentum(double w,double y,double &E,double &px,double &py,double&pz);
+ double pp(double E);
+ void twoBodyDecay(starlightConstants::particleTypeEnum &ipid,double E,double W,double px0,double py0,double pz0,double &px1,double &py1,double&pz1,double &px2,double &py2,/*double &py2,*/double &pz2,int &iFbadevent);
+ // void transform(double betax,double betay,double betaz,double &E,double &px,double &py,double &pz,int &iFbadevent);
+ void thephi(double W,double px,double py,double pz,double E,double &theta,double &phi);
+
+ double getMass();
+ double getWidth();
+ double getSpin();
+
+ starlightConstants::particleTypeEnum _GGsingInputpidtest;
+ int _GGsingInputnumw;
+ int _GGsingInputnumy;
+ double _GGsingInputGamma_em;
+#ifdef ENABLE_PYTHIA
+ pythiaDecayer _pyDecayer;
+#endif
+
+};
+
+
+#endif // GAMMAGAMMASINGLE_H
Property changes on: branches/starlight_1.1/include/gammagammasingle.h
___________________________________________________________________
Added: svn:keywords
## -0,0 +1 ##
+Rev Date Author
\ No newline at end of property
Index: branches/starlight_1.1/include/pythiadecayer.h
===================================================================
--- branches/starlight_1.1/include/pythiadecayer.h (revision 0)
+++ branches/starlight_1.1/include/pythiadecayer.h (revision 145)
@@ -0,0 +1,44 @@
+#ifndef PYTHIADECAYER_H
+#define PYTHIADECAYER_H
+
+#include "Pythia.h"
+#include "starlightparticle.h"
+#include "upcevent.h"
+
+class pythiaDecayer
+{
+
+public:
+
+ // Default constructor
+ pythiaDecayer();
+
+ // Copy constructor
+// pythiaDecayer(const pythiaDecayer &obj);
+
+ // Destructor
+ virtual ~pythiaDecayer();
+
+ // Assignment operator
+// pythiaDecayer& operator=(const pythiaDecayer& other);
+
+ // Initialise
+ void init();
+
+ // Add particle to current event
+ void addParticle(const starlightParticle &p);
+
+ // Execute event and return starlight type event
+ upcEvent execute();
+
+
+private:
+
+ Pythia8::Pythia _pythia;
+
+ // Prohibited
+ pythiaDecayer(Pythia8::Pythia pythia);
+ bool operator==(const pythiaDecayer &other) const;
+
+};
+#endif // PYTHIADECAYER_H
Index: branches/starlight_1.1/include/readinluminosity.h
===================================================================
--- branches/starlight_1.1/include/readinluminosity.h (revision 0)
+++ branches/starlight_1.1/include/readinluminosity.h (revision 145)
@@ -0,0 +1,71 @@
+///////////////////////////////////////////////////////////////////////////
+//
+// Copyright 2010
+//
+// This file is part of starlight.
+//
+// starlight is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
+//
+// starlight is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with starlight. If not, see <http://www.gnu.org/licenses/>.
+//
+///////////////////////////////////////////////////////////////////////////
+//
+// File and Version Information:
+// $Rev:: $: revision of last commit
+// $Author:: $: author of last commit
+// $Date:: $: date of last commit
+//
+// Description:
+//
+//
+//
+///////////////////////////////////////////////////////////////////////////
+
+
+#ifndef READINLUMINOSITY_H
+#define READINLUMINOSITY_H
+
+
+#include "inputParameters.h"
+#include "starlightlimits.h"
+
+
+class readLuminosity
+{
+ public:
+ readLuminosity(const inputParameters& input);
+ ~readLuminosity();
+
+ void read();
+ /*double _Warray[starlightLimits::MAXWBINS]; //decreased from 1000; too big! causes fault!
+ double _Yarray[starlightLimits::MAXYBINS];
+ double _Farray[starlightLimits::MAXWBINS][starlightLimits::MAXYBINS];
+ */
+ double *_Warray;
+ double *_Yarray;
+ double **_Farray;
+
+ double _f_max;
+ double _fptarray[500][500];
+ // inputParameters inputread;
+ double _bwnormsave;
+
+ protected:
+ int _ReadInputNPT;
+ int _ReadInputnumy;
+ int _ReadInputnumw;
+ int _ReadInputgg_or_gP;
+ int _ReadInputinterferencemode;
+};
+
+
+#endif // READINLUMINOSITY_H
Property changes on: branches/starlight_1.1/include/readinluminosity.h
___________________________________________________________________
Added: svn:keywords
## -0,0 +1 ##
+Rev Date Author
\ No newline at end of property
Index: branches/starlight_1.1/include/incoherentVMCrossSection.h
===================================================================
--- branches/starlight_1.1/include/incoherentVMCrossSection.h (revision 0)
+++ branches/starlight_1.1/include/incoherentVMCrossSection.h (revision 145)
@@ -0,0 +1,61 @@
+///////////////////////////////////////////////////////////////////////////
+//
+// Copyright 2010
+//
+// This file is part of starlight.
+//
+// starlight is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
+//
+// starlight is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with starlight. If not, see <http://www.gnu.org/licenses/>.
+//
+///////////////////////////////////////////////////////////////////////////
+//
+// File and Version Information:
+// $Rev:: 44 $: revision of last commit
+// $Author:: bgrube $: author of last commit
+// $Date:: 2011-02-27 19:31:25 +0100 #$: date of last commit
+//
+// Description:
+//
+//
+//
+///////////////////////////////////////////////////////////////////////////
+
+
+#ifndef INCOHERENTVMCROSSSECTION_H
+#define INCOHERENTVMCROSSSECTION_H
+
+
+#include "photonNucleusCrossSection.h"
+
+
+class incoherentVMCrossSection : public photonNucleusCrossSection {
+
+public:
+
+ incoherentVMCrossSection(const inputParameters& input,
+ const beamBeamSystem& bbsystem);
+ ~incoherentVMCrossSection();
+
+ void crossSectionCalculation(const double bwnormsave);
+
+private:
+
+ double _Ep;
+ double _narrowYmax;
+ double _narrowYmin;
+ int _narrowNumY;
+
+};
+
+
+#endif // INCOHERENTVMCROSSSECTION_H
Index: branches/starlight_1.1/include/spectrum.h
===================================================================
--- branches/starlight_1.1/include/spectrum.h (revision 0)
+++ branches/starlight_1.1/include/spectrum.h (revision 145)
@@ -0,0 +1,162 @@
+
+/*
+ <one line to give the program's name and a brief idea of what it does.>
+ Copyright (C) <year> <name of author>
+
+ This program is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation, either version 3 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see <http://www.gnu.org/licenses/>.
+
+*/
+
+#ifndef SPECTRUM_H
+#define SPECTRUM_H
+
+#include <vector>
+class beamBeamSystem;
+class randomGenerator;
+
+class spectrum
+{
+public:
+
+ /** Spectrum must be constructed with beam-beam system, default constructor disallowed */
+ spectrum(beamBeamSystem *bbs);
+
+ /**
+ * Generate a table of photon energy probabilities
+ * Use NK+1 logarithmic steps between Et_min and Eg_max
+ */
+ int generateKsingle();
+
+ /**
+ * Generate a 2-D table of photon energy probabilities
+ * Use NK+1 x NK+1 logarithmic steps between Et_min and Eg_max
+ */
+ int generateKdouble();
+
+ /**
+ * Get the energy of a single gamma
+ * @return energy of the gamma
+ */
+ double drawKsingle();
+
+ /**
+ * Get the energy of a single gamma
+ * @param egamma1 variable passed by reference to get the energy of the frst gamma
+ * @param egamma2 variable passed by reference to get the energy of the second gamma
+ * @return energy of the gamma
+ */
+ void drawKdouble(float &egamma1, float &egamma2);
+
+ /** Set the beam beam system */
+ void setBeamBeamSystem(beamBeamSystem *bbs) {
+ _beamBeamSystem = bbs;
+ }
+
+ /** Set seed for random generator */
+ void setRandomGenerator(randomGenerator *rand) {
+ _randomGenerator = rand;
+ }
+
+ /** Set the minimum gamma energy */
+ void setMinGammaEnergy(double energy) { _eGammaMin = energy; }
+
+ /** Set the maximum gamma energy */
+ void setMaxGammaEnergy(double energy) { _eGammaMax = energy; }
+
+ /** Set minimum impact parameter */
+ void setBmin(double bmin) { _bMin = bmin; }
+
+ /** Set maximum impact parameter */
+ void setBmax(double bmax) { _bMax = bmax; }
+
+protected:
+
+ /** Generate the hadron breakup probability table */
+ virtual bool generateBreakupProbabilities();
+
+ /** Needs some explanation */
+ virtual double getSigma(double /*egamma*/) const {
+ return 1.05;
+ }
+
+ virtual double getTransformedNofe(double egamma, double b);
+
+ /** Minimum impact parameter */
+ double _bMin;
+
+ /** Maximum impact parameter */
+ double _bMax;
+
+ /** Number of bins in impact parameter */
+ int _nBbins;
+
+ /** Vector containing the probability of breakup */
+ std::vector<double> _probOfBreakup;
+
+ /** Beam beam system */
+ beamBeamSystem *_beamBeamSystem;
+
+private:
+ double getFnSingle(double egamma) const;
+
+ double getFnDouble(double egamma1, double egamma2) const;
+
+ /** NK */
+ int _nK;
+
+ /** Contains the 1 photon probabilities */
+ std::vector<double> _fnSingle;
+
+ /** Contains the 2 photon probabilities */
+ std::vector<std::vector<double> > _fnDouble;
+
+ /** Contains the cumulative distribution */
+ std::vector<double> _fnSingleCumulative;
+
+ /** Contains the cumulative distribution */
+ std::vector<std::vector<double> > _fnDoubleCumulative;
+
+ /** */
+ std::vector<double> _fnDoubleInt;
+
+ /** */
+ std::vector<double> _fnDoubleIntCumulative;
+
+ /** Vecotr of gamma energies */
+ std::vector<double> _eGamma;
+
+ /** Min gamma energy */
+ double _eGammaMin;
+
+ /** Max gamma energy */
+ double _eGammaMax;
+
+ /** Z of target */
+ int _zTarget;
+
+ /** A of target */
+ int _aTarget;
+
+ /** Hadron breakup probability is calculated */
+ bool _hadBreakProbCalculated;
+
+ /** The random generator */
+ randomGenerator *_randomGenerator;
+
+ /** Default constructed disallowed (not implemented) */
+ spectrum();
+
+};
+
+#endif // SPECTRUM_H
Index: branches/starlight_1.1/include/nBodyPhaseSpaceGen.h
===================================================================
--- branches/starlight_1.1/include/nBodyPhaseSpaceGen.h (revision 0)
+++ branches/starlight_1.1/include/nBodyPhaseSpaceGen.h (revision 145)
@@ -0,0 +1,231 @@
+///////////////////////////////////////////////////////////////////////////
+//
+// Copyright 2010
+//
+// This file is part of starlight.
+//
+// starlight is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
+//
+// starlight is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with starlight. If not, see <http://www.gnu.org/licenses/>.
+//
+///////////////////////////////////////////////////////////////////////////
+//
+// File and Version Information:
+// $Rev:: $: revision of last commit
+// $Author:: $: author of last commit
+// $Date:: $: date of last commit
+//
+// Description:
+// calculates n-body phase space (constant matrix element) using various algorithms
+//
+// the n-body decay is split up into (n - 2) successive 2-body decays
+// each 2-body decay is considered in its own center-of-mass frame thereby
+// separating the mass from the (trivial) angular dependence
+//
+// the event is boosted into the same frame in which the n-body system is
+// given
+//
+// based on:
+// GENBOD (CERNLIB W515), see F. James, "Monte Carlo Phase Space", CERN 68-15 (1968)
+// NUPHAZ, see M. M. Block, "Monte Carlo phase space evaluation", Comp. Phys. Commun. 69, 459 (1992)
+// S. U. Chung, "Spin Formalism", CERN Yellow Report
+// S. U. Chung et. al., "Diffractive Dissociation for COMPASS"
+//
+// index convention:
+// - all vectors have the same size (= number of decay daughters)
+// - index i corresponds to the respective value in the (i + 1)-body system: effective mass M, break-up momentum, angles
+// - thus some vector elements are not used like breakupMom[0], theta[0], phi[0], ...
+// this overhead is negligible compared to the ease of notation
+//
+// the following graph illustrates how the n-body decay is decomposed into a sequence of two-body decays
+//
+// n-body ... 3-body 2-body single daughter
+//
+// m[n - 1] m[2] m[1]
+// ^ ^ ^
+// | | |
+// | | |
+// M[n - 1] --> ... --> M[2] --> M[1] --> M [0] = m[0]
+// theta[n - 1] ... theta[2] theta[1] theta[0] = 0 (not used)
+// phi [n - 1] ... phi [2] phi [1] phi [0] = 0 (not used)
+// mSum [n - 1] ... mSum [2] mSum [1] mSum [0] = m[0]
+// = sum_0^(n - 1) m[i] = m[2] + m[1] + m[0] = m[1] + m[0]
+// breakUpMom[n - 1] ... breakUpMom[2] breakUpMom[1] breakUpMom[0] = 0 (not used)
+// = q(M[n - 1], m[n - 1], M[n - 2]) = q(M[2], m[2], M[1]) = q(M[1], m[1], m[0])
+//
+//
+///////////////////////////////////////////////////////////////////////////
+
+
+#ifndef NBODYPHASESPACEGEN_H
+#define NBODYPHASESPACEGEN_H
+
+
+#include <iostream>
+#include <vector>
+
+#include "reportingUtils.h"
+#include "lorentzvector.h"
+#include "randomgenerator.h"
+#include "starlightconstants.h"
+
+
+// small helper functions
+// calculates factorial
+inline
+unsigned int
+factorial(const unsigned int n)
+{
+ unsigned int fac = 1;
+ for (unsigned int i = 1; i <= n; ++i)
+ fac *= i;
+ return fac;
+}
+
+
+// computes breakup momentum of 2-body decay
+inline
+double
+breakupMomentum(const double M, // mass of mother particle
+ const double m1, // mass of daughter particle 1
+ const double m2) // mass of daughter particle 2
+{
+ if (M < m1 + m2)
+ return 0;
+ return sqrt((M - m1 - m2) * (M + m1 + m2) * (M - m1 + m2) * (M + m1 - m2)) / (2 * M);
+}
+
+
+class nBodyPhaseSpaceGen {
+
+public:
+
+ nBodyPhaseSpaceGen();
+ virtual ~nBodyPhaseSpaceGen();
+
+ // generator setup
+ /// sets decay constants and prepares internal variables
+ bool setDecay(const std::vector<double>& daughterMasses); // daughter particle masses
+ bool setDecay(const unsigned int nmbOfDaughters, // number of daughter particles
+ const double* daughterMasses); // array of daughter particle masses
+
+ // random generator
+ void setSeed(const unsigned int seed) { _rnd.SetSeed(seed); } ///< sets seed of random number generator
+ double random () { return _rnd.Rndom(); } ///< returns number from internal random generator
+
+ // high-level generator interface
+ /// generates full event with certain n-body mass and momentum and returns event weight
+ double generateDecay (const lorentzVector& nBody); // Lorentz vector of n-body system in lab frame
+ /// \brief generates full event with certain n-body mass and momentum only when event is accepted (return value = true)
+ /// this function is more efficient, if only weighted events are needed
+ bool generateDecayAccepted(const lorentzVector& nBody, // Lorentz vector of n-body system in lab frame
+ const double maxWeight = 0); // if positive, given value is used as maximum weight, otherwise _maxWeight
+
+ void setMaxWeight (const double maxWeight) { _maxWeight = maxWeight; } ///< sets maximum weight used for hit-miss MC
+ double maxWeight () const { return _maxWeight; } ///< returns maximum weight used for hit-miss MC
+ double normalization () const { return _norm; } ///< returns normalization used in weight calculation
+ double eventWeight () const { return _weight; } ///< returns weight of generated event
+ double maxWeightObserved () const { return _maxWeightObserved; } ///< returns maximum observed weight since instantiation
+ void resetMaxWeightObserved() { _maxWeightObserved = 0; } ///< sets maximum observed weight back to zero
+
+ /// estimates maximum weight for given n-body mass
+ double estimateMaxWeight(const double nBodyMass, // sic!
+ const unsigned int nmbOfIterations = 10000); // number of generated events
+
+ /// \brief applies event weight in form of hit-miss MC
+ /// assumes that event weight has been already calculated by calcWeight()
+ /// if maxWeight > 0 value is used as maximum weight, otherwise _maxWeight value is used
+ inline bool eventAccepted(const double maxWeight = 0);
+
+ //----------------------------------------------------------------------------
+ // trivial accessors
+ const lorentzVector& daughter (const int index) const { return _daughters[index]; } ///< returns Lorentz vector of daughter at index
+ const std::vector<lorentzVector>& daughters () const { return _daughters; } ///< returns Lorentz vectors of all daughters
+ unsigned int nmbOfDaughters () const { return _n; } ///< returns number of daughters
+ double daughterMass (const int index) const { return _m[index]; } ///< returns invariant mass of daughter at index
+ double intermediateMass(const int index) const { return _M[index]; } ///< returns intermediate mass of (index + 1)-body system
+ double breakupMom (const int index) const { return _breakupMom[index]; } ///< returns breakup momentum in (index + 1)-body RF
+ double cosTheta (const int index) const { return _cosTheta[index]; } ///< returns polar angle in (index + 1)-body RF
+ double phi (const int index) const { return _phi[index]; } ///< returns azimuth in (index + 1)-body RF
+
+
+ std::ostream& print(std::ostream& out = std::cout) const; ///< prints generator status
+ friend std::ostream& operator << (std::ostream& out,
+ const nBodyPhaseSpaceGen& gen)
+ { return gen.print(out); }
+
+private:
+
+ //----------------------------------------------------------------------------
+ // low-level generator interface
+ /// randomly choses the (n - 2) effective masses of the respective (i + 1)-body systems
+ void pickMasses(const double nBodyMass); // total energy of n-body system in its RF
+
+ /// \brief computes event weight and breakup momenta
+ /// operates on vector of intermediate two-body masses prepared by pickMasses()
+ double calcWeight();
+
+ /// randomly choses the (n - 1) polar and (n - 1) azimuthal angles in the respective (i + 1)-body RFs
+ inline void pickAngles();
+
+ /// \brief calculates full event kinematics from the effective masses of the (i + 1)-body systems and the Lorentz vector of the decaying system
+ /// uses the break-up momenta calculated by calcWeight() and angles from pickAngles()
+ void calcEventKinematics(const lorentzVector& nBody); // Lorentz vector of n-body system in lab frame
+
+ // external parameters
+ std::vector<double> _m; ///< masses of daughter particles
+
+ // internal variables
+ unsigned int _n; ///< number of daughter particles
+ std::vector<double> _M; ///< effective masses of (i + 1)-body systems
+ std::vector<double> _cosTheta; ///< cosine of polar angle of the 2-body decay of the (i + 1)-body system
+ std::vector<double> _phi; ///< azimuthal angle of the 2-body decay of the (i + 1)-body system
+ std::vector<double> _mSum; ///< sums of daughter particle masses
+ std::vector<double> _breakupMom; ///< breakup momenta for the two-body decays: (i + 1)-body --> daughter_(i + 1) + i-body
+ std::vector<lorentzVector> _daughters; ///< Lorentz vectors of the daughter particles
+ double _norm; ///< normalization value
+ double _weight; ///< phase space weight of generated event
+ double _maxWeightObserved; ///< maximum event weight calculated processing the input data
+ double _maxWeight; ///< maximum weight used to weight events in hit-miss MC
+
+ randomGenerator _rnd; ///< random number generator instance
+
+};
+
+
+inline
+void
+nBodyPhaseSpaceGen::pickAngles()
+{
+ for (unsigned int i = 1; i < _n; ++i) { // loop over 2- to n-bodies
+ _cosTheta[i] = 2 * random() - 1; // range [-1, 1]
+ _phi[i] = starlightConstants::twoPi * random(); // range [ 0, 2 pi]
+ }
+}
+
+
+inline
+bool
+nBodyPhaseSpaceGen::eventAccepted(const double maxWeight) // if maxWeight > 0, given value is used as maximum weight, otherwise _maxWeight
+{
+ const double max = (maxWeight <= 0) ? _maxWeight : maxWeight;
+ if (max <= 0) {
+ printWarn << "maximum weight = " << max << " does not make sense. rejecting event." << std::endl;
+ return false;
+ }
+ if ((_weight / max) > random())
+ return true;
+ return false;
+}
+
+
+#endif // NBODYPHASESPACEGEN_H
Property changes on: branches/starlight_1.1/include/nBodyPhaseSpaceGen.h
___________________________________________________________________
Added: svn:keywords
## -0,0 +1 ##
+Rev Date Author
\ No newline at end of property
Index: branches/starlight_1.1/include/spectrumprotonnucleus.h
===================================================================
--- branches/starlight_1.1/include/spectrumprotonnucleus.h (revision 0)
+++ branches/starlight_1.1/include/spectrumprotonnucleus.h (revision 145)
@@ -0,0 +1,39 @@
+/*
+ <one line to give the library's name and an idea of what it does.>
+ Copyright (C) 2011 Oystein Djuvsland <oystein.djuvsland@gmail.com>
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this library; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+*/
+
+
+#ifndef SPECTRUMPROTONLEAD_H
+#define SPECTRUMPROTONLEAD_H
+
+#include "spectrum.h"
+
+class beamBeamSystem;
+
+class spectrumProtonNucleus : public spectrum
+{
+public:
+ spectrumProtonNucleus(beamBeamSystem *bb);
+ virtual double getNucleonNucleonSigma() const { return 7.35; }
+protected:
+ virtual bool generateBreakupProbabilities();
+ virtual double getSigma(double ) const;
+
+};
+
+#endif // SPECTRUMPROTONLEAD_H
Index: branches/starlight_1.1/include/eventchannel.h
===================================================================
--- branches/starlight_1.1/include/eventchannel.h (revision 0)
+++ branches/starlight_1.1/include/eventchannel.h (revision 145)
@@ -0,0 +1,94 @@
+///////////////////////////////////////////////////////////////////////////
+//
+// Copyright 2010
+//
+// This file is part of starlight.
+//
+// starlight is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
+//
+// starlight is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with starlight. If not, see <http://www.gnu.org/licenses/>.
+//
+///////////////////////////////////////////////////////////////////////////
+//
+// File and Version Information:
+// $Rev:: $: revision of last commit
+// $Author:: $: author of last commit
+// $Date:: $: date of last commit
+//
+// Description:
+//
+//
+//
+///////////////////////////////////////////////////////////////////////////
+
+
+#ifndef EVENTCHANNEL_H
+#define EVENTCHANNEL_H
+
+#include <vector>
+
+#include "starlightconstants.h"
+#include "readinluminosity.h"
+#include "beambeamsystem.h"
+#include "randomgenerator.h"
+#include "upcevent.h"
+
+
+
+class eventChannel : public readLuminosity
+{
+
+public:
+
+ eventChannel(const inputParameters& input,
+ beamBeamSystem& bbsystem);
+ virtual ~eventChannel();
+
+ unsigned long nmbAttempts() const {return _nmbAttempts;} ///< returns number of attempted events
+ unsigned long nmbAccepted() const {return _nmbAccepted;} ///< returns number of accepted events
+
+ virtual starlightConstants::event produceEvent(int &ievent) = 0;
+
+ virtual upcEvent produceEvent() = 0;
+
+ static void transform(const double betax,
+ const double betay,
+ const double betaz,
+ double& E,
+ double& px,
+ double& py,
+ double& pz,
+ int& iFbadevent); ///< Lorentz-transforms given 4-vector
+
+ randomGenerator _randy;
+ beamBeamSystem _bbs;
+
+ static double pseudoRapidity(const double px,
+ const double py,
+ const double pz); ///< calculates pseudorapidity for given 3-momentum
+
+protected:
+
+ unsigned long _nmbAttempts; ///< number of attempted events
+ unsigned long _nmbAccepted; ///< number of accepted events
+
+ bool _ptCutEnabled; ///< en/disables cut in pt
+ double _ptCutMin; ///< minimum pt, if cut is enabled
+ double _ptCutMax; ///< maximum pt, if cut is enabled
+ bool _etaCutEnabled; ///< en/disables cut in eta
+ double _etaCutMin; ///< minimum eta, if cut is enabled
+ double _etaCutMax; ///< maximum eta, if cut is enabled
+
+};
+
+
+#endif // EVENTCHANNEL_H
Property changes on: branches/starlight_1.1/include/eventchannel.h
___________________________________________________________________
Added: svn:keywords
## -0,0 +1 ##
+Rev Date Author
\ No newline at end of property
Index: branches/starlight_1.1/include/filewriter.h
===================================================================
--- branches/starlight_1.1/include/filewriter.h (revision 0)
+++ branches/starlight_1.1/include/filewriter.h (revision 145)
@@ -0,0 +1,79 @@
+///////////////////////////////////////////////////////////////////////////
+//
+// Copyright 2010
+//
+// This file is part of starlight.
+//
+// starlight is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
+//
+// starlight is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with starlight. If not, see <http://www.gnu.org/licenses/>.
+//
+///////////////////////////////////////////////////////////////////////////
+//
+// File and Version Information:
+// $Rev:: $: revision of last commit
+// $Author:: $: author of last commit
+// $Date:: $: date of last commit
+//
+// Description:
+//
+//
+//
+///////////////////////////////////////////////////////////////////////////
+
+
+#ifndef FILEWRITER_H
+#define FILEWRITER_H
+
+
+#include <string>
+#include <fstream>
+
+#include "upcevent.h"
+
+
+class fileWriter
+{
+public:
+
+ /** Default constructor */
+ fileWriter();
+
+ /** Constructor with filename */
+ fileWriter(const std::string& fileName);
+
+ /** Destructor */
+ virtual ~fileWriter();
+
+ /** open the file */
+ int open();
+
+ /** open file with given filename */
+ int open(const std::string& fileName);
+
+ /** close the file */
+ int close();
+
+ /** Set the filename we're writing to */
+ void setFileName(const std::string& fileName) { _fileName = fileName; }
+
+protected:
+
+ /** The file name */
+ std::string _fileName;
+
+ /** The file stream */
+ std::ofstream _fileStream;
+};
+
+
+#endif // FILEWRITER_H
Property changes on: branches/starlight_1.1/include/filewriter.h
___________________________________________________________________
Added: svn:keywords
## -0,0 +1 ##
+Rev Date Author
\ No newline at end of property
Index: branches/starlight_1.1/include/inputParser.h
===================================================================
--- branches/starlight_1.1/include/inputParser.h (revision 0)
+++ branches/starlight_1.1/include/inputParser.h (revision 145)
@@ -0,0 +1,121 @@
+///////////////////////////////////////////////////////////////////////////
+//
+// Copyright 2011
+//
+// This file is part of starlight.
+//
+// starlight is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
+//
+// starlight is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with starlight. If not, see <http://www.gnu.org/licenses/>.
+//
+///////////////////////////////////////////////////////////////////////////
+//
+// File and Version Information:
+// $Rev:: $: revision of last commit
+// $Author:: $: author of last commit
+// $Date:: $: date of last commit
+//
+// Description:
+//
+//
+//
+///////////////////////////////////////////////////////////////////////////
+
+
+#ifndef INPUTPARSER_H
+#define INPUTPARSER_H
+
+#include <string>
+#include <typeinfo>
+#include <iostream>
+#include <map>
+
+class inputParser
+{
+public:
+
+ /** Constructor */
+ inputParser();
+
+ /** Destructor */
+ ~inputParser();
+
+ /** Parse a file */
+ int parseFile(std::string filename);
+
+ /** Add parameter to pass */
+ void addIntParameter(std::string name, int *var, bool required = true);
+
+ /** Add parameter to pass */
+ void addUintParameter(std::string name, unsigned int *var, bool required = true);
+
+ /** Add parameter to pass */
+ void addFloatParameter(std::string name, float *var, bool required = true);
+
+ /** Add parameter to pass */
+ void addDoubleParameter(std::string name, double *var, bool required = true);
+
+ /** Add parameter to pass */
+ void addBoolParameter(std::string name, bool *var, bool required = true);
+
+ /** Add parameter to pass */
+ void addStringParameter(std::string name, std::string *var, bool required = true);
+
+ /** Print info */
+ void printParameterInfo(std::ostream &out = std::cout);
+
+ /** Validate */
+ bool validateParameters(std::ostream &warnOut = std::cout, std::ostream &errOut = std::cerr);
+
+private:
+
+ template <class T>
+ class _parameter
+ {
+ public:
+ _parameter(std::string name, T *val, bool required = true, bool found = false) : _name(name), _val(val), _required(required), _found(found){}
+
+ bool operator==(const _parameter &rhs) const { return _name == rhs._name; }
+
+ bool operator<(const _parameter &rhs) const { return _name.c_str()[0] < rhs._name.c_str()[0]; }
+
+ void printParameterInfo(std::ostream &out = std::cout)
+ {
+ out << std::boolalpha << _name << "\t\t";
+ if(_found)
+ {
+ out << *_val << std::endl;
+ }
+ else
+ {
+ out << "NOT FOUND" << std::endl;
+ }
+ out << std::noboolalpha;
+ }
+
+
+ std::string _name;
+ T *_val;
+ bool _required;
+ bool _found;
+ };
+
+ std::map<std::string, _parameter<int> > _intParameters;
+ std::map<std::string, _parameter<unsigned int> > _uintParameters;
+ std::map<std::string, _parameter<float> > _floatParameters;
+ std::map<std::string, _parameter<double> > _doubleParameters;
+ std::map<std::string, _parameter<bool> > _boolParameters;
+ std::map<std::string, _parameter<std::string> > _stringParameters;
+
+};
+
+#endif // INPUTPARSER_H
Property changes on: branches/starlight_1.1/include/inputParser.h
___________________________________________________________________
Added: svn:keywords
## -0,0 +1 ##
+Rev Date Author
\ No newline at end of property
Index: branches/starlight_1.1/include/gammaaluminosity.h
===================================================================
--- branches/starlight_1.1/include/gammaaluminosity.h (revision 0)
+++ branches/starlight_1.1/include/gammaaluminosity.h (revision 145)
@@ -0,0 +1,58 @@
+///////////////////////////////////////////////////////////////////////////
+//
+// Copyright 2010
+//
+// This file is part of starlight.
+//
+// starlight is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
+//
+// starlight is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with starlight. If not, see <http://www.gnu.org/licenses/>.
+//
+///////////////////////////////////////////////////////////////////////////
+//
+// File and Version Information:
+// $Rev:: $: revision of last commit
+// $Author:: $: author of last commit
+// $Date:: $: date of last commit
+//
+// Description:
+//
+//
+//
+///////////////////////////////////////////////////////////////////////////
+
+
+#ifndef GAMMAALUMINOSITY_H
+#define GAMMAALUMINOSITY_H
+
+
+#include "beambeamsystem.h"
+#include "inputParameters.h"
+#include "photonNucleusCrossSection.h"
+
+
+class photonNucleusLuminosity : public photonNucleusCrossSection
+{
+ public:
+ photonNucleusLuminosity(inputParameters& input, beamBeamSystem& bbsystem);
+ ~photonNucleusLuminosity();
+
+ private:
+ inputParameters _inputgammaa;
+ void photonNucleusDifferentialLuminosity();
+ double *vmsigmapt(double W,double Egamma,double *SIGMAPT);
+ double nofe(double Egamma,double bimp);
+ void pttablegen();
+};
+
+#endif //GAMMAALUMINOSITY_H
+
Property changes on: branches/starlight_1.1/include/gammaaluminosity.h
___________________________________________________________________
Added: svn:keywords
## -0,0 +1 ##
+Rev Date Author
\ No newline at end of property
Index: branches/starlight_1.1/include/lorentzvector.h
===================================================================
--- branches/starlight_1.1/include/lorentzvector.h (revision 0)
+++ branches/starlight_1.1/include/lorentzvector.h (revision 145)
@@ -0,0 +1,110 @@
+///////////////////////////////////////////////////////////////////////////
+//
+// Copyright 2010
+//
+// This file is part of starlight.
+//
+// starlight is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
+//
+// starlight is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with starlight. If not, see <http://www.gnu.org/licenses/>.
+//
+///////////////////////////////////////////////////////////////////////////
+//
+// File and Version Information:
+// $Rev:: $: revision of last commit
+// $Author:: $: author of last commit
+// $Date:: $: date of last commit
+//
+// Description:
+//
+//
+//
+///////////////////////////////////////////////////////////////////////////
+
+
+#ifndef LORENTZVECTOR_H
+#define LORENTZVECTOR_H
+
+
+#include "vector3.h"
+#include <vector>
+
+
+class lorentzVector
+{
+ public:
+
+ lorentzVector();
+ virtual ~lorentzVector();
+
+ lorentzVector(double x, double y, double z, double t);
+ //lorentzVector(double px, double py, double pz, double e);
+
+ void SetXYZT(double x, double y, double z, double t);
+ void SetPxPyPzE(double px, double py, double pz, double e) { SetXYZT(px, py, pz, e); };
+
+ double GetPx() const { return fSpaceVec.GetVector()[0]; }
+ double GetPy() const { return fSpaceVec.GetVector()[1]; }
+ double GetPz() const { return fSpaceVec.GetVector()[2]; }
+ double GetE() const { return fTime; }
+
+ lorentzVector& operator +=(const lorentzVector& vec)
+ {
+ fSpaceVec += vec.fSpaceVec;
+ fTime += vec.fTime;
+ return *this;
+ }
+ lorentzVector& operator -=(const lorentzVector& vec)
+ {
+ fSpaceVec -= vec.fSpaceVec;
+ fTime -= vec.fTime;
+ return *this;
+ }
+
+ double M2() const { return fTime * fTime - fSpaceVec.Mag2(); }
+ double M () const
+ {
+ const double mag2 = M2();
+ return (mag2 < 0) ? -sqrt(-mag2) : sqrt(mag2);
+ }
+
+ vector3 BoostVector() const
+ { return vector3(fSpaceVec.X() / fTime, fSpaceVec.Y() / fTime, fSpaceVec.Z() / fTime); }
+ void Boost(const vector3& beta)
+ {
+ const double beta2 = beta.Mag2();
+ const double gamma = 1 / sqrt(1 - beta2);
+ const double betaTimesMom = beta.X() * fSpaceVec.X() + beta.Y() * fSpaceVec.Y() + beta.Z() * fSpaceVec.Z();
+ const double gamma2 = (beta2 > 0) ? (gamma - 1) / beta2 : 0;
+ SetXYZT(fSpaceVec.X() + gamma2 * betaTimesMom * beta.X() + gamma * beta.X() * fTime,
+ fSpaceVec.Y() + gamma2 * betaTimesMom * beta.Y() + gamma * beta.Y() * fTime,
+ fSpaceVec.Z() + gamma2 * betaTimesMom * beta.Z() + gamma * beta.Z() * fTime,
+ gamma * (fTime + betaTimesMom));
+ }
+
+ friend std::ostream& operator << (std::ostream& out,
+ const lorentzVector& vec)
+ {
+ out << "(" << vec.GetPx() << ", " << vec.GetPy() << ", " << vec.GetPz()
+ << "; " << vec.GetE() << ")";
+ return out;
+ }
+
+ private:
+
+ vector3 fSpaceVec;
+ double fTime;
+
+};
+
+
+#endif // LORENTZVECTOR_H
Property changes on: branches/starlight_1.1/include/lorentzvector.h
___________________________________________________________________
Added: svn:keywords
## -0,0 +1 ##
+Rev Date Author
\ No newline at end of property
Index: branches/starlight_1.1/include/starlightpythia.h
===================================================================
--- branches/starlight_1.1/include/starlightpythia.h (revision 0)
+++ branches/starlight_1.1/include/starlightpythia.h (revision 145)
@@ -0,0 +1,92 @@
+/*
+ <one line to give the library's name and an idea of what it does.>
+ Copyright (C) 2011 Oystein Djuvsland <oystein.djuvsland@gmail.com>
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this library; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+*/
+
+
+#ifndef STARLIGHTPYTHIA_H
+#define STARLIGHTPYTHIA_H
+
+#include "upcevent.h"
+#include "inputParameters.h"
+#include "beambeamsystem.h"
+#include "eventchannel.h"
+
+class spectrum;
+
+class starlightPythia : public eventChannel
+{
+
+public:
+
+ starlightPythia(inputParameters& input, beamBeamSystem& bbsystem);
+ virtual ~starlightPythia();
+
+ int init(std::string pythiaParams, bool fullEventRecord = false);
+
+ virtual upcEvent produceEvent();
+
+ virtual upcEvent produceSingleEvent(int /*zdirection*/, float /*egamma*/){return upcEvent();}
+
+ virtual upcEvent produceDoubleEvent(){return upcEvent();}
+
+ virtual starlightConstants::event produceEvent(int& /*ievent*/){ return starlightConstants::event();}
+
+ void setSingleMode() {
+ _doDoubleEvent = false;
+ }
+
+ void setDoubleMode() {
+ _doDoubleEvent = true;
+ }
+
+ void setMinGammaEnergy(double energy) {
+ _minGammaEnergy = energy;
+ }
+
+ void setMaxGammaEnergy(double energy) {
+ _maxGammaEnergy = energy;
+ }
+
+ void setFullEventRecord(bool fer = true) { _fullEventRecord = fer; }
+
+private:
+
+ /** Contains the photon spectrum */
+ spectrum *_spectrum;
+
+ /** Should we produce a double event? */
+ bool _doDoubleEvent;
+
+ /** Min gamma energy */
+ double _minGammaEnergy;
+
+ /** Max gamma energy */
+ double _maxGammaEnergy;
+
+ /** Full event record or not */
+ bool _fullEventRecord;
+
+ /** Prohibited */
+ starlightPythia();
+ starlightPythia(const starlightPythia& other);
+ starlightPythia& operator=(const starlightPythia& other);
+ bool operator==(const starlightPythia& other) const;
+
+};
+
+#endif // STARLIGHTPYTHIA_H
Index: branches/starlight_1.1/include/incoherentPhotonNucleusLuminosity.h
===================================================================
--- branches/starlight_1.1/include/incoherentPhotonNucleusLuminosity.h (revision 0)
+++ branches/starlight_1.1/include/incoherentPhotonNucleusLuminosity.h (revision 145)
@@ -0,0 +1,55 @@
+///////////////////////////////////////////////////////////////////////////
+//
+// Copyright 2010
+//
+// This file is part of starlight.
+//
+// starlight is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
+//
+// starlight is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with starlight. If not, see <http://www.gnu.org/licenses/>.
+//
+///////////////////////////////////////////////////////////////////////////
+//
+// File and Version Information:
+// $Rev:: 44 $: revision of last commit
+// $Author:: bgrube $: author of last commit
+// $Date:: 2011-02-27 19:31:25 +0100 #$: date of last commit
+//
+// Description:
+//
+//
+//
+///////////////////////////////////////////////////////////////////////////
+
+
+#ifndef INCOHERENTPHOTONNUCLEUSLUMINOSITY_H
+#define INCOHERENTPHOTONNUCLEUSLUMINOSITY_H
+
+
+#include "beambeamsystem.h"
+#include "inputParameters.h"
+#include "photonNucleusCrossSection.h"
+
+
+class incoherentPhotonNucleusLuminosity : public photonNucleusCrossSection
+{
+ public:
+ incoherentPhotonNucleusLuminosity(inputParameters& input, beamBeamSystem& bbsystem);
+ ~incoherentPhotonNucleusLuminosity();
+
+ private:
+ inputParameters _inputgammaa;
+ void incoherentPhotonNucleusDifferentialLuminosity();
+ double nofe(double Egamma,double bimp);
+};
+
+#endif //INCOHERENTPHOTONNUCLEUSLUMINOSITY_H
Index: branches/starlight_1.1/include/gammagammaleptonpair.h
===================================================================
--- branches/starlight_1.1/include/gammagammaleptonpair.h (revision 0)
+++ branches/starlight_1.1/include/gammagammaleptonpair.h (revision 145)
@@ -0,0 +1,91 @@
+///////////////////////////////////////////////////////////////////////////
+//
+// Copyright 2010
+//
+// This file is part of starlight.
+//
+// starlight is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
+//
+// starlight is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with starlight. If not, see <http://www.gnu.org/licenses/>.
+//
+///////////////////////////////////////////////////////////////////////////
+//
+// File and Version Information:
+// $Rev:: $: revision of last commit
+// $Author:: $: author of last commit
+// $Date:: $: date of last commit
+//
+// Description:
+//
+//
+//
+///////////////////////////////////////////////////////////////////////////
+
+
+#ifndef GAMMAGAMMALEPTONPAIR_H
+#define GAMMAGAMMALEPTONPAIR_H
+
+#include <vector>
+
+#include "starlightconstants.h"
+#include "readinluminosity.h"
+#include "starlightlimits.h"
+#include "eventchannel.h"
+
+
+class Gammagammaleptonpair : public eventChannel
+{
+ public:
+ Gammagammaleptonpair(inputParameters& input, beamBeamSystem& bbsystem);
+ ~Gammagammaleptonpair();
+
+ void twoLeptonCrossSection();
+ void calculateTable();
+
+ starlightConstants::event produceEvent(int &ievent);
+ upcEvent produceEvent();
+
+ private:
+ double _sigmax[starlightLimits::MAXWBINS][starlightLimits::MAXYBINS];//=new double[500][500]; //decreased from 1000*1000; too big! causes fault!
+ double _sigmaSum;
+ double _sigfint[starlightLimits::MAXWBINS];
+ double _sigofw[starlightLimits::MAXWBINS];
+ double _signormw;
+ double _wdelta; //Added 7/26/07 for passing sigmadelta to pickw
+ double _remainwd;// "
+ int _ivalwd; // "
+ double _dgammade[1000];
+ double _tautolangle[100];
+
+ double twoMuonCrossSection(double w);
+ void pickw(double &w);
+ void picky(double &y);
+
+ void pairMomentum(double w,double y,double &E,double &px,double &py,double&pz);
+ double pp_1(double E);
+ double pp_2(double E);
+ void twoBodyDecay(starlightConstants::particleTypeEnum &ipid,double E,double W,double px0,double py0,double pz0,double &px1,double &py1,double&pz1,double &px2,double &py2,/*double &py2,*/double &pz2,int &iFbadevent);
+ double thetalep(double W,double theta);
+ void tauDecay(double &px1,double &py1,double &pz1,double &E1,double &px2,double &py2,double &pz2,double &E2);
+
+ double getMass();
+ double getWidth();
+ double getSpin();
+
+ starlightConstants::particleTypeEnum _GGlepInputpidtest;
+ int _GGlepInputnumw;
+ int _GGlepInputnumy;
+ double _GGlepInputGamma_em;
+};
+
+
+#endif // GAMMAGAMMALEPTONPAIR_H
Property changes on: branches/starlight_1.1/include/gammagammaleptonpair.h
___________________________________________________________________
Added: svn:keywords
## -0,0 +1 ##
+Rev Date Author
\ No newline at end of property
Index: branches/starlight_1.1/include/starlightlimits.h
===================================================================
--- branches/starlight_1.1/include/starlightlimits.h (revision 0)
+++ branches/starlight_1.1/include/starlightlimits.h (revision 145)
@@ -0,0 +1,45 @@
+///////////////////////////////////////////////////////////////////////////
+//
+// Copyright 2010
+//
+// This file is part of starlight.
+//
+// starlight is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
+//
+// starlight is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with starlight. If not, see <http://www.gnu.org/licenses/>.
+//
+///////////////////////////////////////////////////////////////////////////
+//
+// File and Version Information:
+// $Rev:: $: revision of last commit
+// $Author:: $: author of last commit
+// $Date:: $: date of last commit
+//
+// Description:
+//
+//
+//
+///////////////////////////////////////////////////////////////////////////
+
+
+#ifndef STARLIGHTLIMITS_H_INCLUDE
+#define STARLIGHTLIMITS_H_INCLUDE
+
+
+namespace starlightLimits
+{
+ static const int MAXWBINS = 3000;
+ static const int MAXYBINS = 3000;
+}
+
+
+#endif // STARLIGHTLIMITS_H_INCLUDE
Property changes on: branches/starlight_1.1/include/starlightlimits.h
___________________________________________________________________
Added: svn:keywords
## -0,0 +1 ##
+Rev Date Author
\ No newline at end of property
Index: branches/starlight_1.1/include/starlightparticle.h
===================================================================
--- branches/starlight_1.1/include/starlightparticle.h (revision 0)
+++ branches/starlight_1.1/include/starlightparticle.h (revision 145)
@@ -0,0 +1,92 @@
+///////////////////////////////////////////////////////////////////////////
+//
+// Copyright 2010
+//
+// This file is part of starlight.
+//
+// starlight is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
+//
+// starlight is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with starlight. If not, see <http://www.gnu.org/licenses/>.
+//
+///////////////////////////////////////////////////////////////////////////
+//
+// File and Version Information:
+// $Rev:: $: revision of last commit
+// $Author:: $: author of last commit
+// $Date:: $: date of last commit
+//
+// Description:
+//
+//
+//
+///////////////////////////////////////////////////////////////////////////
+
+
+#ifndef STARLIGHTPARTICLE_H
+#define STARLIGHTPARTICLE_H
+
+
+#include "lorentzvector.h"
+
+
+class starlightParticle : public lorentzVector
+{
+ public:
+
+ starlightParticle();
+ starlightParticle ( double px, double py, double pz, double e, double mass, int pdgCode, short charge,
+ double vx = 0., double vy = 0, double vz = 0, double vt = 0,
+ int firstParent = 0, int lastParent = 0, int firstDaughter = 0, int lastDaughter = 0, int status = 0);
+ virtual ~starlightParticle();
+
+ void setPdgCode(int pdgCode) { _pdgCode = pdgCode; }
+ int getPdgCode() const { return _pdgCode; }
+
+ void setCharge(short charge) { _charge = charge; }
+ short getCharge() const { return _charge; }
+
+ void setFirstParent(int parent) { _firstParent = parent; }
+ void setLastParent(int parent) { _lastParent = parent; }
+ int getFirstParent() const { return _firstParent; }
+ int getLastParent() const { return _lastParent; }
+
+ void setFirstDaughter(int first) { _firstDaughter = first; }
+ int getFirstDaughter() const { return _firstDaughter; }
+
+ void setLastDaughter(int first) { _lastDaughter = first; }
+ int getLastDaughter() const { return _lastDaughter; }
+
+ void setStatus(int status) { _status = status; }
+ int getStatus() const { return _status; }
+
+ void setVertex(lorentzVector v) { _vertex = v; }
+ lorentzVector getVertex() const { return _vertex; }
+
+ private:
+
+ lorentzVector _vertex;
+
+ int _pdgCode;
+ short _charge;
+ double _mass;
+
+ int _firstParent;
+ int _lastParent;
+ int _firstDaughter;
+ int _lastDaughter;
+
+ int _status;
+
+};
+
+
+#endif // STARLIGHTPARTICLE_H
Property changes on: branches/starlight_1.1/include/starlightparticle.h
___________________________________________________________________
Added: svn:keywords
## -0,0 +1 ##
+Rev Date Author
\ No newline at end of property
Index: branches/starlight_1.1/include/vector3.h
===================================================================
--- branches/starlight_1.1/include/vector3.h (revision 0)
+++ branches/starlight_1.1/include/vector3.h (revision 145)
@@ -0,0 +1,97 @@
+///////////////////////////////////////////////////////////////////////////
+//
+// Copyright 2010
+//
+// This file is part of starlight.
+//
+// starlight is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
+//
+// starlight is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with starlight. If not, see <http://www.gnu.org/licenses/>.
+//
+///////////////////////////////////////////////////////////////////////////
+//
+// File and Version Information:
+// $Rev:: $: revision of last commit
+// $Author:: $: author of last commit
+// $Date:: $: date of last commit
+//
+// Description:
+//
+//
+//
+///////////////////////////////////////////////////////////////////////////
+
+
+#ifndef VECTOR3_H
+#define VECTOR3_H
+
+
+#include <iostream>
+#include <cmath>
+
+
+class vector3
+{
+ public:
+ vector3();
+ vector3(double *vec);
+ vector3(double x, double y, double z);
+ virtual ~vector3();
+
+ const double* GetVector() const { return _vec; }
+
+ void SetVector(double x, double y, double z);
+ void SetVector(double *vec);
+
+ vector3& operator =(const vector3& vec)
+ {
+ if (this != &vec)
+ for (unsigned int i = 0; i < 3; ++i)
+ _vec[i] = vec._vec[i];
+ return *this;
+ }
+
+ vector3& operator +=(const vector3& vec)
+ {
+ for (unsigned int i = 0; i < 3; ++i)
+ _vec[i] += vec._vec[i];
+ return *this;
+ }
+ vector3& operator -=(const vector3& vec)
+ {
+ for (unsigned int i = 0; i < 3; ++i)
+ _vec[i] -= vec._vec[i];
+ return *this;
+ }
+
+ double X() const { return _vec[0]; }
+ double Y() const { return _vec[1]; }
+ double Z() const { return _vec[2]; }
+
+ double Mag2() const { return _vec[0] * _vec[0] + _vec[1] * _vec[1] + _vec[2] * _vec[2]; }
+ double Mag () const { return sqrt(Mag2()); }
+
+ friend std::ostream& operator << (std::ostream& out,
+ const vector3& vec)
+ {
+ out << "(" << vec.X() << ", " << vec.Y() << ", " << vec.Z() << ")";
+ return out;
+ }
+
+ private:
+
+ double _vec[3];
+
+};
+
+
+#endif // VECTOR3_H
Property changes on: branches/starlight_1.1/include/vector3.h
___________________________________________________________________
Added: svn:keywords
## -0,0 +1 ##
+Rev Date Author
\ No newline at end of property
Index: branches/starlight_1.1/include/gammaavm.h
===================================================================
--- branches/starlight_1.1/include/gammaavm.h (revision 0)
+++ branches/starlight_1.1/include/gammaavm.h (revision 145)
@@ -0,0 +1,116 @@
+///////////////////////////////////////////////////////////////////////////
+//
+// Copyright 2010
+//
+// This file is part of starlight.
+//
+// starlight is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
+//
+// starlight is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with starlight. If not, see <http://www.gnu.org/licenses/>.
+//
+///////////////////////////////////////////////////////////////////////////
+//
+// File and Version Information:
+// $Rev:: $: revision of last commit
+// $Author:: $: author of last commit
+// $Date:: $: date of last commit
+//
+// Description:
+//
+//
+//
+///////////////////////////////////////////////////////////////////////////
+
+
+#ifndef GAMMAAVM_H
+#define GAMMAAVM_H
+
+
+#include <vector>
+
+#include "starlightconstants.h"
+#include "readinluminosity.h"
+#include "beambeamsystem.h"
+#include "randomgenerator.h"
+#include "eventchannel.h"
+#include "upcevent.h"
+#include "nBodyPhaseSpaceGen.h"
+
+
+class Gammaavectormeson : public eventChannel
+{
+
+ public:
+ Gammaavectormeson(inputParameters& input,beamBeamSystem& bbsystem);
+ virtual ~Gammaavectormeson();
+ starlightConstants::event produceEvent(int &ievent);
+
+ upcEvent produceEvent();
+
+ void pickwy(double &W, double &Y);
+ void momenta(double W,double Y,double &E,double &px,double &py,double &pz,int &tcheck);
+ double pTgamma(double E);
+ void vmpt(double W,double Y,double &E,double &px,double &py, double &pz,int &tcheck);
+ void twoBodyDecay(starlightConstants::particleTypeEnum &ipid,double E,double W,double px0,double py0,double pz0,double &px1,double &py1,double&pz1,double &px2,double &py2,double &pz2,int &iFbadevent);
+ bool fourBodyDecay(starlightConstants::particleTypeEnum& ipid, const double E, const double W, const double* p, lorentzVector* decayMoms, int& iFbadevent);
+ double getMass();
+ double getWidth();
+ virtual double getTheta(starlightConstants::particleTypeEnum ipid);
+ double getSpin();
+ double _VMbslope;
+ virtual double getDaughterMass(starlightConstants::particleTypeEnum &ipid);
+ double pseudoRapidity(double px, double py, double pz);
+
+ private:
+ starlightConstants::particleTypeEnum _VMpidtest;
+ int _VMnumw;
+ int _VMnumy;
+ int _VMinterferencemode;
+ int _VMCoherence;
+ int _ProductionMode;
+ double _VMCoherenceFactor;
+ double _VMgamma_em;
+ double _VMNPT;
+ double _VMWmax;
+ double _VMWmin;
+ double _VMYmax;
+ double _VMYmin;
+ double _mass;
+ double _width;
+ double _VMptmax;
+ double _VMdpt;
+ nBodyPhaseSpaceGen* _phaseSpaceGen;
+
+};
+
+class Gammaanarrowvm : public Gammaavectormeson
+{
+ public:
+ Gammaanarrowvm(inputParameters& input, beamBeamSystem& bbsystem);
+ virtual ~Gammaanarrowvm();
+};
+
+class Gammaawidevm : public Gammaavectormeson
+{
+ public:
+ Gammaawidevm(inputParameters& input, beamBeamSystem& bbsystem);
+ virtual ~Gammaawidevm();
+};
+
+class Gammaaincoherentvm : public Gammaavectormeson
+{
+ public:
+ Gammaaincoherentvm(inputParameters& input, beamBeamSystem& bbsystem);
+ virtual ~Gammaaincoherentvm();
+};
+
+#endif // GAMMAAVM_H
Property changes on: branches/starlight_1.1/include/gammaavm.h
___________________________________________________________________
Added: svn:keywords
## -0,0 +1 ##
+Rev Date Author
\ No newline at end of property
Index: branches/starlight_1.1/include/upcevent.h
===================================================================
--- branches/starlight_1.1/include/upcevent.h (revision 0)
+++ branches/starlight_1.1/include/upcevent.h (revision 145)
@@ -0,0 +1,75 @@
+///////////////////////////////////////////////////////////////////////////
+//
+// Copyright 2010
+//
+// This file is part of starlight.
+//
+// starlight is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
+//
+// starlight is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with starlight. If not, see <http://www.gnu.org/licenses/>.
+//
+///////////////////////////////////////////////////////////////////////////
+//
+// File and Version Information:
+// $Rev:: $: revision of last commit
+// $Author:: $: author of last commit
+// $Date:: $: date of last commit
+//
+// Description:
+//
+//
+//
+///////////////////////////////////////////////////////////////////////////
+
+
+#ifndef UPCEVENT_H
+#define UPCEVENT_H
+
+
+#include <vector>
+
+#include "starlightconstants.h"
+#include "starlightparticle.h"
+
+
+class upcEvent
+{
+ public:
+
+ upcEvent();
+ upcEvent(starlightConstants::event &ev);
+ ~upcEvent();
+
+// upcEvent & operator = (const starlightConstants::event &);
+
+ void addParticle(starlightParticle &part) { _particles.push_back(part); }
+ void addVertex(vector3 &vertex) { _vertices.push_back(vertex); }
+ void addGamma(float egamma) { _gammaEnergies.push_back(egamma); }
+
+ const std::vector<starlightParticle> * getParticles() const { return &_particles; }
+ const std::vector<vector3> * getVertices() const { return &_vertices; }
+ const std::vector<float> * getGammaEnergies() const { return &_gammaEnergies; }
+
+ upcEvent & operator=(const upcEvent&);
+ upcEvent & operator+(const upcEvent&);
+
+ void boost(double rapidity);
+ private:
+
+ int _NTracks;
+ std::vector<starlightParticle> _particles;
+ std::vector<vector3> _vertices;
+ std::vector<float> _gammaEnergies;
+};
+
+
+#endif // UPCEVENT_H
Property changes on: branches/starlight_1.1/include/upcevent.h
___________________________________________________________________
Added: svn:keywords
## -0,0 +1 ##
+Rev Date Author
\ No newline at end of property
Index: branches/starlight_1.1/include/reportingUtils.h
===================================================================
--- branches/starlight_1.1/include/reportingUtils.h (revision 0)
+++ branches/starlight_1.1/include/reportingUtils.h (revision 145)
@@ -0,0 +1,202 @@
+///////////////////////////////////////////////////////////////////////////
+//
+// Copyright 2010
+//
+// This file is part of starlight.
+//
+// starlight is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
+//
+// starlight is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with starlight. If not, see <http://www.gnu.org/licenses/>.
+//
+///////////////////////////////////////////////////////////////////////////
+//
+// File and Version Information:
+// $Rev:: $: revision of last commit
+// $Author:: $: author of last commit
+// $Date:: $: date of last commit
+//
+// Description:
+// some simple streams for reporting plus some stream operators
+// for common STL classes
+//
+//
+///////////////////////////////////////////////////////////////////////////
+
+
+#ifndef REPORTINGUTILS_H
+#define REPORTINGUTILS_H
+
+
+#include <iostream>
+#include <iomanip>
+#include <string>
+#include <vector>
+
+
+//////////////////////////////////////////////////////////////////////////////
+// macros for printing errors, warnings, and infos
+
+// cuts out block "className::methodName" from __PRETTY_FUNCTION__ output
+inline
+std::string
+getClassMethod__(std::string prettyFunction)
+{
+ size_t pos = prettyFunction.find("(");
+ if (pos == std::string::npos)
+ return prettyFunction; // something is not right
+ prettyFunction.erase(pos); // cut away signature
+ pos = prettyFunction.rfind(" ");
+ if (pos == std::string::npos)
+ return prettyFunction; // something is not right
+ prettyFunction.erase(0, pos + 1); // cut away return type
+ return prettyFunction;
+}
+
+#define printErr std::cerr << "!!! " << __PRETTY_FUNCTION__ << " [" << __FILE__ << ":" << __LINE__ << "]: error: " << std::flush
+#define printWarn std::cerr << "??? " << __PRETTY_FUNCTION__ << " [" << __FILE__ << ":" << __LINE__ << "]: warning: " << std::flush
+#define printInfo std::cout << ">>> " << getClassMethod__(__PRETTY_FUNCTION__) << "(): info: " << std::flush
+
+
+//////////////////////////////////////////////////////////////////////////////
+// functions to print version and compilation info
+
+#ifndef SVN_VERSION // SVN_VERSION set by Makefile
+#define SVN_VERSION "undefined"
+#endif
+inline std::string svnVersion() { return SVN_VERSION; }
+
+inline
+void
+printSvnVersion()
+{
+ const std::string ver = svnVersion();
+ if (ver == "")
+ printInfo << "subversion repository revision is unknown." << std::endl;
+ else
+ printInfo << "subversion repository revision is '" << ver << "'" << std::endl;
+}
+
+
+#ifndef CMAKE_SOURCE_DIR // CMAKE_SOURCE_DIR set by Makefile
+#define CMAKE_SOURCE_DIR "undefined"
+#endif
+inline std::string compileDir() { return CMAKE_SOURCE_DIR; }
+
+inline
+void
+printCompilerInfo()
+{
+ const std::string date = __DATE__;
+ const std::string time = __TIME__;
+ const std::string ver = __VERSION__;
+ const std::string dir = compileDir();
+ printInfo << "this executable was compiled in ";
+ if (dir != "")
+ std::cout << "'" << dir << "'";
+ else
+ std::cout << "unknown directory";
+ std::cout << " on " << date << " " << time << " by compiler " << ver << std::endl;
+}
+
+
+//////////////////////////////////////////////////////////////////////////////
+// simple stream operators for some STL classes
+
+template<typename T1, typename T2>
+inline
+std::ostream&
+operator << (std::ostream& out,
+ const std::pair<T1, T2>& pair)
+{
+ return out << "(" << pair.first << ", " << pair.second << ")";
+}
+
+
+template<typename T>
+inline
+std::ostream&
+operator << (std::ostream& out,
+ const std::vector<T>& vec)
+{
+ out << "{";
+ for (unsigned int i = 0; i < (vec.size() - 1); ++i)
+ out << "[" << i << "] = " << vec[i] << ", ";
+ return out << "[" << vec.size() - 1 << "] = " << vec[vec.size() - 1] << "}";
+}
+
+
+//////////////////////////////////////////////////////////////////////////////
+// various stuff
+
+// indicates progess by printing relative or absolute progress in regular intervals
+inline
+std::ostream&
+progressIndicator(const unsigned int currentPos,
+ const unsigned int nmbTotal,
+ const bool absolute = false,
+ const unsigned int fieldWidth = 3,
+ const unsigned int nmbSteps = 10,
+ std::ostream& out = std::cout)
+{
+ const double step = nmbTotal / (double)nmbSteps;
+ if ((int)(currentPos / step) - (int)((currentPos - 1) / step) != 0) {
+ if (absolute)
+ out << " " << std::setw(fieldWidth) << currentPos << " of " << nmbTotal << std::endl;
+ else
+ out << " " << std::setw(fieldWidth) << (int)(currentPos / step) * nmbSteps << " %" << std::endl;
+ }
+ return out;
+}
+
+
+// converts bool to "true"/"false" string
+inline
+std::string trueFalse(const bool val)
+{
+ if (val)
+ return "true";
+ else
+ return "false";
+}
+
+// converts bool to "yes"/"no" string
+inline
+std::string yesNo(const bool val)
+{
+ if (val)
+ return "yes";
+ else
+ return "no";
+}
+
+// converts bool to "on"/"off" string
+inline
+std::string onOff(const bool val)
+{
+ if (val)
+ return "on";
+ else
+ return "off";
+}
+
+// converts bool to "enabled"/"disabled" string
+inline
+std::string enDisabled(const bool val)
+{
+ if (val)
+ return "enabled";
+ else
+ return "disabled";
+}
+
+
+#endif // REPORTINGUTILS_H
Property changes on: branches/starlight_1.1/include/reportingUtils.h
___________________________________________________________________
Added: svn:keywords
## -0,0 +1 ##
+Rev Date Author
\ No newline at end of property
Index: branches/starlight_1.1/pythia6/pythiaInterface.h
===================================================================
--- branches/starlight_1.1/pythia6/pythiaInterface.h (revision 0)
+++ branches/starlight_1.1/pythia6/pythiaInterface.h (revision 145)
@@ -0,0 +1,71 @@
+//#include "Pythia.h"
+//using namespace Pythia8;
+
+//==========================================================================
+
+// Declare the Fortran subroutines that may be used.
+// This code section is generic.
+
+#include <string>
+
+extern "C" {
+ extern void pyinit_(const char*, const char*, const char*, double&, int, int, int);
+ extern void pyevnt_();
+ extern void pygive_(const char*, int);
+ extern void pyfram_(int&);
+ extern void pylist_(int&);
+ extern void pystat_(int&);
+ extern int pycomp_(int&);
+
+ extern struct
+ {
+ int n;
+ int npad;
+ int k[5][4000];
+ double p[5][4000];
+ double v[5][4000];
+ } pyjets_;
+ extern struct
+ {
+ int mdcy[3][500];
+ int mdme[2][8000];
+ double brat[8000];
+ int kfpd[5][8000];
+ } pydat3_;
+}
+
+
+class pythiaInterface {
+
+public:
+
+ // Give in a command to change a setting.
+ static void pygive(const std::string cmnd) {
+ const char* cstring = cmnd.c_str(); int len = cmnd.length();
+ pygive_(cstring, len);
+ }
+
+ // Initialize the generation for the given beam confiuration.
+ static void pyinit(const std::string frame, const std::string beam,
+ const std::string target, double wIn) {
+ const char* cframe = frame.c_str(); int lenframe = frame.length();
+ const char* cbeam = beam.c_str(); int lenbeam = beam.length();
+ const char* ctarget = target.c_str(); int lentarget = target.length();
+ pyinit_(cframe, cbeam, ctarget, wIn, lenframe, lenbeam, lentarget);
+ }
+
+ static void pyevnt() {pyevnt_();}
+
+ static void pyfram(int frame) { pyfram_(frame); }
+
+ // List the event at the process level.
+ static void pylist(int mode) {pylist_(mode);}
+
+ // Print statistics on the event generation process.
+ static void pystat(int mode) {pystat_(mode);}
+
+ // Get compressed code (KC) from PDG code
+ static int pycomp(int pdg) { return pycomp_(pdg);}
+
+
+};
Index: branches/starlight_1.1/src/spectrumprotonnucleus.cpp
===================================================================
--- branches/starlight_1.1/src/spectrumprotonnucleus.cpp (revision 0)
+++ branches/starlight_1.1/src/spectrumprotonnucleus.cpp (revision 145)
@@ -0,0 +1,66 @@
+/*
+ <one line to give the library's name and an idea of what it does.>
+ Copyright (C) 2011 Oystein Djuvsland <oystein.djuvsland@gmail.com>
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this library; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+*/
+
+#include <cmath>
+#include "spectrumprotonnucleus.h"
+#include "beambeamsystem.h"
+#include "beam.h"
+#include <iostream>
+
+spectrumProtonNucleus::spectrumProtonNucleus(beamBeamSystem *b) : spectrum(b)
+{
+ _bMin = 4.0;
+}
+
+bool spectrumProtonNucleus::generateBreakupProbabilities()
+{
+ int nbbins = _nBbins;
+
+ double b_min = _bMin;
+ //double b_max = _bMax;
+
+ // double binc = (log(b_max/b_min))/(double)nbbins;
+ double binc = exp((log(_bMax/_bMin))/(double)_nBbins);
+
+ double b = b_min;
+
+ _probOfBreakup.resize(nbbins);
+
+ for (int i = 0; i < nbbins; i++)
+ {
+ //double bimp = b;
+ //double rhad = 0;
+ _beamBeamSystem->beam1().Z() > 1 ? _probOfBreakup[i] = exp(-getNucleonNucleonSigma()*_beamBeamSystem->beam1().thickness(b)) :
+ _beamBeamSystem->beam2().Z() > 1 ? _probOfBreakup[i] = exp(-getNucleonNucleonSigma()*_beamBeamSystem->beam2().thickness(b)) :
+ b < 7.76 ? _probOfBreakup[i] = 0 : _probOfBreakup[i] = 1; // Should always be true though
+ //double hardCutoff = 0;
+
+ b = b*binc;
+ }
+
+ return true;
+}
+
+double spectrumProtonNucleus::getSigma(double ) const
+{
+ return 0.11;
+}
+
+
+
Index: branches/starlight_1.1/src/starlightparticlecodes.cpp
===================================================================
--- branches/starlight_1.1/src/starlightparticlecodes.cpp (revision 0)
+++ branches/starlight_1.1/src/starlightparticlecodes.cpp (revision 145)
@@ -0,0 +1,75 @@
+///////////////////////////////////////////////////////////////////////////
+//
+// Copyright 2010
+//
+// This file is part of starlight.
+//
+// starlight is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
+//
+// starlight is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with starlight. If not, see <http://www.gnu.org/licenses/>.
+//
+///////////////////////////////////////////////////////////////////////////
+//
+// File and Version Information:
+// $Rev:: $: revision of last commit
+// $Author:: $: author of last commit
+// $Date:: $: date of last commit
+//
+// Description:
+//
+//
+//
+///////////////////////////////////////////////////////////////////////////
+
+
+#include "starlightparticlecodes.h"
+
+
+int starlightParticleCodes::jetsetToGeant(int particleid)
+{
+//this function takes a jetset particle number and converts it to GEANT
+ int jtogx =0;
+ if(particleid==22) jtogx = 1;
+ if(particleid==-11) jtogx = 2;
+ if(particleid==11) jtogx = 3;
+ if(particleid==12||particleid==-12||particleid==14||particleid==-14||particleid==16||particleid==-16) jtogx = 4;
+ if(particleid==-13) jtogx = 5;
+ if(particleid==13) jtogx = 6;
+ if(particleid==111) jtogx = 7;
+ if(particleid==211) jtogx = 8;
+ if(particleid==-211) jtogx = 9;
+ if(particleid==130) jtogx = 10;
+ if(particleid==321) jtogx = 11;
+ if(particleid==-321) jtogx = 12;
+ if(particleid==2112) jtogx = 13;
+ if(particleid==2212) jtogx = 14;
+ if(particleid==-2212) jtogx = 15;
+ if(particleid==310) jtogx = 16;
+ if(particleid==-310) jtogx = 10;
+ if(particleid==221) jtogx = 17;
+ if(particleid==3122) jtogx = 18;
+ if(particleid==3222) jtogx = 19;
+ if(particleid==3212) jtogx = 20;
+ if(particleid==3112) jtogx = 21;
+ if(particleid==3322) jtogx = 22;
+ if(particleid==3312) jtogx = 23;
+ if(particleid==3334) jtogx = 24;
+ if(particleid==-2112) jtogx = 25;
+ if(particleid==-3122) jtogx = 26;
+ if(particleid==-3222) jtogx = 27;
+ if(particleid==-3212) jtogx = 28;
+ if(particleid==-3112) jtogx = 29;
+ if(particleid==-3322) jtogx = 30;
+ if(particleid==-3312) jtogx = 31;
+ if(particleid==-3334) jtogx = 32;
+ return jtogx;
+}
Property changes on: branches/starlight_1.1/src/starlightparticlecodes.cpp
___________________________________________________________________
Added: svn:keywords
## -0,0 +1 ##
+Rev Date Author
\ No newline at end of property
Index: branches/starlight_1.1/src/beam.cpp
===================================================================
--- branches/starlight_1.1/src/beam.cpp (revision 0)
+++ branches/starlight_1.1/src/beam.cpp (revision 145)
@@ -0,0 +1,89 @@
+///////////////////////////////////////////////////////////////////////////
+//
+// Copyright 2010
+//
+// This file is part of starlight.
+//
+// starlight is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
+//
+// starlight is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with starlight. If not, see <http://www.gnu.org/licenses/>.
+//
+///////////////////////////////////////////////////////////////////////////
+//
+// File and Version Information:
+// $Rev:: $: revision of last commit
+// $Author:: $: author of last commit
+// $Date:: $: date of last commit
+//
+// Description:
+//
+//
+//
+///////////////////////////////////////////////////////////////////////////
+
+
+#include <iostream>
+#include <fstream>
+#include <cmath>
+
+#include "starlightconstants.h"
+#include "inputParameters.h"
+#include "reportingUtils.h"
+#include "bessel.h"
+#include "beam.h"
+
+
+using namespace std;
+using namespace starlightConstants;
+
+
+//______________________________________________________________________________
+beam::beam(const int Z,
+ const int A,
+ const double bdeuteron,
+ const bool dAuCoherentProduction,
+ const inputParameters& input)
+ : nucleus(Z,
+ A,
+ bdeuteron,
+ dAuCoherentProduction)
+{
+ // setting needed inputparameters to protected variables
+ _beamLorentzGamma = input.beamLorentzGamma();
+}
+
+
+//______________________________________________________________________________
+beam::~beam()
+{ }
+
+
+//______________________________________________________________________________
+double beam::photonFlux(const double impactparameter,
+ const double photonEnergy) const
+{
+ // function for the calculation of the "photon density".
+ // photonFlux = number of photons / (energy * area)
+ // assume beta = 1 and gamma >> 1, i.e. neglect the (1 / gamma^2) * K_0(x) term
+
+ const double X
+ = (impactparameter * photonEnergy) / (_beamLorentzGamma * hbarc);
+ if (X <= 0)
+ printWarn << "X = " << X << endl;
+
+ const double factor1 = (double(Z() * Z()) * alpha) / (pi * pi);
+ const double factor2 = 1. / (photonEnergy * impactparameter * impactparameter);
+ const double bessel = bessel::dbesk1(X);
+ const double factor3 = X * X * bessel * bessel;
+
+ return factor1 * factor2 * factor3;
+}
Property changes on: branches/starlight_1.1/src/beam.cpp
___________________________________________________________________
Added: svn:keywords
## -0,0 +1 ##
+Rev Date Author
\ No newline at end of property
Index: branches/starlight_1.1/src/inputParser.cpp
===================================================================
--- branches/starlight_1.1/src/inputParser.cpp (revision 0)
+++ branches/starlight_1.1/src/inputParser.cpp (revision 145)
@@ -0,0 +1,303 @@
+///////////////////////////////////////////////////////////////////////////
+//
+// Copyright 2011
+//
+// This file is part of starlight.
+//
+// starlight is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
+//
+// starlight is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with starlight. If not, see <http://www.gnu.org/licenses/>.
+//
+///////////////////////////////////////////////////////////////////////////
+//
+// File and Version Information:
+// $Rev:: $: revision of last commit
+// $Author:: $: author of last commit
+// $Date:: $: date of last commit
+//
+// Description:
+//
+//
+//
+///////////////////////////////////////////////////////////////////////////
+
+
+#include "../include/inputParser.h"
+#include <fstream>
+#include <cstdlib>
+#include <algorithm>
+
+inputParser::inputParser()
+{
+}
+
+inputParser::~inputParser()
+{
+}
+
+int inputParser::parseFile(std::string filename)
+{
+
+ std::ifstream infile(filename.c_str());
+ if ((!infile) || (!infile.good()))
+ {
+ return -1;
+ }
+ std::string word;
+ std::string name;
+ std::string val;
+
+ std::map<std::string, _parameter<int> >::iterator intIt;
+ std::map<std::string, _parameter<unsigned int> >::iterator uIntIt;
+ std::map<std::string, _parameter<float> >::iterator floatIt;
+ std::map<std::string, _parameter<double> >::iterator doubleIt;
+ std::map<std::string, _parameter<bool> >::iterator boolIt;
+ std::map<std::string, _parameter<std::string> >::iterator stringIt;
+
+ int lineSize = 256;
+ char tmp[lineSize];
+ int nParameters = 0;
+ while (!infile.getline(tmp, lineSize).eof())
+ {
+
+ std::string line(tmp);
+
+ // Check if there is commented out stuff...
+ size_t pos = line.find_first_of("#");
+
+ // Cut the comment out of the line
+ if (pos != line.npos) line.erase(pos, line.find_first_of('\n'));
+
+ // Find the required equal sign and split the string into name and value
+ size_t eqPos = line.find("=");
+ std::string whitespaces (" \t\f\v\n\r");
+
+ name = "";
+ val = "";
+
+ if (eqPos != line.npos)
+ {
+ name = line.substr(0, eqPos);
+ name.erase(name.find_last_not_of(whitespaces)+1);
+ val = line.substr(eqPos+1);
+ val.erase(0, val.find_first_not_of(whitespaces));
+ }
+
+ if (name.length() > 0 && val.length() > 0)
+ {
+ intIt = _intParameters.find(name);
+ if (intIt != _intParameters.end())
+ {
+ intIt->second._found = true;
+ *(intIt->second._val) = atoi(val.c_str());
+ nParameters++;
+ }
+ uIntIt = _uintParameters.find(name);
+ if (uIntIt != _uintParameters.end())
+ {
+ uIntIt->second._found = true;
+ *(uIntIt->second._val) = atoi(val.c_str());
+ nParameters++;
+ }
+ floatIt = _floatParameters.find(name);
+ if (floatIt != _floatParameters.end())
+ {
+ floatIt->second._found = true;
+ *(floatIt->second._val) = atof(val.c_str());
+ nParameters++;
+ }
+ doubleIt = _doubleParameters.find(name);
+ if (doubleIt != _doubleParameters.end())
+ {
+ doubleIt->second._found = true;
+ *(doubleIt->second._val) = atof(val.c_str());
+ nParameters++;
+ }
+ boolIt = _boolParameters.find(name);
+ if (boolIt != _boolParameters.end())
+ {
+ boolIt->second._found = true;
+ *(boolIt->second._val) = atoi(val.c_str());
+ nParameters++;
+ }
+ stringIt = _stringParameters.find(name);
+ if (stringIt != _stringParameters.end())
+ {
+ stringIt->second._found = true;
+ *(stringIt->second._val) = val;
+ nParameters++;
+ }
+
+ }
+
+ }
+ infile.close();
+ return 0;
+
+}
+
+void inputParser::addIntParameter(std::string name, int *var, bool required)
+{
+ _parameter<int> par(name, var, required);
+ _intParameters.insert(std::pair<std::string, _parameter<int> >(name, par));
+}
+
+void inputParser::addUintParameter(std::string name, unsigned int *var, bool required)
+{
+ _parameter<unsigned int> par(name, var, required);
+ _uintParameters.insert(std::pair<std::string, _parameter<unsigned int> >(name, par));
+}
+
+void inputParser::addFloatParameter(std::string name, float *var, bool required)
+{
+ _parameter<float> par(name, var, required);
+ _floatParameters.insert(std::pair<std::string, _parameter<float> >(name, par));
+}
+
+void inputParser::addDoubleParameter(std::string name, double *var, bool required)
+{
+ _parameter<double> par(name, var, required);
+ _doubleParameters.insert(std::pair<std::string, _parameter<double> >(name, par));
+}
+
+void inputParser::addBoolParameter(std::string name, bool *var, bool required)
+{
+ _parameter<bool> par(name, var, required);
+ _boolParameters.insert(std::pair<std::string, _parameter<bool> >(name, par));
+}
+
+void inputParser::addStringParameter(std::string name, std::string *var, bool required)
+{
+ _parameter<std::string> par(name, var, required);
+ _stringParameters.insert(std::pair<std::string, _parameter<std::string> >(name, par));
+}
+
+void inputParser::printParameterInfo(std::ostream &out)
+{
+
+ std::map<std::string, _parameter<int> >::iterator intIt;
+ std::map<std::string, _parameter<unsigned int> >::iterator uIntIt;
+ std::map<std::string, _parameter<float> >::iterator floatIt;
+ std::map<std::string, _parameter<double> >::iterator doubleIt;
+ std::map<std::string, _parameter<bool> >::iterator boolIt;
+ out << "#########################################" << std::endl;
+ out << "PARAMETER:\t\tVALUE:" << std::endl;
+ out << "#########################################" << std::endl;
+ out << "-----------------------------------------" << std::endl;
+ for (intIt = _intParameters.begin(); intIt != _intParameters.end(); ++intIt)
+ {
+ intIt->second.printParameterInfo();
+ out << "-----------------------------------------" << std::endl;
+ }
+ for (uIntIt = _uintParameters.begin(); uIntIt != _uintParameters.end(); ++uIntIt)
+ {
+ uIntIt->second.printParameterInfo();
+ out << "-----------------------------------------" << std::endl;
+ }
+ for (floatIt = _floatParameters.begin(); floatIt != _floatParameters.end(); ++floatIt)
+ {
+ floatIt->second.printParameterInfo();
+ out << "-----------------------------------------" << std::endl;
+ }
+ for (doubleIt = _doubleParameters.begin(); doubleIt != _doubleParameters.end(); ++doubleIt)
+ {
+ doubleIt->second.printParameterInfo();
+ out << "-----------------------------------------" << std::endl;
+ }
+ for (boolIt = _boolParameters.begin(); boolIt != _boolParameters.end(); ++boolIt)
+ {
+ boolIt->second.printParameterInfo();
+ out << "-----------------------------------------" << std::endl;
+ }
+ out << "#########################################" << std::endl;
+}
+
+bool inputParser::validateParameters(std::ostream& warnOut, std::ostream& errOut)
+{
+
+ int nNonCriticalMissing = 0;
+ int nCriticalMissing = 0;
+
+ std::map<std::string, _parameter<int> >::iterator intIt;
+ std::map<std::string, _parameter<float> >::iterator floatIt;
+ std::map<std::string, _parameter<double> >::iterator doubleIt;
+ std::map<std::string, _parameter<bool> >::iterator boolIt;
+
+ for (intIt = _intParameters.begin(); intIt != _intParameters.end(); ++intIt)
+ {
+ if (!intIt->second._found)
+ {
+ if (intIt->second._required)
+ {
+ errOut << "Could not find parameter: " << intIt->second._name << " which is required. Please specify this parameter in the config file!" << std::endl;
+ nCriticalMissing++;
+ }
+ else
+ {
+ warnOut << "Could not find parameter: " << intIt->second._name << ", but it is not required, using default value: " << *intIt->second._val << std::endl;
+ nNonCriticalMissing++;
+ }
+ }
+ }
+ for (floatIt = _floatParameters.begin(); floatIt != _floatParameters.end(); ++floatIt)
+ {
+ if (!floatIt->second._found)
+ {
+ if (floatIt->second._required)
+ {
+ errOut << "Could not find parameter: " << floatIt->second._name << " which is required. Please specify this parameter in the config file!" << std::endl;
+ nCriticalMissing++;
+ }
+ else
+ {
+ warnOut << "Could not find parameter: " << floatIt->second._name << ", but it is not required, using default value: " << *floatIt->second._val << std::endl;
+ nNonCriticalMissing++;
+ }
+ }
+ }
+ for (doubleIt = _doubleParameters.begin(); doubleIt != _doubleParameters.end(); ++doubleIt)
+ {
+ if (!doubleIt->second._found)
+ {
+ if (doubleIt->second._required)
+ {
+ errOut << "Could not find parameter: " << doubleIt->second._name << " which is required. Please specify this parameter in the config file!" << std::endl;
+ nCriticalMissing++;
+ }
+ else
+ {
+ warnOut << "Could not find parameter: " << doubleIt->second._name << ", but it is not required, using default value: " << *doubleIt->second._val << std::endl;
+ nNonCriticalMissing++;
+ }
+ }
+ }
+ for (boolIt = _boolParameters.begin(); boolIt != _boolParameters.end(); ++boolIt)
+ {
+ if (!boolIt->second._found)
+ {
+ if (boolIt->second._required)
+ {
+ errOut << "Could not find parameter: " << boolIt->second._name << " which is required. Please specify this parameter in the config file!" << std::endl;
+ nCriticalMissing++;
+ }
+ else
+ {
+ warnOut << "Could not find parameter: " << boolIt->second._name << ", but it is not required, using default value: " << *boolIt->second._val << std::endl;
+ nNonCriticalMissing++;
+ }
+ }
+ }
+ if(nCriticalMissing > 0) return false;
+ return true;
+}
+
+
Property changes on: branches/starlight_1.1/src/inputParser.cpp
___________________________________________________________________
Added: svn:keywords
## -0,0 +1 ##
+Rev Date Author
\ No newline at end of property
Index: branches/starlight_1.1/src/bessel.cpp
===================================================================
--- branches/starlight_1.1/src/bessel.cpp (revision 0)
+++ branches/starlight_1.1/src/bessel.cpp (revision 145)
@@ -0,0 +1,176 @@
+///////////////////////////////////////////////////////////////////////////
+//
+// Copyright 2010
+//
+// This file is part of starlight.
+//
+// starlight is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
+//
+// starlight is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with starlight. If not, see <http://www.gnu.org/licenses/>.
+//
+///////////////////////////////////////////////////////////////////////////
+//
+// File and Version Information:
+// $Rev:: $: revision of last commit
+// $Author:: $: author of last commit
+// $Date:: $: date of last commit
+//
+// Description:
+// Bessel functions taken from ROOT
+//
+//
+///////////////////////////////////////////////////////////////////////////
+
+
+#include <iostream>
+#include <fstream>
+#include <cmath>
+
+#include "bessel.h"
+
+
+using namespace std;
+
+
+//______________________________________________________________________________
+double bessel::besI0(double x)
+{
+ //FROM ROOT...
+ // Parameters of the polynomial approximation
+ const double p1=1.0, p2=3.5156229, p3=3.0899424,
+ p4=1.2067492, p5=0.2659732, p6=3.60768e-2, p7=4.5813e-3;
+
+ const double q1= 0.39894228, q2= 1.328592e-2, q3= 2.25319e-3,
+ q4=-1.57565e-3, q5= 9.16281e-3, q6=-2.057706e-2,
+ q7= 2.635537e-2, q8=-1.647633e-2, q9= 3.92377e-3;
+
+ const double k1 = 3.75;
+ double ax = fabs(x);
+
+ double y=0., result=0.;
+
+ if (ax < k1) {
+ double xx = x/k1;
+ y = xx*xx;
+ result = p1+y*(p2+y*(p3+y*(p4+y*(p5+y*(p6+y*p7)))));
+ } else {
+ y = k1/ax;
+ result = (exp(ax)/sqrt(ax))*(q1+y*(q2+y*(q3+y*(q4+y*(q5+y*(q6+y*(q7+y*(q8+y*q9))))))));
+ }
+ return result;
+}
+
+
+//______________________________________________________________________________
+double bessel::dbesk0(double x)
+{
+ // Compute the modified Bessel function K_0(x) for positive real x. //should be k0?
+ //
+ // M.Abramowitz and I.A.Stegun, Handbook of Mathematical Functions,
+ // Applied Mathematics Series vol. 55 (1964), Washington.
+ //
+ //--- NvE 12-mar-2000 UU-SAP Utrecht
+
+ // Parameters of the polynomial approximation
+ const double p1= -0.57721566, p2= 0.42278420, p3=0.23069756,
+ p4=3.488590e-2, p5=2.62698e-3, p6=1.0750e-4, p7=7.4e-6;
+
+ const double q1= 1.25331414, q2= -7.832358e-2, q3=2.189568e-2,
+ q4= -1.062446e-2, q5=5.87872e-3, q6= -2.51540e-3, q7= 5.3208e-4;
+
+ if (x <= 0) {
+ cout << "BesselK0 *K0* Invalid argument x = " << x << endl; //Should be k0?
+ return 0;
+ }
+
+ double y=0.,result=0.;
+
+ if (x <= 2) {
+ y = x*x/4.;
+ result = (-log(x/2.)*bessel::besI0(x))+(p1+y*(p2+y*(p3+y*(p4+y*(p5+y*(p6+y*p7))))));
+ } else {
+ y = 2./x;
+ result = (exp(-x)/sqrt(x))*(q1+y*(q2+y*(q3+y*(q4+y*(q5+y*(q6+y*q7))))));
+ }
+ return result;
+}
+
+
+//______________________________________________________________________________
+double bessel::besI1(double x)
+{
+ // Compute the modified Bessel function I_1(x) for any real x.
+ //
+ // M.Abramowitz and I.A.Stegun, Handbook of Mathematical Functions,
+ // Applied Mathematics Series vol. 55 (1964), Washington.
+ //
+ //--- NvE 12-mar-2000 UU-SAP Utrecht
+
+ // Parameters of the polynomial approximation
+ const double p1=0.5, p2=0.87890594, p3=0.51498869,
+ p4=0.15084934, p5=2.658733e-2, p6=3.01532e-3, p7=3.2411e-4;
+
+ const double q1= 0.39894228, q2=-3.988024e-2, q3=-3.62018e-3,
+ q4= 1.63801e-3, q5=-1.031555e-2, q6= 2.282967e-2,
+ q7=-2.895312e-2, q8= 1.787654e-2, q9=-4.20059e-3;
+
+ const double k1 = 3.75;
+ double ax = fabs(x);
+
+ double y=0., result=0.;
+
+ if (ax < k1) {
+ double xx = x/k1;
+ y = xx*xx;
+ result = x*(p1+y*(p2+y*(p3+y*(p4+y*(p5+y*(p6+y*p7))))));
+ } else {
+ y = k1/ax;
+ result = (exp(ax)/sqrt(ax))*(q1+y*(q2+y*(q3+y*(q4+y*(q5+y*(q6+y*(q7+y*(q8+y*q9))))))));
+ if (x < 0) result = -result;
+ }
+ return result;
+}
+
+
+//______________________________________________________________________________
+double bessel::dbesk1(double x)
+{
+ // Compute the modified Bessel function K_1(x) for positive real x.
+ //
+ // M.Abramowitz and I.A.Stegun, Handbook of Mathematical Functions,
+ // Applied Mathematics Series vol. 55 (1964), Washington.
+ //
+ //--- NvE 12-mar-2000 UU-SAP Utrecht
+
+ // Parameters of the polynomial approximation
+ const double p1= 1., p2= 0.15443144, p3=-0.67278579,
+ p4=-0.18156897, p5=-1.919402e-2, p6=-1.10404e-3, p7=-4.686e-5;
+
+ const double q1= 1.25331414, q2= 0.23498619, q3=-3.655620e-2,
+ q4= 1.504268e-2, q5=-7.80353e-3, q6= 3.25614e-3, q7=-6.8245e-4;
+
+ if (x <= 0) {
+ cout << "bessel:dbesk1 *K1* Invalid argument x = " << x << endl;
+ return 0;
+ }
+
+ double y=0.,result=0.;
+
+ if (x <= 2) {
+ y = x*x/4.;
+ result = (log(x/2.)*bessel::besI1(x))+(1./x)*(p1+y*(p2+y*(p3+y*(p4+y*(p5+y*(p6+y*p7))))));
+ } else {
+ y = 2./x;
+ result = (exp(-x)/sqrt(x))*(q1+y*(q2+y*(q3+y*(q4+y*(q5+y*(q6+y*q7))))));
+ }
+ return result;
+}
Property changes on: branches/starlight_1.1/src/bessel.cpp
___________________________________________________________________
Added: svn:keywords
## -0,0 +1 ##
+Rev Date Author
\ No newline at end of property
Index: branches/starlight_1.1/src/starlightpythia.cpp
===================================================================
--- branches/starlight_1.1/src/starlightpythia.cpp (revision 0)
+++ branches/starlight_1.1/src/starlightpythia.cpp (revision 145)
@@ -0,0 +1,140 @@
+/*
+ <one line to give the library's name and an idea of what it does.>
+ Copyright (C) 2011 Oystein Djuvsland <oystein.djuvsland@gmail.com>
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this library; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+*/
+
+#include <cstdio>
+#include <iostream>
+#include "starlightpythia.h"
+#include "pythiaInterface.h"
+#include "spectrumprotonnucleus.h"
+#include <cmath>
+#include <sstream>
+
+starlightPythia::starlightPythia(inputParameters &input, beamBeamSystem &bbs) : eventChannel(input, bbs)
+ ,_spectrum(0)
+ ,_doDoubleEvent(false)
+ ,_minGammaEnergy(input.minGammaEnergy())
+ ,_maxGammaEnergy(input.maxGammaEnergy())
+ ,_fullEventRecord(false)
+{
+}
+
+starlightPythia::~starlightPythia()
+{
+
+}
+
+int starlightPythia::init(std::string pythiaParams, bool fullEventRecord)
+{
+ _fullEventRecord = fullEventRecord;
+ _spectrum = new spectrumProtonNucleus(&_bbs);
+ //_spectrum = new Spectrum(&bbs);
+ _spectrum->setRandomGenerator(&_randy);
+
+ _spectrum->setMinGammaEnergy(_minGammaEnergy);
+ _spectrum->setMaxGammaEnergy(_maxGammaEnergy);
+
+ if(!_doDoubleEvent)
+ {
+ _spectrum->generateKsingle();
+ }
+ else
+ {
+ _spectrum->generateKdouble();
+ }
+
+ // Set to run with varying energies
+ pythiaInterface::pygive("mstp(171)=1"); // Varying energies
+ pythiaInterface::pygive("mstp(172)=1"); // Set the energy before generation
+
+ std::stringstream ss(pythiaParams);
+ std::string p;
+ while(std::getline(ss, p, ';'))
+ {
+ if(p.size()>1)
+ {
+ pythiaInterface::pygive(p.c_str());
+ }
+ }
+ //pythiaInterface::pygive("mstp(12)=0");
+ //pythiaInterface::pygive("mstj(21)=0"); // Disable decays of particles
+
+ //pythiaInterface::pygive("parp(2)=1.0"); // Cut off c.m. energy (GeV)
+
+ pythiaInterface::pyinit("FIXT", "gamma", "p", _maxGammaEnergy); // Fixed target, beam, target, beam momentum (GeV/c)
+
+ return 0;
+}
+
+upcEvent starlightPythia::produceEvent()
+{
+ upcEvent event;
+
+
+
+ if (!_doDoubleEvent)
+ {
+ //int zdirection = (Randy.Rndom()) < 0.5 ? -1 : 1;
+ double gammaE = 0;
+ do
+ {
+ gammaE = _spectrum->drawKsingle();
+ } while(isnan(gammaE));
+ event.addGamma(gammaE);
+
+ char opt[32];
+ std::sprintf(opt, "parp(171)=%f", gammaE/_maxGammaEnergy);
+ pythiaInterface::pygive(opt); // Set the energy of the photon beam (gammaE/1000 * 1000.0);
+ pythiaInterface::pyevnt(); // Generate event
+// pythiaInterface::pyfram(2); // go to CMS
+
+ int zdirection = (_bbs.beam1().Z()==1 ? 1 : -1);
+ double boost = acosh(_bbs.beamLorentzGamma())*zdirection;
+
+ vector3 boostVector(0, 0, tanh(boost));
+
+ for(int idx = 0; idx < pyjets_.n; idx++)
+ {
+// if(std::abs(pyjets_.k[1][idx]) <= 6) std::cout << "Quark: " << pyjets_.k[1][idx] << ", status: " << pyjets_.k[0][idx] << std::endl;
+ if(pyjets_.k[0][idx] > 10 && _fullEventRecord==false) continue;
+ int pdgCode = pyjets_.k[1][idx];
+ int charge = 0;
+ if( pdgCode == 12 || pdgCode == 14 || pdgCode == 16 || pdgCode == 22 || pdgCode == 111 || pdgCode == 130 || pdgCode == 321 || pdgCode == 2112)
+ {
+ charge = 0;
+ }
+ else
+ {
+ charge = (pdgCode > 0) - (pdgCode < 0);
+ }
+
+ starlightParticle particle(pyjets_.p[0][idx], pyjets_.p[1][idx], -zdirection*pyjets_.p[2][idx], pyjets_.p[3][idx], pyjets_.p[4][idx], pyjets_.k[1][idx], charge);
+ if(_fullEventRecord)
+ {
+ particle.setParent(pyjets_.k[2][idx]);
+ particle.setFirstDaughter(pyjets_.k[3][idx]);
+ particle.setLastDaughter(pyjets_.k[4][idx]);
+ particle.setStatus(pyjets_.k[0][idx]);
+ }
+ particle.Boost(boostVector);
+ event.addParticle(particle);
+ }
+
+ }
+ return event;
+}
\ No newline at end of file
Index: branches/starlight_1.1/src/lorentzvector.cpp
===================================================================
--- branches/starlight_1.1/src/lorentzvector.cpp (revision 0)
+++ branches/starlight_1.1/src/lorentzvector.cpp (revision 145)
@@ -0,0 +1,57 @@
+///////////////////////////////////////////////////////////////////////////
+//
+// Copyright 2010
+//
+// This file is part of starlight.
+//
+// starlight is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
+//
+// starlight is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with starlight. If not, see <http://www.gnu.org/licenses/>.
+//
+///////////////////////////////////////////////////////////////////////////
+//
+// File and Version Information:
+// $Rev:: $: revision of last commit
+// $Author:: $: author of last commit
+// $Date:: $: date of last commit
+//
+// Description:
+//
+//
+//
+///////////////////////////////////////////////////////////////////////////
+
+
+#include "lorentzvector.h"
+
+
+lorentzVector::lorentzVector() :
+fSpaceVec()
+,fTime(0)
+{ }
+
+
+lorentzVector::lorentzVector(double x, double y, double z, double t) :
+fSpaceVec(x, y, z)
+,fTime(t)
+{ }
+
+
+lorentzVector::~lorentzVector()
+{ }
+
+
+void lorentzVector::SetXYZT(double x, double y, double z, double t)
+{
+ fSpaceVec.SetVector(x, y, z);
+ fTime = t;
+}
Property changes on: branches/starlight_1.1/src/lorentzvector.cpp
___________________________________________________________________
Added: svn:keywords
## -0,0 +1 ##
+Rev Date Author
\ No newline at end of property
Index: branches/starlight_1.1/src/incoherentPhotonNucleusLuminosity.cpp
===================================================================
--- branches/starlight_1.1/src/incoherentPhotonNucleusLuminosity.cpp (revision 0)
+++ branches/starlight_1.1/src/incoherentPhotonNucleusLuminosity.cpp (revision 145)
@@ -0,0 +1,214 @@
+///////////////////////////////////////////////////////////////////////////
+//
+// Copyright 2010
+//
+// This file is part of starlight.
+//
+// starlight is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
+//
+// starlight is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with starlight. If not, see <http://www.gnu.org/licenses/>.
+//
+///////////////////////////////////////////////////////////////////////////
+//
+// File and Version Information:
+// $Rev:: 45 $: revision of last commit
+// $Author:: bgrube $: author of last commit
+// $Date:: 2011-02-27 20:52:35 +0100 #$: date of last commit
+//
+// Description:
+//
+//
+//
+///////////////////////////////////////////////////////////////////////////
+
+
+#include <iostream>
+#include <fstream>
+#include <cmath>
+
+#include "inputParameters.h"
+#include "beambeamsystem.h"
+#include "beam.h"
+#include "starlightconstants.h"
+#include "nucleus.h"
+#include "bessel.h"
+#include "incoherentPhotonNucleusLuminosity.h"
+
+
+using namespace std;
+
+
+//______________________________________________________________________________
+incoherentPhotonNucleusLuminosity::incoherentPhotonNucleusLuminosity(inputParameters& input, beamBeamSystem& bbsystem)
+ : photonNucleusCrossSection(input, bbsystem), _inputgammaa(input)
+{
+ cout <<"Creating Luminosity Tables for incoherent vector meson production."<<endl;
+ incoherentPhotonNucleusDifferentialLuminosity();
+ cout <<"Luminosity Tables created."<<endl;
+}
+
+
+//______________________________________________________________________________
+incoherentPhotonNucleusLuminosity::~incoherentPhotonNucleusLuminosity()
+{ }
+
+
+//______________________________________________________________________________
+void incoherentPhotonNucleusLuminosity::incoherentPhotonNucleusDifferentialLuminosity()
+{
+ // double Av,Wgp,cs,cvma;
+ double W,dW,dY;
+ double Egamma,Y;
+ // double t,tmin,tmax;
+ double testint,dndWdY;
+ // double ax,bx;
+ double C;
+
+ ofstream wylumfile;
+ wylumfile.precision(15);
+
+ double bwnorm,Eth;
+
+ dW = (_inputgammaa.maxW()-_inputgammaa.minW())/_inputgammaa.nmbWBins();
+ dY = (_inputgammaa.maxRapidity()-(-1.0)*_inputgammaa.maxRapidity())/_inputgammaa.nmbRapidityBins();
+
+ // Write the values of W used in the calculation to slight.txt.
+ wylumfile.open("slight.txt");
+ wylumfile << getbbs().beam1().Z() <<endl;
+ wylumfile << getbbs().beam1().A() <<endl;
+ wylumfile << getbbs().beam2().Z() <<endl;
+ wylumfile << getbbs().beam2().A() <<endl;
+ wylumfile << _inputgammaa.beamLorentzGamma() <<endl;
+ wylumfile << _inputgammaa.maxW() <<endl;
+ wylumfile << _inputgammaa.minW() <<endl;
+ wylumfile << _inputgammaa.nmbWBins() <<endl;
+ wylumfile << _inputgammaa.maxRapidity() <<endl;
+ wylumfile << _inputgammaa.nmbRapidityBins() <<endl;
+ wylumfile << _inputgammaa.productionMode() <<endl;
+ wylumfile << _inputgammaa.beamBreakupMode() <<endl;
+ wylumfile << _inputgammaa.interferenceEnabled() <<endl;
+ wylumfile << _inputgammaa.interferenceStrength() <<endl;
+ wylumfile << _inputgammaa.coherentProduction() <<endl;
+ wylumfile << _inputgammaa.incoherentFactor() <<endl;
+ wylumfile << _inputgammaa.deuteronSlopePar() <<endl;
+ wylumfile << _inputgammaa.maxPtInterference() <<endl;
+ wylumfile << _inputgammaa.nmbPtBinsInterference() <<endl;
+
+ // Normalize the Breit-Wigner Distribution and write values of W to slight.txt
+ testint=0.0;
+ //Grabbing default value for C in the breit-wigner calculation
+ C=getDefaultC();
+ for(unsigned int i = 0; i <= _inputgammaa.nmbWBins() - 1; ++i) {
+ W = _inputgammaa.minW() + double(i)*dW + 0.5*dW;
+ testint = testint + breitWigner(W,C)*dW;
+ wylumfile << W << endl;
+ }
+ bwnorm = 1./testint;
+
+ // Write the values of Y used in the calculation to slight.txt.
+ for(unsigned int i = 0; i <= _inputgammaa.nmbRapidityBins() - 1; ++i) {
+ Y = -1.0*_inputgammaa.maxRapidity() + double(i)*dY + 0.5*dY;
+ wylumfile << Y << endl;
+ }
+
+ // Eth=0.5*(((_inputgammaa.minW()+starlightConstants::protonMass)*(_inputgammaa.minW()
+ // +starlightConstants::protonMass)-starlightConstants::protonMass*starlightConstants::protonMass)/
+ // (Ep + sqrt(Ep*Ep-starlightConstants::protonMass*starlightConstants::protonMass)));
+
+ for(unsigned int i = 0; i <= _inputgammaa.nmbWBins() - 1; ++i) {
+
+ W = _inputgammaa.minW() + double(i)*dW + 0.5*dW;
+
+ double Ep = _inputgammaa.getProtonEnergy();
+
+ Eth=0.5*(((W+starlightConstants::protonMass)*(W+starlightConstants::protonMass)-starlightConstants::protonMass*starlightConstants::protonMass)/
+ (Ep + sqrt(Ep*Ep-starlightConstants::protonMass*starlightConstants::protonMass)));
+
+ for(unsigned int j = 0; j <= _inputgammaa.nmbRapidityBins() - 1; ++j) {
+
+ Y = -1.0*_inputgammaa.maxRapidity() + double(j)*dY + 0.5*dY;
+
+ int A_1 = getbbs().beam1().A();
+ int A_2 = getbbs().beam2().A();
+ if( A_2 == 1 && A_1 != 1 ){
+ // pA, first beam is the nucleus
+ Egamma = 0.5*W*exp(Y);
+ } else if( A_1 ==1 && A_2 != 1){
+ // pA, second beam is the nucleus
+ Egamma = 0.5*W*exp(-Y);
+ } else {
+ Egamma = 0.5*W*exp(Y);
+ }
+
+ dndWdY = 0.;
+
+ if(Egamma > Eth){
+ if(Egamma > maxPhotonEnergy())Egamma = maxPhotonEnergy();
+ double Wgp = sqrt(2.*Egamma*(Ep+sqrt(Ep*Ep-starlightConstants::protonMass*
+ starlightConstants::protonMass))+starlightConstants::protonMass*starlightConstants::protonMass);
+
+ double localsig = sigmagp(Wgp);
+ // int localz = 0;
+ // double localbmin = 0;
+ if( A_1 == 1 && A_2 != 1 ){
+ // localbmin = getbbs().beam2().nuclearRadius() + 0.7;
+ // localz = getbbs().beam2().Z();
+ // dndWdY = Egamma*localz*localz*nepoint(Egamma,localbmin)*localsig*breitWigner(W,bwnorm);
+ dndWdY = Egamma*photonFlux(Egamma)*localsig*breitWigner(W,bwnorm);
+ }else if (A_2 ==1 && A_1 !=1){
+ // localbmin = getbbs().beam1().nuclearRadius() + 0.7;
+ // localz = getbbs().beam1().Z();
+ // dndWdY = Egamma*localz*localz*nepoint(Egamma,localbmin)*localsig*breitWigner(W,bwnorm);
+ dndWdY = Egamma*photonFlux(Egamma)*localsig*breitWigner(W,bwnorm);
+ }else{
+ double csVN = sigma_N(Wgp);
+ double csVA = sigma_A(csVN);
+ double csgA= (csVA/csVN)*sigmagp(Wgp);
+ dndWdY = Egamma*photonFlux(Egamma)*csgA*breitWigner(W,bwnorm);
+ }
+ }
+
+ wylumfile << dndWdY << endl;
+ }
+ }
+
+ wylumfile.close();
+
+ wylumfile.open("slight.txt",ios::app);
+ cout << "bwnorm: "<< bwnorm <<endl;
+ wylumfile << bwnorm << endl;
+ wylumfile.close();
+}
+
+
+//______________________________________________________________________________
+double incoherentPhotonNucleusLuminosity::nofe(double Egamma, double bimp)
+{
+ //Function for the calculation of the "photon density".
+ //nofe=numberofgammas/(energy*area)
+ //Assume beta=1.0 and gamma>>1, i.e. neglect the (1/gamma^2)*K0(x) term
+
+ double X=0.,nofex=0.,factor1=0.,factor2=0.,factor3=0.;
+
+ X = (bimp*Egamma)/(_inputgammaa.beamLorentzGamma()*starlightConstants::hbarc);
+
+ if( X <= 0.0)
+ cout<<"In nofe, X= "<<X<<endl;
+
+ factor1 = (double(getbbs().beam1().Z()*getbbs().beam1().Z())
+ *starlightConstants::alpha)/(starlightConstants::pi*starlightConstants::pi);
+
+ factor2 = 1./(Egamma*bimp*bimp);
+ factor3 = X*X*(bessel::dbesk1(X))*(bessel::dbesk1(X));
+ nofex = factor1*factor2*factor3;
+ return nofex;
+}
Index: branches/starlight_1.1/src/starlightparticle.cpp
===================================================================
--- branches/starlight_1.1/src/starlightparticle.cpp (revision 0)
+++ branches/starlight_1.1/src/starlightparticle.cpp (revision 145)
@@ -0,0 +1,68 @@
+///////////////////////////////////////////////////////////////////////////
+//
+// Copyright 2010
+//
+// This file is part of starlight.
+//
+// starlight is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
+//
+// starlight is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with starlight. If not, see <http://www.gnu.org/licenses/>.
+//
+///////////////////////////////////////////////////////////////////////////
+//
+// File and Version Information:
+// $Rev:: $: revision of last commit
+// $Author:: $: author of last commit
+// $Date:: $: date of last commit
+//
+// Description:
+//
+//
+//
+///////////////////////////////////////////////////////////////////////////
+
+
+#include "starlightparticle.h"
+
+
+starlightParticle::starlightParticle() :
+ lorentzVector()
+ ,_vertex(0,0,0,0)
+ ,_pdgCode(0)
+ ,_charge(-999)
+ ,_mass(-1)
+ ,_firstParent(0)
+ ,_lastParent(0)
+ ,_firstDaughter(0)
+ ,_lastDaughter(0)
+ ,_status(0)
+{ }
+
+
+starlightParticle::starlightParticle(double px, double py, double pz, double e, double mass, int pdgCode, short charge,
+ double vx, double vy, double vz, double vt,
+ int firstParent, int lastParent, int firstDaughter, int lastDaughter, int status) :
+lorentzVector(px, py, pz, e)
+,_vertex(vx,vy,vz,vt)
+,_pdgCode(pdgCode)
+,_charge(charge)
+,_mass(mass)
+,_firstParent(firstParent)
+,_lastParent(lastParent)
+,_firstDaughter(firstDaughter)
+,_lastDaughter(lastDaughter)
+,_status(status)
+{ }
+
+
+starlightParticle::~starlightParticle()
+{ }
Property changes on: branches/starlight_1.1/src/starlightparticle.cpp
___________________________________________________________________
Added: svn:keywords
## -0,0 +1 ##
+Rev Date Author
\ No newline at end of property
Index: branches/starlight_1.1/src/vector3.cpp
===================================================================
--- branches/starlight_1.1/src/vector3.cpp (revision 0)
+++ branches/starlight_1.1/src/vector3.cpp (revision 145)
@@ -0,0 +1,70 @@
+///////////////////////////////////////////////////////////////////////////
+//
+// Copyright 2010
+//
+// This file is part of starlight.
+//
+// starlight is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
+//
+// starlight is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with starlight. If not, see <http://www.gnu.org/licenses/>.
+//
+///////////////////////////////////////////////////////////////////////////
+//
+// File and Version Information:
+// $Rev:: $: revision of last commit
+// $Author:: $: author of last commit
+// $Date:: $: date of last commit
+//
+// Description:
+//
+//
+//
+///////////////////////////////////////////////////////////////////////////
+
+
+#include "vector3.h"
+
+
+vector3::vector3()
+{
+ _vec[0] = 0;
+ _vec[1] = 0;
+ _vec[2] = 0;
+}
+
+
+vector3::vector3(double x, double y, double z)
+{
+ _vec[0] = x;
+ _vec[1] = y;
+ _vec[2] = z;
+}
+
+
+vector3::~vector3()
+{ }
+
+
+void vector3::SetVector(double x, double y, double z)
+{
+ _vec[0] = x;
+ _vec[1] = y;
+ _vec[2] = z;
+}
+
+
+void vector3::SetVector(double *vec)
+{
+ _vec[0] = vec[0];
+ _vec[1] = vec[1];
+ _vec[2] = vec[2];
+}
Property changes on: branches/starlight_1.1/src/vector3.cpp
___________________________________________________________________
Added: svn:keywords
## -0,0 +1 ##
+Rev Date Author
\ No newline at end of property
Index: branches/starlight_1.1/src/gammagammasingle.cpp
===================================================================
--- branches/starlight_1.1/src/gammagammasingle.cpp (revision 0)
+++ branches/starlight_1.1/src/gammagammasingle.cpp (revision 145)
@@ -0,0 +1,723 @@
+///////////////////////////////////////////////////////////////////////////
+//
+// Copyright 2010
+//
+// This file is part of starlight.
+//
+// starlight is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
+//
+// starlight is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with starlight. If not, see <http://www.gnu.org/licenses/>.
+//
+///////////////////////////////////////////////////////////////////////////
+//
+// File and Version Information:
+// $Rev:: $: revision of last commit
+// $Author:: $: author of last commit
+// $Date:: $: date of last commit
+//
+// Description:
+//
+//
+//
+///////////////////////////////////////////////////////////////////////////
+
+#include <iostream>
+#include <fstream>
+#include <cmath>
+#include <vector>
+
+
+#include "starlightconstants.h"
+#include "gammagammasingle.h"
+#include "starlightconfig.h"
+
+using namespace std;
+
+
+//______________________________________________________________________________
+Gammagammasingle::Gammagammasingle(inputParameters& input, beamBeamSystem& bbsystem)
+: eventChannel(input, bbsystem)
+#ifdef ENABLE_PYTHIA
+,_pyDecayer()
+#endif
+{
+
+#ifdef ENABLE_PYTHIA
+ _pyDecayer.init();
+#endif
+
+ //Initialize randomgenerator with our seed.
+ _randy.SetSeed(input.randomSeed());
+ cout<<"Randy in Single Meson construction: "<<_randy.Rndom()<<endl;
+ //Storing inputparameters into protected members for use
+ _GGsingInputnumw=input.nmbWBins();
+ _GGsingInputnumy=input.nmbRapidityBins();
+ _GGsingInputpidtest=input.prodParticleType();
+ _GGsingInputGamma_em=input.beamLorentzGamma();
+ cout<<"SINGLE MESON pid test: "<<_GGsingInputpidtest<<endl;
+ //reading in luminosity tables
+ read();
+ //Now calculating crosssection
+ singleCrossSection();
+}
+
+
+//______________________________________________________________________________
+Gammagammasingle::~Gammagammasingle()
+{ }
+
+
+//______________________________________________________________________________
+void Gammagammasingle::singleCrossSection()
+{
+ //This function carries out a delta function cross-section calculation. For reference, see STAR Note 243, Eq. 8
+ //Multiply all _Farray[] by _f_max
+ double _sigmaSum=0.,remainw=0.;//_remainwd=0.;
+ int ivalw =0;//_ivalwd;
+ //calculate the differential cross section and place in the sigma table
+ _wdelta=getMass();
+ for(int i=0;i<_GGsingInputnumw;i++){
+ for(int j=0;j<_GGsingInputnumy;j++){
+ // Eq. 1 of starnote 347
+ _sigmax[i][j]=(getSpin()*2.+1.)*4*starlightConstants::pi*starlightConstants::pi*getWidth()/
+ (getMass()*getMass()*getMass())*_f_max*_Farray[i][j]*starlightConstants::hbarc*starlightConstants::hbarc/100.;
+ }
+ }
+ //find the index, i,for the value of w just less than the mass because we want to use the value from the sigma table that has w=mass
+
+ for(int i=0;i<_GGsingInputnumw;i++){
+ if(getMass()>_Warray[i]) ivalw=i;
+ }
+
+ remainw = (getMass()-_Warray[ivalw])/(_Warray[ivalw+1]-_Warray[ivalw+1]-_Warray[ivalw]);
+ _ivalwd = ivalw;
+ _remainwd = remainw;
+ //if we are interested rho pairs at threshold, the just set sigma to 100nb
+ switch(_GGsingInputpidtest){
+ case starlightConstants::ZOVERZ03:
+ _sigmaSum =0.;
+ for(int j=0;j<_GGsingInputnumy-1;j++){
+ _sigmaSum = _sigmaSum +(_Yarray[j+1]-_Yarray[j])*
+ 100.0E-9*(.1/getMass())*((1.-remainw)*_f_max*
+ (_Farray[ivalw][j]+_Farray[ivalw][j])/2.+remainw*_f_max*
+ (_Farray[ivalw+1][j]+_Farray[ivalw+1][j+1])/2.);
+ }
+ break;
+ default:
+ //Sum to find the total cross-section
+ _sigmaSum =0.;
+ for(int j =0;j<_GGsingInputnumy-1;j++){
+ _sigmaSum = _sigmaSum+
+ (_Yarray[j+1]-_Yarray[j])*((1.-remainw)*
+ (_sigmax[ivalw][j]+_sigmax[ivalw][j+1])/2.+remainw*
+ (_sigmax[ivalw+1][j]+_sigmax[ivalw+1][j+1])/2.);
+ }
+ }
+ if(_sigmaSum > 0.1) cout <<"The total cross-section is: "<<_sigmaSum<<" barns."<<endl;
+ else if(_sigmaSum > 0.0001)cout <<"The total cross-section is: "<<_sigmaSum*1000<<" mb."<<endl;
+ else cout <<"The total cross-section is: "<<_sigmaSum*1000000<<" ub."<<endl;
+
+
+ return;
+}
+
+
+//______________________________________________________________________________
+void Gammagammasingle::pickw(double &w)
+{
+ //This function picks a w for the 2-photon calculation.
+ double sgf=0.,signorm=0.,x=0.,remainarea=0.,remainw=0.,a=0.,b=0.,c=0.;
+ int ivalw=0;
+
+ double * _sigofw;
+ double * sgfint;
+ _sigofw = new double[starlightLimits::MAXWBINS];
+ sgfint = new double[starlightLimits::MAXYBINS];
+
+ if(_wdelta != 0){
+ w=_wdelta;
+ ivalw=_ivalwd;
+ remainw=_remainwd;
+ }
+ else{
+ //deal with the case where sigma is an array
+ //_sigofw is simga integrated over y using a linear interpolation
+ //sigint is the integral of sgfint, normalized
+
+ //integrate sigma down to a function of just w
+ for(int i=0;i<_GGsingInputnumw;i++){
+ _sigofw[i]=0.;
+ for(int j=0;j<_GGsingInputnumy-1;j++){
+ _sigofw[i] = _sigofw[i]+(_Yarray[j+1]-_Yarray[j])*(_sigmax[i][j+1]+_sigmax[i][j])/2.;
+ }
+ }
+ //calculate the unnormalized sgfint array
+ sgfint[0]=0.;
+ for(int i=0;i<_GGsingInputnumw-1;i++){
+ sgf=(_sigofw[i+1]+_sigofw[i])*(_Warray[i+1]-_Warray[i])/2.;
+ sgfint[i+1]=sgfint[i]+sgf;
+ }
+ //normalize sgfint array
+ signorm=sgfint[_GGsingInputnumw-1];
+
+ for(int i=0;i<_GGsingInputnumw;i++){
+ sgfint[i]=sgfint[i]/signorm;
+ }
+ //pick a random number
+ x = _randy.Rndom();//random()/(RAND_MAX+1.0);
+ //compare x and sgfint to find the ivalue which is just less than the random number x
+ for(int i=0;i<_GGsingInputnumw;i++){
+ if(x > sgfint[i]) ivalw=i;
+ }
+ //remainder above ivalw
+ remainarea = x - sgfint[ivalw];
+
+ //figure out what point corresponds to the excess area in remainarea
+ c = -remainarea*signorm/(_Warray[ivalw+1]-_Warray[ivalw]);
+ b = _sigofw[ivalw];
+ a = (_sigofw[ivalw+1]-_sigofw[ivalw])/2.;
+ if(a==0.){
+ remainw = -c/b;
+ }
+ else{
+ remainw = (-b+sqrt(b*b-4.*a*c))/(2.*a);
+ }
+ _ivalwd = ivalw;
+ _remainwd = remainw;
+ //calculate the w value
+ w = _Warray[ivalw]+(_Warray[ivalw+1]-_Warray[ivalw])*remainw;
+ }
+
+ delete[] _sigofw;
+ delete[] sgfint;
+}
+
+
+//______________________________________________________________________________
+void Gammagammasingle::picky(double &y)
+{
+ double * sigofy;
+ double * sgfint;
+ sigofy = new double[starlightLimits::MAXYBINS];
+ sgfint = new double[starlightLimits::MAXYBINS];
+
+ double remainw =0.,remainarea=0.,remainy=0.,a=0.,b=0.,c=0.,sgf=0.,signorm=0.,x=0.;
+ int ivalw=0,ivaly=0;
+
+ ivalw=_ivalwd;
+ remainw=_remainwd;
+ //average over two colums to get y array
+ for(int j=0;j<_GGsingInputnumy;j++){
+ sigofy[j]=_sigmax[ivalw][j]+(_sigmax[ivalw+1][j]-_sigmax[ivalw][j])*remainw;
+ }
+ //calculate the unnormalized sgfint
+
+ sgfint[0]=0.;
+ for(int j=0;j<_GGsingInputnumy-1;j++){
+ sgf = (sigofy[j+1]+sigofy[j])/2.;
+ sgfint[j+1]=sgfint[j]+sgf*(_Yarray[j+1]-_Yarray[j]);
+ }
+
+ //normalize the sgfint array
+ signorm = sgfint[_GGsingInputnumy-1];
+
+ for(int j=0;j<_GGsingInputnumy;j++){
+ sgfint[j]=sgfint[j]/signorm;
+ }
+ //pick a random number
+ x = _randy.Rndom();//random()/(RAND_MAX+1.0);
+ //compare x and sgfint to find the ivalue which is just less then the random number x
+ for(int i=0;i<_GGsingInputnumy;i++){
+ if(x > sgfint[i])
+ ivaly = i;
+ }
+ //remainder above ivaly
+ remainarea = x - sgfint[ivaly];
+ //figure what point corresponds to the leftover area in remainarea
+ c = -remainarea*signorm/(_Yarray[ivaly+1]-_Yarray[ivaly]);
+ b = sigofy[ivaly];
+ a = (sigofy[ivaly+1]-sigofy[ivaly])/2.;
+ if(a==0.){
+ remainy = -c/b;
+ }
+ else{
+ remainy = (-b + sqrt(b*b-4.*a*c))/(2.*a);
+ }
+ //calculate the y value
+ y = _Yarray[ivaly]+(_Yarray[ivaly+1]-_Yarray[ivaly])*remainy;
+ delete[] sigofy;
+ delete[] sgfint;
+}
+
+
+//______________________________________________________________________________
+void Gammagammasingle::parentMomentum(double w,double y,double &E,double &px,double &py,double &pz)
+{
+ //this function calculates px,py,pz,and E given w and y
+ double anglepp1=0.,anglepp2=0.,pp1=0.,pp2=0.,E1=0.,E2=0.,signpx=0.,pt=0.;
+
+ //E1 and E2 are for the 2 photons in the CM frame
+ E1 = w*exp(y)/2.;
+ E2 = w*exp(-y)/2.;
+ //pz = E1-E2;
+ //calculate px and py
+ //to get x and y components-- phi is random between 0 and 2*pi
+ anglepp1 = _randy.Rndom();//random()/(RAND_MAX+1.0);
+ anglepp2 = _randy.Rndom();//random()/(RAND_MAX+1.0);
+
+ pp1 = pp(E1);
+ pp2 = pp(E2);
+ px = pp1*cos(2.*starlightConstants::pi*anglepp1)+pp2*cos(2.*starlightConstants::pi*anglepp2);
+ py = pp1*sin(2.*starlightConstants::pi*anglepp1)+pp2*sin(2.*starlightConstants::pi*anglepp2);
+ //Compute vector sum Pt=Pt1+Pt2 to find pt for the produced particle
+ pt = sqrt(px*px+py*py);
+ //W is the mass of the produced particle (not necessarily on-mass-shell).Now compute its energy and pz
+ E = sqrt(w*w+pt*pt)*cosh(y);
+ pz= sqrt(w*w+pt*pt)*sinh(y);
+ signpx = _randy.Rndom();//random()/(RAND_MAX+1.0);
+ //pick the z direction
+ if(signpx > 0.5)
+ pz = -pz;
+}
+
+
+//______________________________________________________________________________
+double Gammagammasingle::pp(double E)
+{
+ // will probably have to pass in beambeamsys? that way we can do beam1.formFactor(t) or beam2..., careful with the way sergey did it for asymmetry
+ // returns on random draw from pp(E) distribution
+
+ double ereds =0.,Cm=0.,Coef=0.,x=0.,pp=0.,test=0.,u=0.;
+ double singleformfactorCm=0.,singleformfactorpp1=0.,singleformfactorpp2=0.;
+ int satisfy =0;
+
+ ereds = (E/_GGsingInputGamma_em)*(E/_GGsingInputGamma_em);
+ Cm = sqrt(3.)*E/_GGsingInputGamma_em;
+ //the amplitude of the p_t spectrum at the maximum
+ singleformfactorCm=_bbs.beam1().formFactor(Cm*Cm+ereds);
+ //Doing this once and then storing it as a double, which we square later...SYMMETRY?using beam1 for now.
+ Coef = 3.0*(singleformfactorCm*singleformfactorCm*Cm*Cm*Cm)/((2.*(starlightConstants::pi)*(ereds+Cm*Cm))*(2.*(starlightConstants::pi)*(ereds+Cm*Cm)));
+
+ //pick a test value pp, and find the amplitude there
+ x = _randy.Rndom();//random()/(RAND_MAX+1.0);
+ pp = x*5.*starlightConstants::hbarc/_bbs.beam1().nuclearRadius(); //Will use nucleus #1, there should be two for symmetry//nextline
+ singleformfactorpp1=_bbs.beam1().formFactor(pp*pp+ereds);
+ test = (singleformfactorpp1*singleformfactorpp1)*pp*pp*pp/((2.*starlightConstants::pi*(ereds+pp*pp))*(2.*starlightConstants::pi*(ereds+pp*pp)));
+
+ while(satisfy==0){
+ u = _randy.Rndom();//random()/(RAND_MAX+1.0);
+ if(u*Coef <= test){
+ satisfy =1;
+ }
+ else{
+ x =_randy.Rndom();//random()/(RAND_MAX+1.0);
+ pp = 5*starlightConstants::hbarc/_bbs.beam1().nuclearRadius()*x;
+ singleformfactorpp2=_bbs.beam1().formFactor(pp*pp+ereds);//Symmetry
+ test = (singleformfactorpp2*singleformfactorpp2)*pp*pp*pp/(2.*starlightConstants::pi*(ereds+pp*pp)*2.*starlightConstants::pi*(ereds+pp*pp));
+ }
+ }
+ return pp;
+}
+
+
+//______________________________________________________________________________
+void Gammagammasingle::twoBodyDecay(starlightConstants::particleTypeEnum &ipid,double /*E*/,double W,double px0,double py0,double pz0,double &px1,double &py1,double &pz1,double &px2,double &py2,double &pz2,int &iFbadevent)
+{
+ // This routine decays a particle into two particles of mass mdec,
+ // taking spin into account
+
+ double mdec=0.,E1=0.,E2=0.;
+ double pmag,ytest=0.;
+ double phi,theta,xtest,dndtheta,Ecm;
+ double betax,betay,betaz;
+
+ // set the mass of the daughter particles
+ switch(_GGsingInputpidtest){
+ case starlightConstants::ZOVERZ03:
+ case starlightConstants::F2:
+ mdec = starlightConstants::pionChargedMass;
+ break;
+ case starlightConstants::F2PRIME:
+ // decays 50% to K+/K-, 50% to K_0's
+ ytest = _randy.Rndom();
+ if(ytest >= 0.5){
+ mdec = starlightConstants::kaonChargedMass;
+ }
+ else{
+ mdec = 0.493677;
+ }
+ break;
+ default :
+ cout<<"No default mass selected for single photon-photon particle, expect errant results"<<endl;
+ }
+
+ //Calculating the momentum's magnitude
+ //add switch for rho pairs at threshold and everything else.
+ switch(_GGsingInputpidtest){
+ case starlightConstants::ZOVERZ03: //the rho pairs produced at threshold
+ pmag = sqrt(getMass()*getMass()/4. - mdec*mdec);
+ break;
+ default :
+ if(W < 2*mdec){
+ cout<<" ERROR: W="<<W<<endl;
+ iFbadevent = 1;
+ return;
+ }
+ pmag = sqrt(W*W/4. - mdec*mdec);
+ }
+ // pick an orientation, based on the spin
+ // phi has a flat distribution in 2*pi
+ phi = _randy.Rndom()*2.*starlightConstants::pi; //(random()/(RAND_MAX+1.0))* 2.*starlightConstants::pi;
+
+ // find theta, the angle between one of the outgoing particles and
+ // the beamline, in the frame of the two photons
+ //this will depend on spin, F2,F2' and z/z03 all have spin 2, all other photonphoton-single mesons are handled by jetset
+ //Applies to spin2 mesons.
+ L300td:
+ theta = starlightConstants::pi*_randy.Rndom();
+ xtest = _randy.Rndom();
+ dndtheta = sin(theta)*sin(theta)*sin(theta)*sin(theta)*sin(theta);
+ if(xtest > dndtheta)
+ goto L300td;
+
+ // compute unboosted momenta
+ px1 = sin(theta)*cos(phi)*pmag;
+ py1 = sin(theta)*sin(phi)*pmag;
+ pz1 = cos(theta)*pmag;
+ px2 = -px1;
+ py2 = -py1;
+ pz2 = -pz1;
+ // compute energies
+ //Changed mass to W 11/9/2000 SRK
+ Ecm = sqrt(W*W+px0*px0+py0*py0+pz0*pz0);
+ E1 = sqrt(mdec*mdec+px1*px1+py1*py1+pz1*pz1);
+ E2 = sqrt(mdec*mdec+px2*px2+py2*py2+pz2*pz2);
+
+ // Lorentz transform into the lab frame
+ // betax,betay,betaz are the boost of the complete system
+ betax = -(px0/Ecm);
+ betay = -(py0/Ecm);
+ betaz = -(pz0/Ecm);
+
+ transform (betax,betay,betaz,E1,px1,py1,pz1,iFbadevent);
+ transform (betax,betay,betaz,E2,px2,py2,pz2,iFbadevent);
+
+
+ if(iFbadevent == 1)
+ return;
+
+ // change particle id from that of parent to that of daughters
+
+ switch(_GGsingInputpidtest){
+ //These decay into a pi+ pi- pair
+ case starlightConstants::ZOVERZ03:
+ case starlightConstants::F2:
+ ipid=starlightConstants::PION;
+ break;
+ case starlightConstants::F2PRIME:
+ if( ytest >= 0.5 )
+ {
+ //Decays 50/50 into k+ k- or k_s k_l
+ ipid=starlightConstants::KAONCHARGE;
+ }
+ else
+ {
+ ipid=starlightConstants::KAONNEUTRAL;
+ }
+ break;
+ default:
+ cout<<"Rethink the daughter particles"<<endl;
+ }
+}
+
+
+//______________________________________________________________________________
+starlightConstants::event Gammagammasingle::produceEvent(int &/*ievent*/)
+{
+ // Not in use anymore, default event struct returned
+ return starlightConstants::event();
+}
+
+
+//______________________________________________________________________________
+// fix it ... lost functionality
+//starlightConstants::event Gammagammasingle::produceEvent(int &ievent)
+upcEvent Gammagammasingle::produceEvent()
+{
+ // cout << "NOT IMPLEMENTED!" << endl;
+
+ // return upcEvent();
+
+ // returns the vector with the decay particles inside.
+ // onedecayparticle single;
+ starlightConstants::event single;
+ double comenergy = 0.;
+ double rapidity = 0.;
+ double parentE = 0.;
+ double parentmomx=0.,parentmomy=0.,parentmomz=0.;
+
+ //this function decays particles and writes events to a file
+ //zeroing out the event structure
+ single._numberOfTracks=0;
+ for(int i=0;i<4;i++){
+ single.px[i]=0.;
+ single.py[i]=0.;
+ single.pz[i]=0.;
+ single._fsParticle[i]=starlightConstants::UNKNOWN;
+ single._charge[i]=0;
+ }
+
+ pickw(comenergy);
+ picky(rapidity);
+ parentMomentum(comenergy,rapidity,parentE,parentmomx,parentmomy,parentmomz);
+
+
+ if(_GGsingInputpidtest != starlightConstants::F2 && _GGsingInputpidtest != starlightConstants::F2PRIME)
+ {
+#ifdef ENABLE_PYTHIA
+ starlightParticle particle(parentmomx,parentmomy,parentmomz, parentE, getMass(),_GGsingInputpidtest , 0);
+
+ _pyDecayer.addParticle(particle);
+
+ return _pyDecayer.execute();
+#endif
+ }
+
+
+ int ievent = 0;
+ int iFbadevent=0;
+ starlightConstants::particleTypeEnum ipid = starlightConstants::UNKNOWN;
+ double px2=0.,px1=0.,py2=0.,py1=0.,pz2=0.,pz1=0.;
+ double px3=0.,px4=0.,py3=0.,py4=0.,pz3=0.,pz4=0.;
+ // double theta=0.,phi=0.;//angles from jetset
+ double xtest=0.,ztest=0.;
+ switch(_GGsingInputpidtest){
+ case starlightConstants::ZOVERZ03:
+ //Decays into two pairs.
+ parentmomx=parentmomx/2.;
+ parentmomy=parentmomy/2.;
+ parentmomz=parentmomz/2.;
+ //Pair #1
+ twoBodyDecay(ipid,parentE,comenergy,parentmomx,parentmomy,parentmomz,px1,py1,pz1,px2,py2,pz2,iFbadevent);
+ //Pair #2
+ twoBodyDecay(ipid,parentE,comenergy,parentmomx,parentmomy,parentmomz,px3,py3,pz3,px4,py4,pz4,iFbadevent);
+ //Now add them to vectors to be written out later.
+
+ single._numberOfTracks=4;//number of tracks per event
+ if (iFbadevent==0){
+ xtest = _randy.Rndom();//random()/(RAND_MAX+1.0);
+ ztest = _randy.Rndom();
+ //Assigning charges randomly.
+ if (xtest<0.5){
+ single._charge[0]=1;//q1=1;
+ single._charge[1]=-1;//q2=-1;
+ }
+ else{
+ single._charge[0]=1;//q1=-1;
+ single._charge[1]=-1;//q2=1;
+ }
+ if (ztest<0.5){
+ single._charge[2]=1;//q3=1;
+ single._charge[3]=-1;//q4=-1;
+ }
+ else{
+ single._charge[2]=-1;//q3=-1;
+ single._charge[3]=1;//q4=1;
+ }
+ //Track #1
+ single.px[0]=px1;
+ single.py[0]=py1;
+ single.pz[0]=pz1;
+ single._fsParticle[0]=ipid;
+ //Track #2
+ single.px[1]=px2;
+ single.py[1]=py2;
+ single.pz[1]=pz2;
+ single._fsParticle[1]=ipid;
+ //Track #3
+ single.px[2]=px3;
+ single.py[2]=py3;
+ single.pz[2]=pz3;
+ single._fsParticle[2]=ipid;
+ //Track #4
+ single.px[3]=px4;
+ single.py[3]=py4;
+ single.pz[3]=pz4;
+ single._fsParticle[3]=ipid;
+
+ ievent=ievent+1;
+ }
+
+ break;
+ case starlightConstants::F2:
+ case starlightConstants::F2PRIME:
+ twoBodyDecay(ipid,parentE,comenergy,parentmomx,parentmomy,parentmomz,px1,py1,pz1,px2,py2,pz2,iFbadevent);
+
+ single._numberOfTracks=2;
+ if (iFbadevent==0){
+ xtest = _randy.Rndom();//random()/(RAND_MAX+1.0);
+ if (xtest<0.5){
+ single._charge[0]=1;//q1=1;
+ single._charge[1]=-1;//q2=-1;
+ }
+ else{
+ single._charge[0]=-1;//q1=-1;
+ single._charge[1]=1;//q2=1;
+ }
+ //Track #1
+ single.px[0]=px1;
+ single.py[0]=py1;
+ single.pz[0]=pz1;
+ single._fsParticle[0]=ipid*single._charge[0];
+ //Track #2
+ single.px[1]=px2;
+ single.py[1]=py2;
+ single.pz[1]=pz2;
+ single._fsParticle[1]=ipid*single._charge[1];
+ ievent=ievent+1;
+ }
+ break;
+ default:
+ break;
+ }
+
+ return upcEvent(single);
+}
+
+
+//______________________________________________________________________________
+void Gammagammasingle::thephi(double W,double px,double py,double pz,double E,double &theta,double &phi)
+{
+ // This subroutine calculates angles for channels decayed by jetset.
+ // subroutine thephi(W,px,py,pz,E,theta,phi)
+ E = sqrt (W*W+px*px+py*py+pz*pz);
+
+ theta = acos(pz/sqrt(px*px+py*py+pz*pz));
+ phi = acos(px/sqrt(px*px+py*py));
+
+ if ((px == 0) && (py == 0))
+ phi = 0.;
+ if (py < 0)
+ phi = 2*starlightConstants::pi - phi;
+}
+
+
+//______________________________________________________________________________
+double Gammagammasingle::getMass()
+{
+ using namespace starlightConstants;
+ double singlemass=0.;
+ switch(_GGsingInputpidtest){
+ case starlightConstants::ETA:
+ singlemass= etaMass;
+ break;
+ case starlightConstants::ETAPRIME:
+ singlemass=etaPrimeMass;
+ break;
+ case starlightConstants::ETAC:
+ singlemass=etaCMass;
+ break;
+ case starlightConstants::F0:
+ singlemass=f0Mass;
+ break;
+ case starlightConstants::F2:
+ singlemass=f2Mass;
+ break;
+ case starlightConstants::A2:
+ singlemass=a2Mass;
+ break;
+ case starlightConstants::F2PRIME:
+ singlemass=f2PrimeMass;
+ break;
+ case starlightConstants::ZOVERZ03:
+ singlemass=1.540;
+ break;
+ default:
+ cout<<"Not a recognized single particle, Gammagammasingle::getmass(), mass = 0."<<endl;
+ }
+ return singlemass;
+}
+
+
+//______________________________________________________________________________
+double Gammagammasingle::getWidth()
+{
+ double singlewidth=0.;
+ switch(_GGsingInputpidtest){
+ case starlightConstants::ETA:
+ singlewidth=1.E-6;
+ break;
+ case starlightConstants::ETAPRIME:
+ singlewidth=5.E-6;
+ break;
+ case starlightConstants::ETAC:
+ singlewidth=6.4E-6;
+ break;
+ case starlightConstants::F0:
+ singlewidth=0.56E-6;
+ break;
+ case starlightConstants::F2:
+ singlewidth=2.6E-6;
+ break;
+ case starlightConstants::A2:
+ singlewidth=1.04E-6;
+ break;
+ case starlightConstants::F2PRIME:
+ singlewidth=0.1E-6;
+ break;
+ case starlightConstants::ZOVERZ03:
+ singlewidth=0.1E-6;
+ break;
+ default:
+ cout<<"Not a recognized single particle, Gammagammasingle::getwidth(), width = 0."<<endl;
+ }
+ return singlewidth;
+}
+
+
+//______________________________________________________________________________
+double Gammagammasingle::getSpin()
+{
+ double singlespin=0.5;
+ switch(_GGsingInputpidtest){
+ case starlightConstants::ETA:
+ singlespin=0.0;
+ break;
+ case starlightConstants::ETAPRIME:
+ singlespin=0.0;
+ break;
+ case starlightConstants::ETAC:
+ singlespin=0.0;
+ break;
+ case starlightConstants::F0:
+ singlespin=0.0;
+ break;
+ case starlightConstants::F2:
+ singlespin=2.0;
+ break;
+ case starlightConstants::A2:
+ singlespin=2.0;
+ break;
+ case starlightConstants::F2PRIME:
+ singlespin=2.0;
+ break;
+ case starlightConstants::ZOVERZ03:
+ singlespin=2.0;
+ break;
+ default:
+ cout<<"Not a recognized single particle, Gammagammasingle::getspin(), spin = 0."<<endl;
+ }
+ return singlespin;
+}
+
+
+
Property changes on: branches/starlight_1.1/src/gammagammasingle.cpp
___________________________________________________________________
Added: svn:keywords
## -0,0 +1 ##
+Rev Date Author
\ No newline at end of property
Index: branches/starlight_1.1/src/twophotonluminosity.cpp
===================================================================
--- branches/starlight_1.1/src/twophotonluminosity.cpp (revision 0)
+++ branches/starlight_1.1/src/twophotonluminosity.cpp (revision 145)
@@ -0,0 +1,704 @@
+///////////////////////////////////////////////////////////////////////////
+//
+// Copyright 2010
+//
+// This file is part of starlight.
+//
+// starlight is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
+//
+// starlight is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with starlight. If not, see <http://www.gnu.org/licenses/>.
+//
+///////////////////////////////////////////////////////////////////////////
+//
+// File and Version Information:
+// $Rev:: $: revision of last commit
+// $Author:: $: author of last commit
+// $Date:: $: date of last commit
+//
+// Description:
+// Added incoherent factor to luminosity table output--Joey
+//
+//
+///////////////////////////////////////////////////////////////////////////
+
+
+#include <iostream>
+#include <fstream>
+#include <cmath>
+
+#include "inputParameters.h"
+#include "beambeamsystem.h"
+#include "beam.h"
+#include "starlightconstants.h"
+#include "nucleus.h"
+#include "bessel.h"
+#include "twophotonluminosity.h"
+#include <pthread.h>
+
+using namespace std;
+using namespace starlightConstants;
+
+
+
+//______________________________________________________________________________
+twoPhotonLuminosity::twoPhotonLuminosity(beam beam_1,beam beam_2,inputParameters& input):
+beamBeamSystem(beam_1,beam_2,input),_input2photon(input)
+{
+ //Lets check to see if we need to recalculate the luminosity tables
+ twoPhotonDifferentialLuminosity();
+}
+
+
+//______________________________________________________________________________
+twoPhotonLuminosity::~twoPhotonLuminosity()
+{ }
+
+
+//______________________________________________________________________________
+void twoPhotonLuminosity::twoPhotonDifferentialLuminosity()
+{
+ ofstream wylumfile;
+ wylumfile.precision(15);
+ wylumfile.open("slight.txt");
+ std::vector<double> w(_input2photon.nmbWBins());
+ std::vector<double> y(_input2photon.nmbRapidityBins());
+ double xlum = 0.;
+ double Normalize = 0.,OldNorm;
+ double wmev = 0;
+
+ Normalize = 1./sqrt(1*(double)_input2photon.nmbWBins()*_input2photon.nmbRapidityBins()); //if your grid is very fine, you'll want high accuracy-->small Normalize
+ OldNorm = Normalize;
+
+ //Writing out our input parameters+(w,y)grid+diff._lum.
+ wylumfile << beam1().Z() <<endl;
+ wylumfile << beam1().A() <<endl;
+ wylumfile << beam2().Z() <<endl;
+ wylumfile << beam2().A() <<endl;
+ wylumfile << _input2photon.beamLorentzGamma() <<endl;
+ wylumfile << _input2photon.maxW() <<endl;
+ wylumfile << _input2photon.minW() <<endl;
+ wylumfile << _input2photon.nmbWBins() <<endl;
+ wylumfile << _input2photon.maxRapidity() <<endl;
+ wylumfile << _input2photon.nmbRapidityBins() <<endl;
+ wylumfile << _input2photon.productionMode() <<endl;
+ wylumfile << _input2photon.beamBreakupMode() <<endl;
+ wylumfile << _input2photon.interferenceEnabled() <<endl;
+ wylumfile << _input2photon.interferenceStrength() <<endl;
+ wylumfile << _input2photon.coherentProduction() <<endl;
+ wylumfile << _input2photon.incoherentFactor() <<endl;
+ wylumfile << _input2photon.deuteronSlopePar() <<endl;
+ wylumfile << _input2photon.maxPtInterference() <<endl;
+ wylumfile << _input2photon.nmbPtBinsInterference() <<endl;
+ for (unsigned int i = 0; i < _input2photon.nmbWBins(); ++i) {
+ w[i] = _input2photon.minW() + (_input2photon.maxW()-_input2photon.minW())/_input2photon.nmbWBins()*i;
+ wylumfile << w[i] <<endl;
+ }
+ for (unsigned int i = 0; i < _input2photon.nmbRapidityBins(); ++i) {
+ y[i] = -_input2photon.maxRapidity() + 2.*_input2photon.maxRapidity()*i/(_input2photon.nmbRapidityBins());
+ wylumfile << y[i] <<endl;
+ }
+
+ if(_input2photon.xsecCalcMethod() == 0) {
+
+ for (unsigned int i = 0; i < _input2photon.nmbWBins(); ++i) { //For each (w,y) pair, calculate the diff. _lum
+ for (unsigned int j = 0; j < _input2photon.nmbRapidityBins(); ++j) {
+ wmev = w[i]*1000.;
+ xlum = wmev * D2LDMDY(wmev,y[j],Normalize); //Convert photon flux dN/dW to Lorentz invariant photon number WdN/dW
+ if (j==0) OldNorm = Normalize; //Save value of integral for each new W(i) and Y(i)
+ wylumfile << xlum <<endl;
+ }
+ Normalize = OldNorm;
+ }
+
+ }
+ else if(_input2photon.xsecCalcMethod() == 1) {
+
+ const int nthreads = _input2photon.nThreads();
+ pthread_t threads[nthreads];
+ difflumiargs args[nthreads];
+
+ for(int t = 0; t < nthreads; t++)
+ {
+ args[t].self = this;
+ }
+ for (unsigned int i = 1; i <= _input2photon.nmbWBins(); ++i) { //For each (w,y) pair, calculate the diff. _lum
+ printf("Calculating cross section: %2.0f %% \r", float(i)/float(_input2photon.nmbWBins())*100);
+ fflush(stdout);
+ unsigned int r = 1;
+ for(unsigned int j = 0; j < _input2photon.nmbRapidityBins()/nthreads; ++j)
+ {
+
+ for(int t = 0; t < nthreads; t++)
+ {
+ args[t].m = w[i];
+ args[t].y = y[r];
+
+ pthread_create(&threads[t], NULL, &twoPhotonLuminosity::D2LDMDY_Threaded, &args[t]);
+ r++;
+ }
+ for(int t = 0; t < nthreads; t++)
+ {
+ pthread_join(threads[t], NULL);
+ xlum = w[i] * args[t].res;
+ wylumfile << xlum <<endl;
+ }
+ }
+ for(unsigned int t = 0; t < _input2photon.nmbRapidityBins()%nthreads; t++)
+ {
+ args[t].m = w[i];
+ args[t].y = y[r];
+
+ pthread_create(&threads[t], NULL, &twoPhotonLuminosity::D2LDMDY_Threaded, &args[t]);
+ r++;
+ }
+ for(unsigned int t = 0; t < _input2photon.nmbRapidityBins()%nthreads; t++)
+ {
+ pthread_join(threads[t], NULL);
+ xlum = w[i] * args[t].res;
+ wylumfile << xlum <<endl;
+ }
+ }
+ }
+
+ wylumfile.close();
+ return;
+}
+
+//______________________________________________________________________________
+double twoPhotonLuminosity::D2LDMDY(double M,double Y,double &Normalize)
+{
+ // double differential luminosity
+
+ double D2LDMDYx = 0.;
+
+ _W1 = M/2.0*exp(Y);
+ _W2 = M/2.0*exp(-Y);
+ _gamma = _input2photon.beamLorentzGamma();
+ int Zin=beam1().Z();
+ D2LDMDYx = 2.0/M*Zin*Zin*Zin*Zin*(starlightConstants::alpha*starlightConstants::alpha)*integral(Normalize); //treats it as a symmetric collision
+ Normalize = D2LDMDYx*M/(2.0*beam1().Z()*beam1().Z()*
+ beam1().Z()*beam1().Z()*
+ starlightConstants::alpha*starlightConstants::alpha);
+ //Normalization also treats it as symmetric
+ return D2LDMDYx;
+}
+
+
+
+//______________________________________________________________________________
+double twoPhotonLuminosity::D2LDMDY(double M, double Y) const
+{
+ // double differential luminosity
+
+ double D2LDMDYx = 0.;
+ double w1 = M/2.0*exp(Y);
+ double w2 = M/2.0*exp(-Y);
+ double gamma = _input2photon.beamLorentzGamma();
+
+ //int Z1=beam1().Z();
+ //int Z2=beam2().Z();
+
+ double r_nuc1 = beam1().nuclearRadius();
+ double r_nuc2 = beam2().nuclearRadius();
+
+ double b1min = r_nuc1;
+ double b2min = r_nuc2;
+
+ double b1max = max(5.*gamma*hbarc/w1,5*r_nuc1);
+ double b2max = max(5.*gamma*hbarc/w2,5*r_nuc2);
+
+ const int nbins_b1 = 120;
+ const int nbins_b2 = 120;
+
+ double log_delta_b1 = (log(b1max)-log(b1min))/nbins_b1;
+ double log_delta_b2 = (log(b2max)-log(b2min))/nbins_b2;
+ double sum = 0;
+ for(int i = 0; i < nbins_b1; ++i)
+ {
+ // Sum from nested integral
+ double sum_b2 = 0;
+ double b1_low = b1min*exp(i*log_delta_b1);
+ double b1_high = b1min*exp((i+1)*log_delta_b1);
+ double b1_cent = (b1_high+b1_low)/2.;
+ for(int j = 0; j < nbins_b2; ++j)
+ {
+ // Sum from nested
+ double sum_phi = 0;
+ double b2_low = b2min*exp(j*log_delta_b2);
+ double b2_high = b2min*exp((j+1)*log_delta_b2);
+ double b2_cent = (b2_high+b2_low)/2.;
+
+ // Gaussian integration n = 10
+ // Since cos is symmetric around 0 we only need 5 of the
+ // points in the gaussian integration.
+ const int ngi = 5;
+ double weights[ngi] =
+ {
+ 0.2955242247147529,
+ 0.2692667193099963,
+ 0.2190863625159820,
+ 0.1494513491505806,
+ 0.0666713443086881,
+ };
+
+ double abscissas[ngi] =
+ {
+ -0.1488743389816312,
+ -0.4333953941292472,
+ -0.6794095682990244,
+ -0.8650633666889845,
+ -0.9739065285171717,
+ };
+
+ for(int k = 0; k < ngi; ++k)
+ {
+ double b_rel = sqrt(b1_cent*b1_cent+b2_cent*b2_cent + 2.*b1_cent*b2_cent*cos(pi*(abscissas[k]+1)));
+
+ sum_phi += weights[k] * probabilityOfBreakup(b_rel)*2;
+ }
+ sum_b2 += beam2().photonFlux(b2_cent,w2)*pi*sum_phi*b2_cent*(b2_high-b2_low);
+ }
+
+ sum += beam1().photonFlux(b1_cent, w1)*sum_b2*b1_cent*(b1_high-b1_low);
+
+ }
+ D2LDMDYx = 2.*pi*M/2.*sum;
+ return D2LDMDYx;
+}
+
+
+void * twoPhotonLuminosity::D2LDMDY_Threaded(void * a)
+{
+ difflumiargs *args = (difflumiargs*)a;
+ double M = args->m;
+ double Y = args->y;
+ args->res = args->self->D2LDMDY(M, Y);
+
+ return NULL;
+}
+
+ /*
+ D2LDMDYx = 2.0/M*Zin*Zin*Zin*Zin*(starlightConstants::alpha*starlightConstants::alpha)*integral(Normalize); //treats it as a symmetric collision
+ Normalize = D2LDMDYx*M/(2.0*beam1().Z()*beam1().Z()*
+ beam1().Z()*beam1().Z()*
+ starlightConstants::alpha*starlightConstants::alpha);
+ //Normalization also treats it as symmetric
+ return D2LDMDYx;
+
+ */
+
+
+//______________________________________________________________________________
+double twoPhotonLuminosity::integral(double Normalize)
+{
+ int NIter = 0;
+ int NIterMin = 0;
+ double EPS = 0.;
+ double RM = 0.;
+ double u1 = 0.;
+ double u2 = 0.;
+ double B1 = 0.;
+ double B2 = 0.;
+ double Integrala = 0.;
+ double totsummary = 0.;
+ double NEval = 0.;
+ double Lower[3];
+ double Upper[3];
+ double WK[500000]; //used to be [1000000]
+ double Result, Summary, ResErr, NFNEVL;
+
+ EPS = .01*Normalize; //This is EPS for integration, 1% of previous integral value.
+ // Change this to the Woods-Saxon radius to be consistent with the older calculations (JN 230710)
+ RM = beam1().nuclearRadius()/starlightConstants::hbarcmev; //Assumes symmetry?
+ // RM = beam1().woodSaxonRadius()/starlightConstants::hbarcmev;
+
+ NIter = 10000 + (int)1000000*(int)Normalize; //if integral value is very small, we don't do too many intertions to get precision down to 1%
+ NIterMin = 600;
+ u1 = 9.*_gamma/_W1; //upper boundary in B1
+ u2 = 9.*_gamma/_W2; //upper boundary in B2
+ B1 = .4*_gamma/_W1; //intermediate boundary in B1
+ B2 = .4*_gamma/_W2; //intermediate boundary in B2
+ //The trick is that u1,2 and b1,2 could be less than RM-the lower integration boundary, thus integration area splits into 4,2 or 1 pieces
+
+ if (u1 < RM){
+ Integrala = 0;
+ totsummary = 0;
+ NEval = 0;
+ }
+ else if (B1 > RM){
+ if (u2 < RM){
+ Integrala = 0;
+ totsummary = 0;
+ NEval = 0;
+ }
+ else if (B2 > RM){ //integral has 4 parts
+ Integrala = 0;
+ totsummary = 40000;
+ NEval = 0;
+ Lower[0] = RM; //1
+ Lower[1] = RM; //2
+ Lower[2] = 0.; //3
+ Upper[2] = 2.*starlightConstants::pi; //3
+ Upper[0] = B1; //1
+ Upper[1] = B2; //2
+ radmul(3,Lower,Upper,NIterMin,NIter,EPS,WK,NIter,Result,ResErr,NFNEVL,Summary);
+ Integrala = Integrala + Result;
+ totsummary = totsummary + 1000*Summary;
+ NEval = NEval + NFNEVL;
+ Upper[0] = u1; //1
+ Upper[1] = B2; //2
+ Lower[0] = B1; //1
+ Lower[1] = RM; //2
+ radmul(3,Lower,Upper,NIterMin,NIter,EPS,WK,NIter,Result,ResErr,NFNEVL,Summary);
+ Integrala = Integrala + Result;
+ totsummary = totsummary + 100*Summary;
+ NEval = NEval + NFNEVL;
+ Upper[0] = B1; //1
+ Upper[1] = u2; //2
+ Lower[0] = RM; //1
+ Lower[1] = B2; //2
+ radmul(3,Lower,Upper,NIterMin,NIter,EPS,WK,NIter,Result,ResErr,NFNEVL,Summary);
+ Integrala = Integrala + Result;
+ totsummary = totsummary + 100*Summary;
+ NEval = NEval + NFNEVL;
+ Upper[0] = u1; //1
+ Upper[1] = u2; //2
+ Lower[0] = B1; //1
+ Lower[1] = B2; //2
+ radmul(3,Lower,Upper,NIterMin,NIter,EPS,WK,NIter,Result,ResErr,NFNEVL,Summary);
+ Integrala = Integrala + Result;
+ totsummary = totsummary + Summary;
+ NEval = NEval + NFNEVL;
+ }
+ else {
+ //integral has 2 parts, b2 integral has only 1 component
+ Integrala = 0;
+ totsummary = 20000;
+ NEval = 0;
+ Lower[0] = RM; //1
+ Lower[1] = RM; //2
+ Lower[2] = 0.; //3
+ Upper[2] = 2.*starlightConstants::pi; //3
+ Upper[0] = B1; //1
+ Upper[1] = u2; //2
+ radmul(3,Lower,Upper,NIterMin,NIter,EPS,WK,NIter,Result,ResErr,NFNEVL,Summary);
+ Integrala = Integrala + Result;
+ totsummary = totsummary + 100*Summary;
+ NEval = NEval + NFNEVL;
+ Upper[0] = u1; //1
+ Lower[0] = B1; //1
+ radmul(3,Lower,Upper,NIterMin,NIter,EPS,WK,NIter,Result,ResErr,NFNEVL,Summary);
+ Integrala = Integrala + Result;
+ totsummary = totsummary + Summary;
+ NEval = NEval + NFNEVL;
+ }
+ }
+ else{
+ if (u2 < RM ){
+ Integrala = 0;
+ totsummary = 0;
+ NEval = 0;
+ }
+ else if (B2 > RM){
+ //integral has 2 parts, b1 integral has only 1 component
+ Integrala = 0;
+ totsummary = 20000;
+ NEval = 0;
+ Lower[0] = RM; //1
+ Lower[1] = RM; //2
+ Lower[2] = 0.; //2
+ Upper[2] = 2.*starlightConstants::pi; //3
+ Upper[0] = u1; //1
+ Upper[1] = B2; //2
+ radmul(3,Lower,Upper,NIterMin,NIter,EPS,WK,NIter,Result,ResErr,NFNEVL,Summary);
+ Integrala = Integrala + Result;
+ totsummary = totsummary + 100*Summary;
+ NEval = NEval + NFNEVL;
+ Upper[1] = u2; //2
+ Lower[1] = B2; //2
+ radmul(3,Lower,Upper,NIterMin,NIter,EPS,WK,NIter,Result,ResErr,NFNEVL,Summary);
+ Integrala = Integrala + Result;
+ totsummary = totsummary + Summary;
+ NEval = NEval + NFNEVL;
+ }
+ else{ //integral has 1 part
+ Integrala = 0;
+ totsummary = 10000;
+ NEval = 0;
+ Lower[0] = RM; //1
+ Lower[1] = RM; //2
+ Lower[2] = 0.; //3
+ Upper[2] = 2.*starlightConstants::pi; //3
+ Upper[0] = u1; //1
+ Upper[1] = u2; //2
+ radmul(3,Lower,Upper,NIterMin,NIter,EPS,WK,NIter,Result,ResErr,NFNEVL,Summary);
+ Integrala = Integrala + Result;
+ totsummary = totsummary + Summary;
+ NEval = NEval + NFNEVL;
+ }
+ }
+ Integrala = 2*starlightConstants::pi*Integrala;
+ return Integrala;
+}
+
+//______________________________________________________________________________
+double twoPhotonLuminosity::radmul(int N,double *A,double *B,int MINPTS,int MAXPTS,double EPS,double *WK,int IWK,double &RESULT,double &RELERR,double &NFNEVL,double &IFAIL)
+{
+ double wn1[14] = { -0.193872885230909911, -0.555606360818980835,
+ -0.876695625666819078, -1.15714067977442459, -1.39694152314179743,
+ -1.59609815576893754, -1.75461057765584494, -1.87247878880251983,
+ -1.94970278920896201, -1.98628257887517146, -1.98221815780114818,
+ -1.93750952598689219, -1.85215668343240347, -1.72615963013768225};
+
+ double wn3[14] = { 0.0518213686937966768, 0.0314992633236803330,
+ 0.0111771579535639891, -0.00914494741655235473, -0.0294670527866686986,
+ -0.0497891581567850424, -0.0701112635269013768, -0.0904333688970177241,
+ -0.110755474267134071, -0.131077579637250419, -0.151399685007366752,
+ -0.171721790377483099, -0.192043895747599447, -0.212366001117715794};
+
+ double wn5[14] = { 0.871183254585174982e-01, 0.435591627292587508e-01,
+ 0.217795813646293754e-01, 0.108897906823146873e-01, 0.544489534115734364e-02,
+ 0.272244767057867193e-02, 0.136122383528933596e-02, 0.680611917644667955e-03,
+ 0.340305958822333977e-03, 0.170152979411166995e-03, 0.850764897055834977e-04,
+ 0.425382448527917472e-04, 0.212691224263958736e-04, 0.106345612131979372e-04};
+
+ double wpn1[14] = { -1.33196159122085045, -2.29218106995884763,
+ -3.11522633744855959, -3.80109739368998611, -4.34979423868312742,
+ -4.76131687242798352, -5.03566529492455417, -5.17283950617283939,
+ -5.17283950617283939, -5.03566529492455417, -4.76131687242798352,
+ -4.34979423868312742, -3.80109739368998611, -3.11522633744855959};
+
+ double wpn3[14] = { 0.0445816186556927292, -0.0240054869684499309,
+ -0.0925925925925925875, -0.161179698216735251, -0.229766803840877915,
+ -0.298353909465020564, -0.366941015089163228, -0.435528120713305891,
+ -0.504115226337448555, -0.572702331961591218, -0.641289437585733882,
+ -0.709876543209876532, -0.778463648834019195, -0.847050754458161859};
+
+ RESULT = 0;
+
+ double ABSERR = 0.;
+ double ctr[15], wth[15], wthl[15], z[15];
+ double R1 = 1.;
+ double HF = R1/2.;
+ double xl2 = 0.358568582800318073;
+ double xl4 = 0.948683298050513796;
+ double xl5 = 0.688247201611685289;
+ double w2 = 980./6561.;
+ double w4 = 200./19683.;
+ double wp2 = 245./486.;
+ double wp4 = 25./729.;
+ int j1 =0;
+ double SUM1, SUM2, SUM3, SUM4, SUM5, RGNCMP=0., RGNVAL, RGNERR, F2, F3, DIF, DIFMAX, IDVAXN =0.;
+ IFAIL = 3;
+ if (N < 2 || N > 15) return 0;
+ if (MINPTS > MAXPTS) return 0;
+ int IFNCLS = 0;
+ int IDVAX0 = 0;
+ bool LDV = false;
+ double TWONDM = pow(2.,(double)(N));
+ int IRGNST = 2*N+3;
+ int IRLCLS = (int)pow(2.,(N))+2*N*(N+1)+1;
+ int ISBRGN = IRGNST;
+ int ISBTMP, ISBTPP;
+ int ISBRGS = IRGNST;
+
+ if ( MAXPTS < IRLCLS ) return 0;
+ for ( int j = 0; j < N; j++ ){ //10
+ ctr[j]=(B[j] + A[j])*HF;
+ wth[j]=(B[j] - A[j])*HF;
+ }
+ L20:
+ double RGNVOL = TWONDM; //20
+ for ( int j = 0; j < N; j++ ){ //30
+ RGNVOL = RGNVOL*wth[j];
+ z[j] = ctr[j];
+ }
+
+ SUM1 = integrand(N,z);
+
+ DIFMAX = 0;
+ SUM2 = 0;
+ SUM3 = 0;
+ for ( int j = 0; j < N; j++ ) { //40
+ z[j]=ctr[j]-xl2*wth[j];
+ F2=integrand(N,z);
+
+ z[j]=ctr[j]+xl2*wth[j];
+ F2=F2+integrand(N,z);
+ wthl[j]=xl4*wth[j];
+
+ z[j]=ctr[j]-wthl[j];
+ F3=integrand(N,z);
+
+ z[j]=ctr[j]+wthl[j];
+ F3=F3+integrand(N,z);
+ SUM2=SUM2+F2;
+ SUM3=SUM3+F3;
+ DIF=fabs(7.*F2-F3-12.*SUM1);
+ DIFMAX=max(DIF,DIFMAX);
+
+ if ( DIFMAX == DIF) IDVAXN = j+1;
+ z[j]=ctr[j];
+
+ }
+
+ SUM4 = 0;
+ for ( int j = 1; j < N; j++){ //70
+
+ j1=j-1;
+ for ( int k = j; k < N; k++){ //60
+ for ( int l = 0; l < 2; l++){ //50
+ wthl[j1]=-wthl[j1];
+ z[j1]=ctr[j1]+wthl[j1];
+ for ( int m = 0; m < 2; m++){ //50
+ wthl[k]=-wthl[k];
+ z[k]=ctr[k]+wthl[k];
+ SUM4=SUM4+integrand(N,z);
+ }
+ }
+ z[k]=ctr[k];
+ }
+ z[j1]=ctr[j1];
+ }
+
+ SUM5 = 0;
+
+ for ( int j = 0; j < N; j++){ //80
+ wthl[j]=-xl5*wth[j];
+ z[j]=ctr[j]+wthl[j];
+ }
+ L90:
+ SUM5=SUM5+integrand(N,z); //line 90
+
+ for (int j = 0; j < N; j++){ //100
+ wthl[j]=-wthl[j];
+ z[j]=ctr[j]+wthl[j];
+ if ( wthl[j] > 0. ) goto L90;
+ }
+
+ RGNCMP = RGNVOL*(wpn1[N-2]*SUM1+wp2*SUM2+wpn3[N-2]*SUM3+wp4*SUM4);
+ RGNVAL = wn1[N-2]*SUM1+w2*SUM2+wn3[N-2]*SUM3+w4*SUM4+wn5[N-2]*SUM5;
+
+ RGNVAL = RGNVOL*RGNVAL;
+ RGNERR = fabs(RGNVAL-RGNCMP);
+ RESULT = RESULT+RGNVAL;
+ ABSERR = ABSERR+RGNERR;
+ IFNCLS = IFNCLS+IRLCLS;
+
+
+ if (LDV){
+ L110:
+
+ ISBTMP = 2*ISBRGN;
+
+ if ( ISBTMP > ISBRGS ) goto L160;
+ if ( ISBTMP < ISBRGS ){
+ ISBTPP = ISBTMP + IRGNST;
+
+ if ( WK[ISBTMP-1] < WK[ISBTPP-1] ) ISBTMP = ISBTPP;
+ }
+
+ if ( RGNERR >= WK[ISBTMP-1] ) goto L160;
+ for ( int k = 0; k < IRGNST; k++){
+ WK[ISBRGN-k-1] = WK[ISBTMP-k-1];
+ }
+ ISBRGN = ISBTMP;
+ goto L110;
+ }
+ L140:
+
+ ISBTMP = (ISBRGN/(2*IRGNST))*IRGNST;
+
+ if ( ISBTMP >= IRGNST && RGNERR > WK[ISBTMP-1] ){
+ for ( int k = 0; k < IRGNST; k++){
+ WK[ISBRGN-k-1]=WK[ISBTMP-k-1];
+ }
+ ISBRGN = ISBTMP;
+ goto L140;
+ }
+ L160:
+
+ WK[ISBRGN-1] = RGNERR;
+ WK[ISBRGN-2] = RGNVAL;
+ WK[ISBRGN-3] = IDVAXN;
+
+ for ( int j = 0; j < N; j++) {
+
+ ISBTMP = ISBRGN-2*j-4;
+ WK[ISBTMP]=ctr[j];
+ WK[ISBTMP-1]=wth[j];
+ }
+ if (LDV) {
+ LDV = false;
+ ctr[IDVAX0-1]=ctr[IDVAX0-1]+2*wth[IDVAX0-1];
+ ISBRGS = ISBRGS + IRGNST;
+ ISBRGN = ISBRGS;
+ goto L20;
+ }
+
+ RELERR=ABSERR/fabs(RESULT);
+
+
+ if ( ISBRGS + IRGNST > IWK ) IFAIL = 2;
+ if ( IFNCLS + 2*IRLCLS > MAXPTS ) IFAIL = 1;
+ if ( RELERR < EPS && IFNCLS >= MINPTS ) IFAIL = 0;
+
+ if ( IFAIL == 3 ) {
+ LDV = true;
+ ISBRGN = IRGNST;
+ ABSERR = ABSERR-WK[ISBRGN-1];
+ RESULT = RESULT-WK[ISBRGN-2];
+ IDVAX0 = (int)WK[ISBRGN-3];
+
+ for ( int j = 0; j < N; j++) {
+ ISBTMP = ISBRGN-2*j-4;
+ ctr[j] = WK[ISBTMP];
+ wth[j] = WK[ISBTMP-1];
+ }
+
+ wth[IDVAX0-1] = HF*wth[IDVAX0-1];
+ ctr[IDVAX0-1] = ctr[IDVAX0-1]-wth[IDVAX0-1];
+ goto L20;
+ }
+ NFNEVL=IFNCLS;
+ return 1;
+}
+
+
+//______________________________________________________________________________
+double twoPhotonLuminosity::integrand(double , // N (unused)
+ double X[])
+{
+ double b1 = X[0]; //1
+ double b2 = X[1]; //2
+ double theta = X[2]; //3
+ //breakup effects distances in fermis, so convert to fermis(factor of hbarcmev)
+ double D = sqrt(b1*b1+b2*b2-2*b1*b2*cos(theta))*starlightConstants::hbarcmev;
+ double integrandx = Nphoton(_W1,_gamma,b1)*Nphoton(_W2,_gamma,b2)*b1*b2*probabilityOfBreakup(D);
+ //why not just use gamma?
+ //switching _input2photon.beamLorentzGamma()to gamma
+ return integrandx;
+}
+
+
+//______________________________________________________________________________
+double twoPhotonLuminosity::Nphoton(double W,double gamma,double Rho)
+{
+ double Nphoton1 =0.;
+ double WGamma = W/gamma;
+ double WGR = 1.0*WGamma*Rho;
+ //factor of Z^2*alpha is omitted
+ double Wphib = WGamma*bessel::dbesk1(WGR);
+
+ Nphoton1 = 1.0/(starlightConstants::pi*starlightConstants::pi)*(Wphib*Wphib);
+ return Nphoton1;
+}
Property changes on: branches/starlight_1.1/src/twophotonluminosity.cpp
___________________________________________________________________
Added: svn:keywords
## -0,0 +1 ##
+Rev Date Author
\ No newline at end of property
Index: branches/starlight_1.1/src/readinluminosity.cpp
===================================================================
--- branches/starlight_1.1/src/readinluminosity.cpp (revision 0)
+++ branches/starlight_1.1/src/readinluminosity.cpp (revision 145)
@@ -0,0 +1,147 @@
+///////////////////////////////////////////////////////////////////////////
+//
+// Copyright 2010
+//
+// This file is part of starlight.
+//
+// starlight is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
+//
+// starlight is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with starlight. If not, see <http://www.gnu.org/licenses/>.
+//
+///////////////////////////////////////////////////////////////////////////
+//
+// File and Version Information:
+// $Rev:: $: revision of last commit
+// $Author:: $: author of last commit
+// $Date:: $: date of last commit
+//
+// Description:
+// Added 18->19 for reading in the luminosity table
+// Incoherent factor added to table --Joey
+//
+//
+//
+///////////////////////////////////////////////////////////////////////////
+
+
+#include <iostream>
+#include <fstream>
+
+#include "readinluminosity.h"
+#include "starlightconstants.h"
+#include "inputParameters.h"
+
+
+using namespace std;
+
+
+//______________________________________________________________________________
+readLuminosity::readLuminosity(const inputParameters& input)//:inputread(input)
+: _Warray(0), _Yarray(0), _Farray(0)
+{
+ //storing inputparameters into protected variables for the object to use them
+ _ReadInputNPT=input.nmbPtBinsInterference();
+ _ReadInputnumy=input.nmbRapidityBins();
+ _ReadInputnumw=input.nmbWBins();
+ _ReadInputgg_or_gP=input.productionMode();
+ _ReadInputinterferencemode=input.interferenceEnabled();
+
+}
+
+
+//______________________________________________________________________________
+readLuminosity::~readLuminosity()
+{
+ if(_Warray) delete [] _Warray;
+ if(_Yarray) delete [] _Yarray;
+ if(_Farray) delete [] _Farray;
+}
+
+
+//______________________________________________________________________________
+void readLuminosity::read()
+{
+
+ if(!_Warray) _Warray = new double[_ReadInputnumw];
+ if(!_Yarray) _Yarray = new double[_ReadInputnumy];
+ if(!_Farray)
+ {
+ _Farray = new double*[_ReadInputnumw];
+ for(int i = 0; i < _ReadInputnumw; i++)
+ {
+ _Farray[i] = new double[_ReadInputnumy];
+ }
+ }
+ double dummy[19]; //14//18
+// double (*finterm)[starlightLimits::MAXWBINS]=new double[starlightLimits::MAXWBINS][starlightLimits::MAXYBINS];
+
+ //decreased from 1000*1000; too big! causes fault!
+ double fpart =0.;
+ double fptsum=0.;
+ ifstream wylumfile;
+
+ _f_max=0.0;
+
+ wylumfile.open("slight.txt");
+ for(int i=0;i < 19;i++){ // was 14; this is to account for sergei's additional parameters ie d-Au//was19
+ wylumfile >> dummy[i];
+ }
+ for(int i=0;i<_ReadInputnumw;i++){
+ wylumfile >> _Warray[i];
+ }
+ for(int i=0;i<_ReadInputnumy;i++){
+ wylumfile >> _Yarray[i];
+ }
+ for(int i=0;i<_ReadInputnumw;i++){
+ for(int j=0;j<_ReadInputnumy;j++){
+ wylumfile >> _Farray[i][j];
+ if( _Farray[i][j] > _f_max ) _f_max=_Farray[i][j];
+ }
+ }
+ //Normalize farray (JN 010402)
+ for(int i=0;i<_ReadInputnumw;i++){
+ for(int j=0;j<_ReadInputnumy;j++){
+ _Farray[i][j]=_Farray[i][j]/_f_max;
+ }
+ }
+
+ if (_ReadInputgg_or_gP != 1 && _ReadInputinterferencemode != 0) {
+ // only numy/2 y bins here, from 0 (not -ymax) to ymax
+ double **finterm = new double*[starlightLimits::MAXWBINS];
+ for (int i = 0; i < starlightLimits::MAXWBINS; i++) finterm[i] = new double[starlightLimits::MAXYBINS];
+ for (int i=0;i<_ReadInputnumy/2;i++) {
+ //fmax=0;
+ //we want to convert _fptarray to an integral array where fpt(i,j) is near 0, and fpt(j,NPT) ~1. This will facilitate a simple table loookup
+ fptsum=0.;
+ for (int j=0;j<_ReadInputNPT;j++) {
+ wylumfile >> fpart;
+ finterm[i][j] = fpart;
+ _fptarray[i][j]=0.;
+ fptsum=fptsum+fpart;
+ }
+ //convert array to integral
+ _fptarray[i][0]=finterm[i][0]/fptsum;
+ for (int j=1;j<_ReadInputNPT;j++) {
+ for (int k=0;k<=j;k++) {
+ _fptarray[i][j]=_fptarray[i][j]+finterm[i][k];
+ }
+ _fptarray[i][j]=_fptarray[i][j]/fptsum;
+ }
+ }
+ delete [] finterm;
+
+ }
+ wylumfile >> _bwnormsave;
+ wylumfile.close();
+ //8delete[] finterm;
+ return;
+}
Property changes on: branches/starlight_1.1/src/readinluminosity.cpp
___________________________________________________________________
Added: svn:keywords
## -0,0 +1 ##
+Rev Date Author
\ No newline at end of property
Index: branches/starlight_1.1/src/incoherentVMCrossSection.cpp
===================================================================
--- branches/starlight_1.1/src/incoherentVMCrossSection.cpp (revision 0)
+++ branches/starlight_1.1/src/incoherentVMCrossSection.cpp (revision 145)
@@ -0,0 +1,158 @@
+///////////////////////////////////////////////////////////////////////////
+//
+// Copyright 2010
+//
+// This file is part of starlight.
+//
+// starlight is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
+//
+// starlight is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with starlight. If not, see <http://www.gnu.org/licenses/>.
+//
+///////////////////////////////////////////////////////////////////////////
+//
+// File and Version Information:
+// $Rev:: 45 $: revision of last commit
+// $Author:: bgrube $: author of last commit
+// $Date:: 2011-02-27 20:52:35 +0100 #$: date of last commit
+//
+// Description:
+//
+//
+//
+///////////////////////////////////////////////////////////////////////////
+
+
+#include <iostream>
+#include <fstream>
+#include <cmath>
+
+#include "starlightconstants.h"
+#include "incoherentVMCrossSection.h"
+
+
+using namespace std;
+using namespace starlightConstants;
+
+
+//______________________________________________________________________________
+incoherentVMCrossSection::incoherentVMCrossSection(const inputParameters& input,
+ const beamBeamSystem& bbsystem)
+ :photonNucleusCrossSection(input, bbsystem)
+{
+ _narrowYmax = input.maxRapidity();
+ _narrowYmin = -1.0*_narrowYmax;
+ _narrowNumY = input.nmbRapidityBins();
+ _Ep = input.getProtonEnergy();
+}
+
+
+//______________________________________________________________________________
+incoherentVMCrossSection::~incoherentVMCrossSection()
+{ }
+
+
+//______________________________________________________________________________
+void
+incoherentVMCrossSection::crossSectionCalculation(const double) // _bwnormsave (unused)
+{
+ // This subroutine calculates the vector meson cross section assuming
+ // a narrow resonance. For reference, see STAR Note 386.
+
+ // double Av,Wgp,cs,cvma;
+ double W,dY;
+ double y1,y2,y12,ega1,ega2,ega12;
+ // double t,tmin,tmax;
+ double csgA1,csgA2,csgA12,int_r,dR,rate;
+ double Wgp,csVN,csVA;
+ double tmp;
+ // double ax,bx;
+ double Eth;
+ int J,NY;
+ // int K,NGAUSS;
+
+ NY = _narrowNumY;
+ dY = (_narrowYmax-_narrowYmin)/double(NY);
+
+ cout<<" Using Narrow Resonance ..."<<endl;
+
+ W = getChannelMass();
+ Eth=0.5*(((W+protonMass)*(W+protonMass)-
+ protonMass*protonMass)/(_Ep+sqrt(_Ep*_Ep-protonMass*protonMass)));
+
+ cout<<" gamma+nucleon Threshold: "<<Eth<<endl;
+ int_r=0.;
+
+ tmp = 0.0;
+
+ for(J=0;J<=(NY-1);J++){
+
+ y1 = _narrowYmin + double(J)*dY;
+ y2 = _narrowYmin + double(J+1)*dY;
+ y12 = 0.5*(y1+y2);
+
+ ega1 = 0.5*W*exp(y1);
+ ega2 = 0.5*W*exp(y2);
+ ega12 = 0.5*W*exp(y12);
+
+ if(ega1 < Eth)
+ continue;
+ if(ega2 > maxPhotonEnergy())
+ continue;
+
+ // First point
+ Wgp = sqrt(2.*ega1*(_Ep+sqrt(_Ep*_Ep-starlightConstants::protonMass*starlightConstants::protonMass))
+ +starlightConstants::protonMass*starlightConstants::protonMass);
+ csVN = sigma_N(Wgp);
+ csVA = sigma_A(csVN);
+ csgA1 = (csVA/csVN)*sigmagp(Wgp);
+ if( getbbs().beam1().A() == 1 || getbbs().beam2().A()==1 ){
+ csgA1 = sigmagp(Wgp);
+ }
+
+ // Middle point
+ Wgp = sqrt(2.*ega12*(_Ep+sqrt(_Ep*_Ep-starlightConstants::protonMass*starlightConstants::protonMass))
+ +starlightConstants::protonMass*starlightConstants::protonMass);
+ csVN = sigma_N(Wgp);
+ csVA = sigma_A(csVN);
+ csgA12 = (csVA/csVN)*sigmagp(Wgp);
+ if( getbbs().beam1().A() == 1 || getbbs().beam2().A()==1 ){
+ csgA12 = sigmagp(Wgp);
+ }
+
+ // Last point
+ Wgp = sqrt(2.*ega2*(_Ep+sqrt(_Ep*_Ep-starlightConstants::protonMass*starlightConstants::protonMass))
+ +starlightConstants::protonMass*starlightConstants::protonMass);
+ csVN = sigma_N(Wgp);
+ csVA = sigma_A(csVN);
+ csgA2 = (csVA/csVN)*sigmagp(Wgp);
+ if( getbbs().beam1().A() == 1 || getbbs().beam2().A()==1 ){
+ csgA2 = sigmagp(Wgp);
+ }
+
+ dR = ega1*photonFlux(ega1)*csgA1;
+ dR = dR + 4*ega12*photonFlux(ega12)*csgA12;
+ dR = dR + ega2*photonFlux(ega2)*csgA2;
+ dR = dR*(dY/6.);
+
+ // cout<<" y: "<<y12<<" egamma: "<<ega12<<" flux: "<<photonFlux(ega12)<<" sigma_gA: "<<10000000.*csgA12<<" dsig/dy (microb): "<<10000.*dR/dY<<endl;
+
+ // The 2 accounts for the 2 beams
+ if(getbbs().beam1().A()==getbbs().beam2().A()){
+ dR = 2.*dR;
+ }
+
+ int_r = int_r+dR;
+
+ }
+ rate=luminosity()*int_r;
+ cout<<" Cross section (mb): " <<10.*int_r<<endl;
+}
Index: branches/starlight_1.1/src/starlight.cpp
===================================================================
--- branches/starlight_1.1/src/starlight.cpp (revision 0)
+++ branches/starlight_1.1/src/starlight.cpp (revision 145)
@@ -0,0 +1,379 @@
+///////////////////////////////////////////////////////////////////////////
+//
+// Copyright 2010
+//
+// This file is part of starlight.
+//
+// starlight is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
+//
+// starlight is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with starlight. If not, see <http://www.gnu.org/licenses/>.
+//
+///////////////////////////////////////////////////////////////////////////
+//
+// File and Version Information:
+// $Rev:: $: revision of last commit
+// $Author:: $: author of last commit
+// $Date:: $: date of last commit
+//
+// Description:
+//
+//
+//
+///////////////////////////////////////////////////////////////////////////
+
+
+#include <iostream>
+#include <fstream>
+#include <cstdlib>
+
+#include "starlightconfig.h"
+
+#ifdef ENABLE_PYTHIA
+#include "PythiaStarlight.h"
+#endif
+
+#ifdef ENABLE_DPMJET
+#include "starlightdpmjet.h"
+#endif
+
+#ifdef ENABLE_PYTHIA6
+#include "starlightpythia.h"
+#endif
+
+#include "reportingUtils.h"
+#include "inputParameters.h"
+#include "eventchannel.h"
+#include "gammagammaleptonpair.h"
+#include "gammagammasingle.h"
+#include "gammaavm.h"
+#include "psifamily.h"
+#include "twophotonluminosity.h"
+#include "gammaaluminosity.h"
+#include "incoherentPhotonNucleusLuminosity.h"
+#include "upcevent.h"
+#include "eventfilewriter.h"
+#include "starlight.h"
+
+
+using namespace std;
+using namespace starlightConstants;
+
+
+starlight::starlight()
+ : _inputParameters (0),
+ _beam0 (0),
+ _beam1 (0),
+ _beamSystem (0),
+ _eventChannel (0),
+ _nmbEventsPerFile (100),
+ _nmbEventsToGenerate (10),
+ _configFileName ("slight.in"),
+ _eventDataFileName ("slight.out"),
+ _lumLookUpTableFileName("slight.txt"),
+ _isInitialised (false)
+{ }
+
+
+starlight::~starlight()
+{ }
+
+
+bool
+starlight::init()
+{
+ cout << "##################################" << endl
+ << " initialising Starlight v" << Starlight_VERSION_MAJOR << "."
+ << Starlight_VERSION_MINOR << "..." << endl
+ << "##################################" << endl;
+
+ _nmbEventsToGenerate = _inputParameters->nmbEvents(); // nmbEvents() gives only unsigned int
+ _nmbEventsPerFile = _nmbEventsToGenerate; // for now we write only one file...
+
+ _beamSystem = new beamBeamSystem(*_inputParameters);
+
+ // streamsize precision(15);
+ cout.setf(ios_base::fixed,ios_base::floatfield);
+ cout.precision(15);
+ const bool lumTableIsValid = luminosityTableIsValid();
+ bool createChannel = true;
+ switch (_inputParameters->interactionType()) {
+ case PHOTONPHOTON:
+ if (!lumTableIsValid) {
+ printInfo << "creating luminosity table for photon-photon channel" << endl;
+ twoPhotonLuminosity(_beamSystem->beam1(), _beamSystem->beam2(), *_inputParameters);
+ }
+ break;
+ case PHOTONPOMERONNARROW: // narrow and wide resonances use
+ case PHOTONPOMERONWIDE: // the same luminosity function
+ if (!lumTableIsValid) {
+ printInfo << "creating luminosity table for coherent photon-Pomeron channel" << endl;
+ photonNucleusLuminosity(*_inputParameters, *_beamSystem);
+ }
+ break;
+ case PHOTONPOMERONINCOHERENT: // narrow and wide resonances use
+ if (!lumTableIsValid) {
+ printInfo << "creating luminosity table for incoherent photon-Pomeron channel" << endl;
+ incoherentPhotonNucleusLuminosity(*_inputParameters, *_beamSystem);
+ }
+ break;
+#ifdef ENABLE_DPMJET
+ case PHOTONUCLEARSINGLE:
+ createChannel = false;
+ _eventChannel = new starlightDpmJet(*_inputParameters, *_beamSystem);
+ std::cout << "CREATING PHOTONUCLEAR/DPMJET SINGLE" << std::endl;
+ dynamic_cast<starlightDpmJet*>(_eventChannel)->setSingleMode();
+ dynamic_cast<starlightDpmJet*>(_eventChannel)->setMinGammaEnergy(_inputParameters->minGammaEnergy());
+ dynamic_cast<starlightDpmJet*>(_eventChannel)->setMaxGammaEnergy(_inputParameters->maxGammaEnergy());
+ dynamic_cast<starlightDpmJet*>(_eventChannel)->init();
+ break;
+ case PHOTONUCLEARDOUBLE:
+ createChannel = false;
+ _eventChannel = new starlightDpmJet(*_inputParameters, *_beamSystem);
+ std::cout << "CREATING PHOTONUCLEAR/DPMJET DOUBLE" << std::endl;
+ dynamic_cast<starlightDpmJet*>(_eventChannel)->setDoubleMode();
+ dynamic_cast<starlightDpmJet*>(_eventChannel)->setMinGammaEnergy(_inputParameters->minGammaEnergy());
+ dynamic_cast<starlightDpmJet*>(_eventChannel)->setMaxGammaEnergy(_inputParameters->maxGammaEnergy());
+ dynamic_cast<starlightDpmJet*>(_eventChannel)->init();
+ break;
+ case PHOTONUCLEARSINGLEPA:
+ createChannel = false;
+ _eventChannel = new starlightDpmJet(*_inputParameters, *_beamSystem);
+ std::cout << "CREATING PHOTONUCLEAR/DPMJET SINGLE" << std::endl;
+ dynamic_cast<starlightDpmJet*>(_eventChannel)->setSingleMode();
+ dynamic_cast<starlightDpmJet*>(_eventChannel)->setProtonMode();
+ dynamic_cast<starlightDpmJet*>(_eventChannel)->setMinGammaEnergy(_inputParameters->minGammaEnergy());
+ dynamic_cast<starlightDpmJet*>(_eventChannel)->setMaxGammaEnergy(_inputParameters->maxGammaEnergy());
+ dynamic_cast<starlightDpmJet*>(_eventChannel)->init();
+ break;
+#endif
+#ifdef ENABLE_PYTHIA6
+ case PHOTONUCLEARSINGLEPAPY:
+ createChannel = false;
+ _eventChannel = new starlightPythia(*_inputParameters, *_beamSystem);
+ std::cout << "CREATING PHOTONUCLEAR/PYTHIA SINGLE" << std::endl;
+ dynamic_cast<starlightPythia*>(_eventChannel)->setSingleMode();
+ dynamic_cast<starlightPythia*>(_eventChannel)->setMinGammaEnergy(_inputParameters->minGammaEnergy());
+ dynamic_cast<starlightPythia*>(_eventChannel)->setMaxGammaEnergy(_inputParameters->maxGammaEnergy());
+ dynamic_cast<starlightPythia*>(_eventChannel)->init(_inputParameters->pythiaParams(), _inputParameters->pythiaFullEventRecord());
+ break;
+#endif
+ default:
+ {
+ printWarn << "unknown interaction type '" << _inputParameters->interactionType() << "'."
+ << " cannot initialize starlight." << endl;
+ return false;
+ }
+ }
+
+ if(createChannel)
+ {
+ if (!createEventChannel())
+ return false;
+ }
+
+ _isInitialised = true;
+ return true;
+}
+
+
+upcEvent
+starlight::produceEvent()
+{
+ if (!_isInitialised) {
+ printErr << "trying to generate event but Starlight is not initialised. aborting." << endl;
+ exit(-1);
+ }
+ return _eventChannel->produceEvent();
+}
+
+
+bool
+starlight::luminosityTableIsValid() const
+{
+ printInfo << "using random seed = " << _inputParameters->randomSeed() << endl;
+
+ ifstream lumLookUpTableFile(_lumLookUpTableFileName.c_str());
+ lumLookUpTableFile.precision(15);
+ if ((!lumLookUpTableFile) || (!lumLookUpTableFile.good())) {
+ // printWarn << "cannot open file '" << _lumLookUpTableFileName << "'" << endl;
+ return false;
+ }
+
+ unsigned int beam1Z, beam1A, beam2Z, beam2A;
+ double beamLorentzGamma = 0;
+ double maxW = 0, minW = 0;
+ unsigned int nmbWBins;
+ double maxRapidity = 0;
+ unsigned int nmbRapidityBins;
+ int productionMode, beamBreakupMode;
+ bool interferenceEnabled = false;
+ double interferenceStrength = 0;
+ bool coherentProduction = false;
+ double incoherentFactor = 0, deuteronSlopePar = 0, maxPtInterference = 0;
+ int nmbPtBinsInterference;
+ if (!(lumLookUpTableFile
+ >> beam1Z >> beam1A
+ >> beam2Z >> beam2A
+ >> beamLorentzGamma
+ >> maxW >> minW >> nmbWBins
+ >> maxRapidity >> nmbRapidityBins
+ >> productionMode
+ >> beamBreakupMode
+ >> interferenceEnabled >> interferenceStrength
+ >> coherentProduction >> incoherentFactor
+ >> deuteronSlopePar
+ >> maxPtInterference
+ >> nmbPtBinsInterference))
+ // cannot read parameters from lookup table file
+ return false;
+ lumLookUpTableFile.close();
+
+ if (!( _inputParameters->beam1Z() == beam1Z
+ && _inputParameters->beam1A() == beam1A
+ && _inputParameters->beam2Z() == beam2Z
+ && _inputParameters->beam2A() == beam2A
+ && _inputParameters->beamLorentzGamma() == beamLorentzGamma
+ //&& _inputParameters->maxW() == maxW
+ && _inputParameters->minW() == minW
+ && _inputParameters->nmbWBins() == nmbWBins
+ && _inputParameters->maxRapidity() == maxRapidity
+ && _inputParameters->nmbRapidityBins() == nmbRapidityBins
+ && _inputParameters->productionMode() == productionMode
+ && _inputParameters->beamBreakupMode() == beamBreakupMode
+ && _inputParameters->interferenceEnabled() == interferenceEnabled
+ && _inputParameters->interferenceStrength() == interferenceStrength
+ && _inputParameters->deuteronSlopePar() == deuteronSlopePar
+ && _inputParameters->coherentProduction() == coherentProduction
+ && _inputParameters->incoherentFactor() == incoherentFactor
+ && _inputParameters->maxPtInterference() == maxPtInterference
+ && _inputParameters->nmbPtBinsInterference() == nmbPtBinsInterference))
+ // parameters used to create luminosity lookup table are different than current parameters
+ return false;
+
+ return true;
+}
+
+
+bool
+starlight::createEventChannel()
+{
+ switch (_inputParameters->prodParticleType()) {
+ case ELECTRON:
+ case MUON:
+ case TAUON:
+ {
+ _eventChannel = new Gammagammaleptonpair(*_inputParameters, *_beamSystem);
+ if (_eventChannel)
+ return true;
+ else {
+ printWarn << "cannot construct Gammagammaleptonpair event channel." << endl;
+ return false;
+ }
+ }
+ case A2: // jetset
+ case ETA: // jetset
+ case ETAPRIME: // jetset
+ case ETAC: // jetset
+ case F0: // jetset
+ {
+#ifdef ENABLE_PYTHIA
+ // PythiaOutput = true;
+ cout<<"Pythia is enabled!"<<endl;
+// return true;
+#else
+ printWarn << "Starlight is not compiled against Pythia8; "
+ << "jetset event channel cannot be used." << endl;
+ return false;
+#endif
+ }
+ case F2:
+ case F2PRIME:
+ case ZOVERZ03:
+ {
+ // #ifdef ENABLE_PYTHIA
+ cout<<" This is f2, f2prim, zoverz03 "<<endl;
+ _eventChannel= new Gammagammasingle(*_inputParameters, *_beamSystem);
+ if (_eventChannel)
+ return true;
+ else {
+ printWarn << "cannot construct Gammagammasingle event channel." << endl;
+ return false;
+ }
+ // #endif
+ // printWarn << "Starlight is not compiled against Pythia8; "
+ // << "Gammagammasingle event channel cannot be used." << endl;
+ // return false;
+ }
+ case RHO:
+ case RHOZEUS:
+ case FOURPRONG:
+ case OMEGA:
+ case PHI:
+ case JPSI:
+ case JPSI2S:
+ case JPSI2S_ee:
+ case JPSI2S_mumu:
+ case JPSI_ee:
+ case JPSI_mumu:
+ case UPSILON:
+ case UPSILON_ee:
+ case UPSILON_mumu:
+ case UPSILON2S:
+ case UPSILON2S_ee:
+ case UPSILON2S_mumu:
+ case UPSILON3S:
+ case UPSILON3S_ee:
+ case UPSILON3S_mumu:
+ {
+ if (_inputParameters->interactionType() == PHOTONPOMERONNARROW) {
+ _eventChannel = new Gammaanarrowvm(*_inputParameters, *_beamSystem);
+ if (_eventChannel)
+ return true;
+ else {
+ printWarn << "cannot construct Gammaanarrowvm event channel." << endl;
+ return false;
+ }
+ }
+
+ if (_inputParameters->interactionType() == PHOTONPOMERONWIDE) {
+ _eventChannel = new Gammaawidevm(*_inputParameters, *_beamSystem);
+ if (_eventChannel)
+ return true;
+ else {
+ printWarn << "cannot construct Gammaawidevm event channel." << endl;
+ return false;
+ }
+ }
+
+ if (_inputParameters->interactionType() == PHOTONPOMERONINCOHERENT) {
+ _eventChannel = new Gammaaincoherentvm(*_inputParameters, *_beamSystem);
+ if (_eventChannel)
+ return true;
+ else {
+ printWarn << "cannot construct Gammaanarrowvm event channel." << endl;
+ return false;
+ }
+ }
+
+ printWarn << "interaction type '" << _inputParameters->interactionType() << "' "
+ << "cannot be used with particle type '" << _inputParameters->prodParticleType() << "'. "
+ << "cannot create event channel." << endl;
+ return false;
+ }
+ default:
+ {
+ printWarn << "unknown event channel '" << _inputParameters->prodParticleType() << "'."
+ << " cannot create event channel." << endl;
+ return false;
+ }
+ }
+}
Property changes on: branches/starlight_1.1/src/starlight.cpp
___________________________________________________________________
Added: svn:keywords
## -0,0 +1 ##
+Rev Date Author
\ No newline at end of property
Index: branches/starlight_1.1/src/nBodyPhaseSpaceGen.cpp
===================================================================
--- branches/starlight_1.1/src/nBodyPhaseSpaceGen.cpp (revision 0)
+++ branches/starlight_1.1/src/nBodyPhaseSpaceGen.cpp (revision 145)
@@ -0,0 +1,258 @@
+///////////////////////////////////////////////////////////////////////////
+//
+// Copyright 2010
+//
+// This file is part of starlight.
+//
+// starlight is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
+//
+// starlight is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with starlight. If not, see <http://www.gnu.org/licenses/>.
+//
+///////////////////////////////////////////////////////////////////////////
+//
+// File and Version Information:
+// $Rev:: $: revision of last commit
+// $Author:: $: author of last commit
+// $Date:: $: date of last commit
+//
+// Description:
+// see nBodyPhaseSpaceGen.h
+//
+//
+///////////////////////////////////////////////////////////////////////////
+
+
+#include <algorithm>
+
+#include "nBodyPhaseSpaceGen.h"
+
+
+using namespace std;
+using namespace starlightConstants;
+
+
+nBodyPhaseSpaceGen::nBodyPhaseSpaceGen()
+ : _n (0),
+ _norm (0),
+ _weight (0),
+ _maxWeightObserved(0),
+ _maxWeight (0)
+{ }
+
+
+nBodyPhaseSpaceGen::~nBodyPhaseSpaceGen()
+{ }
+
+
+// sets decay constants and prepares internal variables
+bool
+nBodyPhaseSpaceGen::setDecay(const vector<double>& daughterMasses) // array of daughter particle masses
+{
+ _n = daughterMasses.size();
+ if (_n < 2) {
+ printWarn << "number of daughters = " << _n << " does not make sense." << endl;
+ return false;
+ }
+ // copy daughter masses
+ _m.clear();
+ _m = daughterMasses;
+ // prepare effective mass vector
+ _M.clear();
+ _M.resize(_n, 0);
+ _M[0] = _m[0];
+ // prepare angle vectors
+ _cosTheta.clear();
+ _cosTheta.resize(_n, 0);
+ _phi.clear();
+ _phi.resize(_n, 0);
+ // calculate daughter mass sums
+ _mSum.clear();
+ _mSum.resize(_n, 0);
+ _mSum[0] = _m[0];
+ for (unsigned int i = 1; i < _n; ++i)
+ _mSum[i] = _mSum[i - 1] + _m[i];
+ // prepare breakup momentum vector
+ _breakupMom.clear();
+ _breakupMom.resize(_n, 0);
+ // prepare vector for daughter Lorentz vectors
+ _daughters.clear();
+ _daughters.resize(_n, lorentzVector(0, 0, 0, 0));
+ // calculate normalization
+ _norm = 1 / (2 * pow(twoPi, 2 * (int)_n - 3) * factorial(_n - 2));
+ resetMaxWeightObserved();
+ return true;
+}
+
+
+// set decay constants and prepare internal variables
+bool
+nBodyPhaseSpaceGen::setDecay(const unsigned int nmbOfDaughters, // number of daughter particles
+ const double* daughterMasses) // array of daughter particle masses
+{
+ vector <double> m;
+ m.resize(nmbOfDaughters, 0);
+ for (unsigned int i = 0; i < nmbOfDaughters; ++i)
+ m[i] = daughterMasses[i];
+ return setDecay(m);
+}
+
+
+// generates event with certain n-body mass and momentum and returns event weigth
+// general purpose function
+double
+nBodyPhaseSpaceGen::generateDecay(const lorentzVector& nBody) // Lorentz vector of n-body system in lab frame
+{
+ const double nBodyMass = nBody.M();
+ if (_n < 2) {
+ printWarn << "number of daughter particles = " << _n << " is smaller than 2. "
+ << "weight is set to 0." << endl;
+ _weight = 0;
+ } else if (nBodyMass < _mSum[_n - 1]) {
+ printWarn << "n-body mass = " << nBodyMass << " is smaller than sum of daughter masses = "
+ << _mSum[_n - 1] << ". weight is set to 0." << endl;
+ _weight = 0;
+ } else {
+ pickMasses(nBodyMass);
+ calcWeight();
+ pickAngles();
+ calcEventKinematics(nBody);
+ }
+ return _weight;
+}
+
+
+// generates full event with certain n-body mass and momentum only, when event is accepted (return value = true)
+// this function is more efficient, if only weighted evens are needed
+bool
+nBodyPhaseSpaceGen::generateDecayAccepted(const lorentzVector& nBody, // Lorentz vector of n-body system in lab frame
+ const double maxWeight) // if positive, given value is used as maximum weight, otherwise _maxWeight
+{
+ const double nBodyMass = nBody.M();
+ if (_n < 2) {
+ printWarn << "number of daughter particles = " << _n << " is smaller than 2. "
+ << "no event generated." << endl;
+ return false;
+ } else if (nBodyMass < _mSum[_n - 1]) {
+ printWarn << "n-body mass = " << nBodyMass << " is smaller than sum of daughter masses = "
+ << _mSum[_n - 1] << ". no event generated." << endl;
+ return false;
+ }
+ pickMasses(nBodyMass);
+ calcWeight();
+ if (!eventAccepted(maxWeight))
+ return false;
+ pickAngles();
+ calcEventKinematics(nBody);
+ return true;
+}
+
+
+// randomly choses the (n - 2) effective masses of the respective (i + 1)-body systems
+void
+nBodyPhaseSpaceGen::pickMasses(const double nBodyMass) // total energy of the system in its RF
+{
+ _M[_n - 1] = nBodyMass;
+ // create vector of sorted random values
+ vector<double> r(_n - 2, 0); // (n - 2) values needed for 2- through (n - 1)-body systems
+ for (unsigned int i = 0; i < (_n - 2); ++i)
+ r[i] = random();
+ sort(r.begin(), r.end());
+ // set effective masses of (intermediate) two-body decays
+ const double massInterval = nBodyMass - _mSum[_n - 1]; // kinematically allowed mass interval
+ for (unsigned int i = 1; i < (_n - 1); ++i) // loop over intermediate 2- to (n - 1)-bodies
+ _M[i] = _mSum[i] + r[i - 1] * massInterval; // _mSum[i] is minimum effective mass
+}
+
+
+// computes event weight (= integrand value) and breakup momenta
+// uses vector of intermediate two-body masses prepared by pickMasses()
+double
+nBodyPhaseSpaceGen::calcWeight()
+{
+ for (unsigned int i = 1; i < _n; ++i) // loop over 2- to n-bodies
+ _breakupMom[i] = breakupMomentum(_M[i], _M[i - 1], _m[i]);
+ double momProd = 1; // product of breakup momenta
+ for (unsigned int i = 1; i < _n; ++i) // loop over 2- to n-bodies
+ momProd *= _breakupMom[i];
+ const double massInterval = _M[_n - 1] - _mSum[_n - 1]; // kinematically allowed mass interval
+ _weight = _norm * pow(massInterval, (int)_n - 2) * momProd / _M[_n - 1];
+ if (_weight > _maxWeightObserved)
+ _maxWeightObserved = _weight;
+ if (isnan(_weight))
+ printWarn << "weight = " << _weight << endl;
+ return _weight;
+}
+
+
+// calculates complete event from the effective masses of the (i + 1)-body
+// systems, the Lorentz vector of the decaying system, and the decay angles
+// uses the break-up momenta calculated by calcWeight()
+void
+nBodyPhaseSpaceGen::calcEventKinematics(const lorentzVector& nBody) // Lorentz vector of n-body system in lab frame
+{
+ // build event starting in n-body RF going down to 2-body RF
+ // is more efficicient than Raubold-Lynch method, since it requitres only one rotation and boost per daughter
+ lorentzVector P = nBody; // Lorentz of (i + 1)-body system in lab frame
+ for (unsigned int i = _n - 1; i >= 1; --i) { // loop from n-body down to 2-body
+ // construct Lorentz vector of daughter _m[i] in (i + 1)-body RF
+ const double sinTheta = sqrt(1 - _cosTheta[i] * _cosTheta[i]);
+ const double pT = _breakupMom[i] * sinTheta;
+ lorentzVector& daughter = _daughters[i];
+ daughter.SetPxPyPzE(pT * cos(_phi[i]),
+ pT * sin(_phi[i]),
+ _breakupMom[i] * _cosTheta[i],
+ sqrt(_m[i] * _m[i] + _breakupMom[i] * _breakupMom[i]));
+ // boost daughter into lab frame
+ daughter.Boost(P.BoostVector());
+ // calculate Lorentz vector of i-body system in lab frame
+ P -= daughter;
+ }
+ // set last daughter
+ _daughters[0] = P;
+}
+
+
+// calculates maximum weight for given n-body mass
+double
+nBodyPhaseSpaceGen::estimateMaxWeight(const double nBodyMass, // sic!
+ const unsigned int nmbOfIterations) // number of generated events
+{
+ double maxWeight = 0;
+ for (unsigned int i = 0; i < nmbOfIterations; ++i) {
+ pickMasses(nBodyMass);
+ calcWeight();
+ maxWeight = max(_weight, maxWeight);
+ }
+ return maxWeight;
+}
+
+
+ostream&
+nBodyPhaseSpaceGen::print(ostream& out) const
+{
+ out << "nBodyPhaseSpaceGen parameters:" << endl
+ << " number of daughter particles ............... " << _n << endl
+ << " masses of the daughter particles ........... " << _m << endl
+ << " sums of daughter particle masses ........... " << _mSum << endl
+ << " effective masses of (i + 1)-body systems ... " << _M << endl
+ << " cos(polar angle) in (i + 1)-body systems ... " << _cosTheta << endl
+ << " azimuth in (i + 1)-body systems ............ " << _phi << endl
+ << " breakup momenta in (i + 1)-body systems .... " << _breakupMom << endl
+ << " normalization value ........................ " << _norm << endl
+ << " weight of generated event .................. " << _weight << endl
+ << " maximum weight used in hit-miss MC ......... " << _maxWeight << endl
+ << " maximum weight since instantiation ......... " << _maxWeightObserved << endl
+ << " daughter four-momenta:" << endl;
+ for (unsigned int i = 0; i < _n; ++i)
+ out << " daughter " << i << ": " << _daughters[i] << endl;
+ return out;
+}
Property changes on: branches/starlight_1.1/src/nBodyPhaseSpaceGen.cpp
___________________________________________________________________
Added: svn:keywords
## -0,0 +1 ##
+Rev Date Author
\ No newline at end of property
Index: branches/starlight_1.1/src/spectrum.cpp
===================================================================
--- branches/starlight_1.1/src/spectrum.cpp (revision 0)
+++ branches/starlight_1.1/src/spectrum.cpp (revision 145)
@@ -0,0 +1,486 @@
+
+/*
+ <one line to give the program's name and a brief idea of what it does.>
+ Copyright (C) <year> <name of author>
+
+p This program is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation, either version 3 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see <http://www.gnu.org/licenses/>.
+
+*/
+
+#include "spectrum.h"
+#include <cmath>
+#include "beambeamsystem.h"
+#include <randomgenerator.h>
+#include <iostream>
+
+spectrum::spectrum(beamBeamSystem *bbs) :
+ _bMin(5.0)
+ ,_bMax(128000.0)
+ ,_nBbins(6400)
+ ,_probOfBreakup(_nBbins)
+ ,_beamBeamSystem(bbs)
+ ,_nK(10000)
+ ,_fnSingle(_nK)
+ ,_fnDouble(_nK)
+ ,_fnSingleCumulative(_nK+1)
+ ,_fnDoubleCumulative(_nK+1)
+ ,_fnDoubleInt(_nK)
+ ,_fnDoubleIntCumulative(_nK+1)
+ ,_eGamma(_nK+1)
+ ,_eGammaMin(6.0)
+ ,_eGammaMax(600000.0)
+ ,_zTarget(82)
+ ,_aTarget(278)
+ ,_hadBreakProbCalculated(false)
+ ,_randomGenerator(0)
+{
+ _eGamma.resize(_nK+1);
+ _probOfBreakup.resize(_nBbins);
+}
+
+int spectrum::generateKsingle()
+{
+
+ _fnSingle.resize(_nK);
+ _fnSingleCumulative.resize(_nK+1);
+
+ double eg_inc = exp(log(_eGammaMax/_eGammaMin)/(double)_nK);
+
+ double egamma = _eGammaMin;
+ for (int i = 0; i < _nK+1; i++)
+ {
+ _eGamma[i] = egamma;
+ egamma = egamma * eg_inc;
+ }
+ egamma = _eGammaMin;
+
+ double fnorm = 0;
+
+
+ if (_hadBreakProbCalculated == false)
+ {
+ _hadBreakProbCalculated = generateBreakupProbabilities();
+ }
+ double binc = exp((log(_bMax/_bMin))/(double)_nBbins);
+
+ for (int i = 0; i < _nK; i++)
+ {
+ double b = _bMin;
+
+ double bint = 0.0;
+
+ double f1 = 0;
+ double f2 = 0;
+
+ for (int j = 0; j < _nBbins - 1; j++)
+ {
+ double bold = b;
+ if (j == 0)
+ {
+ //f1 = fBeamBeamSystem->getBeam1().nofe(egamma, b)*GetSigma(egamma)*fProbOfBreakup[j]*b;
+ f1 = getTransformedNofe(egamma, b)*getSigma(egamma)*_probOfBreakup[j]*b;
+ //std::cout << fProbOfBreakup[j] << std::endl;
+ }
+ else
+ {
+ f1 = f2;
+ }
+ b = b*binc;
+// f2 = fBeamBeamSystem->getBeam1().nofe(egamma, b)*GetSigma(egamma)*fProbOfBreakup[j+1]*b;;
+ f2 = getTransformedNofe(egamma, b)*getSigma(egamma)*_probOfBreakup[j+1]*b;;
+ bint = bint + 0.5*(f1+f2)*(b-bold);
+ }
+ bint = 2.0*starlightConstants::pi*bint;
+ if (i == 0)
+ {
+ fnorm = 1.0/bint;
+ }
+ _fnSingle[i] = bint*(_eGamma[i+1]-_eGamma[i]);
+
+ egamma = egamma*eg_inc;
+ }
+
+ _fnSingleCumulative[0] = 0.00;
+ for (int i = 0; i < _nK; i++)
+ {
+ _fnSingleCumulative[i+1] = _fnSingleCumulative[i]+_fnSingle[i];
+ }
+
+ double fnormfactor = 1.00/_fnSingleCumulative[_nK];
+ for (int i = 0; i < _nK; i++)
+ {
+ _fnSingleCumulative[i+1] = fnormfactor*_fnSingleCumulative[i+1];
+ }
+
+ return 0;
+
+}
+
+int spectrum::generateKdouble()
+{
+ //Quick fix for now TODO: Fix it!
+ _nK = 100;
+
+ _fnDouble.resize(_nK);
+ _fnDoubleInt.resize(_nK);
+ _fnDoubleIntCumulative.resize(_nK+1);
+ _fnDoubleCumulative.resize(_nK+1);
+ for (int i = 0; i < _nK; i++)
+ {
+ _fnDouble[i].resize(_nK);
+ _fnDoubleCumulative[i].resize(_nK+1);
+ }
+ _fnDoubleCumulative[_nK].resize(_nK+1);
+
+ double eg_inc = exp(log(_eGammaMax/_eGammaMin)/(double)_nK);
+ double egamma1 = _eGammaMin;
+ double egamma2 = _eGammaMin;
+
+ for (int i = 0; i < _nK+1; i++)
+ {
+ _eGamma[i] = egamma1;
+ egamma1 = egamma1 * eg_inc;
+ }
+ egamma1 = _eGammaMin;
+
+ double fnorm = 0;
+
+ if (_hadBreakProbCalculated == false)
+ {
+ _hadBreakProbCalculated = generateBreakupProbabilities();
+ }
+
+ double binc = exp((log(_bMax/_bMin))/(double)_nBbins);
+
+ int nbbins = _nBbins;
+
+ //double b_min = _bMin;
+ //double b_max = _bMax;
+
+ for (int i = 0; i < _nK; i++)
+ {
+
+ egamma2 = _eGammaMin;
+ //double sum_over_k = 0.0;
+
+ for (int j = 0; j < _nK; j++)
+ {
+ double bint = 0.0;
+ double b = _bMin;
+ double f1 = 0;
+ double f2 = 0;
+
+ for (int k = 0; k < nbbins - 1; k++)
+ {
+ double bold = b;
+
+ if (k == 0)
+ {
+ // f1 = fBeamBeamSystem->getBeam1().nofe(egamma1, b) * fBeamBeamSystem->getBeam2().nofe(egamma2, b)
+ // * GetSigma(egamma1) * GetSigma(egamma2) *fProbOfBreakup[j]*b;
+ f1 = getTransformedNofe(egamma1, b) * getTransformedNofe(egamma2, b)
+ * getSigma(egamma1) * getSigma(egamma2) *_probOfBreakup[k]*b; }
+ else
+ {
+ f1 = f2;
+ }
+ b = b*binc;
+ // f2 = fBeamBeamSystem->getBeam1().nofe(egamma1, b) * fBeamBeamSystem->getBeam2().nofe(egamma2, b)
+ // * GetSigma(egamma1) * GetSigma(egamma2) *fProbOfBreakup[j+1]*b;
+ f2 = getTransformedNofe(egamma1, b) * getTransformedNofe(egamma2, b)
+ * getSigma(egamma1) * getSigma(egamma2) *_probOfBreakup[k+1]*b;
+ bint = bint + 0.5*(f1+f2)*(b-bold);
+ }
+ bint = 2.0*starlightConstants::pi*bint;
+ _fnDouble[i][j] = bint * (_eGamma[i+1] - _eGamma[i]) * (_eGamma[j+1] - _eGamma[j]);
+ egamma2 = egamma2 * eg_inc;
+ }
+ egamma1 = egamma1 * eg_inc;
+ }
+
+ for (int i = 0; i < _nK; i++)
+ {
+ _fnDoubleInt[i] = 0.0;
+ for (int j = 0; j < _nK; j++)
+ {
+ _fnDoubleInt[i] = _fnDoubleInt[i] + _fnDouble[i][j];
+ }
+ }
+
+ _fnDoubleIntCumulative[0] = 0.0;
+ for (int i = 1; i < _nK+1; i++)
+ {
+ _fnDoubleIntCumulative[i] = _fnDoubleIntCumulative[i-1] + _fnDoubleInt[i-1];
+ }
+
+ fnorm = 1.0/_fnDoubleIntCumulative[_nK];
+ for (int i = 0; i < _nK+1; i++)
+ {
+ _fnDoubleIntCumulative[i] = fnorm * _fnDoubleIntCumulative[i];
+ }
+
+ return 0;
+}
+
+double spectrum::drawKsingle()
+{
+ double xtest = 0;
+ int itest = 0;
+ double egamma = 0.0;
+
+ xtest = _randomGenerator->Rndom();
+ while (xtest > _fnSingleCumulative[itest])
+ {
+ itest++;
+ }
+ itest = itest - 1;
+
+ if (itest >= _nK || itest < 0)
+ {
+ std::cerr << "ERROR: itest: " << itest << std::endl;
+
+ }
+
+ double delta_f = xtest - _fnSingleCumulative[itest];
+ if (delta_f <= 0.0)
+ {
+ std::cout << "WARNING: delta_f: " << delta_f << std::endl;
+ return -1;
+ }
+ double dE = _eGamma[itest+1] - _eGamma[itest];
+ double dF = _fnSingleCumulative[itest+1] - _fnSingleCumulative[itest];
+
+ double delta_e = delta_f*dE/dF;
+
+ if (delta_e > (_eGamma[itest+1] - _eGamma[itest]))
+ {
+ std::cerr << "ERROR: delta_E: " << delta_e << std::endl;
+ }
+
+ egamma = _eGamma[itest] + delta_e;
+ return egamma;
+}
+
+void spectrum::drawKdouble(float& egamma1, float& egamma2)
+{
+ double xtest1 = 0.0;
+ double xtest2 = 0.0;
+ int itest1 = 0;
+ int itest2 = 0;
+
+ xtest1 = _randomGenerator->Rndom();
+
+ while (xtest1 > _fnDoubleIntCumulative[itest1])
+ {
+ itest1++;
+ }
+ itest1 = itest1 - 1;
+
+ if (itest1 >= _nK || itest1 < 0)
+ {
+ std::cerr << "ERROR: itest1: " << itest1 << std::endl;
+ }
+ double delta_f = xtest1 - _fnDoubleIntCumulative[itest1];
+
+ if (delta_f <= 0.0)
+ {
+ std::cout << "WARNING: delta_f: " << delta_f << std::endl;
+ }
+
+ double dE = _eGamma[itest1+1] - _eGamma[itest1];
+ double dF = _fnDoubleIntCumulative[itest1+1] - _fnDoubleIntCumulative[itest1];
+
+ double delta_e = delta_f*dE/dF;
+
+ if (delta_e > (_eGamma[itest1+1] - _eGamma[itest1]))
+ {
+ std::cerr << "ERROR: delta_E: " << delta_e << std::endl;
+ }
+
+ egamma1 = _eGamma[itest1] + delta_e;
+
+ // Second gamma
+
+ // double reldw = delta_e/(fEGamma[itest1+1] - fEGamma[itest1]);
+ // std::vector<double> fn_second(fNK);
+ std::vector<double> fn_second_cumulative(_nK+1);
+
+ // for(int i = 0; i < fNK; i++)
+ // {
+ // fn_second[i] = fFnDouble[itest1][i] + (fFnDouble[itest1+1][i] - fFnDouble[itest1][i])*reldw;
+ // }
+
+ fn_second_cumulative[0] = 0.0;
+ for(int i = 1; i < _nK+1; i++)
+ {
+ // fn_second_cumulative[i] = fn_second_cumulative[i-1] + fn_second[i-1]; //TODO:check indexing
+ fn_second_cumulative[i] = fn_second_cumulative[i-1] + _fnDouble[itest1][i-1];
+ }
+
+ double norm_factor = 1.0/fn_second_cumulative[_nK];
+ for(int i = 0; i < _nK+1; i++)
+ {
+ fn_second_cumulative[i] = norm_factor*fn_second_cumulative[i];
+ }
+
+ xtest2 = _randomGenerator->Rndom();
+
+ while (xtest2 > fn_second_cumulative[itest2])
+ {
+ itest2++;
+ }
+ itest2 = itest2 - 1;
+
+ if (itest2 >= _nK || itest2 < 0)
+ {
+ std::cerr << "ERROR: itest2: " << itest2 << std::endl;
+ }
+ delta_f = xtest2 - fn_second_cumulative[itest2];
+
+ if (delta_f <= 0.0)
+ {
+ std::cout << "WARNING: delta_f: " << delta_f << std::endl;
+ }
+
+ dE = _eGamma[itest2+1] - _eGamma[itest2];
+ dF = fn_second_cumulative[itest2+1] - fn_second_cumulative[itest2];
+
+ delta_e = delta_f*dE/dF;
+
+ if (delta_e > (_eGamma[itest2+1] - _eGamma[itest2]))
+ {
+ std::cerr << "ERROR: delta_E: " << delta_e << std::endl;
+ }
+
+ egamma2 = _eGamma[itest2] + delta_e;
+
+ return;
+}
+
+
+bool spectrum::generateBreakupProbabilities()
+{
+
+ int nbbins = _nBbins;
+
+ double b_min = _bMin;
+ //double b_max = _bMax;
+
+ // double binc = (log(b_max/b_min))/(double)nbbins;
+ double binc = exp((log(_bMax/_bMin))/(double)_nBbins);
+
+ double b = b_min;
+
+ _probOfBreakup.resize(nbbins);
+
+ for (int i = 0; i < nbbins; i++)
+ {
+ double bimp = b;
+ double rhad = 0;
+ rhad = _beamBeamSystem->probabilityOfBreakup(bimp);
+ _probOfBreakup[i] = exp(-rhad);
+ b = b*binc;
+ }
+ return true;
+}
+
+double spectrum::getFnSingle(double egamma) const
+{
+ double eginc = exp(log(_eGammaMax/_eGammaMin)/static_cast<double>(_nK));
+ int i1 = log(egamma/_eGammaMin)/log(eginc);
+ int i2 = i1 + 1;
+ double fnSingle = 0.0;
+
+ if (i1 < 0 || i2 > _nK)
+ {
+ std::cout << "I1, I2 out of bounds. Egamma = " << egamma << std::endl;
+ std::cout << "I1, I2 = " << i1 << ", " << i2 << std::endl;
+ fnSingle = 0.0;
+ }
+ else
+ {
+ double dE = _eGamma[i2] - _eGamma[i1];
+ double eFrac = (egamma - _eGamma[i1])/dE;
+
+ if (eFrac < 0.0 || eFrac > 1.0)
+ {
+ std::cout << "WARNING: Efrac = " << eFrac << std::endl;
+ }
+ fnSingle = (1.0 - eFrac)*_fnSingle[i1] + eFrac*_fnSingle[i2];
+ }
+ return fnSingle;
+}
+
+double spectrum::getFnDouble(double egamma1, double egamma2) const
+{
+ double eginc = exp(log(_eGammaMax/_eGammaMin)/static_cast<double>(_nK));
+ int i1 = log(egamma1/_eGammaMin)/log(eginc);
+ int i2 = i1 + 1;
+ double fnDouble = 0.0;
+
+ if (i1 < 0 || i2 > _nK)
+ {
+ std::cout << "I1, I2 out of bounds. Egamma1 = " << egamma1 << std::endl;
+ std::cout << "I1, I2 = " << i1 << ", " << i2 << std::endl;
+ fnDouble = 0.0;
+ return fnDouble;
+ }
+
+ int j1 = log(egamma2/_eGammaMin)/log(eginc);
+ int j2 = j1 + 1;
+
+ if (j1 < 0 || j2 > _nK)
+ {
+ std::cout << "J1, J2 out of bounds. Egamma2 = " << egamma2 << std::endl;
+ std::cout << "J1, J2 = " << j1 << ", " << j2 << std::endl;
+ fnDouble = 0.0;
+ return fnDouble;
+ }
+
+ double dE1 = _eGamma[i2] - _eGamma[i1];
+ double eFrac1 = (egamma1 - _eGamma[i1])/dE1;
+
+ if (eFrac1 < 0.0 || eFrac1 > 1.0)
+ {
+ std::cout << "WARNING: Efrac1 = " << eFrac1 << std::endl;
+ }
+
+ double ptemp1 = (1.0 - eFrac1)*_fnDouble[i1][j1] + eFrac1*_fnDouble[i2][j1];
+ double ptemp2 = (1.0 - eFrac1)*_fnDouble[i1][j2] + eFrac1*_fnDouble[i2][j2];
+
+ double dE2 = _eGamma[j2] - _eGamma[j1];
+ double eFrac2 = (egamma2 - _eGamma[j1])/dE2;
+
+ if (eFrac2 < 0.0 || eFrac2 > 1.0)
+ {
+ std::cout << "WARNING: Efrac2 = " << eFrac2 << std::endl;
+ }
+
+ fnDouble = (1.0 - eFrac2)*ptemp1 + eFrac2*ptemp2;
+
+ return fnDouble;
+
+}
+
+double spectrum::getTransformedNofe(double egamma, double b)
+{
+ double factor = 1.0/(2.0*_beamBeamSystem->beamLorentzGamma());
+ double res = factor * _beamBeamSystem->beam1().photonFlux(b, egamma*factor);
+
+ return res;
+}
+
+
+
+
Index: branches/starlight_1.1/src/psifamily.h
===================================================================
--- branches/starlight_1.1/src/psifamily.h (revision 0)
+++ branches/starlight_1.1/src/psifamily.h (revision 145)
@@ -0,0 +1,57 @@
+///////////////////////////////////////////////////////////////////////////
+//
+// Copyright 2010
+//
+// This file is part of starlight.
+//
+// starlight is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
+//
+// starlight is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with starlight. If not, see <http://www.gnu.org/licenses/>.
+//
+///////////////////////////////////////////////////////////////////////////
+//
+// File and Version Information:
+// $Rev:: $: revision of last commit
+// $Author:: $: author of last commit
+// $Date:: $: date of last commit
+//
+// Description:
+//
+//
+//
+///////////////////////////////////////////////////////////////////////////
+
+
+#ifndef PSIFAMILY_H
+#define PSIFAMILY_H
+
+#include <vector>
+
+#include "starlightconstants.h"
+#include "beambeamsystem.h"
+#include "randomgenerator.h"
+#include "gammaavm.h"
+
+
+class psiFamily : public Gammaanarrowvm
+{
+ public:
+ psiFamily(inputParameters& input, beamBeamSystem& bbsystem);
+ ~psiFamily();
+ double getTheta(starlightConstants::particleTypeEnum ipid);
+ double getDaughterMass(starlightConstants::particleTypeEnum &ipid);
+ private:
+ double _width;
+ double _mass;
+};
+
+#endif //PSIFAMILY_H
Property changes on: branches/starlight_1.1/src/psifamily.h
___________________________________________________________________
Added: svn:keywords
## -0,0 +1 ##
+Rev Date Author
\ No newline at end of property
Index: branches/starlight_1.1/src/starlightdpmjet.cpp
===================================================================
--- branches/starlight_1.1/src/starlightdpmjet.cpp (revision 0)
+++ branches/starlight_1.1/src/starlightdpmjet.cpp (revision 145)
@@ -0,0 +1,156 @@
+/*
+ <one line to give the program's name and a brief idea of what it does.>
+ Copyright (C) <year> <name of author>
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License along
+ with this program; if not, write to the Free Software Foundation, Inc.,
+ 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+
+*/
+
+#include "starlightdpmjet.h"
+#include "spectrum.h"
+#include <iostream>
+#include <spectrumprotonnucleus.h>
+#include "starlightconfig.h"
+
+
+extern "C"
+{
+ extern struct
+ {
+
+ double slpx[200000];
+ double slpy[200000];
+ double slpz[200000];
+ double sle[200000];
+ double slm[200000];
+ int slpid[200000];
+ int slcharge[200000];
+
+ } dpmjetparticle_;
+
+ void dt_produceevent_(float* gammaE, int* nparticles);
+ void dt_getparticle_(int *ipart, int *res);
+ void dt_initialise_();
+}
+
+starlightDpmJet::starlightDpmJet(inputParameters &input , beamBeamSystem &beamsystem ) : eventChannel(input, beamsystem)
+ ,_spectrum(0)
+ ,_doDoubleEvent(true)
+ ,_minGammaEnergy(6.0)
+ ,_maxGammaEnergy(600000.0)
+ ,_protonMode(false)
+{
+
+}
+
+int starlightDpmJet::init()
+{
+ if(_protonMode)
+ {
+ _spectrum = new spectrumProtonNucleus(&_bbs);
+ }
+ else
+ {
+ _spectrum = new spectrum(&_bbs);
+ }
+ _spectrum->setRandomGenerator(&_randy);
+
+ _spectrum->setMinGammaEnergy(_minGammaEnergy);
+ _spectrum->setMaxGammaEnergy(_maxGammaEnergy);
+
+ if(!_doDoubleEvent)
+ {
+ _spectrum->generateKsingle();
+ }
+ else
+ {
+ _spectrum->generateKdouble();
+ }
+
+ return 0;
+
+}
+
+
+upcEvent starlightDpmJet::produceEvent()
+{
+
+ upcEvent event;
+
+ if (!_doDoubleEvent)
+ {
+ //int zdirection = (Randy.Rndom()) < 0.5 ? -1 : 1;
+ int zdirection = 1;
+ float gammaE = _spectrum->drawKsingle();
+ event = produceSingleEvent(zdirection, gammaE);
+ // std::cout << "Gamma energy: " << gammaE << std::endl;
+ }
+ else
+ {
+ event = produceDoubleEvent();
+ }
+
+ return event;
+}
+
+upcEvent starlightDpmJet::produceSingleEvent(int zdirection, float gammaE)
+{
+
+ upcEvent event;
+ event.addGamma(gammaE);
+
+ int nParticles = 0;
+
+ dt_produceevent_(&gammaE, &nParticles);
+
+
+ //In which direction do we go?
+ double rapidity = _bbs.beam1().rapidity()*zdirection;
+
+ for (int i = 0; i < nParticles; i++)
+ {
+ starlightParticle particle(dpmjetparticle_.slpx[i], dpmjetparticle_.slpy[i], zdirection*dpmjetparticle_.slpz[i], dpmjetparticle_.sle[i], dpmjetparticle_.slm[i], dpmjetparticle_.slpid[i], dpmjetparticle_.slcharge[i]);
+ vector3 boostVector(0, 0, tanh(-rapidity));
+ particle.Boost(boostVector);
+ event.addParticle(particle);
+ }
+ return event;
+}
+
+upcEvent starlightDpmJet::produceDoubleEvent()
+{
+ upcEvent event;
+
+ float gammaE1 = 0.0;
+ float gammaE2 = 0.0;
+
+ _spectrum->drawKdouble(gammaE1, gammaE2);
+
+// std::cout << "Gamma1 energy: " << gammaE1 << std::endl;
+ //std::cout << "Gamma2 energy: " << gammaE2 << std::endl;
+
+ //In which direction do we go?
+ int zdirection = (_randy.Rndom()) < 0.5 ? -1 : 1;
+
+ event = produceSingleEvent(zdirection, gammaE1);
+
+ zdirection = zdirection *-1;
+
+ event = event + produceSingleEvent(zdirection, gammaE2);
+
+ return event;
+}
+
+
Index: branches/starlight_1.1/src/photonNucleusCrossSection.cpp
===================================================================
--- branches/starlight_1.1/src/photonNucleusCrossSection.cpp (revision 0)
+++ branches/starlight_1.1/src/photonNucleusCrossSection.cpp (revision 145)
@@ -0,0 +1,924 @@
+///////////////////////////////////////////////////////////////////////////
+//
+// Copyright 2010
+//
+// This file is part of starlight.
+//
+// starlight is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
+//
+// starlight is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with starlight. If not, see <http://www.gnu.org/licenses/>.
+//
+///////////////////////////////////////////////////////////////////////////
+//
+// File and Version Information:
+// $Rev:: $: revision of last commit
+// $Author:: $: author of last commit
+// $Date:: $: date of last commit
+//
+// Description:
+//
+//
+///////////////////////////////////////////////////////////////////////////
+
+
+#include <iostream>
+#include <fstream>
+#include <cmath>
+
+#include "reportingUtils.h"
+#include "starlightconstants.h"
+#include "bessel.h"
+#include "photonNucleusCrossSection.h"
+
+
+using namespace std;
+using namespace starlightConstants;
+
+
+//______________________________________________________________________________
+photonNucleusCrossSection::photonNucleusCrossSection(const inputParameters& input,
+ const beamBeamSystem& bbsystem)
+ : _bbs (bbsystem ),
+ _protonEnergy (input.getProtonEnergy() ),
+ _beamLorentzGamma (input.beamLorentzGamma() ),
+ _particleType (input.prodParticleType() ),
+ _beamBreakupMode (input.beamBreakupMode() ),
+ _coherentProduction(input.coherentProduction()),
+ _incoherentFactor (input.incoherentFactor() ),
+ _productionMode (input.productionMode() ),
+ _sigmaNucleus (_bbs.beam2().A() )
+{
+ // define luminosity for various beam particles in units of 10^{26} cm^{-2} sec^{-1}
+ switch(_bbs.beam1().Z()) {
+ case 1: // proton
+ _luminosity = 1.E8;
+ break;
+ case 8: // O
+ _luminosity = 980.;
+ break;
+ case 14: // Si
+ _luminosity = 440.;
+ break;
+ case 20: // Ca
+ _luminosity = 2000.;
+ break;
+ case 29: // Cu
+ _luminosity = 95.;
+ break;
+ case 49: // Indium, uses same as Iodine
+ _luminosity = 27.;
+ break;
+ case 53: // I
+ _luminosity = 27.;
+ break;
+ case 79: // Au
+ _luminosity = 2.0;
+ break;
+ case 82: // Pb
+ _luminosity = 1.;
+ break;
+ default:
+ printWarn << "luminosity is not defined for beam with Z = " << _bbs.beam1().Z()
+ << ". using " << _luminosity << " 10^{26} cm^{-2} sec^{-1}" << endl;
+ }
+
+ switch(_particleType) {
+ case RHO:
+ _slopeParameter = 11.0; // [(GeV/c)^{-2}]
+ _vmPhotonCoupling = 2.02;
+ _ANORM = -2.75;
+ _BNORM = 0.0;
+ _defaultC = 1.0;
+ _channelMass = 0.7685; // [GeV/c^2]
+ _width = 0.1507; // [GeV/c^2]
+ break;
+ case RHOZEUS:
+ _slopeParameter =11.0;
+ _vmPhotonCoupling=2.02;
+ _ANORM=-2.75;
+ _BNORM=1.84;
+ _defaultC=1.0;
+ _channelMass = 0.7685;
+ _width=0.1507;
+ break;
+ case FOURPRONG:
+ _slopeParameter = 11.0;
+ _vmPhotonCoupling = 2.02;
+ _ANORM = -2.75;
+ _BNORM = 0; // no coherent background component is implemented for four-prong
+ _defaultC = 11.0;
+ _channelMass = 1.350;
+ _width = 0.360;
+ break;
+ case OMEGA:
+ _slopeParameter=10.0;
+ _vmPhotonCoupling=23.13;
+ _ANORM=-2.75;
+ _BNORM=0.0;
+ _defaultC=1.0;
+ _channelMass=0.78194;
+ _width=0.00843;
+ break;
+ case PHI:
+ _slopeParameter=7.0;
+ _vmPhotonCoupling=13.71;
+ _ANORM=-2.75;
+ _BNORM=0.0;
+ _defaultC=1.0;
+ _channelMass=1.019413;
+ _width=0.00443;
+ break;
+ case JPSI:
+ case JPSI_ee:
+ case JPSI_mumu:
+ _slopeParameter=4.0;
+ _vmPhotonCoupling=10.45;
+ _ANORM=-2.75;//Artificial Breit-Wigner parameters--no direct pions
+ _BNORM=0.0;
+ _defaultC=1.0;
+ _channelMass=3.09692;//JN 3.09688
+ _width=0.000091;//JN 0.000087
+ break;
+ case JPSI2S:
+ case JPSI2S_ee:
+ case JPSI2S_mumu:
+ _slopeParameter=4.3;
+ _vmPhotonCoupling=26.39;
+ _ANORM=-2.75;//Artificial
+ _BNORM=0.0;
+ _defaultC=1.0;
+ _channelMass=3.686093;
+ _width=0.000337;
+ break;
+ case UPSILON:
+ case UPSILON_ee:
+ case UPSILON_mumu:
+ _slopeParameter=4.0;
+ _vmPhotonCoupling=125.37;
+ _ANORM=-2.75;//Artificial
+ _BNORM=0.0;
+ _defaultC=1.0;
+ _channelMass=9.46030;
+ _width=0.00005402;
+ break;
+ case UPSILON2S:
+ case UPSILON2S_ee:
+ case UPSILON2S_mumu:
+ _slopeParameter=4.0;
+ _vmPhotonCoupling=290.84;
+ _ANORM=-2.75;
+ _BNORM=0.0;
+ _defaultC=1.0;
+ _channelMass=10.02326;
+ _width=0.00003198;
+ break;
+ case UPSILON3S:
+ case UPSILON3S_ee:
+ case UPSILON3S_mumu:
+ _slopeParameter=4.0;
+ _vmPhotonCoupling=415.10;
+ _ANORM=-2.75;
+ _BNORM=0.0;
+ _defaultC=1.0;
+ _channelMass=10.3552;
+ _width=0.00002032;
+ break;
+ default:
+ cout <<"No sigma constants parameterized for pid: "<<_particleType
+ <<" GammaAcrosssection"<<endl;
+ }
+
+ double maxradius = (_bbs.beam1().nuclearRadius()<_bbs.beam2().nuclearRadius())?_bbs.beam2().nuclearRadius():_bbs.beam1().nuclearRadius();
+ _maxPhotonEnergy = 5. * _beamLorentzGamma * hbarc/maxradius;
+}
+
+
+//______________________________________________________________________________
+photonNucleusCrossSection::~photonNucleusCrossSection()
+{ }
+
+
+//______________________________________________________________________________
+void
+photonNucleusCrossSection::crossSectionCalculation(const double)
+{
+ cout << "Neither narrow/wide resonance cross-section calculation.--Derived" << endl;
+}
+
+
+//______________________________________________________________________________
+double
+photonNucleusCrossSection::getcsgA(const double Egamma,
+ const double W)
+{
+ //This function returns the cross-section for photon-nucleus interaction
+ //producing vectormesons
+
+ double Av,Wgp,cs,cvma;
+ double t,tmin,tmax;
+ double csgA,ax,bx;
+ int NGAUSS;
+
+ // DATA FOR GAUSS INTEGRATION
+ double xg[6] = {0, 0.1488743390, 0.4333953941, 0.6794095683, 0.8650633667, 0.9739065285};
+ double ag[6] = {0, 0.2955242247, 0.2692667193, 0.2190863625, 0.1494513492, 0.0666713443};
+ NGAUSS = 6;
+
+ // Find gamma-proton CM energy
+ Wgp = sqrt(2. * Egamma * (_protonEnergy
+ + sqrt(_protonEnergy * _protonEnergy - protonMass * protonMass))
+ + protonMass * protonMass);
+
+ //Used for d-A and A-A
+ tmin = (W * W / (4. * Egamma * _beamLorentzGamma)) * (W * W / (4. * Egamma * _beamLorentzGamma));
+
+ if ((_bbs.beam1().A() == 1) && (_bbs.beam2().A() == 1)) // proton-proton, no scaling needed
+ csgA = sigmagp(Wgp);
+ else if ((_bbs.beam2().Z() == 1) && (_bbs.beam2().A() == 2)) { // deuteron-A interaction
+ Av = _slopeParameter * sigmagp(Wgp);
+
+ tmax = tmin + 0.64; //0.64
+ ax = 0.5 * (tmax - tmin);
+ bx = 0.5 * (tmax + tmin);
+ csgA = 0.;
+
+ for (int k = 1; k < NGAUSS; ++k) {
+ t = ax * xg[k] + bx;
+ // We use beam2 here since the input stores the deuteron as nucleus 2
+ // and nucleus 2 is the pomeron field source
+ // Also this is the way sergey formatted the formfactor.
+ csgA = csgA + ag[k] * _bbs.beam2().formFactor(t);
+ t = ax * (-xg[k]) + bx;
+ csgA = csgA + ag[k] * _bbs.beam2().formFactor(t);
+ }
+ csgA = 0.5 * (tmax - tmin) * csgA;
+ csgA = Av * csgA;
+ } else if (!_coherentProduction &&
+ (!((_bbs.beam2().Z() == 1) && (_bbs.beam2().A() == 2)))) { // incoherent AA interactions
+ // For incoherent AA interactions, since incoherent treating it as gamma-p
+ // Calculate the differential V.M.+proton cross section
+ csgA = 1.E-4 * _incoherentFactor * _sigmaNucleus * _slopeParameter * sigmagp(Wgp);
+
+ } else { // coherent AA interactions
+ // For typical AA interactions.
+ // Calculate V.M.+proton cross section
+ cs = sqrt(16. * pi * _vmPhotonCoupling * _slopeParameter * hbarc * hbarc * sigmagp(Wgp) / alpha);
+
+ // Calculate V.M.+nucleus cross section
+ // cvma = _bbs.beam1().A()*cs;
+ cvma = sigma_A(cs);
+
+ // Calculate Av = dsigma/dt(t=0) Note Units: fm**s/Gev**2
+ Av = (alpha * cvma * cvma) / (16. * pi * _vmPhotonCoupling * hbarc * hbarc);
+
+ // Check if one or both beams are nuclei
+ int A_1 = _bbs.beam1().A();
+ int A_2 = _bbs.beam2().A();
+
+ tmax = tmin + 0.25;
+ ax = 0.5 * (tmax - tmin);
+ bx = 0.5 * (tmax + tmin);
+ csgA = 0.;
+ for (int k = 1; k < NGAUSS; ++k) {
+
+ t = ax * xg[k] + bx;
+ if( A_1 == 1 && A_2 != 1){
+ csgA = csgA + ag[k] * _bbs.beam2().formFactor(t) * _bbs.beam2().formFactor(t);
+ }else if(A_2 ==1 && A_1 != 1){
+ csgA = csgA + ag[k] * _bbs.beam1().formFactor(t) * _bbs.beam1().formFactor(t);
+ }else{
+ csgA = csgA + ag[k] * _bbs.beam2().formFactor(t) * _bbs.beam2().formFactor(t);
+ }
+
+ t = ax * (-xg[k]) + bx;
+ if( A_1 == 1 && A_2 != 1){
+ csgA = csgA + ag[k] * _bbs.beam2().formFactor(t) * _bbs.beam2().formFactor(t);
+ }else if(A_2 ==1 && A_1 != 1){
+ csgA = csgA + ag[k] * _bbs.beam1().formFactor(t) * _bbs.beam1().formFactor(t);
+ }else{
+ csgA = csgA + ag[k] * _bbs.beam2().formFactor(t) * _bbs.beam2().formFactor(t);
+ }
+ }
+ csgA = 0.5 * (tmax - tmin) * csgA;
+ csgA = Av * csgA;
+ }
+
+ return csgA;
+}
+
+
+//______________________________________________________________________________
+double
+photonNucleusCrossSection::photonFlux(const double Egamma)
+{
+ // This routine gives the photon flux as a function of energy Egamma
+ // It works for arbitrary nuclei and gamma; the first time it is
+ // called, it calculates a lookup table which is used on
+ // subsequent calls.
+ // It returns dN_gamma/dE (dimensions 1/E), not dI/dE
+ // energies are in GeV, in the lab frame
+ // rewritten 4/25/2001 by SRK
+
+ double lEgamma,Emin,Emax;
+ static double lnEmax, lnEmin, dlnE;
+ double stepmult,energy,rZ,rA;
+ int nbstep,nrstep,nphistep,nstep;
+ double bmin,bmax,bmult,biter,bold,integratedflux;
+ double fluxelement,deltar,riter;
+ double deltaphi,phiiter,dist;
+ static double dide[401];
+ double lnElt;
+ double rA2, rZ2;
+ double flux_r;
+ double Xvar;
+ int Ilt;
+ double RNuc=0.,RNuc2=0.,maxradius=0.;
+
+ RNuc=_bbs.beam1().nuclearRadius();
+ RNuc2=_bbs.beam2().nuclearRadius();
+ maxradius = (RNuc<RNuc2)?RNuc2:RNuc;
+ // static ->>> dide,lnEMax,lnEmin,dlnE
+ static int Icheck = 0;
+
+ //Check first to see if pp
+ if( _bbs.beam1().A()==1 && _bbs.beam2().A()==1 ){
+ int nbsteps = 400;
+ double bmin = 0.5;
+ double bmax = 5.0 + (5.0*_beamLorentzGamma*hbarc/Egamma);
+ double dlnb = (log(bmax)-log(bmin))/(1.*nbsteps);
+
+ double local_sum=0.0;
+
+ // Impact parameter loop
+ for (int i = 0; i<=nbsteps;i++){
+
+ double bnn0 = bmin*exp(i*dlnb);
+ double bnn1 = bmin*exp((i+1)*dlnb);
+ double db = bnn1-bnn0;
+
+ // double PofB0 = 1.0;
+ // if( bnn0 > 1.4 )PofB0=0.0;
+ // double PofB1 = 1.0;
+ // if( bnn1 > 1.4 )PofB1=0.0;
+
+ double ppslope = 19.0;
+ double GammaProfile = exp(-bnn0*bnn0/(2.*hbarc*hbarc*ppslope));
+ double PofB0 = 1. - (1. - GammaProfile)*(1. - GammaProfile);
+ GammaProfile = exp(-bnn1*bnn1/(2.*hbarc*hbarc*ppslope));
+ double PofB1 = 1. - (1. - GammaProfile)*(1. - GammaProfile);
+
+ double Xarg = Egamma*bnn0/(hbarc*_beamLorentzGamma);
+ double loc_nofe0 = (_bbs.beam1().Z()*_bbs.beam1().Z()*alpha)/
+ (pi*pi);
+ loc_nofe0 *= (1./(Egamma*bnn0*bnn0));
+ loc_nofe0 *= Xarg*Xarg*(bessel::dbesk1(Xarg))*(bessel::dbesk1(Xarg));
+
+ Xarg = Egamma*bnn1/(hbarc*_beamLorentzGamma);
+ double loc_nofe1 = (_bbs.beam1().Z()*_bbs.beam1().Z()*alpha)/
+ (pi*pi);
+ loc_nofe1 *= (1./(Egamma*bnn1*bnn1));
+ loc_nofe1 *= Xarg*Xarg*(bessel::dbesk1(Xarg))*(bessel::dbesk1(Xarg));
+
+ local_sum += loc_nofe0*(1. - PofB0)*bnn0*db;
+ local_sum += loc_nofe1*(1. - PofB1)*bnn1*db;
+
+ }
+ // End Impact parameter loop
+
+ // Note: 2*pi --> pi because of no factor 2 above
+ double flux_r=local_sum*pi;
+ return flux_r;
+
+ // bmin = nuclearRadius+nuclearRadius;
+ // flux_r = nepoint(Egamma,bmin);
+ // return flux_r;
+ }
+
+ // first call? - initialize - calculate photon flux
+ Icheck=Icheck+1;
+ if(Icheck > 1) goto L1000f;
+
+ rZ=double(_bbs.beam1().Z());
+ rA=double(_bbs.beam1().A());
+ rZ2=double(_bbs.beam2().Z()); //Sergey--dAu
+ rA2=double(_bbs.beam2().A()); //Sergey
+
+ // Nuclear breakup is done by PofB
+ // collect number of integration steps here, in one place
+
+ nbstep=1200;
+ nrstep=60;
+ nphistep=40;
+
+ // this last one is the number of energy steps
+ nstep=100;
+
+ // following previous choices, take Emin=10 keV at LHC, Emin = 1 MeV at RHIC
+ Emin=1.E-5;
+ if (_beamLorentzGamma < 500)
+ Emin=1.E-3;
+
+ // maximum energy is 6 times the cutoff
+ // Emax=12.*hbarc*_beamLorentzGamma/RNuc;
+ Emax=6.*hbarc*_beamLorentzGamma/maxradius;
+
+ // >> lnEmin <-> ln(Egamma) for the 0th bin
+ // >> lnEmax <-> ln(Egamma) for the last bin
+
+ lnEmin=log(Emin);
+ lnEmax=log(Emax);
+ dlnE=(lnEmax-lnEmin)/nstep;
+
+ cout<<" Calculating flux for photon energies from E= "<<Emin
+ <<" to "<<Emax<<" GeV (CM frame) "<<endl;
+
+
+ stepmult= exp(log(Emax/Emin)/double(nstep));
+ energy=Emin;
+
+ for (int j = 1; j<=nstep;j++){
+ energy=energy*stepmult;
+
+ // integrate flux over 2R_A < b < 2R_A+ 6* gamma hbar/energy
+ // use exponential steps
+
+ bmin=RNuc+RNuc2; //2.*nuclearRadius; Sergey
+ bmax=bmin + 6.*hbarc*_beamLorentzGamma/energy;
+
+ bmult=exp(log(bmax/bmin)/double(nbstep));
+ biter=bmin;
+ integratedflux=0.;
+
+ if (_bbs.beam2().Z()==1&&_bbs.beam1().A()==2){
+ //This is for deuteron-gold
+ Xvar = (RNuc+RNuc2)*energy/(hbarc*(_beamLorentzGamma));
+
+ fluxelement = (2.0/pi)*rZ*rZ*alpha/
+ energy*(Xvar*bessel::dbesk0(Xvar)*bessel::dbesk1(Xvar)-(1/2)*Xvar*Xvar*
+ (bessel::dbesk1(Xvar)*bessel::dbesk1(Xvar)-bessel::dbesk0(Xvar)*bessel::dbesk0(Xvar)));
+
+ integratedflux=integratedflux+fluxelement;
+ }else if( (_bbs.beam1().A() == 1 && _bbs.beam2().A() != 1) || (_bbs.beam2().A() == 1 && _bbs.beam1().A() != 1) ){
+ // This is pA
+ if( _productionMode == PHOTONPOMERONINCOHERENT ){
+ // This is pA incoherent
+ // cout<<" This is incoherent! "<<" j = "<<j<<endl;
+ double zproj = 0.0;
+ double localbmin = 0.0;
+ if( _bbs.beam1().A() == 1 ){
+ zproj = (_bbs.beam2().Z());
+ localbmin = _bbs.beam2().nuclearRadius() + 0.7;
+ }
+ if( _bbs.beam2().A() == 1 ){
+ zproj = (_bbs.beam1().Z());
+ localbmin = _bbs.beam1().nuclearRadius() + 0.7;
+ }
+ integratedflux = zproj*zproj*nepoint(energy,localbmin);
+ } else if ( _productionMode == PHOTONPOMERONNARROW || _productionMode == PHOTONPOMERONWIDE ){
+ // cout<<" This is pA coherent "<<" j= "<<j<<endl;
+ double localbmin = 0.0;
+ if( _bbs.beam1().A() == 1 ){
+ localbmin = _bbs.beam2().nuclearRadius() + 0.7;
+ }
+ if( _bbs.beam2().A() == 1 ){
+ localbmin = _bbs.beam1().nuclearRadius() + 0.7;
+ }
+ integratedflux = nepoint(energy,localbmin);
+ }
+ }else{
+ for (int jb = 1; jb<=nbstep;jb++){
+ bold=biter;
+ biter=biter*bmult;
+ // When we get to b>20R_A change methods - just take the photon flux
+ // at the center of the nucleus.
+ if (biter > (10.*RNuc))
+ {
+ // if there is no nuclear breakup or only hadronic breakup, which only
+ // occurs at smaller b, we can analytically integrate the flux from b~20R_A
+ // to infinity, following Jackson (2nd edition), Eq. 15.54
+ Xvar=energy*biter/(hbarc*_beamLorentzGamma);
+ // Here, there is nuclear breakup. So, we can't use the integrated flux
+ // However, we can do a single flux calculation, at the center of the nucleus
+ // Eq. 41 of Vidovic, Greiner and Soff, Phys.Rev.C47,2308(1993), among other places
+ // this is the flux per unit area
+ fluxelement = (rZ*rZ*alpha*energy)*
+ (bessel::dbesk1(Xvar))*(bessel::dbesk1(Xvar))/
+ ((pi*_beamLorentzGamma*hbarc)*
+ (pi*_beamLorentzGamma*hbarc));
+
+ }//if biter>10
+ else{
+ // integrate over nuclear surface. n.b. this assumes total shadowing -
+ // treat photons hitting the nucleus the same no matter where they strike
+ fluxelement=0.;
+ deltar=RNuc/double(nrstep);
+ riter=-deltar/2.;
+
+ for (int jr =1; jr<=nrstep;jr++){
+ riter=riter+deltar;
+ // use symmetry; only integrate from 0 to pi (half circle)
+ deltaphi=pi/double(nphistep);
+ phiiter=0.;
+
+ for( int jphi=1;jphi<= nphistep;jphi++){
+ phiiter=(double(jphi)-0.5)*deltaphi;
+ // dist is the distance from the center of the emitting nucleus to the point in question
+ dist=sqrt((biter+riter*cos(phiiter))*(biter+riter*
+ cos(phiiter))+(riter*sin(phiiter))*(riter*sin(phiiter)));
+ Xvar=energy*dist/(hbarc*_beamLorentzGamma);
+ flux_r = (rZ*rZ*alpha*energy)*
+ (bessel::dbesk1(Xvar)*bessel::dbesk1(Xvar))/
+ ((pi*_beamLorentzGamma*hbarc)*
+ (pi*_beamLorentzGamma*hbarc));
+
+ // The surface element is 2.* delta phi* r * delta r
+ // The '2' is because the phi integral only goes from 0 to pi
+ fluxelement=fluxelement+flux_r*2.*deltaphi*riter*deltar;
+ // end phi and r integrations
+ }//for(jphi)
+ }//for(jr)
+ // average fluxelement over the nuclear surface
+ fluxelement=fluxelement/(pi*RNuc*RNuc);
+ }//else
+ // multiply by volume element to get total flux in the volume element
+ fluxelement=fluxelement*2.*pi*biter*(biter-bold);
+ // modulate by the probability of nuclear breakup as f(biter)
+ if (_beamBreakupMode > 1){
+ fluxelement=fluxelement*_bbs.probabilityOfBreakup(biter);
+ }
+ integratedflux=integratedflux+fluxelement;
+
+ } //end loop over impact parameter
+ } //end of else (pp, pA, AA)
+
+ // In lookup table, store k*dN/dk because it changes less
+ // so the interpolation should be better
+ dide[j]=integratedflux*energy;
+
+ }//end loop over photon energy
+
+ // for 2nd and subsequent calls, use lookup table immediately
+
+ L1000f:
+
+ lEgamma=log(Egamma);
+ if (lEgamma < (lnEmin+dlnE) || lEgamma > lnEmax){
+ flux_r=0.0;
+ cout<<" ERROR: Egamma outside defined range. Egamma= "<<Egamma
+ <<" "<<lnEmax<<" "<<(lnEmin+dlnE)<<endl;
+ }
+ else{
+ // >> Egamma between Ilt and Ilt+1
+ Ilt = int((lEgamma-lnEmin)/dlnE);
+ // >> ln(Egamma) for first point
+ lnElt = lnEmin + Ilt*dlnE;
+ // >> Interpolate
+ flux_r = dide[Ilt] + ((lEgamma-lnElt)/dlnE)*(dide[Ilt+1]- dide[Ilt]);
+ flux_r = flux_r/Egamma;
+ }
+
+ return flux_r;
+}
+
+
+//______________________________________________________________________________
+double
+photonNucleusCrossSection::nepoint(const double Egamma,
+ const double bmin)
+{
+ // Function for the spectrum of virtual photons,
+ // dn/dEgamma, for a point charge q=Ze sweeping
+ // past the origin with velocity gamma
+ // (=1/SQRT(1-(V/c)**2)) integrated over impact
+ // parameter from bmin to infinity
+ // See Jackson eq15.54 Classical Electrodynamics
+ // Declare Local Variables
+ double beta,X,C1,bracket,nepoint_r;
+
+ beta = sqrt(1.-(1./(_beamLorentzGamma*_beamLorentzGamma)));
+ X = (bmin*Egamma)/(beta*_beamLorentzGamma*hbarc);
+
+ bracket = -0.5*beta*beta*X*X*(bessel::dbesk1(X)*bessel::dbesk1(X)
+ -bessel::dbesk0(X)*bessel::dbesk0(X));
+
+ bracket = bracket+X*bessel::dbesk0(X)*bessel::dbesk1(X);
+
+ // C1=(2.*double((_bbs.beam1().Z())*(_bbs.beam1().Z()))*
+ // alpha)/pi;
+
+ // Note: NO Z*Z!!
+ C1=(2.*alpha)/pi;
+
+ nepoint_r = C1*(1./beta)*(1./beta)*(1./Egamma)*bracket;
+
+ return nepoint_r;
+
+}
+
+
+//______________________________________________________________________________
+double
+photonNucleusCrossSection::sigmagp(const double Wgp)
+{
+ // >> Function for the gamma-proton --> VectorMeson
+ // >> cross section. Wgp is the gamma-proton CM energy.
+ // >> Unit for cross section: fm**2
+
+ double sigmagp_r=0.;
+
+ switch(_particleType)
+ {
+ case RHO:
+ case RHOZEUS:
+ case FOURPRONG:
+ sigmagp_r=1.E-4*(5.0*exp(0.22*log(Wgp))+26.0*exp(-1.23*log(Wgp)));
+ break;
+ case OMEGA:
+ sigmagp_r=1.E-4*(0.55*exp(0.22*log(Wgp))+18.0*exp(-1.92*log(Wgp)));
+ break;
+ case PHI:
+ sigmagp_r=1.E-4*0.34*exp(0.22*log(Wgp));
+ break;
+ case JPSI:
+ case JPSI_ee:
+ case JPSI_mumu:
+ sigmagp_r=(1.0-((_channelMass+protonMass)*(_channelMass+protonMass))/(Wgp*Wgp));
+ sigmagp_r*=sigmagp_r;
+ sigmagp_r*=1.E-4*0.00406*exp(0.65*log(Wgp));
+ // sigmagp_r=1.E-4*0.0015*exp(0.80*log(Wgp));
+ break;
+ case JPSI2S:
+ case JPSI2S_ee:
+ case JPSI2S_mumu:
+ sigmagp_r=(1.0-((_channelMass+protonMass)*(_channelMass+protonMass))/(Wgp*Wgp));
+ sigmagp_r*=sigmagp_r;
+ sigmagp_r*=1.E-4*0.00406*exp(0.65*log(Wgp));
+ sigmagp_r*=0.166;
+ // sigmagp_r=0.166*(1.E-4*0.0015*exp(0.80*log(Wgp)));
+ break;
+ case UPSILON:
+ case UPSILON_ee:
+ case UPSILON_mumu:
+ // >> This is W**1.7 dependence from QCD calculations
+ sigmagp_r=1.E-10*(0.060)*exp(1.70*log(Wgp));
+ break;
+ case UPSILON2S:
+ case UPSILON2S_ee:
+ case UPSILON2S_mumu:
+ sigmagp_r=1.E-10*(0.0259)*exp(1.70*log(Wgp));
+ break;
+ case UPSILON3S:
+ case UPSILON3S_ee:
+ case UPSILON3S_mumu:
+ sigmagp_r=1.E-10*(0.0181)*exp(1.70*log(Wgp));
+ break;
+ default: cout<< "!!! ERROR: Unidentified Vector Meson: "<< _particleType <<endl;
+ }
+ return sigmagp_r;
+}
+
+
+//______________________________________________________________________________
+double
+photonNucleusCrossSection::sigma_A(const double sig_N)
+{
+ // Nuclear Cross Section
+ // sig_N,sigma_A in (fm**2)
+
+ double sum;
+ double b,bmax,Pint,arg,sigma_A_r;
+
+ int NGAUSS;
+
+ double xg[17]=
+ {.0,
+ .0483076656877383162,.144471961582796493,
+ .239287362252137075, .331868602282127650,
+ .421351276130635345, .506899908932229390,
+ .587715757240762329, .663044266930215201,
+ .732182118740289680, .794483795967942407,
+ .849367613732569970, .896321155766052124,
+ .934906075937739689, .964762255587506430,
+ .985611511545268335, .997263861849481564
+ };
+
+ double ag[17]=
+ {.0,
+ .0965400885147278006, .0956387200792748594,
+ .0938443990808045654, .0911738786957638847,
+ .0876520930044038111, .0833119242269467552,
+ .0781938957870703065, .0723457941088485062,
+ .0658222227763618468, .0586840934785355471,
+ .0509980592623761762, .0428358980222266807,
+ .0342738629130214331, .0253920653092620595,
+ .0162743947309056706, .00701861000947009660
+ };
+
+ NGAUSS=16;
+
+ // Check if one or both beams are nuclei
+ int A_1 = _bbs.beam1().A();
+ int A_2 = _bbs.beam2().A();
+ if( A_1 == 1 && A_2 == 1)cout<<" This is pp, you should not be here..."<<endl;
+
+ // CALCULATE P(int) FOR b=0.0 - bmax (fm)
+ bmax = 25.0;
+ sum = 0.;
+ for(int IB=1;IB<=NGAUSS;IB++){
+
+ b = 0.5*bmax*xg[IB]+0.5*bmax;
+
+ if( A_1 == 1 && A_2 != 1){
+ arg=-sig_N*_bbs.beam2().rho0()*_bbs.beam2().thickness(b);
+ }else if(A_2 == 1 && A_1 != 1){
+ arg=-sig_N*_bbs.beam1().rho0()*_bbs.beam1().thickness(b);
+ }else{
+ arg=-sig_N*_bbs.beam1().rho0()*_bbs.beam1().thickness(b);
+ }
+
+ Pint=1.0-exp(arg);
+ sum=sum+2.*pi*b*Pint*ag[IB];
+
+
+ b = 0.5*bmax*(-xg[IB])+0.5*bmax;
+
+ if( A_1 == 1 && A_2 != 1){
+ arg=-sig_N*_bbs.beam2().rho0()*_bbs.beam2().thickness(b);
+ }else if(A_2 == 1 && A_1 != 1){
+ arg=-sig_N*_bbs.beam1().rho0()*_bbs.beam1().thickness(b);
+ }else{
+ arg=-sig_N*_bbs.beam1().rho0()*_bbs.beam1().thickness(b);
+ }
+
+ Pint=1.0-exp(arg);
+ sum=sum+2.*pi*b*Pint*ag[IB];
+
+ }
+
+ sum=0.5*bmax*sum;
+
+ sigma_A_r=sum;
+
+ return sigma_A_r;
+}
+
+//______________________________________________________________________________
+double
+photonNucleusCrossSection::sigma_N(const double Wgp)
+{
+ // Nucleon Cross Section in (fm**2)
+ double cs = sqrt(16. * pi * _vmPhotonCoupling * _slopeParameter * hbarc * hbarc * sigmagp(Wgp) / alpha);
+ return cs;
+}
+
+
+//______________________________________________________________________________
+double
+photonNucleusCrossSection::breitWigner(const double W,
+ const double C)
+{
+ // use simple fixed-width s-wave Breit-Wigner without coherent backgorund for rho'
+ // (PDG '08 eq. 38.56)
+ if(_particleType==FOURPRONG) {
+ if (W < 4.01 * pionChargedMass)
+ return 0;
+ const double termA = _channelMass * _width;
+ const double termA2 = termA * termA;
+ const double termB = W * W - _channelMass * _channelMass;
+ return C * _ANORM * _ANORM * termA2 / (termB * termB + termA2);
+ }
+
+ // Relativistic Breit-Wigner according to J.D. Jackson,
+ // Nuovo Cimento 34, 6692 (1964), with nonresonant term. A is the strength
+ // of the resonant term and b the strength of the non-resonant
+ // term. C is an overall normalization.
+
+ double ppi=0.,ppi0=0.,GammaPrim,rat;
+ double aa,bb,cc;
+
+ double nrbw_r;
+
+ // width depends on energy - Jackson Eq. A.2
+ // if below threshold, then return 0. Added 5/3/2001 SRK
+ // 0.5% extra added for safety margin
+ if( _particleType==RHO ||_particleType==RHOZEUS){
+ if (W < 2.01*pionChargedMass){
+ nrbw_r=0.;
+ return nrbw_r;
+ }
+ ppi=sqrt( ((W/2.)*(W/2.)) - pionChargedMass * pionChargedMass);
+ ppi0=0.358;
+ }
+
+ // handle phi-->K+K- properly
+ if (_particleType == PHI){
+ if (W < 2.*kaonChargedMass){
+ nrbw_r=0.;
+ return nrbw_r;
+ }
+ ppi=sqrt( ((W/2.)*(W/2.))- kaonChargedMass*kaonChargedMass);
+ ppi0=sqrt( ((_channelMass/2.)*(_channelMass/2.))-kaonChargedMass*kaonChargedMass);
+ }
+
+ //handle J/Psi-->e+e- properly
+ if (_particleType==JPSI || _particleType==JPSI2S){
+ if(W<2.*mel){
+ nrbw_r=0.;
+ return nrbw_r;
+ }
+ ppi=sqrt(((W/2.)*(W/2.))-mel*mel);
+ ppi0=sqrt(((_channelMass/2.)*(_channelMass/2.))-mel*mel);
+ }
+ if (_particleType==JPSI_ee){
+ if(W<2.*mel){
+ nrbw_r=0.;
+ return nrbw_r;
+ }
+ ppi=sqrt(((W/2.)*(W/2.))-mel*mel);
+ ppi0=sqrt(((_channelMass/2.)*(_channelMass/2.))-mel*mel);
+ }
+ if (_particleType==JPSI_mumu){
+ if(W<2.*muonMass){
+ nrbw_r=0.;
+ return nrbw_r;
+ }
+ ppi=sqrt(((W/2.)*(W/2.))-muonMass*muonMass);
+ ppi0=sqrt(((_channelMass/2.)*(_channelMass/2.))-muonMass*muonMass);
+ }
+ if (_particleType==JPSI2S_ee){
+ if(W<2.*mel){
+ nrbw_r=0.;
+ return nrbw_r;
+ }
+ ppi=sqrt(((W/2.)*(W/2.))-mel*mel);
+ ppi0=sqrt(((_channelMass/2.)*(_channelMass/2.))-mel*mel);
+ }
+ if (_particleType==JPSI2S_mumu){
+ if(W<2.*muonMass){
+ nrbw_r=0.;
+ return nrbw_r;
+ }
+ ppi=sqrt(((W/2.)*(W/2.))-muonMass*muonMass);
+ ppi0=sqrt(((_channelMass/2.)*(_channelMass/2.))-muonMass*muonMass);
+ }
+
+ if(_particleType==UPSILON || _particleType==UPSILON2S ||_particleType==UPSILON3S ){
+ if (W<2.*muonMass){
+ nrbw_r=0.;
+ return nrbw_r;
+ }
+ ppi=sqrt(((W/2.)*(W/2.))-muonMass*muonMass);
+ ppi0=sqrt(((_channelMass/2.)*(_channelMass/2.))-muonMass*muonMass);
+ }
+
+ if(_particleType==UPSILON_mumu || _particleType==UPSILON2S_mumu ||_particleType==UPSILON3S_mumu ){
+ if (W<2.*muonMass){
+ nrbw_r=0.;
+ return nrbw_r;
+ }
+ ppi=sqrt(((W/2.)*(W/2.))-muonMass*muonMass);
+ ppi0=sqrt(((_channelMass/2.)*(_channelMass/2.))-muonMass*muonMass);
+ }
+
+ if(_particleType==UPSILON_ee || _particleType==UPSILON2S_ee ||_particleType==UPSILON3S_ee ){
+ if (W<2.*mel){
+ nrbw_r=0.;
+ return nrbw_r;
+ }
+ ppi=sqrt(((W/2.)*(W/2.))-mel*mel);
+ ppi0=sqrt(((_channelMass/2.)*(_channelMass/2.))-mel*mel);
+ }
+
+ if(ppi==0.&&ppi0==0.)
+ cout<<"Improper Gammaacrosssection::breitwigner, ppi&ppi0=0."<<endl;
+
+ rat=ppi/ppi0;
+ GammaPrim=_width*(_channelMass/W)*rat*rat*rat;
+
+ aa=_ANORM*sqrt(GammaPrim*_channelMass*W);
+ bb=W*W-_channelMass*_channelMass;
+ cc=_channelMass*GammaPrim;
+
+ // First real part squared
+ nrbw_r = (( (aa*bb)/(bb*bb+cc*cc) + _BNORM)*( (aa*bb)/(bb*bb+cc*cc) + _BNORM));
+
+ // Then imaginary part squared
+ nrbw_r = nrbw_r + (( (aa*cc)/(bb*bb+cc*cc) )*( (aa*cc)/(bb*bb+cc*cc) ));
+
+ // Alternative, a simple, no-background BW, following J. Breitweg et al.
+ // Eq. 15 of Eur. Phys. J. C2, 247 (1998). SRK 11/10/2000
+ // nrbw_r = (_ANORM*_mass*GammaPrim/(bb*bb+cc*cc))**2
+
+ nrbw_r = C*nrbw_r;
+
+ return nrbw_r;
+}
Property changes on: branches/starlight_1.1/src/photonNucleusCrossSection.cpp
___________________________________________________________________
Added: svn:keywords
## -0,0 +1 ##
+Rev Date Author
\ No newline at end of property
Index: branches/starlight_1.1/src/narrowResonanceCrossSection.cpp
===================================================================
--- branches/starlight_1.1/src/narrowResonanceCrossSection.cpp (revision 0)
+++ branches/starlight_1.1/src/narrowResonanceCrossSection.cpp (revision 145)
@@ -0,0 +1,135 @@
+///////////////////////////////////////////////////////////////////////////
+//
+// Copyright 2010
+//
+// This file is part of starlight.
+//
+// starlight is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
+//
+// starlight is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with starlight. If not, see <http://www.gnu.org/licenses/>.
+//
+///////////////////////////////////////////////////////////////////////////
+//
+// File and Version Information:
+// $Rev:: $: revision of last commit
+// $Author:: $: author of last commit
+// $Date:: $: date of last commit
+//
+// Description:
+//
+//
+//
+///////////////////////////////////////////////////////////////////////////
+
+
+#include <iostream>
+#include <fstream>
+#include <cmath>
+
+#include "starlightconstants.h"
+#include "narrowResonanceCrossSection.h"
+
+
+using namespace std;
+using namespace starlightConstants;
+
+
+//______________________________________________________________________________
+narrowResonanceCrossSection::narrowResonanceCrossSection(const inputParameters& input,
+ const beamBeamSystem& bbsystem)
+ :photonNucleusCrossSection(input, bbsystem)
+{
+ _narrowYmax = input.maxRapidity();
+ _narrowYmin = -1.0*_narrowYmax;
+ _narrowNumY = input.nmbRapidityBins();
+ _Ep = input.getProtonEnergy();
+}
+
+
+//______________________________________________________________________________
+narrowResonanceCrossSection::~narrowResonanceCrossSection()
+{ }
+
+
+//______________________________________________________________________________
+void
+narrowResonanceCrossSection::crossSectionCalculation(const double) // _bwnormsave (unused)
+{
+ // This subroutine calculates the vector meson cross section assuming
+ // a narrow resonance. For reference, see STAR Note 386.
+
+ // double Av,Wgp,cs,cvma;
+ double W,dY;
+ double y1,y2,y12,ega1,ega2,ega12;
+ // double t,tmin,tmax;
+ double csgA1,csgA2,csgA12,int_r,dR,rate;
+ double tmp;
+ // double ax,bx;
+ double Eth;
+ int J,NY;
+ // int K,NGAUSS;
+
+ NY = _narrowNumY;
+ dY = (_narrowYmax-_narrowYmin)/double(NY);
+
+ cout<<" Using Narrow Resonance ..."<<endl;
+
+ W = getChannelMass();
+ Eth=0.5*(((W+protonMass)*(W+protonMass)-
+ protonMass*protonMass)/(_Ep+sqrt(_Ep*_Ep-protonMass*protonMass)));
+
+ cout<<" gamma+nucleon Threshold: "<<Eth<<endl;
+ int_r=0.;
+
+ tmp = 0.0;
+
+ for(J=0;J<=(NY-1);J++){
+
+ y1 = _narrowYmin + double(J)*dY;
+ y2 = _narrowYmin + double(J+1)*dY;
+ y12 = 0.5*(y1+y2);
+
+ ega1 = 0.5*W*exp(y1);
+ ega2 = 0.5*W*exp(y2);
+ ega12 = 0.5*W*exp(y12);
+
+ if(ega1 < Eth)
+ continue;
+ if(ega2 > maxPhotonEnergy())
+ continue;
+
+ csgA1=getcsgA(ega1,W);
+
+ // Middle Point =====>>>
+ csgA12=getcsgA(ega12,W);
+
+ // Second Point =====>>>
+ csgA2=getcsgA(ega2,W);
+
+ // Sum the contribution for this W,Y.
+ dR = ega1*photonFlux(ega1)*csgA1;
+ dR = dR + 4.*ega12*photonFlux(ega12)*csgA12;
+ dR = dR + ega2*photonFlux(ega2)*csgA2;
+ tmp = tmp+2.*dR*(dY/6.);
+ dR = dR*(dY/6.);
+
+ // cout<<" y: "<<y12<<" egamma: "<<ega12<<" flux: "<<photonFlux(ega12)<<" sigma_gA: "<<10000000.*csgA12<<" dsig/dy (microb): "<<10000.*dR/dY<<endl;
+
+ // The 2 accounts for the 2 beams
+ if(getbbs().beam1().A()==getbbs().beam2().A()){
+ dR = 2.*dR;
+ }
+ int_r = int_r+dR;
+ }
+ rate=luminosity()*int_r;
+ cout<<" Cross section (mb): " <<10.*int_r<<endl;
+}
Property changes on: branches/starlight_1.1/src/narrowResonanceCrossSection.cpp
___________________________________________________________________
Added: svn:keywords
## -0,0 +1 ##
+Rev Date Author
\ No newline at end of property
Index: branches/starlight_1.1/src/eventchannel.cpp
===================================================================
--- branches/starlight_1.1/src/eventchannel.cpp (revision 0)
+++ branches/starlight_1.1/src/eventchannel.cpp (revision 145)
@@ -0,0 +1,113 @@
+///////////////////////////////////////////////////////////////////////////
+//
+// Copyright 2010
+//
+// This file is part of starlight.
+//
+// starlight is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
+//
+// starlight is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with starlight. If not, see <http://www.gnu.org/licenses/>.
+//
+///////////////////////////////////////////////////////////////////////////
+//
+// File and Version Information:
+// $Rev:: $: revision of last commit
+// $Author:: $: author of last commit
+// $Date:: $: date of last commit
+//
+// Description:
+// Class needed for root output
+//
+//
+///////////////////////////////////////////////////////////////////////////
+
+
+#include <iostream>
+#include <fstream>
+#include <cmath>
+
+#include "eventchannel.h"
+
+
+using namespace std;
+
+
+//______________________________________________________________________________
+eventChannel::eventChannel(const inputParameters& input,
+ beamBeamSystem& bbsystem)
+ : readLuminosity(input),
+ _bbs(bbsystem),
+ _nmbAttempts(0),
+ _nmbAccepted(0)
+{
+ _randy.SetSeed(input.randomSeed());
+ _ptCutEnabled = input.ptCutEnabled();
+ _ptCutMin = input.ptCutMin();
+ _ptCutMax = input.ptCutMax();
+ _etaCutEnabled = input.etaCutEnabled();
+ _etaCutMin = input.etaCutMin();
+ _etaCutMax = input.etaCutMax();
+}
+
+
+//______________________________________________________________________________
+eventChannel::~eventChannel()
+{ }
+
+
+//______________________________________________________________________________
+void
+eventChannel::transform(const double betax,
+ const double betay,
+ const double betaz,
+ double& E,
+ double& px,
+ double& py,
+ double& pz,
+ int& iFbadevent)
+{
+ // carries out a lorentz transform of the frame. (Not a boost!)???
+ const double E0 = E;
+ const double px0 = px;
+ const double py0 = py;
+ const double pz0 = pz;
+
+ const double beta = sqrt(betax * betax + betay * betay + betaz * betaz);
+ if (beta >= 1)
+ iFbadevent = 1;
+ const double gamma = 1. / sqrt(1. - beta * beta);
+ const double gob = (gamma - 1) / (beta * beta);
+
+ E = gamma * (E0 - betax * px0 - betay * py0 - betaz* pz0);
+ px = -gamma * betax * E0 + (1. + gob * betax * betax) * px0
+ + gob * betax * betay * py0 + gob * betax * betaz * pz0;
+ py = -gamma * betay * E0 + gob * betay * betax * px0
+ + (1. + gob * betay * betay) * py0 + gob * betay * betaz *pz0;
+ pz = -gamma * betaz * E0 + gob * betaz * betax * px0
+ + gob * betaz * betay * py0 + (1. + gob * betaz * betaz) * pz0;
+}
+
+
+//______________________________________________________________________________
+double
+eventChannel::pseudoRapidity(const double px,
+ const double py,
+ const double pz)
+{
+ const double pT= sqrt(px * px + py * py);
+ const double p = sqrt(pz * pz + pT * pT);
+ double eta = -99.9; // instead of special value, std::numeric_limits<double>::quiet_NaN() should be used
+ if ((p - pz) != 0)
+ eta = 0.5 * log((p + pz)/(p - pz));
+ return eta;
+}
+
Property changes on: branches/starlight_1.1/src/eventchannel.cpp
___________________________________________________________________
Added: svn:keywords
## -0,0 +1 ##
+Rev Date Author
\ No newline at end of property
Index: branches/starlight_1.1/src/starlightStandalone.cpp
===================================================================
--- branches/starlight_1.1/src/starlightStandalone.cpp (revision 0)
+++ branches/starlight_1.1/src/starlightStandalone.cpp (revision 145)
@@ -0,0 +1,127 @@
+///////////////////////////////////////////////////////////////////////////
+//
+// Copyright 2010
+//
+// This file is part of starlight.
+//
+// starlight is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
+//
+// starlight is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with starlight. If not, see <http://www.gnu.org/licenses/>.
+//
+///////////////////////////////////////////////////////////////////////////
+//
+// File and Version Information:
+// $Rev:: 102 $: revision of last commit
+// $Author:: odjuvsla $: author of last commit
+// $Date:: 2012-10-22 16:25:54 -0500 #$: date of last commit
+//
+// Description:
+//
+//
+//
+///////////////////////////////////////////////////////////////////////////
+
+
+#include <iostream>
+
+#include "reportingUtils.h"
+#include "starlight.h"
+#include "inputParameters.h"
+#include "eventfilewriter.h"
+#include "starlightStandalone.h"
+
+
+using namespace std;
+
+
+starlightStandalone::starlightStandalone()
+ : _configFileName ("slight.in"),
+ _eventDataFileName("slight.out"),
+ _starlight (0),
+ _inputParameters (0),
+ _nmbEventsTot (1),
+ _nmbEventsPerFile (_nmbEventsTot)
+{ }
+
+
+starlightStandalone::~starlightStandalone()
+{ }
+
+
+bool
+starlightStandalone::init()
+{
+ // read input parameters from config file
+ _inputParameters = new inputParameters();
+ if (!_inputParameters->init(_configFileName)) {
+ printWarn << "problems initializing input parameters. cannot initialize starlight." << endl;
+ return false;
+ }
+
+ // get the number of events
+ // for now we write everything to one file
+ _nmbEventsTot = _inputParameters->nmbEvents();
+ _nmbEventsPerFile = _nmbEventsTot;
+
+ // create the starlight object
+ _starlight = new starlight();
+ // give starlight the input parameters
+ _starlight->setInputParameters(_inputParameters);
+ // initialize starlight
+ return _starlight->init();
+}
+
+
+bool
+starlightStandalone::run()
+{
+ if (!_starlight) {
+ printWarn << "null pointer to starlight object. make sure that init() was called. "
+ << "cannot generate events." << endl;
+ return false;
+ }
+
+ // open output file
+ eventFileWriter fileWriter;
+ fileWriter.writeFullPythiaInfo(_inputParameters->pythiaFullEventRecord());
+ fileWriter.open(_eventDataFileName);
+
+ printInfo << "generating events:" << endl;
+ unsigned int nmbEvents = 0;
+ while (nmbEvents < _nmbEventsTot) {
+ for (unsigned int iEvent = 0; (iEvent < _nmbEventsPerFile) && (nmbEvents < _nmbEventsTot);
+ ++iEvent, ++nmbEvents) {
+ progressIndicator(iEvent, _nmbEventsTot, true, 4);
+ upcEvent event = _starlight->produceEvent();
+ // Boost event from CMS system to lab system
+ boostEvent(event);
+ fileWriter.writeEvent(event, iEvent);
+ }
+ }
+ printInfo << "number of attempts = " << _starlight->nmbAttempts() << ", "
+ << "number of accepted events = " << _starlight->nmbAccepted() << endl;
+ fileWriter.close();
+
+ return true;
+}
+void starlightStandalone::boostEvent(upcEvent &event)
+{
+
+ // Should probably move this calculation to inputParameters (and remove from bbs)
+ // Calculate CMS boost
+ double rap1 = acosh(_inputParameters->beam1LorentzGamma());
+ double rap2 = -acosh(_inputParameters->beam2LorentzGamma());
+ double boost = (rap1+rap2)/2.;
+
+ event.boost(boost);
+}
+
Property changes on: branches/starlight_1.1/src/starlightStandalone.cpp
___________________________________________________________________
Added: svn:keywords
## -0,0 +1 ##
+Rev Date Author
\ No newline at end of property
Index: branches/starlight_1.1/src/filewriter.cpp
===================================================================
--- branches/starlight_1.1/src/filewriter.cpp (revision 0)
+++ branches/starlight_1.1/src/filewriter.cpp (revision 145)
@@ -0,0 +1,94 @@
+///////////////////////////////////////////////////////////////////////////
+//
+// Copyright 2010
+//
+// This file is part of starlight.
+//
+// starlight is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
+//
+// starlight is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with starlight. If not, see <http://www.gnu.org/licenses/>.
+//
+///////////////////////////////////////////////////////////////////////////
+//
+// File and Version Information:
+// $Rev:: $: revision of last commit
+// $Author:: $: author of last commit
+// $Date:: $: date of last commit
+//
+// Description:
+//
+//
+//
+///////////////////////////////////////////////////////////////////////////
+
+
+#include <iostream>
+#include <exception>
+#include <cstdlib>
+
+#include "filewriter.h"
+
+
+using namespace std;
+
+
+fileWriter::fileWriter()
+: _fileName(""),
+ _fileStream()
+{ }
+
+
+fileWriter::fileWriter(const string& fileName) :
+ _fileName(fileName)
+ ,_fileStream(fileName.c_str())
+{ }
+
+
+fileWriter::~fileWriter()
+{ }
+
+
+int fileWriter::open()
+{
+ try
+ {
+ _fileStream.open(_fileName.c_str());
+ }
+ catch (const ios::failure & error)
+ {
+ cerr << "I/O exception: " << error.what() << endl;
+ return EXIT_FAILURE;
+ }
+ return 0;
+}
+
+
+int fileWriter::open(const string& fileName)
+{
+ _fileName = fileName;
+ return open();
+}
+
+
+int fileWriter::close()
+{
+ try
+ {
+ _fileStream.close();
+ }
+ catch (const ios::failure & error)
+ {
+ cerr << "I/O exception: " << error.what() << endl;
+ return EXIT_FAILURE;
+ }
+ return 0;
+}
Property changes on: branches/starlight_1.1/src/filewriter.cpp
___________________________________________________________________
Added: svn:keywords
## -0,0 +1 ##
+Rev Date Author
\ No newline at end of property
Index: branches/starlight_1.1/src/nucleus.cpp
===================================================================
--- branches/starlight_1.1/src/nucleus.cpp (revision 0)
+++ branches/starlight_1.1/src/nucleus.cpp (revision 145)
@@ -0,0 +1,212 @@
+///////////////////////////////////////////////////////////////////////////
+//
+// Copyright 2010
+//
+// This file is part of starlight.
+//
+// starlight is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
+//
+// starlight is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with starlight. If not, see <http://www.gnu.org/licenses/>.
+//
+///////////////////////////////////////////////////////////////////////////
+//
+// File and Version Information:
+// $Rev:: $: revision of last commit
+// $Author:: $: author of last commit
+// $Date:: $: date of last commit
+//
+// Description:
+//
+//
+//
+///////////////////////////////////////////////////////////////////////////
+
+
+#include <iostream>
+#include <fstream>
+
+#include "starlightconstants.h"
+#include "reportingUtils.h"
+#include "nucleus.h"
+
+
+using namespace std;
+using namespace starlightConstants;
+
+
+//______________________________________________________________________________
+nucleus::nucleus(const int Z,
+ const int A,
+ const double deuteronSlopePar,
+ const bool dAuCoherentProduction)
+ : _Z(Z),
+ _A(A),
+ _deuteronSlopePar(deuteronSlopePar),
+ _dAuCoherentProduction(dAuCoherentProduction)
+{
+ switch (_Z) {
+ case 79:
+ {
+ _Q0 = 0.060;
+ _rho0 = 0.159407;
+ }
+ break;
+ case 53:
+ case 49:
+ {
+ _Q0 = 0.069;
+ _rho0 = 0.161626;
+ }
+ break;
+ case 29:
+ {
+ _Q0 = 0.087;
+ _rho0 = 0.166878;
+ }
+ break;
+ case 14:
+ {
+ _Q0 = 0.115;
+ _rho0 = 0.177128;
+ }
+ break;
+ case 8:
+ {
+ _Q0 = 0.138;
+ _rho0 = 0.188459;
+ }
+ break;
+ case 82:
+ {
+ _Q0 = 0.059;
+ _rho0 = 0.159176;
+ }
+ break;
+ case 20:
+ {
+ _Q0 = 0.102;
+ _rho0 = 0.171907;
+ }
+ break;
+ case 1: // _Q0 and _rho0 are not relevant for protons.
+ {
+ _Q0 = -1.0;
+ _rho0 = -1.0;
+ }
+ break;
+ default:
+ printWarn << "density not defined for projectile with Z = " << _Z << ". using defaults." << endl;
+ _rho0 = 0.16; //'typical' density
+ _Q0 = 0.0; // not used.
+ }
+ _r0 = 1.16 * (1. - 1.16 * pow(_A, -2. / 3.)); // for FRITIOF and FormFactor.
+}
+
+
+//______________________________________________________________________________
+nucleus::~nucleus()
+{ }
+
+
+//______________________________________________________________________________
+double
+nucleus::nuclearRadius() const
+{
+ // we use this for specific nuclei, Au, Pb, protons...
+ if (_Z == 79) // Au
+ return 6.38; // [fm]
+ if (_Z == 82) // Pb
+ return 6.62; // [fm]
+ if ((_Z == 1) && (_A == 1)) // proton
+ return 0.7; // [fm]
+ if ((_Z == 1) && (_A == 2)) // deuteron
+ return 1.9; // [fm]
+ return 1.2 * pow(_A, 1. / 3.);
+}
+
+
+//______________________________________________________________________________
+double
+nucleus::formFactor(const double t) const
+{
+ // electromagnetic form factor of proton
+ if ((_Z == 1) && (_A == 1)) {
+ const double rec = 1. / (1. + t / 0.71);
+ return rec * rec;
+ }
+ // deuteron form factor
+ if ((_Z == 1) && (_A == 2)) { // careful with this line on dAu
+ // this is for dAu//Sergey
+ // sergey's stuff, also replaced b with _deuteronSlopePar and dropped t02 since it wasnt used
+ // incoherent form factor F(t) = 0.34 e(141.5 t) + 0.58 e(26.1 t) + 0.08 e(15.5 t)
+ const double st = 0.34 * exp(-141.5 * t ) + 0.58 * exp(-26.1 * t ) + 0.08 * exp(-15.5 * t );
+ const double st4 = 0.34 * exp(-141.5 * t / 4) + 0.58 * exp(-26.1 * t / 4) + 0.08 * exp(-15.5 * t / 4);
+ // st paramters from Franco and Varma for st eqn PRL33 ...
+ // form factor from Eisenberg, nuclear physics B 104
+ const double arg = _deuteronSlopePar * t;
+ if (_dAuCoherentProduction)
+ return (st4 * st4 * exp(-arg) - 0.068 * st4 * exp(-arg * 3. / 4.));
+ return exp(-arg) * 0.5 * (1 + st) - 0.068 * exp(-arg * 3. / 4.)
+ - st4 * st4 * exp(-arg) + 0.068 * st4 * exp(-arg * 3. / 4.);
+ }
+ // nuclear form factor
+ // use parameterization from FRITIOF
+ // R = r0 * A^{1/3} with r0 = 1.16 * (1 - 1.16 * A^{-2/3})
+ const double R = fritiofR0();
+ const double q = sqrt(t);
+ const double arg1 = q * R / hbarc;
+ const double arg2 = hbarc / (q * _r0);
+ const double sph = (sin(arg1) - arg1 * cos(arg1)) * 3. * arg2 * arg2 * arg2 / double(_A);
+ const double a0 = 0.70; // [fm]
+ return sph / (1. + (a0 * a0 * t) / (hbarc * hbarc));
+}
+
+//______________________________________________________________________________
+
+double
+nucleus::dipoleFormFactor(const double t, const double t0) const
+{
+ const double rec = 1. / (1. + t / t0);
+ return rec * rec;
+}
+
+//______________________________________________________________________________
+double
+nucleus::thickness(const double b) const
+{
+ // JS This code calculates the nuclear thickness function as per Eq. 4 in
+ // Klein and Nystrand, PRC 60.
+ // former DOUBLE PRECISION FUNCTION T(b)
+
+ // data for Gauss integration
+ const unsigned int nmbPoints = 5;
+ const double xg[nmbPoints + 1] = {0., 0.1488743390, 0.4333953941, 0.6794095683,
+ 0.8650633667, 0.9739065285};
+ const double ag[nmbPoints + 1] = {0., 0.2955242247, 0.2692667193, 0.2190863625,
+ 0.1494513492, 0.0666713443};
+
+ const double zMin = 0;
+ const double zMax = 15;
+ const double zRange = 0.5 * (zMax - zMin);
+ const double zMean = 0.5 * (zMax + zMin);
+ double sum = 0;
+ for(unsigned int i = 1; i <= nmbPoints; ++i) {
+ double zsp = zRange * xg[i] + zMean;
+ double radius = sqrt(b * b + zsp * zsp);
+ sum += ag[i] * rws(radius);
+ zsp = zRange * (-xg[i]) + zMean;
+ radius = sqrt(b * b + zsp * zsp);
+ sum += ag[i] * rws(radius);
+ }
+
+ return 2. * zRange * sum;
+}
Property changes on: branches/starlight_1.1/src/nucleus.cpp
___________________________________________________________________
Added: svn:keywords
## -0,0 +1 ##
+Rev Date Author
\ No newline at end of property
Index: branches/starlight_1.1/src/eventfilewriter.cpp
===================================================================
--- branches/starlight_1.1/src/eventfilewriter.cpp (revision 0)
+++ branches/starlight_1.1/src/eventfilewriter.cpp (revision 145)
@@ -0,0 +1,123 @@
+///////////////////////////////////////////////////////////////////////////
+//
+// Copyright 2010
+//
+// This file is part of starlight.
+//
+// starlight is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
+//
+// starlight is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with starlight. If not, see <http://www.gnu.org/licenses/>.
+//
+///////////////////////////////////////////////////////////////////////////
+//
+// File and Version Information:
+// $Rev:: $: revision of last commit
+// $Author:: $: author of last commit
+// $Date:: $: date of last commit
+//
+// Description:
+//
+//
+//
+///////////////////////////////////////////////////////////////////////////
+
+
+#include "eventfilewriter.h"
+#include "starlightparticlecodes.h"
+
+
+//______________________________________________________________________________
+eventFileWriter::eventFileWriter()
+: fileWriter()
+,_writeFullPythia(false)
+{ }
+
+
+//______________________________________________________________________________
+eventFileWriter::eventFileWriter(std::string filename)
+: fileWriter(filename)
+{ }
+
+
+//______________________________________________________________________________
+int eventFileWriter::writeEvent(upcEvent &event, int eventnumber)
+{
+
+ int numberoftracks = 0;
+ if(_writeFullPythia)
+ {
+ numberoftracks = event.getParticles()->size();
+ }
+ else
+ {
+ for(unsigned int i = 0; i<event.getParticles()->size(); ++i)
+ {
+ if(event.getParticles()->at(i).getStatus() >= 0) numberoftracks++;
+ }
+ }
+
+ // int _numberOfVertices = event.getVertices()->size();
+
+ // sometimes we don't have tracks due to wrongly picked W , check it
+ if(numberoftracks){
+ eventnumber++;
+
+ _fileStream << "EVENT: " << eventnumber << " " << numberoftracks << " " << 1 << std::endl;
+ if(event.getGammaEnergies()->size()) _fileStream << "GAMMAENERGIES:";
+ for(unsigned int n = 0; n < event.getGammaEnergies()->size(); n++)
+ {
+ _fileStream << " " << event.getGammaEnergies()->at(n);
+ }
+ if(event.getGammaEnergies()->size()) _fileStream<< std::endl;
+ _fileStream <<"VERTEX: "<<0.<<" "<<0.<<" "<<0.<<" "<<0.<<" "<<1<<" "<<0<<" "<<0<<" "<<numberoftracks<<std::endl;
+
+ int ipart = 0;
+ std::vector<starlightParticle>::const_iterator part = (event.getParticles())->begin();
+
+ for (part = event.getParticles()->begin(); part != event.getParticles()->end(); part++, ipart++)
+ {
+ if(!_writeFullPythia)
+ {
+ if((*part).getStatus() < 0) continue;
+ }
+ _fileStream << "TRACK: " << " " << starlightParticleCodes::jetsetToGeant((*part).getPdgCode()) <<" "<< (*part).GetPx() << " " << (*part).GetPy()
+ << " "<< (*part).GetPz() << " " << eventnumber << " " << ipart << " " << 0 << " "
+ << (*part).getPdgCode();
+
+ if(_writeFullPythia)
+ {
+// std::cout << (*part).getFirstDaughter() << std::endl;
+ lorentzVector vtx = (*part).getVertex();
+ _fileStream << " " << vtx.GetPx() << " " << vtx.GetPy() << " " << vtx.GetPz() << " " << vtx.GetE();
+ _fileStream << " " << (*part).getFirstParent() << " " << (*part).getLastParent() << " " << (*part).getFirstDaughter() << " " << (*part).getLastDaughter() << " " << (*part).getStatus();
+ }
+
+ _fileStream <<std::endl;
+ }
+ }
+
+ return 0;
+}
+
+
+//______________________________________________________________________________
+// Output from the pythia based generation...
+// if (PythiaOutput==true) {
+//
+// for (int t=0;t<(*VD)._numberOfVertices;t++) {
+// outputfile <<"VERTEX: "<<(*VD)._vertx[t]/10.<<" "<<(*VD)._verty[t]/10.<<" "<<(*VD)._vertz[t]/10.<<" "<<0.<<" "<<1<<" "<<0<<" "<<0<<" "<<_numberOfTracks<<endl; //convert from mm to cm for Geant
+// }
+//
+// for (int i=0;i<_numberOfTracks;i++) {
+// outputfile << "TRACK: " <<" "<<jtog((*VD)._charge[i]*(*VD)._fsParticle[i])<<" "<<(*VD).px[i]<<" "<<(*VD).py[i]<<" "<<(*VD).pz[i]<<" "<<eventnumber<<" "<<i<<" "<<(*VD)._mother1[i]<<" "<<(*VD)._mother2[i]<<" "<<(*VD)._daughter1[i]<<" "<<(*VD)._daughter2[i]<<" "<<(*VD)._charge[i]*(*VD)._fsParticle[i]<<endl;
+// }//end of track for loop
+// }//if pythiatrue loop
Property changes on: branches/starlight_1.1/src/eventfilewriter.cpp
___________________________________________________________________
Added: svn:keywords
## -0,0 +1 ##
+Rev Date Author
\ No newline at end of property
Index: branches/starlight_1.1/src/gammaaluminosity.cpp
===================================================================
--- branches/starlight_1.1/src/gammaaluminosity.cpp (revision 0)
+++ branches/starlight_1.1/src/gammaaluminosity.cpp (revision 145)
@@ -0,0 +1,503 @@
+///////////////////////////////////////////////////////////////////////////
+//
+// Copyright 2010
+//
+// This file is part of starlight.
+//
+// starlight is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
+//
+// starlight is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with starlight. If not, see <http://www.gnu.org/licenses/>.
+//
+///////////////////////////////////////////////////////////////////////////
+//
+// File and Version Information:
+// $Rev:: $: revision of last commit
+// $Author:: $: author of last commit
+// $Date:: $: date of last commit
+//
+// Description:
+//
+//
+//
+///////////////////////////////////////////////////////////////////////////
+
+
+#include <iostream>
+#include <fstream>
+#include <cmath>
+
+#include "inputParameters.h"
+#include "beambeamsystem.h"
+#include "beam.h"
+#include "starlightconstants.h"
+#include "nucleus.h"
+#include "bessel.h"
+#include "gammaaluminosity.h"
+
+
+using namespace std;
+
+
+//______________________________________________________________________________
+photonNucleusLuminosity::photonNucleusLuminosity(inputParameters& input, beamBeamSystem& bbsystem)
+ : photonNucleusCrossSection(input, bbsystem), _inputgammaa(input)
+{
+ cout <<"Creating Luminosity Tables."<<endl;
+ photonNucleusDifferentialLuminosity();
+ cout <<"Luminosity Tables created."<<endl;
+}
+
+
+//______________________________________________________________________________
+photonNucleusLuminosity::~photonNucleusLuminosity()
+{ }
+
+
+//______________________________________________________________________________
+void photonNucleusLuminosity::photonNucleusDifferentialLuminosity()
+{
+ // double Av,Wgp,cs,cvma;
+ double W,dW,dY;
+ double Egamma,Y;
+ // double t,tmin,tmax;
+ double testint,dndWdY;
+ double csgA;
+ // double ax,bx;
+ double C;
+
+ ofstream wylumfile;
+ wylumfile.precision(15);
+
+ double bwnorm,Eth;
+
+ dW = (_inputgammaa.maxW()-_inputgammaa.minW())/_inputgammaa.nmbWBins();
+ dY = (_inputgammaa.maxRapidity()-(-1.0)*_inputgammaa.maxRapidity())/_inputgammaa.nmbRapidityBins();
+
+ // Write the values of W used in the calculation to slight.txt.
+ wylumfile.open("slight.txt");
+ wylumfile << getbbs().beam1().Z() <<endl;
+ wylumfile << getbbs().beam1().A() <<endl;
+ wylumfile << getbbs().beam2().Z() <<endl;
+ wylumfile << getbbs().beam2().A() <<endl;
+ wylumfile << _inputgammaa.beamLorentzGamma() <<endl;
+ wylumfile << _inputgammaa.maxW() <<endl;
+ wylumfile << _inputgammaa.minW() <<endl;
+ wylumfile << _inputgammaa.nmbWBins() <<endl;
+ wylumfile << _inputgammaa.maxRapidity() <<endl;
+ wylumfile << _inputgammaa.nmbRapidityBins() <<endl;
+ wylumfile << _inputgammaa.productionMode() <<endl;
+ wylumfile << _inputgammaa.beamBreakupMode() <<endl;
+ wylumfile << _inputgammaa.interferenceEnabled() <<endl;
+ wylumfile << _inputgammaa.interferenceStrength() <<endl;
+ wylumfile << _inputgammaa.coherentProduction() <<endl;
+ wylumfile << _inputgammaa.incoherentFactor() <<endl;
+ wylumfile << _inputgammaa.deuteronSlopePar() <<endl;
+ wylumfile << _inputgammaa.maxPtInterference() <<endl;
+ wylumfile << _inputgammaa.nmbPtBinsInterference() <<endl;
+
+ // Normalize the Breit-Wigner Distribution and write values of W to slight.txt
+ testint=0.0;
+ //Grabbing default value for C in the breit-wigner calculation
+ C=getDefaultC();
+ for(unsigned int i = 0; i <= _inputgammaa.nmbWBins() - 1; ++i) {
+ W = _inputgammaa.minW() + double(i)*dW + 0.5*dW;
+ testint = testint + breitWigner(W,C)*dW;
+ wylumfile << W << endl;
+ }
+ bwnorm = 1./testint;
+
+ // Write the values of Y used in the calculation to slight.txt.
+ for(unsigned int i = 0; i <= _inputgammaa.nmbRapidityBins() - 1; ++i) {
+ Y = -1.0*_inputgammaa.maxRapidity() + double(i)*dY + 0.5*dY;
+ wylumfile << Y << endl;
+ }
+
+ Eth=0.5*(((_inputgammaa.minW()+starlightConstants::protonMass)*(_inputgammaa.minW()
+ +starlightConstants::protonMass)-starlightConstants::protonMass*starlightConstants::protonMass)/
+ (_inputgammaa.getProtonEnergy()+sqrt(_inputgammaa.getProtonEnergy()*
+ _inputgammaa.getProtonEnergy()-starlightConstants::protonMass*starlightConstants::protonMass)));
+
+ for(unsigned int i = 0; i <= _inputgammaa.nmbWBins() - 1; ++i) {
+
+ W = _inputgammaa.minW() + double(i)*dW + 0.5*dW;
+
+ for(unsigned int j = 0; j <= _inputgammaa.nmbRapidityBins() - 1; ++j) {
+
+ Y = -1.0*_inputgammaa.maxRapidity() + double(j)*dY + 0.5*dY;
+
+ int A_1 = getbbs().beam1().A();
+ int A_2 = getbbs().beam2().A();
+ if( A_2 == 1 && A_1 != 1 ){
+ // pA, first beam is the nucleus
+ Egamma = 0.5*W*exp(-Y);
+ } else if( A_1 ==1 && A_2 != 1){
+ // pA, second beam is the nucleus
+ Egamma = 0.5*W*exp(Y);
+ } else {
+ Egamma = 0.5*W*exp(Y);
+ }
+
+ dndWdY = 0.;
+
+ if( Egamma > Eth && Egamma < maxPhotonEnergy() ){
+
+ csgA=getcsgA(Egamma,W);
+ dndWdY = Egamma*photonFlux(Egamma)*csgA*breitWigner(W,bwnorm);
+
+ }
+
+ wylumfile << dndWdY << endl;
+
+ }
+ }
+
+ wylumfile.close();
+
+ if(_inputgammaa.interferenceEnabled()==1)
+ pttablegen();
+
+ wylumfile.open("slight.txt",ios::app);
+ cout << "bwnorm: "<< bwnorm <<endl;
+ wylumfile << bwnorm << endl;
+ wylumfile.close();
+}
+
+
+//______________________________________________________________________________
+void photonNucleusLuminosity::pttablegen()
+{
+ // Calculates the pt spectra for VM production with interference
+ // Follows S. Klein and J. Nystrand, Phys. Rev Lett. 84, 2330 (2000).
+ // Written by S. Klein, 8/2002
+
+ // fill in table pttable in one call
+ // Integrate over all y (using the same y values as in table yarray
+ // note that the cross section goes from ymin (<0) to ymax (>0), in numy points
+ // here, we go from 0 to ymax in (numy/2)+1 points
+ // numy must be even.
+
+ // At each y, calculate the photon energies Egamma1 and Egamma2
+ // and the two photon-A cross sections
+
+ // loop over each p_t entry in the table.
+
+ // Then, loop over b and phi (the angle between the VM \vec{p_t} and \vec{b}
+ // and calculate the cross section at each step.
+ // Put the results in pttable
+
+ ofstream wylumfile;
+ wylumfile.precision(15);
+ wylumfile.open("slight.txt",ios::app);
+
+
+ double param1pt[500],param2pt[500];
+ double *ptparam1=param1pt;
+ double *ptparam2=param2pt;
+ double dY=0.,Yp=0.,Egamma1=0.,Egamma2=0.,Wgp=0.,cs=0.,cvma=0.,Av=0.,tmin=0.,tmax=0.,ax=0.,bx=0.;
+ double csgA=0.,t=0.,sig_ga_1=0.,sig_ga_2=0.,bmax=0.,bmin=0.,db=0.,pt=0.,sum1=0.,b=0.,A1=0.,A2=0.;
+ double sumg=0.,theta=0.,amp_i_2=0.,sumint=0.;
+ int NGAUSS=0,NBIN=0,NThetaBIN=0;
+
+ double xg[16]={.0483076656877383162E0,.144471961582796493E0,
+ .239287362252137075E0, .331868602282127650E0,
+ .421351276130635345E0, .506899908932229390E0,
+ .587715757240762329E0, .663044266930215201E0,
+ .732182118740289680E0, .794483795967942407E0,
+ .849367613732569970E0, .896321155766052124E0,
+ .934906075937739689E0, .964762255587506430E0,
+ .985611511545268335E0, .997263861849481564E0};
+ double ag[16]={.0965400885147278006E0, .0956387200792748594E0,
+ .0938443990808045654E0, .0911738786957638847E0,
+ .0876520930044038111E0, .0833119242269467552E0,
+ .0781938957870703065E0, .0723457941088485062E0,
+ .0658222227763618468E0, .0586840934785355471E0,
+ .0509980592623761762E0, .0428358980222266807E0,
+ .0342738629130214331E0, .0253920653092620595E0,
+ .0162743947309056706E0, .00701861000947009660E0};
+
+ NGAUSS=16;
+
+ //Setting input calls to variables/less calls this way.
+ double Ymax=_inputgammaa.maxRapidity();
+ int numy = _inputgammaa.nmbRapidityBins();
+ double Ep = _inputgammaa.getProtonEnergy();
+ int ibreakup = _inputgammaa.beamBreakupMode();
+ double NPT = _inputgammaa.nmbPtBinsInterference();
+ double gamma_em=_inputgammaa.beamLorentzGamma();
+ double mass= getChannelMass();
+
+ // loop over y from 0 (not -ymax) to yma
+
+ dY=(2.*Ymax)/numy;
+ for(int jy=1;jy<=numy/2;jy++){
+ Yp=(double(jy)-0.5)*dY;
+
+ // Find the photon energies. Yp >= 0, so Egamma2 is smaller
+ // Use the vector meson mass for W here - neglect the width
+
+ Egamma1 = 0.5*mass*exp(Yp);
+ Egamma2 = 0.5*mass*exp(-Yp);
+
+ // Find the sigma(gammaA) for the two directions
+ // Photonuclear Cross Section 1
+ // Gamma-proton CM energy
+
+ Wgp=sqrt(2.*Egamma1*(Ep+sqrt(Ep*Ep-starlightConstants::protonMass*
+ starlightConstants::protonMass))+starlightConstants::protonMass*starlightConstants::protonMass);
+
+ // Calculate V.M.+proton cross section
+
+ cs=sqrt(16.*starlightConstants::pi*vmPhotonCoupling()*slopeParameter()*
+ starlightConstants::hbarc*starlightConstants::hbarc*sigmagp(Wgp)
+ /starlightConstants::alpha);
+
+ // Calculate V.M.+nucleus cross section
+
+ cvma=sigma_A(cs);
+
+ // Calculate Av = dsigma/dt(t=0) Note Units: fm**2/Gev**2
+
+ Av=(starlightConstants::alpha*cvma*cvma)/(16.*starlightConstants::pi
+ *vmPhotonCoupling()*starlightConstants::hbarc*starlightConstants::hbarc);
+
+ tmin = ((mass*mass)/(4.*Egamma1*gamma_em)*(mass*mass)/(4.*Egamma1*gamma_em));
+ tmax = tmin + 0.25;
+ ax = 0.5*(tmax-tmin);
+ bx = 0.5*(tmax+tmin);
+ csgA = 0.;
+
+ for(int k=0;k<NGAUSS;k++){
+ t = sqrt(ax*xg[k]+bx);
+ csgA = csgA + ag[k]*getbbs().beam2().formFactor(t)*getbbs().beam2().formFactor(t);
+ t = sqrt(ax*(-xg[k])+bx);
+ csgA = csgA + ag[k]*getbbs().beam2().formFactor(t)*getbbs().beam2().formFactor(t);
+ }
+
+ csgA = 0.5*(tmax-tmin)*csgA;
+ csgA = Av*csgA;
+ sig_ga_1 = csgA;
+
+ // Photonuclear Cross Section 2
+
+ Wgp=sqrt(2.*Egamma2*(Ep+sqrt(Ep*Ep-starlightConstants::protonMass*
+ starlightConstants::protonMass))+starlightConstants::protonMass*starlightConstants::protonMass);
+
+ cs=sqrt(16.*starlightConstants::pi*vmPhotonCoupling()*slopeParameter()*
+ starlightConstants::hbarc*starlightConstants::hbarc*sigmagp(Wgp)/starlightConstants::alpha);
+
+ cvma=sigma_A(cs);
+
+ Av=(starlightConstants::alpha*cvma*cvma)/(16.*starlightConstants::pi
+ *vmPhotonCoupling()*starlightConstants::hbarc*starlightConstants::hbarc);
+
+ tmin = (((mass*mass)/(4.*Egamma2*gamma_em))*((mass*mass)/(4.*Egamma2*gamma_em)));
+ tmax = tmin + 0.25;
+ ax = 0.5*(tmax-tmin);
+ bx = 0.5*(tmax+tmin);
+ csgA = 0.;
+
+ for(int k=0;k<NGAUSS;k++){
+ t = sqrt(ax*xg[k]+bx);
+ csgA = csgA + ag[k]*getbbs().beam2().formFactor(t)*getbbs().beam2().formFactor(t);
+ t = sqrt(ax*(-xg[k])+bx);
+ csgA = csgA + ag[k]*getbbs().beam2().formFactor(t)*getbbs().beam2().formFactor(t);
+ }
+
+ csgA = 0.5*(tmax-tmin)*csgA;
+ csgA = Av*csgA;
+ sig_ga_2 = csgA;
+
+ // Set up pttables - they find the reduction in sigma(pt)
+ // due to the nuclear form factors.
+ // Use the vector meson mass for W here - neglect width in
+ // interference calculation
+
+ ptparam1=vmsigmapt(mass,Egamma1,ptparam1);
+ ptparam2=vmsigmapt(mass,Egamma2,ptparam2);
+
+ // set bmax according to the smaller photon energy, following flux.f
+
+ bmax=bmin+6.*starlightConstants::hbarc*gamma_em/Egamma2;
+ bmin = getbbs().beam1().nuclearRadius()+getbbs().beam2().nuclearRadius();
+ // if we allow for nuclear breakup, use a slightly smaller bmin
+
+ if (ibreakup != 1)
+ bmin=0.95*bmin;
+ // set number of bins to a reasonable number to start
+ NBIN = 2000;
+ NThetaBIN = 1000;
+ db = (bmax-bmin)/float(NBIN);
+ // loop over pt
+ for(int i=1;i<=NPT;i++){
+
+ pt = (float(i)-0.5)*_inputgammaa.ptBinWidthInterference();
+ sum1=0.0;
+ // loop over b
+ for(int j=1;j<=NBIN;j++){
+
+ b = bmin + (float(j)-0.5)*db;
+ // nofe is the photon flux function
+ A1 = Egamma1*nofe(Egamma1,b)*sig_ga_1*ptparam1[i];
+ A2 = Egamma2*nofe(Egamma2,b)*sig_ga_2*ptparam2[i];
+ sumg=0.0;
+ // do this as a Gaussian integral, from 0 to pi
+ for(int k=0;k<NGAUSS;k++){
+
+ theta=xg[k]*starlightConstants::pi;
+ // allow for a linear sum of interfering and non-interfering amplitudes
+ amp_i_2 = A1 + A2 - 2.*_inputgammaa.interferenceStrength()
+ *sqrt(A1*A2)*cos(pt*b*cos(theta)/starlightConstants::hbarc);
+ sumg = sumg+ag[k]*amp_i_2;
+ }
+ // this is dn/dpt^2
+ // The factor of 2 is because the theta integral is only from 0 to pi
+ sumint=2.*sumg*b*db;
+ if (ibreakup > 1)
+ sumint=sumint*getbbs().probabilityOfBreakup(b);
+ sum1 = sum1 + sumint;
+ }
+ // normalization is done in readDiffLum.f
+ // This is d^2sigma/dpt^2; convert to dsigma/dpt
+ //CHECK THIS OUT----> write(20,*)sum1*pt*dpt
+ wylumfile << sum1*pt*_inputgammaa.ptBinWidthInterference() <<endl;
+ // end of pt loop
+ }
+ // end of y loop
+ }
+ wylumfile.close();
+}
+
+
+//______________________________________________________________________________
+double *photonNucleusLuminosity::vmsigmapt(double W, double Egamma, double *SIGMAPT)
+{
+ //
+ // This subroutine calculates the effect of the nuclear form factor
+ // on the pt spectrum, for use in interference calculations
+ // For an interaction with mass W and photon energy Egamma,
+ // it calculates the cross section suppression SIGMAPT(PT)
+ // as a function of pt.
+ // The input pt values come from pttable.inc
+
+
+ double pxmax=0.,pymax=0.,dx=0.,Epom=0.,pt=0.,px0=0.,py0=0.,sum=0.,sumy=0.;
+ double py=0.,px=0.,pt1=0.,pt2=0.,f1=0.,f2=0.,q1=0.,q2=0.,norm=0.;
+ int NGAUSS =0,Nxbin=0;
+ double xg[16]={.0483076656877383162e0,.144471961582796493e0,
+ .239287362252137075e0, .331868602282127650e0,
+ .421351276130635345e0, .506899908932229390e0,
+ .587715757240762329e0, .663044266930215201e0,
+ .732182118740289680e0, .794483795967942407e0,
+ .849367613732569970e0, .896321155766052124e0,
+ .934906075937739689e0, .964762255587506430e0,
+ .985611511545268335e0, .997263861849481564e0};
+ double ag[16]={.0965400885147278006e0, .0956387200792748594e0,
+ .0938443990808045654e0, .0911738786957638847e0,
+ .0876520930044038111e0, .0833119242269467552e0,
+ .0781938957870703065e0, .0723457941088485062e0,
+ .0658222227763618468e0, .0586840934785355471e0,
+ .0509980592623761762e0, .0428358980222266807e0,
+ .0342738629130214331e0, .0253920653092620595e0,
+ .0162743947309056706e0, .00701861000947009660e0};
+ NGAUSS=16;
+
+ // >> Initialize
+ pxmax = 10.*(starlightConstants::hbarc/getbbs().beam1().nuclearRadius());
+ pymax = 10.*(starlightConstants::hbarc/getbbs().beam1().nuclearRadius());
+
+ Nxbin = 500;
+
+ dx = 2.*pxmax/double(Nxbin);
+ Epom = W*W/(4.*Egamma);
+
+ // >> Loop over total Pt to find distribution
+
+ for(int k=1;k<=_inputgammaa.nmbPtBinsInterference();k++){
+
+ pt=_inputgammaa.ptBinWidthInterference()*(double(k)-0.5);
+
+ px0 = pt;
+ py0 = 0.0;
+
+ // For each total Pt, integrate over Pt1, , the photon pt
+ // The pt of the Pomeron is the difference
+ // pt1 is
+ sum=0.;
+ for(int i=1;i<=Nxbin;i++){
+
+ px = -pxmax + (double(i)-0.5)*dx;
+ sumy=0.0;
+ for(int j=0;j<NGAUSS;j++){
+
+ py = 0.5*pymax*xg[j]+0.5*pymax;
+ // photon pt
+ pt1 = sqrt( px*px + py*py );
+ // pomeron pt
+ pt2 = sqrt( (px-px0)*(px-px0) + (py-py0)*(py-py0) );
+ q1 = sqrt( ((Egamma/_inputgammaa.beamLorentzGamma())*(Egamma/_inputgammaa.beamLorentzGamma())) + pt1*pt1 );
+ q2 = sqrt( ((Epom/_inputgammaa.beamLorentzGamma())*(Epom/_inputgammaa.beamLorentzGamma())) + pt2*pt2 );
+
+ // photon form factor
+ // add in phase space factor?
+ f1 = (getbbs().beam1().formFactor(q1*q1)*getbbs().beam1().formFactor(q1*q1)*pt1*pt1)/(q1*q1*q1*q1);
+
+ // Pomeron form factor
+ f2 = getbbs().beam1().formFactor(q2*q2)*getbbs().beam1().formFactor(q2*q2);
+ sumy= sumy + ag[j]*f1*f2;
+
+ // now consider other half of py phase space - why is this split?
+ py = 0.5*pymax*(-xg[j])+0.5*pymax;
+ pt1 = sqrt( px*px + py*py );
+ pt2 = sqrt( (px-px0)*(px-px0) + (py-py0)*(py-py0) );
+ q1 = sqrt( ((Egamma/_inputgammaa.beamLorentzGamma())*Egamma/_inputgammaa.beamLorentzGamma()) + pt1*pt1 );
+ q2 = sqrt( ((Epom/_inputgammaa.beamLorentzGamma())*(Epom/_inputgammaa.beamLorentzGamma())) + pt2*pt2 );
+ // add in phase space factor?
+ f1 = (getbbs().beam1().formFactor(q1*q1)*getbbs().beam1().formFactor(q1*q1)*pt1*pt1)/(q1*q1*q1*q1);
+ f2 = getbbs().beam1().formFactor(q2*q2)*getbbs().beam1().formFactor(q2*q2);
+ sumy= sumy + ag[j]*f1*f2;
+
+ }
+ // >> This is to normalize the gaussian integration
+ sumy = 0.5*pymax*sumy;
+ // >> The 2 is to account for py: 0 -- pymax
+ sum = sum + 2.*sumy*dx;
+ }
+
+ if(k==1) norm=1./sum;
+ SIGMAPT[k]=sum*norm;
+ }
+ return (SIGMAPT);
+}
+
+
+//______________________________________________________________________________
+double photonNucleusLuminosity::nofe(double Egamma, double bimp)
+{
+ //Function for the calculation of the "photon density".
+ //nofe=numberofgammas/(energy*area)
+ //Assume beta=1.0 and gamma>>1, i.e. neglect the (1/gamma^2)*K0(x) term
+
+ double X=0.,nofex=0.,factor1=0.,factor2=0.,factor3=0.;
+
+ X = (bimp*Egamma)/(_inputgammaa.beamLorentzGamma()*starlightConstants::hbarc);
+
+ if( X <= 0.0)
+ cout<<"In nofe, X= "<<X<<endl;
+
+ factor1 = (double(getbbs().beam1().Z()*getbbs().beam1().Z())
+ *starlightConstants::alpha)/(starlightConstants::pi*starlightConstants::pi);
+
+ factor2 = 1./(Egamma*bimp*bimp);
+ factor3 = X*X*(bessel::dbesk1(X))*(bessel::dbesk1(X));
+ nofex = factor1*factor2*factor3;
+ return nofex;
+}
Property changes on: branches/starlight_1.1/src/gammaaluminosity.cpp
___________________________________________________________________
Added: svn:keywords
## -0,0 +1 ##
+Rev Date Author
\ No newline at end of property
Index: branches/starlight_1.1/src/gammagammaleptonpair.cpp
===================================================================
--- branches/starlight_1.1/src/gammagammaleptonpair.cpp (revision 0)
+++ branches/starlight_1.1/src/gammagammaleptonpair.cpp (revision 145)
@@ -0,0 +1,849 @@
+///////////////////////////////////////////////////////////////////////////
+//
+// Copyright 2010
+//
+// This file is part of starlight.
+//
+// starlight is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
+//
+// starlight is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with starlight. If not, see <http://www.gnu.org/licenses/>.
+//
+///////////////////////////////////////////////////////////////////////////
+//
+// File and Version Information:
+// $Rev:: $: revision of last commit
+// $Author:: $: author of last commit
+// $Date:: $: date of last commit
+//
+// Description:
+// Nystrand 220710
+// Fixed bug which gave incorrect minv distribution in gammagammaleptonpair.
+// Moved loop over W and Y from pickw to twoLeptonCrossSection in
+// gammagammaleptonpair to speed up event generation.
+// Changed to Woods-Saxon radius in twophotonluminosity to be consistent
+// with old starligt.
+//
+//
+///////////////////////////////////////////////////////////////////////////
+
+
+#include <iostream>
+#include <fstream>
+#include <cmath>
+#include <vector>
+
+#include "starlightconstants.h"
+#include "gammagammaleptonpair.h"
+
+
+using namespace std;
+
+
+//_____________________________________________________________________________
+Gammagammaleptonpair::Gammagammaleptonpair(inputParameters& input, beamBeamSystem& bbsystem)
+: eventChannel(input, bbsystem)
+{
+ //Initialize randomgenerator with our seed.
+ _randy.SetSeed(input.randomSeed());
+ cout<<"Randy in leptonpair construction: "<<_randy.Rndom()<<endl;
+ //Storing inputparameters into protected members for use
+ _GGlepInputnumw=input.nmbWBins();
+ _GGlepInputnumy=input.nmbRapidityBins();
+ _GGlepInputpidtest=input.prodParticleType();
+ _GGlepInputGamma_em=input.beamLorentzGamma();
+ //Let us read in the luminosity tables
+ read();
+ //Now we will calculate the crosssection
+ twoLeptonCrossSection();
+ //If it is a tauon, calculate its tables
+ if(input.prodParticleId()==starlightConstants::TAUON) calculateTable();
+}
+
+
+//______________________________________________________________________________
+Gammagammaleptonpair::~Gammagammaleptonpair()
+{ }
+
+
+//______________________________________________________________________________
+void Gammagammaleptonpair::twoLeptonCrossSection()
+{
+ //This function calculates section for 2-particle decay. For reference, see STAR Note 243, Eq. 9.
+ //calculate the 2-lepton differential cross section
+ //the 100 is to convert to barns
+ //the 2 is to account for the fact that we integrate only over one half of the rapidity range
+ //Multiply all _Farray[] by _f_max
+
+ for(int i=0;i<_GGlepInputnumw;i++)
+ {
+ for(int j=0;j<_GGlepInputnumy;j++)
+ {
+ // _sigmax[i][j]=2.*Gammagammaleptonpair::twoMuonCrossSection(_Warray[i])*_f_max*_Farray[i][j]/100.;
+ _sigmax[i][j]=twoMuonCrossSection(_Warray[i])*_f_max*_Farray[i][j]/(100.*_Warray[i]);
+ }
+ }
+ //calculate the total two-lepton cross section
+ double sigmasum =0.;
+ for(int i=0;i<_GGlepInputnumw-1;i++)
+ {
+ for(int j=0;j<_GGlepInputnumy-1;j++)
+ {
+ // _sigmaSum = _sigmaSum +2.*((_sigmax[i][j]+_sigmax[i+1][j]+_sigmax[i][j+1]+_sigmax[i+1][j+1])/4.*(_Yarray[j+1]-_Yarray[j])*(_Warray[i+1]-_Warray[i])/((_Warray[i+1]+_Warray[i])/2.));
+ // _sigmaSum = _sigmaSum +((_sigmax[i][j]+_sigmax[i+1][j]+_sigmax[i][j+1]+_sigmax[i+1][j+1])/4.*(_Yarray[j+1]-_Yarray[j])*(_Warray[i+1]-_Warray[i])/((_Warray[i+1]+_Warray[i])/2.));
+ sigmasum = sigmasum +(_sigmax[i][j]+_sigmax[i+1][j]+_sigmax[i][j+1]+_sigmax[i+1][j+1])/4.*(_Yarray[j+1]-_Yarray[j])*(_Warray[i+1]-_Warray[i]);
+ }
+ }
+ cout << "The total "<<_GGlepInputpidtest<<" cross-section is: "<<sigmasum<<" barns."<<endl;
+
+ // Do this integration here, once per run rather than once per event (JN 220710)
+ //integrate sigma down to a function of just w
+
+ double sgf=0.;
+
+ for(int i=0;i<_ReadInputnumw;i++)
+ {
+ _sigofw[i]=0.;
+ for(int j=0;j<_ReadInputnumy-1;j++)
+ {
+ _sigofw[i] = _sigofw[i]+(_Yarray[j+1]-_Yarray[j])*(_sigmax[i][j+1]+_sigmax[i][j])/2.;
+ }
+ }
+
+ //calculate the unnormalized sgfint array
+ _sigfint[0]=0.;
+ for(int i=0;i<_ReadInputnumw-1;i++)
+ {
+ sgf=(_sigofw[i+1]+_sigofw[i])*(_Warray[i+1]-_Warray[i])/2.;
+ _sigfint[i+1]=_sigfint[i]+sgf;
+ }
+
+ //normalize sgfint array
+ _signormw=_sigfint[_ReadInputnumw-1];
+ for(int i=0;i<_ReadInputnumw;i++)
+ {
+ _sigfint[i]=_sigfint[i]/_signormw;
+ }
+ return;
+}
+
+
+//______________________________________________________________________________
+double Gammagammaleptonpair::twoMuonCrossSection(double w)
+{
+ //This function gives the two muon cross section as a function of Y&W.
+ //Using the formula given in G.Soff et. al Nuclear Equation of State, part B, 579
+ double s=0.,Etest=0.,deltat=0.,xL=0.,sigmuix=0.,alphasquared=0.,hbarcsquared=0.;
+ s = w*w;
+ Etest = 4.*getMass()*getMass()/s;
+ deltat = s * sqrt(1.-Etest);
+ xL = 2.*log(sqrt(s)/(2.*getMass())+sqrt(1./Etest-1.));
+ alphasquared = starlightConstants::alpha*starlightConstants::alpha;
+ hbarcsquared = starlightConstants::hbarc*starlightConstants::hbarc;
+ sigmuix = 4.*starlightConstants::pi*alphasquared/s*hbarcsquared*((1+Etest-0.5*Etest*Etest)*xL-(1./s+Etest/s)*deltat);
+ if(Etest > 1.)
+ sigmuix = 0.;
+ return sigmuix;
+}
+
+
+//______________________________________________________________________________
+void Gammagammaleptonpair::pickw(double &w)
+{
+// This function picks a w for the 2-photon calculation.
+
+ double x=0.,remainarea=0.,remainw=0.,a=0.,b=0.,c=0.;
+ int ivalw=0;
+
+ if(_wdelta != 0)
+ {
+ w=_wdelta;
+ ivalw=_ivalwd;
+ remainw=_remainwd;
+ }
+ else{
+ //deal with the case where sigma is an array
+ //_sigofw is simga integrated over y using a linear interpolation
+ //sigint is the integral of sgfint, normalized
+
+ //pick a random number
+ x = _randy.Rndom();//random()/(RAND_MAX+1.0);
+ //compare x and sgfint to find the ivalue which is just less than the random number x
+ for(int i=0;i<_GGlepInputnumw;i++)
+ {
+ if(x > _sigfint[i]) ivalw=i;
+ }
+ //remainder above ivalw
+ remainarea = x - _sigfint[ivalw];
+
+ //figure out what point corresponds to the excess area in remainarea
+ c = -remainarea*_signormw/(_Warray[ivalw+1]-_Warray[ivalw]);
+ b = _sigofw[ivalw];
+ a = (_sigofw[ivalw+1]-_sigofw[ivalw])/2.;
+ if(a==0.)
+ {
+ remainw = -c/b;
+ }
+ else{
+ remainw = (-b+sqrt(b*b-4.*a*c))/(2.*a);
+ }
+ _ivalwd = ivalw;
+ _remainwd = remainw;
+ //calculate the w value
+ w = _Warray[ivalw]+(_Warray[ivalw+1]-_Warray[ivalw])*remainw;
+
+ }
+}
+
+
+//______________________________________________________________________________
+void Gammagammaleptonpair::picky(double &y)
+{
+ // This function picks a y given a W
+
+ double * sigofy;
+ double * sgfint;
+ sigofy = new double[starlightLimits::MAXYBINS];
+ sgfint = new double[starlightLimits::MAXWBINS];
+
+ double remainw =0.,remainarea=0.,remainy=0.,a=0.,b=0.,c=0.,sgf=0.,signorm=0.,x=0.;
+ int ivalw=0,ivaly=0;
+
+ ivalw=_ivalwd;
+ remainw=_remainwd;
+ //average over two colums to get y array
+ for(int j=0;j<_GGlepInputnumy;j++)
+ {
+ sigofy[j]=_sigmax[ivalw][j]+(_sigmax[ivalw+1][j]-_sigmax[ivalw][j])*remainw;
+ }
+
+ //calculate the unnormalized sgfint
+ sgfint[0]=0.;
+ for(int j=0;j<_GGlepInputnumy-1;j++)
+ {
+ sgf = (sigofy[j+1]+sigofy[j])/2.;
+ sgfint[j+1]=sgfint[j]+sgf*(_Yarray[j+1]-_Yarray[j]);
+ }
+
+ //normalize the sgfint array
+ signorm = sgfint[_GGlepInputnumy-1];
+
+ for(int j=0;j<_GGlepInputnumy;j++)
+ {
+ sgfint[j]=sgfint[j]/signorm;
+ }
+
+ //pick a random number
+ x = _randy.Rndom();//random()/(RAND_MAX+1.0);
+ //compare x and sgfint to find the ivalue which is just less then the random number x
+ for(int i=0;i<_GGlepInputnumy;i++)
+ {
+ if(x > sgfint[i]) ivaly = i;
+ }
+ //remainder above ivaly
+ remainarea = x - sgfint[ivaly];
+
+ //figure what point corresponds to the leftover area in remainarea
+ c = -remainarea*signorm/(_Yarray[ivaly+1]-_Yarray[ivaly]);
+ b = sigofy[ivaly];
+ a = (sigofy[ivaly+1]-sigofy[ivaly])/2.;
+ if(a==0.)
+ {
+ remainy = -c/b;
+ }
+ else{
+ remainy = (-b + sqrt(b*b-4.*a*c))/(2.*a);
+ }
+ //calculate the y value
+ y = _Yarray[ivaly]+(_Yarray[ivaly+1]-_Yarray[ivaly])*remainy;
+ delete[] sigofy;
+ delete[] sgfint;
+}
+
+
+//______________________________________________________________________________
+void Gammagammaleptonpair::pairMomentum(double w,double y,double &E,double &px,double &py,double &pz)
+{
+ //this function calculates px,py,pz,and E given w and y
+
+ double anglepp1=0.,anglepp2=0.,pp1=0.,pp2=0.,E1=0.,E2=0.,signpx=0.,pt=0.;
+
+ //E1 and E2 are for the 2 photons in the CM frame
+ E1 = w*exp(y)/2.;
+ E2 = w*exp(-y)/2.;
+
+ //calculate px and py
+ //to get x and y components-- phi is random between 0 and 2*pi
+ anglepp1 = _randy.Rndom();//random()/(RAND_MAX+1.0);
+ anglepp2 = _randy.Rndom();//random()/(RAND_MAX+1.0);
+
+ pp1 = pp_1(E1);
+ pp2 = pp_2(E2);
+ px = pp1*cos(2.*starlightConstants::pi*anglepp1)+pp2*cos(2.*starlightConstants::pi*anglepp2);
+ py = pp1*sin(2.*starlightConstants::pi*anglepp1)+pp2*sin(2.*starlightConstants::pi*anglepp2);
+
+ //Compute vector sum Pt=Pt1+Pt2 to find pt for the produced particle
+ pt = sqrt(px*px+py*py);
+
+ //W is the mass of the produced particle (not necessarily on-mass-shell).Now compute its energy and pz
+ E = sqrt(w*w+pt*pt)*cosh(y);
+ pz= sqrt(w*w+pt*pt)*sinh(y);
+ signpx = _randy.Rndom();//random()/(RAND_MAX+1.0);
+
+ //pick the z direction
+ //Don't do this anymore since y goes from -ymax to +ymax (JN 15-02-2013)
+ //if(signpx > 0.5) pz = -pz;
+}
+
+
+//______________________________________________________________________________
+double Gammagammaleptonpair::pp_1(double E)
+{
+ // This is for beam 1
+ // returns on random draw from pp(E) distribution
+ double ereds =0.,Cm=0.,Coef=0.,x=0.,pp=0.,test=0.,u=0.;
+ double singleformfactorCm=0.,singleformfactorpp1=0.,singleformfactorpp2=0.;
+ int satisfy =0;
+
+ ereds = (E/_GGlepInputGamma_em)*(E/_GGlepInputGamma_em);
+ //sqrt(3)*E/gamma_em is p_t where the distribution is a maximum
+ Cm = sqrt(3.)*E/_GGlepInputGamma_em;
+ //the amplitude of the p_t spectrum at the maximum
+ singleformfactorCm=_bbs.beam1().formFactor(Cm*Cm+ereds);
+ Coef = 3.0*(singleformfactorCm*singleformfactorCm*Cm*Cm*Cm)/((2.*(starlightConstants::pi)*(ereds+Cm*Cm))*(2.*(starlightConstants::pi)*(ereds+Cm*Cm)));
+
+ //pick a test value pp, and find the amplitude there
+ x = _randy.Rndom();
+ pp = x*5.*starlightConstants::hbarc/_bbs.beam1().nuclearRadius();
+ singleformfactorpp1=_bbs.beam1().formFactor(pp*pp+ereds);
+ test = (singleformfactorpp1*singleformfactorpp1)*pp*pp*pp/((2.*starlightConstants::pi*(ereds+pp*pp))*(2.*starlightConstants::pi*(ereds+pp*pp)));
+
+ while(satisfy==0){
+ u = _randy.Rndom();
+ if(u*Coef <= test)
+ {
+ satisfy =1;
+ }
+ else{
+ x =_randy.Rndom();
+ pp = 5*starlightConstants::hbarc/_bbs.beam1().nuclearRadius()*x;
+ singleformfactorpp2=_bbs.beam1().formFactor(pp*pp+ereds);
+ test = (singleformfactorpp2*singleformfactorpp2)*pp*pp*pp/(2.*starlightConstants::pi*(ereds+pp*pp)*2.*starlightConstants::pi*(ereds+pp*pp));
+ }
+ }
+
+ return pp;
+}
+
+//______________________________________________________________________________
+double Gammagammaleptonpair::pp_2(double E)
+{
+
+ // This is for beam 2
+ //returns on random draw from pp(E) distribution
+ double ereds =0.,Cm=0.,Coef=0.,x=0.,pp=0.,test=0.,u=0.;
+ double singleformfactorCm=0.,singleformfactorpp1=0.,singleformfactorpp2=0.;
+ int satisfy =0;
+
+ ereds = (E/_GGlepInputGamma_em)*(E/_GGlepInputGamma_em);
+ //sqrt(3)*E/gamma_em is p_t where the distribution is a maximum
+ Cm = sqrt(3.)*E/_GGlepInputGamma_em;
+ //the amplitude of the p_t spectrum at the maximum
+ singleformfactorCm=_bbs.beam2().formFactor(Cm*Cm+ereds);
+ Coef = 3.0*(singleformfactorCm*singleformfactorCm*Cm*Cm*Cm)/((2.*(starlightConstants::pi)*(ereds+Cm*Cm))*(2.*(starlightConstants::pi)*(ereds+Cm*Cm)));
+
+ //pick a test value pp, and find the amplitude there
+ x = _randy.Rndom();
+ pp = x*5.*starlightConstants::hbarc/_bbs.beam2().nuclearRadius(); //Will use nucleus #1
+ singleformfactorpp1=_bbs.beam2().formFactor(pp*pp+ereds);
+ test = (singleformfactorpp1*singleformfactorpp1)*pp*pp*pp/((2.*starlightConstants::pi*(ereds+pp*pp))*(2.*starlightConstants::pi*(ereds+pp*pp)));
+
+ while(satisfy==0){
+ u = _randy.Rndom();
+ if(u*Coef <= test)
+ {
+ satisfy =1;
+ }
+ else{
+ x =_randy.Rndom();
+ pp = 5*starlightConstants::hbarc/_bbs.beam2().nuclearRadius()*x;
+ singleformfactorpp2=_bbs.beam2().formFactor(pp*pp+ereds);
+ test = (singleformfactorpp2*singleformfactorpp2)*pp*pp*pp/(2.*starlightConstants::pi*(ereds+pp*pp)*2.*starlightConstants::pi*(ereds+pp*pp));
+ }
+ }
+
+ return pp;
+}
+
+
+
+//______________________________________________________________________________
+void Gammagammaleptonpair::twoBodyDecay(starlightConstants::particleTypeEnum &ipid,
+ double , // E (unused)
+ double W,
+ double px0, double py0, double pz0,
+ double& px1, double& py1, double& pz1,
+ double& px2, double& py2, double& pz2,
+ int& iFbadevent)
+{
+ // This routine decays a particle into two particles of mass mdec,
+ // taking spin into account
+
+ double mdec=0.,E1=0.,E2=0.;
+ double pmag, anglelep[20001];
+ // double ytest=0.,dndtheta;
+ double phi,theta,xtest,Ecm;
+ double betax,betay,betaz;
+ double hirestheta,hirestest,hiresw; //added from JN->needed precision
+
+ // set the mass of the daughter particles
+
+ mdec = getMass();
+ if(W < 2*mdec)
+ {
+ cout<<" ERROR: W="<<W<<endl;
+ iFbadevent = 1;
+ return;
+ }
+ pmag = sqrt(W*W/4. - mdec*mdec);
+
+ // pick an orientation, based on the spin
+ // phi has a flat distribution in 2*pi
+ phi = _randy.Rndom()*2.*starlightConstants::pi; //(random()/(RAND_MAX+1.0))* 2.*starlightConstants::pi;
+
+ // find theta, the angle between one of the outgoing particles and
+ // the beamline, in the frame of the two photons
+
+ if(getSpin()==0.5){
+ // calculate a table of integrated angle values for leptons
+ // JN05: Go from 1000->20000bins, use double precision for anglelep and thetalep. needed when W >6Gev.
+ hiresw = W;
+
+ anglelep[0] = 0.;
+
+ for(int i =1;i<=20000;i++)
+ {
+ hirestheta = starlightConstants::pi * double(i) /20000.;
+
+ // Added sin(theta) phase space factor (not in thetalep) and changed E to W in thetalep call
+ // 11/9/2000 SRK
+ // Note that thetalep is form invariant, so it could be called for E, theta_lab just
+ // as well as W,theta_cm. Since there is a boost from cm to lab below, the former is fine.
+
+ anglelep[i] = anglelep[i-1] + thetalep(hiresw,hirestheta)*sin(hirestheta);
+ }
+
+ hirestheta = 0.;
+ xtest = _randy.Rndom();//random()/(RAND_MAX+1.0);
+ hirestest = xtest;
+ for(int i =1;i<=20000;i++)
+ {
+ if(xtest > (anglelep[i]/anglelep[20000]))
+ hirestheta = starlightConstants::pi * double(i) / 20000.;
+ }
+ theta=hirestheta;
+
+ }
+
+ if(getSpin() != 0.5)
+ cout<<" This model cannot yet handle this spin value for lepton pairs: "<<getSpin()<<endl;
+
+
+ // compute unboosted momenta
+ px1 = sin(theta)*cos(phi)*pmag;
+ py1 = sin(theta)*sin(phi)*pmag;
+ pz1 = cos(theta)*pmag;
+ px2 = -px1;
+ py2 = -py1;
+ pz2 = -pz1;
+
+ // compute energies
+ //Changed mass to W 11/9/2000 SRK
+ Ecm = sqrt(W*W+px0*px0+py0*py0+pz0*pz0);
+
+ E1 = sqrt(mdec*mdec+px1*px1+py1*py1+pz1*pz1);
+ E2 = sqrt(mdec*mdec+px2*px2+py2*py2+pz2*pz2);
+ // decay tau to electrons
+ // note that after this routine px1, etc., refer to the electrons
+ if(_GGlepInputpidtest == starlightConstants::TAUON)
+ tauDecay(px1,py1,pz1,E1,px2,py2,pz2,E2);
+
+ // Lorentz transform into the lab frame
+ // betax,betay,betaz are the boost of the complete system
+ betax = -(px0/Ecm);
+ betay = -(py0/Ecm);
+ betaz = -(pz0/Ecm);
+
+ transform (betax,betay,betaz,E1,px1,py1,pz1,iFbadevent);
+ transform (betax,betay,betaz,E2,px2,py2,pz2,iFbadevent);
+
+
+ if(iFbadevent == 1)
+ return;
+
+ // change particle id from that of parent to that of daughters
+ // change taoun id into electron id, already switched particles in tau decay
+ if(_GGlepInputpidtest == starlightConstants::TAUON)
+ ipid = starlightConstants::ELECTRON;
+ // electrons remain electrons; muons remain muons
+ if ((_GGlepInputpidtest == starlightConstants::ELECTRON) || (_GGlepInputpidtest == starlightConstants::MUON))
+ ipid = _GGlepInputpidtest;
+}
+
+
+//______________________________________________________________________________
+double Gammagammaleptonpair::thetalep(double W,double theta)
+{
+ // This function calculates the cross-section as a function of
+ // angle for a given W and Y, for the production of two muons.
+ // (or tauons)
+ // expression is taken from Brodsky et al. PRD 1971, 1532
+ // equation 5.7
+ // factor that are not dependant on theta are scrapped, so the
+ // the absolute crosssections given by this function are inaccurate
+ // here we are working in the CM frame of the photons and the last
+ // term is 0
+
+ // real function thetalep (W,theta)
+
+ double moverw=0., W1sq=0.;
+ double thetalep_r=0.,denominator=0.;
+
+ W1sq = (W / 2.)*(W/2.);
+ moverw = getMass()*getMass() / W1sq;
+ denominator = (1. - (1. - moverw)*(cos(theta)*cos(theta)));
+
+ thetalep_r = 2. + 4.*(1.-moverw)*((1.-moverw)*sin(theta)*sin(theta)*cos(theta)*cos(theta) + moverw) / (denominator*denominator);
+
+ return thetalep_r;
+
+}
+
+
+//______________________________________________________________________________
+starlightConstants::event Gammagammaleptonpair::produceEvent(int &ievent)
+{//returns the vector with the decay particles inside.
+ starlightConstants::event leptonpair; //This object will store all the tracks for a single event
+ double comenergy = 0.;
+ double rapidity = 0.;
+ double pairE = 0.;
+ double pairmomx=0.,pairmomy=0.,pairmomz=0.;
+ int iFbadevent=0;
+ starlightConstants::particleTypeEnum ipid = starlightConstants::UNKNOWN;
+
+ double px2=0.,px1=0.,py2=0.,py1=0.,pz2=0.,pz1=0.;
+//this function decays particles and writes events to a file
+ //zero out the event structure
+ leptonpair._numberOfTracks=0;
+ for(int i=0;i<4;i++)
+ {
+ leptonpair.px[i]=0.;
+ leptonpair.py[i]=0.;
+ leptonpair.pz[i]=0.;
+ leptonpair._fsParticle[i]=starlightConstants::UNKNOWN;
+ leptonpair._charge[i]=0;
+ }
+
+ pickw(comenergy);
+
+ picky(rapidity);
+
+ pairMomentum(comenergy,rapidity,pairE,pairmomx,pairmomy,pairmomz);
+ twoBodyDecay(ipid,pairE,comenergy,pairmomx,pairmomy,pairmomz,px1,py1,pz1,px2,py2,pz2,iFbadevent);
+ if (iFbadevent==0){
+ int q1=0,q2=0;
+
+ double xtest = _randy.Rndom();//random()/(RAND_MAX+1.0);
+ if (xtest<0.5)
+ {
+ q1=1;
+ q2=-1;
+ }
+ else{
+ q1=-1;
+ q2=1;
+ }
+ leptonpair._numberOfTracks=2;//leptonpairs are two tracks...
+ leptonpair.px[0]=px1;
+ leptonpair.py[0]=py1;
+ leptonpair.pz[0]=pz1;
+ leptonpair._fsParticle[0]=ipid;
+ leptonpair._charge[0]=q1;
+
+ leptonpair.px[1]=px2;
+ leptonpair.py[1]=py2;
+ leptonpair.pz[1]=pz2;
+ leptonpair._fsParticle[1]=ipid;
+ leptonpair._charge[1]=q2;
+
+ ievent=ievent+1;
+ }
+
+ return leptonpair;
+}
+
+
+//______________________________________________________________________________
+upcEvent Gammagammaleptonpair::produceEvent()
+{
+//returns the vector with the decay particles inside.
+
+ upcEvent event;
+
+ double comenergy = 0.;
+ double rapidity = 0.;
+ double pairE = 0.;
+ double pairmomx=0.,pairmomy=0.,pairmomz=0.;
+ int iFbadevent=0;
+ starlightConstants::particleTypeEnum ipid = starlightConstants::UNKNOWN;
+
+ double px2=0.,px1=0.,py2=0.,py1=0.,pz2=0.,pz1=0.,E2=0.,E1=0.;
+ bool accepted = false;
+ do{
+ //this function decays particles and writes events to a file
+ //zero out the event structure
+ pickw(comenergy);
+
+ picky(rapidity);
+
+ pairMomentum(comenergy,rapidity,pairE,pairmomx,pairmomy,pairmomz);
+
+
+ _nmbAttempts++;
+ twoBodyDecay(ipid,pairE,comenergy,pairmomx,pairmomy,pairmomz,px1,py1,pz1,px2,py2,pz2,iFbadevent);
+ double pt1chk = sqrt(px1*px1+py1*py1);
+ double pt2chk = sqrt(px2*px2+py2*py2);
+
+ double eta1 = pseudoRapidity(px1, py1, pz1);
+ double eta2 = pseudoRapidity(px2, py2, pz2);
+
+ if(_ptCutEnabled && !_etaCutEnabled){
+ if(pt1chk > _ptCutMin && pt1chk < _ptCutMax && pt2chk > _ptCutMin && pt2chk < _ptCutMax){
+ accepted = true;
+ _nmbAccepted++;
+ }
+ }
+ else if(!_ptCutEnabled && _etaCutEnabled){
+ if(eta1 > _etaCutMin && eta1 < _etaCutMax && eta2 > _etaCutMin && eta2 < _etaCutMax){
+ accepted = true;
+ _nmbAccepted++;
+ }
+ }
+ else if(_ptCutEnabled && _etaCutEnabled){
+ if(pt1chk > _ptCutMin && pt1chk < _ptCutMax && pt2chk > _ptCutMin && pt2chk < _ptCutMax){
+ if(eta1 > _etaCutMin && eta1 < _etaCutMax && eta2 > _etaCutMin && eta2 < _etaCutMax){
+ accepted = true;
+ _nmbAccepted++;
+ }
+ }
+ }
+
+ }while((_ptCutEnabled || _etaCutEnabled) && !accepted);
+ //twoBodyDecay(ipid,pairE,comenergy,pairmomx,pairmomy,pairmomz,px1,py1,pz1,px2,py2,pz2,iFbadevent);
+
+ if (iFbadevent==0){
+ int q1=0,q2=0;
+
+ double xtest = _randy.Rndom();//random()/(RAND_MAX+1.0);
+ if (xtest<0.5)
+ {
+ q1=1;
+ q2=-1;
+ }
+ else{
+ q1=-1;
+ q2=1;
+ }
+
+ // The new stuff
+ double mlepton = getMass();
+ E1 = sqrt( mlepton*mlepton + px1*px1 + py1*py1 + pz1*pz1 );
+ E2 = sqrt( mlepton*mlepton + px2*px2 + py2*py2 + pz2*pz2 );
+
+ starlightParticle particle1(px1, py1, pz1, E1, starlightConstants::UNKNOWN, -q1*ipid, q1);
+ event.addParticle(particle1);
+
+ starlightParticle particle2(px2, py2, pz2, E2, starlightConstants::UNKNOWN, -q2*ipid, q2);
+ event.addParticle(particle2);
+
+ }
+ return event;
+}
+
+
+//______________________________________________________________________________
+void Gammagammaleptonpair::calculateTable()
+{
+ // this subroutine calculates the tables that are used
+ // elsewhere in the montecarlo
+ // the tauon decay is taken from V-A theory, 1 - 1/3 cos(theta)
+ // the energy of each of the two leptons in tau decay
+ // is calculated using formula 10.35 given
+ // in introduction to elementary particles by D. griffiths
+ // which assmes that the mass of the electron is 0.
+ // the highest energy attainable by the electron in such a system is
+ // .5 * mass of the tau
+
+ // subroutine calculateTable
+
+
+ double E,theta;
+
+ _tautolangle[0] = 0.;
+ _dgammade[0] = 0.;
+
+
+ for(int i =1;i<=100;i++)
+ {
+ // calculate energy of tau decay
+ E = double(i)/100. * .5 * starlightConstants::tauMass;
+ _dgammade[i] = _dgammade[i-1] + E*E * (1. - 4.*E/(3.*starlightConstants::tauMass));
+
+ // calculate angles for tau
+ theta = starlightConstants::pi * double(i) / 100.;
+ _tautolangle[i] = _tautolangle[i-1] + (1 + 0.3333333 * cos(theta));
+ }
+
+
+}
+
+
+//______________________________________________________________________________
+void Gammagammaleptonpair::tauDecay(double &px1,double &py1,double &pz1,double &E1,double &px2,double &py2,double &pz2,double &E2)
+{
+ // this routine assumes that the tauons decay to electrons and
+ // calculates the directons of the decays
+
+ double Ee1,Ee2,theta1,theta2,phi1,phi2, ran1, ran2 ;
+ double pmag1,pex1,pey1,pez1,pex2,pey2,pez2,pmag2;
+ double betax,betay,betaz,dir;
+
+ int Tmp_Par=0; // temp variable for the transform function .. kind of starnge - being called with 7 parameter instead of 8
+
+ // the highest energy attainable by the electron in this system is
+ // .5 * mass of the tau
+
+ // get two random numbers to compare with
+
+
+ ran1 = _randy.Rndom()*_dgammade[100];//(random()/(RAND_MAX+1.0)) * _dgammade[100];
+ ran2 = _randy.Rndom()*_dgammade[100];//(random()/(RAND_MAX+1.0)) * _dgammade[100];
+
+ // compute the energies that correspond to those numbers
+ Ee1 = 0.;
+ Ee2 = 0.;
+
+ for( int i =1;i<=100;i++)
+ {
+ if (ran1 > _dgammade[i])
+ Ee1 = double(i) /100. * .5 * getMass();
+ if (ran2 > _dgammade[i])
+ Ee2 = double(i) /100. * .5 * getMass();
+ }
+
+ // to find the direction of emmission, first
+ // we determine if the tauons have spin of +1 or -1 along the
+ // direction of the beam line
+ dir = 1.;
+ if ( _randy.Rndom() < 0.5 )//(random()/(RAND_MAX+1.0)) < 0.5)
+ dir = -1.;
+
+ // get two random numbers to compare with
+ ran1 = _randy.Rndom()*_tautolangle[99];//(random()/(RAND_MAX+1.0)) * _tautolangle[100];
+ ran2 = _randy.Rndom()*_tautolangle[99];//(random()/(RAND_MAX+1.0)) * _tautolangle[100];
+
+ // find the angles corrsponding to those numbers
+ theta1 = 0.;
+ theta2 = 0.;
+ for( int i =1;i<=100;i++)
+ {
+ if (ran1 > _tautolangle[i]) theta1 = starlightConstants::pi * double(i) /100.;
+ if (ran2 > _tautolangle[i]) theta2 = starlightConstants::pi * double(i) /100.;
+ }
+
+ // grab another two random numbers to determine phi's
+ phi1 = _randy.Rndom()*2.*starlightConstants::pi;// (random()/(RAND_MAX+1.0))* 2. * starlightConstants::pi;
+ phi2 = _randy.Rndom()*2.*starlightConstants::pi;// (random()/(RAND_MAX+1.0))* 2. * starlightConstants::pi;
+ // figure out the momenta of the electron in the frames of the
+ // tauons from which they decayed, that is electron1 is in the
+ // rest frame of tauon1 and e2 is in the rest fram of tau2
+ // again the electrons are assumed to be massless
+ pmag1 = Ee1;
+ pex1 = cos(phi1)*sin(theta1)*pmag1;
+ pey1 = sin(phi1)*sin(theta1)*pmag1;
+ pez1 = cos(theta1)*pmag1*dir;
+ pmag2 = Ee2;
+ pex2 = cos(phi2)*sin(theta2)*pmag2;
+ pey2 = sin(phi2)*sin(theta2)*pmag2;
+ pez2 = cos(theta2)*pmag2*(-1.*dir);
+ // now Lorentz transform into the frame of each of the particles
+ // do particle one first
+ betax = -(px1/E1);
+ betay = -(py1/E1);
+ betaz = -(pz1/E1);
+//cout<<"2decay betax,pex1= "<<betax<<" "<<pex1<<endl;
+ transform (betax,betay,betaz,Ee1,pex1,pey1,pez1,Tmp_Par);
+ // then do particle two
+ betax = -(px1/E2);
+ betay = -(py1/E2);
+ betaz = -(pz1/E2);
+
+ transform (betax,betay,betaz,Ee2,pex2,pey2,pez2, Tmp_Par);
+ // finally dump the electron values into the approriate
+ // variables
+ E1 = Ee1;
+ E2 = Ee2;
+ px1 = pex1;
+ px2 = pex2;
+ py1 = pey1;
+ py2 = pey2;
+ pz1 = pez1;
+ pz2 = pez2;
+}
+
+
+//______________________________________________________________________________
+double Gammagammaleptonpair::getMass()
+{
+ double leptonmass=0.;
+ switch(_GGlepInputpidtest){
+ case starlightConstants::ELECTRON:
+ leptonmass=starlightConstants::mel;
+ break;
+ case starlightConstants::MUON:
+ leptonmass=starlightConstants::muonMass;
+ break;
+ case starlightConstants::TAUON:
+ leptonmass=starlightConstants::tauMass;
+ break;
+ default:
+ cout<<"Not a recognized lepton, Gammagammaleptonpair::getmass(), mass = 0."<<endl;
+ }
+
+ return leptonmass;
+}
+
+
+//______________________________________________________________________________
+double Gammagammaleptonpair::getWidth()
+{
+ double leptonwidth=0.;
+ return leptonwidth;
+
+}
+
+
+//______________________________________________________________________________
+double Gammagammaleptonpair::getSpin()
+{
+ double leptonspin=0.5;
+ return leptonspin;
+}
Property changes on: branches/starlight_1.1/src/gammagammaleptonpair.cpp
___________________________________________________________________
Added: svn:keywords
## -0,0 +1 ##
+Rev Date Author
\ No newline at end of property
Index: branches/starlight_1.1/src/inputParameters.cpp
===================================================================
--- branches/starlight_1.1/src/inputParameters.cpp (revision 0)
+++ branches/starlight_1.1/src/inputParameters.cpp (revision 145)
@@ -0,0 +1,537 @@
+///////////////////////////////////////////////////////////////////////////
+//
+// Copyright 2010
+//
+// This file is part of starlight.
+//
+// starlight is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
+//
+// starlight is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with starlight. If not, see <http://www.gnu.org/licenses/>.
+//
+///////////////////////////////////////////////////////////////////////////
+//
+// File and Version Information:
+// $Rev:: $: revision of last commit
+// $Author:: $: author of last commit
+// $Date:: $: date of last commit
+//
+// Description:
+//
+//
+//
+///////////////////////////////////////////////////////////////////////////
+
+
+#include <iostream>
+#include <fstream>
+
+#include "reportingUtils.h"
+#include "starlightconstants.h"
+#include "inputParameters.h"
+#include "inputParser.h"
+#include "starlightconfig.h"
+#include <cmath>
+
+using namespace std;
+using namespace starlightConstants;
+
+
+//______________________________________________________________________________
+inputParameters::inputParameters()
+ : _configFileName ("slight.in"),
+ _beam1Z (0),
+ _beam1A (0),
+ _beam2Z (0),
+ _beam2A (0),
+ _beam1LorentzGamma (0),
+ _beam2LorentzGamma (0),
+ _maxW (0),
+ _minW (0),
+ _nmbWBins (0),
+ _maxRapidity (0),
+ _nmbRapidityBins (0),
+ _ptCutEnabled (false),
+ _ptCutMin (0),
+ _ptCutMax (0),
+ _etaCutEnabled (false),
+ _etaCutMin (0),
+ _etaCutMax (0),
+ _productionMode (0),
+ _nmbEventsTot (0),
+ _prodParticleId (0),
+ _randomSeed (0),
+ _outputFormat (0),
+ _beamBreakupMode (0),
+ _interferenceEnabled (false),
+ _interferenceStrength (0),
+ _coherentProduction (false),
+ _incoherentFactor (0),
+ _deuteronSlopePar (0),
+ _maxPtInterference (0),
+ _nmbPtBinsInterference (0),
+ _ptBinWidthInterference(0),
+ _protonEnergy (0),
+ _minGammaEnergy (0),
+ _maxGammaEnergy (0),
+ _pythiaParams (),
+ _pythiaFullEventRecord (false),
+ _xsecCalcMethod (0),
+ _nThreads (1)
+
+{ }
+
+
+//______________________________________________________________________________
+inputParameters::~inputParameters()
+{ }
+
+
+//______________________________________________________________________________
+bool
+inputParameters::init(const string& configFileName)
+{
+ // open config file
+ _configFileName = configFileName;
+
+ double minWConfigFile = 0;
+ double maxWConfigFile = 0;
+
+ inputParser ip;
+ ip.addUintParameter(string("BEAM_1_Z"), &_beam1Z);
+ ip.addUintParameter(string("BEAM_2_Z"), &_beam2Z);
+ ip.addUintParameter(string("BEAM_1_A"), &_beam1A);
+ ip.addUintParameter(string("BEAM_2_A"), &_beam2A);
+
+ ip.addDoubleParameter(string("BEAM_1_GAMMA"), &_beam1LorentzGamma);
+ ip.addDoubleParameter(string("BEAM_2_GAMMA"), &_beam2LorentzGamma);
+
+ ip.addDoubleParameter(string("W_MAX"), &maxWConfigFile);
+ ip.addDoubleParameter(string("W_MIN"), &minWConfigFile);
+ ip.addUintParameter(string("W_N_BINS"), &_nmbWBins);;
+
+ ip.addDoubleParameter(string("RAP_MAX"), &_maxRapidity);
+ ip.addUintParameter(string("RAP_N_BINS"), &_nmbRapidityBins);
+
+ ip.addBoolParameter(string("CUT_PT"), &_ptCutEnabled);
+ ip.addDoubleParameter(string("PT_MIN"), &_ptCutMin);
+ ip.addDoubleParameter(string("PT_MAX"), &_ptCutMax);
+
+ ip.addBoolParameter(string("CUT_ETA"), &_etaCutEnabled);
+ ip.addDoubleParameter(string("ETA_MIN"), &_etaCutMin);
+ ip.addDoubleParameter(string("ETA_MAX"), &_etaCutMax);
+
+ ip.addIntParameter(string("PROD_MODE"), &_productionMode);
+
+ ip.addUintParameter(string("N_EVENTS"), &_nmbEventsTot);
+
+ ip.addIntParameter(string("PROD_PID"), &_prodParticleId);
+
+ ip.addIntParameter(string("RND_SEED"), &_randomSeed);
+
+ ip.addIntParameter(string("OUTPUT_FORMAT"), &_outputFormat);
+
+ ip.addIntParameter(string("BREAKUP_MODE"), &_beamBreakupMode);
+
+ ip.addBoolParameter(string("INTERFERENCE"), &_interferenceEnabled);
+ ip.addDoubleParameter(string("IF_STRENGTH"), &_interferenceStrength);
+
+ ip.addBoolParameter(string("COHERENT"), &_coherentProduction);
+ ip.addDoubleParameter(string("INCO_FACTOR"), &_incoherentFactor);
+
+ ip.addDoubleParameter(string("BFORD"), &_deuteronSlopePar);
+
+ ip.addDoubleParameter(string("INT_PT_MAX"), &_maxPtInterference);
+ ip.addIntParameter(string("INT_PT_N_BINS"), &_nmbPtBinsInterference);
+
+ ip.addDoubleParameter(string("MIN_GAMMA_ENERGY"), &_minGammaEnergy, false);
+ ip.addDoubleParameter(string("MAX_GAMMA_ENERGY"), &_maxGammaEnergy, false);
+
+ ip.addStringParameter(string("PYTHIA_PARAMS"), &_pythiaParams, false);
+ ip.addBoolParameter(string("PYTHIA_FULL_EVENTRECORD"), &_pythiaFullEventRecord, false);
+
+ ip.addIntParameter(string("XSEC_METHOD"), &_xsecCalcMethod, false);
+ ip.addIntParameter(string("N_THREADS"), &_nThreads, false);
+
+ int nParameters = ip.parseFile(_configFileName);
+ if(nParameters == -1)
+ {
+ printWarn << "could not open file '" << _configFileName << "'" << endl;
+ return false;
+ }
+
+ //ip.printParameterInfo(cout);
+
+ if(ip.validateParameters(cerr))
+ printInfo << "successfully read input parameters from '" << _configFileName << "'" << endl;
+ else {
+ printWarn << "problems reading input parameters from '" << _configFileName << "'" << endl
+ << *this;
+ return false;
+ }
+
+ // Calculate beam gamma in CMS frame
+ double rap1 = acosh(_beam1LorentzGamma);
+ double rap2 = -acosh(_beam2LorentzGamma);
+ _beamLorentzGamma = cosh((rap1-rap2)/2);
+
+ std::cout << "Rapidity beam 1: " << rap1 << ", rapidity beam 2: " << rap2 << ", rapidity CMS system: " << (rap1+rap2)/2 << ", beam gamma in CMS: " << _beamLorentzGamma<< std::endl;
+ _ptBinWidthInterference = _maxPtInterference / _nmbPtBinsInterference;
+ _protonEnergy = _beamLorentzGamma * protonMass;
+
+ // define interaction type
+ switch (_productionMode) {
+ case 1:
+ _interactionType = PHOTONPHOTON;
+ break;
+ case 2:
+ _interactionType = PHOTONPOMERONNARROW;
+ break;
+ case 3:
+ _interactionType = PHOTONPOMERONWIDE;
+ break;
+ case 4:
+ _interactionType = PHOTONPOMERONINCOHERENT;
+ break;
+ case 5:
+ _interactionType = PHOTONUCLEARSINGLE;
+ break;
+ case 6:
+ _interactionType = PHOTONUCLEARDOUBLE;
+ break;
+ case 7:
+ _interactionType = PHOTONUCLEARSINGLEPA;
+ break;
+ case 8:
+ _interactionType = PHOTONUCLEARSINGLEPAPY;
+ break;
+ default:
+ printWarn << "unknown production mode '" << _productionMode << "'" << endl;
+ return false;
+ }
+
+ //Trying to define the proper Wmins and Wmaxs. a TEMPORARY fix....Better solution=??
+ double mass = 0;
+ double width = 0;
+ double defaultMinW = 0; // default for _minW, unless it is defined later [GeV/c^2]
+ switch (_prodParticleId) {
+ case 11: // e+e- pair
+ _particleType = ELECTRON;
+ _decayType = LEPTONPAIR;
+ defaultMinW = 0.01; // default is 0.01; up to 0.15 is safe for Summer 2000 triggering for e+e- pairs
+ _maxW = maxWConfigFile;
+ break;
+ case 13: // mu+mu- pair
+ _particleType = MUON;
+ _decayType = LEPTONPAIR;
+ defaultMinW = 2 * muonMass;
+ _maxW = maxWConfigFile;
+ break;
+ case 15: // tau+tau- pair
+ _particleType = TAUON;
+ _decayType = LEPTONPAIR;
+ defaultMinW = 2 * tauMass;
+ _maxW = maxWConfigFile;
+ break;
+ case 115: // a_2(1320)
+ _particleType = A2;
+ _decayType = SINGLEMESON;
+ _maxW = maxWConfigFile;
+ break;
+ case 221: // eta
+ _particleType = ETA;
+ _decayType = SINGLEMESON;
+ _maxW = maxWConfigFile;
+ break;
+ case 225: // f_2(1270)
+ _particleType = F2;
+ defaultMinW = 2*pionChargedMass;
+ _decayType = SINGLEMESON;
+ _maxW = maxWConfigFile;
+ break;
+ case 331: // eta'(958)
+ _particleType = ETAPRIME;
+ _decayType = SINGLEMESON;
+ _maxW = maxWConfigFile;
+ break;
+ case 335: // f_2'(1525)
+ _particleType = F2PRIME;
+ _decayType = SINGLEMESON;
+ _maxW = maxWConfigFile;
+ break;
+ case 441: // eta_c(1s)
+ _particleType = ETAC;
+ _decayType = SINGLEMESON;
+ _maxW = maxWConfigFile;
+ defaultMinW = etaCMass - 5 * 0.0267;
+ break;
+ case 9010221: // f_0(980), was orginally called 10221? updated to standard number
+ _particleType = F0;
+ _decayType = SINGLEMESON;
+ _maxW = maxWConfigFile;
+ defaultMinW = 2*pionNeutralMass;
+ break;
+ case 33: // Z"/Z03
+ _particleType = ZOVERZ03;
+ _decayType = SINGLEMESON;
+ _maxW = maxWConfigFile;
+ break;
+ case 113: // rho(770)
+ _particleType = RHO;
+ _decayType = WIDEVMDEFAULT;
+ mass = 0.7685;
+ width = 0.1507;
+ defaultMinW = 2 * pionChargedMass;
+ _maxW = mass + 5 * width;
+ break;
+ case 913: // rho(770) with direct pi+pi- decay, interference given by ZEUS data
+ _particleType = RHOZEUS;
+ _decayType = WIDEVMDEFAULT;
+ mass = 0.7685;
+ width = 0.1507;
+ defaultMinW = 2 * pionChargedMass;
+ _maxW = mass + 5 * width; // use the same 1.5GeV max mass as ZEUS
+ break;
+ case 999: // pi+pi-pi+pi- phase space decay
+ _particleType = FOURPRONG;
+ _decayType = WIDEVMDEFAULT;
+ mass = 1.350;
+ width = 0.360;
+ defaultMinW = 4 * pionChargedMass;
+ _maxW = 3;
+ break;
+ case 223: // omega(782)
+ _particleType = OMEGA;
+ _decayType = NARROWVMDEFAULT; // will probably be moved to 3-body decay
+ mass = 0.78194;
+ width = 0.00843;
+ defaultMinW = mass - 5 * width;
+ _maxW = mass + 5 * width;
+ break;
+ case 333: // phi(1020)
+ _particleType = PHI;
+ _decayType = NARROWVMDEFAULT;
+ mass = 1.019413;
+ width = 0.00443;
+ defaultMinW = 2 * kaonChargedMass;
+ _maxW = mass + 5 * width;
+ break;
+ case 443: // J/psi
+ _particleType = JPSI;
+ _decayType = NARROWVMDEFAULT;
+ mass = 3.09692; // JN 3.09688;
+ width = 0.000091; // JN 0.000087;
+ defaultMinW = mass - 5 * width;
+ _maxW = mass + 5 * width;
+ break;
+ case 443011: // J/psi
+ _particleType = JPSI_ee;
+ _decayType = NARROWVMDEFAULT;
+ mass = 3.09692; // JN 3.09688;
+ width = 0.000091; // JN 0.000087;
+ defaultMinW = mass - 5 * width;
+ _maxW = mass + 5 * width;
+ break;
+ case 443013: // J/psi
+ _particleType = JPSI_mumu;
+ _decayType = NARROWVMDEFAULT;
+ mass = 3.09692; // JN 3.09688;
+ width = 0.000091; // JN 0.000087;
+ defaultMinW = mass - 5 * width;
+ _maxW = mass + 5 * width;
+ break;
+ case 444: // J/psi
+ _particleType = JPSI2S;
+ _decayType = NARROWVMDEFAULT;
+ mass = 3.686093;
+ width = 0.000337;
+ defaultMinW = mass - 5 * width;
+ _maxW = mass + 5 * width;
+ break;
+ case 444011: // J/psi
+ _particleType = JPSI2S_ee;
+ _decayType = NARROWVMDEFAULT;
+ mass = 3.686093;
+ width = 0.000337;
+ defaultMinW = mass - 5 * width;
+ _maxW = mass + 5 * width;
+ break;
+ case 444013: // J/psi
+ _particleType = JPSI2S_mumu;
+ _decayType = NARROWVMDEFAULT;
+ mass = 3.686093;
+ width = 0.000337;
+ defaultMinW = mass - 5 * width;
+ _maxW = mass + 5 * width;
+ break;
+ case 553: // Upsilon
+ _particleType = UPSILON;
+ _decayType = NARROWVMDEFAULT;
+ mass = 9.46030;
+ width = 0.00005402;
+ defaultMinW = mass - 5 * width;
+ _maxW = mass + 5 * width;
+ break;
+ case 553011: // Upsilon
+ _particleType = UPSILON_ee;
+ _decayType = NARROWVMDEFAULT;
+ mass = 9.46030;
+ width = 0.00005402;
+ defaultMinW = mass - 5 * width;
+ _maxW = mass + 5 * width;
+ break;
+ case 553013: // Upsilon
+ _particleType = UPSILON_mumu;
+ _decayType = NARROWVMDEFAULT;
+ mass = 9.46030;
+ width = 0.00005402;
+ defaultMinW = mass - 5 * width;
+ _maxW = mass + 5 * width;
+ break;
+ case 554: // Upsilon(2S)
+ _particleType = UPSILON2S;
+ _decayType = NARROWVMDEFAULT;
+ mass = 10.02326;
+ width = 0.00003198;
+ defaultMinW = mass - 5 * width;
+ _maxW = mass + 5 * width;
+ break;
+ case 554011: // Upsilon(2S)
+ _particleType = UPSILON2S_ee;
+ _decayType = NARROWVMDEFAULT;
+ mass = 10.02326;
+ width = 0.00003198;
+ defaultMinW = mass - 5 * width;
+ _maxW = mass + 5 * width;
+ break;
+ case 554013: // Upsilon(2S)
+ _particleType = UPSILON2S_mumu;
+ _decayType = NARROWVMDEFAULT;
+ mass = 10.02326;
+ width = 0.00003198;
+ defaultMinW = mass - 5 * width;
+ _maxW = mass + 5 * width;
+ break;
+ case 555: // Upsilon(3S)
+ mass = 10.3552;
+ width = 0.00002032;
+ defaultMinW = mass - 5 * width;
+ _maxW = mass + 5 * width;
+ _particleType = UPSILON3S;
+ _decayType = NARROWVMDEFAULT;
+ break;
+ case 555011: // Upsilon(3S)
+ _particleType = UPSILON3S_ee;
+ _decayType = NARROWVMDEFAULT;
+ mass = 10.3552;
+ width = 0.00002032;
+ defaultMinW = mass - 5 * width;
+ _maxW = mass + 5 * width;
+ break;
+ case 555013: // Upsilon(3S)
+ _particleType = UPSILON3S_mumu;
+ _decayType = NARROWVMDEFAULT;
+ mass = 10.3552;
+ width = 0.00002032;
+ defaultMinW = mass - 5 * width;
+ _maxW = mass + 5 * width;
+ break;
+ default:
+ printWarn << "unknown particle ID " << _prodParticleId << endl;
+ return false;
+ } // _prodParticleId
+
+ if (minWConfigFile == -1)
+ _minW = defaultMinW;
+ else
+ _minW = minWConfigFile;
+
+ printInfo << "using the following " << *this;
+
+ return true;
+}
+
+
+//______________________________________________________________________________
+ostream&
+inputParameters::print(ostream& out) const
+{
+ out << "starlight parameters:" << endl
+ << " config file name ...................... '" << _configFileName << "'" << endl
+ << " beam 1 atomic number ................... " << _beam1Z << endl
+ << " beam 1 atomic mass number .............. " << _beam1A << endl
+ << " beam 2 atomic number ................... " << _beam2Z << endl
+ << " beam 2 atomic mass number .............. " << _beam2A << endl
+ << " Lorentz gamma of beams in CM frame ..... " << _beamLorentzGamma << endl
+ << " mass W of produced hadronic system ..... " << _minW << " < W < " << _maxW << " GeV/c^2" << endl
+ << " # of W bins ............................ " << _nmbWBins << endl
+ << " maximum absolute value for rapidity .... " << _maxRapidity << endl
+ << " # of rapidity bins ..................... " << _nmbRapidityBins << endl
+ << " cut in pT............................... " << yesNo(_ptCutEnabled) << endl
+ << " minumum pT.......................... " << _ptCutMin << " GeV/c" << endl
+ << " maximum pT.......................... " << _ptCutMax << " GeV/c" << endl
+ << " cut in eta.............................. " << yesNo(_etaCutEnabled) << endl
+ << " minumum eta......................... " << _etaCutMin << endl
+ << " maximum eta......................... " << _etaCutMax << endl
+ << " meson production mode .................. " << _productionMode << endl
+ << " number of events to generate ........... " << _nmbEventsTot << endl
+ << " PDG ID of produced particle ............ " << _prodParticleId << endl
+ << " seed for random generator .............. " << _randomSeed << endl
+ << " output format .......................... " << _outputFormat << endl
+ << " breakup mode for beam particles ........ " << _beamBreakupMode << endl
+ << " interference enabled ................... " << yesNo(_interferenceEnabled) << endl
+ << " interference strength .................. " << _interferenceStrength << endl
+ << " coherent scattering off nucleus ........ " << yesNo(_coherentProduction) << endl
+ << " scaling factor for incoh. VM prod. ..... " << _incoherentFactor << endl
+ << " deuteron slope parameter ............... " << _deuteronSlopePar << " (GeV/c)^{-2}" << endl
+ << " maximum p_T for interference calc. ..... " << _maxPtInterference << " GeV/c" << endl
+ << " # of p_T bins for interference calc. ... " << _nmbPtBinsInterference << endl;
+ return out;
+}
+
+
+//______________________________________________________________________________
+ostream&
+inputParameters::write(ostream& out) const
+{
+
+ out << "BEAM_1_Z" << beam1Z () <<endl
+ << "BEAM_2_Z" << beam1A () <<endl
+ << "BEAM_1_A" << beam2Z () <<endl
+ << "BEAM_2_A" << beam2A () <<endl
+ << "BEAM_GAMMA" << beamLorentzGamma () <<endl
+ << "W_MAX" << maxW () <<endl
+ << "W_MIN" << minW () <<endl
+ << "W_N_BINS" << nmbWBins () <<endl
+ << "RAP_MAX" << maxRapidity () <<endl
+ << "RAP_N_BINS" << nmbRapidityBins () <<endl
+ << "CUT_PT" << ptCutEnabled () <<endl
+ << "PT_MIN" << ptCutMin () <<endl
+ << "PT_MAX" << ptCutMax () <<endl
+ << "CUT_ETA" << etaCutEnabled () <<endl
+ << "ETA_MIN" << etaCutMin () <<endl
+ << "ETA_MAX" << etaCutMax () <<endl
+ << "PROD_MODE" << productionMode () <<endl
+ << "N_EVENTS" << nmbEvents () <<endl
+ << "PROD_PID" << prodParticleId () <<endl
+ << "RND_SEED" << randomSeed () <<endl
+ << "OUTPUT_FORMAT" << outputFormat () <<endl
+ << "BREAKUP_MODE" << beamBreakupMode () <<endl
+ << "INTERFERENCE" << interferenceEnabled () <<endl
+ << "IF_STRENGTH" << interferenceStrength () <<endl
+ << "COHERENT" << coherentProduction () <<endl
+ << "INCO_FACTOR" << incoherentFactor () <<endl
+ << "BFORD" << deuteronSlopePar () <<endl
+ << "INT_PT_MAX" << maxPtInterference () <<endl
+ << "INT_PT_N_BINS" << nmbPtBinsInterference() <<endl;
+
+ return out;
+}
Property changes on: branches/starlight_1.1/src/inputParameters.cpp
___________________________________________________________________
Added: svn:keywords
## -0,0 +1 ##
+Rev Date Author
\ No newline at end of property
Index: branches/starlight_1.1/src/main.cpp
===================================================================
--- branches/starlight_1.1/src/main.cpp (revision 0)
+++ branches/starlight_1.1/src/main.cpp (revision 145)
@@ -0,0 +1,58 @@
+///////////////////////////////////////////////////////////////////////////
+//
+// Copyright 2010
+//
+// This file is part of starlight.
+//
+// starlight is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
+//
+// starlight is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with starlight. If not, see <http://www.gnu.org/licenses/>.
+//
+///////////////////////////////////////////////////////////////////////////
+//
+// File and Version Information:
+// $Rev:: $: revision of last commit
+// $Author:: $: author of last commit
+// $Date:: $: date of last commit
+//
+// Description:
+// main executable
+//
+//
+///////////////////////////////////////////////////////////////////////////
+
+
+#include <iostream>
+#include <cstdlib>
+
+#include "reportingUtils.h"
+#include "starlight.h"
+#include "eventfilewriter.h"
+#include "starlightStandalone.h"
+
+
+int
+main(int,
+ const char**)
+{
+ printCompilerInfo();
+ printSvnVersion ();
+
+ // creating a starlight standalone object
+ starlightStandalone sl;
+ // initialising starlight
+ if (!sl.init())
+ exit(1);
+ // running starlight
+ if (!sl.run())
+ exit(1);
+}
Property changes on: branches/starlight_1.1/src/main.cpp
___________________________________________________________________
Added: svn:keywords
## -0,0 +1 ##
+Rev Date Author
\ No newline at end of property
Index: branches/starlight_1.1/src/wideResonanceCrossSection.cpp
===================================================================
--- branches/starlight_1.1/src/wideResonanceCrossSection.cpp (revision 0)
+++ branches/starlight_1.1/src/wideResonanceCrossSection.cpp (revision 145)
@@ -0,0 +1,172 @@
+///////////////////////////////////////////////////////////////////////////
+//
+// Copyright 2010
+//
+// This file is part of starlight.
+//
+// starlight is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
+//
+// starlight is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with starlight. If not, see <http://www.gnu.org/licenses/>.
+//
+///////////////////////////////////////////////////////////////////////////
+//
+// File and Version Information:
+// $Rev:: $: revision of last commit
+// $Author:: $: author of last commit
+// $Date:: $: date of last commit
+//
+// Description:
+//
+//
+//
+///////////////////////////////////////////////////////////////////////////
+
+
+#include <iostream>
+#include <fstream>
+#include <cmath>
+
+#include "starlightconstants.h"
+#include "wideResonanceCrossSection.h"
+
+
+using namespace std;
+using namespace starlightConstants;
+
+
+//______________________________________________________________________________
+wideResonanceCrossSection::wideResonanceCrossSection(const inputParameters& input,
+ const beamBeamSystem& bbsystem)
+ : photonNucleusCrossSection(input, bbsystem)//hrm
+{
+ _wideWmax = input.maxW();
+ _wideWmin = input.minW();
+ _wideYmax = input.maxRapidity();
+ _wideYmin = -1.0 * _wideYmax;
+ _Ep = input.getProtonEnergy();
+}
+
+
+//______________________________________________________________________________
+wideResonanceCrossSection::~wideResonanceCrossSection()
+{
+
+}
+
+
+//______________________________________________________________________________
+void
+wideResonanceCrossSection::crossSectionCalculation(const double bwnormsave)
+{
+ // This subroutine calculates the cross-section assuming a wide
+ // (Breit-Wigner) resonance.
+
+ // double Av,Wgp,cs,cvma;
+ double W,dW,dY;
+ double y1,y2,y12,ega1,ega2,ega12;
+ // double t,tmin,tmax;
+ double csgA1,csgA2,csgA12,int_r,dR,rate;
+ double dsigdW,dsigdWalt,dndW,tmp;
+ double dsigdW2;
+ // double ax,bx;
+ double Eth;
+ int I,J,NW,NY;
+ // int K,NGAUSS;
+
+ // ----------------- !!!!!!!!!!!!!!!!!!!! -----------------------------
+
+ double bwnorm =bwnormsave;//used to transfer the bwnorm from the luminosity tables
+
+ // --------------------------------------------------------------------
+ //gamma+nucleon threshold.
+
+ Eth=0.5*(((_wideWmin+protonMass)*(_wideWmin+protonMass)
+ -protonMass*protonMass)/(_Ep+sqrt(_Ep*_Ep-protonMass*protonMass)));
+
+ NW = 100;
+ dW = (_wideWmax-_wideWmin)/double(NW);
+
+ NY = 1200;
+ dY = (_wideYmax-_wideYmin)/double(NY);
+
+ if (getBNORM() == 0.){
+ cout<<" Using Breit-Wigner Resonance Profile."<<endl;
+ }
+ else{
+ cout<<" Using Breit-Wigner plus direct pi+pi- profile."<<endl;
+ }
+
+ cout<<" Integrating over W from "<<_wideWmin<<" to "<<_wideWmax<<endl;
+
+ int_r=0.;
+
+ for(I=0;I<=NW-1;I++){
+
+ W = _wideWmin + double(I)*dW + 0.5*dW;
+
+ tmp = 0.0;
+ dsigdW=0.0;
+ dsigdW2=0.0;
+ dsigdWalt=0.0;
+ dndW=0.0;
+
+ for(J=0;J<=NY-1;J++){
+
+ y1 = _wideYmin + double(J)*dY;
+ y2 = _wideYmin + double(J+1)*dY;
+ y12 = 0.5*(y1+y2);
+
+ ega1 = 0.5*W*exp(y1);
+ ega2 = 0.5*W*exp(y2);
+ ega12 = 0.5*W*exp(y12);
+
+ if(ega1 < Eth) continue;
+ if(ega2 > maxPhotonEnergy()) continue;
+ // check it !!
+
+ if(J == 0){
+ // >> 1st Point (Calculated only the first time) =====>>>
+ //ega1 used.
+ csgA1=getcsgA(ega1,W);
+ }
+ else{
+ csgA1 = csgA2;
+ }
+
+ // >> Middle Point =====>>>
+ csgA12=getcsgA(ega12,W);
+
+ // >> Second Point =====>>>
+ csgA2=getcsgA(ega2,W);
+
+ //>> Sum the contribution for this W,Y. The 2 accounts for the 2 beams
+ dR = ega1*photonFlux(ega1)*csgA1;
+ dR = dR + 4.*ega12*photonFlux(ega12)*csgA12;
+ dR = dR + ega2*photonFlux(ega2)*csgA2;
+ tmp = tmp+2.*dR*(dY/6.);
+ dR = dR*(dY/6.)*breitWigner(W,bwnorm)*dW;
+
+ //For identical beams, we double. Either may emit photon/scatter
+ //For large differences in Z, we approx, that only beam1 emits photon
+ //and beam2 scatters, eg d-Au where beam1=au and beam2=d
+ if(getbbs().beam1().A()==getbbs().beam2().A()){
+ dR = 2.*dR;
+ }
+ int_r = int_r+dR;
+ }
+ }
+
+ rate=luminosity()*int_r;
+
+ cout<<" Cross section (mb): "<<10.*int_r<<endl;
+ cout<<" Production rate : "<<rate<<" Hz"<<endl;
+}
Property changes on: branches/starlight_1.1/src/wideResonanceCrossSection.cpp
___________________________________________________________________
Added: svn:keywords
## -0,0 +1 ##
+Rev Date Author
\ No newline at end of property
Index: branches/starlight_1.1/src/gammaavm.cpp
===================================================================
--- branches/starlight_1.1/src/gammaavm.cpp (revision 0)
+++ branches/starlight_1.1/src/gammaavm.cpp (revision 145)
@@ -0,0 +1,958 @@
+///////////////////////////////////////////////////////////////////////////
+//
+// Copyright 2010
+//
+// This file is part of starlight.
+//
+// starlight is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
+//
+// starlight is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with starlight. If not, see <http://www.gnu.org/licenses/>.
+//
+///////////////////////////////////////////////////////////////////////////
+//
+// File and Version Information:
+// $Rev:: $: revision of last commit
+// $Author:: $: author of last commit
+// $Date:: $: date of last commit
+//
+// Description:
+// Added incoherent t2-> pt2 selection. Following pp selection scheme
+//
+//
+///////////////////////////////////////////////////////////////////////////
+
+
+#include <iostream>
+#include <fstream>
+#include <cassert>
+#include <cmath>
+
+#include "gammaavm.h"
+#include "photonNucleusCrossSection.h"
+#include "wideResonanceCrossSection.h"
+#include "narrowResonanceCrossSection.h"
+#include "incoherentVMCrossSection.h"
+
+using namespace std;
+
+
+//______________________________________________________________________________
+Gammaavectormeson::Gammaavectormeson(inputParameters& input,beamBeamSystem& bbsystem):eventChannel(input,bbsystem), _phaseSpaceGen(0) //:readLuminosity(input),_bbs(bbsystem)
+{
+ _VMNPT=input.nmbPtBinsInterference();
+ _VMWmax=input.maxW();
+ _VMWmin=input.minW();
+ _VMYmax=input.maxRapidity();
+ _VMYmin=-1.*_VMYmax;
+ _VMnumw=input.nmbWBins();
+ _VMnumy=input.nmbRapidityBins();
+ _VMgamma_em=input.beamLorentzGamma();
+ _VMinterferencemode=input.interferenceEnabled();
+ _VMbslope=0.;//Will define in wide/narrow constructor
+ _VMpidtest=input.prodParticleType();
+ _VMptmax=input.maxPtInterference();
+ _VMdpt=input.ptBinWidthInterference();
+ _randy.SetSeed(input.randomSeed());
+ _VMCoherence=input.coherentProduction();
+ _VMCoherenceFactor=input.coherentProduction();
+ _ProductionMode=input.productionMode();
+
+ switch(_VMpidtest){
+ case starlightConstants::RHO:
+ case starlightConstants::RHOZEUS:
+ _width=0.1507;
+ _mass=0.7685;
+ break;
+ case starlightConstants::FOURPRONG:
+ // create n-body phase-space generator instance
+ _phaseSpaceGen = new nBodyPhaseSpaceGen();
+ _phaseSpaceGen->setSeed(input.randomSeed());
+ _width = 0.360;
+ _mass = 1.350;
+ break;
+ case starlightConstants::OMEGA:
+ _width=0.00843;
+ _mass=0.78194;
+ break;
+ case starlightConstants::PHI:
+ _width=0.00443;
+ _mass=1.019413;
+ break;
+ case starlightConstants::JPSI:
+ case starlightConstants::JPSI_ee:
+ case starlightConstants::JPSI_mumu:
+ _width=0.000091;
+ _mass=3.09692;
+ break;
+ case starlightConstants::JPSI2S:
+ case starlightConstants::JPSI2S_ee:
+ case starlightConstants::JPSI2S_mumu:
+ _width=0.000337;
+ _mass=3.686093;
+ break;
+ case starlightConstants::UPSILON:
+ case starlightConstants::UPSILON_ee:
+ case starlightConstants::UPSILON_mumu:
+ _width=0.00005402;
+ _mass=9.46030;
+ break;
+ case starlightConstants::UPSILON2S:
+ case starlightConstants::UPSILON2S_ee:
+ case starlightConstants::UPSILON2S_mumu:
+ _width=0.00003198;
+ _mass=10.02326;
+ break;
+ case starlightConstants::UPSILON3S:
+ case starlightConstants::UPSILON3S_ee:
+ case starlightConstants::UPSILON3S_mumu:
+ _width=0.00002032;
+ _mass=10.3552;
+ break;
+ default: cout<<"No proper vector meson defined, gammaavectormeson::gammaavectormeson"<<endl;
+ }
+}
+
+
+//______________________________________________________________________________
+Gammaavectormeson::~Gammaavectormeson()
+{
+ if (_phaseSpaceGen)
+ delete _phaseSpaceGen;
+}
+
+
+//______________________________________________________________________________
+void Gammaavectormeson::pickwy(double &W, double &Y)
+{
+ double dW, dY, xw,xy,xtest;
+ int IW,IY;
+
+ dW = (_VMWmax-_VMWmin)/double(_VMnumw);
+ dY = (_VMYmax-_VMYmin)/double(_VMnumy);
+
+ L201pwy:
+
+ xw = _randy.Rndom();// random()/(RAND_MAX+1.0);
+ W = _VMWmin + xw*(_VMWmax-_VMWmin);
+
+ if (W < 2 * starlightConstants::pionChargedMass)
+ goto L201pwy;
+
+ IW = int((W-_VMWmin)/dW); //+ 1;
+ xy = _randy.Rndom();//random()/(RAND_MAX+1.0);
+ Y = _VMYmin + xy*(_VMYmax-_VMYmin);
+ IY = int((Y-_VMYmin)/dY); //+ 1;
+ xtest = _randy.Rndom();//random()/(RAND_MAX+1.0);
+
+ if( xtest > _Farray[IW][IY] )
+ goto L201pwy;
+
+}
+
+
+//______________________________________________________________________________
+void Gammaavectormeson::twoBodyDecay(starlightConstants::particleTypeEnum &ipid,
+ double, // E (unused)
+ double W,
+ double px0, double py0, double pz0,
+ double& px1, double& py1, double& pz1,
+ double& px2, double& py2, double& pz2,
+ int& iFbadevent)
+{
+ // This routine decays a particle into two particles of mass mdec,
+ // taking spin into account
+
+ double pmag;
+ // double anglelep[20001],xtest,ytest=0.,dndtheta;
+ double phi,theta,Ecm;
+ double betax,betay,betaz;
+ double mdec=0.0;
+ double E1=0.0,E2=0.0;
+
+ // set the mass of the daughter particles
+ mdec=getDaughterMass(ipid);
+
+ // calculate the magnitude of the momenta
+ if(W < 2*mdec){
+ cout<<" ERROR: W="<<W<<endl;
+ iFbadevent = 1;
+ return;
+ }
+ pmag = sqrt(W*W/4. - mdec*mdec);
+
+ // pick an orientation, based on the spin
+ // phi has a flat distribution in 2*pi
+ phi = _randy.Rndom()*2.*starlightConstants::pi;//(random()/(RAND_MAX+1.0))* 2.*pi;
+
+ // find theta, the angle between one of the outgoing particles and
+ // the beamline, in the frame of the two photons
+
+ theta=getTheta(ipid);
+
+ // compute unboosted momenta
+ px1 = sin(theta)*cos(phi)*pmag;
+ py1 = sin(theta)*sin(phi)*pmag;
+ pz1 = cos(theta)*pmag;
+ px2 = -px1;
+ py2 = -py1;
+ pz2 = -pz1;
+
+ Ecm = sqrt(W*W+px0*px0+py0*py0+pz0*pz0);
+ E1 = sqrt(mdec*mdec+px1*px1+py1*py1+pz1*pz1);
+ E2 = sqrt(mdec*mdec+px2*px2+py2*py2+pz2*pz2);
+
+ betax = -(px0/Ecm);
+ betay = -(py0/Ecm);
+ betaz = -(pz0/Ecm);
+
+ transform (betax,betay,betaz,E1,px1,py1,pz1,iFbadevent);
+ transform (betax,betay,betaz,E2,px2,py2,pz2,iFbadevent);
+
+ if(iFbadevent == 1)
+ return;
+
+}
+
+
+//______________________________________________________________________________
+// decays a particle into four particles with isotropic angular distribution
+bool Gammaavectormeson::fourBodyDecay
+(starlightConstants::particleTypeEnum& ipid,
+ const double , // E (unused)
+ const double W, // mass of produced particle
+ const double* p, // momentum of produced particle; expected to have size 3
+ lorentzVector* decayVecs, // array of Lorentz vectors of daughter particles; expected to have size 4
+ int& iFbadevent)
+{
+ const double parentMass = W;
+
+ // set the mass of the daughter particles
+ const double daughterMass = getDaughterMass(ipid);
+ if (parentMass < 4 * daughterMass){
+ cout << " ERROR: W=" << parentMass << " GeV too small" << endl;
+ iFbadevent = 1;
+ return false;
+ }
+
+ // construct parent four-vector
+ const double parentEnergy = sqrt(p[0] * p[0] + p[1] * p[1] + p[2] * p[2]
+ + parentMass * parentMass);
+ const lorentzVector parentVec(p[0], p[1], p[2], parentEnergy);
+
+ // setup n-body phase-space generator
+ assert(_phaseSpaceGen);
+ static bool firstCall = true;
+ if (firstCall) {
+ const double m[4] = {daughterMass, daughterMass, daughterMass, daughterMass};
+ _phaseSpaceGen->setDecay(4, m);
+ // estimate maximum phase-space weight
+ _phaseSpaceGen->setMaxWeight(1.01 * _phaseSpaceGen->estimateMaxWeight(_VMWmax));
+ firstCall = false;
+ }
+
+ // generate phase-space event
+ if (!_phaseSpaceGen->generateDecayAccepted(parentVec))
+ return false;
+
+ // set Lorentzvectors of decay daughters
+ for (unsigned int i = 0; i < 4; ++i)
+ decayVecs[i] = _phaseSpaceGen->daughter(i);
+ return true;
+}
+
+
+//______________________________________________________________________________
+double Gammaavectormeson::getDaughterMass(starlightConstants::particleTypeEnum &ipid)
+{
+ //This will return the daughter particles mass, and the final particles outputed id...
+ double ytest=0.,mdec=0.;
+
+ switch(_VMpidtest){
+ case starlightConstants::RHO:
+ case starlightConstants::RHOZEUS:
+ case starlightConstants::FOURPRONG:
+ case starlightConstants::OMEGA:
+ mdec = starlightConstants::pionChargedMass;
+ ipid = starlightConstants::PION;
+ break;
+ case starlightConstants::PHI:
+ mdec = starlightConstants::kaonChargedMass;
+ ipid = starlightConstants::KAONCHARGE;
+ break;
+ case starlightConstants::JPSI:
+ mdec = starlightConstants::mel;
+ ipid = starlightConstants::ELECTRON;
+ break;
+ case starlightConstants::JPSI_ee:
+ mdec = starlightConstants::mel;
+ ipid = starlightConstants::ELECTRON;
+ break;
+ case starlightConstants::JPSI_mumu:
+ mdec = starlightConstants::muonMass;
+ ipid = starlightConstants::MUON;
+ break;
+ case starlightConstants::JPSI2S_ee:
+ mdec = starlightConstants::mel;
+ ipid = starlightConstants::ELECTRON;
+ break;
+ case starlightConstants::JPSI2S_mumu:
+ mdec = starlightConstants::muonMass;
+ ipid = starlightConstants::MUON;
+ break;
+
+ case starlightConstants::JPSI2S:
+ case starlightConstants::UPSILON:
+ case starlightConstants::UPSILON2S:
+ case starlightConstants::UPSILON3S:
+ // decays 50% to e+/e-, 50% to mu+/mu-
+ ytest = _randy.Rndom();//random()/(RAND_MAX+1.0);
+
+ mdec = starlightConstants::muonMass;
+ ipid = starlightConstants::MUON;
+ break;
+ case starlightConstants::UPSILON_ee:
+ case starlightConstants::UPSILON2S_ee:
+ case starlightConstants::UPSILON3S_ee:
+ mdec = starlightConstants::mel;
+ ipid = starlightConstants::ELECTRON;
+ break;
+ case starlightConstants::UPSILON_mumu:
+ case starlightConstants::UPSILON2S_mumu:
+ case starlightConstants::UPSILON3S_mumu:
+ mdec = starlightConstants::muonMass;
+ ipid = starlightConstants::MUON;
+ break;
+ default: cout<<"No daughtermass defined, gammaavectormeson::getdaughtermass"<<endl;
+ }
+
+ return mdec;
+}
+
+
+//______________________________________________________________________________
+double Gammaavectormeson::getTheta(starlightConstants::particleTypeEnum ipid)
+{
+ //This depends on the decay angular distribution
+ //Valid for rho, phi, omega.
+ double theta=0.;
+ double xtest=0.;
+ double dndtheta=0.;
+ L200td:
+
+ theta = starlightConstants::pi*_randy.Rndom();//random()/(RAND_MAX+1.0);
+ xtest = _randy.Rndom();//random()/(RAND_MAX+1.0);
+ // Follow distribution for helicity +/-1
+ // Eq. 19 of J. Breitweg et al., Eur. Phys. J. C2, 247 (1998)
+ // SRK 11/14/2000
+
+ switch(ipid){
+
+ case starlightConstants::MUON:
+ case starlightConstants::ELECTRON:
+ //primarily for upsilon/j/psi. VM->ee/mumu
+ dndtheta = sin(theta)*(1.+((cos(theta))*(cos(theta))));
+ break;
+
+ case starlightConstants::PION:
+ case starlightConstants::KAONCHARGE:
+ //rhos etc
+ dndtheta= sin(theta)*(1.-((cos(theta))*(cos(theta))));
+ break;
+
+ default: cout<<"No proper theta dependence defined, check gammaavectormeson::gettheta"<<endl;
+ }//end of switch
+
+ if(xtest > dndtheta)
+ goto L200td;
+
+ return theta;
+
+}
+
+
+//______________________________________________________________________________
+double Gammaavectormeson::getWidth()
+{
+ return _width;
+}
+
+
+//______________________________________________________________________________
+double Gammaavectormeson::getMass()
+{
+ return _mass;
+}
+
+
+//______________________________________________________________________________
+double Gammaavectormeson::getSpin()
+{
+ return 1.0; //VM spins are the same
+}
+
+
+//______________________________________________________________________________
+void Gammaavectormeson::momenta(double W,double Y,double &E,double &px,double &py,double &pz,int &tcheck)
+{
+ // This subroutine calculates momentum and energy of vector meson
+ // given W and Y, without interference. Subroutine vmpt.f handles
+ // production with interference
+
+ double dW,dY;
+ double Egam,Epom,tmin,pt1,pt2,phi1,phi2;
+ double px1,py1,px2,py2;
+ double pt,xt,xtest,ytest;
+ // double photon_spectrum;
+ double t2;
+
+ dW = (_VMWmax-_VMWmin)/double(_VMnumw);
+ dY = (_VMYmax-_VMYmin)/double(_VMnumy);
+
+ //Find Egam,Epom in CM frame
+ if( _bbs.beam1().A()==1 && _bbs.beam2().A() != 1){
+ if( _ProductionMode == 2 ){
+ Egam = 0.5*W*exp(Y);
+ Epom = 0.5*W*exp(-Y);
+ }else{
+ Egam = 0.5*W*exp(-Y);
+ Epom = 0.5*W*exp(Y);
+ }
+ } else if( _bbs.beam2().A()==1 && _bbs.beam1().A() != 1 ){
+ if( _ProductionMode == 2 ){
+ Egam = 0.5*W*exp(-Y);
+ Epom = 0.5*W*exp(Y);
+ }else{
+ Egam = 0.5*W*exp(Y);
+ Epom = 0.5*W*exp(-Y);
+ }
+ } else {
+ Egam = 0.5*W*exp(Y);
+ Epom = 0.5*W*exp(-Y);
+ }
+
+ // cout<<" Y: "<<Y<<" W: "<<W<<" Egam: "<<Egam<<" Epom: "<<Epom<<endl;
+ pt1 = pTgamma(Egam);
+ phi1 = 2.*starlightConstants::pi*_randy.Rndom();
+
+ // cout<<" pt1: "<<pt1<<endl;
+
+ if( (_bbs.beam1().A()==1 && _bbs.beam2().A()==1) ||
+ (_ProductionMode == 4) ) {
+ if( (_VMpidtest == starlightConstants::RHO) || (_VMpidtest == starlightConstants::RHOZEUS) || (_VMpidtest == starlightConstants::OMEGA)){
+ // Use dipole form factor for light VM
+ L555vm:
+ xtest = 2.0*_randy.Rndom();
+ double ttest = xtest*xtest;
+ ytest = _randy.Rndom();
+ double t0 = 1./2.23;
+ double yprob = xtest*_bbs.beam1().dipoleFormFactor(ttest,t0)*_bbs.beam1().dipoleFormFactor(ttest,t0);
+ if( ytest > yprob ) goto L555vm;
+ t2 = ttest;
+ pt2 = xtest;
+ }else{
+ //Use dsig/dt= exp(-_VMbslope*t) for heavy VM
+ xtest = _randy.Rndom();
+ t2 = (-1./_VMbslope)*log(xtest);
+ pt2 = sqrt(1.*t2);
+ }
+ } else {
+ // >> Check tmin
+ tmin = ((Epom/_VMgamma_em)*(Epom/_VMgamma_em));
+
+ if(tmin > 0.5){
+ cout<<" WARNING: tmin= "<<tmin<<endl;
+ cout<< " Y = "<<Y<<" W = "<<W<<" Epom = "<<Epom<<" gamma = "<<_VMgamma_em<<endl;
+ cout<<" Will pick a new W,Y "<<endl;
+ tcheck = 1;
+ return;
+ }
+ L203vm:
+ xt = _randy.Rndom();
+ if( _bbs.beam1().A()==1 && _bbs.beam2().A() != 1){
+ if( _ProductionMode == 2 ){
+ pt2 = 8.*xt*starlightConstants::hbarc/_bbs.beam2().nuclearRadius();
+ }else{
+ pt2 = 8.*xt*starlightConstants::hbarc/_bbs.beam1().nuclearRadius();
+ }
+ } else if( _bbs.beam2().A()==1 && _bbs.beam1().A() != 1 ){
+ if( _ProductionMode == 2 ){
+ pt2 = 8.*xt*starlightConstants::hbarc/_bbs.beam1().nuclearRadius();
+ }else{
+ pt2 = 8.*xt*starlightConstants::hbarc/_bbs.beam2().nuclearRadius();
+ }
+ } else {
+ pt2 = 8.*xt*starlightConstants::hbarc/_bbs.beam2().nuclearRadius();
+ }
+
+ xtest = _randy.Rndom();
+ t2 = tmin + pt2*pt2;
+
+ if(_bbs.beam2().Z()==1&&_bbs.beam2().A()==2){
+ if(1.0 < _bbs.beam2().formFactor(t2)*pt2) cout <<"POMERON"<<endl;
+ if( xtest > _bbs.beam2().formFactor(t2)*pt2) goto L203vm;
+ }
+ else{
+
+ double comp=0.0;
+ if( _bbs.beam1().A()==1 && _bbs.beam2().A() != 1){
+ if( _ProductionMode == 2 ){
+ comp = _bbs.beam2().formFactor(t2)*_bbs.beam2().formFactor(t2)*pt2;
+ }else{
+ comp = _bbs.beam1().formFactor(t2)*_bbs.beam1().formFactor(t2)*pt2;
+ }
+ } else if( _bbs.beam2().A()==1 && _bbs.beam1().A() != 1 ){
+ if( _ProductionMode == 2 ){
+ comp = _bbs.beam1().formFactor(t2)*_bbs.beam1().formFactor(t2)*pt2;
+ }else{
+ comp = _bbs.beam2().formFactor(t2)*_bbs.beam2().formFactor(t2)*pt2;
+ }
+ } else {
+ comp = _bbs.beam2().formFactor(t2)*_bbs.beam2().formFactor(t2)*pt2;
+ }
+
+ if( xtest > comp ) goto L203vm;
+ }
+
+ /*
+ if(_VMCoherence==0 && (!(_bbs.beam2().Z()==1&&_bbs.beam2().A()==2))){
+ //dsig/dt= exp(-_VMbslope*t)
+ xtest = _randy.Rndom();//random()/(RAND_MAX+1.0);
+ t2 = (-1./_VMbslope)*log(xtest);
+ pt2 = sqrt(1.*t2);
+ }
+ */
+
+ }//else end from pp
+ phi2 = 2.*starlightConstants::pi*_randy.Rndom();//random()/(RAND_MAX+1.0);
+
+ // cout<<" pt2: "<<pt2<<endl;
+
+ px1 = pt1*cos(phi1);
+ py1 = pt1*sin(phi1);
+ px2 = pt2*cos(phi2);
+ py2 = pt2*sin(phi2);
+
+ // Compute vector sum Pt = Pt1 + Pt2 to find pt for the vector meson
+ px = px1 + px2;
+ py = py1 + py2;
+ pt = sqrt( px*px + py*py );
+
+ E = sqrt(W*W+pt*pt)*cosh(Y);
+ pz = sqrt(W*W+pt*pt)*sinh(Y);
+
+ // cout<< " Y = "<<Y<<" W = "<<W<<" Egam = "<<Egam<<" gamma = "<<_VMgamma_em<<endl;
+
+ // Randomly choose to make pz negative 50% of the time
+ if(_bbs.beam2().Z()==1&&_bbs.beam2().A()==2){
+ pz = -pz;
+ }else if( (_bbs.beam1().A()==1 && _bbs.beam2().A() != 1) || (_bbs.beam2().A()==1 && _bbs.beam1().A() != 1) ){
+ // Don't switch
+ }
+ else{
+ if (_randy.Rndom() >= 0.5) pz = -pz;
+ }
+
+}
+
+//______________________________________________________________________________
+double Gammaavectormeson::pTgamma(double E)
+{
+ // returns on random draw from pp(E) distribution
+ double ereds =0.,Cm=0.,Coef=0.,x=0.,pp=0.,test=0.,u=0.;
+ double singleformfactorCm=0.,singleformfactorpp1=0.,singleformfactorpp2=0.;
+ int satisfy =0;
+
+ ereds = (E/_VMgamma_em)*(E/_VMgamma_em);
+ //sqrt(3)*E/gamma_em is p_t where the distribution is a maximum
+ Cm = sqrt(3.)*E/_VMgamma_em;
+
+ //the amplitude of the p_t spectrum at the maximum
+
+ if( _bbs.beam1().A()==1 && _bbs.beam2().A() != 1){
+ if( _ProductionMode == 2 ){
+ singleformfactorCm=_bbs.beam1().formFactor(Cm*Cm+ereds);
+ }else{
+ singleformfactorCm=_bbs.beam2().formFactor(Cm*Cm+ereds);
+ }
+ } else if( _bbs.beam2().A()==1 && _bbs.beam1().A() != 1 ){
+ if( _ProductionMode == 2 ){
+ singleformfactorCm=_bbs.beam2().formFactor(Cm*Cm+ereds);
+ }else{
+ singleformfactorCm=_bbs.beam1().formFactor(Cm*Cm+ereds);
+ }
+ } else {
+ singleformfactorCm=_bbs.beam1().formFactor(Cm*Cm+ereds);
+ }
+
+ Coef = 3.0*(singleformfactorCm*singleformfactorCm*Cm*Cm*Cm)/((2.*(starlightConstants::pi)*(ereds+Cm*Cm))*(2.*(starlightConstants::pi)*(ereds+Cm*Cm)));
+
+ //pick a test value pp, and find the amplitude there
+ x = _randy.Rndom();
+
+ if( _bbs.beam1().A()==1 && _bbs.beam2().A() != 1){
+ if( _ProductionMode == 2 ){
+ pp = x*5.*starlightConstants::hbarc/_bbs.beam1().nuclearRadius();
+ singleformfactorpp1=_bbs.beam1().formFactor(pp*pp+ereds);
+ }else{
+ pp = x*5.*starlightConstants::hbarc/_bbs.beam2().nuclearRadius();
+ singleformfactorpp1=_bbs.beam2().formFactor(pp*pp+ereds);
+ }
+ } else if( _bbs.beam2().A()==1 && _bbs.beam1().A() != 1 ){
+ if( _ProductionMode == 2 ){
+ pp = x*5.*starlightConstants::hbarc/_bbs.beam2().nuclearRadius();
+ singleformfactorpp1=_bbs.beam2().formFactor(pp*pp+ereds);
+ }else{
+ pp = x*5.*starlightConstants::hbarc/_bbs.beam1().nuclearRadius();
+ singleformfactorpp1=_bbs.beam1().formFactor(pp*pp+ereds);
+ }
+ } else {
+ pp = x*5.*starlightConstants::hbarc/_bbs.beam1().nuclearRadius();
+ singleformfactorpp1=_bbs.beam1().formFactor(pp*pp+ereds);
+ }
+
+ test = (singleformfactorpp1*singleformfactorpp1)*pp*pp*pp/((2.*starlightConstants::pi*(ereds+pp*pp))*(2.*starlightConstants::pi*(ereds+pp*pp)));
+
+ while(satisfy==0){
+ u = _randy.Rndom();
+ if(u*Coef <= test)
+ {
+ satisfy =1;
+ }
+ else{
+ x =_randy.Rndom();
+ if( _bbs.beam1().A()==1 && _bbs.beam2().A() != 1){
+ if( _ProductionMode == 2 ){
+ pp = x*5.*starlightConstants::hbarc/_bbs.beam1().nuclearRadius();
+ singleformfactorpp2=_bbs.beam1().formFactor(pp*pp+ereds);
+ }else{
+ pp = x*5.*starlightConstants::hbarc/_bbs.beam2().nuclearRadius();
+ singleformfactorpp2=_bbs.beam2().formFactor(pp*pp+ereds);
+ }
+ } else if( _bbs.beam2().A()==1 && _bbs.beam1().A() != 1 ){
+ if( _ProductionMode == 2 ){
+ pp = x*5.*starlightConstants::hbarc/_bbs.beam2().nuclearRadius();
+ singleformfactorpp2=_bbs.beam2().formFactor(pp*pp+ereds);
+ }else{
+ pp = x*5.*starlightConstants::hbarc/_bbs.beam1().nuclearRadius();
+ singleformfactorpp2=_bbs.beam1().formFactor(pp*pp+ereds);
+ }
+ } else {
+ pp = x*5.*starlightConstants::hbarc/_bbs.beam1().nuclearRadius();
+ singleformfactorpp2=_bbs.beam1().formFactor(pp*pp+ereds);
+ }
+ test = (singleformfactorpp2*singleformfactorpp2)*pp*pp*pp/(2.*starlightConstants::pi*(ereds+pp*pp)*2.*starlightConstants::pi*(ereds+pp*pp));
+ }
+ }
+
+ return pp;
+}
+
+
+//______________________________________________________________________________
+void Gammaavectormeson::vmpt(double W,double Y,double &E,double &px,double &py, double &pz,
+ int&) // tcheck (unused)
+{
+ // This function calculates momentum and energy of vector meson
+ // given W and Y, including interference.
+ // It gets the pt distribution from a lookup table.
+ double dW=0.,dY=0.,yleft=0.,yfract=0.,xpt=0.,pt1=0.,ptfract=0.,pt=0.,pt2=0.,theta=0.;
+ int IY=0,j=0;
+
+ dW = (_VMWmax-_VMWmin)/double(_VMnumw);
+ dY = (_VMYmax-_VMYmin)/double(_VMnumy);
+
+ // Y is already fixed; choose a pt
+ // Follow the approavh in pickwy.f
+ // in _fptarray(IY,pt) IY=1 corresponds to Y=0, IY=numy/2 corresponds to +y
+
+ IY=int(fabs(Y)/dY);//+1;
+ if (IY > (_VMnumy/2)-1){
+ IY=(_VMnumy/2)-1;
+ }
+
+ yleft=fabs(Y)-(IY)*dY;
+ yfract=yleft*dY;
+
+ xpt=_randy.Rndom(); //random()/(RAND_MAX+1.0);
+
+ for(j=0;j<_VMNPT+1;j++){
+ if (xpt < _fptarray[IY][j]) goto L60;
+ }
+ L60:
+
+ // now do linear interpolation - start with extremes
+
+ if (j == 0){
+ pt1=xpt/_fptarray[IY][j]*_VMdpt/2.;
+ goto L80;
+ }
+ if (j == _VMNPT){
+ pt1=(_VMptmax-_VMdpt/2.) + _VMdpt/2.*(xpt-_fptarray[IY][j])/(1.-_fptarray[IY][j]);
+ goto L80;
+ }
+
+ // we're in the middle
+
+ ptfract=(xpt-_fptarray[IY][j])/(_fptarray[IY][j+1]-_fptarray[IY][j]);
+ pt1=(j+1)*_VMdpt+ptfract*_VMdpt;
+
+ // at an extreme in y?
+ if (IY == (_VMnumy/2)-1){
+ pt=pt1;
+ goto L120;
+ }
+ L80:
+ // interpolate in y repeat for next fractional y bin
+
+ for(j=0;j<_VMNPT+1;j++){
+ if (xpt < _fptarray[IY+1][j]) goto L90;
+ }
+ L90:
+
+ // now do linear interpolation - start with extremes
+
+ if (j == 0){
+ pt2=xpt/_fptarray[IY+1][j]*_VMdpt/2.;
+ goto L100;
+ }
+ if (j == _VMNPT){
+ pt2=(_VMptmax-_VMdpt/2.) + _VMdpt/2.*(xpt-_fptarray[IY+1][j])/(1.-_fptarray[IY+1][j]);
+ goto L100;
+ }
+
+ // we're in the middle
+
+ ptfract=(xpt-_fptarray[IY+1][j])/(_fptarray[IY+1][j+1]-_fptarray[IY+1][j]);
+ pt2=(j+1)*_VMdpt+ptfract*_VMdpt;
+
+ L100:
+
+ // now interpolate in y
+
+ pt=yfract*pt2+(1-yfract)*pt1;
+
+ L120:
+
+ // we have a pt
+
+ theta=2.*starlightConstants::pi*_randy.Rndom();//(random()/(RAND_MAX+1.0))*2.*pi;
+ px=pt*cos(theta);
+ py=pt*sin(theta);
+
+ // I guess W is the mass of the vector meson (not necessarily
+ // on-mass-shell), and E is the energy
+
+ E = sqrt(W*W+pt*pt)*cosh(Y);
+ pz = sqrt(W*W+pt*pt)*sinh(Y);
+ // randomly choose to make pz negative 50% of the time
+ if(_randy.Rndom()>=0.5) pz = -pz;
+}
+
+
+//______________________________________________________________________________
+starlightConstants::event Gammaavectormeson::produceEvent(int&)
+{
+ // Not used; return default event
+ return starlightConstants::event();
+}
+
+
+//______________________________________________________________________________
+upcEvent Gammaavectormeson::produceEvent()
+{
+ // The new event type
+ upcEvent event;
+
+ int iFbadevent=0;
+ int tcheck=0;
+ starlightConstants::particleTypeEnum ipid = starlightConstants::UNKNOWN;
+ starlightConstants::particleTypeEnum vmpid = starlightConstants::UNKNOWN;
+
+ if (_VMpidtest == starlightConstants::FOURPRONG) {
+ double comenergy = 0;
+ double mom[3] = {0, 0, 0};
+ double E = 0;
+ lorentzVector decayVecs[4];
+ do {
+ double rapidity = 0;
+ pickwy(comenergy, rapidity);
+ if (_VMinterferencemode == 0)
+ momenta(comenergy, rapidity, E, mom[0], mom[1], mom[2], tcheck);
+ else if (_VMinterferencemode==1)
+ vmpt(comenergy, rapidity, E, mom[0], mom[1], mom[2], tcheck);
+ } while (!fourBodyDecay(ipid, E, comenergy, mom, decayVecs, iFbadevent));
+ if ((iFbadevent == 0) and (tcheck == 0))
+ for (unsigned int i = 0; i < 4; ++i) {
+ starlightParticle daughter(decayVecs[i].GetPx(),
+ decayVecs[i].GetPy(),
+ decayVecs[i].GetPz(),
+ starlightConstants::UNKNOWN, // energy
+ starlightConstants::UNKNOWN, // _mass
+ ipid,
+ (i < 2) ? -1 : +1);
+ event.addParticle(daughter);
+ }
+ } else {
+ double comenergy = 0.;
+ double rapidity = 0.;
+ double E = 0.;
+ double momx=0.,momy=0.,momz=0.;
+
+ double px2=0.,px1=0.,py2=0.,py1=0.,pz2=0.,pz1=0.;
+ bool accepted = false;
+ // if(_accCut){
+ do{
+ pickwy(comenergy,rapidity);
+
+ if (_VMinterferencemode==0){
+ momenta(comenergy,rapidity,E,momx,momy,momz,tcheck);
+ } else if (_VMinterferencemode==1){
+ vmpt(comenergy,rapidity,E,momx,momy,momz,tcheck);
+ }
+
+ // cout << "_ptCutMin: " << _ptCutMin << " _ptCutMax: " << _ptCutMax << " _etaCutMin: " << _etaCutMin << " _etaCutMax: " << _etaCutMax << endl;
+ _nmbAttempts++;
+ //cout << "n tries: " << _nmbAttempts<< endl;
+ vmpid = ipid;
+ twoBodyDecay(ipid,E,comenergy,momx,momy,momz,px1,py1,pz1,px2,py2,pz2,iFbadevent);
+ double pt1chk = sqrt(px1*px1+py1*py1);
+ double pt2chk = sqrt(px2*px2+py2*py2);
+
+ //cout << "pt1: " << pt1chk << " pt2: " << pt2chk << endl;
+ double eta1 = pseudoRapidity(px1, py1, pz1);
+ double eta2 = pseudoRapidity(px2, py2, pz2);
+ //cout << "eta1: " << eta1 << " eta2: " << eta2 << endl;
+ if(_ptCutEnabled && !_etaCutEnabled){
+ if(pt1chk > _ptCutMin && pt1chk < _ptCutMax && pt2chk > _ptCutMin && pt2chk < _ptCutMax){
+ accepted = true;
+ _nmbAccepted++;
+ }
+ }
+ else if(!_ptCutEnabled && _etaCutEnabled){
+ if(eta1 > _etaCutMin && eta1 < _etaCutMax && eta2 > _etaCutMin && eta2 < _etaCutMax){
+ accepted = true;
+ _nmbAccepted++;
+ }
+ }
+ else if(_ptCutEnabled && _etaCutEnabled){
+ if(pt1chk > _ptCutMin && pt1chk < _ptCutMax && pt2chk > _ptCutMin && pt2chk < _ptCutMax){
+ if(eta1 > _etaCutMin && eta1 < _etaCutMax && eta2 > _etaCutMin && eta2 < _etaCutMax){
+ accepted = true;
+ _nmbAccepted++;
+ }
+ }
+ }
+ else if(!_ptCutEnabled && !_etaCutEnabled)
+ _nmbAccepted++;
+
+ }while((_ptCutEnabled || _etaCutEnabled) && !accepted);
+ /* }else{
+ twoBodyDecay(ipid,E,comenergy,momx,momy,momz,px1,py1,pz1,px2,py2,pz2,iFbadevent);
+ }*/
+ if (iFbadevent==0&&tcheck==0) {
+ int q1=0,q2=0;
+ int ipid1,ipid2=0;
+
+ double xtest = _randy.Rndom();
+ if (xtest<0.5)
+ {
+ q1=1;
+ q2=-1;
+ }
+ else {
+ q1=-1;
+ q2=1;
+ }
+
+ if ( ipid == 11 || ipid == 13 ){
+ ipid1 = -q1*ipid;
+ ipid2 = -q2*ipid;
+ } else {
+ ipid1 = q1*ipid;
+ ipid2 = q2*ipid;
+ }
+ // The new stuff
+ double md = getDaughterMass(vmpid);
+ double Ed1 = sqrt(md*md+px1*px1+py1*py1+pz1*pz1);
+ starlightParticle particle1(px1, py1, pz1, Ed1, starlightConstants::UNKNOWN, ipid1, q1);
+ event.addParticle(particle1);
+
+ double Ed2 = sqrt(md*md+px2*px2+py2*py2+pz2*pz2);
+ starlightParticle particle2(px2, py2, pz2, Ed2, starlightConstants::UNKNOWN, ipid2, q2);
+ event.addParticle(particle2);
+ // End of the new stuff
+
+ }
+ }
+
+ return event;
+
+}
+double Gammaavectormeson::pseudoRapidity(double px, double py, double pz)
+{
+ double pT = sqrt(px*px + py*py);
+ double p = sqrt(pz*pz + pT*pT);
+ double eta = -99.9; if((p-pz) != 0){eta = 0.5*log((p+pz)/(p-pz));}
+ return eta;
+}
+
+//______________________________________________________________________________
+Gammaanarrowvm::Gammaanarrowvm(inputParameters& input,beamBeamSystem& bbsystem):Gammaavectormeson(input,bbsystem)
+{
+ cout<<"Reading in luminosity tables. Gammaanarrowvm()"<<endl;
+ read();
+ cout<<"Creating and calculating crosssection. Gammaanarrowvm()"<<endl;
+ narrowResonanceCrossSection sigma(input,bbsystem);
+ sigma.crossSectionCalculation(_bwnormsave);
+ _VMbslope=sigma.slopeParameter();
+}
+
+
+//______________________________________________________________________________
+Gammaanarrowvm::~Gammaanarrowvm()
+{ }
+
+
+//______________________________________________________________________________
+Gammaaincoherentvm::Gammaaincoherentvm(inputParameters& input,beamBeamSystem& bbsystem):Gammaavectormeson(input,bbsystem)
+{
+ cout<<"Reading in luminosity tables. Gammaainkoherentvm()"<<endl;
+ read();
+ cout<<"Creating and calculating crosssection. Gammaainkoherentvm()"<<endl;
+ incoherentVMCrossSection sigma(input,bbsystem);
+ sigma.crossSectionCalculation(_bwnormsave);
+ _VMbslope=sigma.slopeParameter();
+}
+
+
+//______________________________________________________________________________
+Gammaaincoherentvm::~Gammaaincoherentvm()
+{ }
+
+
+//______________________________________________________________________________
+Gammaawidevm::Gammaawidevm(inputParameters& input,beamBeamSystem& bbsystem):Gammaavectormeson(input,bbsystem)
+{
+ cout<<"Reading in luminosity tables. Gammaawidevm()"<<endl;
+ read();
+ cout<<"Creating and calculating crosssection. Gammaawidevm()"<<endl;
+ wideResonanceCrossSection sigma(input,bbsystem);
+ sigma.crossSectionCalculation(_bwnormsave);
+ _VMbslope=sigma.slopeParameter();
+}
+
+
+//______________________________________________________________________________
+Gammaawidevm::~Gammaawidevm()
+{ }
+
+
Property changes on: branches/starlight_1.1/src/gammaavm.cpp
___________________________________________________________________
Added: svn:keywords
## -0,0 +1 ##
+Rev Date Author
\ No newline at end of property
Index: branches/starlight_1.1/src/randomgenerator.cpp
===================================================================
--- branches/starlight_1.1/src/randomgenerator.cpp (revision 0)
+++ branches/starlight_1.1/src/randomgenerator.cpp (revision 145)
@@ -0,0 +1,149 @@
+///////////////////////////////////////////////////////////////////////////
+//
+// Copyright 2010
+//
+// This file is part of starlight.
+//
+// starlight is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
+//
+// starlight is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with starlight. If not, see <http://www.gnu.org/licenses/>.
+//
+///////////////////////////////////////////////////////////////////////////
+//
+// File and Version Information:
+// $Rev:: $: revision of last commit
+// $Author:: $: author of last commit
+// $Date:: $: date of last commit
+//
+// Description:
+//
+//
+//
+///////////////////////////////////////////////////////////////////////////
+
+
+#include <iostream>
+#include <fstream>
+#include <cmath>
+
+#include "randomgenerator.h"
+
+
+using namespace std;
+
+
+//USED IN ROOT under TRANDOM3
+// Random number generator class based on
+// M. Matsumoto and T. Nishimura,
+// Mersenne Twistor: A 623-diminsionally equidistributed
+// uniform pseudorandom number generator
+// ACM Transactions on Modeling and Computer Simulation,
+// Vol. 8, No. 1, January 1998, pp 3--30.
+//
+// For more information see the Mersenne Twistor homepage
+// http://www.math.keio.ac.jp/~matumoto/emt.html
+//
+// Advantage: large period 2**19937-1
+// relativly fast
+// (only two times slower than TRandom, but
+// two times faster than TRandom2)
+// Drawback: a relative large internal state of 624 integers
+//
+//
+// Aug.99 ROOT implementation based on CLHEP by P.Malzacher
+//
+// the original code contains the following copyright notice:
+/* This library is free software; you can redistribute it and/or */
+/* modify it under the terms of the GNU Library General Public */
+/* License as published by the Free Software Foundation; either */
+/* version 2 of the License, or (at your option) any later */
+/* version. */
+/* This library is distributed in the hope that it will be useful, */
+/* but WITHOUT ANY WARRANTY; without even the implied warranty of */
+/* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. */
+/* See the GNU Library General Public License for more details. */
+/* You should have received a copy of the GNU Library General */
+/* Public License along with this library; if not, write to the */
+/* Free Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA */
+/* 02111-1307 USA */
+/* Copyright (C) 1997 Makoto Matsumoto and Takuji Nishimura. */
+/* When you use this, send an email to: matumoto@math.keio.ac.jp */
+/* with an appropriate reference to your work. */
+/////////////////////////////////////////////////////////////////////
+
+
+void randomGenerator::SetSeed(unsigned int seed)
+{
+// Set the random generator sequence
+// if seed is 0 (default value) a TUUID is generated and used to fill
+// the first 8 integers of the seed array.
+// In this case the seed is guaranteed to be unique in space and time.
+// Use upgraded seeding procedure to fix a known problem when seeding with values
+// with many zero in the bit pattern (like 2**28).
+// see http://www.math.sci.hiroshima-u.ac.jp/~m-mat/MT/MT2002/emt19937ar.html
+
+ _count624 = 624;
+ int i,j;
+
+ _Mt[0] = seed;
+ j = 1;
+ // use multipliers from Knuth's "Art of Computer Programming" Vol. 2, 3rd Ed. p.106
+ for(i=j; i<624; i++) {
+ _Mt[i] = (1812433253 * ( _Mt[i-1] ^ ( _Mt[i-1] >> 30)) + i);
+ }
+}
+
+
+double randomGenerator::Rndom(int)
+{
+
+// Machine independent random number generator.
+// Produces uniformly-distributed floating points in ]0,1]
+// Method: Mersenne Twistor
+
+ unsigned int y;
+
+ const int kM = 397;
+ const int kN = 624;
+ const unsigned int kTemperingMaskB = 0x9d2c5680;
+ const unsigned int kTemperingMaskC = 0xefc60000;
+ const unsigned int kUpperMask = 0x80000000;
+ const unsigned int kLowerMask = 0x7fffffff;
+ const unsigned int kMatrixA = 0x9908b0df;
+
+ if (_count624 >= kN) {
+ register int i;
+
+ for (i=0; i < kN-kM; i++) {
+ y = (_Mt[i] & kUpperMask) | (_Mt[i+1] & kLowerMask);
+ _Mt[i] = _Mt[i+kM] ^ (y >> 1) ^ ((y & 0x1) ? kMatrixA : 0x0);
+ }
+
+ for ( ; i < kN-1 ; i++) {
+ y = (_Mt[i] & kUpperMask) | (_Mt[i+1] & kLowerMask);
+ _Mt[i] = _Mt[i+kM-kN] ^ (y >> 1) ^ ((y & 0x1) ? kMatrixA : 0x0);
+ }
+
+ y = (_Mt[kN-1] & kUpperMask) | (_Mt[0] & kLowerMask);
+ _Mt[kN-1] = _Mt[kM-1] ^ (y >> 1) ^ ((y & 0x1) ? kMatrixA : 0x0);
+ _count624 = 0;
+ }
+
+ y = _Mt[_count624++];
+ y ^= (y >> 11);
+ y ^= ((y << 7 ) & kTemperingMaskB );
+ y ^= ((y << 15) & kTemperingMaskC );
+ y ^= (y >> 18);
+
+ if (y) return ( (double) y * 2.3283064365386963e-10); // * Power(2,-32)
+ return Rndom();
+}
Property changes on: branches/starlight_1.1/src/randomgenerator.cpp
___________________________________________________________________
Added: svn:keywords
## -0,0 +1 ##
+Rev Date Author
\ No newline at end of property
Index: branches/starlight_1.1/src/upcevent.cpp
===================================================================
--- branches/starlight_1.1/src/upcevent.cpp (revision 0)
+++ branches/starlight_1.1/src/upcevent.cpp (revision 145)
@@ -0,0 +1,105 @@
+///////////////////////////////////////////////////////////////////////////
+//
+// Copyright 2010
+//
+// This file is part of starlight.
+//
+// starlight is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
+//
+// starlight is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with starlight. If not, see <http://www.gnu.org/licenses/>.
+//
+///////////////////////////////////////////////////////////////////////////
+//
+// File and Version Information:
+// $Rev:: $: revision of last commit
+// $Author:: $: author of last commit
+// $Date:: $: date of last commit
+//
+// Description:
+//
+//
+//
+///////////////////////////////////////////////////////////////////////////
+
+
+#include "upcevent.h"
+
+
+upcEvent::upcEvent() :
+ _NTracks(0)
+ ,_particles(0)
+ ,_vertices(0)
+{ }
+
+upcEvent::upcEvent(starlightConstants::event &ev) :
+ _NTracks(0)
+ ,_particles(0)
+ ,_vertices(0)
+{
+ for(int i = 0; i < ev._numberOfTracks; i++)
+ {
+ starlightParticle p(
+ ev.px[i],
+ ev.py[i],
+ ev.pz[i],
+ starlightConstants::UNKNOWN,
+ starlightConstants::UNKNOWN,
+ ev._fsParticle[i],
+ ev._charge[i]
+ );
+ addParticle(p);
+ }
+}
+
+upcEvent::~upcEvent()
+{ }
+
+
+upcEvent& upcEvent::operator=(const upcEvent& rhs)
+{
+
+ if(this != &rhs)
+ {
+ this->_particles = rhs._particles;
+ this->_vertices = rhs._vertices;
+ this->_gammaEnergies = rhs._gammaEnergies;
+ }
+ return *this;
+}
+
+upcEvent& upcEvent::operator+(const upcEvent& ev)
+{
+ for(unsigned int n = 0; n < ev._particles.size(); n++)
+ {
+ this->_particles.push_back(ev._particles.at(n));
+ }
+ for(unsigned int n = 0; n < ev._vertices.size(); n++)
+ {
+ this->_vertices.push_back(ev._vertices.at(n));
+ }
+ for(unsigned int n = 0; n < ev._gammaEnergies.size(); n++)
+ {
+ this->_gammaEnergies.push_back(ev._gammaEnergies.at(n));
+ }
+ return *this;
+}
+
+void upcEvent::boost(double rapidity)
+{
+ vector3 boostVector(0, 0, tanh(rapidity));
+ std::vector<starlightParticle>::iterator part = _particles.begin();
+
+ for (part = _particles.begin(); part != _particles.end(); part++)
+ {
+ (*part).Boost(boostVector);
+ }
+}
Property changes on: branches/starlight_1.1/src/upcevent.cpp
___________________________________________________________________
Added: svn:keywords
## -0,0 +1 ##
+Rev Date Author
\ No newline at end of property
Index: branches/starlight_1.1/src/pythiadecayer.cpp
===================================================================
--- branches/starlight_1.1/src/pythiadecayer.cpp (revision 0)
+++ branches/starlight_1.1/src/pythiadecayer.cpp (revision 145)
@@ -0,0 +1,76 @@
+#include "pythiadecayer.h"
+#include "reportingUtils.h"
+#include "starlightconfig.h"
+using namespace Pythia8;
+
+
+
+pythiaDecayer::pythiaDecayer() :
+ _pythia(PYTHIA8_SETTINGS_DIR)
+{}
+/*
+pythiaDecayer::pythiaDecayer(const pythiaDecayer &obj) :
+ _pythia(obj._pythia)
+{}
+*/
+pythiaDecayer::~pythiaDecayer()
+{}
+/*
+pythiaDecayer& pythiaDecayer::operator=(const pythiaDecayer &other)
+{
+ if (this != &other)
+ {
+ _pythia = other._pythia;
+ }
+ return *this;
+}
+*/
+void pythiaDecayer::init()
+{
+ _pythia.readString("ProcessLevel:all = off");
+ _pythia.readString("Standalone:allowResDec = on");
+ _pythia.readString("Next:numberShowEvent = 0");
+ _pythia.init();
+ _pythia.event.reset();
+}
+
+void pythiaDecayer::addParticle(const starlightParticle &p)
+{
+
+ Event &pyEvent = _pythia.event;
+ int status = 23; // Outgoing particle from the hardest sub-process
+ int col = 0;
+ int acol = 0;
+ int code = p.getPdgCode();
+
+ pyEvent.append(code, status, col, acol, p.GetPx(), p.GetPy(), p.GetPz(), p.GetE(), p.M());
+
+}
+
+upcEvent pythiaDecayer::execute()
+{
+ upcEvent slEvent;
+
+ Event &pyEvent = _pythia.event;
+ _pythia.forceTimeShower(1, 2, 100000.0);
+// pyEvent.list();
+ if(!_pythia.next())
+ {
+ printWarn << "Pythia::next() failed" << std::endl;
+ return upcEvent();
+ }
+
+ for(int i = 0; i < pyEvent.size(); ++i)
+ {
+
+ Particle p = pyEvent[i];
+ starlightParticle slPart(p.px(), p.py(), p.pz(), p.e(), p.mass(), p.idAbs()*(p.charge()<0?-1:1), p.charge(),
+ p.xProd(), p.yProd(), p.zProd(), p.tProd(),
+ p.mother1(), p.mother2(), p.daughter1(), p.daughter2(), p.status());
+ slEvent.addParticle(slPart);
+ }
+ pyEvent.clear();
+ pyEvent.reset();
+ return slEvent;
+
+}
\ No newline at end of file
Index: branches/starlight_1.1/src/psifamily.cpp
===================================================================
--- branches/starlight_1.1/src/psifamily.cpp (revision 0)
+++ branches/starlight_1.1/src/psifamily.cpp (revision 145)
@@ -0,0 +1,109 @@
+///////////////////////////////////////////////////////////////////////////
+//
+// Copyright 2010
+//
+// This file is part of starlight.
+//
+// starlight is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
+//
+// starlight is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with starlight. If not, see <http://www.gnu.org/licenses/>.
+//
+///////////////////////////////////////////////////////////////////////////
+//
+// File and Version Information:
+// $Rev:: $: revision of last commit
+// $Author:: $: author of last commit
+// $Date:: $: date of last commit
+//
+// Description:
+//
+//
+//
+///////////////////////////////////////////////////////////////////////////
+
+
+#include <iostream>
+#include <fstream>
+#include <cmath>
+
+#include "psifamily.h"
+
+
+using namespace std;
+
+
+psiFamily::psiFamily(inputParameters& input,beamBeamSystem& bbsystem):Gammaanarrowvm(input,bbsystem)
+{
+//Defining _width and mass...
+
+
+ // switch(input.prodParticleType()){
+ // case starlightConstants::JPSI:
+ // cout << "JPSI goddamnit!" << endl;
+ // _width=0.000091;
+ // mass=3.09692;
+ // break;
+ // case starlightConstants::JPSI2S:
+ // _width=0.000337;
+ // mass=3.686093;
+ // break;
+ // default: cout<<"This PSI Family Member Has Not Been Defined, psiFamily::psiFamily()"<<endl;
+ // }
+
+}
+
+
+psiFamily::~psiFamily()
+{ }
+
+
+double psiFamily::getTheta(starlightConstants::particleTypeEnum)
+{
+//should probably merge the psi fmaily back to the vm stuff.
+
+//This depends on the decay angular distribution
+//Valid for J/Psi, Psi(2s)?
+//cout<<"Psi family theta"<<endl;
+double theta=0.;
+double xtest=0.;
+double dndtheta=0.;
+ L200td:
+ theta = starlightConstants::pi*_randy.Rndom();//random()/(RAND_MAX+1.0);
+ xtest = _randy.Rndom();//random()/(RAND_MAX+1.0);
+ // Follow distribution for helicity +/-1
+ // Eq. 19 of J. Breitweg et al., Eur. Phys. J. C2, 247 (1998)//Does Not Apply for J/psi?
+ // SRK 11/14/2000
+
+ dndtheta = sin(theta)*(1.+((cos(theta))*(cos(theta))));
+ if(xtest > dndtheta)
+ goto L200td;
+ return theta;
+}
+
+
+double psiFamily::getDaughterMass(starlightConstants::particleTypeEnum &ipid)
+{
+ double ytest=0.,mdec=0.;
+ // decays 50% to e+/e-, 50% to mu+/mu-
+ ytest = _randy.Rndom();//random()/(RAND_MAX+1.0);
+ if(ytest >= 0.5)
+ {
+ mdec = starlightConstants::mel;
+ ipid = starlightConstants::ELECTRON;
+ }
+ else
+ {
+ mdec = starlightConstants::muonMass;
+ ipid = starlightConstants::MUON;
+ }
+ return mdec;
+}
Property changes on: branches/starlight_1.1/src/psifamily.cpp
___________________________________________________________________
Added: svn:keywords
## -0,0 +1 ##
+Rev Date Author
\ No newline at end of property
Index: branches/starlight_1.1/src/beambeamsystem.cpp
===================================================================
--- branches/starlight_1.1/src/beambeamsystem.cpp (revision 0)
+++ branches/starlight_1.1/src/beambeamsystem.cpp (revision 145)
@@ -0,0 +1,672 @@
+///////////////////////////////////////////////////////////////////////////
+//
+// Copyright 2010
+//
+// This file is part of starlight.
+//
+// starlight is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
+//
+// starlight is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with starlight. If not, see <http://www.gnu.org/licenses/>.
+//
+///////////////////////////////////////////////////////////////////////////
+//
+// File and Version Information:
+// $Rev:: $: revision of last commit
+// $Author:: $: author of last commit
+// $Date:: $: date of last commit
+//
+// Description:
+//
+//
+//
+///////////////////////////////////////////////////////////////////////////
+
+
+#include <iostream>
+#include <fstream>
+#include <cmath>
+
+#include "inputParameters.h"
+#include "reportingUtils.h"
+#include "starlightconstants.h"
+#include "bessel.h"
+#include "beambeamsystem.h"
+
+
+using namespace std;
+using namespace starlightConstants;
+
+
+//______________________________________________________________________________
+beamBeamSystem::beamBeamSystem(const beam& beam1,
+ const beam& beam2,
+ const inputParameters& input)
+ : _beamLorentzGamma(input.beamLorentzGamma()),
+ _beamBreakupMode (input.beamBreakupMode()),
+ _beam1 (beam1),
+ _beam2 (beam2),
+ _breakupProbabilities(0),
+ _breakupImpactParameterStep(1.007),
+ _breakupCutOff(10e-6)
+{
+ init(input);
+}
+
+
+
+
+//______________________________________________________________________________
+beamBeamSystem::beamBeamSystem(const inputParameters &input)
+ : _beamLorentzGamma(input.beamLorentzGamma()),
+ _beamBreakupMode (input.beamBreakupMode()),
+ _beam1 (input.beam1Z(),
+ input.beam1A(),
+ input.deuteronSlopePar(),
+ input.coherentProduction(),
+ input),
+ _beam2 (input.beam2Z(),
+ input.beam2A(),
+ input.deuteronSlopePar(),
+ input.coherentProduction(),
+ input),
+ _breakupProbabilities(0),
+ _breakupImpactParameterStep(1.007),
+ _breakupCutOff(10e-10)
+{
+ init(input);
+}
+
+
+
+//______________________________________________________________________________
+beamBeamSystem::~beamBeamSystem()
+{ }
+
+void beamBeamSystem::init(const inputParameters &p)
+{
+ // Calculate beam gamma in CMS frame
+ double rap1 = acosh(p.beam1LorentzGamma());
+ double rap2 = -acosh(p.beam2LorentzGamma());
+
+ _cmsBoost = (rap1+rap2)/2.;
+
+ _beamLorentzGamma = cosh((rap1-rap2)/2);
+ _beam1.setBeamLorentzGamma(_beamLorentzGamma);
+ _beam2.setBeamLorentzGamma(_beamLorentzGamma);
+
+ generateBreakupProbabilities();
+}
+//______________________________________________________________________________
+double
+beamBeamSystem::probabilityOfBreakup(const double D) const
+{
+
+ double bMin = (_beam1.nuclearRadius()+_beam2.nuclearRadius())/2.;
+ double pOfB = 0.; // PofB = 1 means that there will be a UPC event and PofB = 0 means no UPC
+
+ // Do pp here
+ if ((_beam1.Z() == 1) && (_beam1.A() == 1) && (_beam2.Z() == 1) && (_beam2.A() == 1)) {
+ double ppslope=19.8;
+ double GammaProfile = exp(-D * D / (2. * hbarc * hbarc * ppslope));
+ pOfB = (1. - GammaProfile) * (1. - GammaProfile);
+ // if (D < 2. * _beam1.nuclearRadius())
+ // //Should be the total of RNuc1+Rnuc2,used only beam #1
+ // PofB = 0.0;
+ // else
+ // PofB = 1.0;
+ return pOfB;
+ }
+ else if ( ( (_beam1.A() == 1) && (_beam2.A() != 1) ) || ((_beam1.A() != 1) && (_beam2.A() == 1)) ) {
+ // This is pA
+ if( _beam1.A() == 1 ){
+ bMin = _beam2.nuclearRadius() + 0.7;
+ }else if( _beam2.A() == 1 ){
+ bMin = _beam1.nuclearRadius() + 0.7;
+ }else{
+ cout<<"Some logical problem here!"<<endl;
+ }
+ if( D > bMin )pOfB=1.0;
+ return pOfB;
+ }
+
+ //use the lookup table and return...
+ pOfB = 1.;
+ if (D > 0.0) {
+ //Now we must determine which step number in d corresponds to this D,
+ // and use appropiate Ptot(D_i)
+ //int i = (int)(log(D / Bmin) / log(1.01));
+ int i = (int)(log(D / bMin) / log(_breakupImpactParameterStep));
+ if (i <= 0)
+ pOfB = _breakupProbabilities[0];
+ else{
+ if (i >= int(_breakupProbabilities.size()-1))
+ pOfB = _breakupProbabilities[_breakupProbabilities.size()-1];
+ else {
+ // const double DLow = Bmin * pow((1.01), i);
+ const double DLow = bMin * pow((_breakupImpactParameterStep), i);
+ // const double DeltaD = 0.01 * DLow;
+ const double DeltaD = (_breakupImpactParameterStep-1) * DLow;
+ const double DeltaP = _breakupProbabilities[i + 1] - _breakupProbabilities[i];
+ pOfB = _breakupProbabilities[i] + DeltaP * (D - DLow) / DeltaD;
+ }
+ }
+ }
+
+ return pOfB;
+}
+
+void
+beamBeamSystem::generateBreakupProbabilities()
+{
+ // Step = 1.007;//.01; //We will multiplicateively increase Biter by 1%
+
+
+ double bMin = (_beam1.nuclearRadius()+_beam2.nuclearRadius())/2.;
+
+
+ if ((_beam1.Z() != 1) && (_beam1.A() != 1) && (_beam2.Z() != 1) && _beam2.A() != 1) {
+
+ if (_beamBreakupMode == 1)
+ printInfo << "Hard Sphere Break criteria. b > " << 2. * _beam1.nuclearRadius() << endl;
+ if (_beamBreakupMode == 2)
+ printInfo << "Requiring XnXn [Coulomb] breakup. " << endl;
+ if (_beamBreakupMode == 3)
+ printInfo << "Requiring 1n1n [Coulomb only] breakup. " << endl;
+ if (_beamBreakupMode == 4)
+ printInfo << "Requiring both nuclei to remain intact. " << endl;
+ if (_beamBreakupMode == 5)
+ printInfo << "Requiring no hadronic interactions. " << endl;
+ if (_beamBreakupMode == 6)
+ printInfo << "Requiring breakup of one or both nuclei. " << endl;
+ if (_beamBreakupMode == 7)
+ printInfo << "Requiring breakup of one nucleus (Xn,0n). " << endl;
+
+ //pp may cause segmentation fault in here and it does not use this...
+ double pOfB = 0;
+ double b = bMin;
+ double totRad = _beam1.nuclearRadius()+_beam2.nuclearRadius();
+
+ while(1)
+ {
+
+ if(_beamBreakupMode != 5)
+ {
+ if(b > (totRad*1.5))
+ {
+ if(pOfB<_breakupCutOff)
+ {
+// std::cout << "Break off b: " << b << std::endl;
+// std::cout << "Number of PofB bins: " << _breakupProbabilities.size() << std::endl;
+ break;
+ }
+ }
+ }
+ else
+ {
+ if((1-pOfB)<_breakupCutOff)
+ {
+ // std::cout << "Break off b: " << b << std::endl;
+// std::cout << "Number of PofB bins: " << _breakupProbabilities.size() << std::endl;
+ break;
+ }
+ }
+// std::cout << 1-pOfBreakup << std::endl;
+// _pHadronBreakup = 0;
+// _pPhotonBreakup = 0;
+
+// double pHadronBreakup = probabilityOfHadronBreakup(b);
+ probabilityOfHadronBreakup(b);
+ //moved gammatarg into photonbreakup
+// double pPhotonBreakup = probabilityOfPhotonBreakup(b, _beamBreakupMode);
+ probabilityOfPhotonBreakup(b, _beamBreakupMode);
+
+ //What was probability of photonbreakup depending upon mode selection,
+ // is now done in the photonbreakupfunction
+ if (_beamBreakupMode == 1) {
+ if (b >_beam1.nuclearRadius()+_beam2.nuclearRadius()) // symmetry
+ _pHadronBreakup = 0;
+ else
+ _pHadronBreakup = 999.;
+ }
+
+ b *= _breakupImpactParameterStep;
+ pOfB = exp(-1 * _pHadronBreakup) * _pPhotonBreakup;
+ _breakupProbabilities.push_back(pOfB);
+ }
+ }
+ else if (((_beam1.Z() == 1) && (_beam1.A() == 1)) || ((_beam2.Z() == 1) && (_beam2.A() == 1))) {
+
+ double pOfB = 0;
+ double b = bMin;
+ double totRad = _beam1.nuclearRadius()+_beam2.nuclearRadius();
+
+ while(1)
+ {
+ if(_beamBreakupMode != 5)
+ {
+ if(b > (totRad*1.5))
+ {
+ if(pOfB<_breakupCutOff)
+ {
+// std::cout << "Break off b: " << b << std::endl;
+ break;
+ }
+ }
+ }
+ else
+ {
+ if((1-pOfB)<_breakupCutOff)
+ {
+// std::cout << "Break off b: " << b << std::endl;
+ break;
+ }
+ }
+ _beam1.Z() > 1 ? pOfB = exp(-7.35*_beam1.thickness(b)) :
+ pOfB = exp(-7.35*_beam2.thickness(b));
+ _breakupProbabilities.push_back(pOfB);
+ b *= _breakupImpactParameterStep;
+ }
+ }
+
+
+}
+
+//______________________________________________________________________________
+double
+beamBeamSystem::probabilityOfHadronBreakup(const double impactparameter)
+{
+ // double pbreakup =0.;
+ //probability of hadron breakup,
+ //this is what is returned when the function is called
+ double gamma = _beamLorentzGamma;
+ //input for gamma_em
+ //this will need to be StarlightInputParameters::gamma or whatever
+ double b = impactparameter;
+ int ap = _beam1.A();
+ //Notice this is taking from nucleus 1.Still assuming symmetric system?
+
+ static int IFIRSTH = 0;
+ static double DELL=0., DELR=0., SIGNN=0., R1=0., A1=0., R2=0., RHO1=0.;
+ static double RHO2=0., NZ1=0., NZ2=0., NR1=0., NR2=0.,RR1=0., NY=0., NX=0.;
+ static double AN1=0., AN2=0.;
+ double delo=0.,RSQ=0.,Z1=0.,Y=0.,X=0.,XB=0.,RPU=0.,IRUP=0.,RTU=0.;
+ double IRUT=0.,T1=0.,T2=0.;
+ static double DEN1[20002], DEN2[20002];
+ if (IFIRSTH != 0) goto L100;
+ //Initialize
+ //Integration delta x, delta z
+ IFIRSTH = 1;
+ DELL = .05;
+ DELR = .01;
+
+ //use two sigma_NN's. 52mb at rhic 100gev/beam, 88mb at LHC 2.9tev/beam, gamma is in cm system
+ SIGNN = 5.2;
+ if ( gamma > 500. ) SIGNN = 8.8;
+ //use parameter from Constants
+ R1 = ( _beam1.nuclearRadius()); //remember _beam2? better way to do this generically
+ A1 = 0.535; //This is woodsaxonskindepth?
+ //write(6,12)r1,a1,signn Here is where we could probably set this up asymmetrically R2=_beam2.nuclearRadius() and RHO2=ap2=_beam2.A()
+ R2 = R1;
+ RHO1 = ap;
+ RHO2 = RHO1;
+ NZ1 = ((R1+5.)/DELR);
+ NR1 = NZ1;
+ NZ2 = ((R2+5.)/DELR);
+ NR2 = NZ2;
+ RR1 = -DELR;
+ NY = ((R1+5.)/DELL);
+ NX = 2*NY;
+ for ( int IR1 = 1; IR1 <= NR1; IR1++) {
+ DEN1[IR1] = 0.;
+ RR1 = RR1+DELR;
+ Z1 = -DELR/2;
+
+ for ( int IZ1 = 1; IZ1 <= NZ1; IZ1++) {
+ Z1 = Z1+DELR;
+ RSQ = RR1*RR1+Z1*Z1;
+ DEN1[IR1] = DEN1[IR1]+1./(1.+exp((sqrt(RSQ)-R1)/A1));
+ }//for(IZ)
+
+ DEN1[IR1] = DEN1[IR1]*2.*DELR;
+ DEN2[IR1] = DEN1[IR1];
+ }//for(IR)
+
+ AN1 = 0.;
+ RR1 = 0.;
+
+ for ( int IR1 =1; IR1 <= NR1; IR1++) {
+ RR1 = RR1+DELR;
+ AN1 = AN1+RR1*DEN1[IR1]*DELR*2.*3.141592654;
+ }//for(IR)
+
+ AN2 = AN1; //This will also probably need to be changed?
+
+ delo = .05;
+ //.1 to turn mb into fm^2
+ //Calculate breakup probability here
+ L100:
+ _pHadronBreakup = 0.;
+ if ( b > 25. ) return _pHadronBreakup;
+ Y = -.5*DELL;
+ for ( int IY = 1; IY <= NY; IY++) {
+ Y = Y+DELL;
+ X = -DELL*float(NY+1);
+
+ for ( int IX = 1; IX <=NX; IX++) {
+ X = X+DELL;
+ XB = b-X;
+ RPU = sqrt(X*X+Y*Y);
+ IRUP = (RPU/DELR)+1;
+ RTU = sqrt(XB*XB+Y*Y);
+ IRUT = (RTU/DELR)+1;
+ T1 = DEN2[(int)IRUT]*RHO2/AN2;
+ T2 = DEN1[(int)IRUP]*RHO1/AN1;
+ //Eq.6 BCW, Baltz, Chasman, White, Nucl. Inst. & Methods A 417, 1 (1998)
+ _pHadronBreakup=_pHadronBreakup+2.*T1*(1.-exp(-SIGNN*T2))*DELL*DELL;
+ }//for(IX)
+ }//for(IY)
+
+ return _pHadronBreakup;
+}
+
+
+//______________________________________________________________________________
+double
+beamBeamSystem::probabilityOfPhotonBreakup(const double impactparameter, const int mode)
+{
+ static double ee[10001], eee[162], se[10001];
+
+ //double gamma_em=108.4; //This will be an input value.
+ _pPhotonBreakup =0.; //Might default the probability with a different value?
+ double b = impactparameter;
+ int zp = _beam1.Z(); //What about _beam2? Generic approach?
+ int ap = _beam1.A();
+
+ //Was initialized at the start of the function originally, been moved inward.
+ double pxn=0.;
+ double p1n=0.;
+
+ //Used to be done prior to entering the function. Done properly for assymetric?
+ double gammatarg = 2.*_beamLorentzGamma*_beamLorentzGamma-1.;
+ double omaxx =0.;
+ //This was done prior entering the function as well
+ if (_beamLorentzGamma > 500.){
+ omaxx=1.E10;
+ }
+ else{
+ omaxx=1.E7;
+ }
+
+
+ double e1[23]= {0.,103.,106.,112.,119.,127.,132.,145.,171.,199.,230.,235.,
+ 254.,280.,300.,320.,330.,333.,373.,390.,420.,426.,440.};
+ double s1[23]= {0.,12.0,11.5,12.0,12.0,12.0,15.0,17.0,28.0,33.0,
+ 52.0,60.0,70.0,76.0,85.0,86.0,89.0,89.0,75.0,76.0,69.0,59.0,61.0};
+ double e2[12]={0.,2000.,3270.,4100.,4810.,6210.,6600.,
+ 7790.,8400.,9510.,13600.,16400.};
+ double s2[12]={0.,.1266,.1080,.0805,.1017,.0942,.0844,.0841,.0755,.0827,
+ .0626,.0740};
+ double e3[29]={0.,26.,28.,30.,32.,34.,36.,38.,40.,44.,46.,48.,50.,52.,55.,
+ 57.,62.,64.,66.,69.,72.,74.,76.,79.,82.,86.,92.,98.,103.};
+ double s3[29]={0.,30.,21.5,22.5,18.5,17.5,15.,14.5,19.,17.5,16.,14.,
+ 20.,16.5,17.5,17.,15.5,18.,15.5,15.5,15.,13.5,18.,14.5,15.5,12.5,13.,
+ 13.,12.};
+ static double sa[161]={0.,0.,.004,.008,.013,.017,.021,.025,.029,.034,.038,.042,.046,
+ .051,.055,.059,.063,.067,.072,.076,.08,.085,.09,.095,.1,.108,.116,
+ .124,.132,.14,.152,.164,.176,.188,.2,.22,.24,.26,.28,.3,.32,.34,
+ .36,.38,.4,.417,.433,.450,.467,.483,.5,.51,.516,.52,.523,.5245,
+ .525,.5242,
+ .5214,.518,.512,.505,.495,.482,.469,.456,.442,.428,.414,.4,.386,
+ .370,.355,.34,.325,.310,.295,.280,.265,.25,.236,.222,.208,.194,
+ .180,.166,
+ .152,.138,.124,.11,.101,.095,.09,.085,.08,.076,.072,.069,.066,
+ .063,.06,.0575,.055,.0525,.05,.04875,.0475,.04625,.045,.04375,
+ .0425,.04125,.04,.03875,.0375,.03625,.035,.03375,.0325,.03125,.03,
+ .02925,.0285,.02775,.027,.02625,.0255,.02475,.024,.02325,.0225,
+ .02175,.021,.02025,.0195,.01875,.018,.01725,.0165,.01575,.015,
+ .01425,.0135,.01275,.012,.01125,.0105,.00975,.009,.00825,.0075,
+ .00675,.006,.00525,.0045,.00375,.003,.00225,.0015,.00075,0.};
+
+
+
+ double sen[161]={0.,0.,.012,.025,.038,.028,.028,.038,.035,.029,.039,.035,
+ .038,.032,.038,.041,.041,.049,.055,.061,.072,.076,.070,.067,
+ .080,.103,.125,.138,.118,.103,.129,.155,.170,.180,.190,.200,
+ .215,.250,.302,.310,.301,.315,.330,.355,.380,.400,.410,.420,
+ .438,.456,.474,.492,.510,.533,.556,.578,.6,.62,.63,.638,
+ .640,.640,.637,.631,.625,.618,.610,.600,.580,.555,.530,.505,
+ .480,.455,.435,.410,.385,.360,.340,.320,.300,.285,.270,.255,
+ .240,.225,.210,.180,.165,.150,.140,.132,.124,.116,.108,.100,
+ .092,.084,.077,.071,.066,.060,.055,.051,.048,.046,.044,.042,
+ .040,.038,.036,.034,.032,.030,.028,.027,.026,.025,.025,.025,
+ .024,.024,.024,.024,.024,.023,.023,.023,.023,.023,.022,.022,
+ .022,.022,.022,.021,.021,.021,.020,.020,
+ .020,.019,.018,.017,.016,.015,.014,.013,.012,.011,.010,.009,
+ .008,.007,.006,.005,.004,.003,.002,.001,0.};
+
+ // gammay,p gamma,n of Armstrong begin at 265 incr 25
+
+
+ double sigt[160]={0.,.4245,.4870,.5269,.4778,.4066,.3341,.2444,.2245,.2005,
+ .1783,.1769,.1869,.1940,.2117,.2226,.2327,.2395,.2646,.2790,.2756,
+ .2607,.2447,.2211,.2063,.2137,.2088,.2017,.2050,.2015,.2121,.2175,
+ .2152,.1917,.1911,.1747,.1650,.1587,.1622,.1496,.1486,.1438,.1556,
+ .1468,.1536,.1544,.1536,.1468,.1535,.1442,.1515,.1559,.1541,.1461,
+ .1388,.1565,.1502,.1503,.1454,.1389,.1445,.1425,.1415,.1424,.1432,
+ .1486,.1539,.1354,.1480,.1443,.1435,.1491,.1435,.1380,.1317,.1445,
+ .1375,.1449,.1359,.1383,.1390,.1361,.1286,.1359,.1395,.1327,.1387,
+ .1431,.1403,.1404,.1389,.1410,.1304,.1363,.1241,.1284,.1299,.1325,
+ .1343,.1387,.1328,.1444,.1334,.1362,.1302,.1338,.1339,.1304,.1314,
+ .1287,.1404,.1383,.1292,.1436,.1280,.1326,.1321,.1268,.1278,.1243,
+ .1239,.1271,.1213,.1338,.1287,.1343,.1231,.1317,.1214,.1370,.1232,
+ .1301,.1348,.1294,.1278,.1227,.1218,.1198,.1193,.1342,.1323,.1248,
+ .1220,.1139,.1271,.1224,.1347,.1249,.1163,.1362,.1236,.1462,.1356,
+ .1198,.1419,.1324,.1288,.1336,.1335,.1266};
+
+
+ double sigtn[160]={0.,.3125,.3930,.4401,.4582,.3774,.3329,.2996,.2715,.2165,
+ .2297,.1861,.1551,.2020,.2073,.2064,.2193,.2275,.2384,.2150,.2494,
+ .2133,.2023,.1969,.1797,.1693,.1642,.1463,.1280,.1555,.1489,.1435,
+ .1398,.1573,.1479,.1493,.1417,.1403,.1258,.1354,.1394,.1420,.1364,
+ .1325,.1455,.1326,.1397,.1286,.1260,.1314,.1378,.1353,.1264,.1471,
+ .1650,.1311,.1261,.1348,.1277,.1518,.1297,.1452,.1453,.1598,.1323,
+ .1234,.1212,.1333,.1434,.1380,.1330,.12,.12,.12,.12,.12,.12,.12,.12,
+ .12,.12,.12,.12,.12,.12,.12,.12,.12,.12,.12,.12,.12,.12,.12,.12,.12,
+ .12,.12,.12,.12,.12,.12,.12,.12,.12,.12,.12,.12,.12,.12,.12,.12,.12,
+ .12,.12,.12,.12,.12,.12,.12,.12,.12,.12,.12,.12,.12,.12,.12,.12,.12,
+ .12,.12,.12,.12,.12,.12,.12,.12,.12,.12,.12,.12,.12,.12,.12,.12,.12,
+ .12,.12,.12,.12,.12,.12,.12,.12,.12,.12,.12,.12,.12};
+ //89*.12};
+
+
+
+ static int IFIRSTP=0;
+
+
+ // Initialization needed?
+ //double hbar=197.3;
+ //double pi=3.141592654;
+
+ // added
+ double si1=0, g1 =0, o1=0;
+ int ne = 0, ij =0;
+ double delo=0, omax =0, gk1m=0;
+ static double scon=0., zcon=0.,o0=0.;
+
+
+ double x=0,y=0,eps=0,eta=0,em=0,exx=0,s=0,ictr=0,pom=0,vec=0,gk1=0;
+
+ // maximum energy for GDR dissocation (in target frame, in MeV)
+
+ double omax1n=24.01;
+
+ if (IFIRSTP != 0) goto L100;
+
+ IFIRSTP=1;
+
+
+ //This whole thing is dependenant on gold or lead....Might need to expand
+ if (zp == 79)
+ {
+
+
+ ap=197;
+ si1=540.;
+ g1=4.75;
+
+ // peak and minimum energies for GDR excitation (in MeV)
+ o1=13.70;
+ o0=8.1;
+ }
+ else
+ {
+ zp=82; //assumed to be lead
+ ap=208;
+ si1=640.;
+ g1=4.05;
+ o1=13.42;
+ o0=7.4;
+ for(int j=1;j<=160;j++)
+ {
+
+ sa[j]=sen[j];
+ }
+ }
+ //Part II of initialization
+ delo = .05;
+ //.1 to turn mb into fm^2
+ scon = .1*g1*g1*si1;
+ zcon = zp/(gammatarg*( pi)*(
+ hbarcmev))*zp/(gammatarg*( pi)*
+ ( hbarcmev))/137.04;
+
+ //single neutron from GDR, Veyssiere et al. Nucl. Phys. A159, 561 (1970)
+ for ( int i = 1; i <= 160; i++) {
+ eee[i] = o0+.1*(i-1);
+ sa[i] = 100.*sa[i];
+ }
+ //See Baltz, Rhoades-Brown, and Weneser, Phys. Rev. E 54, 4233 (1996)
+ //for details of the following photo cross-sections
+ eee[161]=24.1;
+ ne=int((25.-o0)/delo)+1;
+ //GDR any number of neutrons, Veyssiere et al., Nucl. Phys. A159, 561 (1970)
+ for ( int i = 1; i <= ne; i++ ) {
+ ee[i] = o0+(i-1)*delo;
+ //cout<<" ee 1 "<<ee[i]<<" "<<i<<endl;
+
+ se[i] = scon*ee[i]*ee[i]/(((o1*o1-ee[i]*ee[i])*(o1*o1-ee[i]*ee[i]))
+ +ee[i]*ee[i]*g1*g1);
+ }
+ ij = ne; //Risky?
+ //25-103 MeV, Lepretre, et al., Nucl. Phys. A367, 237 (1981)
+ for ( int j = 1; j <= 27; j++ ) {
+ ij = ij+1;
+ ee[ij] = e3[j];
+ //cout<<" ee 2 "<<ee[ij]<<" "<<ij<<endl;
+
+ se[ij] = .1*ap*s3[j]/208.;
+ }
+ //103-440 MeV, Carlos, et al., Nucl. Phys. A431, 573 (1984)
+ for ( int j = 1; j <= 22; j++ ) {
+ ij = ij+1;
+ ee[ij] = e1[j];
+ //cout<<" ee 3 "<<ee[ij]<<" "<<ij<<endl;
+ se[ij] = .1*ap*s1[j]/208.;
+ }
+ //440 MeV-2 GeV Armstrong et al.
+ for ( int j = 9; j <= 70; j++) {
+ ij = ij+1;
+ ee[ij] = ee[ij-1]+25.;
+ //cout<<" ee 4 "<<ee[ij]<<" "<<ij<<endl;
+ se[ij] = .1*(zp*sigt[j]+(ap-zp)*sigtn[j]);
+ }
+ //2-16.4 GeV Michalowski; Caldwell
+ for ( int j = 1; j <= 11; j++) {
+ ij = ij+1;
+ ee[ij] = e2[j];
+ //cout<<" ee 5 "<<ee[ij]<<" "<<ij<<endl;
+ se[ij] = .1*ap*s2[j];
+ }
+ //Regge paramteres
+ x = .0677;
+ y = .129;
+ eps = .0808;
+ eta = .4525;
+ em = .94;
+ exx = pow(10,.05);
+
+ //Regge model for high energy
+ s = .002*em*ee[ij];
+ //make sure we reach LHC energies
+ ictr = 100;
+ if ( gammatarg > (2.*150.*150.)) ictr = 150;
+ for ( int j = 1; j <= ictr; j++ ) {
+ ij = ij+1;
+ s = s*exx;
+ ee[ij] = 1000.*.5*(s-em*em)/em;
+ //cout<<" ee 6 "<<ee[ij]<<" "<<ij<<endl;
+ pom = x*pow(s,eps);
+ vec = y*pow(s,(-eta));
+ se[ij] = .1*.65*ap*(pom+vec);
+ }
+ ee[ij+1] = 99999999999.;
+ //done with initaliation
+ //write(6,99)o0;
+ //clear counters for 1N, XN
+ L100:
+
+ p1n = 0.;
+ pxn = 0.;
+ //start XN calculation
+ //what's the b-dependent highest energy of interest?
+
+ omax = min(omaxx,4.*gammatarg*( hbarcmev)/b);
+ if ( omax < o0 ) return _pPhotonBreakup;
+ gk1m = bessel::dbesk1(ee[1]*b/(( hbarcmev)*gammatarg));
+ int k = 2;
+ L212:
+ if (ee[k] < omax ) {
+ gk1 = bessel::dbesk1(ee[k]*b/(( hbarcmev)*gammatarg));
+ //Eq. 3 of BCW--NIM in Physics Research A 417 (1998) pp1-8:
+ pxn=pxn+zcon*(ee[k]-ee[k-1])*.5*(se[k-1]*ee[k-1]*gk1m*gk1m+se[k]*ee[k]*gk1*gk1);
+ k = k + 1;
+ gk1m = gk1;
+ goto L212;
+ }
+ //one neutron dissociation
+ omax = min(omax1n,4.*gammatarg*( hbarcmev)/b);
+ gk1m = bessel::dbesk1(eee[1]*b/(( hbarcmev)*gammatarg));
+ k = 2;
+ L102:
+ if (eee[k] < omax ) {
+ gk1 = bessel::dbesk1(eee[k]*b/(( hbarcmev)*gammatarg));
+ //Like Eq3 but with only the one neutron out GDR photo cross section input
+ p1n = p1n+zcon*(eee[k]-eee[k-1])*.5*(sa[k-1]*eee[k-1]*gk1m*gk1m+sa[k]*eee[k]*gk1*gk1);
+ k = k+1;
+ gk1m = gk1;
+ goto L102;
+ }
+
+
+ //This used to be done externally, now it is done internally.
+ if (( mode) == 1) _pPhotonBreakup = 1.;
+ if (( mode) == 2) _pPhotonBreakup = (1-exp(-1*pxn))*(1-exp(-1*pxn));
+ if (( mode) == 3) _pPhotonBreakup = (p1n*exp(-1*pxn))*(p1n*exp(-1*pxn));
+ if (( mode) == 4) _pPhotonBreakup = exp(-2*pxn);
+ if (( mode) == 5) _pPhotonBreakup = 1.;
+ if (( mode) == 6) _pPhotonBreakup = (1. - exp(-2.*pxn));
+ if (( mode) == 7) _pPhotonBreakup = 2.*exp(-pxn)*(1.-exp(-pxn));
+
+ //cout<<pxn<<" "<<zcon<<" "<<ee[k]<<" "<<se[k-1]<<" "<<gk1m<<" "<<gk1<<" "<<k<<" "<<ee[k+1]<< " "<<b<< endl;
+
+ return _pPhotonBreakup;
+}
Property changes on: branches/starlight_1.1/src/beambeamsystem.cpp
___________________________________________________________________
Added: svn:keywords
## -0,0 +1 ##
+Rev Date Author
\ No newline at end of property
Index: branches/starlight_1.1/starlightDoxyfile.conf
===================================================================
--- branches/starlight_1.1/starlightDoxyfile.conf (revision 0)
+++ branches/starlight_1.1/starlightDoxyfile.conf (revision 145)
@@ -0,0 +1,1255 @@
+# Doxyfile 1.5.1
+
+# This file describes the settings to be used by the documentation system
+# doxygen (www.doxygen.org) for a project
+#
+# All text after a hash (#) is considered a comment and will be ignored
+# The format is:
+# TAG = value [value, ...]
+# For lists items can also be appended using:
+# TAG += value [value, ...]
+# Values that contain spaces should be placed between quotes (" ")
+
+#---------------------------------------------------------------------------
+# Project related configuration options
+#---------------------------------------------------------------------------
+
+# The PROJECT_NAME tag is a single word (or a sequence of words surrounded
+# by quotes) that should identify the project.
+
+PROJECT_NAME = Starlight
+
+# The PROJECT_NUMBER tag can be used to enter a project or revision number.
+# This could be handy for archiving the generated documentation or
+# if some version control system is used.
+
+PROJECT_NUMBER =
+
+# The OUTPUT_DIRECTORY tag is used to specify the (relative or absolute)
+# base path where the generated documentation will be put.
+# If a relative path is entered, it will be relative to the location
+# where doxygen was started. If left blank the current directory will be used.
+
+OUTPUT_DIRECTORY = doxygen
+
+# If the CREATE_SUBDIRS tag is set to YES, then doxygen will create
+# 4096 sub-directories (in 2 levels) under the output directory of each output
+# format and will distribute the generated files over these directories.
+# Enabling this option can be useful when feeding doxygen a huge amount of
+# source files, where putting all generated files in the same directory would
+# otherwise cause performance problems for the file system.
+
+CREATE_SUBDIRS = NO
+
+# The OUTPUT_LANGUAGE tag is used to specify the language in which all
+# documentation generated by doxygen is written. Doxygen will use this
+# information to generate all constant output in the proper language.
+# The default language is English, other supported languages are:
+# Afrikaans, Arabic, Brazilian, Catalan, Chinese, Chinese-Traditional,
+# Croatian, Czech, Danish, Dutch, Finnish, French, German, Greek, Hungarian,
+# Italian, Japanese, Japanese-en (Japanese with English messages), Korean,
+# Korean-en, Lithuanian, Norwegian, Polish, Portuguese, Romanian, Russian,
+# Serbian, Slovak, Slovene, Spanish, Swedish, and Ukrainian.
+
+OUTPUT_LANGUAGE = English
+
+# This tag can be used to specify the encoding used in the generated output.
+# The encoding is not always determined by the language that is chosen,
+# but also whether or not the output is meant for Windows or non-Windows users.
+# In case there is a difference, setting the USE_WINDOWS_ENCODING tag to YES
+# forces the Windows encoding (this is the default for the Windows binary),
+# whereas setting the tag to NO uses a Unix-style encoding (the default for
+# all platforms other than Windows).
+
+USE_WINDOWS_ENCODING = NO
+
+# If the BRIEF_MEMBER_DESC tag is set to YES (the default) Doxygen will
+# include brief member descriptions after the members that are listed in
+# the file and class documentation (similar to JavaDoc).
+# Set to NO to disable this.
+
+BRIEF_MEMBER_DESC = YES
+
+# If the REPEAT_BRIEF tag is set to YES (the default) Doxygen will prepend
+# the brief description of a member or function before the detailed description.
+# Note: if both HIDE_UNDOC_MEMBERS and BRIEF_MEMBER_DESC are set to NO, the
+# brief descriptions will be completely suppressed.
+
+REPEAT_BRIEF = YES
+
+# This tag implements a quasi-intelligent brief description abbreviator
+# that is used to form the text in various listings. Each string
+# in this list, if found as the leading text of the brief description, will be
+# stripped from the text and the result after processing the whole list, is
+# used as the annotated text. Otherwise, the brief description is used as-is.
+# If left blank, the following values are used ("$name" is automatically
+# replaced with the name of the entity): "The $name class" "The $name widget"
+# "The $name file" "is" "provides" "specifies" "contains"
+# "represents" "a" "an" "the"
+
+ABBREVIATE_BRIEF =
+
+# If the ALWAYS_DETAILED_SEC and REPEAT_BRIEF tags are both set to YES then
+# Doxygen will generate a detailed section even if there is only a brief
+# description.
+
+ALWAYS_DETAILED_SEC = NO
+
+# If the INLINE_INHERITED_MEMB tag is set to YES, doxygen will show all
+# inherited members of a class in the documentation of that class as if those
+# members were ordinary class members. Constructors, destructors and assignment
+# operators of the base classes will not be shown.
+
+INLINE_INHERITED_MEMB = YES
+
+# If the FULL_PATH_NAMES tag is set to YES then Doxygen will prepend the full
+# path before files name in the file list and in the header files. If set
+# to NO the shortest path that makes the file name unique will be used.
+
+FULL_PATH_NAMES = NO
+
+# If the FULL_PATH_NAMES tag is set to YES then the STRIP_FROM_PATH tag
+# can be used to strip a user-defined part of the path. Stripping is
+# only done if one of the specified strings matches the left-hand part of
+# the path. The tag can be used to show relative paths in the file list.
+# If left blank the directory from which doxygen is run is used as the
+# path to strip.
+
+STRIP_FROM_PATH =
+
+# The STRIP_FROM_INC_PATH tag can be used to strip a user-defined part of
+# the path mentioned in the documentation of a class, which tells
+# the reader which header file to include in order to use a class.
+# If left blank only the name of the header file containing the class
+# definition is used. Otherwise one should specify the include paths that
+# are normally passed to the compiler using the -I flag.
+
+STRIP_FROM_INC_PATH =
+
+# If the SHORT_NAMES tag is set to YES, doxygen will generate much shorter
+# (but less readable) file names. This can be useful is your file systems
+# doesn't support long names like on DOS, Mac, or CD-ROM.
+
+SHORT_NAMES = NO
+
+# If the JAVADOC_AUTOBRIEF tag is set to YES then Doxygen
+# will interpret the first line (until the first dot) of a JavaDoc-style
+# comment as the brief description. If set to NO, the JavaDoc
+# comments will behave just like the Qt-style comments (thus requiring an
+# explicit @brief command for a brief description.
+
+JAVADOC_AUTOBRIEF = NO
+
+# The MULTILINE_CPP_IS_BRIEF tag can be set to YES to make Doxygen
+# treat a multi-line C++ special comment block (i.e. a block of //! or ///
+# comments) as a brief description. This used to be the default behaviour.
+# The new default is to treat a multi-line C++ comment block as a detailed
+# description. Set this tag to YES if you prefer the old behaviour instead.
+
+MULTILINE_CPP_IS_BRIEF = NO
+
+# If the DETAILS_AT_TOP tag is set to YES then Doxygen
+# will output the detailed description near the top, like JavaDoc.
+# If set to NO, the detailed description appears after the member
+# documentation.
+
+DETAILS_AT_TOP = NO
+
+# If the INHERIT_DOCS tag is set to YES (the default) then an undocumented
+# member inherits the documentation from any documented member that it
+# re-implements.
+
+INHERIT_DOCS = YES
+
+# If the SEPARATE_MEMBER_PAGES tag is set to YES, then doxygen will produce
+# a new page for each member. If set to NO, the documentation of a member will
+# be part of the file/class/namespace that contains it.
+
+SEPARATE_MEMBER_PAGES = NO
+
+# The TAB_SIZE tag can be used to set the number of spaces in a tab.
+# Doxygen uses this value to replace tabs by spaces in code fragments.
+
+TAB_SIZE = 8
+
+# This tag can be used to specify a number of aliases that acts
+# as commands in the documentation. An alias has the form "name=value".
+# For example adding "sideeffect=\par Side Effects:\n" will allow you to
+# put the command \sideeffect (or @sideeffect) in the documentation, which
+# will result in a user-defined paragraph with heading "Side Effects:".
+# You can put \n's in the value part of an alias to insert newlines.
+
+ALIASES =
+
+# Set the OPTIMIZE_OUTPUT_FOR_C tag to YES if your project consists of C
+# sources only. Doxygen will then generate output that is more tailored for C.
+# For instance, some of the names that are used will be different. The list
+# of all members will be omitted, etc.
+
+OPTIMIZE_OUTPUT_FOR_C = NO
+
+# Set the OPTIMIZE_OUTPUT_JAVA tag to YES if your project consists of Java
+# sources only. Doxygen will then generate output that is more tailored for Java.
+# For instance, namespaces will be presented as packages, qualified scopes
+# will look different, etc.
+
+OPTIMIZE_OUTPUT_JAVA = NO
+
+# If you use STL classes (i.e. std::string, std::vector, etc.) but do not want to
+# include (a tag file for) the STL sources as input, then you should
+# set this tag to YES in order to let doxygen match functions declarations and
+# definitions whose arguments contain STL classes (e.g. func(std::string); v.s.
+# func(std::string) {}). This also make the inheritance and collaboration
+# diagrams that involve STL classes more complete and accurate.
+
+BUILTIN_STL_SUPPORT = YES
+
+# If member grouping is used in the documentation and the DISTRIBUTE_GROUP_DOC
+# tag is set to YES, then doxygen will reuse the documentation of the first
+# member in the group (if any) for the other members of the group. By default
+# all members of a group must be documented explicitly.
+
+DISTRIBUTE_GROUP_DOC = NO
+
+# Set the SUBGROUPING tag to YES (the default) to allow class member groups of
+# the same type (for instance a group of public functions) to be put as a
+# subgroup of that type (e.g. under the Public Functions section). Set it to
+# NO to prevent subgrouping. Alternatively, this can be done per class using
+# the \nosubgrouping command.
+
+SUBGROUPING = YES
+
+#---------------------------------------------------------------------------
+# Build related configuration options
+#---------------------------------------------------------------------------
+
+# If the EXTRACT_ALL tag is set to YES doxygen will assume all entities in
+# documentation are documented, even if no documentation was available.
+# Private class members and static file members will be hidden unless
+# the EXTRACT_PRIVATE and EXTRACT_STATIC tags are set to YES
+
+EXTRACT_ALL = YES
+
+# If the EXTRACT_PRIVATE tag is set to YES all private members of a class
+# will be included in the documentation.
+
+EXTRACT_PRIVATE = YES
+
+# If the EXTRACT_STATIC tag is set to YES all static members of a file
+# will be included in the documentation.
+
+EXTRACT_STATIC = YES
+
+# If the EXTRACT_LOCAL_CLASSES tag is set to YES classes (and structs)
+# defined locally in source files will be included in the documentation.
+# If set to NO only classes defined in header files are included.
+
+EXTRACT_LOCAL_CLASSES = YES
+
+# This flag is only useful for Objective-C code. When set to YES local
+# methods, which are defined in the implementation section but not in
+# the interface are included in the documentation.
+# If set to NO (the default) only methods in the interface are included.
+
+EXTRACT_LOCAL_METHODS = NO
+
+# If the HIDE_UNDOC_MEMBERS tag is set to YES, Doxygen will hide all
+# undocumented members of documented classes, files or namespaces.
+# If set to NO (the default) these members will be included in the
+# various overviews, but no documentation section is generated.
+# This option has no effect if EXTRACT_ALL is enabled.
+
+HIDE_UNDOC_MEMBERS = NO
+
+# If the HIDE_UNDOC_CLASSES tag is set to YES, Doxygen will hide all
+# undocumented classes that are normally visible in the class hierarchy.
+# If set to NO (the default) these classes will be included in the various
+# overviews. This option has no effect if EXTRACT_ALL is enabled.
+
+HIDE_UNDOC_CLASSES = NO
+
+# If the HIDE_FRIEND_COMPOUNDS tag is set to YES, Doxygen will hide all
+# friend (class|struct|union) declarations.
+# If set to NO (the default) these declarations will be included in the
+# documentation.
+
+HIDE_FRIEND_COMPOUNDS = NO
+
+# If the HIDE_IN_BODY_DOCS tag is set to YES, Doxygen will hide any
+# documentation blocks found inside the body of a function.
+# If set to NO (the default) these blocks will be appended to the
+# function's detailed documentation block.
+
+HIDE_IN_BODY_DOCS = NO
+
+# The INTERNAL_DOCS tag determines if documentation
+# that is typed after a \internal command is included. If the tag is set
+# to NO (the default) then the documentation will be excluded.
+# Set it to YES to include the internal documentation.
+
+INTERNAL_DOCS = NO
+
+# If the CASE_SENSE_NAMES tag is set to NO then Doxygen will only generate
+# file names in lower-case letters. If set to YES upper-case letters are also
+# allowed. This is useful if you have classes or files whose names only differ
+# in case and if your file system supports case sensitive file names. Windows
+# and Mac users are advised to set this option to NO.
+
+CASE_SENSE_NAMES = YES
+
+# If the HIDE_SCOPE_NAMES tag is set to NO (the default) then Doxygen
+# will show members with their full class and namespace scopes in the
+# documentation. If set to YES the scope will be hidden.
+
+HIDE_SCOPE_NAMES = NO
+
+# If the SHOW_INCLUDE_FILES tag is set to YES (the default) then Doxygen
+# will put a list of the files that are included by a file in the documentation
+# of that file.
+
+SHOW_INCLUDE_FILES = YES
+
+# If the INLINE_INFO tag is set to YES (the default) then a tag [inline]
+# is inserted in the documentation for inline members.
+
+INLINE_INFO = YES
+
+# If the SORT_MEMBER_DOCS tag is set to YES (the default) then doxygen
+# will sort the (detailed) documentation of file and class members
+# alphabetically by member name. If set to NO the members will appear in
+# declaration order.
+
+SORT_MEMBER_DOCS = YES
+
+# If the SORT_BRIEF_DOCS tag is set to YES then doxygen will sort the
+# brief documentation of file, namespace and class members alphabetically
+# by member name. If set to NO (the default) the members will appear in
+# declaration order.
+
+SORT_BRIEF_DOCS = NO
+
+# If the SORT_BY_SCOPE_NAME tag is set to YES, the class list will be
+# sorted by fully-qualified names, including namespaces. If set to
+# NO (the default), the class list will be sorted only by class name,
+# not including the namespace part.
+# Note: This option is not very useful if HIDE_SCOPE_NAMES is set to YES.
+# Note: This option applies only to the class list, not to the
+# alphabetical list.
+
+SORT_BY_SCOPE_NAME = NO
+
+# The GENERATE_TODOLIST tag can be used to enable (YES) or
+# disable (NO) the todo list. This list is created by putting \todo
+# commands in the documentation.
+
+GENERATE_TODOLIST = YES
+
+# The GENERATE_TESTLIST tag can be used to enable (YES) or
+# disable (NO) the test list. This list is created by putting \test
+# commands in the documentation.
+
+GENERATE_TESTLIST = YES
+
+# The GENERATE_BUGLIST tag can be used to enable (YES) or
+# disable (NO) the bug list. This list is created by putting \bug
+# commands in the documentation.
+
+GENERATE_BUGLIST = YES
+
+# The GENERATE_DEPRECATEDLIST tag can be used to enable (YES) or
+# disable (NO) the deprecated list. This list is created by putting
+# \deprecated commands in the documentation.
+
+GENERATE_DEPRECATEDLIST= YES
+
+# The ENABLED_SECTIONS tag can be used to enable conditional
+# documentation sections, marked by \if sectionname ... \endif.
+
+ENABLED_SECTIONS =
+
+# The MAX_INITIALIZER_LINES tag determines the maximum number of lines
+# the initial value of a variable or define consists of for it to appear in
+# the documentation. If the initializer consists of more lines than specified
+# here it will be hidden. Use a value of 0 to hide initializers completely.
+# The appearance of the initializer of individual variables and defines in the
+# documentation can be controlled using \showinitializer or \hideinitializer
+# command in the documentation regardless of this setting.
+
+MAX_INITIALIZER_LINES = 30
+
+# Set the SHOW_USED_FILES tag to NO to disable the list of files generated
+# at the bottom of the documentation of classes and structs. If set to YES the
+# list will mention the files that were used to generate the documentation.
+
+SHOW_USED_FILES = YES
+
+# If the sources in your project are distributed over multiple directories
+# then setting the SHOW_DIRECTORIES tag to YES will show the directory hierarchy
+# in the documentation. The default is NO.
+
+SHOW_DIRECTORIES = NO
+
+# The FILE_VERSION_FILTER tag can be used to specify a program or script that
+# doxygen should invoke to get the current version for each file (typically from the
+# version control system). Doxygen will invoke the program by executing (via
+# popen()) the command <command> <input-file>, where <command> is the value of
+# the FILE_VERSION_FILTER tag, and <input-file> is the name of an input file
+# provided by doxygen. Whatever the program writes to standard output
+# is used as the file version. See the manual for examples.
+
+FILE_VERSION_FILTER =
+
+#---------------------------------------------------------------------------
+# configuration options related to warning and progress messages
+#---------------------------------------------------------------------------
+
+# The QUIET tag can be used to turn on/off the messages that are generated
+# by doxygen. Possible values are YES and NO. If left blank NO is used.
+
+QUIET = NO
+
+# The WARNINGS tag can be used to turn on/off the warning messages that are
+# generated by doxygen. Possible values are YES and NO. If left blank
+# NO is used.
+
+WARNINGS = YES
+
+# If WARN_IF_UNDOCUMENTED is set to YES, then doxygen will generate warnings
+# for undocumented members. If EXTRACT_ALL is set to YES then this flag will
+# automatically be disabled.
+
+WARN_IF_UNDOCUMENTED = YES
+
+# If WARN_IF_DOC_ERROR is set to YES, doxygen will generate warnings for
+# potential errors in the documentation, such as not documenting some
+# parameters in a documented function, or documenting parameters that
+# don't exist or using markup commands wrongly.
+
+WARN_IF_DOC_ERROR = YES
+
+# This WARN_NO_PARAMDOC option can be abled to get warnings for
+# functions that are documented, but have no documentation for their parameters
+# or return value. If set to NO (the default) doxygen will only warn about
+# wrong or incomplete parameter documentation, but not about the absence of
+# documentation.
+
+WARN_NO_PARAMDOC = NO
+
+# The WARN_FORMAT tag determines the format of the warning messages that
+# doxygen can produce. The string should contain the $file, $line, and $text
+# tags, which will be replaced by the file and line number from which the
+# warning originated and the warning text. Optionally the format may contain
+# $version, which will be replaced by the version of the file (if it could
+# be obtained via FILE_VERSION_FILTER)
+
+WARN_FORMAT = "$file:$line: $text"
+
+# The WARN_LOGFILE tag can be used to specify a file to which warning
+# and error messages should be written. If left blank the output is written
+# to stderr.
+
+WARN_LOGFILE =
+
+#---------------------------------------------------------------------------
+# configuration options related to the input files
+#---------------------------------------------------------------------------
+
+# The INPUT tag can be used to specify the files and/or directories that contain
+# documented source files. You may enter file names like "myfile.cpp" or
+# directories like "/usr/src/myproject". Separate the files or directories
+# with spaces.
+
+INPUT = ./include ./src
+
+# If the value of the INPUT tag contains directories, you can use the
+# FILE_PATTERNS tag to specify one or more wildcard pattern (like *.cpp
+# and *.h) to filter out the source-files in the directories. If left
+# blank the following patterns are tested:
+# *.c *.cc *.cxx *.cpp *.c++ *.java *.ii *.ixx *.ipp *.i++ *.inl *.h *.hh *.hxx
+# *.hpp *.h++ *.idl *.odl *.cs *.php *.php3 *.inc *.m *.mm *.py
+
+FILE_PATTERNS = *.cpp \
+ *.h \
+ *.C \
+ *.sh
+
+# The RECURSIVE tag can be used to turn specify whether or not subdirectories
+# should be searched for input files as well. Possible values are YES and NO.
+# If left blank NO is used.
+
+RECURSIVE = YES
+
+# The EXCLUDE tag can be used to specify files and/or directories that should
+# excluded from the INPUT source files. This way you can easily exclude a
+# subdirectory from a directory tree whose root is specified with the INPUT tag.
+
+EXCLUDE =
+
+# The EXCLUDE_SYMLINKS tag can be used select whether or not files or
+# directories that are symbolic links (a Unix filesystem feature) are excluded
+# from the input.
+
+EXCLUDE_SYMLINKS = NO
+
+# If the value of the INPUT tag contains directories, you can use the
+# EXCLUDE_PATTERNS tag to specify one or more wildcard patterns to exclude
+# certain files from those directories. Note that the wildcards are matched
+# against the file with absolute path, so to exclude all test directories
+# for example use the pattern */test/*
+
+EXCLUDE_PATTERNS =
+
+# The EXAMPLE_PATH tag can be used to specify one or more files or
+# directories that contain example code fragments that are included (see
+# the \include command).
+
+EXAMPLE_PATH =
+
+# If the value of the EXAMPLE_PATH tag contains directories, you can use the
+# EXAMPLE_PATTERNS tag to specify one or more wildcard pattern (like *.cpp
+# and *.h) to filter out the source-files in the directories. If left
+# blank all files are included.
+
+EXAMPLE_PATTERNS =
+
+# If the EXAMPLE_RECURSIVE tag is set to YES then subdirectories will be
+# searched for input files to be used with the \include or \dontinclude
+# commands irrespective of the value of the RECURSIVE tag.
+# Possible values are YES and NO. If left blank NO is used.
+
+EXAMPLE_RECURSIVE = YES
+
+# The IMAGE_PATH tag can be used to specify one or more files or
+# directories that contain image that are included in the documentation (see
+# the \image command).
+
+IMAGE_PATH =
+
+# The INPUT_FILTER tag can be used to specify a program that doxygen should
+# invoke to filter for each input file. Doxygen will invoke the filter program
+# by executing (via popen()) the command <filter> <input-file>, where <filter>
+# is the value of the INPUT_FILTER tag, and <input-file> is the name of an
+# input file. Doxygen will then use the output that the filter program writes
+# to standard output. If FILTER_PATTERNS is specified, this tag will be
+# ignored.
+
+INPUT_FILTER =
+
+# The FILTER_PATTERNS tag can be used to specify filters on a per file pattern
+# basis. Doxygen will compare the file name with each pattern and apply the
+# filter if there is a match. The filters are a list of the form:
+# pattern=filter (like *.cpp=my_cpp_filter). See INPUT_FILTER for further
+# info on how filters are used. If FILTER_PATTERNS is empty, INPUT_FILTER
+# is applied to all files.
+
+FILTER_PATTERNS =
+
+# If the FILTER_SOURCE_FILES tag is set to YES, the input filter (if set using
+# INPUT_FILTER) will be used to filter the input files when producing source
+# files to browse (i.e. when SOURCE_BROWSER is set to YES).
+
+FILTER_SOURCE_FILES = NO
+
+#---------------------------------------------------------------------------
+# configuration options related to source browsing
+#---------------------------------------------------------------------------
+
+# If the SOURCE_BROWSER tag is set to YES then a list of source files will
+# be generated. Documented entities will be cross-referenced with these sources.
+# Note: To get rid of all source code in the generated output, make sure also
+# VERBATIM_HEADERS is set to NO.
+
+SOURCE_BROWSER = YES
+
+# Setting the INLINE_SOURCES tag to YES will include the body
+# of functions and classes directly in the documentation.
+
+INLINE_SOURCES = NO
+
+# Setting the STRIP_CODE_COMMENTS tag to YES (the default) will instruct
+# doxygen to hide any special comment blocks from generated source code
+# fragments. Normal C and C++ comments will always remain visible.
+
+STRIP_CODE_COMMENTS = YES
+
+# If the REFERENCED_BY_RELATION tag is set to YES (the default)
+# then for each documented function all documented
+# functions referencing it will be listed.
+
+REFERENCED_BY_RELATION = YES
+
+# If the REFERENCES_RELATION tag is set to YES (the default)
+# then for each documented function all documented entities
+# called/used by that function will be listed.
+
+REFERENCES_RELATION = YES
+
+# If the REFERENCES_LINK_SOURCE tag is set to YES (the default)
+# and SOURCE_BROWSER tag is set to YES, then the hyperlinks from
+# functions in REFERENCES_RELATION and REFERENCED_BY_RELATION lists will
+# link to the source code. Otherwise they will link to the documentstion.
+
+REFERENCES_LINK_SOURCE = YES
+
+# If the USE_HTAGS tag is set to YES then the references to source code
+# will point to the HTML generated by the htags(1) tool instead of doxygen
+# built-in source browser. The htags tool is part of GNU's global source
+# tagging system (see http://www.gnu.org/software/global/global.html). You
+# will need version 4.8.6 or higher.
+
+USE_HTAGS = NO
+
+# If the VERBATIM_HEADERS tag is set to YES (the default) then Doxygen
+# will generate a verbatim copy of the header file for each class for
+# which an include is specified. Set to NO to disable this.
+
+VERBATIM_HEADERS = YES
+
+#---------------------------------------------------------------------------
+# configuration options related to the alphabetical class index
+#---------------------------------------------------------------------------
+
+# If the ALPHABETICAL_INDEX tag is set to YES, an alphabetical index
+# of all compounds will be generated. Enable this if the project
+# contains a lot of classes, structs, unions or interfaces.
+
+ALPHABETICAL_INDEX = YES
+
+# If the alphabetical index is enabled (see ALPHABETICAL_INDEX) then
+# the COLS_IN_ALPHA_INDEX tag can be used to specify the number of columns
+# in which this list will be split (can be a number in the range [1..20])
+
+COLS_IN_ALPHA_INDEX = 5
+
+# In case all classes in a project start with a common prefix, all
+# classes will be put under the same header in the alphabetical index.
+# The IGNORE_PREFIX tag can be used to specify one or more prefixes that
+# should be ignored while generating the index headers.
+
+IGNORE_PREFIX =
+
+#---------------------------------------------------------------------------
+# configuration options related to the HTML output
+#---------------------------------------------------------------------------
+
+# If the GENERATE_HTML tag is set to YES (the default) Doxygen will
+# generate HTML output.
+
+GENERATE_HTML = YES
+
+# The HTML_OUTPUT tag is used to specify where the HTML docs will be put.
+# If a relative path is entered the value of OUTPUT_DIRECTORY will be
+# put in front of it. If left blank `html' will be used as the default path.
+
+HTML_OUTPUT = html
+
+# The HTML_FILE_EXTENSION tag can be used to specify the file extension for
+# each generated HTML page (for example: .htm,.php,.asp). If it is left blank
+# doxygen will generate files with .html extension.
+
+HTML_FILE_EXTENSION = .html
+
+# The HTML_HEADER tag can be used to specify a personal HTML header for
+# each generated HTML page. If it is left blank doxygen will generate a
+# standard header.
+
+HTML_HEADER =
+
+# The HTML_FOOTER tag can be used to specify a personal HTML footer for
+# each generated HTML page. If it is left blank doxygen will generate a
+# standard footer.
+
+HTML_FOOTER =
+
+# The HTML_STYLESHEET tag can be used to specify a user-defined cascading
+# style sheet that is used by each HTML page. It can be used to
+# fine-tune the look of the HTML output. If the tag is left blank doxygen
+# will generate a default style sheet. Note that doxygen will try to copy
+# the style sheet file to the HTML output directory, so don't put your own
+# stylesheet in the HTML output directory as well, or it will be erased!
+
+HTML_STYLESHEET =
+
+# If the HTML_ALIGN_MEMBERS tag is set to YES, the members of classes,
+# files or namespaces will be aligned in HTML using tables. If set to
+# NO a bullet list will be used.
+
+HTML_ALIGN_MEMBERS = YES
+
+# If the GENERATE_HTMLHELP tag is set to YES, additional index files
+# will be generated that can be used as input for tools like the
+# Microsoft HTML help workshop to generate a compressed HTML help file (.chm)
+# of the generated HTML documentation.
+
+GENERATE_HTMLHELP = NO
+
+# If the GENERATE_HTMLHELP tag is set to YES, the CHM_FILE tag can
+# be used to specify the file name of the resulting .chm file. You
+# can add a path in front of the file if the result should not be
+# written to the html output directory.
+
+CHM_FILE =
+
+# If the GENERATE_HTMLHELP tag is set to YES, the HHC_LOCATION tag can
+# be used to specify the location (absolute path including file name) of
+# the HTML help compiler (hhc.exe). If non-empty doxygen will try to run
+# the HTML help compiler on the generated index.hhp.
+
+HHC_LOCATION =
+
+# If the GENERATE_HTMLHELP tag is set to YES, the GENERATE_CHI flag
+# controls if a separate .chi index file is generated (YES) or that
+# it should be included in the master .chm file (NO).
+
+GENERATE_CHI = NO
+
+# If the GENERATE_HTMLHELP tag is set to YES, the BINARY_TOC flag
+# controls whether a binary table of contents is generated (YES) or a
+# normal table of contents (NO) in the .chm file.
+
+BINARY_TOC = NO
+
+# The TOC_EXPAND flag can be set to YES to add extra items for group members
+# to the contents of the HTML help documentation and to the tree view.
+
+TOC_EXPAND = NO
+
+# The DISABLE_INDEX tag can be used to turn on/off the condensed index at
+# top of each HTML page. The value NO (the default) enables the index and
+# the value YES disables it.
+
+DISABLE_INDEX = NO
+
+# This tag can be used to set the number of enum values (range [1..20])
+# that doxygen will group on one line in the generated HTML documentation.
+
+ENUM_VALUES_PER_LINE = 4
+
+# If the GENERATE_TREEVIEW tag is set to YES, a side panel will be
+# generated containing a tree-like index structure (just like the one that
+# is generated for HTML Help). For this to work a browser that supports
+# JavaScript, DHTML, CSS and frames is required (for instance Mozilla 1.0+,
+# Netscape 6.0+, Internet explorer 5.0+, or Konqueror). Windows users are
+# probably better off using the HTML help feature.
+
+GENERATE_TREEVIEW = NO
+
+# If the treeview is enabled (see GENERATE_TREEVIEW) then this tag can be
+# used to set the initial width (in pixels) of the frame in which the tree
+# is shown.
+
+TREEVIEW_WIDTH = 250
+
+#---------------------------------------------------------------------------
+# configuration options related to the LaTeX output
+#---------------------------------------------------------------------------
+
+# If the GENERATE_LATEX tag is set to YES (the default) Doxygen will
+# generate Latex output.
+
+GENERATE_LATEX = NO
+
+# The LATEX_OUTPUT tag is used to specify where the LaTeX docs will be put.
+# If a relative path is entered the value of OUTPUT_DIRECTORY will be
+# put in front of it. If left blank `latex' will be used as the default path.
+
+LATEX_OUTPUT = latex
+
+# The LATEX_CMD_NAME tag can be used to specify the LaTeX command name to be
+# invoked. If left blank `latex' will be used as the default command name.
+
+LATEX_CMD_NAME = latex
+
+# The MAKEINDEX_CMD_NAME tag can be used to specify the command name to
+# generate index for LaTeX. If left blank `makeindex' will be used as the
+# default command name.
+
+MAKEINDEX_CMD_NAME = makeindex
+
+# If the COMPACT_LATEX tag is set to YES Doxygen generates more compact
+# LaTeX documents. This may be useful for small projects and may help to
+# save some trees in general.
+
+COMPACT_LATEX = NO
+
+# The PAPER_TYPE tag can be used to set the paper type that is used
+# by the printer. Possible values are: a4, a4wide, letter, legal and
+# executive. If left blank a4wide will be used.
+
+PAPER_TYPE = a4wide
+
+# The EXTRA_PACKAGES tag can be to specify one or more names of LaTeX
+# packages that should be included in the LaTeX output.
+
+EXTRA_PACKAGES =
+
+# The LATEX_HEADER tag can be used to specify a personal LaTeX header for
+# the generated latex document. The header should contain everything until
+# the first chapter. If it is left blank doxygen will generate a
+# standard header. Notice: only use this tag if you know what you are doing!
+
+LATEX_HEADER =
+
+# If the PDF_HYPERLINKS tag is set to YES, the LaTeX that is generated
+# is prepared for conversion to pdf (using ps2pdf). The pdf file will
+# contain links (just like the HTML output) instead of page references
+# This makes the output suitable for online browsing using a pdf viewer.
+
+PDF_HYPERLINKS = NO
+
+# If the USE_PDFLATEX tag is set to YES, pdflatex will be used instead of
+# plain latex in the generated Makefile. Set this option to YES to get a
+# higher quality PDF documentation.
+
+USE_PDFLATEX = NO
+
+# If the LATEX_BATCHMODE tag is set to YES, doxygen will add the \\batchmode.
+# command to the generated LaTeX files. This will instruct LaTeX to keep
+# running if errors occur, instead of asking the user for help.
+# This option is also used when generating formulas in HTML.
+
+LATEX_BATCHMODE = NO
+
+# If LATEX_HIDE_INDICES is set to YES then doxygen will not
+# include the index chapters (such as File Index, Compound Index, etc.)
+# in the output.
+
+LATEX_HIDE_INDICES = NO
+
+#---------------------------------------------------------------------------
+# configuration options related to the RTF output
+#---------------------------------------------------------------------------
+
+# If the GENERATE_RTF tag is set to YES Doxygen will generate RTF output
+# The RTF output is optimized for Word 97 and may not look very pretty with
+# other RTF readers or editors.
+
+GENERATE_RTF = NO
+
+# The RTF_OUTPUT tag is used to specify where the RTF docs will be put.
+# If a relative path is entered the value of OUTPUT_DIRECTORY will be
+# put in front of it. If left blank `rtf' will be used as the default path.
+
+RTF_OUTPUT = rtf
+
+# If the COMPACT_RTF tag is set to YES Doxygen generates more compact
+# RTF documents. This may be useful for small projects and may help to
+# save some trees in general.
+
+COMPACT_RTF = NO
+
+# If the RTF_HYPERLINKS tag is set to YES, the RTF that is generated
+# will contain hyperlink fields. The RTF file will
+# contain links (just like the HTML output) instead of page references.
+# This makes the output suitable for online browsing using WORD or other
+# programs which support those fields.
+# Note: wordpad (write) and others do not support links.
+
+RTF_HYPERLINKS = NO
+
+# Load stylesheet definitions from file. Syntax is similar to doxygen's
+# config file, i.e. a series of assignments. You only have to provide
+# replacements, missing definitions are set to their default value.
+
+RTF_STYLESHEET_FILE =
+
+# Set optional variables used in the generation of an rtf document.
+# Syntax is similar to doxygen's config file.
+
+RTF_EXTENSIONS_FILE =
+
+#---------------------------------------------------------------------------
+# configuration options related to the man page output
+#---------------------------------------------------------------------------
+
+# If the GENERATE_MAN tag is set to YES (the default) Doxygen will
+# generate man pages
+
+GENERATE_MAN = NO
+
+# The MAN_OUTPUT tag is used to specify where the man pages will be put.
+# If a relative path is entered the value of OUTPUT_DIRECTORY will be
+# put in front of it. If left blank `man' will be used as the default path.
+
+MAN_OUTPUT = man
+
+# The MAN_EXTENSION tag determines the extension that is added to
+# the generated man pages (default is the subroutine's section .3)
+
+MAN_EXTENSION = .3
+
+# If the MAN_LINKS tag is set to YES and Doxygen generates man output,
+# then it will generate one additional man file for each entity
+# documented in the real man page(s). These additional files
+# only source the real man page, but without them the man command
+# would be unable to find the correct page. The default is NO.
+
+MAN_LINKS = NO
+
+#---------------------------------------------------------------------------
+# configuration options related to the XML output
+#---------------------------------------------------------------------------
+
+# If the GENERATE_XML tag is set to YES Doxygen will
+# generate an XML file that captures the structure of
+# the code including all documentation.
+
+GENERATE_XML = NO
+
+# The XML_OUTPUT tag is used to specify where the XML pages will be put.
+# If a relative path is entered the value of OUTPUT_DIRECTORY will be
+# put in front of it. If left blank `xml' will be used as the default path.
+
+XML_OUTPUT = xml
+
+# The XML_SCHEMA tag can be used to specify an XML schema,
+# which can be used by a validating XML parser to check the
+# syntax of the XML files.
+
+XML_SCHEMA =
+
+# The XML_DTD tag can be used to specify an XML DTD,
+# which can be used by a validating XML parser to check the
+# syntax of the XML files.
+
+XML_DTD =
+
+# If the XML_PROGRAMLISTING tag is set to YES Doxygen will
+# dump the program listings (including syntax highlighting
+# and cross-referencing information) to the XML output. Note that
+# enabling this will significantly increase the size of the XML output.
+
+XML_PROGRAMLISTING = YES
+
+#---------------------------------------------------------------------------
+# configuration options for the AutoGen Definitions output
+#---------------------------------------------------------------------------
+
+# If the GENERATE_AUTOGEN_DEF tag is set to YES Doxygen will
+# generate an AutoGen Definitions (see autogen.sf.net) file
+# that captures the structure of the code including all
+# documentation. Note that this feature is still experimental
+# and incomplete at the moment.
+
+GENERATE_AUTOGEN_DEF = NO
+
+#---------------------------------------------------------------------------
+# configuration options related to the Perl module output
+#---------------------------------------------------------------------------
+
+# If the GENERATE_PERLMOD tag is set to YES Doxygen will
+# generate a Perl module file that captures the structure of
+# the code including all documentation. Note that this
+# feature is still experimental and incomplete at the
+# moment.
+
+GENERATE_PERLMOD = NO
+
+# If the PERLMOD_LATEX tag is set to YES Doxygen will generate
+# the necessary Makefile rules, Perl scripts and LaTeX code to be able
+# to generate PDF and DVI output from the Perl module output.
+
+PERLMOD_LATEX = NO
+
+# If the PERLMOD_PRETTY tag is set to YES the Perl module output will be
+# nicely formatted so it can be parsed by a human reader. This is useful
+# if you want to understand what is going on. On the other hand, if this
+# tag is set to NO the size of the Perl module output will be much smaller
+# and Perl will parse it just the same.
+
+PERLMOD_PRETTY = YES
+
+# The names of the make variables in the generated doxyrules.make file
+# are prefixed with the string contained in PERLMOD_MAKEVAR_PREFIX.
+# This is useful so different doxyrules.make files included by the same
+# Makefile don't overwrite each other's variables.
+
+PERLMOD_MAKEVAR_PREFIX =
+
+#---------------------------------------------------------------------------
+# Configuration options related to the preprocessor
+#---------------------------------------------------------------------------
+
+# If the ENABLE_PREPROCESSING tag is set to YES (the default) Doxygen will
+# evaluate all C-preprocessor directives found in the sources and include
+# files.
+
+ENABLE_PREPROCESSING = YES
+
+# If the MACRO_EXPANSION tag is set to YES Doxygen will expand all macro
+# names in the source code. If set to NO (the default) only conditional
+# compilation will be performed. Macro expansion can be done in a controlled
+# way by setting EXPAND_ONLY_PREDEF to YES.
+
+MACRO_EXPANSION = NO
+
+# If the EXPAND_ONLY_PREDEF and MACRO_EXPANSION tags are both set to YES
+# then the macro expansion is limited to the macros specified with the
+# PREDEFINED and EXPAND_AS_DEFINED tags.
+
+EXPAND_ONLY_PREDEF = NO
+
+# If the SEARCH_INCLUDES tag is set to YES (the default) the includes files
+# in the INCLUDE_PATH (see below) will be search if a #include is found.
+
+SEARCH_INCLUDES = YES
+
+# The INCLUDE_PATH tag can be used to specify one or more directories that
+# contain include files that are not input files but should be processed by
+# the preprocessor.
+
+INCLUDE_PATH =
+
+# You can use the INCLUDE_FILE_PATTERNS tag to specify one or more wildcard
+# patterns (like *.h and *.hpp) to filter out the header-files in the
+# directories. If left blank, the patterns specified with FILE_PATTERNS will
+# be used.
+
+INCLUDE_FILE_PATTERNS =
+
+# The PREDEFINED tag can be used to specify one or more macro names that
+# are defined before the preprocessor is started (similar to the -D option of
+# gcc). The argument of the tag is a list of macros of the form: name
+# or name=definition (no spaces). If the definition and the = are
+# omitted =1 is assumed. To prevent a macro definition from being
+# undefined via #undef or recursively expanded use the := operator
+# instead of the = operator.
+
+PREDEFINED =
+
+# If the MACRO_EXPANSION and EXPAND_ONLY_PREDEF tags are set to YES then
+# this tag can be used to specify a list of macro names that should be expanded.
+# The macro definition that is found in the sources will be used.
+# Use the PREDEFINED tag if you want to use a different macro definition.
+
+EXPAND_AS_DEFINED =
+
+# If the SKIP_FUNCTION_MACROS tag is set to YES (the default) then
+# doxygen's preprocessor will remove all function-like macros that are alone
+# on a line, have an all uppercase name, and do not end with a semicolon. Such
+# function macros are typically used for boiler-plate code, and will confuse
+# the parser if not removed.
+
+SKIP_FUNCTION_MACROS = YES
+
+#---------------------------------------------------------------------------
+# Configuration::additions related to external references
+#---------------------------------------------------------------------------
+
+# The TAGFILES option can be used to specify one or more tagfiles.
+# Optionally an initial location of the external documentation
+# can be added for each tagfile. The format of a tag file without
+# this location is as follows:
+# TAGFILES = file1 file2 ...
+# Adding location for the tag files is done as follows:
+# TAGFILES = file1=loc1 "file2 = loc2" ...
+# where "loc1" and "loc2" can be relative or absolute paths or
+# URLs. If a location is present for each tag, the installdox tool
+# does not have to be run to correct the links.
+# Note that each tag file must have a unique name
+# (where the name does NOT include the path)
+# If a tag file is not located in the directory in which doxygen
+# is run, you must also specify the path to the tagfile here.
+
+TAGFILES =
+
+# When a file name is specified after GENERATE_TAGFILE, doxygen will create
+# a tag file that is based on the input files it reads.
+
+GENERATE_TAGFILE =
+
+# If the ALLEXTERNALS tag is set to YES all external classes will be listed
+# in the class index. If set to NO only the inherited external classes
+# will be listed.
+
+ALLEXTERNALS = NO
+
+# If the EXTERNAL_GROUPS tag is set to YES all external groups will be listed
+# in the modules index. If set to NO, only the current project's groups will
+# be listed.
+
+EXTERNAL_GROUPS = YES
+
+# The PERL_PATH should be the absolute path and name of the perl script
+# interpreter (i.e. the result of `which perl').
+
+PERL_PATH = /usr/bin/perl
+
+#---------------------------------------------------------------------------
+# Configuration options related to the dot tool
+#---------------------------------------------------------------------------
+
+# If the CLASS_DIAGRAMS tag is set to YES (the default) Doxygen will
+# generate a inheritance diagram (in HTML, RTF and LaTeX) for classes with base
+# or super classes. Setting the tag to NO turns the diagrams off. Note that
+# this option is superseded by the HAVE_DOT option below. This is only a
+# fallback. It is recommended to install and use dot, since it yields more
+# powerful graphs.
+
+CLASS_DIAGRAMS = YES
+
+# If set to YES, the inheritance and collaboration graphs will hide
+# inheritance and usage relations if the target is undocumented
+# or is not a class.
+
+HIDE_UNDOC_RELATIONS = YES
+
+# If you set the HAVE_DOT tag to YES then doxygen will assume the dot tool is
+# available from the path. This tool is part of Graphviz, a graph visualization
+# toolkit from AT&T and Lucent Bell Labs. The other options in this section
+# have no effect if this option is set to NO (the default)
+
+HAVE_DOT = NO
+
+# If the CLASS_GRAPH and HAVE_DOT tags are set to YES then doxygen
+# will generate a graph for each documented class showing the direct and
+# indirect inheritance relations. Setting this tag to YES will force the
+# the CLASS_DIAGRAMS tag to NO.
+
+CLASS_GRAPH = YES
+
+# If the COLLABORATION_GRAPH and HAVE_DOT tags are set to YES then doxygen
+# will generate a graph for each documented class showing the direct and
+# indirect implementation dependencies (inheritance, containment, and
+# class references variables) of the class with other documented classes.
+
+COLLABORATION_GRAPH = YES
+
+# If the GROUP_GRAPHS and HAVE_DOT tags are set to YES then doxygen
+# will generate a graph for groups, showing the direct groups dependencies
+
+GROUP_GRAPHS = YES
+
+# If the UML_LOOK tag is set to YES doxygen will generate inheritance and
+# collaboration diagrams in a style similar to the OMG's Unified Modeling
+# Language.
+
+UML_LOOK = NO
+
+# If set to YES, the inheritance and collaboration graphs will show the
+# relations between templates and their instances.
+
+TEMPLATE_RELATIONS = YES
+
+# If the ENABLE_PREPROCESSING, SEARCH_INCLUDES, INCLUDE_GRAPH, and HAVE_DOT
+# tags are set to YES then doxygen will generate a graph for each documented
+# file showing the direct and indirect include dependencies of the file with
+# other documented files.
+
+INCLUDE_GRAPH = YES
+
+# If the ENABLE_PREPROCESSING, SEARCH_INCLUDES, INCLUDED_BY_GRAPH, and
+# HAVE_DOT tags are set to YES then doxygen will generate a graph for each
+# documented header file showing the documented files that directly or
+# indirectly include this file.
+
+INCLUDED_BY_GRAPH = YES
+
+# If the CALL_GRAPH and HAVE_DOT tags are set to YES then doxygen will
+# generate a call dependency graph for every global function or class method.
+# Note that enabling this option will significantly increase the time of a run.
+# So in most cases it will be better to enable call graphs for selected
+# functions only using the \callgraph command.
+
+CALL_GRAPH = NO
+
+# If the CALLER_GRAPH and HAVE_DOT tags are set to YES then doxygen will
+# generate a caller dependency graph for every global function or class method.
+# Note that enabling this option will significantly increase the time of a run.
+# So in most cases it will be better to enable caller graphs for selected
+# functions only using the \callergraph command.
+
+CALLER_GRAPH = NO
+
+# If the GRAPHICAL_HIERARCHY and HAVE_DOT tags are set to YES then doxygen
+# will graphical hierarchy of all classes instead of a textual one.
+
+GRAPHICAL_HIERARCHY = YES
+
+# If the DIRECTORY_GRAPH, SHOW_DIRECTORIES and HAVE_DOT tags are set to YES
+# then doxygen will show the dependencies a directory has on other directories
+# in a graphical way. The dependency relations are determined by the #include
+# relations between the files in the directories.
+
+DIRECTORY_GRAPH = YES
+
+# The DOT_IMAGE_FORMAT tag can be used to set the image format of the images
+# generated by dot. Possible values are png, jpg, or gif
+# If left blank png will be used.
+
+DOT_IMAGE_FORMAT = png
+
+# The tag DOT_PATH can be used to specify the path where the dot tool can be
+# found. If left blank, it is assumed the dot tool can be found in the path.
+
+DOT_PATH =
+
+# The DOTFILE_DIRS tag can be used to specify one or more directories that
+# contain dot files that are included in the documentation (see the
+# \dotfile command).
+
+DOTFILE_DIRS =
+
+# The MAX_DOT_GRAPH_WIDTH tag can be used to set the maximum allowed width
+# (in pixels) of the graphs generated by dot. If a graph becomes larger than
+# this value, doxygen will try to truncate the graph, so that it fits within
+# the specified constraint. Beware that most browsers cannot cope with very
+# large images.
+
+MAX_DOT_GRAPH_WIDTH = 1024
+
+# The MAX_DOT_GRAPH_HEIGHT tag can be used to set the maximum allows height
+# (in pixels) of the graphs generated by dot. If a graph becomes larger than
+# this value, doxygen will try to truncate the graph, so that it fits within
+# the specified constraint. Beware that most browsers cannot cope with very
+# large images.
+
+MAX_DOT_GRAPH_HEIGHT = 1024
+
+# The MAX_DOT_GRAPH_DEPTH tag can be used to set the maximum depth of the
+# graphs generated by dot. A depth value of 3 means that only nodes reachable
+# from the root by following a path via at most 3 edges will be shown. Nodes
+# that lay further from the root node will be omitted. Note that setting this
+# option to 1 or 2 may greatly reduce the computation time needed for large
+# code bases. Also note that a graph may be further truncated if the graph's
+# image dimensions are not sufficient to fit the graph (see MAX_DOT_GRAPH_WIDTH
+# and MAX_DOT_GRAPH_HEIGHT). If 0 is used for the depth value (the default),
+# the graph is not depth-constrained.
+
+MAX_DOT_GRAPH_DEPTH = 0
+
+# Set the DOT_TRANSPARENT tag to YES to generate images with a transparent
+# background. This is disabled by default, which results in a white background.
+# Warning: Depending on the platform used, enabling this option may lead to
+# badly anti-aliased labels on the edges of a graph (i.e. they become hard to
+# read).
+
+DOT_TRANSPARENT = NO
+
+# Set the DOT_MULTI_TARGETS tag to YES allow dot to generate multiple output
+# files in one run (i.e. multiple -o and -T options on the command line). This
+# makes dot run faster, but since only newer versions of dot (>1.8.10)
+# support this, this feature is disabled by default.
+
+DOT_MULTI_TARGETS = NO
+
+# If the GENERATE_LEGEND tag is set to YES (the default) Doxygen will
+# generate a legend page explaining the meaning of the various boxes and
+# arrows in the dot generated graphs.
+
+GENERATE_LEGEND = YES
+
+# If the DOT_CLEANUP tag is set to YES (the default) Doxygen will
+# remove the intermediate dot files that are used to generate
+# the various graphs.
+
+DOT_CLEANUP = YES
+
+#---------------------------------------------------------------------------
+# Configuration::additions related to the search engine
+#---------------------------------------------------------------------------
+
+# The SEARCHENGINE tag specifies whether or not a search engine should be
+# used. If set to NO the values of all tags below this one will be ignored.
+
+SEARCHENGINE = NO

File Metadata

Mime Type
text/x-diff
Expires
Tue, Nov 19, 8:04 PM (1 d, 5 h)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
3805967
Default Alt Text
(637 KB)

Event Timeline