SuperNEMO-DBD / Falaise

Simulation, Reconstruction and Analysis Software for the SuperNEMO Experiment
http://supernemo.org/Falaise
GNU General Public License v3.0
5 stars 27 forks source link

PR 231 primary event generator selection error #232

Closed willquinn closed 3 years ago

willquinn commented 3 years ago

Relevant files are:

test.conf

#@key_label "name"
#@meta_label "type"
[name="flsimulate" type="flsimulate::section"]
numberOfEvents : integer = 1000
[name="flsimulate.variantService" type="flsimulate::section"]
profile : string as path = "/sps/nemo/scratch/wquinn/snemo-dbd_falaise/install/bin/test.profile"
settings : string[2] = \
        "primary_events:generator=Se82.0nubb" \
        "vertexes:generator=real_flat_source_full_foils_se82_bulk"

test.profile

#@format=datatools::configuration::variant
#@format.version=1.0
#@organization=snemo
#@application=falaise
[registry="geometry"]
layout = "Basic"
layout/if_basic/magnetic_field = true
layout/if_basic/magnetic_field/is_active/type = "UniformVertical"
layout/if_basic/magnetic_field/is_active/type/if_uniform_vertical/magnitude = 25 gauss
layout/if_basic/magnetic_field/is_active/type/if_uniform_vertical/direction = "+z"
layout/if_basic/source_layout = "RealisticFlat"
layout/if_basic/source_calibration = false
layout/if_basic/shielding = true
calo_film_thickness = 25 um

[registry="vertexes"]
generator = "real_flat_source_full_foils_se82_bulk"

[registry="primary_events"]
generator = "Se82.0nubb"

[registry="simulation"]
physics_mode = "Constructors"
physics_mode/if_constructors/em_model = "standard"
production_cuts = true
output_profile = "none"

I then run the following flsimulate -c test.conf -o test.brio

However I get the following output:

flsimulate : Variant service threw exception
[int datatools::configuration::ascii_io::load_record(std::istream&, datatools::configuration::variant_record&) const:220: Failed to convert variant parameter 'generator' from '"Se82.0nubb"' : [datatools::command::returned_info datatools::configuration::variant_record::set_string_value(const string&):1130: Parameter record 'generator' does not accept string value 'Se82.0nubb' !]]

Also in the flsimulate-configure GUI when selecting the vertex generator for the "real_flat_source_full_foils_se82_bulk" I can no longer select the "Se82.0nubb" primary events from the drop down menu.

See the following picture:

Screenshot 2021-04-20 at 12 12 51
willquinn commented 3 years ago

231

willquinn commented 3 years ago

Just to clarify... in flsimulate-configure I picked "if_realistic" as the geometry and "real_flat_source_full_foils_se82_bulk" and "real_flat_source_full_foils_mass_bulk" as the vertex generator but none of the double beta primary event types were available.

lemiere commented 3 years ago

Yes ! I got same issue. Was not the case when Paolo tried it. @pfranchini you confirm ?

pfranchini commented 3 years ago

I have produced gammas so have not investigated other generators.

fmauger commented 3 years ago

I understand the bug. There are some missing variant directives that should connect the possibility to use Se82 DBD generators when the RealisticFlat option is selected. I'm working on a fix (basically adding a few proper rules in the proper file(s)). This issue is due to a very advanced feature of the variant system that allows to allow conditional activation of some variant options in one topic (here the "EventGenerator") when some specific combination of options has been activated in some other region of the optional phase space ("Geometry"). Practically this has to do with the " resources/snemo/demonstrator/geant4_control/Geant4VariantsGDM.conf " file (GDM stands for "Global Dependency Manager") where some special logics can be written to express such complex/long range conditions between variant options. The idea here is to allow the use of the Se event generators only for volumes with materials which are known to contain selenium. So this is a hard constrain but makes sense. And it prevents a (fool) user to generate Se DBD events from Copper foils, or even from calorimeter blocks !

cherylepatrick commented 3 years ago

Ah yes I remember that! Or one I've been caught out by before - trying to generate Nd150 decays when the demonstrator's full of Se82 foils?

fmauger commented 3 years ago

yep!

lemiere commented 3 years ago

