Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 17 additions & 9 deletions DataFormats/Detectors/CPV/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Original file line number Diff line number Diff line change
Expand Up @@ -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"

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
6 changes: 6 additions & 0 deletions DataFormats/Detectors/CPV/src/DataFormatsCPVLinkDef.h
Original file line number Diff line number Diff line change
Expand Up @@ -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> + ;
Expand All @@ -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
2 changes: 1 addition & 1 deletion DataFormats/Detectors/CPV/src/Digit.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
#include "FairLogger.h"

#include "DataFormatsCPV/Digit.h"
#include "CPVBase/Hit.h"
#include "DataFormatsCPV/Hit.h"
#include <iostream>

using namespace o2::cpv;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 <TH1.h>
#include <TH1F.h>
Expand Down
4 changes: 1 addition & 3 deletions Detectors/CPV/base/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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)
1 change: 0 additions & 1 deletion Detectors/CPV/base/include/CPVBase/Geometry.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 0 additions & 2 deletions Detectors/CPV/base/src/CPVBaseLinkDef.h
Original file line number Diff line number Diff line change
Expand Up @@ -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> + ;

Expand Down
18 changes: 3 additions & 15 deletions Detectors/CPV/calib/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down
4 changes: 1 addition & 3 deletions Detectors/CPV/calib/CPVCalibWorkflow/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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)


Expand All @@ -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)
Original file line number Diff line number Diff line change
Expand Up @@ -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"

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 <string>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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"

Expand Down
2 changes: 1 addition & 1 deletion Detectors/CPV/calib/macros/PostBadMapCCDB.C
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down
2 changes: 1 addition & 1 deletion Detectors/CPV/calib/macros/PostCalibCCDB.C
Original file line number Diff line number Diff line change
Expand Up @@ -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 <iostream>
#endif
Expand Down
1 change: 0 additions & 1 deletion Detectors/CPV/reconstruction/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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"

Expand Down
5 changes: 2 additions & 3 deletions Detectors/CPV/simulation/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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"

Expand Down
10 changes: 5 additions & 5 deletions Detectors/CPV/simulation/include/CPVSimulation/Digitizer.h
Original file line number Diff line number Diff line change
Expand Up @@ -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"

Expand Down
10 changes: 6 additions & 4 deletions Detectors/CPV/simulation/include/CPVSimulation/RawWriter.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
{
Expand Down Expand Up @@ -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();
Expand All @@ -79,14 +80,15 @@ class RawWriter
std::vector<padCharge> 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<CalibParams> mCalibParams; ///< CPV calibration
std::unique_ptr<Pedestals> mPedestals; ///< CPV pedestals
std::unique_ptr<BadChannelMap> mBadMap; ///< CPV bad channel map
std::vector<char> mPayload; ///< Payload to be written
gsl::span<o2::cpv::Digit> mDigits; ///< Digits input vector - must be in digitized format including the time response
std::unique_ptr<o2::raw::RawFileWriter> mRawWriter; ///< Raw writer

ClassDefNV(RawWriter, 1);
ClassDefNV(RawWriter, 2);
};

} // namespace cpv
Expand Down
2 changes: 1 addition & 1 deletion Detectors/CPV/simulation/src/Detector.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
4 changes: 4 additions & 0 deletions Detectors/CPV/simulation/src/RawCreator.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ int main(int argc, const char** argv)
add_option("file-for,f", bpo::value<std::string>()->default_value("all"), "single file per: all,link");
add_option("output-dir,o", bpo::value<std::string>()->default_value("./"), "output directory for raw data");
add_option("debug,d", bpo::value<uint32_t>()->default_value(0), "Select debug output level [0 = no debug output]");
add_option("ccdb-url,c", bpo::value<std::string>()->default_value("http://ccdb-test.cern.ch:8080"), "CCDB Url ['localtest' for local testing]");
add_option("hbfutils-config,u", bpo::value<std::string>()->default_value(std::string(o2::base::NameConf::DIGITIZATIONCONFIGFILE)), "config file for HBFUtils (or none)");
add_option("configKeyValues", bpo::value<std::string>()->default_value(""), "comma-separated configKeyValues");

Expand Down Expand Up @@ -80,6 +81,8 @@ int main(int argc, const char** argv)
outputdir = vm["output-dir"].as<std::string>(),
filefor = vm["file-for"].as<std::string>();

auto ccdbUrl = vm["ccdb-url"].as<std::string>();

// if needed, create output directory
if (!std::filesystem::exists(outputdir)) {
if (!std::filesystem::create_directories(outputdir)) {
Expand All @@ -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
Expand Down
Loading