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." 
   48 ################################################################################################# 
   50 # The sampler values correspond to N_on N_off, respectively (note that sampler calls JSampler), 
   52 # N_on   =  number of time slices to read; 
   53 # N_off  =  number of time slices to skip. 
   55 # The sampler option works as follows. 
   57 # read -on average- N_on  consecutive time slices and   
   58 # skip -on average- N_off time slices 
   59 # modulo the number of time slices in the file. 
   61 # The larger N_on, the faster the reading, because this reduces the random accesses  
   62 # of the data taking file to pick up a next time slice. 
   63 # The smaller N_off, the less time slices are skipped. 
   64 # So, N_on = 0 guarantees that all time slices are sampled. 
   65 # Note that if the number of time slices to be produced is small, then too small a value of N_off 
   66 # could create a bias because only the first time slices of the data taking file are then sampled. 
   67 ################################################################################################# 
   74 if [[ -p $PIPE ]]; 
then 
   78     JRandomTimesliceWriter \
 
   91     JPrintTriggerParameters \
 
  118     fatal 
"Error opening $PIPE." 
&set_variable DAQ_TIMESLICE
 
o $QUALITY_ROOT d $DEBUG!JPlot1D f
 
then JShowerPostfit f $INPUT_FILE o $OUTPUT_FILE N
 
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 $
 
then echo Variable JPP_DIR undefined exit fi source $JPP_DIR setenv sh $JPP_DIR &dev null set_variable
 
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 DEBUG set_variable WORKDIR
 
then JConvertDetectorFormat a $DETECTOR[1] o
 
&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
 
do set_variable SIGMA_NS set_variable OUTLIERS set_variable OUTPUT_FILE matrix[${ALPHA_DEG}\deg\] root $JPP JMatrixNZ a $DETECTOR f $INPUT_FILE o $OUTPUT_FILE S
 
&set_variable OUTPUT_FILE
 
then JMuonMCEvt f $INPUT_FILE o $INTERMEDIATE_FILE d
 
then usage $script< input_file >< detector_file > fi set_variable OUTPUT_DIR set_variable SELECTOR JDAQTimesliceL1 set_variable DEBUG case set_variable DEBUG
 
esac $JPP_BIN JLogger sh $LOGGER until pgrep JGetMessage</dev/null > dev null