StRoot  1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
EvtHepMCEvent.hh
1 //--------------------------------------------------------------------------
2 //
3 // Environment:
4 // This software is part of the EvtGen package. If you use all or part
5 // of it, please give an appropriate acknowledgement.
6 //
7 // Copyright Information: See EvtGen/COPYRIGHT
8 // Copyright (C) 2011 University of Warwick, UK
9 //
10 // Module: EvtHepMCEvent
11 //
12 // Description: Create an HepMC::GenEvent for the complete EvtParticle
13 // decay tree.
14 //
15 // Modification history:
16 //
17 // John Back June 2011 Module created
18 //
19 //------------------------------------------------------------------------
20 
21 #ifndef EVTHEPMCEVENT_HH
22 #define EVTHEPMCEVENT_HH
23 
24 #include "EvtGenBase/EvtVector4R.hh"
25 
26 #include "HepMC/GenEvent.h"
27 #include "HepMC/GenParticle.h"
28 #include "HepMC/SimpleVector.h"
29 
30 class EvtParticle;
31 
33 
34 public:
35 
36  EvtHepMCEvent();
37  virtual ~EvtHepMCEvent();
38 
39  // Select what frame a given GenParticle is in:
40  // its own restframe, the lab frame (first mother), or its mother's frame
41  enum HepMCFrame {RESTFRAME = 1, LAB = 2, MOTHER = 3};
42  // Select the GenParticle status
43  enum HepMCStatus {STABLE = 1, DECAYED = 2, HISTORY = 3};
44 
45  void constructEvent(EvtParticle* baseParticle);
46  void constructEvent(EvtParticle* baseParticle, EvtVector4R& translation);
47 
48  HepMC::GenEvent* getEvent() {return _theEvent;}
49 
50  // Methods used to create GenParticles and FourVectors of vertices.
51  // Make these public so that other classes may call them if they use EvtHepMCEvent.
52 
53  // Create a GenParticle using info from the EvtParticle, specifying what frame
54  // the 4-momentum is from.
55  HepMC::GenParticle* createGenParticle(EvtParticle* theParticle, int frameType);
56 
57  // Find out the decay vertex position for the given EvtParticle.
58  HepMC::FourVector getVertexCoord(EvtParticle* theParticle);
59 
60 protected:
61 
62 private:
63 
64  // Delete the event structure (called by destructor)
65  void deleteEvent();
66 
67  // Add a vertex to the event. This is called by the constructEvent function
68  // and is recursive, i.e. it loops through all possible daughter particles and
69  // their descendents.
70  void addVertex(EvtParticle* inEvtParticle, HepMC::GenParticle* inGenParticle);
71 
72  HepMC::GenEvent* _theEvent;
73  EvtVector4R _translation;
74 
75 };
76 
77 #endif
The GenEvent class is the core of HepMC.
Definition: GenEvent.h:155
FourVector is a simple representation of a physics 4 vector.
Definition: SimpleVector.h:42
The GenParticle class contains information about generated particles.
Definition: GenParticle.h:60