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

The geometry of one entire detector, as served by art. More...

#include <GeometryGAr.h>

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

Public Types

using provider_type = GeometryCore
 type of service provider More...
 

Public Member Functions

 GeometryGAr (fhicl::ParameterSet const &pset,::art::ActivityRegistry &reg)
 
void preBeginRun (::art::Run const &run)
 Updates the geometry if needed at the beginning of each new run. More...
 
provider_type const * provider () const
 Returns a pointer to the geometry service provider. More...
 
gar::sumdata::GeometryConfigurationInfo const & configurationInfo () const
 
- Public Member Functions inherited from gar::geo::GeometryCore
 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
 
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...
 
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...
 

Private Member Functions

void LoadNewGeometry (std::string const &gdmlfile, std::string const &rootfile, bool bForceReload=false)
 Expands the provided paths and loads the geometry description(s) More...
 
void InitializeSegmentations ()
 
void FillGeometryConfigurationInfo (fhicl::ParameterSet const &config)
 
bool CheckConfigurationInfo (gar::sumdata::GeometryConfigurationInfo const &other) const
 

Static Private Member Functions

static gar::sumdata::GeometryConfigurationInfo const & ReadConfigurationInfo (art::Run const &run)
 
static bool CompareConfigurationInfo (gar::sumdata::GeometryConfigurationInfo const &A, gar::sumdata::GeometryConfigurationInfo const &B)
 

Private Attributes

std::string fRelPath
 
bool fNonFatalConfCheck
 
fhicl::ParameterSet fSortingParameters
 Parameter set to define the channel map sorting. More...
 
fhicl::ParameterSet fSegParameters
 Parameter set to define the segmentation algorithms. More...
 
fhicl::ParameterSet fECALSegParameters
 Parameters for the ECAL Segmentation. More...
 
fhicl::ParameterSet fMinervaSegParameters
 Parameters for the Tracker Sc Segmentation. More...
 
fhicl::ParameterSet fMuIDSegParameters
 Parameters for the MuID Segmentation. More...
 
gar::sumdata::GeometryConfigurationInfo fConfInfo
 

Additional Inherited Members

- Protected Member Functions inherited from gar::geo::GeometryCore
void SetDetectorName (std::string new_name)
 Sets the detector name. More...
 
void GetGeometryParameters ()
 
void FinalizeGeometryParameters ()
 
void PrintGeometry () const
 
void StoreTPCParameters ()
 
void GetDetectorsPresent ()
 

Detailed Description

The geometry of one entire detector, as served by art.

This class extends the interface of the geometry service provider, GeometryCore, to the one of an art service. It handles the correct initialization of the provider using information

It relies on geo::ExptGeoHelperInterface service to obtain the channel mapping algorithm proper for the selected geometry.

The geometry initialization happens immediately on construction. Optionally, the geometry is automatically reinitialized on each run based on the information contained in the art::Run object.

Configuration

In addition to the parameters documented in geo::GeometryCore, the following parameters are supported:

Note
Currently, the file defined by GDML parameter is also served to ROOT for the internal geometry representation.

Definition at line 104 of file GeometryGAr.h.

Member Typedef Documentation

type of service provider

Definition at line 108 of file GeometryGAr.h.

Constructor & Destructor Documentation

gar::geo::GeometryGAr::GeometryGAr ( fhicl::ParameterSet const &  pset,
::art::ActivityRegistry reg 
)

Definition at line 31 of file GeometryGAr_service.cc.

32  : GeometryCore(pset)
33  , fRelPath (pset.get< std::string >("RelativePath", "" ))
34  , fNonFatalConfCheck(pset.get< bool >("SkipConfigurationCheck", false))
35  , fSortingParameters(pset.get<fhicl::ParameterSet>("SortingParameters", fhicl::ParameterSet() ))
36  , fSegParameters(pset.get<fhicl::ParameterSet>("SegmentationAlgPars", fhicl::ParameterSet() ))
37  {
38  // add a final directory separator ("/") to fRelPath if not already there
39  if (!fRelPath.empty() && (fRelPath.back() != '/')) fRelPath += '/';
40 
41  // register a callback to be executed when a new run starts
42  reg.sPreBeginRun.watch(this, &GeometryGAr::preBeginRun);
43 
44  //......................................................................
45  // 5.15.12 BJR: use the gdml file for both the fGDMLFile and fROOTFile
46  // variables as ROOT v5.30.06 is once again able to read in gdml files
47  // during batch operation, in this case think of fROOTFile meaning the
48  // file used to make the ROOT TGeoManager. I don't want to remove
49  // the separate variables in case ROOT breaks again
50  std::string GDMLFileName = pset.get<std::string>("GDML");
51  std::string ROOTFileName = pset.get<std::string>("GDML");
52 
53  // load the geometry
54  LoadNewGeometry(GDMLFileName, ROOTFileName);
55 
57 
58  } // GeometryGAr::Geometry()
fhicl::ParameterSet fSortingParameters
Parameter set to define the channel map sorting.
Definition: GeometryGAr.h:140
std::string string
Definition: nybbler.cc:12
void LoadNewGeometry(std::string const &gdmlfile, std::string const &rootfile, bool bForceReload=false)
Expands the provided paths and loads the geometry description(s)
std::string fRelPath
Definition: GeometryGAr.h:137
void preBeginRun(::art::Run const &run)
Updates the geometry if needed at the beginning of each new run.
GlobalSignal< detail::SignalResponseType::FIFO, void(Run const &)> sPreBeginRun
fhicl::ParameterSet fSegParameters
Parameter set to define the segmentation algorithms.
Definition: GeometryGAr.h:142
GeometryCore(fhicl::ParameterSet const &pset)
Initialize geometry from a given configuration.
void FillGeometryConfigurationInfo(fhicl::ParameterSet const &config)

