PandaRoot
PndGeoHandling Class Reference

Class to access the naming information of the MVD. More...

#include <PndGeoHandling.h>

Inheritance diagram for PndGeoHandling:

Public Member Functions

 PndGeoHandling ()
 default constructor. Has to be called in SetParContainers if the support of shortId is needed. More...
 
 PndGeoHandling (TString mcFile, TString parFile)
 
 PndGeoHandling (Int_t runID, TString parFile)
 
 PndGeoHandling (PndSensorNamePar *SensorNamePar)
 
virtual ~PndGeoHandling ()
 
virtual void SetParContainers ()
 
TString GetPath (Int_t shortID)
 for a given shortID the path is returned More...
 
Int_t GetShortID (TString path)
 for a given path the (unique) position of the sensor path in the fSensorNamePar-List is given. If it is not found -1 is returned. More...
 
TString GetVolumeID (TString name)
 returns the volume ID for a given volume name More...
 
std::vector< TString > GetNamesLevel (Int_t level, TString startPath="")
 
void GetOUVPath (TString path, TVector3 &o, TVector3 &u, TVector3 &v)
 for a volume given by its path the o, u, v vectors for the plane are returned More...
 
void GetOUVShortId (Int_t shortId, TVector3 &o, TVector3 &u, TVector3 &v)
 
TGeoHMatrix * GetMatrixPath (TString path)
 
TGeoHMatrix * GetMatrixShortId (Int_t shortId)
 
TVector3 GetSensorDimensionsPath (TString path)
 
TVector3 GetSensorDimensionsShortId (Int_t shortId)
 
TVector3 MasterToLocalPath (const TVector3 &master, const TString &id)
 
TVector3 MasterToLocalShortId (const TVector3 &master, const Int_t &shortId)
 
TVector3 LocalToMasterPath (const TVector3 &local, const TString &id)
 
TVector3 LocalToMasterShortId (const TVector3 &local, const Int_t &shortId)
 
TMatrixD MasterToLocalErrorsPath (const TMatrixD &master, const TString &id)
 
TMatrixD MasterToLocalErrorsShortId (const TMatrixD &master, const Int_t &shortId)
 
TMatrixD LocalToMasterErrorsPath (const TMatrixD &local, const TString &id)
 
TMatrixD LocalToMasterErrorsShortId (const TMatrixD &local, const Int_t &shortId)
 
TMatrixD GetCurrentRotationMatrix ()
 
void SetVerbose (Int_t v)
 
void SetGeoManager (TGeoManager *geo)
 
void SetSensorNamePar (PndSensorNamePar *par)
 
Bool_t cd (Int_t id)
 as the cd command of TGeoManager just with the ID More...
 
void FillLevelNames ()
 fills vector<TString> fLevelNames with the names (or the paths) of the volumes down to the level given by fLevel More...
 
TString FindNodePath (TGeoNode *node)
 
void DiveDownToNode (TGeoNode *node)
 
void cd (TGeoNode *node)
 as cd command with the a node, not performant More...
 
void DiveDownToNodeContainingString (TString name)
 runs through the GeoManager until a path is found with a substring which matches to the given string More...
 
void CreateUniqueSensorId (TString startName, std::vector< std::string > listOfSensitives)
 Has to be called during simulation to create unique sensor id. More...
 
bool VolumeIsSensitive (TString &path, std::vector< std::string > &listOfSensitives)
 Checks if the path contains a substring which matches one of the given strings in listOfSensitives. If not false is returned. More...
 
void PrintSensorNames ()
 
TObjArray * GetSensorNames ()
 
std::vector< TString > GetSensorNamesWithString (TString value)
 
Int_t GetRunId (TString mcFile)
 
void GetGeoManager ()
 
TGeoManager * GetGeoMan ()
 
void GetSensorNamePar ()
 
void FillSensorMap ()
 
void InitRuntimeDb (TString parFileName)
 
PndGeoHandlingoperator= (const PndGeoHandling &)
 
void CreateUniqueSensorId (const TString &startName, const std::vector< std::string > &listOfSensitives, PndSensorNameIdMap *idmap)
 

Static Public Member Functions

static PndGeoHandlingInstance ()
 
static void Destroy ()
 

Protected Member Functions

Int_t GetIdForSensor (TString &sensName) const
 
InitStatus Init ()
 
virtual InitStatus ReInit ()
 

Detailed Description

Class to access the naming information of the MVD.

Author
: t.stockmanns t.sto.nosp@m.ckma.nosp@m.ns@fz.nosp@m.-jue.nosp@m.lich..nosp@m.de

To save memory not the full path of a volume is stored in each hit but an encrypted form of it (f.e. /1_1/34_2/101_1/). The first number is the volumeID coming from the GeoManager and the second number is the copy number. This class helps converting the encrypted ID into the path information and vice versa. It needs the information of the GeoManager. Therefore one has to ensure that either an initialized TGeoManager pointer is given in the constructor with the correct geometry or a filename with the correct geometry ("FAIRGeom")

30.03.2010: To reduce the data size a shortId is introduced. The shortId is generated with the command CreateUniqueSensorId and the match between the path in the GeoManager and the shortId is stored in the ParameterDatabase. To use the shortID the constructor of the PndGeoHandling has to be called in the method SetParContainers of a Task!

Definition at line 47 of file PndGeoHandling.h.

Constructor & Destructor Documentation

◆ PndGeoHandling() [1/4]

PndGeoHandling::PndGeoHandling ( )

default constructor. Has to be called in SetParContainers if the support of shortId is needed.

PndGeoHandling::Instance() has to be called the first time in the constructor of a task otherwise the Sensor names are not available from the database

Referenced by Destroy(), and ReInit().

◆ PndGeoHandling() [2/4]

PndGeoHandling::PndGeoHandling ( TString  mcFile,
TString  parFile 
)

◆ PndGeoHandling() [3/4]

PndGeoHandling::PndGeoHandling ( Int_t  runID,
TString  parFile 
)

◆ PndGeoHandling() [4/4]

PndGeoHandling::PndGeoHandling ( PndSensorNamePar SensorNamePar)

◆ ~PndGeoHandling()

virtual PndGeoHandling::~PndGeoHandling ( )
inlinevirtual

Definition at line 67 of file PndGeoHandling.h.

References GetNamesLevel(), GetOUVPath(), GetPath(), GetShortID(), GetVolumeID(), SetParContainers(), and v.

67 {};

Member Function Documentation

◆ cd() [1/2]

Bool_t PndGeoHandling::cd ( Int_t  id)

as the cd command of TGeoManager just with the ID

Referenced by SetSensorNamePar().

◆ cd() [2/2]

void PndGeoHandling::cd ( TGeoNode *  node)

as cd command with the a node, not performant

◆ CreateUniqueSensorId() [1/2]

void PndGeoHandling::CreateUniqueSensorId ( TString  startName,
std::vector< std::string >  listOfSensitives 
)

Has to be called during simulation to create unique sensor id.

Referenced by operator=(), and SetSensorNamePar().

◆ CreateUniqueSensorId() [2/2]

void PndGeoHandling::CreateUniqueSensorId ( const TString &  startName,
const std::vector< std::string > &  listOfSensitives,
PndSensorNameIdMap idmap 
)

◆ Destroy()

static void PndGeoHandling::Destroy ( )
inlinestatic

Definition at line 54 of file PndGeoHandling.h.

References PndGeoHandling().

55  {
56  if (fInstance) {
57  delete fInstance;
58  fInstance = nullptr;
59  }
60  }

◆ DiveDownToNode()

void PndGeoHandling::DiveDownToNode ( TGeoNode *  node)

Referenced by SetSensorNamePar().

◆ DiveDownToNodeContainingString()

void PndGeoHandling::DiveDownToNodeContainingString ( TString  name)

runs through the GeoManager until a path is found with a substring which matches to the given string

Referenced by SetSensorNamePar().

◆ FillLevelNames()

void PndGeoHandling::FillLevelNames ( )

fills vector<TString> fLevelNames with the names (or the paths) of the volumes down to the level given by fLevel

Referenced by SetSensorNamePar().

◆ FillSensorMap()

void PndGeoHandling::FillSensorMap ( )
inline

Definition at line 164 of file PndGeoHandling.h.

References PndSensorNamePar::FillMap(), and InitRuntimeDb().

164 { fSensorNamePar->FillMap(); }

◆ FindNodePath()

TString PndGeoHandling::FindNodePath ( TGeoNode *  node)

Referenced by SetSensorNamePar().

◆ GetCurrentRotationMatrix()

TMatrixD PndGeoHandling::GetCurrentRotationMatrix ( )

◆ GetGeoMan()

TGeoManager* PndGeoHandling::GetGeoMan ( )
inline

Definition at line 162 of file PndGeoHandling.h.

References GetSensorNamePar().

162 { return fGeoMan; }

◆ GetGeoManager()

void PndGeoHandling::GetGeoManager ( )

◆ GetIdForSensor()

Int_t PndGeoHandling::GetIdForSensor ( TString &  sensName) const
protected

Referenced by operator=().

◆ GetMatrixPath()

TGeoHMatrix* PndGeoHandling::GetMatrixPath ( TString  path)

Referenced by GetMatrixShortId(), and GetOUVShortId().

