17#ifndef O2_TPCFACTORIZESACSPEC_H
18#define O2_TPCFACTORIZESACSPEC_H
21#include <fmt/format.h>
51 mCCDBTimeStamp = pc.inputs().get<
uint64_t>(
"sacccdb");
53 auto const* tpcStackHeader = o2::framework::DataRefUtils::getHeader<o2::header::DataHeader*>(
ref);
54 const int stack = tpcStackHeader->subSpecification;
55 mSACFactorization.
setSACs(pc.inputs().get<std::vector<int32_t>>(
ref),
stack);
59 if (countStacks != GEMSTACKS) {
60 LOGP(warning,
"Received only {} out of {}", countStacks, GEMSTACKS);
66 LOGP(info,
"dumping aggregated and factorized SACs to file");
68 mSACFactorization.
dumpToFile(fmt::format(
"SACFactorized_{:02}.root", currTF).
data());
72 sendOutput(pc.outputs());
90 const bool mDebug{
false};
97 const uint64_t timeStampStart = mCCDBTimeStamp;
101 if (timeStampStart != 0) {
109 std::unique_ptr<std::vector<char>> imageSACDelta{};
110 switch (mCompressionDeltaSAC) {
111 case SACFactorization::SACDeltaCompression::MEDIUM:
117 case SACFactorization::SACDeltaCompression::HIGH: {
122 case SACFactorization::SACDeltaCompression::NO:
123 SAC<float> sacContainer{mSACFactorization.
getSACZero(), mSACFactorization.
getSACOne(), std::move(mSACFactorization).getSACDeltaUncompressed()};
128 LOGP(info,
"Sending object {} / {} of size {} bytes, valid for {} : {} ", ccdbInfoSAC.getPath(), ccdbInfoSAC.getFileName(), imageSACDelta->size(), ccdbInfoSAC.getStartValidityTimestamp(), ccdbInfoSAC.getEndValidityTimestamp());
132 LOGP(warning,
"Received empty data for SACs! SACs will not be stored for the current aggregation interval!");
135 mSACFactorization.
reset();
141 std::vector<OutputSpec> outputSpecs;
150 std::vector<InputSpec> inputSpecs;
155 fmt::format(
"tpc-factorize-sac-{:02}", lane).data(),
158 AlgorithmSpec{adaptFromTask<TPCFactorizeSACSpec>(timeframes, compression,
debug, lane)}};
Simple interface to the CDB manager.
Utils and constants for calibration and related workflows.
Timeframe settings Average distance in cm of events merged into Randomize distance around average distance of merged events Simulate correct bunch interactions instead of placing only the average number of events A value[n] sets TFlen for[n] collisions in Number of bunches per trainsort Number of bunch trains Instantaneous interaction rate Do not simulate border Total number of collisions to be placed in the interior of all time Do not select random but walk over array of events in stride steps h Event generator settings h configStandalone Use CPU for GPU Force usage of the specified GPU device no CPU fallback Continue processing after an error First event to Number of events to Number of iterations to Number of iterations to Number of initial iterations excluded from const char Directory with events to Events directory is and not inside events Show standalone event Run event generator maximum time bin of continuous for triggered for automatic continuous for automatic continuous triggered uint64_t
TPC factorization of SACs.
static std::unique_ptr< std::vector< char > > createObjectImage(const T *obj, CcdbObjectInfo *info=nullptr)
static constexpr long DAY
const std::vector< float > & getSACZero(const o2::tpc::Side side) const
auto getSACDeltaHighCompressed() const
void reset()
resetting aggregated SACs
void setSACs(std::vector< int32_t > &&SACs, const unsigned int stack)
auto getSACDeltaMediumCompressed() const
const std::vector< float > & getSACOne(const o2::tpc::Side side) const
void dumpToFile(const char *outFileName="SACFactorized.root", const char *outName="SACFactorized") const
static header::DataDescription getDataDescriptionSACVec(const int lane)
return data description for aggregated SACs for given lane
static constexpr header::DataDescription getDataDescriptionSACCCDB()
static constexpr header::DataDescription getDataDescriptionSAC1()
static constexpr header::DataDescription getDataDescriptionLane()
static constexpr header::DataDescription getDataDescriptionTimeStamp()
static constexpr header::DataDescription getDataDescriptionCCDBSAC()
TPCFactorizeSACSpec(const unsigned int timeframes, const SACFactorization::SACDeltaCompression compression, const bool debug, const int lane)
void endOfStream(o2::framework::EndOfStreamContext &ec) final
This is invoked whenever we have an EndOfStream event.
void run(o2::framework::ProcessingContext &pc) final
constexpr o2::header::DataOrigin gDataOriginTPC
Defining ITS Vertex explicitly as messageable.
uint32_t getCurrentTF(o2::framework::ProcessingContext &pc)
Global TPC definitions and constants.
DataProcessorSpec getTPCFactorizeSACSpec(const int lane, const unsigned int timeframes, const SACFactorization::SACFactorization::SACDeltaCompression compression, const bool debug)
const std::unordered_map< CDBType, const std::string > CDBTypeMap
Storage name in CCDB for each calibration and parameter type.
IDCDeltaCompression
IDC Delta IDC Compression types.
static constexpr o2::header::DataOrigin gDataOriginCDBWrapper
static constexpr o2::header::DataOrigin gDataOriginCDBPayload
container to be written to CCDB