Belle II Software development
CDCMCManager Class Reference

Class to organize and present the Monte Carlo hit information. More...

#include <CDCMCManager.h>

Public Member Functions

 CDCMCManager (CDCMCManager &)=delete
 Singleton: Delete copy constructor and assignment operator.
 
CDCMCManageroperator= (const CDCMCManager &)=delete
 Operator =.
 
void requireTruthInformation ()
 Require the MC information store arrays.
 
void clear ()
 Clears all Monte Carlo information present in the last event.
 
void fill ()
 Fill Monte Carlo look up maps from the DataStore.
 

Static Public Member Functions

static CDCMCManagergetInstance ()
 Getter for the singleton instance.
 
static const CDCMCMapgetMCMap ()
 Getter for the singleton instance of the CDCMCMap.
 
static const CDCMCTrackStoregetMCTrackStore ()
 Getter for the singleton instance of the CDCMCTrackStore.
 
static const CDCSimHitLookUpgetSimHitLookUp ()
 Getter for the singleton instance of the CDCSimHitLookUp.
 
static const CDCMCHitLookUpgetMCHitLookUp ()
 Getter for the singleton instance of the CDCMCHitLookUp.
 
static const CDCMCSegment2DLookUpgetMCSegment2DLookUp ()
 Getter for the singleton instance of the CDCMCSegment2DLookUp.
 
static const CDCMCSegment3DLookUpgetMCSegment3DLookUp ()
 Getter for the singleton instance of the CDCMCSegment3DLookUp.
 
static const CDCMCTrackLookUpgetMCTrackLookUp ()
 Getter for the singleton instance of the CDCMCTrackLookUp.
 

Private Member Functions

 CDCMCManager ()=default
 Default constructor only accessible for getInstance()
 

Private Attributes

EventMetaData m_eventMetaData = EventMetaData(-999, -999, -999)
 Memory for the event, run and experiment number corresponding to the currently stored data.
 

Detailed Description

Class to organize and present the Monte Carlo hit information.

Definition at line 29 of file CDCMCManager.h.

Member Function Documentation

◆ clear()

void clear ( )

Clears all Monte Carlo information present in the last event.

Definition at line 123 of file CDCMCManager.cc.

124{
125 ::getMCTrackLookUpInstance().clear();
126 ::getMCSegment3DLookUpInstance().clear();
127 ::getMCSegment2DLookUpInstance().clear();
128 //::getMCHitLookUpInstance().clear(); // Currently has no clear
129
130 ::getMCTrackStoreInstance().clear();
131 ::getSimHitLookUpInstance().clear();
132 ::getMCMapInstance().clear();
133}

◆ fill()

void fill ( )

Fill Monte Carlo look up maps from the DataStore.

Definition at line 135 of file CDCMCManager.cc.

136{
137 StoreObjPtr<EventMetaData> storedEventMetaData;
138
139 if (storedEventMetaData.isValid()) {
140 if (m_eventMetaData == *storedEventMetaData) {
141 // Instance has already been filled with the current event
142 return;
143 }
144 }
145
146 clear();
147
148 ::getMCMapInstance().fill();
149 const CDCMCMap* ptrMCMap = &getMCMap();
150 ::getSimHitLookUpInstance().fill(ptrMCMap);
151
152 const CDCSimHitLookUp* ptrSimHitLookUp = &getSimHitLookUp();
153 ::getMCTrackStoreInstance().fill(ptrMCMap, ptrSimHitLookUp);
154
155 if (storedEventMetaData.isValid()) {
156 //after filling store the event numbers
157 m_eventMetaData = *storedEventMetaData;
158 }
159}
Type-safe access to single objects in the data store.
Definition: StoreObjPtr.h:96
bool isValid() const
Check whether the object was created.
Definition: StoreObjPtr.h:111
static const CDCSimHitLookUp & getSimHitLookUp()
Getter for the singleton instance of the CDCSimHitLookUp.
Definition: CDCMCManager.cc:90
EventMetaData m_eventMetaData
Memory for the event, run and experiment number corresponding to the currently stored data.
Definition: CDCMCManager.h:78
void clear()
Clears all Monte Carlo information present in the last event.
static const CDCMCMap & getMCMap()
Getter for the singleton instance of the CDCMCMap.
Definition: CDCMCManager.cc:80
Class to organize and present the Monte Carlo hit information.
Definition: CDCMCMap.h:28
Singletone class to gather local information about the hits.

◆ getInstance()

CDCMCManager & getInstance ( )
static

Getter for the singleton instance.

Definition at line 74 of file CDCMCManager.cc.

75{
76 static CDCMCManager mcManager;
77 return mcManager;
78}
Class to organize and present the Monte Carlo hit information.
Definition: CDCMCManager.h:29

◆ getMCHitLookUp()

const CDCMCHitLookUp & getMCHitLookUp ( )
static

Getter for the singleton instance of the CDCMCHitLookUp.

Definition at line 95 of file CDCMCManager.cc.

96{
97 return ::getMCHitLookUpInstance();
98}

◆ getMCMap()

const CDCMCMap & getMCMap ( )
static

Getter for the singleton instance of the CDCMCMap.

Definition at line 80 of file CDCMCManager.cc.

81{
82 return ::getMCMapInstance();
83}

◆ getMCSegment2DLookUp()

const CDCMCSegment2DLookUp & getMCSegment2DLookUp ( )
static

Getter for the singleton instance of the CDCMCSegment2DLookUp.

Definition at line 100 of file CDCMCManager.cc.

101{
102 return ::getMCSegment2DLookUpInstance();
103}

◆ getMCSegment3DLookUp()

const CDCMCSegment3DLookUp & getMCSegment3DLookUp ( )
static

Getter for the singleton instance of the CDCMCSegment3DLookUp.

Definition at line 105 of file CDCMCManager.cc.

106{
107 return ::getMCSegment3DLookUpInstance();
108}

◆ getMCTrackLookUp()

const CDCMCTrackLookUp & getMCTrackLookUp ( )
static

Getter for the singleton instance of the CDCMCTrackLookUp.

Definition at line 110 of file CDCMCManager.cc.

111{
112 return ::getMCTrackLookUpInstance();
113}

◆ getMCTrackStore()

const CDCMCTrackStore & getMCTrackStore ( )
static

Getter for the singleton instance of the CDCMCTrackStore.

Definition at line 85 of file CDCMCManager.cc.

86{
87 return ::getMCTrackStoreInstance();
88}

◆ getSimHitLookUp()

const CDCSimHitLookUp & getSimHitLookUp ( )
static

Getter for the singleton instance of the CDCSimHitLookUp.

Definition at line 90 of file CDCMCManager.cc.

91{
92 return ::getSimHitLookUpInstance();
93}

◆ requireTruthInformation()

void requireTruthInformation ( )

Require the MC information store arrays.

Definition at line 115 of file CDCMCManager.cc.

116{
117 StoreArray <CDCSimHit> cdcSimHits;
118 cdcSimHits.isRequired();
119 StoreArray <MCParticle> mcParticles;
120 mcParticles.isRequired();
121}
bool isRequired(const std::string &name="")
Ensure this array/object has been registered previously.

Member Data Documentation

◆ m_eventMetaData

EventMetaData m_eventMetaData = EventMetaData(-999, -999, -999)
private

Memory for the event, run and experiment number corresponding to the currently stored data.

Definition at line 78 of file CDCMCManager.h.


The documentation for this class was generated from the following files: