B2 analysis code
[u/mrichter/AliRoot.git] / PWGLF / SPECTRA / Nuclei / B2 / macros / Config_Proton_TOF_LHC10x.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 // LHC10x config for protons and antiprotons
17 // author: Eulogio Serradilla <eulogio.serradilla@cern.ch>
18
19 #include <TString.h>
20 #include "AliLnDriver.h"
21 #include "Config.h"
22
23 Int_t Config_Proton_TOF_LHC10x(const TString& inputDir   = "~/alice/input",
24                                const TString& outputDir  = "~/alice/output",
25                                const TString& period     = "lhc10d",
26                                const TString& outputTag  = "lhc10d",
27                                const TString& multTag    = "",
28                                const TString& multCorTag = "",
29                                Bool_t normToInel         = 1,  // for mult
30                                Bool_t drawOutput         = 1)  // for batch
31 {
32 //
33 // lhc10b, lhc10c, lhc10d, lhc10e config for protons and antiprotons
34 // (TOF)
35 //
36         const TString  kSpecies     = "Proton";
37         const TString  kTrkSel      = "its_tpc_tof_dca_spd-bayes";
38         const TString  kTrigName    = "mbor";
39         const Bool_t   kVtxCorr     = 0;
40         const Double_t kVtxCorrVal  = GetVertexCorrection(period);
41         const Int_t    kPtBin[2]    = {11,36};
42         const Bool_t   kUnfolding   = 0;
43         const Bool_t   kFakeTracks  = 0;
44         const Bool_t   kSecondaries = 1;
45         const Int_t    kSecProd     = 0; // 0 tff, 1 roofit, 2 mc
46         const Int_t    kMatDCAxyMod = 1; // 0 geant, 1 flat
47         const Int_t    kNbin        = 10;
48         const Double_t kDCAxy[2]    = {-1.,1.};
49         const Bool_t   kEfficiency  = 1;
50         const Double_t kMatScaling  = 1.9;
51         const Double_t kFdwnScaling = 1.9;
52         const Bool_t   kFitFrac     = 0;
53         const Bool_t   kSameFdwn    = 1;
54         const Double_t kSysErr[2]   = {0.08,0.08} ;
55         
56         Double_t xsec[3];
57         GetInelXSection(xsec, period);
58         
59         Double_t trigEff[3];
60         GetTriggerEfficiency(trigEff, kTrigName, period);
61         
62         // input and output filenames
63         
64         TString inputData     = inputDir + "/" + period + "/" + MakeInputName(kSpecies, period, kTrkSel+multTag) + ".root";
65         TString inputSimu     = inputDir + "/" + period + "/" + MakeSimuName(kSpecies, period, kTrkSel+multCorTag) + ".root";
66         TString inputSimuFix  = inputDir + "/" + period + "/" + MakeSimuFixName(kSpecies, period, kTrkSel+multCorTag) + ".root";
67         TString inputCorr     = inputDir + "/" + period + "/" + MakeInputName(kSpecies, period, kTrkSel+multTag) + "-corr.root";
68         
69         TString outputPt      = outputDir + "/" + MakeOutputName(kSpecies, outputTag) + "-Pt.root";
70         TString outputRatio   = outputDir + "/" + MakeOutputName(kSpecies, outputTag) + "-Ratio.root";
71         TString outputSpectra = outputDir + "/" + MakeOutputName(kSpecies, outputTag) + "-Spectra.root";
72         
73         // configure the driver and run
74         
75         AliLnDriver driver;
76         
77         driver.SetSpecies(kSpecies);
78         
79         driver.SetInputFilenames(inputData, inputSimu, inputSimuFix, inputCorr);
80         driver.SetOutputFilenames(outputPt, outputRatio, outputSpectra);
81         
82         driver.SetOutputTag(outputTag);
83         driver.SetTriggerEfficiency(trigEff);
84         driver.SetInelXSection(xsec);
85         driver.SetNormalizeToINEL(normToInel);
86         driver.SetVertexCorrection(kVtxCorr, kVtxCorrVal);
87         
88         driver.SetPtBinInterval(kPtBin[0], kPtBin[1]);
89         driver.SetPidM2(0);
90         driver.SetUnfolding(kUnfolding);
91         driver.SetFakeTracks(kFakeTracks);
92         driver.SetSecondaries(kSecondaries);
93         driver.SetSecProd(kSecProd);
94         driver.SetMatDCAxyModel(kMatDCAxyMod);
95         driver.SetNBin(kNbin);
96         driver.SetDCAxyInterval(kDCAxy[0], kDCAxy[1]);
97         driver.SetEfficiency(kEfficiency);
98         driver.SetScalingFactors(kMatScaling, kFdwnScaling);
99         driver.SetFitFractionCorr(kFitFrac);
100         driver.SetSameFeedDownCorr(kSameFdwn);
101         
102         driver.SetSysErr(kSysErr[0],kSysErr[1]);
103         
104         //driver.PrintFilenames();
105         
106         driver.Run();
107         
108         // draw output
109         
110         if(!drawOutput) return 0;
111         
112         TStyle* st = GetDrawingStyle();
113         st->cd();
114         gROOT->ForceStyle();
115         
116         DrawOutputCorr(kSpecies,inputCorr);
117         
118         if(kSecProd != 2) DrawCorrDebug(driver.GetPtCorrDebugFilename(), driver.GetOutputCorrTag(), kSpecies, kPtBin[0], kPtBin[1], kDCAxy[0], kDCAxy[1]);
119         
120         DrawPtDebug(driver.GetPtDebugFilename(), outputTag, kSpecies, 0);
121         DrawOutputRatio(outputRatio, outputTag, kSpecies);
122         DrawOutputSpectra(outputSpectra, outputTag, kSpecies);
123         
124         return 0;
125 }