Anchoring simulation to particular timestamp

Dear all,
during simulation and reconstruction we need to access CCDB for calibration and other stuff. For that timestamp is needed which must be given to CCDB Manager. But how to set this timestamp properly and retrieve it at different steps of simulation (o2-sim, o2-sim-digitizer-workflow, o2-xxx-digi2raw)?
Is there any way to know timestamp from raw data? For example, my task is subscribed for x:CPV/DIGITS/0 stream. How can I know the time at which raw data for it was produced?
Thank you & regards,
Sergey

Hi @sevdokim

The o2-sim is generic and is not aware of time. The time info of digitization and reconstruction is based on the timestamp of the TF start, defined as timestamp_of_the_orbit_reset_to_0 + orbit_duration*first_orbit_of_TF. This is still work in progress. The first_orbit_of_TF is provided by the DataHeader::firstTForbit in all O2 inputs.

You can tell to o2-sim-digitizer-workflow to do digitization from some particular orbit using HBFUtils settings, see AliceO2/DetectorSimulation.md at dev · AliceO2Group/AliceO2 · GitHub for details, but note that at the moment this will not be translated to some particular query time for CCDB.

Dear @shahoian ,
thank you very much! This link is very useful for me.
Do I understand correctly that o2-sim is tool for producing hits which are in no way dependence from calibration, settings, etc? And such objects then can be digitized with respect to any anchors? How about alignment? If alignment changes in time then hits will be also different for different alignments.

Small addition: o2-sim does take a time parameter which is used to fetch alignment objects, so it can be anchored to some run-conditions.

@swenzel thanks for correction, was not aware about the timestamp option. Eventually we should come to uniform way of anchoring, either via abs. timestamp, or via run_number and TF or orbit ID.