Skip to content

Commit 773c668

Browse files
author
Yuanjun Mei
committed
fix about null ptr problem of listWithRuns
1 parent 416bd5a commit 773c668

2 files changed

Lines changed: 9 additions & 3 deletions

File tree

PWGCF/MultiparticleCorrelations/Tasks/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ o2physics_add_dpl_workflow(multiparticle-cumulants
3434
PUBLIC_LINK_LIBRARIES O2::Framework O2Physics::AnalysisCore O2Physics::PWGCFCore
3535
COMPONENT_NAME Analysis)
3636

37-
o2physics_add_dpl_workflow(multiparticleCorrelationsMei
37+
o2physics_add_dpl_workflow(multiparticle-correlations-mei
3838
SOURCES multiparticleCorrelationsMei.cxx
3939
PUBLIC_LINK_LIBRARIES O2::Framework O2Physics::AnalysisCore O2Physics::PWGCFCore
4040
COMPONENT_NAME Analysis)

PWGCF/MultiparticleCorrelations/Tasks/multiparticleCorrelationsMei.cxx

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,8 @@ using namespace std;
2727
// ...
2828
#include <Framework/runDataProcessing.h>
2929

30-
#include <TH1D.h>
3130
#include <TGrid.h>
31+
#include <TH1D.h>
3232
#include <TSystem.h>
3333

3434
#include <string>
@@ -258,7 +258,7 @@ struct MultiparticleCorrelationsMei // this name is used in lower-case format to
258258

259259
if (bFileIsInAliEn) {
260260
// File you want to access is in your home dir in AliEn:
261-
TGrid* alien = TGrid::Connect("alien", gSystem->Getenv("USER"), "", ""); // do not forget to add #include <TGrid.h> to the preamble of your analysis task
261+
const TGrid* alien = TGrid::Connect("alien", gSystem->Getenv("USER"), "", ""); // do not forget to add #include <TGrid.h> to the preamble of your analysis task
262262
if (!alien) {
263263
LOGF(fatal, "\033[1;31m%s at line %d\033[0m", __FUNCTION__, __LINE__);
264264
}
@@ -344,6 +344,12 @@ struct MultiparticleCorrelationsMei // this name is used in lower-case format to
344344
// Here comes the common code for all three cases, where from "listWithRuns" you fetch the desired histogram with efficiency corrections:
345345
// listWithRuns->ls();
346346

347+
if (!listWithRuns) {
348+
LOGF(fatal,
349+
"\033[1;31m%s: listWithRuns is null for run %s\033[0m",
350+
__FUNCTION__, runNumber);
351+
}
352+
347353
hist = dynamic_cast<TH1D*>(listWithRuns->FindObject("h_invert"));
348354
if (!hist) {
349355
LOGF(fatal, "%s: histogram 'hist1' not found in run list", __FUNCTION__);

0 commit comments

Comments
 (0)