]> git.uio.no Git - u/mrichter/AliRoot.git/blob - PWGGA/GammaConv/macros/start_GammaConversionAnalysis.sh
fixed bugs while streaming histos for weighting, added new trainconfig for pPb
[u/mrichter/AliRoot.git] / PWGGA / GammaConv / macros / start_GammaConversionAnalysis.sh
1 #! /bin/bash
2 #
3 #
4 #
5 # This script gests as input a directory where the AnalysisResults root file is stored
6 # , it also needs the desired output directory where the produced root files are put.
7 # If nothing is given it will use ./ for the input directory and ./Output for the output
8 #
9 #Input 1: Root file to analyze (not including the .root) Default: AnalyisResults
10 #Input 2: Input directory  Default:$PWD 
11 #Input 3: Output directory Default: $PWD/Output  (directory will be created if it does not exist)
12 #
13
14 RootFile="";
15 if [ -n $1 ]; then
16     RootFile=AnalysisResults
17 else
18     RootFile=$1
19 fi
20
21
22 InputDirectory="";
23 if [ -n $2 ]; then
24     InputDirectory=$PWD/
25 else
26     InputDirectory=$2
27 fi
28 echo Input directory is $InputDirectory
29
30 OutputDirectory="";
31 if [ -n $3 ]; then
32     OutputDirectory=$PWD/Output/
33 else
34     OutputDirectory=$3
35 fi
36  
37 if [ ! -d $OutputDirectory ]; then
38     mkdir $OutputDirectory
39 fi 
40 echo Output directory is $OutputDirectory
41
42 DatFilenameBase=RB-data-AnalysisResults;
43 Suffix=gif;
44
45 if [ -f $OutputDirectory/$DatFilenameBase.dat ]; then
46     echo Warning: The file RB-data-AnalysisResults.dat exists, please remove before continuing.
47     echo -e "\t Otherwise the file will accumulate more entries than it is supposed to."
48     exit;
49 fi
50
51
52 root -b -q $ALICE_ROOT/PWGGA/GammaConv/macros/MakeCutLog.C\(\"$RootFile\"\,\"$InputDirectory\"\,\"$OutputDirectory\"\)
53
54 # Read the different cuts form the Cut selection log file
55 exec<"$OutputDirectory/CutSelection.log"
56
57 while read cutSelection
58 do
59     echo CutSelection is $cutSelection;
60     root -b -q $ALICE_ROOT/PWGGA/GammaConv/macros/Extract_IntegratedPi0Yield.C\(\"$cutSelection\"\,\"$RootFile\"\,\"$InputDirectory\"\,\"$OutputDirectory\"\"\);
61     
62     root -b -q $ALICE_ROOT/PWGGA/GammaConv/macros/Extract_Pi0_Characteristics.C\(\"$cutSelection\"\,\"$RootFile\"\,\"$InputDirectory\"\,\"$OutputDirectory\"\);
63
64 done
65
66     root -b -q $ALICE_ROOT/PWGGA/GammaConv/macros/Plot_IntegratedPi0Yield.C\(\"$DatFilenameBase\"\,\"$OutputDirectory\"\,\"$Suffix\"\)
67
68     root -b -q $ALICE_ROOT/PWGGA/GammaConv/macros/Plot_Pi0_Characteristics.C