Public Member Functions | Protected Member Functions | Private Types | Private Member Functions | Private Attributes | List of all members
gar::geo::GeometryCore Class Reference

Description of geometry of one entire detector. More...

#include <GeometryCore.h>

Inheritance diagram for gar::geo::GeometryCore:
gar::geo::GeometryGAr

Public Member Functions

 GeometryCore (fhicl::ParameterSet const &pset)
 Initialize geometry from a given configuration. More...
 
 ~GeometryCore ()
 Destructor. More...
 
 GeometryCore (GeometryCore const &)=delete
 
 GeometryCore (GeometryCore &&)=delete
 
GeometryCoreoperator= (GeometryCore const &)=delete
 
GeometryCoreoperator= (GeometryCore &&)=delete
 
double DefaultWiggle () const
 Returns the tolerance used in looking for positions. More...
 
std::string ROOTFile () const
 Returns the full directory path to the geometry file source. More...
 
std::string GDMLFile () const
 Returns the full directory path to the GDML file source. More...
 
unsigned int NChannels () const
 
void ApplyECALSegmentationAlg (std::shared_ptr< gar::geo::seg::SegmentationAlg > pECALSegmentationAlg)
 
void ApplyMinervaSegmentationAlg (std::shared_ptr< gar::geo::seg::SegmentationAlg > pMinervaSegmentationAlg)
 
void ApplyMuIDSegmentationAlg (std::shared_ptr< gar::geo::seg::SegmentationAlg > pMuIDSegmentationAlg)
 
gar::geo::seg::ChannelMapAlg const * ChannelMap () const
 Returns the object handling the channel map. More...
 
gar::geo::seg::SegmentationAlg const * ECALSegmentationAlg () const
 Returns the object handling the ECAL segmentation. More...
 
gar::geo::seg::SegmentationAlg const * MinervaSegmentationAlg () const
 Returns the object handling the Sc Tracker segmentation. More...
 
gar::geo::seg::SegmentationAlg const * MuIDSegmentationAlg () const
 Returns the object handling the MuID segmentation. More...
 
float GetECALInnerBarrelRadius () const
 
float GetECALOuterBarrelRadius () const
 
float GetECALInnerEndcapRadius () const
 
float GetECALOuterEndcapRadius () const
 
float GetPVThickness () const
 
int GetECALInnerSymmetry () const
 
float GetECALInnerAngle () const
 
float GetECALBarrelSideLength () const
 
float GetECALBarrelApothemLength () const
 
float GetECALEndcapSideLength () const
 
float GetECALEndcapApothemLength () const
 
float GetECALEndcapStartX () const
 
float GetECALEndcapOuterX () const
 
bool HasRock () const
 
bool HasEnclosure () const
 
bool HasLArTPCDetector () const
 
bool HasGasTPCDetector () const
 
bool HasECALDetector () const
 
bool HasTrackerScDetector () const
 
bool HasMuonDetector () const
 
float GetMuIDInnerBarrelRadius () const
 
float GetMuIDOuterBarrelRadius () const
 
int GetMuIDInnerSymmetry () const
 
float GetMuIDInnerAngle () const
 
float GetMuIDBarrelSideLength () const
 
float GetMuIDBarrelApothemLength () const
 
std::string GetWorldVolumeName () const
 
bool PointInWorld (TVector3 const &point) const
 
bool PointInDetEnclosure (TVector3 const &point) const
 
bool PointInMPD (TVector3 const &point) const
 
bool PointInGArTPC (TVector3 const &point) const
 
bool PointInLArTPC (TVector3 const &point) const
 
bool PointInECALBarrel (TVector3 const &point) const
 
bool PointInECALEndcap (TVector3 const &point) const
 
float GetSensVolumeThickness (const TVector3 &point) const
 
const std::array< double, 3 > FindShapeSize (const TGeoNode *node) const
 
gar::raw::CellID_t GetCellID (const TGeoNode *node, const unsigned int &det_id, const unsigned int &stave, const unsigned int &module, const unsigned int &layer, const unsigned int &slice, const std::array< double, 3 > &localPosition) const
 
const std::string GetECALCellIDEncoding () const
 
const std::string GetMinervaCellIDEncoding () const
 
const std::string GetMuIDCellIDEncoding () const
 
std::array< double, 3 > GetPosition (const TGeoNode *node, const gar::raw::CellID_t &cID) const
 
bool isTile (const std::array< double, 3 > &point, const gar::raw::CellID_t &cID) const
 
double getStripWidth (const std::array< double, 3 > &point) const
 
double getTileSize (const std::array< double, 3 > &point) const
 
double getStripLength (const std::array< double, 3 > &point, const gar::raw::CellID_t &cID) const
 
std::pair< TVector3, TVector3 > GetStripEnds (const std::array< double, 3 > &point, const gar::raw::CellID_t &cID) const
 
std::pair< float, float > CalculateLightPropagation (const std::array< double, 3 > &point, const std::array< double, 3 > &local, const gar::raw::CellID_t &cID) const
 
std::array< double, 3 > ReconstructStripHitPosition (const std::array< double, 3 > &point, const std::array< double, 3 > &local, const float &xlocal, const gar::raw::CellID_t &cID) const
 
template<>
TGeoNode * FindNode (float const &x, float const &y, float const &z) const
 
template<>
TGeoNode * FindNode (double const &x, double const &y, double const &z) const
 
template<>
TGeoNode * FindNode (float const &x, float const &y, float const &z) const
 
template<>
TGeoNode * FindNode (double const &x, double const &y, double const &z) const
 
Detector information
std::string DetectorName () const
 Returns a string with the name of the detector, as configured. More...
 
void WorldBox (float *xlo, float *xhi, float *ylo, float *yhi, float *zlo, float *zhi) const
 Fills the arguments with the boundaries of the world. More...
 
double SurfaceY () const
 The position of the detector respect to earth surface. More...
 
TGeoManager * ROOTGeoManager () const
 Access to the ROOT geometry description manager. More...
 
float GetOriginX () const
 
float GetOriginY () const
 
float GetOriginZ () const
 
float GetWorldX () const
 
float GetWorldY () const
 
float GetWorldZ () const
 
float GetWorldHalfWidth () const
 
float GetWorldHalfHeight () const
 
float GetWorldLength () const
 
float GetRockX () const
 
float GetRockY () const
 
float GetRockZ () const
 
float GetRockHalfWidth () const
 
float GetRockHalfHeight () const
 
float GetRockLength () const
 
float GetEnclosureX () const
 
float GetEnclosureY () const
 
float GetEnclosureZ () const
 
float GetEnclosureHalfWidth () const
 
float GetEnclosureHalfHeight () const
 
float GetEnclosureLength () const
 
float GetMPDX () const
 
float GetMPDY () const
 
float GetMPDZ () const
 
float GetMPDHalfWidth () const
 
float GetMPDHalfHeight () const
 
float GetMPDLength () const
 
float GetLArTPCX () const
 
float GetLArTPCY () const
 
float GetLArTPCZ () const
 
float GetActiveLArTPCX () const
 
float GetActiveLArTPCY () const
 
float GetActiveLArTPCZ () const
 
float GetLArTPCHalfWidth () const
 
float GetLArTPCHalfHeight () const
 
float GetLArTPCLength () const
 
float GetActiveLArTPCHalfWidth () const
 
float GetActiveLArTPCHalfHeight () const
 
float GetActiveLArTPCLength () const
 
unsigned int GetNLayers (std::string det) const
 
std::map< gar::geo::LayeredCalorimeterData::LayoutType, std::shared_ptr< gar::geo::LayeredCalorimeterData > > GetECALLayeredCalorimeterData () const
 
float GArLiteXCent () const
 
float GArLiteYCent () const
 
float GArLiteZCent () const
 
float GArLiteRadius () const
 
float GArLiteLength () const
 
const std::string VolumeName (TVector3 const &point) const
 Returns the name of the deepest volume containing specified point. More...
 
std::vector< TGeoNode const * > FindVolumePath (std::string const &vol_name) const
 Returns all the nodes with volumes with any of the specified names. More...
 
bool FindFirstVolume (std::string const &name, std::vector< const TGeoNode * > &path) const
 
void StoreECALNodes (std::map< std::string, std::vector< const TGeoNode * >> &map) const
 
std::vector< TGeoNode const * > FindAllVolumes (std::set< std::string > const &vol_names) const
 Returns all the nodes with volumes with any of the specified names. More...
 
std::vector< std::vector< TGeoNode const * > > FindAllVolumePaths (std::set< std::string > const &vol_names) const
 Returns paths of all nodes with volumes with the specified names. More...
 
template<typename T >
TGeoNode * FindNode (T const &x, T const &y, T const &z) const
 
TGeoNode * FindNode (std::array< double, 3 > const &point) const
 
TGeoNode * FindNode (TVector3 const &point) const
 
bool WorldToLocal (std::array< double, 3 > const &world, std::array< double, 3 > &local, gar::geo::LocalTransformation< TGeoHMatrix > &trans) const
 
bool LocalToWorld (std::array< double, 3 > const &local, std::array< double, 3 > &world, gar::geo::LocalTransformation< TGeoHMatrix > const &trans) const
 
const std::string MaterialName (TVector3 const &point)
 Name of the deepest material containing the point xyz. More...
 
TGeoMaterial const * Material (double x, double y, double z) const
 
double TotalMass (const char *vol="volWorld") const
 
double MassBetweenPoints (double *p1, double *p2) const
 Return the column density between two points. More...
 
float TPCRadius () const
 Returns the radius of the TPC (y or z direction) More...
 
float TPCLength () const
 Returns the length of the TPC (x direction) More...
 
int TPCNumDriftVols () const
 Returns number of TPC drift volumes. More...
 
float TPCXCent () const
 Returns the X location of the center of the TPC in cm. More...
 
float TPCYCent () const
 Returns the Y location of the center of the TPC in cm. More...
 
float TPCZCent () const
 Returns the Z location of the center of the TPC in cm. More...
 
std::string GetGArTPCVolumeName () const
 Return the name of GAr TPC volume. More...
 
unsigned int NearestChannel (float const worldLoc[3]) const
 Returns the ID of the channel nearest to the specified position. More...
 
unsigned int NearestChannel (std::vector< float > const &worldLoc) const
 
unsigned int NearestChannel (TVector3 const &worldLoc) const
 
void NearestChannelInfo (float const *xyz, gar::geo::ChanWithNeighbors &cwn) const
 
float GetIROCInnerRadius () const
 radii query methods passing through to the channel map algorithm More...
 
float GetIROCOuterRadius () const
 
float GetOROCInnerRadius () const
 
float GetOROCOuterRadius () const
 
float GetOROCPadHeightChangeRadius () const
 
unsigned int GapChannelNumber () const
 Returns the ID of the channel representing a gap if you call NearestChannel and get this channel number, then charge is lost. More...
 
void ChannelToPosition (unsigned int const channel, float *const worldLoc) const
 
bool ValueInRange (double value, double min, double max) const
 Returns whether a value is within the specified range. More...
 
Geometry initialization
void LoadGeometryFile (std::string const &gdmlfile, std::string const &rootfile, bool bForceReload=false)
 Loads the geometry information from the specified files. More...
 
void ApplyChannelMap (std::shared_ptr< gar::geo::seg::ChannelMapAlg > pChannelMap)
 Initializes the geometry to work with this channel map. More...
 

Protected Member Functions

void SetDetectorName (std::string new_name)
 Sets the detector name. More...
 
void GetGeometryParameters ()
 
void FinalizeGeometryParameters ()
 
void PrintGeometry () const
 
void StoreTPCParameters ()
 
void GetDetectorsPresent ()
 

Private Types

typedef std::shared_ptr< const gar::geo::seg::ChannelMapAlgChannelMapPtr
 
typedef std::shared_ptr< const gar::geo::seg::SegmentationAlgECALSegmentationAlgPtr
 
typedef std::shared_ptr< const gar::geo::seg::SegmentationAlgMinervaSegmentationAlgPtr
 
typedef std::shared_ptr< const gar::geo::seg::SegmentationAlgMuIDSegmentationAlgPtr
 
typedef std::map< gar::geo::LayeredCalorimeterData::LayoutType, std::shared_ptr< gar::geo::LayeredCalorimeterData > > ECALLayeredCalorimeterData
 

Private Member Functions

void InitVariables ()
 
void ClearGeometry ()
 Deletes the detector geometry structures. More...
 
void StoreECALParameters ()
 
void StoreMuIDParameters ()
 
void StoreOtherParameters ()
 
void SetDetectorOrigin ()
 
bool FindWorldVolume ()
 
bool FindRockVolume ()
 
bool FindEnclosureVolume ()
 
bool FindMPDVolume ()
 
bool FindLArTPCVolume ()
 
bool FindActiveTPCVolume ()
 
bool FindActiveLArTPCVolume ()
 
bool FindGasTPCVolume ()
 
bool FindECALVolume ()
 
bool FindMuIDVolume ()
 
bool FindECALInnerBarrelRadius ()
 
bool FindECALOuterBarrelRadius ()
 
bool FindECALInnerEndcapRadius ()
 
bool FindECALOuterEndcapRadius ()
 
bool FindPVThickness ()
 
bool FindECALInnerSymmetry ()
 
bool FindECALEndcapStartX ()
 
bool FindECALEndcapOuterX ()
 
bool FindECALnLayers ()
 
bool MakeECALLayeredCalorimeterData ()
 
bool FindMuIDInnerBarrelRadius ()
 
bool FindMuIDOuterBarrelRadius ()
 
bool FindMuIDInnerSymmetry ()
 
bool FindMuIDnLayers ()
 
bool FindTrackerScVolume ()
 
bool FindTrackerScnPlanes ()
 

Private Attributes

double fSurfaceY
 The point where air meets earth for this detector. More...
 
std::string fDetectorName
 Name of the detector. More...
 
std::string fGDMLfile
 path to geometry file used for Geant4 simulation More...
 
std::string fROOTfile
 path to geometry file for geometry in GeometryCore More...
 
double fMinWireZDist
 to look for the closest wire More...
 
double fPositionWiggle
 accounting for rounding errors when testing positions More...
 
bool fPointInWarnings
 Generate warnings from failed inputs to PointIn* methods. More...
 
bool fECALEndcapOutside
 Is the ECAL Endcap outside the PV. More...
 
float fOriginX = 0.
 
float fOriginY = 0.
 
float fOriginZ = 0.
 
float fTPCRadius = 0.
 Radius of the TPC. More...
 
float fTPCLength = 0.
 length of the TPC More...
 
int fTPCNumDriftVols = 2
 2 if standard ALICE detector, 1 if single drift vol More...
 
float fTPCXCent = 0.
 center of TPC: X More...
 
float fTPCYCent = 0.
 center of TPC: Y More...
 
float fTPCZCent = 0.
 center of TPC: Z More...
 
float fWorldX = 0.
 
float fWorldY = 0.
 
float fWorldZ = 0.
 
float fRockX = 0.
 
float fRockY = 0.
 
float fRockZ = 0.
 
float fEnclosureX = 0.
 
float fEnclosureY = 0.
 
float fEnclosureZ = 0.
 
float fMPDX = 0.
 
float fMPDY = 0.
 
float fMPDZ = 0.
 
float fLArTPCX = 0.
 
float fLArTPCY = 0.
 
float fLArTPCZ = 0.
 
float fLArTPCXCent = 0.
 
float fLArTPCYCent = 0.
 
float fLArTPCZCent = 0.
 
float fWorldHalfWidth = 0.
 
float fWorldHalfHeight = 0.
 
float fWorldLength = 0.
 
float fRockHalfWidth = 0.
 
float fRockHalfHeight = 0.
 
float fRockLength = 0.
 
float fEnclosureHalfWidth = 0.
 
float fEnclosureHalfHeight = 0.
 
float fEnclosureLength = 0.
 
float fMPDHalfWidth = 0.
 
float fMPDHalfHeight = 0.
 
float fMPDLength = 0.
 
float fLArTPCHalfWidth = 0.
 
float fLArTPCHalfHeight = 0.
 
float fLArTPCLength = 0.
 
float fLArTPCActiveHalfWidth = 0.
 
float fLArTPCActiveHalfHeight = 0.
 
float fLArTPCActiveLength = 0.
 
float fGArLiteXCent = 0
 
float fGArLiteYCent = 0
 
float fGArLiteZCent = 0
 
float fGArLiteRadius = 0
 
float fGArLiteLength = 0
 
std::map< std::string, std::vector< const TGeoNode * > > fECALNodePath
 Stored map of vectors of nodes for the ecal to speedup node searching. More...
 
bool fHasRock
 
bool fHasEnclosure
 
bool fHasLArTPCDetector
 
bool fHasGasTPCDetector
 
bool fHasECALDetector
 
bool fHasTrackerScDetector
 
float fECALRinner
 Minimum radius of the ECAL inner barrel. More...
 
float fECALRouter
 Minimum radius of the ECAL outer barrel. More...
 
float fECALECapRinner
 
float fECALECapRouter
 
float fPVThickness
 Pressure Vessel thickness. More...
 
int fECALSymmetry
 Number of sides of the Barrel. More...
 
float fECALEndcapStartX
 Position of the start xplane of the ECAL endcap. More...
 
float fECALEndcapOuterX
 Position of the end xplane of the ECAL endcap. More...
 
unsigned int fECALnLayers
 number of ECAL layers from the seg algorithm More...
 
unsigned int fTrackerScnPlanes
 
bool fHasMuonDetector
 
float fMuIDRinner
 Minimum radius of the MuID inner barrel. More...
 
float fMuIDRouter
 Minimum radius of the MuID outer barrel. More...
 
int fMuIDSymmetry
 Number of sides of the MuID Barrel. More...
 
unsigned int fMuIDnLayers
 number of MuID layers from the seg algorithm More...
 
ChannelMapPtr fChannelMapAlg
 Object containing the channel to wire mapping. More...
 
ECALSegmentationAlgPtr fECALSegmentationAlg
 Object containing the segmentation for the ECAL. More...
 
MinervaSegmentationAlgPtr fMinervaSegmentationAlg
 Object containing the segmentation for the Sc Tracker. More...
 
MuIDSegmentationAlgPtr fMuIDSegmentationAlg
 Object containing the segmentation for the Sc Tracker. More...
 
ECALLayeredCalorimeterData fECALLayeredCalorimeterData
 

Detailed Description

Description of geometry of one entire detector.


