]> git.uio.no Git - u/mrichter/AliRoot.git/blob - PWGLF/SPECTRA/Nuclei/B2/macros/B2.C
e24895597b2aff3a8341b025a46ac1f339b72a81
[u/mrichter/AliRoot.git] / PWGLF / SPECTRA / Nuclei / B2 / macros / B2.C
1 /**************************************************************************
2  * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
3  *                                                                        *
4  * Author: The ALICE Off-line Project.                                    *
5  * Contributors are mentioned in the code where appropriate.              *
6  *                                                                        *
7  * Permission to use, copy, modify and distribute this software and its   *
8  * documentation strictly for non-commercial purposes is hereby granted   *
9  * without fee, provided that the above copyright notice appears in all   *
10  * copies and that both the copyright notice and this permission notice   *
11  * appear in the supporting documentation. The authors make no claims     *
12  * about the suitability of this software for any purpose. It is          *
13  * provided "as is" without express or implied warranty.                  *
14  **************************************************************************/
15
16 // coalescence parameter
17 // author: Eulogio Serradilla <eulogio.serradilla@cern.ch>
18
19 #include <TSystem.h>
20 #include <TROOT.h>
21 #include <TFileMerger.h>
22 #include <TString.h>
23
24 #include "AliLnB2.h"
25
26 Int_t B2(const TString& pSpectra   = "~/alice/output/Proton-lhc10d-Spectra.root",
27          const TString& ptag       = "lhc10d",
28          const TString& dSpectra   = "~/alice/output/Deuteron-lhc10d-Spectra.root",
29          const TString& dtag       = "lhc10d",
30          const TString& outputfile = "~/alice/output/lhc10d-B2.root",
31          const TString& otag       = "lhc10d")
32 {
33 //
34 // coalescence parameter
35 //
36         const Int_t kNpart      = 2;
37         const TString kPrefix[] = { "", "Anti" };
38         const Int_t kCharge[]   = { 1, -1 };
39         
40         TFileMerger m;
41         
42         for(Int_t i=0; i<kNpart; ++i)
43         {
44                 TString b2file = kPrefix[i] + "B2.root";
45                 
46                 AliLnB2 b2(pSpectra, ptag, dSpectra, dtag, b2file, otag, 2, kCharge[i]);
47                 
48                 b2.Run();
49                 
50                 m.AddFile(b2file.Data(),0);
51         }
52         
53         m.OutputFile(outputfile.Data());
54         m.Merge();
55         
56         gSystem->Exec("rm -f B2.root AntiB2.root");
57         
58         // draw
59         
60         for(Int_t i=0; i<kNpart; ++i)
61         {
62                 gROOT->ProcessLine(Form(".x DrawB2.C+g(\"%s\",\"%s\",\"%s\")", outputfile.Data(), otag.Data(), kPrefix[i].Data()));
63         }
64         
65         return 0;
66 }