G4ConcreteMesonBaryonToResonance.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 
00027 #include "globals.hh"
00028 #include "G4XAnnihilationChannel.hh"
00029 #include "G4ConcreteMesonBaryonToResonance.hh"
00030 
00031 G4BaryonWidth & G4ConcreteMesonBaryonToResonance::theBaryonWidth()
00032 {
00033   static G4BaryonWidth theWidth;
00034   return theWidth;
00035 }
00036 
00037 G4BaryonPartialWidth & G4ConcreteMesonBaryonToResonance::theBaryonPartialWidth()
00038 {
00039   static G4BaryonPartialWidth theWidth;
00040   return theWidth;
00041 }
00042 
00043 G4ParticleTypeConverter & G4ConcreteMesonBaryonToResonance::myConv() 
00044 {
00045     static G4ParticleTypeConverter theConv;
00046     return theConv;
00047 }
00048 
00049 G4ConcreteMesonBaryonToResonance::G4ConcreteMesonBaryonToResonance(const G4ParticleDefinition* aPrimary,
00050                                                                    const G4ParticleDefinition* bPrimary,
00051                                                                    const G4ParticleDefinition* aSecondary,
00052                                                                    const G4String& partWidthLabel)
00053   : thePrimary1(aPrimary), thePrimary2(bPrimary), theSecondary(aSecondary)
00054 {
00055   crossSectionSource = new G4XAnnihilationChannel(aSecondary, 
00056                                                   theBaryonWidth(),
00057                                                   theBaryonPartialWidth(),
00058                                                   partWidthLabel);
00059 }
00060 
00061 
00062 G4ConcreteMesonBaryonToResonance::~G4ConcreteMesonBaryonToResonance()
00063 { 
00064   delete crossSectionSource;
00065 }
00066 
00067 
00068 G4bool G4ConcreteMesonBaryonToResonance::IsInCharge(const G4KineticTrack& trk1, 
00069                                                     const G4KineticTrack& trk2) const
00070 {
00071   if (myConv().GetGenericType(trk1)==myConv().GetGenericType(thePrimary1) && 
00072       myConv().GetGenericType(trk2)==myConv().GetGenericType(thePrimary2)) return true;
00073   if (myConv().GetGenericType(trk1)==myConv().GetGenericType(thePrimary2) && 
00074       myConv().GetGenericType(trk2)==myConv().GetGenericType(thePrimary1)) return true;
00075   return false;
00076 }
00077 
00078 const G4ParticleDefinition* G4ConcreteMesonBaryonToResonance::GetOutgoingParticle(const G4KineticTrack& trk1, 
00079                                                                                   const G4KineticTrack& trk2) const
00080 {
00081   G4int secondaryIso3 = trk1.GetDefinition()->GetPDGiIsospin3() + trk2.GetDefinition()->GetPDGiIsospin3();
00082   const G4ParticleDefinition* state;
00083   if ( (state = myConv().FindIso3State(myConv().GetGenericType(theSecondary), secondaryIso3)) == NULL) 
00084   {
00085     G4cerr << "for "<<static_cast<G4int>(myConv().GetGenericType(theSecondary))<<" "<<secondaryIso3<<G4endl;
00086     throw G4HadronicException(__FILE__, __LINE__, "G4ConcreteMesonBaryonToResonance: Can't find iso3 state!");
00087   }
00088   return state;
00089 }

Generated on Mon May 27 17:47:56 2013 for Geant4 by  doxygen 1.4.7