--- PamVMC/include/PamVMCPrimaryGenerator.h 2009/02/19 16:50:36 1.1 +++ PamVMC/include/PamVMCPrimaryGenerator.h 2010/09/15 07:05:42 1.6 @@ -9,7 +9,8 @@ #include #include #include -#include +#include +#include #include "PamRootManager.h" @@ -78,15 +79,22 @@ // gen methods void GenPosition(Double_t xmin, Double_t xmax, Double_t ymin, Double_t ymax, Double_t zmin, Double_t zmax){ - SetPosition(frnd->Uniform(xmin,xmax),frnd->Uniform(ymin,ymax),frnd->Uniform(zmin,zmax)); } - - void GenDirection(Double_t thetamin, Double_t thetamax, Double_t phimin, Double_t phimax){ - SetDirection(frnd->Uniform(thetamin,thetamax),frnd->Uniform(phimin,phimax)); } + SetPosition(frandom->Uniform(xmin,xmax),frandom->Uniform(ymin,ymax),frandom->Uniform(zmin,zmax)); } + void GenDirection(Double_t thetamin, Double_t thetamax, Double_t phimin, Double_t phimax){ + SetDirection(ftheta->GetRandom(thetamin, thetamax), frandom->Uniform(phimin,phimax)); + } //flat spectra generator void GenSpe(Double_t PEmin, Double_t PEmax, Bool_t isEnergy=kFALSE); //power law spectra, gamma - differential spectral index void GenSpe(Double_t PEmin, Double_t PEmax, Double_t gamma, Bool_t isEnergy=kFALSE); + void GenSpe_Flat(Double_t PEmin, Double_t PEmax, Double_t gamma, Bool_t isEnergy=kFALSE); + void GenSpe_3par(Double_t PEmin, Double_t PEmax, Double_t a, Double_t b, Double_t c); + void GenSphericalPhiThe(); // cecilia // flusso istropo // sets phi the + void GenSphPhiThe(Double_t xmin, Double_t xmax, Double_t ymin, Double_t ymax, + Double_t zmin, Double_t zmax); // flusso isotropo entro S2 S3 + // sets position and phi the + // get methods Int_t GetParticle(){ return fprim.fPDG; }; @@ -102,6 +110,11 @@ Bool_t Getgood(){ return fprim.fGOOD; }; + //initialize random + void SetRandom(TRandom* random){ + frandom = random; + } + //work with collection of primaries void Register(){ @@ -121,6 +134,7 @@ Double_t KinEToMomentum(Double_t E0); Double_t MomentumToRig(Double_t P0) { return P0/fcharge; }; Double_t RigToMomentum(Double_t R0){ return R0*fcharge; }; + Double_t function3par(Double_t xx, Double_t a, Double_t b, Double_t c){return 5.*pow((xx + b * exp(-c * sqrt(xx))),-a);}; // data members TVirtualMCStack* fStack; @@ -129,8 +143,8 @@ Double_t fmass; Double_t fcharge; TClonesArray* fprimColl; - - TRandom3 * frnd; + TRandom* frandom; // Class is not a owner of this object + TF1* ftheta; // To generate sherical distributhin in theta-angle ClassDef(PamVMCPrimaryGenerator,1) //PamVMCPrimaryGenerator };