CMS 3D CMS Logo

/data/refman/pasoursint/CMSSW_4_1_8_patch13/src/SimG4Core/GFlash/plugins/GFlash.cc

Go to the documentation of this file.
00001 #include "SimG4Core/GFlash/interface/GFlash.h"
00002 #include "SimG4Core/GFlash/interface/ParametrisedPhysics.h"
00003 #include "SimG4Core/GFlash/interface/HadronPhysicsQGSP_WP.h"
00004 #include "SimG4Core/GFlash/interface/HadronPhysicsQGSP_BERT_WP.h"
00005 #include "SimG4Core/PhysicsLists/interface/CMSEmStandardPhysics92.h"
00006 #include "FWCore/MessageLogger/interface/MessageLogger.h"
00007 
00008 #include "G4DecayPhysics.hh"
00009 #include "G4EmExtraPhysics.hh"
00010 #include "G4IonPhysics.hh"
00011 #include "G4QStoppingPhysics.hh"
00012 #include "G4HadronElasticPhysics.hh" 
00013 #include "G4NeutronTrackingCut.hh"
00014 
00015 #include "G4DataQuestionaire.hh"
00016 #include "SimGeneral/GFlash/interface/GflashHistogram.h"
00017 
00018 GFlash::GFlash(G4LogicalVolumeToDDLogicalPartMap& map, 
00019                const HepPDT::ParticleDataTable * table_, 
00020                sim::FieldBuilder *fieldBuilder_, 
00021                const edm::ParameterSet & p) : PhysicsList(map, table_, fieldBuilder_, p), 
00022                                               thePar(p.getParameter<edm::ParameterSet>("GFlash")) {
00023 
00024   G4DataQuestionaire it(photon);
00025 
00026   int  ver           = p.getUntrackedParameter<int>("Verbosity",0);
00027   std::string region = p.getParameter<std::string>("Region");
00028   edm::LogInfo("PhysicsList") << "You are using the simulation engine: "
00029                               << "QGSP_BERT_EML 3.3 + CMS GFLASH with"
00030                               << " special region " << region;
00031 
00032   RegisterPhysics(new ParametrisedPhysics("parametrised",thePar)); 
00033 
00034   // EM Physics
00035   RegisterPhysics( new CMSEmStandardPhysics92("standard EM EML",ver,region));
00036 
00037   // Synchroton Radiation & GN Physics
00038   RegisterPhysics(new G4EmExtraPhysics("extra EM"));
00039 
00040   // Decays
00041   RegisterPhysics(new G4DecayPhysics("decay",ver));
00042 
00043   // Hadron Elastic scattering
00044   RegisterPhysics(new G4HadronElasticPhysics("elastic",ver,false)); 
00045 
00046   // Hadron Physics
00047   G4bool quasiElastic=true;
00048   std::string hadronPhysics = thePar.getParameter<std::string>("GflashHadronPhysics");
00049   if(hadronPhysics=="QGSP_BERT") {
00050     RegisterPhysics(new HadronPhysicsQGSP_BERT_WP("hadron",quasiElastic));
00051   }
00052   else if (hadronPhysics=="QGSP") {
00053     RegisterPhysics(new HadronPhysicsQGSP_WP("hadron",quasiElastic));
00054   }
00055   else {
00056     edm::LogInfo("PhysicsList") << hadronPhysics << " is not available for GflashHadronPhysics!"
00057                                 << "... Using QGSP_BERT\n";
00058     RegisterPhysics(new HadronPhysicsQGSP_BERT_WP("hadron",quasiElastic));
00059   }
00060 
00061   // Stopping Physics
00062   RegisterPhysics(new G4QStoppingPhysics("stopping"));
00063 
00064   // Ion Physics
00065   RegisterPhysics(new G4IonPhysics("ion"));
00066 
00067   // Neutron tracking cut
00068   RegisterPhysics( new G4NeutronTrackingCut("Neutron tracking cut", ver));
00069 
00070 
00071   // singleton histogram object
00072   if(thePar.getParameter<bool>("GflashHistogram")) {
00073     theHisto = GflashHistogram::instance();
00074     theHisto->setStoreFlag(true);
00075     theHisto->bookHistogram(thePar.getParameter<std::string>("GflashHistogramName"));
00076   }
00077 
00078 }
00079 
00080 GFlash::~GFlash() {
00081   /*
00082   if(thePar.getParameter<bool>("GflashHistogram")) {
00083     if(theHisto) delete theHisto;
00084   }
00085   */
00086 }
00087 
00088 //define this as a plug-in
00089 #include "FWCore/Framework/interface/MakerMacros.h"
00090 #include "SimG4Core/Physics/interface/PhysicsListFactory.h"
00091 
00092 
00093 DEFINE_PHYSICSLIST(GFlash);
00094