16#include <fairlogger/Logger.h>
38 mMean = std::unique_ptr<TH2F>(
new TH2F(
"Mean",
"Mean",
n, 0.5,
n + 0.5, 500, 0., 500.));
53 LOG(error) <<
"Raw decoding error " << (
int)e;
74 unsigned short absId = ac.
Address;
75 mMean->Fill(absId, ac.
Charge);
84 LOG(info) <<
"[CPVPedestalCalibDevice - endOfStream]";
96 if (mUpdateCCDB || mForceUpdate) {
102 info.
setPath(
"CPV/Calib/Pedestals");
106 const auto now = std::chrono::system_clock::now();
107 long timeStart = std::chrono::duration_cast<std::chrono::seconds>(now.time_since_epoch()).count();
110 std::map<std::string, std::string> md;
113 LOG(info) <<
"Sending object CPV/Calib/Pedestals";
120 LOG(info) <<
"[CPVPedestalCalibDevice - run] Writing ";
124 std::string
filename = mPath +
"CPVPedestals.root";
136 for (
unsigned short i = mMean->GetNbinsX();
i > 0;
i--) {
137 TH1D* pr = mMean->ProjectionY(Form(
"proj%d",
i),
i,
i);
138 short pedMean = std::min(255,
int(pr->GetMean()));
140 mPedestals->setPedestal(
i - 1, pedMean);
173 std::vector<o2::framework::OutputSpec> outputs;
177 outputs.emplace_back(
"CPV",
"PEDDIFF", 0, o2::framework::Lifetime::Sporadic);
182 o2::framework::adaptFromTask<CPVPedestalCalibDevice>(useCCDB, forceUpdate,
path),
Utils and constants for calibration and related workflows.
static std::string generateFileName(const std::string &inp)
static std::unique_ptr< std::vector< char > > createObjectImage(const T *obj, CcdbObjectInfo *info=nullptr)
void setStartValidityTimestamp(long start)
void setFileName(const std::string &nm)
void setPath(const std::string &path)
void setEndValidityTimestamp(long end)
void setObjectType(const std::string &tp)
void setMetaData(const std::map< std::string, std::string > &md)
static constexpr long INFINITE_TIMESTAMP
void init(o2::framework::InitContext &ic) final
void endOfStream(o2::framework::EndOfStreamContext &ec) final
This is invoked whenever we have an EndOfStream event.
void run(o2::framework::ProcessingContext &pc) final
void sendOutput(DataAllocator &output)
void calculatePedestals()
static constexpr short kNumberOfCPVPadsPhi
static constexpr short kNumberOfCPVPadsZ
Decoder of the ALTRO data in the raw page.
const std::vector< uint32_t > & getDigits() const
Get the reference to the digits container.
RawErrorType_t decode()
Decode the raw cpv payload stream.
Reader for raw data produced by the Readout application in in-memory format.
RawErrorType_t next()
Read next payload from the stream.
bool hasNext() const
check if more pages are available in the raw file
DataAllocator & outputs()
InputRecord & inputs()
The inputs associated with this processing context.
GLsizei const GLchar *const * path
o2::framework::DataProcessorSpec getPedestalCalibSpec(bool useCCDB, bool forceUpdate, std::string path)
std::vector< ConfigParamSpec > Options
std::vector< InputSpec > select(char const *matcher="")
static constexpr o2::header::DataOrigin gDataOriginCDBWrapper
static constexpr o2::header::DataOrigin gDataOriginCDBPayload
LOG(info)<< "Compressed in "<< sw.CpuTime()<< " s"
uint32_t Charge
Bits 18 - 32 : charge.
uint32_t Address
Bits 0 - 17 : Address.