/[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.6 by pizzolot, Wed Sep 15 07:05:42 2010 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
90      void GenSpe(Double_t PEmin, Double_t PEmax, Double_t gamma, Bool_t isEnergy=kFALSE);      void GenSpe(Double_t PEmin, Double_t PEmax, Double_t gamma, Bool_t isEnergy=kFALSE);
91        void GenSpe_Flat(Double_t PEmin, Double_t PEmax, Double_t gamma, Bool_t isEnergy=kFALSE);
92        void GenSpe_3par(Double_t PEmin, Double_t PEmax, Double_t a, Double_t b, Double_t c);
93        void GenSphericalPhiThe(); // cecilia // flusso istropo // sets phi the
94        void GenSphPhiThe(Double_t xmin, Double_t xmax, Double_t ymin, Double_t ymax,
95                          Double_t zmin, Double_t zmax); // flusso isotropo entro S2 S3
96        //                                                  sets position and phi the
97        
98    
99      // get methods      // get methods
100      Int_t GetParticle(){ return fprim.fPDG; };      Int_t GetParticle(){ return fprim.fPDG; };
# Line 102  class PamVMCPrimaryGenerator : public TO Line 110  class PamVMCPrimaryGenerator : public TO
110            
111      Bool_t Getgood(){ return fprim.fGOOD; };      Bool_t Getgood(){ return fprim.fGOOD; };
112    
113        //initialize random
114        void SetRandom(TRandom* random){
115          frandom = random;
116        }
117    
118      //work with collection of primaries      //work with collection of primaries
119    
120      void Register(){      void Register(){
# Line 121  class PamVMCPrimaryGenerator : public TO Line 134  class PamVMCPrimaryGenerator : public TO
134      Double_t KinEToMomentum(Double_t E0);      Double_t KinEToMomentum(Double_t E0);
135      Double_t MomentumToRig(Double_t P0) { return P0/fcharge; };      Double_t MomentumToRig(Double_t P0) { return P0/fcharge; };
136      Double_t RigToMomentum(Double_t R0){ return R0*fcharge; };      Double_t RigToMomentum(Double_t R0){ return R0*fcharge; };
137        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);};
138    
139      // data members      // data members
140      TVirtualMCStack*  fStack;      TVirtualMCStack*  fStack;
# Line 129  class PamVMCPrimaryGenerator : public TO Line 143  class PamVMCPrimaryGenerator : public TO
143      Double_t          fmass;      Double_t          fmass;
144      Double_t          fcharge;      Double_t          fcharge;
145      TClonesArray*     fprimColl;      TClonesArray*     fprimColl;
146        TRandom*          frandom; // Class is not a owner of this object
147      TRandom3 *        frnd;      TF1*              ftheta; // To generate sherical distributhin in theta-angle
148            
149    ClassDef(PamVMCPrimaryGenerator,1)  //PamVMCPrimaryGenerator    ClassDef(PamVMCPrimaryGenerator,1)  //PamVMCPrimaryGenerator
150  };  };

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

  ViewVC Help
Powered by ViewVC 1.1.23