ALLPix / allpix

AllPix is a powerful tool for various simulation goals with pixel detectors, see the Twiki page for more details
https://twiki.cern.ch/twiki/bin/view/Main/AllPix
13 stars 29 forks source link

setWorldMaterial #10

Open emx77 opened 8 years ago

emx77 commented 8 years ago

Dear all,

using option /allpix/extras/setWorldMaterial Vacuum makes allpix crash

Erik.

emx77 commented 8 years ago

Also I see that AllPixDetectorConstruction::Construct is done twice.

mathieubenoit commented 8 years ago

Hi Erik, I seem unable to reproduce the bug. I run the following script :


# Detector 
/allpix/det/setId         200
/allpix/det/setPosition   0.0 0.0  0.0  mm
/allpix/det/setRotation   0.0 0.0  0.0 deg

#/allpix/phys/Physics TestXR_Compton_and_Photoelectric

####################################################################
# Build detectors
#/allpix/phys/Physics LIVERMORE_FTFP_BERT
/allpix/phys/Physics emstandard_opt0
/allpix/det/setMaxStepLengthSensor 2 um
/run/initialize
/allpix/det/update

####################################################################
# prefix for output filename (string) Don't use quotation marks \"
/allpix/config/setOutputPrefixWithPath test

####################################################################
# Verbose control
/run/verbose 0
/control/verbose 0
/control/saveHistory
/tracking/verbose 0
/allpix/phys/verbose 0

/allpix/extras/setWorldMaterial Vacuum

####################################################################
# Visualization
/vis/scene/create
#/vis/scene/add/axes 0. 0. 0. 10. cm
/vis/scene/add/volume World -1 2
/vis/viewer/set/style s
#/vis/open OIX 1024x768-100+100
#/vis/open OGLIXm 1024x768-100+100
#/vis/open RayTracer
#/vis/open OGLIQt
#/vis/open OGLSQt
#/vis/open OIX
#/vis/open OGLIX 1024x768-100+100
#/vis/open OGLSXm
#/vis/open DAWNFILE
#/vis/open OGLSX
#/vis/open OGL 600x600-0+0
/vis/viewer/set/background 0.4 0.5 0.6
/vis/viewer/set/viewpointThetaPhi 20 50
/vis/viewer/zoom 2.0
/vis/viewer/flush

####################################################################
# Draw trajectories at end of event, showing trajectory points as
# markers of size 2 pixels
/vis/scene/add/trajectories
/vis/modeling/trajectories/create/drawByCharge
/vis/modeling/trajectories/drawByCharge-0/default/setDrawStepPts false
/vis/modeling/trajectories/drawByCharge-0/default/setStepPtsSize 2
/vis/scene/endOfEventAction accumulate

####################################################################
# Write Telescope files
/allpix/timepixtelescope/setFolderPath TutoFiles
/allpix/timepixtelescope/setEventIDcolumn 0
/allpix/timepixtelescope/setSumTOT 1
/allpix/timepixtelescope/write 0
/allpix/config/setOutputPrefixWithPath TelescopeSim

####################################################################
# Write ROOT File
/allpix/WriteROOTFiles/write 1
/allpix/WriteROOTFiles/setFolderPath FEI4Alone/run1

####################################################################
# Source GPS
/gps/particle pi-
/gps/pos/type Beam
/gps/pos/sigma_r 5.0 mm
/gps/pos/centre 0 0 -100.0 mm
/gps/direction  0 0 1

/gps/ene/type User
/gps/hist/type energy
# spectra
/gps/hist/point 120000 1

####################################################################
# Shoot
/allpix/beam/frames 100
/allpix/beam/type const 1
/allpix/beam/on

and get this output : User action --> World volume material : Vacuum

Maybe you need to do this just after the /run/initialize

emx77 commented 8 years ago

Dear Matthieu,

In your example just the Macro file data is read. But the world volume is not updated.

It does work when the material definition is between /run/initialize and /allpix/det/update, see below. I do get a warning message that the vacuum material is defined twice.

The program crashes when the /allpix/extras/setWorldMaterial Vacuum is done before /run/initialize.

