77 {
78 if (nHitCombinations <2 or nHitCombinations > 4)
79 B2FATAL("printStaticSectorRelations: input-parameter wrong ("
80 << nHitCombinations
81 << ", allowed only 2-4), skipping print-function!");
82
83 std::string secIDCombis = "## printed " + std::to_string(nHitCombinations) + "-sector-combi-output of secMap: " + configName +
84 "\n{";
86 if (staticSector == nullptr) continue;
87 std::string mainSecID = staticSector->getFullSecID().getFullSecString();
88
89 if (nHitCombinations == 2) {
90 const auto& innerSectors = staticSector->getInner2spSecIDs();
91 if (innerSectors.empty()) {
92 if (suppressDeadSectors == false) { secIDCombis += "\"" + mainSecID + "\",\n"; }
93 } else {
94 for (const auto& innerID : innerSectors) {
95 secIDCombis += "\"" + mainSecID + "\" -> \"" + innerID.getFullSecString() + "\",\n";
96 }
97 }
98
99 } else if (nHitCombinations == 3) {
100
101 const auto& innerSectors = staticSector->getInner3spSecIDs();
102 if (innerSectors.empty()) {
103 if (suppressDeadSectors == false) { secIDCombis += "\"" + mainSecID + "\",\n"; }
104 } else {
105 for (const auto& innerIDpair : innerSectors) {
106 secIDCombis += "\"" + mainSecID + "\" -> \"" + innerIDpair.first.getFullSecString() + "\",\n";
107 secIDCombis += "\"" + innerIDpair.first.getFullSecString() + "\" -> \"" + innerIDpair.second.getFullSecString() + "\",\n";
108 }
109 }
110
111 } else if (nHitCombinations == 4) {
112
113 const auto& innerSectors = staticSector->getInner4spSecIDs();
114 if (innerSectors.empty()) {
115 if (suppressDeadSectors == false) { secIDCombis += "\"" + mainSecID + "\",\n"; }
116 } else {
117 for (const auto& innerIDtriplet : innerSectors) {
118 secIDCombis += "\"" + mainSecID + "\" -> \"" + std::get<0>(innerIDtriplet).getFullSecString() + "\",\n";
119 secIDCombis += "\"" + std::get<0>(innerIDtriplet).getFullSecString() + "\" -> \"" + std::get<1>
120 (innerIDtriplet).getFullSecString() + "\",\n";
121 secIDCombis += "\"" + std::get<1>(innerIDtriplet).getFullSecString() + "\" -> \"" + std::get<2>
122 (innerIDtriplet).getFullSecString() + "\",\n";
123 }
124 }
125
126 }
127 }
128
129 secIDCombis += "};";
130
131 if (print2File == true) {
132 B2DEBUG(29, "Printing static sector relations to file " << configName << "4Mathematica.txt...\n");
133 std::ofstream ofs;
134 ofs.open(configName + "4Mathematica.txt", std::ofstream::out | std::ofstream::trunc);
135 ofs << secIDCombis;
136 ofs.close();
137 }
138 }
const std::vector< staticSector_t * > & getStaticSectors() const
JKL: intended for some checks only - returns CompactIDsMap storing the static sectors.