49 mOutFilename = ic.
options().
get<std::string>(
"mid-mask-outfile");
51 auto stop = [
this]() {
59 std::string
name =
"calib";
63 for (
auto& masks : mMasksHandlers) {
64 auto maskVec = masks.getMasks();
66 auto roMasks = colToBoard.
getData();
67 if (maskVec.empty()) {
68 LOG(info) <<
"No problematic digit found in " <<
name <<
" events";
70 LOG(info) <<
"Problematic digits found in " <<
name <<
" events. Corresponding masks:";
71 for (
auto&
mask : maskVec) {
74 std::cout <<
"\nCorresponding boards masks:" << std::endl;
75 for (
auto& board : roMasks) {
76 std::cout << board << std::endl;
80 if (!mOutFilename.empty()) {
81 auto idx = mOutFilename.find_last_of(
"/");
82 auto insertIdx = (idx == std::string::npos) ? 0 : idx + 1;
83 std::string outFilename = mOutFilename;
84 outFilename.insert(insertIdx,
"_");
85 outFilename.insert(insertIdx,
name.c_str());
87 for (
auto&
mask : fullMasks) {
88 masks.applyMask(
mask);
92 roBoardCfgHandler.
write(outFilename.c_str());
102 auto tStart = std::chrono::high_resolution_clock::now();
104 std::array<gsl::span<const ColumnData>, 2> masks;
106 masks[0] = pc.
inputs().
get<gsl::span<ColumnData>>(
"mid_noise_mask");
107 masks[1] = pc.
inputs().
get<gsl::span<ColumnData>>(
"mid_dead_mask");
109 auto tAlgoStart = std::chrono::high_resolution_clock::now();
111 bool isChanged =
false;
112 for (
int itype = 0; itype < 2; ++itype) {
114 for (
auto&
mask : masks[itype]) {
117 if (!(chMasks == mMasksHandlers[itype])) {
118 mMasksHandlers[itype] = chMasks;
127 mTimerMaskHandler += std::chrono::high_resolution_clock::now() - tAlgoStart;
129 mTimer += std::chrono::high_resolution_clock::now() - tStart;
133 std::array<ChannelMasksHandler, 2> mMasksHandlers{};
134 std::chrono::duration<double> mTimer{0};
135 std::chrono::duration<double> mTimerMaskHandler{0};
136 std::string mOutFilename{};
141 std::vector<of::InputSpec> inputSpecs{
151 {
"mid-mask-outfile", of::VariantType::String,
"", {
"Output filename"}}}};
MID channels masks handler.
Converter from ColumnData to raw local boards.
Strip pattern (aka digits)
Processor to handle the masks.
Function to produce the MID masks.
T get(const char *key) const
ServiceRegistryRef services()
ConfigParamRegistry const & options()
InputRecord & inputs()
The inputs associated with this processing context.
void setFromChannelMask(const ColumnData &mask)
std::vector< ROBoard > getData() const
Gets vector of ROBoard.
void process(gsl::span< const ColumnData > data, bool allowEmpty=false)
void init(o2::framework::InitContext &ic)
void run(o2::framework::ProcessingContext &pc)
void write(const char *filename) const
void updateMasks(const std::vector< ROBoard > &masks)
GLuint const GLchar * name
constexpr o2::header::DataOrigin gDataOriginMID
Defining PrimaryVertex explicitly as messageable.
std::vector< ConfigParamSpec > Options
std::vector< ColumnData > makeDefaultMasks()
framework::DataProcessorSpec getMaskHandlerSpec()
a couple of static helper functions to create timestamp values for CCDB queries or override obsolete ...
LOG(info)<< "Compressed in "<< sw.CpuTime()<< " s"