// ------------------------------------------------------------------------- // ----- PndDpmDirect source file ----- // ----- ----- // ------------------------------------------------------------------------- #include #include "TClonesArray.h" #include "TFile.h" #include "TLorentzVector.h" #include "TTree.h" #include "TVector3.h" #include "TParticle.h" #include "PndDpmDirect.h" #include "FairPrimaryGenerator.h" #include "TRandom.h" using namespace std; #include "cfortran.h" extern "C" { // COMMON /LUJETS/ N,K(1000,2),P(1000,5) // n - number of produced particles, // k[] - Pythia particle identifiers // p[] - kinematical characteristics of particles typedef struct { int n, k[2000]; float p[5000]; } lujets; #define LUJETS COMMON_BLOCK(LUJETS,lujets) COMMON_BLOCK_DEF(lujets,LUJETS); } extern "C" int init1_(float* Plab, double* seed, float* Elastic, float* tetmin );//install DPM extern "C" int dpm_gen__(float* Generator, double* seed ); //to generate events TF1 * fDensityFunction; // ----- Default constructor ------------------------------------------ PndDpmDirect::PndDpmDirect() { } // ------------------------------------------------------------------------ // ----- Standard constructor ----------------------------------------- PndDpmDirect::PndDpmDirect(Double_t Mom, Int_t Mode, Long_t Seed) { // // Calculate ThtMin first. For this we make a cut-off on the value of -t of 1e-2 GeV^2 (~100 MeV/c momentum) // This estimated from a parametrization found in thesis of Thomas Wuerschig (figure 6.4, page 121): // Roughly: 0.4 deg at 15 GeV/c and 4 deg at 1.5 GeV/c, lineair interpolation in double log-scale. // Double_t logangle = TMath::Log(0.4)+(TMath::Log(15.)-TMath::Log(Mom))*(TMath::Log(4)-TMath::Log(0.4))/(TMath::Log(15)-TMath::Log(1.5)); Double_t ThtMin = TMath::Exp(logangle); PndDpmDirect(Mom, Mode, Seed, ThtMin) ; } PndDpmDirect::PndDpmDirect(Double_t Mom, Int_t Mode, Long_t Seed, Double_t ThtMin) { fMom = Mom; fMode = Mode; fSeed = Seed; fThtMin = ThtMin; if (fSeed < 0) { Long_t iSeed = gRandom->GetSeed(); int a = iSeed/100000; fSeed=iSeed - a*100000 + a/100000.; } fGasmode = 0; fRsigma = 0.; fDensityFunction = new TF1(); cout << " PndDpmDirect initialization" << endl; cout << " Momentum = " << fMom << endl; cout << " Seed = " << fSeed << endl; cout << " Mode = " << fMode << endl; cout << " Theta min = " << fThtMin<GetSeed(); int a = iSeed/100000; fSeed=iSeed - a*100000 + a/100000.; } fGasmode = 1; fRsigma = Rsigma; fDensityFunction = DensityFunction; cout << " PndDpmDirect initialization" << endl; cout << " Momentum = " << fMom << endl; cout << " Seed = " << fSeed << endl; cout << " Mode = " << fMode << endl; cout << " Gasmode = " << fGasmode << endl; cout << " Theta min = " << fThtMin<Gaus(0,fRsigma); gRandom->Circle(fX, fY, radius); // calculate fZ according to some (probability) density function of the gas fZ=fDensityFunction->GetRandom(); } // add track //printf("- I -: new particle at: %f, %f, %f ...\n", fX, fY, fZ); primGen->AddTrack(Id[i], Px[i], Py[i], Pz[i], fX, fY, fZ); } return kTRUE; } // ------------------------------------------------------------------------ ClassImp(PndDpmDirect)