Main Page | Namespace List | Class Hierarchy | Class List | File List | Class Members | File Members

chargeDraw.cpp File Reference

An example for drawing charge state. More...

#include <string>
#include <sstream>
#include <TF1.h>
#include <TH1.h>
#include <TCanvas.h>
#include <TApplication.h>
#include <TLegend.h>
#include "toi.h"
#include "chargemodel.h"

Functions

double fq (double *x, double *par)
double maxq (double *x, double *par)
int GetModel ()
int main (int argc, char **argv)

Variables

ChargeStateDistt
 Global pointer to a ChargeStateDist see section trick in the file description.


Detailed Description

An example for drawing charge state.

This file depend on the ROOT framework. It display 2 canvas. The first one is on plot of the fraction of each charge state of 12C between E=1 MeV and E=15 MeV. The second one is a plot of the maximum charge state in function of the energy.

Trick

Despite the fact the ChargeStateDist provide a double returning the fraction of the charge at a given energy we have two define a function fq which will use the global ChargeStateDist *t to return the wanted value. This is because the TF1 class of ROOT can not directly take a class member. The same apply to maxq.

Function Documentation

double fq double *  x,
double *  par
 

Return the charge state fraction. This is required to plot the Getfq member using the TF1 class from ROOT, see section trick in the file description.

int GetModel  ) 
 

int main int  argc,
char **  argv
 

double maxq double *  x,
double *  par
 

Return the maximum charge state. This is required to plot the GetMaxq member using the TF1 class from ROOT, see section trick in the file description.


Variable Documentation

ChargeStateDist* t
 

Global pointer to a ChargeStateDist see section trick in the file description.


Generated on Tue Aug 8 19:46:56 2006 for ChargeModel by  doxygen 1.4.4