From a2d2dcd0042fafaebb3b1ec516d970ca4e60822e Mon Sep 17 00:00:00 2001
From: Markus Frank <markus.frank@cern.ch>
Date: Sun, 12 Jul 2015 00:30:03 +0000
Subject: [PATCH] Be careful when updating. Read release.notes and this time
REALLY MAKE A BACKUP
---
DDDetectors/CMakeLists.txt | 29 ++++--
DDDetectors/src/BoxSegment_geo.cpp | 19 +++-
.../src/CylindricalBarrelCalorimeter_geo.cpp | 47 +++++----
.../src/CylindricalEndcapCalorimeter_geo.cpp | 45 +++++----
DDDetectors/src/DiskTracker_geo.cpp | 19 +++-
DDDetectors/src/EcalBarrel_geo.cpp | 70 +++++++------
DDDetectors/src/ForwardDetector_geo.cpp | 97 ++++++++++---------
DDDetectors/src/LayeringExtensionPlugin.cpp | 30 ++++--
DDDetectors/src/MultiLayerTracker_geo.cpp | 19 +++-
DDDetectors/src/PolyconeSupport_geo.cpp | 19 +++-
.../src/PolyhedraBarrelCalorimeter2_geo.cpp | 71 ++++++++------
.../src/PolyhedraEndcapCalorimeter2_geo.cpp | 19 +++-
.../PolyhedraEndcapCalorimeter2_surfaces.cpp | 27 ++++--
DDDetectors/src/SiTrackerBarrel_geo.cpp | 41 +++++---
DDDetectors/src/SiTrackerBarrel_surfaces.cpp | 67 +++++++------
DDDetectors/src/SiTrackerEndcap2_geo.cpp | 82 +++++++++-------
DDDetectors/src/SiTrackerEndcap_surfaces.cpp | 21 ++--
DDDetectors/src/SubdetectorAssembly_geo.cpp | 19 +++-
.../src/SubdetectorExtensionPlugin.cpp | 19 +++-
DDDetectors/src/SurfaceExamplePlugin.cpp | 23 +++--
DDDetectors/src/TubeSegment_geo.cpp | 19 +++-
21 files changed, 497 insertions(+), 305 deletions(-)
diff --git a/DDDetectors/CMakeLists.txt b/DDDetectors/CMakeLists.txt
index 9183ebaa3..d156d1dc8 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 305f4d4ee..78dad4e24 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 d5faddfc3..2f89637fb 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 0387d11dd..e6b9b23ec 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 fe97527c6..6dbe6aed4 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 45b88d487..b2fb695f4 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 91de3974a..c1ba5162a 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 d564117d9..23aa6f3ae 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 5a8f50276..726ed1603 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 954323ab8..0e09b8fb9 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 7c3390699..1a3c69a0d 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 5c60bcdf2..814a6e4e4 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 9318d3a9d..ff10f0518 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 dceead335..3dd201e26 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 2d597708a..59d599aaa 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 68ced8f82..b393147fe 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 bcd52d2c8..54dab20f1 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 a459a9ecf..594dd7e85 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 4e904a4cb..316c32d40 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 4b3faefc3..45561c5f1 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 9d31f211b..3bba3b0ab 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;
--
GitLab