Belle II Software  release-08-01-10
StoreAccessorBase Class Reference

Base class for StoreObjPtr and StoreArray for easier common treatment. More...

#include <StoreAccessorBase.h>

Inherited by StoreArray< Belle2::BeamabortHit >, StoreArray< Belle2::KLMMuidHit >, StoreArray< Belle2::TRGECLBGTCHit >, StoreArray< Belle2::TOPTimeZero >, StoreArray< Belle2::SVDIntercept >, StoreArray< Belle2::SVDDAQDiagnostic >, StoreArray< Belle2::OnlineEventT0 >, StoreArray< Belle2::V0ValidationVertex >, StoreArray< Belle2::FlavorTaggerInfoMap >, StoreArray< Belle2::TRGECLCluster >, StoreArray< genfit::Track >, StoreArray< Belle2::CDCTriggerTrack >, StoreArray< Belle2::PXDSimHit >, StoreArray< Belle2::ECLDigit >, StoreArray< Belle2::RecoTrack >, StoreArray< Belle2::ARICHAeroHit >, StoreArray< Belle2::ExtHit >, StoreArray< SVDCluster >, StoreArray< Belle2::DosiHit >, StoreArray< Belle2::VXDDedxTrack >, StoreArray< SimHitClass >, StoreArray< Belle2::TRGTOPTimeStampsSlot >, StoreArray< Belle2::TRGECLTiming >, StoreArray< Belle2::TOPSimPhoton >, StoreArray< Belle2::StringWrapper >, StoreArray< Belle2::FlavorTaggerInfo >, StoreArray< Belle2::ECLDebugHit >, StoreArray< Belle2::RawDataBlock >, StoreArray< Belle2::CDCRawHit >, StoreArray< Belle2::RawCDC >, StoreArray< Belle2::FANGSSimHit >, StoreArray< Belle2::SVDCluster >, StoreArray< Belle2::ECLDsp >, StoreArray< Belle2::KLMDigit >, StoreArray< Belle2::V0 >, StoreArray< Belle2::TOPProductionHitDebug >, StoreArray< Belle2::TOPSlowData >, StoreArray< TObject >, StoreArray< Belle2::HE3G4TrackInfo >, StoreArray< Belle2::CDCDedxLikelihood >, StoreArray< Belle2::Btube >, StoreArray< Belle2::KLMHit2d >, StoreArray< Belle2::ARICHDigit >, StoreArray< Belle2::PlumeHit >, StoreArray< Belle2::TRGECLDigi0 >, StoreArray< Belle2::TOPAssociatedPDF >, StoreArray< Belle2::TPCG4TrackInfo >, StoreArray< Belle2::TOPSimCalPulse >, StoreArray< Belle2::ECLTriggerCell >, StoreArray< Belle2::ECLDspWithExtraMCInfo >, StoreArray< Belle2::CDCTriggerFinderClone >, StoreArray< Belle2::RawTRG >, StoreArray< Belle2::CDCRawHitWaveForm >, StoreArray< Belle2::PlumeSimHit >, StoreArray< Belle2::TOPDigit >, StoreArray< Belle2::ARICHInfo >, StoreArray< MCParticle >, StoreArray< Belle2::QcsmonitorHit >, StoreArray< Belle2::ClawsHit >, StoreArray< TSFOutputBitStream >, StoreArray< Belle2::TRGTOPSlotTiming >, StoreArray< Belle2::TRGECLUnpackerSumStore >, StoreArray< Belle2::TRGCDCETFUnpackerStore >, StoreArray< Belle2::TOPPull >, StoreArray< Belle2::TOPRawWaveform >, StoreArray< genfit::TrackCand >, StoreArray< Belle2::ECLPidLikelihood >, StoreArray< Belle2::RawECL >, StoreArray< Belle2::RawSVD >, StoreArray< Bitstream< MergerBus > >, StoreArray< Belle2::ECLHit >, StoreArray< Belle2::CDCSimHit >, StoreArray< Belle2::Particle >, StoreArray< Belle2::SpacePointTrackCand >, StoreArray< RecoTrack >, StoreArray< CDCTriggerTrack >, StoreArray< CDCTriggerSegmentHit >, StoreArray< T2DOutputBitStream >, StoreArray< Belle2::TrackClusterSeparation >, StoreArray< Belle2::TRGECLWaveform >, StoreArray< Belle2::RawPXD >, StoreArray< Belle2::PXDDigit >, StoreArray< Belle2::ECLCluster >, StoreArray< Belle2::OverlapNetwork >, StoreArray< Belle2::TOPTemplateFitResult >, StoreArray< Belle2::ObserverInfo >, StoreArray< NNBitStream >, StoreArray< Belle2::VXDDedxLikelihood >, StoreArray< Belle2::BremHit >, StoreArray< Belle2::CDCTriggerSegmentHit >, StoreArray< Belle2::CDCDedxTrack >, StoreArray< Belle2::PIDLikelihood >, StoreArray< Belle2::ClawHit >, StoreArray< Belle2::KlId >, StoreArray< Belle2::RawKLM >, StoreArray< Belle2::CDCTriggerMLPInput >, StoreArray< Belle2::BeamabortSimHit >, StoreArray< Belle2::RecoHitInformation >, StoreArray< Belle2::BKLMTrack >, StoreArray< Belle2::BelleTrkExtra >, StoreArray< Belle2::FANGSHit >, StoreArray< StoredClass >, StoreArray< Belle2::SVDRecoDigit >, StoreArray< Belle2::PXD2TrackEvent >, StoreArray< Belle2::SVDTrueHit >, StoreArray< Belle2::ECLEnergyCloseToTrack >, StoreArray< Belle2::ECLPureCsIInfo >, StoreArray< Belle2::CsiDigiHit >, StoreArray< Belle2::CsiSimHit >, StoreArray< Belle2::BgoSimHit >, StoreArray< Belle2::MCParticle >, StoreArray< Belle2::ARICHSimHit >, StoreArray< Belle2::ARICHTrack >, StoreArray< Belle2::CsiHit_v2 >, StoreArray< Belle2::TagVertex >, StoreArray< Belle2::PXDRawROIs >, StoreArray< Belle2::KLMMuidLikelihood >, StoreArray< Belle2::RestOfEvent >, StoreArray< Belle2::TRGECLUnpackerEvtStore >, StoreArray< Belle2::ECLLocalMaximum >, StoreArray< Belle2::ECLConnectedRegion >, StoreArray< Belle2::RawARICH >, StoreArray< Belle2::RawCOPPER >, StoreArray< Belle2::KLMCluster >, StoreArray< CDCTriggerMLPInput >, StoreArray< Belle2::TRGTOPWaveFormTimeStamp >, StoreArray< Belle2::TOPInterimFEInfo >, StoreArray< Belle2::TOPLikelihoodScanResult >, StoreArray< Belle2::TRGECLDigi0MC >, StoreArray< Belle2::PXDTrueHit >, StoreArray< Belle2::ECLTrig >, StoreArray< Belle2::ECLShower >, StoreArray< Belle2::ECLSimHit >, StoreArray< Belle2::KLMDigitEventInfo >, StoreArray< Belle2::KLMDigitRaw >, StoreArray< Belle2::RawFTSW >, StoreArray< PXDCluster >, StoreArray< Belle2::TRGECLTrg >, StoreArray< Belle2::TRGECLFAMAna >, StoreArray< Belle2::TOPProductionEventDebug >, StoreArray< Belle2::EKLMAlignmentHit >, StoreArray< Belle2::KLMScintillatorFirmwareFitResult >, StoreArray< Belle2::Cluster >, StoreArray< Belle2::AWESOMESimHit >, StoreArray< Belle2::BgoHit >, StoreArray< Belle2::TRGECLHit >, StoreArray< Belle2::TRGCDCT3DUnpackerStore >, StoreArray< Belle2::TOPPixelLikelihood >, StoreArray< Belle2::SADMetaHit >, StoreArray< Belle2::KLMClusterShape >, StoreArray< Belle2::BeamBackHit >, StoreArray< Belle2::CDCTriggerHoughCluster >, StoreArray< Belle2::QcsmonitorSimHit >, StoreArray< Belle2::ARICHHit >, StoreArray< Belle2::TRGTOPCombinedT0Decision >, StoreArray< Belle2::TRGCDCTSFUnpackerStore >, StoreArray< Belle2::PXDRawAdc >, StoreArray< Belle2::TOPLikelihood >, StoreArray< Belle2::TRGGDLUnpackerStore >, StoreArray< Belle2::Bitstream >, StoreArray< Belle2::MicrotpcSimHit >, StoreArray< Belle2::He3tubeSimHit >, StoreArray< Belle2::CLAWSSimHit >, StoreArray< Belle2::PXDCluster >, StoreArray< Belle2::CDCHit >, StoreArray< TrueHitClass >, StoreArray< Belle2::TOPPDFCollection >, StoreArray< Belle2::TOPBarHit >, StoreArray< Belle2::MCParticleTrajectory >, StoreArray< Belle2::PXDIntercept >, StoreArray< Belle2::PXDRawHit >, StoreArray< Belle2::TRGECLUnpackerStore >, StoreArray< Belle2::ECLCalDigit >, StoreArray< Belle2::ContinuumSuppression >, StoreArray< Belle2::ClawSimHit >, StoreArray< Belle2::SVDShaperDigit >, StoreArray< Belle2::TrackFitResult >, StoreArray< Belle2::Track >, StoreArray< SpacePointTrackCand >, StoreArray< Belle2::MicrotpcHit >, StoreArray< Belle2::He3tubeHit >, StoreArray< Belle2::TRGTOPWaveFormTimeStampsSlot >, StoreArray< Belle2::TRGECLHitMC >, StoreArray< Belle2::SpacePoint >, StoreArray< Belle2::RawTOP >, StoreArray< Belle2::PindiodeSimHit >, StoreArray< Belle2::TOPSimHit >, StoreArray< Belle2::KLMSimHit >, StoreArray< DirectedNodeNetworkContainer >, StoreArray< SpacePoint >, StoreArray< Belle2::PindiodeHit >, StoreArray< Belle2::TRGTOPTimeStamp >, StoreArray< Belle2::TOPRawDigit >, StoreArray< Belle2::ROIid >, StoreArray< Belle2::CsiHit >, StoreArray< Belle2::SVDSimHit >, StoreArray< Belle2::BKLMHit1d >, StoreArray< Belle2::ARICHLikelihood >, StoreObjPtr< Belle2::TRGGRLInfo >, StoreObjPtr< Belle2::StringWrapper >, StoreObjPtr< Belle2::SetMergeable< std::unordered_set< uint64_t > > >, StoreObjPtr< TMatrix >, StoreObjPtr< Belle2::EventMetaData >, StoreObjPtr< BinnedEventT0 >, StoreObjPtr< Belle2::SoftwareTrigger::SoftwareTriggerVariables >, StoreObjPtr< Belle2::ECLCellIdMapping >, StoreObjPtr< Belle2::SimClockState >, StoreObjPtr< Belle2::PXDDAQStatus >, StoreObjPtr< Belle2::EventKinematics >, StoreObjPtr< Belle2::ParticleList >, StoreObjPtr< Belle2::BinnedEventT0 >, StoreObjPtr< Belle2::TRGSummary >, StoreObjPtr< Belle2::FileMetaData >, StoreObjPtr< Belle2::PXDInjectionBGTiming >, StoreObjPtr< Belle2::DisplayData >, StoreObjPtr< Belle2::ParticleExtraInfoMap >, StoreObjPtr< StoreWrapper< T > >, StoreObjPtr< Belle2::TOPRecBunch >, StoreObjPtr< Belle2::DirectedNodeNetworkContainer >, StoreObjPtr< Belle2::TauPairDecay >, StoreObjPtr< Belle2::RawCOPPER >, StoreObjPtr< Belle2::RestOfEvent >, StoreObjPtr< Belle2::MCInitialParticles >, StoreObjPtr< Belle2::EventLevelTriggerTimeInfo >, StoreObjPtr< Belle2::SoftwareTriggerResult >, StoreObjPtr< Belle2::EventExtraInfo >, StoreObjPtr< Belle2::KLMChannelMapValue< unsigned int > >, StoreObjPtr< Belle2::RootMergeable< TTree > >, StoreObjPtr< Belle2::EventShapeContainer >, StoreObjPtr< Belle2::ECLWaveforms >, StoreObjPtr< Belle2::EventLevelClusteringInfo >, StoreObjPtr< Belle2::EventT0 >, StoreObjPtr< Belle2::SVDEventInfo >, StoreObjPtr< Belle2::EventLevelTrackingInfo >, StoreObjPtr< Belle2::PXDGatedModeInfo >, StoreObjPtr< Belle2::RandomGenerator >, StoreObjPtr< Belle2::ROIpayload >, StoreObjPtr< Belle2::ProcessStatistics >, StoreObjPtr< Belle2::ECLTRGInformation >, StoreObjPtr< Belle2::TRGGDLDST >, StoreObjPtr< Belle2::TOPAsicMask >, StoreObjPtr< Belle2::MergedEventConsistency >, RelationArray, StoreArray< T >, and StoreObjPtr< T >.

