Skip to content

Commit 4642462

Browse files
author
Wiktor Pierozak
committed
clang-format
1 parent c8ac4fe commit 4642462

5 files changed

Lines changed: 27 additions & 19 deletions

File tree

Detectors/FIT/macros/compareLut.C

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -23,15 +23,17 @@ R__LOAD_LIBRARY(libO2DataFormatsFIT)
2323

2424
#endif
2525

26-
namespace compare_lut {
26+
namespace compare_lut
27+
{
2728
std::vector<o2::fit::EntryFEE> readLutFromFile(const std::string filePath, const std::string objectName)
2829
{
2930
TFile file(filePath.c_str(), "READ");
3031
if (file.IsOpen() == false) {
3132
std::cerr << "Failed to open " << filePath << std::endl;
3233
return {};
3334
}
34-
std::cout << "Successfully opened " << std::endl << filePath;
35+
std::cout << "Successfully opened " << std::endl
36+
<< filePath;
3537

3638
std::vector<o2::fit::EntryFEE>* lut = nullptr;
3739
file.GetObject<std::vector<o2::fit::EntryFEE>>(objectName.c_str(), lut);
@@ -40,14 +42,14 @@ std::vector<o2::fit::EntryFEE> readLutFromFile(const std::string filePath, const
4042
std::cerr << "Failed to read object " << objectName << std::endl;
4143
return {};
4244
}
43-
std::cout << "Successfully get "<< objectName << " object" << std::endl;
45+
std::cout << "Successfully get " << objectName << " object" << std::endl;
4446

4547
std::vector<o2::fit::EntryFEE> lutCopy = *lut;
4648
file.Close();
4749

4850
return std::move(lutCopy);
4951
}
50-
}
52+
} // namespace compare_lut
5153

