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 if (pc.transitionState() == TransitionHandlingState::Requested) {
73 LOG(info) <<
"Run stop requested, finalizing";
74 mRunStopRequested =
true;
80 mPulseHeight->closeOutputFile();
81 if (mRunStopRequested) {
91 std::shared_ptr<DataRequest> mDataRequest;
92 std::unique_ptr<o2::trd::PulseHeight> mPulseHeight;
93 bool mRunStopRequested =
false;
104 std::vector<OutputSpec> outputs;
107 bool isTPCavailable =
false;
109 LOGF(
debug,
"Found ITS-TPC tracks as input, loading ITS-TPC-TRD");
113 LOGF(
debug,
"Found TPC tracks as input, loading TPC-TRD");
115 isTPCavailable =
true;
119 auto dataRequest = std::make_shared<DataRequest>();
120 dataRequest->requestTracks(
src,
false);
121 dataRequest->requestClusters(srcClu,
false);
122 dataRequest->inputs.emplace_back(
"digits",
"TRD",
"DIGITS", digitsFromReader ? 1 : 0);
128 AlgorithmSpec{adaptFromTask<o2::trd::PuseHeightDevice>(dataRequest)},
130 {
"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