Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-18 09:58:03

0001 //
0002 // ********************************************************************
0003 // * License and Disclaimer                                           *
0004 // *                                                                  *
0005 // * The  Geant4 software  is  copyright of the Copyright Holders  of *
0006 // * the Geant4 Collaboration.  It is provided  under  the terms  and *
0007 // * conditions of the Geant4 Software License,  included in the file *
0008 // * LICENSE and available at  http://cern.ch/geant4/license .  These *
0009 // * include a list of copyright holders.                             *
0010 // *                                                                  *
0011 // * Neither the authors of this software system, nor their employing *
0012 // * institutes,nor the agencies providing financial support for this *
0013 // * work  make  any representation or  warranty, express or implied, *
0014 // * regarding  this  software system or assume any liability for its *
0015 // * use.  Please see the license in the file  LICENSE  and URL above *
0016 // * for the full disclaimer and the limitation of liability.         *
0017 // *                                                                  *
0018 // * This  code  implementation is the result of  the  scientific and *
0019 // * technical work of the GEANT4 collaboration.                      *
0020 // * By using,  copying,  modifying or  distributing the software (or *
0021 // * any work based  on the software)  you  agree  to acknowledge its *
0022 // * use  in  resulting  scientific  publications,  and indicate your *
0023 // * acceptance of all terms of the Geant4 Software license.          *
0024 // ********************************************************************
0025 //
0026 //
0027 //
0028 // -----------------------------------------------------------------------------
0029 //      GEANT 4 class header file
0030 //
0031 //      History: first implementation, A. Feliciello, 30th June 1998
0032 
0033 // -----------------------------------------------------------------------------
0034 
0035 #ifndef G4CollisionInitialState_hh
0036 #define G4CollisionInitialState_hh
0037 
0038 #include "G4KineticTrack.hh"
0039 #include "G4KineticTrackVector.hh"
0040 #include "G4HadTmpUtil.hh"
0041 
0042 class G4BCAction;
0043 
0044 class G4CollisionInitialState
0045 {
0046 
0047 public:
0048   G4CollisionInitialState();
0049   G4CollisionInitialState(G4double time, G4KineticTrack * aPrimary,
0050               G4KineticTrack * aTarget);
0051   G4CollisionInitialState(G4double time, G4KineticTrack * aPrimary,
0052               const G4KineticTrackVector & aTarget,
0053               G4BCAction * aFSGenerator);
0054 
0055   ~G4CollisionInitialState() { }
0056 
0057   G4CollisionInitialState(const G4CollisionInitialState & right);
0058   G4CollisionInitialState & operator=(const G4CollisionInitialState & right);
0059 
0060   G4bool operator<(const G4CollisionInitialState & right) const
0061     {return (theCollisionTime < right.theCollisionTime);}
0062 
0063   G4bool operator==(const G4CollisionInitialState& right) const
0064     {return (theCollisionTime == right.theCollisionTime);}
0065 
0066 
0067   G4KineticTrack * GetPrimary(void)
0068     {return thePrimary;}
0069   void SetPrimary(G4KineticTrack * aPrimary)
0070     {thePrimary = aPrimary;}
0071 
0072   G4KineticTrack * GetTarget(void)
0073     {return theTarget;}
0074   void SetTarget(G4KineticTrack * aTarget)
0075     {theTarget = aTarget;}
0076 
0077   void AddTarget(G4KineticTrack * aTarget)
0078     {theTs.push_back(aTarget);}
0079   G4KineticTrackVector  & GetTargetCollection(void)
0080     {return theTs;}
0081   G4KineticTrackVector * GetFinalState();
0082   G4int GetTargetBaryonNumber()
0083   {
0084     G4double result=0;
0085     for(size_t i=0; i<theTs.size(); i++)
0086     {
0087       result += theTs[i]->GetDefinition()->GetBaryonNumber();
0088     }
0089     return G4lrint(result);
0090   }
0091   G4int GetTargetCharge()
0092   {
0093     G4double result=0;
0094     for(size_t i=0; i<theTs.size(); i++)
0095     {
0096       result += theTs[i]->GetDefinition()->GetPDGCharge();
0097     }
0098     return G4lrint(result);
0099   }
0100 
0101 // -new interface post pion:
0102 
0103   G4double GetCollisionTime(void)
0104     {return theCollisionTime;}
0105   void SetCollisionTime(G4double value)
0106     {theCollisionTime = value;}
0107 
0108 // for debugging only
0109 const G4BCAction * GetGenerator()
0110   {
0111     return theFSGenerator;
0112   }
0113 
0114 
0115   void Print() const;
0116 
0117 //  friend std::ostream& operator<<(std::ostream & out, const G4CollisionInitialState & collision){
0118 //  out=1;
0119 //  return out;
0120 //  }
0121 
0122 
0123 private:
0124 
0125   G4double theCollisionTime;
0126   G4KineticTrack * thePrimary;
0127   G4KineticTrack * theTarget;
0128   G4KineticTrackVector theTs;
0129   G4BCAction * theFSGenerator;
0130 };
0131 
0132 #endif
0133 
0134