1515
1616#include " ITStracking/IOUtils.h"
1717
18+ #include < gsl/span>
19+ #include < vector>
20+ #include < array>
21+ #include < string>
1822#include < iostream>
1923#include < cstdlib>
2024#include < fstream>
2125#include < sstream>
2226#include < tuple>
23- #include < unordered_set>
2427#include < utility>
2528
2629#include " ITSBase/GeometryTGeo.h"
@@ -35,10 +38,7 @@ constexpr int PrimaryVertexLayerId{-1};
3538constexpr int EventLabelsSeparator{-1 };
3639} // namespace
3740
38- namespace o2
39- {
40- namespace its
41- {
41+ using namespace o2 ::its;
4242
4343// / convert compact clusters to 3D spacepoints
4444void ioutils::convertCompactClusters (gsl::span<const itsmft::CompClusterExt> clusters,
@@ -57,8 +57,8 @@ void ioutils::convertCompactClusters(gsl::span<const itsmft::CompClusterExt> clu
5757 }
5858 }
5959
60- for (auto & c : clusters) {
61- float sigmaY2, sigmaZ2, sigmaYZ = 0 ;
60+ for (const auto & c : clusters) {
61+ float sigmaY2{ 0 } , sigmaZ2{ 0 } , sigmaYZ{ 0 } ;
6262 auto locXYZ = extractClusterData (c, pattIt, dict, sigmaY2, sigmaZ2);
6363 auto & cl3d = output.emplace_back (c.getSensorID (), geom->getMatrixT2L (c.getSensorID ()) ^ locXYZ); // local --> tracking
6464 if (applyMisalignment) {
@@ -83,9 +83,9 @@ void ioutils::loadEventData(ROframe& event, gsl::span<const itsmft::CompClusterE
8383 geom->fillMatrixCache (o2::math_utils::bit2Mask (o2::math_utils::TransformType::T2L, o2::math_utils::TransformType::L2G));
8484 int clusterId{0 };
8585
86- for (auto & c : clusters) {
87- int layer = geom->getLayer (c.getSensorID ());
88- float sigmaY2, sigmaZ2, sigmaYZ = 0 ;
86+ for (const auto & c : clusters) {
87+ const int layer = geom->getLayer (c.getSensorID ());
88+ float sigmaY2{ 0 } , sigmaZ2{ 0 } , sigmaYZ{ 0 } ;
8989 auto locXYZ = extractClusterData (c, pattIt, dict, sigmaY2, sigmaZ2);
9090 auto sensorID = c.getSensorID ();
9191 // Inverse transformation to the local --> tracking
@@ -118,9 +118,9 @@ int ioutils::loadROFrameData(const o2::itsmft::ROFRecord& rof, ROframe& event, g
118118
119119 auto first = rof.getFirstEntry ();
120120 auto clusters_in_frame = rof.getROFData (clusters);
121- for (auto & c : clusters_in_frame) {
122- int layer = geom->getLayer (c.getSensorID ());
123- float sigmaY2, sigmaZ2, sigmaYZ = 0 ;
121+ for (const auto & c : clusters_in_frame) {
122+ const int layer = geom->getLayer (c.getSensorID ());
123+ float sigmaY2{ 0 } , sigmaZ2{ 0 } , sigmaYZ{ 0 } ;
124124 auto locXYZ = extractClusterData (c, pattIt, dict, sigmaY2, sigmaZ2);
125125 auto sensorID = c.getSensorID ();
126126 // Inverse transformation to the local --> tracking
@@ -141,53 +141,53 @@ int ioutils::loadROFrameData(const o2::itsmft::ROFRecord& rof, ROframe& event, g
141141 event.addClusterExternalIndexToLayer (layer, first + clusterId);
142142 clusterId++;
143143 }
144- return clusters_in_frame.size ();
144+ return ( int ) clusters_in_frame.size ();
145145}
146146
147- std::vector<std::unordered_map<int , Label>> ioutils::loadLabels (const int eventsNum, const std::string& fileName)
148- {
149- std::vector<std::unordered_map<int , Label>> labelsMap{};
150- std::unordered_map<int , Label> currentEventLabelsMap{};
151- std::ifstream inputStream{};
152- std::string line{};
153- int monteCarloId{}, pdgCode{}, numberOfClusters{};
154- float transverseMomentum{}, phi{}, pseudorapidity{};
147+ // std::vector<std::unordered_map<int, Label>> ioutils::loadLabels(const int eventsNum, const std::string& fileName)
148+ // {
149+ // std::vector<std::unordered_map<int, Label>> labelsMap{};
150+ // std::unordered_map<int, Label> currentEventLabelsMap{};
151+ // std::ifstream inputStream{};
152+ // std::string line{};
153+ // int monteCarloId{}, pdgCode{}, numberOfClusters{};
154+ // float transverseMomentum{}, phi{}, pseudorapidity{};
155155
156- labelsMap.reserve (eventsNum);
156+ // labelsMap.reserve(eventsNum);
157157
158- inputStream.open (fileName);
159- std::getline (inputStream, line);
158+ // inputStream.open(fileName);
159+ // std::getline(inputStream, line);
160160
161- while (std::getline (inputStream, line)) {
161+ // while (std::getline(inputStream, line)) {
162162
163- std::istringstream inputStringStream (line);
163+ // std::istringstream inputStringStream(line);
164164
165- if (inputStringStream >> monteCarloId) {
165+ // if (inputStringStream >> monteCarloId) {
166166
167- if (monteCarloId == EventLabelsSeparator) {
167+ // if (monteCarloId == EventLabelsSeparator) {
168168
169- labelsMap.emplace_back (currentEventLabelsMap);
170- currentEventLabelsMap.clear ();
169+ // labelsMap.emplace_back(currentEventLabelsMap);
170+ // currentEventLabelsMap.clear();
171171
172- } else {
172+ // } else {
173173
174- if (inputStringStream >> transverseMomentum >> phi >> pseudorapidity >> pdgCode >> numberOfClusters) {
174+ // if (inputStringStream >> transverseMomentum >> phi >> pseudorapidity >> pdgCode >> numberOfClusters) {
175175
176- if (std::abs (pdgCode) == constants::pdgcodes::PionCode && numberOfClusters == 7 ) {
176+ // if (std::abs(pdgCode) == constants::pdgcodes::PionCode && numberOfClusters == 7) {
177177
178- currentEventLabelsMap.emplace (std::piecewise_construct, std::forward_as_tuple (monteCarloId),
179- std::forward_as_tuple (monteCarloId, transverseMomentum, phi,
180- pseudorapidity, pdgCode, numberOfClusters));
181- }
182- }
183- }
184- }
185- }
178+ // currentEventLabelsMap.emplace(std::piecewise_construct, std::forward_as_tuple(monteCarloId),
179+ // std::forward_as_tuple(monteCarloId, transverseMomentum, phi,
180+ // pseudorapidity, pdgCode, numberOfClusters));
181+ // }
182+ // }
183+ // }
184+ // }
185+ // }
186186
187- labelsMap.emplace_back (currentEventLabelsMap);
187+ // labelsMap.emplace_back(currentEventLabelsMap);
188188
189- return labelsMap;
190- }
189+ // return labelsMap;
190+ // }
191191
192192// void ioutils::writeRoadsReport(std::ofstream& correctRoadsOutputStream, std::ofstream& duplicateRoadsOutputStream,
193193// std::ofstream& fakeRoadsOutputStream, const std::vector<std::vector<Road<5>>>& roads,
@@ -235,6 +235,3 @@ std::vector<std::unordered_map<int, Label>> ioutils::loadLabels(const int events
235235// }
236236// }
237237// }
238-
239- } // namespace its
240- } // namespace o2
0 commit comments