◆ GetMatrixShortId()

TGeoHMatrix* PndGeoHandling::GetMatrixShortId ( Int_t  shortId)
inline

Definition at line 92 of file PndGeoHandling.h.

References GetMatrixPath(), GetPath(), and GetSensorDimensionsPath().

92 { return GetMatrixPath(GetPath(shortId)); }
TString GetPath(Int_t shortID)
for a given shortID the path is returned
TGeoHMatrix * GetMatrixPath(TString path)

◆ GetNamesLevel()

std::vector<TString> PndGeoHandling::GetNamesLevel ( Int_t  level,
TString  startPath = "" 
)

Referenced by ~PndGeoHandling().

◆ GetOUVPath()

void PndGeoHandling::GetOUVPath ( TString  path,
TVector3 &  o,
TVector3 &  u,
TVector3 &  v 
)

for a volume given by its path the o, u, v vectors for the plane are returned

Referenced by GetOUVShortId(), and ~PndGeoHandling().

◆ GetOUVShortId()

void PndGeoHandling::GetOUVShortId ( Int_t  shortId,
TVector3 &  o,
TVector3 &  u,
TVector3 &  v 
)
inline

Definition at line 84 of file PndGeoHandling.h.

References GetMatrixPath(), GetOUVPath(), and GetPath().

85  {
86  if (fSensorNamePar != 0)
87  GetOUVPath(GetPath(shortId), o, u, v);
88  }
TString GetPath(Int_t shortID)
for a given shortID the path is returned
__m128 v
Definition: P4_F32vec4.h:3
void GetOUVPath(TString path, TVector3 &o, TVector3 &u, TVector3 &v)
for a volume given by its path the o, u, v vectors for the plane are returned

◆ GetPath()

TString PndGeoHandling::GetPath ( Int_t  shortID)

◆ GetRunId()

Int_t PndGeoHandling::GetRunId ( TString  mcFile)

◆ GetSensorDimensionsPath()

TVector3 PndGeoHandling::GetSensorDimensionsPath ( TString  path)

◆ GetSensorDimensionsShortId()

TVector3 PndGeoHandling::GetSensorDimensionsShortId ( Int_t  shortId)
inline

Definition at line 96 of file PndGeoHandling.h.

References GetPath(), GetSensorDimensionsPath(), and MasterToLocalPath().

96 { return GetSensorDimensionsPath(GetPath(shortId)); }
TVector3 GetSensorDimensionsPath(TString path)
TString GetPath(Int_t shortID)
for a given shortID the path is returned

◆ GetSensorNamePar()

void PndGeoHandling::GetSensorNamePar ( )

Referenced by GetGeoMan().

◆ GetSensorNames()

TObjArray* PndGeoHandling::GetSensorNames ( )
inline

Definition at line 142 of file PndGeoHandling.h.

References PndSensorNamePar::GetSensorNames().

143  {
144  if (fSensorNamePar != nullptr)
145  return fSensorNamePar->GetSensorNames();
146  else
147  return nullptr;
148  }
TObjArray * GetSensorNames() const

◆ GetSensorNamesWithString()

std::vector<TString> PndGeoHandling::GetSensorNamesWithString ( TString  value)
inline

Definition at line 150 of file PndGeoHandling.h.

References GetGeoManager(), GetRunId(), and PndSensorNamePar::GetSensorNamesWithString().

151  {
152  if (fSensorNamePar != nullptr)
153  return fSensorNamePar->GetSensorNamesWithString(value);
154  else {
155  std::vector<TString> empty;
156  return empty;
157  }
158  }
std::vector< TString > GetSensorNamesWithString(TString identifier)

◆ GetShortID()

Int_t PndGeoHandling::GetShortID ( TString  path)

for a given path the (unique) position of the sensor path in the fSensorNamePar-List is given. If it is not found -1 is returned.

Referenced by ~PndGeoHandling().

◆ GetVolumeID()

TString PndGeoHandling::GetVolumeID ( TString  name)

returns the volume ID for a given volume name

Referenced by ~PndGeoHandling().

◆ Init()

InitStatus PndGeoHandling::Init ( )
inlineprotected

Definition at line 174 of file PndGeoHandling.h.

References PndSensorNamePar::FillMap().

175  {
176  fSensorNamePar->FillMap();
177  return kSUCCESS;
178  }

◆ InitRuntimeDb()

void PndGeoHandling::InitRuntimeDb ( TString  parFileName)

Referenced by FillSensorMap().

◆ Instance()

static PndGeoHandling* PndGeoHandling::Instance ( )
static

◆ LocalToMasterErrorsPath()

TMatrixD PndGeoHandling::LocalToMasterErrorsPath ( const TMatrixD local,
const TString &  id 
)

