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*//'`
26 triggerAlias="?Trigger=kCalibBarrel"
34 triggerAlias="?Trigger=kCalibBarrel"
38 # local setup in case we provide the trigger mask
39 # the trigger mask is first stripped of quotation characters
40 triggerAlias=${5//\"/}
43 if [ -f Run0_999999999_v3_s0.root ]; then
44 mkdir -p TPC/Calib/Correction
45 mv Run0_999999999_v3_s0.root TPC/Calib/Correction/
48 echo "File to be processed $1"
49 echo "Number of events to be processed $nEvents"
52 echo "* LD_LIBRARY_PATH: $LD_LIBRARY_PATH"
55 if [ "$2" == "OCDB" ]; then
56 echo "Generating OCDB.root only"
57 export OCDB_SNAPSHOT_CREATE="kTRUE"
58 export OCDB_SNAPSHOT_FILENAME="OCDB.root"
63 if [ "${CHUNKNAME:0:1}" = "/" ]; then
64 FILENAME=${CHUNKNAME##*/}
66 if [ -f "$FILENAME" ]; then
67 # locally downloaded chunk
68 CHUNKNAME="`pwd`/$FILENAME"
70 # one chunk from alien (nodownload option to the collection)
71 CHUNKNAME="alien://$CHUNKNAME"
75 if [ -f "wn.xml" ]; then
76 CHUNKNAME="collection://wn.xml"
79 echo "* Running AliRoot to reconstruct $*"
80 echo "* Chunk name: $CHUNKNAME"
81 echo "* Run number: $runNum"
82 echo "* nEvents: $nEvents"
83 echo "* ocdbPath: $ocdbPath"
84 echo "* triggerAlias: $triggerAlias"
87 echo executing aliroot -l -b -q "recCPass0.C(\"$CHUNKNAME\",$nEvents,\"$ocdbPath\",\"$triggerAlias\")"
88 time aliroot -l -b -q "recCPass0.C(\"$CHUNKNAME\",$nEvents,\"$ocdbPath\",\"$triggerAlias\")" &> rec.log
92 echo "*! Exit code of recCPass0.C: $exitcode"
94 if [ $exitcode -ne 0 ]; then
98 mv syswatch.log syswatch_rec.log
100 if [ "$2" == "OCDB" ]; then
101 echo "*! Reconstruction ran in fake mode to create OCDB.root, exiting quickly now"
102 touch OCDB.generating.job
104 if [ -f OCDB.root ]; then
105 echo "* OCDB.root was indeed produced"
107 echo "! Error: OCDB.root was NOT generated !!!"
113 echo "* Running AliRoot to make calibration..."
114 echo executing aliroot -l -b -q "runCalibTrain.C($runNum,\"AliESDs.root\",\"$ocdbPath\")"
115 time aliroot -l -b -q "runCalibTrain.C($runNum,\"AliESDs.root\",\"$ocdbPath\")" &> calib.log
118 echo "*! Exit code of runCalibTrain.C: $exitcode"