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 // 00028 // 20100518 M. Kelsey -- Why use std::pair<> at all? Never exported; just 00029 // store pointers. Add clear() function. Move code from 00030 // Colliders' "bulletTargetSetter()" to set(). 00031 00032 #ifndef G4INTERACTION_CASE_HH 00033 #define G4INTERACTION_CASE_HH 00034 00035 #include "globals.hh" 00036 00037 class G4InuclParticle; 00038 00039 00040 class G4InteractionCase { 00041 public: 00042 G4InteractionCase() : bullet(0), target(0), inter_case(0) {} 00043 00044 G4InteractionCase(G4InuclParticle* part1, G4InuclParticle* part2) { 00045 set(part1, part2); 00046 } 00047 00048 void set(G4InuclParticle* part1, G4InuclParticle* part2); 00049 00050 void clear() { 00051 bullet = target = 0; 00052 inter_case = 0; 00053 } 00054 00055 G4InuclParticle* getBullet() const { return bullet; } 00056 G4InuclParticle* getTarget() const { return target; } 00057 00058 G4bool valid() const { return inter_case != 0; } 00059 00060 G4bool twoNuclei() const { return inter_case == -2; } 00061 G4bool hadNucleus() const { return inter_case == -1; } 00062 G4int hadrons() const { return inter_case; } // "rtype" or "is" code 00063 00064 // For compatibility with G4IntraNucleiCascader code 00065 G4int code() const { return ((inter_case<0) ? -inter_case : 0); } 00066 00067 private: 00068 G4InuclParticle* bullet; 00069 G4InuclParticle* target; 00070 00071 G4int inter_case; 00072 }; 00073 00074 #endif // G4INTERACTION_CASE_HH 00075 00076