void PushRelabel::run()
{
  initPreflow();
  bool discharged = true;

  uint32_t nOfVertices = network_->getNOfVertices();
  uint32_t source = network_->getSource();

  while (discharged)
  {
    discharged = false;

    for (uint32_t curVertex = 0; curVertex < nOfVertices; curVertex++)
    {
      if (isSaturated (curVertex))
      {
        discharge (curVertex);
        discharged = true;
      }
    }
  }

  for (uint32_t curVertex = 0; curVertex < nOfVertices; curVertex++)
  {
    if (curVertex != source)
    {
      network_->addNetworkFlow (network_->getTubes()(source, curVertex).getFlow());
    }
  }
}
/**
 * Checks if there is One and Only One Cluster in each Silicon Detector
 * This includes a check if a channel is Masked or Saturated
 */
bool TSelectionClass::isOneAndOnlyOneClusterSiliconEvent(){
	bool oneAndOnlyOneClusterInAllSilicon = true;
	for(UInt_t det=0;det<TPlaneProperties::getNSiliconDetectors()&&oneAndOnlyOneClusterInAllSilicon==true;det++){
		bool oneAndOnlyOne = (eventReader->getNClusters(det)==1);
		if(verbosity>10)cout<<"DET "<<det<<": "<<oneAndOnlyOne<<" "<<checkDetMasked(det)<<" "<<isSaturated(det)<<flush;
		oneAndOnlyOne = oneAndOnlyOne && !checkDetMasked(det) && !isSaturated(det);
		oneAndOnlyOneClusterInAllSilicon=oneAndOnlyOneClusterInAllSilicon&&oneAndOnlyOne;
	}
	return oneAndOnlyOneClusterInAllSilicon;
}
Exemple #3
0
 bool isSaturatedAround(size_t x, size_t y) const {
     return isSaturated(getMaxAround(x, y));
 }
Exemple #4
0
 bool isSaturated(size_t x, size_t y) const {
     return isSaturated((*this)(x, y));
 }