Member Function Documentation

bool gar::geo::GeometryGAr::CheckConfigurationInfo ( gar::sumdata::GeometryConfigurationInfo const &  other) const
private

Definition at line 213 of file GeometryGAr_service.cc.

214  {
215  MF_LOG_DEBUG("Geometry") << "New geometry information:\n"
216  << other;
218  } // Geometry::CheckConfigurationInfo()
gar::sumdata::GeometryConfigurationInfo fConfInfo
Definition: GeometryGAr.h:147
static bool CompareConfigurationInfo(gar::sumdata::GeometryConfigurationInfo const &A, gar::sumdata::GeometryConfigurationInfo const &B)
#define MF_LOG_DEBUG(id)
bool gar::geo::GeometryGAr::CompareConfigurationInfo ( gar::sumdata::GeometryConfigurationInfo const &  A,
gar::sumdata::GeometryConfigurationInfo const &  B 
)
staticprivate

Definition at line 238 of file GeometryGAr_service.cc.

239  {
240  /*
241  * Implemented criteria:
242  *
243  * * both informations must be valid
244  * * the detector names must exactly match
245  *
246  */
247 
248  if (!A.isDataValid()) {
249  MF_LOG_WARNING("Geometry") << "Geometry::CompareConfigurationInfo(): "
250  "invalid version for configuration A:\n" << A;
251  return false;
252  }
253  if (!B.isDataValid()) {
254  MF_LOG_WARNING("Geometry") << "Geometry::CompareConfigurationInfo(): "
255  "invalid version for configuration B:\n" << B;
256  return false;
257  }
258 
259  return true;
260  } // CompareConfigurationInfo()
#define A
Definition: memgrp.cpp:38
#define MF_LOG_WARNING(category)
gar::sumdata::GeometryConfigurationInfo const& gar::geo::GeometryGAr::configurationInfo ( ) const
inline

Definition at line 118 of file GeometryGAr.h.

118 { return fConfInfo; }
gar::sumdata::GeometryConfigurationInfo fConfInfo
Definition: GeometryGAr.h:147
void gar::geo::GeometryGAr::FillGeometryConfigurationInfo ( fhicl::ParameterSet const &  config)
private

Definition at line 195 of file GeometryGAr_service.cc.

196  {
197 
200 
201  // version 1+:
202  confInfo.detectorName = DetectorName();
203 
204  // version 2+:
205  confInfo.geometryServiceConfiguration = config.to_indented_string();
206  fConfInfo = std::move(confInfo);
207 
208  MF_LOG_DEBUG("Geometry") << "Geometry configuration information:\n" << fConfInfo;
209 
210  } // Geometry::FillGeometryConfigurationInfo()
DataVersion_t dataVersion
Version of the data in this object (0 is invalid version).
Description of the current configuration of detector geometry.
std::string geometryServiceConfiguration
geo::Geometry service configuration, as FHiCL table.
static Config * config
Definition: config.cpp:1054
def move(depos, offset)
Definition: depos.py:107
unsigned int DataVersion_t
Type used for the version of data.
gar::sumdata::GeometryConfigurationInfo fConfInfo
Definition: GeometryGAr.h:147
#define MF_LOG_DEBUG(id)
std::string DetectorName() const
Returns a string with the name of the detector, as configured.
Definition: GeometryCore.h:495
void gar::geo::GeometryGAr::InitializeSegmentations ( )
private

Definition at line 87 of file GeometryGAr_service.cc.

