Index: trunk/MagicSoft/Mars/datacenter/scripts/makecallistolinks
===================================================================
--- trunk/MagicSoft/Mars/datacenter/scripts/makecallistolinks	(revision 7568)
+++ trunk/MagicSoft/Mars/datacenter/scripts/makecallistolinks	(revision 7572)
@@ -63,10 +63,30 @@
 for file in $files
 do 
-  pulse=`cat $file | grep "$reason1\|$reason2"` >> $scriptlog 2>&1
-  if [ ! "$pulse" = "" ]
-  then
-     path=`dirname $file` >> $scriptlog 2>&1
-     ln -vfs $setuppath/callisto/$callistorcnew $path/$callistorcseq >> $scriptlog 2>&1
-  fi
+   pulse=`cat $file | grep "$reason1\|$reason2"` >> $scriptlog 2>&1
+   sequ=`echo $file | cut -d/ -f6`
+
+   if [ ! "$pulse" = "" ]
+   then
+      if ! ls -l $callistorcseq | grep $callistorcnew >> $scriptlog 2>&1
+      then 
+         # resetting the calibration
+         echo "resetting the callisto for sequence $sequ" >> $scriptlog 2>&1
+         resetlogpath=$logpath/resetcallisto
+         echo "resetlogpath: $resetlogpath" >> $scriptlog 2>&1
+         makedir $resetlogpath >> $scriptlog 2>&1
+         resetlog=$resetlogpath/reset-callisto-$sequ.log
+
+         check1=`root -q -b $macrospath/resetcolumn.C+\("\"fCallisto\""\,"\"SequenceProcessStatus\""\,"\"$sequ\""\,"\"$sequ\""\,kFALSE\) | tee $resetlog | grep int | sed -e 's/(int)//'`
+         case $check1 in
+            1)   echo "check1=$check1 -> everything ok, callisto has been reset " >> $scriptlog 2>&1
+                 ;;
+            *)   echo "check1=$check1 -> ERROR -> step could not be resetted -> continue " >> $scriptlog 2>&1
+                 continue ;;
+         esac
+      #linking callisto.rc
+      path=`dirname $file` >> $scriptlog 2>&1
+      ln -vfs $setuppath/callisto/$callistorcnew $path/$callistorcseq >> $scriptlog 2>&1
+      fi
+   fi
 done
 
