ATLAS Offline Software
Public Member Functions | Protected Member Functions | Private Types | Private Member Functions | Static Private Member Functions | Private Attributes | List of all members
Tile::TileVolumeBuilder Class Referencefinal

#include <TileVolumeBuilder.h>

Inheritance diagram for Tile::TileVolumeBuilder:
Collaboration diagram for Tile::TileVolumeBuilder:

Public Member Functions

 TileVolumeBuilder (const std::string &, const std::string &, const IInterface *)
 AlgTool style constructor. More...
 
virtual ~TileVolumeBuilder ()
 Destructor. More...
 
virtual StatusCode initialize () override final
 AlgTool initialize method. More...
 
virtual std::vector< Trk::TrackingVolume * > trackingVolumes (const CaloDetDescrManager &caloDDM, const GeoAlignmentStore *geoAlign) const override final
 TrackingVolumeBuilder interface method - returns vector of ptrs to volumes. More...
 
ServiceHandle< StoreGateSvc > & evtStore ()
 The standard StoreGateSvc (event store) Returns (kind of) a pointer to the StoreGateSvc. More...
 
const ServiceHandle< StoreGateSvc > & evtStore () const
 The standard StoreGateSvc (event store) Returns (kind of) a pointer to the StoreGateSvc. More...
 
const ServiceHandle< StoreGateSvc > & detStore () const
 The standard StoreGateSvc/DetectorStore Returns (kind of) a pointer to the StoreGateSvc. More...
 
virtual StatusCode sysInitialize () override
 Perform system initialization for an algorithm. More...
 
virtual StatusCode sysStart () override
 Handle START transition. More...
 
virtual std::vector< Gaudi::DataHandle * > inputHandles () const override
 Return this algorithm's input handles. More...
 
virtual std::vector< Gaudi::DataHandle * > outputHandles () const override
 Return this algorithm's output handles. More...
 
Gaudi::Details::PropertyBase & declareProperty (Gaudi::Property< T, V, H > &t)
 
Gaudi::Details::PropertyBase * declareProperty (const std::string &name, SG::VarHandleKey &hndl, const std::string &doc, const SG::VarHandleKeyType &)
 Declare a new Gaudi property. More...
 
Gaudi::Details::PropertyBase * declareProperty (const std::string &name, SG::VarHandleBase &hndl, const std::string &doc, const SG::VarHandleType &)
 Declare a new Gaudi property. More...
 
Gaudi::Details::PropertyBase * declareProperty (const std::string &name, SG::VarHandleKeyArray &hndArr, const std::string &doc, const SG::VarHandleKeyArrayType &)
 
Gaudi::Details::PropertyBase * declareProperty (const std::string &name, T &property, const std::string &doc, const SG::NotHandleType &)
 Declare a new Gaudi property. More...
 
Gaudi::Details::PropertyBase * declareProperty (const std::string &name, T &property, const std::string &doc="none")
 Declare a new Gaudi property. More...
 
void updateVHKA (Gaudi::Details::PropertyBase &)
 
MsgStream & msg () const
 
MsgStream & msg (const MSG::Level lvl) const
 
bool msgLvl (const MSG::Level lvl) const
 
 DeclareInterfaceID (ICaloTrackingVolumeBuilder, 1, 0)
 Creates the InterfaceID and interfaceID() method. More...
 

Protected Member Functions

void renounceArray (SG::VarHandleKeyArray &handlesArray)
 remove all handles from I/O resolution More...
 
std::enable_if_t< std::is_void_v< std::result_of_t< decltype(&T::renounce)(T)> > &&!std::is_base_of_v< SG::VarHandleKeyArray, T > &&std::is_base_of_v< Gaudi::DataHandle, T >, void > renounce (T &h)
 
void extraDeps_update_handler (Gaudi::Details::PropertyBase &ExtraDeps)
 Add StoreName to extra input/output deps as needed. More...
 

Private Types

typedef ServiceHandle< StoreGateSvcStoreGateSvc_t
 

Private Member Functions

void printInfo (const GeoPVConstLink &pv) const
 
void printChildren (const GeoPVConstLink &pv, int igen, const Amg::Transform3D &trIn) const
 
void throwIntoGarbage (std::unique_ptr< Trk::Material > mat) const
 
Gaudi::Details::PropertyBase & declareGaudiProperty (Gaudi::Property< T, V, H > &hndl, const SG::VarHandleKeyType &)
 specialization for handling Gaudi::Property<SG::VarHandleKey> More...
 
Gaudi::Details::PropertyBase & declareGaudiProperty (Gaudi::Property< T, V, H > &hndl, const SG::VarHandleKeyArrayType &)
 specialization for handling Gaudi::Property<SG::VarHandleKeyArray> More...
 
Gaudi::Details::PropertyBase & declareGaudiProperty (Gaudi::Property< T, V, H > &hndl, const SG::VarHandleType &)
 specialization for handling Gaudi::Property<SG::VarHandleBase> More...
 
Gaudi::Details::PropertyBase & declareGaudiProperty (Gaudi::Property< T, V, H > &t, const SG::NotHandleType &)
 specialization for handling everything that's not a Gaudi::Property<SG::VarHandleKey> or a <SG::VarHandleKeyArray> More...
 

Static Private Member Functions

static void printCheckResult (MsgStream &log, const Trk::TrackingVolume *vol)
 

Private Attributes

const TileDetDescrManagerm_tileMgr
 Calo DetDescrMgr. More...
 
std::string m_tileMgrLocation
 Location of the CaloDetDescrMgr. More...
 
ToolHandle< Trk::ITrackingVolumeCreatorm_trackingVolumeCreator
 Second helper for volume creation. More...
 
double m_tileBarrelEnvelope
 envelope Cover of the Barrel More...
 
bool m_useCaloSurfBuilder
 if true use DetDescr based layering, if false use biequidistant layering More...
 
unsigned int m_tileBarrelLayersPerSampling
 if m_useCaloSurfBuilder == true, number of layers per dead material region or sampling More...
 
ToolHandle< ICaloSurfaceBuilderm_surfBuilder
 tool required for definition of active volumes More...
 
bool m_forceSymmetry
 forces volume symmetry between negative/positive part More...
 
StoreGateSvc_t m_evtStore
 Pointer to StoreGate (event store by default) More...
 
StoreGateSvc_t m_detStore
 Pointer to StoreGate (detector store by default) More...
 
std::vector< SG::VarHandleKeyArray * > m_vhka
 
bool m_varHandleArraysDeclared
 

Detailed Description

The TileVolumeBuilder builds the TrackingVolumes for

Author
Andre.nosp@m.as.S.nosp@m.alzbu.nosp@m.rger.nosp@m.@cern.nosp@m..ch

dense volume description & layer/cell navigation

Author
sarka.nosp@m..tod.nosp@m.orova.nosp@m.@cer.nosp@m.n.ch

Definition at line 56 of file TileVolumeBuilder.h.

Member Typedef Documentation

◆ StoreGateSvc_t

typedef ServiceHandle<StoreGateSvc> AthCommonDataStore< AthCommonMsg< AlgTool > >::StoreGateSvc_t
privateinherited

Definition at line 388 of file AthCommonDataStore.h.

Constructor & Destructor Documentation

◆ TileVolumeBuilder()

Tile::TileVolumeBuilder::TileVolumeBuilder ( const std::string &  t,
const std::string &  n,
const IInterface *  p 
)

AlgTool style constructor.

Definition at line 58 of file TileVolumeBuilder.cxx.

58  :
59  AthAlgTool(t,n,p),
60  m_tileMgr(nullptr),
61  m_tileMgrLocation("Tile"),
62  m_trackingVolumeCreator("Trk::CylinderVolumeCreator/TrackingVolumeCreator"),
66  m_surfBuilder("CaloSurfaceBuilder"),
67  m_forceSymmetry(true)
68 
69 {
70  declareInterface<Trk::ICaloTrackingVolumeBuilder>(this);
71  // declare the properties via Python
72  declareProperty("TileDetManagerLocation", m_tileMgrLocation);
73  // layers and general setup
74  declareProperty("BarrelEnvelopeCover", m_tileBarrelEnvelope);
75  declareProperty("ForceVolumeSymmetry", m_forceSymmetry);
76  // helper tools
77  declareProperty("TrackingVolumeCreator", m_trackingVolumeCreator);
78  declareProperty("UseCaloSurfBuilder", m_useCaloSurfBuilder);
79  declareProperty("BarrelLayersPerSampling", m_tileBarrelLayersPerSampling);
80  declareProperty("CaloSurfaceBuilder", m_surfBuilder);
81 }

◆ ~TileVolumeBuilder()

Tile::TileVolumeBuilder::~TileVolumeBuilder ( )
virtualdefault

Destructor.

Member Function Documentation

◆ declareGaudiProperty() [1/4]

Gaudi::Details::PropertyBase& AthCommonDataStore< AthCommonMsg< AlgTool > >::declareGaudiProperty ( Gaudi::Property< T, V, H > &  hndl,
const SG::VarHandleKeyArrayType  
)
inlineprivateinherited

specialization for handling Gaudi::Property<SG::VarHandleKeyArray>

Definition at line 170 of file AthCommonDataStore.h.