I have a fix in my local work directory. Is it possible to push this to the git main repository?


initialize

/run/initialize

/allpix/extras/setWorldMaterial Vacuum

################################################

Build detectors

/allpix/det/update


On 16 March 2016 at 17:09, Mathieu Benoit notifications@github.com wrote:

Hi Erik, I seem unable to reproduce the bug. I run the following script :

Detector

/allpix/det/setId 200 /allpix/det/setPosition 0.0 0.0 0.0 mm /allpix/det/setRotation 0.0 0.0 0.0 deg

/allpix/phys/Physics TestXR_Compton_and_Photoelectric

####################################################################

Build detectors

/allpix/phys/Physics LIVERMORE_FTFP_BERT

/allpix/phys/Physics emstandard_opt0 /allpix/det/setMaxStepLengthSensor 2 um /run/initialize /allpix/det/update

####################################################################

prefix for output filename (string) Don't use quotation marks \"

/allpix/config/setOutputPrefixWithPath test

####################################################################

Verbose control

/run/verbose 0 /control/verbose 0 /control/saveHistory /tracking/verbose 0 /allpix/phys/verbose 0

/allpix/extras/setWorldMaterial Vacuum

####################################################################

Visualization

/vis/scene/create

/vis/scene/add/axes 0. 0. 0. 10. cm

/vis/scene/add/volume World -1 2 /vis/viewer/set/style s

/vis/open OIX 1024x768-100+100

/vis/open OGLIXm 1024x768-100+100

/vis/open RayTracer

/vis/open OGLIQt

/vis/open OGLSQt

/vis/open OIX

/vis/open OGLIX 1024x768-100+100

/vis/open OGLSXm

/vis/open DAWNFILE

/vis/open OGLSX

/vis/open OGL 600x600-0+0

/vis/viewer/set/background 0.4 0.5 0.6 /vis/viewer/set/viewpointThetaPhi 20 50 /vis/viewer/zoom 2.0 /vis/viewer/flush

####################################################################

Draw trajectories at end of event, showing trajectory points as

markers of size 2 pixels

/vis/scene/add/trajectories /vis/modeling/trajectories/create/drawByCharge /vis/modeling/trajectories/drawByCharge-0/default/setDrawStepPts false /vis/modeling/trajectories/drawByCharge-0/default/setStepPtsSize 2 /vis/scene/endOfEventAction accumulate

####################################################################

Write Telescope files

/allpix/timepixtelescope/setFolderPath TutoFiles /allpix/timepixtelescope/setEventIDcolumn 0 /allpix/timepixtelescope/setSumTOT 1 /allpix/timepixtelescope/write 0 /allpix/config/setOutputPrefixWithPath TelescopeSim

####################################################################

Write ROOT File

/allpix/WriteROOTFiles/write 1 /allpix/WriteROOTFiles/setFolderPath FEI4Alone/run1

####################################################################

Source GPS

/gps/particle pi- /gps/pos/type Beam /gps/pos/sigma_r 5.0 mm /gps/pos/centre 0 0 -100.0 mm /gps/direction 0 0 1

/gps/ene/type User /gps/hist/type energy

spectra

/gps/hist/point 120000 1

####################################################################

Shoot

/allpix/beam/frames 100 /allpix/beam/type const 1 /allpix/beam/on

and get this output : User action --> World volume material : Vacuum

Maybe you need to do this just after the /run/initialize

— You are receiving this because you authored the thread. Reply to this email directly or view it on GitHub https://github.com/ALLPix/allpix/issues/10#issuecomment-197401600

Erik Maddox, PhD Amsterdam Scientific Instruments B.V. www.amscins.com

mathieubenoit commented 8 years ago

Hi , sure you can make a pull-request on the alpha branch,

Mathieu Benoit


Maître-Assistant, DPNC-UNIGE Office : 301 1-006 CERN CH-1211 Genève 23 Switzerland Mobile : +41754119859

Le 16 mars 2016 à 22:50, emx77 notifications@github.com<mailto:notifications@github.com> a écrit :

/allpix/extras/setWorldMaterial Vacuum