67 LOG(info) <<
"[HMPID Write Root File From Digits stream - init()]";
70 mOutRootFileName = ic.
options().
get<std::string>(
"out-file");
75 TString
filename = TString::Format(
"%s", mOutRootFileName.c_str());
76 TString tit = TString::Format(
"HMPID Digits File Decoding");
78 LOG(info) <<
"Create the ROOT file " <<
filename.Data();
79 mfileOut =
new TFile(TString::Format(
"%s",
filename.Data()),
"RECREATE");
81 mTheTree =
new TTree(
"o2hmp", tit);
82 mTheTree->Branch(
"InteractionRecords", &mTriggers);
83 mTheTree->Branch(
"HMPIDDigits", &mDigits);
91 std::vector<o2::hmpid::Trigger> triggers;
92 std::vector<o2::hmpid::Digit>
digits;
96 triggers = pc.
inputs().
get<std::vector<o2::hmpid::Trigger>>(
ref);
97 LOG(info) <<
"We receive triggers =" << triggers.size();
101 LOG(info) <<
"The size of the vector =" <<
digits.size();
104 for (
int i = 0;
i < triggers.size();
i++) {
105 LOG(info) <<
"Trigger Event Orbit = " << triggers[
i].getOrbit() <<
" BC = " << triggers[
i].getBc();
106 int startDigitsIndex = mDigits.size();
107 int numberOfDigits = 0;
108 for (
int j = triggers[
i].getFirstEntry();
j <= triggers[
i].getLastEntry();
j++) {
112 mTriggers.push_back(triggers[
i]);
113 mTriggers.back().setDataRange(startDigitsIndex, numberOfDigits);
122 mExTimer.
logMes(
"Received an End Of Stream !");
123 LOG(info) <<
"The size of digits vector =" << mDigits.size();
127 mExTimer.
logMes(
"Register Tree ! ");
134 std::vector<o2::framework::InputSpec> inputs;
138 std::vector<o2::framework::OutputSpec> outputs;
145 Options{{
"out-file", VariantType::String,
"hmpDigits.root", {
"name of the output file"}}}};
A raw page parser for DPL input.
Configurable generator for RootTreeWriter processor spec.
T get(const char *key) const
ConfigParamRegistry const & options()
InputRecord & inputs()
The inputs associated with this processing context.
void init(framework::InitContext &ic) final
void endOfStream(framework::EndOfStreamContext &ec) override
This is invoked whenever we have an EndOfStream event.
void run(framework::ProcessingContext &pc) final
void stop()
stop : stops the timer
void start()
start : starts the timer
void logMes(std::string const message)
constexpr o2::header::DataOrigin gDataOriginHMP
Defining PrimaryVertex explicitly as messageable.
std::vector< ConfigParamSpec > Options
o2::framework::DataProcessorSpec getDigitsToRootSpec(std::string inputSpec="HMP/DIGITS")
a couple of static helper functions to create timestamp values for CCDB queries or override obsolete ...
static bool match(DataRef const &ref, const char *binding)
LOG(info)<< "Compressed in "<< sw.CpuTime()<< " s"
std::vector< Digit > digits