JeffersonLab / halld_sim

Simulation for the GlueX Experiment in Hall D
6 stars 10 forks source link

Error when simulating CPP data with BeamProperty Config #343

Open alfab3 opened 3 weeks ago

alfab3 commented 3 weeks ago

When running MCWrapper there is an issue when the option for beamconfig:

define beamconfig TEMPBEAMCONFIG

MCWrapper crashes with this error:

BeamProperties: Parsing config file gen_2pi_primakoff_101582_000_beam.conf
BeamProperties: Using flux from CCDB run 101582
Using CCDB variation = mc
terminate called after throwing an instance of 'std::runtime_error'
  what():  Error: (1270) in 'MySQLDataProvider::GetAssignmentShort(int, const string&, time_t, const string&)' : 'Error fetching assignment'
Abort (core dumped)

It seems as though the luminosity is not entered into the database yet: PHOTON_BEAM/pair_spectrometer/lumi/tagh/untagged PHOTON_BEAM/pair_spectrometer/lumi/tagm/untagged

Commenting out the beamconfig line fixes issue for now, but I think we need this entered into the database which I am unsure of how to do

nsjarvis commented 3 weeks ago

I think that Justin will provide the luminosity, and I expect that he is waiting for all of the REST files to be processed; about 6% of the NERSC jobs failed and Igal is redoing those.

nsjarvis commented 3 weeks ago

Oh and I think Igal said last Wed that he expected it'd take 2-3 weeks to finish reprocessing the problem jobs.

jrstevenjlab commented 3 weeks ago

Yes, we don't fill the flux tables until after the production is complete. In the meantime you can use the cobrems generator and set the electron beam and coherent peak energies to match the setting you want.

FLUX_TO_GEN=cobrems eBEAM_ENERGY=11.5 COHERENT_PEAK=5.8

Those might actually get populated from RCDB if you leave them out of your MC.config file?

Of course you can also specify what energy range you actually want to generate events over with the min/max flags.

GEN_MIN_ENERGY=3 GEN_MAX_ENERGY=11.5

aaust commented 3 weeks ago

It would be great if the BeamProperties class could catch this case and print a useful error message.

jrstevenjlab commented 3 weeks ago

I thought a check already existed to thrown and error and print a message if the flux integral was zero. I added another check on the existence of the CCDB table here https://github.com/JeffersonLab/halld_sim/pull/344