9 #include <tracking/modules/spacePointCreator/SPTCvirtualIPRemoverModule.h>
10 #include <framework/logging/Logger.h>
23 setDescription(
"The quality estimator module for SpacePointTrackCandidates using a circleFit.");
24 setPropertyFlags(c_ParallelProcessingCertified);
26 addParam(
"tcArrayName", m_PARAMtcArrayName,
" sets the name of expected StoreArray with SpacePointTrackCand in it",
string(
""));
28 addParam(
"doCheckOnly", m_PARAMdoCheckOnly,
" if true, no vIP is removed, but only nVIPs are counted.",
bool(
false));
30 addParam(
"maxTCLengthForVIPKeeping", m_PARAMmaxTCLengthForVIPKeeping,
31 "If you want to keep the vIP only for short TCs, then set this value to the number of hits a TC is maximally allowed to have to not loose its vIP (number of hits without counting the vIP).",
36 void SPTCvirtualIPRemoverModule::event()
39 B2DEBUG(1,
"\n" <<
"SPTCvirtualIPRemoverModule:event: event " << m_eventCounter <<
"\n");
40 m_nTCsTotal += m_spacePointTrackCands.getEntries();
46 unsigned nHits = aTC.size();
50 const std::vector<const SpacePoint*>& spacePoints = aTC.getHits();
51 for (
unsigned int iSp = 0; iSp < spacePoints.size(); ++iSp) {
53 if (aHit->
getType() == VXD::SensorInfoBase::SensorType::VXD) {
56 if (m_PARAMdoCheckOnly or (m_PARAMmaxTCLengthForVIPKeeping + 1 >= nHits))
continue;
58 aTC.removeSpacePoint(iSp);
64 B2DEBUG(1,
"SPTCvirtualIPRemoverModule:event: event " << m_eventCounter
67 <<
" hits has vIP: " << (hasVIP ?
"true" :
"false")
68 <<
" and was removed " << (m_PARAMdoCheckOnly ?
"false" :
"true")
76 void SPTCvirtualIPRemoverModule::endRun()
78 if (m_eventCounter == 0) { m_eventCounter++; }
79 double invEvents = 1. / m_eventCounter;
81 B2DEBUG(1,
"SPTCvirtualIPRemoverModule:endRun: events: " << m_eventCounter
82 <<
", nSPTCsPerEvent: " << invEvents *
float(m_nTCsTotal)
83 <<
", nVIPsPerEvent: " << invEvents *
float(m_nVIPsTotal)
84 <<
", nVIPsRemovedPerEvent: " << invEvents *
float(m_nVIPsRemoved)
A module for checking and removing the virtual IP if wanted.
Storage for (VXD) SpacePoint-based track candidates.
SpacePoint typically is build from 1 PXDCluster or 1-2 SVDClusters.
Belle2::VXD::SensorInfoBase::SensorType getType() const
Return SensorType (PXD, SVD, ...) on which the SpacePoint lives.
#define REG_MODULE(moduleName)
Register the given module (without 'Module' suffix) with the framework.
Abstract base class for different kinds of events.