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");
103 info.setObjectType(
"Pedestals");
104 info.setFileName(flName);
106 const auto now = std::chrono::system_clock::now();
107 long timeStart = std::chrono::duration_cast<std::chrono::seconds>(now.time_since_epoch()).count();
108 info.setStartValidityTimestamp(timeStart);
110 std::map<std::string, std::string> md;
111 info.setMetaData(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.
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 e
char error[CURL_ERROR_SIZE]
static std::string generateFileName(const std::string &inp)
static std::unique_ptr< std::vector< char > > createObjectImage(const T *obj, CcdbObjectInfo *info=nullptr)
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()
GLsizei const GLchar *const * path
o2::framework::DataProcessorSpec getPedestalCalibSpec(bool useCCDB, bool forceUpdate, std::string path)
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.