Skip to content

Commit c3e5bd6

Browse files
benedikt-voelkelBenedikt Volkel
andauthored
Apply O2 clang-format (#360)
In preparation of adding clang-format and whitespace/tab check CI as implemented for O2 to all C-like scripts Co-authored-by: Benedikt Volkel <benedikt.volkel@cern.ch>
1 parent 13dbfe3 commit c3e5bd6

30 files changed

+1539
-1481
lines changed

DATA/production/common/readAO2Ds.C

Lines changed: 13 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
1-
int readAO2Ds(const char* filename = "AO2D.root") {
1+
int readAO2Ds(const char* filename = "AO2D.root")
2+
{
23

34
int retCode = 0;
4-
5+
56
TFile* f = new TFile(filename);
67
int nkeysfile = f->GetNkeys();
78
TList* lkeysfile = f->GetListOfKeys();
@@ -24,38 +25,33 @@ int readAO2Ds(const char* filename = "AO2D.root") {
2425
TString cnameKeyInDir = kdir->GetClassName();
2526
TString onameKeyInDir = kdir->GetName();
2627
if (cnameKeyInDir != "TTree") {
27-
continue;
28+
continue;
2829
}
2930
if (ikdir < nkeysdir - 1) {
30-
std::cout << onameKeyInDir.Data() << " ";
31-
}
32-
else {
33-
std::cout << onameKeyInDir.Data() << std::endl;
31+
std::cout << onameKeyInDir.Data() << " ";
32+
} else {
33+
std::cout << onameKeyInDir.Data() << std::endl;
3434
}
3535
TTree* t = (TTree*)d->Get(onameKeyInDir.Data());
3636
if (onameKeyInDir.BeginsWith("O2track")) {
37-
vectNEntriesPerTree.push_back({onameKeyInDir.Data(), t->GetEntries()});
37+
vectNEntriesPerTree.push_back({onameKeyInDir.Data(), t->GetEntries()});
3838
}
3939
}
40-
if (all_of(vectNEntriesPerTree.begin(), vectNEntriesPerTree.end(), [&] (std::pair<std::string, int> i) {return i.second == vectNEntriesPerTree[0].second;})){
40+
if (all_of(vectNEntriesPerTree.begin(), vectNEntriesPerTree.end(), [&](std::pair<std::string, int> i) { return i.second == vectNEntriesPerTree[0].second; })) {
4141
std::cout << "In current DF (" << onameKeyInFile.Data() << "), all tracks tables (starting with O2track) have the same number of entries!" << std::endl;
42-
}
43-
else {
42+
} else {
4443
std::cout << "In current DF (" << onameKeyInFile.Data() << "), NOT all tracks tables (starting with O2track) have the same number of entries!" << std::endl;
4544
retCode = 1;
4645
}
4746
for (auto& item : vectNEntriesPerTree) {
4847
std::cout << "table " << item.first << " has " << item.second << " entries" << std::endl;
49-
}
48+
}
5049
}
5150
if (std::equal(vectNEntriesPerDF.begin() + 1, vectNEntriesPerDF.end(), vectNEntriesPerDF.begin())) {
5251
std::cout << "All DFs have the same number of tables" << std::endl;
53-
}
54-
else {
52+
} else {
5553
std::cout << "NOT all DFs have the same number of tables" << std::endl;
5654
retCode = retCode + 2;
57-
}
55+
}
5856
return retCode;
5957
}
60-
61-

0 commit comments

Comments
 (0)