// ------------------------------------------------------------------------- // ----- FairBoxGeneratorMOD header file ----- // ----- Created 09/09/04 by Yu.Kharlov ----- // ------------------------------------------------------------------------- /** FairBoxGeneratorMOD.h *@author Yuri Kharlov * * The FairBoxGeneratorMOD generates particles within given range * over pt, phi, eta, y or theta a fixed multiplicity per event. * Derived from FairGenerator. **/ /* $Id: FairBoxGeneratorMOD.h,v 1.3 2006/07/14 11:23:57 kharlov Exp $ */ /* History of cvs commits: * * $Log: FairBoxGeneratorMOD.h,v $ * Revision 1.3 2006/07/14 11:23:57 kharlov * Add protection for simultaneously set ranges; split vertex and kinematics ranges * * Revision 1.2 2006/03/29 16:25:50 kharlov * New functionality added * */ #ifndef FAIR_BOXGENERATORMOD_H #define FAIR_BOXGENERATORMOD_H #include "FairGenerator.h" #include "TF1.h" #include class FairPrimaryGenerator; class TF1; class FairBoxGeneratorMOD : public FairGenerator { public: /** Default constructor. **/ FairBoxGeneratorMOD(); /** Constructor with PDG-ID, multiplicity **@param pdgid Particle type (PDG encoding) **@param mult Multiplicity (default is 1) **/ FairBoxGeneratorMOD(Int_t pdgid, Int_t mult=1); /** Destructor **/ virtual ~FairBoxGeneratorMOD() {}; /** Modifiers **/ void SetPDGType (Int_t pdg) {fPDGType = pdg; }; void SetRandAntiPart (Bool_t var=kTRUE){fPDGvarAnti=var;} void SetMultiplicity (Int_t mult) {fMult = mult; }; void SetPRange(Double32_t pmin=0 , Double32_t pmax=10) {fPMin=pmin; fPMax=pmax; fPRangeIsSet=kTRUE;} void SetPtRange (Double32_t ptmin=0 , Double32_t ptmax=10) {fPtMin=ptmin; fPtMax=ptmax; fPtRangeIsSet=kTRUE;}; void SetPhiRange (Double32_t phimin=0 , Double32_t phimax=360) {fPhiMin=phimin; fPhiMax=phimax; fPhiRangeIsSet=kTRUE;}; void SetEtaRange (Double32_t etamin=-5 , Double32_t etamax=7) {fEtaMin=etamin; fEtaMax=etamax; fEtaRangeIsSet=kTRUE;}; void SetYRange (Double32_t ymin=-5 , Double32_t ymax=7) {fYMin=ymin; fYMax=ymax; fYRangeIsSet=kTRUE;}; void SetThetaRange (Double32_t thetamin=0, Double32_t thetamax=90) {fThetaMin=thetamin; fThetaMax=thetamax; fThetaRangeIsSet=kTRUE;}; void SetCosTheta () {fCosThetaIsSet=kTRUE;}; void SetXYZ (Double32_t x=0, Double32_t y=0, Double32_t z=0) { fX=x; fY=y; fZ=z; fPointVtxIsSet=kTRUE; } void SetBoxXYZ (Double32_t x1=0, Double32_t x2=0, Double32_t y1=0, Double32_t y2=0, Double32_t z1=0, Double32_t z2=0) { fX1=x1; fX2=x2; fY1=y1; fY2=y2; fZ1=z1; fZ2=z2; fBoxVtxIsSet=kTRUE; } void SetPlane1XYZ (Double32_t x1=0, Double32_t x2=0, Double32_t y1=0, Double32_t y2=0, Double32_t z1=0, Double32_t z2=0) { fX1=x1; fX2=x2; fY1=y1; fY2=y2; fZ1=z1; fZ2=z2; fPlane1VtxIsSet=kTRUE; } void SetCylinder(Double32_t r, Double32_t phimin, Double32_t phimax, Double32_t len, Double_t Z) { fCR=r; fCPhi1=phimin; fCPhi2=phimax; fCLen=len; fCZ=Z; fCylVtxIsSet=kTRUE; } void SetShift(Double32_t xmin, Double32_t xmax, Double32_t ymin=0, Double32_t ymax=0, Double32_t zmin=0, Double32_t zmax=0) {fX1=xmin;fX2=xmax;fY1=ymin;fY2=ymax;fZ1=zmin;fZ2=zmax;} void SetCosmic(Double32_t r, Double32_t phimin, Double32_t phimax, Double32_t x0, Double32_t y0, Double32_t z0) { fCR=r; fCPhi1=phimin; fCPhi2=phimax; fCX=x0; fCY=y0; fCZ=z0; fCosmicsIsSet=kTRUE; } void SetSphere(Double32_t r, Double32_t x0=0, Double32_t y0=0, Double32_t z0=0) { SetCosmic(r,0,360,x0,y0,z0); fSphereIsSet=kTRUE; } void SetDonut(Double32_t r1, Double32_t r2, Double32_t z1, Double32_t z2, Double32_t phi1=0, Double32_t phi2=360) { fX1=r1; fX2=r2; fY1=phi1; fY2=phi2; fZ1=z1; fZ2=z2; fDonutIsSet=kTRUE; } void SetDebug(Bool_t debug=0) {fDebug = debug;} /** Initializer **/ Bool_t Init(); /** Creates an event with given type and multiplicity. **@param primGen pointer to the FairPrimaryGenerator **/ virtual Bool_t ReadEvent(FairPrimaryGenerator* primGen); private: Int_t fPDGType; // Particle type (PDG encoding) Int_t fMult; // Multiplicity Double32_t fPDGMass; // Particle mass [GeV] Double32_t fPtMin, fPtMax; // Transverse momentum range [GeV] Double32_t fPhiMin, fPhiMax; // Azimuth angle range [degree] Double32_t fEtaMin, fEtaMax; // Pseudorapidity range in lab system Double32_t fYMin, fYMax; // Rapidity range in lab system Double32_t fPMin, fPMax; // Momentum range in lab system Double32_t fThetaMin, fThetaMax; // Polar angle range in lab system [degree] Double32_t fX, fY, fZ; // Point vertex coordinates [cm] Double32_t fX1, fY1, fX2, fY2, fZ1, fZ2; // Box vertex coords (x1,y1,z1)->(x2,y2,z2) Double32_t fCR, fCPhi1, fCPhi2, fCLen, fCZ; // radius, phi min, phi max, length and start Z for cylinder vertex Double32_t fCX,fCY; TF1 * fFunc; Bool_t fEtaRangeIsSet; // True if eta range is set Bool_t fYRangeIsSet; // True if rapidity range is set Bool_t fPhiRangeIsSet; // True if Phi range is set Bool_t fThetaRangeIsSet; // True if theta range is set Bool_t fCosThetaIsSet; // True if uniform distribution in //cos(theta) is set (default -> not set) Bool_t fPtRangeIsSet; // True if transverse momentum range is set Bool_t fPRangeIsSet; // True if abs.momentum range is set Bool_t fPointVtxIsSet; // True if point vertex is set Bool_t fBoxVtxIsSet; // True if box vertex is set Bool_t fCylVtxIsSet; // True if cylinder vertex is set Bool_t fCosmicsIsSet; // True if cosmics are simulated Bool_t fSphereIsSet; // True if tracks should come from a sphere Bool_t fPlane1VtxIsSet; // True if tracks should come from A plane along the z-axis Bool_t fDebug; // Debug switch Bool_t fPDGvarAnti; // produce uniform random particle and anti particle Bool_t fDonutIsSet; // vertex from ring shaped box ClassDef(FairBoxGeneratorMOD,2); }; #endif