%CERTIFY%

# Introduction to the NBPhys Package

## Introduction

This is a small introductory tutorial to the NBPhys package, the primary goal of this tutorial is to introduce the use of NBPhys in PhysicsAnalysis code.

NBPhys is a Object Oriented framework for writing "PhysicsAnalysis". It provides a "natural" object model to map your analysis. It also provides automatic solutions for handling combinatory, output, and memory management.

This tutorial introduces NBPhys' basic concepts, and objetcs.

## Concepts

### Nodes

We can write down a "decay tree" of the decay we wish to analyze. The leaf nodes, would be the final state particles, and the nodes in the upper levels would be inferred particles.

The idea of NBPhys' Nodes is symmilar to the Nodes in the decay tree. But it is a little more general.

NBPhys Nodes have two main functionalities:

• To provide a container for all kinds of data, like mass, charge, momenta, etc...(Data Maps)
• To remember the lineage of a Node so a combinatory engine can ensure that there are no clashes of information in the lineage of the node.

### Combinatory Utilities

NBPhys has a combinatory engine that makes combinations of nodes, it automatically verifies that no clashes of information are present.

### Filter

NBPhys filters are object look inside a Node, perform calculations and decide wether this node is to be accepted. An example is an Invariant Mass window filter, this filter would:

• Look inside the node for information that can be used to calculate the mass
• Calculate the node's invariant mass
• Asociate the calculated mass with the node
• Accept or reject the node according to a window defined by the user

### Writers

The job of a writer "T" is to describe how a data of type "T" is to be written on an ntuple. For example, a writer for a 3Vector would output to the NTuple as different branches, the X, Y, and Z.

This four concepts are the basis of NBPhys, on this tutorial there will be examples and excerciese for every one of them

## Setup

The package to be used during the tutorial is being tested with athena release 11.0.5

Setup Steps:

• If this is the first time you are using athena, setup your working area "INSERT LINK"

• Setup your cmt for version 11.0.5,opt; `source ~/cmtdir/setup.sh -tag=11.0.5,opt`
• Go to the top of your working area for the 11.0.5 release
• Check Out the latest TestRelease; `cmt co TestRelease`
• `source ~/ekajomov/public/installNBPhys.sh`
• `source TestRelease/TestRelease-00-00-18/cmt/setup.sh`
• `cd NBPhys/NBAnalysis/NBAnalysisAlgorithms/NBAnalysisAlgoritms-xx-xx-xx/run`
• `cmt br gmake`
Hopefully, after a few minutes, NBPhys will be compiled and ready to run.

## A First Example

This first example algorithm explores some of NBPhys' features, during the tutorial we will add some functionality to the code.