@@ -20,7 +20,7 @@ int count(const RAYX::BundleHistory& hist) {
2020}
2121
2222// Re-formats `hist` into a bunch of doubles using the format.
23- std::vector<double > toDoubles (const RAYX::BundleHistory& hist, const Format& format, int startEventID ) {
23+ std::vector<double > toDoubles (const RAYX::BundleHistory& hist, const Format& format) {
2424 std::vector<double > output;
2525 output.reserve (count (hist) * format.size ());
2626
@@ -29,19 +29,18 @@ std::vector<double> toDoubles(const RAYX::BundleHistory& hist, const Format& for
2929 for (uint32_t event_id = 0 ; event_id < ray_hist.size (); event_id++) {
3030 const RAYX::Ray& event = ray_hist[event_id];
3131 for (uint32_t i = 0 ; i < format.size (); i++) {
32- double next = format[i].get_double (ray_id, event_id + startEventID , event);
32+ double next = format[i].get_double (ray_id, event_id, event);
3333 output.push_back (next);
3434 }
3535 }
3636 }
3737 return output;
3838}
3939
40- void writeH5 (const RAYX::BundleHistory& hist, const std::string& filename, const Format& format, std::vector<std::string> elementNames,
41- int startEventID) {
40+ void writeH5 (const RAYX::BundleHistory& hist, const std::string& filename, const Format& format, std::vector<std::string> elementNames) {
4241 HighFive::File file (filename, HighFive::File::ReadWrite | HighFive::File::Create | HighFive::File::Truncate);
4342
44- auto doubles = toDoubles (hist, format, startEventID );
43+ auto doubles = toDoubles (hist, format);
4544
4645 try {
4746 // write data
@@ -78,15 +77,12 @@ RAYX::BundleHistory fromDoubles(const std::vector<double>& doubles, const Format
7877 RAYX::RayHistory rayHist;
7978 rayHist.reserve (8 ); // Estimate: assume 8 events per ray on average
8079
81- const double startEventID = doubles[1 ];
8280 const double * data = doubles.data ();
8381
8482 for (size_t i = 0 ; i < numRays; ++i) {
8583 const double * rayData = data + i * formatSize;
8684
87- double eventId = rayData[1 ];
88-
89- if (eventId == startEventID && !rayHist.empty ()) {
85+ if (!rayHist.empty ()) {
9086 bundleHist.push_back (std::move (rayHist));
9187 rayHist.clear ();
9288 rayHist.reserve (8 );
@@ -120,7 +116,7 @@ RAYX::BundleHistory fromDoubles(const std::vector<double>& doubles, const Format
120116 return bundleHist;
121117}
122118
123- RAYX::BundleHistory raysFromH5 (const std::string& filename, const Format& format, std::unique_ptr< uint32_t > startEventID ) {
119+ RAYX::BundleHistory raysFromH5 (const std::string& filename, const Format& format) {
124120 RAYX_PROFILE_FUNCTION_STDOUT ();
125121 RAYX::BundleHistory rays;
126122
@@ -138,9 +134,6 @@ RAYX::BundleHistory raysFromH5(const std::string& filename, const Format& format
138134 RAYX_WARN << " No rays found in " << filename;
139135 return rays;
140136 }
141- if (startEventID) {
142- *startEventID = static_cast <uint32_t >(doubles[1 ]);
143- }
144137 rays = fromDoubles (doubles, format);
145138 RAYX_VERB << " Loaded " << rays.size () << " rays from " << filename;
146139
0 commit comments