172  {
173  return *AthCommonDataStore<PBASE>::declareProperty(hndl.name(),
174  hndl.value(),
175  hndl.documentation());
176 
177  }

◆ declareGaudiProperty() [2/4]

Gaudi::Details::PropertyBase& AthCommonDataStore< AthCommonMsg< AlgTool > >::declareGaudiProperty ( Gaudi::Property< T, V, H > &  hndl,
const SG::VarHandleKeyType  
)
inlineprivateinherited

specialization for handling Gaudi::Property<SG::VarHandleKey>

Definition at line 156 of file AthCommonDataStore.h.

158  {
159  return *AthCommonDataStore<PBASE>::declareProperty(hndl.name(),
160  hndl.value(),
161  hndl.documentation());
162 
163  }

◆ declareGaudiProperty() [3/4]

Gaudi::Details::PropertyBase& AthCommonDataStore< AthCommonMsg< AlgTool > >::declareGaudiProperty ( Gaudi::Property< T, V, H > &  hndl,
const SG::VarHandleType  
)
inlineprivateinherited

specialization for handling Gaudi::Property<SG::VarHandleBase>

Definition at line 184 of file AthCommonDataStore.h.

186  {
187  return *AthCommonDataStore<PBASE>::declareProperty(hndl.name(),
188  hndl.value(),
189  hndl.documentation());
190  }

◆ declareGaudiProperty() [4/4]

Gaudi::Details::PropertyBase& AthCommonDataStore< AthCommonMsg< AlgTool > >::declareGaudiProperty ( Gaudi::Property< T, V, H > &  t,
const SG::NotHandleType  
)
inlineprivateinherited

specialization for handling everything that's not a Gaudi::Property<SG::VarHandleKey> or a <SG::VarHandleKeyArray>

Definition at line 199 of file AthCommonDataStore.h.

200  {
201  return PBASE::declareProperty(t);
202  }

◆ DeclareInterfaceID()

Trk::ICaloTrackingVolumeBuilder::DeclareInterfaceID ( ICaloTrackingVolumeBuilder  ,
,
 
)
inherited

Creates the InterfaceID and interfaceID() method.

◆ declareProperty() [1/6]

Gaudi::Details::PropertyBase* AthCommonDataStore< AthCommonMsg< AlgTool > >::declareProperty ( const std::string &  name,
SG::VarHandleBase hndl,
const std::string &  doc,
const SG::VarHandleType  
)
inlineinherited

Declare a new Gaudi property.

Parameters
nameName of the property.
hndlObject holding the property value.
docDocumentation string for the property.

This is the version for types that derive from SG::VarHandleBase. The property value object is put on the input and output lists as appropriate; then we forward to the base class.

Definition at line 245 of file AthCommonDataStore.h.

249  {
250  this->declare(hndl.vhKey());
251  hndl.vhKey().setOwner(this);
252 
253  return PBASE::declareProperty(name,hndl,doc);
254  }

◆ declareProperty() [2/6]

Gaudi::Details::PropertyBase* AthCommonDataStore< AthCommonMsg< AlgTool > >::declareProperty ( const std::string &  name,
SG::VarHandleKey hndl,
const std::string &  doc,
const SG::VarHandleKeyType  
)
inlineinherited

Declare a new Gaudi property.

Parameters
nameName of the property.
hndlObject holding the property value.
docDocumentation string for the property.

This is the version for types that derive from SG::VarHandleKey. The property value object is put on the input and output lists as appropriate; then we forward to the base class.

Definition at line 221 of file AthCommonDataStore.h.

225  {
226  this->declare(hndl);
227  hndl.setOwner(this);
228 
229  return PBASE::declareProperty(name,hndl,doc);
230  }

◆ declareProperty() [3/6]

Gaudi::Details::PropertyBase* AthCommonDataStore< AthCommonMsg< AlgTool > >::declareProperty ( const std::string &  name,
SG::VarHandleKeyArray hndArr,
const std::string &  doc,
const SG::VarHandleKeyArrayType  
)
inlineinherited

Definition at line 259 of file AthCommonDataStore.h.

263  {
264 
265  // std::ostringstream ost;
266  // ost << Algorithm::name() << " VHKA declareProp: " << name
267  // << " size: " << hndArr.keys().size()
268  // << " mode: " << hndArr.mode()
269  // << " vhka size: " << m_vhka.size()
270  // << "\n";
271  // debug() << ost.str() << endmsg;
272 
273  hndArr.setOwner(this);
274  m_vhka.push_back(&hndArr);
275 
276  Gaudi::Details::PropertyBase* p = PBASE::declareProperty(name, hndArr, doc);
277  if (p != 0) {
278  p->declareUpdateHandler(&AthCommonDataStore<PBASE>::updateVHKA, this);
279  } else {
280  ATH_MSG_ERROR("unable to call declareProperty on VarHandleKeyArray "
281  << name);
282  }
283 
284  return p;
285 
286  }

◆ declareProperty() [4/6]

Gaudi::Details::PropertyBase* AthCommonDataStore< AthCommonMsg< AlgTool > >::declareProperty ( const std::string &  name,
T &  property,
const std::string &  doc,
const SG::NotHandleType  
)
inlineinherited

Declare a new Gaudi property.

Parameters
nameName of the property.
propertyObject holding the property value.
docDocumentation string for the property.

This is the generic version, for types that do not derive from SG::VarHandleKey. It just forwards to the base class version of declareProperty.

Definition at line 333 of file AthCommonDataStore.h.

337  {
338  return PBASE::declareProperty(name, property, doc);
339  }

◆ declareProperty() [5/6]

Gaudi::Details::PropertyBase* AthCommonDataStore< AthCommonMsg< AlgTool > >::declareProperty ( const std::string &  name,
T &  property,
const std::string &  doc = "none" 
)
inlineinherited

Declare a new Gaudi property.

Parameters
nameName of the property.
propertyObject holding the property value.
docDocumentation string for the property.

This dispatches to either the generic declareProperty or the one for VarHandle/Key/KeyArray.

Definition at line 352 of file AthCommonDataStore.h.

355  {
356  typedef typename SG::HandleClassifier<T>::type htype;
357  return declareProperty (name, property, doc, htype());
358  }

◆ declareProperty() [6/6]

Gaudi::Details::PropertyBase& AthCommonDataStore< AthCommonMsg< AlgTool > >::declareProperty ( Gaudi::Property< T, V, H > &  t)
inlineinherited

Definition at line 145 of file AthCommonDataStore.h.

145  {
146  typedef typename SG::HandleClassifier<T>::type htype;
148  }

◆ detStore()

const ServiceHandle<StoreGateSvc>& AthCommonDataStore< AthCommonMsg< AlgTool > >::detStore ( ) const
inlineinherited

The standard StoreGateSvc/DetectorStore Returns (kind of) a pointer to the StoreGateSvc.

Definition at line 95 of file AthCommonDataStore.h.

95 { return m_detStore; }

◆ evtStore() [1/2]

ServiceHandle<StoreGateSvc>& AthCommonDataStore< AthCommonMsg< AlgTool > >::evtStore ( )
inlineinherited

The standard StoreGateSvc (event store) Returns (kind of) a pointer to the StoreGateSvc.

Definition at line 85 of file AthCommonDataStore.h.

85 { return m_evtStore; }

◆ evtStore() [2/2]

const ServiceHandle<StoreGateSvc>& AthCommonDataStore< AthCommonMsg< AlgTool > >::evtStore ( ) const
inlineinherited

The standard StoreGateSvc (event store) Returns (kind of) a pointer to the StoreGateSvc.

Definition at line 90 of file AthCommonDataStore.h.

90 { return m_evtStore; }

◆ extraDeps_update_handler()

void AthCommonDataStore< AthCommonMsg< AlgTool > >::extraDeps_update_handler ( Gaudi::Details::PropertyBase &  ExtraDeps)
protectedinherited

Add StoreName to extra input/output deps as needed.

use the logic of the VarHandleKey to parse the DataObjID keys supplied via the ExtraInputs and ExtraOuputs Properties to add the StoreName if it's not explicitly given

◆ initialize()

StatusCode Tile::TileVolumeBuilder::initialize ( )
finaloverridevirtual

AlgTool initialize method.

Definition at line 90 of file TileVolumeBuilder.cxx.

91 {
92  // get Tile Detector Description Manager
94 
95  // Retrieve the second volume creator
97  ATH_MSG_INFO( "Retrieved tool " << m_trackingVolumeCreator );
98 
99  ATH_CHECK(m_surfBuilder.retrieve());
100  ATH_MSG_INFO( "Retrieved tool " << m_surfBuilder );
101 
102  ATH_MSG_INFO( " initialize() successful" );
103  return StatusCode::SUCCESS;
104 }

◆ inputHandles()

virtual std::vector<Gaudi::DataHandle*> AthCommonDataStore< AthCommonMsg< AlgTool > >::inputHandles ( ) const
overridevirtualinherited

Return this algorithm's input handles.

We override this to include handle instances from key arrays if they have not yet been declared. See comments on updateVHKA.

◆ msg() [1/2]

MsgStream& AthCommonMsg< AlgTool >::msg ( ) const
inlineinherited

