Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 13 additions & 6 deletions inc/TRestGeant4GeometryInfo.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
#ifndef REST_TRESTGEANT4GEOMETRYINFO_H
#define REST_TRESTGEANT4GEOMETRYINFO_H

#include <TRestStringOutput.h>
#include <TString.h>
#include <TVector3.h>

Expand All @@ -12,10 +13,11 @@
class G4VPhysicalVolume;

class TRestGeant4GeometryInfo {
ClassDef(TRestGeant4GeometryInfo, 3);
ClassDef(TRestGeant4GeometryInfo, 4);

private:
bool fIsAssembly = false;
TString fPathSeparator = "_";

std::map<Int_t, TString> fVolumeNameMap = {};
std::map<TString, Int_t> fVolumeNameReverseMap = {};
Expand All @@ -34,12 +36,14 @@ class TRestGeant4GeometryInfo {
std::vector<TString> fGdmlLogicalNames;

std::map<TString, TString>
fGeant4PhysicalNameToNewPhysicalNameMap; /*
* only makes sense when using assembly
*/
fNewPhysicalToGeant4PhysicalNameMap; // reverse map of fGeant4PhysicalNameToNewPhysicalNameMap

std::map<TString, TString> fGeant4AssemblyImprintToGdmlNameMap;
std::map<TString, std::map<TString, TString>> fGdmlAssemblyToChildrenGeant4ToGdmlPhysicalNameMap;
std::map<TString, TString> fGeant4AssemblyImprintToAssemblyLogicalNameMap;

std::map<TString, TString> fPhysicalToLogicalVolumeMap;
std::map<TString, std::vector<TString> > fLogicalToPhysicalMap;
std::map<TString, std::vector<TString>> fLogicalToPhysicalMap;
// many physical volumes can point to one single logical
std::map<TString, TString> fLogicalToMaterialMap;
std::map<TString, TVector3> fPhysicalToPositionInWorldMap;
Expand All @@ -49,7 +53,9 @@ class TRestGeant4GeometryInfo {

void PopulateFromGdml(const TString&);

TString GetAlternativePathFromGeant4Path(const TString&) const;
TString GetAlternativeNameFromGeant4PhysicalName(const TString&) const;
std::set<TString> GetAlternativeNamesFromGeant4PhysicalName(const TString&) const;
TString GetGeant4PhysicalNameFromAlternativeName(const TString&) const;

std::vector<TString> GetAllLogicalVolumes() const;
Expand Down Expand Up @@ -86,7 +92,8 @@ class TRestGeant4GeometryInfo {
}

inline bool IsAssembly() const { return fIsAssembly; }

inline TString GetPathSeparator() const { return fPathSeparator; }
void SetPathSeparator(const TString& separator) { fPathSeparator = separator; }
void InsertVolumeName(Int_t id, const TString& volumeName);

TString GetVolumeFromID(Int_t id) const;
Expand Down
Loading