31 , fuNbPads(uNbPadsX * uNbPadsY)
34 , fvbGridx(fuNbPads, false)
35 , fvbGridy(fuNbPads, false)
36 , fvbLogx(fuNbPads, false)
37 , fvbLogy(fuNbPads, false)
38 , fvbLogz(fuNbPads, false)
39 , fvvsObjName(fuNbPads)
40 , fvvsOptions(fuNbPads)
249void GetNbPadsXY(TPad* pPad, uint32_t& uNbPadsX, uint32_t& uNbPadsY)
251 uint32_t uNbPads = 1;
257 double_t dPrevX = -1.0;
258 double_t dPrevY = 2.0;
261 while (pPad->GetPad(uNbPads)) {
266 if (dPrevX < gPad->GetXlowNDC()) {
268 dPrevX = gPad->GetXlowNDC();
272 if (dPrevY > gPad->GetYlowNDC()) {
274 dPrevY = gPad->GetYlowNDC();
288 if (
nullptr == pCanv)
return std::string(
"");
291 std::string sConfig = pCanv->GetName();
295 sConfig += pCanv->GetTitle();
299 std::string sPadsConfig =
"";
300 uint32_t uNbPads = 1;
301 uint32_t uNbPadsX = 0;
302 uint32_t uNbPadsY = 0;
306 double_t dPrevX = -1.0;
307 double_t dPrevY = 2.0;
310 while (pCanv->GetPad(uNbPads)) {
315 if (dPrevX < gPad->GetXlowNDC()) {
317 dPrevX = gPad->GetXlowNDC();
321 if (dPrevY > gPad->GetYlowNDC()) {
323 dPrevY = gPad->GetYlowNDC();
329 Form(
"%d,%d,%d,%d,%d", gPad->GetGridx(), gPad->GetGridy(), gPad->GetLogx(), gPad->GetLogy(), gPad->GetLogz());
331 TObjLink* lnkHist = gPad->GetListOfPrimitives()->FirstLink();
334 if (!lnkHist) sPadsConfig +=
",(nullptr,nullptr)";
337 if (
nullptr !=
dynamic_cast<TH1*
>(lnkHist->GetObject()))
338 sPadsConfig += Form(
",(%s,%s)", lnkHist->GetObject()->GetName(), lnkHist->GetOption());
339 lnkHist = lnkHist->Next();
349 sConfig += Form(
"%u;%u;", uNbPadsX, uNbPadsY);
350 sConfig += sPadsConfig;
360 std::string sName =
"";
361 std::string sTitle =
"";
362 uint32_t uNbPads = 0;
363 uint32_t uNbPadsX = 0;
364 uint32_t uNbPadsY = 0;
370 std::vector<std::string> vsObjName;
371 std::vector<std::string> vsOptions;
377 charPosDel = sFullConfig.find(
';');
378 sName = sFullConfig.substr(0, charPosDel);
380 std::string sNext = sFullConfig.substr(charPosDel);
383 charPosDel = sNext.find(
';');
384 sTitle = sNext.substr(0, charPosDel);
386 sNext = sNext.substr(charPosDel);
389 uNbPadsX = std::stoul(sNext, &charPosDel);
391 sNext = sNext.substr(charPosDel);
394 uNbPadsY = std::stoul(sNext, &charPosDel);
396 sNext = sNext.substr(charPosDel);
399 uNbPads = uNbPadsX * uNbPadsY;
405 for (UInt_t uPadIdx = 0; uPadIdx < uNbPads; ++uPadIdx) {
406 if (0 == sNext.size()) {
407 std::cerr <<
"ExtractCanvasConfigFromString => Empty configuration string while " << uPadIdx <<
" over "
408 << uNbPads <<
" pads remain! "
409 <<
"last ones will have default config!" << std::endl;
415 bGridx = std::stoul(sNext, &charPosDel);
417 sNext = sNext.substr(charPosDel);
420 bGridy = std::stoul(sNext, &charPosDel);
422 sNext = sNext.substr(charPosDel);
425 bLogx = std::stoul(sNext, &charPosDel);
427 sNext = sNext.substr(charPosDel);
430 bLogy = std::stoul(sNext, &charPosDel);
432 sNext = sNext.substr(charPosDel);
435 bLogz = std::stoul(sNext, &charPosDel);
437 sNext = sNext.substr(charPosDel);
440 charPosDel = sNext.find(
';');
441 std::string sObjs = sNext.substr(0, charPosDel);
444 size_t charPosOpBrkt = sObjs.find(
'(');
445 while (charPosOpBrkt != std::string::npos) {
447 sObjs = sObjs.substr(charPosOpBrkt);
450 charPosOpBrkt = sObjs.find(
'(');
451 size_t charPosComma = sObjs.find(
',');
452 size_t charPosClBrkt = sObjs.find(
')');
459 std::string sObjName = sObjs.substr(charPosOpBrkt, charPosComma - charPosOpBrkt - 1);
460 std::string sObjOpt = sObjs.substr(charPosComma, charPosClBrkt - charPosComma - 1);
462 vsObjName.push_back(sObjName);
463 vsOptions.push_back(sObjOpt);
466 sObjs = sObjs.substr(charPosClBrkt);
467 charPosOpBrkt = sObjs.find(
'(');
471 charPosDel = sNext.find(
';');
473 sNext = sNext.substr(charPosDel);
476 conf.
SetConfig(uPadIdx, bGridx, bGridy, bLogx, bLogy, bLogz, vsObjName, vsOptions);