/[PAMELA software]/PamVMC/include/PamVMCPrimaryGenerator.h
ViewVC logotype

Diff of /PamVMC/include/PamVMCPrimaryGenerator.h

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.1 by nikolas, Thu Feb 19 16:50:36 2009 UTC revision 1.5 by pam-rm2, Fri Jun 12 18:39:19 2009 UTC
# Line 9  Line 9 
9  #include <TVector3.h>  #include <TVector3.h>
10  #include <TVector2.h>  #include <TVector2.h>
11  #include <TMath.h>  #include <TMath.h>
12  #include <TRandom3.h>  #include <TRandom.h>
13    #include <TF1.h>
14    
15  #include "PamRootManager.h"  #include "PamRootManager.h"
16    
# Line 78  class PamVMCPrimaryGenerator : public TO Line 79  class PamVMCPrimaryGenerator : public TO
79      // gen methods      // gen methods
80    
81      void GenPosition(Double_t xmin, Double_t xmax, Double_t ymin, Double_t ymax, Double_t zmin, Double_t zmax){      void GenPosition(Double_t xmin, Double_t xmax, Double_t ymin, Double_t ymax, Double_t zmin, Double_t zmax){
82        SetPosition(frnd->Uniform(xmin,xmax),frnd->Uniform(ymin,ymax),frnd->Uniform(zmin,zmax)); }        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(frnd->Uniform(thetamin,thetamax),frnd->Uniform(phimin,phimax)); }  
83    
84        void GenDirection(Double_t thetamin, Double_t thetamax, Double_t phimin, Double_t phimax){
85          SetDirection(ftheta->GetRandom(thetamin, thetamax), frandom->Uniform(phimin,phimax));
86        }
87      //flat spectra generator      //flat spectra generator
88      void GenSpe(Double_t PEmin, Double_t PEmax, Bool_t isEnergy=kFALSE);      void GenSpe(Double_t PEmin, Double_t PEmax, Bool_t isEnergy=kFALSE);
89      //power law spectra, gamma - differential spectral index      //power law spectra, gamma - differential spectral index
# Line 102  class PamVMCPrimaryGenerator : public TO Line 103  class PamVMCPrimaryGenerator : public TO
103            
104      Bool_t Getgood(){ return fprim.fGOOD; };      Bool_t Getgood(){ return fprim.fGOOD; };
105    
106        //initialize random
107        void SetRandom(TRandom* random){
108          frandom = random;
109        }
110    
111      //work with collection of primaries      //work with collection of primaries
112    
113      void Register(){      void Register(){
# Line 129  class PamVMCPrimaryGenerator : public TO Line 135  class PamVMCPrimaryGenerator : public TO
135      Double_t          fmass;      Double_t          fmass;
136      Double_t          fcharge;      Double_t          fcharge;
137      TClonesArray*     fprimColl;      TClonesArray*     fprimColl;
138        TRandom*          frandom; // Class is not a owner of this object
139      TRandom3 *        frnd;      TF1*              ftheta; // To generate sherical distributhin in theta-angle
140            
141    ClassDef(PamVMCPrimaryGenerator,1)  //PamVMCPrimaryGenerator    ClassDef(PamVMCPrimaryGenerator,1)  //PamVMCPrimaryGenerator
142  };  };

Legend:
Removed from v.1.1  
changed lines
  Added in v.1.5

  ViewVC Help
Powered by ViewVC 1.1.23