Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-18 09:59:00

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 //      GEANT4 Class file
0028 //
0029 //
0030 //      File name:    G4QMDSystem.hh 
0031 //
0032 //      Author: Koi, Tatsumi (tkoi@slac.stanford.edu)       
0033 // 
0034 //      Creation date: 29 March 2007
0035 // -----------------------------------------------------------------------------
0036 //
0037 // 080602 Fix memory leaks by T. Koi 
0038 // 081120 Add EraseParticipant and InsertParticipant Methods by T. Koi
0039 
0040 #ifndef G4QMDSystem_hh
0041 #define G4QMDSystem_hh
0042 
0043 #include "G4QMDParticipant.hh"
0044 
0045 class G4QMDSystem 
0046 {
0047    public:
0048 
0049       G4QMDSystem();
0050       virtual ~G4QMDSystem();
0051 
0052       void SetParticipant( G4QMDParticipant* particle )
0053       {
0054         participants.push_back ( particle );
0055       }
0056 
0057       void SetSystem ( G4QMDSystem* , G4ThreeVector , G4ThreeVector );
0058 
0059       void SubtractSystem ( G4QMDSystem* );
0060 
0061       G4QMDParticipant* EraseParticipant( G4int i )
0062       {
0063         G4QMDParticipant* particle =  participants[ i ];
0064         participants.erase(std::find( participants.cbegin(),
0065                                       participants.cend(), participants[ i ]));
0066         return particle;
0067       }
0068 
0069       void DeleteParticipant( G4int i )
0070       {
0071         delete participants[ i ];
0072         participants.erase(std::find ( participants.cbegin(),
0073                                        participants.cend(), participants[ i ]));
0074       }
0075 
0076       void InsertParticipant( G4QMDParticipant* particle , G4int j );
0077 
0078       G4int GetTotalNumberOfParticipant()
0079       {
0080         return (G4int)participants.size();
0081       }
0082 
0083       G4QMDParticipant* GetParticipant( G4int i )
0084       {
0085         return participants[i];
0086       }
0087 
0088       void IncrementCollisionCounter()
0089       {
0090         ++numberOfCollision;
0091       }
0092 
0093       G4int GetNOCollision()
0094       {
0095         return numberOfCollision;
0096       }
0097 
0098       void ShowParticipants();
0099 
0100       void Clear();
0101 
0102    protected:
0103       std::vector< G4QMDParticipant* > participants;
0104 
0105    private:
0106       G4int numberOfCollision;
0107 };
0108 
0109 #endif