]> git.uio.no Git - u/mrichter/AliRoot.git/blame - PWGLF/SPECTRA/Nuclei/B2/macros/Config_TPCTOF_LHC10x.C
Merge branch 'feature-movesplit'
[u/mrichter/AliRoot.git] / PWGLF / SPECTRA / Nuclei / B2 / macros / Config_TPCTOF_LHC10x.C
CommitLineData
4ea666e1 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// TPC+TOF config
17// author: Eulogio Serradilla <eulogio.serradilla@cern.ch>
18
aa54def0 19#if !defined(__CINT__) || defined(__MAKECINT__)
4ea666e1 20#include <Riostream.h>
21#include <TSystem.h>
22#include <TString.h>
23#include <TFileMerger.h>
4ea666e1 24#include "AliLnDriver.h"
aa54def0 25#endif
26
4ea666e1 27#include "Config.h"
28
aa54def0 29Int_t Config_TPCTOF_LHC10x( const TString& inputDir = "~/alice/input"
30 , const TString& outputDir = "~/alice/output"
31 , const TString& period = "lhc10d"
32 , const TString& outputTag = "lhc10d"
33 , const TString& trkselTag = "-bayes-nsd"
34 , const TString& multTag = ""
35 , const TString& multCorTag = ""
36 , Double_t ymax = 0.5
37 , Bool_t inel = 0
38 , Bool_t drawOutput = 1
39 , const TString& species = "Proton"
40 , Double_t ptmin = 0.4
41 , Double_t ptjoint = 1.0
42 , Double_t ptmax = 3.2
43 , Double_t ptpid = 4)
4ea666e1 44{
45//
46// combine TPC and TOF for protons and deuterons
47//
df36ebb5 48 using namespace std;
49
50 if((species != "Proton") && (species != "Deuteron"))
51 {
52 cerr << "Particle species " << species << " not implemented, only 'Proton' and 'Deuteron'." << endl;
53 exit(1);
54 }
4ea666e1 55
56 const TString kOutputTagTPC = outputTag + "-tpc";
57 const TString kOutputTagTOF = outputTag + "-tof";
58
59 const TString kArgTPC = inputDir + "\","
60 + "\"" + outputDir + "\","
61 + "\"" + period + "\","
62 + "\"" + kOutputTagTPC + "\","
aa54def0 63 + "\"" + trkselTag + "\","
4ea666e1 64 + "\"" + multTag + "\","
65 + "\"" + multCorTag;
66
67 const TString kArgTOF = inputDir + "\","
68 + "\"" + outputDir + "\","
69 + "\"" + period + "\","
70 + "\"" + kOutputTagTOF + "\","
aa54def0 71 + "\"" + trkselTag + "\","
4ea666e1 72 + "\"" + multTag + "\","
73 + "\"" + multCorTag;
74
df36ebb5 75 cout << "Config_" << species << "_TPC_LHC10x.C" << endl << endl;
aa54def0 76 gROOT->ProcessLine(Form(".x Config_%s_TPC_LHC10x.C+g(\"%s\", %f, %d, 0, %f, %f, 0,1,1,0,0)"
df36ebb5 77 , species.Data()
78 , kArgTPC.Data()
aa54def0 79 , ymax
df36ebb5 80 , inel
aa54def0 81 , ptmin
82 , ptjoint));
83
4ea666e1 84
df36ebb5 85 cout << "Config_" << species << "_TOF_LHC10x.C" << endl << endl;
aa54def0 86 gROOT->ProcessLine(Form(".x Config_%s_TOF_LHC10x.C+g(\"%s\", %f, %d, 0, %f, %f, %f, 1,1,1,0,0)"
df36ebb5 87 , species.Data()
88 , kArgTOF.Data()
aa54def0 89 , ymax
df36ebb5 90 , inel
aa54def0 91 , ptjoint
92 , ptmax
93 , ptpid));
4ea666e1 94
4ea666e1 95 TString outputPtTPC = outputDir + "/" + MakeOutputName(species, kOutputTagTPC) + "-Pt.root";
96 TString outputPtTOF = outputDir + "/" + MakeOutputName(species, kOutputTagTOF) + "-Pt.root";
97
aa54def0 98 TString outputPtTPCdbg = outputDir + "/" + MakeOutputName(species, kOutputTagTPC) + "-Pt-debug.root";
99 TString outputPtTOFdbg = outputDir + "/" + MakeOutputName(species, kOutputTagTOF) + "-Pt-debug.root";
100
4ea666e1 101 // combine TPC and TOF pt
102
103 TString outputPt = outputDir + "/" + MakeOutputName(species, outputTag) + "-Pt.root";
104 TString outputRatio = outputDir + "/" + MakeOutputName(species, outputTag) + "-Ratio.root";
105 TString outputSpectra = outputDir + "/" + MakeOutputName(species, outputTag) + "-Spectra.root";
106
107 TFileMerger m;
108
109 m.AddFile(outputPtTPC.Data(),0);
110 m.AddFile(outputPtTOF.Data(),0);
111
112 m.OutputFile(outputPt.Data());
113
114 m.Merge();
115
aa54def0 116 // remove tmp files
117 gSystem->Exec(Form("rm -f %s %s %s %s", outputPtTPC.Data(), outputPtTOF.Data(), outputPtTPCdbg.Data(), outputPtTOFdbg.Data()));
118
4ea666e1 119 // make ratio and spectra
120
121 AliLnDriver driver;
122
123 driver.SetSpecies(species);
124
aa54def0 125 driver.SetRapidityInterval(-ymax,ymax);
4ea666e1 126
d2dadf60 127 driver.SetExtrapolateToINEL(inel);
4ea666e1 128
129 driver.SetOutputFilenames(outputPt, outputRatio, outputSpectra);
130
131 driver.SetOutputTag(outputTag);
132
133 driver.SetMakeCorrections(0);
134 driver.SetMakePt(0);
135 driver.SetMakeRatio(1);
136 driver.SetMakeSpectra(1);
137
138 driver.Run();
139
140 if(!drawOutput) return 0;
141
4ea666e1 142 DrawOutputRatio(outputRatio, outputTag, species);
143 DrawOutputSpectra(outputSpectra, outputTag, species);
144
145 return 0;
146}