HerdSoftware  0.3.2
Classes | Public Member Functions | Private Member Functions | Private Attributes | List of all members
Herd::GGSDataProvider Class Reference

Data provider for Geant4 Monte Carlo data. More...

#include <dataproviders/GGSDataProvider.h>

Inheritance diagram for Herd::GGSDataProvider:

Classes

class  CachedFunction
 
struct  ObjDescriptor
 

Public Member Functions

 GGSDataProvider (const std::string &name, const std::string &source)
 Constructor. More...
 
bool Connect () override
 Connects the given GGS files(s). More...
 
bool SetCurrentEvent (unsigned int event) override
 Sets the current event. More...
 
RetrievalResult GetObject (const std::string &name, ObjectCategory category, ObjectWrapper &wrapper, std::string &actualName) override
 Provides an object. More...
 
std::vector< std::string > FreeObjects (const std::vector< std::string > &objs, Memory::Status memStatus) override
 Free the memory of unneeded objects. More...
 

Private Member Functions

bool LoadPrerequisites (ObjDescriptor &objDesc)
 

Private Attributes

unsigned int m_currEv
 
unsigned int m_currReadEv
 
std::vector< ObjDescriptorm_objDescriptors = {}
 
std::shared_ptr< GGSTRootReader > m_reader
 
std::unique_ptr< Readers::GGSMCGenReaderm_mcGenReader = nullptr
 
std::unique_ptr< Readers::GGSTGeoReaderm_mcTGeoReader = nullptr
 
std::unique_ptr< Readers::ParametricGeoCssReaderm_mcPGCssReader = nullptr
 
std::unique_ptr< Readers::ParametricGeoCaloReaderm_mcPGCaloReader = nullptr
 
std::unique_ptr< Readers::ParametricGeoFitReaderm_mcPGFitReader = nullptr
 
std::unique_ptr< Readers::ParametricGeoPsdReaderm_mcPGPsdReader = nullptr
 
std::unique_ptr< Readers::ParametricGeoSiliconDetectorReaderm_mcPGStkReader = nullptr
 
std::unique_ptr< Readers::ParametricGeoSiliconDetectorReaderm_mcPGScdReader = nullptr
 
std::unique_ptr< Readers::GGSMCTruthReaderm_mcTruthReader = nullptr
 
std::unique_ptr< Readers::GGSCaloHitsReaderm_caloHitsReader = nullptr
 
std::unique_ptr< Readers::GGSSiliconDetectorHitsReaderm_stkHitsReader = nullptr
 
std::unique_ptr< Readers::GGSSiliconDetectorHitsReaderm_scdHitsReader = nullptr
 
std::unique_ptr< Readers::GGSFitHitsReaderm_fitHitsReader = nullptr
 
std::unique_ptr< Readers::GGSPsdHitsReaderm_psdHitsReader = nullptr
 

Detailed Description

Data provider for Geant4 Monte Carlo data.

Reads the HERD MC data from GGS output files produced with ParametricGeo detector geometry. For STK it can provide integrated hits on each single strip or hits and particle hits non-segmented Si wafers, depending on whether the strips have been activated in the geometry datacard ofthe simulation or not, respectively.

Published event objects:

name type alias description
caloHitsGGS CaloHits caloHitsMC, caloHitsGeV The hits in the calorimeter.
fitLayerHitsCollGGS FitHitsColl The integrated hits in the monolithic FIT layers (1 hit per plane).
fitParticleHitsCollGGS FitParticleHitsColl fitParticleHitsCollMC, fitParticleHitsCollGeV The particle hits in the FIT.
stkWaferHitsCollGGS StkHitsColl The hits in the STK wafers.
stkWaferParticleHitsCollGGS StkParticleHitsColl stkWaferParticleHitsCollMC, stkWaferParticleHitsCollGeV The particle hits in the STK wafers.
scdWaferHitsCollGGS ScdHitsColl The hits in the SCD wafers.
scdWaferParticleHitsCollGGS ScdParticleHitsColl scdWaferParticleHitsCollMC, scdWaferParticleHitsCollGeV The particle hits in the SCD wafers.
psdHitsCollGGS PsdHitsColl psdHitsCollMC, psdHitsCollGeV The hits in the PSD.
psdParticleHitsCollGGS PsdParticleHitsColl psdParticleHitsCollMC, psdParticleHitsCollGeV The particle hits in the PSD.
mcTruth MCTruth The Monte Carlo truth of the event.

Published global objects:

name type alias store description
caloGeoParamsGGS CaloGeoParams caloGeoParams globStore Geometric parameters of the Calo.
fitGeoParamsCollGGS FitGeoParamsColl fitGeoParamsColl globStore Geometric parameters of the FIT.
stkGeoParamsCollGGS StkGeoParamsColl stkGeoParamsColl globStore Geometric parameters of the STK.
scdGeoParamsCollGGS ScdGeoParamsColl scdGeoParamsColl globStore Geometric parameters of the SCD.
psdGeoParamsCollGGS PsdGeoParamsColl psdGeoParamsColl globStore Geometric parameters of the PSD.
mcGenerationInfo const MCGenerationInfo globStore Parameters of the MC primary particle generation.
cssGeoParamsGGS CssGeoParams cssGeoParams globStore Geometric parameters of the space station.

Parameters:

