// $Id: PamVMCPrimaryGenerator.h,v 1.0 2007/06/03 #ifndef PAMVMC_PRIMARY_GENERATOR_H #define PAMVMC_PRIMARY_GENERATOR_H #include #include #include #include #include #include #include #include //#include #include "PamRootManager.h" #include "PamVMC2PiAux.h" #include "PamVMCPrimaryGF.h" class TVirtualMCStack; using std::cout; using std::endl; using TMath::Sqrt; class PamVMCPrimary : public TObject { public: PamVMCPrimary(): fID(0), fPDG(0), fX0(0.), fY0(0.), fZ0(0.), fTHETA(0.), fPHI(0.), fP0(0.), fGOOD(kFALSE), fXTOL(-100.), fYTOL(-100.){ for (Int_t j = 0; j<14; j++){ fCR_X[j] = -100.; fCR_Y[j] = -100.; } }; virtual ~PamVMCPrimary(){ /*gObjectTable->Remove(this);*/}; UInt_t fID; Int_t fPDG; Double_t fX0, fY0, fZ0; Double_t fTHETA, fPHI; Double_t fP0; Bool_t fGOOD; Double_t fXTOL, fYTOL; Double_t fCR_X [14]; Double_t fCR_Y [14]; void Clean() { fID=0; fPDG=0; fX0=fY0=fZ0=fTHETA=fPHI=fP0=0.; fGOOD=kFALSE; fXTOL=fYTOL=-100.; for (Int_t j = 0; j<14; j++){ fCR_X[j] = -100.; fCR_Y[j] = -100.; } } void Clear(const Option_t * =""){ this->~PamVMCPrimary(); } void Print(const Option_t * ="") const { cout<<"PRIMARY particle "<CheckCrossing(fzprev,fxprev,fyprev, z_curr, x_curr, y_curr); SetZeroStep(z_curr,x_curr, y_curr); } //after last step of primary void CheckInsideAcceptance(){ for(Int_t i = 0; iIsInsideAcceptance(fprim.fCR_X, fprim.fCR_Y, fprim.fXTOL, fprim.fYTOL); fpgf->Clear(); if(fprim.fGOOD) fngood++; //Here I'm getting what I have in collection and asume that I have only 1 primary here //If I wish to launch more in 1 event I need change this stuff PamVMCPrimary* tmp = (PamVMCPrimary*)fprimColl->At(0); if(tmp) *tmp = fprim; } Double_t MomentumToKinE(Double_t P0); Double_t KinEToMomentum(Double_t E0); Double_t MomentumToRig(Double_t P0) { return TMath::Abs(P0/fcharge); }; Double_t RigToMomentum(Double_t R0){ return TMath::Abs(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);}; private: // methods // data members TVirtualMCStack* fStack; Int_t fevno; Int_t fngood; //particles inside nominal acceptance PamVMCPrimary fprim; Double_t fmass; Double_t fcharge; Double_t fxprev, fyprev, fzprev; // coordinates of primary on prev. step TClonesArray* fprimColl; TRandom* frandom; // Class is not a owner of this object TF1* ftheta; // To generate sherical distributhin in theta-angle PamVMC2PiAux* f2PiAux; //2 Pi generator aux stuff PamVMCPrimaryGF* fpgf; // Object which ClassDef(PamVMCPrimaryGenerator,1) //PamVMCPrimaryGenerator }; // inline functions inline Double_t PamVMCPrimaryGenerator::MomentumToKinE(Double_t P0) { return Sqrt(P0*P0+fmass*fmass)-fmass; } inline Double_t PamVMCPrimaryGenerator::KinEToMomentum(Double_t E0) { return Sqrt(E0*E0+2.*E0*fmass); } #endif //PAMVMC_PRIMARY_GENERATOR_H