Skip to content

Commit 7f364f2

Browse files
shahor02sawenzel
authored andcommitted
Fix macros assuming global namespace std
Plenty of macros are we passing compiled tests due to the {using namespace std;} declared by the rootcling during ACLiC dictionary generation, which is wrong in the 1st places. With root-project/root#5296 fix they all fail. Adding {using namespace std;} in macros body
1 parent cda9026 commit 7f364f2

34 files changed

Lines changed: 127 additions & 106 deletions

Detectors/CPV/calib/macros/PostCalibCCDB.C

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ void PostCalibCCDB()
3636

3737
hGains[mod] = (TH2F*)fGains->Get(Form("mod%d", mod));
3838
if (!o2cpvCalib->setGain(hGains[mod], mod)) {
39-
cout << " Can not set gain for module " << mod << endl;
39+
std::cout << " Can not set gain for module " << mod << std::endl;
4040
return;
4141
}
4242
}

Detectors/CPV/testsimulation/plot_dig_cpv.C

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ void plot_dig_cpv(int ievent = 0, std::string inputfile = "o2dig.root")
3131
hitTree->SetBranchAddress("CPVDigit", &mDigitsArray);
3232

3333
if (!mDigitsArray) {
34-
cout << "CPV digits not found in the file. Exiting ..." << endl;
34+
std::cout << "CPV digits not found in the file. Exiting ..." << std::endl;
3535
return;
3636
}
3737
hitTree->GetEvent(ievent);

Detectors/CPV/testsimulation/plot_hit_cpv.C

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ void plot_hit_cpv(int ievent = 0, std::string inputprefix = "o2sim")
3333
hitTree->SetBranchAddress("CPVHit", &mHitsArray);
3434

3535
if (!mHitsArray) {
36-
cout << "CPV hits not registered in the FairRootManager. Exiting ..." << endl;
36+
std::cout << "CPV hits not registered in the FairRootManager. Exiting ..." << std::endl;
3737
return;
3838
}
3939
hitTree->GetEvent(ievent);

