Belle II Software  release-05-02-19
RawSecMapMergerModule.cc
1 /**************************************************************************
2  * BASF2 (Belle Analysis Framework 2) *
3  * Copyright(C) 2015 - Belle II Collaboration *
4  * *
5  * Author: The Belle II Collaboration *
6  * Contributors: Jakob Lettenbichler (jakob.lettenbichler@oeaw.ac.at) *
7  * *
8  * This software is provided "as is" without any warranty. *
9  **************************************************************************/
10 
11 #include <tracking/modules/VXDTFHelperTools/RawSecMapMergerModule.h>
12 #include <tracking/spacePointCreation/SpacePoint.h>
13 #include <tracking/trackFindingVXD/environment/VXDTFFiltersHelperFunctions.h>
14 #include <tracking/trackFindingVXD/filterMap/filterFramework/SelectionVariableNamesToFunctions.h>
15 #include <vxd/geometry/GeoCache.h>
16 
17 using namespace std;
18 using namespace Belle2;
19 
20 //-----------------------------------------------------------------
21 // Register the Module
22 //-----------------------------------------------------------------
23 REG_MODULE(RawSecMapMerger)
24 
25 //-----------------------------------------------------------------
26 // Implementation
27 //-----------------------------------------------------------------
28 
30 {
31  //Set module properties
32  setDescription("this module takes a root file containing a raw sectorMap created by the SecMapTrainerBaseModule and converts it to a sectormap which can be read by the VXDTF. Please check the parameters to be set...");
33 // setPropertyFlags(c_ParallelProcessingCertified); /// WARNING this module should _not_ be used for parallel processing! Its task is to create the sector maps only once...
34 
35 
36  addParam("rootFileNames", m_PARAMrootFileNames,
37  "List of files (wildcards not allowed - use python glob.glob() to expand to list of files)", {"lowTestRedesign_454970355.root"});
38 
39  addParam("mapNames", m_PARAMmapNames, "names of sectorMaps to be loaded.", {""});
40 
41  addParam("printFullGraphs", m_PARAMprintFullGraphs,
42  "If true, the full trained graphs will be printed to screen. WARNING: produces a lot of output for full detector-cases!",
43  bool(false));
44 }
45 
46 
47 
48 
49 
50 std::vector<std::string> RawSecMapMergerModule::getRootFiles(std::string mapName)
51 {
52  B2INFO("RawSecMapMerger::getRootFiles(): loading mapName: " << mapName);
53 
54  vector<string> files4ThisMap;
55  for (string& fileName : m_PARAMrootFileNames) {
56  if (fileName.find(mapName) == string::npos) {
57  B2DEBUG(1, "getRootFiles: fileName " << fileName << " was _not_ accepted for map " << mapName);
58  continue;
59  }
60  B2DEBUG(1, "getRootFiles: fileName " << fileName << " accepted for map " << mapName);
61  files4ThisMap.push_back(fileName);
62  }
63  return files4ThisMap;
64 }
65 
66 
67 
68 
69 
70 std::unique_ptr<TChain> RawSecMapMergerModule::createTreeChain(const SectorMapConfig& configuration, const std::string& nHitString)
71 {
72  B2INFO("RawSecMapMerger::createTreeChain(): loading mapName: " << configuration.secMapName << " with extension " << nHitString);
73  unique_ptr<TChain> treeChain = unique_ptr<TChain>(new TChain((configuration.secMapName + nHitString).c_str()));
74 
75  vector<string> fileList = getRootFiles(configuration.secMapName);
76  for (string& file : fileList) { treeChain->Add(file.c_str()); }
77 
78  return treeChain;
79 }
80 
81 
82 
83 
84 
85 template<class ValueType> std::vector<BranchInterface<ValueType>> RawSecMapMergerModule::getBranches(
86  std::unique_ptr<TChain>& chain,
87  const std::vector<std::string>& branchNames)
88 {
89  vector<BranchInterface<ValueType>> branches;
90  B2INFO("RawSecMapMerger::getBranches(): loading branches: " << branchNames.size());
91  unsigned nBranches = branchNames.size();
92 
93  branches.resize(nBranches, BranchInterface<ValueType>());
94  for (unsigned fPos = 0; fPos < nBranches; fPos++) {
95  branches[fPos].name = branchNames[fPos];
96  chain->SetBranchAddress(
97  branches[fPos].name.c_str(),
98  &(branches[fPos].value),
99  &(branches[fPos].branch));
100  }
101  B2INFO("RawSecMapMerger::getBranches(): done");
102  return branches;
103 }
104 
105 std::string
106 RawSecMapMergerModule::prepareNHitSpecificStuff(
107  unsigned nHits,
108  const SectorMapConfig&,
109  std::vector<std::string>& secBranchNames,
110  std::vector<std::string>& filterBranchNames)
111 {
112  if (nHits == 2) {
113  secBranchNames = { "outerSecID", "innerSecID"};
115 
116  for (const auto& filterNameToFunction : twoHitsFilterNameToFunction) {
117  string filterName = filterNameToFunction.first ;
118  filterBranchNames.push_back(filterName);
119  }
120  return "2Hit";
121  }
122 
123  if (nHits == 3) {
124  secBranchNames = { "outerSecID", "centerSecID", "innerSecID"};
126 
127  for (const auto& filterNameToFunction : threeHitsFilterNameToFunction) {
128  string filterName = filterNameToFunction.first ;
129  filterBranchNames.push_back(filterName);
130  }
131  return "3Hit";
132  }
133 
134  B2ERROR("prepareNHitSpecificStuff: wrong chainLength!");
135  return "";
136 }
137 
138 template <class FilterType> void RawSecMapMergerModule::trainGraph(
139  SectorGraph<FilterType>& mainGraph,
140  std::unique_ptr<TChain>& chain,
141  std::vector<BranchInterface<unsigned>>& sectorBranches,
142  std::vector<BranchInterface<double>>& filterBranches)
143 {
144  auto nEntries = chain->GetEntries();
145  B2DEBUG(10, "RawSecMapMerger::trainGraph(): start of " << nEntries << " entries in tree and " << sectorBranches.size() <<
146  " branches");
147  if (nEntries == 0) { B2WARNING("trainGraph: valid file but no data stored!"); return; }
148 
149  auto percentMark = nEntries / 10; auto progressCounter = 0;
150  // log all sector-combinations and determine their absolute number of appearances:
151  for (auto i = 0 ; i <= nEntries; i++) {
152  if (percentMark < 1 or (i % percentMark) == 0) {
153  B2INFO("RawSecMapMerger::trainGraph(): with mark: " << percentMark << " and i=" << i << ", " << progressCounter <<
154  "% related, mainGraph has got " << mainGraph.size() << " sectors...");
155  progressCounter += 10;
156  }
157  auto thisEntry = chain->LoadTree(i);
158 
159  auto ids = getSecIDs(sectorBranches, thisEntry);
160  auto currentID = SubGraphID(ids);
161 
162  auto pos = mainGraph.find(currentID);
163 
164  if (pos == mainGraph.end()) { B2WARNING("trainGraph: could not find subgraph " << currentID.print() << " - skipping entry..."); continue; }
165 
166  for (auto& filter : filterBranches) {
167  filter.update(thisEntry);
168  pos->second.addValue(FilterType(filter.name), filter.value);
169  }
170  } // entry-loop-end
171 }
172 
173 
174 
175 
176 
177 template <class FilterType> SectorGraph<FilterType> RawSecMapMergerModule::buildGraph(
178  std::unique_ptr<TChain>& chain,
179  std::vector<BranchInterface<unsigned>>& sectorBranches,
180  std::vector<BranchInterface<double>>& filterBranches)
181 {
182  auto nEntries = chain->GetEntries();
183  B2INFO("RawSecMapMerger::buildGraph(): start of " << nEntries << " entries in tree and " << sectorBranches.size() <<
184  " branches");
185 
186  // creating main graph containing all subgraphs:
187  vector<string> filterNames;
188  // cppcheck-suppress useStlAlgorithm
189  for (auto& entry : filterBranches) { filterNames.push_back(entry.name); }
190  SectorGraph<FilterType> mainGraph(filterNames);
191 
192  if (nEntries == 0) { B2WARNING("buildGraph: valid file but no data stored!"); return mainGraph; }
193  auto percentMark = nEntries / 10;
194  auto progressCounter = 0;
195 
196  // log all sector-combinations and determine their absolute number of appearances:
197  for (auto i = 0 ; i <= nEntries; i++) {
198  if (percentMark < 1 or (i % percentMark) == 0) {
199  B2INFO("RawSecMapMerger::buildGraph(): with mark: " << percentMark << " and i=" << i << ", " << progressCounter <<
200  "% related, mainGraph has got " << mainGraph.size() << " sectors...");
201  progressCounter += 10;
202  }
203  auto thisEntry = chain->LoadTree(i);
204 
205  std::vector<unsigned> ids = getSecIDs(sectorBranches, thisEntry);
206 
207  if (! good(ids))
208  continue;
209 
210  auto currentID = SubGraphID(ids);
211  B2DEBUG(10, "buildGraph-SubGraphID-print: id: " << currentID.print());
212 
213  auto pos = mainGraph.find(currentID);
214 
215  if (pos == mainGraph.end()) { pos = mainGraph.add(currentID); }
216 
217  if (pos == mainGraph.end()) { B2WARNING("could not find nor add subgraph - skipping entry..."); continue; }
218 
219  pos->second.wasFound();
220 
221  for (auto& filter : filterBranches) {
222  filter.update(thisEntry);
223  pos->second.checkAndReplaceIfMinMax(FilterType(filter.name), filter.value);
224  }
225  } // entry-loop-end
226 
227  B2INFO("RawSecMapMerger::buildGraph(): mainGraph finished - has now size: " << mainGraph.size());
228  B2DEBUG(1, "fullGraph-Print: " << mainGraph.print());
229 
230  return mainGraph;
231 }
232 
233 
234 bool RawSecMapMergerModule::good(const std::vector<unsigned>& ids)
235 {
236  switch (ids.size()) {
237  case 2:
238  if (FullSecID(ids[0]).getLayerID() == FullSecID(ids[1]).getLayerID() &&
239  FullSecID(ids[0]).getLadderID() == FullSecID(ids[1]).getLadderID()
240  )
241  return false; // the ids are bad: for us a track cannot cross twice the same ladder
242  return true;
243  case 3:
244  if (FullSecID(ids[0]).getLayerID() == FullSecID(ids[1]).getLayerID() &&
245  FullSecID(ids[0]).getLadderID() == FullSecID(ids[1]).getLadderID()
246  )
247  return false; // the ids are bad: for us a track cannot cross twice the same ladder
248  if (FullSecID(ids[1]).getLayerID() == FullSecID(ids[2]).getLayerID() &&
249  FullSecID(ids[1]).getLadderID() == FullSecID(ids[2]).getLadderID()
250  )
251  return false; // the ids are bad: for us a track cannot cross twice the same ladder
252  if (FullSecID(ids[0]).getLayerID() == FullSecID(ids[2]).getLayerID() &&
253  FullSecID(ids[0]).getLadderID() == FullSecID(ids[2]).getLadderID()
254  )
255  return false; // the ids are bad: for us a track cannot cross twice the same ladder
256  return true;
257  default:
258  return true;
259  }
260 }
261 
262 
263 void RawSecMapMergerModule::printData(
264  std::unique_ptr<TChain>& chain,
265  std::vector<BranchInterface<unsigned>>& sectorBranches,
266  std::vector<BranchInterface<double>>& filterBranches)
267 {
268  // prepare everything:
269  unsigned nEntries = chain->GetEntries();
270  unsigned percentMark = 1;
271  if (nEntries > 100) { percentMark = nEntries / 50; }
272  unsigned progressCounter = 0;
273 
274  B2INFO("RawSecMapMerger::printData(): start of " << nEntries <<
275  " entries in tree and " << sectorBranches.size() <<
276  "/" << filterBranches.size() <<
277  " sector-/filter-branches");
278 
279  for (unsigned i = 0 ; i < nEntries; i++) {
280  if (percentMark > 1 and (i % percentMark) != 0) { continue; }
281  progressCounter += 2;
282  B2INFO("RawSecMapMerger::printData(): entry " << i << " of " << nEntries << ":");
283 
284  auto thisEntry = chain->LoadTree(i);
285 
286  string out;
287  for (unsigned k = 0 ; k < sectorBranches.size(); k++) {
288  sectorBranches[k].branch->GetEntry(thisEntry);
289  out += sectorBranches[k].name + ": " + FullSecID(sectorBranches[k].value).getFullSecString() + ". ";
290  }
291  out += "\n";
292 
293  for (unsigned k = 0 ; k < filterBranches.size(); k++) {
294  filterBranches[k].branch->GetEntry(thisEntry);
295  out += filterBranches[k].name + ": " + to_string(filterBranches[k].value) + ". ";
296  }
297  B2INFO(out << "\n");
298  }
299 }
300 
301 
302 
303 
304 
305 void RawSecMapMergerModule::printVXDTFFilters(const VXDTFFilters<SpacePoint>& filters,
306  std::string configName, unsigned int nHitCombinations, bool print2File)
307 {
308  SecMapHelper::printStaticSectorRelations<SpacePoint>(filters , configName , nHitCombinations, print2File);
309 }
310 
311 
314 //std::vector<VxdID> RawSecMapMergerModule::getCompatibleVxdIDs(const SectorMapConfig& config)
315 //{
316 //
317 // // TODO: remove that part and use the version in the bootstrap module
318 //
319 // // TODO WARNING hardcoded values!
320 // std::vector<unsigned> layers = { 0, 1, 2, 3, 4, 5, 6};
321 // std::vector<unsigned> ladders = { 0, 8, 12, 7, 10, 12, 16};
322 // std::vector<unsigned> sensors = { 0, 2, 2, 2, 3, 4, 5};
323 //
324 // std::vector<VxdID> vxdIDs;
325 //
326 // for (unsigned layerID : config.allowedLayers) {
327 // for (unsigned ladderID = 0; ladderID <= ladders.at(layerID); ladderID++) {
328 // if (ladderID == 0 and layerID != 0) continue; // only virtual IP (layer 0) has ladder 0
329 // for (unsigned sensorID = 0; sensorID <= sensors.at(layerID); sensorID++) {
330 // if (sensorID == 0 and layerID != 0) continue; // only virtual IP (layer 0) has sensor 0
331 // vxdIDs.push_back(VxdID(layerID, ladderID, sensorID));
332 // }
333 // }
334 // }
335 // return vxdIDs;
336 //}
337 
338 
339 
340 template <class FilterType> unsigned RawSecMapMergerModule::updateFilterSubLayerIDs(SectorGraph<FilterType>& mainGraph,
341  VXDTFFilters<SpacePoint>& segFilters)
342 {
343  // get all VXD sensors in the geometry
344  // WARNING: if a different geometry in the first training step was used this may lead to difficulties
345  std::vector<VxdID> vxdIDs = VXD::GeoCache::getInstance().getListOfSensors();
346 
347 
348  // collect all secIDs occured in training and use them to update the sectors in the SectorID in the VXDTFFilter
349  // in particular the sublayerID which is determined from the graph
350  for (VxdID sensor : vxdIDs) {
351 
352  std::vector< FullSecID> allTrainedSecIDsOfSensor = mainGraph.getAllFullSecIDsOfSensor(sensor);
353 
354  // this removes all FullSecIDs which occured more than once
355  std::sort(allTrainedSecIDsOfSensor.begin(), allTrainedSecIDsOfSensor.end());
356  allTrainedSecIDsOfSensor.erase(
357  std::unique(
358  allTrainedSecIDsOfSensor.begin(),
359  allTrainedSecIDsOfSensor.end()),
360  allTrainedSecIDsOfSensor.end());
361 
362  for (FullSecID sector : allTrainedSecIDsOfSensor) {
363  // the search within that function will ignore the sublayerid, the sublayer id will be set to the one in "sector"
364  bool success = segFilters.setSubLayerIDs(sector, sector.getSubLayerID());
365  // if success is false the sector was not found in the segFilters. This should not happen!
366  if (!success) B2FATAL("There is a mismatch between the FullSecIDs in the Trainings Graph and the SectorMap!");
367  }
368 
369  B2DEBUG(1, "Sensor: " << sensor << " had " << allTrainedSecIDsOfSensor.size() << " trained IDs and ");
370  } // end loop sensor of vxdIDs.
371 
372  return vxdIDs.size() + 1;
373 }
374 
375 
376 
377 
378 
379 // TODO this is not yet capable of dealing with other than twoHitFilters. -> generalize!
380 template <class FilterType> void RawSecMapMergerModule::getSegmentFilters(
381  const SectorMapConfig& config,
382  SectorGraph<FilterType>& mainGraph,
383  VXDTFFilters<SpacePoint>* xHitFilters,
384  int nSecChainLength)
385 {
386 
387  // Thomas : possible bug, the sublayer id s have been updated only for the nSecChainLength==2 case
388  /*
389  if (xHitFilters->size() == 0) {
390  unsigned nSectors = updateFilterSubLayerIDs( mainGraph, *xHitFilters);
391  B2DEBUG(1, "RawSecMapMerger::getSegmentFilters: in updateSubLayerIDs " << nSectors << " were added to secMap " <<
392  config.secMapName);
393  } else {
394  B2DEBUG(1, "RawSecMapMerger::getSegmentFilters: in given xHitFilters-container has size of " << xHitFilters->size() <<
395  " and therefore no further sectors have to be added.");
396  }
397  */
398  // after rewriting this function only updates the sublayer ids of the already existing sectors
399  // so it should only be executed once!!
400  // TODO: remove the if by a better construction!! Also what happens if for the nSecChainLength>2 case the sublayerids need updates???
401  if (nSecChainLength == 2) updateFilterSubLayerIDs(mainGraph, *xHitFilters);
402 
403  B2DEBUG(1, "RawSecMapMerger::getSegmentFilters: secMap " << config.secMapName << " got the following sectors:\n" <<
404  mainGraph.print());
405 
406 
407  for (auto& subGraph : mainGraph) {
408 
409  if (nSecChainLength == 2) {
410  add2HitFilters(*xHitFilters, subGraph.second, config);
411  } else if (nSecChainLength == 3) {
412  add3HitFilters(*xHitFilters, subGraph.second, config);
413  } else if (nSecChainLength == 4) {
414  add4HitFilters(*xHitFilters, subGraph.second, config);
415  } else { B2FATAL("nSecChainLength " << nSecChainLength << " is not within allowed range [2;4]!"); }
416  }
417 }
418 
419 
420 
421 
422 
423 template <class FilterType> void RawSecMapMergerModule::add2HitFilters(VXDTFFilters<SpacePoint>&
424  filterContainer, SubGraph<FilterType>& subGraph, const SectorMapConfig& config)
425 {
426 // // // WARNING evil hack -> SelectionVariables themselves should be able to tell their own names!
427 // // std::string named3D = "Distance3DSquared", namedXY = "Distance2DXYSquared", nameddZ = "Distance1DZ", namesRZ = "SlopeRZ",
428 // // named3Dn = "Distance3DNormed";
429  const auto& filterCutsMap = subGraph.getFinalQuantileValues();
431 
432  auto filterNameToFunctions(SelectionVariableNamesToFunctions(
434  std::string filterVals;
435  for (const auto& filterNameToFunction : filterNameToFunctions) {
436  string filterName = filterNameToFunction.first ;
437  filterVals += filterName + ": "
438  + std::to_string(filterCutsMap.at(filterName).getMin())
439  + "/"
440  + std::to_string(filterCutsMap.at(filterName).getMax()) + ", ";
441  }
442  B2DEBUG(1, "SubGraph " << subGraph.getID().print() << " - filter:min/max: " << filterVals);
443 
444  VXDTFFilters<SpacePoint>::twoHitFilter_t friendSectorsSegmentFilter =
445  (
446  (
447  (filterCutsMap.at("DistanceInTimeUside").getMin() <= DistanceInTimeUside<SpacePoint>() <=
448  filterCutsMap.at("DistanceInTimeUside").getMax()) &&
449  (filterCutsMap.at("DistanceInTimeVside").getMin() <= DistanceInTimeVside<SpacePoint>() <=
450  filterCutsMap.at("DistanceInTimeVside").getMax()) &&
451  (filterCutsMap.at("Distance3DSquared").getMin() <= Distance3DSquared<SpacePoint>() <=
452  filterCutsMap.at("Distance3DSquared").getMax()) &&
453  (filterCutsMap.at("Distance2DXYSquared").getMin() <= Distance2DXYSquared<SpacePoint>() <=
454  filterCutsMap.at("Distance2DXYSquared").getMax()) &&
455  (filterCutsMap.at("Distance1DZ").getMin() <= Distance1DZ<SpacePoint>() <= filterCutsMap.at("Distance1DZ").getMax()) &&
456  (filterCutsMap.at("SlopeRZ").getMin() <= SlopeRZ<SpacePoint>() <= filterCutsMap.at("SlopeRZ").getMax()) &&
457  (filterCutsMap.at("Distance3DNormed").getMin() <= Distance3DNormed<SpacePoint>() <=
458  filterCutsMap.at("Distance3DNormed").getMax())
459  )
460  );
461 
462  auto secIDs = subGraph.getID().getFullSecIDs();
463 
464  // secIDs are sorted from outer to inner:
465  B2DEBUG(1, "RawSecMapMerger::add2HitFilters: now adding FriendSectorFilter for secIDs (outer/inner): " << secIDs.at(
466  0) << "/" << secIDs.at(1));
467  if (filterContainer.addTwoHitFilter(secIDs.at(0), secIDs.at(1),
468  friendSectorsSegmentFilter) == 0)
469  B2WARNING("secMap: " << config.secMapName << "Problem adding the friendship relation from the inner sector:" <<
470  secIDs.at(1) << " -> " << secIDs.at(0) << " outer sector");
471 }
472 
473 
474 
475 template <class FilterType> void RawSecMapMergerModule::add3HitFilters(VXDTFFilters<SpacePoint>&
476  filterContainer, SubGraph<FilterType>& subGraph, const SectorMapConfig& config)
477 {
478  const auto& filterCutsMap = subGraph.getFinalQuantileValues();
480 
481  auto filterNameToFunctions(SelectionVariableNamesToFunctions(
483  std::string filterVals;
484 
485  for (auto& filterNameToFunction : filterNameToFunctions) {
486  string filterName = filterNameToFunction.first ;
487  filterVals += filterName + ": "
488  + std::to_string(filterCutsMap.at(filterName).getMin())
489  + "/"
490  + std::to_string(filterCutsMap.at(filterName).getMax()) + ", ";
491  }
492  B2DEBUG(1, "SubGraph " << subGraph.getID().print() << " - filter:min/max: " << filterVals);
493 
494 
496  ((filterCutsMap.at("DistanceInTime").getMin() <= DistanceInTime<SpacePoint>() <= filterCutsMap.at("DistanceInTime").getMax()) &&
497  (filterCutsMap.at("Angle3DSimple").getMin() <= Angle3DSimple<SpacePoint>() <= filterCutsMap.at("Angle3DSimple").getMax()) &&
498  (filterCutsMap.at("CosAngleXY").getMin() <= CosAngleXY<SpacePoint>() <= filterCutsMap.at("CosAngleXY").getMax()) &&
499  (filterCutsMap.at("AngleRZSimple").getMin() <= AngleRZSimple<SpacePoint>() <= filterCutsMap.at("AngleRZSimple").getMax()) &&
500  (CircleDist2IP<SpacePoint>() <= filterCutsMap.at("CircleDist2IP").getMax()) &&
501  (filterCutsMap.at("DeltaSlopeRZ").getMin() <= DeltaSlopeRZ<SpacePoint>()) <= filterCutsMap.at("DeltaSlopeRZ").getMax() &&
502  (filterCutsMap.at("DeltaSlopeZoverS").getMin() <= DeltaSlopeZoverS<SpacePoint>() <=
503  filterCutsMap.at("DeltaSlopeZoverS").getMax()) &&
504  (filterCutsMap.at("DeltaSoverZ").getMin() <= DeltaSoverZ<SpacePoint>() <= filterCutsMap.at("DeltaSoverZ").getMax()) &&
505  (filterCutsMap.at("HelixParameterFit").getMin() <= HelixParameterFit<SpacePoint>() <=
506  filterCutsMap.at("HelixParameterFit").getMax()) &&
507  (filterCutsMap.at("Pt").getMin() <= Pt<SpacePoint>() <= filterCutsMap.at("Pt").getMax()) &&
508  (filterCutsMap.at("CircleRadius").getMin() <= CircleRadius<SpacePoint>() <= filterCutsMap.at("CircleRadius").getMax())
509 
510  ).observe(VoidObserver());
511 
512 
513  auto secIDs = subGraph.getID().getFullSecIDs();
514 
515  // secIDs are sorted from outer to inner:
516  B2DEBUG(1, "RawSecMapMerger::add3HitFilters: now adding FriendSectorFilter for secIDs (outer/center/inner): "
517  << secIDs.at(0) << "/"
518  << secIDs.at(1) << "/"
519  << secIDs.at(2));
520  if (filterContainer.addThreeHitFilter(secIDs.at(0), secIDs.at(1), secIDs.at(2),
521  threeHitFilter) == 0)
522  B2WARNING("secMap: " << config.secMapName << "Problem adding the friendship relation for the secIDs (outer/center/inner): "
523  << secIDs.at(0) << "/"
524  << secIDs.at(1) << "/"
525  << secIDs.at(2));
526 }
527 
528 
529 
530 template <class FilterType> void RawSecMapMergerModule::add4HitFilters(
531  VXDTFFilters<SpacePoint>& /*filterContainer*/, SubGraph<FilterType>& /*subGraph*/,
532  const SectorMapConfig& /*config*/)
533 {
534 
535 }
536 
537 
538 
539 
540 
541 
542 
543 
Belle2::SectorGraph
contains all subgraphs.
Definition: SectorGraph.h:38
Belle2::VxdID
Class to uniquely identify a any structure of the PXD and SVD.
Definition: VxdID.h:43
Belle2::VXDTFFilters
Class that contains all the static sectors to which the filters are attached.
Definition: VXDTFFilters.h:75
REG_MODULE
#define REG_MODULE(moduleName)
Register the given module (without 'Module' suffix) with the framework.
Definition: Module.h:652
Belle2::SectorGraph::print
std::string print(bool fullPrint=true) const
returns a string giving an overview of the graph.
Definition: SectorGraph.h:83
Belle2::SectorGraph::size
unsigned size() const
returns number of collected subgraphs so far.
Definition: SectorGraph.h:62
Belle2::SectorGraph::find
Iterator find(SubGraphID idChain)
find entry.
Definition: SectorGraph.h:53
Belle2::filter
std::map< ExpRun, std::pair< double, double > > filter(const std::map< ExpRun, std::pair< double, double >> &runs, double cut, std::map< ExpRun, std::pair< double, double >> &runsRemoved)
filter events to remove runs shorter than cut, it stores removed runs in runsRemoved
Definition: Splitter.cc:43
Belle2::VXDTFFilters::addTwoHitFilter
int addTwoHitFilter(FullSecID outer, FullSecID inner, const twoHitFilter_t &filter)
adds a two hit filter
Definition: VXDTFFilters.h:187
Belle2::RawSecMapMergerModule
The RawSecMapMergerModule.
Definition: RawSecMapMergerModule.h:58
Belle2::Module
Base class for Modules.
Definition: Module.h:74
Belle2::SelectionVariableNamesToFunctions
std::unordered_map< std::string, typename Variable::functionType > SelectionVariableNamesToFunctions(Belle2::Filter< Variable, Range, Options... >)
Return a map from the SelectionVariable name to the SelectionVariable function of the Variable used i...
Definition: SelectionVariableNamesToFunctions.h:45
Belle2::FullSecID
Class to identify a sector inside of the VXD.
Definition: FullSecID.h:43
Belle2
Abstract base class for different kinds of events.
Definition: MillepedeAlgorithm.h:19
Belle2::SubGraphID::getFullSecIDs
std::vector< FullSecID > getFullSecIDs() const
returns SecIDs coded as FullSecIDs:
Definition: SubGraphID.h:195
Belle2::BranchInterface
simple struct for interfacing the Branch.
Definition: BranchInterface.h:32
Belle2::RootIOUtilities::filterBranches
std::set< std::string > filterBranches(const std::set< std::string > &branchesToFilter, const std::vector< std::string > &branches, const std::vector< std::string > &excludeBranches, int durability, bool quiet=false)
Given a list of input branches and lists of branches to include/exclude, returns a list of branches t...
Definition: RootIOUtilities.cc:25
Belle2::SubGraph
contains all relevant stuff needed for dealing with a subGraph.
Definition: SubGraph.h:40
Belle2::SectorGraph::end
Iterator end()
returns end of subGraphs.
Definition: SectorGraph.h:59
Belle2::VXDTFFilters::setSubLayerIDs
bool setSubLayerIDs(FullSecID sector, int sublayer)
during the trainings phase the sublayer ids have to be updated
Definition: VXDTFFilters.h:339
Belle2::SubGraph::getID
const SubGraphID & getID() const
returns iD of this graph
Definition: SubGraph.h:103
Belle2::VXDTFFilters::addThreeHitFilter
int addThreeHitFilter(FullSecID outer, FullSecID center, FullSecID inner, const threeHitFilter_t &filter)
adds a three hit filter
Definition: VXDTFFilters.h:201
Belle2::SectorMapConfig
simple struct containing all the configuration data needed for the SecMapTrainer.
Definition: SectorMapConfig.h:36
Belle2::SubGraph::getFinalQuantileValues
const std::unordered_map< FilterType, MinMax > & getFinalQuantileValues()
this deletes the old min and max values stored and replaces them with the quantiles to be found.
Definition: SubGraph.h:130
Belle2::SectorGraph::getAllFullSecIDsOfSensor
std::vector< FullSecID > getAllFullSecIDsOfSensor(VxdID sensor)
returns a Vector containing all FullSecIDs found for given sensor.
Definition: SectorGraph.h:230
Belle2::FullSecID::getFullSecString
std::string getFullSecString() const
returns the FullSecID coded as string compatible to secIDs stored in the xml-sectormaps
Definition: FullSecID.cc:119
Belle2::VoidObserver
The most CPU efficient Observer for the VXDTF filter tools (even if useless).
Definition: VoidObserver.h:40
Belle2::SubGraphID::print
std::string print() const
returns string of entries.
Definition: SubGraphID.h:111
Belle2::SubGraphID
stores the ID of a subgraph, which is basically a chain of FullSecID coded as unsigned ints.
Definition: SubGraphID.h:34
Belle2::SectorGraph::add
Iterator add(SubGraphID &newID)
add new subgraph if not added already.
Definition: SectorGraph.h:73