Definition at line 24 of file AthCommonMsg.h.

24  {
25  return this->msgStream();
26  }

◆ msg() [2/2]

MsgStream& AthCommonMsg< AlgTool >::msg ( const MSG::Level  lvl) const
inlineinherited

Definition at line 27 of file AthCommonMsg.h.

27  {
28  return this->msgStream(lvl);
29  }

◆ msgLvl()

bool AthCommonMsg< AlgTool >::msgLvl ( const MSG::Level  lvl) const
inlineinherited

Definition at line 30 of file AthCommonMsg.h.

30  {
31  return this->msgLevel(lvl);
32  }

◆ outputHandles()

virtual std::vector<Gaudi::DataHandle*> AthCommonDataStore< AthCommonMsg< AlgTool > >::outputHandles ( ) const
overridevirtualinherited

Return this algorithm's output handles.

We override this to include handle instances from key arrays if they have not yet been declared. See comments on updateVHKA.

◆ printCheckResult()

void Tile::TileVolumeBuilder::printCheckResult ( MsgStream &  log,
const Trk::TrackingVolume vol 
)
staticprivate

Definition at line 737 of file TileVolumeBuilder.cxx.

738 {
739  if (vol) log << "... ok" << endmsg;
740  else log << "... missing" << endmsg;
741 }

◆ printChildren()

void Tile::TileVolumeBuilder::printChildren ( const GeoPVConstLink &  pv,
int  igen,
const Amg::Transform3D trIn 
) const
private

Definition at line 754 of file TileVolumeBuilder.cxx.

755  {
756  // subcomponents
757  unsigned int nc = pv->getNChildVols();
758  igen++;
759  std::string cname;
760  for (unsigned int ic = 0; ic < nc; ic++) {
761  Amg::Transform3D transf = trIn * pv->getXToChildVol(ic);
762 
763  const PVConstLink cv = pv->getChildVol(ic);
764  const GeoLogVol* clv = cv->getLogVol();
765  std::cout << " ";
766  std::cout << "subcomponent:" << igen << ":" << ic << ":" << clv->getName()
767  << ", made of" << clv->getMaterial()->getName() << ","
768  << clv->getShape()->type() << std::endl;
769  std::cout << "position:" << "R:" << transf.translation().perp()
770  << ",phi:" << transf.translation().phi()
771  << ",x:" << transf.translation().x()
772  << ",y:" << transf.translation().y()
773  << ",z:" << transf.translation().z() << std::endl;
774  const GeoTrd* trd = dynamic_cast<const GeoTrd*>(clv->getShape());
775  if (trd)
776  std::cout << "trddim:" << trd->getXHalfLength1() << ","
777  << trd->getXHalfLength2() << "," << trd->getYHalfLength1()
778  << "," << trd->getYHalfLength2() << "," << trd->getZHalfLength()
779  << std::endl;
780  const GeoTubs* tub = dynamic_cast<const GeoTubs*>(clv->getShape());
781  if (tub)
782  std::cout << "tubdim:" << tub->getRMin() << "," << tub->getRMax() << ","
783  << tub->getZHalfLength() << std::endl;
784  const GeoPcon* con = dynamic_cast<const GeoPcon*>(clv->getShape());
785  if (con) {
786  const unsigned int nPlanes = con->getNPlanes();
787  for (unsigned int i = 0; i < nPlanes; i++) {
788  std::cout << "polycone:" << i << ":" << con->getRMinPlane(i) << ","
789  << con->getRMaxPlane(i) << "," << con->getZPlane(i)
790  << std::endl;
791  }
792  }
793 
794  if (ic == 0 || cname != clv->getName()) {
795  // m_geoShapeConverter->decodeShape(clv->getShape());
796  printChildren(cv, igen, transf);
797  cname = clv->getName();
798  }
799  }
800 }

◆ printInfo()

void Tile::TileVolumeBuilder::printInfo ( const GeoPVConstLink &  pv) const
private

Definition at line 743 of file TileVolumeBuilder.cxx.

743  {
744  const GeoLogVol* lv = pv->getLogVol();
745  std::cout << "New Tile Object:" << lv->getName() << ", made of"
746  << lv->getMaterial()->getName() << "," << lv->getShape()->type()
747  << std::endl;
748  // m_geoShapeConverter->decodeShape(lv->getShape());
749  int igen = 0;
750  Amg::Transform3D transf = pv->getX();
751  printChildren(pv, igen, transf);
752 }

◆ renounce()

std::enable_if_t<std::is_void_v<std::result_of_t<decltype(&T::renounce)(T)> > && !std::is_base_of_v<SG::VarHandleKeyArray, T> && std::is_base_of_v<Gaudi::DataHandle, T>, void> AthCommonDataStore< AthCommonMsg< AlgTool > >::renounce ( T &  h)
inlineprotectedinherited

Definition at line 380 of file AthCommonDataStore.h.

381  {
382  h.renounce();
383  PBASE::renounce (h);
384  }

◆ renounceArray()

void AthCommonDataStore< AthCommonMsg< AlgTool > >::renounceArray ( SG::VarHandleKeyArray handlesArray)
inlineprotectedinherited

remove all handles from I/O resolution

Definition at line 364 of file AthCommonDataStore.h.

364  {
365  handlesArray.renounce();
366  }

◆ sysInitialize()

virtual StatusCode AthCommonDataStore< AthCommonMsg< AlgTool > >::sysInitialize ( )
overridevirtualinherited

Perform system initialization for an algorithm.

We override this to declare all the elements of handle key arrays at the end of initialization. See comments on updateVHKA.

Reimplemented in DerivationFramework::CfAthAlgTool, AthCheckedComponent< AthAlgTool >, AthCheckedComponent<::AthAlgTool >, and asg::AsgMetadataTool.

◆ sysStart()

virtual StatusCode AthCommonDataStore< AthCommonMsg< AlgTool > >::sysStart ( )
overridevirtualinherited

Handle START transition.

We override this in order to make sure that conditions handle keys can cache a pointer to the conditions container.

◆ throwIntoGarbage()

void Tile::TileVolumeBuilder::throwIntoGarbage ( std::unique_ptr< Trk::Material mat) const
private

◆ trackingVolumes()

std::vector< Trk::TrackingVolume * > Tile::TileVolumeBuilder::trackingVolumes ( const CaloDetDescrManager caloDDM,
const GeoAlignmentStore geoAlign 
) const
finaloverridevirtual

TrackingVolumeBuilder interface method - returns vector of ptrs to volumes.

The caller assumes ownership of the pointers

Implements Trk::ICaloTrackingVolumeBuilder.

Definition at line 106 of file TileVolumeBuilder.cxx.

