Metadata-Version: 2.4
Name: ispynanoaod
Version: 0.1.2
Summary: A simple python event display for CMS nanoaod
Author-email: Thomas McCauley <thomas.mccauley@cern.ch>
License: BSD 3-Clause License
        
        Copyright (c) 2025, Thomas McCauley
        All rights reserved.
        
        Redistribution and use in source and binary forms, with or without
        modification, are permitted provided that the following conditions are met:
        
        1. Redistributions of source code must retain the above copyright notice, this
           list of conditions and the following disclaimer.
        
        2. Redistributions in binary form must reproduce the above copyright notice,
           this list of conditions and the following disclaimer in the documentation
           and/or other materials provided with the distribution.
        
        3. Neither the name of the copyright holder nor the names of its
           contributors may be used to endorse or promote products derived from
           this software without specific prior written permission.
        
        THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
        AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
        IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
        DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
        FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
        DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
        SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
        CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
        OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
        OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
Project-URL: Homepage, https://github.com/cms-outreach/ispy-nanoaod
Keywords: visualization,nanoaod,CMS
Requires-Python: >=3.8
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: pythreejs
Requires-Dist: uproot
Requires-Dist: awkward
Requires-Dist: jupyter
Dynamic: license-file

[![Binder](https://mybinder.org/badge_logo.svg)](https://mybinder.org/v2/gh/cms-outreach/ispy-nanoaod/HEAD) [![DOI](https://zenodo.org/badge/DOI/10.5281/zenodo.17369554.svg)](https://doi.org/10.5281/zenodo.17369554)

# iSpy NanoAOD: An event display for the CMS NanoAOD format

This application allows one to visualize events in the CMS NanoAOD format in a Jupyter notebook.

## Installation
```
pip install ispynanoaod
```

### Installation for developers:
Clone this repository:
```
git clone https://github.com/cms-outreach/ispy-nanoaod.git
```
Install locally:
```
cd ispy-nanoaod
pip install -e .
```

## Usage
See the example notebooks in the `examples` dir. You may also open and run them
using the link to Binder above.

### Quick start
Open a notebook using for example `jupyter lab`.

Import the libraries:
```
import os
import subprocess
import ispynanoaod as ispy
```

Download some data:
```
file_name = 'EEB2FE3F-7CF3-BF4A-9F70-3F89FACE698E.root'
file_url = 'http://opendata.cern.ch/eos/opendata/cms/Run2016H/DoubleMuon/NANOAOD/UL2016_MiniAODv2_NanoAODv9-v1/2510000/EEB2FE3F-7CF3-BF4A-9F70-3F89FACE698E.root'

if not (os.path.isfile(f'{file_name}')):
    subprocess.run(['curl', '-O', f'{file_url}'])
```

Visualize:
```
display = ispy.EventDisplay()
display.load_file(file_name)
display.display()
```

![image](imgs/ispynanoaod-quickstart.png)




