source: trunk/source/processes/hadronic/models/cascade/cascade/include/G4CollisionOutput.hh @ 1340

Last change on this file since 1340 was 1340, checked in by garnier, 14 years ago

update ti head

File size: 5.8 KB
Line 
1//
2// ********************************************************************
3// * License and Disclaimer                                           *
4// *                                                                  *
5// * The  Geant4 software  is  copyright of the Copyright Holders  of *
6// * the Geant4 Collaboration.  It is provided  under  the terms  and *
7// * conditions of the Geant4 Software License,  included in the file *
8// * LICENSE and available at  http://cern.ch/geant4/license .  These *
9// * include a list of copyright holders.                             *
10// *                                                                  *
11// * Neither the authors of this software system, nor their employing *
12// * institutes,nor the agencies providing financial support for this *
13// * work  make  any representation or  warranty, express or implied, *
14// * regarding  this  software system or assume any liability for its *
15// * use.  Please see the license in the file  LICENSE  and URL above *
16// * for the full disclaimer and the limitation of liability.         *
17// *                                                                  *
18// * This  code  implementation is the result of  the  scientific and *
19// * technical work of the GEANT4 collaboration.                      *
20// * By using,  copying,  modifying or  distributing the software (or *
21// * any work based  on the software)  you  agree  to acknowledge its *
22// * use  in  resulting  scientific  publications,  and indicate your *
23// * acceptance of all terms of the Geant4 Software license.          *
24// ********************************************************************
25//
26// $Id: G4CollisionOutput.hh,v 1.29 2010/09/26 04:06:03 mkelsey Exp $
27// Geant4 tag: $Name: hadr-casc-V09-03-85 $
28//
29// 20100114  M. Kelsey -- Remove G4CascadeMomentum, use G4LorentzVector directly
30// 20100407  M. Kelsey -- Replace ::resize(0) with ::clear()
31// 20100409  M. Kelsey -- Move function code to .cc files, not inlinable
32// 20100418  M. Kelsey -- Add function to boost output lists to lab frame
33// 20100520  M. Kelsey -- Add function to rotate Z axis, from G4Casc.Interface
34// 20100620  M. Kelsey -- Add setVerboseLevel() function
35// 20100715  M. Kelsey -- Add total charge and baryon number functions, and a
36//              combined "add()" function to put two of these together.
37// 20100716  M. Kelsey -- Add interface to handle G4CascadParticles
38// 20100924  M. Kelsey -- Use "OutgoingNuclei" name consistently, replacing
39//              old "TargetFragment".  Add new (reusable) G4Fragment buffer
40//              and access functions for initial post-cascade processing.
41//              Move implementation of add() to .cc file.
42// 20100925  M. Kelsey -- Add function to process G4ReactionProduct list
43
44#ifndef G4COLLISION_OUTPUT_HH
45#define G4COLLISION_OUTPUT_HH
46
47#include "G4Fragment.hh"
48#include "G4InuclElementaryParticle.hh"
49#include "G4InuclNuclei.hh"
50#include "G4LorentzRotation.hh"
51#include "G4ReactionProductVector.hh"
52#include <algorithm>
53#include <vector>
54
55class G4CascadParticle;
56class G4LorentzConvertor;
57
58
59class G4CollisionOutput {
60public:
61  G4CollisionOutput();
62  G4CollisionOutput& operator=(const G4CollisionOutput& right);
63
64  void setVerboseLevel(G4int verbose) { verboseLevel = verbose; };
65
66  // ===== Accumulate contents of lists =====
67
68  void reset();         // Empties lists for new event
69
70  void add(const G4CollisionOutput& right);     // Merge complete objects
71
72  void addOutgoingParticle(const G4InuclElementaryParticle& particle) {
73    outgoingParticles.push_back(particle);
74  }
75
76  void addOutgoingParticles(const std::vector<G4InuclElementaryParticle>& particles);
77
78  void addOutgoingNucleus(const G4InuclNuclei& nuclei) {
79    outgoingNuclei.push_back(nuclei);
80  };
81
82  void addOutgoingNuclei(const std::vector<G4InuclNuclei>& nuclea);
83
84  // These are primarily for G4IntraNucleiCascader internal checks
85  void addOutgoingParticle(const G4CascadParticle& cparticle);
86  void addOutgoingParticles(const std::vector<G4CascadParticle>& cparticles);
87
88  void addOutgoingParticles(const G4ReactionProductVector* rproducts);
89
90  // Special buffer for initial, possible unstable fragment from cascade
91  void addRecoilFragment(const G4Fragment* aFragment) {
92    if (aFragment) addRecoilFragment(*aFragment);
93  }
94
95  void addRecoilFragment(const G4Fragment& aFragment) {
96    theRecoilFragment = aFragment;
97  }
98
99  // ===== Access contents of lists =====
100
101  G4int numberOfOutgoingParticles() const { return outgoingParticles.size(); }
102   
103  const std::vector<G4InuclElementaryParticle>& getOutgoingParticles() const {
104    return outgoingParticles;
105  };
106
107  G4int numberOfOutgoingNuclei() const { return outgoingNuclei.size(); };
108 
109  const std::vector<G4InuclNuclei>& getOutgoingNuclei() const {
110    return outgoingNuclei;
111  };
112
113  const G4Fragment& getRecoilFragment() const { return theRecoilFragment; }
114
115  // ===== Get event totals for conservation checking, recoil, etc. ======
116
117  G4LorentzVector getTotalOutputMomentum() const;
118  G4int getTotalCharge() const;                 // NOTE:  No fractional charges!
119  G4int getTotalBaryonNumber() const;
120
121  void printCollisionOutput() const;
122
123  // ===== Manipulate final-state particles for kinematics =====
124
125  void boostToLabFrame(const G4LorentzConvertor& convertor);
126  void rotateEvent(const G4LorentzRotation& rotate);
127  void trivialise(G4InuclParticle* bullet, G4InuclParticle* target);
128  void setOnShell(G4InuclParticle* bullet, G4InuclParticle* target);
129  void setRemainingExitationEnergy();
130
131  double getRemainingExitationEnergy() const { return eex_rest; };
132  G4bool acceptable() const { return on_shell; };
133
134private: 
135  G4int verboseLevel;
136
137  std::vector<G4InuclElementaryParticle> outgoingParticles;
138  std::vector<G4InuclNuclei> outgoingNuclei;
139  G4Fragment theRecoilFragment;
140
141  G4double eex_rest;            // Used by setOnShell() for kinematics
142
143  std::pair<std::pair<G4int,G4int>, G4int> selectPairToTune(G4double de) const; 
144
145  G4bool on_shell;
146};       
147
148#endif // G4COLLISION_OUTPUT_HH
149
Note: See TracBrowser for help on using the repository browser.