Geant4 9.6.0
Toolkit for the simulation of the passage of particles through matter
Loading...
Searching...
No Matches
cheprep::DefaultHepRep Class Reference

#include <DefaultHepRep.h>

+ Inheritance diagram for cheprep::DefaultHepRep:

Public Member Functions

 DefaultHepRep ()
 
 ~DefaultHepRep ()
 
HEPREP::HepRepcopy (HEPREP::HepRepSelectFilter *filter)
 
std::vector< std::string > getLayerOrder ()
 
void addLayer (std::string layer)
 
void addTypeTree (HEPREP::HepRepTypeTree *typeTree)
 
void removeTypeTree (HEPREP::HepRepTypeTree *typeTree)
 
HEPREP::HepRepTypeTreegetTypeTree (std::string name, std::string version)
 
std::vector< HEPREP::HepRepTypeTree * > getTypeTreeList ()
 
void addInstanceTree (HEPREP::HepRepInstanceTree *instanceTree)
 
void overlayInstanceTree (HEPREP::HepRepInstanceTree *instanceTree)
 
void removeInstanceTree (HEPREP::HepRepInstanceTree *instanceTree)
 
HEPREP::HepRepInstanceTreegetInstanceTreeTop (std::string name, std::string version)
 
HEPREP::HepRepInstanceTreegetInstances (std::string name, std::string version, std::vector< std::string > typeNames)
 
HEPREP::HepRepInstanceTreegetInstancesAfterAction (std::string name, std::string version, std::vector< std::string > typeNames, std::vector< HEPREP::HepRepAction * > actions, bool getPoints, bool getDrawAtts, bool getNonDrawAtts, std::vector< std::string > invertAtts)
 
std::string checkForException ()
 
std::vector< HEPREP::HepRepInstanceTree * > getInstanceTreeList ()
 
- Public Member Functions inherited from HEPREP::HepRep
virtual ~HepRep ()
 Destructor.
 
virtual void addLayer (std::string layer)=0
 
virtual std::vector< std::string > getLayerOrder ()=0
 
virtual void addTypeTree (HepRepTypeTree *typeTree)=0
 
virtual void removeTypeTree (HepRepTypeTree *typeTree)=0
 
virtual std::vector< HepRepTypeTree * > getTypeTreeList ()=0
 
virtual HepRepTypeTreegetTypeTree (std::string name, std::string version)=0
 
virtual void addInstanceTree (HepRepInstanceTree *instanceTree)=0
 
virtual void overlayInstanceTree (HepRepInstanceTree *instanceTree)=0
 
virtual void removeInstanceTree (HepRepInstanceTree *instanceTree)=0
 
virtual std::vector< HepRepInstanceTree * > getInstanceTreeList ()=0
 
virtual HepRepInstanceTreegetInstanceTreeTop (std::string name, std::string version)=0
 
virtual HepRepInstanceTreegetInstances (std::string name, std::string version, std::vector< std::string > typeNames)=0
 
virtual HepRepInstanceTreegetInstancesAfterAction (std::string name, std::string version, std::vector< std::string > typeNames, std::vector< HepRepAction * > actions, bool getPoints, bool getDrawAtts, bool getNonDrawAtts, std::vector< std::string > invertAtts)=0
 
virtual std::string checkForException ()=0
 
virtual HepRepcopy (HepRepSelectFilter *filter=NULL)=0
 

Detailed Description

Definition at line 24 of file DefaultHepRep.h.

Constructor & Destructor Documentation

◆ DefaultHepRep()

cheprep::DefaultHepRep::DefaultHepRep ( )

Definition at line 14 of file DefaultHepRep.cc.

14 {
15}

◆ ~DefaultHepRep()

cheprep::DefaultHepRep::~DefaultHepRep ( )

Definition at line 17 of file DefaultHepRep.cc.

17 {
18 for (vector<HepRepTypeTree*>::iterator i1 = typeTrees.begin(); i1 != typeTrees.end(); i1++) {
19 delete (*i1);
20 }
21 for (vector<HepRepInstanceTree*>::iterator i2 = instanceTrees.begin(); i2 != instanceTrees.end(); i2++) {
22 delete (*i2);
23 }
24}

Member Function Documentation

◆ addInstanceTree()

void cheprep::DefaultHepRep::addInstanceTree ( HEPREP::HepRepInstanceTree instanceTree)
virtual

Searches for a named type in any of the typetrees. The first occurrence found is returned.

Parameters
namename of type.
Returns
named HepRepType. Adds an instancetree to this heprep.
Parameters
instanceTreeto be added.

Implements HEPREP::HepRep.

Definition at line 57 of file DefaultHepRep.cc.

57 {
58 // FIXME check if already exist
59 instanceTrees.push_back(instanceTree);
60}

◆ addLayer()

void cheprep::DefaultHepRep::addLayer ( std::string  layer)
virtual

Add a layer to the list of layers in this heprep. The layer is added to the back of the list.

Parameters
layername of layer to be added to the back of the list.

Implements HEPREP::HepRep.

Definition at line 35 of file DefaultHepRep.cc.

35 {
36 layers.push_back(layer);
37}

◆ addTypeTree()

void cheprep::DefaultHepRep::addTypeTree ( HEPREP::HepRepTypeTree typeTree)
virtual

Add a typetree to this heprep.

Parameters
typeTreeto be added.

Implements HEPREP::HepRep.

Definition at line 39 of file DefaultHepRep.cc.

39 {
40 // FIXME check if already exist
41 typeTrees.push_back(typeTree);
42}

◆ checkForException()

string cheprep::DefaultHepRep::checkForException ( )
virtual

Returns last exception thrown and clears it. Useful for implementations without exception handling.

Returns
last exception and clears it.

Implements HEPREP::HepRep.

Definition at line 94 of file DefaultHepRep.cc.

94 {
95 return NULL;
96}

◆ copy()

HepRep * cheprep::DefaultHepRep::copy ( HEPREP::HepRepSelectFilter filter)
virtual

Returns a deep copy of the heprep, with all its attached trees, where instances are filtered using a HepRepSelectFilter.

Parameters
filterto be used for filtering instances.
Returns
copy of heprep.

Implements HEPREP::HepRep.

Definition at line 26 of file DefaultHepRep.cc.

26 {
27 cerr << "DefaultHepRep::copy(HepRepSelectFilter*) not implemented." << endl;
28 return NULL;
29}

◆ getInstances()

HepRepInstanceTree * cheprep::DefaultHepRep::getInstances ( std::string  name,
std::string  version,
std::vector< std::string >  typeNames 
)
virtual

Returns a named and versioned instancetree for a list of typenames.

This tree needs to be added to the heprep afterwards.

Parameters
namename of the instancetree.
versionversion of the instancetree.
typeNamesa list of typenames for which we need instancetrees.
Returns
HepRepIntanceTree

Implements HEPREP::HepRep.

Definition at line 75 of file DefaultHepRep.cc.

76 {
77 cerr << "DefaultHepRep::getInstances(string, string, vector<string>) not implemented." << endl;
78 return NULL;
79}

◆ getInstancesAfterAction()

HepRepInstanceTree * cheprep::DefaultHepRep::getInstancesAfterAction ( std::string  name,
std::string  version,
std::vector< std::string >  typeNames,
std::vector< HEPREP::HepRepAction * >  actions,
bool  getPoints,
bool  getDrawAtts,
bool  getNonDrawAtts,
std::vector< std::string >  invertAtts 
)
virtual

Returns a named and versioned instancetree for a list of typenames after executing some action and for specific filters.

This tree needs to be added to the heprep afterwards.

The inversion effect of invertAtts depends on the values of GetDrawAtts and GetNonDrawAtts as follows:

  • GetDrawAtts GetNonDrawAtts effect of InvertAtts
  • FALSE FALSE all Attributes specified will be downloaded
  • TRUE FALSE Draw Attributes specified will be omitted, NonDraw Attributes specified will be included
  • FALSE TRUE Draw Attributes specified will be included, NonDraw Attributes specified will be omitted
  • TRUE TRUE all Attributes specified will be omitted
Parameters
namename of the instancetree.
versionversion of the instancetree.
typeNamesa list of typenames for which we need instancetrees.
actionsexecute this list of actions before returning.
getPointsinclude the HepRepPoints in the instance tree.
getDrawAttsinclude the Draw attributes in the instance tree.
getNonDrawAttsinclude the Non-Draw attributes in the instance tree.
invertAttslist of attributes to be included or not depending on getDrawAtts and getNonDrawAtts.
Returns
HepRepIntanceTree

