5 #ifndef INDETTRACKINGGEOMETRY_STAGEDTRACKINGGEOMETRYBUILDERIMPL_H
6 #define INDETTRACKINGGEOMETRY_STAGEDTRACKINGGEOMETRYBUILDERIMPL_H
22 #include "GaudiKernel/ToolHandle.h"
23 #include "GaudiKernel/ServiceHandle.h"
30 #ifndef TRKDETDESCR_TAKESMALLERBIGGER
31 #define TRKDETDESCR_TAKESMALLERBIGGER
32 #define takeSmaller(current,test) current = current < test ? current : test
33 #define takeBigger(current,test) current = current > test ? current : test
34 #define takeSmallerBigger(cSmallest, cBiggest, test) takeSmaller(cSmallest, test); takeBigger(cBiggest, test)
76 const std::vector<Trk::Layer*>& negLayers,
77 const std::vector<Trk::Layer*>& cenLayers,
78 const std::vector<Trk::Layer*>& posLayers,
double minRc,
79 double maxRc,
double zC,
int binC,
bool bec =
false,
80 double minRe = 0.,
double maxRe = 0.,
double zMinE = 0.,
81 double zMaxE = 0.,
int binE = 0)
140 std::unique_ptr<Trk::TrackingGeometry> trackingGeometryImpl(
141 std::vector<InDet::LayerSetup>& layerSetups,
142 double maximumLayerExtendZ,
143 double maximumLayerRadius,
144 double envelopeVolumeHalfZ,
145 double envelopeVolumeRadius)
const;
148 void estimateLayerDimensions(
const std::vector<Trk::Layer*>&
layers,
160 const std::vector<Trk::Layer*>&
layers,
165 const std::string& volumeName,
167 bool doAdjustOuterRadius =
true)
const;
171 const std::vector<Trk::TrackingVolume*>& negVolumes,
172 const std::vector<Trk::TrackingVolume*>& centralVolumes,
173 const std::vector<Trk::TrackingVolume*>& posVolumes,
174 const std::string& baseName =
"UndefinedVolume")
const;
177 const std::string& idName,
179 const std::vector<Trk::Layer*>& negLayers,
180 const std::vector<Trk::Layer*>& centralLayers,
181 const std::vector<Trk::Layer*>& posLayers,
188 std::vector<InDet::LayerSetup>& layerSetupCache)
const;
193 (std::vector<InDet::LayerSetup>& layerSetupCache,
196 double extendZ)
const;
206 double zPosCentral)
const;
209 bool ringLayout(
const std::vector<Trk::Layer*>&
layers, std::vector<double>& rmins, std::vector<double>& rmaxs)
const;
212 void checkForInsert(std::vector<double>& radii,
double radius)
const;
213 void checkForInsert(
double rmin,
double rmax, std::vector<std::pair<double, double>>& radii)
const;
216 std::vector<Trk::Layer*> checkZoverlap(std::vector<Trk::Layer*>& lays)
const;
217 Trk::Layer* mergeDiscLayers(std::vector<Trk::Layer*>& dlays)
const;
224 PublicToolHandle<Trk::ITrackingVolumeCreator> m_trackingVolumeCreator{
225 this,
"TrackingVolumeCreator",
226 "Trk::CylinderVolumeCreator/CylinderVolumeCreator"};
227 PublicToolHandle<Trk::ILayerArrayCreator> m_layerArrayCreator{
228 this,
"LayerArrayCreator",
229 "Trk::LayerArrayCreator/LayerArrayCreator"};
232 IntegerArrayProperty m_layerBinningTypeCenter{
234 "LayerBinningTypeCenter",
236 IntegerArrayProperty m_layerBinningTypeEndcap{
238 "LayerBinningTypeEndcap",
240 IntegerArrayProperty m_colorCodesConfig{
241 this,
"ColorCodes", {}};
245 this,
"EnvelopeDefinitionSvc",
246 "AtlasEnvelopeDefSvc"};
247 DoubleArrayProperty m_enclosingCylinderRadius{
249 "VolumeEnclosureCylinderRadii",
251 DoubleArrayProperty m_enclosingDiscPositionZ{
253 "VolumeEnclosureDiscPositions",
256 DoubleProperty m_layerEnvelopeCover{
257 this,
"EnvelopeCover",
259 BooleanProperty m_buildBoundaryLayers{
this,
"BuildBoundaryLayers",
261 BooleanProperty m_replaceJointBoundaries{
262 this,
"ReplaceAllJointBoundaries",
266 BooleanProperty m_indexStaticLayers{
267 this,
"IndexStaticLayers",
271 BooleanProperty m_checkForRingLayout{
272 this,
"CheckForRingLayout",
274 DoubleProperty m_ringTolerance{
275 this,
"MinimalRadialGapForVolumeSplit",
279 StringProperty m_namespace{
this,
"VolumeNamespace",
282 StringProperty m_exitVolume{
283 this,
"ExitVolumeName",
284 "InDet::Containers::InnerDetector"};
289 BooleanProperty m_removeHGTD{
this,
"RemoveHGTD",
false};
290 FloatProperty m_zMinHGTD{
this,
"ZminHGTD", 3420.f};
296 for (
auto& checkr : radii) {
304 std::sort(radii.begin(),radii.end());
311 if (!radii.size()) radii.push_back(std::pair<double,double>(rmin,rmax));
314 while (
ir != radii.size() && rmin > radii[
ir].second )
ir++;
316 if (
ir==radii.size()) radii.push_back(std::pair<double,double>(rmin,rmax));
318 else if (rmax<radii[
ir].
first) radii.insert(radii.begin()+
ir,std::pair<double,double>(rmin,rmax));
322 if (rmin<radii[
ir].
first) radii[
ir].first=rmin;
324 unsigned int imerge =
ir;
325 while (imerge<radii.size()-1 && rmax>radii[imerge+1].first) imerge++;
326 radii[
ir].second = rmax > radii[imerge].second ? rmax : radii[imerge].second;
327 if (imerge>
ir) radii.erase(radii.begin()+
ir+1,radii.begin()+imerge);
334 #endif //INDETTRACKINGGEOMETRY_STAGEDTRACKINGGEOMETRYBUILDERIMPL_H