]> git.uio.no Git - u/mrichter/AliRoot.git/blob - PWGLF/SPECTRA/Nuclei/B2/macros/B2.C
rewrite d/p ratio and simplify some macros
[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& dSpectra   = "~/alice/output/Deuteron-lhc10d-Spectra.root"
28          , const TString& ptag       = "lhc10d"
29          , const TString& dtag       = "lhc10d"
30          , const TString& outputfile = "~/alice/output/lhc10d-B2.root"
31          , const TString& otag       = "lhc10d"
32          , const Bool_t   draw       = 1)
33 {
34 //
35 // coalescence parameter
36 //
37         const Int_t kNpart      = 2;
38         const TString kPrefix[] = { "", "Anti" };
39         const Int_t kCharge[]   = { 1, -1 };
40         
41         TFileMerger m;
42         
43         for(Int_t i=0; i<kNpart; ++i)
44         {
45                 TString b2file = kPrefix[i] + "B2.root";
46                 
47                 AliLnB2 b2(pSpectra, ptag, dSpectra, dtag, b2file, otag, 2, kCharge[i]);
48                 
49                 b2.Run();
50                 
51                 m.AddFile(b2file.Data(),0);
52         }
53         
54         m.OutputFile(outputfile.Data());
55         m.Merge();
56         
57         gSystem->Exec("rm -f B2.root AntiB2.root");
58         
59         // draw
60         
61         if(!draw) return 0;
62         
63         for(Int_t i=0; i<kNpart; ++i)
64         {
65                 gROOT->ProcessLine(Form(".x DrawB2.C+g(\"%s\",\"%s\",\"%s\")", outputfile.Data(), otag.Data(), kPrefix[i].Data()));
66         }
67         
68         return 0;
69 }