Tutorial: performing an Example Partial Wave Analysis

For testing and benchmarking purposes, an example PWA of Monte Carlo toy data is located in the directory $TOP_DIR/benchmark/pbarpTopi0pi0eta . This is an analysis of antiproton-proton annihilation into π0 π0 η with only the f2(1270) and the a2(1320) as intermediate resonances.

This is a step by step tutorial on running this example analysis.


Relevant Files

The following files should be located in the "benchmark" folder and in the event storage:


File DescriptionSorted ascending
defaultparams.dat A list of default start parameters for the fit
benchmark*runscript Shell scripts to run the PWA in different modes
toyDataModel.dat The "experimental" toy data as ASCII file containing four-vectors located in the event storage $EVT_DIR/benchmark/pi0pi0eta900/toyDataPbarPToPi0Pi0Eta900.dat
pbarpReactionDefault.cfg The configuration file. The fitted model is defined and all options are set here
toyDataMC.dat The phasespace distributed toy Monte Carlo data as an ASCII file containing four-vectors located in the event storage $EVT_DIR/benchmark/pi0pi0eta900/toyMCPbarPToPi0Pi0Eta900.dat

Setting the Environment

If not already done, some environment variables have to be set in order to run PAWIAN. An example is given in the file "SetEnv_rub" in the top directory of the PAWIAN installation. On the Βochum site, you only have to "cd" into that directory and execute

source SetEnv_rub

Otherwise, you'll have to set the relevant environment variables $ROOTSYS, $TOP_DIR, $LD_LIBRARY_PATH, $PATH, $EVT_DIR, $KMAT_DIR and $BOOST_BUILD_PATH yourself. Additionally, $ROOTSYS/bin has to appear in your PATH variable.

Working Directory

The studies should not be performed in the directory of the PAWIAN installation. Instead, it is better to create an own directory on an available file server and copy $TOP_DIR/benchmark/pbarpTopi0pi0eta there:

cp -r $TOP_DIR/benchmark/pbarpTopi0pi0eta ./

Generating the Default Parameter List

To start any PWA, a set of start parameters has to be given. A default list is already available in the directory but can also be generated by running

$TOP_DIR/bin/singleChannelApp --pbarpFiles pbarpReactionDefault.cfg --mode dumpDefaultParams

The list logic per line is as follows:

1. Paramter name

2. Initial parameter error (used in the initial step of the minimization process to estimate the variation step size; a too small value might affect the convergence)

3. Lower parameter bound (optional)

4. Upper parameter bound (optional)

Starting the Server and Clients

This example PWA is performed using the client/server mode with four clients. The relevant configuration file options are

serverPort = 20301
serverAddress = localhost
noOfClients = 4

To start the server run

$TOP_DIR/bin/singleChannelApp --pbarpFiles pbarpReactionDefault.cfg --mode server --paramFile defaultparams.dat

However, you may want to pipe the output into a log file, e.g.

$TOP_DIR/bin/singleChannelApp --pbarpFiles pbarpReactionDefault.cfg --mode server --paramFile defaultparams.dat !>& server.log &

Wait some seconds and then start the four clients on the same machine:

$TOP_DIR/bin/singleChannelApp --pbarpFiles pbarpReactionDefault.cfg --mode client --paramFile defaultparams.dat !>& client1.log &

$TOP_DIR/bin/singleChannelApp --pbarpFiles pbarpReactionDefault.cfg --mode client --paramFile defaultparams.dat !>& client2.log &

$TOP_DIR/bin/singleChannelApp --pbarpFiles pbarpReactionDefault.cfg --mode client --paramFile defaultparams.dat !>& client3.log &

$TOP_DIR/bin/singleChannelApp --pbarpFiles pbarpReactionDefault.cfg --mode client --paramFile defaultparams.dat !>& client4.log &

In the server.log, lines similar to the following should appear:

INFO: ********* Server mode ****************
INFO: Listening on port 20301
INFO: Number of clients for channel 0 : 4
INFO: Waiting for 4 clients ...
INFO: Client pc70 logged in (ID 0).
INFO: Client pc70 logged in (ID 1).

INFO: Client pc70 logged in (ID 2).

INFO: Client pc70 logged in (ID 2).
INFO: All clients ready.
INFO: start migrad with strategy level 1

During the minimization, the current values of the likelihood are printed

INFO: current LH = -2218.040279118386

while the current parameter values (with default errors) are frequently dumped into a file named currentResult.dat. After the minimization has finished, the logfile should sho**************** Minuit <nop>FunctionMinimum information ******************
INFO: Function minimum is valid.
INFO: Covariance matrix is valid.
INFO: Final LH: -7155.52338
INFO: # of function calls: 2928
INFO: minimum edm: 2.236921451e-05

The file finalResult.dat now holds the list of final fit parameters with proper errors. Another file serializedOutput.dat is created in which (currently only) the covariance matrix is stored for later use. The generated and obtained fit parameters for the two intermediate resonances are as follows:


resonance a2(1320) f2(1270)
m (generated) [GeV/c2] 1.3177 1.2755
Γ (generated) [GeV/c2] 0.1111 0.1867
m (fitted) [GeV/c2] 1.3181 ± 0.0012 1.2831 ± 0.0036
Γ (fitted) [GeV/c2] 0.1069 ± 0.0031 0.2001 ± 0.0073

Plotting the Result

Start the QA mode by typing ./run_qa or alternatively by running

$TOP_DIR/bin/singleChannelApp --pbarpFiles ./pbarpReactionDefault.cfg --mode qaMode --paramFile ./finalResult.dat !>& logQA.log &=

A ROOT file pawianHists.root is created (this may take some time). This file holds:
  • two ROOT trees _dataFourvecs and _fittedFourvecs where the latter are the Monte Carlo data but with an additional weight representing the fitted intensity for this event
  • Histograms of masses and angles, as chosen in the configuration file. The histograms have prefixes "Data", "MC" and "Fit", so to quickly estimate the goodness of fit, you can plot the "Data" and the corresponding "Fit" histogram on the same canvas.

In addition two other ROOT files are created pawianHistsa2_1320.root and pawianHistsf2_1270.root containing the same information as pawianHists.root, but weighted with the contribution of the a2(1320) and f2(1270) wave, respectively. The most important information like the obtained NLL-value, number of free parameters, information criteria and contributions of the individual waves can also be found the summary-file "qaSummarySimple.dat":

logLh -7155.52
noOfFreeFitParams 22
BIC: -14099.5
AICa: -14267
AICc: -14267
No of data events without weight 15000
No of data events with weight 15000
No of MC events 45000
scaling factor 0.333333
no of fitted events with scaling factor: 14999.9
contribution no 0
contribution name f2_1270
no of fitted events with scaling factor: 5192.8
contribution no 1
contribution name a2_1320
no of fitted events with scaling factor: 9128.37



Histograms with all relevant phase space projections including the individual contributing waves can be visualized with the root-script "drawCrontribs.C". Start root with X-forwarding via "root -l" or without X-forwarding via "root -b". Load the script

".L $TOP_DIR/Scripts/DrawContributions.C"

and start afterwards:

".x drawCrontribs.C"

A canvas with the histogram will appear or without X-forwarding you can find the relevant output in the file "FitResultHists.jpg":

Topic revision: r9 - 2023-01-28, MeikeKuessner
Copyright © by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding Panda Wiki Send feedback | Imprint | Privacy Policy (in German)