Belle II Software  release-05-02-19
PXDPerformanceModule.cc
1 /**************************************************************************
2  * BASF2 (Belle Analysis Framework 2) *
3  * Copyright(C) 2021 - Belle II Collaboration *
4  * *
5  * Author: The Belle II Collaboration *
6  * Contributors: Qingyuan Liu *
7  * *
8  * This software is provided "as is" without any warranty. *
9  **************************************************************************/
10 
11 #include <pxd/modules/pxdPerformance/PXDPerformanceModule.h>
12 //#include <pxd/utilities/PXD2TrackEvent.h>
13 
14 //#include <framework/datastore/DataStore.h>
15 //#include <framework/datastore/StoreObjPtr.h>
16 //#include <framework/datastore/StoreArray.h>
17 //#include <framework/datastore/RelationArray.h>
18 
19 //#include <framework/dataobjects/FileMetaData.h>
20 
21 using namespace std;
22 using namespace Belle2;
23 using namespace Belle2::PXD;
24 
25 
26 
27 //-----------------------------------------------------------------
28 // Register the Module
29 //-----------------------------------------------------------------
30 REG_MODULE(PXDPerformance)
31 
32 
33 //-----------------------------------------------------------------
34 // Implementation
35 //-----------------------------------------------------------------
36 
38  Module()
39 {
40  //Set module properties
41  setDescription("PXD performance module");
42  setPropertyFlags(c_ParallelProcessingCertified); // specify this flag if you need parallel processing
43 
44  addParam("pxdClustersFromTracksName", m_storeClustersFromTracksName, "name of StoreArray with PXD track cluster",
45  std::string("PXDClustersFromTracks"));
46 }
47 
48 PXDPerformanceModule::~PXDPerformanceModule()
49 {
50 }
51 
52 void PXDPerformanceModule::initialize()
53 {
54  //Required data stores
55  m_pxdClustersFromTracks.isRequired(m_storeClustersFromTracksName);
56  m_tracks.isRequired(m_storeTracksName);
57  m_recoTracks.isRequired(m_storeRecoTracksName);
58  m_pxdIntercepts.isRequired(m_storeRecoTracksName);
59 
60  // Add new StoreArrays
61  m_pxd2TrackEvents.registerInDataStore(DataStore::c_ErrorIfAlreadyRegistered);
62 
63 }
64 
65 void PXDPerformanceModule::beginRun()
66 {
67  B2DEBUG(20, "||| PXDPerformanceModule Parameters:");
68  B2DEBUG(20, " PXDClustersFromTracksName = " << m_storeClustersFromTracksName);
69  B2DEBUG(20, " PXDInterceptsName = " << m_storeInterceptsName);
70  B2DEBUG(20, " RecoTracksName = " << m_storeRecoTracksName);
71  B2DEBUG(20, " TracksName = " << m_storeTracksName);
72 }
73 
74 void PXDPerformanceModule::event()
75 {
76  PXD2TrackEvent eventHolder;
77  B2DEBUG(1, "PXD2TrackEvent created");
78  bool good = eventHolder.setValues(m_recoTracks,
79  m_storeRecoTracksName,
80  m_storeInterceptsName,
81  m_storeClustersFromTracksName
82  );
83  B2DEBUG(1, "PXD2TrackEvent update status: " << good);
84  if (good) {
85  m_pxd2TrackEvents.appendNew(eventHolder);
86  B2DEBUG(1, "PXD2TrackEvent is appended.");
87  }
88 
89 }
90 
91 void PXDPerformanceModule::endRun()
92 {
93 }
94 
95 
96 void PXDPerformanceModule::terminate()
97 {
98 }
Belle2::PXD2TrackBase::setValues
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.
Definition: PXD2TrackBase.h:108
REG_MODULE
#define REG_MODULE(moduleName)
Register the given module (without 'Module' suffix) with the framework.
Definition: Module.h:652
Belle2::PXDPerformanceModule
PXD Performance module.
Definition: PXDPerformanceModule.h:55
Belle2::Module
Base class for Modules.
Definition: Module.h:74
Belle2::PXD
Namespace to encapsulate code needed for simulation and reconstrucion of the PXD.
Definition: PXDCalibrationUtilities.h:28
Belle2
Abstract base class for different kinds of events.
Definition: MillepedeAlgorithm.h:19
Belle2::PXD2TrackEvent
Class PXD2TrackEvent: Event data container for performance and calibration studies.
Definition: PXD2TrackEvent.h:41