Implements HEPREP::HepRep.

Definition at line 81 of file DefaultHepRep.cc.

89 {
90 cerr << "DefaultHepRep::getInstancesAfterAction(string, string, vector<string>, vector<HepRepAction*>, bool, bool, bool, vector<string>) not implemented." << endl;
91 return NULL;
92}

◆ getInstanceTreeList()

vector< HepRepInstanceTree * > cheprep::DefaultHepRep::getInstanceTreeList ( )
virtual

Returns a collection of instancetrees.

Returns
collection of HepRepInstanceTrees.

Implements HEPREP::HepRep.

Definition at line 98 of file DefaultHepRep.cc.

98 {
99 return instanceTrees;
100}

◆ getInstanceTreeTop()

HepRepInstanceTree * cheprep::DefaultHepRep::getInstanceTreeTop ( std::string  name,
std::string  version 
)
virtual

Returns a named and versioned instancetree. FIXME: doc is incorrect here, should only return TOP of the tree. Filling in should be done by getInstances calls.

This tree needs to be added to the heprep afterwards.

Parameters
namename of the instancetree.
versionversion of the instancetree.
Returns
HepRepIntanceTree

Implements HEPREP::HepRep.

Definition at line 70 of file DefaultHepRep.cc.

70 {
71 cerr << "DefaultHepRep::getInstanceTreeTop(string, string) not implemented." << endl;
72 return NULL;
73}

◆ getLayerOrder()

vector< string > cheprep::DefaultHepRep::getLayerOrder ( )
virtual

Returns the list of layers.

Returns
the known layer names, in the order back-to-front.

Implements HEPREP::HepRep.

Definition at line 31 of file DefaultHepRep.cc.

31 {
32 return layers;
33}

◆ getTypeTree()

HepRepTypeTree * cheprep::DefaultHepRep::getTypeTree ( std::string  name,
std::string  version 
)
virtual

Returns a named and versioned typetree.

Parameters
namename of the typetree.
versionversion of the typetree.
Returns
named and versioned HepRepTypeTree.

Implements HEPREP::HepRep.

Definition at line 48 of file DefaultHepRep.cc.

48 {
49 cerr << "DefaultHepRep::getTypeTree(string, string) not implemented." << endl;
50 return NULL;
51}

◆ getTypeTreeList()

vector< HepRepTypeTree * > cheprep::DefaultHepRep::getTypeTreeList ( )
virtual

Returns the collection of all typetrees of this heprep.

Returns
collection of HepRepTypeTrees.

Implements HEPREP::HepRep.

Definition at line 53 of file DefaultHepRep.cc.

53 {
54 return typeTrees;
55}

◆ overlayInstanceTree()

void cheprep::DefaultHepRep::overlayInstanceTree ( HEPREP::HepRepInstanceTree instanceTree)
virtual

Overlays an instancetree to this heprep, overriding attributes and adding children.

Parameters
instanceTreeto be overlaid.

Implements HEPREP::HepRep.

Definition at line 62 of file DefaultHepRep.cc.

62 {
63 cerr << "DefaultHepRep::overlayInstanceTree(HepRepInstanceTree * instanceTree) not implemented." << endl;
64}

◆ removeInstanceTree()

void cheprep::DefaultHepRep::removeInstanceTree ( HEPREP::HepRepInstanceTree instanceTree)
virtual

Remove an instanectree from this heprep.

Parameters
instanceTreeto be removed.

Implements HEPREP::HepRep.

Definition at line 66 of file DefaultHepRep.cc.

66 {
67 cerr << "DefaultHepRep::removeInstanceTree(HepRepInstanceTree*) not implemented." << endl;
68}

◆ removeTypeTree()

void cheprep::DefaultHepRep::removeTypeTree ( HEPREP::HepRepTypeTree typeTree)
virtual

Remove a typetree from this heprep.

Parameters
typeTreeto be removed.

Implements HEPREP::HepRep.

Definition at line 44 of file DefaultHepRep.cc.

44 {
45 cerr << "DefaultHepRep::removeTypeTree(HepRepTypeTree*) not implemented." << endl;
46}

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