OPAL (Object Oriented Parallel Accelerator Library)  2.2.0
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/PBunchDefs.h"
12 
13 #include "H5hut.h"
14 
16 public:
17  H5PartWrapperForPC(const std::string &fileName, h5_int32_t flags = H5_O_WRONLY);
18  H5PartWrapperForPC(const std::string &fileName, int restartStep, std::string sourceFile, h5_int32_t flags = H5_O_RDWR);
19  virtual ~H5PartWrapperForPC();
20 
21  virtual void readHeader();
22  virtual void readStep(PartBunchBase<double, 3>*, h5_ssize_t firstParticle, h5_ssize_t lastParticle);
23 
24  virtual void writeHeader();
25  virtual void writeStep(PartBunchBase<double, 3>*, const std::map<std::string, double> &additionalStepAttributes);
26 
27  virtual bool predecessorIsSameFlavour() const;
28 
29  bool getPreviousH5Local() const;
30  double getReferenceR() const;
31  double getReferenceT() const;
32  double getReferenceZ() const;
33  double getReferencePr() const;
34  double getReferencePt() const;
35  double getReferencePz() const;
36  double getMeanKineticEnergy() const;
37  double getMeanMomentum() const;
38  double getAzimuth() const;
39  double getElevation() const;
40 private:
42  void readStepData(PartBunchBase<double, 3>*, h5_ssize_t , h5_ssize_t);
43 
44  void writeStepHeader(PartBunchBase<double, 3>*, const std::map<std::string, double> &);
46 
50  h5_float64_t meanE_m;
51  h5_float64_t meanMomentum_m;
52  h5_float64_t azimuth_m;
53  h5_float64_t elevation_m;
54 };
55 
56 inline
58  return (predecessorOPALFlavour_m == "opal-cycl");
59 }
60 
61 inline
63  return previousH5Local_m;
64 }
65 
66 inline
68  return referenceLocation_m[0];
69 }
70 
71 inline
73  return referenceLocation_m[1];
74 }
75 
76 inline
78  return referenceLocation_m[2];
79 }
80 
81 inline
83  return referenceMomentum_m[0];
84 }
85 
86 inline
88  return referenceMomentum_m[1];
89 }
90 
91 inline
93  return referenceMomentum_m[2];
94 }
95 
96 inline
98  return meanE_m;
99 }
100 
101 inline
103  return meanMomentum_m;
104 }
105 
106 inline
108  return azimuth_m;
109 }
110 
111 inline
113  return elevation_m;
114 }
115 
116 #endif //OPAL_H5PARTWRAPPERFORPC_H
void writeStepHeader(PartBunchBase< double, 3 > *, const std::map< std::string, double > &)
double getAzimuth() const
double getReferenceR() const
double getMeanKineticEnergy() const
virtual void readHeader()
void writeStepData(PartBunchBase< double, 3 > *)
double getReferencePz() const
double getReferencePr() const
bool getPreviousH5Local() const
std::string predecessorOPALFlavour_m
Definition: H5PartWrapper.h:71
virtual void writeHeader()
double getReferencePt() const
h5_float64_t meanMomentum_m
virtual void writeStep(PartBunchBase< double, 3 > *, const std::map< std::string, double > &additionalStepAttributes)
double getReferenceT() const
virtual void readStep(PartBunchBase< double, 3 > *, h5_ssize_t firstParticle, h5_ssize_t lastParticle)
h5_float64_t elevation_m
H5PartWrapperForPC(const std::string &fileName, h5_int32_t flags=H5_O_WRONLY)
double getMeanMomentum() const
void readStepHeader(PartBunchBase< double, 3 > *)
double getReferenceZ() const
virtual bool predecessorIsSameFlavour() const
double getElevation() const
void readStepData(PartBunchBase< double, 3 > *, h5_ssize_t, h5_ssize_t)