3 #include "CoreUtils/ServiceUtil.h" 9 namespace gar_pandora {
12 : m_settings(settings),
15 fGeo = gar::providerFrom<geo::GeometryGAr>();
38 MF_LOG_INFO(
"GeometryCreator::CreateGeometry()" ) <<
"Creating geometry for detector " << detectorName <<
std::endl;
41 PANDORA_RETURN_RESULT_IF(pandora::STATUS_CODE_SUCCESS, !=, PandoraApi::Geometry::SubDetector::Create(
m_pPandora, iter->second));
44 MF_LOG_INFO(
"GeometryCreator::CreateGeometry()" ) <<
"Creating geometry for additional subdetector " << iter->first <<
std::endl;
45 PANDORA_RETURN_RESULT_IF(pandora::STATUS_CODE_SUCCESS, !=, PandoraApi::Geometry::SubDetector::Create(
m_pPandora, iter->second));
50 MF_LOG_ERROR(
"GeometryCreator::CreateGeometry()" ) <<
"Failure in pandora geometry creator, exception: " << exception.what() <<
std::endl;
54 return pandora::STATUS_CODE_SUCCESS;
61 PandoraApi::Geometry::SubDetector::Parameters eCalBarrelParameters, eCalEndCapParameters,
62 muonBarrelParameters, muonEndCapParameters;
67 subDetectorTypeMap[pandora::ECAL_BARREL] = eCalBarrelParameters;
68 subDetectorTypeMap[pandora::ECAL_ENDCAP] = eCalEndCapParameters;
70 PandoraApi::Geometry::SubDetector::Parameters trackerParameters;
72 trackerParameters.m_subDetectorName =
"Tracker";
73 trackerParameters.m_subDetectorType = pandora::INNER_TRACKER;
74 trackerParameters.m_innerRCoordinate = 0.f;
75 trackerParameters.m_innerZCoordinate = 0.f;
76 trackerParameters.m_innerPhiCoordinate = 0.f;
77 trackerParameters.m_innerSymmetryOrder = 0;
80 trackerParameters.m_outerPhiCoordinate = 0.f;
81 trackerParameters.m_outerSymmetryOrder = 0;
82 trackerParameters.m_isMirroredInZ =
true;
83 trackerParameters.m_nLayers = 0;
84 subDetectorTypeMap[pandora::INNER_TRACKER] = trackerParameters;
98 const std::vector<gar::geo::LayeredCalorimeterStruct::Layer> &
layers = inputParameters.
layers;
100 parameters.m_subDetectorName = subDetectorName;
101 parameters.m_subDetectorType = subDetectorType;
107 parameters.m_innerPhiCoordinate = inputParameters.
inner_phi0;
108 parameters.m_outerPhiCoordinate = inputParameters.
outer_phi0;
110 parameters.m_isMirroredInZ =
true;
111 parameters.m_nLayers = layers.size();
113 MF_LOG_DEBUG(
"GeometryCreator::SetDefaultSubDetectorParameters")
114 <<
" parameters.m_subDetectorName = " << parameters.m_subDetectorName.Get()
115 <<
" parameters.m_subDetectorType = " << parameters.m_subDetectorType.Get()
116 <<
" parameters.m_innerRCoordinate = " << parameters.m_innerRCoordinate.Get()
117 <<
" parameters.m_innerZCoordinate = " << parameters.m_innerZCoordinate.Get()
118 <<
" parameters.m_innerSymmetryOrder = " << parameters.m_innerSymmetryOrder.Get()
119 <<
" parameters.m_outerRCoordinate = " << parameters.m_outerRCoordinate.Get()
120 <<
" parameters.m_outerZCoordinate = " << parameters.m_outerZCoordinate.Get()
121 <<
" parameters.m_innerPhiCoordinate = " << parameters.m_innerPhiCoordinate.Get()
122 <<
" parameters.m_outerPhiCoordinate = " << parameters.m_outerPhiCoordinate.Get()
123 <<
" parameters.m_nLayers = " << parameters.m_nLayers.Get();
125 for (
size_t i = 0; i < layers.size(); i++)
128 PandoraApi::Geometry::LayerParameters layerParameters;
135 totalNumberOfRadLengths += layers.at(i-1).outer_nRadiationLengths;
136 totalNumberOfIntLengths += layers.at(i-1).outer_nInteractionLengths;
140 layerParameters.m_nRadiationLengths = totalNumberOfRadLengths;
141 layerParameters.m_nInteractionLengths = totalNumberOfIntLengths;
143 MF_LOG_DEBUG(
"GeometryCreator::SetDefaultSubDetectorParameters")
145 <<
" layerParameters.m_closestDistanceToIp = " << layerParameters.m_closestDistanceToIp.Get()
146 <<
" layerParameters.m_nRadiationLengths = " << layerParameters.m_nRadiationLengths.Get()
147 <<
" layerParameters.m_nInteractionLengths = " << layerParameters.m_nInteractionLengths.Get();
149 parameters.m_layerParametersVector.push_back(layerParameters);
static constexpr double cm
GeometryCreator(const Settings &settings, const pandora::Pandora *const pPandora)
double inner_nInteractionLengths
void SetAdditionalSubDetectorParameters(SubDetectorNameMap &subDetectorNameMap) const
#define MF_LOG_ERROR(category)
std::vector< Layer > layers
void SetDefaultSubDetectorParameters(const gar::geo::LayeredCalorimeterData &inputParameters, const std::string &subDetectorName, const pandora::SubDetectorType subDetectorType, PandoraApi::Geometry::SubDetector::Parameters ¶meters) const
float TPCRadius() const
Returns the radius of the TPC (y or z direction)
const pandora::Pandora & m_pPandora
Address of the pandora object to create the geometry.
#define MF_LOG_INFO(category)
void SetMandatorySubDetectorParameters(SubDetectorTypeMap &subDetectorTypeMap) const
std::map< pandora::SubDetectorType, PandoraApi::Geometry::SubDetector::Parameters > SubDetectorTypeMap
General GArSoft Utilities.
std::map< std::string, PandoraApi::Geometry::SubDetector::Parameters > SubDetectorNameMap
double inner_nRadiationLengths
float TPCLength() const
Returns the length of the TPC (x direction)
const geo::GeometryCore * fGeo
Geometry provider.
pandora::StatusCode CreateGeometry() const
cet::coded_exception< error, detail::translate > exception
QTextStream & endl(QTextStream &s)
std::map< gar::geo::LayeredCalorimeterData::LayoutType, std::shared_ptr< gar::geo::LayeredCalorimeterData > > GetECALLayeredCalorimeterData() const