Belle II Software  release-08-01-10
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 
35 PXDPerformanceModule::PXDPerformanceModule() :
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 
47 {
48 }
49 
51 {
52  //Required data stores
54  m_tracks.isRequired(m_storeTracksName);
57 
58  // Add new StoreArrays
60 
61 }
62 
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 
73 {
74  PXD2TrackEvent eventHolder;
75  B2DEBUG(20, "PXD2TrackEvent created");
76  bool good = eventHolder.setValues(m_recoTracks,
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 
90 {
91 }
92 
93 
95 {
96 }
@ c_ErrorIfAlreadyRegistered
If the object/array was already registered, produce an error (aborting initialisation).
Definition: DataStore.h:72
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
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.
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
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.