PandaRoot
3.52/src/eventRecordInterfaces/PhotosHEPEVTEvent.h
Go to the documentation of this file.
1 //****************************************************************************
2 //* This file is part of PandaRoot. *
3 //* *
4 //* PandaRoot is distributed under the terms of the *
5 //* GNU General Public License (GPL) version 3, *
6 //* copied verbatim in the file "LICENSE". *
7 //* *
8 //* Copyright (C) 2006 - 2024 FAIR GmbH and copyright holders of PandaRoot *
9 //* The copyright holders are listed in the file "COPYRIGHTHOLDERS". *
10 //* The authors are listed in the file "AUTHORS". *
11 //****************************************************************************
12 
13 //****************************************************************************
14 //* This file is part of PandaRoot. *
15 //* *
16 //* PandaRoot is distributed under the terms of the *
17 //* GNU General Public License (GPL) version 3, *
18 //* copied verbatim in the file "LICENSE". *
19 //* *
20 //* Copyright (C) 2006 - 2024 FAIR GmbH and copyright holders of PandaRoot *
21 //* The copyright holders are listed in the file "COPYRIGHTHOLDERS". *
22 //* The authors are listed in the file "AUTHORS". *
23 //****************************************************************************
24 
25 #ifndef _PhotosHEPEVTEvent_h_included_
26 #define _PhotosHEPEVTEvent_h_included_
27 
42 #include <iostream>
43 #include "PhotosEvent.h"
44 #include "PhotosParticle.h"
45 #include "PhotosHEPEVTParticle.h"
46 
47 namespace Photospp {
48 
49 // Uncomment this line to use interface to common block HEPEVT
50 // But first be sure about suitable for you value of NMXHEP
51 // and whether phep, vhep should be declared float or double
52 //#define USE_HEPEVT_INTERFACE
53 
54 #ifdef USE_HEPEVT_INTERFACE
55 
56 // Change this value to match HEPEVT size
57 const int NMXHEP = 10000;
58 
59 extern "C" struct {
60  int nevhep; // serial number
61  int nhep; // number of particles
62  int isthep[NMXHEP]; // status code
63  int idhep[NMXHEP]; // particle PDG ID
64  int jmohep[NMXHEP][2]; // parent particles
65  int jdahep[NMXHEP][2]; // childreen particles
66  double phep[NMXHEP][5]; // four-momentum, mass [GeV]
67  double vhep[NMXHEP][4]; // vertex [mm]
68 } hepevt_;
69 
70 #endif
71 
73 
74 class PhotosHEPEVTEvent : public PhotosEvent {
75 
76  public:
79 
82 
85 
88 
90  void setParticle(int i, PhotosHEPEVTParticle *p);
91 
93  int getParticleCount();
94 
96  std::vector<PhotosParticle *> getParticleList();
97 
99  void print();
100 
102  void clear();
103 
104 #ifdef USE_HEPEVT_INTERFACE
105 
106  static void read_event_from_HEPEVT(PhotosHEPEVTEvent *evt);
107 
109  static void write_event_to_HEPEVT(PhotosHEPEVTEvent *evt);
110 #endif
111 
112  private:
114  std::vector<PhotosHEPEVTParticle *> particle_list;
115 };
116 
117 } // namespace Photospp
118 #endif
double vhep[NMXHEP][4]
int isthep[NMXHEP]
unsigned int i
Definition: P4_F32vec4.h:33
Definition: Log.h:54
static const int NMXHEP
int idhep[NMXHEP]
double phep[NMXHEP][5]
Abstract base class for containing the event information.
int jdahep[NMXHEP][2]
std::vector< PhotosParticle * > getParticleList()
void setParticle(int i, PhotosHEPEVTParticle *p)
void addParticle(PhotosHEPEVTParticle *p)
PhotosHEPEVTParticle * getParticle(int i)
Single particle of HEPEVT event record.
int jmohep[NMXHEP][2]