CMS 3D CMS Logo

/data/refman/pasoursint/CMSSW_4_4_5_patch3/src/SimG4Core/GFlash/src/G4PiKBuilder_WP.cc

Go to the documentation of this file.
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  http://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.4 2009/10/16 07:55:51 fabiocos Exp $
00027 // GEANT4 tag $Name: V04-03-00 $
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 #include "FWCore/MessageLogger/interface/MessageLogger.h"
00049 
00050 G4PiKBuilder_WP::
00051 G4PiKBuilder_WP(): wasActivated(false) 
00052 {  
00053   thePionPlusInelastic=new G4PionPlusInelasticProcess;
00054   thePionMinusInelastic=new G4PionMinusInelasticProcess;
00055   theKaonPlusInelastic=new G4KaonPlusInelasticProcess;
00056   theKaonMinusInelastic=new G4KaonMinusInelasticProcess;
00057   theKaonZeroLInelastic=new G4KaonZeroLInelasticProcess;
00058   theKaonZeroSInelastic=new G4KaonZeroSInelasticProcess;
00059 
00060   theWrappedPionPlusInelastic=new GflashHadronWrapperProcess("G4PionPlusInelasticProcess");
00061   theWrappedPionMinusInelastic=new GflashHadronWrapperProcess("G4PionMinusInelasticProcess");
00062   theWrappedKaonPlusInelastic=new GflashHadronWrapperProcess("G4KaonPlusInelasticProcess");
00063   theWrappedKaonMinusInelastic=new GflashHadronWrapperProcess("G4KaonMinusInelasticProcess");
00064 }
00065 
00066 G4PiKBuilder_WP::
00067 ~G4PiKBuilder_WP(){
00068   delete thePionPlusInelastic;
00069   delete thePionMinusInelastic;
00070   delete theKaonPlusInelastic;
00071   delete theKaonMinusInelastic;
00072   delete theKaonZeroLInelastic;
00073   delete theKaonZeroSInelastic;
00074 
00075   //  delete theWrappedPionPlusInelastic;
00076   //  delete theWrappedPionMinusInelastic;
00077 }
00078 
00079 void G4PiKBuilder_WP::
00080 Build()
00081 {
00082   wasActivated = true;
00083 
00084   std::vector<G4VPiKBuilder *>::iterator i;
00085   for(i=theModelCollections.begin(); i!=theModelCollections.end(); i++)
00086   {
00087     (*i)->Build(thePionPlusInelastic);
00088     (*i)->Build(thePionMinusInelastic);
00089     (*i)->Build(theKaonPlusInelastic);
00090     (*i)->Build(theKaonMinusInelastic);
00091     (*i)->Build(theKaonZeroLInelastic);
00092     (*i)->Build(theKaonZeroSInelastic);
00093   }
00094   G4ProcessManager * theProcMan;
00095   theProcMan = G4PionPlus::PionPlus()->GetProcessManager();
00096   //  theProcMan->AddDiscreteProcess(thePionPlusInelastic);
00097   edm::LogInfo("SimG4CoreGFlash") << " Adding GflashHadronWrapperProcess (G4wrapperProcess) for G4PionPlusInelasticProcess";
00098   theWrappedPionPlusInelastic->RegisterProcess(thePionPlusInelastic);
00099   theProcMan->AddDiscreteProcess(theWrappedPionPlusInelastic);
00100   
00101   theProcMan = G4PionMinus::PionMinus()->GetProcessManager();
00102   //  theProcMan->AddDiscreteProcess(thePionMinusInelastic);
00103   edm::LogInfo("SimG4CoreGFlash") << " Adding GflashHadronWrapperProcess (G4wrapperProcess) for G4PionMinusInelasticProcess";
00104   theWrappedPionMinusInelastic->RegisterProcess(thePionMinusInelastic);
00105   theProcMan->AddDiscreteProcess(theWrappedPionMinusInelastic);
00106   
00107   theProcMan = G4KaonPlus::KaonPlus()->GetProcessManager();
00108   //  theProcMan->AddDiscreteProcess(theKaonPlusInelastic);
00109   edm::LogInfo("SimG4CoreGFlash") << " Adding GflashHadronWrapperProcess (G4wrapperProcess) for G4KaonPlusInelasticProcess";
00110   theWrappedKaonPlusInelastic->RegisterProcess(theKaonPlusInelastic);
00111   theProcMan->AddDiscreteProcess(theWrappedKaonPlusInelastic);
00112   
00113   theProcMan = G4KaonMinus::KaonMinus()->GetProcessManager();
00114   //  theProcMan->AddDiscreteProcess(theKaonMinusInelastic);
00115   edm::LogInfo("SimG4CoreGFlash") << " Adding GflashHadronWrapperProcess (G4wrapperProcess) for G4KaonMinusInelasticProcess";
00116   theWrappedKaonMinusInelastic->RegisterProcess(theKaonMinusInelastic);
00117   theProcMan->AddDiscreteProcess(theWrappedKaonMinusInelastic);
00118   
00119   theProcMan = G4KaonZeroLong::KaonZeroLong()->GetProcessManager();
00120   theProcMan->AddDiscreteProcess(theKaonZeroLInelastic);
00121   
00122   theProcMan = G4KaonZeroShort::KaonZeroShort()->GetProcessManager();
00123   theProcMan->AddDiscreteProcess(theKaonZeroSInelastic);
00124 }
00125 // 2002 by J.P. Wellisch
00126 // 2008 Modified for GflashHadronWrapperProcess