88  {
89  // the channel map is responsible of calling the channel map configuration
90  // of the TPC geometry
92 
93  if ( ! ChannelMap() ) {
94  throw cet::exception("ChannelMapLoadFail")
95  << " failed to load new channel map";
96  }
97 
98  // the channel map is responsible of calling the channel map configuration
99  // of the ECAL geometry
101  if(not fECALSegParameters.is_empty()) {
102  ::art::ServiceHandle<geo::ExptGeoHelperInterface>()->ConfigureECALSegmentationAlg(fECALSegParameters, this);
103 
104  if ( ! ECALSegmentationAlg() ) {
105  throw cet::exception("ECALSegmentationAlgLoadFailed")
106  << " failed to load the ECAL segmentation";
107  }
108  }
109 
110  // the channel map is responsible of calling the channel map configuration
111  // of the Tracker Sc geometry
113  if(not fMinervaSegParameters.is_empty()) {
114  ::art::ServiceHandle<geo::ExptGeoHelperInterface>()->ConfigureMinervaSegmentationAlg(fMinervaSegParameters, this);
115 
116  if ( ! MinervaSegmentationAlg() ) {
117  throw cet::exception("MinervaSegmentationAlgLoadFailed")
118  << " failed to load the Minerva segmentation";
119  }
120  }
121 
122  // the channel map is responsible of calling the channel map configuration
123  // of the MuID geometry
125  if(not fMuIDSegParameters.is_empty()) {
126  ::art::ServiceHandle<geo::ExptGeoHelperInterface>()->ConfigureMuIDSegmentationAlg(fMuIDSegParameters, this);
127 
128  if ( ! MuIDSegmentationAlg() ) {
129  throw cet::exception("MuIDSegmentationAlgLoadFailed")
130  << " failed to load the MuID segmentation";
131  }
132  }
133 
134  } // GeometryGAr::InitializeSegmentation()
fhicl::ParameterSet fSortingParameters
Parameter set to define the channel map sorting.
Definition: GeometryGAr.h:140
fhicl::ParameterSet fMuIDSegParameters
Parameters for the MuID Segmentation.
Definition: GeometryGAr.h:145
fhicl::ParameterSet fMinervaSegParameters
Parameters for the Tracker Sc Segmentation.
Definition: GeometryGAr.h:144
gar::geo::seg::ChannelMapAlg const * ChannelMap() const
Returns the object handling the channel map.
Definition: GeometryCore.h:930
fhicl::ParameterSet fECALSegParameters
Parameters for the ECAL Segmentation.
Definition: GeometryGAr.h:143
T get(std::string const &key) const
Definition: ParameterSet.h:271
gar::geo::seg::SegmentationAlg const * ECALSegmentationAlg() const
Returns the object handling the ECAL segmentation.
Definition: GeometryCore.h:933
gar::geo::seg::SegmentationAlg const * MinervaSegmentationAlg() const
Returns the object handling the Sc Tracker segmentation.
Definition: GeometryCore.h:936
bool is_empty() const
fhicl::ParameterSet fSegParameters
Parameter set to define the segmentation algorithms.
Definition: GeometryGAr.h:142
gar::geo::seg::SegmentationAlg const * MuIDSegmentationAlg() const
Returns the object handling the MuID segmentation.
Definition: GeometryCore.h:939
cet::coded_exception< error, detail::translate > exception
Definition: exception.h:33
void gar::geo::GeometryGAr::LoadNewGeometry ( std::string const &  gdmlfile,
std::string const &  rootfile,
bool  bForceReload = false 
)
private

Expands the provided paths and loads the geometry description(s)

Definition at line 137 of file GeometryGAr_service.cc.

140  {
141  // start with the relative path
142  std::string GDMLFileName(fRelPath), ROOTFileName(fRelPath);
143 
144  // add the base file names
145  ROOTFileName.append(gdmlfile);
146  GDMLFileName.append(gdmlfile);
147 
148  // Search all reasonable locations for the GDML file that contains
149  // the detector geometry.
150  // cet::search_path constructor decides if initialized value is a path
151  // or an environment variable
152  std::string GDMLfile("");
153  std::string ROOTfile("");
154 
155  if(fRelPath.empty()){
156  cet::search_path sp("FW_SEARCH_PATH");
157 
158  ;
159  if( !sp.find_file(GDMLFileName, GDMLfile) ) {
160  throw cet::exception("Geometry")
161  << "cannot find the gdml geometry file:"
162  << "\n" << GDMLFileName
163  << "\nbail ungracefully.\n";
164  }
165 
166  if( !sp.find_file(ROOTFileName, ROOTfile) ) {
167  throw cet::exception("Geometry")
168  << "cannot find the root geometry file:\n"
169  << "\n" << ROOTFileName
170  << "\nbail ungracefully.\n";
171  }
172  }
173  else{
174  GDMLfile = GDMLFileName;
175  ROOTfile = GDMLFileName;
176  }
177 
178  // initialize the geometry with the files we have found
179  LoadGeometryFile(GDMLfile, ROOTfile, bForceReload);
180 
181  //Get detector parameters
183 
184  // now init the detector Segmentations (Channel Map, ECAL etc...)
186 
187  // Finish the geometry when it uses the segmentation
189 
190  //Print the geometry parameters
191  PrintGeometry();
192  } // GeometryGAr::LoadNewGeometry()
std::string string
Definition: nybbler.cc:12
std::string fRelPath
Definition: GeometryGAr.h:137
void LoadGeometryFile(std::string const &gdmlfile, std::string const &rootfile, bool bForceReload=false)
Loads the geometry information from the specified files.
void PrintGeometry() const
cet::coded_exception< error, detail::translate > exception
Definition: exception.h:33
void gar::geo::GeometryGAr::preBeginRun ( ::art::Run const &  run)

