8 # ------------------------------------------------------------------------------------------ 
   10 #    Script to jointly run JRandomTimesliceWriter and JTriggerProcessor in run-by-run mode. 
   12 # ------------------------------------------------------------------------------------------ 
   14 if [ -z $JPP_DIR ]; 
then 
   15     echo "Variable JPP_DIR undefined." 
   19 source $JPP_DIR/setenv.sh $JPP_DIR
 
   28 set_variable:  SAMPLER               RANDOMEVENT_SAMPLER                    
"1 1000" 
   33     usage "$script <detector file> <output file> <DAQ file> <PMT parameters file>"\
 
   34           "\nAuxiliary script to produce random event data." 
   37 if (( $# == 4 )); 
then 
   43     fatal 
"Wrong number of arguments." 
   46 JPrintTree -
f $DAQ_FILE | 
awk '/KM3NETDAQ::JDAQSummaryslice/ {print $3}'  |  
read N 
   48 set_variable   RUNBYRUN             
"file=$DAQ_FILE; sampler=${SAMPLER%% *} $(($N / 2))" 
   50 ################################################################################################# 
   52 # The sampler values correspond to N_on N_off, respectively (note that sampler calls JSampler), 
   54 # N_on   =  number of time slices to read; 
   55 # N_off  =  number of time slices to skip. 
   57 # The sampler option works as follows. 
   59 # read -on average- N_on  consecutive time slices and   
   60 # skip -on average- N_off time slices 
   61 # modulo the number of time slices in the file. 
   63 # The larger N_on, the faster the reading, because this reduces the random accesses  
   64 # of the data taking file to pick up a next time slice. 
   65 # The smaller N_off, the less time slices are skipped. 
   66 # So, N_on = 0 guarantees that all time slices are sampled. 
   67 # Note that if the number of time slices to be produced is small, then too small a value of N_off 
   68 # could create a bias because only the first time slices of the data taking file are then sampled. 
   69 ################################################################################################# 
   79 if [[ ! -p $PIPE ]]; 
then 
   80     fatal 
"Error opening $PIPE." 
   85 JRandomTimesliceWriter \
 
   99 JPrintTriggerParameters \
 
&set_variable DAQ_TIMESLICE
 
std::istream & read(std::istream &in, JTestSummary &summary, const char delimiter= ' ')
Read test summary. 
 
o $QUALITY_ROOT d $DEBUG!CHECK_EXIT_CODE JPlot1D f
 
then echo Variable JPP_DIR undefined exit fi source $JPP_DIR setenv sh $JPP_DIR &dev null set_variable DETECTOR_ID set_array RUNS if do_usage *then usage $script< source directory > nThe source directory corresponds to a pre calibrated D0ARCA009 detector fi case set_variable DIR
 
then fatal Wrong number of arguments fi JConvertDetectorFormat a o
 
static const double C
Physics constants. 
 
then timer_start(JRandomTimesliceWriter-a ${DETECTOR}-o ${PIPE}-n ${NUMBER_OF_SLICES}-P ${PMT_FILE}-d ${DEBUG}-S ${SEED}-B"$BACKGROUND_HZ"-N"$RECYCLING"--!&&for((i=0;$i!=10;++i));do;echo 'EOF' > $PIPE;usleep 100000;done &&rm-f $PIPE)&JTimesliceReprocessor-a $
 
do set_variable STRING_TXT awk
 
const JK40Rates & getK40Rates()
Get K40 rates. 
 
then echo Variable JPP_DIR undefined exit fi source $JPP_DIR setenv sh $JPP_DIR &dev null set_variable
 
then echo Variable JPP_DIR undefined exit fi source $JPP_DIR setenv sh $JPP_DIR &dev null set_variable DEBUG set_variable WORKDIR
 
&set_variable OUTPUT_FILE
 
&set_variable OUT_FILE set_variable DETECTOR_FILE set_variable DAQ_FILE
 
then usage $script[detector file[output file[PMT parameters file[number of slices]]]] nAuxiliary script to produce random time slice data fi case set_variable NUMBER_OF_SLICES
 
then usage $script< input file >[option[primary[working directory]]] nWhere option can be N
 
fi set_variable FILENAME $WORKDIR
 
then JMuonMCEvt f $INPUT_FILE o $INTERMEDIATE_FILE d
 
esac $JPP_BIN JLogger sh $LOGGER until pgrep JGetMessage</dev/null > dev null
 
#define DEBUG(A)
Message macros.