Skip to content
Snippets Groups Projects
Commit 233c2b68 authored by Wouter Deconinck's avatar Wouter Deconinck
Browse files

Removed local versions which are now upstream

parent d84c37af
No related branches found
No related tags found
1 merge request!297Spack v0.18.0
This commit is part of merge request !297. Comments created here will be created in the context of that merge request.
from spack.pkg.builtin.acts import Acts as BuiltinActs
class Acts(BuiltinActs):
version('19.0.0', commit='1ce9c583150060ba8388051685433899713d56d9', submodules=True)
version('18.0.0', commit='fe03b5af6ca2b092dec87c4cef77dd552bbbe719', submodules=True)
version('17.1.0', commit='0d9c3a6da022da48d6401e10c273896a1f775a9e', submodules=True)
version('17.0.0', commit='ccbf4c7d4ec3698bac4db9687fab2455a3f9c203', submodules=True)
version('16.0.0', commit='9bd86921155e708189417b5a8019add10fd5b273', submodules=True)
version('15.1.0', commit='a96e6db7de6075e85b6d5346bc89845eeb89b324', submodules=True)
version('15.0.0', commit='0fef9e0831a90e946745390882aac871b211eaac', submodules=True)
version('19.1.0', commit='82f42a2cc80d4259db251275c09b84ee97a7bd22', submodules=True)
diff --git a/DDG4/src/Geant4IsotropeGenerator.cpp b/DDG4/src/Geant4IsotropeGenerator.cpp
index 54588aaf..f63b29b4 100644
--- a/DDG4/src/Geant4IsotropeGenerator.cpp
+++ b/DDG4/src/Geant4IsotropeGenerator.cpp
@@ -48,7 +48,6 @@ void Geant4IsotropeGenerator::getParticleDirectionUniform(int, ROOT::Math::XYZVe
double x3 = std::cos(theta);
direction.SetXYZ(x1,x2,x3);
- momentum = rnd.rndm()*momentum;
}
/// Particle distribution ~ cos(theta)
@@ -63,7 +62,6 @@ void Geant4IsotropeGenerator::getParticleDirectionCosTheta(int, ROOT::Math::XYZV
double x3 = cos_theta;
direction.SetXYZ(x1,x2,x3);
- momentum = rnd.rndm()*momentum;
}
/// Particle distribution flat in eta (pseudo rapidity)
@@ -84,7 +82,6 @@ void Geant4IsotropeGenerator::getParticleDirectionEta(int, ROOT::Math::XYZVector
double x3 = std::sinh(eta);
double r = std::sqrt(1.0+x3*x3);
direction.SetXYZ(x1/r,x2/r,x3/r);
- momentum = rnd.rndm()*momentum;
}
/// e+e- --> ffbar particle distribution ~ 1 + cos^2(theta)
@@ -110,7 +107,6 @@ void Geant4IsotropeGenerator::getParticleDirectionFFbar(int, ROOT::Math::XYZVect
double x2 = std::sin(theta)*std::sin(phi);
double x3 = std::cos(theta);
direction.SetXYZ(x1,x2,x3);
- momentum = rnd.rndm()*momentum;
return;
}
}
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 618812f7..8316ba67 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -46,6 +46,7 @@ ENDIF()
#############################################################
ENABLE_LANGUAGE(CXX)
+ENABLE_LANGUAGE(C)
# Set C++ standard
set(CMAKE_CXX_STANDARD 14 CACHE STRING "C++ standard used for compiling")
diff --git a/DDCore/src/plugins/Compact2Objects.cpp b/DDCore/src/plugins/Compact2Objects.cpp
index fab6267f..581f535f 100644
--- a/DDCore/src/plugins/Compact2Objects.cpp
+++ b/DDCore/src/plugins/Compact2Objects.cpp
@@ -805,21 +805,48 @@ template <> void Converter<PropertyTable>::operator()(xml_h e) const {
}
#endif
-/** Convert compact visualization attribute to Detector visualization attribute
+/** Convert compact visualization attribute to Detector visualization attribute.
*
* <vis name="SiVertexBarrelModuleVis"
* alpha="1.0" r="1.0" g="0.75" b="0.76"
* drawingStyle="wireframe"
* showDaughters="false"
* visible="true"/>
+ *
+ * Optionally inherit an already defined VisAttr and override other properties.
+ *
+ * <vis name="SiVertexEndcapModuleVis"
+ * ref="SiVertexBarrelModuleVis"
+ * alpha="0.5"/>
*/
template <> void Converter<VisAttr>::operator()(xml_h e) const {
VisAttr attr(e.attr<string>(_U(name)));
+ float alpha = 1.0;
+ float red = 1.0;
+ float green = 1.0;
+ float blue = 1.0;
+ bool use_ref = false;
+ if(e.hasAttr(_U(ref))) {
+ use_ref = true;
+ auto refName = e.attr<string>(_U(ref));
+ const auto refAttr = description.visAttributes(refName);
+ if(!refAttr.isValid() ) {
+ throw runtime_error("reference VisAttr " + refName + " does not exist");
+ }
+ // Just copying things manually.
+ // I think a handle's copy constructor/assignment would reuse the underlying pointer... maybe?
+ refAttr.argb(alpha,red,green,blue);
+ attr.setColor(alpha,red,green,blue);
+ attr.setDrawingStyle( refAttr.drawingStyle());
+ attr.setLineStyle( refAttr.lineStyle());
+ attr.setShowDaughters(refAttr.showDaughters());
+ attr.setVisible(refAttr.visible());
+ }
xml_dim_t dim(e);
- float alpha = dim.alpha(1.0);
- float red = dim.r(1.0);
- float green = dim.g(1.0);
- float blue = dim.b(1.0);
+ alpha = dim.alpha(alpha);
+ red = dim.r(red );
+ green = dim.g(green);
+ blue = dim.b(blue );
printout(s_debug.visattr ? ALWAYS : DEBUG, "Compact",
"++ Converting VisAttr structure: %-16s. Alpha=%.2f R=%.3f G=%.3f B=%.3f",
@@ -835,7 +862,8 @@ template <> void Converter<VisAttr>::operator()(xml_h e) const {
attr.setLineStyle(VisAttr::DASHED);
}
else {
- attr.setLineStyle(VisAttr::SOLID);
+ if (!use_ref)
+ attr.setLineStyle(VisAttr::SOLID);
}
if (e.hasAttr(_U(drawingStyle))) {
string ds = e.attr<string>(_U(drawingStyle));
@@ -845,12 +873,15 @@ template <> void Converter<VisAttr>::operator()(xml_h e) const {
attr.setDrawingStyle(VisAttr::SOLID);
}
else {
- attr.setDrawingStyle(VisAttr::SOLID);
+ if (!use_ref)
+ attr.setDrawingStyle(VisAttr::SOLID);
}
if (e.hasAttr(_U(showDaughters)))
attr.setShowDaughters(e.attr<bool>(_U(showDaughters)));
- else
- attr.setShowDaughters(true);
+ else {
+ if (!use_ref)
+ attr.setShowDaughters(true);
+ }
description.addVisAttribute(attr);
}
diff --git a/DDG4/edm4hep/Geant4Output2EDM4hep.cpp b/DDG4/edm4hep/Geant4Output2EDM4hep.cpp
index 555e4e52..504fb8e4 100644
--- a/DDG4/edm4hep/Geant4Output2EDM4hep.cpp
+++ b/DDG4/edm4hep/Geant4Output2EDM4hep.cpp
@@ -20,6 +20,7 @@
#include "DDG4/Geant4HitCollection.h"
#include "DDG4/Geant4OutputAction.h"
#include "DDG4/Geant4SensDetAction.h"
+#include "DDG4/Geant4DataConversion.h"
#include "DDG4/EventParameters.h"
// Geant4 headers
@@ -563,16 +564,23 @@ void Geant4Output2EDM4hep::createCollections(OutputContext<G4Event>& ctxt){
continue ;
}
+ Geant4Sensitive* sd = coll->sensitive();
+ string sd_enc = dd4hep::sim::Geant4ConversionHelper::encoding(sd->sensitiveDetector());
+
if( typeid( Geant4Tracker::Hit ) == coll->type().type() ){
- m_store->create<edm4hep::SimTrackerHitCollection>(colName);
+ auto& sthc = m_store->create<edm4hep::SimTrackerHitCollection>(colName);
m_file->registerForWrite(colName);
+ auto& sthc_md = m_store->getCollectionMetaData( sthc.getID() );
+ sthc_md.setValue("CellIDEncodingString", sd_enc);
printout(DEBUG,"Geant4Output2EDM4hep","+++ created collection %s",colName.c_str() );
}
else if( typeid( Geant4Calorimeter::Hit ) == coll->type().type() ){
- m_store->create<edm4hep::SimCalorimeterHitCollection>(colName);
+ auto& schc = m_store->create<edm4hep::SimCalorimeterHitCollection>(colName);
m_file->registerForWrite(colName);
+ auto& schc_md = m_store->getCollectionMetaData( schc.getID() );
+ schc_md.setValue("CellIDEncodingString", sd_enc);
printout(DEBUG,"Geant4Output2EDM4hep","+++ created collection %s",colName.c_str() );
colName += "Contributions" ;
diff --git a/DDG4/src/Geant4ShapeConverter.cpp b/DDG4/src/Geant4ShapeConverter.cpp
index 2a79a69a..6f4af522 100644
--- a/DDG4/src/Geant4ShapeConverter.cpp
+++ b/DDG4/src/Geant4ShapeConverter.cpp
@@ -205,8 +205,9 @@ namespace dd4hep {
template <> G4VSolid* convertShape<TGeoSphere>(const TGeoShape* shape) {
const TGeoSphere* sh = (const TGeoSphere*) shape;
- return new G4Sphere(sh->GetName(), sh->GetRmin() * CM_2_MM, sh->GetRmax() * CM_2_MM, sh->GetPhi1() * DEGREE_2_RAD,
- sh->GetPhi2() * DEGREE_2_RAD, sh->GetTheta1() * DEGREE_2_RAD, sh->GetTheta2() * DEGREE_2_RAD);
+ return new G4Sphere(sh->GetName(), sh->GetRmin() * CM_2_MM, sh->GetRmax() * CM_2_MM,
+ sh->GetPhi1() * DEGREE_2_RAD, (sh->GetPhi2()-sh->GetPhi1()) * DEGREE_2_RAD,
+ sh->GetTheta1() * DEGREE_2_RAD, (sh->GetTheta2()- sh->GetTheta1()) * DEGREE_2_RAD);
}
template <> G4VSolid* convertShape<TGeoTorus>(const TGeoShape* shape) {
......@@ -3,10 +3,6 @@ from spack.pkg.builtin.dd4hep import Dd4hep as BuiltinDd4hep
class Dd4hep(BuiltinDd4hep):
version('1.20.1', sha256='18c18a125583c39cb808c602e052cc2379aa3a8029aa78dbb40bcc31f1deb798')
version('1.20', sha256='cf6af0c486d5c84e8c8a8e40ea16cec54d4ed78bffcef295a0eeeaedf51cab59')
version('1.19', sha256='d2eccf5e8402ba7dab2e1d7236e12ee4db9b1c5e4253c40a140bf35580db1d9b')
patch('https://github.com/AIDASoft/DD4hep/pull/896.diff',
sha256='2d7e87824d324b8bd14cb2a8b441d2fc25a6d3474e6e041bd68c56439a9477cf',
when='@1.20:1.20.1')
diff --git a/DDG4/python/DDSim/Helper/Physics.py b/DDG4/python/DDSim/Helper/Physics.py
index 4ce65959..62eb05eb 100644
--- a/DDG4/python/DDSim/Helper/Physics.py
+++ b/DDG4/python/DDSim/Helper/Physics.py
@@ -17,7 +17,7 @@ class Physics(ConfigHelper):
self._list = "FTFP_BERT"
self._decays = False
self._pdgfile = None
- self._rejectPDGs = {1, 2, 3, 4, 5, 6, 21, 23, 24, 25}
+ self._rejectPDGs = {1, 2, 3, 4, 5, 6, 21, 23, 24, 25, 2101}
self._zeroTimePDGs = {11, 13, 15, 17}
self._userFunctions = []
diff --git a/DDG4/src/Geant4Particle.cpp b/DDG4/src/Geant4Particle.cpp
index 1db6105c..7f8d7482 100644
--- a/DDG4/src/Geant4Particle.cpp
+++ b/DDG4/src/Geant4Particle.cpp
@@ -57,7 +57,9 @@ Geant4Particle::~Geant4Particle() {
void Geant4Particle::release() {
//::printf("************ Release Geant4Particle[%p]: ID:%d pdgID %d ref:%d\n",(void*)this,id,pdgID,ref-1);
if ( --ref <= 0 ) {
+ if( (ref > -1) ) {
delete this;
+ }
}
}
from spack import *
from spack.pkg.builtin.edm4hep import Edm4hep as BuiltinEdm4hep
class Edm4hep(BuiltinEdm4hep):
version('0.4.1', sha256='122987fd5969b0f1639afa9668ac5181203746d00617ddb3bf8a2a9842758a63')
version('0.4', sha256='bcb729cd4a6f5917b8f073364fc950788111e178dd16b7e5218361f459c92a24')
from spack import *
from spack.pkg.builtin.gaudi import Gaudi as BuiltinGaudi
class Gaudi(BuiltinGaudi):
version('36.4', sha256='1a5c27cdc21ec136b47f5805406c92268163393c821107a24dbb47bd88e4b97d')
version('36.3', sha256='9ac228d8609416afe4dea6445c6b3ccebac6fab1e46121fcc3a056e24a5d6640')
version('36.2', sha256='a1b4bb597941a7a5b8d60382674f0b4ca5349c540471cd3d4454efbe7b9a09b9')
version('36.1', sha256='9f718c832313676249e5c3ac76ba4346978ee2328f8cdcb29176498b080402e9')
patch('https://gitlab.cern.ch/gaudi/Gaudi/-/commit/03db151003d5207795ae8ec96aaf2f5f8a9ea008.diff',
sha256='e73f45f10ea4a143a05c53a468233ceaad1a8ec22dee9877d178a3c9ee46c70f',
when='@:36.5')
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
index 07a21a2..cf0d819 100755
--- a/src/CMakeLists.txt
+++ b/src/CMakeLists.txt
@@ -13,8 +13,8 @@ endif()
# Remove SIO and ROOT related things from the core library
LIST(FILTER sources EXCLUDE REGEX SIO.*)
-LIST(FILTER sources EXCLUDE REGEX ROOT.*|PythonEventStore.*|root.* )
-LIST(FILTER root_sources INCLUDE REGEX ROOT.*|PythonEventStore.*|root.* )
+LIST(FILTER sources EXCLUDE REGEX ROOT.*|PythonEventStore.*|root[a-z|A-z|0-9].* )
+LIST(FILTER root_sources INCLUDE REGEX ROOT.*|PythonEventStore.*|root[a-z|A-z|0-9].* )
# Main Library, no external dependencies
add_library(podio SHARED ${sources})
from spack import *
from spack.pkg.builtin.podio import Podio as BuiltinPodio
class Podio(BuiltinPodio):
# issue with build breaking for spack as the search-and-replace for "root"
# erroneously selects the all files as the build happens under /tmp/root
patch('cmake.patch', when="@0.13.1:0.14.0")
version('0.14.1', sha256='361ac3f3ec6f5a4830729ab45f96c19f0f62e9415ff681f7c6cdb4ebdb796f72')
def setup_run_environment(self, env):
env.prepend_path('PYTHONPATH', self.prefix.python)
env.prepend_path('LD_LIBRARY_PATH', self.spec['podio'].libs.directories[0])
def setup_dependent_build_environment(self, env, dependent_spec):
env.prepend_path('PYTHONPATH', self.prefix.python)
env.prepend_path('LD_LIBRARY_PATH', self.spec['podio'].libs.directories[0])
env.prepend_path('ROOT_INCLUDE_PATH', self.prefix.include)
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment