/scratch0/jsnuveri/BDSIM/BDSIMgit/bdsim/src/BDSBunch.cc

00001 #include "BDSBunch.hh"
00002 #include "BDSBunchFactory.hh"
00003 #include "BDSDebug.hh"
00004 
00005 BDSBunch::BDSBunch() {
00006 #ifdef BDSDEBUG 
00007   G4cout << __METHOD_NAME__ << G4endl;
00008 #endif
00009 
00010   // Construct default reference type 
00011   distribType = std::string("reference");
00012   bdsBunch    = new BDSBunchInterface(); 
00013 }
00014 
00015 BDSBunch::~BDSBunch() {
00016   delete bdsBunch;
00017 }
00018 
00019 void BDSBunch::SetOptions(struct Options& opt) {
00020 #ifdef BDSDEBUG 
00021   G4cout << __METHOD_NAME__ << G4endl;
00022 #endif
00023 
00024   // check options and construct corrrect bdsBunchInterface
00025   delete bdsBunch;
00026 
00027   bdsBunch = BDSBunchFactory::createBunch(opt.distribType);
00028 
00029   bdsBunch->SetOptions(opt);
00030   return;
00031 }
00032 
00033 
00034 void BDSBunch::GetNextParticle(G4double& x0, G4double& y0, G4double& z0, 
00035                                G4double& xp, G4double& yp, G4double& zp,
00036                                G4double& t , G4double&  E, G4double& weight) {
00037 #ifdef BDSDEBUG 
00038   G4cout << __METHOD_NAME__ << G4endl;
00039 #endif
00040 
00041   bdsBunch->GetNextParticle(x0,y0,z0,xp,yp,zp,t,E,weight);
00042   return;
00043 }

Generated on 28 Jun 2015 for BDSIM by  doxygen 1.4.7