This part of the training deals with using HEPExplorer modules to perform simple tasks such as:
Examples are based on IRIS Explorer maps and modules installed at Cern and available to outside institutes as part of the Roadshow Installation Kit.
Chose the histogramPlot map from the Librarian panel. When the map is ready on the Map Editor, you should first select a database by just clicking on its name in the ContainerBrowser panel and then go on to select a container name. The list of histograms is now visible in the HistOOgramReader panel. It suffices to select a histogram by clicking on its name for it to be displayed in the Render window. It can be useful to set the render window background to white via the edit background color option in the Viewing menu of the Render window.
The map is shown in the figure below.

The ContainerBrowser module allows you to browse the databases in the federated database defined by the OO_FD_BOOT environment variable. When the module starts, the list of the data bases available in the OO_FD_BOOT federated database appears in the DB List scroll field. A list of all the containers available in a given database can be obtained by click on the database name in question the DB List field. You can also create a new container belonging to the chosen database by typing the new container's name in the container text field. The output of this module is a container which can be connected to the Histogram Reader module.

The HistOOgramReader module receives a container from the ContainerBrowser module and allows you to select a histogram from that container. The list of histograms appears in the Histograms field. You can select the type of histogram should be shown (1D, 2D or all) using the radio buttons on the right of the Histogram list. By clicking on one of the histogram names in that list, the selected histogram is send on the output port and can be received by any module able to take an histogram as its input.

The module receives the histogram from the HistOOgramReader module. It can also take lattices as input. It creates the geometry from these data and sends them to the Render module, which shows the result on screen. The module can also save the picture in a PostScript file.
Various plot attributes can be changed via radio buttons or pull-down menus.

