Belle II Software development
PXDPerformanceModule.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/pxdPerformance/PXDPerformanceModule.h>
10#include <pxd/utilities/PXD2TrackEvent.h>
11
12#include <pxd/dataobjects/PXDCluster.h>
13#include <mdst/dataobjects/Track.h>
14#include <tracking/dataobjects/RecoTrack.h>
15#include <tracking/dataobjects/PXDIntercept.h>
16
17using namespace std;
18using namespace Belle2;
19using namespace Belle2::PXD;
20
21
22
23//-----------------------------------------------------------------
24// Register the Module
25//-----------------------------------------------------------------
26REG_MODULE(PXDPerformance);
27
28
29//-----------------------------------------------------------------
30// Implementation
31//-----------------------------------------------------------------
32
34 Module()
35{
36 //Set module properties
37 setDescription("PXD performance module");
38 setPropertyFlags(c_ParallelProcessingCertified); // specify this flag if you need parallel processing
39
40 addParam("pxdClustersFromTracksName", m_storeClustersFromTracksName, "name of StoreArray with PXD track cluster",
41 std::string("PXDClustersFromTracks"));
42}
43
47
49{
50 //Required data stores
52 m_tracks.isRequired(m_storeTracksName);
55
56 // Add new StoreArrays
58
59}
60
62{
63 B2DEBUG(20, "||| PXDPerformanceModule Parameters:");
64 B2DEBUG(20, " PXDClustersFromTracksName = " << m_storeClustersFromTracksName);
65 B2DEBUG(20, " PXDInterceptsName = " << m_storeInterceptsName);
66 B2DEBUG(20, " RecoTracksName = " << m_storeRecoTracksName);
67 B2DEBUG(20, " TracksName = " << m_storeTracksName);
68}
69
71{
72 PXD2TrackEvent eventHolder;
73 B2DEBUG(20, "PXD2TrackEvent created");
74 bool good = eventHolder.setValues(m_recoTracks,
78 );
79 B2DEBUG(20, "PXD2TrackEvent update status: " << good);
80 if (good) {
81 m_pxd2TrackEvents.appendNew(eventHolder);
82 B2DEBUG(20, "PXD2TrackEvent is appended.");
83 }
84
85}
86
90
91
@ c_ErrorIfAlreadyRegistered
If the object/array was already registered, produce an error (aborting initialisation).
Definition DataStore.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
Module()
Constructor.
Definition Module.cc:30
@ 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
Class PXD2TrackEvent: Event data container for performance and calibration studies.
StoreArray< PXD2TrackEvent > m_pxd2TrackEvents
Output PXD2TrackEvent.
std::string m_storeRecoTracksName
Name of the collection to use for RecoTracks.
std::string m_storeTracksName
Name of the collection to use for Tracks.
virtual void initialize() override
Initialize module.
virtual void event() override
Event processing.
std::string m_storeInterceptsName
Name of the collection to use for PXDIntercepts.
virtual void endRun() override
End-of-run tasks.
virtual void terminate() override
Final summary and cleanup.
StoreArray< PXDIntercept > m_pxdIntercepts
Required input PXDIntercepts.
StoreArray< PXDCluster > m_pxdClustersFromTracks
Required input PXDClustersFromTracks.
virtual void beginRun() override
Start-of-run initializations.
StoreArray< Track > m_tracks
Required input Tracks.
std::string m_storeClustersFromTracksName
Name of the collection to use for PXDClustersFromTracks.
StoreArray< RecoTrack > m_recoTracks
Required input RecoTracks.
virtual ~PXDPerformanceModule()
Destructor.
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:559
#define REG_MODULE(moduleName)
Register the given module (without 'Module' suffix) with the framework.
Definition Module.h:649
virtual bool setValues(const StoreArray< RecoTrack > &recoTracks, const std::string &recoTracksName="", const std::string &pxdInterceptsName="", const std::string &pxdTrackClustersName="PXDClustersFromTracks")
Set values from RecoTrack collection.
Namespace to encapsulate code needed for simulation and reconstrucion of the PXD.
Abstract base class for different kinds of events.
STL namespace.