62 LOG(info) <<
"[HMPID Dump Digits - init() ] ";
63 mPrintDigits = ic.
options().
get<
bool>(
"print");
65 mIsOutputOnFile =
false;
66 mOutputFileName = ic.
options().
get<std::string>(
"out-file");
67 if (mOutputFileName !=
"") {
68 mOsFile.open(mOutputFileName, std::ios::out);
69 if (mOsFile.is_open()) {
70 mIsOutputOnFile =
true;
74 std::cout <<
"--- HMP Digits : [Chamb,PhoCat,x,y]=Charge ---" << std::endl;
76 if (mIsOutputOnFile) {
77 mOsFile <<
"--- HMP Digits : [Chamb,PhoCat,x,y]=Charge ---" << std::endl;
89 LOG(info) <<
"[HMPID Dump Digits - run() ] Enter Dump ...";
90 std::vector<o2::hmpid::Trigger> triggers;
91 std::vector<o2::hmpid::Digit>
digits;
95 triggers = pc.
inputs().
get<std::vector<o2::hmpid::Trigger>>(
ref);
96 LOG(info) <<
"We receive triggers =" << triggers.size();
100 LOG(info) <<
"The size of the vector =" <<
digits.size();
101 mDigitsReceived +=
digits.size();
103 for (
int i = 0;
i < triggers.size();
i++) {
105 std::cout <<
"Trigger Event Orbit = " << triggers[
i].getOrbit() <<
" BC = " << triggers[
i].getBc() << std::endl;
106 for (
int j = triggers[
i].getFirstEntry();
j <= triggers[
i].getLastEntry();
j++) {
107 std::cout <<
digits[
j] << std::endl;
110 if (mIsOutputOnFile) {
111 mOsFile <<
"Trigger Event Orbit = " << triggers[
i].getOrbit() <<
" BC = " << triggers[
i].getBc() << std::endl;
112 for (
int j = triggers[
i].getFirstEntry();
j <= triggers[
i].getLastEntry();
j++) {
113 mOsFile <<
digits[
j] << std::endl;
118 std::cout <<
">>----->>>" << triggers.size() <<
" " <<
digits.size() << std::endl;
135 std::vector<o2::framework::InputSpec> inputs;
139 std::vector<o2::framework::OutputSpec> outputs;
146 Options{{
"out-file", VariantType::String,
"", {
"name of the output file"}},
147 {
"print", VariantType::Bool,
false, {
"print digits (default false )"}}}};
A raw page parser for DPL input.
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 run(framework::ProcessingContext &pc) final
void endOfStream(framework::EndOfStreamContext &ec) override
This is invoked whenever we have an EndOfStream event.
void stop()
stop : stops the timer
void elapseMes(std::string const message)
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 getDumpDigitsSpec(std::string inputSpec="HMP/DIGITS")
a couple of static helper functions to create timestamp values for CCDB queries or override obsolete ...
std::string to_string(gsl::span< T, Size > span)
static bool match(DataRef const &ref, const char *binding)
LOG(info)<< "Compressed in "<< sw.CpuTime()<< " s"
std::vector< Digit > digits