7 # Files assumed to be in working directory:
8 # recCPass0.C - reconstruction macro
9 # runCalibTrain.C - calibration/filtering macro
10 # Arguments (run locally):
11 # 1 - raw data file name
12 # 2 - number of events to be processed
16 # runCPass0.sh raw.root 50 104892
19 # $1 = raw input filename
20 runNum=`echo $1 | cut -d "/" -f 6 | sed 's/^0*//'`
27 # use the value passed by LPM, or by default use the kCalibBarrel alias
28 triggerAlias=${ALIEN_JDL_TRIGGERALIAS-?Trigger=kCalibBarrel}
29 #triggerAlias="?Trigger=kPhysicsAll"
37 triggerAlias="?Trigger=kCalibBarrel"
41 # local setup in case we provide the trigger mask
42 # the trigger mask is first stripped of quotation characters
43 triggerAlias=${5//\"/}
46 if [ -f Run0_999999999_v3_s0.root ]; then
47 mkdir -p TPC/Calib/Correction
48 mv Run0_999999999_v3_s0.root TPC/Calib/Correction/
51 echo "File to be processed $1"
52 echo "Number of events to be processed $nEvents"
55 echo "* LD_LIBRARY_PATH: $LD_LIBRARY_PATH"
58 if [ "$2" == "OCDB" ]; then
59 echo "Generating OCDB.root only"
60 export OCDB_SNAPSHOT_CREATE="kTRUE"
61 export OCDB_SNAPSHOT_FILENAME="OCDB.root"
62 touch OCDB.generating.job
67 if [ "${CHUNKNAME:0:1}" = "/" ]; then
68 FILENAME=${CHUNKNAME##*/}
70 if [ -f "$FILENAME" ]; then
71 # locally downloaded chunk
72 CHUNKNAME="`pwd`/$FILENAME"
74 # one chunk from alien (nodownload option to the collection)
75 CHUNKNAME="alien://$CHUNKNAME"
79 if [ -f "wn.xml" ]; then
80 CHUNKNAME="collection://wn.xml"
83 echo "* Running AliRoot to reconstruct $*"
84 echo "* Chunk name: $CHUNKNAME"
85 echo "* Run number: $runNum"
86 echo "* nEvents: $nEvents"
87 echo "* ocdbPath: $ocdbPath"
88 echo "* triggerAlias: $triggerAlias"
91 echo executing aliroot -l -b -q -x "recCPass0.C(\"$CHUNKNAME\",$nEvents,\"$ocdbPath\",\"$triggerAlias\")"
92 time aliroot -l -b -q -x "recCPass0.C(\"$CHUNKNAME\",$nEvents,\"$ocdbPath\",\"$triggerAlias\")" &> rec.log
96 echo "*! Exit code of recCPass0.C: $exitcode"
98 if [ $exitcode -ne 0 ]; then
102 mv syswatch.log syswatch_rec.log
104 if [ "$2" == "OCDB" ]; then
105 echo "*! Reconstruction ran in fake mode to create OCDB.root, exiting quickly now"
107 if [ -f OCDB.root ]; then
108 echo "* OCDB.root was indeed produced"
110 echo "! Error: OCDB.root was NOT generated !!!"
111 echo "OCDB.root was not generated" > validation_error.message
118 echo "* Running AliRoot to make calibration..."
119 echo executing aliroot -l -b -q -x "runCalibTrain.C($runNum,\"AliESDs.root\",\"$ocdbPath\")"
120 time aliroot -l -b -q -x "runCalibTrain.C($runNum,\"AliESDs.root\",\"$ocdbPath\")" &> calib.log
123 echo "*! Exit code of runCalibTrain.C: $exitcode"
125 if [ $exitcode -ne 0 ]; then
126 echo "runCalibTrain.C exited with code $exitcode" > validation_error.message