108  {
109  // the return vector
110  auto tileTrackingVolumes = std::vector<Trk::TrackingVolume*>();
111  // the converter helpers
112  //Trk::GeoShapeConverter geoShapeToVolumeBounds;
113  //Trk::GeoMaterialConverter geoMaterialToMaterialProperties;
114  // dummy material
115  Trk::Material tileMaterial;
116 
117  // dimensions
118  double tileZ = 0.;
119  double gapZ = 0.;
120  // ITC hardcoded : simple shortcut (needs resizing anyway )
121  double plug1Z = 3405.;
122  double plug2Z = 3512.075;
123  double plug1R = 3440.;
124  double plug2R = 2959.;
125  double plug1hZ = 154.5;
126  double plug2hZ = 47.425;
127 
128  // The Volumes To be Created ( by parsing geoModel ) ===========
129  Trk::TrackingVolume* tileBarrel = nullptr;
130  Trk::TrackingVolume* tileGirder = nullptr;
131 
132  Trk::TrackingVolume* tilePositiveExtendedBarrel = nullptr;
133  Trk::TrackingVolume* tileNegativeExtendedBarrel = nullptr;
134 
135  // The Volumes To be Created ( Gap Volumes ) ====================
136  Trk::TrackingVolume* tileBarrelPositiveFingerGap = nullptr;
137  Trk::TrackingVolume* tileBarrelNegativeFingerGap = nullptr;
138  Trk::TrackingVolume* tilePositiveFingerGap = nullptr;
139  Trk::TrackingVolume* tileNegativeFingerGap = nullptr;
140 
141  // The Bounds To be Assigned (for resizing) ====================
142  std::shared_ptr<Trk::CylinderVolumeBounds> tileBarrelBounds;
143  std::unique_ptr<Trk::CylinderVolumeBounds> tileBarrelGirderBounds;
144 
145  Trk::CylinderVolumeBounds tilePositiveExtendedBarrelBounds;
146  std::shared_ptr<Trk::CylinderVolumeBounds> itcPlug1Bounds;
147  std::shared_ptr<Trk::CylinderVolumeBounds> itcPlug2Bounds;
148  std::shared_ptr<Trk::CylinderVolumeBounds> gapBounds;
149 
150  std::vector<std::pair<const Trk::Surface*, const Trk::Surface*>> entrySurf =
151  m_surfBuilder->entrySurfaces(&caloDDM);
152  std::vector<std::pair<const Trk::Surface*, const Trk::Surface*>> exitSurf =
153  m_surfBuilder->exitSurfaces(&caloDDM);
154 
155  // averaged material properties
156  auto barrelProperties = std::make_shared<Trk::Material>(22.7, 212., 45.8, 21.4, 0.0062);
157  auto extendedBarrelProperties = std::make_shared<Trk::Material>(22.7, 210., 45.8, 21.4, 0.0062);
158  // material properties with layer encoding - to be defined later
159  Trk::BinnedMaterial barrelMaterialBinned{};
160  Trk::BinnedMaterial extendedMaterialBinned{};
161 
162  Trk::Material girderProperties = Trk::Material(28.6, 272.5, 40.4, 19., 0.0049);
163  Trk::Material extendedGirderProperties = Trk::Material(27.9, 266.4, 41., 19.2, 0.005);
164  Trk::Material fingerProperties = Trk::Material(46., 426.6, 34.2, 16.2, 0.0032);
165 
166  unsigned int numTreeTops = m_tileMgr->getNumTreeTops();
167  ATH_MSG_DEBUG( "Retrieved " << numTreeTops << " tree tops from the TileDetDescrManager. " );
168 
169  // layer material can be adjusted here
170  std::vector<Trk::IdentifiedMaterial> matTB;
171  int baseID = Trk::GeometrySignature(Trk::Calo)*1000 + 12;
172  matTB.emplace_back(barrelProperties,0);
173  matTB.emplace_back(barrelProperties,baseID);
174  matTB.emplace_back(barrelProperties,baseID+1);
175  matTB.emplace_back(barrelProperties,baseID+2);
176 
177  // material index
178  std::vector<size_t> ltb{0,1,2,3};
179 
180  // layer material can be adjusted here
181  std::vector<Trk::IdentifiedMaterial> matETB;
182  baseID = Trk::GeometrySignature(Trk::Calo)*1000 + 18;
183  matETB.emplace_back(extendedBarrelProperties,0);
184  matETB.emplace_back(extendedBarrelProperties,baseID);
185  matETB.emplace_back(extendedBarrelProperties,baseID+1);
186  matETB.emplace_back(extendedBarrelProperties,baseID+2);
187 
188  // layer material can be adjusted here
189  //Trk::MaterialProperties barrelFingerGapProperties = Trk::MaterialProperties(1., 130./0.35, 0.003*pow(0.35,3),30.);
190  Trk::Material barrelFingerGapProperties(353., 2254., 20.7, 10., 0.00057);
191 
192  //Trk::MaterialProperties fingerGapProperties = Trk::MaterialProperties(1., 88./0.1, 0.003*pow(0.1,3),30.);
193  Trk::Material fingerGapProperties(552., 3925., 16.4, 8.1, 0.00034);
194 
195  for (unsigned int itreetop = 0; itreetop<numTreeTops; ++itreetop){
196  PVConstLink currentVPhysVolLink = m_tileMgr->getTreeTop(itreetop);
197 
198  // const GeoVPhysVol* top = &(*(m_tileMgr->getTreeTop(itreetop)));
199  //GeoVolumeCursor vol (top);
200  //while (!vol.atEnd()) {
201  // const GeoVPhysVol* cv = &(*(vol.getVolume()));
202  // printInfo(cv);
203  //}
204 
205  const GeoLogVol* currentLogVol = currentVPhysVolLink->getLogVol();
206 
207  unsigned int currentChilds = currentVPhysVolLink->getNChildVols();
208 
209  ATH_MSG_DEBUG( "Processing " << currentLogVol->getName() << "... has "
210  << currentChilds << " childs." );
211  const GeoShape* currentShape = currentLogVol->getShape();
212  ATH_MSG_VERBOSE( " -> the shape is " << currentShape->type() );
213  std::vector<double> zboundaries;
214 
215  ATH_MSG_DEBUG( "Start looping over childs. " );
216  // the loop over the childs
217  for (unsigned int ichild = 0; ichild < currentChilds; ++ichild){
218 
219  PVConstLink currentChildLink = currentVPhysVolLink->getChildVol(ichild);
220  //printInfo(currentChildLink);
221  const GeoLogVol* childLogVol = currentChildLink->getLogVol();
222  const GeoShape* childShape = childLogVol->getShape();
223  ATH_MSG_VERBOSE( " Child: " << childLogVol->getName() << " has shape " << childShape->type() );
224 
225  const GeoTubs* currentTubs = dynamic_cast<const GeoTubs*>(childShape);
226  std::shared_ptr<Trk::CylinderVolumeBounds> childCylVolBounds = currentTubs ? Trk::GeoShapeConverter::convert(currentTubs) : nullptr;
227  // get the transform
228  GeoTrf::Transform3D childTransform = currentVPhysVolLink->getXToChildVol(ichild);
229  double childZposition = childTransform.translation().z();
230 
231  if (childCylVolBounds){
232  // screen output
233  ATH_MSG_VERBOSE( " ---> CylinderVolumeBounds created as: " );
234  ATH_MSG_VERBOSE( " ---> Position in z: " << childTransform.translation().z() );
235  ATH_MSG_VERBOSE( *childCylVolBounds );
236 
237  // retrieve split radius from the TileBar2 exit surface
238  double depth = exitSurf[CaloCell_ID::TileBar2].first->bounds().r();
239 
240  switch (itreetop){
241 
242  case 0 : { // Tile Barrel case ==================================================================
243 
244  // the centered one is the TileBarrel
245  if ( fabs(childZposition)< 100.*mm ){
246  //depth is where we split childCylVolBounds
247  tileBarrelBounds = std::make_shared<Trk::CylinderVolumeBounds>(childCylVolBounds->innerRadius(),depth,childCylVolBounds->halflengthZ());
248 
249  // assign Bounds
250  tileBarrelGirderBounds = make_unique<Trk::CylinderVolumeBounds>(depth,childCylVolBounds->outerRadius(),childCylVolBounds->halflengthZ());
251 
252  // construct bin utilities
253  std::vector<float> steps;
254  steps.push_back(childCylVolBounds->innerRadius());
255  steps.push_back(entrySurf[CaloCell_ID::TileBar0].first->bounds().r());
256  steps.push_back(entrySurf[CaloCell_ID::TileBar1].first->bounds().r());
257  steps.push_back(entrySurf[CaloCell_ID::TileBar2].first->bounds().r());
258  steps.push_back(depth);
260 
261  barrelMaterialBinned = Trk::BinnedMaterial(*barrelProperties,rBU,ltb,matTB);
262 
263  tileBarrel = new Trk::AlignableTrackingVolume(
264  nullptr, tileBarrelBounds, barrelMaterialBinned, 12,
265  "Calo::Detectors::Tile::Barrel");
266  }
267  } break;
268 
269  default : { // Tile Extended Barrel ==================================================================
270 
271  std::string volumeName;
272  std::string girderName;
273  std::vector<double> girderLayerRadius;
274  std::vector<double> layerRadius;
275  std::vector<double> layerEnvelope;
276  std::shared_ptr<Trk::CylinderVolumeBounds> tileExtendedBounds = nullptr;
277  std::unique_ptr<Trk::CylinderVolumeBounds> gapVolBounds;
278 
279  // prepare for the Extended Barrel
280  if (childCylVolBounds->halflengthZ() > 1000.){
281  volumeName = childZposition > 0. ?
282  "Calo::Detectors::Tile::PositiveExtendedBarrel" : "Calo::Detectors::Tile::NegativeExtendedBarrel";
283 
284  //depth is where we split childCylVolBounds
285  tileExtendedBounds = std::make_shared<Trk::CylinderVolumeBounds>(childCylVolBounds->innerRadius(),depth,childCylVolBounds->halflengthZ());
286 
287  } else if (childCylVolBounds->halflengthZ() > 100.){
288  // prepare for the EBarrel Finger : (ST) : merge with combined girder
289  //tileFingerBounds = new Trk::CylinderVolumeBounds(depth,childCylVolBounds->outerRadius(),childCylVolBounds->halflengthZ());
290 
291  } else if ( childLogVol->getName()=="Gap" && !gapBounds ) {
292 
293  gapVolBounds = make_unique<Trk::CylinderVolumeBounds>(childCylVolBounds->innerRadius(),childCylVolBounds->outerRadius(),
294  childCylVolBounds->halflengthZ());
295 
296  gapZ = fabs(childZposition);
297 
298  } else {
299  ATH_MSG_VERBOSE( " ---> This Volume is not gonna built !" );
300  break;
301  }
302 
303  // only account for misalignment along z
304  Amg::Vector3D childPosition(0.,0.,childZposition);
305  Trk::TrackingVolume* tileExtendedTrackingVolume = nullptr;
306 
307  if(m_useCaloSurfBuilder && childCylVolBounds->halflengthZ() > 1000.){
308 
309  // get some output
310  ATH_MSG_VERBOSE ( "[C1] Creating TrackingVolume '" << volumeName );
311 
312  // construct bin utilities
313  std::vector<float> steps;
314  steps.push_back(tileExtendedBounds->innerRadius());
315  steps.push_back(entrySurf[CaloCell_ID::TileExt0].first->bounds().r());
316  steps.push_back(entrySurf[CaloCell_ID::TileExt1].first->bounds().r());
317  steps.push_back(entrySurf[CaloCell_ID::TileExt2].first->bounds().r());
318  steps.push_back(tileExtendedBounds->outerRadius());
320 
321  extendedMaterialBinned = Trk::BinnedMaterial(*extendedBarrelProperties,eBU,ltb,matETB);
322 
323  tileExtendedTrackingVolume = new Trk::AlignableTrackingVolume(
324  std::make_unique<Amg::Transform3D>(Amg::Translation3D(childPosition)),
325  tileExtendedBounds,
326  extendedMaterialBinned, 18, volumeName);
327 
328  } else {
329  if ( gapVolBounds ) {
330  gapBounds = std::move(gapVolBounds);
331 
332  } else if (tileExtendedBounds) {
333 
334  // construct bin utilities
335  std::vector<float> steps;
336  steps.push_back(tileExtendedBounds->innerRadius());
337  steps.push_back(entrySurf[CaloCell_ID::TileExt0].first->bounds().r());
338  steps.push_back(entrySurf[CaloCell_ID::TileExt1].first->bounds().r());
339  steps.push_back(entrySurf[CaloCell_ID::TileExt2].first->bounds().r());
340  steps.push_back(tileExtendedBounds->outerRadius());
342 
343  extendedMaterialBinned = Trk::BinnedMaterial(*extendedBarrelProperties.get(),eBU,ltb,matETB);
344 
345  tileExtendedTrackingVolume = new Trk::AlignableTrackingVolume(
346  std::make_unique<Amg::Transform3D>(Amg::Translation3D(childPosition)),
347  tileExtendedBounds,
348  extendedMaterialBinned,
349  18,
350  volumeName);
351  }
352  }
353  // and assign it to the right one
354  if (childCylVolBounds->halflengthZ() > 1000.){
355  if (childZposition > 0.) {
356  tilePositiveExtendedBarrel = tileExtendedTrackingVolume;
357  tilePositiveExtendedBarrelBounds = *tileExtendedBounds;
358  } else {
359  tileNegativeExtendedBarrel = tileExtendedTrackingVolume;
360  }
361  } else if (childCylVolBounds->halflengthZ() > 100.) {
362  tileZ = fabs(childZposition)+childCylVolBounds->halflengthZ();
363  }
364  } break;
365  } // end of switch
366  } // end of ? cylVolBounds
367  } //end of ichild loop
368  } // end of treetop loop
369 
370  if (!gapBounds) std::abort();
371  if (!tileBarrelGirderBounds) std::abort();
372  if (!tilePositiveExtendedBarrel) std::abort();
373  if (!tileNegativeExtendedBarrel) std::abort();
374 
375  ATH_MSG_DEBUG( "TileDetDescrManager parsed successfully! " );
376 
377  // combined girder volume
378  {
379  auto tileGirderBounds = std::make_shared<Trk::CylinderVolumeBounds>
380  (tileBarrelGirderBounds->innerRadius(),
381  tileBarrelGirderBounds->outerRadius(),
382  tileZ);
383 
384  tileGirder = new Trk::TrackingVolume(nullptr,
385  std::move(tileGirderBounds),
386  girderProperties,
387  nullptr, nullptr,
388  "Calo::Girder::TileCombined");
389  }
390 
391  // build the gap volumes ( crack done by CaloTG )
392  double tileExtZ = tilePositiveExtendedBarrel->center().z()-tilePositiveExtendedBarrelBounds.halflengthZ();
393 
394  // binned material for ITC :
395  std::vector<Trk::IdentifiedMaterial> matITC;
396  // layer material can be adjusted here
397  baseID = Trk::GeometrySignature(Trk::Calo)*1000;
398  matITC.emplace_back(barrelProperties,baseID+15);
399  matITC.emplace_back(barrelProperties,baseID+16);
400  matITC.emplace_back(barrelProperties,baseID+17);
401 
402  // ITCPlug1
403  double p1Z = 0.5*(plug1Z-plug1hZ+tileExtZ);
404  double hp1Z = 0.5*(tileExtZ-plug1Z+plug1hZ);
405  itcPlug1Bounds = std::make_shared<Trk::CylinderVolumeBounds>(
406  plug1R,
407  tileBarrelBounds->outerRadius(),
408  hp1Z);
409 
410  Amg::Vector3D itcP1Pos(0.,0.,p1Z);
411  Amg::Vector3D itcP1Neg(0.,0.,-p1Z);
412  auto itcP1PosTransform = std::make_unique<Amg::Transform3D>(Amg::Translation3D(itcP1Pos));
413  auto itcP1NegTransform = std::make_unique<Amg::Transform3D>(Amg::Translation3D(itcP1Neg));
414 
415 
416  std::vector<size_t> dummylay(1,1);
417  std::vector<float> bpsteps{float(plug1R), float(tileBarrelBounds->outerRadius())};
418  auto rBU = Trk::BinUtility(bpsteps, Trk::open, Trk::binR);
419  const Trk::BinUtility& rBUc(rBU);
420  const Trk::BinnedMaterial plug1MatPos(*barrelProperties,rBU,dummylay,matITC);
421  const Trk::BinnedMaterial plug1MatNeg(*barrelProperties,rBUc,dummylay,matITC);
422 
424  std::move(itcP1PosTransform),
425  itcPlug1Bounds,
426  plug1MatPos,
427  16,
428  "Calo::Detectors::Tile::ITCPlug1Pos");
429 
431  std::move(itcP1NegTransform),
432  std::shared_ptr<Trk::CylinderVolumeBounds>(itcPlug1Bounds->clone()),
433  plug1MatNeg, 16, "Calo::Detectors::Tile::ITCPlug1Neg");
434 
435  // ITCPlug2
436  double p2Z = 0.5*(plug2Z-plug2hZ+tileExtZ);
437  double hp2Z = 0.5*(tileExtZ-plug2Z+plug2hZ);
438  itcPlug2Bounds =
439  std::make_shared<Trk::CylinderVolumeBounds>(plug2R, plug1R, hp2Z);
440 
441  Amg::Vector3D itcP2Pos(0.,0.,p2Z);
442  Amg::Vector3D itcP2Neg(0.,0.,-p2Z);
443  auto itcP2PosTransform = std::make_unique<Amg::Transform3D>(Amg::Translation3D(itcP2Pos));
444  auto itcP2NegTransform = std::make_unique<Amg::Transform3D>(Amg::Translation3D(itcP2Neg));
445 
446  std::vector<size_t> p2lay(1,0);
447  std::vector<float> p2steps{float(plug2R), float(plug1R)};
448  auto p2BU = Trk::BinUtility(p2steps, Trk::open, Trk::binR);
449  const Trk::BinUtility& p2BUc(p2BU);
450  const Trk::BinnedMaterial plug2MatPos(*barrelProperties,p2BU,p2lay,matITC);
451  const Trk::BinnedMaterial plug2MatNeg(*barrelProperties,p2BUc,p2lay,matITC);
452 
454  std::move(itcP2PosTransform),
455  itcPlug2Bounds,
456  plug2MatPos,
457  15,
458  "Calo::Detectors::Tile::ITCPlug2Pos");
459 
461  std::move(itcP2NegTransform),
462  std::shared_ptr<Trk::CylinderVolumeBounds> (itcPlug2Bounds->clone()),
463  plug2MatNeg, 15,
464  "Calo::Detectors::Tile::ITCPlug2Neg");
465 
466  //std::cout <<"ITC Plug2 ok:"<< std::endl;
467 
468  // Gap
469  float gapi = 0.5*(gapZ-gapBounds->halflengthZ()+tileExtZ);
470  double hgZ = 0.5*(tileExtZ-gapZ+gapBounds->halflengthZ());
471  gapBounds = std::make_shared<Trk::CylinderVolumeBounds>(
472  tileBarrelBounds->innerRadius(), plug2R, hgZ);
473 
474  Amg::Vector3D gPos(0.,0.,gapi);
475  Amg::Vector3D gNeg(0.,0.,-gapi);
476  auto gapPosTransform = std::make_unique<Amg::Transform3D>(Amg::Translation3D(gPos));
477  auto gapNegTransform = std::make_unique<Amg::Transform3D>(Amg::Translation3D(gNeg));
478 
479  std::vector<size_t> glay(1,2);
480  std::vector<float> gsteps{float(gapi-gapBounds->halflengthZ()), float(gapi+gapBounds->halflengthZ())};
481  auto gp = Trk::BinUtility(gsteps, Trk::open, Trk::binZ);
482  const Trk::BinnedMaterial gpMat(*barrelProperties,gp,glay,matITC);
483 
486  std::move(gapPosTransform),
487  gapBounds, gpMat,
488  17, "Calo::Detectors::Tile::GapPos");
489 
490  std::vector<float> nsteps{float(-gapi-gapBounds->halflengthZ()), float(-gapi+gapBounds->halflengthZ())};
491  auto gn = Trk::BinUtility(nsteps, Trk::open, Trk::binZ);
492  const Trk::BinnedMaterial gnMat(*barrelProperties,gn,glay,matITC);
493 
495  std::move(gapNegTransform),
496  std::shared_ptr<Trk::CylinderVolumeBounds>(gapBounds->clone()),
497  gnMat, 15,
498  "Calo::Detectors::Tile::GapNeg");
499 
500  // add buffer volumes and glue together gap sections
501  float p1i = itcPlug1Pos->center().z()-itcPlug1Bounds->halflengthZ();
502  float p2i = itcPlug2Pos->center().z()-itcPlug2Bounds->halflengthZ();
503  float gi = gapPos->center().z()-gapBounds->halflengthZ();
504  float zgBuff = 0.5*(p1i+gi);
505  float hgBuff = 0.5*(gi-p1i);
506  Amg::Vector3D gBuffPos(0.,0.,zgBuff);
507  Amg::Vector3D gBuffNeg(0.,0.,-zgBuff);
508  auto gBuffPosTransform = std::make_unique<Amg::Transform3D>(Amg::Translation3D(gBuffPos));
509  auto gBuffNegTransform = std::make_unique<Amg::Transform3D>(Amg::Translation3D(gBuffNeg));
510 
511  auto gapBuffBounds = std::make_shared<Trk::CylinderVolumeBounds>(
512  gapBounds->innerRadius(),
513  gapBounds->outerRadius(),
514  hgBuff);
515 
516  Trk::TrackingVolume* gBufferPos = new Trk::TrackingVolume(
517  std::move(gBuffPosTransform), gapBuffBounds, fingerProperties,
518  nullptr, nullptr, "Calo::GapVolumes::Tile::GapBufferPos");
519 
520  Trk::TrackingVolume* gBufferNeg = new Trk::TrackingVolume(
521  std::move(gBuffNegTransform),
522  std::shared_ptr<Trk::CylinderVolumeBounds>(gapBuffBounds->clone()),
523  fingerProperties, nullptr, nullptr,
524  "Calo::GapVolumes::Tile::GapBufferNeg");
525 
526  Trk::TrackingVolume* positiveGapSector = nullptr;
527  if (gBufferPos) {
528  std::vector<Trk::TrackingVolume*> volsPosGap;
529  volsPosGap.push_back(gBufferPos);
530  volsPosGap.push_back(gapPos);
531  positiveGapSector = m_trackingVolumeCreator->createContainerTrackingVolume
532  (volsPosGap,
533  tileMaterial,
534  "Calo::Container::PositiveGap");
535  }
536  Trk::TrackingVolume* negativeGapSector = nullptr;
537  if (gBufferNeg) {
538  std::vector<Trk::TrackingVolume*> volsNegGap;
539  volsNegGap.push_back(gapNeg);
540  volsNegGap.push_back(gBufferNeg);
541  negativeGapSector = m_trackingVolumeCreator->createContainerTrackingVolume
542  (volsNegGap,
543  tileMaterial,
544  "Calo::Container::NegativeGap");
545  }
546 
547  // plug2 sector
548  float z2Buff = 0.5*(p1i+p2i);
549  float h2Buff = 0.5*(p2i-p1i);
550  Amg::Vector3D p2BuffPos(0.,0.,z2Buff);
551  Amg::Vector3D p2BuffNeg(0.,0.,-z2Buff);
552  auto p2BuffPosTransform = std::make_unique<Amg::Transform3D>(Amg::Translation3D(p2BuffPos));
553  auto p2BuffNegTransform = std::make_unique<Amg::Transform3D>(Amg::Translation3D(p2BuffNeg));
554 
555  auto p2BuffBounds = std::make_shared<Trk::CylinderVolumeBounds>(
556  itcPlug2Bounds->innerRadius(), itcPlug2Bounds->outerRadius(), h2Buff);
557 
558  Trk::TrackingVolume* p2BufferPos = new Trk::TrackingVolume(
559  std::move(p2BuffPosTransform), p2BuffBounds, fingerProperties, nullptr,
560  nullptr, "Calo::GapVolumes::Tile::Plug2BufferPos");
561 
562  Trk::TrackingVolume* p2BufferNeg = new Trk::TrackingVolume(
563  std::move(p2BuffNegTransform),
564  std::shared_ptr<Trk::CylinderVolumeBounds>(p2BuffBounds->clone()),
565  fingerProperties, nullptr,
566  nullptr, "Calo::GapVolumes::Tile::Plug2BufferNeg");
567 
568  Trk::TrackingVolume* positiveP2Sector = nullptr;
569  if (p2BufferPos) {
570  std::vector<Trk::TrackingVolume*> volsPosP2;
571  volsPosP2.push_back(p2BufferPos);
572  volsPosP2.push_back(itcPlug2Pos);
573  positiveP2Sector = m_trackingVolumeCreator->createContainerTrackingVolume
574  (volsPosP2,
575  tileMaterial,
576  "Calo::Container::PositiveP2");
577  }
578  Trk::TrackingVolume* negativeP2Sector = nullptr;
579  if (itcPlug2Neg) {
580  std::vector<Trk::TrackingVolume*> volsNegP2;
581  volsNegP2.push_back(itcPlug2Neg);
582  volsNegP2.push_back(p2BufferNeg);
583  negativeP2Sector = m_trackingVolumeCreator->createContainerTrackingVolume
584  (volsNegP2,
585  tileMaterial,
586  "Calo::Container::NegativeP2");
587  }
588 
589  // glue ITC sector radially
590  Trk::TrackingVolume* positiveITCSector = nullptr;
591  if (positiveGapSector && positiveP2Sector) {
592  std::vector<Trk::TrackingVolume*> volsITCPos;
593  volsITCPos.push_back(positiveGapSector);
594  volsITCPos.push_back(positiveP2Sector);
595  volsITCPos.push_back(itcPlug1Pos);
596  positiveITCSector = m_trackingVolumeCreator->createContainerTrackingVolume
597  (volsITCPos,
598  tileMaterial,
599  "Calo::Container::ITCPos");
600  }
601  Trk::TrackingVolume* negativeITCSector = nullptr;
602  if (negativeGapSector && negativeP2Sector) {
603  std::vector<Trk::TrackingVolume*> volsITCNeg;
604  volsITCNeg.push_back(negativeGapSector);
605  volsITCNeg.push_back(negativeP2Sector);
606  volsITCNeg.push_back(itcPlug1Neg);
607  negativeITCSector = m_trackingVolumeCreator->createContainerTrackingVolume
608  (volsITCNeg,
609  tileMaterial,
610  "Calo::Container::ITCNeg");
611  }
612 
613  ATH_MSG_DEBUG( "Gap volumes (ITC sector) built " );
614 
615  // ------------------------------ BARREL SECTION COMPLETION --------------------------------------------------
616 
617  // the Finger Gap Volumes to be constructed
618  double rMin = tileBarrelBounds->innerRadius();
619  double rMax = tileBarrelBounds->outerRadius();
620 
621  double zFG = 0.5*(tileBarrelBounds->halflengthZ()+p1i);
622  double hZ = 0.5*(p1i-tileBarrelBounds->halflengthZ());
623  auto tileBarrelFingerGapBounds = std::make_shared<Trk::CylinderVolumeBounds>(rMin,rMax,hZ);
624 
625  Amg::Vector3D pBFPos(0.,0.,zFG);
626  Amg::Vector3D pBFNeg(0.,0.,-zFG);
627  auto bfPosTransform = std::make_unique<Amg::Transform3D>(Amg::Translation3D(pBFPos));
628  auto bfNegTransform = std::make_unique<Amg::Transform3D>(Amg::Translation3D(pBFNeg));
629 
630  tileBarrelPositiveFingerGap = new Trk::TrackingVolume(
631  std::move(bfPosTransform), tileBarrelFingerGapBounds, barrelFingerGapProperties,
632  nullptr, nullptr,
633  "Calo::GapVolumes::Tile::BarrelPositiveFingerGap");
634 
635  tileBarrelNegativeFingerGap = new Trk::TrackingVolume(
636  std::move(bfNegTransform),
637  std::shared_ptr<Trk::CylinderVolumeBounds>(
638  tileBarrelFingerGapBounds->clone()),
639  barrelFingerGapProperties, nullptr, nullptr,
640  "Calo::GapVolumes::Tile::BarrelNegativeFingerGap");
641 
642  // ------------------------------ ENDCAP SECTION COMPLETION --------------------------------------------------
643 
644  double zBE = tilePositiveExtendedBarrel->center().z()+tilePositiveExtendedBarrelBounds.halflengthZ();
645  zFG = 0.5*(tileZ + zBE);
646  hZ = 0.5*(tileZ - zBE);
647 
648  auto tilePositiveFingerGapBounds = std::make_shared<Trk::CylinderVolumeBounds>(
649  tilePositiveExtendedBarrelBounds.innerRadius(),
650  tilePositiveExtendedBarrelBounds.outerRadius(),
651  hZ);
652 
653  Amg::Vector3D pEFPos(0.,0.,zFG);
654  Amg::Vector3D pEFNeg(0.,0.,-zFG);
655  auto efPosTransform = std::make_unique<Amg::Transform3D>(Amg::Translation3D(pEFPos));
656  auto efNegTransform = std::make_unique<Amg::Transform3D>(Amg::Translation3D(pEFNeg));
657 
658  tilePositiveFingerGap = new Trk::TrackingVolume(
659  std::move(efPosTransform), tilePositiveFingerGapBounds, fingerGapProperties,
660  nullptr, nullptr, "Calo::GapVolumes::Tile::PositiveFingerGap");
661 
662  tileNegativeFingerGap = new Trk::TrackingVolume(
663  std::move(efNegTransform),
664  std::shared_ptr<Trk::CylinderVolumeBounds>(tilePositiveFingerGapBounds->clone()),
665  fingerGapProperties, nullptr, nullptr, "Calo::GapVolumes::Tile::NegativeFingerGap");
666 
667  // set the color code for displaying
668  tileBarrel->registerColorCode( 4 );
669  tilePositiveExtendedBarrel->registerColorCode( 4 );
670  tileNegativeExtendedBarrel->registerColorCode( 4 );
671 
672  gapPos->registerColorCode( 4 );
673  gapNeg->registerColorCode( 4 );
674  itcPlug1Pos->registerColorCode( 4 );
675  itcPlug1Neg->registerColorCode( 4 );
676  itcPlug2Pos->registerColorCode( 4 );
677  itcPlug2Neg->registerColorCode( 4 );
678 
679  tileGirder->registerColorCode( 12 );
680 
681  // finalize Tile : glue locally and return 1 volume
682  ATH_MSG_DEBUG( "Gluing Tile volumes" );
683 
684  // glue tile volumes in z
685  std::vector<Trk::TrackingVolume*> tileVols;
686  tileVols.push_back(tileNegativeFingerGap);
687  tileVols.push_back(tileNegativeExtendedBarrel);
688  tileVols.push_back(negativeITCSector);
689  tileVols.push_back(tileBarrelNegativeFingerGap);
690  tileVols.push_back(tileBarrel);
691  tileVols.push_back(tileBarrelPositiveFingerGap);
692  tileVols.push_back(positiveITCSector);
693  tileVols.push_back(tilePositiveExtendedBarrel);
694  tileVols.push_back(tilePositiveFingerGap);
695  Trk::TrackingVolume* tileCombinedSector = m_trackingVolumeCreator->createContainerTrackingVolume
696  (tileVols,
697  tileMaterial,
698  "Calo::Container::Tile::InnerSector");
699 
700  // glue with combined girder
701  std::vector<Trk::TrackingVolume*> tileVolumes;
702  tileVolumes.push_back(tileCombinedSector);
703  tileVolumes.push_back(tileGirder);
704  Trk::TrackingVolume* tile = m_trackingVolumeCreator->createContainerTrackingVolume
705  (tileVolumes,
706  tileMaterial,
707  "Calo::Container::Tile::Combined");
708 
709  ATH_MSG_DEBUG( "Combined Tile built " );
710 
711  tileTrackingVolumes.push_back(tile); // [0]
712  tileTrackingVolumes.push_back(tilePositiveExtendedBarrel);// [1]
713 
714  if (msgLvl(MSG::INFO)) {
715  ATH_MSG_DEBUG( "Checking the existence of all Tracking Volumes:" );
716  ATH_MSG_DEBUG( " -> Tile::Barrel ");
717  printCheckResult(msg(MSG::DEBUG), tileBarrel);
718  ATH_MSG_DEBUG( " -> Tile::PositiveExtendedBarrel ");
719  printCheckResult(msg(MSG::DEBUG), tilePositiveExtendedBarrel);
720  ATH_MSG_DEBUG( " -> Tile::NegativeExtendedBarrel ");
721  printCheckResult(msg(MSG::DEBUG), tileNegativeExtendedBarrel);
722  ATH_MSG_DEBUG( " -> Tile::BarrelPositiveFingerGap ");
723  printCheckResult(msg(MSG::DEBUG), tileBarrelPositiveFingerGap);
724  ATH_MSG_DEBUG( " -> Tile::BarrelNegativeFingerGap ");
725  printCheckResult(msg(MSG::DEBUG), tileBarrelNegativeFingerGap);
726  ATH_MSG_DEBUG( " -> Tile::PositiveFingerGap ");
727  printCheckResult(msg(MSG::DEBUG), tilePositiveFingerGap);
728  ATH_MSG_DEBUG( " -> Tile::NegativeFingerGap ");
729  printCheckResult(msg(MSG::DEBUG), tileNegativeFingerGap);
730  ATH_MSG_DEBUG( " -> Tile::Girder ");
731  printCheckResult(msg(MSG::DEBUG), tileGirder);
732  } // end of detailed output
733 
734  return tileTrackingVolumes;
735 }