Detectors/EMCAL/reconstruction/macros/RawFitterTESTs.C

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ void RawFitterTESTs()
4848
while (rawreader.hasNext()) {
4949

5050
rawreader.next();
51-
cout << "next page \n";
51+
std::cout << "next page \n";
5252

5353
//std::cout<<rawreader.getRawHeader()<<std::endl;
5454

Detectors/ITSMFT/ITS/macros/EVE/simple_geom_ITS.C

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,8 @@
1818

1919
#endif
2020

21+
using namespace std;
22+
2123
void AddNodes(TGeoNode* node, TEveGeoNode* parent, Int_t depth, Int_t depthmax, TObjArray* list);
2224

2325
void simple_geom_ITS(std::string inputGeom = "o2sim_geometry.root")

Detectors/ITSMFT/ITS/macros/test/CheckClusterShape.C

Lines changed: 14 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121
using o2::itsmft::Digit;
2222
using o2::itsmft::SegmentationAlpide;
2323
using namespace o2::its;
24+
using namespace std;
2425

2526
//////////////////////////////////////////
2627
//////////////////////////////////////////
@@ -166,7 +167,7 @@ class Cluster
166167
//////////////////////////////////////////
167168
void AnalyzeClusters(Int_t nev, const map<UInt_t, Cluster>& clusters, TH1F* freqDist, TH1F* cSizeDist)
168169
{
169-
cout << ">>> Event " << nev << endl;
170+
std::cout << ">>> Event " << nev << std::endl;
170171
Float_t x, z;
171172
Long64_t shapeId;
172173
map<Long64_t, Int_t> csFrequency;
@@ -181,33 +182,33 @@ void AnalyzeClusters(Int_t nev, const map<UInt_t, Cluster>& clusters, TH1F* freq
181182
o2::itsmft::ClusterShape* cs = Cluster::PixelsToClusterShape(pv);
182183
shapeId = cs->GetShapeID();
183184
cSizeDist->Fill(cs->GetNFiredPixels());
184-
cout << endl
185-
<< shapeId << ":" << endl
186-
<< *cs << endl
187-
<< endl;
185+
std::cout << std::endl
186+
<< shapeId << ":" << std::endl
187+
<< *cs << std::endl
188+
<< std::endl;
188189

189190
if (csFrequency.find(shapeId) == csFrequency.end())
190191
csFrequency[shapeId] = 0;
191192
csFrequency[shapeId] += 1;
192193

193194
// if (cls.GetNClusters(i) > 0) {
194-
// cout << " [";
195+
// std::cout << " [";
195196
// for (auto j = 0; j < cls.GetNClusters(i); ++j) {
196197
// Pixel p = cls.GetPixel(i, j);
197-
// cout << "(" << p.GetRow() << "," << p.GetCol() << ")";
198+
// std::cout << "(" << p.GetRow() << "," << p.GetCol() << ")";
198199
// //SegmentationAlpide::detectorToLocal(p.GetRow(),p.GetCol(),x,z);
199200
// //cout << "(" << x << "," << z << ")";
200-
// if (j < cls.GetNClusters(i)-1) cout << " ";
201+
// if (j < cls.GetNClusters(i)-1) std::cout << " ";
201202
// }
202-
// cout << "]";
203+
// std::cout << "]";
203204
// }
204205

205-
//if (i < 6) cout << ", ";
206-
//else cout << endl;
206+
//if (i < 6) std::cout << ", ";
207+
//else std::cout << std::endl;
207208
}
208209
}
209-
cout << ">>>>>>>>>>>>>>>>>" << endl
210-
<< endl;
210+
std::cout << ">>>>>>>>>>>>>>>>>" << std::endl
211+
<< std::endl;
211212

212213
int i = 0;
213214
std::multimap<Int_t, Long64_t> fmap = flip_map(csFrequency);

Detectors/ITSMFT/ITS/macros/test/CheckLUtime.C

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,8 @@
2222

2323
#endif
2424

25+
using namespace std;
26+
2527
void CheckLUtime(std::string clusfile = "o2clus_its.root", std::string dictfile = "")
2628
{
2729
using o2::itsmft::Cluster;
@@ -81,6 +83,6 @@ void CheckLUtime(std::string clusfile = "o2clus_its.root", std::string dictfile
8183
realtime.close();
8284
cputime << timerLookUp.CpuTime() / nevCl << std::endl;
8385
cputime.close();
84-
time_output << "Real time (s): " << timerLookUp.RealTime() / nevCl << "CPU time (s): " << timerLookUp.CpuTime() / nevCl << endl;
85-
cout << "Real time (s): " << timerLookUp.RealTime() / nevCl << " CPU time (s): " << timerLookUp.CpuTime() / nevCl << endl;
86+
time_output << "Real time (s): " << timerLookUp.RealTime() / nevCl << "CPU time (s): " << timerLookUp.CpuTime() / nevCl << std::endl;
87+
std::cout << "Real time (s): " << timerLookUp.RealTime() / nevCl << " CPU time (s): " << timerLookUp.CpuTime() / nevCl << std::endl;
8688
}

Detectors/ITSMFT/ITS/macros/test/CheckTracks.C

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,8 @@
2323

2424
#endif
2525

26+
using namespace std;
27+
2628
struct DataFrames {
2729
void update(int frame, long index)
2830
{

Detectors/ITSMFT/ITS/macros/test/DisplayTrack.C

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,8 @@
2626
#include "SimulationDataFormat/MCTruthContainer.h"
2727
#endif
2828

29+
using namespace std;
30+
2931
void DisplayTrack(Int_t event = 0, Int_t track = 0, std::string tracfile = "o2trac_its.root", std::string clusfile = "o2clus_its.root", std::string hitfile = "o2sim_HitsITS.root", std::string inputGeom = "")
3032
{
3133
using namespace o2::base;
@@ -104,7 +106,7 @@ void DisplayTrack(Int_t event = 0, Int_t track = 0, std::string tracfile = "o2tr
104106
n++;
105107
}
106108
}
107-
cout << "Number of hits: " << n << endl;
109+
std::cout << "Number of hits: " << n << std::endl;
108110

109111
gEve->AddElement(points, 0);
110112
f->Close();
@@ -158,7 +160,7 @@ found:
158160
n++;
159161
}
160162
}
161-
cout << "Number of clusters: " << n << endl;
163+
std::cout << "Number of clusters: " << n << std::endl;
162164

163165
gEve->AddElement(points, 0);
164166
f->Close();
@@ -204,7 +206,7 @@ found:
204206
}
205207
break;
206208
}
207-
cout << "Number of attached clusters: " << n << endl;
209+
std::cout << "Number of attached clusters: " << n << std::endl;
208210

209211
gEve->AddElement(points, 0);
210212
f->Close();

Detectors/PHOS/testsimulation/plot_dig_phos.C

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,8 @@
1515
#include "PHOSBase/Geometry.h"
1616
#endif
1717

18+
using namespace std;
19+
1820
void plot_dig_phos(int ievent = 0, TString inputfile = "o2dig.root")
1921
{
2022

0 commit comments

Comments
 (0)