Collaboration diagram for StoreAccessorBase:

Public Member Functions

 StoreAccessorBase (const std::string &name, DataStore::EDurability durability, TClass *objClass, bool isArray)
 Constructor to access an object or array in the DataStore. More...
 
virtual ~StoreAccessorBase ()
 Destructor. More...
 
bool registerInDataStore (DataStore::EStoreFlags storeFlags=DataStore::c_WriteOut)
 Register the object/array in the DataStore. More...
 
bool registerInDataStore (const std::string &name, DataStore::EStoreFlags storeFlags=DataStore::c_WriteOut)
 Register the object/array in the DataStore. More...
 
bool isRequired (const std::string &name="")
 Ensure this array/object has been registered previously. More...
 
bool isOptional (const std::string &name="")
 Tell the DataStore about an optional input. More...
 
bool create (bool replace=false)
 Create a default object in the data store. More...
 
bool assign (TObject *object, bool replace=false)
 Assign 'object' to this accessor. More...
 
virtual void clear ()
 Clear contents of this object.
 
const std::string & getName () const
 Return name under which the object is saved in the DataStore.
 
DataStore::EDurability getDurability () const
 Return durability with which the object is saved in the DataStore.
 
AccessorParams getAccessorParams () const
 Return pair of name and durability under which stored object is saved. More...
 
virtual bool operator== (const StoreAccessorBase &other) const
 Check if two store accessors point to the same object/array.
 
virtual bool operator!= (const StoreAccessorBase &other) const
 Check if two store accessors point to a different object/array.
 
TClass * getClass () const
 The underlying object's type.
 
bool isArray () const
 Is this an accessor for an array?
 
bool notWrittenOut () const
 Returns true if this object/array should not be saved by output modules. More...
 
std::string readableName () const
 Convert this acessor into a readable string (for messages). More...
 

Protected Attributes

std::string m_name
 Store name under which this object/array is saved.
 
DataStore::EDurability m_durability
 Store durability under which the object/array is saved.
 
TClass * m_class
 The underlying object's type.
 
bool m_isArray
 Is this an accessor for an array?
 

Detailed Description

Base class for StoreObjPtr and StoreArray for easier common treatment.


Definition at line 27 of file StoreAccessorBase.h.

Constructor & Destructor Documentation

◆ StoreAccessorBase()

StoreAccessorBase ( const std::string &  name,
DataStore::EDurability  durability,
TClass *  objClass,
bool  isArray 
)
inline

Constructor to access an object or array in the DataStore.

Parameters
nameName under which the object is stored in the DataStore.
durabilityDecides durability map used for getting the accessed object.
objClassType of the object
isArraytrue if the entry in the DataStore is an array

Definition at line 37 of file StoreAccessorBase.h.

◆ ~StoreAccessorBase()

virtual ~StoreAccessorBase ( )
inlinevirtual

Destructor.

Virtual because this is a base class.

Definition at line 44 of file StoreAccessorBase.h.

Member Function Documentation

◆ assign()

bool assign ( TObject *  object,
bool  replace = false 
)

Assign 'object' to this accessor.

(takes ownership).

Parameters
objectThe object that should be put in the DataStore, should be of same type as the one used by this accessor.
replaceShould an existing object be replaced? (if existing and supplied object are equal, this has no effect)
Returns
True if the assignment succeeded. If false, assign() will delete 'object', do not use it afterwards.

Definition at line 33 of file StoreAccessorBase.cc.

◆ create()

bool create ( bool  replace = false)
inline

Create a default object in the data store.

This only works after registerInDataStore() has been called by this or another module.

Parameters
replaceShould an existing object be replaced?
Returns
True if the creation succeeded.

Definition at line 107 of file StoreAccessorBase.h.

◆ getAccessorParams()

AccessorParams getAccessorParams ( ) const
inline

Return pair of name and durability under which stored object is saved.


Definition at line 134 of file StoreAccessorBase.h.

◆ isOptional()

bool isOptional ( const std::string &  name = "")
inline

