Belle II Software  release-05-01-25
PXDSVDCutModule.cc
1 /**************************************************************************
2  * BASF2 (Belle Analysis Framework 2) *
3  * Copyright(C) 2017 - Belle II Collaboration *
4  * *
5  * Author: The Belle II Collaboration *
6  * Contributors: Sebastian Racs *
7  * *
8  * This software is provided "as is" without any warranty. *
9  **************************************************************************/
10 
11 #include "../include/PXDSVDCutModule.h"
12 
13 #include <vector>
14 
15 using namespace Belle2;
16 
17 
18 REG_MODULE(PXDSVDCut)
19 
21 {
22  // Set module properties
23  setDescription("The module to deactivate the SpacePointTrackCandidates with less than *minSVDSPs* SVD SpacePoints.");
24  setPropertyFlags(c_ParallelProcessingCertified);
25 
26  addParam("minSVDSPs", m_minSVDSPs,
27  "Minimum number of SVD SpacePoints to keep a SpacePointTrackCandidate", int(3));
28 
29  addParam("SpacePointTrackCandsStoreArrayName", m_SpacePointTrackCandsStoreArrayName,
30  "Name of StoreArray containing the SpacePointTrackCandidates to be estimated.", std::string(""));
31 }
32 
34 {
36 }
37 
39 {
40  // Check each SpacePointTrackCand for its number of SVD SpacePoints
42 
43  const std::vector<const Belle2::SpacePoint*> sorted_spacepoints = aTC.getSortedHits();
44  int n_svd_spacepoints = 0;
45 
46  for (auto& spacepoint : sorted_spacepoints)
47  if (spacepoint->getType() == VXD::SensorInfoBase::SVD)
48  n_svd_spacepoints++;
49 
50  if (n_svd_spacepoints < m_minSVDSPs)
51  aTC.removeRefereeStatus(SpacePointTrackCand::c_isActive);
52 
53  }
54 }
Belle2::PXDSVDCutModule::initialize
void initialize() override
Initializes the Module.
Definition: PXDSVDCutModule.cc:33
REG_MODULE
#define REG_MODULE(moduleName)
Register the given module (without 'Module' suffix) with the framework.
Definition: Module.h:652
Belle2::SpacePointTrackCand::c_isActive
@ c_isActive
bit 11: SPTC is active (i.e.
Definition: SpacePointTrackCand.h:94
Belle2::PXDSVDCutModule::m_spacePointTrackCands
StoreArray< SpacePointTrackCand > m_spacePointTrackCands
the storeArray for SpacePointTrackCands as member, is faster than recreating link for each event
Definition: PXDSVDCutModule.h:67
Belle2::Module
Base class for Modules.
Definition: Module.h:74
Belle2::PXDSVDCutModule::event
void event() override
Applies the selected quality estimation method for a given set of TCs.
Definition: PXDSVDCutModule.cc:38
Belle2
Abstract base class for different kinds of events.
Definition: MillepedeAlgorithm.h:19
Belle2::PXDSVDCutModule::m_SpacePointTrackCandsStoreArrayName
std::string m_SpacePointTrackCandsStoreArrayName
sets the name of the expected StoreArray containing SpacePointTrackCands
Definition: PXDSVDCutModule.h:62
Belle2::VXD::SensorInfoBase::SVD
@ SVD
SVD Sensor.
Definition: SensorInfoBase.h:45
Belle2::PXDSVDCutModule::m_minSVDSPs
int m_minSVDSPs
Minimum number of SVD SpacePointss to keep a SpacePointTrackCandidate.
Definition: PXDSVDCutModule.h:59
Belle2::PXDSVDCutModule
The module to deactivate the SpacePointTrackCandidates with less than minSVDSPs SVD SpacePoints.
Definition: PXDSVDCutModule.h:40
Belle2::SpacePointTrackCand
Storage for (VXD) SpacePoint-based track candidates.
Definition: SpacePointTrackCand.h:51