1 /**************************************************************************
2 * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
4 * Author: The ALICE Off-line Project. *
5 * Contributors are mentioned in the code where appropriate. *
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 **************************************************************************/
16 // LHC10x multiplicity config for protons and deuterons
17 // author: Eulogio Serradilla <eulogio.serradilla@cern.ch>
19 #if !defined(__CINT__) || defined(__MAKECINT__)
23 #include <TFileMerger.h>
24 #include "AliLnDriver.h"
29 Int_t LHC10xMult( const TString& species = "Deuteron"
30 , const TString& inputDir = "~/alice/input"
31 , const TString& outputDir = "~/alice/output"
32 , const TString& period = "lhc10d"
33 , const TString& otag = "lhc10d"
34 , const TString& trkselTag = "-tpc3-nsd-moc"
39 // lhc10x multiplicity config
40 // call Config_XXX for each multiplicity class
42 // if option = 0 then use Config_XXX_TPC
43 // if option = 1 then use Config_XXX_TOF
44 // if option = 2 then use Config_TPCTOF
46 using namespace B2mult;
49 const Bool_t kINEL[kNmult] = { 0 };
51 Double_t ptmin = (species=="Proton") ? 0.4 : 0.7;
52 Double_t ptjoint = (species=="Proton") ? 1.0 : 1.0;
53 Double_t ptmax = (species=="Proton") ? 2.0 : 2.5;
54 Double_t ptpid = (species=="Proton") ? 0.4 : 1.3;
56 if( (option<0) || (option>2) || ((species != "Proton") && (species != "Deuteron")))
58 cerr << "unknown species/option: " << species << "/" << option << endl;
59 cerr << "species: Proton or Deuteron, options: 0 (TPC), 1 (TOF), 2 (TPCTOF)" << endl;
65 TString ratio[kNmult];
66 TString spectra[kNmult];
68 for(Int_t i=0; i<kNmult; ++i)
70 // limit the ptmax value for deuterons
71 if(species == "Deuteron") ptmax = kDtrPtMax[i];
74 cout << "Multiplicity class : " << kMultTag[i] << endl;
75 cout << "Period : " << period << endl;
77 TString outputTag = otag + kMultTag[i];
79 TString arg = inputDir + "\","
80 + "\"" + outputDir + "\","
81 + "\"" + period + "\","
82 + "\"" + outputTag + "\","
83 + "\"" + trkselTag + "\","
84 + "\"" + kMultTag[i] + "\"," // data
85 + "\"" + ""; // same simulations for all mult
90 cout << "Config_" << species << "_TPC_LHC10x.C" << endl << endl;
91 gROOT->ProcessLine(Form(".x Config_%s_TPC_LHC10x.C+g(\"%s\", %f, %d, 0, %f, %f)", species.Data(), arg.Data(), ymax, kINEL[i], ptmin, ptmax));
94 cout << "Config_" << species << "_LHC10x.C" << endl << endl;
95 gROOT->ProcessLine(Form(".x Config_%s_TOF_LHC10x.C+g(\"%s\", %f, %d, 0, %f, %f, %f)", species.Data(), arg.Data(), ymax, kINEL[i], ptmin, ptmax, ptpid));
98 cout << "Config_TPCTOF_LHC10x.C" << endl << endl;
99 gROOT->ProcessLine(Form(".x Config_TPCTOF_LHC10x.C+g(\"%s\", %f, %d, 0, \"%s\", %f, %f, %f, %f)", arg.Data(), ymax, kINEL[i], species.Data(), ptmin, ptjoint, ptmax, ptpid));
103 ratio[i] = outputDir + "/" + species + "-" + outputTag + "-Ratio.root";
104 spectra[i] = outputDir + "/" + species + "-" + outputTag + "-Spectra.root";
106 m1.AddFile(ratio[i].Data(),0);
107 m2.AddFile(spectra[i].Data(),0);
112 TString allRatios = outputDir + "/" + species + "-" + otag + "-Mult-Ratio.root";
113 TString allSpectra = outputDir + "/" + species + "-" + otag + "-Mult-Spectra.root";
115 m1.OutputFile(allRatios.Data());
116 m2.OutputFile(allSpectra.Data());
123 for(Int_t i=0; i<kNmult; ++i)
125 gSystem->Exec(Form("rm -f %s", ratio[i].Data()));
126 gSystem->Exec(Form("rm -f %s", spectra[i].Data()));
131 gROOT->ProcessLine(Form(".x DrawDir.C+g(\"%s\",\"Anti%s%s_Ratio_Pt\",\"\",0,4.5, 0., 1.8, \"#it{p}_{T} (GeV/c)\", \"#bar{p}/p\", 0, \"cRatio\",\"Particle ratio\")", allRatios.Data(),species.Data(),species.Data()));
133 Double_t minYield = (species=="Proton") ? 1.1e-6 : 1.1e-8;
134 Double_t maxYield = (species=="Proton") ? 4.e-1 : 7.e-4;
136 DrawOutputSpectraMult(allSpectra, species, minYield, maxYield);