Note
All lengths are specified in centimetres
    How to correctly instantiate a GeometryCore object
    ---------------------------------------------------

    Instantiation is a multi-step procedure:
    1. construct a GeometryCore object (the "service provider"),
       with the full configuration; at this step, configuration is just stored
    2. load a geometry with GeometryCore::LoadGeometryFile();
       this loads the detector geometry information
    3. prepare a channel map algorithm object (might use for example
       GeometryCore::DetectorName() or the detector geometry from the
       newly created object, but any use of channel mapping related functions
       is forbidden and it would yield undefined behaviour (expected to be
       catastrophic)
    4. acquire the channel mapping algorithm with
       GeometryCore::ApplyChannelMap(); at this point, the ChannelMapAlg object
       is asked to initialize itself and to perform whatever modifications to
       the geometry provider is needed.

    Step 3 (creation of the channel mapping algorithm object) can be performed
    at any time before step 4, provided that no GeometryCore instance is needed
    for it.


    Configuration parameters
    -------------------------

    - *Name* (string; mandatory): string identifying the detector; it can be
      different from the base name of the file used to initialize the geometry;
      standard names are recommended by each experiment.
      This name can be used, for example, to select which channel mapping
      algorithm to use.
    - *SurfaceY* (real; mandatory): depth of the detector, in centimetrs;
      see SurfaceY() for details
- *MinWireZDist* (real; default: 3)

Definition at line 436 of file GeometryCore.h.

Member Typedef Documentation

Definition at line 1267 of file GeometryCore.h.

Definition at line 1280 of file GeometryCore.h.

Definition at line 1270 of file GeometryCore.h.

Definition at line 1273 of file GeometryCore.h.

Definition at line 1276 of file GeometryCore.h.

Constructor & Destructor Documentation

gar::geo::GeometryCore::GeometryCore ( fhicl::ParameterSet const &  pset)

Initialize geometry from a given configuration.

Parameters
psetconfiguration parameters

This constructor does not load any geometry description. The next step is to do exactly that, by GeometryCore::LoadGeometryFile().

Definition at line 51 of file GeometryCore.cxx.

52  : fSurfaceY (pset.get< double >("SurfaceY" ))
53  , fDetectorName (pset.get< std::string >("Name" ))
54  , fPositionWiggle (pset.get< double >("PositionEpsilon", 1.e-4))
55  , fPointInWarnings (pset.get< bool >("PointInWarnings", false))
56  , fECALEndcapOutside (pset.get< bool >("ECALEndcapOutsidePV", true))
57  {
58  std::transform(fDetectorName.begin(), fDetectorName.end(), fDetectorName.begin(), ::tolower);
59 
60  InitVariables();
61  } // GeometryCore::GeometryCore()
bool fECALEndcapOutside
Is the ECAL Endcap outside the PV.
std::string string
Definition: nybbler.cc:12
bool fPointInWarnings
Generate warnings from failed inputs to PointIn* methods.
std::string fDetectorName
Name of the detector.
double fSurfaceY
The point where air meets earth for this detector.
double fPositionWiggle
accounting for rounding errors when testing positions
gar::geo::GeometryCore::~GeometryCore ( )

Destructor.

Definition at line 65 of file GeometryCore.cxx.

66  {
67  ClearGeometry();
68  } // GeometryCore::~GeometryCore()
void ClearGeometry()
Deletes the detector geometry structures.
gar::geo::GeometryCore::GeometryCore ( GeometryCore const &  )
delete
gar::geo::GeometryCore::GeometryCore ( GeometryCore &&  )
delete

Member Function Documentation

void gar::geo::GeometryCore::ApplyChannelMap ( std::shared_ptr< gar::geo::seg::ChannelMapAlg pChannelMap)

Initializes the geometry to work with this channel map.

Parameters
pChannelMapa pointer to the channel mapping algorithm to be used
See also
LoadGeometryFile()

The specified channel mapping is used with this geometry. The algorithm object is asked and allowed to make the necessary modifications to the geometry description. These modifications typically involve some resorting of the objects.

The ownership of the algorithm object is shared, usually with a calling framework: we maintain it alive as long as we need it (and no other code can delete it), and we delete it only if no other code is sharing the ownership.

This method needs to be called after LoadGeometryFile() to complete the geometry initialization.

void gar::geo::GeometryCore::ApplyECALSegmentationAlg ( std::shared_ptr< gar::geo::seg::SegmentationAlg pECALSegmentationAlg)

Definition at line 79 of file GeometryCore.cxx.

80  {
81  pECALSegmentationAlg->Initialize(*this);
82  fECALSegmentationAlg = pECALSegmentationAlg;
83  } // GeometryCore::ApplyECALSegmentationAlg()
ECALSegmentationAlgPtr fECALSegmentationAlg
Object containing the segmentation for the ECAL.
void gar::geo::GeometryCore::ApplyMinervaSegmentationAlg ( std::shared_ptr< gar::geo::seg::SegmentationAlg pMinervaSegmentationAlg)

Definition at line 86 of file GeometryCore.cxx.

87  {
88  pMinervaSegmentationAlg->Initialize(*this);
89  fMinervaSegmentationAlg = pMinervaSegmentationAlg;
90  } // GeometryCore::ApplyMinervaSegmentationAlg()
MinervaSegmentationAlgPtr fMinervaSegmentationAlg
Object containing the segmentation for the Sc Tracker.
void gar::geo::GeometryCore::ApplyMuIDSegmentationAlg ( std::shared_ptr< gar::geo::seg::SegmentationAlg pMuIDSegmentationAlg)

Definition at line 93 of file GeometryCore.cxx.

94  {
95  pMuIDSegmentationAlg->Initialize(*this);
96  fMuIDSegmentationAlg = pMuIDSegmentationAlg;
97  } // GeometryCore::ApplyMuIDSegmentationAlg()
MuIDSegmentationAlgPtr fMuIDSegmentationAlg
Object containing the segmentation for the Sc Tracker.
std::pair< float, float > gar::geo::GeometryCore::CalculateLightPropagation ( const std::array< double, 3 > &  point,
const std::array< double, 3 > &  local,
const gar::raw::CellID_t cID 
) const

Definition at line 997 of file GeometryCore.cxx.

998  {
999  std::pair<float, float> light_prop;
1000  std::string node_name = this->FindNode(point)->GetName();
1001  const std::array<double, 3> shape = this->FindShapeSize(this->FindNode(point));
1002 
1003  if(node_name.find("ECal") != std::string::npos || node_name.find("ECAL") != std::string::npos || node_name.find("ecal") != std::string::npos) {
1004  fECALSegmentationAlg->setLayerDimXY(shape[0] * 2, shape[1] * 2);
1006  light_prop = fECALSegmentationAlg->CalculateLightPropagation(*this, local, cID);
1007  }
1008 
1009  if(node_name.find("Yoke") != std::string::npos || node_name.find("yoke") != std::string::npos) {
1010  fMuIDSegmentationAlg->setLayerDimXY(shape[0] * 2, shape[1] * 2);
1011  fMuIDSegmentationAlg->setVariables(GetMuIDInnerAngle(), 0.);
1012  light_prop = fMuIDSegmentationAlg->CalculateLightPropagation(*this, local, cID);
1013  }
1014 
1015  return light_prop;
1016  }
TGeoNode * FindNode(T const &x, T const &y, T const &z) const
std::string string
Definition: nybbler.cc:12
ECALSegmentationAlgPtr fECALSegmentationAlg
Object containing the segmentation for the ECAL.
const std::array< double, 3 > FindShapeSize(const TGeoNode *node) const
float GetMuIDInnerAngle() const
float GetECALInnerAngle() const
Definition: GeometryCore.h:960
MuIDSegmentationAlgPtr fMuIDSegmentationAlg
Object containing the segmentation for the Sc Tracker.
float GetECALEndcapSideLength() const
Definition: GeometryCore.h:969
gar::geo::seg::ChannelMapAlg const* gar::geo::GeometryCore::ChannelMap ( ) const
inline

Returns the object handling the channel map.

Definition at line 930 of file GeometryCore.h.

930 { return fChannelMapAlg.get(); }
ChannelMapPtr fChannelMapAlg
Object containing the channel to wire mapping.
void gar::geo::GeometryCore::ChannelToPosition ( unsigned int const  channel,
float *const  worldLoc 
) const

Definition at line 799 of file GeometryCore.cxx.

800  {
801  return fChannelMapAlg->ChannelToPosition(channel, worldLoc);
802  }
uint8_t channel
Definition: CRTFragment.hh:201
ChannelMapPtr fChannelMapAlg
Object containing the channel to wire mapping.
void gar::geo::GeometryCore::ClearGeometry ( )
private

Deletes the detector geometry structures.

Definition at line 215 of file GeometryCore.cxx.

215  {
216 
217  return;
218  } // GeometryCore::ClearGeometry()
double gar::geo::GeometryCore::DefaultWiggle ( ) const
inline

Returns the tolerance used in looking for positions.

Returns
the tolerance value

This parameter is used as tolerance ("wiggle") for methods that require Typically, it's a additional fraction of tolerance: 0 means no tolerance, 0.1 means 10% tolerance.

Todo:
Confirm the definition of wiggle: this one is taken from other doc

Definition at line 468 of file GeometryCore.h.

468 { return fPositionWiggle; }
double fPositionWiggle
accounting for rounding errors when testing positions
std::string gar::geo::GeometryCore::DetectorName ( ) const
inline

Returns a string with the name of the detector, as configured.

Definition at line 495 of file GeometryCore.h.

495 { return fDetectorName; }
std::string fDetectorName
Name of the detector.
gar::geo::seg::SegmentationAlg const* gar::geo::GeometryCore::ECALSegmentationAlg ( ) const
inline

Returns the object handling the ECAL segmentation.

Definition at line 933 of file GeometryCore.h.

933 { return fECALSegmentationAlg.get(); }
ECALSegmentationAlgPtr fECALSegmentationAlg
Object containing the segmentation for the ECAL.
void gar::geo::GeometryCore::FinalizeGeometryParameters ( )
protected

Definition at line 1063 of file GeometryCore.cxx.

1064  {
1065  if(fHasECALDetector) {
1066  FindECALnLayers();
1069  }
1070 
1071  if(fHasMuonDetector) {
1072  FindMuIDnLayers();
1073  }
1074 
1075  if(fHasTrackerScDetector) {
1077  }
1078  }
void StoreECALNodes(std::map< std::string, std::vector< const TGeoNode * >> &map) const
std::map< std::string, std::vector< const TGeoNode * > > fECALNodePath
Stored map of vectors of nodes for the ecal to speedup node searching.
bool gar::geo::GeometryCore::FindActiveLArTPCVolume ( )
private

Definition at line 1382 of file GeometryCore.cxx.

1383  {
1384  // check if the current level of the detector is the active TPC volume, if
1385  // not, then dig a bit deeper
1386  std::vector<TGeoNode const*> path = this->FindVolumePath("volArgonCubeActive");
1387  if(path.size() == 0)
1388  return false;
1389 
1390  const TGeoNode *LArTPC_node = path.at(path.size()-1);
1391  if(LArTPC_node == nullptr) {
1392  std::cout << "Cannot find node volArgonCubeActive_0" << std::endl;
1393  return false;
1394  }
1395 
1396  TGeoMatrix *mat = LArTPC_node->GetMatrix();
1397  const double *origin = mat->GetTranslation();
1398 
1399  //Get the origin correctly
1400  fLArTPCXCent = fWorldX + fRockX + fEnclosureX + fLArTPCX + origin[0];
1401  fLArTPCYCent = fWorldY + fRockY + fEnclosureY + fLArTPCY + origin[1];
1402  fLArTPCZCent = fWorldZ + fRockZ + fEnclosureZ + fLArTPCZ + origin[2];
1403 
1404  //Get the dimension of the active volume
1405  fLArTPCActiveHalfWidth = ((TGeoBBox*)LArTPC_node->GetVolume()->GetShape())->GetDZ();
1406  fLArTPCActiveHalfHeight = ((TGeoBBox*)LArTPC_node->GetVolume()->GetShape())->GetDY();
1407  fLArTPCActiveLength = 2.0 * ((TGeoBBox*)LArTPC_node->GetVolume()->GetShape())->GetDX();
1408 
1409  return true;
1410  }
std::vector< TGeoNode const * > FindVolumePath(std::string const &vol_name) const
Returns all the nodes with volumes with any of the specified names.
constexpr Point origin()
Returns a origin position with a point of the specified type.
Definition: geo_vectors.h:227
QTextStream & endl(QTextStream &s)
bool gar::geo::GeometryCore::FindActiveTPCVolume ( )
private

Definition at line 1413 of file GeometryCore.cxx.

1414  {
1415  // check if the current level of the detector is the active TPC volume, if
1416  // not, then dig a bit deeper
1417  std::vector<TGeoNode const*> path = this->FindVolumePath("TPCGas_vol");
1418  if(path.size() == 0)
1419  path = this->FindVolumePath("volTPCGas");
1420  if(path.size() == 0)
1421  return false;
1422 
1423  const TGeoNode *GArTPC_node = path.at(path.size()-1);
1424  if(GArTPC_node == nullptr) {
1425  std::cout << "Cannot find node TPCGas_vol_0/TPCGas_vol_0" << std::endl;
1426  return false;
1427  }
1428 
1429  TGeoMatrix *mat = GArTPC_node->GetMatrix();
1430  const double *origin = mat->GetTranslation();
1431 
1432  //Get the origin correctly
1433  fTPCXCent = fWorldX + fRockX + fEnclosureX + fMPDX + origin[0];
1434  fTPCYCent = fWorldY + fRockY + fEnclosureY + fMPDY + origin[1];
1435  fTPCZCent = fWorldZ + fRockZ + fEnclosureZ + fMPDZ + origin[2];
1436 
1437  //Get the dimension of the active volume
1438  TGeoVolume *activeVol = GArTPC_node->GetVolume();
1439  float rOuter = ((TGeoTube*)activeVol->GetShape())->GetRmax();
1440 
1441  fTPCRadius = rOuter;
1442  fTPCLength = 2.0 * ((TGeoTube*)activeVol->GetShape())->GetDZ();
1443 
1444  // suggest -- figure out how many TPC drift volumes there are and set fTPCNumDriftVols here.
1445  fTPCNumDriftVols = 2;
1446 
1447  return true;
1448  }
float fTPCXCent
center of TPC: X
float fTPCLength
length of the TPC
std::vector< TGeoNode const * > FindVolumePath(std::string const &vol_name) const
Returns all the nodes with volumes with any of the specified names.
float fTPCRadius
Radius of the TPC.
float fTPCYCent
center of TPC: Y
int fTPCNumDriftVols
2 if standard ALICE detector, 1 if single drift vol
float fTPCZCent
center of TPC: Z
constexpr Point origin()
Returns a origin position with a point of the specified type.
Definition: geo_vectors.h:227
QTextStream & endl(QTextStream &s)
std::vector< std::vector< TGeoNode const * > > gar::geo::GeometryCore::FindAllVolumePaths ( std::set< std::string > const &  vol_names) const

Returns paths of all nodes with volumes with the specified names.

Parameters
vol_nameslist of names of volumes
Returns
list paths of the found nodes

All the nodes in the geometry are checked, and the path of all the ones that contain a volume with a name among the ones specified in vol_names is saved in the collection and returned. A node path is a ordered list of all nodes leading to the final one, starting from thetop level (root) down. The node at the back() of the path is the one with name in vol_names. No empty paths are returned.

Definition at line 353 of file GeometryCore.cxx.

354  {
355  CollectPathsByName path_collector(vol_names);
356 
357  ROOTGeoNodeForwardIterator iNode(ROOTGeoManager()->GetTopNode());
358 
359  while (*iNode) {
360  path_collector(iNode);
361  ++iNode;
362  } // while
363 
364  return path_collector.paths;
365  } // GeometryCore::FindAllVolumePaths()
TGeoManager * ROOTGeoManager() const
Access to the ROOT geometry description manager.
std::vector< TGeoNode const * > gar::geo::GeometryCore::FindAllVolumes ( std::set< std::string > const &  vol_names) const

Returns all the nodes with volumes with any of the specified names.

Parameters
vol_nameslist of names of volumes
Returns
list of nodes found

All the nodes in the geometry are checked, and all the ones that contain a volume with a name among the ones specified in vol_names are saved in the collection and returned.

Definition at line 337 of file GeometryCore.cxx.

338  {
339  CollectNodesByName node_collector(vol_names);
340 
341  ROOTGeoNodeForwardIterator iNode(ROOTGeoManager()->GetTopNode());
342  TGeoNode const* pCurrentNode;
343 
344  while ((pCurrentNode = *iNode)) {
345  node_collector(*pCurrentNode);
346  ++iNode;
347  } // while
348 
349  return node_collector.nodes;
350  } // GeometryCore::FindAllVolumes()
TGeoManager * ROOTGeoManager() const
Access to the ROOT geometry description manager.
bool gar::geo::GeometryCore::FindECALEndcapOuterX ( )
private

Definition at line 1602 of file GeometryCore.cxx.

1603  {
1604  //Find the ecal Endcap
1605  TGeoVolume *vol_e = gGeoManager->FindVolumeFast("EndcapECal_vol");
1606  if(!vol_e)
1607  vol_e = gGeoManager->FindVolumeFast("volEndcapECal");
1608  if(!vol_e)
1609  return false;
1610 
1611  fECALEndcapOuterX = ((TGeoBBox*)vol_e->GetShape())->GetDZ();
1612 
1613  return true;
1614  }
float fECALEndcapOuterX
Position of the end xplane of the ECAL endcap.
bool gar::geo::GeometryCore::FindECALEndcapStartX ( )
private

Definition at line 1575 of file GeometryCore.cxx.

1576  {
1577  if(fECALEndcapOutside){
1578  //Find the PV Endcap
1579  TGeoVolume *vol_pv = gGeoManager->FindVolumeFast("PVEndcap_vol");
1580  if(!vol_pv)
1581  vol_pv = gGeoManager->FindVolumeFast("volPVEndcap");
1582  if(!vol_pv)
1583  return false;
1584 
1585  TGeoVolume *vol_tpc_chamber = gGeoManager->FindVolumeFast("volGArTPC");
1586  if(!vol_tpc_chamber) return false;
1587 
1588  //The start of the endcap is after the pv endcap -> sum of tpc chamber length and pressure vessel bulge
1589  fECALEndcapStartX = ((TGeoBBox*)vol_pv->GetShape())->GetDZ()*2 + ((TGeoBBox*)vol_tpc_chamber->GetShape())->GetDZ();
1590  } else {
1591  TGeoVolume *vol_tpc_chamber = gGeoManager->FindVolumeFast("volGArTPC");
1592  if(!vol_tpc_chamber) return false;
1593 
1594  //The start of the endcap is after the tpc chamber length
1595  fECALEndcapStartX = ((TGeoBBox*)vol_tpc_chamber->GetShape())->GetDZ();
1596  }
1597 
1598  return true;
1599  }
bool fECALEndcapOutside
Is the ECAL Endcap outside the PV.
float fECALEndcapStartX
Position of the start xplane of the ECAL endcap.
bool gar::geo::GeometryCore::FindECALInnerBarrelRadius ( )
private

Definition at line 1483 of file GeometryCore.cxx.

1484  {
1485  TGeoVolume *vol = gGeoManager->FindVolumeFast("BarrelECal_vol");
1486  if(!vol)
1487  vol = gGeoManager->FindVolumeFast("volBarrelECal");
1488  if(!vol)
1489  return false;
1490 
1491  fECALRinner = ((TGeoPgon*)vol->GetShape())->GetRmin(0);
1492 
1493  return true;
1494  }
float fECALRinner
Minimum radius of the ECAL inner barrel.
bool gar::geo::GeometryCore::FindECALInnerEndcapRadius ( )
private

Definition at line 1511 of file GeometryCore.cxx.

1512  {
1513  TGeoVolume *vol = gGeoManager->FindVolumeFast("EndcapECal_vol");
1514  if(!vol)
1515  vol = gGeoManager->FindVolumeFast("volEndcapECal");
1516  if(!vol)
1517  return false;
1518 
1519  fECALECapRinner = 0.;
1520 
1521  return true;
1522  }
bool gar::geo::GeometryCore::FindECALInnerSymmetry ( )
private

Definition at line 1561 of file GeometryCore.cxx.

1562  {
1563  TGeoVolume *vol = gGeoManager->FindVolumeFast("BarrelECal_vol");
1564  if(!vol)
1565  vol = gGeoManager->FindVolumeFast("volBarrelECal");
1566  if(!vol)
1567  return false;
1568 
1569  fECALSymmetry = ((TGeoPgon*)vol->GetShape())->GetNedges();
1570 
1571  return true;
1572  }
int fECALSymmetry
Number of sides of the Barrel.
bool gar::geo::GeometryCore::FindECALnLayers ( )
private

Definition at line 1617 of file GeometryCore.cxx.

1618  {
1620  fECALnLayers = fECALSegmentationAlg->nLayers();
1621 
1622  return true;
1623  }
ECALSegmentationAlgPtr fECALSegmentationAlg
Object containing the segmentation for the ECAL.
unsigned int fECALnLayers
number of ECAL layers from the seg algorithm
bool gar::geo::GeometryCore::FindECALOuterBarrelRadius ( )
private

Definition at line 1497 of file GeometryCore.cxx.

1498  {
1499  TGeoVolume *vol = gGeoManager->FindVolumeFast("BarrelECal_vol");
1500  if(!vol)
1501  vol = gGeoManager->FindVolumeFast("volBarrelECal");
1502  if(!vol)
1503  return false;
1504 
1505  fECALRouter = ((TGeoPgon*)vol->GetShape())->GetRmax(0);
1506 
1507  return true;
1508  }
float fECALRouter
Minimum radius of the ECAL outer barrel.
bool gar::geo::GeometryCore::FindECALOuterEndcapRadius ( )
private

Definition at line 1525 of file GeometryCore.cxx.

1526  {
1527  if(fECALEndcapOutside){
1528  fECALECapRouter = fECALRouter; //should be equal
1529  } else {
1530  //Inside the Pressure Vessel
1531  TGeoVolume *vol = gGeoManager->FindVolumeFast("EndcapECal_vol");
1532  if(!vol)
1533  vol = gGeoManager->FindVolumeFast("volEndcapECal");
1534  if(!vol)
1535  return false;
1536 
1537  fECALECapRouter = ((TGeoBBox*)vol->GetShape())->GetDX();
1538  }
1539 
1540  return true;
1541  }
bool fECALEndcapOutside
Is the ECAL Endcap outside the PV.
float fECALRouter
Minimum radius of the ECAL outer barrel.
bool gar::geo::GeometryCore::FindECALVolume ( )
private

Definition at line 1461 of file GeometryCore.cxx.

1462  {
1463  TGeoVolume *vol = gGeoManager->FindVolumeFast("BarrelECal_vol");
1464  if(!vol)
1465  vol = gGeoManager->FindVolumeFast("volBarrelECal");
1466  if(!vol)
1467  return false;
1468 
1469  return true;
1470  }
bool gar::geo::GeometryCore::FindEnclosureVolume ( )
private

Definition at line 1304 of file GeometryCore.cxx.

1305  {
1306  std::vector<TGeoNode const*> path = this->FindVolumePath("volDetEnclosure");
1307  if(path.size() == 0) return false;
1308 
1309  const TGeoNode *enc_node = path.at(path.size()-1);
1310  if(enc_node == nullptr) {
1311  std::cout << "Cannot find node volDetEnclosure_0" << std::endl;
1312  return false;
1313  }
1314 
1315  const double *origin = enc_node->GetMatrix()->GetTranslation();
1316 
1317  fEnclosureX = origin[0];
1318  fEnclosureY = origin[1];
1319  fEnclosureZ = origin[2];
1320 
1321  fEnclosureHalfWidth = ((TGeoBBox*)enc_node->GetVolume()->GetShape())->GetDZ();
1322  fEnclosureHalfHeight = ((TGeoBBox*)enc_node->GetVolume()->GetShape())->GetDY();
1323  fEnclosureLength = 2.0 * ((TGeoBBox*)enc_node->GetVolume()->GetShape())->GetDX();
1324 
1325  return true;
1326  }
std::vector< TGeoNode const * > FindVolumePath(std::string const &vol_name) const
Returns all the nodes with volumes with any of the specified names.
constexpr Point origin()
Returns a origin position with a point of the specified type.
Definition: geo_vectors.h:227
QTextStream & endl(QTextStream &s)
bool gar::geo::GeometryCore::FindFirstVolume ( std::string const &  name,
std::vector< const TGeoNode * > &  path 
) const

Definition at line 290 of file GeometryCore.cxx.

291  {
292  assert(!path.empty());
293  auto const* pCurrent = path.back();
294  auto const* pCurrentVolume = pCurrent->GetVolume();
295 
296  // first check the current layer
297  if (strncmp(name.c_str(), pCurrentVolume->GetName(), name.length()) == 0)
298  return true;
299 
300  //explore the next layer down
301  unsigned int nd = pCurrentVolume->GetNdaughters();
302  for(unsigned int i = 0; i < nd; ++i) {
303  path.push_back(pCurrentVolume->GetNode(i));
304  if (FindFirstVolume(name, path)) return true;
305  path.pop_back();
306  } // for
307  return false;
308  } // GeometryCore::FindFirstVolume()
static QCString name
Definition: declinfo.cpp:673
uint length() const
Definition: qcstring.h:195
bool FindFirstVolume(std::string const &name, std::vector< const TGeoNode * > &path) const
bool gar::geo::GeometryCore::FindGasTPCVolume ( )
private

Definition at line 1451 of file GeometryCore.cxx.

1452  {
1453  TGeoVolume *vol = gGeoManager->FindVolumeFast("volGArTPC");
1454  if(!vol)
1455  return false;
1456 
1457  return true;
1458  }
bool gar::geo::GeometryCore::FindLArTPCVolume ( )
private

Definition at line 1329 of file GeometryCore.cxx.

1330  {
1331  std::vector<TGeoNode const*> path = this->FindVolumePath("volArgonCubeDetector");
1332  if(path.size() == 0)
1333  return false;
1334 
1335  const TGeoNode *lar_node = path.at(path.size()-1);
1336  if(lar_node == nullptr) {
1337  std::cout << "Cannot find node volArgonCubeDetector_0" << std::endl;
1338  return false;
1339  }
1340 
1341  const double *origin = lar_node->GetMatrix()->GetTranslation();
1342 
1343  fLArTPCX = origin[0];
1344  fLArTPCY = origin[1];
1345  fLArTPCZ = origin[2];
1346 
1347  fLArTPCHalfWidth = ((TGeoBBox*)lar_node->GetVolume()->GetShape())->GetDZ();
1348  fLArTPCHalfHeight = ((TGeoBBox*)lar_node->GetVolume()->GetShape())->GetDY();
1349  fLArTPCLength = 2.0 * ((TGeoBBox*)lar_node->GetVolume()->GetShape())->GetDX();
1350 
1351  return true;
1352  }
std::vector< TGeoNode const * > FindVolumePath(std::string const &vol_name) const
Returns all the nodes with volumes with any of the specified names.
constexpr Point origin()
Returns a origin position with a point of the specified type.
Definition: geo_vectors.h:227
QTextStream & endl(QTextStream &s)
bool gar::geo::GeometryCore::FindMPDVolume ( )
private

Definition at line 1355 of file GeometryCore.cxx.

1356  {
1357  std::vector<TGeoNode const*> path = this->FindVolumePath("volMPD");
1358  if(path.size() == 0)
1359  return false;
1360 
1361  const TGeoNode *mpd_node = path.at(path.size()-1);
1362  if(mpd_node == nullptr) {
1363  std::cout << "Cannot find node volMPD_0" << std::endl;
1364  return false;
1365  }
1366 
1367  const double *origin = mpd_node->GetMatrix()->GetTranslation();
1368 
1369  fMPDX = origin[0];
1370  fMPDY = origin[1];
1371  fMPDZ = origin[2];
1372 
1373  fMPDHalfWidth = ((TGeoBBox*)mpd_node->GetVolume()->GetShape())->GetDZ();
1374  fMPDHalfHeight = ((TGeoBBox*)mpd_node->GetVolume()->GetShape())->GetDY();
1375  fMPDLength = 2.0 * ((TGeoBBox*)mpd_node->GetVolume()->GetShape())->GetDX();
1376 
1377  return true;
1378  }
std::vector< TGeoNode const * > FindVolumePath(std::string const &vol_name) const
Returns all the nodes with volumes with any of the specified names.
constexpr Point origin()
Returns a origin position with a point of the specified type.
Definition: geo_vectors.h:227
QTextStream & endl(QTextStream &s)
bool gar::geo::GeometryCore::FindMuIDInnerBarrelRadius ( )
private

Definition at line 1817 of file GeometryCore.cxx.

1818  {
1819  TGeoVolume *vol = gGeoManager->FindVolumeFast("YokeBarrel_vol");
1820  if(!vol)
1821  vol = gGeoManager->FindVolumeFast("volYokeBarrel");
1822  if(!vol)
1823  return false;
1824 
1825  fMuIDRinner = ((TGeoPgon*)vol->GetShape())->GetRmin(0);
1826 
1827  return true;
1828  }
float fMuIDRinner
Minimum radius of the MuID inner barrel.
bool gar::geo::GeometryCore::FindMuIDInnerSymmetry ( )
private

Definition at line 1845 of file GeometryCore.cxx.

1846  {
1847  TGeoVolume *vol = gGeoManager->FindVolumeFast("YokeBarrel_vol");
1848  if(!vol)
1849  vol = gGeoManager->FindVolumeFast("volYokeBarrel");
1850  if(!vol)
1851  return false;
1852 
1853  fMuIDSymmetry = ((TGeoPgon*)vol->GetShape())->GetNedges();
1854 
1855  return true;
1856  }
int fMuIDSymmetry
Number of sides of the MuID Barrel.
bool gar::geo::GeometryCore::FindMuIDnLayers ( )
private

Definition at line 1859 of file GeometryCore.cxx.

1860  {
1862  fMuIDnLayers = fMuIDSegmentationAlg->nLayers();
1863 
1864  return true;
1865  }
unsigned int fMuIDnLayers
number of MuID layers from the seg algorithm
MuIDSegmentationAlgPtr fMuIDSegmentationAlg
Object containing the segmentation for the Sc Tracker.
bool gar::geo::GeometryCore::FindMuIDOuterBarrelRadius ( )
private

Definition at line 1831 of file GeometryCore.cxx.

1832  {
1833  TGeoVolume *vol = gGeoManager->FindVolumeFast("YokeBarrel_vol");
1834  if(!vol)
1835  vol = gGeoManager->FindVolumeFast("volYokeBarrel");
1836  if(!vol)
1837  return false;
1838 
1839  fMuIDRouter = ((TGeoPgon*)vol->GetShape())->GetRmax(0);
1840 
1841  return true;
1842  }
float fMuIDRouter
Minimum radius of the MuID outer barrel.
bool gar::geo::GeometryCore::FindMuIDVolume ( )
private

Definition at line 1473 of file GeometryCore.cxx.

1474  {
1475  TGeoVolume *vol = gGeoManager->FindVolumeFast("volYokeBarrel");
1476  if(!vol)
1477  return false;
1478 
1479  return true;
1480  }
template<>
TGeoNode* gar::geo::GeometryCore::FindNode ( float const &  x,
float const &  y,
float const &  z 
) const

Definition at line 369 of file GeometryCore.cxx.

370  {
371  return gGeoManager->FindNode(x, y, z);
372  }
list x
Definition: train.py:276
template<>
TGeoNode* gar::geo::GeometryCore::FindNode ( double const &  x,
double const &  y,
double const &  z 
) const

Definition at line 376 of file GeometryCore.cxx.

377  {
378  return gGeoManager->FindNode(x, y, z);
379  }
list x
Definition: train.py:276
template<typename T >
TGeoNode* gar::geo::GeometryCore::FindNode ( T const &  x,
T const &  y,
T const &  z 
) const
TGeoNode * gar::geo::GeometryCore::FindNode ( std::array< double, 3 > const &  point) const

Definition at line 382 of file GeometryCore.cxx.

383  {
384  return gGeoManager->FindNode(point[0], point[1], point[2]);
385  }
TGeoNode * gar::geo::GeometryCore::FindNode ( TVector3 const &  point) const

Definition at line 388 of file GeometryCore.cxx.

389  {
390  return gGeoManager->FindNode(point.x(), point.y(), point.z());
391  }
template<>
TGeoNode* gar::geo::GeometryCore::FindNode ( float const &  x,
float const &  y,
float const &  z 
) const
template<>
TGeoNode* gar::geo::GeometryCore::FindNode ( double const &  x,
double const &  y,
double const &  z 
) const
bool gar::geo::GeometryCore::FindPVThickness ( )
private

Definition at line 1544 of file GeometryCore.cxx.

1545  {
1546  TGeoVolume *vol = gGeoManager->FindVolumeFast("PVBarrel_vol");
1547  if(!vol)
1548  vol = gGeoManager->FindVolumeFast("volPVBarrel");
1549  if(!vol)
1550  { fPVThickness = 0.; return false; }
1551 
1552  float min = ((TGeoTube*)vol->GetShape())->GetRmin();
1553  float max = ((TGeoTube*)vol->GetShape())->GetRmax();
1554 
1555  fPVThickness = std::abs(max - min);
1556 
1557  return true;
1558  }
float fPVThickness
Pressure Vessel thickness.
T abs(T value)
static int max(int a, int b)
T min(sqlite3 *const db, std::string const &table_name, std::string const &column_name)
Definition: statistics.h:55
bool gar::geo::GeometryCore::FindRockVolume ( )
private

Definition at line 1279 of file GeometryCore.cxx.

1280  {
1281  std::vector<TGeoNode const*> path = this->FindVolumePath("rockBox_lv");
1282  if(path.size() == 0) return false;
1283 
1284  const TGeoNode *rock_node = path.at(path.size()-1);
1285  if(rock_node == nullptr) {
1286  std::cout << "Cannot find node rockBox_lv_0" << std::endl;
1287  return false;
1288  }
1289 
1290  const double *origin = rock_node->GetMatrix()->GetTranslation();
1291 
1292  fRockX = origin[0];
1293  fRockY = origin[1];
1294  fRockZ = origin[2];
1295 
1296  fRockHalfWidth = ((TGeoBBox*)rock_node->GetVolume()->GetShape())->GetDZ();
1297  fRockHalfHeight = ((TGeoBBox*)rock_node->GetVolume()->GetShape())->GetDY();
1298  fRockLength = 2.0 * ((TGeoBBox*)rock_node->GetVolume()->GetShape())->GetDX();
1299 
1300  return true;
1301  }
std::vector< TGeoNode const * > FindVolumePath(std::string const &vol_name) const
Returns all the nodes with volumes with any of the specified names.
constexpr Point origin()
Returns a origin position with a point of the specified type.
Definition: geo_vectors.h:227
QTextStream & endl(QTextStream &s)
const std::array< double, 3 > gar::geo::GeometryCore::FindShapeSize ( const TGeoNode *  node) const

Definition at line 161 of file GeometryCore.cxx.

162  {
163  TGeoVolume *vol = node->GetVolume();
164  std::string volname = vol->GetName();
165 
166  //Check if it is ECAL endcap -> layer size is not the BBox! It is the apothem
167  bool isBarrel = true;
168  bool isECAL = false;
169 
170  if (volname.find("barrel") == std::string::npos &&
171  volname.find("Barrel") == std::string::npos) {
172  isBarrel = false;
173  }
174  if (volname.find("PV") != std::string::npos) {
175  isBarrel = false;
176  }
177 
178  if (volname.find("ECal") != std::string::npos || volname.find("ecal") != std::string::npos)
179  isECAL = true;
180 
181  // Old code commented out here but keep it a bit for reference
182  // if(volname.find("endcap") != std::string::npos || volname.find("Endcap") != std::string::npos ) isBarrel = false;
183 
184  std::array<double, 3> shape = {0., 0., 0.};
185 
186  if (vol)
187  {
188  TGeoBBox *box = (TGeoBBox*)(vol->GetShape());
189 
190  if(isBarrel) {
191  shape[0] = box->GetDX();
192  shape[1] = box->GetDY();
193  } else {
194  if(fECALEndcapOutside && isECAL){
195  shape[0] = GetECALEndcapApothemLength() / 2.;
196  shape[1] = GetECALEndcapApothemLength() / 2.;
197  } else {
198  shape[0] = box->GetDX();
199  shape[1] = box->GetDY();
200  }
201  }
202 
203  shape[2] = box->GetDZ();
204 
205  return shape; //return half size in cm
206  }
207  else{
208  throw cet::exception("GeometryCore::FindShapeSize")
209  << "Could not find the volume associated to node "
210  << node->GetName() <<"\n";
211  }
212  }
bool fECALEndcapOutside
Is the ECAL Endcap outside the PV.
std::string string
Definition: nybbler.cc:12
float GetECALEndcapApothemLength() const
Definition: GeometryCore.h:972
cet::coded_exception< error, detail::translate > exception
Definition: exception.h:33
bool gar::geo::GeometryCore::FindTrackerScnPlanes ( )
private

Definition at line 1899 of file GeometryCore.cxx.

1900  {
1903 
1904  return true;
1905  }
MinervaSegmentationAlgPtr fMinervaSegmentationAlg
Object containing the segmentation for the Sc Tracker.
unsigned int fTrackerScnPlanes
bool gar::geo::GeometryCore::FindTrackerScVolume ( )
private

Definition at line 1868 of file GeometryCore.cxx.

1869  {
1870  std::vector<TGeoNode const*> path = this->FindVolumePath("volTracker");
1871  if(path.size() == 0)
1872  return false;
1873 
1874  const TGeoNode *Tracker_node = path.at(path.size()-1);
1875  if(Tracker_node == nullptr) {
1876  std::cout << "Cannot find node volTracker_0" << std::endl;
1877  return false;
1878  }
1879 
1880  TGeoMatrix *mat = Tracker_node->GetMatrix();
1881  const double *origin = mat->GetTranslation();
1882 
1883  //Get the origin correctly
1884  fGArLiteXCent = fWorldX + fRockX + fEnclosureX + fMPDX + origin[0];
1885  fGArLiteYCent = fWorldY + fRockY + fEnclosureY + fMPDY + origin[1];
1886  fGArLiteZCent = fWorldZ + fRockZ + fEnclosureZ + fMPDZ + origin[2];
1887 
1888  //Get the dimension of the active volume
1889  TGeoVolume *activeVol = Tracker_node->GetVolume();
1890  float rOuter = ((TGeoTube*)activeVol->GetShape())->GetRmax();
1891 
1892  fGArLiteRadius = rOuter;
1893  fGArLiteLength = 2.0 * ((TGeoTube*)activeVol->GetShape())->GetDZ();
1894 
1895  return true;
1896  }
std::vector< TGeoNode const * > FindVolumePath(std::string const &vol_name) const
Returns all the nodes with volumes with any of the specified names.
constexpr Point origin()
Returns a origin position with a point of the specified type.
Definition: geo_vectors.h:227
QTextStream & endl(QTextStream &s)
std::vector< TGeoNode const * > gar::geo::GeometryCore::FindVolumePath ( std::string const &  vol_name) const

Returns all the nodes with volumes with any of the specified names.

Parameters
vol_nameslist of names of volumes
Returns
list of nodes found

All the nodes in the geometry are checked, and all the ones that contain a volume with a name among the ones specified in vol_names are saved in the collection and returned.

Definition at line 281 of file GeometryCore.cxx.

282  {
283  std::vector<TGeoNode const*> path = { ROOTGeoManager()->GetTopNode() };
284  if (!FindFirstVolume(vol_name, path)) path.clear();
285 
286  return path;
287  } // GeometryCore::FindVolumePath()
TGeoManager * ROOTGeoManager() const
Access to the ROOT geometry description manager.
bool FindFirstVolume(std::string const &name, std::vector< const TGeoNode * > &path) const
bool gar::geo::GeometryCore::FindWorldVolume ( )
private

Definition at line 1254 of file GeometryCore.cxx.

1255  {
1256  std::vector<TGeoNode const*> path = this->FindVolumePath("volWorld");
1257  if(path.size() == 0) return false;
1258 
1259  const TGeoNode *world_node = path.at(path.size()-1);
1260  if(world_node == nullptr) {
1261  std::cout << "Cannot find node volWorld_0" << std::endl;
1262  return false;
1263  }
1264 
1265  const double *origin = world_node->GetMatrix()->GetTranslation();
1266 
1267  fWorldX = origin[0];
1268  fWorldY = origin[1];
1269  fWorldZ = origin[2];
1270 
1271  fWorldHalfWidth = ((TGeoBBox*)world_node->GetVolume()->GetShape())->GetDZ();
1272  fWorldHalfHeight = ((TGeoBBox*)world_node->GetVolume()->GetShape())->GetDY();
1273  fWorldLength = 2.0 * ((TGeoBBox*)world_node->GetVolume()->GetShape())->GetDX();
1274 
1275  return true;
1276  }
std::vector< TGeoNode const * > FindVolumePath(std::string const &vol_name) const
Returns all the nodes with volumes with any of the specified names.
constexpr Point origin()
Returns a origin position with a point of the specified type.
Definition: geo_vectors.h:227
QTextStream & endl(QTextStream &s)
unsigned int gar::geo::GeometryCore::GapChannelNumber ( ) const

Returns the ID of the channel representing a gap if you call NearestChannel and get this channel number, then charge is lost.

Definition at line 792 of file GeometryCore.cxx.

793  {
794  return fChannelMapAlg->GapChannelNumber();
795  }
ChannelMapPtr fChannelMapAlg
Object containing the channel to wire mapping.
float gar::geo::GeometryCore::GArLiteLength ( ) const
inline

Definition at line 638 of file GeometryCore.h.

638 { return fGArLiteLength; }
float gar::geo::GeometryCore::GArLiteRadius ( ) const
inline

Definition at line 636 of file GeometryCore.h.

636 { return fGArLiteRadius; }
float gar::geo::GeometryCore::GArLiteXCent ( ) const
inline

Definition at line 630 of file GeometryCore.h.

630 { return fGArLiteXCent; }
float gar::geo::GeometryCore::GArLiteYCent ( ) const
inline

Definition at line 632 of file GeometryCore.h.

632 { return fGArLiteYCent; }
float gar::geo::GeometryCore::GArLiteZCent ( ) const
inline

Definition at line 634 of file GeometryCore.h.

634 { return fGArLiteZCent; }
std::string gar::geo::GeometryCore::GDMLFile ( ) const
inline

Returns the full directory path to the GDML file source.

Returns
the full directory path to the GDML file source

This is the full path of the source of the detector geometry handed to the detector simulation (GEANT).

Definition at line 486 of file GeometryCore.h.

486 { return fGDMLfile; }
std::string fGDMLfile
path to geometry file used for Geant4 simulation
float gar::geo::GeometryCore::GetActiveLArTPCHalfHeight ( ) const
inline

Definition at line 622 of file GeometryCore.h.

622 { return fLArTPCActiveHalfHeight; }
float gar::geo::GeometryCore::GetActiveLArTPCHalfWidth ( ) const
inline

Definition at line 620 of file GeometryCore.h.

620 { return fLArTPCActiveHalfWidth; }
float gar::geo::GeometryCore::GetActiveLArTPCLength ( ) const
inline

Definition at line 624 of file GeometryCore.h.

624 { return fLArTPCActiveLength; }
float gar::geo::GeometryCore::GetActiveLArTPCX ( ) const
inline

Definition at line 608 of file GeometryCore.h.

608 { return fLArTPCXCent; }
float gar::geo::GeometryCore::GetActiveLArTPCY ( ) const
inline

Definition at line 610 of file GeometryCore.h.

610 { return fLArTPCYCent; }
float gar::geo::GeometryCore::GetActiveLArTPCZ ( ) const
inline

Definition at line 612 of file GeometryCore.h.

612 { return fLArTPCZCent; }
gar::raw::CellID_t gar::geo::GeometryCore::GetCellID ( const TGeoNode *  node,
const unsigned int &  det_id,
const unsigned int &  stave,
const unsigned int &  module,
const unsigned int &  layer,
const unsigned int &  slice,
const std::array< double, 3 > &  localPosition 
) const

Definition at line 805 of file GeometryCore.cxx.

806  {
807  std::string node_name = node->GetName();
808  gar::raw::CellID_t cellID = 0.;
809 
810  if(node_name.find("ECal") != std::string::npos || node_name.find("ECAL") != std::string::npos || node_name.find("ecal") != std::string::npos) {
811 
812  const std::array<double, 3> shape = this->FindShapeSize(node);
813  fECALSegmentationAlg->setLayerDimXY(shape[0] * 2, shape[1] * 2);
814  cellID = fECALSegmentationAlg->GetCellID(*this, det_id, stave, module, layer, slice, localPosition);
815 
816  } else if(node_name.find("TrackerSc") != std::string::npos || node_name.find("trackersc") != std::string::npos || node_name.find("Tracker") != std::string::npos || node_name.find("tracker") != std::string::npos) {
817 
818  const std::array<double, 3> shape = this->FindShapeSize(node);
819  fMinervaSegmentationAlg->setLayerDimXY(shape[0] * 2, shape[1] * 2);
820  cellID = fMinervaSegmentationAlg->GetCellID(*this, det_id, 0, 0, layer, slice, localPosition);
821 
822  } else if(node_name.find("Yoke") != std::string::npos || node_name.find("yoke") != std::string::npos) {
823 
824  const std::array<double, 3> shape = this->FindShapeSize(node);
825  fMuIDSegmentationAlg->setLayerDimXY(shape[0] * 2, shape[1] * 2);
826  cellID = fMuIDSegmentationAlg->GetCellID(*this, det_id, stave, module, layer, slice, localPosition);
827 
828  } else {
829  MF_LOG_WARNING("GeometryCore::GetCellID")
830  << "Detector id " << det_id << " unknown!"
831  << " Node name " << node_name;
832  }
833 
834  return cellID;
835  }
MinervaSegmentationAlgPtr fMinervaSegmentationAlg
Object containing the segmentation for the Sc Tracker.
std::string string
Definition: nybbler.cc:12
ECALSegmentationAlgPtr fECALSegmentationAlg
Object containing the segmentation for the ECAL.
const std::array< double, 3 > FindShapeSize(const TGeoNode *node) const
long long int CellID_t
Definition: CaloRawDigit.h:24
MuIDSegmentationAlgPtr fMuIDSegmentationAlg
Object containing the segmentation for the Sc Tracker.
#define MF_LOG_WARNING(category)
void gar::geo::GeometryCore::GetDetectorsPresent ( )
protected

Definition at line 1081 of file GeometryCore.cxx.

1082  {
1083  FindWorldVolume();
1086  //MPD Mother volume
1087  FindMPDVolume();
1088 
1090 
1093 
1095 
1097  }
float gar::geo::GeometryCore::GetECALBarrelApothemLength ( ) const
inline

Definition at line 966 of file GeometryCore.h.

966 { return ( std::cos( M_PI / fECALSymmetry ) * fECALRouter ); }
float fECALRouter
Minimum radius of the ECAL outer barrel.
int fECALSymmetry
Number of sides of the Barrel.
#define M_PI
Definition: includeROOT.h:54
float gar::geo::GeometryCore::GetECALBarrelSideLength ( ) const
inline

Definition at line 963 of file GeometryCore.h.

963 { return ( 2 * std::sin( M_PI / fECALSymmetry ) * fECALRouter ); }
float fECALRouter
Minimum radius of the ECAL outer barrel.
int fECALSymmetry
Number of sides of the Barrel.
#define M_PI
Definition: includeROOT.h:54
const std::string gar::geo::GeometryCore::GetECALCellIDEncoding ( ) const

Definition at line 838 of file GeometryCore.cxx.

839  {
841  return fECALSegmentationAlg->cellEncoding();
842  else
843  return "";
844  }
ECALSegmentationAlgPtr fECALSegmentationAlg
Object containing the segmentation for the ECAL.
float gar::geo::GeometryCore::GetECALEndcapApothemLength ( ) const
inline

Definition at line 972 of file GeometryCore.h.

972 { return ( std::cos( M_PI / fECALSymmetry ) * fECALECapRouter ); }
int fECALSymmetry
Number of sides of the Barrel.
#define M_PI
Definition: includeROOT.h:54
float gar::geo::GeometryCore::GetECALEndcapOuterX ( ) const
inline

Definition at line 978 of file GeometryCore.h.

978 { return fECALEndcapOuterX; }
float fECALEndcapOuterX
Position of the end xplane of the ECAL endcap.
float gar::geo::GeometryCore::GetECALEndcapSideLength ( ) const
inline

Definition at line 969 of file GeometryCore.h.

969 { return ( 2 * std::sin( M_PI / fECALSymmetry ) * fECALECapRouter ); }
int fECALSymmetry
Number of sides of the Barrel.
#define M_PI
Definition: includeROOT.h:54
float gar::geo::GeometryCore::GetECALEndcapStartX ( ) const
inline

Definition at line 975 of file GeometryCore.h.

975 { return fECALEndcapStartX; }
float fECALEndcapStartX
Position of the start xplane of the ECAL endcap.
float gar::geo::GeometryCore::GetECALInnerAngle ( ) const
inline

Definition at line 960 of file GeometryCore.h.

960 { return (( fECALSymmetry - 2 ) * M_PI / fECALSymmetry); }
int fECALSymmetry
Number of sides of the Barrel.
#define M_PI
Definition: includeROOT.h:54
float gar::geo::GeometryCore::GetECALInnerBarrelRadius ( ) const
inline

Definition at line 942 of file GeometryCore.h.

942 { return fECALRinner; }
float fECALRinner
Minimum radius of the ECAL inner barrel.
float gar::geo::GeometryCore::GetECALInnerEndcapRadius ( ) const
inline

Definition at line 948 of file GeometryCore.h.

948 { return fECALECapRinner; }
int gar::geo::GeometryCore::GetECALInnerSymmetry ( ) const
inline

Definition at line 957 of file GeometryCore.h.

957 { return fECALSymmetry; }
int fECALSymmetry
Number of sides of the Barrel.
std::map< gar::geo::LayeredCalorimeterData::LayoutType, std::shared_ptr<gar::geo::LayeredCalorimeterData> > gar::geo::GeometryCore::GetECALLayeredCalorimeterData ( ) const
inline

Definition at line 628 of file GeometryCore.h.

628 { return fECALLayeredCalorimeterData; }
ECALLayeredCalorimeterData fECALLayeredCalorimeterData
float gar::geo::GeometryCore::GetECALOuterBarrelRadius ( ) const
inline

Definition at line 945 of file GeometryCore.h.

945 { return fECALRouter; }
float fECALRouter
Minimum radius of the ECAL outer barrel.
float gar::geo::GeometryCore::GetECALOuterEndcapRadius ( ) const
inline

Definition at line 951 of file GeometryCore.h.

951 { return fECALECapRouter; }
float gar::geo::GeometryCore::GetEnclosureHalfHeight ( ) const
inline

Definition at line 586 of file GeometryCore.h.

586 { return fEnclosureHalfHeight; }
float gar::geo::GeometryCore::GetEnclosureHalfWidth ( ) const
inline

Definition at line 584 of file GeometryCore.h.

584 { return fEnclosureHalfWidth; }
float gar::geo::GeometryCore::GetEnclosureLength ( ) const
inline

Definition at line 588 of file GeometryCore.h.

588 { return fEnclosureLength; }
float gar::geo::GeometryCore::GetEnclosureX ( ) const
inline

Definition at line 578 of file GeometryCore.h.

578 { return fEnclosureX; }
float gar::geo::GeometryCore::GetEnclosureY ( ) const
inline

Definition at line 580 of file GeometryCore.h.

580 { return fEnclosureY; }
float gar::geo::GeometryCore::GetEnclosureZ ( ) const
inline

Definition at line 582 of file GeometryCore.h.

582 { return fEnclosureZ; }
std::string gar::geo::GeometryCore::GetGArTPCVolumeName ( ) const
inline

Return the name of GAr TPC volume.

Returns
the name of the GArTPC volume

This information is used by Geant4 simulation

Definition at line 809 of file GeometryCore.h.

809 {return "TPC_Drift"; }
void gar::geo::GeometryCore::GetGeometryParameters ( )
protected

Definition at line 1041 of file GeometryCore.cxx.

1042  {
1043 
1044  // move this ahead of the segmentation call in the service
1046 
1047  if(fHasGasTPCDetector)
1049  if(fHasECALDetector)
1051  if(fHasTrackerScDetector) {
1052  /* no op */
1053  }
1054  if(fHasMuonDetector)
1056 
1058 
1059  SetDetectorOrigin(); //Set the origin!
1060  }
float gar::geo::GeometryCore::GetIROCInnerRadius ( ) const

radii query methods passing through to the channel map algorithm

Definition at line 733 of file GeometryCore.cxx.

734  {
735  return fChannelMapAlg->GetIROCInnerRadius();
736  }
ChannelMapPtr fChannelMapAlg
Object containing the channel to wire mapping.
float gar::geo::GeometryCore::GetIROCOuterRadius ( ) const

Definition at line 739 of file GeometryCore.cxx.

740  {
741  return fChannelMapAlg->GetIROCOuterRadius();
742  }
ChannelMapPtr fChannelMapAlg
Object containing the channel to wire mapping.
float gar::geo::GeometryCore::GetLArTPCHalfHeight ( ) const
inline

Definition at line 616 of file GeometryCore.h.

616 { return fLArTPCHalfHeight; }
float gar::geo::GeometryCore::GetLArTPCHalfWidth ( ) const
inline

Definition at line 614 of file GeometryCore.h.

614 { return fLArTPCHalfWidth; }
float gar::geo::GeometryCore::GetLArTPCLength ( ) const
inline

Definition at line 618 of file GeometryCore.h.

618 { return fLArTPCLength; }
float gar::geo::GeometryCore::GetLArTPCX ( ) const
inline

Definition at line 602 of file GeometryCore.h.

602 { return fLArTPCX; }
float gar::geo::GeometryCore::GetLArTPCY ( ) const
inline

Definition at line 604 of file GeometryCore.h.

604 { return fLArTPCY; }
float gar::geo::GeometryCore::GetLArTPCZ ( ) const
inline

Definition at line 606 of file GeometryCore.h.

606 { return fLArTPCZ; }
const std::string gar::geo::GeometryCore::GetMinervaCellIDEncoding ( ) const

Definition at line 847 of file GeometryCore.cxx.

848  {
850  return fMinervaSegmentationAlg->cellEncoding();
851  else
852  return "";
853  }
MinervaSegmentationAlgPtr fMinervaSegmentationAlg
Object containing the segmentation for the Sc Tracker.
float gar::geo::GeometryCore::GetMPDHalfHeight ( ) const
inline

Definition at line 598 of file GeometryCore.h.

598 { return fMPDHalfHeight; }
float gar::geo::GeometryCore::GetMPDHalfWidth ( ) const
inline

Definition at line 596 of file GeometryCore.h.

596 { return fMPDHalfWidth; }
float gar::geo::GeometryCore::GetMPDLength ( ) const
inline

Definition at line 600 of file GeometryCore.h.

600 { return fMPDLength; }
float gar::geo::GeometryCore::GetMPDX ( ) const
inline

Definition at line 590 of file GeometryCore.h.

590 { return fMPDX; }
float gar::geo::GeometryCore::GetMPDY ( ) const
inline

Definition at line 592 of file GeometryCore.h.

592 { return fMPDY; }
float gar::geo::GeometryCore::GetMPDZ ( ) const
inline

Definition at line 594 of file GeometryCore.h.

594 { return fMPDZ; }
float gar::geo::GeometryCore::GetMuIDBarrelApothemLength ( ) const
inline

Definition at line 1017 of file GeometryCore.h.

1017 { return ( std::cos( M_PI / fMuIDSymmetry ) * fMuIDRouter ); }
float fMuIDRouter
Minimum radius of the MuID outer barrel.
int fMuIDSymmetry
Number of sides of the MuID Barrel.
#define M_PI
Definition: includeROOT.h:54
float gar::geo::GeometryCore::GetMuIDBarrelSideLength ( ) const
inline

Definition at line 1014 of file GeometryCore.h.

1014 { return ( 2 * std::sin( M_PI / fMuIDSymmetry ) * fMuIDRouter ); }
float fMuIDRouter
Minimum radius of the MuID outer barrel.
int fMuIDSymmetry
Number of sides of the MuID Barrel.
#define M_PI
Definition: includeROOT.h:54
const std::string gar::geo::GeometryCore::GetMuIDCellIDEncoding ( ) const

Definition at line 856 of file GeometryCore.cxx.

857  {
859  return fMuIDSegmentationAlg->cellEncoding();
860  else
861  return "";
862  }
MuIDSegmentationAlgPtr fMuIDSegmentationAlg
Object containing the segmentation for the Sc Tracker.
float gar::geo::GeometryCore::GetMuIDInnerAngle ( ) const
inline

Definition at line 1011 of file GeometryCore.h.

1011 { return (( fMuIDSymmetry - 2 ) * M_PI / fMuIDSymmetry); }
int fMuIDSymmetry
Number of sides of the MuID Barrel.
#define M_PI
Definition: includeROOT.h:54
float gar::geo::GeometryCore::GetMuIDInnerBarrelRadius ( ) const
inline

Definition at line 1002 of file GeometryCore.h.

1002 { return fMuIDRinner; }
float fMuIDRinner
Minimum radius of the MuID inner barrel.
int gar::geo::GeometryCore::GetMuIDInnerSymmetry ( ) const
inline

Definition at line 1008 of file GeometryCore.h.

1008 { return fMuIDSymmetry; }
int fMuIDSymmetry
Number of sides of the MuID Barrel.
float gar::geo::GeometryCore::GetMuIDOuterBarrelRadius ( ) const
inline

Definition at line 1005 of file GeometryCore.h.

1005 { return fMuIDRouter; }
float fMuIDRouter
Minimum radius of the MuID outer barrel.
unsigned int gar::geo::GeometryCore::GetNLayers ( std::string  det) const

Definition at line 1626 of file GeometryCore.cxx.

1627  {
1628  if(det.compare("ECAL") == 0)
1629  return fECALnLayers;
1630 
1631  if(det.compare("TrackerSc") == 0)
1632  return fTrackerScnPlanes;
1633 
1634  if(det.compare("MuID") == 0)
1635  return fMuIDnLayers;
1636 
1637  return 0;
1638  }
unsigned int fTrackerScnPlanes
unsigned int fECALnLayers
number of ECAL layers from the seg algorithm
unsigned int fMuIDnLayers
number of MuID layers from the seg algorithm
float gar::geo::GeometryCore::GetOriginX ( ) const
inline

Definition at line 548 of file GeometryCore.h.

548 { return fOriginX; }
float gar::geo::GeometryCore::GetOriginY ( ) const
inline

Definition at line 550 of file GeometryCore.h.

550 { return fOriginY; }
float gar::geo::GeometryCore::GetOriginZ ( ) const
inline

Definition at line 552 of file GeometryCore.h.

552 { return fOriginZ; }
float gar::geo::GeometryCore::GetOROCInnerRadius ( ) const

Definition at line 745 of file GeometryCore.cxx.

746  {
747  return fChannelMapAlg->GetOROCInnerRadius();
748  }
ChannelMapPtr fChannelMapAlg
Object containing the channel to wire mapping.
float gar::geo::GeometryCore::GetOROCOuterRadius ( ) const

Definition at line 757 of file GeometryCore.cxx.

758  {
759  return fChannelMapAlg->GetOROCOuterRadius();
760  }
ChannelMapPtr fChannelMapAlg
Object containing the channel to wire mapping.
float gar::geo::GeometryCore::GetOROCPadHeightChangeRadius ( ) const

Definition at line 751 of file GeometryCore.cxx.

752  {
753  return fChannelMapAlg->GetOROCPadHeightChangeRadius();
754  }
ChannelMapPtr fChannelMapAlg
Object containing the channel to wire mapping.
std::array< double, 3 > gar::geo::GeometryCore::GetPosition ( const TGeoNode *  node,
const gar::raw::CellID_t cID 
) const

Definition at line 865 of file GeometryCore.cxx.

866  {
867  std::string node_name = node->GetName();
868  std::array<double, 3> pos;
869 
870  if(node_name.find("ECal") != std::string::npos || node_name.find("ECAL") != std::string::npos || node_name.find("ecal") != std::string::npos) {
871  const std::array<double, 3> shape = this->FindShapeSize(node);
872  fECALSegmentationAlg->setLayerDimXY(shape[0] * 2, shape[1] * 2);
874  pos = fECALSegmentationAlg->GetPosition(*this, cID);
875  }
876 
877  if(node_name.find("Yoke") != std::string::npos || node_name.find("yoke") != std::string::npos) {
878  const std::array<double, 3> shape = this->FindShapeSize(node);
879  fMuIDSegmentationAlg->setLayerDimXY(shape[0] * 2, shape[1] * 2);
880  fMuIDSegmentationAlg->setVariables(GetMuIDInnerAngle(), 0.);
881  pos = fMuIDSegmentationAlg->GetPosition(*this, cID);
882  }
883 
884  return pos;
885  }
std::string string
Definition: nybbler.cc:12
ECALSegmentationAlgPtr fECALSegmentationAlg
Object containing the segmentation for the ECAL.
const std::array< double, 3 > FindShapeSize(const TGeoNode *node) const
float GetMuIDInnerAngle() const
float GetECALInnerAngle() const
Definition: GeometryCore.h:960
MuIDSegmentationAlgPtr fMuIDSegmentationAlg
Object containing the segmentation for the Sc Tracker.
float GetECALEndcapSideLength() const
Definition: GeometryCore.h:969
float gar::geo::GeometryCore::GetPVThickness ( ) const
inline

Definition at line 954 of file GeometryCore.h.

954 { return fPVThickness; }
float fPVThickness
Pressure Vessel thickness.
float gar::geo::GeometryCore::GetRockHalfHeight ( ) const
inline

Definition at line 574 of file GeometryCore.h.

574 { return fRockHalfHeight; }
float gar::geo::GeometryCore::GetRockHalfWidth ( ) const
inline

Definition at line 572 of file GeometryCore.h.

572 { return fRockHalfWidth; }
float gar::geo::GeometryCore::GetRockLength ( ) const
inline

Definition at line 576 of file GeometryCore.h.

576 { return fRockLength; }
float gar::geo::GeometryCore::GetRockX ( ) const
inline

Definition at line 566 of file GeometryCore.h.

566 { return fRockX; }
float gar::geo::GeometryCore::GetRockY ( ) const
inline

Definition at line 568 of file GeometryCore.h.

568 { return fRockY; }
float gar::geo::GeometryCore::GetRockZ ( ) const
inline

Definition at line 570 of file GeometryCore.h.

570 { return fRockZ; }
float gar::geo::GeometryCore::GetSensVolumeThickness ( const TVector3 &  point) const

Definition at line 148 of file GeometryCore.cxx.

149  {
150  TGeoNode *node = gGeoManager->FindNode(point.x(), point.y(), point.z());
151 
152  if(node) {
153  return this->FindShapeSize(node)[2] * 2;
154  }
155  else{
156  return 0.;
157  }
158  }
const std::array< double, 3 > FindShapeSize(const TGeoNode *node) const
std::pair< TVector3, TVector3 > gar::geo::GeometryCore::GetStripEnds ( const std::array< double, 3 > &  point,
const gar::raw::CellID_t cID 
) const

Definition at line 962 of file GeometryCore.cxx.

963  {
964  std::string node_name = this->FindNode(point)->GetName();
965  std::pair<TVector3, TVector3> localStripEnds;
966 
967  //Get the matrix to make the transformation from Local to World
968  std::array<double, 3> localtemp;
970  this->WorldToLocal(point, localtemp, trans);
971  const std::array<double, 3> shape = this->FindShapeSize(this->FindNode(point));
972 
973  if(node_name.find("ECal") != std::string::npos || node_name.find("ECAL") != std::string::npos || node_name.find("ecal") != std::string::npos) {
974  fECALSegmentationAlg->setLayerDimXY(shape[0] * 2, shape[1] * 2);
976  localStripEnds = fECALSegmentationAlg->getStripEnds(*this, localtemp, cID);
977  }
978 
979  if(node_name.find("Yoke") != std::string::npos || node_name.find("yoke") != std::string::npos) {
980  fMuIDSegmentationAlg->setLayerDimXY(shape[0] * 2, shape[1] * 2);
981  fMuIDSegmentationAlg->setVariables(GetMuIDInnerAngle(), 0.);
982  localStripEnds = fMuIDSegmentationAlg->getStripEnds(*this, localtemp, cID);
983  }
984 
985  //Get the world coordinates from both local coordinates of the strip ends
986  std::array<double, 3> stripEnd1local = { localStripEnds.first.X(), localStripEnds.first.Y(), localStripEnds.first.Z() };
987  std::array<double, 3> stripEnd2local = { localStripEnds.second.X(), localStripEnds.second.Y(), localStripEnds.second.Z() };
988  std::array<double, 3> stripEnd1;
989  std::array<double, 3> stripEnd2;
990  this->LocalToWorld(stripEnd1local, stripEnd1, trans);
991  this->LocalToWorld(stripEnd2local, stripEnd2, trans);
992 
993  return std::make_pair( TVector3(stripEnd1[0], stripEnd1[1], stripEnd1[2]), TVector3(stripEnd2[0], stripEnd2[1], stripEnd2[2]) );
994  }
TGeoNode * FindNode(T const &x, T const &y, T const &z) const
bool WorldToLocal(std::array< double, 3 > const &world, std::array< double, 3 > &local, gar::geo::LocalTransformation< TGeoHMatrix > &trans) const
std::string string
Definition: nybbler.cc:12
ECALSegmentationAlgPtr fECALSegmentationAlg
Object containing the segmentation for the ECAL.
const std::array< double, 3 > FindShapeSize(const TGeoNode *node) const
float GetMuIDInnerAngle() const
Class to transform between world and local coordinates.
float GetECALInnerAngle() const
Definition: GeometryCore.h:960
bool LocalToWorld(std::array< double, 3 > const &local, std::array< double, 3 > &world, gar::geo::LocalTransformation< TGeoHMatrix > const &trans) const
MuIDSegmentationAlgPtr fMuIDSegmentationAlg
Object containing the segmentation for the Sc Tracker.
float GetECALEndcapSideLength() const
Definition: GeometryCore.h:969
double gar::geo::GeometryCore::getStripLength ( const std::array< double, 3 > &  point,
const gar::raw::CellID_t cID 
) const

Definition at line 935 of file GeometryCore.cxx.

936  {
937  double strip_length = 0.;
938  const TGeoNode *node = this->FindNode(point);
939  std::string node_name = node->GetName();
940 
941  std::array<double, 3> localtemp;
943  this->WorldToLocal(point, localtemp, trans);
944  const std::array<double, 3> shape = this->FindShapeSize(this->FindNode(point));
945 
946  if(node_name.find("ECal") != std::string::npos || node_name.find("ECAL") != std::string::npos || node_name.find("ecal") != std::string::npos) {
947  fECALSegmentationAlg->setLayerDimXY(shape[0] * 2, shape[1] * 2);
949  strip_length = fECALSegmentationAlg->getStripLength(*this, localtemp, cID);
950  }
951 
952  if(node_name.find("Yoke") != std::string::npos || node_name.find("yoke") != std::string::npos) {
953  fMuIDSegmentationAlg->setLayerDimXY(shape[0] * 2, shape[1] * 2);
954  fMuIDSegmentationAlg->setVariables(GetMuIDInnerAngle(), 0.);
955  strip_length = fMuIDSegmentationAlg->getStripLength(*this, localtemp, cID);
956  }
957 
958  return strip_length;
959  }
TGeoNode * FindNode(T const &x, T const &y, T const &z) const
bool WorldToLocal(std::array< double, 3 > const &world, std::array< double, 3 > &local, gar::geo::LocalTransformation< TGeoHMatrix > &trans) const
std::string string
Definition: nybbler.cc:12
ECALSegmentationAlgPtr fECALSegmentationAlg
Object containing the segmentation for the ECAL.
const std::array< double, 3 > FindShapeSize(const TGeoNode *node) const
float GetMuIDInnerAngle() const
Class to transform between world and local coordinates.
float GetECALInnerAngle() const
Definition: GeometryCore.h:960
MuIDSegmentationAlgPtr fMuIDSegmentationAlg
Object containing the segmentation for the Sc Tracker.
float GetECALEndcapSideLength() const
Definition: GeometryCore.h:969
double gar::geo::GeometryCore::getStripWidth ( const std::array< double, 3 > &  point) const

Definition at line 905 of file GeometryCore.cxx.

906  {
907  double strip_width = 0.;
908  std::string node_name = this->FindNode(point)->GetName();
909 
910  if(node_name.find("ECal") != std::string::npos || node_name.find("ECAL") != std::string::npos || node_name.find("ecal") != std::string::npos) {
911  strip_width = fECALSegmentationAlg->stripSizeX();
912  }
913 
914  if(node_name.find("Yoke") != std::string::npos || node_name.find("yoke") != std::string::npos) {
915  strip_width = fMuIDSegmentationAlg->stripSizeX();
916  }
917 
918  return strip_width;
919  }
TGeoNode * FindNode(T const &x, T const &y, T const &z) const
std::string string
Definition: nybbler.cc:12
ECALSegmentationAlgPtr fECALSegmentationAlg
Object containing the segmentation for the ECAL.
MuIDSegmentationAlgPtr fMuIDSegmentationAlg
Object containing the segmentation for the Sc Tracker.
double gar::geo::GeometryCore::getTileSize ( const std::array< double, 3 > &  point) const

Definition at line 922 of file GeometryCore.cxx.

923  {
924  double tilesize = 0.;
925  std::string node_name = this->FindNode(point)->GetName();
926 
927  if(node_name.find("ECal") != std::string::npos || node_name.find("ECAL") != std::string::npos || node_name.find("ecal") != std::string::npos) {
928  tilesize = fECALSegmentationAlg->gridSizeX();
929  }
930 
931  return tilesize;
932  }
TGeoNode * FindNode(T const &x, T const &y, T const &z) const
std::string string
Definition: nybbler.cc:12
ECALSegmentationAlgPtr fECALSegmentationAlg
Object containing the segmentation for the ECAL.
float gar::geo::GeometryCore::GetWorldHalfHeight ( ) const
inline

Definition at line 562 of file GeometryCore.h.

562 { return fWorldHalfHeight; }
float gar::geo::GeometryCore::GetWorldHalfWidth ( ) const
inline

Definition at line 560 of file GeometryCore.h.

560 { return fWorldHalfWidth; }
float gar::geo::GeometryCore::GetWorldLength ( ) const
inline

Definition at line 564 of file GeometryCore.h.

564 { return fWorldLength; }
std::string gar::geo::GeometryCore::GetWorldVolumeName ( ) const
inline

Definition at line 1019 of file GeometryCore.h.

1019 { return "volWorld"; }
float gar::geo::GeometryCore::GetWorldX ( ) const
inline

Definition at line 554 of file GeometryCore.h.

554 { return fWorldX; }
float gar::geo::GeometryCore::GetWorldY ( ) const
inline

Definition at line 556 of file GeometryCore.h.

556 { return fWorldY; }
float gar::geo::GeometryCore::GetWorldZ ( ) const
inline

Definition at line 558 of file GeometryCore.h.

558 { return fWorldZ; }
bool gar::geo::GeometryCore::HasECALDetector ( ) const
inline

Definition at line 993 of file GeometryCore.h.

993 { return fHasECALDetector; }
bool gar::geo::GeometryCore::HasEnclosure ( ) const
inline

Definition at line 984 of file GeometryCore.h.

984 { return fHasEnclosure; }
bool gar::geo::GeometryCore::HasGasTPCDetector ( ) const
inline

Definition at line 990 of file GeometryCore.h.

990 { return fHasGasTPCDetector; }
bool gar::geo::GeometryCore::HasLArTPCDetector ( ) const
inline

Definition at line 987 of file GeometryCore.h.

987 { return fHasLArTPCDetector; }
bool gar::geo::GeometryCore::HasMuonDetector ( ) const
inline

Definition at line 999 of file GeometryCore.h.

999 { return fHasMuonDetector; }
bool gar::geo::GeometryCore::HasRock ( ) const
inline

Definition at line 981 of file GeometryCore.h.

981 { return fHasRock; }
bool gar::geo::GeometryCore::HasTrackerScDetector ( ) const
inline

Definition at line 996 of file GeometryCore.h.

996 { return fHasTrackerScDetector; }
void gar::geo::GeometryCore::InitVariables ( )
private

Definition at line 1908 of file GeometryCore.cxx.

1909  {
1910  fEnclosureX = 0.;
1911  fEnclosureY = 0.;
1912  fEnclosureZ = 0.;
1913 
1914  fTPCNumDriftVols = 2; // default to ALICE-style TPC with cathode in the middle
1915 
1916  fTPCXCent = 0.;
1917  fTPCYCent = 0.;
1918  fTPCZCent = 0.;
1919 
1920  fMPDX = 0.;
1921  fMPDY = 0.;
1922  fMPDZ = 0.;
1923 
1924  fLArTPCX = 0.;
1925  fLArTPCY = 0.;
1926  fLArTPCZ = 0.;
1927 
1928  fLArTPCXCent = 0.;
1929  fLArTPCYCent = 0.;
1930  fLArTPCZCent = 0.;
1931 
1932  fTPCRadius = 9999.;
1933  fTPCLength = 9999.;
1934 
1935  fEnclosureHalfWidth = 9999.;
1936  fEnclosureHalfHeight = 9999.;
1937  fEnclosureLength = 9999.;
1938 
1939  fMPDHalfWidth = 9999.;
1940  fMPDHalfHeight = 9999.;
1941  fMPDLength = 9999.;
1942 
1943  fLArTPCHalfWidth = 0.;
1944  fLArTPCHalfHeight = 0.;
1945  fLArTPCLength = 0.;
1946 
1949  fLArTPCActiveLength = 0.;
1950 
1951  fECALRinner = 0.;
1952  fECALRouter = 0.;
1953  fECALECapRouter = 0.;
1954  fECALECapRouter = 0.;
1955  fPVThickness = 0.;
1956  fECALSymmetry = -1;
1957  fECALEndcapStartX = 0.;
1958  fECALnLayers = 0;
1959  fECALNodePath.clear();
1960 
1961  fHasRock = false;
1962  fHasEnclosure = false;
1963  fHasLArTPCDetector = false;
1964  fHasGasTPCDetector = false;
1965  fHasECALDetector = false;
1966  fHasTrackerScDetector = false;
1967  fHasMuonDetector = false;
1968 
1969  fMuIDRinner = 0.;
1970  fMuIDRouter = 0.;
1971  fMuIDSymmetry = -1;
1972  fMuIDnLayers = 0;
1973 
1974  fGArLiteXCent = 0.;
1975  fGArLiteYCent = 0.;
1976  fGArLiteZCent = 0.;
1977  fTrackerScnPlanes = 0;
1978 
1979  fGArLiteRadius = 9999.;
1980  fGArLiteLength = 9999.;
1981  }
float fMuIDRouter
Minimum radius of the MuID outer barrel.
float fTPCXCent
center of TPC: X
float fMuIDRinner
Minimum radius of the MuID inner barrel.
float fPVThickness
Pressure Vessel thickness.
float fTPCLength
length of the TPC
float fTPCRadius
Radius of the TPC.
float fECALRouter
Minimum radius of the ECAL outer barrel.
float fECALEndcapStartX
Position of the start xplane of the ECAL endcap.
unsigned int fTrackerScnPlanes
unsigned int fECALnLayers
number of ECAL layers from the seg algorithm
float fTPCYCent
center of TPC: Y
float fECALRinner
Minimum radius of the ECAL inner barrel.
unsigned int fMuIDnLayers
number of MuID layers from the seg algorithm
int fTPCNumDriftVols
2 if standard ALICE detector, 1 if single drift vol
int fECALSymmetry
Number of sides of the Barrel.
int fMuIDSymmetry
Number of sides of the MuID Barrel.
std::map< std::string, std::vector< const TGeoNode * > > fECALNodePath
Stored map of vectors of nodes for the ecal to speedup node searching.
float fTPCZCent
center of TPC: Z
bool gar::geo::GeometryCore::isTile ( const std::array< double, 3 > &  point,
const gar::raw::CellID_t cID 
) const

Definition at line 888 of file GeometryCore.cxx.

889  {
890  bool isTile = false;
891  std::string node_name = this->FindNode(point)->GetName();
892 
893  if(node_name.find("ECal") != std::string::npos || node_name.find("ECAL") != std::string::npos || node_name.find("ecal") != std::string::npos) {
894  isTile = fECALSegmentationAlg->isTile(cID);
895  }
896 
897  if(node_name.find("Yoke") != std::string::npos || node_name.find("yoke") != std::string::npos) {
898  isTile = fMuIDSegmentationAlg->isTile(cID);
899  }
900 
901  return isTile;
902  }
TGeoNode * FindNode(T const &x, T const &y, T const &z) const
std::string string
Definition: nybbler.cc:12
ECALSegmentationAlgPtr fECALSegmentationAlg
Object containing the segmentation for the ECAL.
bool isTile(const std::array< double, 3 > &point, const gar::raw::CellID_t &cID) const
MuIDSegmentationAlgPtr fMuIDSegmentationAlg
Object containing the segmentation for the Sc Tracker.
void gar::geo::GeometryCore::LoadGeometryFile ( std::string const &  gdmlfile,
std::string const &  rootfile,
bool  bForceReload = false 
)

Loads the geometry information from the specified files.

Parameters
gdmlfilepath to file to be used for Geant4 simulation
rootfilepath to file for internal geometry representation
bForceReloadreload even if there is already a valid geometry
See also
ApplyChannelMap()

Both paths must directly resolve to an available file, as no search is performed for them.

The gdmlfile parameter does not have to necessarily be in GDML format, as long as it's something supported by Geant4. This file is not used by the geometry, but its path is provided on request by the simulation modules (see GArSoft LArG4 module). The rootfile also does not need to be a ROOT file, but just anything that TGeoManager::Import() supports. This file is parsed immediately and the internal geometry representation is built out of it.

Note
After calling this method, the detector geometry information can be considered complete, but the geometry service provider is not fully initialized yet, since it's still necessary to provide or update the channel mapping.

Definition at line 100 of file GeometryCore.cxx.

101  {
102  if (gdmlfile.empty()) {
103  throw cet::exception("GeometryCore")
104  << "No GDML Geometry file specified!\n";
105  }
106 
107  if (rootfile.empty()) {
108  throw cet::exception("GeometryCore")
109  << "No ROOT Geometry file specified!\n";
110  }
111 
112  ClearGeometry();
113 
114  // Open the GDML file, and convert it into ROOT TGeoManager format.
115  // Then lock the gGeoManager to prevent future imports, for example
116  // in AuxDetGeometry
117  if( !gGeoManager || bForceReload ){
118  if (gGeoManager) TGeoManager::UnlockGeometry();
119  else { // very first time (or so it should)
120  // [20210630, petrillo@slac.stanford.edu]
121  // ROOT 6.22.08 allows us to choose the representation of lengths
122  // in the geometry objects parsed from GDML.
123  // In LArSoft we want them to be centimeters (ROOT standard).
124  // This was tracked as Redmine issue #25990, and I leave this mark
125  // because I feel that we'll be back to it not too far in the future.
126  // Despite the documentation (ROOT 6.22/08),
127  // it seems the units are locked from the beginning,
128  // so we unlock without prejudice.
129  TGeoManager::LockDefaultUnits(false);
130  TGeoManager::SetDefaultUnits(TGeoManager::kRootUnits);
131  TGeoManager::LockDefaultUnits(true);
132  }
133  TGeoManager::Import(rootfile.c_str());
134  gGeoManager->LockGeometry();
135  }
136 
137  fGDMLfile = gdmlfile;
138  fROOTfile = rootfile;
139 
140  MF_LOG_INFO("GeometryCore")
141  << "New detector geometry loaded from "
142  << "\n\t" << fROOTfile
143  << "\n\t" << fGDMLfile;
144 
145  } // GeometryCore::LoadGeometryFile()
std::string fROOTfile
path to geometry file for geometry in GeometryCore
#define Import
#define MF_LOG_INFO(category)
void ClearGeometry()
Deletes the detector geometry structures.
std::string fGDMLfile
path to geometry file used for Geant4 simulation
cet::coded_exception< error, detail::translate > exception
Definition: exception.h:33
bool gar::geo::GeometryCore::LocalToWorld ( std::array< double, 3 > const &  local,
std::array< double, 3 > &  world,
gar::geo::LocalTransformation< TGeoHMatrix > const &  trans 
) const

Definition at line 423 of file GeometryCore.cxx.

424  {
425  if (trans.GetNodes().empty()){
426  throw cet::exception("GeometryCore::LocalToWorld")
427  << " LocalTransformation has no nodes! -- Call WorldToLocal first!" << "\n";
428  return false;
429  }
430 
431  //Change to world frame
432  std::array<double, 3> loc{ {local[0], local[1], local[2]} }, wd;
433  trans.LocalToWorld(loc.data(), wd.data());
434  world = {wd.at(0), wd.at(1), wd.at(2)};
435 
436  return true;
437  }
std::vector< TGeoNode const * > GetNodes() const
void LocalToWorld(double const *local, double *world) const
Transforms a point from local frame to world frame.
cet::coded_exception< error, detail::translate > exception
Definition: exception.h:33
bool gar::geo::GeometryCore::MakeECALLayeredCalorimeterData ( )
private

extent of the calorimeter in the r-z-plane [ rmin, rmax, zmin, zmax ].

extent of the calorimeter in the r-z-plane [ rmin, rmax, zmin, zmax ].

Definition at line 1641 of file GeometryCore.cxx.

1642  {
1643  //Barrel
1644  fECALLayeredCalorimeterData[gar::geo::LayeredCalorimeterData::BarrelLayout] = std::shared_ptr<gar::geo::LayeredCalorimeterData>(new LayeredCalorimeterData());
1645 
1650 
1651  /// extent of the calorimeter in the r-z-plane [ rmin, rmax, zmin, zmax ].
1656 
1657  for(unsigned int i = 0; i < GetNLayers("ECAL"); i++)
1658  {
1659  float nRadiationLengths = 0.;
1660  float nInteractionLengths = 0.;
1661  float thickness_sum = 0.;
1662  float layer_thickness = 0.;
1663  float abs_thickness = 0.;
1664 
1666  // caloLayer.cellSize0 = fECALSegmentationAlg->gridSizeX();
1667  // caloLayer.cellSize1 = fECALSegmentationAlg->gridSizeX();
1668  caloLayer.cellSize0 = fECALSegmentationAlg->stripSizeX();
1669  caloLayer.cellSize1 = fECALSegmentationAlg->stripSizeX();
1670 
1671  TGeoVolume *volLayer = gGeoManager->FindVolumeFast(TString::Format("BarrelECal_stave01_module01_layer_%02i_vol", i+1));
1672 
1673  if(volLayer)
1674  {
1675  for(int islice = 0; islice < volLayer->GetNdaughters(); islice++)
1676  {
1677  TGeoVolume *slice = volLayer->GetNode(islice)->GetVolume();
1678  TGeoMaterial *mat = slice->GetMaterial();
1679  double rad_len = mat->GetRadLen();
1680  double int_len = mat->GetIntLen();
1681  const char *material = mat->GetName();
1682 
1683  double slice_thickness = ((TGeoBBox*)slice->GetShape())->GetDZ(); //half thickness
1684 
1685  nRadiationLengths += slice_thickness/rad_len;
1686  nInteractionLengths += slice_thickness/int_len;
1687  thickness_sum += slice_thickness;
1688  layer_thickness += slice_thickness;
1689 
1690  MF_LOG_DEBUG("GeometryCore::FindECALLayeredCalorimeterData")
1691  << " Slice " << islice
1692  << " RadLen " << nRadiationLengths
1693  << " IntLen " << nInteractionLengths
1694  << " ThicknessSum " << thickness_sum
1695  << " Material " << mat->GetName();
1696 
1697  if(strcmp(material, "Copper") == 0 || strcmp(material, "Steel") == 0 || strcmp(material, "Lead") == 0) {
1698  abs_thickness += slice_thickness * 2;
1699  }
1700 
1701  if(strcmp(material, "Scintillator") == 0) {
1702  caloLayer.inner_nRadiationLengths = nRadiationLengths;
1703  caloLayer.inner_nInteractionLengths = nInteractionLengths;
1704  caloLayer.inner_thickness = thickness_sum;
1705  caloLayer.sensitive_thickness = slice_thickness*2.;
1706 
1707  nRadiationLengths = 0.;
1708  nInteractionLengths = 0.;
1709  thickness_sum = 0.;
1710  }
1711 
1712  nRadiationLengths += slice_thickness/rad_len;
1713  nInteractionLengths += slice_thickness/int_len;
1714  thickness_sum += slice_thickness;
1715  layer_thickness += slice_thickness;
1716  }
1717 
1718  caloLayer.outer_nRadiationLengths = nRadiationLengths;
1719  caloLayer.outer_nInteractionLengths = nInteractionLengths;
1720  caloLayer.outer_thickness = thickness_sum;
1721 
1722  caloLayer.distance = GetECALInnerBarrelRadius() + (i+1) * layer_thickness;
1723  caloLayer.absorberThickness = abs_thickness;
1725  }
1726  }
1727 
1728  //Endcap
1729  fECALLayeredCalorimeterData[gar::geo::LayeredCalorimeterData::EndcapLayout] = std::shared_ptr<gar::geo::LayeredCalorimeterData>(new LayeredCalorimeterData());
1730 
1735 
1736  /// extent of the calorimeter in the r-z-plane [ rmin, rmax, zmin, zmax ].
1741 
1742  for(unsigned int i = 0; i < GetNLayers("ECAL"); i++)
1743  {
1744  float nRadiationLengths = 0.;
1745  float nInteractionLengths = 0.;
1746  float thickness_sum = 0.;
1747  float layer_thickness = 0.;
1748  float abs_thickness = 0.;
1749 
1751  // caloLayer.cellSize0 = fECALSegmentationAlg->gridSizeX();
1752  // caloLayer.cellSize1 = fECALSegmentationAlg->gridSizeX();
1753  caloLayer.cellSize0 = fECALSegmentationAlg->stripSizeX();
1754  caloLayer.cellSize1 = fECALSegmentationAlg->stripSizeX();
1755 
1756  TGeoVolume *volLayer = gGeoManager->FindVolumeFast(TString::Format("EndcapECal_stave01_module00_layer_%02i_vol", i+1));
1757 
1758  if(volLayer)
1759  {
1760  for(int islice = 0; islice < volLayer->GetNdaughters(); islice++)
1761  {
1762  TGeoVolume *slice = volLayer->GetNode(islice)->GetVolume();
1763  TGeoMaterial *mat = slice->GetMaterial();
1764  double rad_len = mat->GetRadLen();
1765  double int_len = mat->GetIntLen();
1766  const char *material = mat->GetName();
1767 
1768  double slice_thickness = ((TGeoBBox*)slice->GetShape())->GetDZ(); //half thickness
1769 
1770  nRadiationLengths += slice_thickness/rad_len;
1771  nInteractionLengths += slice_thickness/int_len;
1772  thickness_sum += slice_thickness;
1773  layer_thickness += slice_thickness;
1774 
1775  MF_LOG_DEBUG("GeometryCore::FindECALLayeredCalorimeterData")
1776  << " Slice " << islice
1777  << " RadLen " << nRadiationLengths
1778  << " IntLen " << nInteractionLengths
1779  << " ThicknessSum " << thickness_sum
1780  << " Material " << mat->GetName();
1781 
1782  if(strcmp(material, "Copper") == 0 || strcmp(material, "Steel") == 0 || strcmp(material, "Lead") == 0) {
1783  abs_thickness += slice_thickness * 2;
1784  }
1785 
1786  if(strcmp(material, "Scintillator") == 0) {
1787  caloLayer.inner_nRadiationLengths = nRadiationLengths;
1788  caloLayer.inner_nInteractionLengths = nInteractionLengths;
1789  caloLayer.inner_thickness = thickness_sum;
1790  caloLayer.sensitive_thickness = slice_thickness*2.;
1791 
1792  nRadiationLengths = 0.;
1793  nInteractionLengths = 0.;
1794  thickness_sum = 0.;
1795  }
1796 
1797  nRadiationLengths += slice_thickness/rad_len;
1798  nInteractionLengths += slice_thickness/int_len;
1799  thickness_sum += slice_thickness;
1800  layer_thickness += slice_thickness;
1801  }
1802 
1803  caloLayer.outer_nRadiationLengths = nRadiationLengths;
1804  caloLayer.outer_nInteractionLengths = nInteractionLengths;
1805  caloLayer.outer_thickness = thickness_sum;
1806 
1807  caloLayer.distance = GetECALEndcapStartX() + i * layer_thickness;
1808  caloLayer.absorberThickness = abs_thickness;
1810  }
1811  }
1812 
1813  return true;
1814  }
Format
Definition: utils.h:7
int GetECALInnerSymmetry() const
Definition: GeometryCore.h:957
ECALSegmentationAlgPtr fECALSegmentationAlg
Object containing the segmentation for the ECAL.
float GetECALOuterEndcapRadius() const
Definition: GeometryCore.h:951
float GetECALInnerEndcapRadius() const
Definition: GeometryCore.h:948
ECALLayeredCalorimeterData fECALLayeredCalorimeterData
float GetECALEndcapStartX() const
Definition: GeometryCore.h:975
float GetECALOuterBarrelRadius() const
Definition: GeometryCore.h:945
int strcmp(const String &s1, const String &s2)
Definition: relates.cpp:14
#define MF_LOG_DEBUG(id)
float GetECALInnerBarrelRadius() const
Definition: GeometryCore.h:942
unsigned int GetNLayers(std::string det) const
float GetECALEndcapOuterX() const
Definition: GeometryCore.h:978
LayeredCalorimeterStruct LayeredCalorimeterData
Definition: GeometryCore.h:146
double gar::geo::GeometryCore::MassBetweenPoints ( double *  p1,
double *  p2 
) const

Return the column density between two points.

Parameters
p1pointer to array holding (x, y, z) of the first point
p2pointer to array holding (x, y, z) of the second point
Returns
the mass

Both points are specified in world coordinates.

Todo:
Unify the coordinates type

Returns the mass between two coordinates

Definition at line 689 of file GeometryCore.cxx.

690  {
691 
692  //The purpose of this method is to determine the column density
693  //between the two points given. Do that by starting at p1 and
694  //stepping until you get to the node of p2. calculate the distance
695  //between the point just inside that node and p2 to get the last
696  //bit of column density
697  double columnD = 0.;
698 
699  //first initialize a track - get the direction cosines
700  double length = std::sqrt( sqr(p2[0]-p1[0])
701  + sqr(p2[1]-p1[1])
702  + sqr(p2[2]-p1[2]));
703  double dxyz[3] = {(p2[0]-p1[0])/length, (p2[1]-p1[1])/length, (p2[2]-p1[2])/length};
704 
705  gGeoManager->InitTrack(p1,dxyz);
706 
707  //might be helpful to have a point to a TGeoNode
708  TGeoNode *node = gGeoManager->GetCurrentNode();
709 
710  //check that the points are not in the same volume already.
711  //if they are in different volumes, keep stepping until you
712  //are in the same volume as the second point
713  while(!gGeoManager->IsSameLocation(p2[0], p2[1], p2[2])){
714  gGeoManager->FindNextBoundary();
715  columnD += gGeoManager->GetStep()*node->GetMedium()->GetMaterial()->GetDensity();
716 
717  //the act of stepping puts you in the next node and returns that node
718  node = gGeoManager->Step();
719  }//end loop to get to volume of second point
720 
721  //now you are in the same volume as the last point, but not at that point.
722  //get the distance between the current point and the last one
723  const double *current = gGeoManager->GetCurrentPoint();
724  length = std::sqrt(sqr(p2[0]-current[0]) +
725  sqr(p2[1]-current[1]) +
726  sqr(p2[2]-current[2]));
727  columnD += length*node->GetMedium()->GetMaterial()->GetDensity();
728 
729  return columnD;
730  }
T sqr(T v)
static Entry * current
TGeoMaterial const* gar::geo::GeometryCore::Material ( double  x,
double  y,
double  z 
) const

Returns the material at the specified position

Todo:
Unify the coordinates type
const std::string gar::geo::GeometryCore::MaterialName ( TVector3 const &  point)

Name of the deepest material containing the point xyz.

Returns
material of the origin by default
Todo:

make this constant

remove return value constantness (or make it a reference)

Unify the coordinates type

Definition at line 654 of file GeometryCore.cxx.

655  {
656  if( !this->PointInWorld(point) ){
657  const std::string unknown("unknownVolume");
658  return unknown;
659  }
660 
661  const std::string name(this->FindNode(point)->GetMedium()->GetMaterial()->GetName());
662  return name;
663  }
static QCString name
Definition: declinfo.cpp:673
TGeoNode * FindNode(T const &x, T const &y, T const &z) const
std::string string
Definition: nybbler.cc:12
bool PointInWorld(TVector3 const &point) const
constexpr ProductStatus unknown() noexcept
Definition: ProductStatus.h:31
gar::geo::seg::SegmentationAlg const* gar::geo::GeometryCore::MinervaSegmentationAlg ( ) const
inline

Returns the object handling the Sc Tracker segmentation.

Definition at line 936 of file GeometryCore.h.

936 { return fMinervaSegmentationAlg.get(); }
MinervaSegmentationAlgPtr fMinervaSegmentationAlg
Object containing the segmentation for the Sc Tracker.
gar::geo::seg::SegmentationAlg const* gar::geo::GeometryCore::MuIDSegmentationAlg ( ) const
inline

Returns the object handling the MuID segmentation.

Definition at line 939 of file GeometryCore.h.

939 { return fMuIDSegmentationAlg.get(); }
MuIDSegmentationAlgPtr fMuIDSegmentationAlg
Object containing the segmentation for the Sc Tracker.
unsigned int gar::geo::GeometryCore::NChannels ( ) const

Definition at line 228 of file GeometryCore.cxx.

229  {
230  return fChannelMapAlg->Nchannels();
231  }
ChannelMapPtr fChannelMapAlg
Object containing the channel to wire mapping.
unsigned int gar::geo::GeometryCore::NearestChannel ( float const  worldLoc[3]) const

Returns the ID of the channel nearest to the specified position.

Parameters
worldLoc3D coordinates of the point (world reference frame)
Returns
the ID of the channel, or raw::InvalidChannelID if invalid wire

The different versions allow different way to provide the position.

Todo:

remove the integers version

Verify the raw::InvalidChannelID part

Definition at line 763 of file GeometryCore.cxx.

764  {
765  return fChannelMapAlg->NearestChannel(worldLoc);
766  }
ChannelMapPtr fChannelMapAlg
Object containing the channel to wire mapping.
unsigned int gar::geo::GeometryCore::NearestChannel ( std::vector< float > const &  worldLoc) const

Definition at line 769 of file GeometryCore.cxx.

770  {
771  float loc[3] = {worldLoc[0], worldLoc[1], worldLoc[2]};
772 
773  return this->NearestChannel(loc);
774  }
unsigned int NearestChannel(float const worldLoc[3]) const
Returns the ID of the channel nearest to the specified position.
unsigned int gar::geo::GeometryCore::NearestChannel ( TVector3 const &  worldLoc) const

Definition at line 777 of file GeometryCore.cxx.

778  {
779  float loc[3] = {(float)worldLoc[0], (float)worldLoc[1], (float)worldLoc[2]};
780 
781  return this->NearestChannel(loc);
782  }
unsigned int NearestChannel(float const worldLoc[3]) const
Returns the ID of the channel nearest to the specified position.
void gar::geo::GeometryCore::NearestChannelInfo ( float const *  xyz,
gar::geo::ChanWithNeighbors cwn 
) const

Definition at line 786 of file GeometryCore.cxx.

787  {
788  fChannelMapAlg->NearestChannelInfo(xyz, cwn);
789  }
ChannelMapPtr fChannelMapAlg
Object containing the channel to wire mapping.
GeometryCore& gar::geo::GeometryCore::operator= ( GeometryCore const &  )
delete
GeometryCore& gar::geo::GeometryCore::operator= ( GeometryCore &&  )
delete
bool gar::geo::GeometryCore::PointInDetEnclosure ( TVector3 const &  point) const

Definition at line 503 of file GeometryCore.cxx.

504  {
505  // check that the given point is in the enclosure volume at least
506  if (std::abs(point.x()) > fEnclosureHalfWidth ||
507  std::abs(point.y()) > fEnclosureHalfHeight ||
508  std::abs(point.z()) > fEnclosureLength){
509  if (fPointInWarnings) {
510  MF_LOG_WARNING("GeometryCoreBadInputPoint")
511  << "point ("
512  << point.x() << ","
513  << point.y() << ","
514  << point.z() << ") "
515  << "is not inside the detector enclosure volume "
516  << " half width = " << fEnclosureHalfWidth
517  << " half height = " << fEnclosureHalfHeight
518  << " half length = " << fEnclosureLength;
519  }
520  return false;
521  }
522 
523  return true;
524  }
bool fPointInWarnings
Generate warnings from failed inputs to PointIn* methods.
T abs(T value)
#define MF_LOG_WARNING(category)
bool gar::geo::GeometryCore::PointInECALBarrel ( TVector3 const &  point) const

Definition at line 606 of file GeometryCore.cxx.

607  {
608  std::string vol_name = this->VolumeName(point);
609 
610  if (vol_name.find("barrel") == std::string::npos &&
611  vol_name.find("Barrel") == std::string::npos) {
612  return false;
613  }
614 
615  // There is a barrel to the pressure vessel!
616  if (vol_name.find("PV") != std::string::npos) {
617  return false;
618  } else {
619  return true;
620  }
621  }
std::string string
Definition: nybbler.cc:12
const std::string VolumeName(TVector3 const &point) const
Returns the name of the deepest volume containing specified point.
bool gar::geo::GeometryCore::PointInECALEndcap ( TVector3 const &  point) const

Definition at line 624 of file GeometryCore.cxx.

625  {
626  std::string vol_name = this->VolumeName(point);
627 
628  if (vol_name.find("endcap") == std::string::npos &&
629  vol_name.find("Endcap") == std::string::npos) {
630  return false;
631  }
632 
633  // There is an endcap to the pressure vessel!
634  if (vol_name.find("PV") != std::string::npos) {
635  return false;
636  } else {
637  return true;
638  }
639  }
std::string string
Definition: nybbler.cc:12
const std::string VolumeName(TVector3 const &point) const
Returns the name of the deepest volume containing specified point.
bool gar::geo::GeometryCore::PointInGArTPC ( TVector3 const &  point) const

Definition at line 553 of file GeometryCore.cxx.

554  {
555  // check that the given point is in the enclosure volume at least
556  float y = std::abs(point.y() - GetOriginY());
557  float z = std::abs(point.z() - GetOriginZ());
558  if (std::abs(point.x() - GetOriginX()) > fTPCLength/2.0 ||
559  std::hypot(z,y) > fTPCRadius) {
560  if (fPointInWarnings) {
561  MF_LOG_WARNING("GeometryCoreBadInputPoint")
562  << "point ("
563  << point.x() << ","
564  << point.y() << ","
565  << point.z() << ") "
566  << "is not inside the GArTPC volume "
567  << " radius = " << fTPCRadius
568  << " length = " << fTPCLength;
569  }
570  return false;
571  }
572 
573  return true;
574  }
float GetOriginX() const
Definition: GeometryCore.h:548
float fTPCLength
length of the TPC
bool fPointInWarnings
Generate warnings from failed inputs to PointIn* methods.
float fTPCRadius
Radius of the TPC.
std::enable_if_t< std::is_arithmetic_v< T >, T > hypot(T x, T y)
Definition: hypot.h:60
float GetOriginZ() const
Definition: GeometryCore.h:552
T abs(T value)
float GetOriginY() const
Definition: GeometryCore.h:550
#define MF_LOG_WARNING(category)
bool gar::geo::GeometryCore::PointInLArTPC ( TVector3 const &  point) const

Definition at line 577 of file GeometryCore.cxx.

578  {
579  //Name to change depending on the detector..
580  TGeoVolume *volLArTPC = gGeoManager->FindVolumeFast("volArgonCubeActive");
581 
582  float halflength = ((TGeoBBox*)volLArTPC->GetShape())->GetDZ();
583  float halfheight = ((TGeoBBox*)volLArTPC->GetShape())->GetDY();
584  float halfwidth = ((TGeoBBox*)volLArTPC->GetShape())->GetDX();
585  if (std::abs(point.x()) > halfwidth ||
586  std::abs(point.y()) > halfheight ||
587  std::abs(point.z()) > halflength){
588  if (fPointInWarnings) {
589  MF_LOG_WARNING("GeometryCoreBadInputPoint")
590  << "point ("
591  << point.x() << ","
592  << point.y() << ","
593  << point.z() << ") "
594  << "is not inside the LArTPC volume "
595  << " half width = " << halfwidth
596  << " half height = " << halfheight
597  << " half length = " << halflength;
598  }
599  return false;
600  }
601 
602  return true;
603  }
bool fPointInWarnings
Generate warnings from failed inputs to PointIn* methods.
T abs(T value)
#define MF_LOG_WARNING(category)
bool gar::geo::GeometryCore::PointInMPD ( TVector3 const &  point) const

Definition at line 527 of file GeometryCore.cxx.

528  {
529  TVector3 tpc_origin(GetOriginX(), GetOriginY(), GetOriginZ());
530  TVector3 new_point = point - tpc_origin;
531  // check that the given point is in the enclosure volume at least
532  if (std::abs(new_point.x()) > fMPDHalfWidth ||
533  std::abs(new_point.y()) > fMPDHalfHeight ||
534  std::abs(new_point.z()) > fMPDLength){
535  if (fPointInWarnings) {
536  MF_LOG_WARNING("GeometryCoreBadInputPoint")
537  << "point ("
538  << point.x() << ","
539  << point.y() << ","
540  << point.z() << ") "
541  << "is not inside the MPD volume "
542  << " half width = " << fMPDHalfWidth
543  << " half height = " << fMPDHalfHeight
544  << " half length = " << fMPDLength;
545  }
546  return false;
547  }
548 
549  return true;
550  }
float GetOriginX() const
Definition: GeometryCore.h:548
bool fPointInWarnings
Generate warnings from failed inputs to PointIn* methods.
float GetOriginZ() const
Definition: GeometryCore.h:552
T abs(T value)
float GetOriginY() const
Definition: GeometryCore.h:550
#define MF_LOG_WARNING(category)
bool gar::geo::GeometryCore::PointInWorld ( TVector3 const &  point) const

Definition at line 475 of file GeometryCore.cxx.

476  {
477  // check that the given point is in the World volume at least
478  TGeoVolume *volWorld = gGeoManager->FindVolumeFast("volWorld");
479  float halflength = ((TGeoBBox*)volWorld->GetShape())->GetDZ();
480  float halfheight = ((TGeoBBox*)volWorld->GetShape())->GetDY();
481  float halfwidth = ((TGeoBBox*)volWorld->GetShape())->GetDX();
482  if (std::abs(point.x()) > halfwidth ||
483  std::abs(point.y()) > halfheight ||
484  std::abs(point.z()) > halflength){
485  if (fPointInWarnings) {
486  MF_LOG_WARNING("GeometryCoreBadInputPoint")
487  << "point ("
488  << point.x() << ","
489  << point.y() << ","
490  << point.z() << ") "
491  << "is not inside the world volume "
492  << " half width = " << halfwidth
493  << " half height = " << halfheight
494  << " half length = " << halflength;
495  }
496  return false;
497  }
498 
499  return true;
500  }
bool fPointInWarnings
Generate warnings from failed inputs to PointIn* methods.
T abs(T value)
#define MF_LOG_WARNING(category)
void gar::geo::GeometryCore::PrintGeometry ( ) const
protected

Definition at line 1158 of file GeometryCore.cxx.

1159  {
1160  std::cout << "Geometry loaded with \n" << std::endl;
1161  std::cout << "------------------------------" << std::endl;
1162  std::cout << "ND-GAr detector origin set to " << GetOriginX() << " cm " << GetOriginY() << " cm " << GetOriginZ() << " cm" << std::endl;
1163 
1164  //Prints geometry parameters
1165  std::cout << "------------------------------" << std::endl;
1166  std::cout << "World Geometry" << std::endl;
1167  std::cout << "World Origin (x, y, z) " << GetWorldX() << " cm " << GetWorldY() << " cm " << GetWorldZ() << " cm" << std::endl;
1168  std::cout << "World Size (H, W, L) " << GetWorldHalfWidth() << " cm " << GetWorldHalfHeight() << " cm " << GetWorldLength() << " cm" << std::endl;
1169 
1170  if(this->HasRock()) {
1171  std::cout << "------------------------------" << std::endl;
1172  std::cout << "Rock Geometry" << std::endl;
1173  std::cout << "Rock Origin (x, y, z) " << GetRockX() << " cm " << GetRockY() << " cm " << GetRockZ() << " cm" << std::endl;
1174  std::cout << "Rock Size (H, W, L) " << GetRockHalfWidth() << " cm " << GetRockHalfHeight() << " cm " << GetRockLength() << " cm" << std::endl;
1175  }
1176 
1177  if(this->HasEnclosure()) {
1178  std::cout << "------------------------------" << std::endl;
1179  std::cout << "Enclosure Geometry" << std::endl;
1180  std::cout << "Enclosure Origin (x, y, z) " << GetEnclosureX() << " cm " << GetEnclosureY() << " cm " << GetEnclosureZ() << " cm" << std::endl;
1181  std::cout << "Enclosure Size (H, W, L) " << GetEnclosureHalfWidth() << " cm " << GetEnclosureHalfHeight() << " cm " << GetEnclosureLength() << " cm" << std::endl;
1182  }
1183 
1184  if(this->HasLArTPCDetector()) {
1185  std::cout << "------------------------------" << std::endl;
1186  std::cout << "LArArgonCube Geometry" << std::endl;
1187  std::cout << "LArTPC Origin (x, y, z) " << GetLArTPCX() << " cm " << GetLArTPCY() << " cm " << GetLArTPCZ() << " cm" << std::endl;
1188  std::cout << "LArTPC Size (H, W, L) " << GetLArTPCHalfWidth() << " cm " << GetLArTPCHalfHeight() << " cm " << GetLArTPCLength() << " cm" << std::endl;
1189  std::cout << "------------------------------" << std::endl;
1190  std::cout << "LArActiveArgonCube Geometry" << std::endl;
1191  std::cout << "LArTPCActive Origin (x, y, z) " << GetActiveLArTPCX() << " cm " << GetActiveLArTPCY() << " cm " << GetActiveLArTPCZ() << " cm" << std::endl;
1192  std::cout << "LArTPCActive Size (H, W, L) " << GetActiveLArTPCHalfWidth() << " cm " << GetActiveLArTPCHalfHeight() << " cm " << GetActiveLArTPCLength() << " cm" << std::endl;
1193 
1194  }
1195 
1196  std::cout << "------------------------------" << std::endl;
1197  std::cout << "ND-GAr Geometry" << std::endl;
1198  std::cout << "ND-GAr Origin (x, y, z) " << GetMPDX() << " cm " << GetMPDY() << " cm " << GetMPDZ() << " cm" << std::endl;
1199  std::cout << "ND-GAr Size (H, W, L) " << GetMPDHalfWidth() << " cm " << GetMPDHalfHeight() << " cm " << GetMPDLength() << " cm" << std::endl;
1200 
1201  if(this->HasGasTPCDetector()) {
1202  std::cout << "------------------------------" << std::endl;
1203  std::cout << "TPC Geometry" << std::endl;
1204  std::cout << "TPC Origin (x, y, z) " << TPCXCent() << " cm " << TPCYCent() << " cm " << TPCZCent() << " cm" << std::endl;
1205  std::cout << "TPC Active Volume Size (R, L) " << TPCRadius() << " cm " << TPCLength() << " cm" << std::endl;
1206  std::cout << "TPC Number of Drift Volumes " << TPCNumDriftVols() << std::endl;
1207  }
1208 
1209  if(this->HasECALDetector()) {
1210  std::cout << "------------------------------" << std::endl;
1211  std::cout << "ECAL Geometry" << std::endl;
1212  std::cout << "ECAL Barrel inner radius: " << GetECALInnerBarrelRadius() << " cm" << std::endl;
1213  std::cout << "ECAL Barrel outer radius: " << GetECALOuterBarrelRadius() << " cm" << std::endl;
1214  std::cout << "ECAL Endcap inside PV: " << !fECALEndcapOutside << std::endl;
1215  std::cout << "ECAL Endcap inner radius: " << GetECALInnerEndcapRadius() << " cm" << std::endl;
1216  std::cout << "ECAL Endcap outer radius: " << GetECALOuterEndcapRadius() << " cm" << std::endl;
1217  std::cout << "ECAL Barrel inner symmetry: " << GetECALInnerSymmetry() << std::endl;
1218  std::cout << "ECAL Barrel polyhedra angle: " << GetECALInnerAngle()*180/M_PI << " deg" << std::endl;
1219  std::cout << "ECAL Barrel polyhedra side length: " << GetECALBarrelSideLength() << " cm" << std::endl;
1220  std::cout << "ECAL Barrel polyhedra apothem length: " << GetECALBarrelApothemLength() << " cm" << std::endl;
1221  if(fECALEndcapOutside){
1222  std::cout << "ECAL Endcap polyhedra side length: " << GetECALEndcapSideLength() << " cm" << std::endl;
1223  std::cout << "ECAL Endcap polyhedra apothem length: " << GetECALEndcapApothemLength() << " cm" << std::endl;
1224  }
1225  std::cout << "ECAL Endcap Start X: " << GetECALEndcapStartX() << " cm" << std::endl;
1226  std::cout << "ECAL Endcap Outer X: " << GetECALEndcapOuterX() << " cm" << std::endl;
1227  std::cout << "Number of layers: " << GetNLayers("ECAL") << std::endl;
1228  std::cout << "Pressure Vessel Thickness: " << GetPVThickness() << " cm" << std::endl;
1229  }
1230 
1231  if(this->HasTrackerScDetector()) {
1232  std::cout << "------------------------------" << std::endl;
1233  std::cout << "ND-GAr Lite Geometry" << std::endl;
1234  std::cout << "ND-GAr Lite Origin (x, y, z) " << GArLiteXCent() << " cm " << GArLiteYCent() << " cm " << GArLiteZCent() << " cm" << std::endl;
1235  std::cout << "ND-GAr Lite Active Volume Size (R, L) " << GArLiteRadius() << " cm " << GArLiteLength() << " cm" << std::endl;
1236  std::cout << "Number of planes (from Segmentation alg) " << GetNLayers("TrackerSc") << std::endl;
1237  }
1238 
1239  if(this->HasMuonDetector()) {
1240  std::cout << "------------------------------" << std::endl;
1241  std::cout << "MuID Geometry" << std::endl;
1242  std::cout << "MuID Barrel inner radius: " << GetMuIDInnerBarrelRadius() << " cm" << std::endl;
1243  std::cout << "MuID Barrel outer radius: " << GetMuIDOuterBarrelRadius() << " cm" << std::endl;
1244  std::cout << "MuID Barrel inner symmetry: " << GetMuIDInnerSymmetry() << std::endl;
1245  std::cout << "MuID Barrel polyhedra angle: " << GetMuIDInnerAngle()*180/M_PI << " deg" << std::endl;
1246  std::cout << "MuID Barrel polyhedra side length: " << GetMuIDBarrelSideLength() << " cm" << std::endl;
1247  std::cout << "MuID Barrel polyhedra apothem length: " << GetMuIDBarrelApothemLength() << " cm" << std::endl;
1248  std::cout << "Number of layers: " << GetNLayers("MuID") << std::endl;
1249  }
1250  std::cout << "------------------------------\n" << std::endl;
1251  }
bool HasRock() const
Definition: GeometryCore.h:981
float GetActiveLArTPCHalfHeight() const
Definition: GeometryCore.h:622
bool fECALEndcapOutside
Is the ECAL Endcap outside the PV.
float GetActiveLArTPCZ() const
Definition: GeometryCore.h:612
float GetEnclosureX() const
Definition: GeometryCore.h:578
float GetEnclosureHalfWidth() const
Definition: GeometryCore.h:584
float GetRockHalfWidth() const
Definition: GeometryCore.h:572
float GetMPDLength() const
Definition: GeometryCore.h:600
int GetECALInnerSymmetry() const
Definition: GeometryCore.h:957
bool HasLArTPCDetector() const
Definition: GeometryCore.h:987
float GetActiveLArTPCHalfWidth() const
Definition: GeometryCore.h:620
float GetRockLength() const
Definition: GeometryCore.h:576
float GetMuIDInnerBarrelRadius() const
int TPCNumDriftVols() const
Returns number of TPC drift volumes.
Definition: GeometryCore.h:771
float GetWorldY() const
Definition: GeometryCore.h:556
float GetMPDZ() const
Definition: GeometryCore.h:594
float GetOriginX() const
Definition: GeometryCore.h:548
float GetLArTPCHalfWidth() const
Definition: GeometryCore.h:614
float GArLiteLength() const
Definition: GeometryCore.h:638
float GetRockZ() const
Definition: GeometryCore.h:570
float TPCXCent() const
Returns the X location of the center of the TPC in cm.
Definition: GeometryCore.h:778
float GArLiteYCent() const
Definition: GeometryCore.h:632
float GetECALOuterEndcapRadius() const
Definition: GeometryCore.h:951
bool HasEnclosure() const
Definition: GeometryCore.h:984
bool HasGasTPCDetector() const
Definition: GeometryCore.h:990
float GetPVThickness() const
Definition: GeometryCore.h:954
float GetMuIDInnerAngle() const
float GetMPDX() const
Definition: GeometryCore.h:590
float GetWorldZ() const
Definition: GeometryCore.h:558
float GetECALInnerAngle() const
Definition: GeometryCore.h:960
float GetLArTPCX() const
Definition: GeometryCore.h:602
float GetOriginZ() const
Definition: GeometryCore.h:552
float GetECALBarrelApothemLength() const
Definition: GeometryCore.h:966
float TPCRadius() const
Returns the radius of the TPC (y or z direction)
Definition: GeometryCore.h:755
float GetECALInnerEndcapRadius() const
Definition: GeometryCore.h:948
float GetActiveLArTPCLength() const
Definition: GeometryCore.h:624
float GetRockX() const
Definition: GeometryCore.h:566
float TPCZCent() const
Returns the Z location of the center of the TPC in cm.
Definition: GeometryCore.h:792
float GetRockHalfHeight() const
Definition: GeometryCore.h:574
float GetEnclosureZ() const
Definition: GeometryCore.h:582
bool HasTrackerScDetector() const
Definition: GeometryCore.h:996
float GetOriginY() const
Definition: GeometryCore.h:550
float GetWorldHalfHeight() const
Definition: GeometryCore.h:562
float GetWorldLength() const
Definition: GeometryCore.h:564
float GetLArTPCZ() const
Definition: GeometryCore.h:606
float GetEnclosureHalfHeight() const
Definition: GeometryCore.h:586
float GetWorldX() const
Definition: GeometryCore.h:554
float GetECALEndcapStartX() const
Definition: GeometryCore.h:975
float GetMuIDOuterBarrelRadius() const
float GetActiveLArTPCY() const
Definition: GeometryCore.h:610
#define M_PI
Definition: includeROOT.h:54
float GetECALEndcapApothemLength() const
Definition: GeometryCore.h:972
float GetECALOuterBarrelRadius() const
Definition: GeometryCore.h:945
float GetMuIDBarrelSideLength() const
bool HasECALDetector() const
Definition: GeometryCore.h:993
float GetEnclosureY() const
Definition: GeometryCore.h:580
float GArLiteXCent() const
Definition: GeometryCore.h:630
float GetMPDY() const
Definition: GeometryCore.h:592
float TPCYCent() const
Returns the Y location of the center of the TPC in cm.
Definition: GeometryCore.h:785
float GetEnclosureLength() const
Definition: GeometryCore.h:588
bool HasMuonDetector() const
Definition: GeometryCore.h:999
float GetMuIDBarrelApothemLength() const
float GetMPDHalfHeight() const
Definition: GeometryCore.h:598
float GetECALInnerBarrelRadius() const
Definition: GeometryCore.h:942
float GetLArTPCLength() const
Definition: GeometryCore.h:618
float TPCLength() const
Returns the length of the TPC (x direction)
Definition: GeometryCore.h:763
float GetECALBarrelSideLength() const
Definition: GeometryCore.h:963
float GetRockY() const
Definition: GeometryCore.h:568
int GetMuIDInnerSymmetry() const
float GetLArTPCY() const
Definition: GeometryCore.h:604
float GetActiveLArTPCX() const
Definition: GeometryCore.h:608
unsigned int GetNLayers(std::string det) const
float GetMPDHalfWidth() const
Definition: GeometryCore.h:596
QTextStream & endl(QTextStream &s)
float GetECALEndcapOuterX() const
Definition: GeometryCore.h:978
float GetLArTPCHalfHeight() const
Definition: GeometryCore.h:616
float GetWorldHalfWidth() const
Definition: GeometryCore.h:560
float GArLiteRadius() const
Definition: GeometryCore.h:636
float GetECALEndcapSideLength() const
Definition: GeometryCore.h:969
float GArLiteZCent() const
Definition: GeometryCore.h:634
std::array< double, 3 > gar::geo::GeometryCore::ReconstructStripHitPosition ( const std::array< double, 3 > &  point,
const std::array< double, 3 > &  local,
const float &  xlocal,
const gar::raw::CellID_t cID 
) const

Definition at line 1019 of file GeometryCore.cxx.

1020  {
1021  std::array<double, 3> pos;
1022  std::string node_name = this->FindNode(point)->GetName();
1023  const std::array<double, 3> shape = this->FindShapeSize(this->FindNode(point));
1024 
1025  if(node_name.find("ECal") != std::string::npos || node_name.find("ECAL") != std::string::npos || node_name.find("ecal") != std::string::npos) {
1026  fECALSegmentationAlg->setLayerDimXY(shape[0] * 2, shape[1] * 2);
1028  pos = fECALSegmentationAlg->ReconstructStripHitPosition(*this, local, xlocal, cID);
1029  }
1030 
1031  if(node_name.find("Yoke") != std::string::npos || node_name.find("yoke") != std::string::npos) {
1032  fMuIDSegmentationAlg->setLayerDimXY(shape[0] * 2, shape[1] * 2);
1033  fMuIDSegmentationAlg->setVariables(GetMuIDInnerAngle(), 0.);
1034  pos = fMuIDSegmentationAlg->ReconstructStripHitPosition(*this, local, xlocal, cID);
1035  }
1036 
1037  return pos;
1038  }
TGeoNode * FindNode(T const &x, T const &y, T const &z) const
std::string string
Definition: nybbler.cc:12
ECALSegmentationAlgPtr fECALSegmentationAlg
Object containing the segmentation for the ECAL.
const std::array< double, 3 > FindShapeSize(const TGeoNode *node) const
float GetMuIDInnerAngle() const
float GetECALInnerAngle() const
Definition: GeometryCore.h:960
MuIDSegmentationAlgPtr fMuIDSegmentationAlg
Object containing the segmentation for the Sc Tracker.
float GetECALEndcapSideLength() const
Definition: GeometryCore.h:969
std::string gar::geo::GeometryCore::ROOTFile ( ) const
inline

Returns the full directory path to the geometry file source.

Returns
the full directory path to the geometry file source

This is the full path of the source of the detector geometry GeometryCore relies on.

Definition at line 477 of file GeometryCore.h.

477 { return fROOTfile; }
std::string fROOTfile
path to geometry file for geometry in GeometryCore
TGeoManager * gar::geo::GeometryCore::ROOTGeoManager ( ) const

Access to the ROOT geometry description manager.

Definition at line 222 of file GeometryCore.cxx.

223  {
224  return gGeoManager;
225  }
void gar::geo::GeometryCore::SetDetectorName ( std::string  new_name)
inlineprotected

Sets the detector name.

Definition at line 1066 of file GeometryCore.h.

1066 { fDetectorName = new_name; }
std::string fDetectorName
Name of the detector.
void gar::geo::GeometryCore::SetDetectorOrigin ( )
private

Definition at line 1100 of file GeometryCore.cxx.

1101  {
1102  //Case ND-GAr full
1103  if(fHasGasTPCDetector) {
1104  fOriginX = TPCXCent();
1105  fOriginY = TPCYCent();
1106  fOriginZ = TPCZCent();
1107  }
1108 
1109  //Case ND-GAr Lite
1110  if(fHasTrackerScDetector) {
1111  fOriginX = GArLiteXCent();
1112  fOriginY = GArLiteYCent();
1113  fOriginZ = GArLiteZCent();
1114  }
1115 
1116  }
float TPCXCent() const
Returns the X location of the center of the TPC in cm.
Definition: GeometryCore.h:778
float GArLiteYCent() const
Definition: GeometryCore.h:632
float TPCZCent() const
Returns the Z location of the center of the TPC in cm.
Definition: GeometryCore.h:792
float GArLiteXCent() const
Definition: GeometryCore.h:630
float TPCYCent() const
Returns the Y location of the center of the TPC in cm.
Definition: GeometryCore.h:785
float GArLiteZCent() const
Definition: GeometryCore.h:634
void gar::geo::GeometryCore::StoreECALNodes ( std::map< std::string, std::vector< const TGeoNode * >> &  map) const

Definition at line 311 of file GeometryCore.cxx.

311  {
312 
313  //Loop over all nodes for the ecal active volume and store it in a map
314  //Active volume has the form [Barrel-Endcap]ECal_staveXX_moduleYY_layer_ZZ_slice2_vol
315  std::string det[2] = { "Barrel", "Endcap" };
316  unsigned int nstave = GetECALInnerSymmetry() + 1;
317  unsigned int nmodule = 7;
318  unsigned int nlayer = fECALSegmentationAlg->nLayers() + 1;
319 
320  for(unsigned int idet = 0; idet < 2; idet++) {
321  for(unsigned int istave = 0; istave < nstave; istave++) {
322  for(unsigned int imodule = 0; imodule < nmodule; imodule++) {
323  for(unsigned int ilayer = 0; ilayer < nlayer; ilayer++) {
324  boost::format bname = boost::format("%sECal_stave%02i_module%02i_layer_%02i_slice2_vol") % det[idet].c_str() % istave % imodule % ilayer;
325  std::string vol_name = bname.str();
326  std::vector<const TGeoNode*> path = FindVolumePath(vol_name);
327  if(!path.empty()) map.emplace(vol_name, path); //insert in the map
328  }
329  }
330  }
331  }
332 
333  return;
334  } // GeometryCore::StoreECALNodes()
int GetECALInnerSymmetry() const
Definition: GeometryCore.h:957
std::string string
Definition: nybbler.cc:12
static bool format(QChar::Decomposition tag, QString &str, int index, int len)
Definition: qstring.cpp:11496
ECALSegmentationAlgPtr fECALSegmentationAlg
Object containing the segmentation for the ECAL.
std::vector< TGeoNode const * > FindVolumePath(std::string const &vol_name) const
Returns all the nodes with volumes with any of the specified names.
void gar::geo::GeometryCore::StoreECALParameters ( )
private

Definition at line 1135 of file GeometryCore.cxx.

void gar::geo::GeometryCore::StoreMuIDParameters ( )
private

Definition at line 1149 of file GeometryCore.cxx.

1150  {
1154  // std::raise(SIGINT);
1155  }
void gar::geo::GeometryCore::StoreOtherParameters ( )
private

Definition at line 1119 of file GeometryCore.cxx.

1120  {
1121  if(fHasLArTPCDetector) {
1122  //For the LArTPC
1124  }
1125  }
void gar::geo::GeometryCore::StoreTPCParameters ( )
protected

Definition at line 1128 of file GeometryCore.cxx.

1129  {
1130  if(!fHasGasTPCDetector) return;
1132  }
double gar::geo::GeometryCore::SurfaceY ( ) const
inline

The position of the detector respect to earth surface.

Returns
typical y position at surface in units of cm

This is the depth (y) of the surface (where earth meets air) for this detector site. The number is expressed in world coordinates and in centimetres, and it represents the y coordinate of earth surface. A negative value means that the origin of coordinates, typically matching the detector centre, is above surface.

Todo:
check that this is actually how it is used

Definition at line 538 of file GeometryCore.h.

538 { return fSurfaceY; }
double fSurfaceY
The point where air meets earth for this detector.
double gar::geo::GeometryCore::TotalMass ( const char *  vol = "volWorld") const

Returns the total mass [kg] of the specified volume (default: world)

Todo:
Use GetWorldVolumeName() as default instead

Definition at line 670 of file GeometryCore.cxx.

671  {
672  //the TGeoNode::GetVolume() returns the TGeoVolume of the detector outline
673  //and ROOT calculates the mass in kg for you
674  TGeoVolume *gvol = gGeoManager->FindVolumeFast(vol);
675  if(gvol) return gvol->Weight();
676 
677  throw cet::exception("GeometryCore") << "could not find specified volume "
678  << vol
679  << " to determine total mass\n";
680  }
cet::coded_exception< error, detail::translate > exception
Definition: exception.h:33
float gar::geo::GeometryCore::TPCLength ( ) const
inline

Returns the length of the TPC (x direction)

Returns
the value of the length of the specified TPC

Definition at line 763 of file GeometryCore.h.

763 { return fTPCLength; }
float fTPCLength
length of the TPC
int gar::geo::GeometryCore::TPCNumDriftVols ( ) const
inline

Returns number of TPC drift volumes.

Definition at line 771 of file GeometryCore.h.

771 { return fTPCNumDriftVols; }
int fTPCNumDriftVols
2 if standard ALICE detector, 1 if single drift vol
float gar::geo::GeometryCore::TPCRadius ( ) const
inline

Returns the radius of the TPC (y or z direction)

Returns
the radius of the TPC (y or z direction)

Definition at line 755 of file GeometryCore.h.

755 { return fTPCRadius; }
float fTPCRadius
Radius of the TPC.
float gar::geo::GeometryCore::TPCXCent ( ) const
inline

Returns the X location of the center of the TPC in cm.

Definition at line 778 of file GeometryCore.h.

778 { return fTPCXCent; }
float fTPCXCent
center of TPC: X
float gar::geo::GeometryCore::TPCYCent ( ) const
inline

Returns the Y location of the center of the TPC in cm.

Definition at line 785 of file GeometryCore.h.

785 { return fTPCYCent; }
float fTPCYCent
center of TPC: Y
float gar::geo::GeometryCore::TPCZCent ( ) const
inline

Returns the Z location of the center of the TPC in cm.

Definition at line 792 of file GeometryCore.h.

792 { return fTPCZCent; }
float fTPCZCent
center of TPC: Z
bool gar::geo::GeometryCore::ValueInRange ( double  value,
double  min,
double  max 
) const

Returns whether a value is within the specified range.

Parameters
valuethe value to be tested
minthe lower boundary
maxthe upper boundary
Returns
whether the value is within range

If min is larger than max, they are swapped. A tolerance of 10^-6 (absolute) is used.

Todo:

Use wiggle instead of 10^-6

resort source code for a bit of speed up

const std::string gar::geo::GeometryCore::VolumeName ( TVector3 const &  point) const

Returns the name of the deepest volume containing specified point.

Parameters
pointthe location to query, in world coordinates
Returns
name of the volume containing the point
Todo:

Use a reference to TVector3

Use a double[3] instead?

declare it const

what happens if none?

Unify the coordinates type

Definition at line 642 of file GeometryCore.cxx.

643  {
644  if( !this->PointInWorld(point) ){
645  const std::string unknown("unknownVolume");
646  return unknown;
647  }
648 
649  const std::string name(this->FindNode(point)->GetVolume()->GetName());
650  return name;
651  }
static QCString name
Definition: declinfo.cpp:673
TGeoNode * FindNode(T const &x, T const &y, T const &z) const
std::string string
Definition: nybbler.cc:12
bool PointInWorld(TVector3 const &point) const
constexpr ProductStatus unknown() noexcept
Definition: ProductStatus.h:31
void gar::geo::GeometryCore::WorldBox ( float *  xlo,
float *  xhi,
float *  ylo,
float *  yhi,
float *  zlo,
float *  zhi 
) const

Fills the arguments with the boundaries of the world.

Parameters
xlo(output) pointer to the lower x coordinate
xlo(output) pointer to the upper x coordinate
ylo(output) pointer to the lower y coordinate
ylo(output) pointer to the upper y coordinate
zlo(output) pointer to the lower z coordinate
zlo(output) pointer to the upper z coordinate
Exceptions
cet::exception("GeometryCore" category) if no world found

This method fills the boundaries of the world volume, that is the one known as "volWorld" in the geometry.

If a pointer is null, its coordinate is skipped.

Todo:

Replace it with a TPC boundaries style thing?

Unify the coordinates type

Definition at line 452 of file GeometryCore.cxx.

455  {
456  const TGeoShape* s = gGeoManager->GetVolume("volWorld")->GetShape();
457  if(!s)
458  throw cet::exception("GeometryCore") << "no pointer to world volume TGeoShape\n";
459 
460  if (xlo || xhi) {
461  double x1, x2;
462  s->GetAxisRange(1,x1,x2); if (xlo) *xlo = x1; if (xhi) *xhi = x2;
463  }
464  if (ylo || yhi) {
465  double y1, y2;
466  s->GetAxisRange(2,y1,y2); if (ylo) *ylo = y1; if (yhi) *yhi = y2;
467  }
468  if (zlo || zhi) {
469  double z1, z2;
470  s->GetAxisRange(3,z1,z2); if (zlo) *zlo = z1; if (zhi) *zhi = z2;
471  }
472  }
static QCString * s
Definition: config.cpp:1042
cet::coded_exception< error, detail::translate > exception
Definition: exception.h:33
bool gar::geo::GeometryCore::WorldToLocal ( std::array< double, 3 > const &  world,
std::array< double, 3 > &  local,
gar::geo::LocalTransformation< TGeoHMatrix > &  trans 
) const

Definition at line 394 of file GeometryCore.cxx.

395  {
396  TVector3 point(world[0], world[1], world[2]);
397  std::string name = VolumeName(point);
398  std::vector<const TGeoNode*> path;
399 
400  // std::cout << "WorldToLocal -- Finding volume " << name << " ..." << std::endl;
401  if( fECALNodePath.find(name) != fECALNodePath.end() ) {
402  // std::cout << "Found volume " << name << " in fECALNodePath" << std::endl;
403  path = fECALNodePath.at(name);
404  } else {
405  path = FindVolumePath(name);
406  }
407 
408  if (path.empty()){
409  throw cet::exception("GeometryCore::WorldToLocal") << " can't find volume '" << name << "'\n";
410  return false;
411  }
412 
413  //Change to local frame
414  trans.SetPath(path, path.size() - 1);
415  std::array<double, 3> wd{ {world[0], world[1], world[2]} }, loc;
416  trans.WorldToLocal(wd.data(), loc.data());
417  local = {loc.at(0), loc.at(1), loc.at(2)};
418 
419  return true;
420  }
static QCString name
Definition: declinfo.cpp:673
std::string string
Definition: nybbler.cc:12
std::vector< TGeoNode const * > FindVolumePath(std::string const &vol_name) const
Returns all the nodes with volumes with any of the specified names.
void WorldToLocal(double const *world, double *local) const
Transforms a point from world frame to local frame.
std::map< std::string, std::vector< const TGeoNode * > > fECALNodePath
Stored map of vectors of nodes for the ecal to speedup node searching.
void SetPath(std::vector< TGeoNode const * > const &path, size_t depth)
const std::string VolumeName(TVector3 const &point) const
Returns the name of the deepest volume containing specified point.
cet::coded_exception< error, detail::translate > exception
Definition: exception.h:33

Member Data Documentation

ChannelMapPtr gar::geo::GeometryCore::fChannelMapAlg
private

Object containing the channel to wire mapping.

Definition at line 1268 of file GeometryCore.h.

std::string gar::geo::GeometryCore::fDetectorName
private

Name of the detector.

Definition at line 1157 of file GeometryCore.h.

float gar::geo::GeometryCore::fECALECapRinner
private

Definition at line 1249 of file GeometryCore.h.

float gar::geo::GeometryCore::fECALECapRouter
private

Definition at line 1250 of file GeometryCore.h.

float gar::geo::GeometryCore::fECALEndcapOuterX
private

Position of the end xplane of the ECAL endcap.

Definition at line 1254 of file GeometryCore.h.

bool gar::geo::GeometryCore::fECALEndcapOutside
private

Is the ECAL Endcap outside the PV.

Definition at line 1164 of file GeometryCore.h.

float gar::geo::GeometryCore::fECALEndcapStartX
private

Position of the start xplane of the ECAL endcap.

Definition at line 1253 of file GeometryCore.h.

ECALLayeredCalorimeterData gar::geo::GeometryCore::fECALLayeredCalorimeterData
private

Definition at line 1281 of file GeometryCore.h.

unsigned int gar::geo::GeometryCore::fECALnLayers
private

number of ECAL layers from the seg algorithm

Definition at line 1255 of file GeometryCore.h.

std::map<std::string, std::vector<const TGeoNode*> > gar::geo::GeometryCore::fECALNodePath
private

Stored map of vectors of nodes for the ecal to speedup node searching.

Definition at line 1237 of file GeometryCore.h.

float gar::geo::GeometryCore::fECALRinner
private

Minimum radius of the ECAL inner barrel.

Definition at line 1247 of file GeometryCore.h.

float gar::geo::GeometryCore::fECALRouter
private

Minimum radius of the ECAL outer barrel.

Definition at line 1248 of file GeometryCore.h.

ECALSegmentationAlgPtr gar::geo::GeometryCore::fECALSegmentationAlg
private

Object containing the segmentation for the ECAL.

Definition at line 1271 of file GeometryCore.h.

int gar::geo::GeometryCore::fECALSymmetry
private

Number of sides of the Barrel.

Definition at line 1252 of file GeometryCore.h.

float gar::geo::GeometryCore::fEnclosureHalfHeight = 0.
private

Definition at line 1215 of file GeometryCore.h.

float gar::geo::GeometryCore::fEnclosureHalfWidth = 0.
private

Definition at line 1214 of file GeometryCore.h.

float gar::geo::GeometryCore::fEnclosureLength = 0.
private

Definition at line 1216 of file GeometryCore.h.

float gar::geo::GeometryCore::fEnclosureX = 0.
private

Definition at line 1190 of file GeometryCore.h.

float gar::geo::GeometryCore::fEnclosureY = 0.
private

Definition at line 1191 of file GeometryCore.h.

float gar::geo::GeometryCore::fEnclosureZ = 0.
private

Definition at line 1192 of file GeometryCore.h.

float gar::geo::GeometryCore::fGArLiteLength = 0
private

Definition at line 1235 of file GeometryCore.h.

float gar::geo::GeometryCore::fGArLiteRadius = 0
private

Definition at line 1234 of file GeometryCore.h.

float gar::geo::GeometryCore::fGArLiteXCent = 0
private

Definition at line 1230 of file GeometryCore.h.

float gar::geo::GeometryCore::fGArLiteYCent = 0
private

Definition at line 1231 of file GeometryCore.h.

float gar::geo::GeometryCore::fGArLiteZCent = 0
private

Definition at line 1232 of file GeometryCore.h.

std::string gar::geo::GeometryCore::fGDMLfile
private

path to geometry file used for Geant4 simulation

Definition at line 1158 of file GeometryCore.h.

bool gar::geo::GeometryCore::fHasECALDetector
private

Definition at line 1243 of file GeometryCore.h.

bool gar::geo::GeometryCore::fHasEnclosure
private

Definition at line 1240 of file GeometryCore.h.

bool gar::geo::GeometryCore::fHasGasTPCDetector
private

Definition at line 1242 of file GeometryCore.h.

bool gar::geo::GeometryCore::fHasLArTPCDetector
private

Definition at line 1241 of file GeometryCore.h.

bool gar::geo::GeometryCore::fHasMuonDetector
private

Definition at line 1261 of file GeometryCore.h.

bool gar::geo::GeometryCore::fHasRock
private

Definition at line 1239 of file GeometryCore.h.

bool gar::geo::GeometryCore::fHasTrackerScDetector
private

Definition at line 1244 of file GeometryCore.h.

float gar::geo::GeometryCore::fLArTPCActiveHalfHeight = 0.
private

Definition at line 1227 of file GeometryCore.h.

float gar::geo::GeometryCore::fLArTPCActiveHalfWidth = 0.
private

Definition at line 1226 of file GeometryCore.h.

float gar::geo::GeometryCore::fLArTPCActiveLength = 0.
private

Definition at line 1228 of file GeometryCore.h.

float gar::geo::GeometryCore::fLArTPCHalfHeight = 0.
private

Definition at line 1223 of file GeometryCore.h.

float gar::geo::GeometryCore::fLArTPCHalfWidth = 0.
private

Definition at line 1222 of file GeometryCore.h.

float gar::geo::GeometryCore::fLArTPCLength = 0.
private

Definition at line 1224 of file GeometryCore.h.

float gar::geo::GeometryCore::fLArTPCX = 0.
private

Definition at line 1198 of file GeometryCore.h.

float gar::geo::GeometryCore::fLArTPCXCent = 0.
private

Definition at line 1202 of file GeometryCore.h.

float gar::geo::GeometryCore::fLArTPCY = 0.
private

Definition at line 1199 of file GeometryCore.h.

float gar::geo::GeometryCore::fLArTPCYCent = 0.
private

Definition at line 1203 of file GeometryCore.h.

float gar::geo::GeometryCore::fLArTPCZ = 0.
private

Definition at line 1200 of file GeometryCore.h.

float gar::geo::GeometryCore::fLArTPCZCent = 0.
private

Definition at line 1204 of file GeometryCore.h.

MinervaSegmentationAlgPtr gar::geo::GeometryCore::fMinervaSegmentationAlg
private

Object containing the segmentation for the Sc Tracker.

Definition at line 1274 of file GeometryCore.h.

double gar::geo::GeometryCore::fMinWireZDist
private

to look for the closest wire

Minimum distance in Z from a point in which

Definition at line 1160 of file GeometryCore.h.

float gar::geo::GeometryCore::fMPDHalfHeight = 0.
private

Definition at line 1219 of file GeometryCore.h.

float gar::geo::GeometryCore::fMPDHalfWidth = 0.
private

Definition at line 1218 of file GeometryCore.h.

float gar::geo::GeometryCore::fMPDLength = 0.
private

Definition at line 1220 of file GeometryCore.h.

float gar::geo::GeometryCore::fMPDX = 0.
private

Definition at line 1194 of file GeometryCore.h.

float gar::geo::GeometryCore::fMPDY = 0.
private

Definition at line 1195 of file GeometryCore.h.

float gar::geo::GeometryCore::fMPDZ = 0.
private

Definition at line 1196 of file GeometryCore.h.

unsigned int gar::geo::GeometryCore::fMuIDnLayers
private

number of MuID layers from the seg algorithm

Definition at line 1265 of file GeometryCore.h.

float gar::geo::GeometryCore::fMuIDRinner
private

Minimum radius of the MuID inner barrel.

Definition at line 1262 of file GeometryCore.h.

float gar::geo::GeometryCore::fMuIDRouter
private

Minimum radius of the MuID outer barrel.

Definition at line 1263 of file GeometryCore.h.

MuIDSegmentationAlgPtr gar::geo::GeometryCore::fMuIDSegmentationAlg
private

Object containing the segmentation for the Sc Tracker.

Definition at line 1277 of file GeometryCore.h.

int gar::geo::GeometryCore::fMuIDSymmetry
private

Number of sides of the MuID Barrel.

Definition at line 1264 of file GeometryCore.h.

float gar::geo::GeometryCore::fOriginX = 0.
private

Definition at line 1166 of file GeometryCore.h.

float gar::geo::GeometryCore::fOriginY = 0.
private

Definition at line 1167 of file GeometryCore.h.

float gar::geo::GeometryCore::fOriginZ = 0.
private

Definition at line 1168 of file GeometryCore.h.

bool gar::geo::GeometryCore::fPointInWarnings
private

Generate warnings from failed inputs to PointIn* methods.

Definition at line 1163 of file GeometryCore.h.

double gar::geo::GeometryCore::fPositionWiggle
private

accounting for rounding errors when testing positions

Definition at line 1162 of file GeometryCore.h.

float gar::geo::GeometryCore::fPVThickness
private

Pressure Vessel thickness.

Definition at line 1251 of file GeometryCore.h.

float gar::geo::GeometryCore::fRockHalfHeight = 0.
private

Definition at line 1211 of file GeometryCore.h.

float gar::geo::GeometryCore::fRockHalfWidth = 0.
private

Definition at line 1210 of file GeometryCore.h.

float gar::geo::GeometryCore::fRockLength = 0.
private

Definition at line 1212 of file GeometryCore.h.

float gar::geo::GeometryCore::fRockX = 0.
private

Definition at line 1186 of file GeometryCore.h.

float gar::geo::GeometryCore::fRockY = 0.
private

Definition at line 1187 of file GeometryCore.h.

float gar::geo::GeometryCore::fRockZ = 0.
private

Definition at line 1188 of file GeometryCore.h.

std::string gar::geo::GeometryCore::fROOTfile
private

path to geometry file for geometry in GeometryCore

Definition at line 1159 of file GeometryCore.h.

double gar::geo::GeometryCore::fSurfaceY
private

The point where air meets earth for this detector.

Definition at line 1156 of file GeometryCore.h.

float gar::geo::GeometryCore::fTPCLength = 0.
private

length of the TPC

Definition at line 1171 of file GeometryCore.h.

int gar::geo::GeometryCore::fTPCNumDriftVols = 2
private

2 if standard ALICE detector, 1 if single drift vol

Definition at line 1173 of file GeometryCore.h.

float gar::geo::GeometryCore::fTPCRadius = 0.
private

Radius of the TPC.

Definition at line 1170 of file GeometryCore.h.

float gar::geo::GeometryCore::fTPCXCent = 0.
private

center of TPC: X

Definition at line 1178 of file GeometryCore.h.

float gar::geo::GeometryCore::fTPCYCent = 0.
private

center of TPC: Y

Definition at line 1179 of file GeometryCore.h.

float gar::geo::GeometryCore::fTPCZCent = 0.
private

center of TPC: Z

Definition at line 1180 of file GeometryCore.h.

unsigned int gar::geo::GeometryCore::fTrackerScnPlanes
private

Definition at line 1258 of file GeometryCore.h.

float gar::geo::GeometryCore::fWorldHalfHeight = 0.
private

Definition at line 1207 of file GeometryCore.h.

float gar::geo::GeometryCore::fWorldHalfWidth = 0.
private

Definition at line 1206 of file GeometryCore.h.

float gar::geo::GeometryCore::fWorldLength = 0.
private

Definition at line 1208 of file GeometryCore.h.

float gar::geo::GeometryCore::fWorldX = 0.
private

Definition at line 1182 of file GeometryCore.h.

float gar::geo::GeometryCore::fWorldY = 0.
private

Definition at line 1183 of file GeometryCore.h.

float gar::geo::GeometryCore::fWorldZ = 0.
private

Definition at line 1184 of file GeometryCore.h.


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