I've that feeling, change resources/snemo/demonstrator/geant4_control/Geant4VariantsGDM.conf

dependencies.Se82PrimariesDep.slots : integer[2] = 5 11
dependencies.Se82PrimariesDep.logic : string = "OR([5],[11])"

To change for :

dependencies.Se82PrimariesDep.slots : integer[3] = 5 10 11
dependencies.Se82PrimariesDep.logic : string = "OR([5],[10],[11])"

and let us know ;-)

fmauger commented 3 years ago

not sure this is what has to be done. I'm following another track... because in what you are proposing, it will probably work, but you will be also allowed to run Se events from any place in the detector, provided you have activated "geometry:layout/if_basic/source_layout/if_realistic_flat".

what we need is to express the fact that the selected vertex generator corresponds to a real Se82 source... so that it is possible to activate a primary event generator from the "DBD/Se82" group. there is a place to do that... probably in the CSV file... I'm checking

willquinn commented 3 years ago

It does work. In flsimulate-configure I have the option to choose Se82 primaries and when running flsimulate using the conf and profile files above, I get an output brio.

However, I can also now simulate Se82 in the anode wires - which is fun

fmauger commented 3 years ago

Yep. Exactly what I have predicted !

if you have a look on the Geant4VariantsGDM.conf file, you find the following directive:

dependees.slot_11.variant : string = "vertexes:generator/if_source_of_se82_dbd"

which is already addressed in the "dependencies.Se82PrimariesDep.logic : string = "OR([5],[[11])" directive.

So what must be done is to "mark" the various bulk generators on realistic strips as activating the "vertexes:generator/if_source_of_se82_dbd" variant condition...

fmauger commented 3 years ago

addressed in #234 please check !

fmauger commented 3 years ago

it worked for me but one must check possible side-effects...

lemiere commented 3 years ago

Previously, in the csv file we had : real_flat_source_full_foils_se82_bulk : Vertex generation from the bulk volume of all Se82 pads (for Se82 DBD process) : SourceFoilRealisticFlat : if_source_of_se82_dbd

Which no more available in the current version of .csv file.... I will after that....

willquinn commented 3 years ago

I don't know which thread post this on.

I cloned fix #234 and tested using the files I have included on this thread. It worked, however as I don't understand the whole scope of this perhaps someone can explain further.

My question is, don't we want ALL the source foil generators to allow the simulation of ANY double beta primary events, not just Se82?

Other than that the fix worked for what I am trying to do. This question only speaks to the wider usage.

fmauger commented 3 years ago

I don't know which thread post this on.

I cloned fix #234 and tested using the files I have included on this thread. It worked, however as I don't understand the whole scope of this perhaps someone can explain further.

* only the "real_flat_source_full_foils_se82_bulk" generator allows the Se82 primary events

yes because the weighting of the combined generators used under the hood are specific to the Se mass in the collection of pads. for other emitters (Tl , Bi) this makes no sense.

* the other real_flat... generators do not allow Se82 events

The "real_flat_source_strip_34_se82_bulk" should. and we could add the individual "real_flat_sourcestrip*pad?_bulk" vgs

* generators that we do not wish to allow Se82 primaries are correctly not available

which is expected.

My question is, don't we want ALL the source foil generators to allow the simulation of ANY double beta primary events, not just Se82?

Other than that the fix worked for what I am trying to do. This question only speaks to the wider usage.

oops! duplicate answer on the slack. sorry... to many screens !

willquinn commented 3 years ago

Ah no worries I think I understand a bit better now thank you. I checked a couple of the generators you mentioned and they all allow the Se82 primaries :)

cherylepatrick commented 3 years ago

I'm confused now! real_flat_source_full_foils_se82_bulk and all of the individual strip/pad bulks should allow Se82, yes? But stuff like the surface and the copper foils and, I dunno, tracker wires shouldn't. And none of them should allow e.g. Nd150 cos that's not what they're made of. Is that what it's doing?

fmauger commented 3 years ago

yes,it is.

fmauger commented 3 years ago

I've just added individual bulk pads as possible Se source for strips 1 to 34 included.

cherylepatrick commented 3 years ago

Awesome, thank you! I get it now :)