]> git.uio.no Git - u/mrichter/AliRoot.git/blame - PWG4/macros/electrons/parmaker
correct the cluster rejection by energy range and number of cells cut
[u/mrichter/AliRoot.git] / PWG4 / macros / electrons / parmaker
CommitLineData
abde65b8 1#!/bin/bash
2
3#
4# Author: K. Read
5#
2bfb11c6 6# This script makes PAR files without requiring write access to
7# $ALICE_ROOT. It is not necessary to first make AliRoot after doing
8# an svn checkout or update. Execute this script in your local area
9# with write access.
10#
abde65b8 11# Usage:
b21a4af6 12# parmaker JETAN
13# parmaker JETAN remote
14# parmaker JETAN remote patch
2bfb11c6 15# parmaker all remote
abde65b8 16#
17# So far only available for these par files:
a1ef582b 18# ANALYSIS ANALYSISalice AOD EMCALUtils ESD FASTJETAN JETAN
19# PHOSUtils PWG4PartCorrBase PWG4PartCorrDep STEERBase
abde65b8 20#
21
22case $2 in
23
24 "remote")
25
26 case $1 in
2bfb11c6 27 "all")
e928077a 28 ./parmaker ANALYSIS remote
29 ./parmaker ANALYSISalice remote
30 ./parmaker AOD remote
31 ./parmaker EMCALUtils remote
32 ./parmaker ESD remote
33 ./parmaker FASTJETAN remote
34 ./parmaker JETAN remote
35 ./parmaker PHOSUtils remote
36 ./parmaker PWG4PartCorrBase remote
37 ./parmaker PWG4PartCorrDep remote
38 ./parmaker STEERBase remote
2bfb11c6 39 echo " "
40 echo "finished making complete set of par files"
41 exit
42 ;;
abde65b8 43 "ANALYSIS")
44 parmaker_input_basedir="ANALYSIS"
45 parmaker_input_dir_subdir="ANALYSIS"
46 parmaker_output_dir_subdir="ANALYSIS"
47 ;;
48 "ANALYSISalice")
49 parmaker_input_basedir="ANALYSIS"
50 parmaker_input_dir_subdir="ANALYSIS"
51 parmaker_output_dir_subdir="ANALYSISalice"
52 ;;
53 "AOD")
54 parmaker_input_basedir="STEER"
55 parmaker_input_dir_subdir="STEER"
56 parmaker_output_dir_subdir="AOD"
57 ;;
a1ef582b 58 "EMCALUtils")
59 parmaker_input_basedir="EMCAL"
60 parmaker_input_dir_subdir="EMCAL"
61 parmaker_output_dir_subdir="EMCALUtils"
62 ;;
abde65b8 63 "ESD")
64 parmaker_input_basedir="STEER"
65 parmaker_input_dir_subdir="STEER"
66 parmaker_output_dir_subdir="ESD"
67 ;;
a1ef582b 68 "PHOSUtils")
69 parmaker_input_basedir="PHOS"
70 parmaker_input_dir_subdir="PHOS"
71 parmaker_output_dir_subdir="PHOSUtils"
72 ;;
abde65b8 73 "PWG4PartCorrBase")
74 parmaker_input_basedir="PWG4"
75 parmaker_input_dir_subdir="PWG4/PartCorrBase"
76 parmaker_output_dir_subdir="PWG4PartCorrBase/PartCorrBase"
77 ;;
78 "PWG4PartCorrDep")
79 parmaker_input_basedir="PWG4"
80 parmaker_input_dir_subdir="PWG4/PartCorrDep"
81 parmaker_output_dir_subdir="PWG4PartCorrDep/PartCorrDep"
82 ;;
83 "STEERBase")
84 parmaker_input_basedir="STEER"
85 parmaker_input_dir_subdir="STEER"
86 parmaker_output_dir_subdir="STEERBase"
87 ;;
b21a4af6 88 "JETAN")
89 parmaker_input_basedir="JETAN"
90 parmaker_input_dir_subdir="JETAN"
91 parmaker_output_dir_subdir="JETAN"
92 ;;
93 "FASTJETAN")
94 parmaker_input_basedir="JETAN"
95 parmaker_input_dir_subdir="JETAN"
96 parmaker_output_dir_subdir="FASTJETAN"
97 ;;
98 *)
99 echo "parmaker: I'm sorry Dave, I'm afraid I can't do that."
100 exit
abde65b8 101 esac
102
103
2bfb11c6 104 echo " "
abde65b8 105 echo "parmaker to use source $ALICE_ROOT/$parmaker_input_dir_subdir"
106 if [ -e "$ALICE_ROOT/$parmaker_input_dir_subdir" ]
107 then
108 echo "parmaker creating $1.par"
109 mkdir $1
110 if [ $parmaker_input_basedir != $parmaker_input_dir_subdir ]
111 then
112 mkdir $parmaker_output_dir_subdir
113 fi
114
a1ef582b 115 list=`grep Ali ${ALICE_ROOT}/${parmaker_input_basedir}/lib${1}.pkg | sed -e '/EXPORT/d' -e '/EINCLUDE/d' -e 's:.cxx::g' -e 's:SRCS::' -e 's:=::' -e 's:+::' -e 's:\\\::'`
abde65b8 116 for i in $list; do
a1ef582b 117# echo "adding:" $i
abde65b8 118 cp $ALICE_ROOT/$parmaker_input_basedir/$i.cxx $parmaker_output_dir_subdir
119 cp $ALICE_ROOT/$parmaker_input_basedir/$i.h $parmaker_output_dir_subdir
120 done
121
122 mkdir $1/PROOF-INF
123 cp -r $ALICE_ROOT/$parmaker_input_basedir/PROOF-INF.$1/* $1/PROOF-INF
124 cp $ALICE_ROOT/$parmaker_input_basedir/${1}LinkDef.h $1
125 cp $ALICE_ROOT/$parmaker_input_basedir/lib${1}.pkg $1
126 cp $ROOTSYS/test/Makefile.arch $1
127 cp $ALICE_ROOT/$parmaker_input_basedir/Makefile $1/Makefiletemp
128 sed -e 's:include \$(ROOTSYS)\/test\/Makefile.arch:include Makefile.arch:' -e "s:PACKAGE = .*:PACKAGE = ${1}:" $1/Makefiletemp > $1/Makefile
129
130 /bin/rm $1/Makefiletemp
b21a4af6 131
132
133# Apply temporary patches.
134 if [ -z $3 ]
135 then
136 echo "no non-standard patches applied"
137 else
138 if [ $3 = "patch" ]
139 then
140 if [ -e "patches/$1" ]
141 then
142 echo "applying temporary $1 patch"
143 cp patches/$1/* $parmaker_output_dir_subdir
144 echo "completed temporary $1 patch"
145 else
146 echo "no patches found for $1"
147 fi
148 else
149 echo "argument $3 not processed"
150 fi
151 fi
152
153# Apply further FASTJETAN tweaks.
154 if [ $1 = "FASTJETAN" ]
155 then
156 echo "Making temporary adjustments to FASTJETAN.par."
157 cp -r $ALICE_ROOT/JETAN/fastjet FASTJETAN
158
159 sed -e "s:CXXFLAGS +:\nALICEINC += -I../JETAN -I./fastjet -I./fastjet/fastjet\n\n\nCXXFLAGS +:" FASTJETAN/Makefile > FASTJETAN/Makefile2
160 mv FASTJETAN/Makefile2 FASTJETAN/Makefile
161 fi
162
abde65b8 163 tar cfzh $1.par $1
164 /bin/rm -rf $1
165 fi
166 ;;
167
168 *)
169 echo "parmaker to use local source $1"
170 if [ -e "$1" ]
171 then
172 echo "parmaker creating $1.par"
173 tar cfzh $1.par $1
174 else
175 echo "local subdirectory $1 not found"
176 fi
177
178esac