12#ifndef O2_TRD_PULSEHEIGHTSPEC_H
13#define O2_TRD_PULSEHEIGHTSPEC_H
42 mPulseHeight = std::make_unique<PulseHeight>();
43 if (ic.options().get<
bool>(
"enable-root-output")) {
44 mPulseHeight->createOutputFile();
46 if (getenv(
"ALIEN_JDL_LPMPRODUCTIONTYPE") && std::strcmp(getenv(
"ALIEN_JDL_LPMPRODUCTIONTYPE"),
"MC") == 0) {
48 mPulseHeight->setApplyShift(
false);
55 if (tinfo.globalRunNumberChanged) {
56 mRunStopRequested =
false;
58 if (mRunStopRequested) {
59 std::vector<PHData> mPHValues{};
60 pc.outputs().snapshot(
Output{
"TRD",
"PULSEHEIGHT", 0}, mPHValues);
61 std::vector<PHDataHD> mPHValuesHD{};
62 pc.outputs().snapshot(
Output{
"TRD",
"PULSEHEIGHTHD", 0}, mPHValuesHD);
65 RecoContainer recoData;
66 recoData.collectData(pc, *mDataRequest.get());
67 auto digits = pc.inputs().get<gsl::span<o2::trd::Digit>>(
"digits");
68 mPulseHeight->setInput(recoData, &
digits);
69 mPulseHeight->reset();
70 mPulseHeight->process();
71 pc.outputs().snapshot(
Output{
"TRD",
"PULSEHEIGHT", 0}, mPulseHeight->getPHData());
72 pc.outputs().snapshot(
Output{
"TRD",
"PULSEHEIGHTHD", 0}, mPulseHeight->getPHDataHD());
73 if (pc.transitionState() == TransitionHandlingState::Requested) {
74 LOG(info) <<
"Run stop requested, finalizing";
75 mRunStopRequested =
true;
81 mPulseHeight->closeOutputFile();
82 if (mRunStopRequested) {
92 std::shared_ptr<DataRequest> mDataRequest;
93 std::unique_ptr<o2::trd::PulseHeight> mPulseHeight;
94 bool mRunStopRequested =
false;
105 std::vector<OutputSpec> outputs;
109 bool isTPCavailable =
false;
111 LOGF(
debug,
"Found ITS-TPC tracks as input, loading ITS-TPC-TRD");
115 LOGF(
debug,
"Found TPC tracks as input, loading TPC-TRD");
117 isTPCavailable =
true;
121 auto dataRequest = std::make_shared<DataRequest>();
122 dataRequest->requestTracks(
src,
false);
123 dataRequest->requestClusters(srcClu,
false);
124 dataRequest->inputs.emplace_back(
"digits",
"TRD",
"DIGITS", digitsFromReader ? 1 : 0);
130 AlgorithmSpec{adaptFromTask<o2::trd::PuseHeightDevice>(dataRequest)},
132 {
"enable-root-output",
VariantType::Bool,
false, {
"output PH and debug data to root file"}}}};
Helper for geometry and GRP related CCDB requests.
Global index for barrel track: provides provenance (detectors combination), index in respective array...
Creates PH spectra from TRD digits found on tracks.
void stop() final
This is invoked on stop.
void endOfStream(o2::framework::EndOfStreamContext &ec) final
This is invoked whenever we have an EndOfStream event.
void init(o2::framework::InitContext &ic) final
PuseHeightDevice(std::shared_ptr< DataRequest > dr)
void run(o2::framework::ProcessingContext &pc) final
constexpr o2::header::DataOrigin gDataOriginTRD
Defining PrimaryVertex explicitly as messageable.
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< Digit > digits