From f1053631542744c8f20f20b4ec4dd7f3177f5a7c Mon Sep 17 00:00:00 2001 From: sevdokim Date: Mon, 21 Jun 2021 18:51:36 +0200 Subject: [PATCH 1/6] CPV missing TF handling --- DataFormats/Detectors/CPV/CMakeLists.txt | 10 +- .../include/DataFormatsCPV}/BadChannelMap.h | 0 .../CPV/include/DataFormatsCPV}/CalibParams.h | 0 .../CPV/include/DataFormatsCPV}/Hit.h | 0 .../CPV/include/DataFormatsCPV}/Pedestals.h | 0 .../Detectors/CPV}/src/BadChannelMap.cxx | 2 +- .../Detectors/CPV}/src/CalibParams.cxx | 2 +- .../Detectors/CPV/src/DataFormatsCPVLinkDef.h | 10 + DataFormats/Detectors/CPV/src/Digit.cxx | 2 +- .../Detectors/CPV}/src/Hit.cxx | 2 +- .../Detectors/CPV}/src/Pedestals.cxx | 2 +- Detectors/CPV/base/CMakeLists.txt | 2 - Detectors/CPV/base/include/CPVBase/Geometry.h | 1 - Detectors/CPV/base/src/CPVBaseLinkDef.h | 2 - Detectors/CPV/calib/CMakeLists.txt | 16 +- .../CPV/calib/CPVCalibWorkflow/CMakeLists.txt | 2 - .../CPVCalibWorkflow/CPVBadMapCalibDevice.h | 2 +- .../CPVCalibWorkflow/CPVGainCalibDevice.h | 2 +- .../CPVCalibWorkflow/CPVPedestalCalibDevice.h | 2 +- Detectors/CPV/reconstruction/CMakeLists.txt | 1 - .../include/CPVReconstruction/Clusterer.h | 4 +- Detectors/CPV/simulation/CMakeLists.txt | 1 - .../include/CPVSimulation/Detector.h | 2 +- .../include/CPVSimulation/Digitizer.h | 10 +- .../include/CPVSimulation/RawWriter.h | 10 +- Detectors/CPV/simulation/src/Detector.cxx | 2 +- Detectors/CPV/simulation/src/RawCreator.cxx | 4 + Detectors/CPV/simulation/src/RawWriter.cxx | 95 ++++---- Detectors/CPV/workflow/CMakeLists.txt | 1 - .../CPVWorkflow/RawToDigitConverterSpec.h | 18 +- .../workflow/src/RawToDigitConverterSpec.cxx | 218 ++++++++++-------- .../CPV/workflow/src/cpv-reco-workflow.cxx | 4 + .../DigitizerWorkflow/src/CPVDigitizerSpec.h | 2 +- 33 files changed, 232 insertions(+), 199 deletions(-) rename {Detectors/CPV/calib/include/CPVCalib => DataFormats/Detectors/CPV/include/DataFormatsCPV}/BadChannelMap.h (100%) rename {Detectors/CPV/calib/include/CPVCalib => DataFormats/Detectors/CPV/include/DataFormatsCPV}/CalibParams.h (100%) rename {Detectors/CPV/base/include/CPVBase => DataFormats/Detectors/CPV/include/DataFormatsCPV}/Hit.h (100%) rename {Detectors/CPV/calib/include/CPVCalib => DataFormats/Detectors/CPV/include/DataFormatsCPV}/Pedestals.h (100%) rename {Detectors/CPV/calib => DataFormats/Detectors/CPV}/src/BadChannelMap.cxx (98%) rename {Detectors/CPV/calib => DataFormats/Detectors/CPV}/src/CalibParams.cxx (97%) rename {Detectors/CPV/base => DataFormats/Detectors/CPV}/src/Hit.cxx (98%) rename {Detectors/CPV/calib => DataFormats/Detectors/CPV}/src/Pedestals.cxx (98%) diff --git a/DataFormats/Detectors/CPV/CMakeLists.txt b/DataFormats/Detectors/CPV/CMakeLists.txt index 06a8069234efd..b7988e779e3ca 100644 --- a/DataFormats/Detectors/CPV/CMakeLists.txt +++ b/DataFormats/Detectors/CPV/CMakeLists.txt @@ -10,10 +10,14 @@ o2_add_library(DataFormatsCPV SOURCES src/CPVBlockHeader.cxx + src/Hit.cxx src/Digit.cxx src/Cluster.cxx src/TriggerRecord.cxx src/CTF.cxx + src/CalibParams.cxx + src/BadChannelMap.cxx + src/Pedestals.cxx PUBLIC_LINK_LIBRARIES O2::CommonDataFormat O2::Headers O2::MathUtils @@ -24,7 +28,11 @@ o2_add_library(DataFormatsCPV o2_target_root_dictionary(DataFormatsCPV HEADERS include/DataFormatsCPV/CPVBlockHeader.h + include/DataFormatsCPV/Hit.h include/DataFormatsCPV/Digit.h include/DataFormatsCPV/Cluster.h include/DataFormatsCPV/TriggerRecord.h - include/DataFormatsCPV/CTF.h) + include/DataFormatsCPV/CTF.h + include/DataFormatsCPV/CalibParams.h + include/DataFormatsCPV/BadChannelMap.h + include/DataFormatsCPV/Pedestals.h) diff --git a/Detectors/CPV/calib/include/CPVCalib/BadChannelMap.h b/DataFormats/Detectors/CPV/include/DataFormatsCPV/BadChannelMap.h similarity index 100% rename from Detectors/CPV/calib/include/CPVCalib/BadChannelMap.h rename to DataFormats/Detectors/CPV/include/DataFormatsCPV/BadChannelMap.h diff --git a/Detectors/CPV/calib/include/CPVCalib/CalibParams.h b/DataFormats/Detectors/CPV/include/DataFormatsCPV/CalibParams.h similarity index 100% rename from Detectors/CPV/calib/include/CPVCalib/CalibParams.h rename to DataFormats/Detectors/CPV/include/DataFormatsCPV/CalibParams.h diff --git a/Detectors/CPV/base/include/CPVBase/Hit.h b/DataFormats/Detectors/CPV/include/DataFormatsCPV/Hit.h similarity index 100% rename from Detectors/CPV/base/include/CPVBase/Hit.h rename to DataFormats/Detectors/CPV/include/DataFormatsCPV/Hit.h diff --git a/Detectors/CPV/calib/include/CPVCalib/Pedestals.h b/DataFormats/Detectors/CPV/include/DataFormatsCPV/Pedestals.h similarity index 100% rename from Detectors/CPV/calib/include/CPVCalib/Pedestals.h rename to DataFormats/Detectors/CPV/include/DataFormatsCPV/Pedestals.h diff --git a/Detectors/CPV/calib/src/BadChannelMap.cxx b/DataFormats/Detectors/CPV/src/BadChannelMap.cxx similarity index 98% rename from Detectors/CPV/calib/src/BadChannelMap.cxx rename to DataFormats/Detectors/CPV/src/BadChannelMap.cxx index 0e545574b16bc..db1e6c991e5c2 100644 --- a/Detectors/CPV/calib/src/BadChannelMap.cxx +++ b/DataFormats/Detectors/CPV/src/BadChannelMap.cxx @@ -9,7 +9,7 @@ // or submit itself to any jurisdiction. #include "CPVBase/Geometry.h" -#include "CPVCalib/BadChannelMap.h" +#include "DataFormatsCPV/BadChannelMap.h" #include "FairLogger.h" diff --git a/Detectors/CPV/calib/src/CalibParams.cxx b/DataFormats/Detectors/CPV/src/CalibParams.cxx similarity index 97% rename from Detectors/CPV/calib/src/CalibParams.cxx rename to DataFormats/Detectors/CPV/src/CalibParams.cxx index 4276a5d62b15f..10fd818fd7eb6 100644 --- a/Detectors/CPV/calib/src/CalibParams.cxx +++ b/DataFormats/Detectors/CPV/src/CalibParams.cxx @@ -8,7 +8,7 @@ // granted to it by virtue of its status as an Intergovernmental Organization // or submit itself to any jurisdiction. -#include "CPVCalib/CalibParams.h" +#include "DataFormatsCPV/CalibParams.h" #include "CPVBase/Geometry.h" #include "FairLogger.h" diff --git a/DataFormats/Detectors/CPV/src/DataFormatsCPVLinkDef.h b/DataFormats/Detectors/CPV/src/DataFormatsCPVLinkDef.h index 6313759502591..5e934f1b4f571 100644 --- a/DataFormats/Detectors/CPV/src/DataFormatsCPVLinkDef.h +++ b/DataFormats/Detectors/CPV/src/DataFormatsCPVLinkDef.h @@ -14,10 +14,12 @@ #pragma link off all classes; #pragma link off all functions; +#pragma link C++ class o2::cpv::Hit + ; #pragma link C++ class o2::cpv::Digit + ; #pragma link C++ class o2::cpv::Cluster + ; #pragma link C++ class o2::cpv::TriggerRecord + ; +#pragma link C++ class vector < o2::cpv::Hit> + ; #pragma link C++ class std::vector < o2::cpv::Digit> + ; #pragma link C++ class std::vector < o2::cpv::Cluster> + ; #pragma link C++ class std::vector < o2::cpv::TriggerRecord> + ; @@ -26,4 +28,12 @@ #pragma link C++ struct o2::cpv::CTF + ; #pragma link C++ class o2::ctf::EncodedBlocks < o2::cpv::CTFHeader, 7, uint32_t> + ; +#pragma link C++ class o2::cpv::BadChannelMap + ; +#pragma link C++ class o2::TObjectWrapper < o2::cpv::BadChannelMap> + ; +#pragma link C++ class o2::cpv::CalibParams + ; +#pragma link C++ class o2::TObjectWrapper < o2::cpv::CalibParams> + ; +#pragma link C++ class o2::cpv::Pedestals + ; +#pragma link C++ class o2::TObjectWrapper < o2::cpv::Pedestals> + ; + + #endif diff --git a/DataFormats/Detectors/CPV/src/Digit.cxx b/DataFormats/Detectors/CPV/src/Digit.cxx index e1263f165229f..21e6b3ad58857 100644 --- a/DataFormats/Detectors/CPV/src/Digit.cxx +++ b/DataFormats/Detectors/CPV/src/Digit.cxx @@ -10,7 +10,7 @@ #include "FairLogger.h" #include "DataFormatsCPV/Digit.h" -#include "CPVBase/Hit.h" +#include "DataFormatsCPV/Hit.h" #include using namespace o2::cpv; diff --git a/Detectors/CPV/base/src/Hit.cxx b/DataFormats/Detectors/CPV/src/Hit.cxx similarity index 98% rename from Detectors/CPV/base/src/Hit.cxx rename to DataFormats/Detectors/CPV/src/Hit.cxx index 9fbddd7e5fc7e..4762b13c7525c 100644 --- a/Detectors/CPV/base/src/Hit.cxx +++ b/DataFormats/Detectors/CPV/src/Hit.cxx @@ -8,7 +8,7 @@ // granted to it by virtue of its status as an Intergovernmental Organization // or submit itself to any jurisdiction. -#include "CPVBase/Hit.h" +#include "DataFormatsCPV/Hit.h" using namespace o2::cpv; diff --git a/Detectors/CPV/calib/src/Pedestals.cxx b/DataFormats/Detectors/CPV/src/Pedestals.cxx similarity index 98% rename from Detectors/CPV/calib/src/Pedestals.cxx rename to DataFormats/Detectors/CPV/src/Pedestals.cxx index 3f4f6ee39e811..c16c11722e636 100644 --- a/Detectors/CPV/calib/src/Pedestals.cxx +++ b/DataFormats/Detectors/CPV/src/Pedestals.cxx @@ -8,7 +8,7 @@ // granted to it by virtue of its status as an Intergovernmental Organization // or submit itself to any jurisdiction. -#include "CPVCalib/Pedestals.h" +#include "DataFormatsCPV/Pedestals.h" #include "FairLogger.h" #include #include diff --git a/Detectors/CPV/base/CMakeLists.txt b/Detectors/CPV/base/CMakeLists.txt index 3d0dd482329b8..1ddb7ba4a17ee 100644 --- a/Detectors/CPV/base/CMakeLists.txt +++ b/Detectors/CPV/base/CMakeLists.txt @@ -10,11 +10,9 @@ o2_add_library(CPVBase SOURCES src/Geometry.cxx - src/Hit.cxx src/CPVSimParams.cxx PUBLIC_LINK_LIBRARIES O2::SimulationDataFormat) o2_target_root_dictionary(CPVBase HEADERS include/CPVBase/Geometry.h - include/CPVBase/Hit.h include/CPVBase/CPVSimParams.h) diff --git a/Detectors/CPV/base/include/CPVBase/Geometry.h b/Detectors/CPV/base/include/CPVBase/Geometry.h index 634572043ac2b..9dfa43e63ec70 100644 --- a/Detectors/CPV/base/include/CPVBase/Geometry.h +++ b/Detectors/CPV/base/include/CPVBase/Geometry.h @@ -42,7 +42,6 @@ class Geometry /// Absolute pad coordunate /// absId=0..128*60*3-1=23039 /// Raw addresses: - /// DDL corresponds to one module: ddl=Module /// each module consist of 16 columns of width 8 pads: row=0..15 /// Each column consists of 10 dilogics (in z direction) dilogic=0...9 /// Ecah dilogic contains 8*6 pads: hwaddress=0...48 diff --git a/Detectors/CPV/base/src/CPVBaseLinkDef.h b/Detectors/CPV/base/src/CPVBaseLinkDef.h index 73ab6adea36da..8c82cbe04f7c2 100644 --- a/Detectors/CPV/base/src/CPVBaseLinkDef.h +++ b/Detectors/CPV/base/src/CPVBaseLinkDef.h @@ -15,8 +15,6 @@ #pragma link off all functions; #pragma link C++ class o2::cpv::Geometry + ; -#pragma link C++ class o2::cpv::Hit + ; -#pragma link C++ class vector < o2::cpv::Hit> + ; #pragma link C++ class o2::cpv::CPVSimParams + ; #pragma link C++ class o2::conf::ConfigurableParamHelper < o2::cpv::CPVSimParams> + ; diff --git a/Detectors/CPV/calib/CMakeLists.txt b/Detectors/CPV/calib/CMakeLists.txt index 0efd80cbd79c3..88c24c63bdb5d 100644 --- a/Detectors/CPV/calib/CMakeLists.txt +++ b/Detectors/CPV/calib/CMakeLists.txt @@ -8,27 +8,15 @@ # granted to it by virtue of its status as an Intergovernmental Organization or # submit itself to any jurisdiction. -o2_add_library(CPVCalib - SOURCES src/BadChannelMap.cxx - src/CalibParams.cxx - src/Pedestals.cxx - PUBLIC_LINK_LIBRARIES O2::CCDB O2::CPVBase) - -o2_target_root_dictionary(CPVCalib - HEADERS include/CPVCalib/BadChannelMap.h - include/CPVCalib/CalibParams.h - include/CPVCalib/Pedestals.h - LINKDEF src/CPVCalibLinkDef.h) - add_subdirectory(CPVCalibWorkflow) if(BUILD_TESTING) o2_add_test_root_macro(macros/PostBadMapCCDB.C - PUBLIC_LINK_LIBRARIES O2::CCDB O2::CPVBase O2::CPVCalib + PUBLIC_LINK_LIBRARIES O2::CCDB O2::DataFormatsCPV LABELS CPV COMPILE_ONLY) o2_add_test_root_macro( macros/PostCalibCCDB.C - PUBLIC_LINK_LIBRARIES O2::CCDB O2::CPVBase O2::CPVCalib + PUBLIC_LINK_LIBRARIES O2::CCDB O2::DataFormatsCPV LABELS CPV COMPILE_ONLY) endif() diff --git a/Detectors/CPV/calib/CPVCalibWorkflow/CMakeLists.txt b/Detectors/CPV/calib/CPVCalibWorkflow/CMakeLists.txt index 80eaae8e72474..c1b43174821c0 100644 --- a/Detectors/CPV/calib/CPVCalibWorkflow/CMakeLists.txt +++ b/Detectors/CPV/calib/CPVCalibWorkflow/CMakeLists.txt @@ -16,7 +16,6 @@ o2_add_library(CPVCalibWorkflow O2::DataFormatsCPV O2::DetectorsRaw O2::CPVReconstruction - O2::CPVCalib O2::DetectorsCalibration) @@ -25,6 +24,5 @@ o2_add_executable(calib-workflow SOURCES src/cpv-calib-workflow.cxx PUBLIC_LINK_LIBRARIES O2::Framework O2::DataFormatsCPV - O2::CPVCalib O2::CPVCalibWorkflow O2::DetectorsCalibration) diff --git a/Detectors/CPV/calib/CPVCalibWorkflow/include/CPVCalibWorkflow/CPVBadMapCalibDevice.h b/Detectors/CPV/calib/CPVCalibWorkflow/include/CPVCalibWorkflow/CPVBadMapCalibDevice.h index 9b475f4d70794..859168a928211 100644 --- a/Detectors/CPV/calib/CPVCalibWorkflow/include/CPVCalibWorkflow/CPVBadMapCalibDevice.h +++ b/Detectors/CPV/calib/CPVCalibWorkflow/include/CPVCalibWorkflow/CPVBadMapCalibDevice.h @@ -18,7 +18,7 @@ // #include "Framework/ConfigParamRegistry.h" // #include "Framework/ControlService.h" #include "Framework/WorkflowSpec.h" -#include "CPVCalib/BadChannelMap.h" +#include "DataFormatsCPV/BadChannelMap.h" #include "CPVBase/Geometry.h" #include "TH2.h" diff --git a/Detectors/CPV/calib/CPVCalibWorkflow/include/CPVCalibWorkflow/CPVGainCalibDevice.h b/Detectors/CPV/calib/CPVCalibWorkflow/include/CPVCalibWorkflow/CPVGainCalibDevice.h index 04f0635686a10..2f3009e60bdb2 100644 --- a/Detectors/CPV/calib/CPVCalibWorkflow/include/CPVCalibWorkflow/CPVGainCalibDevice.h +++ b/Detectors/CPV/calib/CPVCalibWorkflow/include/CPVCalibWorkflow/CPVGainCalibDevice.h @@ -16,7 +16,7 @@ #include "Framework/Task.h" #include "Framework/WorkflowSpec.h" -#include "CPVCalib/CalibParams.h" +#include "DataFormatsCPV/CalibParams.h" #include "CPVBase/Geometry.h" #include "TH2.h" #include diff --git a/Detectors/CPV/calib/CPVCalibWorkflow/include/CPVCalibWorkflow/CPVPedestalCalibDevice.h b/Detectors/CPV/calib/CPVCalibWorkflow/include/CPVCalibWorkflow/CPVPedestalCalibDevice.h index 95bad3d251c5c..3f3ed6cee78f0 100644 --- a/Detectors/CPV/calib/CPVCalibWorkflow/include/CPVCalibWorkflow/CPVPedestalCalibDevice.h +++ b/Detectors/CPV/calib/CPVCalibWorkflow/include/CPVCalibWorkflow/CPVPedestalCalibDevice.h @@ -18,7 +18,7 @@ // #include "Framework/ConfigParamRegistry.h" // #include "Framework/ControlService.h" #include "Framework/WorkflowSpec.h" -#include "CPVCalib/Pedestals.h" +#include "DataFormatsCPV/Pedestals.h" #include "CPVBase/Geometry.h" #include "TH2.h" diff --git a/Detectors/CPV/reconstruction/CMakeLists.txt b/Detectors/CPV/reconstruction/CMakeLists.txt index 09b1c003756be..7ec757f3648f0 100644 --- a/Detectors/CPV/reconstruction/CMakeLists.txt +++ b/Detectors/CPV/reconstruction/CMakeLists.txt @@ -16,7 +16,6 @@ o2_add_library(CPVReconstruction src/CTFCoder.cxx src/CTFHelper.cxx PUBLIC_LINK_LIBRARIES O2::CPVBase - O2::CPVCalib O2::DataFormatsCPV O2::DetectorsRaw AliceO2::InfoLogger diff --git a/Detectors/CPV/reconstruction/include/CPVReconstruction/Clusterer.h b/Detectors/CPV/reconstruction/include/CPVReconstruction/Clusterer.h index 591d5f75d13c4..3c728a3355e9f 100644 --- a/Detectors/CPV/reconstruction/include/CPVReconstruction/Clusterer.h +++ b/Detectors/CPV/reconstruction/include/CPVReconstruction/Clusterer.h @@ -15,8 +15,8 @@ #include "DataFormatsCPV/Digit.h" #include "DataFormatsCPV/Cluster.h" #include "CPVReconstruction/FullCluster.h" -#include "CPVCalib/CalibParams.h" -#include "CPVCalib/BadChannelMap.h" +#include "DataFormatsCPV/CalibParams.h" +#include "DataFormatsCPV/BadChannelMap.h" #include "SimulationDataFormat/MCTruthContainer.h" #include "DataFormatsCPV/TriggerRecord.h" diff --git a/Detectors/CPV/simulation/CMakeLists.txt b/Detectors/CPV/simulation/CMakeLists.txt index dd2b803aa3f4d..a5776a985b7a3 100644 --- a/Detectors/CPV/simulation/CMakeLists.txt +++ b/Detectors/CPV/simulation/CMakeLists.txt @@ -16,7 +16,6 @@ o2_add_library(CPVSimulation PUBLIC_LINK_LIBRARIES O2::DetectorsBase O2::DataFormatsCPV O2::CPVBase - O2::CPVCalib O2::CCDB O2::SimConfig O2::SimulationDataFormat diff --git a/Detectors/CPV/simulation/include/CPVSimulation/Detector.h b/Detectors/CPV/simulation/include/CPVSimulation/Detector.h index 8922c9a8cc9cc..04c5bc92fb066 100644 --- a/Detectors/CPV/simulation/include/CPVSimulation/Detector.h +++ b/Detectors/CPV/simulation/include/CPVSimulation/Detector.h @@ -13,7 +13,7 @@ #include "DetectorsBase/Detector.h" #include "MathUtils/Cartesian.h" -#include "CPVBase/Hit.h" +#include "DataFormatsCPV/Hit.h" #include "RStringView.h" #include "Rtypes.h" diff --git a/Detectors/CPV/simulation/include/CPVSimulation/Digitizer.h b/Detectors/CPV/simulation/include/CPVSimulation/Digitizer.h index adb199b353a27..f0f7fa3542429 100644 --- a/Detectors/CPV/simulation/include/CPVSimulation/Digitizer.h +++ b/Detectors/CPV/simulation/include/CPVSimulation/Digitizer.h @@ -11,12 +11,12 @@ #ifndef ALICEO2_CPV_DIGITIZER_H #define ALICEO2_CPV_DIGITIZER_H -#include "DataFormatsCPV/Digit.h" #include "CPVBase/Geometry.h" -#include "CPVCalib/CalibParams.h" -#include "CPVCalib/Pedestals.h" -#include "CPVCalib/BadChannelMap.h" -#include "CPVBase/Hit.h" +#include "DataFormatsCPV/Hit.h" +#include "DataFormatsCPV/Digit.h" +#include "DataFormatsCPV/CalibParams.h" +#include "DataFormatsCPV/Pedestals.h" +#include "DataFormatsCPV/BadChannelMap.h" #include "SimulationDataFormat/MCCompLabel.h" #include "SimulationDataFormat/MCTruthContainer.h" diff --git a/Detectors/CPV/simulation/include/CPVSimulation/RawWriter.h b/Detectors/CPV/simulation/include/CPVSimulation/RawWriter.h index e4f21a1dd388b..6399d4a165f1b 100644 --- a/Detectors/CPV/simulation/include/CPVSimulation/RawWriter.h +++ b/Detectors/CPV/simulation/include/CPVSimulation/RawWriter.h @@ -25,9 +25,9 @@ #include "DetectorsRaw/RawFileWriter.h" #include "DataFormatsCPV/Digit.h" #include "DataFormatsCPV/TriggerRecord.h" -#include "CPVCalib/CalibParams.h" -#include "CPVCalib/Pedestals.h" -#include "CPVCalib/BadChannelMap.h" +#include "DataFormatsCPV/CalibParams.h" +#include "DataFormatsCPV/Pedestals.h" +#include "DataFormatsCPV/BadChannelMap.h" namespace o2 { @@ -65,6 +65,7 @@ class RawWriter o2::raw::RawFileWriter& getWriter() const { return *mRawWriter; } void setOutputLocation(const char* outputdir) { mOutputLocation = outputdir; } + void setCcdbUrl(const char* ccdbUrl) { mCcdbUrl = ccdbUrl; } void setFileFor(FileFor_t filefor) { mFileFor = filefor; } void init(); @@ -79,6 +80,7 @@ class RawWriter std::vector mPadCharge[kNcc][kNDilogic][kNGasiplex]; ///< list of signals per event FileFor_t mFileFor = FileFor_t::kFullDet; ///< Granularity of the output files std::string mOutputLocation = "./"; ///< Rawfile name + std::string mCcdbUrl = "http://ccdb-test.cern.ch:8080"; ///< CCDB Url std::unique_ptr mCalibParams; ///< CPV calibration std::unique_ptr mPedestals; ///< CPV pedestals std::unique_ptr mBadMap; ///< CPV bad channel map @@ -86,7 +88,7 @@ class RawWriter gsl::span mDigits; ///< Digits input vector - must be in digitized format including the time response std::unique_ptr mRawWriter; ///< Raw writer - ClassDefNV(RawWriter, 1); + ClassDefNV(RawWriter, 2); }; } // namespace cpv diff --git a/Detectors/CPV/simulation/src/Detector.cxx b/Detectors/CPV/simulation/src/Detector.cxx index 98ce6f20f3f38..488d46a8be886 100644 --- a/Detectors/CPV/simulation/src/Detector.cxx +++ b/Detectors/CPV/simulation/src/Detector.cxx @@ -22,7 +22,7 @@ #include "FairVolume.h" #include "CPVBase/Geometry.h" -#include "CPVBase/Hit.h" +#include "DataFormatsCPV/Hit.h" #include "CPVBase/CPVSimParams.h" #include "CPVSimulation/Detector.h" #include "CPVSimulation/GeometryParams.h" diff --git a/Detectors/CPV/simulation/src/RawCreator.cxx b/Detectors/CPV/simulation/src/RawCreator.cxx index 97426bfa3662f..726ce400bdbcf 100644 --- a/Detectors/CPV/simulation/src/RawCreator.cxx +++ b/Detectors/CPV/simulation/src/RawCreator.cxx @@ -49,6 +49,7 @@ int main(int argc, const char** argv) add_option("file-for,f", bpo::value()->default_value("all"), "single file per: all,link"); add_option("output-dir,o", bpo::value()->default_value("./"), "output directory for raw data"); add_option("debug,d", bpo::value()->default_value(0), "Select debug output level [0 = no debug output]"); + add_option("ccdb-url,c", bpo::value()->default_value("http://ccdb-test.cern.ch:8080"), "CCDB Url ['localtest' for local testing]"); add_option("hbfutils-config,u", bpo::value()->default_value(std::string(o2::base::NameConf::DIGITIZATIONCONFIGFILE)), "config file for HBFUtils (or none)"); add_option("configKeyValues", bpo::value()->default_value(""), "comma-separated configKeyValues"); @@ -80,6 +81,8 @@ int main(int argc, const char** argv) outputdir = vm["output-dir"].as(), filefor = vm["file-for"].as(); + auto ccdbUrl = vm["ccdb-url"].as(); + // if needed, create output directory if (!std::filesystem::exists(outputdir)) { if (!std::filesystem::create_directories(outputdir)) { @@ -104,6 +107,7 @@ int main(int argc, const char** argv) o2::cpv::RawWriter rawwriter; rawwriter.setOutputLocation(outputdir.data()); rawwriter.setFileFor(granularity); + rawwriter.setCcdbUrl(ccdbUrl.data()); rawwriter.init(); // Loop over all entries in the tree, where each tree entry corresponds to a time frame diff --git a/Detectors/CPV/simulation/src/RawWriter.cxx b/Detectors/CPV/simulation/src/RawWriter.cxx index c632eb795abcb..75db0e2263380 100644 --- a/Detectors/CPV/simulation/src/RawWriter.cxx +++ b/Detectors/CPV/simulation/src/RawWriter.cxx @@ -18,7 +18,8 @@ #include "CPVSimulation/RawWriter.h" #include "CPVBase/CPVSimParams.h" #include "CPVBase/Geometry.h" -#include "CCDB/CcdbApi.h" +#include "CCDB/CCDBTimeStampUtils.h" +#include "CCDB/BasicCCDBManager.h" using namespace o2::cpv; @@ -34,57 +35,61 @@ void RawWriter::init() //ddl,crorc, link,... mRawWriter->registerLink(0, 0, 0, 0, rawfilename.data()); -} -void RawWriter::digitsToRaw(gsl::span digitsbranch, gsl::span triggerbranch) -{ - if (triggerbranch.begin() == triggerbranch.end()) { //do we have any data? - return; - } - if (!mCalibParams) { - if (o2::cpv::CPVSimParams::Instance().mCCDBPath.compare("localtest") == 0) { - mCalibParams = std::make_unique(1); // test default calibration - LOG(INFO) << "[RawWriter] No reading calibration from ccdb requested, set default"; - } else { - LOG(INFO) << "[RawWriter] getting calibration object from ccdb"; - o2::ccdb::CcdbApi ccdb; - std::map metadata; - ccdb.init("http://ccdb-test.cern.ch:8080"); // or http://localhost:8080 for a local installation - auto tr = triggerbranch.begin(); - double eventTime = -1; - // if(tr!=triggerbranch.end()){ - // eventTime = (*tr).getBCData().getTimeNS() ; - // } - //add copy constructor if necessary - // mCalibParams = std::make_unique(ccdb.retrieveFromTFileAny("CPV/Calib", metadata, eventTime)); - if (!mCalibParams) { - LOG(FATAL) << "[RawWriter] can not get calibration object from ccdb"; + //CCDB setup + LOG(INFO) << "CCDB Url: " << mCcdbUrl; + auto& ccdbMgr = o2::ccdb::BasicCCDBManager::instance(); + ccdbMgr.setURL(mCcdbUrl); + bool isCcdbReachable = ccdbMgr.isHostReachable();//if host is not reachable we can use only dummy calibration + if (!isCcdbReachable) { + if (mCcdbUrl.compare("localtest") != 0) { + LOG(ERROR) << "Host " << mCcdbUrl << " is not reachable!!!"; } + LOG(INFO) << "Using dummy calibration"; + mCalibParams = std::make_unique(1); + //mBadMap = std::make_unique(1); + mPedestals = std::make_unique(1); + } else { + ccdbMgr.setCaching(true);//make local cache of remote objects + ccdbMgr.setLocalObjectValidityChecking(true);//query objects from remote site only when local one is not valid + LOG(INFO) << "Successfully initializated BasicCCDBManager with caching option"; + + //read calibration from ccdb (for now do it only at the beginning of dataprocessing) + //TODO: setup timestam according to anchors + ccdbMgr.setTimestamp(o2::ccdb::getCurrentTimestamp()); + + LOG(INFO) << "CCDB: Reading o2::cpv::CalibParams from CPV/Calib/Gains"; + mCalibParams.reset(ccdbMgr.get("CPV/Calib/Gains")); + if (!mCalibParams) { + LOG(ERROR) << "Cannot get o2::cpv::CalibParams from CCDB. using dummy calibration!"; + mCalibParams = std::make_unique(1); } - } - if (!mPedestals) { - if (o2::cpv::CPVSimParams::Instance().mCCDBPath.compare("localtest") == 0) { - mPedestals = std::make_unique(1); // test default calibration - LOG(INFO) << "[RawWriter] No reading calibration from ccdb requested, set default"; - } else { - LOG(INFO) << "[RawWriter] getting calibration object from ccdb"; - o2::ccdb::CcdbApi ccdb; - std::map metadata; - ccdb.init("http://ccdb-test.cern.ch:8080"); // or http://localhost:8080 for a local installation - auto tr = triggerbranch.begin(); - double eventTime = -1; - // if(tr!=triggerbranch.end()){ - // eventTime = (*tr).getBCData().getTimeNS() ; - // } - //add copy constructor if necessary - // mPedestals = std::make_unique(ccdb.retrieveFromTFileAny("CPV/Calib", metadata, eventTime)); - if (!mPedestals) { - LOG(FATAL) << "[RawWriter] can not get calibration object from ccdb"; - } + /* + LOG(INFO) << "CCDB: Reading o2::cpv::BadChannelMap from CPV/Calib/BadChannelMap"; + mBadMap.reset(ccdbMgr.get("CPV/Calib/BadChannelMap")); + if (!mBadMap) { + LOG(ERROR) << "Cannot get o2::cpv::BadChannelMap from CCDB. using dummy calibration!"; + mBadMap = std::make_unique(1); } + */ + + LOG(INFO) << "CCDB: Reading o2::cpv::Pedestals from CPV/Calib/Pedestals"; + mPedestals.reset(ccdbMgr.get("CPV/Calib/Pedestals")); + if (!mPedestals) { + LOG(ERROR) << "Cannot get o2::cpv::Pedestals from CCDB. using dummy calibration!"; + mPedestals = std::make_unique(1); + } + LOG(INFO) << "Task configuration is done."; } +} +void RawWriter::digitsToRaw(gsl::span digitsbranch, gsl::span triggerbranch) +{ + if (triggerbranch.begin() == triggerbranch.end()) { //do we have any data? + return; + } + //process digits which belong to same orbit int iFirstTrgInCurrentOrbit = 0; int currentOrbit = triggerbranch[0].getBCData().orbit; diff --git a/Detectors/CPV/workflow/CMakeLists.txt b/Detectors/CPV/workflow/CMakeLists.txt index 905fa0dd5f2a0..a4f2f338d9c06 100644 --- a/Detectors/CPV/workflow/CMakeLists.txt +++ b/Detectors/CPV/workflow/CMakeLists.txt @@ -21,7 +21,6 @@ o2_add_library(CPVWorkflow O2::DataFormatsCPV O2::DPLUtils O2::CPVBase - O2::CPVCalib O2::CPVSimulation O2::CPVReconstruction O2::Algorithm) diff --git a/Detectors/CPV/workflow/include/CPVWorkflow/RawToDigitConverterSpec.h b/Detectors/CPV/workflow/include/CPVWorkflow/RawToDigitConverterSpec.h index d44ce0aa8bc6b..03dbe2f5308b1 100644 --- a/Detectors/CPV/workflow/include/CPVWorkflow/RawToDigitConverterSpec.h +++ b/Detectors/CPV/workflow/include/CPVWorkflow/RawToDigitConverterSpec.h @@ -14,10 +14,11 @@ #include "Framework/Task.h" #include "DataFormatsCPV/Digit.h" #include "DataFormatsCPV/TriggerRecord.h" -#include "CPVCalib/CalibParams.h" -#include "CPVCalib/BadChannelMap.h" -#include "CPVCalib/Pedestals.h" +#include "DataFormatsCPV/CalibParams.h" +#include "DataFormatsCPV/BadChannelMap.h" +#include "DataFormatsCPV/Pedestals.h" #include "CPVReconstruction/RawDecoder.h" +#include "CCDB/BasicCCDBManager.h" namespace o2 { @@ -52,8 +53,8 @@ class RawToDigitConverterSpec : public framework::Task /// /// The following branches are linked: /// Input RawData: {"ROUT", "RAWDATA", 0, Lifetime::Timeframe} - /// Output cells: {"CPV", "CELLS", 0, Lifetime::Timeframe} - /// Output cells trigger record: {"CPV", "CELLSTR", 0, Lifetime::Timeframe} + /// Output cells: {"CPV", "DIGITS", 0, Lifetime::Timeframe} + /// Output cells trigger record: {"CPV", "DIGITTRIGREC", 0, Lifetime::Timeframe} /// Output HW errors: {"CPV", "RAWHWERRORS", 0, Lifetime::Timeframe} void run(framework::ProcessingContext& ctx) final; @@ -62,8 +63,9 @@ class RawToDigitConverterSpec : public framework::Task char CheckHWAddress(short ddl, short hwAddress, short& fee); private: - int mDDL = 15; - bool mIsPedestalData; ///< No subtract pedestals if true + bool mIsPedestalData; ///< Do not subtract pedestals if true + bool mIsUsingCcdbMgr; ///< Are we using CCDB manager? + long mCurrentTimeStamp; ///< Current timestamp for CCDB querying std::unique_ptr mCalibParams; ///< CPV calibration std::unique_ptr mPedestals; ///< CPV pedestals std::unique_ptr mBadMap; ///< BadMap @@ -72,7 +74,7 @@ class RawToDigitConverterSpec : public framework::Task std::vector mOutputHWErrors; ///< Errors occured in reading data }; -/// \brief Creating DataProcessorSpec for the CPV Cell Converter Spec +/// \brief Creating DataProcessorSpec for the CPV Digit Converter Spec /// /// Refer to RawToDigitConverterSpec::run for input and output specs o2::framework::DataProcessorSpec getRawToDigitConverterSpec(); diff --git a/Detectors/CPV/workflow/src/RawToDigitConverterSpec.cxx b/Detectors/CPV/workflow/src/RawToDigitConverterSpec.cxx index 381cfcaabba42..0a62549a97635 100644 --- a/Detectors/CPV/workflow/src/RawToDigitConverterSpec.cxx +++ b/Detectors/CPV/workflow/src/RawToDigitConverterSpec.cxx @@ -19,115 +19,135 @@ #include "DetectorsRaw/RDHUtils.h" #include "CPVReconstruction/RawDecoder.h" #include "CPVWorkflow/RawToDigitConverterSpec.h" -#include "CCDB/CcdbApi.h" -#include "CPVBase/CPVSimParams.h" +#include "CCDB/CCDBTimeStampUtils.h" +#include "CCDB/BasicCCDBManager.h" #include "CPVBase/Geometry.h" using namespace o2::cpv::reco_workflow; void RawToDigitConverterSpec::init(framework::InitContext& ctx) { - mDDL = ctx.options().get("DDL"); - LOG(DEBUG) << "Initialize converter "; - + LOG(DEBUG) << "Initializing RawToDigitConverterSpec..."; + //Read command-line options - //Pedestal flag (on/off) - std::string optPedestal(""); + //Pedestal flag true/false + mIsPedestalData = false; if (ctx.options().isSet("pedestal")) { - optPedestal = ctx.options().get("pedestal"); + mIsPedestalData = ctx.options().get("pedestal"); + } + LOG(INFO) << "Pedestal data: " << mIsPedestalData; + if(mIsPedestalData) { //no calibration for pedestal runs needed + return; //skip CCDB initialization for pedestal runs + } + + //CCDB Url + std::string ccdbUrl = "localtest"; + if (ctx.options().isSet("ccdb-url")) { + ccdbUrl = ctx.options().get("ccdb-url"); + } + LOG(INFO) << "CCDB Url: " << ccdbUrl; + + //dummy calibration objects + if(ccdbUrl.compare("localtest")==0) {// test default calibration + mIsUsingCcdbMgr = false; + mCalibParams = std::make_unique(1); + mBadMap = std::make_unique(1); + mPedestals = std::make_unique(1); + LOG(INFO) << "No reading calibration from ccdb requested, using dummy calibration for testing"; + return; //localtest = no reading ccdb + } + + //init CCDB + auto& ccdbMgr = o2::ccdb::BasicCCDBManager::instance(); + ccdbMgr.setURL(ccdbUrl); + mIsUsingCcdbMgr = ccdbMgr.isHostReachable();//if host is not reachable we can use only dummy calibration + if (!mIsUsingCcdbMgr) { + LOG(ERROR) << "Host " << ccdbUrl << " is not reachable!!!"; + LOG(ERROR) << "Using dummy calibration"; + mCalibParams = std::make_unique(1); + mBadMap = std::make_unique(1); + mPedestals = std::make_unique(1); + } else { + ccdbMgr.setCaching(true);//make local cache of remote objects + ccdbMgr.setLocalObjectValidityChecking(true);//query objects from remote site only when local one is not valid + LOG(INFO) << "Successfully initializated BasicCCDBManager with caching option"; + + //read calibration from ccdb (for now do it only at the beginning of dataprocessing) + //probably later we can check bad channel map more oftenly + mCurrentTimeStamp = o2::ccdb::getCurrentTimestamp(); + ccdbMgr.setTimestamp(mCurrentTimeStamp); + + mCalibParams.reset(ccdbMgr.get("CPV/Calib/Gains")); + if (!mCalibParams) { + LOG(ERROR) << "Cannot get o2::cpv::CalibParams from CCDB. using dummy calibration!"; + mCalibParams = std::make_unique(1); + } + mBadMap.reset(ccdbMgr.get("CPV/Calib/BadChannelMap")); + if (!mBadMap) { + LOG(ERROR) << "Cannot get o2::cpv::BadChannelMap from CCDB. using dummy calibration!"; + mBadMap = std::make_unique(1); + } + mPedestals.reset(ccdbMgr.get("CPV/Calib/Pedestals")); + if (!mPedestals) { + LOG(ERROR) << "Cannot get o2::cpv::Pedestals from CCDB. using dummy calibration!"; + mPedestals = std::make_unique(1); + } + LOG(INFO) << "Task configuration is done."; } - LOG(INFO) << "Pedestal data: " << optPedestal; - mIsPedestalData = optPedestal == "on" ? true : false; } void RawToDigitConverterSpec::run(framework::ProcessingContext& ctx) -{ +{ // Cache digits from bunch crossings as the component reads timeframes from many links consecutively std::map>> digitBuffer; // Internal digit buffer int firstEntry = 0; mOutputHWErrors.clear(); - if (!mCalibParams) { - if (o2::cpv::CPVSimParams::Instance().mCCDBPath.compare("localtest") == 0) { - mCalibParams = std::make_unique(1); // test default calibration - LOG(INFO) << "No reading calibration from ccdb requested, set default"; - } else { - LOG(INFO) << "Getting calibration object from ccdb"; - //TODO: configuring ccdb address from config file, readign proper calibration/BadMap and updateing if necessary - o2::ccdb::CcdbApi ccdb; - std::map metadata; - ccdb.init("http://ccdb-test.cern.ch:8080"); // or http://localhost:8080 for a local installation - // auto tr = triggerbranch.begin(); - // double eventTime = -1; - // if(tr!=triggerbranch.end()){ - // eventTime = (*tr).getBCData().getTimeNS() ; - // } - // mCalibParams = ccdb.retrieveFromTFileAny("CPV/Calib", metadata, eventTime); - // if (!mCalibParams) { - // LOG(FATAL) << "Can not get calibration object from ccdb"; - // } + // if we see requested data type input with 0xDEADBEEF subspec and 0 payload this means that the "delayed message" + // mechanism created it in absence of real data from upstream. Processor should send empty output to not block the workflow + std::vector dummy{o2::framework::InputSpec{"dummy", o2::framework::ConcreteDataMatcher{"CPV", o2::header::gDataDescriptionRawData, 0xDEADBEEF}}}; + for (const auto& ref : framework::InputRecordWalker(ctx.inputs(), dummy)) { + const auto dh = o2::framework::DataRefUtils::getHeader(ref); + if (dh->payloadSize == 0) { // send empty output + LOG(INFO) << "Sending empty output due to data type input with 0xDEADBEEF"; + mOutputDigits.clear(); + ctx.outputs().snapshot(o2::framework::Output{"CPV", "DIGITS", 0, o2::framework::Lifetime::Timeframe}, mOutputDigits); + mOutputTriggerRecords.clear(); + ctx.outputs().snapshot(o2::framework::Output{"CPV", "DIGITTRIGREC", 0, o2::framework::Lifetime::Timeframe}, mOutputTriggerRecords); + mOutputHWErrors.clear(); + ctx.outputs().snapshot(o2::framework::Output{"CPV", "RAWHWERRORS", 0, o2::framework::Lifetime::Timeframe}, mOutputHWErrors); + return; //empty TF, nothing to process } } - if (!mBadMap) { - if (o2::cpv::CPVSimParams::Instance().mCCDBPath.compare("localtest") == 0) { - mBadMap = std::make_unique(1); // test default calibration - LOG(INFO) << "No reading bad map from ccdb requested, set default"; - } else { - LOG(INFO) << "Getting bad map object from ccdb"; - o2::ccdb::CcdbApi ccdb; - std::map metadata; - ccdb.init("http://ccdb-test.cern.ch:8080"); // or http://localhost:8080 for a local installation - // auto tr = triggerbranch.begin(); - // double eventTime = -1; - // if(tr!=triggerbranch.end()){ - // eventTime = (*tr).getBCData().getTimeNS() ; - // } - // mBadMap = ccdb.retrieveFromTFileAny("CPV/BadMap", metadata, eventTime); - // if (!mBadMap) { - // LOG(FATAL) << "Can not get bad map object from ccdb"; - // } - } - } + //we need to know timestamp from data. + //for now lets consider it is 'now' (i.e. o2::ccdb::getCurrentTS()) - if (!mPedestals && !mIsPedestalData) { - if (o2::cpv::CPVSimParams::Instance().mCCDBPath.compare("localtest") == 0) { - mPedestals = std::make_unique(1); // test default calibration - LOG(INFO) << "No reading calibration from ccdb requested, set default"; - } else { - LOG(INFO) << "Getting calibration object from ccdb"; - //TODO: configuring ccdb address from config file, readign proper calibration/BadMap and updateing if necessary - o2::ccdb::CcdbApi ccdb; - std::map metadata; - ccdb.init("http://ccdb-test.cern.ch:8080"); // or http://localhost:8080 for a local installation - // auto tr = triggerbranch.begin(); - // double eventTime = -1; - // if(tr!=triggerbranch.end()){ - // eventTime = (*tr).getBCData().getTimeNS() ; - // } - // mPedestals = ccdb.retrieveFromTFileAny("CPV/Calib", metadata, eventTime); - // if (!mPedestals) { - // LOG(FATAL) << "Can not get calibration object from ccdb"; - // } - } - } + std::vector rawFilter{ + {"RAWDATA", o2::framework::ConcreteDataTypeMatcher{"CPV", "RAWDATA"}, o2::framework::Lifetime::Timeframe}, + }; + for (const auto& rawData : framework::InputRecordWalker(ctx.inputs(), rawFilter)) { + /*enum RawErrorType_t { + kOK, ///< NoError + kOK_NO_PAYLOAD, ///< No payload per ddl (not error) + kRDH_DECODING, + kRDH_INVALID, + kNOT_CPV_RDH, + kSTOPBIT_NOTFOUND, + kPAGE_NOTFOUND, + kPAYLOAD_INCOMPLETE, + kNO_CPVHEADER, + kNO_CPVTRAILER, + kCPVHEADER_INVALID, + kCPVTRAILER_INVALID, + kSEGMENT_HEADER_ERROR, + kROW_HEADER_ERROR, + kEOE_HEADER_ERROR, + kPADERROR, + kUNKNOWN_WORD, + kPadAddress + };*/ - for (const auto& rawData : framework::InputRecordWalker(ctx.inputs())) { - /* enum RawErrorType_t { - kOK, ///< NoError - kNO_PAYLOAD, ///< No payload per ddl - kRDH_DECODING, - kNOT_CPV_RDH, - kPAGE_NOTFOUND, - kPAYLOAD_INCOMPLETE, - kCPVHEADER_INVALID, - kCPVTRAILER_INVALID, - kSEGMENT_HEADER_ERROR, - kROW_HEADER_ERROR, - kEOE_HEADER_ERROR, - kPADERROR, - kPadAddress - */ o2::cpv::RawReaderMemory rawreader(o2::framework::DataRefUtils::as(rawData)); // loop over all the DMA pages while (rawreader.hasNext()) { @@ -136,7 +156,8 @@ void RawToDigitConverterSpec::run(framework::ProcessingContext& ctx) } catch (RawErrorType_t e) { LOG(ERROR) << "Raw decoding error " << (int)e; //add error list - mOutputHWErrors.emplace_back(5, 0, 0, 0, e); //Put general errors to non-existing DDL5 + //RawDecoderError(short c, short d, short g, short p, RawErrorType_t e) + mOutputHWErrors.emplace_back(25, 0, 0, 0, e); //Put general errors to non-existing ccId 25 //if problem in header, abandon this page if (e == RawErrorType_t::kRDH_DECODING) { break; @@ -146,24 +167,20 @@ void RawToDigitConverterSpec::run(framework::ProcessingContext& ctx) } auto& rdh = rawreader.getRawHeader(); auto triggerOrbit = o2::raw::RDHUtils::getTriggerOrbit(rdh); - // auto ddl = o2::raw::RDHUtils::getFEEID(header); auto mod = o2::raw::RDHUtils::getLinkID(rdh) + 2; //link=0,1,2 -> mod=2,3,4 - // if(ddl != mDDL){ - // LOG(ERROR) << "DDL from header "<< ddl << " != configured DDL=" << mDDL; - // } - if (mod > o2::cpv::Geometry::kNMod) { //only 3 correct modules:2,3,4 + //for now all modules are written to one LinkID + if (mod > o2::cpv::Geometry::kNMod || mod < 2) { //only 3 correct modules:2,3,4 LOG(ERROR) << "module=" << mod << "do not exist"; - mOutputHWErrors.emplace_back(6, mod, 0, 0, kRDH_INVALID); //Add non-existing DDL as DDL 5 + mOutputHWErrors.emplace_back(25, mod, 0, 0, kRDH_INVALID); //Add non-existing modules to non-existing ccId 25 and dilogic = mod continue; //skip STU mod } - // use the altro decoder to decode the raw data, and extract the RCU trailer o2::cpv::RawDecoder decoder(rawreader); RawErrorType_t err = decoder.decode(); - if (err != kOK) { + if (!(err == kOK || err == kOK_NO_PAYLOAD)) { //TODO handle severe errors //TODO: probably careful conversion of decoder errors to Fitter errors? - mOutputHWErrors.emplace_back(mod, 1, 0, 0, err); //assign general header errors to non-existing FEE 16 + mOutputHWErrors.emplace_back(25, mod, 0, 0, err); //assign general RDH errors to non-existing ccId 25 and dilogic = mod } std::shared_ptr> currentDigitContainer; @@ -237,18 +254,21 @@ o2::framework::DataProcessorSpec o2::cpv::reco_workflow::getRawToDigitConverterS { std::vector inputs; inputs.emplace_back("RAWDATA", o2::framework::ConcreteDataTypeMatcher{"CPV", "RAWDATA"}, o2::framework::Lifetime::Timeframe); + //receive at least 1 guaranteed input (which will allow to acknowledge the TF) + inputs.emplace_back("STFDist", "FLP", "DISTSUBTIMEFRAME", 0, o2::framework::Lifetime::Timeframe); std::vector outputs; outputs.emplace_back("CPV", "DIGITS", 0, o2::framework::Lifetime::Timeframe); outputs.emplace_back("CPV", "DIGITTRIGREC", 0, o2::framework::Lifetime::Timeframe); outputs.emplace_back("CPV", "RAWHWERRORS", 0, o2::framework::Lifetime::Timeframe); + //note that for cpv we always have stream #0 (i.e. CPV/DIGITS/0) return o2::framework::DataProcessorSpec{"CPVRawToDigitConverterSpec", inputs, // o2::framework::select("A:CPV/RAWDATA"), outputs, o2::framework::adaptFromTask(), o2::framework::Options{ - {"pedestal", o2::framework::VariantType::String, "off", {"Analyze as pedestal run on/off"}}, - {"DDL", o2::framework::VariantType::String, "0", {"DDL id to read"}}, + {"pedestal", o2::framework::VariantType::Bool, false, {"If true then do not subtract pedestals from digits"}}, + {"ccdb-url", o2::framework::VariantType::String, "http://ccdb-test.cern.ch:8080", {"CCDB Url"}}, }}; } diff --git a/Detectors/CPV/workflow/src/cpv-reco-workflow.cxx b/Detectors/CPV/workflow/src/cpv-reco-workflow.cxx index d74275e344775..f62cf72f48ef9 100644 --- a/Detectors/CPV/workflow/src/cpv-reco-workflow.cxx +++ b/Detectors/CPV/workflow/src/cpv-reco-workflow.cxx @@ -33,6 +33,8 @@ void customize(std::vector& workflowOptions) {"disable-mc", o2::framework::VariantType::Bool, false, {"disable sending of MC information"}}, {"disable-root-input", o2::framework::VariantType::Bool, false, {"disable root-files input reader"}}, {"disable-root-output", o2::framework::VariantType::Bool, false, {"disable root-files output writer"}}, + {"pedestal", o2::framework::VariantType::Bool, false, {"pedestal run? if true then don't subtract pedestals from digits"}}, + //{"ccdb-url", o2::framework::VariantType::String, "http://ccdb-test.cern.ch:8080", {"path to CCDB like http://ccdb-test.cern.ch:8080"}}, {"configKeyValues", o2::framework::VariantType::String, "", {"Semicolon separated key=value strings ..."}}}; std::swap(workflowOptions, options); } @@ -62,5 +64,7 @@ o2::framework::WorkflowSpec defineDataProcessing(o2::framework::ConfigContext co !cfgc.options().get("disable-mc"), // cfgc.options().get("input-type"), // cfgc.options().get("output-type") // + // cfgc.options().get("pedestal"), + // cfgc.options().get("ccdb-url"), ); } diff --git a/Steer/DigitizerWorkflow/src/CPVDigitizerSpec.h b/Steer/DigitizerWorkflow/src/CPVDigitizerSpec.h index a7ba75fb7e023..226cbb160b169 100644 --- a/Steer/DigitizerWorkflow/src/CPVDigitizerSpec.h +++ b/Steer/DigitizerWorkflow/src/CPVDigitizerSpec.h @@ -14,7 +14,7 @@ #include "Framework/DataProcessorSpec.h" #include "Framework/Task.h" #include "DataFormatsCPV/Digit.h" -#include "CPVBase/Hit.h" +#include "DataFormatsCPV/Hit.h" #include "CPVSimulation/Digitizer.h" #include "SimulationDataFormat/MCTruthContainer.h" #include "DetectorsBase/BaseDPLDigitizer.h" From b0ef064ad814b3eaedc4076362b50c2ac5ca999a Mon Sep 17 00:00:00 2001 From: sevdokim Date: Mon, 21 Jun 2021 22:10:58 +0200 Subject: [PATCH 2/6] clang-formatted commit --- .../Detectors/CPV/src/DataFormatsCPVLinkDef.h | 1 - Detectors/CPV/simulation/src/RawWriter.cxx | 22 ++++++------ .../workflow/src/RawToDigitConverterSpec.cxx | 34 +++++++++---------- .../CPV/workflow/src/cpv-reco-workflow.cxx | 4 +-- 4 files changed, 30 insertions(+), 31 deletions(-) diff --git a/DataFormats/Detectors/CPV/src/DataFormatsCPVLinkDef.h b/DataFormats/Detectors/CPV/src/DataFormatsCPVLinkDef.h index 5e934f1b4f571..4cd7b3dc13fa1 100644 --- a/DataFormats/Detectors/CPV/src/DataFormatsCPVLinkDef.h +++ b/DataFormats/Detectors/CPV/src/DataFormatsCPVLinkDef.h @@ -35,5 +35,4 @@ #pragma link C++ class o2::cpv::Pedestals + ; #pragma link C++ class o2::TObjectWrapper < o2::cpv::Pedestals> + ; - #endif diff --git a/Detectors/CPV/simulation/src/RawWriter.cxx b/Detectors/CPV/simulation/src/RawWriter.cxx index 75db0e2263380..a878fb7223f4b 100644 --- a/Detectors/CPV/simulation/src/RawWriter.cxx +++ b/Detectors/CPV/simulation/src/RawWriter.cxx @@ -40,18 +40,18 @@ void RawWriter::init() LOG(INFO) << "CCDB Url: " << mCcdbUrl; auto& ccdbMgr = o2::ccdb::BasicCCDBManager::instance(); ccdbMgr.setURL(mCcdbUrl); - bool isCcdbReachable = ccdbMgr.isHostReachable();//if host is not reachable we can use only dummy calibration + bool isCcdbReachable = ccdbMgr.isHostReachable(); //if host is not reachable we can use only dummy calibration if (!isCcdbReachable) { - if (mCcdbUrl.compare("localtest") != 0) { - LOG(ERROR) << "Host " << mCcdbUrl << " is not reachable!!!"; - } - LOG(INFO) << "Using dummy calibration"; - mCalibParams = std::make_unique(1); - //mBadMap = std::make_unique(1); - mPedestals = std::make_unique(1); + if (mCcdbUrl.compare("localtest") != 0) { + LOG(ERROR) << "Host " << mCcdbUrl << " is not reachable!!!"; + } + LOG(INFO) << "Using dummy calibration"; + mCalibParams = std::make_unique(1); + //mBadMap = std::make_unique(1); + mPedestals = std::make_unique(1); } else { - ccdbMgr.setCaching(true);//make local cache of remote objects - ccdbMgr.setLocalObjectValidityChecking(true);//query objects from remote site only when local one is not valid + ccdbMgr.setCaching(true); //make local cache of remote objects + ccdbMgr.setLocalObjectValidityChecking(true); //query objects from remote site only when local one is not valid LOG(INFO) << "Successfully initializated BasicCCDBManager with caching option"; //read calibration from ccdb (for now do it only at the beginning of dataprocessing) @@ -89,7 +89,7 @@ void RawWriter::digitsToRaw(gsl::span digitsbranch, gsl::span("pedestal"); } LOG(INFO) << "Pedestal data: " << mIsPedestalData; - if(mIsPedestalData) { //no calibration for pedestal runs needed - return; //skip CCDB initialization for pedestal runs + if (mIsPedestalData) { //no calibration for pedestal runs needed + return; //skip CCDB initialization for pedestal runs } //CCDB Url std::string ccdbUrl = "localtest"; if (ctx.options().isSet("ccdb-url")) { ccdbUrl = ctx.options().get("ccdb-url"); - } + } LOG(INFO) << "CCDB Url: " << ccdbUrl; //dummy calibration objects - if(ccdbUrl.compare("localtest")==0) {// test default calibration + if (ccdbUrl.compare("localtest") == 0) { // test default calibration mIsUsingCcdbMgr = false; - mCalibParams = std::make_unique(1); + mCalibParams = std::make_unique(1); mBadMap = std::make_unique(1); mPedestals = std::make_unique(1); LOG(INFO) << "No reading calibration from ccdb requested, using dummy calibration for testing"; @@ -60,16 +60,16 @@ void RawToDigitConverterSpec::init(framework::InitContext& ctx) //init CCDB auto& ccdbMgr = o2::ccdb::BasicCCDBManager::instance(); ccdbMgr.setURL(ccdbUrl); - mIsUsingCcdbMgr = ccdbMgr.isHostReachable();//if host is not reachable we can use only dummy calibration + mIsUsingCcdbMgr = ccdbMgr.isHostReachable(); //if host is not reachable we can use only dummy calibration if (!mIsUsingCcdbMgr) { - LOG(ERROR) << "Host " << ccdbUrl << " is not reachable!!!"; - LOG(ERROR) << "Using dummy calibration"; - mCalibParams = std::make_unique(1); - mBadMap = std::make_unique(1); - mPedestals = std::make_unique(1); + LOG(ERROR) << "Host " << ccdbUrl << " is not reachable!!!"; + LOG(ERROR) << "Using dummy calibration"; + mCalibParams = std::make_unique(1); + mBadMap = std::make_unique(1); + mPedestals = std::make_unique(1); } else { - ccdbMgr.setCaching(true);//make local cache of remote objects - ccdbMgr.setLocalObjectValidityChecking(true);//query objects from remote site only when local one is not valid + ccdbMgr.setCaching(true); //make local cache of remote objects + ccdbMgr.setLocalObjectValidityChecking(true); //query objects from remote site only when local one is not valid LOG(INFO) << "Successfully initializated BasicCCDBManager with caching option"; //read calibration from ccdb (for now do it only at the beginning of dataprocessing) @@ -97,7 +97,7 @@ void RawToDigitConverterSpec::init(framework::InitContext& ctx) } void RawToDigitConverterSpec::run(framework::ProcessingContext& ctx) -{ +{ // Cache digits from bunch crossings as the component reads timeframes from many links consecutively std::map>> digitBuffer; // Internal digit buffer int firstEntry = 0; @@ -156,7 +156,7 @@ void RawToDigitConverterSpec::run(framework::ProcessingContext& ctx) } catch (RawErrorType_t e) { LOG(ERROR) << "Raw decoding error " << (int)e; //add error list - //RawDecoderError(short c, short d, short g, short p, RawErrorType_t e) + //RawDecoderError(short c, short d, short g, short p, RawErrorType_t e) mOutputHWErrors.emplace_back(25, 0, 0, 0, e); //Put general errors to non-existing ccId 25 //if problem in header, abandon this page if (e == RawErrorType_t::kRDH_DECODING) { @@ -172,7 +172,7 @@ void RawToDigitConverterSpec::run(framework::ProcessingContext& ctx) if (mod > o2::cpv::Geometry::kNMod || mod < 2) { //only 3 correct modules:2,3,4 LOG(ERROR) << "module=" << mod << "do not exist"; mOutputHWErrors.emplace_back(25, mod, 0, 0, kRDH_INVALID); //Add non-existing modules to non-existing ccId 25 and dilogic = mod - continue; //skip STU mod + continue; //skip STU mod } o2::cpv::RawDecoder decoder(rawreader); RawErrorType_t err = decoder.decode(); diff --git a/Detectors/CPV/workflow/src/cpv-reco-workflow.cxx b/Detectors/CPV/workflow/src/cpv-reco-workflow.cxx index f62cf72f48ef9..cee3ce069da2a 100644 --- a/Detectors/CPV/workflow/src/cpv-reco-workflow.cxx +++ b/Detectors/CPV/workflow/src/cpv-reco-workflow.cxx @@ -64,7 +64,7 @@ o2::framework::WorkflowSpec defineDataProcessing(o2::framework::ConfigContext co !cfgc.options().get("disable-mc"), // cfgc.options().get("input-type"), // cfgc.options().get("output-type") // - // cfgc.options().get("pedestal"), - // cfgc.options().get("ccdb-url"), + // cfgc.options().get("pedestal"), + // cfgc.options().get("ccdb-url"), ); } From 1fff61e5b33e26091e4b485ce4a7c5db86d6e0de Mon Sep 17 00:00:00 2001 From: sevdokim Date: Mon, 21 Jun 2021 23:21:08 +0200 Subject: [PATCH 3/6] format fix of CMakeLists.txt --- DataFormats/Detectors/CPV/CMakeLists.txt | 16 ++++++------ .../Detectors/CPV/src/DataFormatsCPVLinkDef.h | 3 --- Detectors/CPV/base/CMakeLists.txt | 2 +- Detectors/CPV/calib/CMakeLists.txt | 2 +- .../CPV/calib/CPVCalibWorkflow/CMakeLists.txt | 2 +- Detectors/CPV/simulation/CMakeLists.txt | 4 +-- Detectors/CPV/workflow/CMakeLists.txt | 12 ++++----- .../workflow/src/RawToDigitConverterSpec.cxx | 25 +------------------ .../CPV/workflow/src/cpv-reco-workflow.cxx | 9 +++---- 9 files changed, 23 insertions(+), 52 deletions(-) diff --git a/DataFormats/Detectors/CPV/CMakeLists.txt b/DataFormats/Detectors/CPV/CMakeLists.txt index b7988e779e3ca..5194406785adf 100644 --- a/DataFormats/Detectors/CPV/CMakeLists.txt +++ b/DataFormats/Detectors/CPV/CMakeLists.txt @@ -9,20 +9,20 @@ # submit itself to any jurisdiction. o2_add_library(DataFormatsCPV - SOURCES src/CPVBlockHeader.cxx + SOURCES src/CPVBlockHeader.cxx src/Hit.cxx - src/Digit.cxx - src/Cluster.cxx + src/Digit.cxx + src/Cluster.cxx src/TriggerRecord.cxx src/CTF.cxx src/CalibParams.cxx src/BadChannelMap.cxx src/Pedestals.cxx - PUBLIC_LINK_LIBRARIES O2::CommonDataFormat - O2::Headers - O2::MathUtils - O2::DetectorsBase - O2::CPVBase + PUBLIC_LINK_LIBRARIES O2::CommonDataFormat + O2::Headers + O2::MathUtils + O2::DetectorsBase + O2::CPVBase O2::SimulationDataFormat Boost::serialization) diff --git a/DataFormats/Detectors/CPV/src/DataFormatsCPVLinkDef.h b/DataFormats/Detectors/CPV/src/DataFormatsCPVLinkDef.h index 4cd7b3dc13fa1..80918b6c9e30f 100644 --- a/DataFormats/Detectors/CPV/src/DataFormatsCPVLinkDef.h +++ b/DataFormats/Detectors/CPV/src/DataFormatsCPVLinkDef.h @@ -29,10 +29,7 @@ #pragma link C++ class o2::ctf::EncodedBlocks < o2::cpv::CTFHeader, 7, uint32_t> + ; #pragma link C++ class o2::cpv::BadChannelMap + ; -#pragma link C++ class o2::TObjectWrapper < o2::cpv::BadChannelMap> + ; #pragma link C++ class o2::cpv::CalibParams + ; -#pragma link C++ class o2::TObjectWrapper < o2::cpv::CalibParams> + ; #pragma link C++ class o2::cpv::Pedestals + ; -#pragma link C++ class o2::TObjectWrapper < o2::cpv::Pedestals> + ; #endif diff --git a/Detectors/CPV/base/CMakeLists.txt b/Detectors/CPV/base/CMakeLists.txt index 1ddb7ba4a17ee..10258ffc3770c 100644 --- a/Detectors/CPV/base/CMakeLists.txt +++ b/Detectors/CPV/base/CMakeLists.txt @@ -9,7 +9,7 @@ # submit itself to any jurisdiction. o2_add_library(CPVBase - SOURCES src/Geometry.cxx + SOURCES src/Geometry.cxx src/CPVSimParams.cxx PUBLIC_LINK_LIBRARIES O2::SimulationDataFormat) diff --git a/Detectors/CPV/calib/CMakeLists.txt b/Detectors/CPV/calib/CMakeLists.txt index 88c24c63bdb5d..ddce7dc1730f7 100644 --- a/Detectors/CPV/calib/CMakeLists.txt +++ b/Detectors/CPV/calib/CMakeLists.txt @@ -11,7 +11,7 @@ add_subdirectory(CPVCalibWorkflow) if(BUILD_TESTING) - o2_add_test_root_macro(macros/PostBadMapCCDB.C + o2_add_test_root_macro(macros/PostBadMapCCDB.C PUBLIC_LINK_LIBRARIES O2::CCDB O2::DataFormatsCPV LABELS CPV COMPILE_ONLY) diff --git a/Detectors/CPV/calib/CPVCalibWorkflow/CMakeLists.txt b/Detectors/CPV/calib/CPVCalibWorkflow/CMakeLists.txt index c1b43174821c0..b52ef05fb18d8 100644 --- a/Detectors/CPV/calib/CPVCalibWorkflow/CMakeLists.txt +++ b/Detectors/CPV/calib/CPVCalibWorkflow/CMakeLists.txt @@ -12,7 +12,7 @@ o2_add_library(CPVCalibWorkflow SOURCES src/CPVPedestalCalibDevice.cxx src/CPVGainCalibDevice.cxx src/CPVBadMapCalibDevice.cxx - PUBLIC_LINK_LIBRARIES O2::Framework + PUBLIC_LINK_LIBRARIES O2::Framework O2::DataFormatsCPV O2::DetectorsRaw O2::CPVReconstruction diff --git a/Detectors/CPV/simulation/CMakeLists.txt b/Detectors/CPV/simulation/CMakeLists.txt index a5776a985b7a3..53dfd43567d28 100644 --- a/Detectors/CPV/simulation/CMakeLists.txt +++ b/Detectors/CPV/simulation/CMakeLists.txt @@ -18,8 +18,8 @@ o2_add_library(CPVSimulation O2::CPVBase O2::CCDB O2::SimConfig - O2::SimulationDataFormat - O2::Headers + O2::SimulationDataFormat + O2::Headers O2::DetectorsRaw) o2_target_root_dictionary(CPVSimulation diff --git a/Detectors/CPV/workflow/CMakeLists.txt b/Detectors/CPV/workflow/CMakeLists.txt index a4f2f338d9c06..2289e72b53d92 100644 --- a/Detectors/CPV/workflow/CMakeLists.txt +++ b/Detectors/CPV/workflow/CMakeLists.txt @@ -17,12 +17,12 @@ o2_add_library(CPVWorkflow src/RawToDigitConverterSpec.cxx src/EntropyEncoderSpec.cxx src/EntropyDecoderSpec.cxx - PUBLIC_LINK_LIBRARIES O2::Framework - O2::DataFormatsCPV - O2::DPLUtils - O2::CPVBase - O2::CPVSimulation - O2::CPVReconstruction + PUBLIC_LINK_LIBRARIES O2::Framework + O2::DataFormatsCPV + O2::DPLUtils + O2::CPVBase + O2::CPVSimulation + O2::CPVReconstruction O2::Algorithm) o2_add_executable(reco-workflow diff --git a/Detectors/CPV/workflow/src/RawToDigitConverterSpec.cxx b/Detectors/CPV/workflow/src/RawToDigitConverterSpec.cxx index e1c1fc28600e7..dbb5d636a0cca 100644 --- a/Detectors/CPV/workflow/src/RawToDigitConverterSpec.cxx +++ b/Detectors/CPV/workflow/src/RawToDigitConverterSpec.cxx @@ -120,34 +120,10 @@ void RawToDigitConverterSpec::run(framework::ProcessingContext& ctx) } } - //we need to know timestamp from data. - //for now lets consider it is 'now' (i.e. o2::ccdb::getCurrentTS()) - std::vector rawFilter{ {"RAWDATA", o2::framework::ConcreteDataTypeMatcher{"CPV", "RAWDATA"}, o2::framework::Lifetime::Timeframe}, }; for (const auto& rawData : framework::InputRecordWalker(ctx.inputs(), rawFilter)) { - /*enum RawErrorType_t { - kOK, ///< NoError - kOK_NO_PAYLOAD, ///< No payload per ddl (not error) - kRDH_DECODING, - kRDH_INVALID, - kNOT_CPV_RDH, - kSTOPBIT_NOTFOUND, - kPAGE_NOTFOUND, - kPAYLOAD_INCOMPLETE, - kNO_CPVHEADER, - kNO_CPVTRAILER, - kCPVHEADER_INVALID, - kCPVTRAILER_INVALID, - kSEGMENT_HEADER_ERROR, - kROW_HEADER_ERROR, - kEOE_HEADER_ERROR, - kPADERROR, - kUNKNOWN_WORD, - kPadAddress - };*/ - o2::cpv::RawReaderMemory rawreader(o2::framework::DataRefUtils::as(rawData)); // loop over all the DMA pages while (rawreader.hasNext()) { @@ -156,6 +132,7 @@ void RawToDigitConverterSpec::run(framework::ProcessingContext& ctx) } catch (RawErrorType_t e) { LOG(ERROR) << "Raw decoding error " << (int)e; //add error list + //RawErrorType_t is defined in O2/Detectors/CPV/reconstruction/include/CPVReconstruction/RawReaderMemory.h //RawDecoderError(short c, short d, short g, short p, RawErrorType_t e) mOutputHWErrors.emplace_back(25, 0, 0, 0, e); //Put general errors to non-existing ccId 25 //if problem in header, abandon this page diff --git a/Detectors/CPV/workflow/src/cpv-reco-workflow.cxx b/Detectors/CPV/workflow/src/cpv-reco-workflow.cxx index cee3ce069da2a..010751b7085ca 100644 --- a/Detectors/CPV/workflow/src/cpv-reco-workflow.cxx +++ b/Detectors/CPV/workflow/src/cpv-reco-workflow.cxx @@ -61,10 +61,7 @@ o2::framework::WorkflowSpec defineDataProcessing(o2::framework::ConfigContext co return o2::cpv::reco_workflow::getWorkflow(cfgc.options().get("disable-root-input"), cfgc.options().get("disable-root-output"), - !cfgc.options().get("disable-mc"), // - cfgc.options().get("input-type"), // - cfgc.options().get("output-type") // - // cfgc.options().get("pedestal"), - // cfgc.options().get("ccdb-url"), - ); + !cfgc.options().get("disable-mc"), + cfgc.options().get("input-type"), + cfgc.options().get("output-type")); } From b79299091a813f24dfa034e40be93ae23882555f Mon Sep 17 00:00:00 2001 From: sevdokim Date: Tue, 22 Jun 2021 08:23:18 +0200 Subject: [PATCH 4/6] fix for cpv macros --- Detectors/CPV/calib/macros/PostBadMapCCDB.C | 2 +- Detectors/CPV/calib/macros/PostCalibCCDB.C | 2 +- Detectors/CPV/testsimulation/plot_hit_cpv.C | 2 +- macro/duplicateHits.C | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/Detectors/CPV/calib/macros/PostBadMapCCDB.C b/Detectors/CPV/calib/macros/PostBadMapCCDB.C index 538807c2df60e..0666af5dadd46 100644 --- a/Detectors/CPV/calib/macros/PostBadMapCCDB.C +++ b/Detectors/CPV/calib/macros/PostBadMapCCDB.C @@ -11,7 +11,7 @@ #if !defined(__CLING__) || defined(__ROOTCLING__) #include "TRandom.h" #include "CCDB/CcdbApi.h" -#include "CPVCalib/BadChannelMap.h" +#include "DataFormatsCPV/BadChannelMap.h" #include "CPVBase/Geometry.h" #endif void PostBadMapCCDB() diff --git a/Detectors/CPV/calib/macros/PostCalibCCDB.C b/Detectors/CPV/calib/macros/PostCalibCCDB.C index f159d2b548e7f..85cf4cabf46c0 100644 --- a/Detectors/CPV/calib/macros/PostCalibCCDB.C +++ b/Detectors/CPV/calib/macros/PostCalibCCDB.C @@ -12,7 +12,7 @@ #include "TFile.h" #include "TH2F.h" #include "CCDB/CcdbApi.h" -#include "CPVCalib/CalibParams.h" +#include "DataFormatsCPV/CalibParams.h" #include "CPVBase/Geometry.h" #include #endif diff --git a/Detectors/CPV/testsimulation/plot_hit_cpv.C b/Detectors/CPV/testsimulation/plot_hit_cpv.C index 5be311e7eb953..0ba358c0feb19 100644 --- a/Detectors/CPV/testsimulation/plot_hit_cpv.C +++ b/Detectors/CPV/testsimulation/plot_hit_cpv.C @@ -13,7 +13,7 @@ #include "FairSystemInfo.h" #include "SimulationDataFormat/MCCompLabel.h" #include "CPVBase/Geometry.h" -#include "CPVBase/Hit.h" +#include "DataFormatsCPV/Hit.h" #include "DetectorsCommonDataFormats/NameConf.h" #include "DetectorsCommonDataFormats/DetID.h" #endif diff --git a/macro/duplicateHits.C b/macro/duplicateHits.C index 531101b73e2aa..f22b0957dea4f 100644 --- a/macro/duplicateHits.C +++ b/macro/duplicateHits.C @@ -14,7 +14,7 @@ #include "DataFormatsFDD/Hit.h" #include "MCHSimulation/Hit.h" #include "MIDSimulation/Hit.h" -#include "CPVBase/Hit.h" +#include "DataFormatsCPV/Hit.h" #include "DataFormatsZDC/Hit.h" #include "SimulationDataFormat/MCEventHeader.h" #include "DataFormatsParameters/GRPObject.h" From ccd981c95ed0c92ca21210c08cdaa11c2510e5ec Mon Sep 17 00:00:00 2001 From: sevdokim Date: Tue, 22 Jun 2021 09:46:43 +0200 Subject: [PATCH 5/6] fix for macros/CMakeLists.txt --- macro/CMakeLists.txt | 6 +++--- macro/analyzeHits.C | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/macro/CMakeLists.txt b/macro/CMakeLists.txt index 897a1414c3eb4..3a41ab185fd1a 100644 --- a/macro/CMakeLists.txt +++ b/macro/CMakeLists.txt @@ -82,8 +82,8 @@ o2_add_test_root_macro(analyzeHits.C O2::FDDSimulation O2::MCHSimulation O2::MIDSimulation - O2::ZDCSimulation - O2::CPVBase) + O2::ZDCSimulation + O2::DataFormatsCPV) o2_add_test_root_macro(duplicateHits.C PUBLIC_LINK_LIBRARIES O2::ITSMFTSimulation @@ -99,7 +99,7 @@ o2_add_test_root_macro(duplicateHits.C O2::MCHSimulation O2::MIDSimulation O2::ZDCSimulation - O2::CPVBase COMPILE_ONLY) + O2::DataFormatsCPV COMPILE_ONLY) o2_add_test_root_macro(migrateSimFiles.C PUBLIC_LINK_LIBRARIES O2::DetectorsCommonDataFormats) diff --git a/macro/analyzeHits.C b/macro/analyzeHits.C index 7983e6b1188b6..cc22e9e05f05e 100644 --- a/macro/analyzeHits.C +++ b/macro/analyzeHits.C @@ -14,7 +14,7 @@ #include "DataFormatsFDD/Hit.h" #include "MCHSimulation/Hit.h" #include "MIDSimulation/Hit.h" -#include "CPVBase/Hit.h" +#include "DataFormatsCPV/Hit.h" #include "DataFormatsZDC/Hit.h" #include "DetectorsCommonDataFormats/NameConf.h" #include "DataFormatsParameters/GRPObject.h" From ed7c95ad4084ef1876972569db94436544a7d371 Mon Sep 17 00:00:00 2001 From: shahoian Date: Tue, 22 Jun 2021 22:13:37 +0200 Subject: [PATCH 6/6] RAWDATA Lifetime must be Optional, add extra options --- .../include/CPVWorkflow/RawToDigitConverterSpec.h | 2 +- .../CPV/workflow/include/CPVWorkflow/RecoWorkflow.h | 6 +++--- Detectors/CPV/workflow/src/RawToDigitConverterSpec.cxx | 9 +++++---- Detectors/CPV/workflow/src/RecoWorkflow.cxx | 5 +++-- Detectors/CPV/workflow/src/cpv-reco-workflow.cxx | 2 ++ 5 files changed, 14 insertions(+), 10 deletions(-) diff --git a/Detectors/CPV/workflow/include/CPVWorkflow/RawToDigitConverterSpec.h b/Detectors/CPV/workflow/include/CPVWorkflow/RawToDigitConverterSpec.h index 03dbe2f5308b1..fbb5b9496e5f7 100644 --- a/Detectors/CPV/workflow/include/CPVWorkflow/RawToDigitConverterSpec.h +++ b/Detectors/CPV/workflow/include/CPVWorkflow/RawToDigitConverterSpec.h @@ -77,7 +77,7 @@ class RawToDigitConverterSpec : public framework::Task /// \brief Creating DataProcessorSpec for the CPV Digit Converter Spec /// /// Refer to RawToDigitConverterSpec::run for input and output specs -o2::framework::DataProcessorSpec getRawToDigitConverterSpec(); +o2::framework::DataProcessorSpec getRawToDigitConverterSpec(bool askDISTSTF = true); } // namespace reco_workflow diff --git a/Detectors/CPV/workflow/include/CPVWorkflow/RecoWorkflow.h b/Detectors/CPV/workflow/include/CPVWorkflow/RecoWorkflow.h index 900e40c080e2d..cd863e6fe2be1 100644 --- a/Detectors/CPV/workflow/include/CPVWorkflow/RecoWorkflow.h +++ b/Detectors/CPV/workflow/include/CPVWorkflow/RecoWorkflow.h @@ -38,9 +38,9 @@ enum struct OutputType { Digits, framework::WorkflowSpec getWorkflow(bool disableRootInp, bool disableRootOut, bool propagateMC = true, - std::string const& cfgInput = "digits", // - std::string const& cfgOutput = "clusters" // -); + bool askSTFDist = true, + std::string const& cfgInput = "digits", + std::string const& cfgOutput = "clusters"); } // namespace reco_workflow } // namespace cpv diff --git a/Detectors/CPV/workflow/src/RawToDigitConverterSpec.cxx b/Detectors/CPV/workflow/src/RawToDigitConverterSpec.cxx index dbb5d636a0cca..83d5a2a3f3e22 100644 --- a/Detectors/CPV/workflow/src/RawToDigitConverterSpec.cxx +++ b/Detectors/CPV/workflow/src/RawToDigitConverterSpec.cxx @@ -227,13 +227,14 @@ void RawToDigitConverterSpec::run(framework::ProcessingContext& ctx) ctx.outputs().snapshot(o2::framework::Output{"CPV", "RAWHWERRORS", 0, o2::framework::Lifetime::Timeframe}, mOutputHWErrors); } -o2::framework::DataProcessorSpec o2::cpv::reco_workflow::getRawToDigitConverterSpec() +o2::framework::DataProcessorSpec o2::cpv::reco_workflow::getRawToDigitConverterSpec(bool askDISTSTF) { std::vector inputs; - inputs.emplace_back("RAWDATA", o2::framework::ConcreteDataTypeMatcher{"CPV", "RAWDATA"}, o2::framework::Lifetime::Timeframe); + inputs.emplace_back("RAWDATA", o2::framework::ConcreteDataTypeMatcher{"CPV", "RAWDATA"}, o2::framework::Lifetime::Optional); //receive at least 1 guaranteed input (which will allow to acknowledge the TF) - inputs.emplace_back("STFDist", "FLP", "DISTSUBTIMEFRAME", 0, o2::framework::Lifetime::Timeframe); - + if (askDISTSTF) { + inputs.emplace_back("STFDist", "FLP", "DISTSUBTIMEFRAME", 0, o2::framework::Lifetime::Timeframe); + } std::vector outputs; outputs.emplace_back("CPV", "DIGITS", 0, o2::framework::Lifetime::Timeframe); outputs.emplace_back("CPV", "DIGITTRIGREC", 0, o2::framework::Lifetime::Timeframe); diff --git a/Detectors/CPV/workflow/src/RecoWorkflow.cxx b/Detectors/CPV/workflow/src/RecoWorkflow.cxx index 0f6f241843374..2f5cea8d046fe 100644 --- a/Detectors/CPV/workflow/src/RecoWorkflow.cxx +++ b/Detectors/CPV/workflow/src/RecoWorkflow.cxx @@ -57,6 +57,7 @@ const std::unordered_map OutputMap{ o2::framework::WorkflowSpec getWorkflow(bool disableRootInp, bool disableRootOut, bool propagateMC, + bool askSTFDist, std::string const& cfgInput, std::string const& cfgOutput) { @@ -84,14 +85,14 @@ o2::framework::WorkflowSpec getWorkflow(bool disableRootInp, //no explicit raw reader if (isEnabled(OutputType::Digits)) { - specs.emplace_back(o2::cpv::reco_workflow::getRawToDigitConverterSpec()); + specs.emplace_back(o2::cpv::reco_workflow::getRawToDigitConverterSpec(askSTFDist)); if (!disableRootOut) { specs.emplace_back(o2::cpv::getDigitWriterSpec(false)); } } if (isEnabled(OutputType::Clusters)) { // add clusterizer - specs.emplace_back(o2::cpv::reco_workflow::getRawToDigitConverterSpec()); + specs.emplace_back(o2::cpv::reco_workflow::getRawToDigitConverterSpec(askSTFDist)); specs.emplace_back(o2::cpv::reco_workflow::getClusterizerSpec(false)); if (!disableRootOut) { specs.emplace_back(o2::cpv::getClusterWriterSpec(false)); diff --git a/Detectors/CPV/workflow/src/cpv-reco-workflow.cxx b/Detectors/CPV/workflow/src/cpv-reco-workflow.cxx index 010751b7085ca..4a98309a3e8fe 100644 --- a/Detectors/CPV/workflow/src/cpv-reco-workflow.cxx +++ b/Detectors/CPV/workflow/src/cpv-reco-workflow.cxx @@ -34,6 +34,7 @@ void customize(std::vector& workflowOptions) {"disable-root-input", o2::framework::VariantType::Bool, false, {"disable root-files input reader"}}, {"disable-root-output", o2::framework::VariantType::Bool, false, {"disable root-files output writer"}}, {"pedestal", o2::framework::VariantType::Bool, false, {"pedestal run? if true then don't subtract pedestals from digits"}}, + {"ignore-dist-stf", o2::framework::VariantType::Bool, false, {"do not subscribe to FLP/DISTSUBTIMEFRAME/0 message (no lost TF recovery)"}}, //{"ccdb-url", o2::framework::VariantType::String, "http://ccdb-test.cern.ch:8080", {"path to CCDB like http://ccdb-test.cern.ch:8080"}}, {"configKeyValues", o2::framework::VariantType::String, "", {"Semicolon separated key=value strings ..."}}}; std::swap(workflowOptions, options); @@ -62,6 +63,7 @@ o2::framework::WorkflowSpec defineDataProcessing(o2::framework::ConfigContext co return o2::cpv::reco_workflow::getWorkflow(cfgc.options().get("disable-root-input"), cfgc.options().get("disable-root-output"), !cfgc.options().get("disable-mc"), + !cfgc.options().get("ignore-dist-stf"), cfgc.options().get("input-type"), cfgc.options().get("output-type")); }