DD4hep  1.30.0
Detector Description Toolkit for High Energy Physics
createGearForILD.cpp
Go to the documentation of this file.
1 //==========================================================================
2 // AIDA Detector description implementation
3 //--------------------------------------------------------------------------
4 // Copyright (C) Organisation europeenne pour la Recherche nucleaire (CERN)
5 // All rights reserved.
6 //
7 // For the licensing terms see $DD4hepINSTALL/LICENSE.
8 // For the list of contributors see $DD4hepINSTALL/doc/CREDITS.
9 //
10 // Author : F.Gaede
11 //
12 //==========================================================================
13 #include "DD4hep/Detector.h"
14 #include "DD4hep/Factories.h"
15 #include "DD4hep/DD4hepUnits.h"
16 
17 #include "DDRec/DetectorData.h"
18 #include "DDRec/DDGear.h"
19 #include "DDRec/MaterialManager.h"
20 
21 #include "DDRec/Vector3D.h"
22 
24 
25 #include "gearimpl/TPCParametersImpl.h"
26 #include "gearimpl/FixedPadSizeDiskLayout.h"
27 #include "gearimpl/ZPlanarParametersImpl.h"
28 #include "gearimpl/FTDParametersImpl.h"
29 #include "gearimpl/CalorimeterParametersImpl.h"
30 
31 #include <iostream>
32 
33 namespace dd4hep{
34  namespace rec{
35 
36  using namespace detail ;
37 
49  static long createGearForILD(Detector& description, int /*argc*/, char** /*argv*/) {
50 
51  std::cout << " **** running plugin createGearForILD ! " << std::endl ;
52 
53 
54  // ===========================================================================================
55  // global parameters:
56 
57  double crossing_angle(0.) ;
58  try{ crossing_angle = description.constant<double>("ILC_Main_Crossing_Angle") ; } catch(std::runtime_error&e) {std::cerr << " >>>> " << e.what() << std::endl ;}
59 
60 
61  //========= TPC ==============================================================================
62  try{
63 
64  DetElement tpcDE = description.detector("TPC") ;
65 
66  FixedPadSizeTPCData* tpc = tpcDE.extension<FixedPadSizeTPCData>() ;
67 
68  gear::TPCParametersImpl* gearTPC = new gear::TPCParametersImpl( tpc->driftLength /dd4hep::mm , gear::PadRowLayout2D::POLAR ) ;
69 
70  gearTPC->setPadLayout( new gear::FixedPadSizeDiskLayout( tpc->rMinReadout/dd4hep::mm , tpc->rMaxReadout/dd4hep::mm, tpc->padHeight/dd4hep::mm,
71  tpc->padWidth/dd4hep::mm , tpc->maxRow, tpc->padGap /dd4hep::mm ) ) ;
72 
73  gearTPC->setDoubleVal("tpcInnerRadius", tpc->rMin/dd4hep::mm ) ; // inner r of support tube
74  gearTPC->setDoubleVal("tpcOuterRadius", tpc->rMax/dd4hep::mm ) ; // outer radius of TPC
75  gearTPC->setDoubleVal("tpcInnerWallThickness", tpc->innerWallThickness/dd4hep::mm ) ; // thickness of inner shell
76  gearTPC->setDoubleVal("tpcOuterWallThickness", tpc->outerWallThickness/dd4hep::mm ) ; // thickness of outer shell
77 
78  tpcDE.addExtension< GearHandle >( new GearHandle( gearTPC, "TPCParameters" ) ) ;
79 
80  } catch( std::runtime_error& e ){
81  std::cerr << " >>>> " << e.what() << std::endl ;
82  }
83 
84  //========= VXD ==============================================================================
85 
86  try{
87  DetElement vxdDE = description.detector("VXD") ;
88 
89  ZPlanarData* vxd = vxdDE.extension<ZPlanarData>() ;
90 
91  // ZPlanarParametersImpl (int type, double shellInnerRadius, double shellOuterRadius, double shellHalfLength, double shellGap, double shellRadLength)
92  int vxdType = gear::ZPlanarParameters::CMOS ;
93  gear::ZPlanarParametersImpl* gearVXD = new gear::ZPlanarParametersImpl( vxdType, vxd->rInnerShell/dd4hep::mm, vxd->rOuterShell/dd4hep::mm,
94  vxd->zHalfShell/dd4hep::mm , vxd->gapShell/dd4hep::mm , 0. ) ;
95 
96  for(unsigned i=0,n=vxd->layers.size() ; i<n; ++i){
97 
98  const rec::ZPlanarData::LayerLayout& l = vxd->layers[i] ;
99 
100  // FIXME set rad lengths to 0 -> need to get from dd4hep ....
101  gearVXD->addLayer( l.ladderNumber, l.phi0,
102  l.distanceSupport/dd4hep::mm, l.offsetSupport/dd4hep::mm, l.thicknessSupport/dd4hep::mm, l.zHalfSupport/dd4hep::mm, l.widthSupport/dd4hep::mm, 0. ,
103  l.distanceSensitive/dd4hep::mm, l.offsetSensitive/dd4hep::mm, l.thicknessSensitive/dd4hep::mm, l.zHalfSensitive/dd4hep::mm, l.widthSensitive/dd4hep::mm, 0. ) ;
104 
105  }
106 
107  GearHandle* handle = new GearHandle( gearVXD, "VXDParameters" ) ;
108 
109  // quick hack for now: add the one material that is needed by KalDet :
110  // handle->addMaterial( "VXDSupportMaterial", 2.075865162e+01, 1.039383117e+01, 2.765900000e+02, 1.014262421e+03, 3.341388059e+03) ;
111 
112  // -------- better: get right averaged material from first ladder: ------------------
113  MaterialManager matMgr( Detector::getInstance().world().volume() ) ;
114 
115  const rec::ZPlanarData::LayerLayout& l = vxd->layers[0] ;
116 
117  Vector3D a( l.distanceSupport , l.phi0 , 0. , Vector3D::cylindrical ) ;
118  Vector3D b( l.distanceSupport + l.thicknessSupport , l.phi0 , 0. , Vector3D::cylindrical ) ;
119 
120  const MaterialVec& materials = matMgr.materialsBetween( a , b ) ;
121 
122  MaterialData mat = ( materials.size() > 1 ? matMgr.createAveragedMaterial( materials ) : materials[0].first ) ;
123 
124  // std::cout << " ####### found materials between points : " << a << " and " << b << " : " ;
125  // for( unsigned i=0,n=materials.size();i<n;++i){
126  // std::cout << materials[i].first.name() << "[" << materials[i].second << "], " ;
127  // }
128  // std::cout << std::endl ;
129  // std::cout << " averaged material : " << mat << std::endl ;
130 
131  handle->addMaterial( "VXDSupportMaterial", mat.A(), mat.Z() , mat.density()/(dd4hep::kg/(dd4hep::g*dd4hep::m3)) , mat.radiationLength()/dd4hep::mm , mat.interactionLength()/dd4hep::mm ) ;
132 
133 
134  vxdDE.addExtension< GearHandle >( handle ) ;
135 
136  } catch( std::runtime_error& e ){
137  std::cerr << " >>>> " << e.what() << std::endl ;
138  }
139 
140  //========= SIT ==============================================================================
141 
142  try{
143 
144  DetElement sitDE = description.detector("SIT") ;
145 
146  ZPlanarData* sit = sitDE.extension<ZPlanarData>() ;
147 
148  // ZPlanarParametersImpl (int type, double shellInnerRadius, double shellOuterRadius, double shellHalfLength, double shellGap, double shellRadLength)
149  int sitType = gear::ZPlanarParameters::CCD ;
150  gear::ZPlanarParametersImpl* gearSIT = new gear::ZPlanarParametersImpl( sitType, sit->rInnerShell/dd4hep::mm, sit->rOuterShell/dd4hep::mm,
151  sit->zHalfShell/dd4hep::mm , sit->gapShell/dd4hep::mm , 0. ) ;
152  std::vector<int> n_sensors_per_ladder ;
153 
154  for(unsigned i=0,n=sit->layers.size() ; i<n; ++i){
155 
156  const rec::ZPlanarData::LayerLayout& l = sit->layers[i] ;
157 
158  // FIXME set rad lengths to 0 -> need to get from dd4hep ....
159  gearSIT->addLayer( l.ladderNumber, l.phi0,
160  l.distanceSupport/dd4hep::mm, l.offsetSupport/dd4hep::mm, l. thicknessSupport/dd4hep::mm, l.zHalfSupport/dd4hep::mm, l.widthSupport/dd4hep::mm, 0. ,
161  l.distanceSensitive/dd4hep::mm, l.offsetSensitive/dd4hep::mm, l. thicknessSensitive/dd4hep::mm, l.zHalfSensitive/dd4hep::mm, l.widthSensitive/dd4hep::mm, 0. ) ;
162 
163 
164  n_sensors_per_ladder.push_back( l.sensorsPerLadder);
165  }
166 
167  gearSIT->setDoubleVal("strip_width_mm" , sit->widthStrip / dd4hep::mm ) ;
168  gearSIT->setDoubleVal("strip_length_mm" , sit->lengthStrip/ dd4hep::mm ) ;
169  gearSIT->setDoubleVal("strip_pitch_mm" , sit->pitchStrip / dd4hep::mm ) ;
170  gearSIT->setDoubleVal("strip_angle_deg" , sit->angleStrip / dd4hep::deg ) ;
171 
172 
173  gearSIT->setIntVals("n_sensors_per_ladder",n_sensors_per_ladder);
174 
175  sitDE.addExtension< GearHandle >( new GearHandle( gearSIT, "SITParameters" ) ) ;
176 
177  } catch( std::runtime_error& e ){
178  std::cerr << " >>>> " << e.what() << std::endl ;
179  }
180 
181  //============================================================================================
182 
183  try {
184 
185  DetElement setDE = description.detector("SET") ;
186 
187  ZPlanarData* set = setDE.extension<ZPlanarData>() ;
188 
189  // ZPlanarParametersImpl (int type, double shellInnerRadius, double shellOuterRadius, double shellHalfLength, double shellGap, double shellRadLength)
190  int setType = gear::ZPlanarParameters::CCD ;
191  gear::ZPlanarParametersImpl* gearSET = new gear::ZPlanarParametersImpl( setType, set->rInnerShell/dd4hep::mm, set->rOuterShell/dd4hep::mm,
192  set->zHalfShell/dd4hep::mm , set->gapShell/dd4hep::mm , 0. ) ;
193  std::vector<int> n_sensors_per_ladder ;
194  //n_sensors_per_ladder.clear() ;
195 
196  for(unsigned i=0,n=set->layers.size() ; i<n; ++i){
197 
198  const rec::ZPlanarData::LayerLayout& l = set->layers[i] ;
199 
200  // FIXME set rad lengths to 0 -> need to get from dd4hep ....
201  gearSET->addLayer( l.ladderNumber, l.phi0,
202  l.distanceSupport/dd4hep::mm, l.offsetSupport/dd4hep::mm, l. thicknessSupport/dd4hep::mm, l.zHalfSupport/dd4hep::mm, l.widthSupport/dd4hep::mm, 0. ,
203  l.distanceSensitive/dd4hep::mm, l.offsetSensitive/dd4hep::mm, l. thicknessSensitive/dd4hep::mm, l.zHalfSensitive/dd4hep::mm, l.widthSensitive/dd4hep::mm, 0. ) ;
204 
205 
206  n_sensors_per_ladder.push_back( l.sensorsPerLadder);
207  }
208 
209  gearSET->setDoubleVal("strip_width_mm" , set->widthStrip / dd4hep::mm ) ;
210  gearSET->setDoubleVal("strip_length_mm" , set->lengthStrip/ dd4hep::mm ) ;
211  gearSET->setDoubleVal("strip_pitch_mm" , set->pitchStrip / dd4hep::mm ) ;
212  gearSET->setDoubleVal("strip_angle_deg" , set->angleStrip / dd4hep::deg ) ;
213 
214 
215  gearSET->setIntVals("n_sensors_per_ladder",n_sensors_per_ladder);
216 
217  setDE.addExtension< GearHandle >( new GearHandle( gearSET, "SETParameters" ) ) ;
218 
219  } catch( std::runtime_error& e ){
220  std::cerr << " >>>> " << e.what() << std::endl ;
221  }
222 
223  //============================================================================================
224 
225  try {
226 
227  DetElement ftdDE = description.detector("FTD") ;
228 
229  ZDiskPetalsData* ftd = ftdDE.extension<ZDiskPetalsData>() ;
230 
231  gear::FTDParametersImpl* gearFTD = new gear::FTDParametersImpl();
232 
233  for(unsigned i=0,n=ftd->layers.size() ; i<n; ++i){
234 
235  const rec::ZDiskPetalsData::LayerLayout& l = ftd->layers[i] ;
236 
237 
238  bool isDoubleSided = l.typeFlags[ rec::ZDiskPetalsStruct::SensorType::DoubleSided ] ;
239 
240  // avoid 'undefined reference' at link time ( if built w/o optimization ):
241  static const int PIXEL = gear::FTDParameters::PIXEL ;
242  static const int STRIP = gear::FTDParameters::STRIP ;
243  int sensorType = ( l.typeFlags[ rec::ZDiskPetalsStruct::SensorType::Pixel ] ? PIXEL : STRIP ) ;
244  // gear::FTDParameters::PIXEL : gear::FTDParameters::STRIP ) ;
245 
246  double zoffset = fabs( l.zOffsetSupport ) ;
247  double signoffset = l.zOffsetSupport > 0 ? 1. : -1 ;
248 
249  gearFTD->addLayer( l.petalNumber, l.sensorsPerPetal,
250  isDoubleSided, sensorType,
251  l.petalHalfAngle, l.phi0, l.alphaPetal,
252  l.zPosition/dd4hep::mm, zoffset/dd4hep::mm, signoffset,
253  l.distanceSupport/dd4hep::mm, l.thicknessSupport/dd4hep::mm,
254  l.widthInnerSupport/dd4hep::mm, l.widthOuterSupport/dd4hep::mm,
255  l.lengthSupport/dd4hep::mm,
256  0.,
257  l.distanceSensitive/dd4hep::mm, l.thicknessSensitive/dd4hep::mm,
258  l.widthInnerSensitive/dd4hep::mm, l.widthOuterSensitive/dd4hep::mm,
259  l.lengthSensitive/dd4hep::mm,
260  0. ) ;
261 
262 
263  // FIXME set rad lengths to 0 -> need to get from dd4hep ....
264  }
265 
266  gearFTD->setDoubleVal("strip_width_mm" , ftd->widthStrip / dd4hep::mm ) ;
267  gearFTD->setDoubleVal("strip_length_mm" , ftd->lengthStrip/ dd4hep::mm ) ;
268  gearFTD->setDoubleVal("strip_pitch_mm" , ftd->pitchStrip / dd4hep::mm ) ;
269  gearFTD->setDoubleVal("strip_angle_deg" , ftd->angleStrip / dd4hep::deg ) ;
270 
271 
272  ftdDE.addExtension< GearHandle >( new GearHandle( gearFTD, "FTDParameters" ) ) ;
273 
274  } catch( std::runtime_error& e ){
275  std::cerr << " >>>> " << e.what() << std::endl ;
276  }
277 
278  //============================================================================================
279 
280  try {
281 
282  DetElement coilDE = description.detector("Coil") ;
283 
284  gear::GearParametersImpl* gearCOIL = new gear::GearParametersImpl();
285 
286  Tube coilTube = Tube( coilDE.volume().solid() ) ;
287 
288  gearCOIL->setDoubleVal("Coil_cryostat_inner_radius" , coilTube->GetRmin()/ dd4hep::mm ) ;
289  gearCOIL->setDoubleVal("Coil_cryostat_outer_radius" , coilTube->GetRmax()/ dd4hep::mm ) ;
290  gearCOIL->setDoubleVal("Coil_cryostat_half_z" , coilTube->GetDZ()/ dd4hep::mm ) ;
291 
292  coilDE.addExtension< GearHandle >( new GearHandle( gearCOIL, "CoilParameters" ) ) ;
293 
294  } catch( std::runtime_error& e ){
295  std::cerr << " >>>> " << e.what() << std::endl ;
296  }
297 
298  //============================================================================================
299 
300  try {
301 
302  DetElement tubeDE = description.detector("Tube") ;
303 
304  ConicalSupportData* tube = tubeDE.extension<ConicalSupportData>() ;
305 
306  gear::GearParametersImpl* gearTUBE = new gear::GearParametersImpl();
307 
308  tube->isSymmetricInZ = true ;
309 
310  unsigned n = tube->sections.size() ;
311 
312  std::vector<double> rInner(n) ;
313  std::vector<double> rOuter(n) ;
314  std::vector<double> zStart(n) ;
315 
316  for(unsigned i=0 ; i<n ; ++i){
317 
318  const ConicalSupportData::Section& s = tube->sections[i] ;
319 
320  rInner[i] = s.rInner/ dd4hep::mm ;
321  rOuter[i] = s.rOuter/ dd4hep::mm ;
322  zStart[i] = s.zPos / dd4hep::mm ;
323 
324  // FIXME set rad lengths to 0 -> need to get from dd4hep ....
325  }
326 
327  gearTUBE->setDoubleVals("RInner" , rInner ) ;
328  gearTUBE->setDoubleVals("ROuter" , rOuter ) ;
329  gearTUBE->setDoubleVals("Z" , zStart ) ;
330 
331 
332  tubeDE.addExtension< GearHandle >( new GearHandle( gearTUBE, "BeamPipe" ) ) ;
333 
334  } catch( std::runtime_error& e ){
335  std::cerr << " >>>> " << e.what() << std::endl ;
336  }
337 
338  //========= CALO ==============================================================================
339 
340  //**********************************************************
341  //* gear interface w/ LayeredCalorimeterData extension
342  //**********************************************************
343 
344  std::map< std::string, std::string > caloMap ;
345  caloMap["HcalBarrel"] = "HcalBarrelParameters" ;
346  caloMap["EcalBarrel"] = "EcalBarrelParameters" ;
347  caloMap["EcalEndcap"] = "EcalEndcapParameters" ;
348  caloMap["EcalPlug"] = "EcalPlugParameters" ;
349  caloMap["YokeBarrel"] = "YokeBarrelParameters" ;
350  caloMap["YokeEndcap"] = "YokeEndcapParameters" ;
351  caloMap["YokePlug"] = "YokePlugParameters" ;
352  caloMap["HcalBarrel"] = "HcalBarrelParameters" ;
353  caloMap["HcalEndcap"] = "HcalEndcapParameters" ;
354  caloMap["HcalRing"] = "HcalRingParameters" ;
355  caloMap["Lcal"] = "LcalParameters" ;
356  caloMap["LHcal"] = "LHcalParameters" ;
357  caloMap["BeamCal"] = "BeamCalParameters" ;
358 
359  for( std::map< std::string, std::string >::const_iterator it = caloMap.begin() ; it != caloMap.end() ; ++it ){
360 
361 
362 
363  try {
364 
365  DetElement caloDE = description.detector( it->first ) ;
366 
367  LayeredCalorimeterData* calo = caloDE.extension<LayeredCalorimeterData>() ;
368 
369  gear::CalorimeterParametersImpl* gearCalo =
370  ( calo->layoutType == LayeredCalorimeterData::BarrelLayout ?
371  new gear::CalorimeterParametersImpl( calo->extent[0]/dd4hep::mm, calo->extent[3]/dd4hep::mm, calo->inner_symmetry, calo->phi0 ) :
372  //CalorimeterParametersImpl (double rMin, double zMax, int symOrder=8, double phi0=0.0) - C'tor for a cylindrical (octagonal) BARREL calorimeter.
373  new gear::CalorimeterParametersImpl( calo->extent[0]/dd4hep::mm, calo->extent[1]/dd4hep::mm, calo->extent[2]/dd4hep::mm, calo->outer_symmetry, calo->phi0 ) ) ;
374  //CalorimeterParametersImpl (double rMin, double rMax, double zMin, int symOrder=2, double phi0=0.0) - C'tor for a cylindrical (octagonal) ENDCAP calorimeter.
375 
376  for( unsigned i=0, nL = calo->layers.size() ; i <nL ; ++i ){
377 
378  LayeredCalorimeterData::Layer& l = calo->layers[i] ;
379 
380  //Do some arithmetic to get thicknesses and (approximate) absorber thickneses from "new" rec structures
381  //The positioning should come out right, but the absorber thickness should be overestimated due to the presence of
382  //other less dense material
383  if( i == 0 ) {
384  gearCalo->layerLayout().positionLayer( l.distance/dd4hep::mm,
385  (l.inner_thickness+l.sensitive_thickness/2.)/dd4hep::mm ,
386  l.cellSize0/dd4hep::mm, l.cellSize1/dd4hep::mm,
387  (l.inner_thickness-l.sensitive_thickness/2.)/dd4hep::mm ) ;
388  }else{
389  gearCalo->layerLayout().addLayer( (l.inner_thickness+l.sensitive_thickness/2.+calo->layers[i-1].outer_thickness-calo->layers[i-1].sensitive_thickness/2. ) / dd4hep::mm ,
390  l.cellSize0/dd4hep::mm, l.cellSize1/dd4hep::mm, (l.inner_thickness-l.sensitive_thickness/2.+calo->layers[i-1].outer_thickness-calo->layers[i-1].sensitive_thickness/2.)/dd4hep::mm) ;
391  }
392  // if( i == 0 ) {
393  // gearCalo->layerLayout().positionLayer( l.distance/dd4hep::mm, l.thickness/dd4hep::mm ,
394  // l.cellSize0/dd4hep::mm, l.cellSize1/dd4hep::mm, l.absorberThickness/dd4hep::mm ) ;
395  // }else{
396  // gearCalo->layerLayout().addLayer( l.thickness/dd4hep::mm ,
397  // l.cellSize0/dd4hep::mm, l.cellSize1/dd4hep::mm, l.absorberThickness/dd4hep::mm ) ;
398  // }
399 
400  }
401 
402  if( it->first == "HcalBarrel" ){
403  // additional parameters needed by MarlinPandora
404  gearCalo->setIntVal("Hcal_outer_polygon_order" , calo->outer_symmetry ) ;
405  gearCalo->setDoubleVal("Hcal_outer_polygon_phi0" , calo->phi0 ) ;
406  }
407 
408  if( it->first == "BeamCal" ){
409 
410  try{
411  // additional parameters needed by BCalReco
412 
413  SensitiveDetector sD = description.sensitiveDetector( it->first ) ;
414  Readout readOut = sD.readout() ;
415  Segmentation seg = readOut.segmentation() ;
416 
417  // DDSegmentation::DoubleVecParameter rPar = dynamic_cast<DDSegmentation::DoubleVecParameter>( seg.parameter("grid_r_values"));
418  DDSegmentation::DoubleVecParameter pPar = dynamic_cast<DDSegmentation::DoubleVecParameter>( seg.parameter("grid_phi_values"));
419  DDSegmentation::DoubleParameter oPPar= dynamic_cast<DDSegmentation::DoubleParameter>( seg.parameter("offset_phi"));
420 
421 
422  //offset_phi="-180*degree+(360*degree-BCal_SpanningPhi)*0.5"
423  double offsetPhi = oPPar->typedValue() ;
424  double spanningPhi = 360.*dd4hep::deg - 2.*( offsetPhi + 180.*dd4hep::deg ) ;
425 
426  gearCalo->setDoubleVals( "phi_segmentation" , pPar->typedValue() );
427  gearCalo->setDoubleVal( "cylinder_starting_phi", offsetPhi );
428  gearCalo->setDoubleVal( "cylinder_spanning_phi", spanningPhi );
429  gearCalo->setDoubleVal( "beam_crossing_angle" , crossing_angle );
430 
431  //fixme: don't know how to get these parameters at this stage ...
432  // probably need a named parameter object at every DetElement ....
433  gearCalo->setDoubleVal( "dead_area_outer_r" , 0 );
434  gearCalo->setDoubleVal( "pairsMonitorZ" , 0. );
435  gearCalo->setDoubleVal( "FIXME_dead_area_outer_r" , -1. );
436  gearCalo->setDoubleVal( "FIXME_pairsMonitorZ" , -1. );
437 
438  } catch( std::runtime_error& e ){
439  std::cerr << " >>>> BeamCal: " << e.what() << std::endl ;
440  }
441  }
442 
443  if( it->first == "Lcal" || it->first == "LHcal" ){
444  gearCalo->setDoubleVal( "beam_crossing_angle" , crossing_angle );
445  }
446 
447  caloDE.addExtension< GearHandle >( new GearHandle( gearCalo, it->second ) ) ;
448 
449  } catch( std::runtime_error& e ){
450  std::cerr << " >>>> " << e.what() << std::endl ;
451  }
452 
453  } // calo loop
454 
455 
456 
457  //**********************************************************
458  //* test gear interface w/ LayeredExtensionImpl extension
459  //**********************************************************
460 
461  // DetElement calo2DE = description.detector("EcalBarrel") ;
462 
463  // Calorimeter calo2( calo2DE ) ;
464 
465  // gear::CalorimeterParametersImpl* gearCalo2 =
466  // ( calo2.isBarrel() ?
467  // new gear::CalorimeterParametersImpl( calo2.getRMin()/dd4hep::mm, calo2.getZMax()/dd4hep::mm, calo2.getNSides(), 0. ) : // fixme: phi 0 is not defined ??
468  // new gear::CalorimeterParametersImpl( calo2.getRMin()/dd4hep::mm, calo2.getRMax()/dd4hep::mm, calo2.getZMin()/dd4hep::mm, calo2.getNSides(), 0. )
469  // ) ;
470 
471  // for( unsigned i=0, nL = calo2.numberOfLayers() ; i <nL ; ++i ){
472 
473  // if( i == 0 ) {
474  // gearCalo2->layerLayout().positionLayer( calo2.getRMin()/dd4hep::mm, calo2.thickness(i)/dd4hep::mm , 0. /dd4hep::mm, 0. /dd4hep::mm, calo2.absorberThickness(i)/dd4hep::mm ) ;
475 
476  // }else{ // fixme: cell sizes not in API !?
477 
478  // gearCalo2->layerLayout().addLayer( calo2.thickness(i)/dd4hep::mm , 0. /dd4hep::mm, 0. /dd4hep::mm, calo2.absorberThickness(i)/dd4hep::mm ) ;
479  // }
480 
481 
482  // }
483 
484  // calo2DE.addExtension< GearHandle >( new GearHandle( gearCalo2, "EcalBarrelParameters" ) ) ;
485 
486 
487  //============================================================================================
488 
489 
490 
491  // --- Detector::apply() expects return code 1 if all went well ! ----
492  return 1;
493  }
494  }
495 }
496 DECLARE_APPLY( GearForILD, dd4hep::rec::createGearForILD )
497 
498 
DetectorData.h
Detector.h
dd4hep::rec::ZDiskPetalsStruct::SensorType::Pixel
@ Pixel
Definition: DetectorData.h:214
DECLARE_APPLY
#define DECLARE_APPLY(name, func)
Definition: Factories.h:281
dd4hep::rec::MaterialVec
std::vector< std::pair< Material, double > > MaterialVec
Definition: MaterialManager.h:30
dd4hep::rec::Vector3D::cylindrical
static Cylindrical cylindrical()
Definition: Vector3D.h:278
dd4hep::DDSegmentation::DoubleParameter
TypedSegmentationParameter< double > * DoubleParameter
Definition: Segmentation.h:39
Factories.h
dd4hep::rec::ZDiskPetalsStruct::SensorType::DoubleSided
@ DoubleSided
Definition: DetectorData.h:213
dd4hep::rec::LayeredCalorimeterData
StructExtension< LayeredCalorimeterStruct > LayeredCalorimeterData
Definition: DetectorData.h:472
dd4hep::Detector::getInstance
static Detector & getInstance(const std::string &name="default")
—Factory method----—
Definition: DetectorImp.cpp:150
DDGear.h
dd4hep::rec::ConicalSupportData
StructExtension< ConicalSupportStruct > ConicalSupportData
Definition: DetectorData.h:345
gear
Definition: DDGear.h:24
dd4hep::DDSegmentation::DoubleVecParameter
TypedSegmentationParameter< std::vector< double > > * DoubleVecParameter
Definition: Segmentation.h:43
dd4hep::rec::ZDiskPetalsData
StructExtension< ZDiskPetalsStruct > ZDiskPetalsData
Definition: DetectorData.h:302
dd4hep::rec::ZPlanarData
StructExtension< ZPlanarStruct > ZPlanarData
Definition: DetectorData.h:184
MaterialManager.h
dd4hep
Namespace for the AIDA detector description toolkit.
Definition: AlignmentsCalib.h:28
dd4hep::rec::FixedPadSizeTPCData
StructExtension< FixedPadSizeTPCStruct > FixedPadSizeTPCData
Definition: DetectorData.h:90
Segmentation.h
DD4hepUnits.h
Vector3D.h
handle
void handle(const O *o, const C &c, F pmf)
Definition: LCDDConverter.cpp:1105