Updates the geometry if needed at the beginning of each new run.

Definition at line 62 of file GeometryGAr_service.cc.

63  {
65  if (!CheckConfigurationInfo(inputGeomInfo)) {
66  if (fNonFatalConfCheck) {
67  // disable the non-fatal option if you need the details
68  MF_LOG_WARNING("Geometry") << "Geometry used for " << run.id()
69  << " is incompatible with the one configured in the job.";
70  }
71  else
72  {
73  throw cet::exception("Geometry")
74  << "Geometry used for run " << run.id()
75  << " is incompatible with the one configured in the job!"
76  << "\n=== job configuration " << std::string(50, '=')
77  << "\n" << fConfInfo
78  << "\n=== run configuration " << std::string(50, '=')
79  << "\n" << inputGeomInfo
80  << "\n======================" << std::string(50, '=')
81  << "\n";
82  }
83  }
84  } // GeometryGAr::preBeginRun()
bool CheckConfigurationInfo(gar::sumdata::GeometryConfigurationInfo const &other) const
std::string string
Definition: nybbler.cc:12
static gar::sumdata::GeometryConfigurationInfo const & ReadConfigurationInfo(art::Run const &run)
gar::sumdata::GeometryConfigurationInfo fConfInfo
Definition: GeometryGAr.h:147
#define MF_LOG_WARNING(category)
cet::coded_exception< error, detail::translate > exception
Definition: exception.h:33
Description of the current configuration of detector geometry.
provider_type const* gar::geo::GeometryGAr::provider ( ) const
inline

Returns a pointer to the geometry service provider.

Definition at line 116 of file GeometryGAr.h.

116 { return static_cast<provider_type const*>(this); }
GeometryCore provider_type
type of service provider
Definition: GeometryGAr.h:108
gar::sumdata::GeometryConfigurationInfo const & gar::geo::GeometryGAr::ReadConfigurationInfo ( art::Run const &  run)
staticprivate

Definition at line 221 of file GeometryGAr_service.cc.

222  {
223 
224  try {
225  return run.getProduct<gar::sumdata::GeometryConfigurationInfo>(art::InputTag{"GeometryGArConfigurationWriter"});
226  }
227  catch (art::Exception const& e) {
228  throw art::Exception{
229  e.categoryCode(),
230  "Can't read geometry configuration information.\n"
231  "Is `GeometryGArConfigurationWriter` service configured?\n",
232  e};
233  }
234 
235  } // Geometry::ReadConfigurationInfo()
Description of the current configuration of detector geometry.
const double e
cet::coded_exception< errors::ErrorCodes, ExceptionDetail::translate > Exception
Definition: Exception.h:66

Member Data Documentation

gar::sumdata::GeometryConfigurationInfo gar::geo::GeometryGAr::fConfInfo
private

Definition at line 147 of file GeometryGAr.h.

fhicl::ParameterSet gar::geo::GeometryGAr::fECALSegParameters
private

Parameters for the ECAL Segmentation.

Definition at line 143 of file GeometryGAr.h.

fhicl::ParameterSet gar::geo::GeometryGAr::fMinervaSegParameters
private

Parameters for the Tracker Sc Segmentation.

Definition at line 144 of file GeometryGAr.h.

fhicl::ParameterSet gar::geo::GeometryGAr::fMuIDSegParameters
private

Parameters for the MuID Segmentation.

Definition at line 145 of file GeometryGAr.h.

bool gar::geo::GeometryGAr::fNonFatalConfCheck
private

Definition at line 139 of file GeometryGAr.h.

std::string gar::geo::GeometryGAr::fRelPath
private

Relative path added to FW_SEARCH_PATH to search for geometry file

Definition at line 137 of file GeometryGAr.h.

fhicl::ParameterSet gar::geo::GeometryGAr::fSegParameters
private

Parameter set to define the segmentation algorithms.

Definition at line 142 of file GeometryGAr.h.

fhicl::ParameterSet gar::geo::GeometryGAr::fSortingParameters
private

Parameter set to define the channel map sorting.

Definition at line 140 of file GeometryGAr.h.


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