21 if (!asBuiltContainer.
isValid()){
23 return StatusCode::FAILURE;
28 return StatusCode::FAILURE;
31 unsigned int nLines{0};
36 ostr<<
" {"<<std::endl;
38 ostr<<
" \"typ\": \""<<asBuilt.AmdbStation()<<
"\","<<std::endl;
39 ostr<<
" \"jzz\": "<<asBuilt.AmdbEta()<<
", "<<std::endl;
40 ostr<<
" \"jff\": "<<asBuilt.AmdbPhi()<<
", "<<std::endl;
41 for (
const multilayer_t ml : {multilayer_t::ML1, multilayer_t::ML2}){
42 for (
const tubeSide_t side: {tubeSide_t::POS, tubeSide_t::NEG}){
43 const std::string prefix = std::format(
"Ml{}{}TubeSide",
44 static_cast<unsigned>(ml) + 1,
45 side == tubeSide_t::POS ?
"Pos" :
"Neg");
47 const auto dumpValue = [&ostr, &prefix](std::string_view field,
50 ostr <<
" \"" << prefix << field <<
"\": "
51 << val << (last ?
"" :
", ") <<
'\n';
54 dumpValue(
"y0", asBuilt.y0(ml, side));
55 dumpValue(
"z0", asBuilt.z0(ml, side));
56 dumpValue(
"alpha", asBuilt.alpha(ml, side));
57 dumpValue(
"ypitch", asBuilt.ypitch(ml, side));
58 dumpValue(
"zpitch", asBuilt.zpitch(ml, side));
59 dumpValue(
"stagg", asBuilt.stagg(ml, side),
60 ml == multilayer_t::ML2 && side == tubeSide_t::NEG);
63 ostr<<
" }"<< (nLines != asBuiltContainer->size() ?
"," :
"")<<std::endl;
69 return StatusCode::SUCCESS;