G4CascadeInterface.hh

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$
00027 // Defines an interface to Bertini (BERT) cascade
00028 // based on INUCL  intra-nuclear transport.models 
00029 // with bullet hadron energy ~< 10 GeV
00030 //
00031 // 20100405  M. Kelsey -- Fix constness of op== and op!=
00032 // 20100519  M. Kelsey -- Remove Collider data members
00033 // 20100617  M. Kelsey -- Make G4InuclCollider a local data member
00034 // 20100723  M. Kelsey -- Move G4CollisionOutput here for reuse
00035 // 20100916  M. Kelsey -- Add functions to encapsulate ApplyYourself() actions,
00036 //              make colliders pointers (don't expose dependencies)
00037 // 20100922  M. Kelsey -- Add functions to select de-excitation method
00038 // 20110224  M. Kelsey -- Add createTarget() for use with Propagate(); split
00039 //              conservation law messages to separate function.  Move verbose
00040 //              setting to .cc file, and apply to all member objects.
00041 // 20110301  M. Kelsey -- Add copyPreviousCascade() for use with Propagate()  
00042 //              along with new buffers and related particle-conversion  
00043 //              functions.  Encapulate buffer deletion in clear()
00044 // 20110303  M. Kelsey -- Change "bulletList" name to "inputFragments"
00045 // 20110304  M. Kelsey -- Drop conversion of Propagate() arguments; pass
00046 //              directly to collider for processing.  Rename makeReactionProduct
00047 //              to makeDynamicParticle.
00048 // 20110502  M. Kelsey -- Add filename string to capture random seeds.
00049 // 20110720  M. Kelsey -- Discard elastic-cut array (no longer needed),
00050 //              discard local "theFinalState" (avail in base class).
00051 // 20110801  M. Kelsey -- Make bullet and target buffers local objects (with
00052 //              hadron and nucleus versions) to reduce memory churn
00053 // 20120522  M. Kelsey -- Implement base class IsApplicable, and add overloaded
00054 //              version which takes G4ParticleDefintion, a la G4VProcess.
00055 // 20120822  M. Kelsey -- Add function to dump user configuration settings.
00056 //              Remove local verboseLevel; shadows base class data member.
00057 
00058 #ifndef G4CASCADEINTERFACE_H
00059 #define G4CASCADEINTERFACE_H 1
00060 
00061 #include "G4VIntraNuclearTransportModel.hh"
00062 #include "G4FragmentVector.hh"
00063 #include "G4InuclElementaryParticle.hh"
00064 #include "G4InuclNuclei.hh"
00065 #include "G4LorentzRotation.hh"
00066 #include "G4Nucleon.hh"
00067 #include "G4Nucleus.hh"
00068 #include "G4ParticleChange.hh"
00069 #include "G4ReactionProduct.hh"
00070 #include "G4ReactionProductVector.hh"
00071 #include <vector>
00072 
00073 class G4CascadParticle;
00074 class G4CascadeCheckBalance;
00075 class G4CollisionOutput;
00076 class G4DynamicParticle;
00077 class G4HadFinalState;
00078 class G4InuclCollider;
00079 class G4InuclParticle;
00080 class G4ParticleDefinition;
00081 class G4V3DNucleus;
00082 
00083 
00084 class G4CascadeInterface : public G4VIntraNuclearTransportModel {
00085 
00086 public:
00087   G4CascadeInterface(const G4String& name = "BertiniCascade");
00088 
00089   virtual ~G4CascadeInterface();
00090 
00091   G4ReactionProductVector* Propagate(G4KineticTrackVector* theSecondaries,
00092                                      G4V3DNucleus* theNucleus);
00093   
00094   G4HadFinalState* ApplyYourself(const G4HadProjectile& aTrack,
00095                                  G4Nucleus& theNucleus);
00096 
00097   void SetVerboseLevel(G4int verbose);          // Overrides base class
00098 
00099   G4bool IsApplicable(const G4HadProjectile& aTrack,
00100                       G4Nucleus& theNucleus);
00101 
00102   G4bool IsApplicable(const G4ParticleDefinition* aPD) const;
00103 
00104   // Select betweeen different post-cascade de-excitation models
00105   void useCascadeDeexcitation();
00106   void usePreCompoundDeexcitation();
00107 
00108   virtual void ModelDescription(std::ostream& outFile) const;
00109   virtual void DumpConfiguration(std::ostream& outFile) const;
00110 
00111 protected:
00112   void clear();                 // Delete previously created particles
00113 
00114   // Convert input projectile and target to Bertini internal types
00115   G4bool createBullet(const G4HadProjectile& aTrack);
00116   G4bool createTarget(G4Nucleus& theNucleus);
00117   G4bool createTarget(G4V3DNucleus* theNucleus);
00118   G4bool createTarget(G4int A, G4int Z);
00119 
00120   // Evaluate whether any outgoing particles penetrated Coulomb barrier
00121   G4bool coulombBarrierViolation() const;
00122 
00123   // Conditions for rejecting cascade attempt
00124   G4bool retryInelasticProton() const;
00125   G4bool retryInelasticNucleus() const;
00126 
00127   // Transfer Bertini internal final state to hadronics interface
00128   void copyOutputToHadronicResult();
00129   G4ReactionProductVector* copyOutputToReactionProducts();
00130 
00131   // Replicate input particles onto output
00132   G4HadFinalState* NoInteraction(const G4HadProjectile& aTrack,
00133                                  G4Nucleus& theNucleus);
00134 
00135   // Report violations of conservation laws in original frame
00136   void checkFinalResult();
00137 
00138   // Terminate job because of energy/momentum/etc. violations
00139   void throwNonConservationFailure();
00140 
00141   // Convert between Bertini and external particle types
00142   G4DynamicParticle* makeDynamicParticle(const G4InuclElementaryParticle& iep) const;
00143   G4DynamicParticle* makeDynamicParticle(const G4InuclNuclei& inuc) const;
00144 
00145 
00146 private:
00147   G4int operator==(const G4CascadeInterface& right) const {
00148     return (this == &right);
00149   }
00150 
00151   G4int operator!=(const G4CascadeInterface& right) const {
00152     return (this != &right);
00153   }
00154 
00155   static const G4String randomFile;     // Filename to capture random seeds
00156   static const G4int maximumTries;      // Number of iterations for inelastic
00157 
00158   G4int numberOfTries;
00159 
00160   G4InuclCollider* collider;
00161   G4CascadeCheckBalance* balance;
00162 
00163   G4InuclParticle* bullet;              // Pointers to last filled versions
00164   G4InuclParticle* target;
00165 
00166   G4CollisionOutput* output;
00167 
00168   G4InuclElementaryParticle hadronBullet;       // Buffers for bullet, target
00169   G4InuclNuclei             nucleusBullet;
00170 
00171   G4InuclElementaryParticle hadronTarget;
00172   G4InuclNuclei             nucleusTarget;
00173 
00174   G4LorentzRotation bulletInLabFrame;
00175 };
00176 
00177 #endif // G4CASCADEINTERFACE_H

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