# cms-sw/cmssw architecture

> Architecture diagram of the GitHub repository cms-sw/cmssw, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-11-14). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/cms-sw/cmssw
- Repository: https://github.com/cms-sw/cmssw

## Overview

CMSSW is a broad framework for event processing and scientific computing; the README provides only a brief introduction. This map focuses on the sampled runtime capabilities: framework services and events, random-state production, file storage, and a tracklet-matching component. The excerpts show some calls and registrations, but not the full event schedule or all plugin wiring, so unverified links are omitted or marked dashed.

Main entry points: [`FWStorage/StorageFactory/interface/StorageFactory.h`](https://github.com/cms-sw/cmssw/blob/master/FWStorage/StorageFactory/interface/StorageFactory.h) (Storage Factory), [`IOMC/RandomEngine/plugins/RandomEngineStateProducer.cc`](https://github.com/cms-sw/cmssw/blob/master/IOMC/RandomEngine/plugins/RandomEngineStateProducer.cc) (State Producer), [`FWStorage/XrdAdaptor/plugins/XrdStorageMaker.cc`](https://github.com/cms-sw/cmssw/blob/master/FWStorage/XrdAdaptor/plugins/XrdStorageMaker.cc) (XRootD Adapter), [`FWStorage/DCacheAdaptor/plugins/DCacheStorageMaker.cc`](https://github.com/cms-sw/cmssw/blob/master/FWStorage/DCacheAdaptor/plugins/DCacheStorageMaker.cc) (DCache Adapter)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_framework["Framework Core"]
  node_event["Event API<br/>[Event.h]"]
  node_parameters["Parameter Sets<br/>[ParameterSet.h]"]
  node_logging["Message Logging<br/>[MessageLogger.h]"]
  node_service["Service Access<br/>[Service.h]"]
  node_registry["Service Registry<br/>[ServiceRegistry.h]"]
  node_exception["Base Exceptions<br/>[Exception.h]"]
  node_edmexception["Framework Exceptions<br/>[EDMException.h]"]
end

subgraph group_random["Random State"]
  node_rng["Random Service"]
  node_stateproducer["State Producer"]
  node_randomstates["Engine States"]
end

subgraph group_storage["File Storage"]
  node_storagefactory["Storage Factory<br/>[StorageFactory.h]"]
  node_storage["Storage API<br/>[Storage.h]"]
  node_posbuffer["Position Buffers<br/>[IOPosBuffer.h]"]
  node_maker["Storage Maker<br/>[StorageMaker.h]"]
  node_makerfactory["Maker Registry"]
  node_rootfile["ROOT File Adapter"]
  node_xrd["XRootD Adapter<br/>[XrdStorageMaker.cc]"]
  node_dcache["DCache Adapter"]
end

subgraph group_trigger["Tracklet Matching"]
  node_matchengine["Match Engine<br/>[MatchEngineUnit.cc]"]
  node_settings["Tracklet Settings<br/>[Settings.h]"]
end

node_eventproducer(("Event Processing"))

node_service -->|"accesses"| node_registry
node_edmexception -->|"extends"| node_exception
node_eventproducer -.->|"runs"| node_stateproducer
node_stateproducer -->|"reads state"| node_rng
node_stateproducer -->|"puts products"| node_event
node_stateproducer -->|"creates"| node_randomstates
node_rootfile -->|"opens via"| node_storagefactory
node_storagefactory -.->|"returns"| node_storage
node_storage -->|"uses buffers"| node_posbuffer
node_storagefactory -.->|"dispatches to"| node_maker
node_xrd -->|"reads hints"| node_storagefactory
node_dcache -->|"reads hints"| node_storagefactory
node_xrd -->|"registers with"| node_makerfactory
node_dcache -->|"registers with"| node_makerfactory
node_matchengine -->|"uses"| node_settings

click node_event "https://github.com/cms-sw/cmssw/blob/master/FWCore/Framework/interface/Event.h"
click node_parameters "https://github.com/cms-sw/cmssw/blob/master/FWCore/ParameterSet/interface/ParameterSet.h"
click node_logging "https://github.com/cms-sw/cmssw/blob/master/FWCore/MessageLogger/interface/MessageLogger.h"
click node_service "https://github.com/cms-sw/cmssw/blob/master/FWCore/ServiceRegistry/interface/Service.h"
click node_registry "https://github.com/cms-sw/cmssw/blob/master/FWCore/ServiceRegistry/interface/ServiceRegistry.h"
click node_exception "https://github.com/cms-sw/cmssw/blob/master/FWCore/Utilities/interface/Exception.h"
click node_edmexception "https://github.com/cms-sw/cmssw/blob/master/FWCore/Utilities/interface/EDMException.h"
click node_rng "https://github.com/cms-sw/cmssw/blob/master/FWCore/AbstractServices/interface/RandomNumberGenerator.h"
click node_stateproducer "https://github.com/cms-sw/cmssw/blob/master/IOMC/RandomEngine/plugins/RandomEngineStateProducer.cc"
click node_storagefactory "https://github.com/cms-sw/cmssw/blob/master/FWStorage/StorageFactory/interface/StorageFactory.h"
click node_storage "https://github.com/cms-sw/cmssw/blob/master/FWStorage/StorageFactory/interface/Storage.h"
click node_posbuffer "https://github.com/cms-sw/cmssw/blob/master/FWStorage/StorageFactory/interface/IOPosBuffer.h"
click node_maker "https://github.com/cms-sw/cmssw/blob/master/FWStorage/StorageFactory/interface/StorageMaker.h"
click node_makerfactory "https://github.com/cms-sw/cmssw/blob/master/FWStorage/StorageFactory/interface/StorageMakerFactory.h"
click node_rootfile "https://github.com/cms-sw/cmssw/blob/master/FWStorage/TFileAdaptor/src/TStorageFactoryFile.cc"
click node_xrd "https://github.com/cms-sw/cmssw/blob/master/FWStorage/XrdAdaptor/plugins/XrdStorageMaker.cc"
click node_dcache "https://github.com/cms-sw/cmssw/blob/master/FWStorage/DCacheAdaptor/plugins/DCacheStorageMaker.cc"
click node_matchengine "https://github.com/cms-sw/cmssw/blob/master/L1Trigger/TrackFindingTracklet/src/MatchEngineUnit.cc"
click node_settings "https://github.com/cms-sw/cmssw/blob/master/L1Trigger/TrackFindingTracklet/interface/Settings.h"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_event,node_parameters,node_logging,node_service,node_registry,node_exception,node_edmexception toneBlue
class node_rng,node_stateproducer,node_randomstates toneAmber
class node_storagefactory,node_storage,node_posbuffer,node_maker,node_makerfactory,node_rootfile,node_xrd,node_dcache toneMint
class node_matchengine,node_settings toneRose
class node_eventproducer toneIndigo
```

## Components

### Framework Core

- [Event API](https://github.com/cms-sw/cmssw/blob/master/FWCore/Framework/interface/Event.h): `FWCore/Framework/interface/Event.h`
- [Parameter Sets](https://github.com/cms-sw/cmssw/blob/master/FWCore/ParameterSet/interface/ParameterSet.h): `FWCore/ParameterSet/interface/ParameterSet.h`
- [Message Logging](https://github.com/cms-sw/cmssw/blob/master/FWCore/MessageLogger/interface/MessageLogger.h): `FWCore/MessageLogger/interface/MessageLogger.h`
- [Service Access](https://github.com/cms-sw/cmssw/blob/master/FWCore/ServiceRegistry/interface/Service.h): `FWCore/ServiceRegistry/interface/Service.h`
- [Service Registry](https://github.com/cms-sw/cmssw/blob/master/FWCore/ServiceRegistry/interface/ServiceRegistry.h): `FWCore/ServiceRegistry/interface/ServiceRegistry.h`
- [Base Exceptions](https://github.com/cms-sw/cmssw/blob/master/FWCore/Utilities/interface/Exception.h): `FWCore/Utilities/interface/Exception.h`
- [Framework Exceptions](https://github.com/cms-sw/cmssw/blob/master/FWCore/Utilities/interface/EDMException.h): `FWCore/Utilities/interface/EDMException.h`

### Random State

- [Random Service](https://github.com/cms-sw/cmssw/blob/master/FWCore/AbstractServices/interface/RandomNumberGenerator.h): `FWCore/AbstractServices/interface/RandomNumberGenerator.h`
- [State Producer](https://github.com/cms-sw/cmssw/blob/master/IOMC/RandomEngine/plugins/RandomEngineStateProducer.cc): `IOMC/RandomEngine/plugins/RandomEngineStateProducer.cc`
- **Engine States**

### File Storage

- [Storage Factory](https://github.com/cms-sw/cmssw/blob/master/FWStorage/StorageFactory/interface/StorageFactory.h): `FWStorage/StorageFactory/interface/StorageFactory.h`
- [Storage API](https://github.com/cms-sw/cmssw/blob/master/FWStorage/StorageFactory/interface/Storage.h): `FWStorage/StorageFactory/interface/Storage.h`
- [Position Buffers](https://github.com/cms-sw/cmssw/blob/master/FWStorage/StorageFactory/interface/IOPosBuffer.h): `FWStorage/StorageFactory/interface/IOPosBuffer.h`
- [Storage Maker](https://github.com/cms-sw/cmssw/blob/master/FWStorage/StorageFactory/interface/StorageMaker.h): `FWStorage/StorageFactory/interface/StorageMaker.h`
- [Maker Registry](https://github.com/cms-sw/cmssw/blob/master/FWStorage/StorageFactory/interface/StorageMakerFactory.h): `FWStorage/StorageFactory/interface/StorageMakerFactory.h`
- [ROOT File Adapter](https://github.com/cms-sw/cmssw/blob/master/FWStorage/TFileAdaptor/src/TStorageFactoryFile.cc): `FWStorage/TFileAdaptor/src/TStorageFactoryFile.cc`
- [XRootD Adapter](https://github.com/cms-sw/cmssw/blob/master/FWStorage/XrdAdaptor/plugins/XrdStorageMaker.cc): `FWStorage/XrdAdaptor/plugins/XrdStorageMaker.cc`
- [DCache Adapter](https://github.com/cms-sw/cmssw/blob/master/FWStorage/DCacheAdaptor/plugins/DCacheStorageMaker.cc): `FWStorage/DCacheAdaptor/plugins/DCacheStorageMaker.cc`

### Tracklet Matching

- [Match Engine](https://github.com/cms-sw/cmssw/blob/master/L1Trigger/TrackFindingTracklet/src/MatchEngineUnit.cc): `L1Trigger/TrackFindingTracklet/src/MatchEngineUnit.cc`
- [Tracklet Settings](https://github.com/cms-sw/cmssw/blob/master/L1Trigger/TrackFindingTracklet/interface/Settings.h): `L1Trigger/TrackFindingTracklet/interface/Settings.h`

### Other components

- **Event Processing**

## Connections

- Service Access → Service Registry: accesses (evidence: `FWCore/ServiceRegistry/interface/Service.h`)
- Framework Exceptions → Base Exceptions: extends (evidence: `FWCore/Utilities/interface/EDMException.h`)
- Event Processing → State Producer: runs
- State Producer → Random Service: reads state (evidence: `IOMC/RandomEngine/plugins/RandomEngineStateProducer.cc`)
- State Producer → Event API: puts products (evidence: `IOMC/RandomEngine/plugins/RandomEngineStateProducer.cc`)
- State Producer → Engine States: creates (evidence: `IOMC/RandomEngine/plugins/RandomEngineStateProducer.cc`)
- ROOT File Adapter → Storage Factory: opens via (evidence: `FWStorage/TFileAdaptor/src/TStorageFactoryFile.cc`)
- Storage Factory → Storage API: returns
- Storage API → Position Buffers: uses buffers (evidence: `FWStorage/StorageFactory/interface/Storage.h`)
- Storage Factory → Storage Maker: dispatches to (evidence: `FWStorage/StorageFactory/interface/StorageFactory.h`)
- XRootD Adapter → Storage Factory: reads hints (evidence: `FWStorage/XrdAdaptor/plugins/XrdStorageMaker.cc`)
- DCache Adapter → Storage Factory: reads hints (evidence: `FWStorage/DCacheAdaptor/plugins/DCacheStorageMaker.cc`)
- XRootD Adapter → Maker Registry: registers with (evidence: `FWStorage/XrdAdaptor/plugins/XrdStorageMaker.cc`)
- DCache Adapter → Maker Registry: registers with (evidence: `FWStorage/DCacheAdaptor/plugins/DCacheStorageMaker.cc`)
- Match Engine → Tracklet Settings: uses (evidence: `L1Trigger/TrackFindingTracklet/src/MatchEngineUnit.cc`)
