39 mCaloAmp = 0xFFFFFFFF;
40 mCaloTime = 0xFFFFFFFF;
42 mTFNumber = ic.
options().
get<int64_t>(
"aod-timeframe-id");
43 mRunNumber = ic.
options().
get<
int>(
"run-number");
52 if (mTFNumber == -1L) {
54 tfNumber = uint64_t(tinfo.firstTForbit) + (uint64_t(tinfo.runNumber) << 32);
58 const int runNumber = (mRunNumber == -1) ?
int(tinfo.runNumber) : mRunNumber;
61 auto ctr = pc.
inputs().
get<gsl::span<o2::phos::TriggerRecord>>(
"cellTriggerRecords");
63 LOG(
debug) <<
"FOUND " <<
cells.size() <<
" PHOS cells in CTF";
64 LOG(
debug) <<
"FOUND " << ctr.size() <<
" PHOS tiggers in CTF";
73 auto caloCellsCursor = caloCellsBuilder->
cursor<o2::aod::Calos>();
74 auto caloCellsTRGTableCursor = caloCellsTRGTableBuilder->
cursor<o2::aod::CaloTriggers>();
76 uint64_t triggerMask = 1, inputMask = 1;
79 for (
const auto& tr : ctr) {
81 int firstCellInEvent = tr.getFirstEntry();
82 int lastCellInEvent = firstCellInEvent + tr.getNumberOfObjects();
83 for (
int i = firstCellInEvent;
i < lastCellInEvent;
i++) {
87 caloCellsTRGTableCursor(0,
91 (
c.getType() ==
TRU2x2) ? 0 : 1,
104 o2::math_utils::detail::truncateFloatFraction(
c.getEnergy(), mCaloAmp),
105 o2::math_utils::detail::truncateFloatFraction(
c.getTime(), mCaloTime),
110 auto bcID = tr.getBCData().toLong();
146 LOGF(info,
"PHOS Standalone AOD Producer total timing: Cpu: %.3e Real: %.3e s in %d slots",
147 mTimer.CpuTime(), mTimer.RealTime(), mTimer.Counter() - 1);
152 std::vector<o2::framework::InputSpec> inputs;
156 std::vector<OutputSpec> outputs;
157 outputs.emplace_back(
OutputLabel{
"O2bc"},
"AOD",
"BC", 0, Lifetime::Timeframe);
158 outputs.emplace_back(
OutputLabel{
"O2collision"},
"AOD",
"COLLISION", 0, Lifetime::Timeframe);
159 outputs.emplace_back(
OutputLabel{
"O2caloCell"},
"AOD",
"CALO", 0, Lifetime::Timeframe);
160 outputs.emplace_back(
OutputLabel{
"O2caloCellTRGR"},
"AOD",
"CALOTRIGGER", 0, Lifetime::Timeframe);
161 outputs.emplace_back(
OutputSpec{
"TFN",
"TFNumber"});
162 outputs.emplace_back(
OutputSpec{
"TFF",
"TFFilename"});
165 "phos-standalone-aod-producer-workflow",
170 ConfigParamSpec{
"run-number", VariantType::Int64, -1L, {
"The run-number. If left default we try to get it from DPL header."}},
171 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