5254
inline bool operator==(const o2::fit::EntryFEE& lhs, const o2::fit::EntryFEE& rhs)
5355
{
@@ -64,7 +66,7 @@ void compareLut(const std::string fileA, const std::string fileB, const bool com
6466
{
6567
std::vector<o2::fit::EntryFEE> lutA = compare_lut::readLutFromFile(fileA, objectName);
6668
std::vector<o2::fit::EntryFEE> lutB = compare_lut::readLutFromFile(fileB, objectName);
67-
if(lutA.empty() || lutB.empty()) {
69+
if (lutA.empty() || lutB.empty()) {
6870
return;
6971
}
7072

Detectors/FIT/macros/convertLutToCsv.C

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -24,15 +24,17 @@ R__LOAD_LIBRARY(libO2DataFormatsFIT)
2424

2525
#endif
2626

27-
namespace convert_lut_to_csv {
27+
namespace convert_lut_to_csv
28+
{
2829
std::vector<o2::fit::EntryFEE> readLutFromFile(const std::string filePath, const std::string objectName)
2930
{
3031
TFile file(filePath.c_str(), "READ");
3132
if (file.IsOpen() == false) {
3233
std::cerr << "Failed to open " << filePath << std::endl;
3334
return {};
3435
}
35-
std::cout << "Successfully opened " << std::endl << filePath;
36+
std::cout << "Successfully opened " << std::endl
37+
<< filePath;
3638

3739
std::vector<o2::fit::EntryFEE>* lut = nullptr;
3840
file.GetObject<std::vector<o2::fit::EntryFEE>>(objectName.c_str(), lut);
@@ -41,14 +43,14 @@ std::vector<o2::fit::EntryFEE> readLutFromFile(const std::string filePath, const
4143
std::cerr << "Failed to read object " << objectName << std::endl;
4244
return {};
4345
}
44-
std::cout << "Successfully get "<< objectName << " object" << std::endl;
46+
std::cout << "Successfully get " << objectName << " object" << std::endl;
4547

4648
std::vector<o2::fit::EntryFEE> lutCopy = *lut;
4749
file.Close();
4850

4951
return std::move(lutCopy);
5052
}
51-
}
53+
} // namespace convert_lut_to_csv
5254

5355
void saveToCSV(const std::vector<o2::fit::EntryFEE>& lut, const std::string& path)
5456
{

Detectors/FIT/macros/createLutFromCsv.C

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,8 @@ R__LOAD_LIBRARY(libO2DataFormatsFIT)
2222
#include "CommonConstants/LHCConstants.h"
2323
#endif
2424

25-
namespace create_lut_from_csv {
25+
namespace create_lut_from_csv
26+
{
2627
void saveToRoot(std::vector<o2::fit::EntryFEE>& lut, const std::string& path)
2728
{
2829
TFile file(path.data(), "RECREATE");
@@ -34,7 +35,7 @@ void saveToRoot(std::vector<o2::fit::EntryFEE>& lut, const std::string& path)
3435
file.WriteObject(&lut, "ccdb_object");
3536
file.Close();
3637
}
37-
}
38+
} // namespace create_lut_from_csv
3839

3940
void createLutFromCsv(const std::string csvFilePath, const std::string rootFilePath)
4041
{

Detectors/FIT/macros/fetchLut.C

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,8 @@ R__LOAD_LIBRARY(libO2DataFormatsFIT)
2626

2727
#endif
2828

29-
namespace {
29+
namespace
30+
{
3031
void saveToRoot(std::shared_ptr<std::vector<o2::fit::EntryFEE>> lut, const std::string& path)
3132
{
3233
TFile file(path.data(), "RECREATE");
@@ -38,7 +39,7 @@ void saveToRoot(std::shared_ptr<std::vector<o2::fit::EntryFEE>> lut, const std::
3839
file.Close();
3940
}
4041

41-
void _fetchLut(const std::string ccdbUrl="alice-ccdb.cern.ch", const std::string detector="FT0", long timestamp = -1, const std::string fileName = "o2_lut.root")
42+
void _fetchLut(const std::string ccdbUrl = "alice-ccdb.cern.ch", const std::string detector = "FT0", long timestamp = -1, const std::string fileName = "o2_lut.root")
4243
{
4344
o2::ccdb::CcdbApi ccdbApi;
4445
ccdbApi.init(ccdbUrl);
@@ -64,9 +65,9 @@ void _fetchLut(const std::string ccdbUrl="alice-ccdb.cern.ch", const std::string
6465

6566
saveToRoot(lut, fileName);
6667
}
67-
}
68+
} // namespace
6869

69-
void fetchLut(const std::string ccdbUrl="alice-ccdb.cern.ch", const std::string detector="FT0", long timestamp = -1, const std::string fileName = "o2_lut.root")
70+
void fetchLut(const std::string ccdbUrl = "alice-ccdb.cern.ch", const std::string detector = "FT0", long timestamp = -1, const std::string fileName = "o2_lut.root")
7071
{
7172
_fetchLut(ccdbUrl, detector, timestamp, fileName);
7273
}

Detectors/FIT/macros/printLut.C

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,15 +21,17 @@ R__LOAD_LIBRARY(libO2DataFormatsFIT)
2121
#include "CommonConstants/LHCConstants.h"
2222
#endif
2323

24-
namespace print_lut {
24+
namespace print_lut
25+
{
2526
std::vector<o2::fit::EntryFEE> readLutFromFile(const std::string filePath, const std::string objectName)
2627
{
2728
TFile file(filePath.c_str(), "READ");
2829
if (file.IsOpen() == false) {
2930
std::cerr << "Failed to open " << filePath << std::endl;
3031
return {};
3132
}
32-
std::cout << "Successfully opened " << std::endl << filePath;
33+
std::cout << "Successfully opened " << std::endl
34+
<< filePath;
3335

3436
std::vector<o2::fit::EntryFEE>* lut = nullptr;
3537
file.GetObject<std::vector<o2::fit::EntryFEE>>(objectName.c_str(), lut);
@@ -38,14 +40,14 @@ std::vector<o2::fit::EntryFEE> readLutFromFile(const std::string filePath, const
3840
std::cerr << "Failed to read object " << objectName << std::endl;
3941
return {};
4042
}
41-
std::cout << "Successfully get "<< objectName << " object" << std::endl;
43+
std::cout << "Successfully get " << objectName << " object" << std::endl;
4244

4345
std::vector<o2::fit::EntryFEE> lutCopy = *lut;
4446
file.Close();
4547

4648
return std::move(lutCopy);
4749
}
48-
}
50+
} // namespace print_lut
4951

5052
void printLut(const std::string fileName, const std::string objectName = "ccdb_object")
5153
{

0 commit comments

Comments
 (0)