G4CascadeRecoilMaker.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 #ifndef G4CASCADE_RECOIL_MAKER_HH
00027 #define G4CASCADE_RECOIL_MAKER_HH
00028 // $Id$
00029 //
00030 // Collects generated cascade data (using Collider::collide() interface)
00031 // and computes the nuclear recoil kinematics needed to balance the event.
00032 //
00033 // 20100909  M. Kelsey -- Inspired by G4CascadeCheckBalance
00034 // 20100909  M. Kelsey -- Move G4IntraNucleiCascader::goodCase() here, add
00035 //              tolerance for "almost zero" excitation energy, add function
00036 //              to manually override excitation energy
00037 // 20100910  M. Kelsey -- Drop getRecoilFragment() in favor of user calling
00038 //              makeRecoilFragment() with returned non-const pointer.  Drop
00039 //              handling of excitons.
00040 // 20100914  M. Kelsey -- Migrate to integer A and Z
00041 // 20100921  M. Kelsey -- Return G4InuclNuclei using "makeRecoilNuclei()".
00042 //              Repurpose "makeRecoilFragment()" to return G4Fragment.
00043 // 20100924  M. Kelsey -- Add raw excitation energy (mass difference) function
00044 // 20110214  M. Kelsey -- Replace "model" with G4InuclParticle::Model enum
00045 // 20110722  M. Kelsey -- For IntraNucleiCascader, take G4CollOut as argument
00046 
00047 #include <cmath>
00048 #include <vector>
00049 #include <CLHEP/Units/SystemOfUnits.h>
00050 
00051 #include "G4VCascadeCollider.hh"
00052 #include "globals.hh"
00053 #include "G4CollisionOutput.hh"
00054 #include "G4InuclNuclei.hh"
00055 #include "G4Fragment.hh"
00056 #include "G4LorentzVector.hh"
00057 
00058 class G4CascadParticle;
00059 class G4CascadeCheckBalance;
00060 class G4InuclElementaryParticle;
00061 class G4InuclParticle;
00062 
00063 
00064 class G4CascadeRecoilMaker : public G4VCascadeCollider {
00065 public:
00066   explicit G4CascadeRecoilMaker(G4double tolerance=0.001*CLHEP::MeV);
00067   virtual ~G4CascadeRecoilMaker();
00068 
00069   // Standard Collider interface (non-const output "buffer")
00070   void collide(G4InuclParticle* bullet, G4InuclParticle* target,
00071                G4CollisionOutput& output);
00072 
00073   // This is for use with G4IntraNucleiCascader
00074   void collide(G4InuclParticle* bullet, G4InuclParticle* target,
00075                G4CollisionOutput& output,
00076                const std::vector<G4CascadParticle>& cparticles);
00077 
00078   // Modifiable parameters
00079   void setTolerance(G4double tolerance) { excTolerance = tolerance; }
00080 
00081   void setRecoilExcitation(G4double Eexc) { excitationEnergy = Eexc; }
00082 
00083   // Build nucleus from current parameters, if physically reasonable
00084   G4InuclNuclei* makeRecoilNuclei(G4InuclParticle::Model model=G4InuclParticle::DefaultModel);
00085   G4Fragment* makeRecoilFragment();     // For use with PreCompound
00086 
00087   // Attach exciton configuration for use by "nucleus makers"
00088   void addExcitonConfiguration(const G4ExitonConfiguration exciton) {
00089     theExcitons = exciton;
00090   }
00091 
00092   // Access nuclear configuration parameters
00093   G4int getRecoilA() const { return recoilA; }
00094   G4int getRecoilZ() const { return recoilZ; }
00095   G4double getRecoilExcitation() const { return excitationEnergy; }
00096   const G4LorentzVector& getRecoilMomentum() const { return recoilMomentum; }
00097 
00098   // Data quality checks
00099   G4bool goodFragment() const;          // Verify A, Z both meaningful
00100   G4bool goodRecoil() const;            // And sensible four-vector
00101   G4bool wholeEvent() const;            // Zero recoil
00102   G4bool unphysicalRecoil() const { return !wholeEvent() && !goodRecoil(); }
00103 
00104   G4bool goodNucleus() const;   // Ensure that fragment is energetically okay
00105 
00106 protected:
00107   void fillRecoil();            // Set recoil parameters from CheckBalance
00108   G4double deltaM() const;      // Mass difference from current parameters
00109 
00110 private:
00111   G4CascadeCheckBalance* balance;       // Used to do kinematics calculations
00112 
00113   G4double excTolerance;        // Minimum excitation energy, rounds to zero
00114 
00115   G4double inputEkin;                   // Available initial kinetic energy
00116 
00117   G4int recoilA;                        // Nuclear parameters of recoil
00118   G4int recoilZ;
00119   G4LorentzVector recoilMomentum;
00120   G4double excitationEnergy;
00121 
00122   G4ExitonConfiguration theExcitons;    // Used by G4InuclNuclei and G4Fragment
00123 
00124   G4InuclNuclei theRecoilNuclei;        // Reusable buffers for recoil
00125   G4Fragment theRecoilFragment;
00126 };
00127 
00128 #endif  /* G4CASCADE_RECOIL_MAKER_HH */

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