23 #include "gearimpl/TPCParametersImpl.h"
24 #include "gearimpl/FixedPadSizeDiskLayout.h"
25 #include "gearimpl/ZPlanarParametersImpl.h"
26 #include "gearimpl/FTDParametersImpl.h"
27 #include "gearimpl/CalorimeterParametersImpl.h"
34 using namespace detail ;
53 static long createGearForSiD(Detector& description,
int ,
char** ) {
55 std::cout <<
" **** running plugin createGearForSiD ! " << std::endl ;
59 DetElement coilDE = description.detector(
"Solenoid") ;
61 gear::GearParametersImpl* gearCOIL =
new gear::GearParametersImpl();
63 Tube coilTube = Tube( coilDE.volume().solid() ) ;
65 gearCOIL->setDoubleVal(
"Coil_cryostat_inner_radius" , coilTube->GetRmin()/ dd4hep::mm ) ;
66 gearCOIL->setDoubleVal(
"Coil_cryostat_outer_radius" , coilTube->GetRmax()/ dd4hep::mm ) ;
67 gearCOIL->setDoubleVal(
"Coil_cryostat_half_z" , coilTube->GetDZ()/ dd4hep::mm ) ;
69 coilDE.addExtension< GearHandle >(
new GearHandle( gearCOIL,
"CoilParameters" ) ) ;
71 }
catch( std::runtime_error& e ){
72 std::cerr <<
" >>>> " << e.what() << std::endl ;
81 std::map< std::string, std::string > caloMap ;
82 caloMap[
"HCalBarrel"] =
"HcalBarrelParameters" ;
83 caloMap[
"HCalEndcap"] =
"HcalEndcapParameters" ;
84 caloMap[
"ECalBarrel"] =
"EcalBarrelParameters" ;
85 caloMap[
"ECalEndcap"] =
"EcalEndcapParameters" ;
86 caloMap[
"MuonBarrel"] =
"YokeBarrelParameters" ;
87 caloMap[
"MuonEndcap"] =
"YokeEndcapParameters" ;
88 caloMap[
"LumiCal"] =
"LcalParameters" ;
89 caloMap[
"BeamCal"] =
"BeamCalParameters" ;
91 for( std::map< std::string, std::string >::const_iterator it = caloMap.begin() ; it != caloMap.end() ; ++it ){
95 DetElement caloDE = description.detector( it->first ) ;
99 gear::CalorimeterParametersImpl* gearCalo =
100 ( calo->layoutType == LayeredCalorimeterData::BarrelLayout ?
101 new gear::CalorimeterParametersImpl( calo->extent[0]/dd4hep::mm, calo->extent[3]/dd4hep::mm, calo->inner_symmetry, calo->inner_phi0 ) :
103 new
gear::CalorimeterParametersImpl( calo->extent[0]/
dd4hep::mm, calo->extent[1]/
dd4hep::mm, calo->extent[2]/
dd4hep::mm, calo->outer_symmetry, calo->outer_phi0 ) ) ;
106 for(
unsigned i=0, nL = calo->layers.size() ; i <nL ; ++i ){
108 LayeredCalorimeterData::Layer& l = calo->layers[i] ;
115 gearCalo->layerLayout().positionLayer( l.distance/dd4hep::mm, (l.inner_thickness+l.sensitive_thickness/2.)/dd4hep::mm ,
116 l.cellSize0/dd4hep::mm, l.cellSize1/dd4hep::mm, (l.inner_thickness-l.sensitive_thickness/2.)/dd4hep::mm ) ;
117 }
else if ( i == nL -1 ) {
120 gearCalo->layerLayout().addLayer((l.inner_thickness+l.outer_thickness+calo->layers[i-1].outer_thickness-calo->layers[i-1].sensitive_thickness/2.)/dd4hep::mm ,
121 l.cellSize0/dd4hep::mm, l.cellSize1/dd4hep::mm, (l.inner_thickness+l.outer_thickness-l.sensitive_thickness+calo->layers[i-1].outer_thickness-calo->layers[i-1].sensitive_thickness/2.)/dd4hep::mm) ;
124 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 ,
125 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) ;
129 if( it->first ==
"HCalBarrel" ){
131 gearCalo->setIntVal(
"Hcal_outer_polygon_order" , calo->outer_symmetry ) ;
132 gearCalo->setDoubleVal(
"Hcal_outer_polygon_phi0" , calo->outer_phi0 ) ;
135 caloDE.addExtension< GearHandle >(
new GearHandle( gearCalo, it->second ) ) ;
137 }
catch( std::runtime_error& e ){
138 std::cerr <<
" >>>> " << e.what() << std::endl ;