6 #include "nlohmann/json.hpp"
15 return StatusCode::SUCCESS;
18 const EventContext& ctx = Gaudi::Hive::currentContext();
20 if (!asBuiltContainer.isValid()){
22 return StatusCode::FAILURE;
27 return StatusCode::FAILURE;
30 unsigned int nLines{0};
35 ostr<<
" {"<<std::endl;
37 ostr<<
" \"typ\": \""<<asBuilt.AmdbStation()<<
"\","<<std::endl;
38 ostr<<
" \"jzz\": "<<asBuilt.AmdbEta()<<
", "<<std::endl;
39 ostr<<
" \"jff\": "<<asBuilt.AmdbPhi()<<
", "<<std::endl;
40 for (
const multilayer_t ml : {multilayer_t::ML1, multilayer_t::ML2}){
41 for (
const tubeSide_t
side: {tubeSide_t::POS, tubeSide_t::NEG}){
42 std::stringstream
prefix{};
43 prefix<<
"Ml"<<(
static_cast<unsigned>(ml) + 1);
44 prefix<<(
side == tubeSide_t::POS?
"Pos" :
"Neg")<<
"TubeSide";
46 auto dumpValue = [&
prefix,&ostr](
const std::string&
field,
50 ostr<<
val<<(last ?
"":
", ")<<std::endl;
52 dumpValue(
"y0", asBuilt.y0(ml,
side));
53 dumpValue(
"z0", asBuilt.z0(ml,
side));
54 dumpValue(
"alpha", asBuilt.alpha(ml,
side));
55 dumpValue(
"ypitch", asBuilt.ypitch(ml,
side));
56 dumpValue(
"zpitch", asBuilt.zpitch(ml,
side));
57 dumpValue(
"stagg", asBuilt.stagg(ml,
side),
58 ml == multilayer_t::ML2 &&
side == tubeSide_t::NEG);
61 ostr<<
" }"<< (nLines != asBuiltContainer->size() ?
"," :
"")<<std::endl;
67 return StatusCode::SUCCESS;