Skip to content

Commit d9bdc8c

Browse files
authored
[Common] TOF: check metadata that is initialized (#11901)
1 parent 2418fc5 commit d9bdc8c

File tree

1 file changed

+18
-10
lines changed

1 file changed

+18
-10
lines changed

Common/TableProducer/PID/pidTOFMerge.cxx

Lines changed: 18 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -15,29 +15,30 @@
1515
/// \author Nicolò Jacazio nicolo.jacazio@cern.ch
1616
///
1717

18-
#include <utility>
19-
#include <vector>
20-
#include <string>
2118
#include <map>
19+
#include <string>
2220
#include <unordered_map>
21+
#include <utility>
22+
#include <vector>
2323

2424
// O2 includes
25-
#include "Framework/runDataProcessing.h"
25+
#include "CCDB/BasicCCDBManager.h"
2626
#include "Framework/AnalysisTask.h"
2727
#include "Framework/HistogramRegistry.h"
28+
#include "Framework/runDataProcessing.h"
2829
#include "ReconstructionDataFormats/Track.h"
29-
#include "CCDB/BasicCCDBManager.h"
3030
#include "TOFBase/EventTimeMaker.h"
3131

3232
// O2Physics includes
33-
#include "TableHelper.h"
34-
#include "MetadataHelper.h"
3533
#include "CollisionTypeHelper.h"
34+
#include "MetadataHelper.h"
35+
#include "TableHelper.h"
3636
#include "pidTOFBase.h"
37-
#include "Common/DataModel/TrackSelectionTables.h"
37+
3838
#include "Common/DataModel/EventSelection.h"
3939
#include "Common/DataModel/FT0Corrected.h"
4040
#include "Common/DataModel/Multiplicity.h"
41+
#include "Common/DataModel/TrackSelectionTables.h"
4142

4243
using namespace o2;
4344
using namespace o2::framework;
@@ -924,7 +925,7 @@ struct tofPidMerge {
924925
doprocessRun2.value = false;
925926
} else {
926927
if (mTOFCalibConfig.autoSetProcessFunctions()) {
927-
LOG(info) << "Autodetecting process functions for mass and beta";
928+
LOG(info) << "Autodetecting process functions";
928929
if (metadataInfo.isFullyDefined()) {
929930
if (metadataInfo.isRun3()) {
930931
doprocessRun3.value = true;
@@ -972,17 +973,24 @@ struct tofPidMerge {
972973
doprocessRun2BetaM.value = false;
973974
doprocessRun3BetaM.value = false;
974975
} else {
976+
LOG(info) << "Table for TOF beta is " << (enableTableBeta ? "enabled" : "disabled");
977+
LOG(info) << "Table for TOF mass is " << (enableTableMass ? "enabled" : "disabled");
975978
if (mTOFCalibConfig.autoSetProcessFunctions()) {
976979
LOG(info) << "Autodetecting process functions for mass and beta";
977-
if (metadataInfo.isFullyDefined()) {
980+
if (metadataInfo.isInitialized()) {
978981
if (metadataInfo.isRun3()) {
979982
doprocessRun3BetaM.value = true;
980983
doprocessRun2BetaM.value = false;
981984
} else {
982985
doprocessRun2BetaM.value = true;
983986
doprocessRun3BetaM.value = false;
984987
}
988+
} else {
989+
metadataInfo.print();
990+
LOG(warning) << "Metadata is not defined, cannot autodetect process functions for mass and beta";
985991
}
992+
} else {
993+
LOG(info) << "Process functions for mass and beta are set manually";
986994
}
987995
if (doprocessRun2BetaM && doprocessRun3BetaM) {
988996
LOG(fatal) << "Both processRun2BetaM and processRun3BetaM are enabled. Pick one of the two";

0 commit comments

Comments
 (0)