Belle II Software  release-06-01-15
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 <framework/datastore/DataStore.h>
13 //#include <framework/datastore/StoreObjPtr.h>
14 //#include <framework/datastore/StoreArray.h>
15 //#include <framework/datastore/RelationArray.h>
16 
17 //#include <framework/dataobjects/FileMetaData.h>
18 
19 using namespace std;
20 using namespace Belle2;
21 using namespace Belle2::PXD;
22 
23 
24 
25 //-----------------------------------------------------------------
26 // Register the Module
27 //-----------------------------------------------------------------
28 REG_MODULE(PXDPerformance)
29 
30 
31 //-----------------------------------------------------------------
32 // Implementation
33 //-----------------------------------------------------------------
34 
36  Module()
37 {
38  //Set module properties
39  setDescription("PXD performance module");
40  setPropertyFlags(c_ParallelProcessingCertified); // specify this flag if you need parallel processing
41 
42  addParam("pxdClustersFromTracksName", m_storeClustersFromTracksName, "name of StoreArray with PXD track cluster",
43  std::string("PXDClustersFromTracks"));
44 }
45 
46 PXDPerformanceModule::~PXDPerformanceModule()
47 {
48 }
49 
50 void PXDPerformanceModule::initialize()
51 {
52  //Required data stores
53  m_pxdClustersFromTracks.isRequired(m_storeClustersFromTracksName);
54  m_tracks.isRequired(m_storeTracksName);
55  m_recoTracks.isRequired(m_storeRecoTracksName);
56  m_pxdIntercepts.isRequired(m_storeRecoTracksName);
57 
58  // Add new StoreArrays
59  m_pxd2TrackEvents.registerInDataStore(DataStore::c_ErrorIfAlreadyRegistered);
60 
61 }
62 
63 void PXDPerformanceModule::beginRun()
64 {
65  B2DEBUG(20, "||| PXDPerformanceModule Parameters:");
66  B2DEBUG(20, " PXDClustersFromTracksName = " << m_storeClustersFromTracksName);
67  B2DEBUG(20, " PXDInterceptsName = " << m_storeInterceptsName);
68  B2DEBUG(20, " RecoTracksName = " << m_storeRecoTracksName);
69  B2DEBUG(20, " TracksName = " << m_storeTracksName);
70 }
71 
72 void PXDPerformanceModule::event()
73 {
74  PXD2TrackEvent eventHolder;
75  B2DEBUG(20, "PXD2TrackEvent created");
76  bool good = eventHolder.setValues(m_recoTracks,
77  m_storeRecoTracksName,
78  m_storeInterceptsName,
79  m_storeClustersFromTracksName
80  );
81  B2DEBUG(20, "PXD2TrackEvent update status: " << good);
82  if (good) {
83  m_pxd2TrackEvents.appendNew(eventHolder);
84  B2DEBUG(20, "PXD2TrackEvent is appended.");
85  }
86 
87 }
88 
89 void PXDPerformanceModule::endRun()
90 {
91 }
92 
93 
94 void PXDPerformanceModule::terminate()
95 {
96 }
Base class for Modules.
Definition: Module.h:72
Class PXD2TrackEvent: Event data container for performance and calibration studies.
#define REG_MODULE(moduleName)
Register the given module (without 'Module' suffix) with the framework.
Definition: Module.h:650
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.