JeffersonLab / coatjava

1 stars 18 forks source link

ALERT s/l/c/o indexing starts from zero #272

Open baltzell opened 4 months ago

baltzell commented 4 months ago

Should see how much work it would be adopt the standard convention.

baltzell commented 4 months ago

For the two geometry services, the necessary changes look straightforward enough.

AHDC reconstruction uses indexes for a few geometry calculations and bounds checking, but it looks also manageable. This should be all of them:

phi calculation

something with bounds, looks as if it was already assuming indexing started from 1?

phi calculation

a bit scary but presumably easy

various geometry calculations

baltzell commented 4 months ago

@mpaolone In the recent file from @efuchey, attached, AHDC::adc's layer cleary starts from 0, but I never see component=0. That's consistent with gemc 5.9's ahdc__geometry* files and hit process code. The geometry services (AHDC and ATOF) in COATJAVA internally index everything from zero (and use them for geometry calculations) and export them with the same convention. In GEMC's factory.groovy, the compoment (and only the component) it receives from the geometry service is manually incremented by one for AHDC before outputting the geometry txt files.

So this surely explains the manual -1 offsetting and 1:N bounds checking for only wire (compoment) in AHDC reconstruction, which is then used for geometry calculations similar to as in the geometry service.

alert_adc_sim_1k.hipo.gz