Analysis codes
An analysis code is the engine's classification of a facility — its answer to "how do I treat this facility?" Each side of a pair gets its own analysis code: one for the PES, one for the ES. The codes are the output of the facility-side analysis (driven by type code, attributes, barricading, relationship, and segment) and the input to the HD-specific explosive libraries that produce the actual required distances.
By the end of this lesson you should be able to:
- Distinguish a facility's analysis code from the per-hazard required distance the engine ultimately returns
- Recognize the canonical DCMA analysis codes for common facilities
- Predict the analysis code from a feature's type code, attributes, relationship, and barricade state
- Explain how the (PES code, ES code) pair drives the HD libraries
What an analysis code is — and is not
An analysis code captures how the engine should treat the facility, not the numerical answer for a given pair:
- The PES analysis code describes the source of explosives — its construction, segmentation, and barricade state. Examples:
AGSU(Above-Ground Storage, Unbarricaded),ECM7FB(7-bar ECM, Front, Barricaded). - The ES analysis code describes how the receiving side should be evaluated — typically the Exposure Type and barricade state for that pair. Examples:
IBD(treat as inhabited-building distance),ILDU(treat as intraline distance, unbarricaded).
Once both codes are resolved, the engine has a complete picture of the facility-side configuration. The next step — picking the right K-factor, formula, or fixed-distance rule — is then a question for the HD libraries, not for the analysis-code resolution.
Two analysis paths produce two analysis codes
Each pair returns a PES-side and an ES-side analysisPath — see PES/ES analysis paths. Each path resolves to one analysis code:
- The PES path walks type code → attributes → barricade → segment to produce the PES analysis code
- The ES path walks type code → relationship → barricade to produce the ES analysis code
Both paths complete before any explosive math runs. The HD libraries only see the resolved codes.
Examples from DCMA
The DCMA criteria define a fixed set of analysis codes per type code. Cycling through a feature's settings reveals the codes available for that type.
AGM (Above-Ground Magazine)
| Code | Meaning |
|---|---|
AGSU | Above-ground storage, unbarricaded |
AGSB | Above-ground storage, barricaded |
NQD | No QD required |
A barricade swap on an AGM moves the PES analysis code from AGSU to AGSB. A different change — making the facility part of an IDS-essential operation — could produce NQD instead.
ECM7 (7-bar Earth-Covered Magazine)
| Code | Meaning |
|---|---|
ECM7FU | 7-bar ECM, front, unbarricaded |
ECM7FB | 7-bar ECM, front, barricaded |
ECM7R | 7-bar ECM, rear |
ECM7S | 7-bar ECM, side |
ECMFU / ECMFB / ECMR / ECMS | Generic ECM analogs (used when the bar rating doesn't matter for the path) |
NQD | No QD required |
ECM analysis codes are segment-aware: the front, rear, and side faces resolve to different codes because the criteria treat them differently. The front also distinguishes barricaded from unbarricaded; the rear and side do not.
IHB / EOL / PTR (representative ES analysis codes)
| Type code | Possible analysis codes |
|---|---|
IHB | IBD, ILDB, ILDU, NQD |
PTR | IBD, PTRD, NQD |
EOL | AGSU, AGSB, IBD, ILDB, ILDU, NQD (acts as PES or ES) |
The relationship code matters here: an IHB on an unrelated pair lands on IBD; the same IHB on a related (or sameline) pair lands on ILDU (or ILDB if a barricade qualifies). The same physical facility produces different ES analysis codes depending on what pair it is participating in.
[TODO: FILL IN — confirm the canonical full analysis-code list per DCMA type code, and any codes specific to less-common facilities (AUX, UTE, UTW, etc.).]
Analysis codes feed the HD libraries
After the PES and ES analysis codes resolve, the engine hands them — together with the explosive weight per hazard division — to the HD-specific libraries. The library's job is to answer "given an AGSU PES carrying X lb of 1.1, sited against an IBD ES, what required distance applies?"
In the QD worked example, the HD 1.1 library opens with:
QD Analysis, NEW: 1000lbs PES:AGSU to ES:IBD
Both codes appear in the first line. Everything that follows — the K-factor, the HFD evaluation, the cross-hazard comparison — is the library reasoning about that specific (AGSU, IBD, 1,000 lb 1.1) input.
Change either analysis code (e.g., barricade the PES so it becomes AGSB, or make the pair sameline so the ES becomes ILDU) and the HD library walks a different criteria flow with potentially different K-factors, formulas, or thresholds.
Predicting an analysis code from inputs
For most type codes, the analysis code is fully determined by:
- Type code — sets the family (AGS*, ECM*, IBD/ILD*, etc.)
- Segment — for multi-face features, picks the side suffix (F, R, S)
- Barricade state — picks the U/B suffix where applicable
- Relationship (ES side only) — chooses between IBD-family and ILD-family
- Special states (IDS Essential, NQD-eligible facilities) — can short-circuit to
NQD
For ECMs, point 2 is the wrinkle that catches new users: the segment under analysis (front vs rear vs side) determines the ES, not just the type code.
Try it
In the calculator with an AGM PES → IHB ES:
- Run analysis and note the resolved PES and ES analysis codes (expect
AGSUandIBD) - Toggle barricaded on the PES — the PES code should move to
AGSB - Change the relationship code to
sameline— the ES code should move toILDU - Add a barricade between PES and ES — the ES code should move to
ILDB - Re-run after each change and observe how the per-hazard required distances shift, even though the underlying inputs (NEW, geometry) did not
This is the cleanest demonstration that the (PES code, ES code) pair drives every downstream value.
Related
- Type codes and feature categories — the input that anchors the analysis-code resolution
- Calculator: Attributes — refines which entries the engine traverses
- Segments and sides — the segment for multi-face features
- Relationships — the relationship code that gates ES analysis codes
- Barricading — barricade state that distinguishes B vs U variants
- Criteria path — the citations behind each analysis-code resolution
- Tracing analysis paths — the narrated walkthrough showing the resolution
- QD results: required, blast, frag — the HD libraries that consume the analysis codes
- Flowcharts — visual cousin of the analysis paths