diff --git a/DDDetectors/CMakeLists.txt b/DDDetectors/CMakeLists.txt index 9183ebaa3da90c7deffcd9f5b4a4c65f88868239..d156d1dc852a762e9b94cf6889b4f8410b418885 100644 --- a/DDDetectors/CMakeLists.txt +++ b/DDDetectors/CMakeLists.txt @@ -1,25 +1,36 @@ -#----------------------------------------------------------------------------------- +# $Id: Handle.h 570 2013-05-17 07:47:11Z markus.frank $ +#========================================================================== +# AIDA Detector description implementation for LCD +#-------------------------------------------------------------------------- +# Copyright (C) Organisation europ茅enne pour la Recherche nucl茅aire (CERN) +# All rights reserved. +# +# For the licensing terms see $DD4hepINSTALL/LICENSE. +# For the list of contributors see $DD4hepINSTALL/doc/CREDITS. +# +#========================================================================== +#-------------------------------------------------------------------------- # DDDetectors # # Author: M.Frank # Date: 13/11/2014 # -#----------------------------------------------------------------------------------- +#-------------------------------------------------------------------------- # -#---Find ROOT----------------------------------------------------------------------- +#---Find ROOT-------------------------------------------------------------- find_package( ROOT REQUIRED COMPONENTS Geom ) -#---Find and configure DD4hep basics------------------------------------------------ +#---Find and configure DD4hep basics--------------------------------------- include(DD4hep) -#---Find and configure Xerces------------------------------------------------------- +#---Find and configure Xerces---------------------------------------------- include(DD4hep_XML_setup) # -#---Includedirs--------------------------------------------------------------------- +#---Includedirs------------------------------------------------------------ include_directories(${CMAKE_SOURCE_DIR}/DDCore/include ${CMAKE_SOURCE_DIR}/DDRec/include ${CMAKE_SOURCE_DIR}/DDSurfaces/include ${CMAKE_SOURCE_DIR}/DDSegmentation/include ${ROOT_INCLUDE_DIR} ) -#---Add Library--------------------------------------------------------------------- +#---Add Library------------------------------------------------------------ file(GLOB sources src/*.cpp ) add_dd4hep_plugin( DDDetectors SHARED ${sources}) @@ -28,7 +39,7 @@ SET_TARGET_PROPERTIES(DDDetectors PROPERTIES VERSION ${DD4hep_VERSION} SOVERSION # -#--- install target----------------------------------------------------------------- +#--- install target-------------------------------------------------------- install( TARGETS DDDetectors LIBRARY DESTINATION lib ) install( DIRECTORY compact @@ -36,4 +47,4 @@ install( DIRECTORY compact PATTERN ".svn" EXCLUDE ) # to do: add corresponding uninstall... -#----------------------------------------------------------------------------------- +#-------------------------------------------------------------------------- diff --git a/DDDetectors/src/BoxSegment_geo.cpp b/DDDetectors/src/BoxSegment_geo.cpp index 305f4d4eeb467e6d84dd690692e866fcbdfd72ec..78dad4e246ad4ad894d92c218b958883571f8863 100644 --- a/DDDetectors/src/BoxSegment_geo.cpp +++ b/DDDetectors/src/BoxSegment_geo.cpp @@ -1,11 +1,20 @@ -// $Id: BoxDetector_geo.cpp 633 2013-06-21 13:50:50Z markus.frank $ -//==================================================================== +// $Id: run_plugin.h 1663 2015-03-20 13:54:53Z gaede $ +//========================================================================== // AIDA Detector description implementation for LCD -//-------------------------------------------------------------------- +//-------------------------------------------------------------------------- +// Copyright (C) Organisation europ茅enne pour la Recherche nucl茅aire (CERN) +// All rights reserved. // -// Author : M.Frank +// For the licensing terms see $DD4hepINSTALL/LICENSE. +// For the list of contributors see $DD4hepINSTALL/doc/CREDITS. // -//==================================================================== +// Author : M.Frank +// +//========================================================================== +// +// Specialized generic detector constructor +// +//========================================================================== #include "DD4hep/DetFactoryHelper.h" using namespace std; diff --git a/DDDetectors/src/CylindricalBarrelCalorimeter_geo.cpp b/DDDetectors/src/CylindricalBarrelCalorimeter_geo.cpp index d5faddfc3505fd90494ed115db171fc57ddf5d94..2f89637fb15079dd17b3b278b41a17b9c5118231 100644 --- a/DDDetectors/src/CylindricalBarrelCalorimeter_geo.cpp +++ b/DDDetectors/src/CylindricalBarrelCalorimeter_geo.cpp @@ -1,11 +1,20 @@ -// $Id: CylindricalBarrelCalorimeter_geo.cpp 1306 2014-08-22 12:29:38Z markus.frank@cern.ch $ -//==================================================================== +// $Id: run_plugin.h 1663 2015-03-20 13:54:53Z gaede $ +//========================================================================== // AIDA Detector description implementation for LCD -//-------------------------------------------------------------------- +//-------------------------------------------------------------------------- +// Copyright (C) Organisation europ茅enne pour la Recherche nucl茅aire (CERN) +// All rights reserved. // -// Author : M.Frank +// For the licensing terms see $DD4hepINSTALL/LICENSE. +// For the list of contributors see $DD4hepINSTALL/doc/CREDITS. // -//==================================================================== +// Author : M.Frank +// +//========================================================================== +// +// Specialized generic detector constructor +// +//========================================================================== #include "DD4hep/DetFactoryHelper.h" using namespace std; @@ -34,21 +43,21 @@ static Ref_t create_detector(LCDD& lcdd, xml_h e, SensitiveDetector sens) { Volume layer_vol(layer_name,layer_tub,air); for(xml_coll_t l(x_layer,_U(slice)); l; ++l, ++m) { - xml_comp_t x_slice = l; - double router = r + x_slice.thickness(); - Material slice_mat = lcdd.material(x_slice.materialStr()); - string slice_name = layer_name + _toString(m,"slice%d"); - Tube slice_tube(r,router,z*2); - Volume slice_vol (slice_name,slice_tube,slice_mat); + xml_comp_t x_slice = l; + double router = r + x_slice.thickness(); + Material slice_mat = lcdd.material(x_slice.materialStr()); + string slice_name = layer_name + _toString(m,"slice%d"); + Tube slice_tube(r,router,z*2); + Volume slice_vol (slice_name,slice_tube,slice_mat); - if ( x_slice.isSensitive() ) { - sens.setType("calorimeter"); - slice_vol.setSensitiveDetector(sens); - } - r = router; - slice_vol.setAttributes(lcdd,x_slice.regionStr(),x_slice.limitsStr(),x_slice.visStr()); - // Instantiate physical volume - layer_vol.placeVolume(slice_vol); + if ( x_slice.isSensitive() ) { + sens.setType("calorimeter"); + slice_vol.setSensitiveDetector(sens); + } + r = router; + slice_vol.setAttributes(lcdd,x_slice.regionStr(),x_slice.limitsStr(),x_slice.visStr()); + // Instantiate physical volume + layer_vol.placeVolume(slice_vol); } layer_vol.setVisAttributes(lcdd,x_layer.visStr()); layer_tub.setDimensions(rlayer,r,z*2,0,2*M_PI); diff --git a/DDDetectors/src/CylindricalEndcapCalorimeter_geo.cpp b/DDDetectors/src/CylindricalEndcapCalorimeter_geo.cpp index 0387d11ddda7181dcb43c1d6010da7fe27d3c190..e6b9b23ecaa855173f0acaa8be79d3408d45b006 100644 --- a/DDDetectors/src/CylindricalEndcapCalorimeter_geo.cpp +++ b/DDDetectors/src/CylindricalEndcapCalorimeter_geo.cpp @@ -1,11 +1,20 @@ -// $Id: CylindricalEndcapCalorimeter_geo.cpp 1306 2014-08-22 12:29:38Z markus.frank@cern.ch $ -//==================================================================== +// $Id: run_plugin.h 1663 2015-03-20 13:54:53Z gaede $ +//========================================================================== // AIDA Detector description implementation for LCD -//-------------------------------------------------------------------- +//-------------------------------------------------------------------------- +// Copyright (C) Organisation europ茅enne pour la Recherche nucl茅aire (CERN) +// All rights reserved. // -// Author : M.Frank +// For the licensing terms see $DD4hepINSTALL/LICENSE. +// For the list of contributors see $DD4hepINSTALL/doc/CREDITS. // -//==================================================================== +// Author : M.Frank +// +//========================================================================== +// +// Specialized generic detector constructor +// +//========================================================================== #include "DD4hep/DetFactoryHelper.h" #include "XML/Layering.h" @@ -41,20 +50,20 @@ static Ref_t create_detector(LCDD& lcdd, xml_h e, SensitiveDetector sens) { Volume layer_vol(layer_name,Tube(rmin,rmax,layerWidth),air); for(xml_coll_t l(x_layer,_U(slice)); l; ++l, ++m) { - xml_comp_t x_slice = l; - double w = x_slice.thickness(); - string slice_name = layer_name + _toString(m+1,"slice%d"); - Material slice_mat = lcdd.material(x_slice.materialStr()); - Volume slice_vol (slice_name,Tube(rmin,rmax,w),slice_mat); + xml_comp_t x_slice = l; + double w = x_slice.thickness(); + string slice_name = layer_name + _toString(m+1,"slice%d"); + Material slice_mat = lcdd.material(x_slice.materialStr()); + Volume slice_vol (slice_name,Tube(rmin,rmax,w),slice_mat); - if ( x_slice.isSensitive() ) { - sens.setType("calorimeter"); - slice_vol.setSensitiveDetector(sens); - } - slice_vol.setAttributes(lcdd,x_slice.regionStr(),x_slice.limitsStr(),x_slice.visStr()); - pv = layer_vol.placeVolume(slice_vol,Position(0,0,z-zlayer-layerWidth/2+w/2)); - pv.addPhysVolID("slice",m+1); - z += w; + if ( x_slice.isSensitive() ) { + sens.setType("calorimeter"); + slice_vol.setSensitiveDetector(sens); + } + slice_vol.setAttributes(lcdd,x_slice.regionStr(),x_slice.limitsStr(),x_slice.visStr()); + pv = layer_vol.placeVolume(slice_vol,Position(0,0,z-zlayer-layerWidth/2+w/2)); + pv.addPhysVolID("slice",m+1); + z += w; } layer_vol.setVisAttributes(lcdd,x_layer.visStr()); diff --git a/DDDetectors/src/DiskTracker_geo.cpp b/DDDetectors/src/DiskTracker_geo.cpp index fe97527c6b01e14514264096a6b3e3b35663be11..6dbe6aed4e91338af72a92ae2680ad59b0e16e13 100644 --- a/DDDetectors/src/DiskTracker_geo.cpp +++ b/DDDetectors/src/DiskTracker_geo.cpp @@ -1,11 +1,20 @@ -// $Id: DiskTracker_geo.cpp 1306 2014-08-22 12:29:38Z markus.frank@cern.ch $ -//==================================================================== +// $Id: run_plugin.h 1663 2015-03-20 13:54:53Z gaede $ +//========================================================================== // AIDA Detector description implementation for LCD -//-------------------------------------------------------------------- +//-------------------------------------------------------------------------- +// Copyright (C) Organisation europ茅enne pour la Recherche nucl茅aire (CERN) +// All rights reserved. // -// Author : M.Frank +// For the licensing terms see $DD4hepINSTALL/LICENSE. +// For the list of contributors see $DD4hepINSTALL/doc/CREDITS. // -//==================================================================== +// Author : M.Frank +// +//========================================================================== +// +// Specialized generic detector constructor +// +//========================================================================== #include "DD4hep/DetFactoryHelper.h" using namespace std; diff --git a/DDDetectors/src/EcalBarrel_geo.cpp b/DDDetectors/src/EcalBarrel_geo.cpp index 45b88d4875632e8aed31b86978ea94a70739a55c..b2fb695f422d649f032b6fa2341d345df22454df 100644 --- a/DDDetectors/src/EcalBarrel_geo.cpp +++ b/DDDetectors/src/EcalBarrel_geo.cpp @@ -1,14 +1,22 @@ -// $Id: EcalBarrel_geo.cpp 1306 2014-08-22 12:29:38Z markus.frank@cern.ch $ -//==================================================================== +// $Id: run_plugin.h 1663 2015-03-20 13:54:53Z gaede $ +//========================================================================== // AIDA Detector description implementation for LCD -//-------------------------------------------------------------------- +//-------------------------------------------------------------------------- +// Copyright (C) Organisation europ茅enne pour la Recherche nucl茅aire (CERN) +// All rights reserved. // -// Author : M.Frank +// For the licensing terms see $DD4hepINSTALL/LICENSE. +// For the list of contributors see $DD4hepINSTALL/doc/CREDITS. // -//==================================================================== +// Author : M.Frank +// +//========================================================================== +// +// Specialized generic detector constructor +// +//========================================================================== #include "DD4hep/DetFactoryHelper.h" #include "XML/Layering.h" -#include "TGeoTrd2.h" using namespace std; using namespace DD4hep; @@ -53,10 +61,10 @@ static Ref_t create_detector(LCDD& lcdd, xml_h e, SensitiveDetector sens) { // Create the trapezoid for the stave. Trapezoid trd(trd_x1, // Outer side, i.e. the "short" X side. - trd_x2, // Inner side, i.e. the "long" X side. - trd_y1, // Corresponds to subdetector (or module) Z. - trd_y2, // - trd_z); // Thickness, in Y for top stave, when rotated. + trd_x2, // Inner side, i.e. the "long" X side. + trd_y1, // Corresponds to subdetector (or module) Z. + trd_y2, // + trd_z); // Thickness, in Y for top stave, when rotated. Volume mod_vol("stave",trd,air); @@ -78,30 +86,30 @@ static Ref_t create_detector(LCDD& lcdd, xml_h e, SensitiveDetector sens) { int repeat = x_layer.repeat(); // Loop over number of repeats for this layer. for (int j=0; j<repeat; j++) { - string l_name = _toString(l_num,"layer%d"); - double l_thickness = layering.layer(l_num-1)->thickness(); // Layer's thickness. - double xcut = (l_thickness / tan_beta); // X dimension for this layer. - l_dim_x -= xcut/2; - - Position l_pos(0,0,l_pos_z+l_thickness/2); // Position of the layer. - Box l_box(l_dim_x*2-tolerance,stave_z*2-tolerance,l_thickness-tolerance); - Volume l_vol(l_name,l_box,air); - DetElement layer(stave_det, l_name, det_id); - - // Loop over the sublayers or slices for this layer. - int s_num = 1; - double s_pos_z = -(l_thickness / 2); - for(xml_coll_t si(x_layer,_U(slice)); si; ++si) { - xml_comp_t x_slice = si; - string s_name = _toString(s_num,"slice%d"); - double s_thick = x_slice.thickness(); - Box s_box(l_dim_x*2-tolerance,stave_z*2-tolerance,s_thick-tolerance); - Volume s_vol(s_name,s_box,lcdd.material(x_slice.materialStr())); + string l_name = _toString(l_num,"layer%d"); + double l_thickness = layering.layer(l_num-1)->thickness(); // Layer's thickness. + double xcut = (l_thickness / tan_beta); // X dimension for this layer. + l_dim_x -= xcut/2; + + Position l_pos(0,0,l_pos_z+l_thickness/2); // Position of the layer. + Box l_box(l_dim_x*2-tolerance,stave_z*2-tolerance,l_thickness-tolerance); + Volume l_vol(l_name,l_box,air); + DetElement layer(stave_det, l_name, det_id); + + // Loop over the sublayers or slices for this layer. + int s_num = 1; + double s_pos_z = -(l_thickness / 2); + for(xml_coll_t si(x_layer,_U(slice)); si; ++si) { + xml_comp_t x_slice = si; + string s_name = _toString(s_num,"slice%d"); + double s_thick = x_slice.thickness(); + Box s_box(l_dim_x*2-tolerance,stave_z*2-tolerance,s_thick-tolerance); + Volume s_vol(s_name,s_box,lcdd.material(x_slice.materialStr())); DetElement slice(layer,s_name,det_id); if ( x_slice.isSensitive() ) { - s_vol.setSensitiveDetector(sens); - } + s_vol.setSensitiveDetector(sens); + } slice.setAttributes(lcdd,s_vol,x_slice.regionStr(),x_slice.limitsStr(),x_slice.visStr()); // Slice placement. diff --git a/DDDetectors/src/ForwardDetector_geo.cpp b/DDDetectors/src/ForwardDetector_geo.cpp index 91de3974a7e8beb7f6c9b5474bf2eb8098d6241f..c1ba5162aa8465a3730535e5ebc0bf1e3b9a8277 100644 --- a/DDDetectors/src/ForwardDetector_geo.cpp +++ b/DDDetectors/src/ForwardDetector_geo.cpp @@ -1,11 +1,20 @@ -// $Id: ForwardDetector_geo.cpp 1306 2014-08-22 12:29:38Z markus.frank@cern.ch $ -//==================================================================== +// $Id: run_plugin.h 1663 2015-03-20 13:54:53Z gaede $ +//========================================================================== // AIDA Detector description implementation for LCD -//-------------------------------------------------------------------- +//-------------------------------------------------------------------------- +// Copyright (C) Organisation europ茅enne pour la Recherche nucl茅aire (CERN) +// All rights reserved. // -// Author : M.Frank +// For the licensing terms see $DD4hepINSTALL/LICENSE. +// For the list of contributors see $DD4hepINSTALL/doc/CREDITS. // -//==================================================================== +// Author : M.Frank +// +//========================================================================== +// +// Specialized generic detector constructor +// +//========================================================================== #include "XML/Layering.h" #include "DD4hep/DetFactoryHelper.h" @@ -103,45 +112,45 @@ static Ref_t create_detector(LCDD& lcdd, xml_h e, SensitiveDetector sens) { double slicePosZ = -layerThickness / 2; double sliceDisplZ = 0; for(xml_coll_t l(x_layer,_U(slice)); l; ++l) { - xml_comp_t x_slice = l; - string slice_nam = _toString(sliceCount,"slice%d"); - /** Get slice parameters. */ - double sliceThickness = x_slice.thickness(); - Material slice_mat = lcdd.material(x_slice.materialStr()); - - // Go to mid of this slice. - sliceDisplZ += sliceThickness / 2; - slicePosZ += sliceThickness / 2; - - // Slice's basic tube. - Tube sliceTube(rmin,rmax,sliceThickness); - DetElement slice(layer,slice_nam,sdet.id()); - double sliceGlobalZ = zinner + (layerDisplZ - layerThickness / 2) + sliceDisplZ; - double slicePosX = std::tan(xangleHalf) * sliceGlobalZ; - - // First slice subtraction solid. - SubtractionSolid sliceSubtraction1(sliceTube,beamInTube,Transform3D(beamInRot,Position(slicePosX,0,0))); - // Second slice subtraction solid. - SubtractionSolid sliceSubtraction2(sliceSubtraction1,beamOutTube,Transform3D(beamOutRot,Position(-slicePosX,0,0))); - // Slice LV. - Volume sliceVol(det_name+"_"+layer_nam+"_"+slice_nam, sliceSubtraction2, slice_mat); - - if ( x_slice.isSensitive() ) { - sens.setType("calorimeter"); - sliceVol.setSensitiveDetector(sens); - } - // Set attributes of slice - slice.setAttributes(lcdd, sliceVol, x_slice.regionStr(), x_slice.limitsStr(), x_slice.visStr()); - - // Place volume in layer - PlacedVolume pv = layerVol.placeVolume(sliceVol,Position(0,0,slicePosZ)); - pv.addPhysVolID("slice",sliceCount); - slice.setPlacement(pv); - - // Start of next slice. - sliceDisplZ += sliceThickness / 2; - slicePosZ += sliceThickness / 2; - ++sliceCount; + xml_comp_t x_slice = l; + string slice_nam = _toString(sliceCount,"slice%d"); + /** Get slice parameters. */ + double sliceThickness = x_slice.thickness(); + Material slice_mat = lcdd.material(x_slice.materialStr()); + + // Go to mid of this slice. + sliceDisplZ += sliceThickness / 2; + slicePosZ += sliceThickness / 2; + + // Slice's basic tube. + Tube sliceTube(rmin,rmax,sliceThickness); + DetElement slice(layer,slice_nam,sdet.id()); + double sliceGlobalZ = zinner + (layerDisplZ - layerThickness / 2) + sliceDisplZ; + double slicePosX = std::tan(xangleHalf) * sliceGlobalZ; + + // First slice subtraction solid. + SubtractionSolid sliceSubtraction1(sliceTube,beamInTube,Transform3D(beamInRot,Position(slicePosX,0,0))); + // Second slice subtraction solid. + SubtractionSolid sliceSubtraction2(sliceSubtraction1,beamOutTube,Transform3D(beamOutRot,Position(-slicePosX,0,0))); + // Slice LV. + Volume sliceVol(det_name+"_"+layer_nam+"_"+slice_nam, sliceSubtraction2, slice_mat); + + if ( x_slice.isSensitive() ) { + sens.setType("calorimeter"); + sliceVol.setSensitiveDetector(sens); + } + // Set attributes of slice + slice.setAttributes(lcdd, sliceVol, x_slice.regionStr(), x_slice.limitsStr(), x_slice.visStr()); + + // Place volume in layer + PlacedVolume pv = layerVol.placeVolume(sliceVol,Position(0,0,slicePosZ)); + pv.addPhysVolID("slice",sliceCount); + slice.setPlacement(pv); + + // Start of next slice. + sliceDisplZ += sliceThickness / 2; + slicePosZ += sliceThickness / 2; + ++sliceCount; } // Set attributes of slice layer.setAttributes(lcdd, layerVol, x_layer.regionStr(), x_layer.limitsStr(), x_layer.visStr()); diff --git a/DDDetectors/src/LayeringExtensionPlugin.cpp b/DDDetectors/src/LayeringExtensionPlugin.cpp index d564117d9364132375b9d3c9ab30b84b92d77e80..23aa6f3ae88828764f938785f706c34850f4401e 100644 --- a/DDDetectors/src/LayeringExtensionPlugin.cpp +++ b/DDDetectors/src/LayeringExtensionPlugin.cpp @@ -1,11 +1,21 @@ -// $Id: SiTrackerBarrel_geo.cpp 1360 2014-10-27 16:32:06Z Nikiforos.Nikiforou@cern.ch $ -//==================================================================== +// $Id: run_plugin.h 1663 2015-03-20 13:54:53Z gaede $ +//========================================================================== // AIDA Detector description implementation for LCD -//-------------------------------------------------------------------- +//-------------------------------------------------------------------------- +// Copyright (C) Organisation europ茅enne pour la Recherche nucl茅aire (CERN) +// All rights reserved. // -// Author : M.Frank +// For the licensing terms see $DD4hepINSTALL/LICENSE. +// For the list of contributors see $DD4hepINSTALL/doc/CREDITS. // -//==================================================================== +// Author : M.Frank +// +//========================================================================== +// +// Specialized generic detector plugin +// +//========================================================================== + #include <map> #include "DDRec/Extensions/LayeringExtensionImpl.h" using namespace DD4hep::DDRec; @@ -21,11 +31,11 @@ namespace { LayeringExtensionImpl* e = new LayeringExtensionImpl(); det.addExtension<LayeringExtension>(e); for(std::map<int,DetElement>::const_iterator i=layers.begin(); i!=layers.end();++i) { - DetElement de = (*i).second; - e->setLayer(de.id(), de, Position(0,0,1)); - std::cout << " Add layer:" << de.name() - << " ID: " << de.id() - << " Parent:" << de.parent().name() << std::endl; + DetElement de = (*i).second; + e->setLayer(de.id(), de, Position(0,0,1)); + std::cout << " Add layer:" << de.name() + << " ID: " << de.id() + << " Parent:" << de.parent().name() << std::endl; } } }; diff --git a/DDDetectors/src/MultiLayerTracker_geo.cpp b/DDDetectors/src/MultiLayerTracker_geo.cpp index 5a8f502766b64da1c6d3a323c9ec0350270b99df..726ed1603309983b41cf179cef02317b38682c20 100644 --- a/DDDetectors/src/MultiLayerTracker_geo.cpp +++ b/DDDetectors/src/MultiLayerTracker_geo.cpp @@ -1,11 +1,20 @@ -// $Id: MultiLayerTracker_geo.cpp 1306 2014-08-22 12:29:38Z markus.frank@cern.ch $ -//==================================================================== +// $Id: run_plugin.h 1663 2015-03-20 13:54:53Z gaede $ +//========================================================================== // AIDA Detector description implementation for LCD -//-------------------------------------------------------------------- +//-------------------------------------------------------------------------- +// Copyright (C) Organisation europ茅enne pour la Recherche nucl茅aire (CERN) +// All rights reserved. // -// Author : M.Frank +// For the licensing terms see $DD4hepINSTALL/LICENSE. +// For the list of contributors see $DD4hepINSTALL/doc/CREDITS. // -//==================================================================== +// Author : M.Frank +// +//========================================================================== +// +// Specialized generic detector constructor +// +//========================================================================== #include "DD4hep/DetFactoryHelper.h" using namespace std; diff --git a/DDDetectors/src/PolyconeSupport_geo.cpp b/DDDetectors/src/PolyconeSupport_geo.cpp index 954323ab884b7ef9cb34a1c51eec93b81fc18d17..0e09b8fb938bf34f1214bb126dc368357c893964 100644 --- a/DDDetectors/src/PolyconeSupport_geo.cpp +++ b/DDDetectors/src/PolyconeSupport_geo.cpp @@ -1,11 +1,20 @@ -// $Id: PolyconeSupport_geo.cpp 1360 2014-10-27 16:32:06Z Nikiforos.Nikiforou@cern.ch $ -//==================================================================== +// $Id: run_plugin.h 1663 2015-03-20 13:54:53Z gaede $ +//========================================================================== // AIDA Detector description implementation for LCD -//-------------------------------------------------------------------- +//-------------------------------------------------------------------------- +// Copyright (C) Organisation europ茅enne pour la Recherche nucl茅aire (CERN) +// All rights reserved. // -// Author : M.Frank +// For the licensing terms see $DD4hepINSTALL/LICENSE. +// For the list of contributors see $DD4hepINSTALL/doc/CREDITS. // -//==================================================================== +// Author : M.Frank +// +//========================================================================== +// +// Specialized generic detector constructor +// +//========================================================================== #include "DD4hep/DetFactoryHelper.h" using namespace std; diff --git a/DDDetectors/src/PolyhedraBarrelCalorimeter2_geo.cpp b/DDDetectors/src/PolyhedraBarrelCalorimeter2_geo.cpp index 7c3390699a95c91a78899276e5c0330a9d60eb44..1a3c69a0dad53ee44368071cccd84edac6fbf158 100644 --- a/DDDetectors/src/PolyhedraBarrelCalorimeter2_geo.cpp +++ b/DDDetectors/src/PolyhedraBarrelCalorimeter2_geo.cpp @@ -1,11 +1,20 @@ -// $Id: PolyhedraBarrelCalorimeter2_geo.cpp 1390 2014-11-14 16:32:48Z Christian.Grefe@cern.ch $ -//==================================================================== +// $Id: run_plugin.h 1663 2015-03-20 13:54:53Z gaede $ +//========================================================================== // AIDA Detector description implementation for LCD -//-------------------------------------------------------------------- +//-------------------------------------------------------------------------- +// Copyright (C) Organisation europ茅enne pour la Recherche nucl茅aire (CERN) +// All rights reserved. // -// Author : M.Frank +// For the licensing terms see $DD4hepINSTALL/LICENSE. +// For the list of contributors see $DD4hepINSTALL/doc/CREDITS. // -//==================================================================== +// Author : M.Frank +// +//========================================================================== +// +// Specialized generic detector constructor +// +//========================================================================== #include "DD4hep/DetFactoryHelper.h" #include "XML/Layering.h" @@ -14,7 +23,7 @@ using namespace DD4hep; using namespace DD4hep::Geometry; static void placeStaves(DetElement& parent, DetElement& stave, double rmin, int numsides, double total_thickness, - Volume envelopeVolume, double innerAngle, Volume sectVolume) { + Volume envelopeVolume, double innerAngle, Volume sectVolume) { double innerRotation = innerAngle; double offsetRotation = -innerRotation / 2; double sectCenterRadius = rmin + total_thickness / 2; @@ -109,31 +118,31 @@ static Ref_t create_detector(LCDD& lcdd, xml_h e, SensitiveDetector sens) { double slice_pos_z = -(layer_thickness / 2); int slice_number = 1; for (xml_coll_t k(x_layer, _U(slice)); k; ++k) { - xml_comp_t x_slice = k; - string slice_name = _toString(slice_number, "slice%d"); - double slice_thickness = x_slice.thickness(); - Material slice_material = lcdd.material(x_slice.materialStr()); - DetElement slice(layer, slice_name, slice_number); - - slice_pos_z += slice_thickness / 2; - // Slice volume & box - Volume slice_vol(slice_name, Box(layer_dim_x, detZ / 2, slice_thickness / 2), slice_material); - - if (x_slice.isSensitive()) { - sens.setType("calorimeter"); - slice_vol.setSensitiveDetector(sens); - } - // Set region, limitset, and vis. - slice_vol.setAttributes(lcdd, x_slice.regionStr(), x_slice.limitsStr(), x_slice.visStr()); - // slice PlacedVolume - PlacedVolume slice_phv = layer_vol.placeVolume(slice_vol, Position(0, 0, slice_pos_z)); - slice_phv.addPhysVolID("slice", slice_number); - - slice.setPlacement(slice_phv); - // Increment Z position for next slice. - slice_pos_z += slice_thickness / 2; - // Increment slice number. - ++slice_number; + xml_comp_t x_slice = k; + string slice_name = _toString(slice_number, "slice%d"); + double slice_thickness = x_slice.thickness(); + Material slice_material = lcdd.material(x_slice.materialStr()); + DetElement slice(layer, slice_name, slice_number); + + slice_pos_z += slice_thickness / 2; + // Slice volume & box + Volume slice_vol(slice_name, Box(layer_dim_x, detZ / 2, slice_thickness / 2), slice_material); + + if (x_slice.isSensitive()) { + sens.setType("calorimeter"); + slice_vol.setSensitiveDetector(sens); + } + // Set region, limitset, and vis. + slice_vol.setAttributes(lcdd, x_slice.regionStr(), x_slice.limitsStr(), x_slice.visStr()); + // slice PlacedVolume + PlacedVolume slice_phv = layer_vol.placeVolume(slice_vol, Position(0, 0, slice_pos_z)); + slice_phv.addPhysVolID("slice", slice_number); + + slice.setPlacement(slice_phv); + // Increment Z position for next slice. + slice_pos_z += slice_thickness / 2; + // Increment slice number. + ++slice_number; } // Set region, limitset, and vis. layer_vol.setAttributes(lcdd, x_layer.regionStr(), x_layer.limitsStr(), x_layer.visStr()); diff --git a/DDDetectors/src/PolyhedraEndcapCalorimeter2_geo.cpp b/DDDetectors/src/PolyhedraEndcapCalorimeter2_geo.cpp index 5c60bcdf200395d8bfb7969b6146e0fcbf40bea1..814a6e4e4ef8017210ffcc5d420bef7cc62251db 100644 --- a/DDDetectors/src/PolyhedraEndcapCalorimeter2_geo.cpp +++ b/DDDetectors/src/PolyhedraEndcapCalorimeter2_geo.cpp @@ -1,11 +1,20 @@ -// $Id: PolyhedraEndcapCalorimeter2_geo.cpp 1306 2014-08-22 12:29:38Z markus.frank@cern.ch $ -//==================================================================== +// $Id: run_plugin.h 1663 2015-03-20 13:54:53Z gaede $ +//========================================================================== // AIDA Detector description implementation for LCD -//-------------------------------------------------------------------- +//-------------------------------------------------------------------------- +// Copyright (C) Organisation europ茅enne pour la Recherche nucl茅aire (CERN) +// All rights reserved. // -// Author : M.Frank +// For the licensing terms see $DD4hepINSTALL/LICENSE. +// For the list of contributors see $DD4hepINSTALL/doc/CREDITS. // -//==================================================================== +// Author : M.Frank +// +//========================================================================== +// +// Specialized generic detector constructor +// +//========================================================================== #include "DD4hep/DetFactoryHelper.h" #include "XML/Layering.h" diff --git a/DDDetectors/src/PolyhedraEndcapCalorimeter2_surfaces.cpp b/DDDetectors/src/PolyhedraEndcapCalorimeter2_surfaces.cpp index 9318d3a9d3de64b931fc2be1e7973a016562f026..ff10f05186d51d33212e45229452bb19243516dc 100644 --- a/DDDetectors/src/PolyhedraEndcapCalorimeter2_surfaces.cpp +++ b/DDDetectors/src/PolyhedraEndcapCalorimeter2_surfaces.cpp @@ -1,11 +1,20 @@ -// $Id: $ -//==================================================================== +// $Id: run_plugin.h 1663 2015-03-20 13:54:53Z gaede $ +//========================================================================== // AIDA Detector description implementation for LCD -//-------------------------------------------------------------------- +//-------------------------------------------------------------------------- +// Copyright (C) Organisation europ茅enne pour la Recherche nucl茅aire (CERN) +// All rights reserved. // -// Author : M.Frank +// For the licensing terms see $DD4hepINSTALL/LICENSE. +// For the list of contributors see $DD4hepINSTALL/doc/CREDITS. // -//==================================================================== +// Author : M.Frank +// +//========================================================================== +// +// Specialized generic detector constructor +// +//========================================================================== // Framework include files #define DD4HEP_USE_SURFACEINSTALL_HELPER DD4hep_PolyhedraEndcapCalorimeterSurfacePlugin #include "DD4hep/SurfaceInstaller.h" @@ -35,11 +44,11 @@ void Installer<UserData>::install(DetElement component, PlacedVolume pv) { std::cout << " Module: " << mod_shape.toString() << std::endl; std::cout << " Component: " << comp_shape.toString() << std::endl; std::cout << "dz:" << dz << " Si-pos:" << si_position - << " Mod-thickness:" << half_mod_thickness - << " Comp-thickness:" << half_comp_thickness - << std::endl; + << " Mod-thickness:" << half_mod_thickness + << " Comp-thickness:" << half_comp_thickness + << std::endl; VolPlane surf(comp_vol,Type(Type::Sensitive,Type::Measurement1D), - inner_thickness, outer_thickness, u, v, n, o); + inner_thickness, outer_thickness, u, v, n, o); addSurface(component,surf); } } diff --git a/DDDetectors/src/SiTrackerBarrel_geo.cpp b/DDDetectors/src/SiTrackerBarrel_geo.cpp index dceead3356f4eb7f0b8deae33c2c9d3fb953fa2f..3dd201e260429c6c3fd81b662a7acc0bc41b936b 100644 --- a/DDDetectors/src/SiTrackerBarrel_geo.cpp +++ b/DDDetectors/src/SiTrackerBarrel_geo.cpp @@ -1,11 +1,20 @@ -// $Id: SiTrackerBarrel_geo.cpp 1360 2014-10-27 16:32:06Z Nikiforos.Nikiforou@cern.ch $ -//==================================================================== +// $Id: run_plugin.h 1663 2015-03-20 13:54:53Z gaede $ +//========================================================================== // AIDA Detector description implementation for LCD -//-------------------------------------------------------------------- +//-------------------------------------------------------------------------- +// Copyright (C) Organisation europ茅enne pour la Recherche nucl茅aire (CERN) +// All rights reserved. // -// Author : M.Frank +// For the licensing terms see $DD4hepINSTALL/LICENSE. +// For the list of contributors see $DD4hepINSTALL/doc/CREDITS. // -//==================================================================== +// Author : M.Frank +// +//========================================================================== +// +// Specialized generic detector constructor +// +//========================================================================== #include "DD4hep/DetFactoryHelper.h" #include "DD4hep/Printout.h" @@ -67,7 +76,7 @@ static Ref_t create_detector(LCDD& lcdd, xml_h e, SensitiveDetector sens) { if ( x_comp.isSensitive() ) { pv.addPhysVolID(_U(sensor),sensor_number++); c_vol.setSensitiveDetector(sens); - sensitives[m_nam].push_back(pv); + sensitives[m_nam].push_back(pv); } } } @@ -112,8 +121,8 @@ static Ref_t create_detector(LCDD& lcdd, xml_h e, SensitiveDetector sens) { // Loop over the number of modules in z. for (int j = 0; j < nz; j++) { - string module_name = _toString(module,"module%d"); - DetElement mod_elt(lay_elt,module_name,module); + string module_name = _toString(module,"module%d"); + DetElement mod_elt(lay_elt,module_name,module); // Module PhysicalVolume. // Transform3D tr(RotationZYX(0,-((M_PI/2)-phic-phi_tilt),M_PI/2),Position(x,y,module_z)); //NOTE (Nikiforos, 26/08 Rotations needed to be fixed so that component1 (silicon) is on the outside @@ -121,15 +130,15 @@ static Ref_t create_detector(LCDD& lcdd, xml_h e, SensitiveDetector sens) { pv = lay_vol.placeVolume(m_env,tr); pv.addPhysVolID("module", module); - mod_elt.setPlacement(pv); - for(size_t ic=0; ic<sensVols.size(); ++ic) { - PlacedVolume sens_pv = sensVols[ic]; - DetElement comp_elt(mod_elt,sens_pv.volume().name(),module); - comp_elt.setPlacement(sens_pv); - } + mod_elt.setPlacement(pv); + for(size_t ic=0; ic<sensVols.size(); ++ic) { + PlacedVolume sens_pv = sensVols[ic]; + DetElement comp_elt(mod_elt,sens_pv.volume().name(),module); + comp_elt.setPlacement(sens_pv); + } - /// Increase counters etc. - module++; + /// Increase counters etc. + module++; // Adjust the x and y coordinates of the module. x += dx; y += dy; diff --git a/DDDetectors/src/SiTrackerBarrel_surfaces.cpp b/DDDetectors/src/SiTrackerBarrel_surfaces.cpp index 2d597708ae047432bc96a1b2e50d27f09642a68f..59d599aaadec824b65ebff2c3c49b2a12a218821 100644 --- a/DDDetectors/src/SiTrackerBarrel_surfaces.cpp +++ b/DDDetectors/src/SiTrackerBarrel_surfaces.cpp @@ -1,18 +1,28 @@ -// $Id: SiTrackerBarrel_geo.cpp 1360 2014-10-27 16:32:06Z Nikiforos.Nikiforou@cern.ch $ -//==================================================================== +// $Id: run_plugin.h 1663 2015-03-20 13:54:53Z gaede $ +//========================================================================== // AIDA Detector description implementation for LCD -//-------------------------------------------------------------------- +//-------------------------------------------------------------------------- +// Copyright (C) Organisation europ茅enne pour la Recherche nucl茅aire (CERN) +// All rights reserved. // -// Author : M.Frank +// For the licensing terms see $DD4hepINSTALL/LICENSE. +// For the list of contributors see $DD4hepINSTALL/doc/CREDITS. // -//==================================================================== -// Framework include files +// Author : M.Frank +// +//========================================================================== +// +// Specialized generic detector constructor +// +//========================================================================== + namespace { struct UserData { int dimension ; }; } +// Framework include files #define SURFACEINSTALLER_DATA UserData #define DD4HEP_USE_SURFACEINSTALL_HELPER DD4hep_SiTrackerBarrelSurfacePlugin #include "DD4hep/SurfaceInstaller.h" @@ -23,11 +33,11 @@ namespace{ double value = -1; char* ptr = ::strchr(argv[i],'='); if ( ptr ) { - std::string name( argv[i] , ptr ) ; - value = DD4hep::Geometry::_toDouble(++ptr); - if( name=="dimension" ) data.dimension = value ; - std::cout << "DD4hep_SiTrackerBarrelSurfacePlugin: argument[" << i << "] = " << name - << " = " << value << std::endl; + std::string name( argv[i] , ptr ) ; + value = DD4hep::Geometry::_toDouble(++ptr); + if( name=="dimension" ) data.dimension = value ; + std::cout << "DD4hep_SiTrackerBarrelSurfacePlugin: argument[" << i << "] = " << name + << " = " << value << std::endl; } } } @@ -41,27 +51,28 @@ namespace{ DD4hep::Geometry::Box mod_shape(mod_vol.solid()), comp_shape(comp_vol.solid()); if ( !comp_shape.isValid() || !mod_shape.isValid() ) { - invalidInstaller("Components and/or modules are not boxes -- invalid shapes"); + invalidInstaller("Components and/or modules are not boxes -- invalid shapes"); } else if ( !handleUsingCache(component,comp_vol) ) { - const double* trans = placementTranslation(component); - double half_module_thickness = mod_shape->GetDZ(); - double sensitive_z_position = trans[2]; - double outer_thickness = half_module_thickness + sensitive_z_position; - double inner_thickness = half_module_thickness - sensitive_z_position; - //Surface is placed at the center of the volume, no need to shift origin - //Make sure u,v,n form a right-handed coordinate system, v along the final z - Vector3D u(-1.,0.,0.), v(0.,-1.,0.), n(0.,0.,1.), o(0.,0.,0.); + const double* trans = placementTranslation(component); + double half_module_thickness = mod_shape->GetDZ(); + double sensitive_z_position = trans[2]; + double outer_thickness = half_module_thickness + sensitive_z_position; + double inner_thickness = half_module_thickness - sensitive_z_position; + //Surface is placed at the center of the volume, no need to shift origin + //Make sure u,v,n form a right-handed coordinate system, v along the final z + Vector3D u(-1.,0.,0.), v(0.,-1.,0.), n(0.,0.,1.), o(0.,0.,0.); - Type type( Type::Sensitive ) ; + Type type( Type::Sensitive ) ; - if( data.dimension == 1 ) { - type.setProperty( Type::Measurement1D , true ) ; - } else if( data.dimension != 2 ) { - throw std::runtime_error("**** DD4hep_SiTrackerBarrelSurfacePlugin: no or wrong 'dimension' argument given - has to be 1 or 2") ; - } - VolPlane surf(comp_vol, type, inner_thickness, outer_thickness, u, v, n, o); - addSurface(component,surf); + if( data.dimension == 1 ) { + type.setProperty( Type::Measurement1D , true ) ; + } else if( data.dimension != 2 ) { + throw std::runtime_error("**** DD4hep_SiTrackerBarrelSurfacePlugin: no or wrong " + "'dimension' argument given - has to be 1 or 2") ; + } + VolPlane surf(comp_vol, type, inner_thickness, outer_thickness, u, v, n, o); + addSurface(component,surf); } } } diff --git a/DDDetectors/src/SiTrackerEndcap2_geo.cpp b/DDDetectors/src/SiTrackerEndcap2_geo.cpp index 68ced8f8251ca566105ce76992b3295b0e7efe85..b393147fed24b9c3898736ff220a9fd41e8716d0 100644 --- a/DDDetectors/src/SiTrackerEndcap2_geo.cpp +++ b/DDDetectors/src/SiTrackerEndcap2_geo.cpp @@ -1,12 +1,20 @@ -// $Id: SiTrackerEndcap2_geo.cpp 1306 2014-08-22 12:29:38Z markus.frank@cern.ch $ -//==================================================================== +// $Id: run_plugin.h 1663 2015-03-20 13:54:53Z gaede $ +//========================================================================== // AIDA Detector description implementation for LCD -//-------------------------------------------------------------------- +//-------------------------------------------------------------------------- +// Copyright (C) Organisation europ茅enne pour la Recherche nucl茅aire (CERN) +// All rights reserved. // -// Author : M.Frank +// For the licensing terms see $DD4hepINSTALL/LICENSE. +// For the list of contributors see $DD4hepINSTALL/doc/CREDITS. // -//==================================================================== - +// Author : M.Frank +// +//========================================================================== +// +// Specialized generic detector constructor +// +//========================================================================== #include "DD4hep/DetFactoryHelper.h" #include <map> @@ -60,11 +68,11 @@ static Ref_t create_detector(LCDD& lcdd, xml_h e, SensitiveDetector sens) { c_vol.setVisAttributes(lcdd.visAttributes(c.visStr())); pv = m_volume.placeVolume(c_vol,Position(0,posY+c_thick/2,0)); if ( c.isSensitive() ) { - sdet.check(n_sensor > 2,"SiTrackerEndcap2::fromCompact: "+c_name+" Max of 2 modules allowed!"); - pv.addPhysVolID("sensor",n_sensor); - c_vol.setSensitiveDetector(sens); - sensitives[m_nam].push_back(pv); - ++n_sensor; + sdet.check(n_sensor > 2,"SiTrackerEndcap2::fromCompact: "+c_name+" Max of 2 modules allowed!"); + pv.addPhysVolID("sensor",n_sensor); + c_vol.setSensitiveDetector(sens); + sensitives[m_nam].push_back(pv); + ++n_sensor; } posY += c_thick; } @@ -89,33 +97,33 @@ static Ref_t create_detector(LCDD& lcdd, xml_h e, SensitiveDetector sens) { Placements& sensVols = sensitives[m_nam]; for(int k=0; k<nmodules; ++k) { - string m_base = _toString(l_id,"layer%d") + _toString(mod_num,"_module%d"); - double x = -r*std::cos(phi); - double y = -r*std::sin(phi); - DetElement module(sdet,m_base+"_pos",det_id); - pv = assembly.placeVolume(m_vol,Transform3D(RotationZYX(0,-M_PI/2-phi,-M_PI/2),Position(x,y,zstart+dz))); - pv.addPhysVolID("barrel",1).addPhysVolID("layer", l_id).addPhysVolID("module",mod_num); - module.setPlacement(pv); - for(size_t ic=0; ic<sensVols.size(); ++ic) { - PlacedVolume sens_pv = sensVols[ic]; - DetElement comp_elt(module,sens_pv.volume().name(),mod_num); - comp_elt.setPlacement(sens_pv); - } + string m_base = _toString(l_id,"layer%d") + _toString(mod_num,"_module%d"); + double x = -r*std::cos(phi); + double y = -r*std::sin(phi); + DetElement module(sdet,m_base+"_pos",det_id); + pv = assembly.placeVolume(m_vol,Transform3D(RotationZYX(0,-M_PI/2-phi,-M_PI/2),Position(x,y,zstart+dz))); + pv.addPhysVolID("barrel",1).addPhysVolID("layer", l_id).addPhysVolID("module",mod_num); + module.setPlacement(pv); + for(size_t ic=0; ic<sensVols.size(); ++ic) { + PlacedVolume sens_pv = sensVols[ic]; + DetElement comp_elt(module,sens_pv.volume().name(),mod_num); + comp_elt.setPlacement(sens_pv); + } - if ( reflect ) { - pv = assembly.placeVolume(m_vol,Transform3D(RotationZYX(M_PI,-M_PI/2-phi,-M_PI/2),Position(x,y,-zstart-dz))); - pv.addPhysVolID("barrel",2).addPhysVolID("layer",l_id).addPhysVolID("module",mod_num); - DetElement r_module(sdet,m_base+"_neg",det_id); - r_module.setPlacement(pv); - for(size_t ic=0; ic<sensVols.size(); ++ic) { - PlacedVolume sens_pv = sensVols[ic]; - DetElement comp_elt(r_module,sens_pv.volume().name(),mod_num); - comp_elt.setPlacement(sens_pv); - } - } - dz = -dz; - phi += iphi; - ++mod_num; + if ( reflect ) { + pv = assembly.placeVolume(m_vol,Transform3D(RotationZYX(M_PI,-M_PI/2-phi,-M_PI/2),Position(x,y,-zstart-dz))); + pv.addPhysVolID("barrel",2).addPhysVolID("layer",l_id).addPhysVolID("module",mod_num); + DetElement r_module(sdet,m_base+"_neg",det_id); + r_module.setPlacement(pv); + for(size_t ic=0; ic<sensVols.size(); ++ic) { + PlacedVolume sens_pv = sensVols[ic]; + DetElement comp_elt(r_module,sens_pv.volume().name(),mod_num); + comp_elt.setPlacement(sens_pv); + } + } + dz = -dz; + phi += iphi; + ++mod_num; } } } diff --git a/DDDetectors/src/SiTrackerEndcap_surfaces.cpp b/DDDetectors/src/SiTrackerEndcap_surfaces.cpp index bcd52d2c875745c28bec3e16820c4c4e4e03c318..54dab20f1f475f41e496504586ba6cac943fdca2 100644 --- a/DDDetectors/src/SiTrackerEndcap_surfaces.cpp +++ b/DDDetectors/src/SiTrackerEndcap_surfaces.cpp @@ -1,11 +1,20 @@ -// $Id: $ -//==================================================================== +// $Id: run_plugin.h 1663 2015-03-20 13:54:53Z gaede $ +//========================================================================== // AIDA Detector description implementation for LCD -//-------------------------------------------------------------------- +//-------------------------------------------------------------------------- +// Copyright (C) Organisation europ茅enne pour la Recherche nucl茅aire (CERN) +// All rights reserved. // -// Author : M.Frank +// For the licensing terms see $DD4hepINSTALL/LICENSE. +// For the list of contributors see $DD4hepINSTALL/doc/CREDITS. // -//==================================================================== +// Author : M.Frank +// +//========================================================================== +// +// Specialized generic detector constructor +// +//========================================================================== // Framework include files #define DD4HEP_USE_SURFACEINSTALL_HELPER DD4hep_SiTrackerEndcapSurfacePlugin #include "DD4hep/SurfaceInstaller.h" @@ -31,7 +40,7 @@ void Installer<UserData>::install(DetElement component, PlacedVolume pv) { Vector3D u(0.,0.,-1.), v(-1.,0.,0.), n(0.,-1.,0.), o(0.,0.,0.); VolPlane surf(comp_vol,Type(Type::Sensitive,Type::Measurement1D), - inner_thickness, outer_thickness, u, v, n, o); + inner_thickness, outer_thickness, u, v, n, o); addSurface(component,surf); } } diff --git a/DDDetectors/src/SubdetectorAssembly_geo.cpp b/DDDetectors/src/SubdetectorAssembly_geo.cpp index a459a9ecf1194304bb7a0fc3377d9d5f57604e79..594dd7e859c8ceb85dec8a0f26c9e199dac47856 100644 --- a/DDDetectors/src/SubdetectorAssembly_geo.cpp +++ b/DDDetectors/src/SubdetectorAssembly_geo.cpp @@ -1,11 +1,20 @@ -// $Id: SubdetectorAssembly_geo.cpp 1306 2014-08-22 12:29:38Z markus.frank@cern.ch $ -//==================================================================== +// $Id: run_plugin.h 1663 2015-03-20 13:54:53Z gaede $ +//========================================================================== // AIDA Detector description implementation for LCD -//-------------------------------------------------------------------- +//-------------------------------------------------------------------------- +// Copyright (C) Organisation europ茅enne pour la Recherche nucl茅aire (CERN) +// All rights reserved. // -// Author : M.Frank +// For the licensing terms see $DD4hepINSTALL/LICENSE. +// For the list of contributors see $DD4hepINSTALL/doc/CREDITS. // -//==================================================================== +// Author : M.Frank +// +//========================================================================== +// +// Specialized generic detector constructor +// +//========================================================================== #include "DD4hep/DetFactoryHelper.h" #include "DD4hep/Printout.h" #include "XML/Utilities.h" diff --git a/DDDetectors/src/SubdetectorExtensionPlugin.cpp b/DDDetectors/src/SubdetectorExtensionPlugin.cpp index 4e904a4cb23d0e568fee6269aff439da855fbd05..316c32d40599fea58c52cff5765741faa49208dd 100644 --- a/DDDetectors/src/SubdetectorExtensionPlugin.cpp +++ b/DDDetectors/src/SubdetectorExtensionPlugin.cpp @@ -1,11 +1,20 @@ -// $Id: SiTrackerBarrel_geo.cpp 1360 2014-10-27 16:32:06Z Nikiforos.Nikiforou@cern.ch $ -//==================================================================== +// $Id: run_plugin.h 1663 2015-03-20 13:54:53Z gaede $ +//========================================================================== // AIDA Detector description implementation for LCD -//-------------------------------------------------------------------- +//-------------------------------------------------------------------------- +// Copyright (C) Organisation europ茅enne pour la Recherche nucl茅aire (CERN) +// All rights reserved. // -// Author : M.Frank +// For the licensing terms see $DD4hepINSTALL/LICENSE. +// For the list of contributors see $DD4hepINSTALL/doc/CREDITS. // -//==================================================================== +// Author : M.Frank +// +//========================================================================== +// +// Specialized generic detector plugin +// +//========================================================================== // Framework include files #include "DDRec/Extensions/SubdetectorExtensionImpl.h" #define DD4HEP_USE_SURFACEINSTALL_HELPER SubdetectorExtensionPlugin diff --git a/DDDetectors/src/SurfaceExamplePlugin.cpp b/DDDetectors/src/SurfaceExamplePlugin.cpp index 4b3faefc3a446d317a0e977c658bb184ee8373cc..45561c5f1d784ca516099a819742f03e64a695d8 100644 --- a/DDDetectors/src/SurfaceExamplePlugin.cpp +++ b/DDDetectors/src/SurfaceExamplePlugin.cpp @@ -1,11 +1,20 @@ -// $Id: SiTrackerBarrel_geo.cpp 1360 2014-10-27 16:32:06Z Nikiforos.Nikiforou@cern.ch $ -//==================================================================== +// $Id: run_plugin.h 1663 2015-03-20 13:54:53Z gaede $ +//========================================================================== // AIDA Detector description implementation for LCD -//-------------------------------------------------------------------- +//-------------------------------------------------------------------------- +// Copyright (C) Organisation europ茅enne pour la Recherche nucl茅aire (CERN) +// All rights reserved. // -// Author : M.Frank +// For the licensing terms see $DD4hepINSTALL/LICENSE. +// For the list of contributors see $DD4hepINSTALL/doc/CREDITS. // -//==================================================================== +// Author : M.Frank +// +//========================================================================== +// +// Specialized generic detector plugin +// +//========================================================================== // Framework include files namespace { struct UserData { int a,b,c; }; } #define SURFACEINSTALLER_DATA UserData @@ -18,10 +27,10 @@ namespace { double value = -1; char* ptr = ::strchr(argv[i],'='); if ( ptr ) { - value = DD4hep::Geometry::_toDouble(++ptr); + value = DD4hep::Geometry::_toDouble(++ptr); } std::cout << "SurfaceExamplePlugin: argument[" << i << "] = " << argv[i] - << " value = " << value << std::endl; + << " value = " << value << std::endl; } } diff --git a/DDDetectors/src/TubeSegment_geo.cpp b/DDDetectors/src/TubeSegment_geo.cpp index 9d31f211bd60b2830d30a8fe312b200d3f178ba5..3bba3b0ab79d64edf4a08f7eb4a69fbcc537f0f7 100644 --- a/DDDetectors/src/TubeSegment_geo.cpp +++ b/DDDetectors/src/TubeSegment_geo.cpp @@ -1,11 +1,20 @@ -// $Id: TubeSegment_geo.cpp 1306 2014-08-22 12:29:38Z markus.frank@cern.ch $ -//==================================================================== +// $Id: run_plugin.h 1663 2015-03-20 13:54:53Z gaede $ +//========================================================================== // AIDA Detector description implementation for LCD -//-------------------------------------------------------------------- +//-------------------------------------------------------------------------- +// Copyright (C) Organisation europ茅enne pour la Recherche nucl茅aire (CERN) +// All rights reserved. // -// Author : M.Frank +// For the licensing terms see $DD4hepINSTALL/LICENSE. +// For the list of contributors see $DD4hepINSTALL/doc/CREDITS. // -//==================================================================== +// Author : M.Frank +// +//========================================================================== +// +// Specialized generic detector constructor +// +//========================================================================== #include "DD4hep/DetFactoryHelper.h" using namespace std;