diff --git a/DataFormats/Detectors/CPV/CMakeLists.txt b/DataFormats/Detectors/CPV/CMakeLists.txt index 06a8069234efd..5194406785adf 100644 --- a/DataFormats/Detectors/CPV/CMakeLists.txt +++ b/DataFormats/Detectors/CPV/CMakeLists.txt @@ -9,22 +9,30 @@ # submit itself to any jurisdiction. o2_add_library(DataFormatsCPV - SOURCES src/CPVBlockHeader.cxx - src/Digit.cxx - src/Cluster.cxx + SOURCES src/CPVBlockHeader.cxx + src/Hit.cxx + src/Digit.cxx + src/Cluster.cxx src/TriggerRecord.cxx src/CTF.cxx - PUBLIC_LINK_LIBRARIES O2::CommonDataFormat - O2::Headers - O2::MathUtils - O2::DetectorsBase - O2::CPVBase + src/CalibParams.cxx + src/BadChannelMap.cxx + src/Pedestals.cxx + PUBLIC_LINK_LIBRARIES O2::CommonDataFormat + O2::Headers + O2::MathUtils + O2::DetectorsBase + O2::CPVBase O2::SimulationDataFormat Boost::serialization) 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..80918b6c9e30f 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,8 @@ #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::cpv::CalibParams + ; +#pragma link C++ class 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..10258ffc3770c 100644 --- a/Detectors/CPV/base/CMakeLists.txt +++ b/Detectors/CPV/base/CMakeLists.txt @@ -9,12 +9,10 @@ # submit itself to any jurisdiction. o2_add_library(CPVBase - SOURCES src/Geometry.cxx - src/Hit.cxx + SOURCES src/Geometry.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..ddce7dc1730f7 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 + o2_add_test_root_macro(macros/PostBadMapCCDB.C + 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..b52ef05fb18d8 100644 --- a/Detectors/CPV/calib/CPVCalibWorkflow/CMakeLists.txt +++ b/Detectors/CPV/calib/CPVCalibWorkflow/CMakeLists.txt @@ -12,11 +12,10 @@ 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 - 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/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/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..53dfd43567d28 100644 --- a/Detectors/CPV/simulation/CMakeLists.txt +++ b/Detectors/CPV/simulation/CMakeLists.txt @@ -16,11 +16,10 @@ o2_add_library(CPVSimulation PUBLIC_LINK_LIBRARIES O2::DetectorsBase O2::DataFormatsCPV O2::CPVBase - O2::CPVCalib O2::CCDB O2::SimConfig - O2::SimulationDataFormat - O2::Headers + O2::SimulationDataFormat + O2::Headers O2::DetectorsRaw) o2_target_root_dictionary(CPVSimulation 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..a878fb7223f4b 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,6 +35,53 @@ void RawWriter::init() //ddl,crorc, link,... mRawWriter->registerLink(0, 0, 0, 0, rawfilename.data()); + + //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); + } + + /* + 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) @@ -41,49 +89,6 @@ void RawWriter::digitsToRaw(gsl::span digitsbranch, gsl::span(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"; - } - } - } - - 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"; - } - } - } //process digits which belong to same orbit int iFirstTrgInCurrentOrbit = 0; 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/Detectors/CPV/workflow/CMakeLists.txt b/Detectors/CPV/workflow/CMakeLists.txt index 905fa0dd5f2a0..2289e72b53d92 100644 --- a/Detectors/CPV/workflow/CMakeLists.txt +++ b/Detectors/CPV/workflow/CMakeLists.txt @@ -17,13 +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::CPVCalib - 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/include/CPVWorkflow/RawToDigitConverterSpec.h b/Detectors/CPV/workflow/include/CPVWorkflow/RawToDigitConverterSpec.h index d44ce0aa8bc6b..fbb5b9496e5f7 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,10 +74,10 @@ 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(); +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 381cfcaabba42..83d5a2a3f3e22 100644 --- a/Detectors/CPV/workflow/src/RawToDigitConverterSpec.cxx +++ b/Detectors/CPV/workflow/src/RawToDigitConverterSpec.cxx @@ -19,25 +19,81 @@ #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) @@ -47,87 +103,27 @@ void RawToDigitConverterSpec::run(framework::ProcessingContext& ctx) 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"; - // } - } - } - - 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"; - // } - } - } - - 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 - */ + std::vector rawFilter{ + {"RAWDATA", o2::framework::ConcreteDataTypeMatcher{"CPV", "RAWDATA"}, o2::framework::Lifetime::Timeframe}, + }; + for (const auto& rawData : framework::InputRecordWalker(ctx.inputs(), rawFilter)) { o2::cpv::RawReaderMemory rawreader(o2::framework::DataRefUtils::as(rawData)); // loop over all the DMA pages while (rawreader.hasNext()) { @@ -136,7 +132,9 @@ 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 + //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 if (e == RawErrorType_t::kRDH_DECODING) { break; @@ -146,24 +144,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 - continue; //skip STU mod + 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; @@ -233,22 +227,26 @@ 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) + 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); 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/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 d74275e344775..4a98309a3e8fe 100644 --- a/Detectors/CPV/workflow/src/cpv-reco-workflow.cxx +++ b/Detectors/CPV/workflow/src/cpv-reco-workflow.cxx @@ -33,6 +33,9 @@ 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"}}, + {"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); } @@ -59,8 +62,8 @@ 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("disable-mc"), + !cfgc.options().get("ignore-dist-stf"), + cfgc.options().get("input-type"), + cfgc.options().get("output-type")); } 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" 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" 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"