◆ updateVHKA()

void AthCommonDataStore< AthCommonMsg< AlgTool > >::updateVHKA ( Gaudi::Details::PropertyBase &  )
inlineinherited

Definition at line 308 of file AthCommonDataStore.h.

308  {
309  // debug() << "updateVHKA for property " << p.name() << " " << p.toString()
310  // << " size: " << m_vhka.size() << endmsg;
311  for (auto &a : m_vhka) {
312  std::vector<SG::VarHandleKey*> keys = a->keys();
313  for (auto k : keys) {
314  k->setOwner(this);
315  }
316  }
317  }

Member Data Documentation

◆ m_detStore

StoreGateSvc_t AthCommonDataStore< AthCommonMsg< AlgTool > >::m_detStore
privateinherited

Pointer to StoreGate (detector store by default)

Definition at line 393 of file AthCommonDataStore.h.

◆ m_evtStore

StoreGateSvc_t AthCommonDataStore< AthCommonMsg< AlgTool > >::m_evtStore
privateinherited

Pointer to StoreGate (event store by default)

Definition at line 390 of file AthCommonDataStore.h.

◆ m_forceSymmetry

bool Tile::TileVolumeBuilder::m_forceSymmetry
private

forces volume symmetry between negative/positive part

Definition at line 96 of file TileVolumeBuilder.h.

