OPAL (Object Oriented Parallel Accelerator Library)  2021.1.99
OPAL
H5PartWrapperForPC.h
Go to the documentation of this file.
1 #ifndef OPAL_H5PARTWRAPPERFORPC_H
2 #define OPAL_H5PARTWRAPPERFORPC_H
3 
9 
10 #include "Algorithms/Vektor.h"
11 
12 #include "H5hut.h"
13 
15 public:
16  H5PartWrapperForPC(const std::string &fileName, h5_int32_t flags = H5_O_WRONLY);
17  H5PartWrapperForPC(const std::string &fileName, int restartStep, std::string sourceFile, h5_int32_t flags = H5_O_RDWR);
18  virtual ~H5PartWrapperForPC();
19 
20  virtual void readHeader();
21  virtual void readStep(PartBunchBase<double, 3>*, h5_ssize_t firstParticle, h5_ssize_t lastParticle);
22 
23  virtual void writeHeader();
24  virtual void writeStep(PartBunchBase<double, 3>*, const std::map<std::string, double> &additionalStepAttributes);
25 
26  virtual bool predecessorIsSameFlavour() const;
27 
28  bool getPreviousH5Local() const;
29  double getReferenceR() const;
30  double getReferenceT() const;
31  double getReferenceZ() const;
32  double getReferencePr() const;
33  double getReferencePt() const;
34  double getReferencePz() const;
35  double getMeanKineticEnergy() const;
36  double getMeanMomentum() const;
37  double getAzimuth() const;
38  double getElevation() const;
39 private:
41  void readStepData(PartBunchBase<double, 3>*, h5_ssize_t , h5_ssize_t);
42 
43  void writeStepHeader(PartBunchBase<double, 3>*, const std::map<std::string, double> &);
45 
49  h5_float64_t meanE_m;
50  h5_float64_t meanMomentum_m;
51  h5_float64_t azimuth_m;
52  h5_float64_t elevation_m;
53 };
54 
55 inline
57  return (predecessorOPALFlavour_m == "opal-cycl");
58 }
59 
60 inline
62  return previousH5Local_m;
63 }
64 
65 inline
67  return referenceLocation_m[0];
68 }
69 
70 inline
72  return referenceLocation_m[1];
73 }
74 
75 inline
77  return referenceLocation_m[2];
78 }
79 
80 inline
82  return referenceMomentum_m[0];
83 }
84 
85 inline
87  return referenceMomentum_m[1];
88 }
89 
90 inline
92  return referenceMomentum_m[2];
93 }
94 
95 inline
97  return meanE_m;
98 }
99 
100 inline
102  return meanMomentum_m;
103 }
104 
105 inline
107  return azimuth_m;
108 }
109 
110 inline
112  return elevation_m;
113 }
114 
115 #endif //OPAL_H5PARTWRAPPERFORPC_H
std::string predecessorOPALFlavour_m
Definition: H5PartWrapper.h:75
double getReferencePz() const
virtual void writeStep(PartBunchBase< double, 3 > *, const std::map< std::string, double > &additionalStepAttributes)
void readStepData(PartBunchBase< double, 3 > *, h5_ssize_t, h5_ssize_t)
double getReferenceZ() const
double getAzimuth() const
h5_float64_t elevation_m
void readStepHeader(PartBunchBase< double, 3 > *)
bool getPreviousH5Local() const
virtual bool predecessorIsSameFlavour() const
virtual void writeHeader()
H5PartWrapperForPC(const std::string &fileName, h5_int32_t flags=H5_O_WRONLY)
void writeStepData(PartBunchBase< double, 3 > *)
double getElevation() const
double getReferencePr() const
double getReferenceT() const
double getReferenceR() const
h5_float64_t meanMomentum_m
double getMeanMomentum() const
double getMeanKineticEnergy() const
double getReferencePt() const
virtual void readHeader()
void writeStepHeader(PartBunchBase< double, 3 > *, const std::map< std::string, double > &)
virtual void readStep(PartBunchBase< double, 3 > *, h5_ssize_t firstParticle, h5_ssize_t lastParticle)