Belle II Software development
Belle2::SecMapHelper Namespace Reference

namespace for SectorMapHelper-related stuff More...

Functions

template<class HitType >
void printStaticSectorRelations (const VXDTFFilters< HitType > &filters, const std::string &configName, unsigned int nHitCombinations=2, bool print2File=true, bool suppressDeadSectors=true)
 TODO dot-compatible version of printStaticSectorRelations:
 

Detailed Description

namespace for SectorMapHelper-related stuff

Function Documentation

◆ printStaticSectorRelations()

void printStaticSectorRelations ( const VXDTFFilters< HitType > &  filters,
const std::string &  configName,
unsigned int  nHitCombinations = 2,
bool  print2File = true,
bool  suppressDeadSectors = true 
)

TODO dot-compatible version of printStaticSectorRelations:

function for printing relationBetweenStaticSectors:

Parameters
filterscontains the static sectors
configNameis used for the fileName to be able to recognize the outputs
nHitCombinationsshows links of 2-, 3- or 4-static sectors in a row
print2Fileprints to a file if yes or to screen if no
suppressDeadSectorsdiscards sectors without links if set to true

Definition at line 75 of file VXDTFFiltersHelperFunctions.h.

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{";
85 for (const auto* staticSector : filters.getStaticSectors()) {
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 // TODO discuss: do we want to treat the nodes as sectors or as sector-pairs in this case? more correct would be sector-pair...)
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 // TODO discuss: do we want to treat the nodes as sectors or as sector-pairs in this case? more correct would be sector-pair...)
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.
Definition: VXDTFFilters.h:286