Belle II Software  release-05-01-25
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: More...
 

Detailed Description

namespace for SectorMapHelper-related stuff

Function Documentation

◆ printStaticSectorRelations()

void Belle2::SecMapHelper::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:

  • 'filters' contains the static sectors

configName is used for the fileName to be able to recognize the outputs

  • nHit-Combinations shows links of 2-, 3- or 4-static sectors in a row
  • print2File prints to a file if yes or to screen if no
  • suppressDeadSectors discards sectors without links if set to true

Definition at line 85 of file VXDTFFiltersHelperFunctions.h.

85  : " + configName +
86  "\n{";
87  for (const auto* staticSector : filters.getStaticSectors()) {
88  if (staticSector == nullptr) continue;
89  std::string mainSecID = staticSector->getFullSecID().getFullSecString();
90 
91  if (nHitCombinations == 2) {
92  const auto& innerSectors = staticSector->getInner2spSecIDs();
93  if (innerSectors.empty()) {
94  if (suppressDeadSectors == false) { secIDCombis += "\"" + mainSecID + "\",\n"; }
95  } else {
96  for (const auto& innerID : innerSectors) {
97  secIDCombis += "\"" + mainSecID + "\" -> \"" + innerID.getFullSecString() + "\",\n";
98  }
99  }
100 
101  } else if (nHitCombinations == 3) {
102  // TODO discuss: do we want to treat the nodes as sectors or as sector-pairs in this case? more correct would be sector-pair...)
103  const auto& innerSectors = staticSector->getInner3spSecIDs();
104  if (innerSectors.empty()) {
105  if (suppressDeadSectors == false) { secIDCombis += "\"" + mainSecID + "\",\n"; }
106  } else {
107  for (const auto& innerIDpair : innerSectors) {
108  secIDCombis += "\"" + mainSecID + "\" -> \"" + innerIDpair.first.getFullSecString() + "\",\n";
109  secIDCombis += "\"" + innerIDpair.first.getFullSecString() + "\" -> \"" + innerIDpair.second.getFullSecString() + "\",\n";
110  }
111  }
112 
113  } else if (nHitCombinations == 4) {
114  // TODO discuss: do we want to treat the nodes as sectors or as sector-pairs in this case? more correct would be sector-pair...)
115  const auto& innerSectors = staticSector->getInner4spSecIDs();
116  if (innerSectors.empty()) {
117  if (suppressDeadSectors == false) { secIDCombis += "\"" + mainSecID + "\",\n"; }
118  } else {
119  for (const auto& innerIDtriplet : innerSectors) {
120  secIDCombis += "\"" + mainSecID + "\" -> \"" + std::get<0>(innerIDtriplet).getFullSecString() + "\",\n";
121  secIDCombis += "\"" + std::get<0>(innerIDtriplet).getFullSecString() + "\" -> \"" + std::get<1>
122  (innerIDtriplet).getFullSecString() + "\",\n";
123  secIDCombis += "\"" + std::get<1>(innerIDtriplet).getFullSecString() + "\" -> \"" + std::get<2>
124  (innerIDtriplet).getFullSecString() + "\",\n";
125  }
126  }
127 
128  }
129  }
130 
131  secIDCombis += "};";
132 
133  if (print2File == true) {
134  B2DEBUG(99, "Printing static sector relations to file " << configName << "4Mathematica.txt...\n");
135  std::ofstream ofs;
136  ofs.open(configName + "4Mathematica.txt", std::ofstream::out | std::ofstream::trunc);
137  ofs << secIDCombis;
138  ofs.close();
139  }
140  }
141 
142  } // SecMapHelper namespace
144 } //Belle2 namespace