Belle II Software development
SVDTrackingEventLevelMdstInfoFillerModule.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 <svd/modules/svdMetadata/SVDTrackingEventLevelMdstInfoFillerModule.h>
10
11#include <vxd/dataobjects/VxdID.h>
12
13using namespace Belle2;
14
15REG_MODULE(SVDTrackingEventLevelMdstInfoFiller);
16
18{
19 setDescription("This module adds additional global event level information about SVD track finding to the MDST object 'EventLevelTrackingInfo'");
21
22 addParam("EventLevelTrackingInfoName",
24 "Name of the EventLevelTrackingInfo that should be used (different one for ROI-finding).",
26
27 addParam("svdClustersName",
29 "Name of the SVDClusters that should be used (different one for ROI-finding).",
31}
32
33
35{
38}
39
40
42{
43 // use a simple array for the SVD layers (if geometry is changed then also EventLevelTrackingInfo doesn't work)
44 // first index: layer number (shifted by 3), second index: isU
45 int nClustersPerLayer[4][2] = {};
46 for (const auto& cluster : m_svdClusters) {
47 nClustersPerLayer[((int)cluster.getSensorID().getLayerNumber()) - 3][(int)cluster.isUCluster()]++;
48 }
49
50 if (m_eventLevelTrackingInfo.isValid()) {
51 for (int layer = 0; layer <= 3; layer++) {
52 for (int isU = 0; isU <= 1; isU++) {
53 m_eventLevelTrackingInfo->setNVXDClustersInLayer(layer + 3, isU, nClustersPerLayer[layer][isU]);
54 }
55 }
56
57 }
58}
59
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_eventLevelTrackingInfoName
Name of the StoreObject to access the event level tracking information.
StoreObjPtr< EventLevelTrackingInfo > m_eventLevelTrackingInfo
StoreObject to access the event level tracking information.
StoreArray< SVDCluster > m_svdClusters
StoreArray of SVDClusters.
void event() override
Event processing, create store array.
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.