40 mCaloAmp = 0xFFFFFFFF;
41 mCaloTime = 0xFFFFFFFF;
43 mTFNumber = ic.
options().
get<int64_t>(
"aod-timeframe-id");
44 mRunNumber = ic.
options().
get<
int>(
"run-number");
53 if (mTFNumber == -1L) {
55 tfNumber = uint64_t(tinfo.firstTForbit) + (uint64_t(tinfo.runNumber) << 32);
59 const int runNumber = (mRunNumber == -1) ?
int(tinfo.runNumber) : mRunNumber;
62 auto ctr = pc.
inputs().
get<gsl::span<o2::phos::TriggerRecord>>(
"cellTriggerRecords");
64 LOG(
debug) <<
"FOUND " <<
cells.size() <<
" PHOS cells in CTF";
65 LOG(
debug) <<
"FOUND " << ctr.size() <<
" PHOS tiggers in CTF";
74 auto caloCellsCursor = caloCellsBuilder->
cursor<o2::aod::Calos>();
75 auto caloCellsTRGTableCursor = caloCellsTRGTableBuilder->
cursor<o2::aod::CaloTriggers>();
77 uint64_t triggerMask = 1, inputMask = 1;
80 for (
const auto& tr : ctr) {
82 int firstCellInEvent = tr.getFirstEntry();
83 int lastCellInEvent = firstCellInEvent + tr.getNumberOfObjects();
84 for (
int i = firstCellInEvent;
i < lastCellInEvent;
i++) {
88 caloCellsTRGTableCursor(0,
92 (
c.getType() ==
TRU2x2) ? 0 : 1,
105 o2::math_utils::detail::truncateFloatFraction(
c.getEnergy(), mCaloAmp),
106 o2::math_utils::detail::truncateFloatFraction(
c.getTime(), mCaloTime),
111 auto bcID = tr.getBCData().toLong();
147 LOGF(info,
"PHOS Standalone AOD Producer total timing: Cpu: %.3e Real: %.3e s in %d slots",
148 mTimer.CpuTime(), mTimer.RealTime(), mTimer.Counter() - 1);
153 std::vector<o2::framework::InputSpec> inputs;
157 std::vector<OutputSpec> outputs;
158 outputs.emplace_back(
OutputLabel{
"O2bc"},
"AOD",
"BC", 0, Lifetime::Timeframe);
159 outputs.emplace_back(
OutputLabel{
"O2collision"},
"AOD",
"COLLISION", 0, Lifetime::Timeframe);
160 outputs.emplace_back(
OutputLabel{
"O2caloCell"},
"AOD",
"CALO", 0, Lifetime::Timeframe);
161 outputs.emplace_back(
OutputLabel{
"O2caloCellTRGR"},
"AOD",
"CALOTRIGGER", 0, Lifetime::Timeframe);
162 outputs.emplace_back(
OutputSpec{
"TFN",
"TFNumber"});
163 outputs.emplace_back(
OutputSpec{
"TFF",
"TFFilename"});
166 "phos-standalone-aod-producer-workflow",
171 ConfigParamSpec{
"run-number", VariantType::Int64, -1L, {
"The run-number. If left default we try to get it from DPL header."}},
172 ConfigParamSpec{
"aod-timeframe-id", VariantType::Int64, -1L, {
"Set timeframe number"}}}};
General auxilliary methods.
Convert CTF (EncodedBlocks) to AO2D PHOS standalone.
T get(const char *key) const
void snapshot(const Output &spec, T const &object)
decltype(auto) make(const Output &spec, Args... args)
ConfigParamRegistry const & options()
DataAllocator & outputs()
The data allocator is used to allocate memory for the output data.
InputRecord & inputs()
The inputs associated with this processing context.
ServiceRegistryRef services()
The services registry associated with this processing context.
void endOfStream(o2::framework::EndOfStreamContext &ec) final
This is invoked whenever we have an EndOfStream event.
StandaloneAODProducerSpec()
void init(o2::framework::InitContext &ic) final
void run(o2::framework::ProcessingContext &pc) final
constexpr o2::header::DataOrigin gDataOriginPHS
Collisions_001 Collisions
Defining PrimaryVertex explicitly as messageable.
std::vector< ConfigParamSpec > Options
framework::DataProcessorSpec getPHOSStandaloneAODProducerSpec()
create a processor spec
@ TRU2x2
TRU channel, 2x2 trigger.
a couple of static helper functions to create timestamp values for CCDB queries or override obsolete ...
LOG(info)<< "Compressed in "<< sw.CpuTime()<< " s"
std::vector< Cell > cells