Skip to content

Commit 979a8d5

Browse files
committed
Merge branch 'dev' into devel
2 parents 5c6d214 + 133c2ec commit 979a8d5

34 files changed

+1966
-1149
lines changed

Common/SimConfig/src/SimConfig.cxx

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -200,7 +200,11 @@ bool SimConfig::determineActiveModulesList(const std::string& version, std::vect
200200
return false;
201201
}
202202
modules = map[version];
203-
LOGP(info, "Running with official detector version '{}'", version);
203+
static std::string last_version{}; // prevent multiple printouts of same message
204+
if (last_version != version) {
205+
LOGP(info, "Running with official detector version '{}'", version);
206+
last_version = version;
207+
}
204208
}
205209
// check if specified modules are in list
206210
if (inputargs.size() != 1 || inputargs[0] != "all") {

DataFormats/Parameters/src/GRPTool.cxx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -312,7 +312,7 @@ bool create_GRPs(Options const& opts)
312312
auto soreor = ccdbmgr.getRunDuration(opts.run);
313313
runStart = soreor.first;
314314
grp.setTimeStart(runStart);
315-
grp.setTimeEnd(runStart + 3600000);
315+
grp.setTimeEnd(soreor.second);
316316
grp.setNHBFPerTF(opts.orbitsPerTF);
317317
std::vector<std::string> modules{};
318318
if (!o2::conf::SimConfig::determineActiveModulesList(opts.detectorList, opts.readout, std::vector<std::string>(), modules)) {

Detectors/GlobalTrackingWorkflow/study/src/TrackMCStudy.cxx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1366,7 +1366,7 @@ void TrackMCStudy::processITSTracks(const o2::globaltracking::RecoContainer& rec
13661366
hinf.trefYT = traY;
13671367
}
13681368
}
1369-
(*mDBGOut) << "itsTree" << "hits=" << outHitInfo << "trIn=" << ((o2::track::TrackParCov&)itsTr) << "trOut=" << itsTr.getParamOut() << "mcTr=" << entrySel->second.mcTrackInfo.track << "nTrefs=" << nrefAcc << "\n";
1369+
(*mDBGOut) << "itsTree" << "hits=" << outHitInfo << "trIn=" << ((o2::track::TrackParCov&)itsTr) << "trOut=" << itsTr.getParamOut() << "mcTr=" << entrySel->second.mcTrackInfo.track << "mcPDG=" << entrySel->second.mcTrackInfo.pdg << "nTrefs=" << nrefAcc << "\n";
13701370
}
13711371
}
13721372

Detectors/TPC/base/include/TPCBase/CalArray.h

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,11 @@
2626
#include <boost/format.hpp>
2727
#endif
2828

