Belle II Software development
PXDSVDCutModule.cc
1/**************************************************************************
2 * basf2 (Belle II Analysis Software Framework) *
3 * Author: The Belle II Collaboration *
4 * *
5 * See git log for contributors and copyright holders. *
6 * This file is licensed under LGPL-3.0, see LICENSE.md. *
7 **************************************************************************/
8
9#include "../include/PXDSVDCutModule.h"
10
11#include <vector>
12
13using namespace Belle2;
14
15
16REG_MODULE(PXDSVDCut);
17
19{
20 // Set module properties
21 setDescription("The module to deactivate the SpacePointTrackCandidates with less than *minSVDSPs* SVD SpacePoints.");
23
24 addParam("minSVDSPs", m_minSVDSPs,
25 "Minimum number of SVD SpacePoints to keep a SpacePointTrackCandidate", int(3));
26
27 addParam("SpacePointTrackCandsStoreArrayName", m_SpacePointTrackCandsStoreArrayName,
28 "Name of StoreArray containing the SpacePointTrackCandidates to be estimated.", std::string(""));
29}
30
32{
34}
35
37{
38 // Check each SpacePointTrackCand for its number of SVD SpacePoints
40
41 const std::vector<const Belle2::SpacePoint*> sorted_spacepoints = aTC.getSortedHits();
42 int n_svd_spacepoints = 0;
43
44 for (auto& spacepoint : sorted_spacepoints)
45 if (spacepoint->getType() == VXD::SensorInfoBase::SVD)
46 n_svd_spacepoints++;
47
48 if (n_svd_spacepoints < m_minSVDSPs)
49 aTC.removeRefereeStatus(SpacePointTrackCand::c_isActive);
50
51 }
52}
Base class for Modules.
Definition: Module.h:72
void setDescription(const std::string &description)
Sets the description of the module.
Definition: Module.cc:214
void setPropertyFlags(unsigned int propertyFlags)
Sets the flags for the module properties.
Definition: Module.cc:208
@ c_ParallelProcessingCertified
This module can be run in parallel processing mode safely (All I/O must be done through the data stor...
Definition: Module.h:80
std::string m_SpacePointTrackCandsStoreArrayName
sets the name of the expected StoreArray containing SpacePointTrackCands
void initialize() override
Initializes the Module.
void event() override
Applies the selected quality estimation method for a given set of TCs.
int m_minSVDSPs
Minimum number of SVD SpacePointss to keep a SpacePointTrackCandidate.
PXDSVDCutModule()
Constructor of the module.
StoreArray< SpacePointTrackCand > m_spacePointTrackCands
the storeArray for SpacePointTrackCands as member, is faster than recreating link for each event
Storage for (VXD) SpacePoint-based track candidates.
@ c_isActive
bit 11: SPTC is active (i.e.
bool isRequired(const std::string &name="")
Ensure this array/object has been registered previously.
void addParam(const std::string &name, T &paramVariable, const std::string &description, const T &defaultValue)
Adds a new parameter to the module.
Definition: Module.h:560
#define REG_MODULE(moduleName)
Register the given module (without 'Module' suffix) with the framework.
Definition: Module.h:650
Abstract base class for different kinds of events.