#!/bin/sh
#
# ========================================================================
#
# *
# * This file is part of MARS, the MAGIC Analysis and Reconstruction
# * Software. It is distributed to you in the hope that it can be a useful
# * and timesaving tool in analysing Data of imaging Cerenkov telescopes.
# * It is distributed WITHOUT ANY WARRANTY.
# *
# * Permission to use, copy, modify and distribute this software and its
# * documentation for any purpose is hereby granted without fee,
# * provided that the above copyright notice appear in all copies and
# * that both that copyright notice and this permission notice appear
# * in supporting documentation. It is provided "as is" without express
# * or implied warranty.
# *
#
#
#   Author(s): Daniela Dorner  05/2005 <mailto:dorner@astro.uni-wuerzburg.de>
#
#   Copyright: MAGIC Software Development, 2000-2007
#
#
# ========================================================================
#
# This a resource file for the scripts, in which the standard paths and 
# functions, which are needed more often are stored. 
#

rootsys=/opt/root_v5.12.00f
if ! export | grep $rootsys  >|/dev/null
then
   export ROOTSYS=$rootsys
   export PATH=$PATH:$ROOTSYS/bin
   export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$ROOTSYS/lib
fi


logpath=/magic/datacenter/autologs
lockpath=/magic/datacenter/locks
listpath=/magic/datacenter/lists
setuppath=/magic/datacenter/setup

datapath=/magic/data
subsystempath=/magic/subsystemdata
sequpath=/magic/sequences
datasetpath=/magic/datasets

mcpath=/magic/montecarlo
mcrawpath=$mcpath/rawfiles
mcsequpath=$mcpath/sequences
reflectorversion="reflector 0.7"
cameraversion="camera 0.75"

webpath=/www/htdocs/datacenter

#addresses to which the errors are sent
erradrs="datacenter@astro.uni-wuerzburg.de" 
#addresses to which the changes are sent
adrs="datacenter@astro.uni-wuerzburg.de, tbretz@astro.uni-wuerzburg.de" 


#setup for jobmanager
sleeptime=30 #30
sleeptimelimit=360 #360
errorsleeptimedefault=60 #60
max=42 #maximum number of processes

#scripts=( "runcallisto" "runstar" "runganymed" "dodatacheck" )
#scriptscolname=( "fCallisto" "fStar" "fGanymed" "fDataCheckDone" )
#datascripts=( "runcallisto" "runstar" "runganymed" )
#datascriptscolname=( "fCallisto" "fStar" "fGanymed" )
datascripts=( "runganymed" "runstar" "runcallisto" "cutslices" )
datascriptscolname=( "fGanymed" "fStar" "fCallisto" "fCompmux" )

#
# FIXME: 
# max anz an prozessen setzen
# besser Verhaeltnis zwischen den Prozessen und das am besten noch 
# automatisch anpassen 
# evtl noch maximale anz an callistos setzen
# 

#hour:            0  1  2  3  4  5  6  7  8  9 10 11 12 13 14 15 16 17 18 19 20 21 22 23
pnototal=(       42 42 42 42 42 42 42 42 42 42 42 42 42 42 42 42 42 42 42 42 42 42 42 42 )
pnototalwe=(     42 42 42 42 42 42 42 42 42 42 42 42 42 42 42 42 42 42 42 42 42 42 42 42 )

pnocallisto=(    32 32 32 32 32 20 20 18 18 12 12 12 12 12 12 12 12 12 12 18 18 20 20 32 )
pnostar=(        10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 )
pnoganymed=(      7  7  7  7  7  7  7  7  7  7  7  7  7  7  7  7  7  7  7  7  7  7  7  7 )
pnocutslices=(    8  8  8  8  8  8  8  8  8  8  8  8  8  8  8  8  8  8  8  8  8  8  8  8 )
#pnodatacheck=(   20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 )

pnocallistowe=(  32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 )
pnostarwe=(      10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 )
pnoganymedwe=(    7  7  7  7  7  7  7  7  7  7  7  7  7  7  7  7  7  7  7  7  7  7  7  7 )
pnocutsliceswe=(  8  8  8  8  8  8  8  8  8  8  8  8  8  8  8  8  8  8  8  8  8  8  8  8 )
#pnodatacheckwe=( 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 )

##pnosweek=( ${pnocallisto[@]} ${pnostar[@]} ${pnoganymed[@]} ${pnodatacheck[@]} )
##pnoswe=( ${pnocallistowe[@]} ${pnostarwe[@]} ${pnoganymedwe[@]} ${pnodatacheckwe[@]} )
#pnosweek=( ${pnocallisto[@]} ${pnostar[@]} ${pnoganymed[@]} )
#pnoswe=( ${pnocallistowe[@]} ${pnostarwe[@]} ${pnoganymedwe[@]} )
pnosweek=( ${pnoganymed[@]} ${pnostar[@]} ${pnocallisto[@]} ${pnocutslices[@]} )
pnoswe=( ${pnoganymedwe[@]} ${pnostarwe[@]} ${pnocallistowe[@]} ${pnocutsliceswe[@]} )

# values for mc production
mcscripts=( "runcorsika" "runreflector" "runcamera" )
mcscriptscolname=( "fCorsikaFileAvail" "fReflectorFileAvail" "fCameraFileAvail" )

#hour:            0  1  2  3  4  5  6  7  8  9 10 11 12 13 14 15 16 17 18 19 20 21 22 23

pnocorsika=(     18 18 18 18 18 18 18 12 10  8  7  7  7  7  7  7  7  7  7  8 10 12 18 18 )
pnoreflector=(    8  8  8  8  8  8  8  8  8  8  8  8  8  8  8  8  8  8  8  8  8  8  8  8 )
pnocamera=(       4  4  4  4  4  4  4  4  4  4  4  4  4  4  4  4  4  4  4  4  4  4  4  4 )

pnocorsikawe=(   18 18 18 18 18 18 18 18 18 18 18 18 18 18 18 18 18 18 18 18 18 18 18 18 )
pnoreflectorwe=(  8  8  8  8  8  8  8  8  8  8  8  8  8  8  8  8  8  8  8  8  8  8  8  8 )
pnocamerawe=(     4  4  4  4  4  4  4  4  4  4  4  4  4  4  4  4  4  4  4  4  4  4  4  4 )

#pnosweek=( ${pnocorsika[@]} ${pnoreflector[@]} ${pnocamera[@]} )
#pnoswe=( ${pnocorsikawe[@]} ${pnoreflectorwe[@]} ${pnocamerawe[@]} )

