Belle II Software development
PXDTrackingEventLevelMdstInfoFillerModule.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 <pxd/modules/pxdMetadata/PXDTrackingEventLevelMdstInfoFillerModule.h>
10
11#include <vxd/dataobjects/VxdID.h>
12
13using namespace Belle2;
14
15REG_MODULE(PXDTrackingEventLevelMdstInfoFiller);
16
18{
19 setDescription("This module adds additional global event level information about PXD track finding to the MDST object 'EventLevelTrackingInfo'");
21}
22
23
25{
27 m_eventLevelTrackingInfo.isRequired();
28}
29
30
32{
33
34 // use a simple array for the PXD layers (if geometry is changed then also EventLevelTrackingInfo doesn't work)
35 // index: layer number (shifted by 1)
36 int nClustersPerLayer[2] = {};
37 for (const auto& cluster : m_pxdClusters) {
38 nClustersPerLayer[((int)cluster.getSensorID().getLayerNumber()) - 1]++;
39 }
40
41 if (m_eventLevelTrackingInfo.isValid()) {
42 for (int layer = 0; layer <= 1; layer++) {
43 m_eventLevelTrackingInfo->setNVXDClustersInLayer(layer + 1, 0, nClustersPerLayer[layer]);
44 }
45 }
46}
47
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
StoreObjPtr< EventLevelTrackingInfo > m_eventLevelTrackingInfo
StoreObject to access the event level tracking information.
void event() override
Event processing, create store array.
StoreArray< PXDCluster > m_pxdClusters
StoreArray of PXDClusters.
bool isRequired(const std::string &name="")
Ensure this array/object has been registered previously.
#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.