◆ m_surfBuilder

ToolHandle<ICaloSurfaceBuilder> Tile::TileVolumeBuilder::m_surfBuilder
private

tool required for definition of active volumes

Definition at line 94 of file TileVolumeBuilder.h.

◆ m_tileBarrelEnvelope

double Tile::TileVolumeBuilder::m_tileBarrelEnvelope
private

envelope Cover of the Barrel

Definition at line 89 of file TileVolumeBuilder.h.

◆ m_tileBarrelLayersPerSampling

unsigned int Tile::TileVolumeBuilder::m_tileBarrelLayersPerSampling
private

if m_useCaloSurfBuilder == true, number of layers per dead material region or sampling

Definition at line 92 of file TileVolumeBuilder.h.

◆ m_tileMgr

const TileDetDescrManager* Tile::TileVolumeBuilder::m_tileMgr
private

Calo DetDescrMgr.

Definition at line 84 of file TileVolumeBuilder.h.

◆ m_tileMgrLocation

std::string Tile::TileVolumeBuilder::m_tileMgrLocation
private

Location of the CaloDetDescrMgr.

Definition at line 85 of file TileVolumeBuilder.h.

◆ m_trackingVolumeCreator

ToolHandle<Trk::ITrackingVolumeCreator> Tile::TileVolumeBuilder::m_trackingVolumeCreator
private