◆ LocalToMasterErrorsShortId()

TMatrixD PndGeoHandling::LocalToMasterErrorsShortId ( const TMatrixD local,
const Int_t &  shortId 
)
inline

Definition at line 113 of file PndGeoHandling.h.

References GetCurrentRotationMatrix(), GetPath(), and LocalToMasterErrorsPath().

113 { return LocalToMasterErrorsPath(local, GetPath(shortId)); }
TString GetPath(Int_t shortID)
for a given shortID the path is returned
TMatrixD LocalToMasterErrorsPath(const TMatrixD &local, const TString &id)

◆ LocalToMasterPath()

TVector3 PndGeoHandling::LocalToMasterPath ( const TVector3 &  local,
const TString &  id 
)

◆ LocalToMasterShortId()

TVector3 PndGeoHandling::LocalToMasterShortId ( const TVector3 &  local,
const Int_t &  shortId 
)
inline

Definition at line 104 of file PndGeoHandling.h.

References GetPath(), LocalToMasterPath(), and MasterToLocalErrorsPath().

104 { return LocalToMasterPath(local, GetPath(shortId)); }
TString GetPath(Int_t shortID)
for a given shortID the path is returned
TVector3 LocalToMasterPath(const TVector3 &local, const TString &id)

◆ MasterToLocalErrorsPath()

TMatrixD PndGeoHandling::MasterToLocalErrorsPath ( const TMatrixD master,
const TString &  id 
)

◆ MasterToLocalErrorsShortId()

TMatrixD PndGeoHandling::MasterToLocalErrorsShortId ( const TMatrixD master,
const Int_t &  shortId 
)
inline

Definition at line 109 of file PndGeoHandling.h.

References GetPath(), LocalToMasterErrorsPath(), and MasterToLocalErrorsPath().

109 { return MasterToLocalErrorsPath(master, GetPath(shortId)); }
TString GetPath(Int_t shortID)
for a given shortID the path is returned
TMatrixD MasterToLocalErrorsPath(const TMatrixD &master, const TString &id)

◆ MasterToLocalPath()

TVector3 PndGeoHandling::MasterToLocalPath ( const TVector3 &  master,
const TString &  id 
)

◆ MasterToLocalShortId()

TVector3 PndGeoHandling::MasterToLocalShortId ( const TVector3 &  master,
const Int_t &  shortId 
)
inline

Definition at line 100 of file PndGeoHandling.h.

References GetPath(), LocalToMasterPath(), and MasterToLocalPath().

100 { return MasterToLocalPath(master, GetPath(shortId)); }
TVector3 MasterToLocalPath(const TVector3 &master, const TString &id)
TString GetPath(Int_t shortID)
for a given shortID the path is returned

◆ operator=()

PndGeoHandling& PndGeoHandling::operator= ( const PndGeoHandling )
inline

Definition at line 167 of file PndGeoHandling.h.

References CreateUniqueSensorId(), and GetIdForSensor().

167 { return *this; }

◆ PrintSensorNames()

void PndGeoHandling::PrintSensorNames ( )
inline

Definition at line 136 of file PndGeoHandling.h.

References PndSensorNamePar::Print().

137  {
138  if (fSensorNamePar)
139  fSensorNamePar->Print();
140  }

◆ ReInit()

virtual InitStatus PndGeoHandling::ReInit ( )
inlineprotectedvirtual

Definition at line 180 of file PndGeoHandling.h.

References PndGeoHandling().

181  {
182  fGeoMan = 0;
183  fGeoMan = gGeoManager;
184  return kSUCCESS;
185  }

◆ SetGeoManager()

void PndGeoHandling::SetGeoManager ( TGeoManager *  geo)
inline

Definition at line 118 of file PndGeoHandling.h.

118 { fGeoMan = geo; };

◆ SetParContainers()

virtual void PndGeoHandling::SetParContainers ( )
virtual

Referenced by ~PndGeoHandling().

◆ SetSensorNamePar()

void PndGeoHandling::SetSensorNamePar ( PndSensorNamePar par)
inline

◆ SetVerbose()

void PndGeoHandling::SetVerbose ( Int_t  v)
inline

Definition at line 117 of file PndGeoHandling.h.

References v.

Referenced by PndSdsDetector::SetVerboseLevel().

117 { fVerbose = v; }
__m128 v
Definition: P4_F32vec4.h:3

◆ VolumeIsSensitive()

bool PndGeoHandling::VolumeIsSensitive ( TString &  path,
std::vector< std::string > &  listOfSensitives 
)

Checks if the path contains a substring which matches one of the given strings in listOfSensitives. If not false is returned.

Referenced by SetSensorNamePar().


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