OpenIntervals: Difference between revisions

From Mu2eWiki
Jump to navigation Jump to search
Tag: Reverted
Tag: Manual revert
Line 5: Line 5:


==Example==
==Example==
[[File:openintervals.png|right|width=15px|example of open intervals]]
[[File:openintervals.png|right|width=150px|example of open intervals]]
In the displayed example, each "CID" represents a "calibration identifier" which contains on instance of calibration content.  Run number passes to the right and time passed down the chart.  The first row (CID0,1,2) represent the simplest case - when CID0 was inserted, it was the only calibration and represented all runs.  When CID1 was committed, it takes over from its start run to the future, then CID2 similarly took over the future at some point.  The rest represent patches which supersede the original set for different intervals.  The red boxes indicate the algorithm choice for the calibration content.  CID10 being the latest open-ended interval will be the choice for future runs.
In the displayed example, each "CID" represents a "calibration identifier" which contains on instance of calibration content.  Run number passes to the right and time passed down the chart.  The first row (CID0,1,2) represent the simplest case - when CID0 was inserted, it was the only calibration and represented all runs.  When CID1 was committed, it takes over from its start run to the future, then CID2 similarly took over the future at some point.  The rest represent patches which supersede the original set for different intervals.  The red boxes indicate the algorithm choice for the calibration content.  CID10 being the latest open-ended interval will be the choice for future runs.



Revision as of 00:08, 19 April 2025

Introduction

As explained more in ConditionsData, the standard conditions database has "closed intervals". When a calibration is assigned to run range, the range must have a beginning and an end. If an executable attempts to retrieve calibrations outside the known intervals, the job throws an error. This style require close maintenance, but allows precise control and reproducibility of conditions.

The "open intervals" style reduces the reproducibility but is simpler to maintain. In this style, calibrations are typically assigned an open run range. The interval starts from a given run when the calibration was created, but there is no end to the interval. Requests for calibrations for future runs will be matched to last open interval. At some point in the future a new calibration is created, a new open interval is added, and this calibration takes over as the valid content for future runs. The order that calibrations are stored to the database is important because the later entry (containing the requested run) overrides the earlier entry. If a patch is required, it is added with a start and end declaring the patch period. Since this is the last entry, it takes precedence for the patch period.

Example

example of open intervals

In the displayed example, each "CID" represents a "calibration identifier" which contains on instance of calibration content. Run number passes to the right and time passed down the chart. The first row (CID0,1,2) represent the simplest case - when CID0 was inserted, it was the only calibration and represented all runs. When CID1 was committed, it takes over from its start run to the future, then CID2 similarly took over the future at some point. The rest represent patches which supersede the original set for different intervals. The red boxes indicate the algorithm choice for the calibration content. CID10 being the latest open-ended interval will be the choice for future runs.

Template:-

Code recipes

Calibration content to be committed needs to be prepared in the same way as standard content. The table must be [[1]] in code, created using SQL, and defined as a table with a TID. Since this part is the same , this table can also be used in a standard conditions set, with closed intervals. The open interval IoVs are kept separate from the closed interval IoV's. The content must be prepared in [text format].