-
Notifications
You must be signed in to change notification settings - Fork 25
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Question about creating digi collections from simhits. #710
Comments
How are you creating your output files? |
And no, the DualCrysCalorimeterHit usually does not define your output type. Whatever Geant4Output2... plugin that is used defines the output types, but I got lost in your repository. |
I don't write specific code to do that. As far as I know, the output is defined in the ddsim command, when I do ddsim --compactFile=DRConly.xml --runType=batch -G --steeringFile SCEPCALsteering.py --outputFile=out.root --part.userParticleHandler='' -G --gun.position="0.,0.,-1cm" --gun.direction "0 0 1" --gun.energy "5GeV" --gun.particle="e-" -N 1 and the extention on the --outFile defines it to put all the GEANT4 hit collections into the output in root format? I don't have any code I wrote (beyond what is in DualCrysCalorimeterSDAction.cpp that I pointed you to in my last point) where I personally do anything regarding the output of my ddsim run. My steering file is https://github.com/saraheno/DualTestBeam/blob/master/compact/SCEPCALsteering.py#L372 should I be doing something else to follow current "best practices" for introducing students to the "IDEA" "FCCee" computing environment? I know you hate graphic pastes, but don't know how otherwize to do this. this is what is in my output file |
You are not creating an edm4hep based root file. But DDG4s own root output. (You can just type Which version of the software were you using? In the latest versions, ddsim should automatically create EDM4hep if it is available. |
I do not see the DD4hep version in the spew when I run ddsim. I don't know where to find the version number in the downloaded code. I downloaded it on 7 Jan with the command $ git clone https://github.com/AIDASoft/DD4hep.git What do I need to do in order to put out the edm4hep-based root file (although the thought makes me cry, as my analysis code is based on the current root tuple... but ya... I can update it). I don't see any other output, so am I turning off the edm4hep output somehow by turning on the DDG4's own root output? |
You need to enable EDM4hep |
I downloaded a version DD4hep with the git clone command. I tried to cmake as you suggest when I try cmake -DDD4HEP_USE_GEANT4=ON -DBoost_NO_BOOST_CMAKE=ON -DDD4HEP_USE_LCIO=ON -DBUILD_TESTING=ON -DROOT_DIR=$ROOTSYS -D CMAKE_BUILD_TYPE=Release -DDD4HEP_BUILD_EXAMPLES=ON -DCMAKE_INSTALL_PREFIX=../install -D DD4HEP_USE_EDM4HEP=ON .. I get an error shown below. -- Found OpenGL: /usr/lib64/libOpenGL.so The following configuration files were considered but not accepted:
-- Configuring incomplete, errors occurred! |
You need a newer LCG release, like 107. |
after upgrading to 107 using source /cvmfs/sft.cern.ch/lcg/views/LCG_107/x86_64-el8-gcc11-opt/setup.sh I get the spew shown below. How do I fix this? the command I did was cmake -DDD4HEP_USE_GEANT4=ON -DBoost_NO_BOOST_CMAKE=ON -DDD4HEP_USE_LCIO=ON -DBUILD_TESTING=ON -DROOT_DIR=$ROOTSYS -D CMAKE_BUILD_TYPE=Release -DDD4HEP_BUILD_EXAMPLES=ON -DCMAKE_INSTALL_PREFIX=../install -D DD4HEP_USE_EDM4HEP=ON .. the error is -- Detected CPU: icelake Could not find a package configuration file provided by "EDM4HEP"
Add the installation prefix of "EDM4HEP" to CMAKE_PREFIX_PATH or set |
Right, later versions of EDM4hep require c++20, but gcc11 is built with c++17, so there is no EDM4hep... |
okay, I'm trying to compile it in singularity. I envoke the singularity using singularity run -B /cvmfs:/cvmfs -B /data:/data docker://gitlab-registry.cern.ch/sft/docker/alma9-core:latest I then try to do the cmake cmake -DDD4HEP_USE_GEANT4=ON -DBoost_NO_BOOST_CMAKE=ON -DDD4HEP_USE_LCIO=ON -DBUILD_TESTING=ON -DROOT_DIR=$ROOTSYS -D CMAKE_BUILD_TYPE=Release -DDD4HEP_BUILD_EXAMPLES=ON -DCMAKE_INSTALL_PREFIX=../install -D DD4HEP_USE_EDM4HEP=ON .. but then I get -- Detecting C compile features
Add the installation prefix of "ROOT" to CMAKE_PREFIX_PATH or set -- Configuring incomplete, errors occurred! |
There are multiple issues above. Don't run these two together:
With the first you set up the LCG stack and with the second the Key4hep stack. Many packages are in both and the result of doing this is most likely a broken environment. Then as Andre explained in his comment above you need to use a more recent compiler. Try (GCC 13 should also work):
|
thanks for your help. I still seem to be not understanding
|
When you run
The second command which is supposed to set up the environment is not actually run, because the singularity command does not actually return until you are done with whatever you want to do inside of it. |
okay, it is doing better. but I'm still getting errors and failure to compile log onto my cluster source /cvmfs/sft.cern.ch/lcg/views/LCG_102b/x86_64-centos8-gcc11-opt/setup.sh edit CMakeFiles.txt and include DualTestBeam in the "SET" list cd ../ this makes errors. I attach output_setup.txt cmake -DDD4HEP_USE_GEANT4=ON -DBoost_NO_BOOST_CMAKE=ON -DDD4HEP_USE_LCIO=ON -DBUILD_TESTING=ON -DROOT_DIR=$ROOTSYS -D CMAKE_BUILD_TYPE=Release -DDD4HEP_BUILD_EXAMPLES=ON -DCMAKE_INSTALL_PREFIX=../install -D DD4HEP_USE_EDM4HEP=ON ..>& output_cmake.txt this makes errors. I attach output_cmake.txt make -j4 >& output_make.txt this makes a huge spew. I attach output_make.txt |
Don't mix and match
|
okay, that fixed the compile (I thought the singularity would protect the second setup from the first? oh well). It compiled when I did the commands given below. But there must be something wrong with my CMakeLists.txt or something, as it no longer finds the modules in my examples/DualTestBeam/src area in this new environment. ddsim --compactFile=DRConly.xml --runType=batch -G --steeringFile SCEPCALsteering.py --outputFile=out_Conly_20GeV_pi-.root --part.userParticleHandler= -G --gun.position="0. 0.mm -1cm" --gun.direction "0. 0. 1." --gun.energy "20*GeV" --gun.particle="pi-" -N 1 >& run.txt I attach the crash in a file run.txt I'm a big confused because when I go to the build area and do "grep -r DRCrys * >& grep.txt" it looks like it is compiling it. This is the compile commands git clone https://github.com/AIDASoft/DD4hep.git edit CMakeFiles.txt and include DualTestBeam in the "SET" list cd ../ |
nevermind. I know what I did wrong |
okay, so now after remembering to do ./install/bin/thisdd4hep.sh, I'm getting a real crash, not just compilation problems. what do I need to do to fix this ( as a reminder I'm trying to switch from ddsim's own root output to edh4hep output)?
|
I think there must be some magic command I am missing to setup my edm4hep.root file? Or maybe I need some code to tell edm4hep about my custom hit class https://github.com/saraheno/DualTestBeam/blob/master/src/DualCrysCalorimeterHit.h? or maybe there is something about the custom hit class edm4hep doesn't like? maybe it has structures in it edm4hep doesn't like? unfortunately the crash does not seem to be very informative. It just looks like
I am guessing it is crashing while trying to setup the EDM4hep root output? |
Does the ddsim command work with your previous setup? |
Also please remember our little friends the triple tick marks ``` |
The error message you see comes from
Of course once you fix that issue and add
By the way if you apply these changes to your code, you don't have to compile all of dd4hep, but just your example, and then source diff --git a/CMakeLists.txt b/CMakeLists.txt
index f44e907..7160f15 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -14,6 +14,13 @@
#==========================================================================
cmake_minimum_required(VERSION 3.12 FATAL_ERROR)
+
+set( PackageName DualTestBeam )
+#---------------------------
+
+project(${PackageName})
+
+
IF(NOT TARGET DD4hep::DDCore)
find_package ( DD4hep REQUIRED )
include ( ${DD4hep_DIR}/cmake/DD4hep.cmake )
@@ -78,12 +85,13 @@ dd4hep_configure_output ()
dd4hep_add_plugin ( DualTestBeam
GENERATED G__DualTestBeam.cxx
SOURCES src/*.cpp src/plugins/*.cpp
- USES DD4hep::DDCore DD4hep::DDAlign DD4hep::DDCond DD4hep::DDG4 DDDetectors
+ USES DD4hep::DDCore DD4hep::DDAlign DD4hep::DDCond DD4hep::DDG4
ROOT::Core ROOT::Geom ROOT::GenVector CLHEP::CLHEP Geant4::Interface
)
+dd4hep_instantiate_package(${PackageName})
target_include_directories(DualTestBeam PUBLIC include) |
You already created a different output plugin in the past AIDASoft/DD4hep#1104 (comment) |
Thanks Andre. Regarding the user defined output... I put that old code into my repository. No idea if it will compile. but before I try to start compiling it. I'm a bit worried. My main goal is to make some code like
to read my custom hits and turn them into digis I think I was told that to do this, I cannot use the native ddsim root tuple. I need a edm4hep root tuple. Does this code
work with or make or something like that an ed4hep root tuple? Is there anything special I need to do so that what comes out can be read by something like the muon single digi code? |
I have to admit, looking at the code now, I don't even understand why SCEGeant4Output2ROOT.* doesn't include my custom hit header DualCrystalCalorimeterHit.h. If I was making an edm4hep output for my custom class, shouldn't it include that header? |
This thread is to continue the conversation I started incorrection in the ddsim repository regarding how to create digis from simhits.
In that thread, I asked about https://github.com/key4hep/k4GaudiPandora/blob/4b9f4b92e1e92abc15c594f7c74584f1f2269742/k4GaudiPandora/include/DDSimpleMuonDigi.h#L39
which is like
and wanted to understand how to alter that to work with my ddsim output created with code at https://github.com/saraheno/DualTestBeam.
I am trying to understand how to do this by reading https://key4hep.github.io/key4hep-doc/developing-key4hep-software/WritingAlgorithms.html
now in my code there is a line
https://github.com/saraheno/DualTestBeam/blob/15822226f728896704fc2d4f0aa6f3a497e398ea/src/DualCrysCalorimeterSDAction.cpp#L176
I think this defines a geant4hit collection using hits of the type DualCrysCalorimeterHit
and which I think is defining the output collection for my code, and its type.
so in that template structure above, I need to replace "const edm4hep::SimCalorimeterHitCollection&" with "Geant4HitCollection" ?
And I guess I don't know if I can just leave edm4hep::CalorimeterHitCollection as it is? where would I find its header file edm4hep/CalorimeterHitCollection.h ?
The text was updated successfully, but these errors were encountered: