Skip to content

Repository files navigation

CMS Dimuon Signal vs Background — ML Classifier + Streamlit Demo

This project builds an end-to-end machine learning prototype using real CMS Open Data from the CERN Open Data Portal.
It classifies dimuon collision events as Z→μμ signal-like or background and provides an interactive Streamlit web interface for exploration.


Project Goal

  • Use real CMS dimuon collision data
  • Engineer physics-inspired features
  • Train a classifier to separate signal vs background
  • Evaluate using confusion matrix, ROC, and precision–recall
  • Deploy as an interactive Streamlit app

Data

  • Source: CERN Open Data Portal (CMS dimuon dataset)
  • File used: Dimuon_DoubleMu.csv (loaded locally via the Streamlit uploader)
  • Each row = one collision event with two reconstructed muons
  • Labeling (physics-motivated):
    signal = 1 if 80 ≤ M ≤ 100 GeV, else background = 0
    (Z-boson peak region)

Methods

  • Feature engineering:
    • momentum magnitude: p = sqrt(px^2 + py^2 + pz^2)
    • transverse energy: ET = sqrt(px^2 + py^2)
    • total transverse momentum: pt_sum = pt1 + pt2
  • Model: RandomForestClassifier
  • Evaluation:
    • confusion matrix + classification report
    • ROC curve (AUC ~ 0.999)
    • precision–recall curve
  • Explainability:
    • feature_importances_ (top features dominated by pt_sum, pt1, pt2, ET1, ET2)

Sample Output Images

Streamlit Demo

Streamlit Demo Streamlit Demo

ROC Curve

ROC

Precision–Recall Curve

PR

Invariant Mass (Z peak)

Mass


How to Run

Copy code:

streamlit run app.py

and Upload the dataset Upload Dimuon_DoubleMu.csv from CERN Open Data.

Notes This is a demonstration prototype showing how physics intuition and machine learning can be integrated for particle physics event classification. It is designed for learning and portfolio demonstration.

About

Physics-informed machine learning pipeline for classifying CMS dimuon events, with an interactive Streamlit demo using real CERN Open Data.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages