BOSS 7.1.2
BESIII Offline Software System
Loading...
Searching...
No Matches
G4HepMCParticle.h
Go to the documentation of this file.
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//
27// $Id: G4HepMCParticle.h,v 1.2 2022/01/24 23:15:49 dengzy Exp $
28// GEANT4 tag $Name: G4Svc-00-01-56 $
29//
30//
31
32
33#ifndef G4HepMCParticle_h
34#define G4HepMCParticle_h 1
35
36#include "globals.hh"
37#include "G4Allocator.hh"
38#include "G4PrimaryParticle.hh"
39
40// class desccription:
41//
42// This class is exclusively used by G4HepMCInterface.
43
45{
46 public:
47 inline void *operator new(size_t);
48 inline void operator delete(void *aStackedTrack);
49
51 G4HepMCParticle(G4PrimaryParticle* pp,G4int isthep, G4int barcode);
53
54 const G4HepMCParticle & operator=(const G4HepMCParticle &right);
55 G4int operator==(const G4HepMCParticle &right) const;
56 G4int operator!=(const G4HepMCParticle &right) const;
57
58 private:
59 G4PrimaryParticle * theParticle;
60 G4int ISTHEP; // Status code of the entry
61 // Set to be 0 after generating links of
62 // G4PrimaryParticle object
63 G4int barcodeEndVtx;
64 public:
65 inline G4PrimaryParticle * GetTheParticle()
66 { return theParticle; }
67 inline void Done()
68 { ISTHEP *= -1; }
69 inline G4int GetISTHEP()
70 { return ISTHEP; }
71 inline G4int GetBarcodeEndVtx()
72 { return barcodeEndVtx;}
73};
74
75extern G4ThreadLocal G4Allocator<G4HepMCParticle> *aHepMCParticleAllocator;
76
77// #if defined G4EVENT_ALLOC_EXPORT
78// extern G4DLLEXPORT G4Allocator<G4HepMCParticle> aHEPEvtParticleAllocator;
79// #else
80// extern G4DLLIMPORT G4Allocator<G4HepMCParticle> aHEPEvtParticleAllocator;
81// #endif
82
83inline void * G4HepMCParticle::operator new(size_t)
84{
86 aHepMCParticleAllocator = new G4Allocator<G4HepMCParticle>;
87 }
88 // void * aHEPEvtParticle;
89 // aHEPEvtParticle = (void *) aHEPEvtParticleAllocator.MallocSingle();
90 return aHepMCParticleAllocator->MallocSingle();;
91}
92
93inline void G4HepMCParticle::operator delete(void * aHEPEvtParticle)
94{
95 // aHEPEvtParticleAllocator.FreeSingle((G4HepMCParticle *) aHEPEvtParticle);
96 aHepMCParticleAllocator->FreeSingle((G4HepMCParticle *) aHEPEvtParticle);
97}
98
99
100#endif
101
**********INTEGER nmxhep !maximum number of particles DOUBLE PRECISION vhep INTEGER isthep
G4ThreadLocal G4Allocator< G4HepMCParticle > * aHepMCParticleAllocator
G4int operator==(const G4HepMCParticle &right) const
const G4HepMCParticle & operator=(const G4HepMCParticle &right)
G4PrimaryParticle * GetTheParticle()
G4int operator!=(const G4HepMCParticle &right) const