00001 // 00002 // ******************************************************************** 00003 // * License and Disclaimer * 00004 // * * 00005 // * The Geant4 software is copyright of the Copyright Holders of * 00006 // * the Geant4 Collaboration. It is provided under the terms and * 00007 // * conditions of the Geant4 Software License, included in the file * 00008 // * LICENSE and available at https://cern.ch/geant4/license . These * 00009 // * include a list of copyright holders. * 00010 // * * 00011 // * Neither the authors of this software system, nor their employing * 00012 // * institutes,nor the agencies providing financial support for this * 00013 // * work make any representation or warranty, express or implied, * 00014 // * regarding this software system or assume any liability for its * 00015 // * use. Please see the license in the file LICENSE and URL above * 00016 // * for the full disclaimer and the limitation of liability. * 00017 // * * 00018 // * This code implementation is the result of the scientific and * 00019 // * technical work of the GEANT4 collaboration. * 00020 // * By using, copying, modifying or distributing the software (or * 00021 // * any work based on the software) you agree to acknowledge its * 00022 // * use in resulting scientific publications, and indicate your * 00023 // * acceptance of all terms of the Geant4 Software license. * 00024 // ******************************************************************** 00025 // 00026 // $Id: G4PiKBuilder_WP.cc,v 1.2 2008/02/29 23:40:56 syjun Exp $ 00027 // GEANT4 tag $Name: V02-01-04 $ 00028 // 00029 //--------------------------------------------------------------------------- 00030 // 00031 // ClassName: G4PiKBuilder_WP 00032 // 00033 // Author: 2002 J.P. Wellisch 00034 // 00035 // Modified: 00036 // 16.11.2005 G.Folger: don't keep processes as data members, but new these 00037 // 13.06.2006 G.Folger: (re)move elastic scatterring 00038 // 00039 //---------------------------------------------------------------------------- 00040 // 00041 #include "G4ParticleDefinition.hh" 00042 #include "G4ParticleTable.hh" 00043 #include "G4ProcessManager.hh" 00044 00045 #include "SimG4Core/GFlash/interface/GflashHadronWrapperProcess.h" 00046 #include "SimG4Core/GFlash/interface/G4PiKBuilder_WP.h" 00047 00048 G4PiKBuilder_WP:: 00049 G4PiKBuilder_WP(): wasActivated(false) 00050 { 00051 thePionPlusInelastic=new G4PionPlusInelasticProcess; 00052 thePionMinusInelastic=new G4PionMinusInelasticProcess; 00053 theKaonPlusInelastic=new G4KaonPlusInelasticProcess; 00054 theKaonMinusInelastic=new G4KaonMinusInelasticProcess; 00055 theKaonZeroLInelastic=new G4KaonZeroLInelasticProcess; 00056 theKaonZeroSInelastic=new G4KaonZeroSInelasticProcess; 00057 00058 theWrappedPionPlusInelastic=new GflashHadronWrapperProcess("G4PionPlusInelasticProcess"); 00059 theWrappedPionMinusInelastic=new GflashHadronWrapperProcess("G4PionMinusInelasticProcess"); 00060 } 00061 00062 G4PiKBuilder_WP:: 00063 ~G4PiKBuilder_WP(){ 00064 delete thePionPlusInelastic; 00065 delete thePionMinusInelastic; 00066 delete theKaonPlusInelastic; 00067 delete theKaonMinusInelastic; 00068 delete theKaonZeroLInelastic; 00069 delete theKaonZeroSInelastic; 00070 00071 // delete theWrappedPionPlusInelastic; 00072 // delete theWrappedPionMinusInelastic; 00073 } 00074 00075 void G4PiKBuilder_WP:: 00076 Build() 00077 { 00078 wasActivated = true; 00079 00080 std::vector<G4VPiKBuilder *>::iterator i; 00081 for(i=theModelCollections.begin(); i!=theModelCollections.end(); i++) 00082 { 00083 (*i)->Build(thePionPlusInelastic); 00084 (*i)->Build(thePionMinusInelastic); 00085 (*i)->Build(theKaonPlusInelastic); 00086 (*i)->Build(theKaonMinusInelastic); 00087 (*i)->Build(theKaonZeroLInelastic); 00088 (*i)->Build(theKaonZeroSInelastic); 00089 } 00090 G4ProcessManager * theProcMan; 00091 theProcMan = G4PionPlus::PionPlus()->GetProcessManager(); 00092 // theProcMan->AddDiscreteProcess(thePionPlusInelastic); 00093 std::cout << " Adding GflashHadronWrapperProcess (G4wrapperProcess) for G4PionPlusInelasticProcess" << std::endl; 00094 theWrappedPionPlusInelastic->RegisterProcess(thePionPlusInelastic); 00095 theProcMan->AddDiscreteProcess(theWrappedPionPlusInelastic); 00096 00097 theProcMan = G4PionMinus::PionMinus()->GetProcessManager(); 00098 // theProcMan->AddDiscreteProcess(thePionMinusInelastic); 00099 std::cout << " Adding GflashHadronWrapperProcess (G4wrapperProcess) for G4PionMinusInelasticProcess" << std::endl; 00100 theWrappedPionMinusInelastic->RegisterProcess(thePionMinusInelastic); 00101 theProcMan->AddDiscreteProcess(theWrappedPionMinusInelastic); 00102 00103 theProcMan = G4KaonPlus::KaonPlus()->GetProcessManager(); 00104 theProcMan->AddDiscreteProcess(theKaonPlusInelastic); 00105 00106 theProcMan = G4KaonMinus::KaonMinus()->GetProcessManager(); 00107 theProcMan->AddDiscreteProcess(theKaonMinusInelastic); 00108 00109 theProcMan = G4KaonZeroLong::KaonZeroLong()->GetProcessManager(); 00110 theProcMan->AddDiscreteProcess(theKaonZeroLInelastic); 00111 00112 theProcMan = G4KaonZeroShort::KaonZeroShort()->GetProcessManager(); 00113 theProcMan->AddDiscreteProcess(theKaonZeroSInelastic); 00114 } 00115 // 2002 by J.P. Wellisch