]> git.uio.no Git - u/mrichter/AliRoot.git/blob - PWGPP/QA/scripts/runQA.sh
440f096c41411055877c88fa2154edafdce32352
[u/mrichter/AliRoot.git] / PWGPP / QA / scripts / runQA.sh
1 #!/bin/bash
2 if [ ${BASH_VERSINFO} -lt 4 ]; then
3   echo "bash version >= 4 needed, you have ${BASH_VERSION}, exiting..."
4   exit 1
5 fi
6
7 main()
8 {
9   if [[ -z $1 ]]; then
10     echo "Usage: "
11     echo "  ${0##*/} option=value [option=value]"
12     echo "  at least inputList should be specified, or configFile containing it:"
13     echo "  ${0##*/} inputList=file.list"
14     echo "  options override config file (if any), e.g.:"
15     echo "  ${0##*/} configFile=runQA.config inputList=file.list outputDirectory=%det"
16     return 1
17   fi
18
19   if ! parseConfig "$@"; then
20     ${0}
21     return 1
22   fi
23
24   [[ -z $ALICE_ROOT ]] && echo "ALICE_ROOT not defined" && return 1
25
26   ocdbregex='raw://'
27   if [[ ${ocdbStorage} =~ ${ocdbregex} ]]; then
28     alien-token-init ${alienUserName}
29     #this is a hack! alien-token init seems not enough
30     #but the gclient_env script messes up the LD_LIBRARY_PATH
31     while read x; do
32       eval ${x};
33     done < <(grep -v "LD_LIBRARY_PATH" /tmp/gclient_env_${UID})
34   fi
35
36   updateQA "$@"
37 }
38
39 updateQA()
40 {
41   umask 0002
42   parseConfig "$@"
43
44   #be paranoid and make some full paths
45   [[ ! -f ${inputList} ]] && echo "no input list: ${inputList}" && return 1
46   inputList=$(get_realpath ${inputList})
47   mkdir -p ${workingDirectory}
48   workingDirectory=$(workingDirectory=${workingDirectory%/}; cd ${workingDirectory%/*}; echo "${PWD}/${workingDirectory##*/}")
49   if [[ ! -d ${workingDirectory} ]]; then
50     echo "working dir $workingDirectory does not exist and cannot be created"
51     return 1
52   fi
53   cd ${workingDirectory}
54
55   echo JOB config:
56   echo inputList=$inputList
57   echo outputDirectory=$outputDirectory
58   echo
59
60   dateString=$(date +%Y-%m-%d-%H-%M-%S-%N)
61   echo "Start time QA process: $dateString"
62
63   #logging
64   mkdir -p $logDirectory
65   [[ ! -d $logDirectory ]] && echo "no log dir $logDirectory" && return 1
66   logFile="$logDirectory/${0##*/}.${dateString}.log"
67   touch ${logFile}
68   [[ ! -f ${logFile} ]] && echo "cannot write logfile $logfile" && return 1
69   echo "logFile = $logFile"
70
71   #check lock
72   lockFile=${workingDirectory}/runQA.lock
73   [[ -f ${lockFile} ]] && echo "lock ${lockFile} exists!" | tee ${logFile} && return 1
74   touch ${lockFile}
75   [[ ! -f ${lockFile} ]] && echo "cannot lock $lockFile" | tee ${logFile} && return 1
76   
77   exec &>${logFile}
78
79   ################################################################
80   #ze detector loop
81   for detectorScript in $ALICE_ROOT/PWGPP/QA/detectorQAscripts/*; do
82     echo
83     echo "##############################################"
84     echo $(date)
85     unset planB
86     [[ ! ${detectorScript} =~ .*\.sh$ ]] && continue
87     detector=${detectorScript%.sh}
88     detector=${detector##*/}
89     
90     #skip if excluded
91     if [[ "${excludeDetectors}" =~ ${detector} ]]; then
92       echo "${detector} is excluded in config, skipping..."
93       continue
94     fi
95
96     #if includeDetectors set, only process thoe detectors specified there
97     if [[ -n ${includeDetectors} && ! "${includeDetectors}" =~ ${detector} ]]; then
98       echo "${detector} not included in includeDetectors, skipping..."
99       continue
100     fi
101
102     logSummary=${logDirectory}/summary-${detector}-${dateString}.log
103     hostInfo >> ${logSummary}
104     outputDir=$(substituteDetectorName ${detector} ${outputDirectory})
105     tmpDetectorRunDir=${workingDirectory}/tmpQAtmpRunDir${detector}-${dateString}
106     if ! mkdir -p ${tmpDetectorRunDir}; then
107       echo "cannot create the temp dir $tmpDetectorRunDir"
108       continue
109     fi
110     cd ${tmpDetectorRunDir}
111
112     tmpPrefix=${tmpDetectorRunDir}/${outputDir}
113     echo "running QA for ${detector}"
114     echo "  outputDir=$outputDir"
115     echo "  tmpPrefix=$tmpPrefix"
116     
117     #unset the detector functions from previous iterations (detectors)
118     unset -f runLevelQA
119     unset -f periodLevelQA
120     unset -f runLevelHighPtTreeQA
121     unset -f periodLevelHighPtTreeQA
122     source ${detectorScript}
123
124     #################################################################
125     #produce the QA and trending tree for each file (run)
126     unset arrOfTouchedProductions
127     declare -A arrOfTouchedProductions
128     while read qaFile; do
129       echo
130       echo $(date)
131       
132       #first check if input file exists
133       [[ ! -f ${qaFile%\#*} ]] && echo "file ${qaFile%\#*} not accessible" && continue
134
135       if ! guessRunData ${qaFile}; then
136         echo "could not guess run data from ${qaFile}"
137         continue
138       fi
139       echo "anchorYear for ${originalPeriod} is: ${anchorYear}"
140
141       tmpProductionDir=${tmpPrefix}/${dataType}/${year}/${period}/${pass}
142       tmpRunDir=${tmpProductionDir}/000${runNumber}
143       mkdir -p ${tmpRunDir}
144       cd ${tmpRunDir}
145
146       #by default we expect to have everything in the same archive
147       highPtTree=${qaFile}
148
149       #maybe the input is not an archive, but a file
150       [[ "${qaFile}" =~ QAresults.root$ ]] && highPtTree=""
151       [[ "${qaFile}" =~ FilterEvents_Trees.root$ ]] && qaFile=""
152
153       #it is possible we get the highPt trees from somewhere else
154       #search the list of high pt trees for the proper run number
155       if [[ -n ${inputListHighPtTrees} ]]; then
156         highPtTree=$(egrep -m1 ${runNumber} ${inputListHighPtTrees})
157         echo "loaded the highPtTree ${highPtTree} from external file ${inputListHighPtTrees}"
158       fi
159       
160       echo qaFile=$qaFile
161       echo highPtTree=$highPtTree
162       echo ocdbStorage=${ocdbStorage}
163       echo
164
165       #what if we have a zip archive?
166       if [[ "$qaFile" =~ .*.zip$ ]]; then
167         if unzip -l ${qaFile} | egrep "QAresults.root" &>/dev/null; then
168           qaFile="${qaFile}#QAresults.root"
169         elif unzip -l ${qaFile} | egrep "QAresults_barrel.root" &>/dev/null; then
170           qaFile="${qaFile}#QAresults_barrel.root"
171         else
172           qaFile=""
173         fi
174       fi
175       if [[ "$highPtTree" =~ .*.zip$ ]]; then
176         if unzip -l ${highPtTree} | egrep "FilterEvents_Trees.root" &>/dev/null; then
177           highPtTree="${highPtTree}#FilterEvents_Trees.root"
178         else
179           highPtTree=""
180         fi
181       fi
182      
183       if [[ -n ${qaFile} && $(type -t runLevelQA) =~ "function" ]]; then
184         echo running ${detector} runLevelQA for run ${runNumber} from ${qaFile}
185         runLevelQA "${qaFile}" &> runLevelQA.log
186         #perform some default actions:
187         #if trending.root not created, create a default one
188         if [[ ! -f trending.root ]]; then
189           aliroot -b -q -l "$ALICE_ROOT/PWGPP/macros/simpleTrending.C(\"${qaFile}\",${runNumber},\"${detector}\",\"trending.root\",\"trending\",\"recreate\")" 2>&1 | tee -a runLevelQA.log
190         fi
191         if [[ -f trending.root ]]; then
192           #cache the touched production + an example file to guarantee consistent run data parsing
193           arrOfTouchedProductions[${tmpProductionDir}]="${qaFile%\#*}"
194         else
195           echo "trending.root not created"
196         fi
197       fi
198       #expert QA based on high pt trees
199       if [[ -n ${highPtTree} && $(type -t runLevelHighPtTreeQA) =~ "function" ]]; then
200         echo running ${detector} runLevelHighPtTreeQA for run ${runNumber} from ${highPtTree}
201         runLevelHighPtTreeQA "${highPtTree}" &> runLevelHighPtTreeQA.log
202         arrOfTouchedProductions[${tmpProductionDir}]=1
203       fi
204
205       cd ${tmpDetectorRunDir}
206     
207     done < ${inputList}
208
209     #################################################################
210     #cache which productions were (re)done
211     echo "list of processed productions:"
212     echo "    ${!arrOfTouchedProductions[@]}"
213     echo
214
215     #################################################################
216     #(re)do the merging/trending 
217     for tmpProductionDir in ${!arrOfTouchedProductions[@]}; do
218       cd ${tmpProductionDir}
219       echo
220       echo "running period level stuff in ${tmpProductionDir}"
221       echo $(date)
222     
223       productionDir=${outputDir}/${tmpProductionDir#${tmpPrefix}}
224       echo productionDir=${outputDir}/${tmpProductionDir#${tmpPrefix}}
225
226       mkdir -p ${productionDir}
227       if [[ ! -d ${productionDir} ]]; then 
228         echo "cannot make productionDir $productionDir" && continue
229       fi
230       
231       #move runs to final destination
232       for dir in ${tmpProductionDir}/000*; do
233         echo 
234         oldRunDir=${outputDir}/${dir#${tmpPrefix}}
235         if ! guessRunData "${arrOfTouchedProductions[${tmpProductionDir}]}"; then
236           echo "could not guess run data from ${dir}"
237           continue
238         fi
239
240         #before moving - VALIDATE!!!
241         if ! validate ${dir}; then 
242           continue
243         fi
244
245         #moving a dir is an atomic operation, no locking necessary
246         if [[ -d ${oldRunDir} ]]; then
247           echo "removing old ${oldRunDir}"
248           rm -rf ${oldRunDir}
249         fi
250         echo "moving new ${runNumber} to ${productionDir}"
251         mv -f ${dir} ${productionDir}
252       done
253    
254       #go to a temp dir to do the period level stuff in a completely clean dir
255       tmpPeriodLevelQAdir="${tmpProductionDir}/periodLevelQA"
256       echo
257       echo tmpPeriodLevelQAdir="${tmpProductionDir}/periodLevelQA"
258       if ! mkdir -p ${tmpPeriodLevelQAdir}; then continue; fi
259       cd ${tmpPeriodLevelQAdir}
260
261       #link the final list of per-run dirs here, just the dirs
262       #to have a clean working directory
263       unset linkedStuff
264       declare -a linkedStuff
265       for x in ${productionDir}/000*; do [[ -d $x ]] && ln -s $x && linkedStuff+=(${x##*/}); done
266
267       #merge trending files if any
268       if /bin/ls 000*/trending.root &>/dev/null; then
269         hadd trending.root 000*/trending.root &> periodLevelQA.log
270       fi
271       
272       #run the period level trending/QA
273       if [[ -f "trending.root" && $(type -t periodLevelQA) =~ "function" ]]; then
274         echo running ${detector} periodLevelQA for production ${period}/${pass}
275         periodLevelQA trending.root &>> periodLevelQA.log
276       else 
277         echo "WARNING: not running ${detector} periodLevelQA for production ${period}/${pass}, no trending.root"
278       fi
279
280       if ! validate ${PWD}; then continue; fi
281
282       #here we are validated so move the produced QA to the final place
283       #clean up linked stuff first
284       [[ -n ${linkedStuff[@]} ]] && rm ${linkedStuff[@]}
285       periodLevelLock=${productionDir}/runQA.lock
286       if [[ ! -f ${periodLevelLock} ]]; then
287         #some of the output could be a directory, so handle that
288         #TODO: maybe use rsync?
289         #lock to avoid conflicts:
290         echo "${HOSTNAME} ${dateString}" > ${periodLevelLock}
291         for x in ${tmpPeriodLevelQAdir}/*; do  
292           if [[ -d ${x} ]]; then
293             echo "removing ${productionDir}/${x##*/}"
294             rm -rf ${productionDir}/${x##*/}
295             echo "moving ${x} to ${productionDir}"
296             mv ${x} ${productionDir}
297           fi
298           if [[ -f ${x} ]]; then
299             echo "moving ${x} to ${productionDir}"
300             mv -f ${x} ${productionDir} 
301           fi
302         done
303         rm -f ${periodLevelLock}
304         #remove the temp dir
305         rm -rf ${tmpPeriodLevelQAdir}
306       else
307         echo "ERROR: cannot move to destination"                     >> ${logSummary}
308         echo "production dir ${productionDir} locked!"               >> ${logSummary}
309         echo "check and maybe manually do:"                          >> ${logSummary}
310         echo " rm ${periodLevelLock}"                                >> ${logSummary}
311         echo " rsync -av ${tmpPeriodLevelQAdir}/ ${productionDir}/"  >> ${logSummary}
312         planB=1
313       fi
314
315     done
316
317     cd ${workingDirectory}
318
319     if [[ -z ${planB} ]]; then
320       echo
321       echo removing ${tmpDetectorRunDir}
322       rm -rf ${tmpDetectorRunDir}
323     else
324       executePlanB
325     fi
326   done #end of detector loop
327
328   #remove lock
329   rm -f ${lockFile}
330 }
331
332 executePlanB()
333 {
334   #in case of emergency
335   if [[ -n ${MAILTO} ]]; then 
336     echo
337     echo "trouble detected, sending email to ${MAILTO}"
338     cat ${logSummary} | mail -s "qa in need of assistance" ${MAILTO}
339   fi
340 }
341
342 validate()
343 {
344   summarizeLogs ${1} >> ${logSummary}
345   logStatus=$?
346   if [[ ${logStatus} -ne 0 ]]; then 
347     echo "WARNING not validated: ${1}"
348     planB=1
349     return 1
350   fi
351   return 0
352 }
353
354 summarizeLogs()
355 {
356   local dir=$1
357   [[ ! -d ${dir} ]] && dir=${PWD}
358
359   #print a summary of logs
360   logFiles=(
361       "*.log"
362       "stdout"
363       "stderr"
364   )
365
366   #check logs
367   local logstatus=0
368   for log in ${dir}/${logFiles[*]}; do
369     [[ ! -f ${log} ]] && continue
370     errorSummary=$(validateLog ${log})
371     validationStatus=$?
372     [[ validationStatus -ne 0 ]] && logstatus=1
373     if [[ ${validationStatus} -eq 0 ]]; then 
374       #in pretend mode randomly report an error in rec.log some cases
375       if [[ -n ${pretend} && "${log}" == "rec.log" ]]; then
376         [[ $(( ${RANDOM}%2 )) -ge 1 ]] && echo "${log} BAD random error" || echo "${log} OK"
377       else
378         echo "${log} OK"
379       fi
380     elif [[ ${validationStatus} -eq 1 ]]; then
381       echo "${log} BAD ${errorSummary}"
382     elif [[ ${validationStatus} -eq 2 ]]; then
383       echo "${log} OK MWAH ${errorSummary}"
384     fi
385   done
386
387   #report core files
388   while read x; do
389     echo ${x}
390     chmod 644 ${x}
391     gdb --batch --quiet -ex "bt" -ex "quit" aliroot ${x} > stacktrace_${x//\//_}.log
392   done < <(/bin/ls ${PWD}/*/core 2>/dev/null; /bin/ls ${PWD}/core 2>/dev/null)
393
394   return ${logstatus}
395 }
396
397 validateLog()
398 {
399   log=${1}
400   errorConditions=(
401             'There was a crash'
402             'floating'
403             'error while loading shared libraries'
404             'std::bad_alloc'
405             's_err_syswatch_'
406             'Thread [0-9]* (Thread'
407             'AliFatal'
408             'core dumped'
409             '\.C.*error:.*\.h: No such file'
410             'segmentation'
411             'Interpreter error recovered'
412   )
413
414   warningConditions=(
415             'This is serious'
416   )
417
418   local logstatus=0
419   local errorSummary=""
420   local warningSummary=""
421
422   for ((i=0; i<${#errorConditions[@]};i++)); do
423     local tmp=$(grep -m1 -e "${errorConditions[${i}]}" ${log})
424     [[ -n ${tmp} ]] && tmp+=" : "
425     errorSummary+=${tmp}
426   done
427
428   for ((i=0; i<${#warningConditions[@]};i++)); do
429     local tmp=$(grep -m1 -e "${warningConditions[${i}]}" ${log})
430     [[ -n ${tmp} ]] && tmp+=" : "
431     warningSummary+=${tmp}
432   done
433
434   if [[ -n ${errorSummary} ]]; then 
435     echo "${errorSummary}"
436     return 1
437   fi
438
439   if [[ -n ${warningSummary} ]]; then
440     echo "${warningSummary}"
441     return 2
442   fi
443
444   return 0
445 }
446
447 parseConfig()
448 {
449   args=("$@")
450
451   #config file
452   configFile=""
453   #where to search for qa files
454   inputList=file.list
455   #working directory
456   workingDirectory="${PWD}"
457   #where to place the final qa plots
458   #outputDirectory="/afs/cern.ch/work/a/aliqa%det/www/"
459   outputDirectory="${workingDirectory}/%DET"
460   #filter out detector option
461   excludeDetectors="EXAMPLE"
462   #logs
463   logDirectory=${workingDirectory}/logs
464   #OCDB storage
465   ocdbStorage="raw://"
466   #email to
467   #MAILTO="fbellini@cern.ch"
468
469   #first, check if the config file is configured
470   #is yes - source it so that other options can override it
471   #if any
472   for opt in "${args[@]}"; do
473     if [[ ${opt} =~ configFile=.* ]]; then
474       eval "${opt}"
475       [[ ! -f ${configFile} ]] && echo "configFile ${configFile} not found, exiting..." && return 1
476       echo "using config file: ${configFile}"
477       source "${configFile}"
478       break
479     fi
480   done
481
482   #then, parse the options as they override the options from file
483   for opt in "${args[@]}"; do
484     if [[ ! "${opt}" =~ .*=.* ]]; then
485       echo "badly formatted option ${var}, should be: option=value, stopping..."
486       return 1
487     fi
488     local var="${opt%%=*}"
489     local value="${opt#*=}"
490     echo "${var}=${value}"
491     export ${var}="${value}"
492   done
493 }
494
495 guessRunData()
496 {
497   #guess the period from the path, pick the rightmost one
498   period=""
499   runNumber=""
500   year=""
501   pass=""
502   legoTrainRunNumber=""
503   dataType=""
504   originalPass=""
505   originalPeriod=""
506   anchorYear=""
507
508   shortRunNumber=""
509   oldIFS=${IFS}
510   local IFS="/"
511   declare -a path=( $1 )
512   IFS="${oldIFS}"
513   local dirDepth=$(( ${#path[*]}-1 ))
514   i=0
515   for ((x=${dirDepth};x>=0;x--)); do
516
517     [[ $((x-1)) -ge 0 ]] && local fieldPrev=${path[$((x-1))]}
518     local field=${path[${x}]}
519     local fieldNext=${path[$((x+1))]}
520
521     [[ ${field} =~ ^[0-9]*$ && ${fieldNext} =~ (.*\.zip$|.*\.root$) ]] && legoTrainRunNumber=${field}
522     [[ -n ${legoTrainRunNumber} && -z ${pass} ]] && pass=${fieldPrev}
523     [[ ${field} =~ ^LHC[0-9][0-9][a-z].*$ ]] && period=${field%_*} && originalPeriod=${field}
524     [[ ${field} =~ ^000[0-9][0-9][0-9][0-9][0-9][0-9]$ ]] && runNumber=${field#000}
525     [[ ${field} =~ ^[0-9][0-9][0-9][0-9][0-9][0-9]$ ]] && shortRunNumber=${field}
526     [[ ${field} =~ ^20[0-9][0-9]$ ]] && year=${field}
527     [[ ${field} =~ ^(^sim$|^data$) ]] && dataType=${field}
528     (( i++ ))
529   done
530   originalPass=${pass}
531   [[ -n ${shortRunNumber} && "${legoTrainRunNumber}" =~ ${shortRunNumber} ]] && legoTrainRunNumber=""
532   [[ -z ${legoTrainRunNumber} ]] && pass=${path[$((dirDepth-1))]}
533   [[ "${dataType}" =~ ^sim$ ]] && pass="passMC" && runNumber=${shortRunNumber} && originalPass="" #for MC not from lego, the runnumber is identified as lego train number, thus needs to be nulled
534   [[ -n ${legoTrainRunNumber} ]] && pass+="_lego${legoTrainRunNumber}"
535   
536   #modify the OCDB: set the year
537   if [[ ${dataType} =~ sim ]]; then 
538     anchorYear=$(run2year $runNumber)
539     if [[ -z "${anchorYear}" ]]; then
540       echo "WARNING: anchorYear not available for this production: ${originalPeriod}, runNumber: ${runNumber}. Cannot set the OCDB."
541       return 1
542     fi
543     ocdbStorage=$(setYear ${anchorYear} ${ocdbStorage})
544   else
545     ocdbStorage=$(setYear ${year} ${ocdbStorage})
546   fi
547
548   #if [[ -z ${dataType} || -z ${year} || -z ${period} || -z ${runNumber}} || -z ${pass} ]];
549   if [[ -z ${runNumber}} ]]
550   then
551     #error condition
552     return 1
553   else
554     #ALL OK
555     return 0
556   fi
557 }
558
559 run2year()
560 {
561   #for a given run print the year.
562   #the run-year table is ${runMap} (a string)
563   #defined in the config file
564   #one line per year, format: year runMin runMax
565   local run=$1
566   while read year runMin runMax; do
567     [[ -z ${run} || -z ${runMin} || -z ${runMax} ]] && continue
568     [[ ${run} -ge ${runMin} && ${run} -le ${runMax} ]] && echo ${year} && break
569   done < <(echo "${runMap}")
570   return 0
571 }
572
573 substituteDetectorName()
574 {
575   local det=$1
576   local dir=$2
577   [[ ${dir} =~ \%det ]] && det=${det,,} && echo ${dir/\%det/${det}}
578   [[ ${dir} =~ \%DET ]] && det=${det} && echo ${dir/\%DET/${det}}
579 }
580
581 get_realpath() 
582 {
583   if [[ -f "$1" ]]
584   then
585     # file *must* exist
586     if cd "$(echo "${1%/*}")" &>/dev/null
587     then
588       # file *may* not be local
589       # exception is ./file.ext
590       # try 'cd .; cd -;' *works!*
591       local tmppwd="$PWD"
592       cd - &>/dev/null
593     else
594       # file *must* be local
595       local tmppwd="$PWD"
596     fi
597   else
598     # file *cannot* exist
599     return 1 # failure
600   fi
601   # reassemble realpath
602   echo "$tmppwd"/"${1##*/}"
603   return 0 # success
604 }
605
606 setYear()
607 {
608   #set the year
609   #  ${1} - year to be set
610   #  ${2} - where to set the year
611   local year1=$(guessYear ${1})
612   local year2=$(guessYear ${2})
613   local path=${2}
614   [[ ${year1} -ne ${year2} && -n ${year2} && -n ${year1} ]] && path=${2/\/${year2}\//\/${year1}\/}
615   echo ${path}
616   return 0
617 }
618
619 guessYear()
620 {
621   #guess the year from the path, pick the rightmost one
622   local IFS="/"
623   declare -a pathArray=( ${1} )
624   local field
625   local year
626   for field in ${pathArray[@]}; do
627     [[ ${field} =~ ^20[0-9][0-9]$ ]] && year=${field}
628   done
629   echo ${year}
630   return 0
631 }
632
633 hostInfo(){
634 #
635 # Hallo world -  Print AliRoot/Root/Alien system info
636 #
637
638 #
639 # HOST info
640 #
641     echo --------------------------------------
642         echo 
643         echo HOSTINFO
644         echo 
645         echo HOSTINFO HOSTNAME"      "$HOSTNAME
646         echo HOSTINFO DATE"          "`date`
647         echo HOSTINFO gccpath"       "`which gcc` 
648         echo HOSTINFO gcc version"   "`gcc --version | grep gcc`
649         echo --------------------------------------    
650
651 #
652 # ROOT info
653 #
654         echo --------------------------------------
655         echo
656         echo ROOTINFO
657         echo 
658         echo ROOTINFO ROOT"           "`which root`
659         echo ROOTINFO VERSION"        "`root-config --version`
660         echo 
661         echo --------------------------------------
662
663
664 #
665 # ALIROOT info
666 #
667         echo --------------------------------------
668         echo
669         echo ALIROOTINFO
670         echo 
671         echo ALIROOTINFO ALIROOT"        "`which aliroot`
672         echo ALIROOTINFO VERSION"        "`echo $ALICE_LEVEL`
673         echo ALIROOTINFO TARGET"         "`echo $ALICE_TARGET`
674         echo 
675         echo --------------------------------------
676
677 #
678 # Alien info
679 #
680 #echo --------------------------------------
681 #echo
682 #echo ALIENINFO
683 #for a in `alien --printenv`; do echo ALIENINFO $a; done 
684 #echo
685 #echo --------------------------------------
686
687 #
688 # Local Info
689 #
690         echo PWD `pwd`
691         echo Dir 
692         ls -al
693         echo
694         echo
695         echo
696 }
697
698 main "$@"