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);
63 RecoContainer recoData;
64 recoData.collectData(pc, *mDataRequest.get());
65 auto digits = pc.inputs().get<gsl::span<o2::trd::Digit>>(
"digits");
66 mPulseHeight->setInput(recoData, &
digits);
67 mPulseHeight->reset();
68 mPulseHeight->process();
69 pc.outputs().snapshot(
Output{
"TRD",
"PULSEHEIGHT", 0}, mPulseHeight->getPHData());
70 if (pc.transitionState() == TransitionHandlingState::Requested) {
71 LOG(info) <<
"Run stop requested, finalizing";
72 mRunStopRequested =
true;
78 mPulseHeight->closeOutputFile();
79 if (mRunStopRequested) {
89 std::shared_ptr<DataRequest> mDataRequest;
90 std::unique_ptr<o2::trd::PulseHeight> mPulseHeight;
91 bool mRunStopRequested =
false;
102 std::vector<OutputSpec> outputs;
105 bool isTPCavailable =
false;
107 LOGF(
debug,
"Found ITS-TPC tracks as input, loading ITS-TPC-TRD");
111 LOGF(
debug,
"Found TPC tracks as input, loading TPC-TRD");
113 isTPCavailable =
true;
117 auto dataRequest = std::make_shared<DataRequest>();
118 dataRequest->requestTracks(
src,
false);
119 dataRequest->requestClusters(srcClu,
false);
120 dataRequest->inputs.emplace_back(
"digits",
"TRD",
"DIGITS", digitsFromReader ? 1 : 0);
126 AlgorithmSpec{adaptFromTask<o2::trd::PuseHeightDevice>(dataRequest)},
128 {
"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