Feature #22466
Provide a LArSoft geometry example working with the new larg4
Description
My attempt to figure out what it takes to use the new LArG4 package has been frustrated at the point where the detector description from the GDML source needs to be updated.
I feel that we will benefit from a real, working LArSoft full example of how to do that step, including up to running GEANT4 in LArSoft.
So I have pushed into LArCoreAlg develop
branch a geometry description, larcorealg:source:larcorealg/Geometry/gdml/MinimalLArTPCdetector.gdml and its _nowires
companion, which contains the minimal set of GDML instructions that make LArSoft geometry and presumably GEANT4 and larg4::LArG4
module (LArSim) work properly.
I would like that simplified file to be adapted so that the rest of the community can start from there and give a try to the new LArG4.
To be clear: I am aware of the instructions on LArG4 wiki, and while I got a flavour of the required changed, the instructions proved not enough to bootstrap me into updating a LArTPC geometry file.
For reference, that geometry is the same, in LArSoft terms, as larcorealg:source:larcorealg/Geometry/gdml/LArTPCdetector.gdml, which is a MicroBooNE-like detector with TPC (1), PMTs (30), and auxiliary detectors (267). I can provide configuration files using that geometry and running the current LArG4
module (although I failed to fully enable optical simulation so far).
History
#1 Updated by Lynn Garren almost 2 years ago
- File test_311dp.fcl added
- File services_dune2.fcl added
- File dune_refactored.fcl added
- File 3x1x1dphase_nowires.gdml added
From Hans:
The people working on dual phase TPC's were able to get the full chain running and I think everything can be found in the dune repositories. I have attached the fcl and gdml file they used.
I am in the process of compiling an example that shows how to use the new workflow using a simplified liquid Argon Detector geometry. But I still have to complete some coding which completely splits the electron drift and detector response. That means the larsim:source:larsim/ElectronDrift/SimDriftElectrons_module.cc used by the example above will be split into the DriftElectronstoPlane_module.cc and another module that produces the simchannels.
Here the DriftElectronstoPlane_module will take the SimEnergyDeposits as input, drift the electrons to a surface and create the SimDriftedElectronClusters which then are the input for a new module that takes the SimDriftedElectronClusters as input and simchannels as output.
#2 Updated by Kyle Knoepfel almost 2 years ago
- Assignee set to Hans-Joachim Wenzel
- Status changed from New to Assigned
Hans, can you take care of this?
#3 Updated by Kyle Knoepfel almost 2 years ago
Hans, what is the status of this issue?
#4 Updated by Hans-Joachim Wenzel almost 2 years ago
- File fcl.tgz added
#5 Updated by Hans-Joachim Wenzel almost 2 years ago
- File dune_refactored2.fcl added
Currently an example is available as part of dunetpc. It was developed by the group working on a dual-phase TPC (Jose, Bea and Paul). So to look at the example one needs to setup dunetpc. Below is what I am doing until we find a place for a more generic example.
mkdir example
cd example
mkdir larsim_dev
cd larsim_dev
source /cvmfs/fermilab.opensciencegrid.org/products/larsoft/setup
setup mrb
export MRB_PROJECT=larsim
mrb newDev -v v08_07_00 -q e17:prof
source localProducts_larsim_v08_07_00_e17_prof/setup
cd srcs
mrb g larsim
cd $MRB_BUILDDIR
mrbsetenv
mrb b -j 4
unsetup cetpkgsupport
source /cvmfs/dune.opensciencegrid.org/products/dune/setup_dune.sh
setup dunetpc -qe17:prof v08_20_00
wget https://cdcvs.fnal.gov/redmine/attachments/download/53755/fcl.tgz
tar xzvf fcl.tgz
lar -c dune_refactored.fcl
to run the module by Bill seligman which does the simdrift and injects the charge into the simchannels. (Currently this still depends on the LArG4Parameters service but we will remove this dependency)
lar -c dune_refactored2.fcl
#6 Updated by Hans-Joachim Wenzel almost 2 years ago
- File deleted (
fcl.tgz)
#7 Updated by Hans-Joachim Wenzel almost 2 years ago
- File deleted (
dune_refactored2.fcl)
#8 Updated by Hans-Joachim Wenzel almost 2 years ago
#9 Updated by Hans-Joachim Wenzel almost 2 years ago
- File deleted (
3x1x1dphase_nowires.gdml)
#10 Updated by Hans-Joachim Wenzel almost 2 years ago
- File deleted (
dune_refactored.fcl)
#11 Updated by Hans-Joachim Wenzel almost 2 years ago
- File deleted (
services_dune2.fcl)
#12 Updated by Hans-Joachim Wenzel almost 2 years ago
- File deleted (
test_311dp.fcl)
#13 Updated by Hans-Joachim Wenzel 9 months ago
- File Screenshot from 2020-07-07 09-45-19.png Screenshot from 2020-07-07 09-45-19.png added
- File MinimalLArTPCdetector_nowires.gdml MinimalLArTPCdetector_nowires.gdml added
I took Gianluca's larcorealg:source:larcorealg/Geometry/gdml/MinimalLArTPCdetector_nowires.gdml file and modified it. The gdml file is attached.
#14 Updated by Hans-Joachim Wenzel 9 months ago
- File MinimalLArTPCdetector_nowires.gdml MinimalLArTPCdetector_nowires.gdml added
- File Screenshot from 2020-07-08 17-16-38.png Screenshot from 2020-07-08 17-16-38.png added
- File Screenshot from 2020-07-08 17-15-36.png Screenshot from 2020-07-08 17-15-36.png added
Now everything is square as Gianluca intended. The gdml as well as some screenshots are attached. I am not quite done yet but the gdml file should be quite compact and easy to read and modify.
#15 Updated by Michael Wang 7 months ago
- File tt.fcl tt.fcl added
- File MinimalLArTPCdetector_g4_nowires.gdml MinimalLArTPCdetector_g4_nowires.gdml added
- File MinimalLArTPCdetector_g4.gdml MinimalLArTPCdetector_g4.gdml added
I am testing (with larsoft v08_55_02) the new minimal LArTPC detector example Hans created about 2 months ago for the purpose of illustrating how to use the refactored larg4. However it fails in GeometryCore::BuildGeometry at the following line:
Cryostats() = builder.extractCryostats(path);
with the following error message:
Info in <TGeoManager::Import>: Reading geometry from file: ./MinimalLArTPCdetector_g4.gdml
Info in <TGeoManager::TGeoManager>: Geometry GDMLImport, Geometry imported from GDML created
Info in <TGeoManager::SetTopVolume>: Top volume is volWorld. Master volume is volWorld
Info in <TGeoNavigator::BuildCache>: --- Maximum geometry depth set to 100
Info in <TGeoManager::CheckGeometry>: Fixing runtime shapes...
Info in <TGeoManager::CheckGeometry>: ...Nothing to fix
Info in <TGeoManager::CloseGeometry>: Counting nodes...
Info in <TGeoManager::Voxelize>: Voxelizing...
Info in <TGeoManager::CloseGeometry>: Building cache...
Info in <TGeoManager::CountLevels>: max level = 5, max placements = 2591
Info in <TGeoManager::CloseGeometry>: 3563 nodes/ 12 volume UID's in Geometry imported from GDML
Info in <TGeoManager::CloseGeometry>: ----------------modeler ready----------------
*** Break *** segmentation violation
__boot()
import os
Gianluca, could you please take a look, since this appears to be your code and you understand it better than the rest of us, to help us understand what's wrong so we can get this example working. I am attaching the fcl and the gdml files used by the geometry service. The gdml file used by larg4 is the same one Hans created and uploaded 2 months ago on this page.
#16 Updated by Michael Wang 7 months ago
- File tt_v090300.log tt_v090300.log added
- Experiment - added
- Experiment deleted (
ICARUS)
As suggested by Kyle and Lynn at today's scisoft meeting, I repeated my test using larsoft v09_03_00. I see the same failure. Attached is a text file with the output from running lar showing more details of the failure.
#17 Updated by Michael Wang 6 months ago
The problem I was seeing turned out to be the way things were labeled in Han's gdml file describing the minimal lartpc. GeometryBuilderStandard was expecting "volTPCWire" but the label used in the gdml file was "psenseWire". Replacing the latter with the former seems to fix things and I no longer see the error above.
With the fixed gdml file, I was able to run SimDriftElectrons to drift the ionization electrons resulting from the SimEnergyDeposits to the two wire planes in the sample model to produce SimChannels. I was also able to run SimWire on these results to produce the RawDigits associated with wire signals.
Finally, I also managed to get lareventdisplay to work with the example above to verify it was producing reasonable results.
#18 Updated by Hans-Joachim Wenzel 5 months ago
- File tt.fcl tt.fcl added
- File MinimalLArTPCdetector.gdml MinimalLArTPCdetector.gdml added
- File MinimalLArTPCdetector.fcl MinimalLArTPCdetector.fcl added
- File MinimalLArTPCdetector_nowires.gdml MinimalLArTPCdetector_nowires.gdml added
- File MinimalLArTPCdetector_g4.gdml MinimalLArTPCdetector_g4.gdml added
- File MinimalLArTPCdetector_g4_nowires.gdml MinimalLArTPCdetector_g4_nowires.gdml added
- File miketest_g4.gdml miketest_g4.gdml added
- File miketest_g4_nowires.gdml miketest_g4_nowires.gdml added
for more information see:
presentation "Minimal LArG4-compatible LArTPC geometry example"
LArSoft Coordination Meeting
Tuesday Nov 3, 2020, 9:00 AM
#19 Updated by Hans-Joachim Wenzel 5 months ago
- Status changed from Assigned to Resolved
An example has been created consisting of gdml files describing the geometry and fcl files to run an example. This has been added and a pull request has been created.
For the moment one can test it in the following way:
source /cvmfs/fermilab.opensciencegrid.org/products/larsoft/setup mkdir geom cd geom setup mrb export MRB_PROJECT=larg4 mrb newDev -v v09_01_03 -q e19:prof source /home/wenzel/geom/localProducts_larg4_v09_01_03_e19_prof/setup cd srcs mrb gitCheckout --repo-type github --fork larg4 cd larg4 git status git checkout -b wenzel_larg4_develop git status cd $MRB_BUILDDIR mrbsetenv mrb b -j 4 setup nurandom -qe19:prof v1_04_03 setup larsim -qe19:prof v09_06_00 lar -c test_MinimalLArTPC.fcl
#20 Updated by Hans-Joachim Wenzel 5 months ago
- % Done changed from 0 to 100
- Experiment LArSoft added
- Experiment deleted (
-)