name | type | default value | description ----------—|--------—|------------—|---------------------------------------------------------------—

Constructor & Destructor Documentation

◆ GGSDataProvider()

Herd::GGSDataProvider::GGSDataProvider ( const std::string &  name,
const std::string &  source 
)

Constructor.

Parameters
nameThe name of the provider
sourceA GGS output file (.root) or a text file (.txt) containing a list of GGS files to be concatenated.

Member Function Documentation

◆ Connect()

bool Herd::GGSDataProvider::Connect ( )
override

Connects the given GGS files(s).

Returns
True if the file(s) has been correctly opened.
See also
GGSDataProvider.

◆ FreeObjects()

std::vector< std::string > Herd::GGSDataProvider::FreeObjects ( const std::vector< std::string > &  objs,
Memory::Status  memStatus 
)
override

Free the memory of unneeded objects.

Currently this method frees the memory of the provided objects if memStatus is EXHAUSTED. In current implementation only hit objects are freed:

  • caloHitsGGS
  • stkWaferHitsCollGGS
  • stkWaferParticleHitsCollGGS
  • stkStripHitsCollGGS
  • scdWaferHitsCollGGS
  • scdWaferParticleHitsCollGGS
  • scdStripHitsCollGGS
  • psdHitsCollGGS
  • psdParticleHitsCollGGS

since they occupy most of the used memory.

Parameters
objsThe list of objects to be freed.
memStatusThe current memory occupation status.
Returns
a list of freed objects.

◆ GetObject()

RetrievalResult Herd::GGSDataProvider::GetObject ( const std::string &  name,
ObjectCategory  category,
ObjectWrapper &  wrapper,
std::string &  actualName 
)
override

Provides an object.

See the description of the class for more information about the provided objects.

Parameters
nameThe name or alias of the requested object.
categoryThe category of the requested object.
wrapperWrapper for return value.
actualNameThe name of the object in case we're asking for an alias
Returns
A RetrievalResult code with the result of the retrieval operation

◆ LoadPrerequisites()

bool Herd::GGSDataProvider::LoadPrerequisites ( ObjDescriptor objDesc)
private

◆ SetCurrentEvent()

bool Herd::GGSDataProvider::SetCurrentEvent ( unsigned int  event)
override

Sets the current event.

Parameters
eventThe index of the event to be set as current.
Returns
true if 0 <= event < total number of events in the GGS file(s), false otherwise.

Member Data Documentation

◆ m_caloHitsReader

std::unique_ptr<Readers::GGSCaloHitsReader> Herd::GGSDataProvider::m_caloHitsReader = nullptr
private

◆ m_currEv

unsigned int Herd::GGSDataProvider::m_currEv
private

◆ m_currReadEv

unsigned int Herd::GGSDataProvider::m_currReadEv
private

◆ m_fitHitsReader

std::unique_ptr<Readers::GGSFitHitsReader> Herd::GGSDataProvider::m_fitHitsReader = nullptr
private

◆ m_mcGenReader

std::unique_ptr<Readers::GGSMCGenReader> Herd::GGSDataProvider::m_mcGenReader = nullptr
private

◆ m_mcPGCaloReader

std::unique_ptr<Readers::ParametricGeoCaloReader> Herd::GGSDataProvider::m_mcPGCaloReader = nullptr
private

◆ m_mcPGCssReader

std::unique_ptr<Readers::ParametricGeoCssReader> Herd::GGSDataProvider::m_mcPGCssReader = nullptr
private

◆ m_mcPGFitReader

std::unique_ptr<Readers::ParametricGeoFitReader> Herd::GGSDataProvider::m_mcPGFitReader = nullptr
private

◆ m_mcPGPsdReader

std::unique_ptr<Readers::ParametricGeoPsdReader> Herd::GGSDataProvider::m_mcPGPsdReader = nullptr
private

◆ m_mcPGScdReader

std::unique_ptr<Readers::ParametricGeoSiliconDetectorReader> Herd::GGSDataProvider::m_mcPGScdReader = nullptr
private

◆ m_mcPGStkReader

std::unique_ptr<Readers::ParametricGeoSiliconDetectorReader> Herd::GGSDataProvider::m_mcPGStkReader = nullptr
private

◆ m_mcTGeoReader

std::unique_ptr<Readers::GGSTGeoReader> Herd::GGSDataProvider::m_mcTGeoReader = nullptr
private

◆ m_mcTruthReader

std::unique_ptr<Readers::GGSMCTruthReader> Herd::GGSDataProvider::m_mcTruthReader = nullptr
private

◆ m_objDescriptors

std::vector<ObjDescriptor> Herd::GGSDataProvider::m_objDescriptors = {}
private

◆ m_psdHitsReader

std::unique_ptr<Readers::GGSPsdHitsReader> Herd::GGSDataProvider::m_psdHitsReader = nullptr
private

◆ m_reader

std::shared_ptr<GGSTRootReader> Herd::GGSDataProvider::m_reader
private

◆ m_scdHitsReader

std::unique_ptr<Readers::GGSSiliconDetectorHitsReader> Herd::GGSDataProvider::m_scdHitsReader = nullptr
private

◆ m_stkHitsReader

std::unique_ptr<Readers::GGSSiliconDetectorHitsReader> Herd::GGSDataProvider::m_stkHitsReader = nullptr
private

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