// ------------------------------------------------------------------------- // ----- 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 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, 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.; 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)