Skip to content
Snippets Groups Projects

Use new counters

Merged Sebastien Ponce requested to merge sponce_useNewCounters into master
2 files
+ 18
18
Compare changes
  • Side-by-side
  • Inline
Files
2
@@ -15,7 +15,7 @@ STClusterKiller::STClusterKiller( const std::string& name,
{
declareProperty("SelectorType", m_selectorType = "STSelectClustersByChannel");
declareSTConfigProperty("InputLocation",m_inputLocation, STClusterLocation::TTClusters);
declareSTConfigProperty("InputLocation",m_inputLocation, STClusterLocation::TTClusters);
declareSTConfigProperty("SelectorName", m_selectorName, detType()+"Killer");
}
@@ -33,16 +33,16 @@ StatusCode STClusterKiller::initialize()
StatusCode STClusterKiller::execute()
{
STClusters* clusterCont = get<STClusters>(m_inputLocation);
// make list of clusters to remove
std::vector<STChannelID> chanList; chanList.reserve(100);
removedClusters(clusterCont,chanList);
// remove from the container
std::vector<STChannelID>::reverse_iterator iterVec = chanList.rbegin();
std::vector<STChannelID>::reverse_iterator iterVec = chanList.rbegin();
for (; iterVec != chanList.rend(); ++iterVec){
clusterCont->erase(*iterVec);
} // iterVec
@@ -61,25 +61,23 @@ void STClusterKiller::removedClusters(const LHCb::STClusters* clusterCont,
const bool select = (*m_clusterSelector)(*iterC);
if (select == true){;
deadClusters.push_back((*iterC)->key());
++counter("Dead");
++m_deadCnt;
}
++counter("Processed");
++m_processedCnt;
} // iterC
}
StatusCode STClusterKiller::finalize() {
const double dead = counter("Dead").flag();
const double processed = counter("Processed").flag();
const double dead = m_deadCnt.nEntries();
const double processed = m_processedCnt.nEntries();
double killed = 0.0;
if (!LHCb::Math::Equal_To<double>()(processed, 0.0)){
killed = dead/processed;
double killed = 0.0;
if (!LHCb::Math::Equal_To<double>()(processed, 0.0)){
killed = dead/processed;
}
info() << "Fraction of clusters killed " << 100* killed << " %" << endmsg;
return ST::AlgBase::finalize();
}
Loading