G4INCLBinaryCollisionAvatar.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 // INCL++ intra-nuclear cascade model
00027 // Pekka Kaitaniemi, CEA and Helsinki Institute of Physics
00028 // Davide Mancusi, CEA
00029 // Alain Boudard, CEA
00030 // Sylvie Leray, CEA
00031 // Joseph Cugnon, University of Liege
00032 //
00033 #define INCLXX_IN_GEANT4_MODE 1
00034 
00035 #include "globals.hh"
00036 
00037 /*
00038  * G4INCLBinaryCollisionAvatar.cc
00039  *
00040  *  \date Jun 5, 2009
00041  * \author Pekka Kaitaniemi
00042  */
00043 
00044 #include "G4INCLBinaryCollisionAvatar.hh"
00045 #include "G4INCLElasticChannel.hh"
00046 #include "G4INCLRecombinationChannel.hh"
00047 #include "G4INCLDeltaProductionChannel.hh"
00048 #include "G4INCLCrossSections.hh"
00049 #include "G4INCLKinematicsUtils.hh"
00050 #include "G4INCLRandom.hh"
00051 #include "G4INCLParticleTable.hh"
00052 #include "G4INCLPauliBlocking.hh"
00053 #include "G4INCLPionNucleonChannel.hh"
00054 #include "G4INCLStore.hh"
00055 #include "G4INCLBook.hh"
00056 #include "G4INCLLogger.hh"
00057 #include <string>
00058 #include <sstream>
00059 // #include <cassert>
00060 
00061 namespace G4INCL {
00062 
00063   const G4double BinaryCollisionAvatar::cutNN = 1910;
00064   const G4double BinaryCollisionAvatar::cutNNSquared = cutNN*cutNN;
00065 
00066   BinaryCollisionAvatar::BinaryCollisionAvatar(G4double time, G4double crossSection,
00067       G4INCL::Nucleus *n, G4INCL::Particle *p1, G4INCL::Particle *p2)
00068     : InteractionAvatar(time, n, p1, p2), theCrossSection(crossSection)
00069   {
00070     setType(CollisionAvatarType);
00071   }
00072 
00073   BinaryCollisionAvatar::~BinaryCollisionAvatar() {
00074   }
00075 
00076   G4INCL::IChannel* BinaryCollisionAvatar::getChannel() const {
00077     // We already check cutNN at avatar creation time, but we have to check it
00078     // again here. For composite projectiles, we might have created independent
00079     // avatars with no cutNN before any collision took place.
00080     if(particle1->isNucleon()
00081         && particle2->isNucleon()
00082         && theNucleus->getStore()->getBook()->getAcceptedCollisions()!=0) {
00083       const G4double energyCM2 = KinematicsUtils::squareTotalEnergyInCM(particle1, particle2);
00084       // Below a certain cut value we don't do anything:
00085       if(energyCM2 < cutNNSquared) {
00086         DEBUG("CM energy = sqrt(" << energyCM2 << ") MeV < sqrt(" << cutNNSquared
00087             << ") MeV = cutNN" << "; returning a NULL channel" << std::endl);
00088         InteractionAvatar::restoreParticles();
00089         return NULL;
00090       }
00091     }
00092 
00112     ThreeVector minimumDistance = particle1->getPosition();
00113     minimumDistance -= particle2->getPosition();
00114     const G4double betaDotX = boostVector.dot(minimumDistance);
00115     const G4double minDist = Math::tenPi*(minimumDistance.mag2() + betaDotX*betaDotX / (1.-boostVector.mag2()));
00116     if(minDist > theCrossSection) {
00117       DEBUG("CM distance of approach is too small: " << minDist << ">" <<
00118         theCrossSection <<"; returning a NULL channel" << std::endl);
00119       InteractionAvatar::restoreParticles();
00120       return NULL;
00121     }
00122 
00123     if(particle1->isNucleon() && particle2->isNucleon()) { // NN->NN
00124       G4double elasticCX = CrossSections::elastic(particle1,
00125           particle2);
00126       G4double deltaProductionCX = CrossSections::deltaProduction(particle1,
00127           particle2);
00128 
00129       G4bool isElastic = true;
00130       if(elasticCX/(elasticCX + deltaProductionCX) < Random::shoot()) {
00131         // NN -> N Delta channel is chosen
00132         isElastic = false;
00133       }
00134 
00135       if(isElastic) { // Elastic NN channel
00136         DEBUG("NN interaction: elastic channel chosen" << std::endl);
00137         return new ElasticChannel(theNucleus, particle1, particle2);
00138       } else { // Delta production
00139         // Inelastic NN channel
00140         DEBUG("NN interaction: inelastic channel chosen" << std::endl);
00141         return new DeltaProductionChannel(particle1, particle2, theNucleus);
00142       }
00143     } else if((particle1->isNucleon() && particle2->isDelta()) ||
00144               (particle1->isDelta() && particle2->isNucleon())) {
00145       G4double elasticCX = CrossSections::elastic(particle1,
00146           particle2);
00147       G4double recombinationCX = CrossSections::recombination(particle1,
00148           particle2);
00149 
00150       G4bool isElastic = true;
00151       if(elasticCX/(elasticCX + recombinationCX) < Random::shoot()) {
00152         // N Delta -> NN channel is chosen
00153         isElastic = false;
00154       }
00155 
00156       if(isElastic) { // Elastic N Delta channel
00157         DEBUG("NDelta interaction: elastic channel chosen" << std::endl);
00158         return new ElasticChannel(theNucleus, particle1, particle2);
00159       } else { // Recombination
00160         DEBUG("NDelta interaction: recombination channel chosen" << std::endl);
00161         return new RecombinationChannel(theNucleus, particle1, particle2);
00162       }
00163     } else if(particle1->isDelta() && particle2->isDelta()) {
00164         DEBUG("DeltaDelta interaction: elastic channel chosen" << std::endl);
00165         return new ElasticChannel(theNucleus, particle1, particle2);
00166     } else if((particle1->isNucleon() && particle2->isPion()) ||
00167               (particle1->isPion() && particle2->isNucleon())) {
00168       return new PionNucleonChannel(particle1, particle2, theNucleus, shouldUseLocalEnergy());
00169     } else {
00170       DEBUG("BinaryCollisionAvatar can only handle nucleons (for the moment)."
00171               << std::endl
00172               << particle1->print()
00173               << std::endl
00174               << particle2->print()
00175               << std::endl);
00176       InteractionAvatar::restoreParticles();
00177       return NULL;
00178     }
00179   }
00180 
00181   void BinaryCollisionAvatar::preInteraction() {
00182     InteractionAvatar::preInteraction();
00183   }
00184 
00185   FinalState *BinaryCollisionAvatar::postInteraction(FinalState *fs) {
00186     // Call the postInteraction method of the parent class
00187     // (provides Pauli blocking and enforces energy conservation)
00188     fs = InteractionAvatar::postInteraction(fs);
00189 
00190     switch(fs->getValidity()) {
00191       case PauliBlockedFS:
00192         theNucleus->getStore()->getBook()->incrementBlockedCollisions();
00193         break;
00194       case NoEnergyConservationFS:
00195       case ParticleBelowFermiFS:
00196       case ParticleBelowZeroFS:
00197         break;
00198       case ValidFS:
00199         theNucleus->getStore()->getBook()->incrementAcceptedCollisions();
00200         if(theNucleus->getStore()->getBook()->getAcceptedCollisions() == 1) {
00201           G4double t = theNucleus->getStore()->getBook()->getCurrentTime();
00202           theNucleus->getStore()->getBook()->setFirstCollisionTime(t);
00203           theNucleus->getStore()->getBook()->setFirstCollisionXSec(oldXSec);
00204         }
00205     }
00206     return fs;
00207   }
00208 
00209   std::string BinaryCollisionAvatar::dump() const {
00210     std::stringstream ss;
00211     ss << "(avatar " << theTime <<" 'nn-collision" << std::endl
00212       << "(list " << std::endl
00213       << particle1->dump()
00214       << particle2->dump()
00215       << "))" << std::endl;
00216     return ss.str();
00217   }
00218 
00219 }

Generated on Mon May 27 17:48:33 2013 for Geant4 by  doxygen 1.4.7