Second helper for volume creation.

Definition at line 87 of file TileVolumeBuilder.h.

◆ m_useCaloSurfBuilder

bool Tile::TileVolumeBuilder::m_useCaloSurfBuilder
private

if true use DetDescr based layering, if false use biequidistant layering

Definition at line 91 of file TileVolumeBuilder.h.

◆ m_varHandleArraysDeclared

bool AthCommonDataStore< AthCommonMsg< AlgTool > >::m_varHandleArraysDeclared
privateinherited

Definition at line 399 of file AthCommonDataStore.h.

◆ m_vhka

std::vector<SG::VarHandleKeyArray*> AthCommonDataStore< AthCommonMsg< AlgTool > >::m_vhka
privateinherited

Definition at line 398 of file AthCommonDataStore.h.


The documentation for this class was generated from the following files:
Tile::TileVolumeBuilder::m_tileMgrLocation
std::string m_tileMgrLocation
Location of the CaloDetDescrMgr.
Definition: TileVolumeBuilder.h:85
python.PyKernel.retrieve
def retrieve(aClass, aKey=None)
Definition: PyKernel.py:110
egammaParameters::depth
@ depth
pointing depth of the shower as calculated in egammaqgcld
Definition: egammaParamDefs.h:276
CaloCell_ID_FCS::TileExt2
@ TileExt2
Definition: FastCaloSim_CaloCell_ID.h:39
python.SystemOfUnits.mm
float mm
Definition: SystemOfUnits.py:98
ATH_MSG_INFO
#define ATH_MSG_INFO(x)
Definition: AthMsgStreamMacros.h:31
Tile::TileVolumeBuilder::m_trackingVolumeCreator
ToolHandle< Trk::ITrackingVolumeCreator > m_trackingVolumeCreator
Second helper for volume creation.
Definition: TileVolumeBuilder.h:87
Trk::binZ
@ binZ
Definition: BinningType.h:49
Tile::TileVolumeBuilder::m_tileBarrelLayersPerSampling
unsigned int m_tileBarrelLayersPerSampling
if m_useCaloSurfBuilder == true, number of layers per dead material region or sampling
Definition: TileVolumeBuilder.h:92
CaloCell_ID_FCS::TileExt0
@ TileExt0
Definition: FastCaloSim_CaloCell_ID.h:37
CaloCell_ID_FCS::TileBar1
@ TileBar1
Definition: FastCaloSim_CaloCell_ID.h:32
Trk::BinnedMaterial
Definition: BinnedMaterial.h:31
AthCommonDataStore< AthCommonMsg< AlgTool > >::m_evtStore
StoreGateSvc_t m_evtStore
Pointer to StoreGate (event store by default)
Definition: AthCommonDataStore.h:390
AthCommonDataStore< AthCommonMsg< AlgTool > >::m_vhka
std::vector< SG::VarHandleKeyArray * > m_vhka
Definition: AthCommonDataStore.h:398
AthCommonMsg< AlgTool >::msgLvl
bool msgLvl(const MSG::Level lvl) const
Definition: AthCommonMsg.h:30
read_hist_ntuple.t
t
Definition: read_hist_ntuple.py:5
ATH_MSG_VERBOSE
#define ATH_MSG_VERBOSE(x)
Definition: AthMsgStreamMacros.h:28
Trk::Calo
@ Calo
Definition: GeometrySignature.h:28
Trk::TrackingVolume::registerColorCode
void registerColorCode(unsigned int icolor)
Register the color code.
AthCommonDataStore< AthCommonMsg< AlgTool > >::detStore
const ServiceHandle< StoreGateSvc > & detStore() const
The standard StoreGateSvc/DetectorStore Returns (kind of) a pointer to the StoreGateSvc.
Definition: AthCommonDataStore.h:95
SG::VarHandleKeyArray::setOwner
virtual void setOwner(IDataHandleHolder *o)=0
ReadCellNoiseFromCool.tile
tile
Definition: ReadCellNoiseFromCool.py:92
IDTPMcnv.htype
htype
Definition: IDTPMcnv.py:29
TileDetDescrManager::getTreeTop
virtual PVConstLink getTreeTop(unsigned int i) const override
Definition: TileDetDescrManager.cxx:79
WriteCellNoiseToCool.gn
gn
Definition: WriteCellNoiseToCool.py:531
AthCommonDataStore::declareGaudiProperty
Gaudi::Details::PropertyBase & declareGaudiProperty(Gaudi::Property< T, V, H > &hndl, const SG::VarHandleKeyType &)
specialization for handling Gaudi::Property<SG::VarHandleKey>
Definition: AthCommonDataStore.h:156
Trk::GeometrySignature
GeometrySignature
Definition: GeometrySignature.h:24
python.utils.AtlRunQueryDQUtils.p
p
Definition: AtlRunQueryDQUtils.py:209
beamspotman.steps
int steps
Definition: beamspotman.py:503
AthCommonDataStore
Definition: AthCommonDataStore.h:52
ATH_MSG_ERROR
#define ATH_MSG_ERROR(x)
Definition: AthMsgStreamMacros.h:33
lumiFormat.i
int i
Definition: lumiFormat.py:85
CaloCell_ID_FCS::TileBar0
@ TileBar0
Definition: FastCaloSim_CaloCell_ID.h:31
TileDetDescrManager::getNumTreeTops
virtual unsigned int getNumTreeTops() const override
Definition: TileDetDescrManager.cxx:74
beamspotman.n
n
Definition: beamspotman.py:729
Tile::TileVolumeBuilder::m_tileBarrelEnvelope
double m_tileBarrelEnvelope
envelope Cover of the Barrel
Definition: TileVolumeBuilder.h:89
endmsg
#define endmsg
Definition: AnalysisConfig_Ntuple.cxx:63
ATH_MSG_DEBUG
#define ATH_MSG_DEBUG(x)
Definition: AthMsgStreamMacros.h:29
AthCommonDataStore< AthCommonMsg< AlgTool > >::declareProperty
Gaudi::Details::PropertyBase & declareProperty(Gaudi::Property< T, V, H > &t)
Definition: AthCommonDataStore.h:145
Amg::Transform3D
Eigen::Affine3d Transform3D
Definition: GeoPrimitives.h:46
Trk::CylinderVolumeBounds::halflengthZ
double halflengthZ() const
This method returns the halflengthZ.
Definition: CylinderVolumeBounds.h:207
ATH_CHECK
#define ATH_CHECK
Definition: AthCheckMacros.h:40
Trk::Volume::center
const Amg::Vector3D & center() const
returns the center of the volume
Definition: Volume.h:90
AthCommonDataStore< AthCommonMsg< AlgTool > >::m_detStore
StoreGateSvc_t m_detStore
Pointer to StoreGate (detector store by default)
Definition: AthCommonDataStore.h:393
checkCorrelInHIST.gi
dictionary gi
Definition: checkCorrelInHIST.py:404
AthAlgTool::AthAlgTool
AthAlgTool()
Default constructor:
Tile::TileVolumeBuilder::m_useCaloSurfBuilder
bool m_useCaloSurfBuilder
if true use DetDescr based layering, if false use biequidistant layering
Definition: TileVolumeBuilder.h:91
SG::VarHandleKeyArray::renounce
virtual void renounce()=0
Trk::BinUtility
Definition: BinUtility.h:39
grepfile.ic
int ic
Definition: grepfile.py:33
SG::HandleClassifier::type
std::conditional< std::is_base_of< SG::VarHandleKeyArray, T >::value, VarHandleKeyArrayType, type2 >::type type
Definition: HandleClassifier.h:54
Trk::CylinderVolumeBounds
Definition: CylinderVolumeBounds.h:70
Tile::TileVolumeBuilder::m_surfBuilder
ToolHandle< ICaloSurfaceBuilder > m_surfBuilder
tool required for definition of active volumes
Definition: TileVolumeBuilder.h:94
merge_scale_histograms.doc
string doc
Definition: merge_scale_histograms.py:9
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:240
CaloCell_ID_FCS::TileExt1
@ TileExt1
Definition: FastCaloSim_CaloCell_ID.h:38
Trk::CylinderVolumeBounds::outerRadius
double outerRadius() const
This method returns the outer radius.
Definition: CylinderVolumeBounds.h:191
Amg::Vector3D
Eigen::Matrix< double, 3, 1 > Vector3D
Definition: GeoPrimitives.h:47
Trk::open
@ open
Definition: BinningType.h:40
Trk::binR
@ binR
Definition: BinningType.h:50
python.CaloAddPedShiftConfig.default
default
Definition: CaloAddPedShiftConfig.py:43
a
TList * a
Definition: liststreamerinfos.cxx:10
h
python.Constants.INFO
int INFO
Definition: Control/AthenaCommon/python/Constants.py:15
Trk::CylinderVolumeBounds::innerRadius
double innerRadius() const
This method returns the inner radius.
Definition: CylinderVolumeBounds.h:187
DeMoScan.first
bool first
Definition: DeMoScan.py:534
DEBUG
#define DEBUG
Definition: page_access.h:11
Amg::Translation3D
Eigen::Translation< double, 3 > Translation3D
Definition: GeoPrimitives.h:44
AthCommonMsg< AlgTool >::msg
MsgStream & msg() const
Definition: AthCommonMsg.h:24
python.CaloCondTools.log
log
Definition: CaloCondTools.py:20
python.changerun.pv
pv
Definition: changerun.py:79
SG::VarHandleBase::vhKey
SG::VarHandleKey & vhKey()
Return a non-const reference to the HandleKey.
Definition: StoreGate/src/VarHandleBase.cxx:629
Tile::TileVolumeBuilder::printCheckResult
static void printCheckResult(MsgStream &log, const Trk::TrackingVolume *vol)
Definition: TileVolumeBuilder.cxx:737
LVL1::gFEXPos
Definition: gFexPos.h:11
python.Bindings.keys
keys
Definition: Control/AthenaPython/python/Bindings.py:801
Trk::GeoShapeConverter::convert
static std::shared_ptr< CylinderVolumeBounds > convert(const GeoTubs *gtub)
Convert a tubs.
Definition: GeoShapeConverter.cxx:57
Trk::Material
Definition: Material.h:117
Trk::TrackingVolume
Definition: TrackingVolume.h:119
Trk::CylinderVolumeBounds::clone
CylinderVolumeBounds * clone() const override
Virtual constructor.
Definition: CylinderVolumeBounds.h:171
Material
@ Material
Definition: MaterialTypes.h:8
CaloCell_ID_FCS::TileBar2
@ TileBar2
Definition: FastCaloSim_CaloCell_ID.h:33
Tile::TileVolumeBuilder::m_tileMgr
const TileDetDescrManager * m_tileMgr
Calo DetDescrMgr.
Definition: TileVolumeBuilder.h:84
Tile::TileVolumeBuilder::m_forceSymmetry
bool m_forceSymmetry
forces volume symmetry between negative/positive part
Definition: TileVolumeBuilder.h:96
plotBeamSpotMon.nc
int nc
Definition: plotBeamSpotMon.py:82
Tile::TileVolumeBuilder::printChildren
void printChildren(const GeoPVConstLink &pv, int igen, const Amg::Transform3D &trIn) const
Definition: TileVolumeBuilder.cxx:754
fitman.k
k
Definition: fitman.py:528
python.LArMinBiasAlgConfig.float
float
Definition: LArMinBiasAlgConfig.py:65
Trk::AlignableTrackingVolume
Definition: AlignableTrackingVolume.h:36