ROOT logo
/**************************************************************************
 * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
 *                                                                        *
 * Author: The ALICE Off-line Project.                                    *
 * Contributors are mentioned in the code where appropriate.              *
 *                                                                        *
 * Permission to use, copy, modify and distribute this software and its   *
 * documentation strictly for non-commercial purposes is hereby granted   *
 * without fee, provided that the above copyright notice appears in all   *
 * copies and that both the copyright notice and this permission notice   *
 * appear in the supporting documentation. The authors make no claims     *
 * about the suitability of this software for any purpose. It is          *
 * provided "as is" without express or implied warranty.                  *
 **************************************************************************/

// coalescence parameter
// author: Eulogio Serradilla <eulogio.serradilla@cern.ch>

#if !defined(__CINT__) || defined(__MAKECINT__)
#include <Riostream.h>
#include <TSystem.h>
#include <TROOT.h>
#include <TFileMerger.h>
#include <TString.h>
#include "AliLnBA.h"
#endif

Int_t BA(  const TString& pSpectra   = "~/alice/output/Proton-lhc10d-Spectra.root"
         , const TString& dSpectra   = "~/alice/output/Deuteron-lhc10d-Spectra.root"
         , const TString& ptag       = "lhc10d"
         , const TString& dtag       = "lhc10d"
         , const TString& outputfile = "~/alice/output/lhc10d-B2.root"
         , const TString& otag       = "lhc10d"
         , const Bool_t   draw       = 1)
{
//
// coalescence parameter for nucleus and antinucleus
//
	using namespace std;
	
	Int_t A = 2;
	Int_t Z = 1;
	
	if(nucleus == "Deuteron")
	{
		A = 2;
		Z = 1;
	}
	else if(nucleus == "Triton")
	{
		A = 3;
		Z = 1;
	}
	else if(nucleus == "He3")
	{
		A = 3;
		Z = 2;
	}
	else
	{
		cerr << "only valid names: Deuteron, Triton and He3" << endl;
		return 1;
	}
	
	const Int_t kNpart = 2;
	const Int_t kZ[kNpart] = { Z, -Z };
	const TString kB2File[kNpart] = {"BA.root", "AntiBA.root" };
	
	TFileMerger m;
	
	for(Int_t i=0; i<kNpart; ++i)
	{
		AliLnBA b2(pSpectra, ptag, dSpectra, dtag, kB2File[i], otag, A, kZ[i]);
		
		b2.Run();
		
		m.AddFile(kB2File[i].Data(),0);
	}
	
	m.OutputFile(outputfile.Data());
	m.Merge();
	
	gSystem->Exec(Form("rm -f %s %s", kB2File[0].Data(), kB2File[1].Data()));
	
	if(!draw) return 0;
	
	const TString kNucleus[kNpart] = { nucleus, Form("Anti%s",nucleus.Data())};
	
	for(Int_t i=0; i<kNpart; ++i)
	{
		gROOT->ProcessLine(Form(".x DrawBA.C+g(\"%s\",\"%s\",\"%s\")", outputfile.Data(), otag.Data(), kNucleus[i].Data()));
	}
	
	return 0;
}
 BA.C:1
 BA.C:2
 BA.C:3
 BA.C:4
 BA.C:5
 BA.C:6
 BA.C:7
 BA.C:8
 BA.C:9
 BA.C:10
 BA.C:11
 BA.C:12
 BA.C:13
 BA.C:14
 BA.C:15
 BA.C:16
 BA.C:17
 BA.C:18
 BA.C:19
 BA.C:20
 BA.C:21
 BA.C:22
 BA.C:23
 BA.C:24
 BA.C:25
 BA.C:26
 BA.C:27
 BA.C:28
 BA.C:29
 BA.C:30
 BA.C:31
 BA.C:32
 BA.C:33
 BA.C:34
 BA.C:35
 BA.C:36
 BA.C:37
 BA.C:38
 BA.C:39
 BA.C:40
 BA.C:41
 BA.C:42
 BA.C:43
 BA.C:44
 BA.C:45
 BA.C:46
 BA.C:47
 BA.C:48
 BA.C:49
 BA.C:50
 BA.C:51
 BA.C:52
 BA.C:53
 BA.C:54
 BA.C:55
 BA.C:56
 BA.C:57
 BA.C:58
 BA.C:59
 BA.C:60
 BA.C:61
 BA.C:62
 BA.C:63
 BA.C:64
 BA.C:65
 BA.C:66
 BA.C:67
 BA.C:68
 BA.C:69
 BA.C:70
 BA.C:71
 BA.C:72
 BA.C:73
 BA.C:74
 BA.C:75
 BA.C:76
 BA.C:77
 BA.C:78
 BA.C:79
 BA.C:80
 BA.C:81
 BA.C:82
 BA.C:83
 BA.C:84
 BA.C:85
 BA.C:86
 BA.C:87
 BA.C:88
 BA.C:89
 BA.C:90
 BA.C:91
 BA.C:92
 BA.C:93
 BA.C:94
 BA.C:95
 BA.C:96