HEP Interactive Analysis in IRIS Explorer is implemented by a set of HEPExplorer Modules. Generally speaking, the current set of Modules allows you to extract data from an Objectivity/DB data store and put them in a HistOOgram, using cuts on the data set expressed in C++ syntax. In particular modules implement the following functions:
Apart from accessing the data in the tag, users can invoke static C++ functions that implement, e.g., common physics or access the experiment specific event object (by traversing the association between a tag and its related event). User-defined functions can be used whenever a C++ expression is allowed.
By using two more modules from the HEPExplorer suite, users can book in advance the histogram that will be filled (like with PAW's NTUPLE/PROJECT command).
The modules can be grouped in an IRIS Explorer Map to avoid redefining every time the user's analysis setup and such a map can be executed in a batch fashion using IRIS Explorer's script language.
As an example of how to use these modules we can look at the explorablePlot map, which produces HistOOgrams out of an Explorable Collection. Default HistOOgrams are created in a temporary container that is cleaned up every-time you run the map. You can think about this map as a NT/PL replacement.

If you want to produce a HistOOgram you should do the following.
The explorablePlot map can extended in three different ways:
The C++ code that scans the data is generated and compiled every time you modify one of the C++ expressions on the HepExplorableSelector module. Since compilation could take some time it is very annoying to recompile the code whenever you make a small change on the cut value.
Symbolic constants overcome this problem. Instead of specifying the numerical value of your cut in the Match expression, such as:
Npart > 500 you define a symbolic constant Npmin and express the Match expression as:
Npart > Npmin
Then you enter the value for Npmin in the Constants widget,
Npmin 500
When you press the Confirm button the code is recompiled, but if you then change the symbolic constant's value,
Npmin 600
such a value is passed to the module and the code is not recompiled.
The default behaviour of the HistOOgramFill module is to fill an HistOOgram booked on the fly. The min and max values of the default histOOgram are sampled from the data, while the number of bins is 100 for 1D histOOgrams and 40 by 40 for 2D HistOOgrams.
If you want to project your data over an histOOgram with a predefined binning, you can use the optional Histogram input port of the module. If you specify a valid HistOOgram object ID on this input, the corresponding HistOOgram will be used instead of the default one.
If the HistOOgram you want to fill already exists, you can look it up using the HistOOgramReader module, otherwise you can create it using the HistOOgramCreate module; nevertheless you must connect the HistOOgramReader or HistOOgramCreate output to the Histogram input of HistOOgramFill.
The C++ code implementing the user function is declared in partCut.h and implemented in partCut.cpp. The code is compiled by typing the name of the .cpp file in the LibMaker module's panel.

HEPExplorer modules for interactive analysis allow you to easily manipulate tag fields to define cuts, or to collect information in a histogram. As mentioned before, no knowledge of the specific object model is required as long as you deal with attributes defined in the tag. If you want to cross the association between a Tag and its related event, HEPExplorer modules have to know about your object model.
Information about the object model is communicated to the modules by specifying the following:
We assume that the Event Tag was already created before, so that header files and shared library already exist and the concrete Tag class name is known.
After getting the information you need, you should specify the following:
In this case the shared library is already installed in a directory belonging to the shared library path and the header file is placed in $(EXPLORERUSERHOME)/include, a directory that is always searched for include files.
We see that we have a concrete Tag whose name is AtlasProdTag, the header file is AtlasProd.h, and the shared library file is AtlasProd.sl. Once all necessary information is defined, you can use the shortcut variable theTag to access the Concrete tag and ask for an event reference using the getEvent() method defined there. With the reference to the event, you can access the individual attributes as you would in a normal C++ program (in our case the attribute is named NgTrack and corresponds to the number of tracks in the event).
To add fit capabilities to the standard explorablePlot map, users should put on the Map editor two more modules:
Once the modules are there, three connection must be added:
Refer to the next chapter to see how to usethe DataFit module.
This module fits a mathematical model or a given user function to data presented at its input ports. The underlying minimisation engine is based on Minuit. The incoming data can be one- or two-dimensional and can be presented as a lattice (any type, any coordinate type) or a persistent histogram characterised by its Objectivity/DB object identifier.
After the data have been received, the module allows you to:
The layout of the DataFit panel is shown below

The panel offers further various dials, sliders, input boxes, etc., to communicate with the fitting module. Each parameter in the fit is identified by its name. A text input widget allows you to type in the symbolic form of the model expression for the fit. Available symbols are: for one-dimensional fits: g or G for Gaussian, e or E for Exponential, and pN or PN (where N is a number) for a Polynomial of degree N. For two-dimensional fits only the Gaussian option (g or G) is available. For instance one could write
g+p3, g+G-e,
The module will generate the code for the function, compile it and put it in a sharable library that will be be loaded dynamically. The generated function will be a function of one or two variables according to the dimension of the incoming data. If necessary, the code for the function can be edited before compilation, or, more generally, you can use your own function for fitting.
For the fit itself there is the Fit menu, which lets you launch fits with Minuit's MIGRAD, MINIMIZE, SIMPLEX, and IMPROVE procedures (see the Minuit documentation for details). The covariance matrix of the fit is available via the Show menu, while a more detailed HESSE and MINOS error analysis can is initiated via the Errors menu.
If you are using a combination of the standard functions, you can set a default starting value by using the Set Default from Model command from the Parameters menu. This will parse the model expression and generate a set of parameters with appropriate names, default values and behaviours.
In this section we shall go through the various steps needed to fit and then plot a simple one-dimensional histogram retrieved from an Objectivity/DB database.
The DataFit module receives a histogram from the HistOOgramFill and performs a fit on it. The output of the module is a lattice having two data fields: the first contains the result of the fit (channel 2) and the second the original data. This makes it possible to connect this module directly to NagGraph (if wanted). Since the HistOOgramPlot module only needs one channel (the fitted data) you must invoke the ChannelSelect module to choose right channel.
You are now ready to start a simple fit. Suppose we want to fit the histogram to a Gaussian distribution. In this case it is enough to type G in the ModelExpression text field (lower left hand corner) of the DataFit panel. After typing a carriage return, C++ source code corresponding to the definition of a Gaussian parameter fit is generated, compiled and loaded.
To have an acceptable set of starting values for the fit, it is possible to adjust the fitting parameters visually. First in the Parameters menu select Set default from model. This fills the Parameters list with MAX1, Mean1 and StdDev1, corresponding to the three Gaussian parameters. By clicking on one of them you can modify its value by using the dials on the right of the Parameters list. It is also possible to adjust the fitting interval with the slider below the same Parameters list.
When you are satisfied with the initial values for the parameters, you can choose the fitting method (for example MIGRAD) in the Fit menu to perform the fit.