11 #include <tracking/modules/spacePointCreator/SPTCvirtualIPRemoverModule.h>
12 #include <framework/logging/Logger.h>
25 setDescription(
"The quality estimator module for SpacePointTrackCandidates using a circleFit.");
26 setPropertyFlags(c_ParallelProcessingCertified);
28 addParam(
"tcArrayName", m_PARAMtcArrayName,
" sets the name of expected StoreArray with SpacePointTrackCand in it",
string(
""));
30 addParam(
"doCheckOnly", m_PARAMdoCheckOnly,
" if true, no vIP is removed, but only nVIPs are counted.",
bool(
false));
32 addParam(
"maxTCLengthForVIPKeeping", m_PARAMmaxTCLengthForVIPKeeping,
33 "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).",
38 void SPTCvirtualIPRemoverModule::event()
41 B2DEBUG(1,
"\n" <<
"SPTCvirtualIPRemoverModule:event: event " << m_eventCounter <<
"\n");
42 m_nTCsTotal += m_spacePointTrackCands.getEntries();
48 unsigned nHits = aTC.size();
52 const std::vector<const SpacePoint*>& spacePoints = aTC.getHits();
53 for (
unsigned int iSp = 0; iSp < spacePoints.size(); ++iSp) {
55 if (aHit->
getType() == VXD::SensorInfoBase::SensorType::VXD) {
58 if (m_PARAMdoCheckOnly or (m_PARAMmaxTCLengthForVIPKeeping + 1 >= nHits))
continue;
60 aTC.removeSpacePoint(iSp);
66 B2DEBUG(1,
"SPTCvirtualIPRemoverModule:event: event " << m_eventCounter
69 <<
" hits has vIP: " << (hasVIP ?
"true" :
"false")
70 <<
" and was removed " << (m_PARAMdoCheckOnly ?
"false" :
"true")
78 void SPTCvirtualIPRemoverModule::endRun()
80 if (m_eventCounter == 0) { m_eventCounter++; }
81 double invEvents = 1. / m_eventCounter;
83 B2DEBUG(1,
"SPTCvirtualIPRemoverModule:endRun: events: " << m_eventCounter
84 <<
", nSPTCsPerEvent: " << invEvents *
float(m_nTCsTotal)
85 <<
", nVIPsPerEvent: " << invEvents *
float(m_nVIPsTotal)
86 <<
", nVIPsRemovedPerEvent: " << invEvents *
float(m_nVIPsRemoved)