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);
 
   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};                                                                                                                                               
 
   92  uint64_t mCCDBTimeStamp{0};                                                                                                                                             
 
   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.
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 PrimaryVertex 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.
constexpr unsigned short GEMSTACKS
IDCDeltaCompression
IDC Delta IDC Compression types.
static constexpr o2::header::DataOrigin gDataOriginCDBWrapper
static constexpr o2::header::DataOrigin gDataOriginCDBPayload
container to be written to CCDB