Index: trunk/source/processes/hadronic/models/cascade/cascade/include/G4CollisionOutput.hh
===================================================================
--- trunk/source/processes/hadronic/models/cascade/cascade/include/G4CollisionOutput.hh	(revision 1337)
+++ trunk/source/processes/hadronic/models/cascade/cascade/include/G4CollisionOutput.hh	(revision 1340)
@@ -24,6 +24,6 @@
 // ********************************************************************
 //
-// $Id: G4CollisionOutput.hh,v 1.20.2.1 2010/06/25 09:43:06 gunter Exp $
-// Geant4 tag: $Name: geant4-09-04-beta-01 $
+// $Id: G4CollisionOutput.hh,v 1.29 2010/09/26 04:06:03 mkelsey Exp $
+// Geant4 tag: $Name: hadr-casc-V09-03-85 $
 //
 // 20100114  M. Kelsey -- Remove G4CascadeMomentum, use G4LorentzVector directly
@@ -32,25 +32,41 @@
 // 20100418  M. Kelsey -- Add function to boost output lists to lab frame
 // 20100520  M. Kelsey -- Add function to rotate Z axis, from G4Casc.Interface
+// 20100620  M. Kelsey -- Add setVerboseLevel() function
+// 20100715  M. Kelsey -- Add total charge and baryon number functions, and a
+//		combined "add()" function to put two of these together.
+// 20100716  M. Kelsey -- Add interface to handle G4CascadParticles
+// 20100924  M. Kelsey -- Use "OutgoingNuclei" name consistently, replacing
+//		old "TargetFragment".  Add new (reusable) G4Fragment buffer 
+//		and access functions for initial post-cascade processing.
+//		Move implementation of add() to .cc file.
+// 20100925  M. Kelsey -- Add function to process G4ReactionProduct list
 
 #ifndef G4COLLISION_OUTPUT_HH
 #define G4COLLISION_OUTPUT_HH
 
+#include "G4Fragment.hh"
 #include "G4InuclElementaryParticle.hh"
 #include "G4InuclNuclei.hh"
 #include "G4LorentzRotation.hh"
+#include "G4ReactionProductVector.hh"
 #include <algorithm>
 #include <vector>
 
+class G4CascadParticle;
 class G4LorentzConvertor;
 
+
 class G4CollisionOutput {
-
 public:
-
   G4CollisionOutput();
-
   G4CollisionOutput& operator=(const G4CollisionOutput& right);
 
-  void reset();
+  void setVerboseLevel(G4int verbose) { verboseLevel = verbose; };
+
+  // ===== Accumulate contents of lists =====
+
+  void reset();		// Empties lists for new event
+
+  void add(const G4CollisionOutput& right);	// Merge complete objects
 
   void addOutgoingParticle(const G4InuclElementaryParticle& particle) {
@@ -60,56 +76,72 @@
   void addOutgoingParticles(const std::vector<G4InuclElementaryParticle>& particles);
 
-  void addTargetFragment(const G4InuclNuclei& nuclei) {
-    nucleiFragments.push_back(nuclei);
+  void addOutgoingNucleus(const G4InuclNuclei& nuclei) {
+    outgoingNuclei.push_back(nuclei);
   };
 
-  void addTargetFragments(const std::vector<G4InuclNuclei>& nuclea);
+  void addOutgoingNuclei(const std::vector<G4InuclNuclei>& nuclea);
 
+  // These are primarily for G4IntraNucleiCascader internal checks
+  void addOutgoingParticle(const G4CascadParticle& cparticle);
+  void addOutgoingParticles(const std::vector<G4CascadParticle>& cparticles);
+
+  void addOutgoingParticles(const G4ReactionProductVector* rproducts);
+
+  // Special buffer for initial, possible unstable fragment from cascade
+  void addRecoilFragment(const G4Fragment* aFragment) {
+    if (aFragment) addRecoilFragment(*aFragment);
+  }
+
+  void addRecoilFragment(const G4Fragment& aFragment) {
+    theRecoilFragment = aFragment;
+  }
+
+  // ===== Access contents of lists =====
+
+  G4int numberOfOutgoingParticles() const { return outgoingParticles.size(); }
+    
   const std::vector<G4InuclElementaryParticle>& getOutgoingParticles() const {
     return outgoingParticles;
   };
 
-  G4int numberOfNucleiFragments() const { 
-    return nucleiFragments.size(); 
-  };
+  G4int numberOfOutgoingNuclei() const { return outgoingNuclei.size(); };
  
-  const std::vector<G4InuclNuclei>& getNucleiFragments() const {
-    return nucleiFragments;
+  const std::vector<G4InuclNuclei>& getOutgoingNuclei() const {
+    return outgoingNuclei;
   };
 
+  const G4Fragment& getRecoilFragment() const { return theRecoilFragment; }
+
+  // ===== Get event totals for conservation checking, recoil, etc. ======
+
   G4LorentzVector getTotalOutputMomentum() const;
+  G4int getTotalCharge() const;			// NOTE:  No fractional charges!
+  G4int getTotalBaryonNumber() const;
 
   void printCollisionOutput() const;
 
+  // ===== Manipulate final-state particles for kinematics =====
+
   void boostToLabFrame(const G4LorentzConvertor& convertor);
-
   void rotateEvent(const G4LorentzRotation& rotate);
-
-  void trivialise(G4InuclParticle* bullet, 
-		  G4InuclParticle* target);
-
-  void setOnShell(G4InuclParticle* bullet, 
-		  G4InuclParticle* target);
-
+  void trivialise(G4InuclParticle* bullet, G4InuclParticle* target);
+  void setOnShell(G4InuclParticle* bullet, G4InuclParticle* target);
   void setRemainingExitationEnergy();
 
-  double getRemainingExitationEnergy() const { 
-    return eex_rest; 
-  };
-
-  G4bool acceptable() const { 
-    return on_shell; 
-  };
+  double getRemainingExitationEnergy() const { return eex_rest; };
+  G4bool acceptable() const { return on_shell; };
 
 private: 
   G4int verboseLevel;
+
   std::vector<G4InuclElementaryParticle> outgoingParticles;
-  std::vector<G4InuclNuclei> nucleiFragments;
-  G4double eex_rest;
+  std::vector<G4InuclNuclei> outgoingNuclei;
+  G4Fragment theRecoilFragment;
+
+  G4double eex_rest;		// Used by setOnShell() for kinematics
 
   std::pair<std::pair<G4int,G4int>, G4int> selectPairToTune(G4double de) const; 
 
   G4bool on_shell;
-
 };        
 