Tell the DataStore about an optional input.

Mainly useful for creating diagrams of module inputs and outputs.

Parameters
nameIf not empty, set non-default name for this object/array. This is permanent, so that e.g. after using registerInDataStore("myName") in initialize(), this object will continue refer to 'myName' in event().
Returns
True if the object/array exists.

Definition at line 93 of file StoreAccessorBase.h.

◆ isRequired()

bool isRequired ( const std::string &  name = "")
inline

Ensure this array/object has been registered previously.

Will cause an ERROR if it does not exist. This must be called in the initialization phase.

Parameters
nameIf not empty, set non-default name for this object/array. This is permanent, so that e.g. after using registerInDataStore("myName") in initialize(), this object will continue refer to 'myName' in event().
Returns
True if the object/array exists.

Definition at line 78 of file StoreAccessorBase.h.

◆ notWrittenOut()

bool notWrittenOut ( ) const

Returns true if this object/array should not be saved by output modules.

See DataStore::c_DontWriteOut. Can be changed by re-registering it with/without the flag.

Definition at line 53 of file StoreAccessorBase.cc.

◆ readableName()

std::string readableName ( ) const

Convert this acessor into a readable string (for messages).

e.g. "object EventMetaData (durability: event)"

Definition at line 18 of file StoreAccessorBase.cc.

◆ registerInDataStore() [1/2]

bool registerInDataStore ( const std::string &  name,
DataStore::EStoreFlags  storeFlags = DataStore::c_WriteOut 
)
inline

Register the object/array in the DataStore.

This must be called in the initialization phase.

Parameters
nameIf not empty, set non-default name for this object/array. This is permanent, so that e.g. after using registerInDataStore("myName") in initialize(), this object will continue refer to 'myName' in event().
storeFlagsORed combination of DataStore::EStoreFlags.
Returns
True if the registration succeeded.

Definition at line 64 of file StoreAccessorBase.h.

◆ registerInDataStore() [2/2]

bool registerInDataStore ( DataStore::EStoreFlags  storeFlags = DataStore::c_WriteOut)
inline

Register the object/array in the DataStore.

This must be called in the initialization phase.

Parameters
storeFlagsORed combination of DataStore::EStoreFlags.
Returns
True if the registration succeeded.

Definition at line 52 of file StoreAccessorBase.h.


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