|
|
|||
File indexing completed on 2026-04-29 07:39: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 /// \file HepMCG4Interface.hh 0027 /// \brief Definition of the HepMCG4Interface class 0028 0029 #ifndef HEPMC_G4_INTERFACE_H 0030 #define HEPMC_G4_INTERFACE_H 0031 0032 #include "HepMC/GenEvent.h" 0033 0034 #include "G4VPrimaryGenerator.hh" 0035 0036 /// A base class for primary generation via HepMC object. 0037 /// This class is derived from G4VPrimaryGenerator. 0038 0039 class HepMCG4Interface : public G4VPrimaryGenerator 0040 { 0041 protected: 0042 // Note that the life of HepMC event object must be handled by users. 0043 // In the default implementation, a current HepMC event will be 0044 // deleted at GeneratePrimaryVertex() in the next event. 0045 HepMC::GenEvent* hepmcEvent; // (care for single event case only) 0046 0047 // We have to take care for the position of primaries because 0048 // primary vertices outside the world voulme give rise to G4Execption. 0049 // If the default implementation is not adequate, an alternative 0050 // can be implemented in your own class. 0051 virtual G4bool CheckVertexInsideWorld(const G4ThreeVector& pos) const; 0052 0053 // service method for conversion from HepMC::GenEvent to G4Event 0054 void HepMC2G4(const HepMC::GenEvent* hepmcevt, G4Event* g4event); 0055 0056 // Implement this method in his/her own concrete class. 0057 // An empty event will be created in default. 0058 virtual HepMC::GenEvent* GenerateHepMCEvent(); 0059 0060 public: 0061 HepMCG4Interface(); 0062 virtual ~HepMCG4Interface(); 0063 0064 // set/get methods 0065 HepMC::GenEvent* GetHepMCGenEvent() const; 0066 0067 // The default behavior is that a single HepMC event generated by 0068 // GenerateHepMCEvent() will be converted to G4Event through HepMC2G4(). 0069 virtual void GeneratePrimaryVertex(G4Event* anEvent); 0070 }; 0071 0072 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... 0073 inline HepMC::GenEvent* HepMCG4Interface::GetHepMCGenEvent() const 0074 { 0075 return hepmcEvent; 0076 } 0077 0078 #endif
| [ Source navigation ] | [ Diff markup ] | [ Identifier search ] | [ general search ] |
|
This page was automatically generated by the 2.3.7 LXR engine. The LXR team |
|