HerdSoftware  0.1.1
Classes | Public Member Functions | Private Types | 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

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 Types

using ObjPrerequisite = std::pair< ObjDescriptor, std::function< void(DataReader *, DataReader *)> >
 

Private Member Functions

bool _LoadPrerequisites (ObjDescriptor &objDesc)
 

Private Attributes

unsigned int m_currEv
 
unsigned int m_currReadEv
 
std::shared_ptr< GGSTRootReader > m_reader
 
std::vector< ObjDescriptorm_objDescriptors
 
const std::pair< std::string, std::vector< std::string > > m_caloHitsNames {"caloHitsGGS", {"caloHitsMC", "caloHitsGeV"}}
 
const std::pair< std::string, std::vector< std::string > > m_fitHitsCollNames
 
const std::pair< std::string, std::vector< std::string > > m_fitParticleHitsCollNames
 
const std::pair< std::string, std::vector< std::string > > m_stkStripHitsCollNames
 
const std::pair< std::string, std::vector< std::string > > m_stkWaferHitsCollNames
 
const std::pair< std::string, std::vector< std::string > > m_stkWaferParticleHitsCollNames
 
const std::pair< std::string, std::vector< std::string > > m_scdStripHitsCollNames
 
const std::pair< std::string, std::vector< std::string > > m_scdWaferHitsCollNames
 
const std::pair< std::string, std::vector< std::string > > m_scdWaferParticleHitsCollNames
 
const std::pair< std::string, std::vector< std::string > > m_psdHitsCollNames
 
const std::pair< std::string, std::vector< std::string > > m_psdParticleHitsCollNames
 
const std::pair< std::string, std::vector< std::string > > m_mcTruthNames {"mcTruth", {}}
 
std::unique_ptr< ParametricGeoReaderm_geoReader
 
std::unique_ptr< GGSSimReaderm_evReader
 

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.
fitHitsCollGGS FitHitsColl fitHitsCollMC, fitHitsCollGeV The integrated hits in the monolithic FIT layers (1 hit per plane).
fitParticleHitsCollGGS FitParticleHitsColl fitParticleHitsCollMC, fitParticleHitsCollGeV The particle hits in the FIT.
stkWaferHitsCollGGS StkHitsColl stkWaferHitsCollMC, stkWaferHitsCollGeV The hits in the STK wafers.
stkWaferParticleHitsCollGGS StkParticleHitsColl stkWaferParticleHitsCollMC, stkWaferParticleHitsCollGeV The particle hits in the STK wafers.
stkStripHitsCollGGS StkHitsColl stkHitsCollMC, stkHitsCollGeV The hits in the STK strips (only if strips have been activated in simulation).
scdWaferHitsCollGGS ScdHitsColl scdWaferHitsCollMC, scdWaferHitsCollGeV The hits in the SCD wafers.
scdWaferParticleHitsCollGGS ScdParticleHitsColl scdWaferParticleHitsCollMC, scdWaferParticleHitsCollGeV The particle hits in the SCD wafers.
scdStripHitsCollGGS ScdHitsColl scdHitsCollMC, scdHitsCollGeV The hits in the SCD strips (only if strips have been activated in simulation).
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 ----------—|--------—|------------—|---------------------------------------------------------------—

Member Typedef Documentation

◆ ObjPrerequisite

using Herd::GGSDataProvider::ObjPrerequisite = std::pair<ObjDescriptor, std::function<void(DataReader *, DataReader *)> >
private

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

◆ _LoadPrerequisites()

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

◆ 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

◆ 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_caloHitsNames

const std::pair<std::string, std::vector<std::string> > Herd::GGSDataProvider::m_caloHitsNames {"caloHitsGGS", {"caloHitsMC", "caloHitsGeV"}}
private

◆ m_currEv

unsigned int Herd::GGSDataProvider::m_currEv
private

◆ m_currReadEv

unsigned int Herd::GGSDataProvider::m_currReadEv
private

◆ m_evReader

std::unique_ptr<GGSSimReader> Herd::GGSDataProvider::m_evReader
private

◆ m_fitHitsCollNames

const std::pair<std::string, std::vector<std::string> > Herd::GGSDataProvider::m_fitHitsCollNames
private
Initial value:
{"fitHitsCollGGS",
{"fitHitsCollMC", "fitHitsCollGeV"}}

◆ m_fitParticleHitsCollNames

const std::pair<std::string, std::vector<std::string> > Herd::GGSDataProvider::m_fitParticleHitsCollNames
private
Initial value:
{
"fitParticleHitsCollGGS", {"fitParticleHitsCollMC", "fitParticleHitsCollGeV"}}

◆ m_geoReader

std::unique_ptr<ParametricGeoReader> Herd::GGSDataProvider::m_geoReader
private

◆ m_mcTruthNames

const std::pair<std::string, std::vector<std::string> > Herd::GGSDataProvider::m_mcTruthNames {"mcTruth", {}}
private

◆ m_objDescriptors

std::vector<ObjDescriptor> Herd::GGSDataProvider::m_objDescriptors
private

◆ m_psdHitsCollNames

const std::pair<std::string, std::vector<std::string> > Herd::GGSDataProvider::m_psdHitsCollNames
private
Initial value:
{"psdHitsCollGGS",
{"psdHitsCollMC", "psdHitsCollGeV"}}

◆ m_psdParticleHitsCollNames

const std::pair<std::string, std::vector<std::string> > Herd::GGSDataProvider::m_psdParticleHitsCollNames
private
Initial value:
{
"psdParticleHitsCollGGS", {"psdParticleHitsCollMC", "psdParticleHitsCollGeV"}}

◆ m_reader

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

◆ m_scdStripHitsCollNames

const std::pair<std::string, std::vector<std::string> > Herd::GGSDataProvider::m_scdStripHitsCollNames
private
Initial value:
{"scdStripHitsCollGGS",
{"scdHitsCollMC", "scdHitsCollGeV"}}

◆ m_scdWaferHitsCollNames

const std::pair<std::string, std::vector<std::string> > Herd::GGSDataProvider::m_scdWaferHitsCollNames
private
Initial value:
{
"scdWaferHitsCollGGS", {"scdWaferHitsCollMC", "scdWaferHitsCollGeV"}}

◆ m_scdWaferParticleHitsCollNames

const std::pair<std::string, std::vector<std::string> > Herd::GGSDataProvider::m_scdWaferParticleHitsCollNames
private
Initial value:
{
"scdWaferParticleHitsCollGGS", {"scdWaferParticleHitsCollMC", "scdWaferParticleHitsCollGeV"}}

◆ m_stkStripHitsCollNames

const std::pair<std::string, std::vector<std::string> > Herd::GGSDataProvider::m_stkStripHitsCollNames
private
Initial value:
{"stkStripHitsCollGGS",
{"stkHitsCollMC", "stkHitsCollGeV"}}

◆ m_stkWaferHitsCollNames

const std::pair<std::string, std::vector<std::string> > Herd::GGSDataProvider::m_stkWaferHitsCollNames
private
Initial value:
{
"stkWaferHitsCollGGS", {"stkWaferHitsCollMC", "stkWaferHitsCollGeV"}}

◆ m_stkWaferParticleHitsCollNames

const std::pair<std::string, std::vector<std::string> > Herd::GGSDataProvider::m_stkWaferParticleHitsCollNames
private
Initial value:
{
"stkWaferParticleHitsCollGGS", {"stkWaferParticleHitsCollMC", "stkWaferParticleHitsCollGeV"}}

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