29+
#ifdef NDEBUG
30+
#undef NDEBUG
31+
#include <cassert>
32+
#endif
33+
2934
namespace o2
3035
{
3136
namespace tpc
@@ -93,7 +98,11 @@ class CalArray
9398
int getPadSubsetNumber() const { return mPadSubsetNumber; }
9499

95100
void setValue(const size_t channel, const T& value) { mData[channel] = value; }
96-
const T getValue(const size_t channel) const { return mData[channel]; }
101+
const T getValue(const size_t channel) const
102+
{
103+
assert(channel < mData.size());
104+
return mData[channel];
105+
}
97106

98107
void setValue(const size_t row, const size_t pad, const T& value);
99108
const T getValue(const size_t row, const size_t pad) const;

Detectors/TPC/base/include/TPCBase/CalDet.h

Lines changed: 26 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,12 @@
3030
#include "Rtypes.h"
3131
#endif
3232

33+
#ifndef NDEBUG
34+
#undef NDEBUG
35+
// always enable assert
36+
#include <cassert>
37+
#endif
38+
3339
namespace o2
3440
{
3541
namespace tpc
@@ -211,7 +217,26 @@ inline const T CalDet<T>::getValue(const ROC roc, const size_t row, const size_t
211217
}
212218
case PadSubset::Region: {
213219
const auto globalRow = roc.isOROC() ? mappedRow + mapper.getNumberOfRowsROC(ROC(0)) : mappedRow;
214-
return mData[Mapper::REGION[globalRow] + roc.getSector() * Mapper::NREGIONS].getValue(Mapper::OFFSETCRUGLOBAL[globalRow] + mappedPad);
220+
const auto dataRow = Mapper::REGION[globalRow] + roc.getSector() * Mapper::NREGIONS;
221+
const auto index = Mapper::OFFSETCRUGLOBAL[globalRow] + mappedPad;
222+
assert(dataRow < mData.size());
223+
if (index >= mData[dataRow].getData().size()) {
224+
// S. Wenzel: We shouldn't come here but we do. For instance for CalDet calibrations loaded from
225+
// creator.loadIDCPadFlags(1731274461770);
226+
227+
// In this case there is an index overflow, leading to invalid reads and potentially a segfault.
228+
// To increase stability, for now returning a trivial answer. This can be removed once either the algorithm
229+
// or the calibration data has been fixed.
230+
#ifndef GPUCA_ALIGPUCODE // hide from GPU standalone compilation
231+
static bool printMsg = true;
232+
if (printMsg) {
233+
LOG(error) << "Out of bound access in TPC CalDet ROC " << roc << " row " << row << " pad " << pad << " (no more messages printed)";
234+
}
235+
printMsg = false;
236+
#endif
237+
return T{};
238+
}
239+
return mData[dataRow].getValue(index);
215240
break;
216241
}
217242
}

Detectors/TPC/base/src/TPCFlagsMemberCustomStreamer.cxx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,9 @@ static __attribute__((used)) int _R__dummyStreamer_3 =
6969
([]() {
7070
auto cl = TClass::GetClass<o2::tpc::CalArray<o2::tpc::PadFlags>>();
7171
if (cl) {
72-
cl->AdoptMemberStreamer("mData", new TMemberStreamer(MemberVectorPadFlagsStreamer));
72+
if (!getenv("TPC_PADFLAGS_STREAMER_OFF")) {
73+
cl->AdoptMemberStreamer("mData", new TMemberStreamer(MemberVectorPadFlagsStreamer));
74+
}
7375
} else {
7476
// we should never come here ... and if we do we should assert/fail
7577
assert(false);

Detectors/TPC/base/test/testTPCCalDet.cxx

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@
2424
#include "TPCBase/CalDet.h"
2525
#include "TFile.h"
2626
#include "Framework/TypeTraits.h"
27+
#include "TPCBase/DeadChannelMapCreator.h"
2728

2829
namespace o2::tpc
2930
{
@@ -344,4 +345,12 @@ BOOST_AUTO_TEST_CASE(CalDetTypeTest)
344345
BOOST_CHECK(testDict == true);
345346
}
346347

348+
BOOST_AUTO_TEST_CASE(CalDetStreamerTest)
349+
{
350+
// simple code executing the TPC IDCPadFlags loading in a standalone env --> easy to valgrind
351+
o2::tpc::DeadChannelMapCreator creator{};
352+
creator.init("https://alice-ccdb.cern.ch");
353+
creator.loadIDCPadFlags(1731274461770);
354+
}
355+
347356
} // namespace o2::tpc

Detectors/Upgrades/ITS3/CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,3 +19,4 @@ add_subdirectory(base)
1919
add_subdirectory(workflow)
2020
add_subdirectory(reconstruction)
2121
add_subdirectory(macros)
22+
add_subdirectory(study)

Detectors/Upgrades/ITS3/macros/test/CMakeLists.txt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@
1212
its3_add_macro(CheckDigitsITS3.C)
1313
its3_add_macro(CheckClustersITS3.C)
1414
its3_add_macro(CheckTracksITS3.C)
15-
its3_add_macro(CheckDCA.C)
1615
its3_add_macro(CreateDictionariesITS3.C)
1716
its3_add_macro(buildMatBudLUT.C)
1817
its3_add_macro(CheckHits.C)

Detectors/Upgrades/ITS3/macros/test/CheckClustersITS3.C

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -283,7 +283,7 @@ void CheckClustersITS3(const std::string& clusfile = "o2clus_its.root",
283283
nt.Draw("cgy:cgx>>h_cgy_vs_cgx_OB(1000, -50, 50, 1000, -50, 50)", "id >= 3456", "colz");
284284
canvCgXCgY->cd(4);
285285
nt.Draw("cgy:cgz>>h_cgy_vs_cgz_OB(1000, -100, 100, 1000, -50, 50)", "id >= 3456", "colz");
286-
canvCgXCgY->SaveAs("it3clusters_y_vs_x_vs_z.pdf");
286+
canvCgXCgY->SaveAs("it3clusters_y_vs_x_vs_z.png");
287287

288288
auto canvdXdZ = new TCanvas("canvdXdZ", "", 1600, 800);
289289
canvdXdZ->Divide(2, 2);
@@ -295,7 +295,7 @@ void CheckClustersITS3(const std::string& clusfile = "o2clus_its.root",
295295
nt.Draw("dx:dz>>h_dx_vs_dz_IB_z(1000, -0.01, 0.01, 1000, -0.01, 0.01)", "id < 3456 && abs(cgz) < 2", "colz");
296296
canvdXdZ->cd(4)->SetLogz();
297297
nt.Draw("dx:dz>>h_dx_vs_dz_OB_z(1000, -0.01, 0.01, 1000, -0.01, 0.01)", "id >= 3456 && abs(cgz) < 2", "colz");
298-
canvdXdZ->SaveAs("it3clusters_dx_vs_dz.pdf");
298+
canvdXdZ->SaveAs("it3clusters_dx_vs_dz.png");
299299

300300
auto canvCHXZ = new TCanvas("canvCHXZ", "", 1600, 1600);
301301
canvCHXZ->Divide(2, 2);
@@ -307,7 +307,7 @@ void CheckClustersITS3(const std::string& clusfile = "o2clus_its.root",
307307
nt.Draw("(cgz-hgz)*10000:eta>>h_chz_IB(101,-1.4,1.4,101,-50,50)", "id<3456", "prof");
308308
canvCHXZ->cd(4);
309309
nt.Draw("(cgz-hgz)*10000:eta>>h_chz_OB(101,-1.4,1.4,101,-50,50)", "id>=3456", "prof");
310-
canvCgXCgY->SaveAs("it3clusters_xz_eta.pdf");
310+
canvCgXCgY->SaveAs("it3clusters_xz_eta.png");
311311

312312
auto c1 = new TCanvas("p1", "pullX");
313313
c1->cd();

0 commit comments

Comments
 (0)