From bf5d0f68321e61bf6202204212aabee55c3db14d Mon Sep 17 00:00:00 2001 From: Paul King Date: Fri, 31 Aug 2018 10:52:03 -0400 Subject: [PATCH 001/137] Squashed 'Feedback/' content from commit 8322bc5 git-subtree-dir: Feedback git-subtree-split: 8322bc5d3fd872a2e9079d50aa6bde85beb3c78b --- FlipPCValues | 177 +++ GetGoodPC | 111 ++ Makefile | 165 +++ SetLargeNegative_A_q | 98 ++ SetLargePositive_A_q | 88 ++ SetNominalPC | 72 ++ include/GMSock.h | 14 + include/GreenMonster.h | 120 ++ include/GreenSock.h | 39 + include/QwEPICSControl.h | 827 ++++++++++++++ include/QwHelicityCorrelatedFeedback.h | 484 ++++++++ include/README | 10 + include/SCAN_cf_commands.h | 17 + include/cfSock.h | 37 + include/cfSockCli.h | 28 + include/cfSock_types.h | 14 + main/QwFeedback.cc | 274 +++++ prminput/EpicsTable.map | 665 +++++++++++ prminput/detectors.map | 18 + prminput/parity_hist.in | 615 +++++++++++ prminput/qweak_beamline_eventcuts.in | 101 ++ prminput/qweak_beamline_geometry.map | 54 + prminput/qweak_fb_prm.in | 169 +++ prminput/qweak_hallc_beamline.map | 139 +++ prminput/qweak_hallc_pedestal.map | 154 +++ prminput/qweak_helicity.map | 84 ++ prminput/qweak_lumi.map | 140 +++ prminput/qweak_lumi_eventcuts.in | 42 + prminput/qweak_lumi_pedestal.map | 19 + prminput/qwfeedback.conf | 29 + prminput/qwfeedback_offline.conf | 31 + src/GreenMonster.cc | 217 ++++ src/QwEPICSControl.cc | 133 +++ src/QwHelicityCorrelatedFeedback.cc | 1393 ++++++++++++++++++++++++ src/cfSockCli.c | 443 ++++++++ 35 files changed, 7021 insertions(+) create mode 100755 FlipPCValues create mode 100755 GetGoodPC create mode 100644 Makefile create mode 100755 SetLargeNegative_A_q create mode 100755 SetLargePositive_A_q create mode 100755 SetNominalPC create mode 100644 include/GMSock.h create mode 100644 include/GreenMonster.h create mode 100644 include/GreenSock.h create mode 100644 include/QwEPICSControl.h create mode 100644 include/QwHelicityCorrelatedFeedback.h create mode 100644 include/README create mode 100644 include/SCAN_cf_commands.h create mode 100644 include/cfSock.h create mode 100644 include/cfSockCli.h create mode 100644 include/cfSock_types.h create mode 100644 main/QwFeedback.cc create mode 100644 prminput/EpicsTable.map create mode 100644 prminput/detectors.map create mode 100644 prminput/parity_hist.in create mode 100644 prminput/qweak_beamline_eventcuts.in create mode 100644 prminput/qweak_beamline_geometry.map create mode 100644 prminput/qweak_fb_prm.in create mode 100644 prminput/qweak_hallc_beamline.map create mode 100644 prminput/qweak_hallc_pedestal.map create mode 100644 prminput/qweak_helicity.map create mode 100644 prminput/qweak_lumi.map create mode 100644 prminput/qweak_lumi_eventcuts.in create mode 100644 prminput/qweak_lumi_pedestal.map create mode 100644 prminput/qwfeedback.conf create mode 100644 prminput/qwfeedback_offline.conf create mode 100644 src/GreenMonster.cc create mode 100644 src/QwEPICSControl.cc create mode 100644 src/QwHelicityCorrelatedFeedback.cc create mode 100644 src/cfSockCli.c diff --git a/FlipPCValues b/FlipPCValues new file mode 100755 index 000000000..5228091e3 --- /dev/null +++ b/FlipPCValues @@ -0,0 +1,177 @@ +#!/bin/bash +# Author : Rakitha Beminiwattha +# 02/20/2011 +# This bash script allows us to set the norminal values for the PC hardware counts +# To use it, +# compile using +# chmod +x FlipPCValues +# and then run ./FlipPCValues +# EPICS names PC [+] C1068_QDAC01PC [-] C1068_QDAC02 + +#cainfo=/home/EPICS/dvlepics/R3.14.12.1/base/bin/linux-x86/cainfo +#caget=/home/EPICS/dvlepics/R3.14.12.1/base/bin/linux-x86/caget +#caput=/home/EPICS/dvlepics/R3.14.12.1/base/bin/linux-x86/caput + +#1. PITA starting setpoints when IHWP is flipped from the IN-OUT in 8:18am 02/23/2011 +#2. Runs checked OUT - 10810 IN - 10766 -Changed by Rakitha 03/17/2011 +#PC_pos_t0_IN=43766 +#PC_neg_t0_IN=40434 +#RHWP_IN=8250 +#PC_pos_t0_OUT=43000 +#PC_neg_t0_OUT=41150 +#RHWP_OUT=500 + +#3. Runs checked OUT - 10978 IN - 10969&10981 -Changed by Rakitha 03/30/2011 - rakithab@jlab.org +#PC_pos_t0_IN=42990 +#PC_neg_t0_IN=41210 +#RHWP_IN=8250 +#PC_pos_t0_OUT=43238 +#PC_neg_t0_OUT=40962 +#RHWP_OUT=500 + +#4. Runs checked OUT - 11283 IN - 11286 -Changed by Rakitha 04/11/2011 - rakithab@jlab.org +PC_pos_t0_IN=43300 +PC_neg_t0_IN=40899 +#RHWP_IN=8250 +PC_pos_t0_OUT=42864 +PC_neg_t0_OUT=41335 +#RHWP_OUT=500 + +#New RHWP for run 2 - 11-24-2011 rakitha (rakithab) +#RHWP IN is 291.5 +#RHWP OUT is 15.7 +#conversion from deg to dac is 360 deg -> 8000 dac +#RHWP_IN=6478 +#RHWP_OUT=349 + + +#New RHWP for run 2 - 02-03-2012 rakitha (rakithab) +#conversion from deg to dac is 360 deg -> 8000 dac + +#RHWP_IN=391 +#RHWP_OUT=6342 +#RHWP_OUT_IN=7519 + +#New RHWP for run 2 - 02-16-2012 rakitha (rakithab) from E-log 250 +#conversion from deg to dac is 360 deg -> 8000 dac + +RHWP_IN=329 +RHWP_OUT=3496 +RHWP_OUT_IN=7511 + +#Helicity magnet set points +hel_odd_2_IN=-2 +hel_odd_2_OUT=-3 +hel_odd_2_OUT_IN=-3 + + +IHWP2="`caget -tf0 -w 0.1 IGL1I00DIOFLRD`" + +if [ $IHWP2 -ge 10000 ]; then + IHWP2="IN" +# echo "IHWP2 $IHWP2" +else + IHWP2="OUT" +# echo "IHWP2 $IHWP2" +fi +#conversion for PC V is 2^16 DAC = 2000V + + + + + +#5. No longer needs above values. +# Reads text files, +# /local/scratch/qweak/Last_good_PC_pos_OUT, +# /local/scratch/qweak/Last_good_PC_neg_OUT +# /local/scratch/qweak/Last_good_PC_pos_IN +# /local/scratch/qweak/Last_good_PC_neg_IN +# set updated by the feedback program with last oggd PC values.- Changed by Rakitha 04/15/2011 - rakithab@jlab.org +host_name=${HOSTNAME} +case "$host_name" in + *cdaql5* ) + PC_pos_current="`caget -t C1068_QDAC01`" + PC_neg_current="`caget -t C1068_QDAC02`" + echo -n "Did you stop the current run in the Qweak, Compton AND Injector DAQ? [y/n] " + read yesno + if [ ${yesno} = "n" ] ; then + echo "Do it now! Then run this script again." + exit -1 + else + echo "Check the IHWP state..." + fi + + IHWP_State="`caget -t IGL1I00DI24_24M`" +#IHWP_State="IN" + echo -n "Did you notice the IHWP state has changed [y/n] " + read yesno2 + + if [ ${yesno2} = "n" ] ; then + echo "Verify it now! Then run this script again." + exit -1 + else + echo "Flipping the PC values..." + fi + + echo "Setting Pockels Cell values " + + if [ "$IHWP_State" == "OUT " ];then + echo "Current IHWP state is OUT" + if [ "$IHWP2" == "IN" ];then + echo "Current IHWP2 state is $IHWP2" + PC_pos_t0_OUT="`cat /local/scratch/qweak/Last_good_PC_pos_OUT_IHWP2_IN`" + PC_neg_t0_OUT="`cat /local/scratch/qweak/Last_good_PC_neg_OUT_IHWP2_IN`" + echo "RHWP for IHWP OUT state = $RHWP_OUT_IN" + caput psub_pl_ipos $RHWP_OUT_IN + echo " Helicity magnet setpoint hel_odd_2 = $hel_odd_2_OUT" + caput hel_odd_2 $hel_odd_2_OUT + else + echo "Current IHWP2 state is $IHWP2" + PC_pos_t0_OUT="`cat /local/scratch/qweak/Last_good_PC_pos_OUT`" + PC_neg_t0_OUT="`cat /local/scratch/qweak/Last_good_PC_neg_OUT`" + echo "RHWP for IHWP OUT state = $RHWP_OUT" + caput psub_pl_ipos $RHWP_OUT + echo " Helicity magnet setpoint hel_odd_2 = $hel_odd_2_OUT_IN" + caput hel_odd_2 $hel_odd_2_OUT_IN + fi + echo "Norminal PC_pos = $PC_pos_t0_OUT" + echo "Current PC_pos = $PC_pos_current" + echo "Norminal PC_neg = $PC_neg_t0_OUT" + echo "Current PC_neg = $PC_neg_current" + echo "Setting norminal values" + caput C1068_QDAC01 $PC_pos_t0_OUT + caput C1068_QDAC02 $PC_neg_t0_OUT + else + echo "Current IHWP state is IN" + if [ "$IHWP2" == "IN" ];then + echo "Current IHWP2 state is $IHWP2" + PC_pos_t0_IN="`cat /local/scratch/qweak/Last_good_PC_pos_IN_IHWP2_IN`" + PC_neg_t0_IN="`cat /local/scratch/qweak/Last_good_PC_neg_IN_IHWP2_IN`" + else + echo "Current IHWP2 state is $IHWP2" + PC_pos_t0_IN="`cat /local/scratch/qweak/Last_good_PC_pos_IN`" + PC_neg_t0_IN="`cat /local/scratch/qweak/Last_good_PC_neg_IN`" + echo " Setting Helicity magnet setpoint hel_odd_2 = $hel_odd_2_IN" + caput hel_odd_2 $hel_odd_2_IN + fi + echo "Norminal PC_pos = $PC_pos_t0_IN" + echo "Current PC_pos = $PC_pos_current" + echo "Norminal PC_neg = $PC_neg_t0_IN" + echo "Current PC_neg = $PC_neg_current" + echo "RHWP for IHWP IN state = $RHWP_IN" + echo "Setting norminal values" + caput C1068_QDAC01 $PC_pos_t0_IN + caput C1068_QDAC02 $PC_neg_t0_IN + caput psub_pl_ipos $RHWP_IN + fi + ;; + * ) + echo " " + echo " " + echo "FlipPCValues is not supposed to be running at $host_name" + echo "Please go to cdaql5 and re-run FlipPCValues" + echo " " + echo " " +# echo "Please email to rakithab@jlab.org about what you want to do" + ;; +esac diff --git a/GetGoodPC b/GetGoodPC new file mode 100755 index 000000000..b3e598920 --- /dev/null +++ b/GetGoodPC @@ -0,0 +1,111 @@ +#!/bin/bash +# Author : Rakitha Beminiwattha +# 01/16/2012 +# This bash script allows us to read norminal and current values for the PC and RHWP hardware counts +# To use it, +# compile using +# chmod +x GetGoodPC +# and then run ./GetGoodPC +# EPICS names PC [+] C1068_QDAC01PC [-] C1068_QDAC02 + +# Reads text files, +# /local/scratch/qweak/Last_good_PC_pos_OUT, +# /local/scratch/qweak/Last_good_PC_neg_OUT +# /local/scratch/qweak/Last_good_PC_pos_IN +# /local/scratch/qweak/Last_good_PC_neg_IN +# set updated by the feedback program with last oggd PC values.- Changed by Rakitha 04/15/2011 - rakithab@jlab.org +#RHWP_IN=391 +#RHWP_OUT=6342 +#RHWP_OUT_IN=7519 + +#New RHWP for run 2 - 02-16-2012 rakitha (rakithab) from E-log 250 +#conversion from deg to dac is 360 deg -> 8000 dac + +# +#cainfo=/home/EPICS/dvlepics/R3.14.12.1/base/bin/linux-x86/cainfo +#caget=/home/EPICS/dvlepics/R3.14.12.1/base/bin/linux-x86/caget + +RHWP_IN=329 +RHWP_OUT=3496 +RHWP_OUT_IN=7511 + +IHWP2="`caget -tf0 -w 0.1 IGL1I00DIOFLRD`" +if [ $IHWP2 -ge 10000 ]; then + IHWP2="IN" +# echo "IHWP2 $IHWP2" +else + IHWP2="OUT" +# echo "IHWP2 $IHWP2" +fi + +host_name=${HOSTNAME} +case "$host_name" in + *cdaql5* ) + PC_pos_current="`caget -tf0 C1068_QDAC01`" + PC_neg_current="`caget -tf0 C1068_QDAC02`" + Midpoint=$(((PC_pos_current+PC_neg_current)/2)) + echo "Current PC Mid-point = $Midpoint" + IHWP_State="`caget -t IGL1I00DI24_24M`" + RHWP="`caget -t psub_pl_ipos`" + echo "Current RHWP = $RHWP" + echo "RHWP" + echo "`cainfo psub_pl_ipos | grep Access | cut -c 20-30`" + echo "PC DAC status" + echo "`cainfo C1068_QDAC01 | grep Access | cut -c 20-30`" + echo "`cainfo C1068_QDAC02 | grep Access | cut -c 20-30`" +# RHWP_access="`$cainfo psub_pl_ipos | grep Access | cut -c 26-30 `" +# if [ "$RHWP_access" != "write" ]; then +# echo "Hall C have no write access to RHWP" +# echo "Please request MCC to set RHWP setting to $RHWP" +# echo "Once RHWP setting is set $RHWP run the script again" +# fi + if [ "$IHWP_State" == "OUT " ];then + echo "Current IHWP state is OUT" + echo "Nominal Mid-point = 40800" + if [ "$IHWP2" == "IN" ];then + echo "Current IHWP2 state is $IHWP2" + PC_pos_t0_OUT="`cat /local/scratch/qweak/Last_good_PC_pos_OUT_IHWP2_IN`" + PC_neg_t0_OUT="`cat /local/scratch/qweak/Last_good_PC_neg_OUT_IHWP2_IN`" + echo "RHWP for IHWP OUT state = $RHWP_OUT_IN" + else + echo "Current IHWP2 state is $IHWP2" + PC_pos_t0_OUT="`cat /local/scratch/qweak/Last_good_PC_pos_OUT`" + PC_neg_t0_OUT="`cat /local/scratch/qweak/Last_good_PC_neg_OUT`" + echo "RHWP for IHWP OUT state = $RHWP_OUT" + fi + + echo "Nominal PC_pos = $PC_pos_t0_OUT" + echo "Current PC_pos = $PC_pos_current" + echo "Nominal PC_neg = $PC_neg_t0_OUT" + echo "Current PC_neg = $PC_neg_current" + + + else + echo "Current IHWP state is IN" + echo "Nominal Mid-point = 41215" + if [ "$IHWP2" == "IN" ];then + echo "Current IHWP2 state is $IHWP2" + PC_pos_t0_IN="`cat /local/scratch/qweak/Last_good_PC_pos_IN_IHWP2_IN`" + PC_neg_t0_IN="`cat /local/scratch/qweak/Last_good_PC_neg_IN_IHWP2_IN`" + else + echo "Current IHWP2 state is $IHWP2" + PC_pos_t0_IN="`cat /local/scratch/qweak/Last_good_PC_pos_IN`" + PC_neg_t0_IN="`cat /local/scratch/qweak/Last_good_PC_neg_IN`" + fi + + echo "Nominal PC_pos = $PC_pos_t0_IN" + echo "Current PC_pos = $PC_pos_current" + echo "Nominal PC_neg = $PC_neg_t0_IN" + echo "Current PC_neg = $PC_neg_current" + echo "RHWP for IHWP IN state = $RHWP_IN" + fi + ;; + * ) + echo " " + echo " " + echo "Please go to cdaql5 and re-run" + echo " " + echo " " +# echo "Please email to rakithab@jlab.org about what you want to do" + ;; +esac diff --git a/Makefile b/Makefile new file mode 100644 index 000000000..d40cc77f8 --- /dev/null +++ b/Makefile @@ -0,0 +1,165 @@ + +############## +# Environment : +############## + +SHELL = /bin/sh +ARCH = $(shell uname) +MAKE = $(word $(words $(shell which gmake)),$(shell which gmake)) +# system dependent, but '/usr/bin/gmake' is incorrect on some system) +# the trick is to get rid of any verbose parts that precedes the return +AWK = gawk +BASENAME := basename +CAT := cat +CD := cd +CHMOD := chmod +DIRNAME := dirname +ECHO := echo +FIND := find +GCC := gcc + # This must be the GNU compiler collection : explicit use of + # flag '-M' for automatic search for dependencies + # It is not correlated to $(CXX) and $(LD) which depend on $(ARCH) +GREP := grep +LS := ls +MAKE := make +RM-f := \rm -f +RM-rf := \rm -rf + # 'rm' is often aliases as 'rm -i', so '\rm' instead +MV := \mv +CP := \cp +ROOTCINT := rootcint +SED := sed -e +TOUCH := touch +CXX = + +#### VPATH = $QWANALYSIS/lib:$QWANALYSIS/Analysis/include:$QWANALYSIS/Analysis/src:$QWANALYSIS/Parity/include:$QWANALYSIS/Parity/src + + + +MYSRCDIR = ./src +MYINCDIR = ./include + +VPATH = ./main:./src + + + + +ifndef CODA + $(error Error: The CODA variable is not defined; the feedback analyzer requires linking against a complete CODA installation.) +endif + +################## +################## +### Get the flags from the QWANALYSIS build +################## + +QWEAKLIBS := $(shell ${QWANALYSIS}/bin/qweak-config --libs) +QWEAKLDFLAGS := $(shell ${QWANALYSIS}/bin/qweak-config --ldflags) +# When we get the QwAnalysis include paths, turn paths like "./*" into "${QWANALYSIS}/*". +REGEXP_QWANA := $(shell ${ECHO} ${QWANALYSIS} | ${SED} 's/\//\\\//g') +QWEAKCPPFLAGS := $(shell ${QWANALYSIS}/bin/qweak-config --cppflags | sed 's/I\./I${REGEXP_QWANA}/g' ) + +################## + +ifeq ($(ARCH),Linux) + CXX = g++ + LINKER = g++ + CFLAGS = -Wall -fPIC -O3 + ###CFLAGS = -Wall -fPIC +endif + +ifeq ($(ARCH),SunOS) + CXX = CC + LINKER = CC + CFLAGS = -KPIC + CLIBS = -lm -lposix4 -lsocket -lnsl -lresolv -ldl +endif + +##### + + +################## +# JLab EPICS libs +################## +ifdef EPICS + EPICSFLAGS := -I$(EPICS)/base/include -I$(EPICS)/base/include/os/Linux + # On the cdaq cluster, the library directory is different between the 3.13 + # and 3.14 EPICS versions + ifeq ($(shell $(AWK) '$$2="EPICS_REVISION" {print $$3}' $(EPICS)/base/include/epicsVersion.h),13) + EPICSLIBS := -L${EPICS}/base/lib/Linux -lca -lcas -lCom -lAs -lgdd + else + EPICSLIBS := -L${EPICS}/base/lib/linux-x86 -lca -lcas -lCom -lgdd + endif +else + $(error Aborting : EPICS library is not accessible from the system) +endif + +############## +############## +############## + +CFLAGS += $(EPICSFLAGS) -I${MYINCDIR} +CPPFLAGS = $(QWEAKCPPFLAGS) +LDFLAGS = $(QWEAKLDFLAGS) +LIBS = $(EPICSLIBS) $(QWEAKLIBS) -L$(QW_LIB) -lQw + +############## +############## +############## + +MYSRCFILES= $(shell find $(MYSRCDIR) -name \*.cc -or -name \*.c) +MYINCFILES= $(shell find $(MYINCDIR) -name \*.h) + +MYOBJFILES= $(shell echo $(MYSRCFILES)|sed -e 's/\.cc/\.o/g' -e 's/\.c/\.o/g') + +############## + +default : qwfeedback +all: default + +qwfeedback : main/QwFeedback.o $(MYOBJFILES) + @echo + @echo + @echo + @echo + @echo "########## Making \"qwfeedback\" ##########" + @echo Local source files used: $(MYOBJFILES). + @echo Local include files used: $(MYINCFILES). + @echo "########## Making \"qwfeedback\" ##########"> .lastbuild-qwfeedback + @echo $(shell date) >> .lastbuild-qwfeedback + @echo Local source files used: $(MYOBJFILES). >>.lastbuild-qwfeedback + @echo Local include files used: $(MYINCFILES).>>.lastbuild-qwfeedback + @echo + ${LINKER} ${CFLAGS} ${filter-out %.a %.so, $^} ${LDFLAGS} ${LIBS} -o $@ + @echo + @echo "###### Finished making \"qwfeedback\" ######" + @echo "###### Finished making \"qwfeedback\" ######" >>.lastbuild-qwfeedback + @echo + +clean: + rm -f *.o */*.o core qwfeedback *~ */*~ + +main/%.o: main/%.cc $(MYINCFILES) + @echo "######" + $(CXX) ${CFLAGS} ${CPPFLAGS} -o $@ -c $< + @echo "######" + +src/%.o: src/%.cc include/%.h + @echo "######" + $(CXX) ${CFLAGS} ${CPPFLAGS} -o $@ -c $< + @echo "######" + +src/%.o: src/%.c include/%.h + @echo "######" + $(GCC) ${CFLAGS} -o $@ -c $< + @echo "######" + +%.o: %.cc + ${CXX} ${CFLAGS} ${CPPFLAGS} -c $< + @echo "######" + + + + + diff --git a/SetLargeNegative_A_q b/SetLargeNegative_A_q new file mode 100755 index 000000000..197d390e4 --- /dev/null +++ b/SetLargeNegative_A_q @@ -0,0 +1,98 @@ +#!/bin/bash +# Author : Rakitha Beminiwattha +# 03/09/2011 +# This bash script allows us to set the PC setpoints to get large negative charge asymmetry +# To use it, +# compile using +# chmod +x SetLargeNegative_A_q +# and then run ./SetLargeNegative_A_q + +# EPICS names PC [+] C1068_QDAC01PC [-] C1068_QDAC02 + +# Last time norminal values were updated +# Runs checked OUT - 10207 IN - 10198 - Rakitha 02/23/2011 -Old + + +#PC_pos_t0_IN=43570 +#PC_neg_t0_IN=40650 +#PC_pos_t0_OUT=42970 +#PC_neg_t0_OUT=41230 + + +#2. Runs checked OUT - 10810 IN - 10766 -Changed by Rakitha 03/17/2011 -Current +#PC_pos_t0_IN=43766 +#PC_neg_t0_IN=40434 +#PC_pos_t0_OUT=43000 +#PC_neg_t0_OUT=41150 + +#3. Runs checked OUT - 10978 IN - 10969&10981 -Changed by Rakitha 03/30/2011 - rakithab@jlab.org +#PC_pos_t0_IN=42990 +#PC_neg_t0_IN=41210 +#PC_pos_t0_OUT=43238 +#PC_neg_t0_OUT=40962 + +#4. Runs checked OUT - 11283 IN - 11286 -Changed by Rakitha 04/11/2011 - rakithab@jlab.org +#PC_pos_t0_IN=43300 +#PC_neg_t0_IN=40899 +#PC_pos_t0_OUT=42864 +#PC_neg_t0_OUT=41335 + +#5. No longer needs above values. +# Reads text files, +# /local/scratch/qweak/Last_good_PC_pos_OUT, +# /local/scratch/qweak/Last_good_PC_neg_OUT +# /local/scratch/qweak/Last_good_PC_pos_IN +# /local/scratch/qweak/Last_good_PC_neg_IN +# set updated by the feedback program with last oggd PC values.- Changed by Rakitha 04/15/2011 - rakithab@jlab.org + + +PC_Delta_Counts=2500 + + +PC_pos_current="`caget -t C1068_QDAC01`" +PC_neg_current="`caget -t C1068_QDAC02`" + + +IHWP_State="`caget -t IGL1I00DI24_24M`" +#IHWP_State="IN" +echo "Offsetting Pockels Cell values by $PC_Delta_Counts" + +if [ "$IHWP_State" == "OUT " ];then + #PC_pos_t0_OUT="`cat /local/scratch/qweak/Last_good_PC_pos_OUT`" + #PC_neg_t0_OUT="`cat /local/scratch/qweak/Last_good_PC_neg_OUT`" + PC_pos_t0_OUT="`cat /local/scratch/qweak/norminal_PC_OUT`" + PC_neg_t0_OUT="`cat /local/scratch/qweak/norminal_PC_OUT`" + + + echo "Current IHWP state is OUT" + echo "Norminal PC_pos = $PC_pos_t0_OUT" + echo "Current PC_pos = $PC_pos_current" + echo "Norminal PC_neg = $PC_neg_t0_OUT" + echo "Current PC_neg = $PC_neg_current" + PC_pos_OUT=$(($PC_pos_t0_OUT - $PC_Delta_Counts)) + PC_neg_OUT=$(($PC_neg_t0_OUT + $PC_Delta_Counts)) + echo "Setting PC positive setpoint to $PC_pos_OUT to get large negative charge asymmetry" + caput C1068_QDAC01 $PC_pos_OUT + echo "Setting PC positive setpoint to $PC_neg_OUT to get large negative charge asymmetry" + caput C1068_QDAC02 $PC_neg_OUT +else + #PC_pos_t0_IN="`cat /local/scratch/qweak/Last_good_PC_pos_IN`" + #PC_neg_t0_IN="`cat /local/scratch/qweak/Last_good_PC_neg_IN`" + PC_pos_t0_IN="`cat /local/scratch/qweak/norminal_PC_IN`" + PC_neg_t0_IN="`cat /local/scratch/qweak/norminal_PC_IN`" + + + echo "Current IHWP state is IN" + echo "Norminal PC_pos = $PC_pos_t0_IN" + echo "Current PC_pos = $PC_pos_current" + echo "Norminal PC_neg = $PC_neg_t0_IN" + echo "Current PC_neg = $PC_neg_current" + PC_pos_IN=$(($PC_pos_t0_IN - $PC_Delta_Counts)) + PC_neg_IN=$(($PC_neg_t0_IN + $PC_Delta_Counts)) + echo "Setting PC negative setpoint to $PC_pos_IN to get large negative charge asymmetry" + caput C1068_QDAC01 $PC_pos_IN + echo "Setting PC negative setpoint to $PC_neg_IN to get large negative charge asymmetry" + caput C1068_QDAC02 $PC_neg_IN +fi + + diff --git a/SetLargePositive_A_q b/SetLargePositive_A_q new file mode 100755 index 000000000..087c455ff --- /dev/null +++ b/SetLargePositive_A_q @@ -0,0 +1,88 @@ +#!/bin/bash +# Author : Rakitha Beminiwattha +# 03/09/2011 +# This bash script allows us to set the PC setpoints to get large positive charge asymmetry +# To use it, +# compile using +# chmod +x SetLargePositive_A_q +# and then run ./SetLargePositive_A_q + +# EPICS names PC [+] C1068_QDAC01PC [-] C1068_QDAC02 + +# Last time norminal values were updated +# Runs checked OUT - 10207 IN - 10198 - Rakitha 02/23/2011 - Old + +#2. Runs checked OUT - 10810 IN - 10766 -Changed by Rakitha 03/17/2011 -Current +#PC_pos_t0_IN=43766 +#PC_neg_t0_IN=40434 +#PC_pos_t0_OUT=43000 +#PC_neg_t0_OUT=41150 + +#3. Runs checked OUT - 10978 IN - 10969&10981 -Changed by Rakitha 03/30/2011 - rakithab@jlab.org +#PC_pos_t0_IN=42990 +#PC_neg_t0_IN=41210 +#PC_pos_t0_OUT=43238 +#PC_neg_t0_OUT=40962 + +#4. Runs checked OUT - 11283 IN - 11286 -Changed by Rakitha 04/11/2011 - rakithab@jlab.org +#PC_pos_t0_IN=43300 +#PC_neg_t0_IN=40899 +#PC_pos_t0_OUT=42864 +#PC_neg_t0_OUT=41335 + +PC_Delta_Counts=2500 + +#5. No longer needs above values. +# Reads text files, +# /local/scratch/qweak/Last_good_PC_pos_OUT, +# /local/scratch/qweak/Last_good_PC_neg_OUT +# /local/scratch/qweak/Last_good_PC_pos_IN +# /local/scratch/qweak/Last_good_PC_neg_IN +# set updated by the feedback program with last logged PC values.- Changed by Rakitha 04/15/2011 - rakithab@jlab.org + + +PC_pos_current="`caget -t C1068_QDAC01`" +PC_neg_current="`caget -t C1068_QDAC02`" + + +IHWP_State="`caget -t IGL1I00DI24_24M`" +#IHWP_State="IN" +echo "Offsetting Pockels Cell values by $PC_Delta_Counts" + +if [ "$IHWP_State" == "OUT " ];then +# PC_pos_t0_OUT="`cat /local/scratch/qweak/Last_good_PC_pos_OUT`" +# PC_neg_t0_OUT="`cat /local/scratch/qweak/Last_good_PC_neg_OUT`" + PC_pos_t0_OUT="`cat /local/scratch/qweak/norminal_PC_OUT`" + PC_neg_t0_OUT="`cat /local/scratch/qweak/norminal_PC_OUT`" + + echo "Current IHWP state is OUT" + echo "Norminal PC_pos = $PC_pos_t0_OUT" + echo "Current PC_pos = $PC_pos_current" + echo "Norminal PC_neg = $PC_neg_t0_OUT" + echo "Current PC_neg = $PC_neg_current" + PC_pos_OUT=$(($PC_pos_t0_OUT + $PC_Delta_Counts)) + PC_neg_OUT=$(($PC_neg_t0_OUT - $PC_Delta_Counts)) + echo "Setting PC positive setpoint to $PC_pos_OUT to get large positive charge asymmetry" + caput C1068_QDAC01 $PC_pos_OUT + echo "Setting PC negative setpoint to $PC_neg_OUT to get large positive charge asymmetry" + caput C1068_QDAC02 $PC_neg_OUT +else +# PC_pos_t0_IN="`cat /local/scratch/qweak/Last_good_PC_pos_IN`" +# PC_neg_t0_IN="`cat /local/scratch/qweak/Last_good_PC_neg_IN`" + PC_pos_t0_IN="`cat /local/scratch/qweak/norminal_PC_IN`" + PC_neg_t0_IN="`cat /local/scratch/qweak/norminal_PC_IN`" + + echo "Current IHWP state is IN" + echo "Norminal PC_pos = $PC_pos_t0_IN" + echo "Current PC_pos = $PC_pos_current" + echo "Norminal PC_neg = $PC_neg_t0_IN" + echo "Current PC_neg = $PC_neg_current" + PC_pos_IN=$(($PC_pos_t0_IN + $PC_Delta_Counts)) + PC_neg_IN=$(($PC_neg_t0_IN - $PC_Delta_Counts)) + echo "Setting PC positive setpoint to $PC_pos_IN to get large positive charge asymmetry" + #caput C1068_QDAC01 $PC_pos_IN + echo "Setting PC negative setpoint to $PC_neg_IN to get large positive charge asymmetry" + #caput C1068_QDAC02 $PC_neg_IN +fi + + diff --git a/SetNominalPC b/SetNominalPC new file mode 100755 index 000000000..b944ad224 --- /dev/null +++ b/SetNominalPC @@ -0,0 +1,72 @@ +#!/bin/bash +# Author : Rakitha Beminiwattha +# 01/16/2012 +# This bash script allows us to read norminal and current values for the PC and RHWP hardware counts +# To use it, +# compile using +# chmod +x GetGoodPC +# and then run ./GetGoodPC +# EPICS names PC [+] C1068_QDAC01PC [-] C1068_QDAC02 + +# Reads text files, +# /local/scratch/qweak/Last_good_PC_pos_OUT, +# /local/scratch/qweak/Last_good_PC_neg_OUT +# /local/scratch/qweak/Last_good_PC_pos_IN +# /local/scratch/qweak/Last_good_PC_neg_IN +# set updated by the feedback program with last oggd PC values.- Changed by Rakitha 04/15/2011 - rakithab@jlab.org +RHWP_IN=6478 +RHWP_OUT=349 + +host_name=${HOSTNAME} +case "$host_name" in + *cdaql5* ) + PC_pos_current="`caget -t C1068_QDAC01`" + PC_neg_current="`caget -t C1068_QDAC02`" + #Midpoint=$(((PC_pos_current+PC_neg_current)/2)) + #echo "PC Mid-point = $Midpoint" + IHWP_State="`caget -t IGL1I00DI24_24M`" + RHWP="`caget -t psub_pl_ipos`" + echo "Current RHWP = $RHWP" + if [ "$IHWP_State" == "OUT " ];then + echo "Current IHWP state is OUT" + echo "Norminal Mid-point = 40800" + PC_pos_t0_OUT="`cat /local/scratch/qweak/Last_good_PC_pos_OUT`" + PC_neg_t0_OUT="`cat /local/scratch/qweak/Last_good_PC_neg_OUT`" + echo "Norminal PC_pos = $PC_pos_t0_OUT" + echo "Current PC_pos = $PC_pos_current" + echo "Norminal PC_neg = $PC_neg_t0_OUT" + echo "Current PC_neg = $PC_neg_current" + echo "RHWP for IHWP OUT state = $RHWP_OUT" + PC_pos_t0_OUT="`cat /local/scratch/qweak/norminal_PC_OUT`" + PC_neg_t0_OUT="`cat /local/scratch/qweak/norminal_PC_OUT`" + echo "Nominal Mid-point" + caput C1068_QDAC01 $PC_pos_t0_OUT + caput C1068_QDAC02 $PC_neg_t0_OUT + + else + echo "Current IHWP state is IN" + echo "Norminal Mid-point = 41215" + PC_pos_t0_IN="`cat /local/scratch/qweak/Last_good_PC_pos_IN`" + PC_neg_t0_IN="`cat /local/scratch/qweak/Last_good_PC_neg_IN`" + echo "Norminal PC_pos = $PC_pos_t0_IN" + echo "Current PC_pos = $PC_pos_current" + echo "Norminal PC_neg = $PC_neg_t0_IN" + echo "Current PC_neg = $PC_neg_current" + echo "RHWP for IHWP IN state = $RHWP_IN" + PC_pos_t0_IN="`cat /local/scratch/qweak/norminal_PC_IN`" + PC_neg_t0_IN="`cat /local/scratch/qweak/norminal_PC_IN`" + echo "Nominal Mid-point" + caput C1068_QDAC01 $PC_pos_t0_IN + caput C1068_QDAC02 $PC_neg_t0_IN + + fi + ;; + * ) + echo " " + echo " " + echo "Please go to cdaql5 and re-run FlipPCValues" + echo " " + echo " " +# echo "Please email to rakithab@jlab.org about what you want to do" + ;; +esac diff --git a/include/GMSock.h b/include/GMSock.h new file mode 100644 index 000000000..a26698a04 --- /dev/null +++ b/include/GMSock.h @@ -0,0 +1,14 @@ +#include "GreenSock.h" + +extern "C" int cfSockCommand(int crate_number, + int command_type, int command, + int req_param, int req_param_2, + char *reply, char *msg); + +extern "C" int GreenSockCommand(int crate_number, + struct greenRequest *gRequest); + +extern "C" int cfSockCliOpen (int crate_number, int keepopen); +extern "C" int cfSockCliSend (int crate_number, struct request *myRequest, + struct request *serverReply); +extern "C" int cfSockCliClose(); diff --git a/include/GreenMonster.h b/include/GreenMonster.h new file mode 100644 index 000000000..f03bfd0b7 --- /dev/null +++ b/include/GreenMonster.h @@ -0,0 +1,120 @@ + +#include + +//#include "TGClient.h" +#include "Rtypes.h" +#include "TString.h" +//#include "TROOT.h" +//#include "TStyle.h" +//#include "TObjectTable.h" +//#include "TGCanvas.h" +//#include "TPad.h" +//#include "TPaveText.h" +//#include "TGTab.h" +//#include "TGIcon.h" +//#include +//#include "TGFrame.h" +//#include "TGMenu.h" +//#include "TSystem.h" +//#include "TGLayout.h" +//#include "TGLabel.h" +//#include "TGButton.h" +//#include "TGTextBuffer.h" +//#include "TGTextEntry.h" +//#include "TGToolTip.h" +//#include "TFile.h" +//#include "TTimer.h" +//#include "TColor.h" +//#include "TQObject.h" +//#include "TRootHelpDialog.h" +//#include "RQ_OBJECT.h" + +#include "cfSock_types.h" +//#include "../bmw/bmw_cf_commands.h" +#include "SCAN_cf_commands.h" +#include "GMSock.h" + +#define GM_LOCAL 201 + +#define GM_BMW_CHANGE 2001 +#define GM_BMW_CHECK 2002 +#define GM_BMW_TEST_ENABLE 2005 +#define GM_BMW_TEST_SET_VALUE 2006 +#define GM_BMW_SET_KILL 2007 +// the relative value of these button id's labels each modulation object +#define BMW_OBJRADIO1 2101 +#define BMW_OBJRADIO2 2102 +#define BMW_OBJRADIO3 2103 +#define BMW_OBJRADIO4 2104 +#define BMW_OBJRADIO5 2105 +#define BMW_OBJRADIO6 2106 +#define BMW_OBJRADIO7 2107 +#define BMW_OBJRADIO8 2108 + +#define KILL_SERVER_1 5001 +#define KILL_SERVER_2 5002 +#define KILL_SERVER_3 5003 +#define KILL_SERVER_4 5004 + + +#define GM_SCN_CHECK 6002 +#define GM_SCN_SET 6003 +#define SCN_RADIO_CLN 6101 +#define SCN_RADIO_NOT 6102 +#define SCN_RADIO_CLN_BT 0 +#define SCN_RADIO_NOT_BT 1 +#define SCN_INT_CLN 1 +#define SCN_INT_NOT 0 + +class GreenMonster{ +public: + GreenMonster(); + ~GreenMonster(); + + void CheckScan(); + + void Open(); + void Close(); + + void SCNSetStatus(Int_t); + void SCNSetValue(Int_t,Int_t); + + void PrintScanInfo(){ + switch (statusSCN) + { + case SCN_INT_CLN: + { + std::cout << "Scan Status is CLEAN" << std::endl; + break; + } + case SCN_INT_NOT: + { + std::cout << "Scan Status is NOT_CLEAN" << std::endl; + break; + } + default: + std::cout << "ERROR: Unrecognized SCAN status flag" << std::endl; + } + std::cout << "Scan data 1: " << setpoint1SCN << std::endl; + std::cout << "Scan data 2: " << setpoint2SCN << std::endl; + } + +private: + Bool_t fVerbose; + + Bool_t fUseCrate[5]; + TString* fCrateNames[5]; + Int_t fCrateNumbers[5]; + + // objects for scan tabpage + Int_t fSCN_TABID; + + Int_t statusSCN; + Int_t setpoint1SCN; + Int_t setpoint2SCN; + + void SCNUpdateStatus(Int_t); + Bool_t SCNCheckStatus(); + void SCNCheckValues(); + +}; diff --git a/include/GreenSock.h b/include/GreenSock.h new file mode 100644 index 000000000..cfd2f5e2a --- /dev/null +++ b/include/GreenSock.h @@ -0,0 +1,39 @@ +/* GreenSock.h - header used by both GreenMonster and cfSockCli */ +/* defines */ +/* structure for socket requests/replies */ + + +#ifndef SOCK_ERROR +#define SOCK_ERROR (-1) +#endif +#ifndef SOCK_OK +#define SOCK_OK (0) +#endif + +#define GREEN_REQUEST_MSG_SIZE 1024 /* max size of request message */ + +#ifndef Crate_CountingHouse +#define Crate_CountingHouse (0) +#endif +#ifndef Crate_LeftSpect +#define Crate_LeftSpect (1) +#endif +#ifndef Crate_RightSpect +#define Crate_RightSpect (2) +#endif +#ifndef Crate_Injector +#define Crate_Injector (3) +#endif +#ifndef Crate_Qwvmets +#define Crate_Qwvmets (4) +#endif +struct greenRequest +{ + long command_type; + long command; + long par1; + long par2; + char *reply; + char message[GREEN_REQUEST_MSG_SIZE]; /* message buffer */ +}; + diff --git a/include/QwEPICSControl.h b/include/QwEPICSControl.h new file mode 100644 index 000000000..dc881a8fd --- /dev/null +++ b/include/QwEPICSControl.h @@ -0,0 +1,827 @@ +#ifndef __QwEPICSCONTROL__ +#define __QwEPICSCONTROL__ + + + +#include +#include +#include +#include +#include + +#include +#include + + +#include "Rtypes.h" + +#include "TMath.h" +#include "TMatrix.h" +#include "TString.h" + +#include "cadef.h" + + +class QwEPICSControl{ +public: + + QwEPICSControl(); + ~QwEPICSControl(); + + void Print_HallAIA(){ + Int_t status; + // Char_t tmp[30]; + // status = ca_get(DBR_STRING, fIDHall_A_IA, tmp); + // status = ca_pend_io(10); + // std::cout << "Hall A IA value: " << tmp << std::endl; + Double_t value; + status = ca_get(DBR_DOUBLE, fIDHall_A_IA, &value); + status = ca_pend_io(10); + printf("Hall A IA value: %lf\n", value); + }; + + + void Print_Qasym_Ctrls(){ + Int_t status; + // Char_t tmp[30]; + // status = ca_get(DBR_STRING, fIDHall_A_IA, tmp); + // status = ca_pend_io(10); + // std::cout << "Hall A IA value: " << tmp << std::endl; + Double_t value; + + status = ca_get(DBR_DOUBLE, fIDPockels_Cell_plus, &value); + status = ca_pend_io(10); + std::cout << "Pockels Cell plus HV value: " << value << std::endl; + status = ca_get(DBR_DOUBLE, fIDPockels_Cell_minus, &value); + status = ca_pend_io(10); + std::cout << "Pockels Cell minus HV value: " << value << std::endl; + + status = ca_get(DBR_DOUBLE, fIDHall_C_IA_A0, &value); + status = ca_pend_io(10); + std::cout << "Hall C IA value A0: " << value << std::endl; + status = ca_get(DBR_DOUBLE, fIDHall_C_IA_A1, &value); + status = ca_pend_io(10); + std::cout << "Hall C IA value A1: " << value << std::endl; + status = ca_get(DBR_DOUBLE, fIDHall_C_IA_A2, &value); + status = ca_pend_io(10); + std::cout << "Hall C IA value A2: " << value << std::endl; + status = ca_get(DBR_DOUBLE, fIDHall_C_IA_A3, &value); + status = ca_pend_io(10); + std::cout << "Hall C IA value A3: " << value << std::endl; + + }; + + void Set_HallCIA(Int_t mode, Double_t &value){ + Int_t status; + switch(mode){ + case 0: + status = ca_put(DBR_DOUBLE, fIDHall_C_IA_A0, &value); + status = ca_pend_io(10); + status = ca_get(DBR_DOUBLE, fIDHall_C_IA_A0, &value); + status = ca_pend_io(10); + std::cout << "Hall C IA value A0: " << value << std::endl; + break; + case 1: + status = ca_put(DBR_DOUBLE, fIDHall_C_IA_A1, &value); + status = ca_pend_io(10); + status = ca_get(DBR_DOUBLE, fIDHall_C_IA_A1, &value); + status = ca_pend_io(10); + std::cout << "Hall C IA value A1: " << value << std::endl; + break; + case 2: + status = ca_put(DBR_DOUBLE, fIDHall_C_IA_A2, &value); + status = ca_pend_io(10); + status = ca_get(DBR_DOUBLE, fIDHall_C_IA_A2, &value); + status = ca_pend_io(10); + std::cout << "Hall C IA value A2: " << value << std::endl; + break; + case 3: + status = ca_put(DBR_DOUBLE, fIDHall_C_IA_A3, &value); + status = ca_pend_io(10); + status = ca_get(DBR_DOUBLE, fIDHall_C_IA_A3, &value); + status = ca_pend_io(10); + std::cout << "Hall C IA value A3: " << value << std::endl; + break; + } + + }; + + void Set_HallAIA(Int_t mode, Double_t &value){ + Int_t status; + switch(mode){ + case 0: + status = ca_put(DBR_DOUBLE, fIDHall_A_IA_A0, &value); + status = ca_pend_io(10); + status = ca_get(DBR_DOUBLE, fIDHall_A_IA_A0, &value); + status = ca_pend_io(10); + std::cout << "Hall A IA value A0: " << value << std::endl; + break; + case 1: + status = ca_put(DBR_DOUBLE, fIDHall_A_IA_A1, &value); + status = ca_pend_io(10); + status = ca_get(DBR_DOUBLE, fIDHall_A_IA_A1, &value); + status = ca_pend_io(10); + std::cout << "Hall A IA value A1: " << value << std::endl; + break; + case 2: + status = ca_put(DBR_DOUBLE, fIDHall_A_IA_A2, &value); + status = ca_pend_io(10); + status = ca_get(DBR_DOUBLE, fIDHall_A_IA_A2, &value); + status = ca_pend_io(10); + std::cout << "Hall A IA value A2: " << value << std::endl; + break; + case 3: + status = ca_put(DBR_DOUBLE, fIDHall_A_IA_A3, &value); + status = ca_pend_io(10); + status = ca_get(DBR_DOUBLE, fIDHall_A_IA_A3, &value); + status = ca_pend_io(10); + std::cout << "Hall A IA value A3: " << value << std::endl; + break; + } + + }; + + void Set_HelicityMagnet(size_t magnet_index, size_t helicity_index, Double_t &value){ + Int_t status; + if (magnet_index<4 && helicity_index<2){ + status = ca_put(DBR_DOUBLE, fIDHelMag[magnet_index][helicity_index], &value); + status = ca_pend_io(10); + status = ca_get(DBR_DOUBLE, fIDHelMag[magnet_index][helicity_index], &value); + status = ca_pend_io(10); + std::cout << "Helicity Magnet, " << fHelMagNames[magnet_index] + << "," << fHelicityNames[helicity_index] << " setpoint: " + << value << std::endl; + } else { + std::cerr << "Set_HelicityMagnet(): " + << "magnet_index must be less than 4, and is " << magnet_index + << "; helicity_index must be 0 or 1 but is " << helicity_index + << std::endl; + } + }; + + + + void Get_HallCIA(Int_t mode, Double_t &value){ + Int_t status; + switch(mode){ + case 0: + status = ca_get(DBR_DOUBLE, fIDHall_C_IA_A0, &value); + status = ca_pend_io(10); + std::cout << "Hall C IA value A0: " << value << std::endl; + break; + case 1: + status = ca_get(DBR_DOUBLE, fIDHall_C_IA_A1, &value); + status = ca_pend_io(10); + std::cout << "Hall C IA value A1: " << value << std::endl; + break; + case 2: + status = ca_get(DBR_DOUBLE, fIDHall_C_IA_A2, &value); + status = ca_pend_io(10); + std::cout << "Hall C IA value A2: " << value << std::endl; + break; + case 3: + status = ca_get(DBR_DOUBLE, fIDHall_C_IA_A3, &value); + status = ca_pend_io(10); + std::cout << "Hall C IA value A3: " << value << std::endl; + break; + } + + + } + + void Get_HallAIA(Int_t mode, Double_t &value){ + Int_t status; + switch(mode){ + case 0: + status = ca_get(DBR_DOUBLE, fIDHall_A_IA_A0, &value); + status = ca_pend_io(10); + std::cout << "Hall A IA value A0: " << value << std::endl; + break; + case 1: + status = ca_get(DBR_DOUBLE, fIDHall_A_IA_A1, &value); + status = ca_pend_io(10); + std::cout << "Hall A IA value A1: " << value << std::endl; + break; + case 2: + status = ca_get(DBR_DOUBLE, fIDHall_A_IA_A2, &value); + status = ca_pend_io(10); + std::cout << "Hall A IA value A2: " << value << std::endl; + break; + case 3: + status = ca_get(DBR_DOUBLE, fIDHall_A_IA_A3, &value); + status = ca_pend_io(10); + std::cout << "Hall A IA value A3: " << value << std::endl; + break; + } + + + } + + void Get_HelicityMagnet(size_t magnet_index, size_t helicity_index, Double_t &value){ + Int_t status; + if (magnet_index<4 && helicity_index<2){ + status = ca_get(DBR_DOUBLE, fIDHelMag[magnet_index][helicity_index], &value); + status = ca_pend_io(10); + std::cout << "Helicity Magnet, " << fHelMagNames[magnet_index] + << "," << fHelicityNames[helicity_index] << " setpoint: " + << value << std::endl; + } else { + std::cerr << "Get_HelicityMagnet(): " + << "magnet_index must be less than 4, and is " << magnet_index + << "; helicity_index must be 0 or 1 but is " << helicity_index + << std::endl; + } + }; + + //I removed followup read after eahc ca_put command - rakithab (02-29-2012) + void Set_Pockels_Cell_plus(Double_t &value){ + Int_t status; + status = ca_put(DBR_DOUBLE, fIDPockels_Cell_plus, &value); + status = ca_pend_io(10); + status = ca_put(DBR_DOUBLE, fIDPockels_Cell_plus, &value); + status = ca_pend_io(10); + std::cout << "Pockels Cell pos HW-count value: " << value << std::endl; + + }; + void Set_Pockels_Cell_minus(Double_t &value){ + Int_t status; + status = ca_put(DBR_DOUBLE, fIDPockels_Cell_minus, &value); + status = ca_pend_io(10); + status = ca_put(DBR_DOUBLE, fIDPockels_Cell_minus, &value); + status = ca_pend_io(10); + std::cout << "Pockels Cell minus HW-count value: " << value << std::endl; + }; + + void Get_Pockels_Cell_plus(Double_t &value){ + Int_t status; + status = ca_get(DBR_DOUBLE, fIDPockels_Cell_plus, &value); + status = ca_pend_io(10); + std::cout << "Pockels Cell pos HW-count value: " << value << std::endl; + + }; + void Get_Pockels_Cell_minus(Double_t &value){ + Int_t status; + status = ca_get(DBR_DOUBLE, fIDPockels_Cell_minus, &value); + status = ca_pend_io(10); + std::cout << "Pockels Cell minus HW-count value: " << value << std::endl; + }; + + void Set_ChargeAsymmetry(Double_t &value, Double_t &value_error, Double_t &value_width){ + Int_t status; + status = ca_put(DBR_DOUBLE,fChargeAsymmetry , &value); + status = ca_pend_io(10); + //status = ca_get(DBR_DOUBLE,fChargeAsymmetry , &value); + //status = ca_pend_io(10); + status = ca_put(DBR_DOUBLE,fChargeAsymmetryError , &value_error); + status = ca_pend_io(10); + //status = ca_get(DBR_DOUBLE,fChargeAsymmetryError , &value_error); + //status = ca_pend_io(10); + status = ca_put(DBR_DOUBLE,fChargeAsymmetryWidth , &value_width); + status = ca_pend_io(10); + //status = ca_get(DBR_DOUBLE,fChargeAsymmetryWidth , &value_width); + //status = ca_pend_io(10); + + std::cout << "EPICS Charge asymmetry updated " << value <<" +/- "< * +\**********************************************************/ +#ifndef __QwHelicityCorrelatedFeedback__ +#define __QwHelicityCorrelatedFeedback__ + +#include "QwHelicityPattern.h" + +#include "QwEPICSControl.h" +#include "GreenMonster.h" +#include "QwVQWK_Channel.h" +#include "QwScaler_Channel.h" + +#include "QwParameterFile.h" +#include +/// +/// \ingroup QwAnalysis_ADC +/// +/// \ingroup QwAnalysis_BL +class QwHelicityCorrelatedFeedback : public QwHelicityPattern { + /****************************************************************** + * Class: QwHelicityCorrelatedFeedback + * + * + ******************************************************************/ + + public: + QwHelicityCorrelatedFeedback(QwSubsystemArrayParity &event):QwHelicityPattern(event){ + //Currently pattern type based runningasymmetry accumulation works only with pattern size of 4 + fFBRunningAsymmetry.resize(kHelModes,event); + fHelModeGoodPatternCounter.resize(kHelModes,0); + + fEnableBurstSum=kFALSE; + fGoodPatternCounter=0; + fHAGoodPatternCounter=0; + fPFGoodPatternCounter=0; + fPatternCounter=0; + + +/* fFeedbackStatus=kTRUE; */ +/* if (fEPICSCtrl.Get_FeedbackStatus()>0) */ +/* fEPICSCtrl.Set_FeedbackStatus(0); */ +/* if (fFeedbackStatus){ */ +/* fFeedbackStatus=kFALSE; */ +/* fEPICSCtrl.Set_FeedbackStatus(1.0); */ +/* } */ + + CheckFeedbackStatus(); + + fPreviousHelPat=0;//at the beginning of the run this is non existing + fCurrentHelPatMode=-1;//at the beginning of the run this is non existing + + fPITASetpointPOS=0; + fPrevPITASetpointPOS=0; + fPITASetpointNEG=0; + fPrevPITASetpointNEG=0; + fPITA_MIN_Charge_asym=1;//default value is 1ppm + + //initialize setpoints to zero + //HA IA + for(Int_t i=0;i<4;i++){ + fPrevHAIASetpoint[i]=0; + fHAIASetpoint[i]=0; + } + //PITA + fPrevPITASetpointPOS=0; + fPrevPITASetpointNEG=0; + fPITASetpointPOS=0; + fPITASetpointNEG=0; + + + fTargetCharge.InitializeChannel("q_targ","derived"); + fRunningCharge.InitializeChannel("q_targ","derived"); + fAsymBCM7.InitializeChannel("bcm7","derived"); + fAsymBCM8.InitializeChannel("bcm8","derived"); + + fChargeAsymmetry0.InitializeChannel("q_targ","derived");//this is the charge asym at the beginning of the feedback loop + fPreviousChargeAsymmetry.InitializeChannel("q_targ","derived");//charge asymmetry at the previous feedback loop + fCurrentChargeAsymmetry.InitializeChannel("q_targ","derived");//current charge asymmetry + + fIAAsymmetry0.InitializeChannel("q_targ","derived");//this is the charge asymmetry of the IA at the beginning of the feedback loop + fPreviousIAAsymmetry.InitializeChannel("q_targ","derived");//this is the charge asymmetry of the IA at the previous feedback loop + fCurrentIAAsymmetry.InitializeChannel("q_targ","derived");//current charge asymmetry of the IA + + fScalerChargeRunningSum.InitializeChannel("sca_bcm"); + fScalerCharge.InitializeChannel("sca_bcm"); + + fTargetParameter.InitializeChannel("x_targ","derived"); + + fTargetXDiffRunningSum.InitializeChannel("x_targ","derived");//to access the published Target X diff + fTargetXPDiffRunningSum.InitializeChannel("xp_targ","derived");//to access the published Target XP diff + fTargetYDiffRunningSum.InitializeChannel("y_targ","derived");//to access the published Target Y diff + fTargetYPDiffRunningSum.InitializeChannel("yp_targ","derived");//to access the published Target YP diff + + fAsymBCM78DDRunningSum.InitializeChannel("bcm78dd","derived"); + fYieldBCM8RunningSum.InitializeChannel("q_targ","derived"); + fAsymUSLumiSumRunningSum.InitializeChannel("uslumisum","derived"); + + time ( &rawtime ); + timeinfo = localtime ( &rawtime ); + out_file_IA = fopen("/local/scratch/qweak/Feedback_IA_log.txt", "a"); + //out_file_IA = fopen("/dev/shm/Feedback_IA_log.txt", "a"); + + fprintf(out_file_IA,"%22s \n",asctime (timeinfo)); + fprintf(out_file_IA,"Pat num. \t A_q[mode]\t IA Setpoint \t IA Previous Setpoint \n"); + fclose(out_file_IA); + // out_file_PITA = fopen("Feedback_PITA_log.txt", "wt"); + + out_file_PITA = fopen("/local/scratch/qweak/Feedback_PITA_log.txt", "a"); + out_file_HA_IA = fopen("/local/scratch/qweak/Feedback_HA_IA_log.txt", "a"); + fprintf(out_file_PITA,"%22s \n",asctime (timeinfo)); + fprintf(out_file_PITA, + "%10s %22s +- %16s %16s %26s %26s %26s %26s\n", + "Pat num.", "Charge Asym [ppm]", "Asym Error", "Correction", + "New PITA Setpoint[+]", "Old PITA Setpoint[+]", + "New PITA Setpoint[-]", "Old PITA Setpoint[-]"); + fclose(out_file_PITA); + + fprintf(out_file_HA_IA,"%22s \n",asctime (timeinfo)); + fprintf(out_file_HA_IA, + "%10s %22s %16s %16s %26s %23s \n", + "Pat num.", "Charge Asym(ppm)", "Asym Error", "Correction", + "New IA Setpoint", "Old IA Setpoint"); + fclose(out_file_HA_IA); + + + + }; + + + ~QwHelicityCorrelatedFeedback() { + // if (!fFeedbackStatus){ + // fFeedbackStatus=kFALSE; + fEPICSCtrl.Set_FeedbackStatus(0); + // } + + }; + ///inherited from QwHelicityPattern + void CalculateAsymmetry(); + void ClearRunningSum(); + void AccumulateRunningSum(); + void CalculateRunningAverage(); + void ConstructBranchAndVector(TTree *tree, TString &prefix, std::vector &values); + void FillTreeVector(std::vector &values) const; + + /// \brief Define the configuration options + static void DefineOptions(QwOptions &options); + /// \brief Process the configuration options + void ProcessOptions(QwOptions &options); + + /// \brief Load deltaA_q, no.of good patterns to accumulate and other neccessary feedback parameters + void LoadParameterFile(TString filename); + + /// \brief retrieves the target charge asymmetry,asymmetry error ,asymmetry width + void GetTargetChargeStat(); + /// \brief retrieves the target charge asymmetry,asymmetry error ,asymmetry width for given mode + void GetTargetChargeStat(Int_t mode); + /// \brief retrieves the target position angle parameters (X,XP,Y,YP) mean, error and width + void GetTargetPositionStat(); + /// \brief retrieves the Hall A charge asymmetry,asymmetry error ,asymmetry width for given mode + void GetHAChargeStat(Int_t mode); + + + + /// \brief Feed the Hall C IA set point based on the charge asymmetry + void FeedIASetPoint(Int_t mode); + + /// \brief Feed the Hall A IA set point based on the charge asymmetry + void FeedHAIASetPoint(Int_t mode); + + /// \brief Feed the Hall C PITA set point based on the charge asymmetry + void FeedPITASetPoints(); + + + /// \brief Feed the IA set point based on the charge asymmetry + void FeedPCPos(); + /// \brief Feed the IA set point based on the charge asymmetry + void FeedPCNeg(); + + /// \brief Log the last IA feedback information + void LogParameters(Int_t mode); + + /// \brief Log the last PITA feedback information + void LogParameters(); + + /// \brief Log the Pos/angle information + void LogPFParameters(); + + + + /// \brief Log the last Hall A IA feedback information + void LogHAParameters(Int_t mode); + + /// \brief Set Clean=0 or 1 in the GreenMonster + void UpdateGMClean(Int_t state); + + /// \brief Update last feedback setting into scan variables in the GreenMonster + void UpdateGMScanParameters(); + + /// \brief Initiates the PITA feedback if the charge asymmetry passed the quality cut + Bool_t ApplyPITAFeedback(); + /// \brief Initiates the Hall A IA feedback if the Hall A charge asymmetry passed the quality cut + Bool_t ApplyHAIAFeedback(); + + /// \brief Initiates the IA feedback if the Hall C charge asymmetry have passed the quality cut + Bool_t ApplyIAFeedback(Int_t mode); + + /// \brief Initiates the Helicity magnet feedback if the position differences and/or angle differences have passed the quality cut + Bool_t ApplyHMFeedback(); + + + + /// \brief Check to see no.of good patterns accumulated after the last feedback is greater than a set value + Bool_t IsPatternsAccumulated(){ + if (fGoodPatternCounter>=fAccumulatePatternMax) + return kTRUE; + + return kFALSE; + }; + /// \brief Check to see no.of good patterns accumulated after the last position/angle feedback correction + Bool_t IsPFPatternsAccumulated(){ + if (fPFGoodPatternCounter>=fPFAccumulatePatternMax) + return kTRUE; + + return kFALSE; + }; + + /// \brief Check to see no.of good patterns accumulated after the last position/angle feedback correction + Bool_t IsHAPatternsAccumulated(){ + if (fHAGoodPatternCounter>=fHAAccumulatePatternMax) + return kTRUE; + + return kFALSE; + }; + + + /// \brief Check neccessary conditions and apply IA setponts based on the charge asym for all four modes + void ApplyFeedbackCorrections(); + /// \brief Check to see no.of good patterns accumulated after the last feedback is greater than a set value for given mode + Bool_t IsPatternsAccumulated(Int_t mode); + + /// \brief Returns the type of the last helicity pattern based on following pattern history + ///1. +--+ +--+ + ///2. +--+ -++- + ///3. -++- +--+ + ///4. -++- -++- + + Int_t GetLastGoodHelicityPatternType(); + + + void CalculateRunningAverage(Int_t mode); + void ClearRunningSum(Int_t mode); + + private: + /// \brief Returns the charge asymmetry stats when required by feedback caluculations. + Double_t GetChargeAsym(){ + return fChargeAsymmetry; + }; + Double_t GetChargeAsymError(){ + return fChargeAsymmetryError; + }; + Double_t GetChargeAsymWidth(){ + return fChargeAsymmetryWidth; + }; + + //Define separate running sums for differents helicity pattern modes + /// \brief The types of helicity patterns based on following pattern history + ///1. +--+ +--+ + ///2. +--+ -++- + ///3. -++- +--+ + ///4. -++- -++- + + + TString GetHalfWavePlateState(); + UInt_t GetHalfWavePlate2State(); + void CheckFeedbackStatus(); + + static const Int_t kHelPat1=1001;//to compare with current or previous helpat + static const Int_t kHelPat2=110; + static const Int_t kHelModes=4;//kHelModes + + std::vector fFBRunningAsymmetry; + Int_t fCurrentHelPat; + Int_t fPreviousHelPat; + + Int_t fCurrentHelPatMode; + + Double_t fChargeAsymmetry;//current charge asym + Double_t fChargeAsymmetryError;//current charge asym precision + Double_t fChargeAsymmetryWidth;//current charge asym width + + //position/angle parameters + Double_t fTargetXDiff; + Double_t fTargetXDiffError; + Double_t fTargetXDiffWidth; + + Double_t fTargetXPDiff; + Double_t fTargetXPDiffError; + Double_t fTargetXPDiffWidth; + + Double_t fTargetYDiff; + Double_t fTargetYDiffError; + Double_t fTargetYDiffWidth; + + Double_t fTargetYPDiff; + Double_t fTargetYPDiffError; + Double_t fTargetYPDiffWidth; + + Double_t f3C12XDiff; + Double_t f3C12XDiffError; + Double_t f3C12XDiffWidth; + + Double_t f3C12YDiff; + Double_t f3C12YDiffError; + Double_t f3C12YDiffWidth; + + Double_t f3C12YQ; + Double_t f3C12YQError; + Double_t f3C12YQWidth; + + Double_t fAsymBCM78DD; + Double_t fAsymBCM78DDError; + Double_t fAsymBCM78DDWidth; + + Double_t fBCM8Yield; + + + Double_t fAsymBCMUSLumiSum; + Double_t fAsymBCMUSLumiSumError; + Double_t fAsymBCMUSLumiSumWidth; + + Double_t fChargeAsym[kHelModes];//current charge asym + Double_t fChargeAsymError[kHelModes];//current charge asym precision + Double_t fChargeAsymWidth[kHelModes];//current charge asym width + + Double_t fHAChargeAsym[kHelModes];//Hall A current charge asym + Double_t fHAChargeAsymError[kHelModes];//Hall A current charge asym precision + Double_t fHAChargeAsymWidth[kHelModes];//Hall A current charge asym width + + Int_t fAccumulatePatternMax; //Hall C PITA Correction interval in units of patterns + Int_t fHAAccumulatePatternMax; //Hall A IA Correction interval in units of patterns + Int_t fPFAccumulatePatternMax; //HC Position/Angle difference Correction interval in units of patterns + Double_t fChargeAsymPrecision; //Charge asymmetry precision in ppm + + + //Keep a record of optimal values for IA, PC POS and NEG + Double_t fOptimalIA; + Double_t fOptimalPCP; + Double_t fOptimalPCN; + //current IA and PC values + Double_t fCurrentIA; + Double_t fCurrentPCP; + Double_t fCurrentPCN; + + //Hall C IA Slopes for 4 modes and their errors + Double_t fIASlopeA[kHelModes]; + Double_t fDelta_IASlopeA[kHelModes]; + + //Hall A IA Slopes for 4 modes and their errors + Double_t fHAIASlopeA[kHelModes]; + Double_t fHADelta_IASlopeA[kHelModes]; + + //Hall C IA setpoints for 4 modes + Double_t fIASetpoint[kHelModes];//New setpont calculated based on the charge asymmetry + Double_t fPrevIASetpoint[kHelModes];//previous setpoint + + //Hall A IA setpoints for 4 modes + Double_t fHAIASetpoint[kHelModes];//New setpont calculated based on the charge asymmetry + Double_t fPrevHAIASetpoint[kHelModes];//previous setpoint + + Double_t fIASetpointlow;//lower and upper limits for IA dac hardware counts + Double_t fIASetpointup; + + //PITA Slopes for halfwave plate IN & OUT + Double_t fPITASlopeIN;//IHWP1 IN IHWP2 OUT + Double_t fPITASlopeOUT;//IHWP1 OUT IHWP2 OUT + Double_t fPITASlopeOUT_IN;//IHWP1 OUT IHWP2 IN + Double_t fPITASlope; + + //PITA setpoints for pos hel and neg hel + Double_t fPITASetpointPOS; + Double_t fPITASetpointNEG; + Double_t fPITASetpointPOS_t0_IN;//Initial PC positive HW setpoint + Double_t fPITASetpointNEG_t0_IN;//Initial PC negative HW setpoint + Double_t fPITASetpointPOS_t0_OUT;//Initial PC positive HW setpoint + Double_t fPITASetpointNEG_t0_OUT;//Initial PC negative HW setpoint + Bool_t fInitialCorrection;//Is true at the beginning so that t_0 correction is appiled before doing any correction + + + Double_t fPrevPITASetpointPOS;//previous setpoint + Double_t fPrevPITASetpointNEG;//previous setpoint + Double_t fPITASetpointlow;//lower and upper limits for PITA dac hardware counts + Double_t fPITASetpointup; + Double_t fPITA_MIN_Charge_asym;//Minimum charge asymmetry at which feedback correction is applied. see QwHelicityCorrelatedFeedback::FeedPITASetPoints() + + + + /// Create an EPICS control event + QwEPICSControl fEPICSCtrl; + GreenMonster fScanCtrl; + + //Pattern counter + Int_t fGoodPatternCounter;//increment the quartet number - reset after each PITA feedback operation + Int_t fHAGoodPatternCounter;//increment the quartet number - reset after each Hall A IA feedback operation + Int_t fPFGoodPatternCounter;//increment the quartet number - reset after each position/angle feedback operation + + Int_t fPatternCounter;//increment the quartet number - reset after each feedback operation + + + std::vector fHelModeGoodPatternCounter;//count patterns for each mode seperately - reset after each feedback operation + + // Keep four VQWK channels, one each for pattern history 1, 2, 3, and 4 + // Use AddToRunningSum to add the asymmetry for the current pattern + // into the proper pattern history runnign sum. + + QwBeamCharge fTargetCharge; + QwBeamCharge fRunningCharge; + QwBeamCharge fChargeAsymmetry0;//this is the charge asym at the beginning of the feedback loop + QwBeamCharge fPreviousChargeAsymmetry;//charge asymmetry at the previous feedback loop + QwBeamCharge fCurrentChargeAsymmetry;//current charge asymmetry + + QwBeamCharge fIAAsymmetry0;//this is the charge asymmetry of the IA at the beginning of the feedback loop + QwBeamCharge fPreviousIAAsymmetry;//this is the charge asymmetry of the IA at the previous feedback loop + QwBeamCharge fCurrentIAAsymmetry;//current charge asymmetry of the IA + + QwSIS3801D24_Channel fScalerCharge;//for Hall A feedback + QwSIS3801D24_Channel fScalerChargeRunningSum;//for Hall A feedback + + QwBeamCharge fTargetParameter;//to access the published postions/angles + + QwBeamCharge fTargetXDiffRunningSum;//to access the published Target X diff + QwBeamCharge fTargetXPDiffRunningSum;//to access the published Target XP diff + QwBeamCharge fTargetYDiffRunningSum;//to access the published Target Y diff + QwBeamCharge fTargetYPDiffRunningSum;//to access the published Target YP diff + QwBeamCharge f3C12XDiffRunningSum;//to access the published 3c12 X diff + QwBeamCharge f3C12YDiffRunningSum;//to access the published 3c12 Y diff + QwBeamCharge f3C12YQRunningSum;//to access the published 3c12 eff. charge + + QwBeamCharge fAsymBCM7;//to access bcm7 asymmetry + QwBeamCharge fAsymBCM8;//to access bcm8 asymmetry + QwBeamCharge fAsymBCM78DDRunningSum;//to accumulate bcm78 DD asymmetry + QwBeamCharge fYieldBCM8RunningSum;//to access bcm8 Yield + + QwBeamCharge fAsymUSLumiSumRunningSum;//to accumulate US Lumi sum + + + //log file + FILE *out_file_PITA; + FILE *out_file_IA; + FILE *IHWP_State; + FILE *out_file_HA_IA; + FILE *out_file_PC_IN_pos; + FILE *out_file_PC_IN_neg; + FILE *out_file_PC_OUT_pos; + FILE *out_file_PC_OUT_neg; + + Bool_t fHalfWaveIN; + Bool_t fHalfWaveOUT; + Int_t fIHWP; + + Bool_t fHalfWaveRevert; + Bool_t fAutoIHWP; + + TString fHalfWavePlateStatus; + UInt_t fDefaultHalfWavePlateStatus; + UInt_t fPreviousHalfWavePlateStatus; + + Bool_t fPITAFB; + Bool_t fHAIAFB; + Bool_t fIAFB; + Bool_t fFeedbackStatus; + Bool_t fFeedbackDamping; + + + time_t rawtime; + struct tm * timeinfo; + + +}; + +#endif diff --git a/include/README b/include/README new file mode 100644 index 000000000..a9cc0f072 --- /dev/null +++ b/include/README @@ -0,0 +1,10 @@ +The files: + SCAN_cf_commands.h + GreenSock.h + cfSock_types.h + cfSock.h + cfSockCli.h +should be identical to the versions in the "cfSocket/scan" and +"cfSocket/cfSock" libraries used on the remote VME crate. +As of 12apr2010, they are identical. + diff --git a/include/SCAN_cf_commands.h b/include/SCAN_cf_commands.h new file mode 100644 index 000000000..94296865e --- /dev/null +++ b/include/SCAN_cf_commands.h @@ -0,0 +1,17 @@ +/******************************************* +* SCAN_cf_commands.h * +* header for SCAN_interface, * +* which provides codes for * +* SCAN commands through the IP socket * +* * +* KDP Mar 2004 * +********************************************/ + + + +// Define SCAN commands +#define SCAN_GET_DATA 1001 +#define SCAN_SET_DATA 1002 +#define SCAN_GET_STATUS 1003 +#define SCAN_SET_STATUS 1004 + diff --git a/include/cfSock.h b/include/cfSock.h new file mode 100644 index 000000000..727a35fd1 --- /dev/null +++ b/include/cfSock.h @@ -0,0 +1,37 @@ +/* cfSock.h - header used by both client and server of cfSock */ +/* defines */ + +#define SERVER_PORT_NUM 5001 /* server's port number for bind() */ +#define SERVER_WORK_PRIORITY 125 /* priority of server's work task */ +#define SERVER_STACK_SIZE 10000 /* stack size of server's work task */ +#define SERVER_MAX_CONNECTIONS 4 /* max clients connected at a time */ + +#define REQUEST_MSG_SIZE 1024 /* max size of request message */ +#define REPLY_MSG_SIZE 1024 /* max size of reply message */ + +#ifndef SOCK_ERROR +#define SOCK_ERROR (-1) +#endif +#ifndef SOCK_OK +#define SOCK_OK (0) +#endif +#define MAGIC_COOKIE 0xff8b344f /* value = -7654321 */ +#define SOCK_ADDR_SIZE sizeof(struct sockaddr_in)) + + + +/* structure for requests from clients to server */ + +struct request +{ + long magic_cookie; + long command_type; + long command; + long par1; + long par2; + long reply; /* TRUE = request reply from server */ + char message[REQUEST_MSG_SIZE]; /* message buffer */ + long msgLen; // length of message text +}; + + diff --git a/include/cfSockCli.h b/include/cfSockCli.h new file mode 100644 index 000000000..b99bae740 --- /dev/null +++ b/include/cfSockCli.h @@ -0,0 +1,28 @@ +/* cfSockCli.h - header used by cfSock client, replacing the + missing vxWorks.h */ + +#if !defined(FALSE) || (FALSE!=0) +#define FALSE 0 +#endif + +#if !defined(TRUE) || (TRUE!=1) +#define TRUE 1 +#endif + +/* low-level I/O input, output, error fd's */ +#define STD_IN 0 +#define STD_OUT 1 +#define STD_ERR 2 + +#include "GreenSock.h" +#include "cfSock.h" + +/* Name or IP addresses of the various servers */ +char * ServerName_CountingHouse="129.57.206.93"; /* g0 injdaq */ +char * ServerName_LeftSpect="129.57.164.100"; +/* char * ServerName_CountingHouse="129.57.164.13"; */ +/* char * ServerName_LeftSpect="129.57.192.61"; */ +char * ServerName_RightSpect="129.57.192.60"; +char * ServerName_Injector="129.57.206.10"; +char * ServerName_QwTSCrate="129.57.168.100"; + diff --git a/include/cfSock_types.h b/include/cfSock_types.h new file mode 100644 index 000000000..496571f57 --- /dev/null +++ b/include/cfSock_types.h @@ -0,0 +1,14 @@ +/* cfSock_types.h - header used by both server of cfSock and */ +/* GreenMonster defines codes to specify the types of commands. */ +/* Unique codes here will specify unique calls make by cfSockSer, which */ +/* will then be handled by a separate library dedicated to serving the */ +/* config utility calls for that object type. This will make cfSockCli */ +/* and cfSockSer independent of various commands to be issued. */ + + +#define COMMAND_HAPTB 1000 +#define COMMAND_BMW 2000 +#define COMMAND_FDBK 3000 +#define COMMAND_HAPADC 4000 +#define COMMAND_SCAN 5000 + diff --git a/main/QwFeedback.cc b/main/QwFeedback.cc new file mode 100644 index 000000000..fc031e47a --- /dev/null +++ b/main/QwFeedback.cc @@ -0,0 +1,274 @@ + +/*------------------------------------------------------------------------*//*! + + \file QwFeedback.cc + + \brief main(...) function for the qwanalysis feedback executable to set IA and/or PITA slopes + +*//*-------------------------------------------------------------------------*/ + +// System headers +#include +#include +#include +#include + +// Boost headers +#include + +// Qweak headers +#include "QwLog.h" +#include "QwRootFile.h" +#include "QwOptionsParity.h" +#include "QwEventBuffer.h" +#include "QwHistogramHelper.h" +#include "QwSubsystemArrayParity.h" +#include "QwHelicityCorrelatedFeedback.h" +#include "QwEventRing.h" +#include "QwEPICSEvent.h" +//#include "QwEPICSControl.h" +//#include "GreenMonster.h" + +// Qweak subsystems +// (for correct dependency generation) +#include "QwHelicity.h" +#include "QwFakeHelicity.h" +#include "QwBeamLine.h" +#include "QwMainCerenkovDetector.h" +#include "QwScanner.h" +#include "QwLumi.h" +#include "QwBeamMod.h" +#include "QwVQWK_Channel.h" + + + + +Int_t main(Int_t argc, Char_t* argv[]) +{ + /// First, fill the search paths for the parameter files; this sets a + /// static variable within the QwParameterFile class which will be used by + /// all instances. + /// The "scratch" directory should be first. + //QwParameterFile::AppendToSearchPath(getenv_safe_string("QW_PRMINPUT")); + QwParameterFile::AppendToSearchPath(getenv_safe_string("QWANALYSIS") + "/Extensions/QwFeedback/prminput"); + //QwParameterFile::AppendToSearchPath(getenv_safe_string("QWANALYSIS") + "/Parity/prminput"); + //QwParameterFile::AppendToSearchPath(getenv_safe_string("QWANALYSIS") + "/Analysis/prminput"); + + + // Then set the command line arguments and the configuration filename, + // and we define the options that can be used in them (using QwOptions). + gQwOptions.SetCommandLine(argc, argv); + gQwOptions.AddConfigFile("qwfeedback.conf"); + //gQwOptions.ListConfigFiles(); + //gQwOptions.AddConfigFile("qweak_mysql.conf"); + // Define the command line options + DefineOptionsParity(gQwOptions); + QwHelicityCorrelatedFeedback::DefineOptions(gQwOptions); + //Load command line options for the histogram/tree helper class + gQwHists.ProcessOptions(gQwOptions); + /// Setup screen and file logging + gQwLog.ProcessOptions(&gQwOptions); + + /// Load the histogram parameter definitions (from parity_hists.txt) into the global + /// histogram helper: QwHistogramHelper + //gQwHists.LoadHistParamsFromFile("qweak_parity_hists.in"); + //gQwHists.LoadTreeParamsFromFile("Qweak_Tree_Trim_List.in"); + + + /// Create the event buffer + QwEventBuffer eventbuffer; + eventbuffer.ProcessOptions(gQwOptions); + + + + /// Create the database connection + // QwDatabase database(gQwOptions); + + + /// Start loop over all runs + // QwRootFile* rootfile = 0; + + + /* + /// Create an EPICS control event + QwEPICSControl fEPICSCtrl; + GreenMonster fScanCtrl; + // Let's clear the values for the scan data & set "not clean". + fScanCtrl.Open(); + fScanCtrl.SCNSetStatus(SCN_INT_NOT); + fScanCtrl.SCNSetValue(1,0); + fScanCtrl.SCNSetValue(2,0); + fScanCtrl.CheckScan(); + fScanCtrl.PrintScanInfo(); + fScanCtrl.Close(); + + fEPICSCtrl.Print_Qasym_Ctrls(); + */ + + // Loop over all runs + while (eventbuffer.OpenNextStream() == CODA_OK){ + // Begin processing for the first run. + + /// Set the current event number for parameter file lookup + QwParameterFile::SetCurrentRunNumber(eventbuffer.GetRunNumber()); + + + /// Create an EPICS event + QwEPICSEvent epicsevent; + epicsevent.LoadChannelMap("EpicsTable.map"); + + /// Load the detectors from file + QwSubsystemArrayParity detectors(gQwOptions); + detectors.ProcessOptions(gQwOptions); + + /// Create the helicity pattern + QwHelicityCorrelatedFeedback helicitypattern(detectors); + helicitypattern.ProcessOptions(gQwOptions); + helicitypattern.LoadParameterFile("qweak_fb_prm.in"); + /* + helicitypattern.UpdateGMClean(0); + helicitypattern.FeedIASetPoint(0); + helicitypattern.UpdateGMClean(1); + */ + + /// Create the event ring with the subsysten array + QwEventRing eventring(gQwOptions,detectors); + + /// Create the running sum + QwSubsystemArrayParity runningsum(detectors); + + + Int_t failed_events_counts = 0; // count failed total events + + + // Clear the single-event running sum at the beginning of the runlet + runningsum.ClearEventData(); + helicitypattern.ClearRunningSum(); + // Clear the running sum of the burst values at the beginning of the runlet + helicitypattern.ClearBurstSum(); + + + + + // Loop over events in this CODA file + while (eventbuffer.GetNextEvent() == CODA_OK) { + + if (eventbuffer.GetEventNumber()%1000) + std::cout<0){ + QwMessage << "Number of events processed at end of run: " << eventbuffer.GetEventNumber() << std::endl; + break; + } + + // Now, if this is not a physics event, go back and get a new event. + if (!eventbuffer.IsPhysicsEvent()) continue; + + + // Fill the subsystem objects with their respective data for this event. + eventbuffer.FillSubsystemData(detectors); + + // Process the subsystem data + detectors.ProcessEvent(); + + // The event pass the event cut constraints + if (detectors.ApplySingleEventCuts()) { + + // Accumulate the running sum to calculate the event based running average + runningsum.AccumulateRunningSum(detectors); + +// // Fill the histograms +// rootfile->FillHistograms(detectors); + +// // Fill the tree branches +// rootfile->FillTreeBranches(detectors); +// rootfile->FillTree("Mps_Tree"); + + // Add event to the ring + eventring.push(detectors); + + // Check to see ring is ready + if (eventring.IsReady()) { + + // Load the event into the helicity pattern + helicitypattern.LoadEventData(eventring.pop()); + + // Calculate helicity pattern asymmetry + if (helicitypattern.IsCompletePattern()) { + + // Update the blinder if conditions have changed + helicitypattern.UpdateBlinder(detectors); + + // Calculate the asymmetry + helicitypattern.CalculateAsymmetry(); + if (helicitypattern.IsGoodAsymmetry()) { + helicitypattern.ApplyFeedbackCorrections();//apply IA feedback + // Clear the data + helicitypattern.ClearEventData(); + } + + } // helicitypattern.IsCompletePattern() + + } // eventring.IsReady() + + + // Failed single event cuts + } else { + failed_events_counts++; + } + + // Burst mode + if (eventbuffer.IsEndOfBurst()) { + helicitypattern.AccumulateRunningBurstSum(); + helicitypattern.CalculateBurstAverage(); + helicitypattern.ClearBurstSum(); + } + + + + } // end of loop over events + + QwMessage << "Number of events processed at end of run: " + << eventbuffer.GetEventNumber() << std::endl; + + + + // Close event buffer stream + eventbuffer.CloseStream(); + + + + // Print the event cut error summery for each subsystem + detectors.GetEventcutErrorCounters(); + + + // Read from the datebase + // database.SetupOneRun(eventbuffer); + + // Each sussystem has its own Connect() and Disconnect() functions. + // if (database.AllowsWriteAccess()) { + // helicitypattern.FillDB(&database); + // epicsevent.FillDB(&database); + // } + + + QwMessage << "Total events failed " << failed_events_counts << QwLog::endl; + + // Report run summary + eventbuffer.ReportRunSummary(); + eventbuffer.PrintRunTimes(); + + } //end of run loop + + + QwMessage << "I have done everything I can do..." << QwLog::endl; + + return 0; +} diff --git a/prminput/EpicsTable.map b/prminput/EpicsTable.map new file mode 100644 index 000000000..07aca012b --- /dev/null +++ b/prminput/EpicsTable.map @@ -0,0 +1,665 @@ +! The exclamation mark (!) is for comment in this file. +! +! 07-08-2010: added "String" in more variables by identifying them using +! caget epicsVarName (e.g. caget QW_T_miA) in a machine where caget command can be issued. +! +! 06-28-2010: first svn commit of this table (rsubedi) +! Table for epics variables whose values can be stored in a MySQL database. +! This table has three columns. The first column is the name for an epics +! variable. The second column at the moment is just a flag to insert epics data +! in the MySQL database. The third column is related to those epics variables +! that have only string-value (e.g. the epics varaible for the half wave plate +! is IGL1I00DI24_24M and has either IN or OUT value). +! +! +QWTGTPOS slow_controls_data !Vertical position of the target +QWtgt_name slow_controls_data String ! Name of the target position +QWT_miA slow_controls_data !Temp A at manifold inlet K Cernox +QWT_moA slow_controls_data !Temp A at manifold outlet K Cernox +QWT_hxiA slow_controls_data !Temp A at heat exchanger inlet K Cernox Phytron brake +QWT_hxoA slow_controls_data !Temp A at heat exchanger outlet K Cernox Phytron home switch +QWT_piA slow_controls_data !Temp A at pump inlet K Cernox GV open switch +! slow_controls_data !GV closed switch [something to be added here] +QWT_miB slow_controls_data !Temp B at manifold inlet K Cernox Turbo status *5? +QWT_moB slow_controls_data !Temp B at manifold outlet K Cernox CCG *5? +QWT_hxiB slow_controls_data !Temp B at heat exchanger inlet K Cernox Ballast vacuum +QWT_hxoB slow_controls_data !Temp B at heat exchanger outlet K Cernox +QWT_piB slow_controls_data !Temp B at pump inlet K Cernox +QWT_ladderA slow_controls_data !Temp A on dummy tgt ladder K +QWT_USdmA slow_controls_data !Temp A on upstream dummy frame K +QWT_DSdmA slow_controls_data !Temp A on downstream dummy frame K +QWT_phytronA slow_controls_data !Temp A on Phytron motor K +QWT_tableA slow_controls_data !Temp A on Horizontal Motion table K +QWT_ladderB slow_controls_data !Temp B on dummy tgt ladder K +QWT_USdmB slow_controls_data !Temp B on upstream dummy frame K +QWT_DSdmB slow_controls_data !Temp B on downstream dummy frame K +QWT_phytronB slow_controls_data !Temp B on Phytron motor K +QWT_tableB slow_controls_data !Temp B on Horizontal Motion table K +QWT_solidA slow_controls_data !Temp A on solid target frame K +QWT_solidB slow_controls_data !Temp B on solid target frame K +QWT_spareA slow_controls_data !K +QWT_spareB slow_controls_data !K +QWT_pumpA slow_controls_data !Temp A on pump motor house K +QWT_pumpB slow_controls_data !Temp B on pump motor house K +! slow_controls_data !K [something to be added here] +QWT_4kjt slow_controls_data !Coolant Temp at outlet of 4K JT valve K Cernox +QWT_4ko slow_controls_data !Temp of returning 4K coolant K Cernox +QWT_15kjt slow_controls_data !Coolant Temp at outlet of 15K JT valve K Cernox +QWT_15ko slow_controls_data !Temp of returning 15K coolant K Cernox +QW_Pmp_TachSet slow_controls_data !Set value for pump tach Hz +QW_Pmp_VSet slow_controls_data !Set value for pump voltage Volts +QW_Pmp_I1Set slow_controls_data !Set value for pump current phase 1 Amps +QW_Pmp_I2Set slow_controls_data !Set value for pump current phase 2 Amps +QW_Pmp_I3Set slow_controls_data !Set value for pump current phase 3 Amps +QW_Pmp_TachRead slow_controls_data !Read value for pump tach Hz +QW_Pmp_VRead slow_controls_data !Read value for pump voltage Volts +QW_Pmp_I1Read slow_controls_data !Read value for pump current phase 1 Amps +QW_Pmp_I2Read slow_controls_data !Read value for pump current phase 2 Amps +QW_Pmp_I3Read slow_controls_data !Read value for pump current phase 3 Amps +QW_Pmp_Status1 slow_controls_data !Pump controller status bits +QW_Pmp_Status2 slow_controls_data !Pump controller status bits +QW_HPH_ISet slow_controls_data !High Power Heater set current limit Amps +QW_HPH_VSet slow_controls_data !High Power Heater set voltage Volts +QW_HPH_PSet slow_controls_data !High Power Heater set (calculated) power Watts +QW_HPH_IRead slow_controls_data !High Power Heater read current Amps +QW_HPH_VRead slow_controls_data !High Power Heater read voltage Volts +QW_HPH_PRead slow_controls_data !High Power Heater read power Watts +QW_HPH__PID slow_controls_data !Pid mode on or off +QW_HPH_TSet slow_controls_data !HPH set temperature K +QW_HPH_TRead slow_controls_data !HPH read/current temperature K +QW_HPH_Beam_Comp_Switch slow_controls_data !HPH beam compensation switch +QW_pbeam slow_controls_data !Calculated beam power Watts +QW_ibeam slow_controls_data !Beam current uA +QW_HPH_Pmax slow_controls_data !Maximum Heater Power W +QW_HPH_Pman slow_controls_data !smitghg Manual power setting W +QW_HPH_R slow_controls_data !Heater resistance Ohms +QW_HPH_OnOff slow_controls_data !Heater mode +QW_HPH_bmcomp1 slow_controls_data !beam compensation parameter 1 (length) cm +QW_HPH_bmcomp2 slow_controls_data !beam compensation parameter 2 (density) g/cc +QW_HPH_bmcomp3 slow_controls_data !beam compensation parameter 3 (dE/dx) MeV/g/cm^2 +QW_HPH_bmcomp4 slow_controls_data !beam compensation parameter 4 (spare) +QW_HPH_Prop slow_controls_data !PID proportinal gain (typ 600) +QW_HPH_Integ slow_controls_data !PID integral gain (typ 40) +QW_HPH_Deriv slow_controls_data !PID derivative gain (typ 0) +QW_HPH_Scan slow_controls_data !Scan time for PID (typ 1) s +QW_HPH_dmin slow_controls_data !minimum change in power per scan W +QW_HPH_dmax slow_controls_data !maximum change in power per scan W +QW_JT_4Kset slow_controls_data ! +QW_JT_4KRead slow_controls_data ! +QW_JT_4KStep slow_controls_data !4K JT Step size +QW_JT_15KSet slow_controls_data ! +QW_JT_15LRead slow_controls_data ! +QW_JT_15KStep slow_controls_data !15K JT Step size +QW_Phy_ENCSet slow_controls_data !Hor. Motion Phytron set stepper position +QW_Phy_VSet slow_controls_data !Hor. Motion Phytron set Voltage Volts +QW_Phy_ISet slow_controls_data !Hor. Motion Phytron set current Amps +QW_Phy_BrakeSet slow_controls_data !Hor. Motion Phytron set brake value +QW_Phy_ENCRead slow_controls_data !Hor. Motion Phytron read stepper position +QW_Phy_VRead slow_controls_data !Hor. Motion Phytron read Voltage Volts +QW_Phy_IRead slow_controls_data !Hor. Motion Phytron read current Amps +QW_Phy_BrakeRead slow_controls_data !Hor. Motion Phytron read brake value +QW_Phy_Prog slow_controls_data !Hor. Motion Phytron program number +QW_Phy_Out1 slow_controls_data !Hor. Motion Phytron output word 1 +QW_Phy_Out2 slow_controls_data !Hor. Motion Phytron output word 2 +QW_Phy_In1 slow_controls_data !Hor. Motion Phytron input word 1 +QW_Phy_In2 slow_controls_data !Hor. Motion Phytron input word 2 +QW_Phy_Switches slow_controls_data !Hor. Motion Phytron limit switch readback +QW_Phy_ResPos slow_controls_data !Hor. Motion resistive position readout +QW_EC5_ENCSet slow_controls_data !Lifter EC5 set stepper position +QW_EC5_VSet slow_controls_data !Lifter EC5 set Voltage Volts +QW_EC5_ISet slow_controls_data !Lifter EC5 set current Amps +QW_EC5_BrakeSet slow_controls_data !Lifter EC5 set brake value +QW_EC5_ENCRead slow_controls_data !Lifter EC5 read stepper position +QW_EC5_VRead slow_controls_data !Lifter EC5 read Voltage Volts +QW_EC5_IRead slow_controls_data !Lifter EC5 read current Amps +QW_EC5_BrakeRead slow_controls_data !Lifter EC5 read brake value +QW_EC5_Prog slow_controls_data !Lifter EC5 program number +QW_EC5_Out1 slow_controls_data !Lifter EC5 output word 1 +QW_EC5_Out2 slow_controls_data !Lifter EC5 output word 2 +QW_EC5_In1 slow_controls_data !Lifter EC5 input word 1 +QW_EC5_In2 slow_controls_data !Lifter EC5 input word 2 +QW_EC5_Switches slow_controls_data !Lifter EC5 limit switch readback +QW_EC5_AxisStatus slow_controls_data ! +QW_EC5_DriveStatus slow_controls_data ! +QW_EC5_SystemStatus slow_controls_data ! +QW_EC5_ResPos slow_controls_data !Lifter EC5 resistive position readout +QW_PT3 slow_controls_data !Gas panel pressure transducer PT3 psia +QW_PT4 slow_controls_data !Gas panel pressure transducer PT4 psia +QW_PT9 slow_controls_data !Gas panel pressure transducer PT9 psia +QW_PT7 slow_controls_data !Gas panel pressure transducer PT7 psia +QW_PT87 slow_controls_data !Gas panel pressure transducer PT87 psia +QW_PT77 slow_controls_data !Gas panel pressure transducer PT77 psia +QW_PT_Scatt_Chamber slow_controls_data !Scattering Chamber Vacuum psia +QW_PT_Scatt_Chamber_switch slow_controls_data !Scattering Chamber vacuum switch psia +HC_ValveBox_Pos slow_controls_data !Warm return valve position % open +HC_ValveBox_Temp slow_controls_data !Warm return temp K +QW_TgtX0 slow_controls_data !X (Hor) stepper pos for Tgt 0 +QW_TgtY0 slow_controls_data !Y (Ver) stepper pos for Tgt 0 +QW_TgtX1 slow_controls_data ! +QW_TgtY1 slow_controls_data ! +QW_TgtX2 slow_controls_data ! +QW_TgtY2 slow_controls_data ! +QW_TgtX3 slow_controls_data ! +QW_TgtY3 slow_controls_data ! +QW_TgtX4 slow_controls_data ! +QW_TgtY4 slow_controls_data ! +QW_TgtX5 slow_controls_data ! +QW_TgtY5 slow_controls_data ! +QW_TgtX6 slow_controls_data ! +QW_TgtY6 slow_controls_data ! +QW_TgtX7 slow_controls_data ! +QW_TgtY7 slow_controls_data ! +QW_TgtX8 slow_controls_data ! +QW_TgtY8 slow_controls_data ! +QW_TgtX9 slow_controls_data ! +QW_TgtY9 slow_controls_data ! +QW_TgtX10 slow_controls_data ! +QW_TgtY10 slow_controls_data ! +QW_TgtX11 slow_controls_data ! +QW_TgtY11 slow_controls_data ! +QW_TgtX12 slow_controls_data ! +QW_TgtY12 slow_controls_data ! +QW_TgtX13 slow_controls_data ! +QW_TgtY13 slow_controls_data ! +QW_TgtX14 slow_controls_data ! +QW_TgtY14 slow_controls_data ! +QW_TgtX15 slow_controls_data ! +QW_TgtY15 slow_controls_data ! +QW_TgtX16 slow_controls_data ! +QW_TgtY16 slow_controls_data ! +QW_TgtX17 slow_controls_data ! +QW_TgtY17 slow_controls_data ! +QW_TgtX18 slow_controls_data ! +QW_TgtY18 slow_controls_data ! +QW_TgtX19 slow_controls_data ! +QW_TgtY19 slow_controls_data ! +QW_TgtX20 slow_controls_data ! +QW_TgtY20 slow_controls_data ! +QW_TgtX21 slow_controls_data ! +QW_TgtY21 slow_controls_data ! +QW_TgtX22 slow_controls_data ! +QW_TgtY22 slow_controls_data ! +QW_TgtX23 slow_controls_data ! +QW_TgtY23 slow_controls_data ! +QW_TgtX24 slow_controls_data ! +QW_TgtY24 slow_controls_data ! +QW_TgtX25 slow_controls_data ! +QW_TgtY25 slow_controls_data ! +QW_TgtX26 slow_controls_data ! +QW_TgtY26 slow_controls_data ! +QW_Tgt_Raster0 slow_controls_data !Raster requirement for Tgt 0 +QW_Tgt_CurLim0 slow_controls_data !Beam Current Limit for Tgt 0 +QW_Tgt_Raster1 slow_controls_data ! +QW_Tgt_CurLim1 slow_controls_data ! +QW_Tgt_Raster2 slow_controls_data ! +QW_Tgt_CurLim2 slow_controls_data ! +QW_Tgt_Raster3 slow_controls_data ! +QW_Tgt_CurLim3 slow_controls_data ! +QW_Tgt_Raster4 slow_controls_data ! +QW_Tgt_CurLim4 slow_controls_data ! +QW_Tgt_Raster5 slow_controls_data ! +QW_Tgt_CurLim5 slow_controls_data ! +QW_Tgt_Raster6 slow_controls_data ! +QW_Tgt_CurLim6 slow_controls_data ! +QW_Tgt_Raster7 slow_controls_data ! +QW_Tgt_CurLim7 slow_controls_data ! +QW_Tgt_Raster8 slow_controls_data ! +QW_Tgt_CurLim8 slow_controls_data ! +QW_Tgt_Raster9 slow_controls_data ! +QW_Tgt_CurLim9 slow_controls_data ! +QW_Tgt_Raster10 slow_controls_data ! +QW_Tgt_CurLim10 slow_controls_data ! +QW_Tgt_Raster11 slow_controls_data ! +QW_Tgt_CurLim11 slow_controls_data ! +QW_Tgt_Raster12 slow_controls_data ! +QW_Tgt_CurLim12 slow_controls_data ! +QW_Tgt_Raster13 slow_controls_data ! +QW_Tgt_CurLim13 slow_controls_data ! +QW_Tgt_Raster14 slow_controls_data ! +QW_Tgt_CurLim14 slow_controls_data ! +QW_Tgt_Raster15 slow_controls_data ! +QW_Tgt_CurLim15 slow_controls_data ! +QW_Tgt_Raster16 slow_controls_data ! +QW_Tgt_CurLim16 slow_controls_data ! +QW_Tgt_Raster17 slow_controls_data ! +QW_Tgt_CurLim17 slow_controls_data ! +QW_Tgt_Raster18 slow_controls_data ! +QW_Tgt_CurLim18 slow_controls_data ! +QW_Tgt_Raster19 slow_controls_data ! +QW_Tgt_CurLim19 slow_controls_data ! +QW_Tgt_Raster20 slow_controls_data ! +QW_Tgt_CurLim20 slow_controls_data ! +QW_Tgt_Raster21 slow_controls_data ! +QW_Tgt_CurLim21 slow_controls_data ! +QW_Tgt_Raster22 slow_controls_data ! +QW_Tgt_CurLim22 slow_controls_data ! +QW_Tgt_Raster23 slow_controls_data ! +QW_Tgt_CurLim23 slow_controls_data ! +QW_Tgt_Raster24 slow_controls_data ! +QW_Tgt_CurLim24 slow_controls_data ! +QW_Tgt_Raster25 slow_controls_data ! +QW_Tgt_CurLim25 slow_controls_data ! +QW_Tgt_Raster26 slow_controls_data ! +QW_Tgt_CurLim26 slow_controls_data ! +QW_ResEncX slow_controls_data !ADC value of horizontal resistive encoder +QW_ResEncY slow_controls_data !ADC value of vertical resistive encoder +QW_ResEnc_TgtX0 slow_controls_data !Resistive Encoder X (Hor) for Tgt 0 +QW_ResEnc_TgtY0 slow_controls_data !Resistive Encoder Y (Ver) for Tgt 0 +QW_ResEnc_TgtX1 slow_controls_data ! +QW_ResEnc_TgtY1 slow_controls_data ! +QW_ResEnc_TgtX2 slow_controls_data ! +QW_ResEnc_TgtY2 slow_controls_data ! +QW_ResEnc_TgtX3 slow_controls_data ! +QW_ResEnc_TgtY3 slow_controls_data ! +QW_ResEnc_TgtX4 slow_controls_data ! +QW_ResEnc_TgtY4 slow_controls_data ! +QW_ResEnc_TgtX5 slow_controls_data ! +QW_ResEnc_TgtY5 slow_controls_data ! +QW_ResEnc_TgtX6 slow_controls_data ! +QW_ResEnc_TgtY6 slow_controls_data ! +QW_ResEnc_TgtX7 slow_controls_data ! +QW_ResEnc_TgtY7 slow_controls_data ! +QW_ResEnc_TgtX8 slow_controls_data ! +QW_ResEnc_TgtY8 slow_controls_data ! +QW_ResEnc_TgtX9 slow_controls_data ! +QW_ResEnc_TgtY9 slow_controls_data ! +QW_ResEnc_TgtX10 slow_controls_data ! +QW_ResEnc_TgtY10 slow_controls_data ! +QW_ResEnc_TgtX11 slow_controls_data ! +QW_ResEnc_TgtY11 slow_controls_data ! +QW_ResEnc_TgtX12 slow_controls_data ! +QW_ResEnc_TgtY12 slow_controls_data ! +QW_ResEnc_TgtX13 slow_controls_data ! +QW_ResEnc_TgtY13 slow_controls_data ! +QW_ResEnc_TgtX14 slow_controls_data ! +QW_ResEnc_TgtY14 slow_controls_data ! +QW_ResEnc_TgtX15 slow_controls_data ! +QW_ResEnc_TgtY15 slow_controls_data ! +QW_ResEnc_TgtX16 slow_controls_data ! +QW_ResEnc_TgtY16 slow_controls_data ! +QW_ResEnc_TgtX17 slow_controls_data ! +QW_ResEnc_TgtY17 slow_controls_data ! +QW_ResEnc_TgtX18 slow_controls_data ! +QW_ResEnc_TgtY18 slow_controls_data ! +QW_ResEnc_TgtX19 slow_controls_data ! +QW_ResEnc_TgtY19 slow_controls_data ! +QW_ResEnc_TgtX20 slow_controls_data ! +QW_ResEnc_TgtY20 slow_controls_data ! +QW_ResEnc_TgtX21 slow_controls_data ! +QW_ResEnc_TgtY21 slow_controls_data ! +QW_ResEnc_TgtX22 slow_controls_data ! +QW_ResEnc_TgtY22 slow_controls_data ! +QW_ResEnc_TgtX23 slow_controls_data ! +QW_ResEnc_TgtY23 slow_controls_data ! +QW_ResEnc_TgtX24 slow_controls_data ! +QW_ResEnc_TgtY24 slow_controls_data ! +QW_ResEnc_TgtX25 slow_controls_data ! +QW_ResEnc_TgtY25 slow_controls_data ! +QW_ResEnc_TgtX26 slow_controls_data ! +QW_ResEnc_TgtY26 slow_controls_data ! +CFI6731C slow_controls_data !15k Flow g/s +CTD673 slow_controls_data !15K Supply temp at ESR K +CPI673 slow_controls_data !15K Supply pressure at ESR atm +CTD9541 slow_controls_data !20K return temp at ESR K +CPI9541 slow_controls_data !20K return pressure at ESR atm +haCryo_15K_Total_F slow_controls_data !sum of Hall A and Hall C 15K flows g/s +CFI60DLP slow_controls_data !"dirty flowrate" at ESR (warm return) g/s +CTD6614 slow_controls_data !Hall A 15K supply temp K +CFI6711C slow_controls_data !4k Flow g/s +CTD671SC slow_controls_data !4K Supply temp at ESR K +CPI671SC slow_controls_data !4K Supply pressure at ESR atm +CTD672 slow_controls_data !5K return temp at ESR K +CPI672 slow_controls_data !5K return pressure at ESR atm +QWBCM1 slow_controls_data !Beam current in Hall C uA +QWBCM2 slow_controls_data !Beam current in Hall C uA +QWBCM3 slow_controls_data !Beam current in Hall C uA +QWBCM4 slow_controls_data !Beam current in Hall C uA +QWGV_Status slow_controls_data !Status bits of the gate valves +QWHPHIset slow_controls_data !Max Heater Current Set +QWHPHIDACset slow_controls_data !Max Current DAC Set +QWHPHVDACset slow_controls_data !Voltage DAC Set +QWHPHManual slow_controls_data !Manual power setting +QWHPHAuto slow_controls_data !auto power setting +QWHPHheat_pid.ORBV slow_controls_data !Cur Pos +QWHPHheat_pid.OVAL slow_controls_data !Cur Out +QWHPHheat_pid.CVAL slow_controls_data !Cur Inp +QWHPHheat.pidS slow_controls_data !Output +QWHPHheat_pid_VAL slow_controls_data !Set Value +QWHPHmode_bypass.VAL slow_controls_data !Heater mode +QWheat_tot slow_controls_data !Total Power +QWbeam_heat slow_controls_data !Beam Power +! +! The following list of injector/source related Epics variables was provided by Riad Suleiman. +! +VWienAngle slow_controls_data !Vertical Wien Angle +MWF1I04.BDL slow_controls_data !Vertical Wien BDL (G-cm) +IGL1I00OD16_4 polarized_source String !Vertical Wien HV Polarity (on/off) +IGL1I00DAC6 slow_controls_data !Vertical Wien Electrode Voltage +Phi_FG slow_controls_data !Solenoids Angle (Phi_FG) +MFG1I04A.BDL slow_controls_data !First Solenoid BDL (G-cm) +MFG1I04B.BDL slow_controls_data !Second Solenoid BDL (G-cm) +HWienAngle slow_controls_data !Horizontal Wien Angle +MWF0I02.BDL slow_controls_data !Horizontal Wien BDL (G-cm) +IGL1I00OD16_9 slow_controls_data !Horizontal Wien HV Polarity +IGL1I00DAC5 slow_controls_data !Horizontal Wien Electrode Voltage +psub_aa_pos slow_controls_data !Hall A Laser Attenuator (Hall A Laser Attenuator Setting) -- +IGL1I00OD16_16 polarized_source String !IHWP: Insertible Beam Half-wave plate Set(off=out) +IGL1I00DI24_24M polarized_source String !Beam Half-wave plate Read(off=out) () -- +psub_pl_pos slow_controls_data !Rotating waveplate (Rotatable Half Wave Plate Setting) -- +IGLdac3:ao_7 slow_controls_data !IA Cell Setpoint Hall A +IGL1I00AI20 slow_controls_data !IA Cell Setpoint Hall B +IGLdac3:ao_4 slow_controls_data !IA Cell Setpoint Hall C +IGLdac3:ao_5 slow_controls_data !PZT X Setpoint Hall A +IGLdac3:ao_6 slow_controls_data !PZT Y Setpoint Hall A +IGLdac3:ao_0 slow_controls_data !PZT X Setpoint Common (X PZT Voltage ) -- +IGLdac3:ao_1 slow_controls_data !PZT Y Setpoint Common (Y PZT Voltage V) -- +IGLdac2:G2Ch3Pos slow_controls_data !Gun2: PC (PITA) POS +IGLdac2:G2Ch4Neg slow_controls_data !Gun2: PC (PITA) NEG +IGL1I00OD16_8 polarized_source String !Pockels Cell ON/OFF +cdipc_xpos slow_controls_data !Pockels Cell X Stage +cdipc_ypos slow_controls_data !Pockels Cell Y Stage +psub_cx_pos slow_controls_data !Wafer X Stage (X laser position on cathode) -- +psub_cy_pos slow_controls_data !Wafer Y Stage (Y laser position on cathode) -- +SMRPOSA slow_controls_data !Hall A Slit Position (Hall A Chopper Slit Readback) -- +HELCLOCKs slow_controls_data !Helicity Clock Set (result: Free Clock) +HELDELAYs polarized_source String !Helicity Delay Set (result: 8 windows) +HELPATTERNs polarized_source String !Helicity Pattern Set (has a value such as Quartet) +HELCLOCKd slow_controls_data !Helicity Clock Read (result: Free Clock) +HELTSETTLEd slow_controls_data !Helicity Settle Read +HELTSTABLEd slow_controls_data !Helicity Stable Read +HELDELAYd polarized_source String !Helicity Delay Read (result: 8 windows) +HELPATTERNd polarized_source String !Helicity Pattern Read (has a value such as Quartet) +HELFREQ slow_controls_data !Helicity Frequency +! +! The following list is already in the MySql database +! +HC:qint_period slow_controls_data !Charge asymmetry sampling period +laser_a_wavelength slow_controls_data !Hall A laser wavelength nm +HC:0L03_WSUM slow_controls_data !0L03 Charge Asymmetry 4 Wire Sum +! +! psub_cx_pos slow_controls_data !laser position on cathode [already in Riad's list above] +! +SMRPOSB slow_controls_data !Hall B Chopper Slit Readback +R00PGSET slow_controls_data !Prebuncher Setting +IGLdac2:scale_6.A slow_controls_data !Hall B TACO Voltage V +IGL1I00AI27 slow_controls_data !Hall A IA Voltage V +laser_c_wavelength slow_controls_data !Hall C laser wavelength nm +HC:1I04_XDIF slow_controls_data !1I04 X Difference +IGL1I00AI17 slow_controls_data !Dummy Helicity Pockels Cell Voltage V +HC:0L02_DWSUM slow_controls_data !Error on 0L02 Charge Asymmetry 4 Wire Sum +HC:DX_DIF slow_controls_data !dX on X Position Difference to MCC +SMRPOSC slow_controls_data !Hall C Chopper Slit Readback +R00PGMEST slow_controls_data !Prebuncher Setting dB +HC:1I04_DXDIF slow_controls_data !Error on 1I04 X Difference +HC:Q_ASY slow_controls_data !Charge Asymmetry to MCC ppm +HC:1I04_DWSUM slow_controls_data !Error on 1I04 Charge Asymmetry 4 Wire Sum +WienAngle slow_controls_data !Wien Filter Angle Setting degrees +itov2out slow_controls_data !A2 Slit Setting +HC:QPD_XDIF slow_controls_data !QPD X Difference +EHCFR_LIPRC polarized_source !String !Master Focus Location: 1=G0, 0=Pivot +HC:0L02_WSUM slow_controls_data !0L02 Charge Asymmetry 4 Wire Sum +HC:1I04_DYDIF slow_controls_data !Error on 1I04 Y Difference +hel_mag_status.D slow_controls_data !Integrated helicity bit difference +IBCxxxxCRCUR4 slow_controls_data !Hall C MPS BCM Current uA +scaler_calc1 slow_controls_data !Hall B Beam Current (Faraday Cup) nA +! +!psub_cy_pos slow_controls_data !Y laser position on cathode [already in Riad's list above] +! +itov5out slow_controls_data !A3 Slit Setting +IGL1I00DAC3 slow_controls_data !Hall B Seed Level +osc_jitter slow_controls_data !Hall A Laser Phase Jitter +HC:QPD_DWSUM slow_controls_data !Error on QPD Charge Asymmetry 4 Wire Sum +IGL1I00AI24 slow_controls_data !IA Voltage V +HC:P_ONOFF polarized_source String !enable/disable position feedback (ON/OFF) +HC:QPD_WSUM slow_controls_data !QPD Charge Asymmetry 4 Wire Sum +itov7out slow_controls_data !A4 Slit Setting +HC:0L03_DXDIF slow_controls_data !Error on 0L03 X Difference +hallb_transmission slow_controls_data !Hall B Independent Transmission % +! +!SMRPOSA slow_controls_data !Hall A Chopper Slit Readback [already in Riad's list above] +! +HC:0L03_YDIF slow_controls_data !0L03 Y Difference +HC:IBCM_DQASY slow_controls_data !Error on Injector BCM Charge Asymmetry +HC:1I06_DWSUM slow_controls_data !Error on 1I06 Charge Asymmetry 4 Wire Sum +HC:X_DIF slow_controls_data !X Position Difference to MCC +HC:0I05_YDIF slow_controls_data !0I05 Y Difference +IGL1I00DAC2 slow_controls_data !Hall B Control Level +HC:1I06_DXDIF slow_controls_data !Error on 1I06 X Difference +HC:0I05_DWSUM slow_controls_data !Error on 0I05 Charge Asymmetry 4 Wire Sum +HC:QPD_DYDIF slow_controls_data !Error on QPD Y Difference +HC:1I06_WSUM slow_controls_data !1I06 Charge Asymmetry 4 Wire Sum +psub_ab_pos slow_controls_data !Hall B Laser Attenuator Setting +HC:0I05_DYDIF slow_controls_data !Error on 0I05 Y Difference +! +!psub_pl_pos slow_controls_data !Rotatable Half Wave Plate Setting [already in Riad's list above] +! +hallc_photocurrent slow_controls_data !Hall C photocurrent uA +HC:0L02_DYDIF slow_controls_data !Error on 0L02 Y Difference +hac_bcm_average slow_controls_data !Hall A (?) BCM Current uA +ISL0I04DT polarized_source !Master Slit Setting (string value: IN) +IPM2C24A.IENG slow_controls_data !Hall B Beam Current (2C24A) +IBCxxxxCRCUR2 slow_controls_data !Hall A MPS BCM Current uA +HC:0I05_XDIF slow_controls_data !0I05 X Difference +HC:1I02_DYDIF slow_controls_data !Error on 1I02 Y Difference +HC:1I02_DXDIF slow_controls_data !Error on 1I02 X Difference +IGL1I00AI25 slow_controls_data !Hall A X PZT Voltage V +HC:QPD_YDIF slow_controls_data !QPD Y Difference +HC:DY_DIF slow_controls_data !dY on Y Position Difference to MCC +HC:QPD_DXDIF slow_controls_data !Error on QPD X Difference +IGL1I00AI8 slow_controls_data !Gun 2 PITA Voltage Negative V +itov1out slow_controls_data !A1 Slit Setting +qe_halla slow_controls_data !Hall A Quantum Efficiency % +HC:1I02_DWSUM slow_controls_data !Error on 1I02 Charge Asymmetry 4 Wire Sum +hallb_photocurrent slow_controls_data !Hall B photocurrent uA +HC:0L02_XDIF slow_controls_data !0L02 X Difference +HC:1I02_WSUM slow_controls_data !1I02 Charge Asymmetry 4 Wire Sum +hallc_transmission slow_controls_data !Hall C Independent Transmission % +HC:IBCM_QASY slow_controls_data !Injector BCM Charge Asymmetry +! +IGL1I00AI23 slow_controls_data !G0 Y PZT Voltage V [still exists] +IGL1I00AI22 slow_controls_data !G0 X PZT Voltage V [still exists] +! +!IGLdac3:ao_1 slow_controls_data !Y PZT Voltage V [already in Riad's list above] +!IGLdac3:ao_0 slow_controls_data !X PZT Voltage [already in Riad's list above] +! +HC:Y_DIF slow_controls_data !Y Position Difference to MCC +qe_hallb slow_controls_data !Hall B Quantum Efficiency % +IGL1I00AI26 slow_controls_data !Hall A Y PZT Voltage V +laser_b_wavelength slow_controls_data !Hall B laser wavelength nm +! +!psub_aa_pos slow_controls_data !Hall A Laser Attenuator Setting [already in Riad's list above] +! +HC:1I06_YDIF slow_controls_data !1I06 Y Difference +HC:1I02_YDIF slow_controls_data !1I02 Y Difference +HC:DQ_ASY slow_controls_data !Charge Asymmetry Uncertainty ppm +HC:0L02_YDIF slow_controls_data !0L02 Y Difference +IBCxxxxCLOSS slow_controls_data !Machine Energy Loss +psub_ac_pos slow_controls_data !Hall C Laser Attenuator Setting +IGL1I00AI7 slow_controls_data !Gun 2 PITA Voltage Positive V +HC:1I04_YDIF slow_controls_data !1I04 Y Difference +qe_hallc slow_controls_data !Hall C Quantum Efficiency % +HC:0L03_DYDIF slow_controls_data !Error on 0L03 Y Difference +HC:0L03_DWSUM slow_controls_data !Error on 0L03 Charge Asymmetry 4 Wire Sum +HC:0L03_XDIF slow_controls_data !0L03 X Difference +halla_photocurrent slow_controls_data !Hall A photocurrent uA +HC:1I06_XDIF slow_controls_data !1I06 X Difference +IGL1I00PStrans slow_controls_data !Injector transmission +HC:pint_period slow_controls_data !Position difference sampling period +HC:0L02_DXDIF slow_controls_data !Error on 0L02 X Difference +osc2_jitter slow_controls_data !Hall C Laser Phase Jitter +halla_transmission slow_controls_data !Hall A Independent Transmission % +HC:1I04_WSUM slow_controls_data !1I04 Charge Asymmetry 4 Wire Sum +HC:1I06_DYDIF slow_controls_data !Error on 1I06 Y Difference +HC:1I02_XDIF slow_controls_data !1I02 X Difference +HC:0I05_WSUM slow_controls_data !0I05 Charge Asymmetry 4 Wire Sum +HC:bcm_threshold slow_controls_data !BCM threshold cut for charge feedback uA +ibcm1 slow_controls_data !Hall C Beam Current (monitor 1): careful, this is also in target epics +ibcm2 slow_controls_data !Hall C Beam Current (monitor 2): careful, this is also in target epics +HC:bcm_select polarized_source !String ! (result: BCM2) +! +!IGL1I00DI24_24M slow_controls_data ![already in Riad's list above] +! +EHCFR_LIXWidth slow_controls_data ! +EHCFR_LIYWidth slow_controls_data ! +EHCFR_ENERGY slow_controls_data ! +! +!IGL1I00DI24_24M slow_controls_data ![This was repeated, see by 4 variables above] +! +HC:0I05_DXIF slow_controls_data !Error on 0I05 X Difference +! +!Epics variables from Hall C beamline BPM and BCM for their auto-gains +! +IPM3C17.XIFG slow_controls_data !stripline bpm x position auto-gain +IPM3C17.YIFG slow_controls_data ! stripline bpm y position auto-gain +IBC3C17.XIFG slow_controls_data !bcm x position auto-gain +IBC3C17.YIFG slow_controls_data !bcm y position auto-gain +IPM3C18.XIFG slow_controls_data ! +IPM3C18.YIFG slow_controls_data ! +IPM3C19.XIFG slow_controls_data ! +IPM3C19.YIFG slow_controls_data ! +IPM3P01.XIFG slow_controls_data ! +IPM3P01.YIFG slow_controls_data ! +IPM3P02A.XIFG slow_controls_data ! +IPM3P02A.YIFG slow_controls_data ! +IPM3P03A.XIFG slow_controls_data ! +IPM3P03A.YIFG slow_controls_data ! +IPM3P02B.XIFG slow_controls_data ! +IPM3P02B.YIFG slow_controls_data ! +IPM3C20.XIFG slow_controls_data ! +IPM3C20.YIFG slow_controls_data ! +IPM3C21.XIFG slow_controls_data ! +IPM3C21.YIFG slow_controls_data ! +IPM3H02.XIFG slow_controls_data ! +IPM3H02.YIFG slow_controls_data ! +IPM3H04.XIFG slow_controls_data ! +IPM3H04.YIFG slow_controls_data ! +! +IPM3H04H slow_controls_data !cavity bpm horizontal +IPM3H04V slow_controls_data !cavity bpm vertical +IBC3H04 slow_controls_data !cavity bcm +IBC3H05 slow_controls_data !hall C bcm (i.e., ibcm1) +IBC3H05A slow_controls_data !hall C bcm (i.e., ibcm2) +! +IPM3H07A.XIFG slow_controls_data ! +IPM3H07A.YIFG slow_controls_data ! +IPM3H07B.XIFG slow_controls_data ! +IPM3H07B.YIFG slow_controls_data ! +IPM3H07C.XIFG slow_controls_data ! +IPM3H07C.YIFG slow_controls_data ! +IPM3H09.XIFG slow_controls_data ! +IPM3H09.YIFG slow_controls_data ! +! +IPM3H09AH slow_controls_data ! +IPM3H09AV slow_controls_data ! +IBC3H09 slow_controls_data ! +! +IPM3H09B.XIFG slow_controls_data ! +IPM3H09B.YIFG slow_controls_data ! +! +!Epics variables from Hall C beamline BPM and BCM for their X and Y positions +! +IPM3C17.XPOS slow_controls_data !stripline bpm x position +IPM3C17.YPOS slow_controls_data !stripline bpm y position +IBC3C17.XPOS slow_controls_data !bcm x position +IBC3C17.YPOS slow_controls_data !bcm y position +IPM3C18.XPOS slow_controls_data ! +IPM3C18.YPOS slow_controls_data ! +IPM3C19.XPOS slow_controls_data ! +IPM3C19.YPOS slow_controls_data ! +IPM3P01.XPOS slow_controls_data ! +IPM3P01.YPOS slow_controls_data ! +IPM3P02A.XPOS slow_controls_data ! +IPM3P02A.YPOS slow_controls_data ! +IPM3P03A.XPOS slow_controls_data ! +IPM3P03A.YPOS slow_controls_data ! +IPM3P02B.XPOS slow_controls_data ! +IPM3P02B.YPOS slow_controls_data ! +IPM3C20.XPOS slow_controls_data ! +IPM3C20.YPOS slow_controls_data ! +IPM3C21.XPOS slow_controls_data ! +IPM3C21.YPOS slow_controls_data ! +IPM3H02.XPOS slow_controls_data ! +IPM3H02.YPOS slow_controls_data ! +IPM3H04.XPOS slow_controls_data ! +IPM3H04.YPOS slow_controls_data ! +! +IPM3H07A.XPOS slow_controls_data ! +IPM3H07A.YPOS slow_controls_data ! +IPM3H07B.XPOS slow_controls_data ! +IPM3H07B.YPOS slow_controls_data ! +IPM3H07C.XPOS slow_controls_data ! +IPM3H07C.YPOS slow_controls_data ! +IPM3H09.XPOS slow_controls_data ! +IPM3H09.YPOS slow_controls_data ! +! +IPM3H09B.XPOS slow_controls_data ! +IPM3H09B.YPOS slow_controls_data ! +! +!Epics variables from Hall C beamline BPM and BCM for their X and Y position offsets +! +IPM3C17.XSOF slow_controls_data !stripline bpm x position offset +IPM3C17.YSOF slow_controls_data ! stripline bpm y position offset +IBC3C17.XSOF slow_controls_data !bcm x position offset +IBC3C17.YSOF slow_controls_data !bcm y position offset +IPM3C18.XSOF slow_controls_data ! +IPM3C18.YSOF slow_controls_data ! +IPM3C19.XSOF slow_controls_data ! +IPM3C19.YSOF slow_controls_data ! +IPM3P01.XSOF slow_controls_data ! +IPM3P01.YSOF slow_controls_data ! +IPM3P02A.XSOF slow_controls_data ! +IPM3P02A.YSOF slow_controls_data ! +IPM3P03A.XSOF slow_controls_data ! +IPM3P03A.YSOF slow_controls_data ! +IPM3P02B.XSOF slow_controls_data ! +IPM3P02B.YSOF slow_controls_data ! +IPM3C20.XSOF slow_controls_data ! +IPM3C20.YSOF slow_controls_data ! +IPM3C21.XSOF slow_controls_data ! +IPM3C21.YSOF slow_controls_data ! +IPM3H02.XSOF slow_controls_data ! +IPM3H02.YSOF slow_controls_data ! +IPM3H04.XSOF slow_controls_data ! +IPM3H04.YSOF slow_controls_data ! +! +IPM3H07A.XSOF slow_controls_data ! +IPM3H07A.YSOF slow_controls_data ! +IPM3H07B.XSOF slow_controls_data ! +IPM3H07B.YSOF slow_controls_data ! +IPM3H07C.XSOF slow_controls_data ! +IPM3H07C.YSOF slow_controls_data ! +IPM3H09.XSOF slow_controls_data ! +IPM3H09.YSOF slow_controls_data ! +! +IPM3H09B.XSOF slow_controls_data ! +IPM3H09B.YSOF slow_controls_data ! +! +! Miscellaneous epics variables: +HC:Q_ONOFF polarized_source !String !Charge feedback (ON/OFF) +! Epics variables for Compton missing. +! +! Fast Feedback (copied from G0 epics.dictionary) +! +FB_A:FB_On polarized_source !String !fast feedback Hall A status (result: OFF) +FB_C:FB_On polarized_source !String !fast feedback Hall C status (result: OFF) +FB_C:status:mbbi2.B7 slow_controls_data !1 or 0 !fast feedback Hall C status flag +FB_C:use_RF polarized_source !String !fast energy lock Hall C status (result: RF OFF) +FB_A:use_RF polarized_source !String !fast energy lock Hall A status (result: RF ON) +FB_A:status:mbbi2.B7 slow_controls_data !1 or 0 !fast feedback Hall A status flag +! +! Hall C Moller information (copied from G0 epics.dictionary) +! +OXSS_RDF slow_controls_data !Leads Field +OXSS_MGFD slow_controls_data !Persistent Field (T) +TARGPOS slow_controls_data !Target position X +COLPOS1 slow_controls_data !Collimator Block 1 +COLPOS2 slow_controls_data !Collimator Block 2 +COLPOS3 slow_controls_data !Collimator Block 3 +COLPOS4 slow_controls_data !Collimator Block 4 +COLPOS5 slow_controls_data !Collimator Block 5 +COLPOS6 slow_controls_data !Collimator Block 6 +COLPOS7 slow_controls_data !Collimator Block 7 +!MHCMQ2SETI slow_controls_data !Supply Set (A) +!MHCMQ2IRBCK slow_controls_data !Current ReadBack (A) +!MQE3M02.S slow_controls_data !Current Set (A) +!The "result" indicates the result obtained from caget command. diff --git a/prminput/detectors.map b/prminput/detectors.map new file mode 100644 index 000000000..dfbe87b21 --- /dev/null +++ b/prminput/detectors.map @@ -0,0 +1,18 @@ +# This is an example of a detector definition file. + +[QwBeamLine] + name = HallCBeamLine + map = qweak_hallc_beamline.map + geom = qweak_beamline_geometry.map + param = qweak_hallc_pedestal.map + eventcut = qweak_beamline_eventcuts.in + +[QwHelicity] + name = Helicity info + map = qweak_helicity.map + +[QwLumi] + name = Lumi Detector + map = qweak_lumi.map + param = qweak_lumi_pedestal.map + eventcut = qweak_lumi_eventcuts.in diff --git a/prminput/parity_hist.in b/prminput/parity_hist.in new file mode 100644 index 000000000..6038a569c --- /dev/null +++ b/prminput/parity_hist.in @@ -0,0 +1,615 @@ +#Beamline +# This is the histogram parameter input file for the QwHistogramHelper class +# "." is the wildcard here!!!! Please use "." only (no "*") since we +# require the exact same length for two strings to match!!!! +# The values after the axis titles, if exist, are the min and max of +# the histogram filled weight. + + +#name_title type x_nbins x_min x_max y_nbins y_min y_max xtitle ytitle +############################################################################################## +### Single event histograms +delta_event_number TH1F 12 -1.5 10.5 EventNumber(actual-previous) Events +delta_pattern_number TH1F 12 -1.5 10.5 PatternNumber(actual-previous) Counts +pattern_phase TH1F 11 -1.5 9.5 PatternPhase Counts +pat_phase TH1F 11 -1.5 9.5 PatternPhase Counts +hel_pat_phase TH1F 11 -1.5 9.5 PatternPhase Counts +helicity TH1F 5 -2.5 2.5 Helicity Counts +pattern_polarity TH1F 5 -2.5 2.5 Pattern_polarity Counts +cleandata TH1F 5 -2.5 2.5 Cleandata Counts +scandata1 TH1F 101 -0.5 100.5 Scandata1 Counts +scandata2 TH1F 101 -0.5 100.5 Scandata2 Counts +scalerheader TH1F 5 -2.5 2.5 ScalerHeader Counts +scalercounter TH1F 189 -2.5 186.5 ScalerCounter Counts +mps_counter TH1F 189 -2.5 186.5 ScalerCounter Counts +hel_mps_counter TH1F 189 -2.5 186.5 ScalerCounter Counts +pat_counter TH1F 189 -2.5 186.5 ScalerCounter Counts +hel_pat_counter TH1F 189 -2.5 186.5 ScalerCounter Counts +userbit TH1F 5 -2.5 2.5 Userbit Counts +input_register TH1F 12 -1.5 10.5 inputregister Events +output_register TH1F 12 -1.5 10.5 outputregister Events +hel_cleandata TH1F 5 -2.5 2.5 Cleandata Counts +hel_scandata1 TH1F 101 -0.5 100.5 Scandata1 Counts +hel_scandata2 TH1F 101 -0.5 100.5 Scandata2 Counts +hel_scalerheader TH1F 5 -2.5 2.5 ScalerHeader Counts +hel_scalercounter TH1F 189 -2.5 186.5 ScalerCounter Counts +hel_userbit TH1F 5 -2.5 2.5 Userbit Counts +hel_input_register TH1F 12 -1.5 10.5 inputregister Events +hel_output_register TH1F 12 -1.5 10.5 inputregister Events +empty._block._raw TH1F 1000 -5.0e9 5.0e9 Counts Events +empty._block. TH1F 1000 -5.0e9 5.0e9 CalibratedCounts Events +empty._.w_raw TH1F 1000 -5.0e9 5.0e9 Counts Events +emty._.w TH1F 1000 -5.0e9 5.0e9 CalibratedCounts Events +empty._sw-hw_raw TH1F 1000 -5.0e2 5.0e2 Counts Events +phasemonitor_block._raw TH1F 1000 -5.0e9 5.0e9 Counts Events +phasemonitor_block. TH1F 1000 -5.0e9 5.0e9 CalibratedCounts Events +phasemonitor_.w_raw TH1F 1000 -5.0e9 5.0e9 Counts Events +phasemonitor_.w TH1F 1000 -5.0e9 5.0e9 CalibratedCounts Events +phasemonitor_sw-hw_raw TH1F 1000 -5.0e2 5.0e2 Counts Events +phasemonitor_SampleSize TH1F 1000 -0.5 2.0e4 Sample Size +qwk_..... TH1F 1000 -5.0e9 5.0e9 Counts Events +qwk_....._block._raw TH1F 1000 -5.0e9 5.0e9 Counts Events +qwk_....._block. TH1F 1000 -5.0e9 5.0e9 CalibratedCounts Events +qwk_....._.w_raw TH1F 1000 -5.0e9 5.0e9 Counts Events +qwk_....._.w TH1F 1000 -5.0e9 5.0e9 CalibratedCounts Events +qwk_....._sw-hw_raw TH1F 1000 -5.0e2 5.0e2 Counts Events +qwk_...Rel._block._raw TH1F 1000 -5.0e1 5.0e1 mm Events +qwk_...Rel._block. TH1F 2000 -5.0e1 5.0e1 mm Events +qwk_...Rel._.w_raw TH1F 1000 -5.0e1 5.0e1 mm Events +qwk_...Rel._.w TH1F 2000 -5.0e1 5.0e1 mm Events +qwk_......_block._raw TH1F 1000 -5.0e9 5.0e9 Counts Events +qwk_......_block. TH1F 1000 -5.0e9 5.0e9 CalibratedCounts Events +qwk_......_.w_raw TH1F 1000 -5.0e9 5.0e9 Counts Events +qwk_......_.w TH1F 1000 -2.0e6 6.0e6 CalibratedCounts Events +qwk_......_sw-hw_raw TH1F 1000 -5.0e2 5.0e2 Counts Events +qwk_....Rel._block._raw TH1F 1000 -5.0e1 5.0e1 mm Events +qwk_....Rel._block. TH1F 2000 -5.0e1 5.0e1 mm Events +qwk_....Rel._.w_raw TH1F 1000 -5.0e1 5.0e1 mm Events +qwk_....Rel._.w TH1F 2000 -5.0e1 5.0e1 mm Events +qwk_......._block._raw TH1F 1000 -5.0e9 5.0e9 Counts Events +qwk_......._block. TH1F 1000 -5.0e9 5.0e9 CalibratedCounts Events +qwk_......._.w_raw TH1F 1000 -5.0e9 5.0e9 Counts Events +qwk_......._.w TH1F 1000 -2.0e6 2.0e6 CalibratedCounts Events +qwk_......._sw-hw_raw TH1F 1000 -5.0e2 5.0e2 Counts Events +qwk_.....Rel._block._raw TH1F 1000 -5.0e1 5.0e1 mm Events +qwk_.....Rel._block. TH1F 2000 -5.0e1 5.0e1 mm Events +qwk_.....Rel._.w_raw TH1F 1000 -5.0e1 5.0e1 mm Events +qwk_.....Rel._.w TH1F 2000 -5.0e1 5.0e1 mm Events +qwk_........_block._raw TH1F 1000 -5.0e9 5.0e9 Counts Events +qwk_........_block. TH1F 1000 -5.0e9 5.0e9 CalibratedCounts Events +qwk_........_.w_raw TH1F 1000 -5.0e9 5.0e9 Counts Events +qwk_........_.w TH1F 1000 -5.0e9 5.0e9 CalibratedCounts Events +qwk_........._block._raw TH1F 1000 -5.0e9 5.0e9 Counts Events +qwk_........._block. TH1F 1000 -5.0e9 5.0e9 CalibratedCounts Events +qwk_........._.w_raw TH1F 1000 -5.0e9 5.0e9 Counts Events +qwk_........._.w TH1F 1000 -5.0e9 5.0e9 CalibratedCounts Events +qwk_.........._block. TH1F 1000 -5.0e9 5.0e9 CalibratedCounts Events +qwk_.........._.w TH1F 1000 -5.0e9 5.0e9 CalibratedCounts Events +qwk_............_block. TH1F 1000 -5.0e9 5.0e9 CalibratedCounts Events +qwk_............_.w TH1F 1000 -5.0e9 5.0e9 CalibratedCounts Events +qwk_......_......_block. TH1F 1000 -5.0e9 5.0e9 CalibratedCounts Events +qwk_......_......_hw TH1F 1000 -5.0e9 5.0e9 CalibratedCounts Events +qwk_......._......_block. TH1F 1000 -5.0e9 5.0e9 CalibratedCounts Events +qwk_......._......_hw TH1F 1000 -5.0e9 5.0e9 CalibratedCounts Events +qwk_......_......_block. TH1F 1000 -5.0e9 5.0e9 CalibratedCounts Events +qwk_......_......_.w TH1F 1000 -5.0e9 5.0e9 CalibratedCounts Events +qwk_......._......_block. TH1F 1000 -5.0e9 5.0e9 CalibratedCounts Events +qwk_......._......_.w TH1F 1000 -5.0e9 5.0e9 CalibratedCounts Events + +qwk_targetWSum_block. TH1F 1000 -5.0e9 5.0e9 CalibratedCounts Events +qwk_targetWSum_hw TH1F 1000 -5.0e9 5.0e9 CalibratedCounts Events +qwk_targetXAngle_block. TH1F 1000 -5.0e9 5.0e9 CalibratedCounts Events +qwk_targetXAngle_hw TH1F 1000 -5.0e9 5.0e9 CalibratedCounts Events +qwk_targetYAngle_block TH1F 1000 -5.0e9 5.0e9 CalibratedCounts Events +qwk_targetYAngle_hw TH1F 1000 -5.0e9 5.0e9 CalibratedCounts Events + + + +yield_empty._block. TH1F 1000 -5.0e9 5.0e9 CalibratedCounts Events +yield_empty._.w TH1F 1000 -5.0e9 5.0e9 CalibratedCounts Events +yield_phasemonitor_block. TH1F 1000 -5.0e9 5.0e9 CalibratedCounts Events +yield_phasemonitor_.w TH1F 1000 -5.0e9 5.0e9 CalibratedCounts Events +yield_qwk_..... TH1F 1000 -5.0e9 5.0e9 Counts Events +yield_qwk_....._block._raw TH1F 1000 -5.0e9 5.0e9 Counts Events +yield_qwk_....._block. TH1F 1000 -5.0e9 5.0e9 CalibratedCounts Events +yield_qwk_....._.w_raw TH1F 1000 -5.0e9 5.0e9 Counts Events +yield_qwk_....._.w TH1F 1000 -5.0e9 5.0e9 CalibratedCounts Events +yield_qwk_....._sw-hw_raw TH1F 1000 -5.0e2 5.0e2 CalibratedCounts Events +yield_qwk_...Rel._block._raw TH1F 1000 -5.0e1 5.0e1 mm Events +yield_qwk_...Rel._block. TH1F 2000 -5.0e1 5.0e1 mm Events +yield_qwk_...Rel._.w_raw TH1F 1000 -5.0e1 5.0e1 mm Events +yield_qwk_...Rel._.w TH1F 2000 -5.0e1 5.0e1 mm Events +yield_qwk_......_block._raw TH1F 1000 -5.0e9 5.0e9 Counts Events +yield_qwk_......_block. TH1F 1000 -5.0e9 5.0e9 CalibratedCounts Events +yield_qwk_......_.w_raw TH1F 1000 -5.0e9 5.0e9 Counts Events +yield_qwk_......_.w TH1F 1000 -5.0e9 5.0e9 CalibratedCounts Events +yield_qwk_......_sw-hw_raw TH1F 1000 -5.0e2 5.0e2 CalibratedCounts Events +yield_qwk_....Rel._block._raw TH1F 1000 -5.0e1 5.0e1 mm Events +yield_qwk_....Rel._block. TH1F 2000 -5.0e1 5.0e1 mm Events +yield_qwk_....Rel._.w_raw TH1F 1000 -5.0e1 5.0e1 mm Events +yield_qwk_....Rel._.w TH1F 2000 -5.0e1 5.0e1 mm Events +yield_qwk_....Rel._sw-hw_raw TH1F 2000 -5.0e2 5.0e2 mm Events +yield_qwk_......._block._raw TH1F 1000 -5.0e9 5.0e9 Counts Events +yield_qwk_......._block. TH1F 1000 -5.0e9 5.0e9 CalibratedCounts Events +yield_qwk_......._.w_raw TH1F 1000 -5.0e9 5.0e9 Counts Events +yield_qwk_......._.w TH1F 1000 -5.0e9 5.0e9 CalibratedCounts Events +yield_qwk_......._sw-hw_raw TH1F 1000 -5.0e2 5.0e2 CalibratedCounts Events +yield_qwk_.....Rel._block._raw TH1F 1000 -5.0e1 5.0e1 mm Events +yield_qwk_.....Rel._block. TH1F 2000 -5.0e1 5.0e1 mm Events +yield_qwk_.....Rel._.w_raw TH1F 1000 -5.0e1 5.0e1 mm Events +yield_qwk_.....Rel._.w TH1F 2000 -5.0e1 5.0e1 mm Events +yield_qwk_........_block._raw TH1F 1000 -5.0e9 5.0e9 Counts Events +yield_qwk_........_block. TH1F 1000 -5.0e9 5.0e9 CalibratedCounts Events +yield_qwk_........_.w_raw TH1F 1000 -5.0e9 5.0e9 Counts Events +yield_qwk_........_.w TH1F 1000 -5.0e9 5.0e9 CalibratedCounts Events +yield_qwk_........._block._raw TH1F 1000 -5.0e9 5.0e9 Counts Events +yield_qwk_........._block. TH1F 1000 -5.0e9 5.0e9 CalibratedCounts Events +yield_qwk_........._.w_raw TH1F 1000 -5.0e9 5.0e9 Counts Events +yield_qwk_........._.w TH1F 1000 -5.0e9 5.0e9 CalibratedCounts Events +yield_qwk_.........._block. TH1F 1000 -5.0e9 5.0e9 CalibratedCounts Events +yield_qwk_.........._.w TH1F 1000 -5.0e9 5.0e9 CalibratedCounts Events +yield_qwk_............_block. TH1F 1000 -5.0e9 5.0e9 CalibratedCounts Events +yield_qwk_............_.w TH1F 1000 -5.0e9 5.0e9 CalibratedCounts Events + +yield_qwk_......_......_block. TH1F 1000 -5.0e9 5.0e9 CalibratedCounts Events +yield_qwk_......_......_.w TH1F 1000 -5.0e9 5.0e9 CalibratedCounts Events +yield_qwk_......._......_block. TH1F 1000 -5.0e9 5.0e9 CalibratedCounts Events +yield_qwk_......._......_.w TH1F 1000 -5.0e9 5.0e9 CalibratedCounts Events +yield_qwk_......_............_block. TH1F 1000 -5.0e9 5.0e9 CalibratedCounts Events +yield_qwk_......_............_.w TH1F 1000 -5.0e9 5.0e9 CalibratedCounts Events + +yield_......_block._raw TH1F 1000 -5.0e9 5.0e9 Counts Events +yield_......_block. TH1F 1000 -5.0e9 5.0e9 CalibratedCounts Events +yield_......_.w_raw TH1F 1000 -5.0e9 5.0e9 Counts Events +yield_......_.w TH1F 1000 -5.0e9 5.0e9 CalibratedCounts Events + +yield_........_block._raw TH1F 1000 -5.0e9 5.0e9 Counts Events +yield_........_block. TH1F 1000 -5.0e9 5.0e9 CalibratedCounts Events +yield_........_.w_raw TH1F 1000 -5.0e9 5.0e9 Counts Events +yield_........_.w TH1F 1000 -5.0e9 5.0e9 CalibratedCounts Events + +yield_........._block._raw TH1F 1000 -5.0e9 5.0e9 Counts Events +yield_........._block. TH1F 1000 -5.0e9 5.0e9 CalibratedCounts Events +yield_........._.w_raw TH1F 1000 -5.0e9 5.0e9 Counts Events +yield_........._.w TH1F 1000 -5.0e9 5.0e9 CalibratedCounts Events + +yield_................._block._raw TH1F 1000 -5.0e9 5.0e9 Counts Events +yield_................._block. TH1F 1000 -5.0e9 5.0e9 CalibratedCounts Events +yield_................._.w_raw TH1F 1000 -5.0e9 5.0e9 Counts Events +yield_................._.w TH1F 1000 -5.0e9 5.0e9 CalibratedCounts Events +yield_..................._block._raw TH1F 1000 -5.0e9 5.0e9 Counts Events +yield_..................._block. TH1F 1000 -5.0e9 5.0e9 CalibratedCounts Events +yield_..................._.w_raw TH1F 1000 -5.0e9 5.0e9 Counts Events +yield_..................._.w TH1F 1000 -5.0e9 5.0e9 CalibratedCounts Events + +yield_................_block. TH1F 1000 -5.0e9 5.0e9 CalibratedCounts Events +yield_................_hw TH1F 1000 -5.0e9 5.0e9 CalibratedCounts Events +yield_............._block. TH1F 1000 -5.0e9 5.0e9 CalibratedCounts Events +yield_............._hw TH1F 1000 -5.0e9 5.0e9 CalibratedCounts Events + +yield_qwk_targetWSum_block. TH1F 1000 -5.0e9 5.0e9 CalibratedCounts Events +yield_qwk_targetWSum_hw TH1F 1000 -5.0e9 5.0e9 CalibratedCounts Events +yield_qwk_targetXAngle_block. TH1F 1000 -5.0e9 5.0e9 CalibratedCounts Events +yield_qwk_targetXAngle_hw TH1F 1000 -5.0e9 5.0e9 CalibratedCounts Events +yield_qwk_targetYAngle_block TH1F 1000 -5.0e9 5.0e9 CalibratedCounts Events +yield_qwk_targetYAngle_hw TH1F 1000 -5.0e9 5.0e9 CalibratedCounts Events + + +asym_empty._block. TH1F 1000 -5.0e-2 5.0e-2 NoUnits Events +asym_empty._hw TH1F 1000 -5.0e-2 5.0e-2 NoUnits Events +asym_phasemonitor_block. TH1F 1000 -5.0e-2 5.0e-2 NoUnits Events +asym_phasemonitor_hw TH1F 1000 -5.0e-2 5.0e-2 NoUnits Events +asym_qwk_..... TH1F 1000 -5.0e-2 5.0e-2 NoUnits Events +asym_qwk_....._block. TH1F 1000 -5.0e-2 5.0e-2 NoUnits Events +asym_qwk_....._hw TH1F 1000 -5.0e-2 5.0e-2 NoUnits Events +asym_qwk_......_block. TH1F 1000 -5.0e-2 5.0e-2 NoUnits Events +asym_qwk_......_hw TH1F 1000 -5.0e-2 5.0e-2 NoUnits Events +asym_qwk_......._block. TH1F 1000 -5.0e-2 5.0e-2 NoUnits Events +asym_qwk_......._hw TH1F 1000 -5.0e-2 5.0e-2 NoUnits Events +asym_qwk_........_block. TH1F 1000 -5.0e-2 5.0e-2 NoUnits Events +asym_qwk_........_hw TH1F 1000 -5.0e-2 5.0e-2 NoUnits Events + +asym_qwk_........._block. TH1F 1000 -5.0e-2 5.0e-2 NoUnits Events +asym_qwk_........._hw TH1F 1000 -5.0e-2 5.0e-2 NoUnits Events +asym_......_block. TH1F 1000 -5.0e-2 5.0e-2 NoUnits Events +asym_......_hw TH1F 1000 -5.0e-2 5.0e-2 NoUnits Events +asym_........_block. TH1F 1000 -5.0e-2 5.0e-2 NoUnits Events +asym_........_hw TH1F 1000 -5.0e-2 5.0e-2 NoUnits Events +asym_........._block. TH1F 1000 -5.0e-2 5.0e-2 NoUnits Events +asym_........._hw TH1F 1000 -5.0e-2 5.0e-2 NoUnits Events +asym_................._block. TH1F 1000 -5.0e-2 5.0e-2 NoUnits Events +asym_................._hw TH1F 1000 -5.0e-2 5.0e-2 NoUnits Events +asym_..................._block. TH1F 1000 -5.0e-2 5.0e-2 NoUnits Events +asym_..................._hw TH1F 1000 -5.0e-2 5.0e-2 NoUnits Events +asym_qwk_......_............_block. TH1F 1000 -5.0e9 5.0e9 CalibratedCounts Events +asym_qwk_......_............_.w TH1F 1000 -5.0e9 5.0e9 CalibratedCounts Events + +asym_................_block. TH1F 1000 -5.0e9 5.0e9 CalibratedCounts Events +asym_................_hw TH1F 1000 -5.0e9 5.0e9 CalibratedCounts Events +asym_............._block. TH1F 1000 -5.0e9 5.0e9 CalibratedCounts Events +asym_............._hw TH1F 1000 -5.0e9 5.0e9 CalibratedCounts Events + + +asym._qwk_0r06WSum_block. TH1F 1000 -5.0e9 5.0e9 CalibratedCounts Events +asym._qwk_targetWSum_hw TH1F 1000 -5.0e9 5.0e9 CalibratedCounts Events +asym._qwk_targetXAngle_block. TH1F 1000 -5.0e9 5.0e9 CalibratedCounts Events +asym._qwk_targetXAngle_hw TH1F 1000 -5.0e9 5.0e9 CalibratedCounts Events +asym._qwk_targetYAngle_block TH1F 1000 -5.0e9 5.0e9 CalibratedCounts Events +asym._qwk_targetYAngle_hw TH1F 1000 -5.0e9 5.0e9 CalibratedCounts Events + + + +diff_qwk_...Rel._block. TH1F 2000 -1.0e1 1.0e1 mm Events +diff_qwk_...Rel._hw TH1F 2000 -1.0e-1 1.0e-1 mm Events +diff_qwk_....Rel._block. TH1F 2000 -5.0e1 5.0e1 mm Events +diff_qwk_....Rel._hw TH1F 2000 -5.0e1 5.0e1 mm Events +diff_qwk_.....Rel._block. TH1F 2000 -5.0e1 5.0e1 mm Events +diff_qwk_.....Rel._hw TH1F 2000 -5.0e1 5.0e1 mm Events +diff_qwk_......_........Rel._hw TH1F 1000 -5.0e9 5.0e9 CalibratedCounts Events +diff_qwk_......_........Rel._block. TH1F 1000 -5.0e9 5.0e9 CalibratedCounts Events + + +diff_qwk_............_block. TH1F 2000 -5.0e1 5.0e1 mm Events +diff_qwk_............_hw TH1F 2000 -5.0e1 5.0e1 mm Events + +....Rel._block._raw TH1F 1000 -5.0e1 5.0e1 mm Events +....Rel._block. TH1F 2000 -5.0e1 5.0e1 mm Events +....Rel._.w_raw TH1F 1000 -5.0e1 5.0e1 mm Events +....Rel._.w TH1F 2000 -5.0e1 5.0e1 mm Events +....Rel._seqnum TH1F 301 -0.5 300.5 SequenceNumber Events +....Rel._numsamples TH1F 1001 -2.5 5002.5 NumberOfSamples Events + +......................._block._raw TH1F 5000 -5.0e9 5.0e9 Counts Events +......................._block. TH1F 5000 -5.0e9 5.0e9 CalibratedCounts Events +......................._.w_raw TH1F 1000 -5.0e9 5.0e9 Counts Events +......................._.w TH1F 1000 -5.0e9 5.0e9 CalibratedCounts Events +......................._seqnum TH1F 301 -0.5 300.5 SequenceNumber Events +......................._numsamples TH1F 1001 -2.5 5002.5 NumberOfSamples Events + +...................._block._raw TH1F 5000 -5.0e9 5.0e9 Counts Events +...................._block. TH1F 5000 -5.0e9 5.0e9 CalibratedCounts Events +...................._.w_raw TH1F 1000 -5.0e9 5.0e9 Counts Events +...................._.w TH1F 1000 -5.0e9 5.0e9 CalibratedCounts Events +...................._seqnum TH1F 301 -0.5 300.5 SequenceNumber Events +...................._numsamples TH1F 1001 -2.5 5002.5 NumberOfSamples Events + +..................._block._raw TH1F 5000 -5.0e9 5.0e9 Counts Events +..................._block. TH1F 5000 -5.0e9 5.0e9 CalibratedCounts Events +..................._.w_raw TH1F 1000 -5.0e9 5.0e9 Counts Events +..................._.w TH1F 1000 -5.0e9 5.0e9 CalibratedCounts Events +..................._seqnum TH1F 301 -0.5 300.5 SequenceNumber Events +..................._numsamples TH1F 1001 -2.5 5002.5 NumberOfSamples Events + +................._block._raw TH1F 5000 -5.0e9 5.0e9 Counts Events +................._block. TH1F 5000 -5.0e9 5.0e9 CalibratedCounts Events +................._.w_raw TH1F 1000 -5.0e9 5.0e9 Counts Events +................._.w TH1F 1000 -5.0e9 5.0e9 CalibratedCounts Events +................._seqnum TH1F 301 -0.5 300.5 SequenceNumber Events +................._numsamples TH1F 1001 -2.5 5002.5 NumberOfSamples Events + +................_block._raw TH1F 5000 -5.0e9 5.0e9 Counts Events +................_block. TH1F 5000 -5.0e9 5.0e9 CalibratedCounts Events +................_.w_raw TH1F 1000 -5.0e9 5.0e9 Counts Events +................_.w TH1F 1000 -5.0e9 5.0e9 CalibratedCounts Events +................_seqnum TH1F 301 -0.5 300.5 SequenceNumber Events +................_numsamples TH1F 1001 -2.5 5002.5 NumberOfSamples Events + +............._block._raw TH1F 5000 -5.0e9 5.0e9 Counts Events +............._block. TH1F 5000 -5.0e9 5.0e9 CalibratedCounts Events +............._.w_raw TH1F 1000 -5.0e9 5.0e9 Counts Events +............._.w TH1F 1000 -5.0e9 5.0e9 CalibratedCounts Events +............._seqnum TH1F 301 -0.5 300.5 SequenceNumber Events +............._numsamples TH1F 1001 -2.5 5002.5 NumberOfSamples Events + +........._block._raw TH1F 5000 -5.0e9 5.0e9 Counts Events +........._block. TH1F 5000 -5.0e9 5.0e9 CalibratedCounts Events +........._.w_raw TH1F 1000 -5.0e9 5.0e9 Counts Events +........._.w TH1F 1000 -5.0e9 5.0e9 CalibratedCounts Events +........._seqnum TH1F 301 -0.5 300.5 SequenceNumber Events +........._numsamples TH1F 1001 -2.5 5002.5 NumberOfSamples Events + +........_block._raw TH1F 5000 -5.0e9 5.0e9 Counts Events +........_block. TH1F 5000 -5.0e9 5.0e9 CalibratedCounts Events +........_.w_raw TH1F 1000 -5.0e9 5.0e9 Counts Events +........_.w TH1F 1000 -5.0e9 5.0e9 CalibratedCounts Events +........_seqnum TH1F 301 -0.5 300.5 SequenceNumber Events +........_numsamples TH1F 1001 -2.5 5002.5 NumberOfSamples Events + +md2neg_hw_raw TH1F 5000 8 10 Counts Events +md2neg_sw-hw_raw TH1F 5000 8 10 Counts Events + +......_hw TH1F 5000 -5.0e9 5.0e9 CalibratedCounts Events +......_sw-hw_raw TH1F 1000 -5.0e2 5.0e2 Counts Events +......_hw_raw TH1F 5000 5.6e7 6.0e7 Counts Events +......_block._raw TH1F 5000 -5.0e9 5.0e9 Counts Events +......_block. TH1F 5000 -5.0e9 5.0e9 CalibratedCounts Events +......_.w_raw TH1F 1000 -5.0e9 5.0e9 Counts Events +......_.w TH1F 1000 -5.0e9 5.0e9 CalibratedCounts Events +......_seqnum TH1F 301 -0.5 300.5 SequenceNumber Events +......_numsamples TH1F 1001 -2.5 5002.5 +MD.Neg_block._raw TH1F 5000 -5.0e9 5.0e9 Counts Events +MD.Neg_block._volt TH1F 2000 -0.4 -0.01 Voltage Events +MD.Neg_.w_raw TH1F 1000 -5.0e9 5.0e9 Counts Events +MD.Neg_.w_volt TH1F 2000 -0.4 -0.01 Voltage Events +MD.Neg_seqnum TH1F 301 -0.5 300.5 SequenceNumber Events +MD.Neg_numsamples TH1F 1001 -2.5 5002.5 NumberOfSamples Events +MD.Pos_block._raw TH1F 1000 -5.0e9 5.0e9 Counts Events +MD.Pos_block._volt TH1F 2000 -0.04 -0.01 Voltage Events +MD.Pos_.w_raw TH1F 1000 -5.0e9 5.0e9 Counts Events +MD.Pos_.w_volt TH1F 2000 -0.04 -0.01 Voltage Events +MD.Pos_seqnum TH1F 301 -0.5 300.5 SequenceNumber Events +MD.Pos_numsamples TH1F 1001 -2.5 5002.5 NumberOfSamples Events + +### Quartet yield histograms +yield......_block._raw TH1F 1000 -2.0e8 0.5e8 Counts Events +yield......_block._volt TH1F 2000 -0.05 0.01 Voltage Events +yield......_.w_raw TH1F 1000 -3.0e8 0.5e8 Counts Events +yield......_.w_volt TH1F 2000 -0.05 0.01 Voltage Events +yield......_seqnum TH1F 301 -0.5 300.5 SequenceNumber Events +yield......_numsamples TH1F 1001 -2.5 5002.5 NumberOfSamples Events +yieldMD.Neg_block._raw TH1F 1000 -2.0e8 0.5e8 Counts Events +yieldMD.Neg_block._volt TH1F 2000 -0.05 0.01 Voltage Events +yieldMD.Neg_.w_raw TH1F 1000 -3.0e8 0.5e8 Counts Events +yieldMD.Neg_.w_volt TH1F 2000 -0.05 0.01 Voltage Events +yieldMD.Neg_seqnum TH1F 301 -0.5 300.5 SequenceNumber Events +yieldMD.Neg_numsamples TH1F 1001 -2.5 5002.5 NumberOfSamples Events +yieldMD.Pos_block._raw TH1F 1000 -2.0e8 0.5e8 Counts Events +yieldMD.Pos_block._volt TH1F 2000 -0.05 0.01 Voltage Events +yieldMD.Pos_.w_raw TH1F 1000 -3.0e8 0.5e8 Counts Events +yieldMD.Pos_.w_volt TH1F 2000 -1.25 -1.05 Voltage Events +yieldMD.Pos_seqnum TH1F 301 -0.5 300.5 SequenceNumber Events +yieldMD.Pos_numsamples TH1F 1001 -2.5 5002.5 NumberOfSamples Events +### Quartet asym histograms +asym......_block._raw TH1F 1001 -1.001e-3 1.001e-3 Asym(raw) Events +asym......_block._volt TH1F 1001 -5.005e-9 5.005e-9 Asym(volts) Events +asym......_.w_raw TH1F 1001 -1.001e-3 1.001e-3 Asym(raw) Events +asym......_.w_volt TH1F 1001 -5.005e-9 5.005e-9 Asym(volts) Events +asym......_seqnum TH1F 301 -0.5 300.5 SequenceNumber Events +asym......_numsamples TH1F 1001 -2.5 5002.5 NumberOfSamples Events +asymMD.Neg_block._raw TH1F 1001 -1.001e-3 1.001e-3 Asym(raw) Events +asymMD.Neg_block._volt TH1F 1001 -5.005e-9 5.005e-9 Asym(volts) Events +asymMD.Neg_.w_raw TH1F 1001 -1.001e-3 1.001e-3 Asym(raw) Events +asymMD.Neg_.w_volt TH1F 1001 -5.005e-9 5.005e-9 Asym(volts) Events +asymMD.Neg_seqnum TH1F 301 -0.5 300.5 SequenceNumber Events +asymMD.Neg_numsamples TH1F 1001 -2.5 5002.5 NumberOfSamples Events +asymMD.Pos_block._raw TH1F 1001 -1.001e-3 1.001e-3 Asym(raw) Events +asymMD.Pos_block._volt TH1F 1001 -5.005e-9 5.005e-9 Asym(volts) Events +asymMD.Pos_.w_raw TH1F 1001 -1.001e-3 1.001e-3 Asym(raw) Events +asymMD.Pos_.w_volt TH1F 1001 -5.005e-9 5.005e-9 Asym(volts) Events +asymMD.Pos_seqnum TH1F 301 -0.5 300.5 SequenceNumber Events +asymMD.Pos_numsamples TH1F 1001 -2.5 5002.5 NumberOfSamples Events +### +### +### Single Ended adc histograms +### Single event histograms +SE......_block._raw TH1F 1000 -5.0e7 5.0e7 Counts Events +SE......_block._volt TH1F 2000 -0.4 -0.01 Voltage Events +SE......_.w_raw TH1F 1000 -5.0e7 5.0e7 Counts Events +SE......_.w_volt TH1F 2000 -0.4 -0.01 Voltage Events +SE......_seqnum TH1F 301 -0.5 300.5 SequenceNumber Events +SE......_numsamples TH1F 1001 -2.5 5002.5 NumberOfSamples Events + + +SETermDn_sw-hw_raw TH1F 1001 -2.5 5002.5 CountsEvents +SESpareE_sw-hw_raw TH1F 1001 -2.5 5002.5 CountsEvents +SEAmpCh2_sw-hw_raw TH1F 1001 -2.5 5002.5 CountsEvents +SEAmpCh1_sw-hw_raw TH1F 1001 -2.5 5002.5 CountsEvents +SESpareB_sw-hw_raw TH1F 1001 -2.5 5002.5 CountsEvents +SESpareA_sw-hw_raw TH1F 1001 -2.5 5002.5 CountsEvents +SETermUp_sw-hw_raw TH1F 1001 -2.5 5002.5 CountsEvents +SEBattDn_sw-hw_raw TH1F 1001 -2.5 5002.5 CountsEvents + + +MD.Neg_block._raw TH1F 1000 -5.0e7 5.0e7 Counts Events +MD.Neg_block._volt TH1F 2000 -0.4 -0.01 Voltage Events +MD.Neg_.w_raw TH1F 1000 -5.0e7 5.0e7 Counts Events +MD.Neg_.w_volt TH1F 2000 -0.4 -0.01 Voltage Events +MD.Neg_seqnum TH1F 301 -0.5 300.5 SequenceNumber Events +MD.Neg_numsamples TH1F 1001 -2.5 5002.5 NumberOfSamples Events +MD.Pos_block._raw TH1F 1000 -5.0e7 5.0e7 Counts Events +MD.Pos_block._volt TH1F 2000 -0.04 -0.01 Voltage Events +MD.Pos_.w_raw TH1F 1000 -5.0e7 5.0e7 Counts Events +MD.Pos_.w_volt TH1F 2000 -0.04 -0.01 Voltage Events +MD.Pos_seqnum TH1F 301 -0.5 300.5 SequenceNumber Events +MD.Pos_numsamples TH1F 1001 -2.5 5002.5 NumberOfSamples Events +### Quartet yield histograms +yieldSE......_block._raw TH1F 1000 -2.0e8 0.5e8 Counts Events +yieldSE......_block._volt TH1F 2000 -0.05 0.01 Voltage Events +yieldSE......_.w_raw TH1F 1000 -3.0e8 0.5e8 Counts Events +yieldSE......_.w_volt TH1F 2000 -0.05 0.01 Voltage Events +yieldSE......_seqnum TH1F 301 -0.5 300.5 SequenceNumber Events +yieldSE......_numsamples TH1F 1001 -2.5 5002.5 NumberOfSamples Events +yieldMD.Neg_block._raw TH1F 1000 -2.0e8 0.5e8 Counts Events +yieldMD.Neg_block._volt TH1F 2000 -0.05 0.01 Voltage Events +yieldMD.Neg_.w_raw TH1F 1000 -3.0e8 0.5e8 Counts Events +yieldMD.Neg_.w_volt TH1F 2000 -0.05 0.01 Voltage Events +yieldMD.Neg_seqnum TH1F 301 -0.5 300.5 SequenceNumber Events +yieldMD.Neg_numsamples TH1F 1001 -2.5 5002.5 NumberOfSamples Events +yieldMD.Pos_block._raw TH1F 1000 -2.0e8 0.5e8 Counts Events +yieldMD.Pos_block._volt TH1F 2000 -0.05 0.01 Voltage Events +yieldMD.Pos_.w_raw TH1F 1000 -3.0e8 0.5e8 Counts Events +yieldMD.Pos_.w_volt TH1F 2000 -1.25 -1.05 Voltage Events +yieldMD.Pos_seqnum TH1F 301 -0.5 300.5 SequenceNumber Events +yieldMD.Pos_numsamples TH1F 1001 -2.5 5002.5 NumberOfSamples Events +### Quartet asym histograms +asymSE......_block._raw TH1F 1001 -1.001e-3 1.001e-3 Asym(raw) Events +asymSE......_block._volt TH1F 1001 -5.005e-9 5.005e-9 Asym(volts) Events +asymSE......_.w_raw TH1F 1001 -1.001e-3 1.001e-3 Asym(raw) Events +asymSE......_.w_volt TH1F 1001 -5.005e-9 5.005e-9 Asym(volts) Events +asymSE......_seqnum TH1F 301 -0.5 300.5 SequenceNumber Events +asymSE......_numsamples TH1F 1001 -2.5 5002.5 NumberOfSamples Events +asymMD.Neg_block._raw TH1F 1001 -1.001e-3 1.001e-3 Asym(raw) Events +asymMD.Neg_block._volt TH1F 1001 -5.005e-9 5.005e-9 Asym(volts) Events +asymMD.Neg_.w_raw TH1F 1001 -1.001e-3 1.001e-3 Asym(raw) Events +asymMD.Neg_.w_volt TH1F 1001 -5.005e-9 5.005e-9 Asym(volts) Events +asymMD.Neg_seqnum TH1F 301 -0.5 300.5 SequenceNumber Events +asymMD.Neg_numsamples TH1F 1001 -2.5 5002.5 NumberOfSamples Events +asymMD.Pos_block._raw TH1F 1001 -1.001e-3 1.001e-3 Asym(raw) Events +asymMD.Pos_block._volt TH1F 1001 -5.005e-9 5.005e-9 Asym(volts) Events +asymMD.Pos_.w_raw TH1F 1001 -1.001e-3 1.001e-3 Asym(raw) Events +asymMD.Pos_.w_volt TH1F 1001 -5.005e-9 5.005e-9 Asym(volts) Events +asymMD.Pos_seqnum TH1F 301 -0.5 300.5 SequenceNumber Events +asymMD.Pos_numsamples TH1F 1001 -2.5 5002.5 NumberOfSamples Events + + +### Scanner histograms + +scanner_vqwk_power TH1F 4096 0.5 4096.5 front_adc Events +scanner_front_adc TH1F 4096 0.5 4096.5 front_adc Events +scanner_back__adc TH1F 4096 0.5 4096.5 back__adc Events +scanner_power_adc TH1F 4096 0.5 4096.5 power_adc Events +scanner_pos_x_adc TH1F 4096 0.5 4096.5 pos_x_adc Events +scanner_pos_y_adc TH1F 4096 0.5 4096.5 pos_y_adc Events + +scanner_front_tdc TH1F 4096 0.5 4096.5 front_tdc Events +scanner_back__tdc TH1F 4096 0.5 4096.5 back__tdc Events +scanner_front_f1 TH1F 4096 0.5 4096.5 front_f1 Events +scanner_back__f1 TH1F 4096 0.5 4096.5 back__f1 Events +scanner_coinc_f1 TH1F 4096 0.5 4096.5 coinc_f1 Events +scanner_ref_t_f1 TH1F 4096 0.5 4096.5 ref_t_f1 Events + +scanner_front_sca TH1F 1500 0.5 1500.5 rate[kps] Events +scanner_back__sca TH1F 1500 0.5 1500.5 rate[kps] Events +scanner_coinc_sca TH1F 1500 0.5 1500.5 rate[kps] Events +scanner_randm_sca TH1F 1500 0.5 1500.5 rate[kps] Events + +scanner_bg_chrlt_sca TH1F 1500 0.5 1500.5 rate[kps] Events +scanner_bg_wilbr_sca TH1F 1500 0.5 1500.5 rate[kps] Events + +scanner_power_vqwk TH1F 10000 0.0 5.0e9 power_vqwk Events +scanner_pos_x_vqwk TH1F 10000 0.0 5.0e9 pos_x_vqwk Events +scanner_pos_y_vqwk TH1F 10000 0.0 5.0e9 pos_y_vqwk Events +scanner_spare. TH1F 10001 -5.0e9 5.0e9 spare Events + +scanner_position_x TH1F 2000 -60.0 60.0 X[cm] Events +scanner_position_y TH1F 2000 -350.0 -310.0 Y[cm] Events +scanner_ref_posi_x TH1F 2000 -60.0 60.0 X[cm] Events +scanner_ref_posi_y TH1F 2000 -350.0 -310.0 Y[cm] Events + +scanner_rate_map TH2F 220 -55.0 55.0 400 -350.0 -310.0 X[cm] Y[cm] + + +### Compton Electron histograms + +Compton_eDet_Accum_Raw_Plane0 TH1F 96 -0.5 95.5 Strips Hits +Compton_eDet_Accum_Plane0 TH1F 96 -0.5 95.5 Strips Hits +Compton_eDet_Evt_Raw_Plane0 TH1F 96 -0.5 95.5 Strips Hits +Compton_eDet_Evt_Plane0 TH1F 96 -0.5 95.5 Strips Hits +Compton_eDet_Accum_Raw_Plane1 TH1F 96 -0.5 95.5 Strips Hits +Compton_eDet_Accum_Plane1 TH1F 96 -0.5 95.5 Strips Hits +Compton_eDet_Evt_Raw_Plane1 TH1F 96 -0.5 95.5 Strips Hits +Compton_eDet_Evt_Plane1 TH1F 96 -0.5 95.5 Strips Hits +Compton_eDet_Accum_Raw_Plane2 TH1F 96 -0.5 95.5 Strips Hits +Compton_eDet_Accum_Plane2 TH1F 96 -0.5 95.5 Strips Hits +Compton_eDet_Evt_Raw_Plane2 TH1F 96 -0.5 95.5 Strips Hits +Compton_eDet_Evt_Plane2 TH1F 96 -0.5 95.5 Strips Hits +Compton_eDet_Accum_Raw_Plane3 TH1F 96 -0.5 95.5 Strips Hits +Compton_eDet_Accum_Plane3 TH1F 96 -0.5 95.5 Strips Hits +Compton_eDet_Evt_Raw_Plane3 TH1F 96 -0.5 95.5 Strips Hits +Compton_eDet_Evt_Plane3 TH1F 96 -0.5 95.5 Strips Hits + +### Halo monitor histograms +sca_halo3 TH1F +sca_halo4 TH1F +sca_halo5 TH1F +sca_halo6 TH1F +sca_halo7 TH1F +sca_halo8 TH1F +sca_halo9 TH1F +sca_halo10 TH1F + +yield_sca_halo3 TH1F +yield_sca_halo4 TH1F +yield_sca_halo5 TH1F +yield_sca_halo6 TH1F +yield_sca_halo7 TH1F +yield_sca_halo8 TH1F +yield_sca_halo9 TH1F +yield_sca_halo10 TH1F + +asym_sca_halo3 TH1F +asym_sca_halo4 TH1F +asym_sca_halo5 TH1F +asym_sca_halo6 TH1F +asym_sca_halo7 TH1F +asym_sca_halo8 TH1F +asym_sca_halo9 TH1F +asym_sca_halo10 TH1F + +### downstream lumi scaler histograms +sca_dslumi1 TH1F 100 0 1e6 Rate Events +sca_dslumi2 TH1F 100 0 1e6 Rate Events +sca_dslumi3 TH1F 100 0 1e6 Rate Events +sca_dslumi4 TH1F 100 0 1e6 Rate Events +sca_dslumi5 TH1F 100 0 1e6 Rate Events +sca_dslumi6 TH1F 100 0 1e6 Rate Events +sca_dslumi7 TH1F 100 0 1e6 Rate Events +sca_dslumi8 TH1F 100 0 1e6 Rate Events + +yield_sca_dslumi1 TH1F +yield_sca_dslumi2 TH1F +yield_sca_dslumi3 TH1F +yield_sca_dslumi4 TH1F +yield_sca_dslumi5 TH1F +yield_sca_dslumi6 TH1F +yield_sca_dslumi7 TH1F +yield_sca_dslumi8 TH1F + +asym_sca_dslumi1 TH1F +asym_sca_dslumi2 TH1F +asym_sca_dslumi3 TH1F +asym_sca_dslumi4 TH1F +asym_sca_dslumi5 TH1F +asym_sca_dslumi6 TH1F +asym_sca_dslumi7 TH1F +asym_sca_dslumi8 TH1F + +### upstream lumi scaler histograms +sca_uslumi1neg TH1F +sca_uslumi1pos TH1F +sca_uslumi3neg TH1F +sca_uslumi3pos TH1F +sca_uslumi5neg TH1F +sca_uslumi5pos TH1F +sca_uslumi7neg TH1F +sca_uslumi7pos TH1F + +yield_sca_uslumi1neg TH1F +yield_sca_uslumi1pos TH1F +yield_sca_uslumi3neg TH1F +yield_sca_uslumi3pos TH1F +yield_sca_uslumi5neg TH1F +yield_sca_uslumi5pos TH1F +yield_sca_uslumi7neg TH1F +yield_sca_uslumi7pos TH1F + +asym_sca_uslumi1neg TH1F +asym_sca_uslumi1pos TH1F +asym_sca_uslumi3neg TH1F +asym_sca_uslumi3pos TH1F +asym_sca_uslumi5neg TH1F +asym_sca_uslumi5pos TH1F +asym_sca_uslumi7neg TH1F +asym_sca_uslumi7pos TH1F + + +########################################### +# VQWK and scaler wildcard names +########################################### +qwk_.* TH1F 1000 -5.0e2 5.0e2 Counts Events +yield_qwk_.* TH1F 1000 -5.0e2 5.0e2 Counts Events +asym.*_qwk_.* TH1F 1000 -5.0e2 5.0e2 Counts Events + +sca_.* TH1F 1001 -1.0e1 1000.0e1 Counts Events +yield_sca_.* TH1F 1001 -1.0e1 1000.0e1 Counts Events +asym.*_sca_.* TH1F 1001 -1.0e1 1000.0e1 Counts Events + +########################################### +# Adding some fully wildcarded histogram names. +# Do not add any other specific names below these. +########################################### +.*_block._raw TH1F 1000 -5.0e9 5.0e9 Counts Events +.*_block. TH1F 1000 -5.0e9 5.0e9 CalibratedCounts Events +.*_.w_raw TH1F 1000 -5.0e9 5.0e9 Counts Events +.*_.w TH1F 1000 -5.0e9 5.0e9 CalibratedCounts Events +.*_sw-hw_raw TH1F 1000 -5.0e2 5.0e2 Counts Events diff --git a/prminput/qweak_beamline_eventcuts.in b/prminput/qweak_beamline_eventcuts.in new file mode 100644 index 000000000..1418a2915 --- /dev/null +++ b/prminput/qweak_beamline_eventcuts.in @@ -0,0 +1,101 @@ +! +!This file contains beamline event cut properties last updated 10/27/2009 based on run 752/755 +! +!********************************************************************************************* +!Global switch to turn ON and OFF eventcut check +!Available settings +!*************************************************** +!To turn OFF all checks +!EVENTCUTS = 0 + +!*************************************************** +!To turn OFF event cuts and perform only HW checks +!EVENTCUTS = 1 + +!*************************************************** +!To turn ON both event cuts and HW checks +!EVENTCUTS = 2 + +!*************************************************** +!To turn do both event cuts and HW checks and only flag event cut failed events +EVENTCUTS = 3 + + +!*************************************************** +!for bcm devices +!device_type, device_name, lower limit [uA], upper limit [uA] +! ****** The bcm lower cut value should be 70% of the asked current +! for 150 uA, lower limit 100 uA +!bcm, qwk_bcm1, 110, 1000000, g, 0 + +! for standard running beam current range 10-180 uA +!bcm, qwk_bcm1, 1, 1000000, l, 2 +bcm, qwk_bcm8, 10, 1000000, g, 2 + +! for 100 uA, lower limit 100 uA +!bcm, qwk_bcm1, 80, 1000000, g, 0 +!bcm, qwk_bcm1, 20, 1000000, g, 0 +! for 130 uA, lower limit 91 uA +! bcm, qwk_bcm1, 91, 1000000, g, 0 +! for 120 uA, lower limit 84 uA +! bcm, qwk_bcm1, 105, 1000000, g, 0 +! for 90 uA, lower limit 63 uA +! bcm, qwk_bcm1, 63, 1000000, g, 0 +! for 80 uA, lower limit 56 uA +! bcm, qwk_bcm1, 56, 1000000, g, 0 +!halomonitor , sca_habcm, 5, 1000000, l, 0 +! for 1 uA, lower limit 98 uA +!bcm, qwk_bcm1, 0.2, 1000000, g, 0 + +!bcm, qwk_bcm1, 35, 1000000, g, 0 +!bcm, qwk_bcm1, 14, 1000000, g, 0 +!bcm, qwk_bcm1, 7, 1000000, g, 0 +!bcm, qwk_bcm2, 0, 0, g, 0 +!bcm, qwk_bcm3, 0, 0, g, 0 +!bcm, qwk_bcm5, 0, 0, g, 0 +!bcm, qwk_bcm6, 0, 0, g, 0 + + +!For bpmstrpline devices +!channel_name can be relx, rely, absx, absy, effective charge, xp, xm, yp, ym +!Cuts are applied after the VQwSubsystem::ProcessEvent() routine. +! So pedestals are applied before appyling the cuts. + +!device_type, device_name, channel_name, lower limit, upper limit, local(l)/global(g), stability percentage + +bpmstripline, qwk_bpm3c12, XP, 0, 58710, l, 0 +bpmstripline, qwk_bpm3c12, XM, 0, 57992, l, 0 +bpmstripline, qwk_bpm3c12, YP, 0, 59995, l, 0 +bpmstripline, qwk_bpm3c12, YM, 0, 56795, l, 0 + +bpmstripline, qwk_bpm3h07a, XP, 0, 65000, l, 0 +bpmstripline, qwk_bpm3h07a, XM, 0, 62600, l, 0 +bpmstripline, qwk_bpm3h07a, YP, 0, 69000, l, 0 +bpmstripline, qwk_bpm3h07a, YM, 0, 72000, l, 0 +bpmstripline, qwk_bpm3h07b, XP, 0, 65500, l, 0 +bpmstripline, qwk_bpm3h07b, XM, 0, 67000, l, 0 +bpmstripline, qwk_bpm3h07b, YP, 0, 69000, l, 0 +bpmstripline, qwk_bpm3h07b, YM, 0, 70000, l, 0 +bpmstripline, qwk_bpm3h07c, XP, 0, 65000, l, 0 +bpmstripline, qwk_bpm3h07c, XM, 0, 66000, l, 0 +bpmstripline, qwk_bpm3h07c, YP, 0, 66400, l, 0 +bpmstripline, qwk_bpm3h07c, YM, 0, 66000, l, 0 +bpmstripline, qwk_bpm3h09, XP, 0, 62120, l, 0 +bpmstripline, qwk_bpm3h09, XM, 0, 64800, l, 0 +bpmstripline, qwk_bpm3h09, YP, 0, 62400, l, 0 +bpmstripline, qwk_bpm3h09, YM, 0, 61900, l, 0 + +!This file contains beamline event cut properties +! +!IMPORTANT +!--------- +!Make sure when puting tabs in the map file entries, always put ", " before inserting a tab. +!Otherwise the routine QwParameterFile::GetNextToken(", ") will extract the entry with the tab character. + +!Comments +!-------- +!Devices that are not in the list are not subjected event cut checks +!All devices will be tested for HW checks. +! +!For device_type =bcm only upper and lower limit of the calibrated charge on the ADC HW sum. (QwVQWK_Channel::fHardwareBlockSum) + diff --git a/prminput/qweak_beamline_geometry.map b/prminput/qweak_beamline_geometry.map new file mode 100644 index 000000000..6c57fc2a8 --- /dev/null +++ b/prminput/qweak_beamline_geometry.map @@ -0,0 +1,54 @@ +!************************************************************************** +! Geometry information for the BPMs in Hall C beamline. +!************************************************************************** +! [Last updated by buddhini on 12-03-2010] +! +! 12-02-2010 B.Waidyawansa Added the correct offset in Z to the target (+11mm->moved downstream). +! Removed the wrong offser of 14mm in X. It was meant to be the offset for Z not X. +! I got confused. Greg said 14mm offset to Z. Survey doc (http://www.jlab.org/accel/survalign/documents/dthallc/C1340.pdf) +! shows it was 11mm offset to z compared to the old value from the last survey (http://www.jlab.org/accel/survalign/documents/dthallc/C1307.pdf). +! So I used that value instead. +! +! 11-12-2010 B.Waidyawansa Added the new surveyed offsets for the 3 bpms in front of the target from +! Jays hclog https://hallcweb.jlab.org/hclog/1011_archive/101112150143.html +! +! X/Yoffset - The difference in the ideal position and the surveyed position of a BPM in X/Y axis. +! +! Z offset - The location of the BPM in the hallC beamline (alog Z axis) from the begining of the arc +! to the center of the device/ origin of device coordinate system. +! +! BSEN scaling factor - Bpm SENsitivity scaling factor is the ratio of general BSEN = 18.81 adc counts/mm +! seen in most of the BPMs in the hall and the actual BSEN of a BPM. +! Almost all the BPMs in the hallC beamline except 3H08 has BSEN=25.8 adc counts/mm +! So we use this factor to apply such changes. +! +! AlphaX/Y - Relative gains of the individual XM,YM pairs compared to XP,YP pairs. +! +! The units of the offsets are in millemeters to be comparable with the units of the analysis results. +! +! The optime based BPM and target offset values for bpms after 3c19 were obtained from Qweak-doc-1203-v3 bu Nuruzzaman. +! The BSEN, ALPHAX and ALPHAY values and the XSOF and YSOF values for the rest of the bpms were obtained from EPICS. +! +! For BPMs that don't have factors or offsets given in the list below, default values will +! be assigned. +! default offset (X/Y/Z) = 0.0 +! default BSEN scaling factor = 18.81 +! default AlphaX/AlphaY = 1.0 +! +! device type, device_name, Xoffset,Yoffset, Zoffset, BSEN scaling factor, AlpaX, AlpaY +! + bpmstripline, QWK_BPM3C12, 0.736, -0.202, 75926.1, 1.0, 0.982274, 0.950626, + bpmstripline, QWK_BPM3H07A, 0.6823, 0.0892, 138406.0, 1.0, 0.960181, 1.071930, xgain=0.9844,ygain=1.0020 + bpmstripline, QWK_BPM3H07B, 0.5896, -0.1550, 139363.0, 1.0, 1.022240, 1.015710, xgain=0.8410,ygain=0.8710 + bpmstripline, QWK_BPM3H07C, 0.6, 0.0, 140319.0, 1.0, 1.013110, 0.985986, + bpmstripline, QWK_BPM3H09, 0.865, -1.0160, 144803.0, 1.0, 1.025930, 0.993640, xgain=0.9762,ygain=0.8710 + +! The representative bpm for qweak hydrogen target. +! From the latest survey information on target (http://www.jlab.org/accel/survalign/documents/dthallc/C1340.pdf), +! the dz offset for the target was reduced 11 mm by moving the target by 11 mm downstream. +! Therefore I added the new z offset ,11 mm to the ideal z position of the target ( 148739 mm ) to get the correct center of the +! target w.r.t bpm coordinates. + + combinedbpm, QWK_TARGET 0.0, 0.0, 148750.0, 1.0, 1.0, 1.0, + +!END diff --git a/prminput/qweak_fb_prm.in b/prminput/qweak_fb_prm.in new file mode 100644 index 000000000..3b425a94d --- /dev/null +++ b/prminput/qweak_fb_prm.in @@ -0,0 +1,169 @@ +#feedback parameters are stored here + +#No.of good patterns to accumulate before triggering the feedback algorithm. + +#for Hall C PITA +patterns = 10000 +#for Hall A IA +HAF_patterns = 20000 +#for position feedback +PF_patterns = 50000 + +#The precision of the charge asymmetry in ppm +#deltaAq = 62 +deltaAq = 20 + +#optimal IA values in volts +optimalIA = 5.5 + +#optimal PC POS in volts +optimalPCP = 5.1 + +#optimal PC NEG in volts +optimalPCN = 5.2 + + + +#Hall C IA Slopes for 4 modes + +#source POLOG entry 1543984 (M_Dalton) + +A0 = -4.482e-2 +DeltaA0 = 3.614e-4 + +A1 = -4.525e-2 +DeltaA1=3.555e-4 + +A2 = -4.586e-2 +DeltaA2 = 3.482e-4 + +A3 = -4.553e-2 + +#Hall A IA Slopes for 4 modes from hclog - 228845 +#for IHWP IN +#HAA0 = 0.0283573 +#for IHWP OUT +#HAA1 = 0.0283573 + +#HAA2 = 0.0283573 +#HAA3 = 0.0283573 + +#Hall A IA Slopes for 4 modes from hclog - 257218 +#valid for all IHWP 1-2 + +#for IHWP IN +HAA0 = -0.270058 +#for IHWP OUT +HAA1 = -0.270058 + +HAA2 = -0.270058 +HAA3 = -0.270058 + +#IA hardware counts set-point limits + +IA_low = 10000 +IA_up = 50000 + +#PITA slopes +# From M.Dalton, as of 00:10,23oct2010, use a slope of: -0.73 ppm/dac-tick +# +#PITASLOPE_OUT = +0.73 +#PITASLOPE_IN = -0.73 + +#PITA slopes +# From M.Dalton, as of ,03Dec2010, +# units are ppm/dac-tick +#PITASLOPE_OUT = +0.554 +#PITASLOPE_IN = -0.557 + +#PITA slopes +# From John Leacock, as of ,19Dec2010, +# units are ppm/dac-tick +#PITASLOPE_OUT = -0.996422 +#PITASLOPE_IN = +0.996422 + +#PITA slopes +# From M.Dalton, as of ,06Jan2011, https://cebaf.jlab.org/elog/entry/1560667 +# units are ppm/dac-tick +#PITASLOPE_OUT = -0.8588 +#PITASLOPE_IN = +0.8588 +### Changed to slope of 1.145ppm/DAC based on 4Feb2011 large charge asym measurement +### See HCLog 218348. +#PITASLOPE_OUT = +1.145 +#PITASLOPE_IN = +1.145 + +### See HCLog 224296 07:35:22 on March 17, 2011 - rakithab +#PITASLOPE_OUT = +0.7749 +### See HCLog 224663 10:12:08 on March 18, 2011 - rakithab +#PITASLOPE_IN = +0.7192 + +### See HCLog 227091 on Apr 07, 2011 - rakithab +#PITASLOPE_OUT = 0.9562 +#PITASLOPE_IN = 0.9790 + +### See HCLog 227952 on Apr 12, 2011 - rakithab +#PITASLOPE_OUT = 0.8698 +#PITASLOPE_IN = 1.0792 + + +### See HCLog 229730 on Apr 23, 2011 - rakithab +#PITASLOPE_OUT = 0.772325 +#PITASLOPE_IN = 0.833674 + +### Run 2 ; IHWP IN slope is from the run 1 last setting +### Run 2 ; IHWP OUT slope is from Mark D. + +#PITASLOPE_OUT = -0.96 + +#PITASLOPE_IN = 0.833674 + +### Run 2 ; IHWP IN slope from run 13994 +### Run 2 ; IHWP OUT slope from run 14002 + +#PITASLOPE_IN = 0.5506 +#PITASLOPE_OUT = -0.8879 +#PITASLOPE_OUT_IN = -0.8879 + +### Run 2 ; IHWP IN-OUT slope from run 15716 +### Run 2 ; IHWP OUT-OUT slope from run 15712 +### Run 2 ; IHWP OUT-IN slope from run 15786 +### See HCLOG 252279 + +#PITASLOPE_IN = 0.8080 +#PITASLOPE_OUT = -1.22794 +#PITASLOPE_OUT_IN = 0.6002 + + +### Run 2 ; new IHWP1-2 slopes from Beam E-log 250. All slopes have flipped sign + +PITASLOPE_IN = 1.06 +PITASLOPE_OUT = 0.53 +PITASLOPE_OUT_IN = 0.57 + + + + + + +### PITANEG = 200 + +#PITA starting setpoints when IHWP is flipped from the IN-OUT in 8:18am 02/23/2011 +# Runs checked OUT - 10207 IN - 10198 - Rakitha 02/23/2011 +PC_pos_t0_IN = 43570 +PC_neg_t0_IN = 40650 +PC_pos_t0_OUT = 42970 +PC_neg_t0_OUT = 41230 + + +#PC hardware count set-point limits +# These should be just inside the low alarm limits on the PC, as +# referenced by Riad in OPS Elog 1549310. +PC_low = 38018 +PC_up = 48016 + +#Minimum charge asymmetry at which feedback correction is applied. see QwHelicityCorrelatedFeedback::FeedPITASetPoints() +MIN_CHARGE_ASYM = 0.005 + +#To enable correction damping see QwHelicityCorrelatedFeedback::FeedPITASetPoints() +DAMPING = 0 + diff --git a/prminput/qweak_hallc_beamline.map b/prminput/qweak_hallc_beamline.map new file mode 100644 index 000000000..51ef42cb8 --- /dev/null +++ b/prminput/qweak_hallc_beamline.map @@ -0,0 +1,139 @@ + +!************************************************************************** +! HALL C BEAMLINE +!************************************************************************** +! +! +ROC=1 +Bank=0x102 +!same sample size for ADCs in a given bank +!sample_size=480 +!for 960Hz +sample_size=464 +! +! +! module.type, module.num chan.num, det.type, det.name, if unrotated then last column ->UNROTATED + +!ADC0, Slot 18, Serial Number 13, Address 0x7B +! VQWK, 0, 4, bcm, QWK_BCM5 +! VQWK, 0, 5, bcm, QWK_BCM6 + VQWK, 0, 6, bcm, QWK_BCM7 + VQWK, 0, 7, bcm, QWK_BCM8 + + +!ADC1, Slot 4, Serial Number 26, Address 0x7C + VQWK, 1, 4, bpmstripline, QWK_BPM3H07AXP + VQWK, 1, 5, bpmstripline, QWK_BPM3H07AXM + VQWK, 1, 6, bpmstripline, QWK_BPM3H07AYP + VQWK, 1, 7, bpmstripline, QWK_BPM3H07AYM + +!ADC2, Slot 5, Serial Number 22, Address 0x7D + VQWK, 2, 0, bpmstripline, QWK_BPM3H07BXP + VQWK, 2, 1, bpmstripline, QWK_BPM3H07BXM + VQWK, 2, 2, bpmstripline, QWK_BPM3H07BYP + VQWK, 2, 3, bpmstripline, QWK_BPM3H07BYM + VQWK, 2, 4, bpmstripline, QWK_BPM3H07CXP + VQWK, 2, 5, bpmstripline, QWK_BPM3H07CXM + VQWK, 2, 6, bpmstripline, QWK_BPM3H07CYP + VQWK, 2, 7, bpmstripline, QWK_BPM3H07CYM + +!ADC3, Slot 6, Serial Number 08, Address 0x7E + VQWK, 3, 4, bpmstripline, QWK_BPM3H09XP + VQWK, 3, 5, bpmstripline, QWK_BPM3H09XM + VQWK, 3, 6, bpmstripline, QWK_BPM3H09YP + VQWK, 3, 7, bpmstripline, QWK_BPM3H09YM + + +!Last updated Nov 23 2011 by Rakitha (rakithab) using Parity/prminput/qweak_hallc_beamline.13337-.map revision-3566 +!ADC4, Slot 7, Address 37, 0x7F + VQWK, 4, 6, bcm, QWK_BCM2 + VQWK, 4, 7, bcm, QWK_BCM1 + +!Last updated Feb 08 2012 Rakitha (rakithab) using Parity/prminput/qweak_hallc_beamline.15261-.map +!ADC6, Slot 9, Serial Number 04, Address 0x81 + VQWK, 6, 4, bpmstripline, QWK_BPM3C12XP + VQWK, 6, 5, bpmstripline, QWK_BPM3C12XM + VQWK, 6, 6, bpmstripline, QWK_BPM3C12YP + VQWK, 6, 7, bpmstripline, QWK_BPM3C12YM + + +!************************************************************************** +! HALL C BEAMLINE SCALERS +!************************************************************************** +ROC=0 +normclock=sca_4MHz +Bank=0x6103 + +! +!! scaler.type, scaler.num word.num, det.type, det.name + + + SCALER, 0, 22, bcm, sca_habcm + SCALER, 0, 30, clock, sca_4MHz + + +! Enter the device names in order they appear in the beamline. +! +begin=combinedbcm +name=qwk_charge +!name type wieght +! qwk_bcm1, bcm, 1.0 +qwk_bcm8, bcm, 1.0 + +end=combinedbcm + + +begin=combinedbpm +name=qwk_target +!name type q x y + QWK_BPM3H07A, bpmstripline, 1.0, 1.0, 1.0 + QWK_BPM3H07B, bpmstripline, 1.0, 1.0, 1.0 + QWK_BPM3H07C, bpmstripline, 1.0, 1.0, 1.0 + QWK_BPM3H09, bpmstripline, 1.0, 1.0, 1.0 +end=combinedbpm + + + +!END + +!set of published variables +!publish name,device_type, device name, property (x-pos,xp-angle,y-pos,yp-angle,c-charge,e-energy change, ef - effective charge) + +!Each line must contain, +!1. publish name +!2. device type +! bcm +! bpmstripline +! bpmcavity +! combobpm +! combobcm +! comboenergy +! scaler +!3. device name +!4. property to publish +! x-pos +! xp-angle +! y-pos +! yp-angle +! c-charge +! e-energy change +! ef-effective charge +! sc - scaler channel + +[PUBLISH] + q_targ, combobcm, qwk_charge, c + sca_bcm, bcm, sca_habcm, c + + x_targ, combobpm, qwk_target, x + y_targ, combobpm, qwk_target, y + xp_targ, combobpm, qwk_target, xp + yp_targ, combobpm, qwk_target, yp + + 3c12x, bpmstripline, qwk_bpm3c12, x + 3c12y, bpmstripline, qwk_bpm3c12, y + 3c12efc, bpmstripline, qwk_bpm3c12, ef + + bcm7, bcm, qwk_bcm7, c + bcm8, bcm, qwk_bcm8, c + + diff --git a/prminput/qweak_hallc_pedestal.map b/prminput/qweak_hallc_pedestal.map new file mode 100644 index 000000000..a5e2cb8a2 --- /dev/null +++ b/prminput/qweak_hallc_pedestal.map @@ -0,0 +1,154 @@ +!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! +! +! Filename : qweak_hallc_pedestal.9695-.map +! +! ** HallC BPM pedestals (per sample) obtained using Run 5900 +! qwk_bcm1 (is calibrated with Run 5807 Gain Setting 2) +! +! ** HallC BCM pedestals and their gains obtained using Run 8370 +!// 8370-8394 BCM calibration RUN 8370 (*) +!// https://hallcweb.jlab.org/hclog/1012_archive/101220200033.html +!// https://hallcweb.jlab.org/hclog/1012_archive/101221120541.html +!// 8395-8396 BCM gain setting 3 +!// https://hallcweb.jlab.org/hclog/1012_archive/101221042257.html +!// only 8395, 8396 is junk +!// +!// +!// 8397- BCM gain setting 2 +!// https://hallcweb.jlab.org/hclog/1012_archive/101221061819.html +!// https://hallcweb.jlab.org/hclog/1012_archive/101221062342.html +!// https://hallcweb.jlab.org/hclog/1012_archive/101221062621.html + + +! For BCM5/6 https://hallcweb.jlab.org/hclog/1101_archive/110120122054.html +! 8966 - +! +! Thursday, January 20 13:12:51 EST 2011, jhlee +! +! For BCM1/2/5/6 https://hallcweb.jlab.org/hclog/1101_archive/110125222318.html +! Wednesday, January 26 09:00:19 EST 2011, jhlee +! Ramesh confirmed the results is the better than run 8966, +! thus, I simply use run 9723 +! Wednesday, January 26 18:33:21 EST 2011, jhlee +! +! For BCM5/6 Friday, February 4 16:10:37 EST 2011,jhlee +! https://hallcweb.jlab.org/hclog/1102_archive/110204144852.html +! For BCM1/2/5/6 https://hallcweb.jlab.org/hclog/1111_archive/111126153445.html log-240704 + +! ** HallC BPM pedestals (per sample) obtained using Run 11956 (qweak_hallc_pedestal.15261-.map) +! +! Hall A bcm:ha_bcm Mon Mar 05 13:28:44 EST 2012 Hclog: 257105 (rakitha - rakithab@jlab.org) + +!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! +! device , pedestal , gain +!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + qwk_bpm3c07XP , 4321.91 , 1.0 + qwk_bpm3c07XM , 4270.65 , 1.0 + qwk_bpm3c07YP , 3467.82 , 1.0 + qwk_bpm3c07YM , 4715.08 , 1.0 + qwk_bpm3c07aXP , 4371.05 , 1.0 + qwk_bpm3c07aXM , 3980.77 , 1.0 + qwk_bpm3c07aYP , 3316.36 , 1.0 + qwk_bpm3c07aYM , 3995.29 , 1.0 + qwk_bpm3c08XP , 4936.66 , 1.0 + qwk_bpm3c08XM , 3802.45 , 1.0 + qwk_bpm3c08YP , 4552.01 , 1.0 + qwk_bpm3c08YM , 5647.08 , 1.0 + qwk_bpm3c11XP , 4110.59 , 1.0 + qwk_bpm3c11XM , 4551.41 , 1.0 + qwk_bpm3c11YP , 4504.34 , 1.0 + qwk_bpm3c11YM , 4780.60 , 1.0 + qwk_bpm3c12XP , 4711.27 , 1.0 + qwk_bpm3c12XM , 4718.28 , 1.0 + qwk_bpm3c12YP , 5467.24 , 1.0 + qwk_bpm3c12YM , 6778.53 , 1.0 + qwk_bpm3c14XP , 5608.24 , 1.0 + qwk_bpm3c14XM , 5942.43 , 1.0 + qwk_bpm3c14YP , 5504.66 , 1.0 + qwk_bpm3c14YM , 6342.74 , 1.0 + qwk_bpm3c16XP , 5273.68 , 1.0 + qwk_bpm3c16XM , 5315.81 , 1.0 + qwk_bpm3c16YP , 4312.00 , 1.0 + qwk_bpm3c16YM , 4441.03 , 1.0 + qwk_bpm3c17XP , 4858.54 , 1.0 + qwk_bpm3c17XM , 5152.51 , 1.0 + qwk_bpm3c17YP , 2681.43 , 1.0 + qwk_bpm3c17YM , 3956.57 , 1.0 + qwk_bpm3c18XP , 4435.01 , 1.0 + qwk_bpm3c18XM , 5022.96 , 1.0 + qwk_bpm3c18YP , 5233.13 , 1.0 + qwk_bpm3c18YM , 5192.95 , 1.0 + qwk_bpm3c19XP , 4566.58 , 1.0 + qwk_bpm3c19XM , 4255.30 , 1.0 + qwk_bpm3c19YP , 4943.83 , 1.0 + qwk_bpm3c19YM , 4853.58 , 1.0 + qwk_bpm3p02aXP , 3475.28 , 1.0 + qwk_bpm3p02aXM , 3254.37 , 1.0 + qwk_bpm3p02aYP , 4794.35 , 1.0 + qwk_bpm3p02aYM , 3674.62 , 1.0 + qwk_bpm3p02bXP , 4330.53 , 1.0 + qwk_bpm3p02bXM , 4845.56 , 1.0 + qwk_bpm3p02bYP , 4824.18 , 1.0 + qwk_bpm3p02bYM , 3614.02 , 1.0 + qwk_bpm3p03aXP , 4961.07 , 1.0 + qwk_bpm3p03aXM , 4191.02 , 1.0 + qwk_bpm3p03aYP , 5657.01 , 1.0 + qwk_bpm3p03aYM , 4859.91 , 1.0 + qwk_bpm3c20XP , 4609.54 , 1.0 + qwk_bpm3c20XM , 5574.22 , 1.0 + qwk_bpm3c20YP , 2749.85 , 1.0 + qwk_bpm3c20YM , 2875.62 , 1.0 + qwk_bpm3c21XP , -726.38 , 1.0 + qwk_bpm3c21XM , -884.42 , 1.0 + qwk_bpm3c21YP , -3100.85 , 1.0 + qwk_bpm3c21YM , -3323.95 , 1.0 + qwk_bpm3h02XP , 2159.46 , 1.0 + qwk_bpm3h02XM , 2811.80 , 1.0 + qwk_bpm3h02YP , 4720.97 , 1.0 + qwk_bpm3h02YM , 3676.43 , 1.0 + qwk_bpm3h04XP , 2756.25 , 1.0 + qwk_bpm3h04XM , 2461.72 , 1.0 + qwk_bpm3h04YP , 3545.75 , 1.0 + qwk_bpm3h04YM , 2479.48 , 1.0 + qwk_bpm3h07aXP , 297.71 , 1.0 + qwk_bpm3h07aXM , -971.43 , 1.0 + qwk_bpm3h07aYP , 3126.18 , 1.0 + qwk_bpm3h07aYM , 2611.49 , 1.0 + qwk_bpm3h07bXP , -82.80 , 1.0 + qwk_bpm3h07bXM , -1252.00 , 1.0 + qwk_bpm3h07bYP , -1404.54 , 1.0 + qwk_bpm3h07bYM , -1608.96 , 1.0 + qwk_bpm3h07cXP , -229.37 , 1.0 + qwk_bpm3h07cXM , -1563.31 , 1.0 + qwk_bpm3h07cYP , 392.83 , 1.0 + qwk_bpm3h07cYM , 530.79 , 1.0 + qwk_bpm3h08XP , -2446.26 , 1.0 + qwk_bpm3h08XM , -3141.81 , 1.0 + qwk_bpm3h08YP , -2078.04 , 1.0 + qwk_bpm3h08YM , -2453.59 , 1.0 + qwk_bpm3h09XP , 4286.37 , 1.0 + qwk_bpm3h09XM , 3540.56 , 1.0 + qwk_bpm3h09YP , 4617.19 , 1.0 + qwk_bpm3h09YM , 3976.35 , 1.0 + qwk_bpm3h09bXP , 2691.17 , 1.0 + qwk_bpm3h09bXM , 3844.96 , 1.0 + qwk_bpm3h09bYP , 5128.03 , 1.0 + qwk_bpm3h09bYM , 4205.27 , 1.0 + +#updated from the qweak_hallc_pedestal.14417-.map -- rakithab + + + qwk_bcm1 , -197.599785, +0.004342 + qwk_bcm2 , -557.273210, +0.004688 + qwk_bcm5 ,-427.799, 0.00213436 + qwk_bcm6 ,-409.644, 0.00222752 + qwk_bcm7 ,-553.898, 0.00214255 + qwk_bcm8 ,-494.289, 0.00207661 + +######## + qwk_linephase , -382.662 , 1.0 + qwk_invert_tstable , -541.714 , 1.0 + sca_habcm, 5335.6, 0.00000121050 + sca_4mhz , 0.0, 0.000000250 + + diff --git a/prminput/qweak_helicity.map b/prminput/qweak_helicity.map new file mode 100644 index 000000000..1dc5d616e --- /dev/null +++ b/prminput/qweak_helicity.map @@ -0,0 +1,84 @@ +!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! +!! input file for decoding the helicity subsystem +!! Of note in this file: +!! HelicityDecodingMode : will tell which mode of decoding is in use +!! : for now it can be InputRegisterMode, UserbitMode +!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + +!Injector data during happex data taking: run 12331, 12354, 12356 +!HelicityDecodingMode=InputRegisterMode +!PatternPhase=4 +!ROC=23 +! +! Header=0xfdacf000 +! HAPPEX BMW words +!SKIP 148 +!WORD, 0, 0, helicitydata, ha_cleandata +!WORD, 0, 0, helicitydata, ha_scandata1 +! +!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! +!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! +!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + +!INPUT REGISTER MODE! +HelicityDecodingMode=InputRegisterMode + + +!Need to set PATTERNPHASEOFFSET = 1 (when pattern phase starts with 1) or 0 (when pattern phase starts with 0) +!default value for PATTERNPHASEOFFSET = 1 is set within the code itself which works fine with regular injector/beamline/parity mock data +!uncomment below line only if pattern phase start from 0 +!PATTERNPHASEOFFSET=0 + +!The size of pattern. toggle = 2, quartets = 4, octets = 8. +PatternPhase=4 +!Helicity bit pattern (lowest bit = earliest window) +PatternBits=0x69 + +!Need to set the NumberPatternsDelayed = 0 when using togling mode. Default value is 2. +!NumberPatternsDelayed=0 + +!seed size is either 24 bit or 30 bit. default is 30 bit +!RandSeedBits=24 + +ROC=0 +Bank=0x6101 + +! +! module.type, module.num chan.num, det.type, det.name +! +WORD, 0, 0, helicitydata, input_register +WORD, 0, 0, helicitydata, output_register +WORD, 0, 0, helicitydata, MPS_counter +WORD, 0, 0, helicitydata, PAT_counter +WORD, 0, 0, helicitydata, PAT_phase +SKIP 9 +WORD, 0, 0, helicitydata, cleandata +WORD, 0, 0, helicitydata, scandata1 +WORD, 0, 0, helicitydata, scandata2 +SKIP 1 +!END +! +!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! +!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! +!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + +!USER BIT MODE + +!HelicityDecodingMode= UserbitMode +!PatternPhase=4 +!seed size is either 24 bit or 30 bit. default is 24 bit +!RandSeedBits=24 +!RandSeedBits=30 +!ROC=31 +!Bank=0x3101 +! +! module.type, module.num chan.num, det.type, det.name +! +!WORD, 0, 0, helicitydata, cleandata +!WORD, 0, 0, helicitydata, scandata1 +!WORD, 0, 0, helicitydata, scandata2 +!WORD, 0, 0, helicitydata, scalerheader +!WORD, 0, 0, helicitydata, scalercounter +!WORD, 0, 0, helicitydata, userbit +!END + diff --git a/prminput/qweak_lumi.map b/prminput/qweak_lumi.map new file mode 100644 index 000000000..57bc176eb --- /dev/null +++ b/prminput/qweak_lumi.map @@ -0,0 +1,140 @@ +!************************************************************************** +! QWEAK LUMI MAP +!************************************************************************** +!As of 11/10/2011 +! +ROC=2 +Bank=0x0202 +!same sample size for ADCs in a given bank +!use 480 for 1kHz +!use 2000 for 240Hz +!sample_size=480 +!sample_size=2000 +!for 960Hz +sample_size=464 + +! +! +! module.type, module.num chan.num, det.type, det.name, if unrotated then last column ->UNROTATED + +!ADC4, Slot 12, Serial Number 18, Address 0x84 + VQWK, 4, 0, integrationpmt, QWK_USLUMI1NEG + VQWK, 4, 1, integrationpmt, QWK_USLUMI1POS + VQWK, 4, 2, integrationpmt, QWK_USLUMI3NEG + VQWK, 4, 3, integrationpmt, QWK_USLUMI3POS + VQWK, 4, 4, integrationpmt, QWK_USLUMI5NEG + VQWK, 4, 5, integrationpmt, QWK_USLUMI5POS + VQWK, 4, 6, integrationpmt, QWK_USLUMI7NEG + VQWK, 4, 7, integrationpmt, QWK_USLUMI7POS + +!ADC5, Slot 14, Serial Number 03, Address 0x85 +! VQWK, 5, 0, integrationpmt, QWK_DSLUMI1 +! VQWK, 5, 1, integrationpmt, QWK_DSLUMI2 +! VQWK, 5, 2, integrationpmt, QWK_DSLUMI3 +! VQWK, 5, 3, integrationpmt, QWK_DSLUMI4 +! VQWK, 5, 4, integrationpmt, QWK_DSLUMI5 +! VQWK, 5, 5, integrationpmt, QWK_DSLUMI6 +! VQWK, 5, 6, integrationpmt, QWK_DSLUMI7 +! VQWK, 5, 7, integrationpmt, QWK_DSLUMI8 + + + +!************************************************************************** +! QWEAK LUMI SCALERS +!************************************************************************** +ROC=0 +Bank=0x6103 +! module.type, scaler.num word.num, scaler.type, det.name +! pre august 26, 2010 +!SCALER,2,1,scalerpmt,sca_uslumi7pos +!SCALER,2,2,scalerpmt,sca_uslumi7neg +!SCALER,2,3,scalerpmt,sca_uslumi5pos +!SCALER,2,4,scalerpmt,sca_uslumi5neg +!SCALER,2,5,scalerpmt,sca_uslumi3pos +!SCALER,2,6,scalerpmt,sca_uslumi3neg +!SCALER,2,7,scalerpmt,sca_uslumi1pos +!SCALER,2,8,scalerpmt,sca_uslumi1neg +!SCALER,2,9,scalerpmt,sca_dslumi8 +!SCALER,2,10,scalerpmt,sca_dslumi7 +!SCALER,2,11,scalerpmt,sca_dslumi6 +!SCALER,2,12,scalerpmt,sca_dslumi5 +!SCALER,2,13,scalerpmt,sca_dslumi4 +!SCALER,2,14,scalerpmt,sca_dslumi3 +!SCALER,2,15,scalerpmt,sca_dslumi2 +!SCALER,2,16,scalerpmt,sca_dslumi1 + +!post august 26,2010 sca_ below! +!SCALER,2,0,scalerpmt,sca_dslumi1 +!SCALER,2,1,scalerpmt,sca_dslumi2 +!SCALER,2,2,scalerpmt,sca_dslumi3 +!SCALER,2,3,scalerpmt,sca_dslumi4 +!SCALER,2,4,scalerpmt,sca_dslumi5 +!SCALER,2,5,scalerpmt,sca_dslumi6 +!SCALER,2,6,scalerpmt,sca_dslumi7 +!SCALER,2,7,scalerpmt,sca_dslumi8 +!SCALER,2,8,scalerpmt,sca_uslumi1neg +!SCALER,2,9,scalerpmt,sca_uslumi1pos +!SCALER,2,10,scalerpmt,sca_uslumi3neg +!SCALER,2,11,scalerpmt,sca_uslumi3pos +!SCALER,2,12,scalerpmt,sca_uslumi5neg +!SCALER,2,13,scalerpmt,sca_uslumi5pos +!SCALER,2,14,scalerpmt,sca_uslumi7neg +!SCALER,2,15,scalerpmt,sca_uslumi7pos + + +!Bank=0x6103 +! module.type, scaler.num word.num, scaler.type, det.name +!SCALER,1,0,scalerpmt,vtf_uslumi1neg +!SCALER,1,1,scalerpmt,vtf_uslumi1pos +!SCALER,1,2,scalerpmt,vtf_uslumi3neg +!SCALER,1,3,scalerpmt,vtf_uslumi3pos +!SCALER,1,4,scalerpmt,vtf_uslumi5neg +!SCALER,1,5,scalerpmt,vtf_uslumi5pos +!SCALER,1,6,scalerpmt,vtf_uslumi7neg +!SCALER,1,7,scalerpmt,vtf_uslumi7pos +!SCALER,1,8,scalerpmt,vtf_dslumi1 +!SCALER,1,9,scalerpmt,vtf_dslumi2 +!SCALER,1,10,scalerpmt,vtf_dslumi3 +!SCALER,1,11,scalerpmt,vtf_dslumi4 +!SCALER,1,12,scalerpmt,vtf_dslumi5 +!SCALER,1,13,scalerpmt,vtf_dslumi6 +!SCALER,1,14,scalerpmt,vtf_dslumi7 +!SCALER,1,15,scalerpmt,vtf_dslumi8 + + + + +! "virtual" channels for PMT combination, it supports any combination of physical channels +! when naming the DetName, do not use arithmetic and logic operators, such as +,-, &, and so on +! +! ModuleType, Chan#, NumberOfCombinedChan's, DetType, DetName, PhysicalChanNames, WeightNumbers, +! VPMT, 40, 2, CombinationPMT, uslumi1_sum, qwk_uslumi1Pos, qwk_uslumi1Neg, 1.0, 1.0 +! VPMT, 41, 2, CombinationPMT, uslumi3_sum, qwk_uslumi3Pos, qwk_uslumi3Neg, 1.0, 1.0 +! VPMT, 42, 2, CombinationPMT, uslumi5_sum, qwk_uslumi5Pos, qwk_uslumi5Neg, 1.0, 1.0 +! VPMT, 43, 2, CombinationPMT, uslumi7_sum, qwk_uslumi7Pos, qwk_uslumi7Neg, 1.0, 1.0 +! VPMT, 44, 4, CombinationPMT, uslumi1_uslumi5_sum, qwk_uslumi1Pos, qwk_uslumi1Neg, qwk_uslumi5Pos, qwk_uslumi5Neg, 1.0, 1.0, 1.0, 1.0 +! VPMT, 45, 4, CombinationPMT, uslumi3_uslumi7_sum, qwk_uslumi3Pos, qwk_uslumi3Neg, qwk_uslumi7Pos, qwk_uslumi7Neg, 1.0, 1.0, 1.0, 1.0 +! VPMT, 46, 4, CombinationPMT, uslumi1_uslumi5_diff, qwk_uslumi1Pos, qwk_uslumi1Neg, qwk_uslumi5Pos, qwk_uslumi5Neg, 1.0, 1.0, -1.0, -1.0 +! VPMT, 47, 4, CombinationPMT, uslumi3_uslumi7_diff, qwk_uslumi3Pos, qwk_uslumi3Neg, qwk_uslumi7Pos, qwk_uslumi7Neg, 1.0, 1.0, -1.0, -1.0 + +VPMT, 48, 8, CombinationPMT, uslumi_sum, qwk_uslumi1Pos, qwk_uslumi1Neg, qwk_uslumi3Pos, qwk_uslumi3Neg, qwk_uslumi5Pos, qwk_uslumi5Neg, qwk_uslumi7Pos, qwk_uslumi7Neg, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0 + +!VPMT, 48, 6, CombinationPMT, uslumi_sum, qwk_uslumi1Pos, qwk_uslumi1Neg, qwk_uslumi3Pos, qwk_uslumi3Neg, qwk_uslumi5Pos, qwk_uslumi5Neg, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0 + +! VPMT, 49, 2, CombinationPMT, dslumi1_dslumi5_sum, qwk_dslumi1, qwk_dslumi5, 1.0, 1.0 +! VPMT, 50, 2, CombinationPMT, dslumi2_dslumi6_sum, qwk_dslumi2, qwk_dslumi6, 1.0, 1.0 +! VPMT, 51, 2, CombinationPMT, dslumi3_dslumi7_sum, qwk_dslumi3, qwk_dslumi7, 1.0, 1.0 +! VPMT, 52, 2, CombinationPMT, dslumi4_dslumi8_sum, qwk_dslumi4, qwk_dslumi8, 1.0, 1.0 + +! VPMT, 53, 2, CombinationPMT, dslumi1_dslumi5_diff, qwk_dslumi1, qwk_dslumi5, 1.0, -1.0 +! VPMT, 54, 2, CombinationPMT, dslumi2_dslumi6_diff, qwk_dslumi2, qwk_dslumi6, 1.0, -1.0 +! VPMT, 55, 2, CombinationPMT, dslumi3_dslumi7_diff, qwk_dslumi3, qwk_dslumi7, 1.0, -1.0 +! VPMT, 56, 2, CombinationPMT, dslumi4_dslumi8_diff, qwk_dslumi4, qwk_dslumi8, 1.0, -1.0 + +! VPMT, 57, 4, CombinationPMT, dslumi_odd, qwk_dslumi1, qwk_dslumi3, qwk_dslumi5, qwk_dslumi7, 1.0, 1.0, 1.0, 1.0 +! VPMT, 58, 4, CombinationPMT, dslumi_even, qwk_dslumi2, qwk_dslumi4, qwk_dslumi6, qwk_dslumi8, 1.0, 1.0, 1.0, 1.0 + +! VPMT, 59, 8, CombinationPMT, dslumi_sum, qwk_dslumi1, qwk_dslumi2, qwk_dslumi3, qwk_dslumi4, qwk_dslumi5, qwk_dslumi6, qwk_dslumi7, qwk_dslumi8, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0 + + +!END diff --git a/prminput/qweak_lumi_eventcuts.in b/prminput/qweak_lumi_eventcuts.in new file mode 100644 index 000000000..ad7f876f1 --- /dev/null +++ b/prminput/qweak_lumi_eventcuts.in @@ -0,0 +1,42 @@ +!This file contains LUMI event cut properties last updated 11/15/2010 based on the run 6297 + +!Global switch to turn ON and OFF eventcut check +!Available settings +!To turn OFF all checks +!EVENTCUTS = 0 +!To turn OFF event cuts and perform only HW checks +!EVENTCUTS = 1 +!To turn do both event cuts and HW checks +!EVENTCUTS = 2 +!To turn do both event cuts and HW checks and only flag event cut failed events +EVENTCUTS = 3 + +!IMPORTANT +!--------- +!Make sure when puting tabs in the map file entries, always put ", " before inserting a tab. +!Otherwise the routine QwParameterFile::GetNextToken(", ") will extract the entry with the tab character. + + +!device_type, device_name, lower limit, upper limit, local(l)/global(g), stability percentage + + +!integrationpmt, qwk_uslumi1neg, 0.002053, 1000000, l, 0.01 +!combinationpmt, uslumi3_sum, 0.007625, 1000000, l,0.01 + + + + + + + + +!This file contains beamline event cut properties + + +!Comments +!-------- +!Devices that are not in the list are not subjected event cut checks +!All devices will be tested for HW checks. +! +!For device_type =bcm only upper and lower limit of the calibrated charge on the ADC HW sum. (QwVQWK_Channel::fHardwareBlockSum) + diff --git a/prminput/qweak_lumi_pedestal.map b/prminput/qweak_lumi_pedestal.map new file mode 100644 index 000000000..732b884f8 --- /dev/null +++ b/prminput/qweak_lumi_pedestal.map @@ -0,0 +1,19 @@ + +!The following pedestals were recorded from RUN 16454 +!channel name , Mps channelname.hw_sum_raw/num_samples , gain +qwk_dslumi1 , 1652.34 , 0.00007629 +qwk_dslumi2 , 1470.11 , 0.00007629 +qwk_dslumi3 , 732.542 , 0.00007629 +qwk_dslumi4 , 1236.64 , 0.00007629 +qwk_dslumi5 , 1771.18 , 0.00007629 +qwk_dslumi6 , 1492.29 , 0.00007629 +qwk_dslumi7 , 1195.73 , 0.00007629 +qwk_dslumi8 , 1452.85 , 0.00007629 +qwk_uslumi1neg , 7724.26 , 0.00007629 +qwk_uslumi1pos , 11838.3 , 0.00007629 +qwk_uslumi3neg , 8080.52 , 0.00007629 +qwk_uslumi3pos , 8218.88 , 0.00007629 +qwk_uslumi5neg , 13485.1 , 0.00007629 +qwk_uslumi5pos , 14430.1 , 0.00007629 +qwk_uslumi7neg , 12196.3 , 0.00007629 +qwk_uslumi7pos , 8134.84 , 0.00007629 diff --git a/prminput/qwfeedback.conf b/prminput/qwfeedback.conf new file mode 100644 index 000000000..fc23fc405 --- /dev/null +++ b/prminput/qwfeedback.conf @@ -0,0 +1,29 @@ +# +# Configuration file for the injector tests. +# +# To run standalone +# ./qwfeedback --ET.hostname cdaql4 --ET.session cdaq --online.RunNumber 1000000 + +online = true +ET.station = feedback +autoflush = 0 +disable-histos = true +disable-trees = true +rootfile-stem = feedback_ + +ring.stability_cut = 2 + + + +blinder.force-target-out = true + +PITA-Feedback = true +HA-IA-Feedback = false +IA-Feedback = false +Auto-IHWP-Flip = false +[QwDatabase] +accesslevel = OFF + +[QwLog] + loglevel-screen = 1 + loglevel-file = 2 diff --git a/prminput/qwfeedback_offline.conf b/prminput/qwfeedback_offline.conf new file mode 100644 index 000000000..986702c13 --- /dev/null +++ b/prminput/qwfeedback_offline.conf @@ -0,0 +1,31 @@ +# +# Configuration file for the injector tests. +# +# To run standalone offline feedback system +# ./qwfeedback -c qwfeedback_offline -r 14678 -e1:400000 + + + +#online = true +#ET.station = feedback +autoflush = 0 +disable-histos = true +disable-trees = true +rootfile-stem = feedback_ + +ring.stability_cut = 2 + + + +blinder.force-target-out = true + +PITA-Feedback = true +HA-IA-Feedback = false +IA-Feedback = false +Auto-IHWP-Flip = false +[QwDatabase] +accesslevel = OFF + +[QwLog] + loglevel-screen = 1 + loglevel-file = 2 diff --git a/src/GreenMonster.cc b/src/GreenMonster.cc new file mode 100644 index 000000000..4a76fa496 --- /dev/null +++ b/src/GreenMonster.cc @@ -0,0 +1,217 @@ + +#include "GreenMonster.h" + +//ClassImp(GreenMonster) + +GreenMonster::GreenMonster():fVerbose(kTRUE) +{ + fUseCrate[0]= kFALSE; + fCrateNames[0] = new TString("Qweak Injector"); + fCrateNumbers[0] = Crate_CountingHouse;//injector crate + + fUseCrate[1]= kFALSE; + fCrateNames[1] = new TString("Injector"); + fCrateNumbers[1] = Crate_Injector; + + fUseCrate[2]= kFALSE; + fCrateNames[2] = new TString("Left Spect"); + fCrateNumbers[2] = Crate_LeftSpect; + + fUseCrate[3]= kFALSE; + fCrateNames[3] = new TString("Right Spect"); + fCrateNumbers[3] = Crate_RightSpect; + + + fUseCrate[4]= kTRUE; + fCrateNames[4] = new TString("Qw VME TS"); + fCrateNumbers[4] = Crate_Qwvmets; + + +} + +GreenMonster::~GreenMonster() { +}; + +void GreenMonster::Open() { + // cfSockCliOpen(Crate_CountingHouse, 0); +}; + +void GreenMonster::Close() { + // cfSockCliClose(); +}; + +void GreenMonster::CheckScan() { + SCNCheckStatus(); // this call is actually an important initialization! + SCNCheckValues(); // this call is actually an important initialization! +}; + + + +void GreenMonster::SCNUpdateStatus(Int_t id) { + + switch (id) + { + case SCN_INT_CLN: + { + // fStateRBtSCN[SCN_RADIO_NOT_BT]->SetState(kButtonUp); + // fStateRBtSCN[SCN_RADIO_CLN_BT]->SetState(kButtonDown); + statusSCN=id; + break; + } + case SCN_INT_NOT: + { + // fStateRBtSCN[SCN_RADIO_CLN_BT]->SetState(kButtonUp); + // fStateRBtSCN[SCN_RADIO_NOT_BT]->SetState(kButtonDown); + statusSCN=id; + break; + } + default: + std::cout << "ERROR: Unrecognized SCAN status flag" << std::endl; + } + return; +} + + +Bool_t GreenMonster::SCNCheckStatus() { + struct greenRequest gRequest; + int command, par1, par2, command_type; + char *msgReq = "SCN status check"; + char *reply = "Y"; + Int_t iclean; + + // printf("SCN Status ="); + command_type = COMMAND_SCAN; gRequest.command_type = command_type; + command = SCAN_GET_STATUS; gRequest.command = command; + par1 = 0; gRequest.par1 = par1; + par2 = 0; gRequest.par2 = par2; + strcpy(gRequest.message,msgReq); gRequest.reply = reply; + if (GreenSockCommand(Crate_Qwvmets,&gRequest) == SOCK_OK) { + command = gRequest.command; + par1 = gRequest.par1; + par2 = gRequest.par2; + iclean=par1; + if (iclean != SCN_INT_CLN && iclean != SCN_INT_NOT) { + printf("UNKNOWN REPLY FOR SCN STATUS: %d ",iclean); + return kFALSE; + } + } else { + printf("ERROR accessing socket!"); + return kFALSE; + } + + // printf("% d %d\n",par1,par2); + + SCNUpdateStatus(iclean); + return kTRUE; +} + +void GreenMonster::SCNSetStatus(Int_t status) { + struct greenRequest gRequest; + int command, par1, par2, command_type; + char *msgReq = "SCN Status Change"; + char *reply = "Y"; + + command_type = COMMAND_SCAN; gRequest.command_type = command_type; + command = SCAN_SET_STATUS; gRequest.command = command; + par1 = status; gRequest.par1 = par1; + par2 = 0; gRequest.par2 = par2; + + if (fVerbose) std::cout << "Setting SCN status: " << par1 << std::endl; + strcpy(gRequest.message,msgReq); gRequest.reply = reply; + + if (GreenSockCommand(Crate_Qwvmets,&gRequest) == SOCK_OK) { + if (fVerbose) printf("SCAN status change call is complete\n"); + } else { + printf("ERROR accessing socket!"); + return; + } + // check scan status + SCNCheckStatus(); +} + + + +void GreenMonster::SCNSetValue(Int_t which, Int_t value) { + struct greenRequest gRequest; + int command, par1, par2, command_type; + char *msgReq = "Set SCN Data Value"; + char *reply = "Y"; + + if (which==1) setpoint1SCN=value; + else if (which==2) setpoint2SCN=value; + + if (fVerbose) std::cout << " writing new SCAN set point " << value + << " to data" << which < * +\**********************************************************/ + +#include "QwHelicityCorrelatedFeedback.h" +#include "TSystem.h" + +/*****************************************************************/ + + +/** + * Defines configuration options using QwOptions functionality. + * @param options Options object + */ +void QwHelicityCorrelatedFeedback::DefineOptions(QwOptions &options) +{ + + options.AddOptions("Helicity Correlated Feedback")("Auto-IHWP-Flip", po::value()->default_value(false)->zero_tokens(),"Set Half wave plate IN. The default is Half wave plate OUT"); + options.AddOptions("Helicity Correlated Feedback")("Half-wave-plate-revert", po::value()->default_value(false)->zero_tokens(),"Revert half-wave plate status. The default is determined via EPIC"); + //options.AddOptions("Helicity Correlated Feedback")("Half-wave-plate-OUT", po::value()->default_value(true)->zero_tokens(),"Half wave plate OUT"); + options.AddOptions("Helicity Correlated Feedback")("PITA-Feedback", po::value()->default_value(false)->zero_tokens(),"Run the PITA charge feedback"); + options.AddOptions("Helicity Correlated Feedback")("IA-Feedback", po::value()->default_value(false)->zero_tokens(),"Run the IA charge feedback"); + options.AddOptions("Helicity Correlated Feedback")("HA-IA-Feedback", po::value()->default_value(false)->zero_tokens(),"Run the Hall A IA charge feedback"); + +}; + +/*****************************************************************/ +void QwHelicityCorrelatedFeedback::ProcessOptions(QwOptions &options) +{ + QwHelicityPattern::ProcessOptions(options); + + fHalfWaveRevert = options.GetValue("Half-wave-plate-revert"); + fHalfWavePlateStatus = GetHalfWavePlateState();//read the IHWP for the first time when the feedback is starting. + fAutoIHWP = options.GetValue("Auto-IHWP-Flip"); + + + + printf("NOTICE \n QwFeedback got the half-wave plate status %s\n", fHalfWavePlateStatus.Data()); + + if(fHalfWavePlateStatus.Contains("IN")) { + if(fHalfWaveRevert) fHalfWaveIN = false; + else fHalfWaveIN = true; + fDefaultHalfWavePlateStatus=1; + } + else { + if(fHalfWaveRevert) fHalfWaveIN = true; + else fHalfWaveIN = false; + fDefaultHalfWavePlateStatus=0; + } + + fHalfWaveOUT = !fHalfWaveIN; + + if (fHalfWaveIN) + printf("NOTICE \n Half-wave-plate-IN\n"); + else + printf("NOTICE \n Half-wave-plate-OUT\n"); + + if (GetHalfWavePlate2State()==1) + printf("NOTICE \n Half-wave-plate-2 is IN \n"); + else if (GetHalfWavePlate2State()==0) + printf("NOTICE \n Half-wave-plate-2 is OUT \n"); + + + + + fPITAFB = options.GetValue("PITA-Feedback"); + fHAIAFB = options.GetValue("HA-IA-Feedback"); + fIAFB = options.GetValue("IA-Feedback"); + + if (fPITAFB) + printf("NOTICE \n PITA-Feedback is running.\n"); + else + printf("NOTICE \n PITA-Feedback is not running.\n"); + if (fIAFB) + printf("NOTICE \n IA-Feedback is running.\n"); + else + printf("NOTICE \n IA-Feedback is not running.\n"); + if (fHAIAFB) + printf("NOTICE \n Hall A IA-Feedback is running.\n"); + else + printf("NOTICE \n Hall A IA-Feedback is not running.\n"); + + if (!fPITAFB && !fIAFB && !fHAIAFB){//no correction applied. + fEPICSCtrl.Set_FeedbackStatus(0); + exit(1); + } + + if (fAutoIHWP){ + printf("NOTICE \n AUTO IHWP Flip is ON \n"); + //exit(1); + }else{ + printf("NOTICE \n AUTO IHWP Flip is OFF \n"); + //exit(1); + } + //exit(1); +}; + +/*****************************************************************/ +void QwHelicityCorrelatedFeedback::LoadParameterFile(TString filename){ + char buffer [10]; + TString prev_IHWP_State; + + QwParameterFile mapstr(filename.Data()); //Open the file + TString varname, varvalue; + UInt_t value; + Double_t dvalue; + fIASetpointlow=11000; + fIASetpointup=40000; + while (mapstr.ReadNextLine()){ + mapstr.TrimComment('#'); // Remove everything after a '!' character. + mapstr.TrimWhitespace(); // Get rid of leading and trailing spaces. + if (mapstr.LineIsEmpty()) continue; + + if (mapstr.HasVariablePair("=",varname,varvalue)){ + //Decode it. + varname.ToLower(); + if (varname=="patterns"){ + value = QwParameterFile::GetUInt(varvalue); + fAccumulatePatternMax=value; + } + else if (varname=="haf_patterns"){ + value = QwParameterFile::GetUInt(varvalue); + fHAAccumulatePatternMax=value; + }else if(varname=="pf_patterns"){ + value = QwParameterFile::GetUInt(varvalue); + fPFAccumulatePatternMax=value; + }else if (varname=="deltaaq"){ + dvalue = atof(varvalue.Data()); + fChargeAsymPrecision=dvalue; + } + else if (varname=="optimalia"){ + dvalue = atof(varvalue.Data()); + fOptimalIA = dvalue; + } + else if (varname=="optimalpcp"){ + dvalue = atof(varvalue.Data()); + fOptimalPCP = dvalue; + } + else if (varname=="optimalpcn"){ + dvalue = atof(varvalue.Data()); + fOptimalPCN = dvalue; + } + else if (varname=="a0"){ + dvalue = atof(varvalue.Data()); + fIASlopeA[0] = dvalue; + } + else if (varname=="deltaa0"){ + dvalue = atof(varvalue.Data()); + fDelta_IASlopeA[0] = dvalue; + } + else if (varname=="a1"){ + dvalue = atof(varvalue.Data()); + fIASlopeA[1] = dvalue; + } + else if (varname=="deltaa1"){ + dvalue = atof(varvalue.Data()); + fDelta_IASlopeA[1] = dvalue; + } + else if (varname=="a2"){ + dvalue = atof(varvalue.Data()); + fIASlopeA[2] = dvalue; + } + else if (varname=="deltaa2"){ + dvalue = atof(varvalue.Data()); + fDelta_IASlopeA[2] = dvalue; + } + else if (varname=="a3"){ + dvalue = atof(varvalue.Data()); + fIASlopeA[3] = dvalue; + } + else if (varname=="deltaa3"){ + dvalue = atof(varvalue.Data()); + fDelta_IASlopeA[3] = dvalue; + } + else if (varname=="haa0"){ + dvalue = atof(varvalue.Data()); + fHAIASlopeA[0] = dvalue; + } + else if (varname=="haa1"){ + dvalue = atof(varvalue.Data()); + fHAIASlopeA[1] = dvalue; + } + else if (varname=="haa2"){ + dvalue = atof(varvalue.Data()); + fHAIASlopeA[2] = dvalue; + } + else if (varname=="haa3"){ + dvalue = atof(varvalue.Data()); + fHAIASlopeA[3] = dvalue; + } + else if (varname=="ia_low"){ + dvalue = atof(varvalue.Data()); + if (dvalue>0) + fIASetpointlow = dvalue; + } + else if (varname=="ia_up"){ + dvalue = atof(varvalue.Data()); + if (dvalue>0) + fIASetpointup = dvalue; + } + else if (varname=="pitaslope_in"){//IHWP1 IN IHWP2 OUT + dvalue = atof(varvalue.Data()); + fPITASlopeIN = dvalue; + } + else if (varname=="pitaslope_out"){//IHWP1 OUT IHWP2 OUT + dvalue = atof(varvalue.Data()); + fPITASlopeOUT = dvalue; + } + else if (varname=="pitaslope_out_in"){//IHWP1 OUT IHWP2 IN + dvalue = atof(varvalue.Data()); + fPITASlopeOUT_IN = dvalue; + } + else if (varname=="pc_pos_t0_in"){ + dvalue = atof(varvalue.Data()); + fPITASetpointPOS_t0_IN = dvalue; + } + else if (varname=="pc_neg_t0_in"){ + dvalue = atof(varvalue.Data()); + fPITASetpointNEG_t0_IN = dvalue; + } + else if (varname=="pc_pos_t0_out"){ + dvalue = atof(varvalue.Data()); + fPITASetpointPOS_t0_OUT = dvalue; + } + else if (varname=="pc_neg_t0_out"){ + dvalue = atof(varvalue.Data()); + fPITASetpointNEG_t0_OUT = dvalue; + } + else if (varname=="pc_up"){ + dvalue = atof(varvalue.Data()); + if (dvalue>0) + fPITASetpointup = dvalue; + } + else if (varname=="pc_low"){ + dvalue = atof(varvalue.Data()); + if (dvalue>0) + fPITASetpointlow = dvalue; + }else if (varname=="min_charge_asym"){ + dvalue = atof(varvalue.Data()); + if (dvalue>0) + fPITA_MIN_Charge_asym = dvalue; + } else if (varname=="damping"){ + dvalue = atof(varvalue.Data()); + if (dvalue>0) + fFeedbackDamping=kTRUE; + else + fFeedbackDamping=kFALSE; + } + + + + } + } + + //Read the last know good PC set points + out_file_PC_IN_pos = fopen("/local/scratch/qweak/Last_good_PC_pos_IN", "r");//Open in read mode + out_file_PC_IN_neg = fopen("/local/scratch/qweak/Last_good_PC_neg_IN", "r");//Open in read mode + out_file_PC_OUT_pos = fopen("/local/scratch/qweak/Last_good_PC_pos_OUT", "r");//Open in read mode + out_file_PC_OUT_neg = fopen("/local/scratch/qweak/Last_good_PC_neg_OUT", "r");//Open in read mode + + if (out_file_PC_IN_pos && out_file_PC_IN_neg && out_file_PC_OUT_pos && out_file_PC_OUT_neg){ + UInt_t tmp; + fscanf(out_file_PC_IN_pos,"%d",&tmp); + fPITASetpointPOS_t0_IN=tmp; + fscanf(out_file_PC_IN_neg,"%d",&tmp); + fPITASetpointNEG_t0_IN=tmp; + fscanf(out_file_PC_OUT_pos,"%d",&tmp); + fPITASetpointPOS_t0_OUT=tmp; + fscanf(out_file_PC_OUT_neg,"%d",&tmp); + fPITASetpointNEG_t0_OUT=tmp; + fclose(out_file_PC_IN_pos); + fclose(out_file_PC_IN_neg); + fclose(out_file_PC_OUT_pos); + fclose(out_file_PC_OUT_neg); + + } + + + + QwMessage<<"Hall C patternMax = "<fIASetpointup) + fIASetpoint[mode]=fIASetpointup; + else if (fIASetpoint[mode]fIASetpointup) || (fHAIASetpoint[mode]fPITASetpointup) || (fPITASetpointPOSfPITASetpointup) || (fPITASetpointNEGfChargeAsymPrecision){ + QwError<<"Charge Asymmetry precision has not reached. Current value "<fChargeAsymPrecision){ + QwError<<"Hall A Charge Asymmetry precision has not reached. Current value "<3){ + QwError << " Could not get external value setting parameters to q_targ" <fChargeAsymPrecision){ + QwError<<"Charge Asymmetry["<=fHAAccumulatePatternMax){ + //QwMessage<<"fHelModeGoodPatternCounter["<> j)&0x1); + } + if (localhel == plushel) { + if (firstplushel) { + fPositiveHelicitySum = fEvents.at(i); + firstplushel = kFALSE; + } else { + fPositiveHelicitySum += fEvents.at(i); + } + } else if (localhel == minushel) { + if (firstminushel) { + fNegativeHelicitySum = fEvents.at(i); + firstminushel = kFALSE; + } else { + fNegativeHelicitySum += fEvents.at(i); + } + } + } + } else { + // + fCurrentHelPat=0; + for (size_t i = 0; i < (size_t) fPatternSize; i++) { + if (fHelicity[i] == plushel) { + if (fPatternSize==4){//currently works only for pattern size of 4 + switch(i){ + case 0: + //fCurrentHelPat+=1; + fCurrentHelPat+=1000; + break; + case 1: + //fCurrentHelPat+=10; + fCurrentHelPat+=100; + break; + case 2: + //fCurrentHelPat+=100; + fCurrentHelPat+=10; + break; + case 3: + //fCurrentHelPat+=1000; + fCurrentHelPat+=1; + break; + } + } + + if (localdebug) + std::cout<<"QwHelicityPattern::CalculateAsymmetry:: here filling fPositiveHelicitySum \n"; + if (firstplushel) { + if (localdebug) std::cout<<"QwHelicityPattern::CalculateAsymmetry:: with = \n"; + fPositiveHelicitySum = fEvents.at(i); + firstplushel = kFALSE; + } else { + if (localdebug) std::cout<<"QwHelicityPattern::CalculateAsymmetry:: with += \n"; + fPositiveHelicitySum += fEvents.at(i); + } + checkhel += 1; + } else if (fHelicity[i] == minushel) { + if (localdebug) std::cout<<"QwHelicityPattern::CalculateAsymmetry:: here filling fNegativeHelicitySum \n"; + if (firstminushel) { + if (localdebug) std::cout<<"QwHelicityPattern::CalculateAsymmetry:: with = \n"; + fNegativeHelicitySum = fEvents.at(i); + firstminushel = kFALSE; + } else { + if (localdebug) std::cout<<"QwHelicityPattern::CalculateAsymmetry:: with += \n"; + fNegativeHelicitySum += fEvents.at(i); + } + checkhel -= 1; + } else { + QwError<< "QwHelicityPattern::CalculateAsymmetry ==" + << "Helicity should be "< 1){ + for (size_t i = 1; i < (size_t) fPatternSize/2 ; i++){ + fPositiveHelicitySum += fEvents.at(i); + fNegativeHelicitySum += fEvents.at(fPatternSize/2 +i); + } + } + fAlternateDiff.ClearEventData(); + fAlternateDiff.Difference(fPositiveHelicitySum,fNegativeHelicitySum); + // Do not blind this helicity-uncorrelated difference. + fAsymmetry1.Ratio(fAlternateDiff,fYield); + // fAsymmetry2: (even events - odd events)/fYield + // Only build fAsymmetry2 if fPatternSize>2. + if (fPatternSize > 2) { + fPositiveHelicitySum.ClearEventData(); + fNegativeHelicitySum.ClearEventData(); + fPositiveHelicitySum = fEvents.at(0); + fNegativeHelicitySum = fEvents.at(1); + if (fPatternSize/2 > 1){ + for (size_t i = 1; i < (size_t) fPatternSize/2 ; i++){ + fPositiveHelicitySum += fEvents.at(2*i); + fNegativeHelicitySum += fEvents.at(2*i + 1); + } + } + fAlternateDiff.ClearEventData(); + fAlternateDiff.Difference(fPositiveHelicitySum,fNegativeHelicitySum); + // Do not blind this helicity-uncorrelated difference. + fAsymmetry2.Ratio(fAlternateDiff,fYield); + } + } + + // Accumulate the burst and running sums + if (fEnableBurstSum) AccumulateBurstSum(); + if (fEnableRunningSum) { + AccumulateRunningSum(); + } + + if (localdebug) QwDebug << " pattern number =" << fQuartetNumber << QwLog::endl; + } + + return; +}; + + +void QwHelicityCorrelatedFeedback::AccumulateRunningSum(){ + Bool_t bXDiff=kFALSE; + Bool_t bXPDiff=kFALSE; + Bool_t bYDiff=kFALSE; + Bool_t bYPDiff=kFALSE; + Bool_t b3C12XDiff=kFALSE; + Bool_t b3C12YDiff=kFALSE; + Bool_t b3C12YQ=kFALSE; + + + + + QwHelicityPattern::AccumulateRunningSum(); + + if(fAsymmetry.RequestExternalValue("sca_bcm", &fScalerCharge)){ + //fScalerChargeRunningSum.PrintValue(); + //fScalerChargeRunningSum.AccumulateRunningSum(fScalerCharge); + if (fScalerCharge.GetEventcutErrorFlag()==0 && fAsymmetry.GetEventcutErrorFlag()==0){ + fScalerChargeRunningSum.AccumulateRunningSum(fScalerCharge); + fHAGoodPatternCounter++;//update the good HA asymmetry counter + } + }else{ + QwError << " Could not get external value setting parameters to sca_bcm" <3){ + QwError << " Could not get external value setting parameters to q_targ" <3){ + QwError << " Hall A Mode is out of bound " << mode <<" mode<0 || mode>3 "< &values){ + QwHelicityPattern::ConstructBranchAndVector(tree,prefix,values); +}; + +void QwHelicityCorrelatedFeedback::FillTreeVector(std::vector &values) const{ + QwHelicityPattern::FillTreeVector(values); +}; + + +TString QwHelicityCorrelatedFeedback::GetHalfWavePlateState() +{ + TString plate_status = gSystem->GetFromPipe("caget -t -w 0.1 IGL1I00DI24_24M"); + return plate_status; +}; + +UInt_t QwHelicityCorrelatedFeedback::GetHalfWavePlate2State(){ + TString ihwp2_value = gSystem->GetFromPipe("caget -tf0 -w 0.1 IGL1I00DIOFLRD"); + UInt_t ihwp2 =ihwp2_value.Atoi(); + + if (ihwp2>10000) + return 1;//13056=IN + else + return 0; //8960=OUT +}; + +void QwHelicityCorrelatedFeedback::CheckFeedbackStatus() +{ + Double_t old_status = 0.0; + old_status = fEPICSCtrl.Get_FeedbackStatus(); + if(old_status == 1.0) { + // EPIC says, feedback is on, but we start it now. + // qwfeedback was killed by "kill -9 option" or was ended improperly. + fEPICSCtrl.Set_FeedbackStatus(0.0); + fFeedbackStatus=kFALSE; + gSystem->Sleep(4000); // wait 4 secs + } + fEPICSCtrl.Set_FeedbackStatus(1.0); + fFeedbackStatus=kTRUE; +} diff --git a/src/cfSockCli.c b/src/cfSockCli.c new file mode 100644 index 000000000..e25203208 --- /dev/null +++ b/src/cfSockCli.c @@ -0,0 +1,443 @@ + +/* cfSockCli - send requests to server over a TCP socket + for configuration utility */ +/* + DESCRIPTION + This file contains the client-side of the VxWorks TCP example code. +*/ + +/* includes */ + +#include +#include +#include +#include +#include +#include + +#include + + +#include "cfSockCli.h" + + +static int gSocketFd; /* socket file descriptor */ +static int gSocketKeepOpen = 0; /* indicator to keep the socket open: + 0 means close it right away; + 1 means keep it open + */ + +/**************************************************************************** + * + * cfSockCli - send requests to server over a TCP socket for configuration utility + * + * This routine connects over a TCP socket to a server, and sends a + * user-provided message to the server. Optionally, this routine + * waits for the server's reply message. + * + * This routine may be invoked as follows: + * -> cfSockCli "remoteSystem" + * Message to send: + * Hello out there + * Would you like a reply (Y or N): + * y + * value = 0 = 0x0 + * -> MESSAGE FROM SERVER: + * Server received your message + * + * RETURNS: OK, or ERROR if the message could not be sent to the server. +*/ + + +int cfSockCliOpen (int crate_number, int keepopen); +int cfSockCliSend (int crate_number, struct request *myRequest, + struct request *serverReply); +int cfSockCliClose(); + + +int cfSockCli ( + int crate_number, /* which crate to address */ + struct request *myRequest, /* request to send to server */ + struct request *serverReply /* reply from server */ + ) +{ + int status; + + // printf("cfSockCli: gSocketKeepOpen=%d\n",gSocketKeepOpen); + // if (gSocketKeepOpen==0){ + if (1==1){ + status = cfSockCliOpen(crate_number, 0); + if (status == SOCK_OK) { + status = cfSockCliSend(crate_number, myRequest, serverReply); + if (status == SOCK_OK) { + status = cfSockCliClose(); + } + } + } else { + status = cfSockCliSend(crate_number, myRequest, serverReply); + } + return status; +} + + + +int cfSockCliOpen (int crate_number, int keepopen) { + struct sockaddr_in serverAddr; /* server's socket address */ + int sockAddrSize; /* size of socket address structure */ + char optval; + char * servername; + + /* printf("cfSockCliOpen: gSocketKeepOpen=%d; keepopen=%d\n", + gSocketKeepOpen, keepopen); + */ + + gSocketKeepOpen = 0; + /* create client's socket */ + switch (crate_number) { + case Crate_CountingHouse: + servername = ServerName_CountingHouse; + break; + case Crate_LeftSpect: + servername = ServerName_LeftSpect; + break; + case Crate_RightSpect: + servername = ServerName_RightSpect; + break; + case Crate_Injector: + servername = ServerName_Injector; + break; + case Crate_Qwvmets: + servername = ServerName_QwTSCrate; + break; + + default: + return (SOCK_ERROR); + } + + if ((gSocketFd = socket (PF_INET, SOCK_STREAM, 0)) == SOCK_ERROR) + { + perror ("socket"); + return (SOCK_ERROR); + } + + optval = 1; + int test = 0; + test = setsockopt ( gSocketFd, IPPROTO_TCP, TCP_NODELAY, + (char *) &optval, + 4 ); /* black magic from Chowdhary's code */ + + + test = setsockopt(gSocketFd, SOL_SOCKET, SO_REUSEADDR, &optval, sizeof(optval)); + + /* bind not required - port number is dynamic */ + /* build server socket address */ + + sockAddrSize = sizeof (struct sockaddr_in); + bzero ((char *) &serverAddr, sockAddrSize); + serverAddr.sin_family = PF_INET; + serverAddr.sin_port = htons (SERVER_PORT_NUM); + + if ((serverAddr.sin_addr.s_addr = inet_addr (servername)) == SOCK_ERROR) + { + perror ("unknown server name"); + close (gSocketFd); + return (SOCK_ERROR); + } + + /* connect to server */ + if (connect (gSocketFd, (struct sockaddr *) &serverAddr, sockAddrSize) == SOCK_ERROR) + { + perror ("connect"); + close (gSocketFd); + return (SOCK_ERROR); + } + gSocketKeepOpen = keepopen; + return (SOCK_OK); +}; + +int cfSockCliSend ( + int crate_number, /* which crate to address */ + struct request *myRequest, /* request to send to server */ + struct request *serverReply /* reply from server */ + ) +{ + int nWrite; + int i, j; + int keepopen = gSocketKeepOpen; + + /* printf("cfSockCliSend: gSocketKeepOpen=%d; keepopen=%d\n", + gSocketKeepOpen, keepopen); + */ + + gSocketKeepOpen = 0; + /* + buildRequestInteractive(myRequest); + printf("\n"); + printf("your command type will be: %d \n",ntohl(myRequest->command_type)); + printf("your command will be: %d \n",ntohl(myRequest->command)); + printf("your magic_cookie will be: %d \n",ntohl(myRequest->magic_cookie)); + printf("your request param_1 will be: %d \n",ntohl(myRequest->par1)); + printf("your request param_2 will be: %d \n",ntohl(myRequest->par2)); + */ + + /* send request to server */ + nWrite = send (gSocketFd, (char *) myRequest, sizeof (*myRequest), 0); + if ( nWrite != sizeof(*myRequest) ) + { + printf ( "cfSockCli WARN: nWrite = %d, sizeof (*myRequest) = %d\n", + nWrite, sizeof (*myRequest) ); + perror ("Connection aborted on error"); + close(gSocketFd); + return (SOCK_ERROR); + } + + if (myRequest->reply) /* if expecting reply, read and display it */ + { + i = recv ( gSocketFd, (char *) serverReply, sizeof(*serverReply), 0 ); + + if ( i == SOCK_ERROR ) + { + perror ("Error reading result\n"); + return (SOCK_ERROR); + } + /* The reason this while loop exists is that there + * is a remote possibility of the above recv returning + * less than sizeof(*serverReply) bytes. This is because a recv returns + * as soon as there is some data, and will not wait for + * all of the requested data to arrive. Since sizeof(*serverReply) bytes + * is relatively small compared to the allowed TCP + * packet sizes, a partial receive is unlikely. If + * the reply size were 2048 bytes instead, + * a partial receive would be far more likely. + * This loop will keep receiving until all sizeof(*serverReply) bytes + * have been received, thus guaranteeing that the + * next recv at the top of the loop will start at + * the beginning of the next reply. + */ + while ( i < sizeof(*serverReply) ) { + j = recv( gSocketFd, ((char *) serverReply)+i, sizeof(*serverReply)-i, 0 ); + if ( j == SOCK_ERROR ) + { + perror ("Error reading result\n"); + close(gSocketFd); + return (SOCK_ERROR); + } + i += j; + } + // handleReplyInteractive(serverReply); + } + gSocketKeepOpen = keepopen; + /* printf("cfSockCliSend: End; gSocketKeepOpen=%d\n", gSocketKeepOpen); */ + return (SOCK_OK); +}; + +int cfSockCliClose() +{ + gSocketKeepOpen = 0; + close (gSocketFd); + /* printf("cfSockCliClose: gSocketKeepOpen=%d\n", gSocketKeepOpen); */ + return (SOCK_OK); +} + +/* + + main (int argc, char *argv[]) + { + long command = 1, par1 = 1, par2 = 1; + char *reply="Y"; + char *msg = "one"; + cfSockCommand(Crate_CountingHouse,command,par1,par2,reply,msg); + printf ("MESSAGE FROM SERVER: <%s> \n", msg); + printf("Server reply command: %d \n",command); + printf("Server reply param_1: %d \n",par1); + printf("Server reply param_2: %d \n\n",par2); + } + main (int argc, char *argv[]) + { + struct request myRequest; // request to send to server + struct request serverReply; // reply from server + + + // cfSockCli("129.57.164.13"); + buildRequestInteractive(&myRequest); + printf("\n"); + printf("your command will be: %d \n",ntohl(myRequest.command)); + printf("your magic_cookie will be: %d \n",ntohl(myRequest.magic_cookie)); + printf("your request param_1 will be: %d \n",ntohl(myRequest.par1)); + printf("your request param_2 will be: %d \n",ntohl(myRequest.par2)); + + cfSockCli(Crate_CountingHouse, &myRequest,&serverReply); + + if (myRequest.reply) // if expecting reply, read and display it + handleReplyInteractive(&serverReply); + + } +*/ + +int cfSockCommand(int crate_number, + long command_type, long command, + long req_param, long req_param_2, + char *reply, char *msg ) +{ + struct request myRequest; // request to send to server + struct request serverReply; // reply from server + int mlen; + int errFlag; + // char *reply = "Y"; + + myRequest.command_type = htonl(command_type); + myRequest.command = htonl(command); + myRequest.magic_cookie = htonl(MAGIC_COOKIE); + myRequest.par1 = htonl(req_param); + myRequest.par2 = htonl(req_param_2); + switch (*reply) + { + case 'y': + case 'Y': myRequest.reply = TRUE; + break; + default: myRequest.reply = FALSE; + break; + } + mlen = strlen(msg); + strncpy(myRequest.message,msg,REQUEST_MSG_SIZE); + myRequest.msgLen = htonl(mlen); + myRequest.message[mlen] = '\0'; + + // printf("\n"); + // printf ("Message to send: <%s> \n",myRequest.message); + // printf("your command type will be: %d \n",ntohl(myRequest.command_type)); + // printf("your command will be: %d \n",ntohl(myRequest.command)); + // printf("your request param_1 will be: %d \n",ntohl(myRequest.par1)); + // printf("your request param_2 will be: %d \n",ntohl(myRequest.par2)); + // printf("Requested reply? : %s \n",reply); + // printf("\n"); + + errFlag = cfSockCli(crate_number,&myRequest,&serverReply); + if (errFlag != SOCK_OK) return errFlag; + + // if expecting reply, read and display it + if (myRequest.reply) { + msg = strcpy(serverReply.message,serverReply.message); + command_type = htonl(serverReply.command_type); + command = htonl(serverReply.command); + req_param = htonl(serverReply.par1); + req_param_2 = htonl(serverReply.par2); + // printf ("MESSAGE FROM SERVER:\n%s\n", msg); + // printf("Server reply command: %d \n",command); + // printf("Server reply param_1: %d \n",req_param); + // printf("Server reply param_2: %d \n\n",req_param_2); + // handleReplyInteractive(&serverReply); + } + return errFlag; +} + +int GreenSockCommand(int crate_number, struct greenRequest *gRequest) +{ + struct request myRequest; // request to send to server + struct request serverReply; // reply from server + // char *reply; + int mlen; + int errFlag; + + // char *reply = "Y"; + + myRequest.command_type = htonl(gRequest->command_type); + myRequest.command = htonl(gRequest->command); + myRequest.magic_cookie = htonl(MAGIC_COOKIE); + myRequest.par1 = htonl(gRequest->par1); + myRequest.par2 = htonl(gRequest->par2); + + switch (*(gRequest->reply)) + { + case 'y': + case 'Y': myRequest.reply = TRUE; + break; + default: myRequest.reply = FALSE; + break; + } + mlen = strlen(gRequest->message); + strncpy(myRequest.message,gRequest->message,REQUEST_MSG_SIZE); + myRequest.msgLen = htonl(mlen); + myRequest.message[mlen] = '\0'; + + // printf("\n"); + // printf ("Message to send: <%s> \n",myRequest.message); + // printf("your command will be: %d \n",ntohl(myRequest.command)); + // printf("your request param_1 will be: %d \n",ntohl(myRequest.par1)); + // printf("your request param_2 will be: %d \n",ntohl(myRequest.par2)); + // printf("Requested reply? : %s \n",gRequest->reply); + // printf("\n"); + + errFlag = cfSockCli(crate_number, &myRequest,&serverReply); + + if (errFlag != SOCK_OK) return errFlag; + + // if expecting reply, read and display it + if (myRequest.reply) { + // gRequest->message = strcpy(serverReply.message,serverReply.message); + strcpy(gRequest->message,serverReply.message); + gRequest->command_type = htonl(serverReply.command_type); + gRequest->command = htonl(serverReply.command); + gRequest->par1 = htonl(serverReply.par1); + gRequest->par2 = htonl(serverReply.par2); + + // printf ("cfSockCli: MESSAGE FROM SERVER: %s\n", gRequest->message); + // printf("Server reply command: %d \n",gRequest->command); + // printf("Server reply param_1: %d \n",gRequest->req_param); + // printf("Server reply param_2: %d \n\n",gRequest->req_param_2); + // handleReplyInteractive(&serverReply); + } + return errFlag; +} + + +void buildRequestInteractive(struct request *myRequest) { + /* build request, prompting user for message */ + int mlen; /* length of message */ + char reply; /* if TRUE, expect reply back */ + + printf ("Message to send: \n"); + mlen = read (STD_IN, myRequest->message, REQUEST_MSG_SIZE); + myRequest->msgLen = htonl(mlen); + myRequest->message[mlen - 1] = '\0'; + + myRequest->command_type = htonl(1); + printf("your command type will be: %d \n",ntohl(myRequest->command_type)); + myRequest->command = htonl(10); + printf("your command will be: %d \n",ntohl(myRequest->command)); + myRequest->magic_cookie = htonl(MAGIC_COOKIE); + printf("your magic_cookie will be: %d \n",ntohl(myRequest->magic_cookie)); + myRequest->par1 = htonl(1); + printf("your request param_1 will be: %d \n",ntohl(myRequest->par1)); + myRequest->par2 = htonl(2); + printf("your request param_2 will be: %d \n",ntohl(myRequest->par2)); + + + printf ("Would you like a reply (Y or N): \n"); + read (STD_IN, &reply, 1); + switch (reply) + { + case 'y': + case 'Y': myRequest->reply = TRUE; + break; + default: myRequest->reply = FALSE; + break; + } +} + +void handleReplyInteractive(struct request *serverReply) { + /* build request, prompting user for message */ + printf ("MESSAGE FROM SERVER:\n%s\n", serverReply->message); + printf("Server reply command type: %d \n",ntohl(serverReply->command_type)); + printf("Server reply command: %d \n",ntohl(serverReply->command)); + printf("Server reply param_1: %d \n",ntohl(serverReply->par1)); + printf("Server reply param_2: %d \n",ntohl(serverReply->par2)); + printf("Server reply msgLen: %d \n",ntohl(serverReply->msgLen)); +} + + + + + + + From d83fd7b948e8a2b54a1cc5477a310a5e4047b3eb Mon Sep 17 00:00:00 2001 From: Ciprian Gal Date: Wed, 10 Oct 2018 09:50:28 -0400 Subject: [PATCH 002/137] test macro for directory structure. #31 --- rootScripts/pedestal/hello.C | 3 +++ 1 file changed, 3 insertions(+) create mode 100644 rootScripts/pedestal/hello.C diff --git a/rootScripts/pedestal/hello.C b/rootScripts/pedestal/hello.C new file mode 100644 index 000000000..b7355cf55 --- /dev/null +++ b/rootScripts/pedestal/hello.C @@ -0,0 +1,3 @@ +void hello(){ + cout<<"Hello"< Date: Wed, 17 Oct 2018 03:47:44 -0400 Subject: [PATCH 003/137] First commit --- rootScripts/pedestal/GetPedestal_injector.C | 190 ++++++++++++++++++++ 1 file changed, 190 insertions(+) create mode 100644 rootScripts/pedestal/GetPedestal_injector.C diff --git a/rootScripts/pedestal/GetPedestal_injector.C b/rootScripts/pedestal/GetPedestal_injector.C new file mode 100644 index 000000000..a410dbb26 --- /dev/null +++ b/rootScripts/pedestal/GetPedestal_injector.C @@ -0,0 +1,190 @@ +// jaPAN Macro Script - BPM Pedestal Scan for injector +void GetPedestal_injector(int run_num = 1, TString user_cut ="1",Double_t lowcurrent=0){ + gROOT->SetStyle("Plain"); + // define style here + // general parameters + gStyle->SetOptDate(0); + gStyle->SetStatColor(10); + gStyle->SetStatH(0.2); + gStyle->SetStatW(0.3); + gStyle->SetOptStat(0); + gStyle->SetOptFit(1011); + gStyle->SetStatX(0.7); + gStyle->SetStatY(0.9); + // canvas parameters + gStyle->SetFrameBorderMode(0); + gStyle->SetFrameBorderSize(0); + // pads parameters + gStyle->SetPadColor(39); + gStyle->SetPadColor(0); + gStyle->SetPadBorderMode(0); + gStyle->SetPadBorderSize(0); + gStyle->SetPadBottomMargin(0.15); + gStyle->SetPadRightMargin(0.01); + gStyle->SetPadLeftMargin(0.15); + gStyle->SetLabelSize(0.035,"x"); + gStyle->SetLabelSize(0.035,"y"); + gStyle->SetTitleSize(0.06,"hxyz"); + gROOT->ForceStyle(); + + TString rf_name =Form("../rootfiles/prexinj_%d.root",run_num); + TFile *rootfile = TFile::Open(rf_name); + TTree *mps = rootfile->Get("Mps_Tree"); + + user_cut += "&& cleandata"; + + // Extract scandata1 + mps->Draw("scandata1>>htemp",user_cut.Data(),"goff"); + int nbinx = (int)htemp->GetXaxis()->GetXmax(); + + vector vec_scandata; + TH1D *hsd = new TH1D("hsd","scan data",nbinx,-0.5,nbinx-0.5); + mps->Draw("scandata1>>hsd",user_cut.Data(),"goff"); + int bin_content; + double bin_center; + for(int ibin=0;ibinGetBinContent(ibin+1); // Histogram bin number starts from 1 + if(bin_content>0){ + bin_center = hsd->GetBinCenter(ibin+1); + vec_scandata.push_back(bin_center); + } + } + const int ndata = vec_scandata.size(); + int ndata_fit = 0; // number of scandata points used for fitting + double scandata[ndata]; + double scandata_error[ndata]; + for(int i=0; i lowcurrent) + ndata_fit++; + } + int startpt = ndata - ndata_fit; //starting point in a data array for fitting + + // BPM device array for injector data, August 2018 + const int nBPM=21; + TString device_name[nBPM]={"0i01a","1i04", //ADC0 + "1i02","0i01", //ADC1 + "1i06","0i02", // ADC2 + "0i02a","0i05", //ADC3 + "0i07","0l01", // ADC4 + "0l02","0l03", //ADC5 + "0l04","0l05", //ADC6 + "0l06","0l07", //ADC7 + "0l08","0l09", //ADC8 + "0l10","2i02", //ADC9 + "2i01"}; //ADC10 + + TString ch_name[4]={"XP","XM","YP","YM"}; + + TCanvas *c_fit = new TCanvas("c_fit","c_fit",800,800); + c_fit->Divide(2,2); + + TCanvas *c_res = new TCanvas("c_res","c_res",800,800); + c_res->Divide(2,2); + + TF1 *f_zero = new TF1("f_zero","0",0,100); + f_zero->SetLineWidth(2); + f_zero->SetLineColor(kRed); + f_zero->SetLineStyle(9); + + TString branch_name; + TString num_samples_name; + + TString my_cut; // cut for extracting each scan data point + + double adc_mean[4][ndata]; + double adc_error[4][ndata]; + double adc_res[4][ndata]; // residual + + TString gfit_title[4]; + TString gres_title[4]; + TF1 *f_fit; + TH1D *h_stat; + double ped[nBPM][4]; + double slope[nBPM][4]; + + TGraphErrors *g_res[4]; + TGraphErrors *g_fit[4]; + TGraphErrors *g_res_ref[4]; + TGraphErrors *g_fit_ref[4]; + TMultiGraph *mg_res[4]; + TMultiGraph *mg_fit[4]; + + for(int ibpm=0;ibpm%f && ",scandata[i]+0.5,scandata[i]-0.5); + my_cut += user_cut; + mps->Draw(Form("%s>>h_bpm%d_%d_%d",branch_name.Data(),ibpm,ich,i), + my_cut.Data(),"goff"); + h_stat =(TH1D*)gDirectory->FindObject(Form("h_bpm%d_%d_%d",ibpm,ich,i)); + adc_mean[ich][i] = h_stat->GetMean(); + adc_error[ich][i] = h_stat->GetRMS()/TMath::Sqrt(h_stat->GetEntries()); + } + c_fit->cd(ich+1); + + mg_fit[ich] = new TMultiGraph(); + g_fit[ich] = new TGraphErrors(ndata-startpt,scandata+startpt,adc_mean[ich]+startpt,scandata_error+startpt,adc_error[ich]+startpt); + g_fit_ref[ich] = new TGraphErrors(startpt,scandata,adc_mean[ich],scandata_error,adc_error[ich]); + g_fit[ich]->SetMarkerStyle(20); + g_fit_ref[ich]->SetMarkerStyle(24); + + mg_fit[ich]->Add(g_fit[ich]); + mg_fit[ich]->Add(g_fit_ref[ich]); + mg_fit[ich]->Draw("AP"); + gfit_title[ich] = Form("%s;scandata1; Raw ADC",branch_name.Data()); + mg_fit[ich]->SetTitle(gfit_title[ich].Data()); + + g_fit[ich]->Fit("pol1","Q"); + f_fit = g_fit[ich]->GetFunction("pol1"); + f_fit->SetLineColor(kRed); + f_fit->SetRange(scandata[0]*0.9,scandata[ndata-1]*1.1); + f_fit->Draw("same"); + ped[ibpm][ich] = f_fit->GetParameter(0); + slope[ibpm][ich] = f_fit->GetParameter(1); + + for(int i=0;icd(ich+1); + mg_res[ich] = new TMultiGraph(); + g_res[ich] = new TGraphErrors(ndata-startpt,scandata+startpt,adc_res[ich]+startpt,scandata_error+startpt,adc_error[ich]+startpt); + g_res_ref[ich] = new TGraphErrors(startpt,scandata,adc_res[ich],scandata_error,adc_error[ich]); + g_res[ich]->SetMarkerStyle(20); + g_res_ref[ich]->SetMarkerStyle(24); + mg_res[ich]->Add(g_res[ich]); + mg_res[ich]->Add(g_res_ref[ich]); + mg_res[ich]->Draw("AP"); + gres_title[ich] = Form("%s;scandata1; Residual ",branch_name.Data()); + mg_res[ich]->SetTitle(gres_title[ich].Data()); + f_zero->SetRange(scandata[0]*0.9,scandata[ndata-1]*1.1); + f_zero->Draw("same"); + } + c_fit->SaveAs(Form("run%d_bpm%s_ped_fit.pdf",run_num,device_name[ibpm].Data())); + c_res->SaveAs(Form("run%d_bpm%s_ped_res.pdf",run_num,device_name[ibpm].Data())); + } + gSystem->Exec(Form("pdfunite *bpm*fit.pdf run%d_fit.pdf",run_num)); + gSystem->Exec(Form("pdfunite *bpm*res.pdf run%d_res.pdf",run_num)); + gSystem->Exec("rm *bpm*.pdf"); + + FILE *mapfile; + mapfile = fopen(Form("prexinj_beamline_pedestal.%d.map",run_num),"w"); + + for(int ibpm=0;ibpmClose(); +} From f6595912c151ee778ca581c46fb5124a17d8be6c Mon Sep 17 00:00:00 2001 From: Your Name Date: Tue, 23 Oct 2018 22:20:58 -0400 Subject: [PATCH 004/137] Adding in the counting house, and making a stab at some new naming conventions - unfortunately I am just copying these things straight from the injector configuration and trying to match, so a lot of things (like the names of the channels) are going to be incorrect for now. - ble = beam line element, i.e. an unknown physical ADC channel - bpmsee = SEE bpm - bpmcav = Cavity bpm - bcm = BCM --- Parity/prminput/prexCH_beamline.map | 64 +++++++++++ Parity/prminput/prexCH_beamline_eventcuts.map | 100 ++++++++++++++++++ Parity/prminput/prexCH_beamline_geometry.map | 57 ++++++++++ Parity/prminput/prexCH_beamline_pedestal.map | 12 +++ Parity/prminput/prexCH_detectors.map | 12 +++ Parity/prminput/prexCH_helicity.map | 83 +++++++++++++++ 6 files changed, 328 insertions(+) create mode 100644 Parity/prminput/prexCH_beamline.map create mode 100644 Parity/prminput/prexCH_beamline_eventcuts.map create mode 100644 Parity/prminput/prexCH_beamline_geometry.map create mode 100644 Parity/prminput/prexCH_beamline_pedestal.map create mode 100644 Parity/prminput/prexCH_detectors.map create mode 100644 Parity/prminput/prexCH_helicity.map diff --git a/Parity/prminput/prexCH_beamline.map b/Parity/prminput/prexCH_beamline.map new file mode 100644 index 000000000..572bf1d34 --- /dev/null +++ b/Parity/prminput/prexCH_beamline.map @@ -0,0 +1,64 @@ + +ROC=23 +MarkerWord=0xff902902 +!!!Bank=0x3102 +!same sample size for ADCs in a given bank +sample_size=464 +!Sample size should be unchanged - ask Paul King +! +! module.type, module.num chan.num, det.type, det.name, if unrotated then last column ->UNROTATED + + +!ADC0 + VQWK, 0, 0, ble, q_0_0 + VQWK, 0, 1, ble, q_0_1 + VQWK, 0, 2, bcm, cm_us + VQWK, 0, 3, bcm, cm_ds + VQWK, 0, 4, ble, q_0_4 + VQWK, 0, 5, ble, q_0_5 + VQWK, 0, 6, ble, q_0_6 + VQWK, 0, 7, ble, q_0_7 + +!ADC1 + VQWK, 1, 0, bpmsee, QWK_1I02XP, UNROTATED + VQWK, 1, 1, bpmsee, QWK_1I02XM, UNROTATED + VQWK, 1, 2, bpmsee, QWK_1I02YP, UNROTATED + VQWK, 1, 3, bpmsee, QWK_1I02YM, UNROTATED + VQWK, 1, 4, ble, QWK_1I04XP, UNROTATED + VQWK, 1, 5, ble, QWK_1I04XM, UNROTATED + VQWK, 1, 6, ble, QWK_1I04YP, UNROTATED + VQWK, 1, 7, ble, QWK_1I04YM, UNROTATED + +!ADC2 + VQWK, 2, 0, ble, QWK_1I06XP, UNROTATED + VQWK, 2, 1, ble, QWK_1I06XM, UNROTATED + VQWK, 2, 2, ble, QWK_1I06YP, UNROTATED + VQWK, 2, 3, ble, QWK_1I06YM, UNROTATED + VQWK, 2, 4, bpmsee, QWK_0I02XP, UNROTATED + VQWK, 2, 5, bpmsee, QWK_0I02XM, UNROTATED + VQWK, 2, 6, bpmsee, QWK_0I02YP, UNROTATED + VQWK, 2, 7, bpmsee, QWK_0I02YM, UNROTATED + +!ADC3 + VQWK, 3, 0, bpmcav, QWK_0I02AXP, UNROTATED + VQWK, 3, 1, bpmcav, QWK_0I02AXM, UNROTATED + VQWK, 3, 2, bpmcav, QWK_0I02AYP, UNROTATED + VQWK, 3, 3, ble, QWK_0I02AYM, UNROTATED + VQWK, 3, 4, bpmcav, QWK_0I05XP, UNROTATED + VQWK, 3, 5, bpmcav, QWK_0I05XM, UNROTATED + VQWK, 3, 6, bpmcav, QWK_0I05YP, UNROTATED + VQWK, 3, 7, ble, QWK_0I05YM, UNROTATED + +!ADC4 + VQWK, 4, 0, bpmcav, QWK_0I07XP, UNROTATED + VQWK, 4, 1, bpmcav, QWK_0I07XM, UNROTATED + VQWK, 4, 2, bpmcav, QWK_0I07YP, UNROTATED + VQWK, 4, 3, ble, QWK_0I07YM, UNROTATED + VQWK, 4, 4, ble, QWK_0L01XP + VQWK, 4, 5, ble, QWK_0L01XM + VQWK, 4, 6, ble, QWK_0L01YP + VQWK, 4, 7, ble, QWK_0L01YM + + +[PUBLISH] + q_targ, bcm, qwk_bcm0l02, c diff --git a/Parity/prminput/prexCH_beamline_eventcuts.map b/Parity/prminput/prexCH_beamline_eventcuts.map new file mode 100644 index 000000000..b92e41436 --- /dev/null +++ b/Parity/prminput/prexCH_beamline_eventcuts.map @@ -0,0 +1,100 @@ + +!This file contains beamline event cut properties last updated 10/27/2009 based on run 752/755 + +!********************************************************************************************* +!Global switch to turn ON and OFF eventcut check +!Available settings +!*************************************************** +!To turn OFF all checks +! EVENTCUTS = 0 + +!*************************************************** +!To turn OFF event cuts and perform only HW checks +!EVENTCUTS = 1 + +!*************************************************** +!To turn ON both event cuts and HW checks +! EVENTCUTS = 2 + +!*************************************************** +!To turn do both event cuts and HW checks and only flag event cut failed events +EVENTCUTS = 3 + +!IMPORTANT +!--------- +!Make sure when puting tabs in the map file entries, always put ", " before inserting a tab. +!Otherwise the routine QwParameterFile::GetNextToken(", ") will get confuse. + +!*************************************************** +!for bcm devices +!device_type, device_name, lower limit, upper limit, local(l)/global(g), stability percentage + +bcm, qwk_bcm0l02, 1, 1000000, l, 0 +!bcm, empty1, -2.420e+6, -2.390e+6 +!bcm, empty1, 0, 0, 1, 0 +!bcm, empty2, 0, 0, 1, 0 + +!bcm, qwk_batext1, 0, 0, 1, 0 + +!bcm, qwk_batext2, 0, 0, 1, 0 +!for 752 & 755 +!for parity mock data run 1000 9.98608e+06 +!bcm, qwk_bcm0l03, 8.00e+06, 1.20e+07, 1, 0 + + +!bcm, qwk_batery6, 0, 0, 1, 0 +!bcm, qwk_batery7, 95.57778e+9, 95.5788e+9, 1, 0 +!bcm, phasemonitor, 0, 0, 1, 0 + +!**************************************************** +!for bpmstrpline devices +!device_type, device_name, channel_name, lower limit, upper limit +!channel_name can be relx, rely, absx, absy, wsum, xp, xm, yp, ym +!Cuts are applied after the VQwSubsystem::ProcessEvent() routine. +!So pedestals are applied before appyling the cuts. + +!device_type, device_name, channel_name, lower limit, upper limit, local(l)/global(g), stability percentage + +!bpmstripline, qwk_qpd, relx, 2.67319, 4.45531 +!bpmstripline, qwk_qpd, rely, 1.31491, 2.19152 + +!bpmstripline, qwk_1i02, absx, 10, 100000, l, 0 +!bpmstripline, qwk_1i02, xp, 1, 3, l, 0 +!bpmstripline, qwk_1i02, yp, 10, 20, l, 0 +!bpmstripline, qwk_1i04, relx, 0, 0, l, 0 +!bpmstripline, qwk_1i06, relx, 0, 0, l, 0 +!bpmstripline, qwk_0i02, relx, 0, 0, l, 0 +!bpmstripline, qwk_0i02a, relx, 0, 0, l, 0 +!bpmstripline, qwk_0i05, relx, 0, 0, l, 0 +!bpmstripline, qwk_0i07, relx, 0, 0, l, 0 +!bpmstripline, qwk_0l01, relx, 0, 0, l, 0 +!bpmstripline, qwk_0l02, relx, 0, 0, l, 0 +!bpmstripline, qwk_0l03, relx, 0, 0, l, 0 +!bpmstripline, qwk_0l04, relx, 0, 0, l, 0 +!bpmstripline, qwk_0l05, relx, 0, 0, l, 0 +!bpmstripline, qwk_0l06, relx, 0, 0, l, 0 +!bpmstripline, qwk_0l07, relx, 0, 0, l, 0 +!bpmstripline, qwk_0l08, relx, 0, 0, l, 0 +!bpmstripline, qwk_0l09, relx, 0, 0, l, 0 +!bpmstripline, qwk_0l1, relx0, 0, 0, l, 0 +!bpmstripline, qwk_0r01, relx, 0, 0, l, 0 +!bpmstripline, qwk_0r02, relx, 0, 0, l, 0 +!bpmstripline, qwk_0r05, relx, 0, 0, l, 0 +!bpmstripline, qwk_0r06, relx, 0, 0, l, 0 + + + +!This file contains beamline event cut properties + +!IMPORTANT +!--------- +!Make sure when puting tabs in the map file entries, always put ", " before inserting a tab. +!Otherwise the routine QwParameterFile::GetNextToken(", ") will extract the entry with the tab character. + +!Comments +!-------- +!Devices that are not in the list are not subjected event cut checks +!All devices will be tested for HW checks. +! +!For device_type =bcm only upper and lower limit of the calibrated charge on the ADC HW sum. (QwVQWK_Channel::fHardwareBlockSum) + diff --git a/Parity/prminput/prexCH_beamline_geometry.map b/Parity/prminput/prexCH_beamline_geometry.map new file mode 100644 index 000000000..26835304a --- /dev/null +++ b/Parity/prminput/prexCH_beamline_geometry.map @@ -0,0 +1,57 @@ +!************************************************************************** +! Geometry information for the BPMs in injector beamline. +!************************************************************************** +! +! X/Yoffset - The difference in the ideal position and the surveyed position of a BPM in X/Y axis. +! +! Z offset - The location of the BPM in the hallC beamline (alog Z axis) from the begining of the beamline +! to the center of the device/ origin of device coordinate system. +! +! BSEN scaling factor - Bpm SENsitivity scaling factor is the ratio of general BSEN = 18.81 adc counts/mm +! seen in most of the BPMs in the injector and the actual BSEN of a BPM. +! Almost all the BPMs in the injector beamline except 1I02,1I04,1I06,0I01,0I01A.0I02,0I02A,0I05,0I07 +! who has BSEN=13.7 adc counts/mm +! So we use this factor to apply such changes. +! +! AlphaX/Y - Relative gains of the individual XM,YM pairs compared to XP,YP pairs. +! +! The units of the offsets are in millemeters to be comparable with the units of the anaysis results. +! +! BSEN, ALPHAX and ALPHA Y were obtained from EPICS. +! +! For BPMs that don't have factors or offsets given in the list below, default values will +! be assigned. +! default offset (X/Y/Z) = 0.0 +! default BSEN scaling factor = 18.81 +! default AlphaX/AlphaY = 1.0 +! +! device type, device_name, Xoffset, Yoffset, Zoffset, BSEN scaling factor, AlpaX, AlpaY +! +!!!!! BSEN scale values adapted from Caryn's pan control.db file, 2018jul26 +!!!!! 0i and 1i BPMS, BSEN scale = 13.7/18.81 = 0.728336 +!!!!! 0L and 0R BPMs, BSEN scale = 18.76/18.81 = 0.99734184 +!!!!! 2i BPMs, BSEN scale = 25.67 /18.81 = 1.3647 + + bpmstripline, bpm0I01A, 0.0, 0.0, 0.0, 0.728336, 1.000000, 1.000000 unrotated + bpmstripline, bpm1I04, 0.0, 0.0, 0.0, 0.728336, 1.000000, 1.000000 unrotated + bpmstripline, bpm1I02, 0.0, 0.0, 0.0, 0.728336, 1.000000, 1.000000 unrotated + bpmstripline, bpm0I01, 0.0, 0.0, 0.0, 0.728336, 1.000000, 1.000000 unrotated + bpmstripline, bpm1I06, 0.0, 0.0, 0.0, 0.728336, 1.000000, 1.000000 unrotated + bpmstripline, bpm0I02, 0.0, 0.0, 0.0, 0.728336, 1.000000, 1.000000 unrotated + bpmstripline, bpm0I02A, 0.0, 0.0, 0.0, 0.728336, 1.000000, 1.000000 unrotated + bpmstripline, bpm0I05, 0.0, 0.0, 0.0, 0.728336, 1.000000, 1.000000 unrotated + bpmstripline, bpm0I07, 0.0, 0.0, 0.0, 0.728336, 1.000000, 1.000000 unrotated + bpmstripline, bpm0L01, 0.0, 0.0, 0.0, 0.99734184 1.000000, 1.000000 + bpmstripline, bpm0L02, 0.0, 0.0, 0.0, 0.99734184 1.000000, 1.000000 + bpmstripline, bpm0L03, 0.0, 0.0, 0.0, 0.99734184 1.000000, 1.000000 + bpmstripline, bpm0L04, 0.0, 0.0, 0.0, 0.99734184 1.000000, 1.000000 + bpmstripline, bpm0L05, 0.0, 0.0, 0.0, 0.99734184 1.000000, 1.000000 + bpmstripline, bpm0L06, 0.0, 0.0, 0.0, 0.99734184 1.000000, 1.000000 + bpmstripline, bpm0L07, 0.0, 0.0, 0.0, 0.99734184 1.000000, 1.000000 + bpmstripline, bpm0L08, 0.0, 0.0, 0.0, 0.99734184 1.000000, 1.000000 + bpmstripline, bpm0L09, 0.0, 0.0, 0.0, 0.99734184 1.000000, 1.000000 + bpmstripline, bpm0L10, 0.0, 0.0, 0.0, 0.99734184 1.000000, 1.000000 + bpmstripline, bpm2I02, 0.0, 0.0, 0.0, 1.3647, 1.000000, 1.000000 unrotated + bpmstripline, bpm2I01, 0.0, 0.0, 0.0, 1.3647, 1.000000, 1.000000 unrotated + +!END diff --git a/Parity/prminput/prexCH_beamline_pedestal.map b/Parity/prminput/prexCH_beamline_pedestal.map new file mode 100644 index 000000000..a0af6f9fd --- /dev/null +++ b/Parity/prminput/prexCH_beamline_pedestal.map @@ -0,0 +1,12 @@ +! Pedestal file of run 2205 +! adc sample size 468 +! curent range in calibration 90 to 155 +! fit is linear +! date of analysis =Tue Feb 22 19:02:59 2011 +! The pedestal run was taken with F2 cup inserted. +! Therefore only bpms up to 0i05 have the correct pedestals +! for this high current calibration. +!---- +!bpm1i02XP , 1204.2 , 1. +!END + diff --git a/Parity/prminput/prexCH_detectors.map b/Parity/prminput/prexCH_detectors.map new file mode 100644 index 000000000..dbd1ea082 --- /dev/null +++ b/Parity/prminput/prexCH_detectors.map @@ -0,0 +1,12 @@ +# This is an example of a detector definition file. + +[QwBeamLine] + name = CountingHouse + map = prexCH_beamline.map + geom = prexCH_beamline_geometry.map + eventcut = prexCH_beamline_eventcuts.map + param = prexCH_beamline_pedestal.map + +[QwHelicity] + name = Helicity info + map = prexCH_helicity.map diff --git a/Parity/prminput/prexCH_helicity.map b/Parity/prminput/prexCH_helicity.map new file mode 100644 index 000000000..fd97d3c16 --- /dev/null +++ b/Parity/prminput/prexCH_helicity.map @@ -0,0 +1,83 @@ +!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! +!! input file for decoding the helicity subsystem +!! Of note in this file: +!! HelicityDecodingMode : will tell which mode of decoding is in use +!! : for now it can be InputRegisterMode, UserbitMode +!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + +!Injector data during happex data taking: run 12331, 12354, 12356 +!HelicityDecodingMode=InputRegisterMode +!PatternPhase=4 +!ROC=23 +! +! Header=0xfdacf000 +! HAPPEX BMW words +!SKIP 148 +!WORD, 0, 0, helicitydata, ha_cleandata +!WORD, 0, 0, helicitydata, ha_scandata1 +! +!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! +!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! +!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + +!INPUT REGISTER MODE +HelicityDecodingMode=InputRegisterMode + +! Set the patternPhase (number of windows in a pattern) for each run range. +! If patternPhase!=4, then also set the NumberPatternsDelayed +! so the reported helicity is delayed by 8 windows (default 2). +!NumberPatternsDelayed=4 +PatternPhase=4 + + + +!Need to set PATTERNPHASEOFFSET = 1 (when pattern phase starts with 1) or 0 (when pattern phase starts with 0) +!default value for PATTERNPHASEOFFSET = 1 is set within the code itself which works fine with regular injector/beamline/parity mock data +!uncomment below line only if phase number start from 0 +PATTERNPHASEOFFSET=0 + + +!seed size is either 24 bit or 30 bit. default is 30 bit +!RandSeedBits=24 + +ROC=24 +MarkerWord=0x00003103 + +! +! module.type, module.num chan.num, det.type, det.name +! +WORD, 0, 0, helicitydata, input_register +WORD, 0, 0, helicitydata, output_register +SKIP 1 ! WORD, 0, 0, helicitydata, sca_MPS_num +SKIP 1 ! WORD, 0, 0, helicitydata, sca_PAT_counter +SKIP 1 ! WORD, 0, 0, helicitydata, sca_PAT_phase +SKIP 3 +WORD, 0, 0, helicitydata, cleandata +WORD, 0, 0, helicitydata, scandata1 +WORD, 0, 0, helicitydata, scandata2 +SKIP 1 +!END +! +!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! +!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! +!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + +!USER BIT MODE + +!HelicityDecodingMode= UserbitMode +!PatternPhase=4 +!seed size is either 24 bit or 30 bit. default is 24 bit +!RandSeedBits=24 +!RandSeedBits=30 +!ROC=31 +!Bank=0x3101 +! +! module.type, module.num chan.num, det.type, det.name +! +!WORD, 0, 0, helicitydata, cleandata +!WORD, 0, 0, helicitydata, scandata1 +!WORD, 0, 0, helicitydata, scandata2 +!WORD, 0, 0, helicitydata, scalerheader +!WORD, 0, 0, helicitydata, scalercounter +!WORD, 0, 0, helicitydata, userbit +!END From d9a569118ccaa872ce8d97b5c15fd5cec8648b15 Mon Sep 17 00:00:00 2001 From: Paul King Date: Fri, 2 Nov 2018 14:02:57 -0400 Subject: [PATCH 005/137] Merged the "new" DataHandler classes from the branch "pking.merging_anik_mrvallee" on git@github.com:paulmking/QwAnalysis, starting from the initial commit of the QwAnalysis framework into JAPAN. Started from the HEAD of the master branch on my fork of JAPAN, then: git checkout -b pking.merge_from_QwAna_2 d45b477d008d15caf77a8cda1521ea96f9eece95 git checkout -b tmp git merge -s ours simpletest_for_Moller_anik git merge pking.merging_anik_mrvallee git checkout pking.merge_from_QwAna_2 git merge --squash tmp For the full history, see https://github.com/paulmking/QwAnalysis/tree/pking.merging_anik_mrvallee --- Analysis/include/QwControl.h | 2 - Analysis/include/QwDBInterface.h | 255 +++ Analysis/include/QwDatabase.h | 5 +- Analysis/include/QwF1TDContainer.h | 17 +- Analysis/include/QwPromptSummary.h | 15 +- Analysis/include/QwRootFile.h | 4 +- Analysis/include/QwSIS3320_Samples.h | 4 +- Analysis/include/QwScaler_Channel.h | 1 + Analysis/include/QwSubsystemArray.h | 5 +- Analysis/include/VQwSubsystem.h | 18 +- Analysis/main/QwRoot.cc | 4 +- Analysis/prminput/EpicsTable.13337-14699.map | 722 ++++++++ Analysis/prminput/EpicsTable.14700-.map | 721 ++++++++ Analysis/prminput/EpicsTable.15178-.map | 731 ++++++++ Analysis/prminput/EpicsTable.map | 720 ++++++++ Analysis/src/QwControl.cc | 2 - Analysis/src/QwDBInterface.cc | 200 ++ Analysis/src/QwEPICSEvent.cc | 5 +- Analysis/src/QwF1TDContainer.cc | 6 +- Analysis/src/QwOptions.cc | 10 +- Analysis/src/QwParameterFile.cc | 4 +- Analysis/src/QwPromptSummary.cc | 5 +- Analysis/src/QwRunCondition.cc | 14 +- Analysis/src/QwSIS3320_Samples.cc | 2 +- Analysis/src/QwScaler_Channel.cc | 1 + Analysis/src/VQwSubsystem.cc | 17 +- CMakeLists.txt | 182 +- GNUmakefile | 95 +- Parity/include/LRBCorrector.h | 73 + Parity/include/LinReg_Bevington_Pebay.h | 78 + Parity/include/QwBeamLine.h | 4 +- Parity/include/QwBeamMod.h | 2 + ...rMainDetector.h => QwBlindDetectorArray.h} | 40 +- Parity/include/QwBlinder.h | 5 +- Parity/include/QwCombiner.h | 89 + ...ssionSubsystem.h => QwCombinerSubsystem.h} | 72 +- Parity/include/QwCorrelator.h | 79 + Parity/include/QwDetectorArray.h | 246 +++ Parity/include/QwHelicity.h | 2 +- Parity/include/QwHelicityPattern.h | 38 +- Parity/include/QwIntegratedRaster.h | 2 + Parity/include/QwLumi.h | 193 -- Parity/include/QwMainCerenkovDetector.h | 6 +- Parity/include/QwOptionsParity.h | 27 +- Parity/include/QwParityDB.h | 4 + Parity/include/QwParitySSQLS.h | 2 + Parity/include/QwRegression.h | 138 -- Parity/include/QwSubsystemArrayParity.h | 5 + Parity/include/QwkRegBlueCorrelator.h | 49 + Parity/include/VQwDataHandler.h | 88 + Parity/main/QwMockDataAnalysis.cc | 6 +- Parity/main/QwMockDataGenerator.cc | 8 +- Parity/main/QwParity.cc | 108 +- Parity/prminput/blueReg.conf | 251 +++ Parity/prminput/mock_detectors.map | 2 +- Parity/prminput/qwparity_simple.conf | 2 +- Parity/prminput/regression_new.map | 64 + Parity/src/LRBCorrector.cc | 238 +++ Parity/src/LinReg_Bevington_Pebay.cc | 359 ++++ Parity/src/QwBeamLine.cc | 23 +- Parity/src/QwBeamMod.cc | 5 +- Parity/src/QwBlindDetectorArray.cc | 1624 +++++++++++++++++ Parity/src/QwBlinder.cc | 23 +- Parity/src/QwCombinedBPM.cc | 12 - Parity/src/QwCombiner.cc | 571 ++++++ Parity/src/QwCombinerSubsystem.cc | 262 +++ Parity/src/QwCorrelator.cc | 308 ++++ ...llerMainDetector.cc => QwDetectorArray.cc} | 264 ++- Parity/src/QwHelicity.cc | 5 +- Parity/src/QwHelicityPattern.cc | 32 +- Parity/src/QwIntegratedRaster.cc | 4 + Parity/src/QwLumi.cc | 1402 -------------- Parity/src/QwMainCerenkovDetector.cc | 7 +- Parity/src/QwRegression.cc | 720 -------- Parity/src/QwRegressionSubsystem.cc | 262 --- Parity/src/QwkRegBlueCorrelator.cc | 256 +++ Parity/src/VQwDataHandler.cc | 333 ++++ SetupFiles/make_SET_ME_UP | 88 +- bin/pullgitinfo.py | 67 + cmake/modules/FindMYSQLPP.cmake | 4 +- cmake/modules/FindROOT.cmake | 9 +- evio/Makefile | 5 +- 82 files changed, 9171 insertions(+), 3162 deletions(-) create mode 100644 Analysis/include/QwDBInterface.h create mode 100644 Analysis/prminput/EpicsTable.13337-14699.map create mode 100644 Analysis/prminput/EpicsTable.14700-.map create mode 100644 Analysis/prminput/EpicsTable.15178-.map create mode 100644 Analysis/prminput/EpicsTable.map create mode 100644 Analysis/src/QwDBInterface.cc create mode 100644 Parity/include/LRBCorrector.h create mode 100644 Parity/include/LinReg_Bevington_Pebay.h rename Parity/include/{MollerMainDetector.h => QwBlindDetectorArray.h} (91%) create mode 100644 Parity/include/QwCombiner.h rename Parity/include/{QwRegressionSubsystem.h => QwCombinerSubsystem.h} (58%) create mode 100644 Parity/include/QwCorrelator.h create mode 100644 Parity/include/QwDetectorArray.h delete mode 100755 Parity/include/QwLumi.h delete mode 100755 Parity/include/QwRegression.h create mode 100644 Parity/include/QwkRegBlueCorrelator.h create mode 100644 Parity/include/VQwDataHandler.h create mode 100644 Parity/prminput/blueReg.conf create mode 100644 Parity/prminput/regression_new.map create mode 100644 Parity/src/LRBCorrector.cc create mode 100644 Parity/src/LinReg_Bevington_Pebay.cc create mode 100644 Parity/src/QwBlindDetectorArray.cc create mode 100644 Parity/src/QwCombiner.cc create mode 100644 Parity/src/QwCombinerSubsystem.cc create mode 100644 Parity/src/QwCorrelator.cc rename Parity/src/{MollerMainDetector.cc => QwDetectorArray.cc} (83%) delete mode 100755 Parity/src/QwLumi.cc delete mode 100755 Parity/src/QwRegression.cc delete mode 100755 Parity/src/QwRegressionSubsystem.cc create mode 100644 Parity/src/QwkRegBlueCorrelator.cc create mode 100644 Parity/src/VQwDataHandler.cc create mode 100755 bin/pullgitinfo.py diff --git a/Analysis/include/QwControl.h b/Analysis/include/QwControl.h index 7a4137c72..c99de122e 100755 --- a/Analysis/include/QwControl.h +++ b/Analysis/include/QwControl.h @@ -43,9 +43,7 @@ class QwControl : public VQwSystem { void SetIsFinished (bool finished) { fIsFinished = finished; }; bool IsFinished () { return fIsFinished; }; - #if ROOT_VERSION_CODE < ROOT_VERSION(5,90,0) ClassDef(QwControl,1) - #endif }; #endif // __QwControl_h__ diff --git a/Analysis/include/QwDBInterface.h b/Analysis/include/QwDBInterface.h new file mode 100644 index 000000000..452590813 --- /dev/null +++ b/Analysis/include/QwDBInterface.h @@ -0,0 +1,255 @@ +/* + * QwDBInterface.h + * + * Created on: Dec 14, 2010 + * Author: jhlee + */ + +#ifndef QWDBINTERFACE_H_ +#define QWDBINTERFACE_H_ + +// System headers +#include +#include +#include +#include +#include + +// ROOT headers +#include "Rtypes.h" +#include "TString.h" + +// Qweak headers +#include "QwLog.h" +//#include "QwParityDB.h" + +// Forward declarations +class QwParityDB; + +// QwDBInterface GetDBEntry(TString subname); + +// I extend a DB interface for QwIntegrationPMT to all subsystem, +// because the table structure are the same in the lumi_data table, +// the md_data table, and the beam table of MySQL database. +// Now every device-specified action will be done in +// the FillDB(QwParityDB *db, TString datatype) of QwBeamLine, +// QwMainCerenkovDetector, and QwLumi class. + +class QwDBInterface { + public: + enum EQwDBIDataTableType{kQwDBI_OtherTable, kQwDBI_BeamTable, + kQwDBI_MDTable, kQwDBI_LumiTable}; + private: + static std::map fPrefix; + + UInt_t fAnalysisId; + UInt_t fDeviceId; + UInt_t fSubblock; + UInt_t fN; + Double_t fValue; + Double_t fError; + Char_t fMeasurementTypeId[4]; + + TString fDeviceName; + + private: + template + T TypedDBClone(); + + public: + static TString DetermineMeasurementTypeID(TString type, TString suffix = "", + Bool_t forcediffs = kFALSE); + + public: + + QwDBInterface() + : fAnalysisId(0),fDeviceId(0),fSubblock(0),fN(0),fValue(0.0),fError(0.0) { + std::strcpy(fMeasurementTypeId, "");fDeviceName =""; + } + virtual ~QwDBInterface() { } + + void SetAnalysisID(UInt_t id) {fAnalysisId = id;}; + void SetDetectorName(TString &in) {fDeviceName = in;}; + void SetDeviceID(UInt_t id) {fDeviceId = id;}; + void SetMonitorID(QwParityDB *db); + void SetMainDetectorID(QwParityDB *db); + void SetLumiDetectorID(QwParityDB *db); + EQwDBIDataTableType SetDetectorID(QwParityDB *db); + void SetMeasurementTypeID(const TString& in) { + std::strncpy(fMeasurementTypeId, in.Data(), 3); + fMeasurementTypeId[3] = '\0'; + }; + void SetMeasurementTypeID(const char* in) { + std::strncpy(fMeasurementTypeId, in, 3); + fMeasurementTypeId[3] = '\0'; + }; + void SetSubblock(UInt_t in) {fSubblock = in;}; + void SetN(UInt_t in) {fN = in;}; + void SetValue(Double_t in) {fValue = in;}; + void SetError(Double_t in) {fError = in;}; + + TString GetDeviceName() {return fDeviceName;}; + + void Reset() { + fAnalysisId = 0; + fDeviceId = 0; + fSubblock = 0; + fN = 0; + fValue = 0.0; + fError = 0.0; + std::strcpy(fMeasurementTypeId,""); + fDeviceName = ""; + }; + + template inline + void AddThisEntryToList(std::vector &list); + + + void PrintStatus(Bool_t print_flag) { + if(print_flag) { + QwMessage << std::setw(12) + << " AnalysisID " << fAnalysisId + << " Device :" << std::setw(30) << fDeviceName + << ":" << std::setw(4) << fDeviceId + << " Subblock " << fSubblock + << " n " << fN + << " Type " << fMeasurementTypeId + << " [ave, err] " + << " [" << std::setw(14) << fValue + << "," << std::setw(14) << fError + << "]" + << QwLog::endl; + } + } +}; + +// +// Template definitions for the QwDBInterface class. +// +// + +template +inline void QwDBInterface::AddThisEntryToList(std::vector &list) +{ + Bool_t okay = kTRUE; + if (fAnalysisId == 0) { + QwError << "QwDBInterface::AddDBEntryToList: Analysis ID invalid; entry dropped" + << QwLog::endl; + okay = kFALSE; + } + if (fDeviceId == 0) { + QwError << "QwDBInterface::AddDBEntryToList: Device ID invalid; entry dropped" + << QwLog::endl; + okay = kFALSE; + } + if (okay) { + T row = TypedDBClone(); + if (row.analysis_id == 0){ + QwError << "QwDBInterface::AddDBEntryToList: Unknown list type; entry dropped" + << QwLog::endl; + okay = kFALSE; + } else { + list.push_back(row); + } + } + if (okay == kFALSE) { + PrintStatus(kTRUE); + }; +} + + + + + + +class QwErrDBInterface { + + private: + + UInt_t fAnalysisId; + UInt_t fDeviceId; + UInt_t fErrorCodeId; + UInt_t fN; + + TString fDeviceName; + + template + T TypedDBClone(); + + + public: + + QwErrDBInterface() + : fAnalysisId(0),fDeviceId(0),fErrorCodeId(0),fN(0) { + fDeviceName =""; + } + virtual ~QwErrDBInterface() { } + + void SetAnalysisID(UInt_t id) {fAnalysisId = id;}; + void SetDeviceName(TString &in) {fDeviceName = in;}; + void SetDeviceID(UInt_t id) {fDeviceId = id;}; + + void SetMonitorID(QwParityDB *db); + void SetMainDetectorID(QwParityDB *db); + void SetLumiDetectorID(QwParityDB *db); + + void SetErrorCodeId(UInt_t in) {fErrorCodeId = in;}; + void SetN(UInt_t in) {fN = in;}; + + TString GetDeviceName() {return fDeviceName;}; + + void Reset() { + fAnalysisId = 0; + fDeviceId = 0; + fErrorCodeId = 0; + fN = 0; + fDeviceName = ""; + }; + + template inline + void AddThisEntryToList(std::vector &list); + + + void PrintStatus(Bool_t print_flag) { + if(print_flag) { + QwMessage << std::setw(12) + << " AnalysisID " << fAnalysisId + << " Device :" << std::setw(30) << fDeviceName + << ":" << std::setw(4) << fDeviceId + << " ErrorCode " << fErrorCodeId + << " n " << fN + << QwLog::endl; + } + } +}; + +template +inline void QwErrDBInterface::AddThisEntryToList(std::vector &list) +{ + Bool_t okay = kTRUE; + if (fAnalysisId == 0) { + QwError << "QwErrDBInterface::AddDBEntryToList: Analysis ID invalid; entry dropped" + << QwLog::endl; + okay = kFALSE; + } + if (fDeviceId == 0) { + QwError << "QwErrDBInterface::AddDBEntryToList: Device ID invalid; entry dropped" + << QwLog::endl; + okay = kFALSE; + } + if (okay) { + T row = TypedDBClone(); + if (row.analysis_id == 0){ + QwError << "QwErrDBInterface::AddDBEntryToList: Unknown list type; entry dropped" + << QwLog::endl; + okay = kFALSE; + } else { + list.push_back(row); + } + } + if (okay == kFALSE) { + PrintStatus(kTRUE); + }; +} + +#endif /* QWDBINTERFACE_H_ */ diff --git a/Analysis/include/QwDatabase.h b/Analysis/include/QwDatabase.h index 721143dbb..f6ccf8b98 100755 --- a/Analysis/include/QwDatabase.h +++ b/Analysis/include/QwDatabase.h @@ -16,9 +16,10 @@ #include // Third Party Headers +#pragma GCC diagnostic ignored "-Wdeprecated" #include -#include "ssqls.h" - +#include +#pragma GCC diagnostic pop // ROOT headers #include "TString.h" diff --git a/Analysis/include/QwF1TDContainer.h b/Analysis/include/QwF1TDContainer.h index c8c851f50..95eea1cd5 100755 --- a/Analysis/include/QwF1TDContainer.h +++ b/Analysis/include/QwF1TDContainer.h @@ -241,9 +241,7 @@ class QwF1TDC : public TObject UInt_t GetTotal(UInt_t* error_counter); - #if ROOT_VERSION_CODE < ROOT_VERSION(5,90,0) - ClassDef(QwF1TDC,1); - #endif + ClassDef(QwF1TDC,1); }; @@ -377,9 +375,7 @@ class QwF1TDContainer : public TObject Bool_t CheckSlot20Chan30(Int_t slot, Int_t chan); - #if ROOT_VERSION_CODE < ROOT_VERSION(5,90,0) - ClassDef(QwF1TDContainer,1); - #endif + ClassDef(QwF1TDContainer,1); }; @@ -461,9 +457,7 @@ class F1TDCReferenceSignal : public TObject void Clear() { fRefTimeArbUnit = (Double_t) fNoRefTimeArbUnit; fFirstHitFlag = false;}; - #if ROOT_VERSION_CODE < ROOT_VERSION(5,90,0) - ClassDef(F1TDCReferenceSignal,1); - #endif + ClassDef(F1TDCReferenceSignal,1); }; @@ -506,9 +500,8 @@ class F1TDCReferenceContainer : public TObject private: TString fSystemName; - #if ROOT_VERSION_CODE < ROOT_VERSION(5,90,0) - ClassDef(F1TDCReferenceContainer,1); - #endif + + ClassDef(F1TDCReferenceContainer,1); }; diff --git a/Analysis/include/QwPromptSummary.h b/Analysis/include/QwPromptSummary.h index e80e7f0d5..29d2b265c 100755 --- a/Analysis/include/QwPromptSummary.h +++ b/Analysis/include/QwPromptSummary.h @@ -113,9 +113,9 @@ class PromptSummaryElement : public TObject /* Double_t fAsymmetryWidthError; */ /* TString fAsymmetryWidthUnit; */ - #if ROOT_VERSION_CODE < ROOT_VERSION(5,90,0) - ClassDef(PromptSummaryElement,0); - #endif +#if ROOT_VERSION_CODE < ROOT_VERSION(5,90,0) + ClassDef(PromptSummaryElement,0); +#endif //ROOT_VERSION_CODE < ROOT_VERSION(5,90,0) }; @@ -139,8 +139,8 @@ class QwPromptSummary : public TObject void SetRunletNumber(const Int_t in) {fRunletNumber = in;}; const Int_t GetRunletNumber() {return fRunletNumber;}; - void AddElement(PromptSummaryElement *in); + PromptSummaryElement* GetElementByName(TString name); void FillDataInElement(TString name, @@ -155,6 +155,7 @@ class QwPromptSummary : public TObject void FillDoubleDifference(TString type, TString name1, TString name2); + Int_t GetSize() const {return fNElements;}; Int_t Size() const {return fNElements;}; Int_t HowManyElements() const {return fNElements;}; @@ -179,9 +180,9 @@ class QwPromptSummary : public TObject Bool_t fLocalDebug; - #if ROOT_VERSION_CODE < ROOT_VERSION(5,90,0) - ClassDef(QwPromptSummary,0); - #endif +#if ROOT_VERSION_CODE < ROOT_VERSION(5,90,0) + ClassDef(QwPromptSummary,0); +#endif //ROOT_VERSION_CODE < ROOT_VERSION(5,90,0) }; diff --git a/Analysis/include/QwRootFile.h b/Analysis/include/QwRootFile.h index 309d95ace..9050680e3 100755 --- a/Analysis/include/QwRootFile.h +++ b/Analysis/include/QwRootFile.h @@ -4,6 +4,7 @@ // System headers #include #include +using std::type_info; // ROOT headers #include "TFile.h" @@ -38,7 +39,8 @@ class QwRootTree { /// Constructor with name, and description QwRootTree(const std::string& name, const std::string& desc, const std::string& prefix = "") - : fName(name),fDesc(desc),fPrefix(prefix),fType("type undefined"),fCurrentEvent(0) { + : fName(name),fDesc(desc),fPrefix(prefix),fType("type undefined"), + fCurrentEvent(0),fNumEventsCycle(0),fNumEventsToSave(0),fNumEventsToSkip(0) { // Construct tree ConstructNewTree(); } diff --git a/Analysis/include/QwSIS3320_Samples.h b/Analysis/include/QwSIS3320_Samples.h index 02a70ad4a..d4ccf411d 100755 --- a/Analysis/include/QwSIS3320_Samples.h +++ b/Analysis/include/QwSIS3320_Samples.h @@ -137,9 +137,9 @@ class QwSIS3320_Samples: public TObject { size_t fTreeArrayIndex; //!< Index of this data element in tree size_t fTreeArrayNumEntries; //!< Number of entries from this data element - #if ROOT_VERSION_CODE < ROOT_VERSION(5,90,0) +#if ROOT_VERSION_CODE < ROOT_VERSION(5,90,0) ClassDef(QwSIS3320_Samples,1); - #endif +#endif //ROOT_VERSION_CODE < ROOT_VERSION(5,90,0) }; // Output stream operator<< for the samples diff --git a/Analysis/include/QwScaler_Channel.h b/Analysis/include/QwScaler_Channel.h index 1b204c96e..1cd8ae5f8 100755 --- a/Analysis/include/QwScaler_Channel.h +++ b/Analysis/include/QwScaler_Channel.h @@ -53,6 +53,7 @@ class VQwScaler_Channel: public VQwHardwareChannel, public MQwMockable { }; VQwScaler_Channel(const VQwScaler_Channel& source) : VQwHardwareChannel(source),MQwMockable(source), + fValue_Raw_Old(source.fValue_Raw_Old), fValue_Raw(source.fValue_Raw), fValue(source.fValue), fValueM2(source.fValueM2), diff --git a/Analysis/include/QwSubsystemArray.h b/Analysis/include/QwSubsystemArray.h index 82b951642..4b16767a2 100755 --- a/Analysis/include/QwSubsystemArray.h +++ b/Analysis/include/QwSubsystemArray.h @@ -179,7 +179,10 @@ class QwSubsystemArray: public std::vector > { VQwHardwareChannel* ReturnInternalValueForFriends(const TString& name) const; /// Friend with regression class who needs write access to data - friend class QwRegression; + friend class QwCombiner; + // Child of QwCombiner Class + friend class QwCorrelator; + friend class VQwDataHandler; /// Published values std::map fPublishedValuesDataElement; diff --git a/Analysis/include/VQwSubsystem.h b/Analysis/include/VQwSubsystem.h index 6f3efedb0..4d3b41193 100755 --- a/Analysis/include/VQwSubsystem.h +++ b/Analysis/include/VQwSubsystem.h @@ -70,15 +70,15 @@ class VQwSubsystem: virtual public VQwSubsystemCloneable, public MQwHistograms { /// Copy constructor by object VQwSubsystem(const VQwSubsystem& orig) : MQwHistograms(orig), + fSystemName(orig.fSystemName), + fEventTypeMask(orig.fEventTypeMask), + fIsDataLoaded(orig.fIsDataLoaded), + fCurrentROC_ID(orig.fCurrentROC_ID), + fCurrentBank_ID(orig.fCurrentBank_ID), fPublishList(orig.fPublishList), fROC_IDs(orig.fROC_IDs), fBank_IDs(orig.fBank_IDs) - { - fSystemName = orig.fSystemName; - fIsDataLoaded = orig.fIsDataLoaded; - fCurrentROC_ID = orig.fCurrentROC_ID; - fCurrentBank_ID = orig.fCurrentBank_ID; - } + { } /// Default destructor virtual ~VQwSubsystem() { } @@ -157,6 +157,8 @@ class VQwSubsystem: virtual public VQwSubsystemCloneable, public MQwHistograms { virtual Int_t LoadInputParameters(TString mapfile) = 0; /// Optional geometry definition virtual Int_t LoadGeometryDefinition(TString mapfile) { return 0; }; + /// Optional crosstalk definition + virtual Int_t LoadCrosstalkDefinition(TString mapfile) { return 0; }; /// Optional event cut file virtual Int_t LoadEventCuts(TString mapfile) { return 0; }; @@ -339,10 +341,10 @@ class VQwSubsystem: virtual public VQwSubsystemCloneable, public MQwHistograms { return (typeid(*this) == typeid(*source)); } - private: + protected: // Private constructor (not implemented, will throw linker error on use) - VQwSubsystem(); + VQwSubsystem() {} }; // class VQwSubsystem diff --git a/Analysis/main/QwRoot.cc b/Analysis/main/QwRoot.cc index 179be7d2c..0ca4d3b47 100755 --- a/Analysis/main/QwRoot.cc +++ b/Analysis/main/QwRoot.cc @@ -26,7 +26,9 @@ int main(int argc, char** argv) gROOT->ProcessLine(".include " + path + "/Analysis/include"); gROOT->ProcessLine(".include " + path + "/Parity/include"); gROOT->ProcessLine(".include " + path + "/Tracking/include"); - gROOT->ProcessLine("gSystem->Load(\"libCint.so\");"); + #if ROOT_VERSION_CODE < ROOT_VERSION(6,0,0) + gROOT->ProcessLine("gSystem->Load(\"libCint.so\");"); + #endif // Run the interface qwrint->Run(); // Delete object diff --git a/Analysis/prminput/EpicsTable.13337-14699.map b/Analysis/prminput/EpicsTable.13337-14699.map new file mode 100644 index 000000000..cd23a5914 --- /dev/null +++ b/Analysis/prminput/EpicsTable.13337-14699.map @@ -0,0 +1,722 @@ +! The exclamation mark (!) is for comment in this file. +! +! 06-17-2011: added Qtor related 4 variables: qw:qt_mps_i_target,qw:qt_mps_i_set, qw:qt_mps_i_dcct, Q1HallP +! 07-08-2010: added "String" in more variables by identifying them using +! caget epicsVarName (e.g. caget QW_T_miA) in a machine where caget command can be issued. +! +! 06-28-2010: first svn commit of this table (rsubedi) +! Table for epics variables whose values can be stored in a MySQL database. +! This table has three columns. The first column is the name for an epics +! variable. The second column at the moment is just a flag to insert epics data +! in the MySQL database. The third column is related to those epics variables +! that have only string-value (e.g. the epics varaible for the half wave plate +! is IGL1I00DI24_24M and has either IN or OUT value). +! +! +!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! +! Special keywords +!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! +NominalWienAngle = 90.0 ! This ought to have been -90 for the 2-pass beam, but we started with it effectively at 90, so let's keep going like this. Note that we will need to flip it to the opposite sign for the 1-pass beam, or do something else clever. +BlinderReversalForRunTwo = 1 ! Set this to 1 to use the extra reversal for Run2. THIS IS NEEDED! +PrecessionReversal = 1 ! This is only needed for the 2-pass beam + +!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! +! NAME DB_TABLE TYPE COMMENT +!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! +QWTGTPOS slow_controls_data !Vertical position of the target +QWtgt_name slow_controls_data String ! Name of the target position +QWT_miA slow_controls_data !Temp A at manifold inlet K Cernox +QWT_moA slow_controls_data !Temp A at manifold outlet K Cernox +QWT_hxiA slow_controls_data !Temp A at heat exchanger inlet K Cernox Phytron brake +QWT_hxoA slow_controls_data !Temp A at heat exchanger outlet K Cernox Phytron home switch +QWT_piA slow_controls_data !Temp A at pump inlet K Cernox GV open switch +! slow_controls_data !GV closed switch [something to be added here] +QWT_miB slow_controls_data !Temp B at manifold inlet K Cernox Turbo status *5? +QWT_moB slow_controls_data !Temp B at manifold outlet K Cernox CCG *5? +QWT_hxiB slow_controls_data !Temp B at heat exchanger inlet K Cernox Ballast vacuum +QWT_hxoB slow_controls_data !Temp B at heat exchanger outlet K Cernox +QWT_piB slow_controls_data !Temp B at pump inlet K Cernox +QWT_ladderA slow_controls_data !Temp A on dummy tgt ladder K +QWT_USdmA slow_controls_data !Temp A on upstream dummy frame K +QWT_DSdmA slow_controls_data !Temp A on downstream dummy frame K +QWT_phytronA slow_controls_data !Temp A on Phytron motor K +QWT_tableA slow_controls_data !Temp A on Horizontal Motion table K +QWT_ladderB slow_controls_data !Temp B on dummy tgt ladder K +QWT_USdmB slow_controls_data !Temp B on upstream dummy frame K +QWT_DSdmB slow_controls_data !Temp B on downstream dummy frame K +QWT_phytronB slow_controls_data !Temp B on Phytron motor K +QWT_tableB slow_controls_data !Temp B on Horizontal Motion table K +QWT_solidA slow_controls_data !Temp A on solid target frame K +QWT_solidB slow_controls_data !Temp B on solid target frame K +QWT_spareA slow_controls_data !K +QWT_spareB slow_controls_data !K +QWT_pumpA slow_controls_data !Temp A on pump motor house K +QWT_pumpB slow_controls_data !Temp B on pump motor house K +! slow_controls_data !K [something to be added here] +QWT_4kjt slow_controls_data !Coolant Temp at outlet of 4K JT valve K Cernox +QWT_4ko slow_controls_data !Temp of returning 4K coolant K Cernox +QWT_15kjt slow_controls_data !Coolant Temp at outlet of 15K JT valve K Cernox +QWT_15ko slow_controls_data !Temp of returning 15K coolant K Cernox +QW_Pmp_TachSet slow_controls_data !Set value for pump tach Hz +QW_Pmp_VSet slow_controls_data !Set value for pump voltage Volts +QW_Pmp_I1Set slow_controls_data !Set value for pump current phase 1 Amps +QW_Pmp_I2Set slow_controls_data !Set value for pump current phase 2 Amps +QW_Pmp_I3Set slow_controls_data !Set value for pump current phase 3 Amps +QW_Pmp_TachRead slow_controls_data !Read value for pump tach Hz +QW_Pmp_VRead slow_controls_data !Read value for pump voltage Volts +QW_Pmp_I1Read slow_controls_data !Read value for pump current phase 1 Amps +QW_Pmp_I2Read slow_controls_data !Read value for pump current phase 2 Amps +QW_Pmp_I3Read slow_controls_data !Read value for pump current phase 3 Amps +QW_Pmp_Status1 slow_controls_data !Pump controller status bits +QW_Pmp_Status2 slow_controls_data !Pump controller status bits +QW_HPH_ISet slow_controls_data !High Power Heater set current limit Amps +QW_HPH_VSet slow_controls_data !High Power Heater set voltage Volts +QW_HPH_PSet slow_controls_data !High Power Heater set (calculated) power Watts +QW_HPH_IRead slow_controls_data !High Power Heater read current Amps +QW_HPH_VRead slow_controls_data !High Power Heater read voltage Volts +QW_HPH_PRead slow_controls_data !High Power Heater read power Watts +QW_HPH__PID slow_controls_data !Pid mode on or off +QW_HPH_TSet slow_controls_data !HPH set temperature K +QW_HPH_TRead slow_controls_data !HPH read/current temperature K +QW_HPH_Beam_Comp_Switch slow_controls_data !HPH beam compensation switch +QW_pbeam slow_controls_data !Calculated beam power Watts +QW_ibeam slow_controls_data !Beam current uA +QW_HPH_Pmax slow_controls_data !Maximum Heater Power W +QW_HPH_Pman slow_controls_data !smitghg Manual power setting W +QW_HPH_R slow_controls_data !Heater resistance Ohms +QW_HPH_OnOff slow_controls_data !Heater mode +QW_HPH_bmcomp1 slow_controls_data !beam compensation parameter 1 (length) cm +QW_HPH_bmcomp2 slow_controls_data !beam compensation parameter 2 (density) g/cc +QW_HPH_bmcomp3 slow_controls_data !beam compensation parameter 3 (dE/dx) MeV/g/cm^2 +QW_HPH_bmcomp4 slow_controls_data !beam compensation parameter 4 (spare) +QW_HPH_Prop slow_controls_data !PID proportinal gain (typ 600) +QW_HPH_Integ slow_controls_data !PID integral gain (typ 40) +QW_HPH_Deriv slow_controls_data !PID derivative gain (typ 0) +QW_HPH_Scan slow_controls_data !Scan time for PID (typ 1) s +QW_HPH_dmin slow_controls_data !minimum change in power per scan W +QW_HPH_dmax slow_controls_data !maximum change in power per scan W +QW_JT_4Kset slow_controls_data ! +QW_JT_4KRead slow_controls_data ! +QW_JT_4KStep slow_controls_data !4K JT Step size +QW_JT_15KSet slow_controls_data ! +QW_JT_15LRead slow_controls_data ! +QW_JT_15KStep slow_controls_data !15K JT Step size +QW_Phy_ENCSet slow_controls_data !Hor. Motion Phytron set stepper position +QW_Phy_VSet slow_controls_data !Hor. Motion Phytron set Voltage Volts +QW_Phy_ISet slow_controls_data !Hor. Motion Phytron set current Amps +QW_Phy_BrakeSet slow_controls_data !Hor. Motion Phytron set brake value +QW_Phy_ENCRead slow_controls_data !Hor. Motion Phytron read stepper position +QW_Phy_VRead slow_controls_data !Hor. Motion Phytron read Voltage Volts +QW_Phy_IRead slow_controls_data !Hor. Motion Phytron read current Amps +QW_Phy_BrakeRead slow_controls_data !Hor. Motion Phytron read brake value +QW_Phy_Prog slow_controls_data !Hor. Motion Phytron program number +QW_Phy_Out1 slow_controls_data !Hor. Motion Phytron output word 1 +QW_Phy_Out2 slow_controls_data !Hor. Motion Phytron output word 2 +QW_Phy_In1 slow_controls_data !Hor. Motion Phytron input word 1 +QW_Phy_In2 slow_controls_data !Hor. Motion Phytron input word 2 +QW_Phy_Switches slow_controls_data !Hor. Motion Phytron limit switch readback +QW_Phy_ResPos slow_controls_data !Hor. Motion resistive position readout +QW_EC5_ENCSet slow_controls_data !Lifter EC5 set stepper position +QW_EC5_VSet slow_controls_data !Lifter EC5 set Voltage Volts +QW_EC5_ISet slow_controls_data !Lifter EC5 set current Amps +QW_EC5_BrakeSet slow_controls_data !Lifter EC5 set brake value +QW_EC5_ENCRead slow_controls_data !Lifter EC5 read stepper position +QW_EC5_VRead slow_controls_data !Lifter EC5 read Voltage Volts +QW_EC5_IRead slow_controls_data !Lifter EC5 read current Amps +QW_EC5_BrakeRead slow_controls_data !Lifter EC5 read brake value +QW_EC5_Prog slow_controls_data !Lifter EC5 program number +QW_EC5_Out1 slow_controls_data !Lifter EC5 output word 1 +QW_EC5_Out2 slow_controls_data !Lifter EC5 output word 2 +QW_EC5_In1 slow_controls_data !Lifter EC5 input word 1 +QW_EC5_In2 slow_controls_data !Lifter EC5 input word 2 +QW_EC5_Switches slow_controls_data !Lifter EC5 limit switch readback +QW_EC5_AxisStatus slow_controls_data ! +QW_EC5_DriveStatus slow_controls_data ! +QW_EC5_SystemStatus slow_controls_data ! +QW_EC5_ResPos slow_controls_data !Lifter EC5 resistive position readout +QW_PT3 slow_controls_data !Gas panel pressure transducer PT3 psia +QW_PT4 slow_controls_data !Gas panel pressure transducer PT4 psia +QW_PT9 slow_controls_data !Gas panel pressure transducer PT9 psia +QW_PT7 slow_controls_data !Gas panel pressure transducer PT7 psia +QW_PT87 slow_controls_data !Gas panel pressure transducer PT87 psia +QW_PT77 slow_controls_data !Gas panel pressure transducer PT77 psia +QW_PT_Scatt_Chamber slow_controls_data !Scattering Chamber Vacuum psia +QW_PT_Scatt_Chamber_switch slow_controls_data !Scattering Chamber vacuum switch psia +HC_ValveBox_Pos slow_controls_data !Warm return valve position % open +HC_ValveBox_Temp slow_controls_data !Warm return temp K +QW_TgtX0 slow_controls_data !X (Hor) stepper pos for Tgt 0 +QW_TgtY0 slow_controls_data !Y (Ver) stepper pos for Tgt 0 +QW_TgtX1 slow_controls_data ! +QW_TgtY1 slow_controls_data ! +QW_TgtX2 slow_controls_data ! +QW_TgtY2 slow_controls_data ! +QW_TgtX3 slow_controls_data ! +QW_TgtY3 slow_controls_data ! +QW_TgtX4 slow_controls_data ! +QW_TgtY4 slow_controls_data ! +QW_TgtX5 slow_controls_data ! +QW_TgtY5 slow_controls_data ! +QW_TgtX6 slow_controls_data ! +QW_TgtY6 slow_controls_data ! +QW_TgtX7 slow_controls_data ! +QW_TgtY7 slow_controls_data ! +QW_TgtX8 slow_controls_data ! +QW_TgtY8 slow_controls_data ! +QW_TgtX9 slow_controls_data ! +QW_TgtY9 slow_controls_data ! +QW_TgtX10 slow_controls_data ! +QW_TgtY10 slow_controls_data ! +QW_TgtX11 slow_controls_data ! +QW_TgtY11 slow_controls_data ! +QW_TgtX12 slow_controls_data ! +QW_TgtY12 slow_controls_data ! +QW_TgtX13 slow_controls_data ! +QW_TgtY13 slow_controls_data ! +QW_TgtX14 slow_controls_data ! +QW_TgtY14 slow_controls_data ! +QW_TgtX15 slow_controls_data ! +QW_TgtY15 slow_controls_data ! +QW_TgtX16 slow_controls_data ! +QW_TgtY16 slow_controls_data ! +QW_TgtX17 slow_controls_data ! +QW_TgtY17 slow_controls_data ! +QW_TgtX18 slow_controls_data ! +QW_TgtY18 slow_controls_data ! +QW_TgtX19 slow_controls_data ! +QW_TgtY19 slow_controls_data ! +QW_TgtX20 slow_controls_data ! +QW_TgtY20 slow_controls_data ! +QW_TgtX21 slow_controls_data ! +QW_TgtY21 slow_controls_data ! +QW_TgtX22 slow_controls_data ! +QW_TgtY22 slow_controls_data ! +QW_TgtX23 slow_controls_data ! +QW_TgtY23 slow_controls_data ! +QW_TgtX24 slow_controls_data ! +QW_TgtY24 slow_controls_data ! +QW_TgtX25 slow_controls_data ! +QW_TgtY25 slow_controls_data ! +QW_TgtX26 slow_controls_data ! +QW_TgtY26 slow_controls_data ! +QW_Tgt_Raster0 slow_controls_data !Raster requirement for Tgt 0 +QW_Tgt_CurLim0 slow_controls_data !Beam Current Limit for Tgt 0 +QW_Tgt_Raster1 slow_controls_data ! +QW_Tgt_CurLim1 slow_controls_data ! +QW_Tgt_Raster2 slow_controls_data ! +QW_Tgt_CurLim2 slow_controls_data ! +QW_Tgt_Raster3 slow_controls_data ! +QW_Tgt_CurLim3 slow_controls_data ! +QW_Tgt_Raster4 slow_controls_data ! +QW_Tgt_CurLim4 slow_controls_data ! +QW_Tgt_Raster5 slow_controls_data ! +QW_Tgt_CurLim5 slow_controls_data ! +QW_Tgt_Raster6 slow_controls_data ! +QW_Tgt_CurLim6 slow_controls_data ! +QW_Tgt_Raster7 slow_controls_data ! +QW_Tgt_CurLim7 slow_controls_data ! +QW_Tgt_Raster8 slow_controls_data ! +QW_Tgt_CurLim8 slow_controls_data ! +QW_Tgt_Raster9 slow_controls_data ! +QW_Tgt_CurLim9 slow_controls_data ! +QW_Tgt_Raster10 slow_controls_data ! +QW_Tgt_CurLim10 slow_controls_data ! +QW_Tgt_Raster11 slow_controls_data ! +QW_Tgt_CurLim11 slow_controls_data ! +QW_Tgt_Raster12 slow_controls_data ! +QW_Tgt_CurLim12 slow_controls_data ! +QW_Tgt_Raster13 slow_controls_data ! +QW_Tgt_CurLim13 slow_controls_data ! +QW_Tgt_Raster14 slow_controls_data ! +QW_Tgt_CurLim14 slow_controls_data ! +QW_Tgt_Raster15 slow_controls_data ! +QW_Tgt_CurLim15 slow_controls_data ! +QW_Tgt_Raster16 slow_controls_data ! +QW_Tgt_CurLim16 slow_controls_data ! +QW_Tgt_Raster17 slow_controls_data ! +QW_Tgt_CurLim17 slow_controls_data ! +QW_Tgt_Raster18 slow_controls_data ! +QW_Tgt_CurLim18 slow_controls_data ! +QW_Tgt_Raster19 slow_controls_data ! +QW_Tgt_CurLim19 slow_controls_data ! +QW_Tgt_Raster20 slow_controls_data ! +QW_Tgt_CurLim20 slow_controls_data ! +QW_Tgt_Raster21 slow_controls_data ! +QW_Tgt_CurLim21 slow_controls_data ! +QW_Tgt_Raster22 slow_controls_data ! +QW_Tgt_CurLim22 slow_controls_data ! +QW_Tgt_Raster23 slow_controls_data ! +QW_Tgt_CurLim23 slow_controls_data ! +QW_Tgt_Raster24 slow_controls_data ! +QW_Tgt_CurLim24 slow_controls_data ! +QW_Tgt_Raster25 slow_controls_data ! +QW_Tgt_CurLim25 slow_controls_data ! +QW_Tgt_Raster26 slow_controls_data ! +QW_Tgt_CurLim26 slow_controls_data ! +QW_ResEncX slow_controls_data !ADC value of horizontal resistive encoder +QW_ResEncY slow_controls_data !ADC value of vertical resistive encoder +QW_ResEnc_TgtX0 slow_controls_data !Resistive Encoder X (Hor) for Tgt 0 +QW_ResEnc_TgtY0 slow_controls_data !Resistive Encoder Y (Ver) for Tgt 0 +QW_ResEnc_TgtX1 slow_controls_data ! +QW_ResEnc_TgtY1 slow_controls_data ! +QW_ResEnc_TgtX2 slow_controls_data ! +QW_ResEnc_TgtY2 slow_controls_data ! +QW_ResEnc_TgtX3 slow_controls_data ! +QW_ResEnc_TgtY3 slow_controls_data ! +QW_ResEnc_TgtX4 slow_controls_data ! +QW_ResEnc_TgtY4 slow_controls_data ! +QW_ResEnc_TgtX5 slow_controls_data ! +QW_ResEnc_TgtY5 slow_controls_data ! +QW_ResEnc_TgtX6 slow_controls_data ! +QW_ResEnc_TgtY6 slow_controls_data ! +QW_ResEnc_TgtX7 slow_controls_data ! +QW_ResEnc_TgtY7 slow_controls_data ! +QW_ResEnc_TgtX8 slow_controls_data ! +QW_ResEnc_TgtY8 slow_controls_data ! +QW_ResEnc_TgtX9 slow_controls_data ! +QW_ResEnc_TgtY9 slow_controls_data ! +QW_ResEnc_TgtX10 slow_controls_data ! +QW_ResEnc_TgtY10 slow_controls_data ! +QW_ResEnc_TgtX11 slow_controls_data ! +QW_ResEnc_TgtY11 slow_controls_data ! +QW_ResEnc_TgtX12 slow_controls_data ! +QW_ResEnc_TgtY12 slow_controls_data ! +QW_ResEnc_TgtX13 slow_controls_data ! +QW_ResEnc_TgtY13 slow_controls_data ! +QW_ResEnc_TgtX14 slow_controls_data ! +QW_ResEnc_TgtY14 slow_controls_data ! +QW_ResEnc_TgtX15 slow_controls_data ! +QW_ResEnc_TgtY15 slow_controls_data ! +QW_ResEnc_TgtX16 slow_controls_data ! +QW_ResEnc_TgtY16 slow_controls_data ! +QW_ResEnc_TgtX17 slow_controls_data ! +QW_ResEnc_TgtY17 slow_controls_data ! +QW_ResEnc_TgtX18 slow_controls_data ! +QW_ResEnc_TgtY18 slow_controls_data ! +QW_ResEnc_TgtX19 slow_controls_data ! +QW_ResEnc_TgtY19 slow_controls_data ! +QW_ResEnc_TgtX20 slow_controls_data ! +QW_ResEnc_TgtY20 slow_controls_data ! +QW_ResEnc_TgtX21 slow_controls_data ! +QW_ResEnc_TgtY21 slow_controls_data ! +QW_ResEnc_TgtX22 slow_controls_data ! +QW_ResEnc_TgtY22 slow_controls_data ! +QW_ResEnc_TgtX23 slow_controls_data ! +QW_ResEnc_TgtY23 slow_controls_data ! +QW_ResEnc_TgtX24 slow_controls_data ! +QW_ResEnc_TgtY24 slow_controls_data ! +QW_ResEnc_TgtX25 slow_controls_data ! +QW_ResEnc_TgtY25 slow_controls_data ! +QW_ResEnc_TgtX26 slow_controls_data ! +QW_ResEnc_TgtY26 slow_controls_data ! +CFI6731C slow_controls_data !15k Flow g/s +CTD673 slow_controls_data !15K Supply temp at ESR K +CPI673 slow_controls_data !15K Supply pressure at ESR atm +CTD9541 slow_controls_data !20K return temp at ESR K +CPI9541 slow_controls_data !20K return pressure at ESR atm +haCryo_15K_Total_F slow_controls_data !sum of Hall A and Hall C 15K flows g/s +CFI60DLP slow_controls_data !"dirty flowrate" at ESR (warm return) g/s +CTD6614 slow_controls_data !Hall A 15K supply temp K +CFI6711C slow_controls_data !4k Flow g/s +CTD671SC slow_controls_data !4K Supply temp at ESR K +CPI671SC slow_controls_data !4K Supply pressure at ESR atm +CTD672 slow_controls_data !5K return temp at ESR K +CPI672 slow_controls_data !5K return pressure at ESR atm +QWBCM1 slow_controls_data !Beam current in Hall C uA +QWBCM2 slow_controls_data !Beam current in Hall C uA +QWBCM3 slow_controls_data !Beam current in Hall C uA +QWBCM4 slow_controls_data !Beam current in Hall C uA +QWGV_Status slow_controls_data !Status bits of the gate valves +QWHPHIset slow_controls_data !Max Heater Current Set +QWHPHIDACset slow_controls_data !Max Current DAC Set +QWHPHVDACset slow_controls_data !Voltage DAC Set +QWHPHManual slow_controls_data !Manual power setting +QWHPHAuto slow_controls_data !auto power setting +QWHPHheat_pid.ORBV slow_controls_data !Cur Pos +QWHPHheat_pid.OVAL slow_controls_data !Cur Out +QWHPHheat_pid.CVAL slow_controls_data !Cur Inp +QWHPHheat.pidS slow_controls_data !Output +QWHPHheat_pid_VAL slow_controls_data !Set Value +QWHPHmode_bypass.VAL slow_controls_data !Heater mode +QWheat_tot slow_controls_data !Total Power +QWbeam_heat slow_controls_data !Beam Power +! +! The following list of injector/source related Epics variables was provided by Riad Suleiman. +! +VWienAngle slow_controls_data !Vertical Wien Angle +MWF1I04.BDL slow_controls_data !Vertical Wien BDL (G-cm) +IGL1I00OD16_4 polarized_source String !Vertical Wien HV Polarity (on/off) +IGL1I00DAC6 slow_controls_data !Vertical Wien Electrode Voltage +Phi_FG slow_controls_data !Solenoids Angle (Phi_FG) +MFG1I04A.BDL slow_controls_data !First Solenoid BDL (G-cm) +MFG1I04B.BDL slow_controls_data !Second Solenoid BDL (G-cm) +HWienAngle slow_controls_data !Horizontal Wien Angle +MWF0I02.BDL slow_controls_data !Horizontal Wien BDL (G-cm) +IGL1I00OD16_9 slow_controls_data !Horizontal Wien HV Polarity +IGL1I00DAC5 slow_controls_data !Horizontal Wien Electrode Voltage +psub_aa_pos slow_controls_data !Hall A Laser Attenuator (Hall A Laser Attenuator Setting) -- +IGL1I00OD16_16 polarized_source String !IHWP: Insertible Beam Half-wave plate Set(off=out) +IGL1I00DI24_24M polarized_source String !Beam Half-wave plate Read(off=out) () -- +psub_pl_pos slow_controls_data !Rotating waveplate (Rotatable Half Wave Plate Setting) -- +IGLdac3:ao_7 slow_controls_data !IA Cell Setpoint Hall A +IGL1I00AI20 slow_controls_data !IA Cell Setpoint Hall B +IGLdac3:ao_4 slow_controls_data !IA Cell Setpoint Hall C +IGLdac3:ao_5 slow_controls_data !PZT X Setpoint Hall A +IGLdac3:ao_6 slow_controls_data !PZT Y Setpoint Hall A +IGLdac3:ao_0 slow_controls_data !PZT X Setpoint Common (X PZT Voltage ) -- +IGLdac3:ao_1 slow_controls_data !PZT Y Setpoint Common (Y PZT Voltage V) -- +IGLdac2:G2Ch3Pos slow_controls_data !Gun2: PC (PITA) POS +IGLdac2:G2Ch4Neg slow_controls_data !Gun2: PC (PITA) NEG +IGL1I00OD16_8 polarized_source String !Pockels Cell ON/OFF +cdipc_xpos slow_controls_data !Pockels Cell X Stage +cdipc_ypos slow_controls_data !Pockels Cell Y Stage +psub_cx_pos slow_controls_data !Wafer X Stage (X laser position on cathode) -- +psub_cy_pos slow_controls_data !Wafer Y Stage (Y laser position on cathode) -- +SMRPOSA slow_controls_data !Hall A Slit Position (Hall A Chopper Slit Readback) -- +HELCLOCKs slow_controls_data !Helicity Clock Set (result: Free Clock) +HELDELAYs polarized_source String !Helicity Delay Set (result: 8 windows) +HELPATTERNs polarized_source String !Helicity Pattern Set (has a value such as Quartet) +HELCLOCKd slow_controls_data !Helicity Clock Read (result: Free Clock) +HELTSETTLEd slow_controls_data !Helicity Settle Read +HELTSTABLEd slow_controls_data !Helicity Stable Read +HELDELAYd polarized_source String !Helicity Delay Read (result: 8 windows) +HELPATTERNd polarized_source String !Helicity Pattern Read (has a value such as Quartet) +HELFREQ slow_controls_data !Helicity Frequency +! +! The following list is already in the MySql database +! +HC:qint_period slow_controls_data !Charge asymmetry sampling period +laser_a_wavelength slow_controls_data !Hall A laser wavelength nm +HC:0L03_WSUM slow_controls_data !0L03 Charge Asymmetry 4 Wire Sum +! +! psub_cx_pos slow_controls_data !laser position on cathode [already in Riad's list above] +! +SMRPOSB slow_controls_data !Hall B Chopper Slit Readback +R00PGSET slow_controls_data !Prebuncher Setting +IGLdac2:scale_6.A slow_controls_data !Hall B TACO Voltage V +IGL1I00AI27 slow_controls_data !Hall A IA Voltage V +laser_c_wavelength slow_controls_data !Hall C laser wavelength nm +HC:1I04_XDIF slow_controls_data !1I04 X Difference +IGL1I00AI17 slow_controls_data !Dummy Helicity Pockels Cell Voltage V +HC:0L02_DWSUM slow_controls_data !Error on 0L02 Charge Asymmetry 4 Wire Sum +HC:DX_DIF slow_controls_data !dX on X Position Difference to MCC +SMRPOSC slow_controls_data !Hall C Chopper Slit Readback +R00PGMEST slow_controls_data !Prebuncher Setting dB +HC:1I04_DXDIF slow_controls_data !Error on 1I04 X Difference +HC:Q_ASY slow_controls_data !Charge Asymmetry to MCC ppm +HC:1I04_DWSUM slow_controls_data !Error on 1I04 Charge Asymmetry 4 Wire Sum +WienAngle slow_controls_data !Wien Filter Angle Setting degrees +itov2out slow_controls_data !A2 Slit Setting +HC:QPD_XDIF slow_controls_data !QPD X Difference +EHCFR_LIPRC polarized_source !String !Master Focus Location: 1=G0, 0=Pivot +HC:0L02_WSUM slow_controls_data !0L02 Charge Asymmetry 4 Wire Sum +HC:1I04_DYDIF slow_controls_data !Error on 1I04 Y Difference +hel_mag_status.D slow_controls_data !Integrated helicity bit difference +IBCxxxxCRCUR4 slow_controls_data !Hall C MPS BCM Current uA +scaler_calc1 slow_controls_data !Hall B Beam Current (Faraday Cup) nA +! +!psub_cy_pos slow_controls_data !Y laser position on cathode [already in Riad's list above] +! +itov5out slow_controls_data !A3 Slit Setting +IGL1I00DAC3 slow_controls_data !Hall B Seed Level +osc_jitter slow_controls_data !Hall A Laser Phase Jitter +HC:QPD_DWSUM slow_controls_data !Error on QPD Charge Asymmetry 4 Wire Sum +IGL1I00AI24 slow_controls_data !IA Voltage V +HC:P_ONOFF polarized_source String !enable/disable position feedback (ON/OFF) +HC:QPD_WSUM slow_controls_data !QPD Charge Asymmetry 4 Wire Sum +itov7out slow_controls_data !A4 Slit Setting +HC:0L03_DXDIF slow_controls_data !Error on 0L03 X Difference +hallb_transmission slow_controls_data !Hall B Independent Transmission % +! +!SMRPOSA slow_controls_data !Hall A Chopper Slit Readback [already in Riad's list above] +! +HC:0L03_YDIF slow_controls_data !0L03 Y Difference +HC:IBCM_DQASY slow_controls_data !Error on Injector BCM Charge Asymmetry +HC:1I06_DWSUM slow_controls_data !Error on 1I06 Charge Asymmetry 4 Wire Sum +HC:X_DIF slow_controls_data !X Position Difference to MCC +HC:0I05_YDIF slow_controls_data !0I05 Y Difference +IGL1I00DAC2 slow_controls_data !Hall B Control Level +HC:1I06_DXDIF slow_controls_data !Error on 1I06 X Difference +HC:0I05_DWSUM slow_controls_data !Error on 0I05 Charge Asymmetry 4 Wire Sum +HC:QPD_DYDIF slow_controls_data !Error on QPD Y Difference +HC:1I06_WSUM slow_controls_data !1I06 Charge Asymmetry 4 Wire Sum +psub_ab_pos slow_controls_data !Hall B Laser Attenuator Setting +HC:0I05_DYDIF slow_controls_data !Error on 0I05 Y Difference +! +!psub_pl_pos slow_controls_data !Rotatable Half Wave Plate Setting [already in Riad's list above] +! +hallc_photocurrent slow_controls_data !Hall C photocurrent uA +HC:0L02_DYDIF slow_controls_data !Error on 0L02 Y Difference +hac_bcm_average slow_controls_data !Hall A (?) BCM Current uA +ISL0I04DT polarized_source !Master Slit Setting (string value: IN) +IPM2C24A.IENG slow_controls_data !Hall B Beam Current (2C24A) +IBCxxxxCRCUR2 slow_controls_data !Hall A MPS BCM Current uA +HC:0I05_XDIF slow_controls_data !0I05 X Difference +HC:1I02_DYDIF slow_controls_data !Error on 1I02 Y Difference +HC:1I02_DXDIF slow_controls_data !Error on 1I02 X Difference +IGL1I00AI25 slow_controls_data !Hall A X PZT Voltage V +HC:QPD_YDIF slow_controls_data !QPD Y Difference +HC:DY_DIF slow_controls_data !dY on Y Position Difference to MCC +HC:QPD_DXDIF slow_controls_data !Error on QPD X Difference +IGL1I00AI8 slow_controls_data !Gun 2 PITA Voltage Negative V +itov1out slow_controls_data !A1 Slit Setting +qe_halla slow_controls_data !Hall A Quantum Efficiency % +HC:1I02_DWSUM slow_controls_data !Error on 1I02 Charge Asymmetry 4 Wire Sum +hallb_photocurrent slow_controls_data !Hall B photocurrent uA +HC:0L02_XDIF slow_controls_data !0L02 X Difference +HC:1I02_WSUM slow_controls_data !1I02 Charge Asymmetry 4 Wire Sum +hallc_transmission slow_controls_data !Hall C Independent Transmission % +HC:IBCM_QASY slow_controls_data !Injector BCM Charge Asymmetry +! +IGL1I00AI23 slow_controls_data !G0 Y PZT Voltage V [still exists] +IGL1I00AI22 slow_controls_data !G0 X PZT Voltage V [still exists] +! +!IGLdac3:ao_1 slow_controls_data !Y PZT Voltage V [already in Riad's list above] +!IGLdac3:ao_0 slow_controls_data !X PZT Voltage [already in Riad's list above] +! +HC:Y_DIF slow_controls_data !Y Position Difference to MCC +qe_hallb slow_controls_data !Hall B Quantum Efficiency % +IGL1I00AI26 slow_controls_data !Hall A Y PZT Voltage V +laser_b_wavelength slow_controls_data !Hall B laser wavelength nm +! +!psub_aa_pos slow_controls_data !Hall A Laser Attenuator Setting [already in Riad's list above] +! +HC:1I06_YDIF slow_controls_data !1I06 Y Difference +HC:1I02_YDIF slow_controls_data !1I02 Y Difference +HC:DQ_ASY slow_controls_data !Charge Asymmetry Uncertainty ppm +HC:0L02_YDIF slow_controls_data !0L02 Y Difference +IBCxxxxCLOSS slow_controls_data !Machine Energy Loss +psub_ac_pos slow_controls_data !Hall C Laser Attenuator Setting +IGL1I00AI7 slow_controls_data !Gun 2 PITA Voltage Positive V +HC:1I04_YDIF slow_controls_data !1I04 Y Difference +qe_hallc slow_controls_data !Hall C Quantum Efficiency % +HC:0L03_DYDIF slow_controls_data !Error on 0L03 Y Difference +HC:0L03_DWSUM slow_controls_data !Error on 0L03 Charge Asymmetry 4 Wire Sum +HC:0L03_XDIF slow_controls_data !0L03 X Difference +halla_photocurrent slow_controls_data !Hall A photocurrent uA +HC:1I06_XDIF slow_controls_data !1I06 X Difference +IGL1I00PStrans slow_controls_data !Injector transmission +HC:pint_period slow_controls_data !Position difference sampling period +HC:0L02_DXDIF slow_controls_data !Error on 0L02 X Difference +osc2_jitter slow_controls_data !Hall C Laser Phase Jitter +halla_transmission slow_controls_data !Hall A Independent Transmission % +HC:1I04_WSUM slow_controls_data !1I04 Charge Asymmetry 4 Wire Sum +HC:1I06_DYDIF slow_controls_data !Error on 1I06 Y Difference +HC:1I02_XDIF slow_controls_data !1I02 X Difference +HC:0I05_WSUM slow_controls_data !0I05 Charge Asymmetry 4 Wire Sum +HC:bcm_threshold slow_controls_data !BCM threshold cut for charge feedback uA +ibcm1 slow_controls_data !Hall C Beam Current (monitor 1): careful, this is also in target epics +ibcm2 slow_controls_data !Hall C Beam Current (monitor 2): careful, this is also in target epics +HC:bcm_select polarized_source !String ! (result: BCM2) +! +!IGL1I00DI24_24M slow_controls_data ![already in Riad's list above] +! +EHCFR_LIXWidth slow_controls_data ! +EHCFR_LIYWidth slow_controls_data ! +EHCFR_ENERGY slow_controls_data ! +! +!IGL1I00DI24_24M slow_controls_data ![This was repeated, see by 4 variables above] +! +HC:0I05_DXIF slow_controls_data !Error on 0I05 X Difference +! +!Epics variables from Hall C beamline BPM and BCM for their auto-gains +! +IPM3C17.XIFG slow_controls_data !stripline bpm x position auto-gain +IPM3C17.YIFG slow_controls_data ! stripline bpm y position auto-gain +IBC3C17.XIFG slow_controls_data !bcm x position auto-gain +IBC3C17.YIFG slow_controls_data !bcm y position auto-gain +IPM3C18.XIFG slow_controls_data ! +IPM3C18.YIFG slow_controls_data ! +IPM3C19.XIFG slow_controls_data ! +IPM3C19.YIFG slow_controls_data ! +IPM3P01.XIFG slow_controls_data ! +IPM3P01.YIFG slow_controls_data ! +IPM3P02A.XIFG slow_controls_data ! +IPM3P02A.YIFG slow_controls_data ! +IPM3P03A.XIFG slow_controls_data ! +IPM3P03A.YIFG slow_controls_data ! +IPM3P02B.XIFG slow_controls_data ! +IPM3P02B.YIFG slow_controls_data ! +IPM3C20.XIFG slow_controls_data ! +IPM3C20.YIFG slow_controls_data ! +IPM3C21.XIFG slow_controls_data ! +IPM3C21.YIFG slow_controls_data ! +IPM3H02.XIFG slow_controls_data ! +IPM3H02.YIFG slow_controls_data ! +IPM3H04.XIFG slow_controls_data ! +IPM3H04.YIFG slow_controls_data ! +! +IPM3H04H slow_controls_data !cavity bpm horizontal +IPM3H04V slow_controls_data !cavity bpm vertical +IBC3H04 slow_controls_data !cavity bcm +IBC3H05 slow_controls_data !hall C bcm (i.e., ibcm1) +IBC3H05A slow_controls_data !hall C bcm (i.e., ibcm2) +! +IPM3H07A.XIFG slow_controls_data ! +IPM3H07A.YIFG slow_controls_data ! +IPM3H07B.XIFG slow_controls_data ! +IPM3H07B.YIFG slow_controls_data ! +IPM3H07C.XIFG slow_controls_data ! +IPM3H07C.YIFG slow_controls_data ! +IPM3H09.XIFG slow_controls_data ! +IPM3H09.YIFG slow_controls_data ! +! +IPM3H09AH slow_controls_data ! +IPM3H09AV slow_controls_data ! +IBC3H09 slow_controls_data ! +! +IPM3H09B.XIFG slow_controls_data ! +IPM3H09B.YIFG slow_controls_data ! +! +!Epics variables from Hall C beamline BPM and BCM for their X and Y positions +! +IPM3C17.XPOS slow_controls_data !stripline bpm x position +IPM3C17.YPOS slow_controls_data !stripline bpm y position +IBC3C17.XPOS slow_controls_data !bcm x position +IBC3C17.YPOS slow_controls_data !bcm y position +IPM3C18.XPOS slow_controls_data ! +IPM3C18.YPOS slow_controls_data ! +IPM3C19.XPOS slow_controls_data ! +IPM3C19.YPOS slow_controls_data ! +IPM3P01.XPOS slow_controls_data ! +IPM3P01.YPOS slow_controls_data ! +IPM3P02A.XPOS slow_controls_data ! +IPM3P02A.YPOS slow_controls_data ! +IPM3P03A.XPOS slow_controls_data ! +IPM3P03A.YPOS slow_controls_data ! +IPM3P02B.XPOS slow_controls_data ! +IPM3P02B.YPOS slow_controls_data ! +IPM3C20.XPOS slow_controls_data ! +IPM3C20.YPOS slow_controls_data ! +IPM3C21.XPOS slow_controls_data ! +IPM3C21.YPOS slow_controls_data ! +IPM3H02.XPOS slow_controls_data ! +IPM3H02.YPOS slow_controls_data ! +IPM3H04.XPOS slow_controls_data ! +IPM3H04.YPOS slow_controls_data ! +! +IPM3H07A.XPOS slow_controls_data ! +IPM3H07A.YPOS slow_controls_data ! +IPM3H07B.XPOS slow_controls_data ! +IPM3H07B.YPOS slow_controls_data ! +IPM3H07C.XPOS slow_controls_data ! +IPM3H07C.YPOS slow_controls_data ! +IPM3H09.XPOS slow_controls_data ! +IPM3H09.YPOS slow_controls_data ! +! +IPM3H09B.XPOS slow_controls_data ! +IPM3H09B.YPOS slow_controls_data ! +! +!Epics variables from Hall C beamline BPM and BCM for their X and Y position offsets +! +IPM3C17.XSOF slow_controls_data !stripline bpm x position offset +IPM3C17.YSOF slow_controls_data ! stripline bpm y position offset +IBC3C17.XSOF slow_controls_data !bcm x position offset +IBC3C17.YSOF slow_controls_data !bcm y position offset +IPM3C18.XSOF slow_controls_data ! +IPM3C18.YSOF slow_controls_data ! +IPM3C19.XSOF slow_controls_data ! +IPM3C19.YSOF slow_controls_data ! +IPM3P01.XSOF slow_controls_data ! +IPM3P01.YSOF slow_controls_data ! +IPM3P02A.XSOF slow_controls_data ! +IPM3P02A.YSOF slow_controls_data ! +IPM3P03A.XSOF slow_controls_data ! +IPM3P03A.YSOF slow_controls_data ! +IPM3P02B.XSOF slow_controls_data ! +IPM3P02B.YSOF slow_controls_data ! +IPM3C20.XSOF slow_controls_data ! +IPM3C20.YSOF slow_controls_data ! +IPM3C21.XSOF slow_controls_data ! +IPM3C21.YSOF slow_controls_data ! +IPM3H02.XSOF slow_controls_data ! +IPM3H02.YSOF slow_controls_data ! +IPM3H04.XSOF slow_controls_data ! +IPM3H04.YSOF slow_controls_data ! +! +IPM3H07A.XSOF slow_controls_data ! +IPM3H07A.YSOF slow_controls_data ! +IPM3H07B.XSOF slow_controls_data ! +IPM3H07B.YSOF slow_controls_data ! +IPM3H07C.XSOF slow_controls_data ! +IPM3H07C.YSOF slow_controls_data ! +IPM3H09.XSOF slow_controls_data ! +IPM3H09.YSOF slow_controls_data ! +! +IPM3H09B.XSOF slow_controls_data ! +IPM3H09B.YSOF slow_controls_data ! +! +! Miscellaneous epics variables: +HC:Q_ONOFF polarized_source !String !Charge feedback (ON/OFF) +! Epics variables for Compton missing. +! +! Fast Feedback (copied from G0 epics.dictionary) +! +FB_A:FB_On polarized_source !String !fast feedback Hall A status (result: OFF) +FB_C:FB_On polarized_source !String !fast feedback Hall C status (result: OFF) +FB_C:status:mbbi2.B7 slow_controls_data !1 or 0 !fast feedback Hall C status flag +FB_C:use_RF polarized_source !String !fast energy lock Hall C status (result: RF OFF) +FB_A:use_RF polarized_source !String !fast energy lock Hall A status (result: RF ON) +FB_A:status:mbbi2.B7 slow_controls_data !1 or 0 !fast feedback Hall A status flag +! +! Hall C Moller information (copied from G0 epics.dictionary) +! +OXSS_RDF slow_controls_data !Leads Field +OXSS_MGFD slow_controls_data !Persistent Field (T) +TARGPOS slow_controls_data !Target position X +COLPOS1 slow_controls_data !Collimator Block 1 +COLPOS2 slow_controls_data !Collimator Block 2 +COLPOS3 slow_controls_data !Collimator Block 3 +COLPOS4 slow_controls_data !Collimator Block 4 +COLPOS5 slow_controls_data !Collimator Block 5 +COLPOS6 slow_controls_data !Collimator Block 6 +COLPOS7 slow_controls_data !Collimator Block 7 +!MHCMQ2SETI slow_controls_data !Supply Set (A) +!MHCMQ2IRBCK slow_controls_data !Current ReadBack (A) +!MQE3M02.S slow_controls_data !Current Set (A) +!The "result" indicates the result obtained from caget command. + +! Added Qtor related 4 variables: qw:qt_mps_i_target,qw:qt_mps_i_set, qw:qt_mps_i_dcct, Q1HallP + +qw:qt_mps_i_target slow_controls_data ! Qtor target curret +qw:qt_mps_i_set slow_controls_data ! Qtor set current +qw:qt_mps_i_dcct slow_controls_data ! Qtor DCCT +Q1HallP slow_controls_data ! Qtor magnetic field read by Hall Probe 1 +! +! +! +! +FB_C:CORR:C1_value.B slow_controls_data ! FFB corrector magnet 1 value +FB_C:CORR:C2_value.B slow_controls_data ! FFB corrector magnet 2 value +FB_C:CORR:C3_value.B slow_controls_data ! FFB corrector magnet 3 value +FB_C:CORR:C4_value.B slow_controls_data ! FFB corrector magnet 4 value +IBC1H04CRCUR2 slow_controls_data ! Hall A MPS BCM Current uA +IBC3H00CRCUR4 slow_controls_data ! Hall C MPS BCM Current uA +IFY0I06I slow_controls_data ! PolCup position: FC1 (is/is not) inserted +IFY0I06R slow_controls_data ! PolCup position: FC1 (is/is not) retracted +IFY0L03I slow_controls_data ! PolCup position: FC2 (is/is not) inserted +IFY0L03R slow_controls_data ! PolCup position: FC2 (is/is not) retracted +IFY1I07I slow_controls_data ! PolCup position: PolCup (is/is not) inserted +IFY1I07R slow_controls_data ! PolCup position: PolCup (is/is not) retracted +IOCSE14:PassSel;r slow_controls_data !String ! IOCSE14 Auto Select +IOCSE14:SEEGainMod;r slow_controls_data !String ! IOCSE14 Auto Gain +IOCSE14:SEEProcMod;r slow_controls_data !String ! IOCSE14 SEE Norm Ops +IOCSE17:PassSel;r slow_controls_data !String ! IOCSE17 Auto Select +IOCSE17:SEEGainMod;r slow_controls_data !String ! IOCSE17 Auto Gain +IOCSE17:SEEProcMod;r slow_controls_data !String ! IOCSE17 SEE Norm Ops +IOCSE18:PassSel;r slow_controls_data !String ! IOCSE18 Auto Select +IOCSE18:SEEGainMod;r slow_controls_data !String ! IOCSE18 Auto Gain +IOCSE18:SEEProcMod;r slow_controls_data !String ! IOCSE18 SEE Norm Ops +IOCSE20:PassSel;r slow_controls_data !String ! IOCSE20 Auto Select +IOCSE20:SEEGainMod;r slow_controls_data !String ! IOCSE20 Auto Gain +IOCSE20:SEEProcMod;r slow_controls_data !String ! IOCSE20 SEE Norm Ops +VCG3H09BTr slow_controls_data ! Scattering Chamber Vacuum psia +qw:exitwindow slow_controls_data ! Exit window temp (C) +rad45_p1 slow_controls_data ! Gamma radiation monitor in Qweak detector shieldhouse +rad45_p2 slow_controls_data ! Neutron radiation monitor in Qweak detector shieldhouse +!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! +! Composite slow control variables +! These are variables for which there is not an actual EPICS variable, +! but a value is generated internally by the QwEPICSEvent class. +!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! +WienMode slow_controls_data String ! This will indicate the spin direction in the hall as defined by the Wien setting + precession + diff --git a/Analysis/prminput/EpicsTable.14700-.map b/Analysis/prminput/EpicsTable.14700-.map new file mode 100644 index 000000000..337cf82e3 --- /dev/null +++ b/Analysis/prminput/EpicsTable.14700-.map @@ -0,0 +1,721 @@ +! The exclamation mark (!) is for comment in this file. +! +! 06-17-2011: added Qtor related 4 variables: qw:qt_mps_i_target,qw:qt_mps_i_set, qw:qt_mps_i_dcct, Q1HallP +! 07-08-2010: added "String" in more variables by identifying them using +! caget epicsVarName (e.g. caget QW_T_miA) in a machine where caget command can be issued. +! +! 06-28-2010: first svn commit of this table (rsubedi) +! Table for epics variables whose values can be stored in a MySQL database. +! This table has three columns. The first column is the name for an epics +! variable. The second column at the moment is just a flag to insert epics data +! in the MySQL database. The third column is related to those epics variables +! that have only string-value (e.g. the epics varaible for the half wave plate +! is IGL1I00DI24_24M and has either IN or OUT value). +! +! +!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! +! Special keywords +!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! +NominalWienAngle = 30.0 ! This is the "nominal" Wien launch angle in degrees needed to have the spin pointing FORWARD for H+ when IHWP OUT & the Wien is Flip-Right (or Horizontal-Only) +BlinderReversalForRunTwo = 1 ! Set this to 1 to use the extra reversal for Run2. THIS IS NEEDED! + +!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! +! NAME DB_TABLE TYPE COMMENT +!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! +QWTGTPOS slow_controls_data !Vertical position of the target +QWtgt_name slow_controls_data String ! Name of the target position +QWT_miA slow_controls_data !Temp A at manifold inlet K Cernox +QWT_moA slow_controls_data !Temp A at manifold outlet K Cernox +QWT_hxiA slow_controls_data !Temp A at heat exchanger inlet K Cernox Phytron brake +QWT_hxoA slow_controls_data !Temp A at heat exchanger outlet K Cernox Phytron home switch +QWT_piA slow_controls_data !Temp A at pump inlet K Cernox GV open switch +! slow_controls_data !GV closed switch [something to be added here] +QWT_miB slow_controls_data !Temp B at manifold inlet K Cernox Turbo status *5? +QWT_moB slow_controls_data !Temp B at manifold outlet K Cernox CCG *5? +QWT_hxiB slow_controls_data !Temp B at heat exchanger inlet K Cernox Ballast vacuum +QWT_hxoB slow_controls_data !Temp B at heat exchanger outlet K Cernox +QWT_piB slow_controls_data !Temp B at pump inlet K Cernox +QWT_ladderA slow_controls_data !Temp A on dummy tgt ladder K +QWT_USdmA slow_controls_data !Temp A on upstream dummy frame K +QWT_DSdmA slow_controls_data !Temp A on downstream dummy frame K +QWT_phytronA slow_controls_data !Temp A on Phytron motor K +QWT_tableA slow_controls_data !Temp A on Horizontal Motion table K +QWT_ladderB slow_controls_data !Temp B on dummy tgt ladder K +QWT_USdmB slow_controls_data !Temp B on upstream dummy frame K +QWT_DSdmB slow_controls_data !Temp B on downstream dummy frame K +QWT_phytronB slow_controls_data !Temp B on Phytron motor K +QWT_tableB slow_controls_data !Temp B on Horizontal Motion table K +QWT_solidA slow_controls_data !Temp A on solid target frame K +QWT_solidB slow_controls_data !Temp B on solid target frame K +QWT_spareA slow_controls_data !K +QWT_spareB slow_controls_data !K +QWT_pumpA slow_controls_data !Temp A on pump motor house K +QWT_pumpB slow_controls_data !Temp B on pump motor house K +! slow_controls_data !K [something to be added here] +QWT_4kjt slow_controls_data !Coolant Temp at outlet of 4K JT valve K Cernox +QWT_4ko slow_controls_data !Temp of returning 4K coolant K Cernox +QWT_15kjt slow_controls_data !Coolant Temp at outlet of 15K JT valve K Cernox +QWT_15ko slow_controls_data !Temp of returning 15K coolant K Cernox +QW_Pmp_TachSet slow_controls_data !Set value for pump tach Hz +QW_Pmp_VSet slow_controls_data !Set value for pump voltage Volts +QW_Pmp_I1Set slow_controls_data !Set value for pump current phase 1 Amps +QW_Pmp_I2Set slow_controls_data !Set value for pump current phase 2 Amps +QW_Pmp_I3Set slow_controls_data !Set value for pump current phase 3 Amps +QW_Pmp_TachRead slow_controls_data !Read value for pump tach Hz +QW_Pmp_VRead slow_controls_data !Read value for pump voltage Volts +QW_Pmp_I1Read slow_controls_data !Read value for pump current phase 1 Amps +QW_Pmp_I2Read slow_controls_data !Read value for pump current phase 2 Amps +QW_Pmp_I3Read slow_controls_data !Read value for pump current phase 3 Amps +QW_Pmp_Status1 slow_controls_data !Pump controller status bits +QW_Pmp_Status2 slow_controls_data !Pump controller status bits +QW_HPH_ISet slow_controls_data !High Power Heater set current limit Amps +QW_HPH_VSet slow_controls_data !High Power Heater set voltage Volts +QW_HPH_PSet slow_controls_data !High Power Heater set (calculated) power Watts +QW_HPH_IRead slow_controls_data !High Power Heater read current Amps +QW_HPH_VRead slow_controls_data !High Power Heater read voltage Volts +QW_HPH_PRead slow_controls_data !High Power Heater read power Watts +QW_HPH__PID slow_controls_data !Pid mode on or off +QW_HPH_TSet slow_controls_data !HPH set temperature K +QW_HPH_TRead slow_controls_data !HPH read/current temperature K +QW_HPH_Beam_Comp_Switch slow_controls_data !HPH beam compensation switch +QW_pbeam slow_controls_data !Calculated beam power Watts +QW_ibeam slow_controls_data !Beam current uA +QW_HPH_Pmax slow_controls_data !Maximum Heater Power W +QW_HPH_Pman slow_controls_data !smitghg Manual power setting W +QW_HPH_R slow_controls_data !Heater resistance Ohms +QW_HPH_OnOff slow_controls_data !Heater mode +QW_HPH_bmcomp1 slow_controls_data !beam compensation parameter 1 (length) cm +QW_HPH_bmcomp2 slow_controls_data !beam compensation parameter 2 (density) g/cc +QW_HPH_bmcomp3 slow_controls_data !beam compensation parameter 3 (dE/dx) MeV/g/cm^2 +QW_HPH_bmcomp4 slow_controls_data !beam compensation parameter 4 (spare) +QW_HPH_Prop slow_controls_data !PID proportinal gain (typ 600) +QW_HPH_Integ slow_controls_data !PID integral gain (typ 40) +QW_HPH_Deriv slow_controls_data !PID derivative gain (typ 0) +QW_HPH_Scan slow_controls_data !Scan time for PID (typ 1) s +QW_HPH_dmin slow_controls_data !minimum change in power per scan W +QW_HPH_dmax slow_controls_data !maximum change in power per scan W +QW_JT_4Kset slow_controls_data ! +QW_JT_4KRead slow_controls_data ! +QW_JT_4KStep slow_controls_data !4K JT Step size +QW_JT_15KSet slow_controls_data ! +QW_JT_15LRead slow_controls_data ! +QW_JT_15KStep slow_controls_data !15K JT Step size +QW_Phy_ENCSet slow_controls_data !Hor. Motion Phytron set stepper position +QW_Phy_VSet slow_controls_data !Hor. Motion Phytron set Voltage Volts +QW_Phy_ISet slow_controls_data !Hor. Motion Phytron set current Amps +QW_Phy_BrakeSet slow_controls_data !Hor. Motion Phytron set brake value +QW_Phy_ENCRead slow_controls_data !Hor. Motion Phytron read stepper position +QW_Phy_VRead slow_controls_data !Hor. Motion Phytron read Voltage Volts +QW_Phy_IRead slow_controls_data !Hor. Motion Phytron read current Amps +QW_Phy_BrakeRead slow_controls_data !Hor. Motion Phytron read brake value +QW_Phy_Prog slow_controls_data !Hor. Motion Phytron program number +QW_Phy_Out1 slow_controls_data !Hor. Motion Phytron output word 1 +QW_Phy_Out2 slow_controls_data !Hor. Motion Phytron output word 2 +QW_Phy_In1 slow_controls_data !Hor. Motion Phytron input word 1 +QW_Phy_In2 slow_controls_data !Hor. Motion Phytron input word 2 +QW_Phy_Switches slow_controls_data !Hor. Motion Phytron limit switch readback +QW_Phy_ResPos slow_controls_data !Hor. Motion resistive position readout +QW_EC5_ENCSet slow_controls_data !Lifter EC5 set stepper position +QW_EC5_VSet slow_controls_data !Lifter EC5 set Voltage Volts +QW_EC5_ISet slow_controls_data !Lifter EC5 set current Amps +QW_EC5_BrakeSet slow_controls_data !Lifter EC5 set brake value +QW_EC5_ENCRead slow_controls_data !Lifter EC5 read stepper position +QW_EC5_VRead slow_controls_data !Lifter EC5 read Voltage Volts +QW_EC5_IRead slow_controls_data !Lifter EC5 read current Amps +QW_EC5_BrakeRead slow_controls_data !Lifter EC5 read brake value +QW_EC5_Prog slow_controls_data !Lifter EC5 program number +QW_EC5_Out1 slow_controls_data !Lifter EC5 output word 1 +QW_EC5_Out2 slow_controls_data !Lifter EC5 output word 2 +QW_EC5_In1 slow_controls_data !Lifter EC5 input word 1 +QW_EC5_In2 slow_controls_data !Lifter EC5 input word 2 +QW_EC5_Switches slow_controls_data !Lifter EC5 limit switch readback +QW_EC5_AxisStatus slow_controls_data ! +QW_EC5_DriveStatus slow_controls_data ! +QW_EC5_SystemStatus slow_controls_data ! +QW_EC5_ResPos slow_controls_data !Lifter EC5 resistive position readout +QW_PT3 slow_controls_data !Gas panel pressure transducer PT3 psia +QW_PT4 slow_controls_data !Gas panel pressure transducer PT4 psia +QW_PT9 slow_controls_data !Gas panel pressure transducer PT9 psia +QW_PT7 slow_controls_data !Gas panel pressure transducer PT7 psia +QW_PT87 slow_controls_data !Gas panel pressure transducer PT87 psia +QW_PT77 slow_controls_data !Gas panel pressure transducer PT77 psia +QW_PT_Scatt_Chamber slow_controls_data !Scattering Chamber Vacuum psia +QW_PT_Scatt_Chamber_switch slow_controls_data !Scattering Chamber vacuum switch psia +HC_ValveBox_Pos slow_controls_data !Warm return valve position % open +HC_ValveBox_Temp slow_controls_data !Warm return temp K +QW_TgtX0 slow_controls_data !X (Hor) stepper pos for Tgt 0 +QW_TgtY0 slow_controls_data !Y (Ver) stepper pos for Tgt 0 +QW_TgtX1 slow_controls_data ! +QW_TgtY1 slow_controls_data ! +QW_TgtX2 slow_controls_data ! +QW_TgtY2 slow_controls_data ! +QW_TgtX3 slow_controls_data ! +QW_TgtY3 slow_controls_data ! +QW_TgtX4 slow_controls_data ! +QW_TgtY4 slow_controls_data ! +QW_TgtX5 slow_controls_data ! +QW_TgtY5 slow_controls_data ! +QW_TgtX6 slow_controls_data ! +QW_TgtY6 slow_controls_data ! +QW_TgtX7 slow_controls_data ! +QW_TgtY7 slow_controls_data ! +QW_TgtX8 slow_controls_data ! +QW_TgtY8 slow_controls_data ! +QW_TgtX9 slow_controls_data ! +QW_TgtY9 slow_controls_data ! +QW_TgtX10 slow_controls_data ! +QW_TgtY10 slow_controls_data ! +QW_TgtX11 slow_controls_data ! +QW_TgtY11 slow_controls_data ! +QW_TgtX12 slow_controls_data ! +QW_TgtY12 slow_controls_data ! +QW_TgtX13 slow_controls_data ! +QW_TgtY13 slow_controls_data ! +QW_TgtX14 slow_controls_data ! +QW_TgtY14 slow_controls_data ! +QW_TgtX15 slow_controls_data ! +QW_TgtY15 slow_controls_data ! +QW_TgtX16 slow_controls_data ! +QW_TgtY16 slow_controls_data ! +QW_TgtX17 slow_controls_data ! +QW_TgtY17 slow_controls_data ! +QW_TgtX18 slow_controls_data ! +QW_TgtY18 slow_controls_data ! +QW_TgtX19 slow_controls_data ! +QW_TgtY19 slow_controls_data ! +QW_TgtX20 slow_controls_data ! +QW_TgtY20 slow_controls_data ! +QW_TgtX21 slow_controls_data ! +QW_TgtY21 slow_controls_data ! +QW_TgtX22 slow_controls_data ! +QW_TgtY22 slow_controls_data ! +QW_TgtX23 slow_controls_data ! +QW_TgtY23 slow_controls_data ! +QW_TgtX24 slow_controls_data ! +QW_TgtY24 slow_controls_data ! +QW_TgtX25 slow_controls_data ! +QW_TgtY25 slow_controls_data ! +QW_TgtX26 slow_controls_data ! +QW_TgtY26 slow_controls_data ! +QW_Tgt_Raster0 slow_controls_data !Raster requirement for Tgt 0 +QW_Tgt_CurLim0 slow_controls_data !Beam Current Limit for Tgt 0 +QW_Tgt_Raster1 slow_controls_data ! +QW_Tgt_CurLim1 slow_controls_data ! +QW_Tgt_Raster2 slow_controls_data ! +QW_Tgt_CurLim2 slow_controls_data ! +QW_Tgt_Raster3 slow_controls_data ! +QW_Tgt_CurLim3 slow_controls_data ! +QW_Tgt_Raster4 slow_controls_data ! +QW_Tgt_CurLim4 slow_controls_data ! +QW_Tgt_Raster5 slow_controls_data ! +QW_Tgt_CurLim5 slow_controls_data ! +QW_Tgt_Raster6 slow_controls_data ! +QW_Tgt_CurLim6 slow_controls_data ! +QW_Tgt_Raster7 slow_controls_data ! +QW_Tgt_CurLim7 slow_controls_data ! +QW_Tgt_Raster8 slow_controls_data ! +QW_Tgt_CurLim8 slow_controls_data ! +QW_Tgt_Raster9 slow_controls_data ! +QW_Tgt_CurLim9 slow_controls_data ! +QW_Tgt_Raster10 slow_controls_data ! +QW_Tgt_CurLim10 slow_controls_data ! +QW_Tgt_Raster11 slow_controls_data ! +QW_Tgt_CurLim11 slow_controls_data ! +QW_Tgt_Raster12 slow_controls_data ! +QW_Tgt_CurLim12 slow_controls_data ! +QW_Tgt_Raster13 slow_controls_data ! +QW_Tgt_CurLim13 slow_controls_data ! +QW_Tgt_Raster14 slow_controls_data ! +QW_Tgt_CurLim14 slow_controls_data ! +QW_Tgt_Raster15 slow_controls_data ! +QW_Tgt_CurLim15 slow_controls_data ! +QW_Tgt_Raster16 slow_controls_data ! +QW_Tgt_CurLim16 slow_controls_data ! +QW_Tgt_Raster17 slow_controls_data ! +QW_Tgt_CurLim17 slow_controls_data ! +QW_Tgt_Raster18 slow_controls_data ! +QW_Tgt_CurLim18 slow_controls_data ! +QW_Tgt_Raster19 slow_controls_data ! +QW_Tgt_CurLim19 slow_controls_data ! +QW_Tgt_Raster20 slow_controls_data ! +QW_Tgt_CurLim20 slow_controls_data ! +QW_Tgt_Raster21 slow_controls_data ! +QW_Tgt_CurLim21 slow_controls_data ! +QW_Tgt_Raster22 slow_controls_data ! +QW_Tgt_CurLim22 slow_controls_data ! +QW_Tgt_Raster23 slow_controls_data ! +QW_Tgt_CurLim23 slow_controls_data ! +QW_Tgt_Raster24 slow_controls_data ! +QW_Tgt_CurLim24 slow_controls_data ! +QW_Tgt_Raster25 slow_controls_data ! +QW_Tgt_CurLim25 slow_controls_data ! +QW_Tgt_Raster26 slow_controls_data ! +QW_Tgt_CurLim26 slow_controls_data ! +QW_ResEncX slow_controls_data !ADC value of horizontal resistive encoder +QW_ResEncY slow_controls_data !ADC value of vertical resistive encoder +QW_ResEnc_TgtX0 slow_controls_data !Resistive Encoder X (Hor) for Tgt 0 +QW_ResEnc_TgtY0 slow_controls_data !Resistive Encoder Y (Ver) for Tgt 0 +QW_ResEnc_TgtX1 slow_controls_data ! +QW_ResEnc_TgtY1 slow_controls_data ! +QW_ResEnc_TgtX2 slow_controls_data ! +QW_ResEnc_TgtY2 slow_controls_data ! +QW_ResEnc_TgtX3 slow_controls_data ! +QW_ResEnc_TgtY3 slow_controls_data ! +QW_ResEnc_TgtX4 slow_controls_data ! +QW_ResEnc_TgtY4 slow_controls_data ! +QW_ResEnc_TgtX5 slow_controls_data ! +QW_ResEnc_TgtY5 slow_controls_data ! +QW_ResEnc_TgtX6 slow_controls_data ! +QW_ResEnc_TgtY6 slow_controls_data ! +QW_ResEnc_TgtX7 slow_controls_data ! +QW_ResEnc_TgtY7 slow_controls_data ! +QW_ResEnc_TgtX8 slow_controls_data ! +QW_ResEnc_TgtY8 slow_controls_data ! +QW_ResEnc_TgtX9 slow_controls_data ! +QW_ResEnc_TgtY9 slow_controls_data ! +QW_ResEnc_TgtX10 slow_controls_data ! +QW_ResEnc_TgtY10 slow_controls_data ! +QW_ResEnc_TgtX11 slow_controls_data ! +QW_ResEnc_TgtY11 slow_controls_data ! +QW_ResEnc_TgtX12 slow_controls_data ! +QW_ResEnc_TgtY12 slow_controls_data ! +QW_ResEnc_TgtX13 slow_controls_data ! +QW_ResEnc_TgtY13 slow_controls_data ! +QW_ResEnc_TgtX14 slow_controls_data ! +QW_ResEnc_TgtY14 slow_controls_data ! +QW_ResEnc_TgtX15 slow_controls_data ! +QW_ResEnc_TgtY15 slow_controls_data ! +QW_ResEnc_TgtX16 slow_controls_data ! +QW_ResEnc_TgtY16 slow_controls_data ! +QW_ResEnc_TgtX17 slow_controls_data ! +QW_ResEnc_TgtY17 slow_controls_data ! +QW_ResEnc_TgtX18 slow_controls_data ! +QW_ResEnc_TgtY18 slow_controls_data ! +QW_ResEnc_TgtX19 slow_controls_data ! +QW_ResEnc_TgtY19 slow_controls_data ! +QW_ResEnc_TgtX20 slow_controls_data ! +QW_ResEnc_TgtY20 slow_controls_data ! +QW_ResEnc_TgtX21 slow_controls_data ! +QW_ResEnc_TgtY21 slow_controls_data ! +QW_ResEnc_TgtX22 slow_controls_data ! +QW_ResEnc_TgtY22 slow_controls_data ! +QW_ResEnc_TgtX23 slow_controls_data ! +QW_ResEnc_TgtY23 slow_controls_data ! +QW_ResEnc_TgtX24 slow_controls_data ! +QW_ResEnc_TgtY24 slow_controls_data ! +QW_ResEnc_TgtX25 slow_controls_data ! +QW_ResEnc_TgtY25 slow_controls_data ! +QW_ResEnc_TgtX26 slow_controls_data ! +QW_ResEnc_TgtY26 slow_controls_data ! +CFI6731C slow_controls_data !15k Flow g/s +CTD673 slow_controls_data !15K Supply temp at ESR K +CPI673 slow_controls_data !15K Supply pressure at ESR atm +CTD9541 slow_controls_data !20K return temp at ESR K +CPI9541 slow_controls_data !20K return pressure at ESR atm +haCryo_15K_Total_F slow_controls_data !sum of Hall A and Hall C 15K flows g/s +CFI60DLP slow_controls_data !"dirty flowrate" at ESR (warm return) g/s +CTD6614 slow_controls_data !Hall A 15K supply temp K +CFI6711C slow_controls_data !4k Flow g/s +CTD671SC slow_controls_data !4K Supply temp at ESR K +CPI671SC slow_controls_data !4K Supply pressure at ESR atm +CTD672 slow_controls_data !5K return temp at ESR K +CPI672 slow_controls_data !5K return pressure at ESR atm +QWBCM1 slow_controls_data !Beam current in Hall C uA +QWBCM2 slow_controls_data !Beam current in Hall C uA +QWBCM3 slow_controls_data !Beam current in Hall C uA +QWBCM4 slow_controls_data !Beam current in Hall C uA +QWGV_Status slow_controls_data !Status bits of the gate valves +QWHPHIset slow_controls_data !Max Heater Current Set +QWHPHIDACset slow_controls_data !Max Current DAC Set +QWHPHVDACset slow_controls_data !Voltage DAC Set +QWHPHManual slow_controls_data !Manual power setting +QWHPHAuto slow_controls_data !auto power setting +QWHPHheat_pid.ORBV slow_controls_data !Cur Pos +QWHPHheat_pid.OVAL slow_controls_data !Cur Out +QWHPHheat_pid.CVAL slow_controls_data !Cur Inp +QWHPHheat.pidS slow_controls_data !Output +QWHPHheat_pid_VAL slow_controls_data !Set Value +QWHPHmode_bypass.VAL slow_controls_data !Heater mode +QWheat_tot slow_controls_data !Total Power +QWbeam_heat slow_controls_data !Beam Power +! +! The following list of injector/source related Epics variables was provided by Riad Suleiman. +! +VWienAngle slow_controls_data !Vertical Wien Angle +MWF1I04.BDL slow_controls_data !Vertical Wien BDL (G-cm) +IGL1I00OD16_4 polarized_source String !Vertical Wien HV Polarity (on/off) +IGL1I00DAC6 slow_controls_data !Vertical Wien Electrode Voltage +Phi_FG slow_controls_data !Solenoids Angle (Phi_FG) +MFG1I04A.BDL slow_controls_data !First Solenoid BDL (G-cm) +MFG1I04B.BDL slow_controls_data !Second Solenoid BDL (G-cm) +HWienAngle slow_controls_data !Horizontal Wien Angle +MWF0I02.BDL slow_controls_data !Horizontal Wien BDL (G-cm) +IGL1I00OD16_9 slow_controls_data !Horizontal Wien HV Polarity +IGL1I00DAC5 slow_controls_data !Horizontal Wien Electrode Voltage +psub_aa_pos slow_controls_data !Hall A Laser Attenuator (Hall A Laser Attenuator Setting) -- +IGL1I00OD16_16 polarized_source String !IHWP: Insertible Beam Half-wave plate Set(off=out) +IGL1I00DI24_24M polarized_source String !Beam Half-wave plate Read(off=out) () -- +psub_pl_pos slow_controls_data !Rotating waveplate (Rotatable Half Wave Plate Setting) -- +IGLdac3:ao_7 slow_controls_data !IA Cell Setpoint Hall A +IGL1I00AI20 slow_controls_data !IA Cell Setpoint Hall B +IGLdac3:ao_4 slow_controls_data !IA Cell Setpoint Hall C +IGLdac3:ao_5 slow_controls_data !PZT X Setpoint Hall A +IGLdac3:ao_6 slow_controls_data !PZT Y Setpoint Hall A +IGLdac3:ao_0 slow_controls_data !PZT X Setpoint Common (X PZT Voltage ) -- +IGLdac3:ao_1 slow_controls_data !PZT Y Setpoint Common (Y PZT Voltage V) -- +IGLdac2:G2Ch3Pos slow_controls_data !Gun2: PC (PITA) POS +IGLdac2:G2Ch4Neg slow_controls_data !Gun2: PC (PITA) NEG +IGL1I00OD16_8 polarized_source String !Pockels Cell ON/OFF +cdipc_xpos slow_controls_data !Pockels Cell X Stage +cdipc_ypos slow_controls_data !Pockels Cell Y Stage +psub_cx_pos slow_controls_data !Wafer X Stage (X laser position on cathode) -- +psub_cy_pos slow_controls_data !Wafer Y Stage (Y laser position on cathode) -- +SMRPOSA slow_controls_data !Hall A Slit Position (Hall A Chopper Slit Readback) -- +HELCLOCKs slow_controls_data !Helicity Clock Set (result: Free Clock) +HELDELAYs polarized_source String !Helicity Delay Set (result: 8 windows) +HELPATTERNs polarized_source String !Helicity Pattern Set (has a value such as Quartet) +HELCLOCKd slow_controls_data !Helicity Clock Read (result: Free Clock) +HELTSETTLEd slow_controls_data !Helicity Settle Read +HELTSTABLEd slow_controls_data !Helicity Stable Read +HELDELAYd polarized_source String !Helicity Delay Read (result: 8 windows) +HELPATTERNd polarized_source String !Helicity Pattern Read (has a value such as Quartet) +HELFREQ slow_controls_data !Helicity Frequency +! +! The following list is already in the MySql database +! +HC:qint_period slow_controls_data !Charge asymmetry sampling period +laser_a_wavelength slow_controls_data !Hall A laser wavelength nm +HC:0L03_WSUM slow_controls_data !0L03 Charge Asymmetry 4 Wire Sum +! +! psub_cx_pos slow_controls_data !laser position on cathode [already in Riad's list above] +! +SMRPOSB slow_controls_data !Hall B Chopper Slit Readback +R00PGSET slow_controls_data !Prebuncher Setting +IGLdac2:scale_6.A slow_controls_data !Hall B TACO Voltage V +IGL1I00AI27 slow_controls_data !Hall A IA Voltage V +laser_c_wavelength slow_controls_data !Hall C laser wavelength nm +HC:1I04_XDIF slow_controls_data !1I04 X Difference +IGL1I00AI17 slow_controls_data !Dummy Helicity Pockels Cell Voltage V +HC:0L02_DWSUM slow_controls_data !Error on 0L02 Charge Asymmetry 4 Wire Sum +HC:DX_DIF slow_controls_data !dX on X Position Difference to MCC +SMRPOSC slow_controls_data !Hall C Chopper Slit Readback +R00PGMEST slow_controls_data !Prebuncher Setting dB +HC:1I04_DXDIF slow_controls_data !Error on 1I04 X Difference +HC:Q_ASY slow_controls_data !Charge Asymmetry to MCC ppm +HC:1I04_DWSUM slow_controls_data !Error on 1I04 Charge Asymmetry 4 Wire Sum +WienAngle slow_controls_data !Wien Filter Angle Setting degrees +itov2out slow_controls_data !A2 Slit Setting +HC:QPD_XDIF slow_controls_data !QPD X Difference +EHCFR_LIPRC polarized_source !String !Master Focus Location: 1=G0, 0=Pivot +HC:0L02_WSUM slow_controls_data !0L02 Charge Asymmetry 4 Wire Sum +HC:1I04_DYDIF slow_controls_data !Error on 1I04 Y Difference +hel_mag_status.D slow_controls_data !Integrated helicity bit difference +IBCxxxxCRCUR4 slow_controls_data !Hall C MPS BCM Current uA +scaler_calc1 slow_controls_data !Hall B Beam Current (Faraday Cup) nA +! +!psub_cy_pos slow_controls_data !Y laser position on cathode [already in Riad's list above] +! +itov5out slow_controls_data !A3 Slit Setting +IGL1I00DAC3 slow_controls_data !Hall B Seed Level +osc_jitter slow_controls_data !Hall A Laser Phase Jitter +HC:QPD_DWSUM slow_controls_data !Error on QPD Charge Asymmetry 4 Wire Sum +IGL1I00AI24 slow_controls_data !IA Voltage V +HC:P_ONOFF polarized_source String !enable/disable position feedback (ON/OFF) +HC:QPD_WSUM slow_controls_data !QPD Charge Asymmetry 4 Wire Sum +itov7out slow_controls_data !A4 Slit Setting +HC:0L03_DXDIF slow_controls_data !Error on 0L03 X Difference +hallb_transmission slow_controls_data !Hall B Independent Transmission % +! +!SMRPOSA slow_controls_data !Hall A Chopper Slit Readback [already in Riad's list above] +! +HC:0L03_YDIF slow_controls_data !0L03 Y Difference +HC:IBCM_DQASY slow_controls_data !Error on Injector BCM Charge Asymmetry +HC:1I06_DWSUM slow_controls_data !Error on 1I06 Charge Asymmetry 4 Wire Sum +HC:X_DIF slow_controls_data !X Position Difference to MCC +HC:0I05_YDIF slow_controls_data !0I05 Y Difference +IGL1I00DAC2 slow_controls_data !Hall B Control Level +HC:1I06_DXDIF slow_controls_data !Error on 1I06 X Difference +HC:0I05_DWSUM slow_controls_data !Error on 0I05 Charge Asymmetry 4 Wire Sum +HC:QPD_DYDIF slow_controls_data !Error on QPD Y Difference +HC:1I06_WSUM slow_controls_data !1I06 Charge Asymmetry 4 Wire Sum +psub_ab_pos slow_controls_data !Hall B Laser Attenuator Setting +HC:0I05_DYDIF slow_controls_data !Error on 0I05 Y Difference +! +!psub_pl_pos slow_controls_data !Rotatable Half Wave Plate Setting [already in Riad's list above] +! +hallc_photocurrent slow_controls_data !Hall C photocurrent uA +HC:0L02_DYDIF slow_controls_data !Error on 0L02 Y Difference +hac_bcm_average slow_controls_data !Hall A (?) BCM Current uA +ISL0I04DT polarized_source !Master Slit Setting (string value: IN) +IPM2C24A.IENG slow_controls_data !Hall B Beam Current (2C24A) +IBCxxxxCRCUR2 slow_controls_data !Hall A MPS BCM Current uA +HC:0I05_XDIF slow_controls_data !0I05 X Difference +HC:1I02_DYDIF slow_controls_data !Error on 1I02 Y Difference +HC:1I02_DXDIF slow_controls_data !Error on 1I02 X Difference +IGL1I00AI25 slow_controls_data !Hall A X PZT Voltage V +HC:QPD_YDIF slow_controls_data !QPD Y Difference +HC:DY_DIF slow_controls_data !dY on Y Position Difference to MCC +HC:QPD_DXDIF slow_controls_data !Error on QPD X Difference +IGL1I00AI8 slow_controls_data !Gun 2 PITA Voltage Negative V +itov1out slow_controls_data !A1 Slit Setting +qe_halla slow_controls_data !Hall A Quantum Efficiency % +HC:1I02_DWSUM slow_controls_data !Error on 1I02 Charge Asymmetry 4 Wire Sum +hallb_photocurrent slow_controls_data !Hall B photocurrent uA +HC:0L02_XDIF slow_controls_data !0L02 X Difference +HC:1I02_WSUM slow_controls_data !1I02 Charge Asymmetry 4 Wire Sum +hallc_transmission slow_controls_data !Hall C Independent Transmission % +HC:IBCM_QASY slow_controls_data !Injector BCM Charge Asymmetry +! +IGL1I00AI23 slow_controls_data !G0 Y PZT Voltage V [still exists] +IGL1I00AI22 slow_controls_data !G0 X PZT Voltage V [still exists] +! +!IGLdac3:ao_1 slow_controls_data !Y PZT Voltage V [already in Riad's list above] +!IGLdac3:ao_0 slow_controls_data !X PZT Voltage [already in Riad's list above] +! +HC:Y_DIF slow_controls_data !Y Position Difference to MCC +qe_hallb slow_controls_data !Hall B Quantum Efficiency % +IGL1I00AI26 slow_controls_data !Hall A Y PZT Voltage V +laser_b_wavelength slow_controls_data !Hall B laser wavelength nm +! +!psub_aa_pos slow_controls_data !Hall A Laser Attenuator Setting [already in Riad's list above] +! +HC:1I06_YDIF slow_controls_data !1I06 Y Difference +HC:1I02_YDIF slow_controls_data !1I02 Y Difference +HC:DQ_ASY slow_controls_data !Charge Asymmetry Uncertainty ppm +HC:0L02_YDIF slow_controls_data !0L02 Y Difference +IBCxxxxCLOSS slow_controls_data !Machine Energy Loss +psub_ac_pos slow_controls_data !Hall C Laser Attenuator Setting +IGL1I00AI7 slow_controls_data !Gun 2 PITA Voltage Positive V +HC:1I04_YDIF slow_controls_data !1I04 Y Difference +qe_hallc slow_controls_data !Hall C Quantum Efficiency % +HC:0L03_DYDIF slow_controls_data !Error on 0L03 Y Difference +HC:0L03_DWSUM slow_controls_data !Error on 0L03 Charge Asymmetry 4 Wire Sum +HC:0L03_XDIF slow_controls_data !0L03 X Difference +halla_photocurrent slow_controls_data !Hall A photocurrent uA +HC:1I06_XDIF slow_controls_data !1I06 X Difference +IGL1I00PStrans slow_controls_data !Injector transmission +HC:pint_period slow_controls_data !Position difference sampling period +HC:0L02_DXDIF slow_controls_data !Error on 0L02 X Difference +osc2_jitter slow_controls_data !Hall C Laser Phase Jitter +halla_transmission slow_controls_data !Hall A Independent Transmission % +HC:1I04_WSUM slow_controls_data !1I04 Charge Asymmetry 4 Wire Sum +HC:1I06_DYDIF slow_controls_data !Error on 1I06 Y Difference +HC:1I02_XDIF slow_controls_data !1I02 X Difference +HC:0I05_WSUM slow_controls_data !0I05 Charge Asymmetry 4 Wire Sum +HC:bcm_threshold slow_controls_data !BCM threshold cut for charge feedback uA +ibcm1 slow_controls_data !Hall C Beam Current (monitor 1): careful, this is also in target epics +ibcm2 slow_controls_data !Hall C Beam Current (monitor 2): careful, this is also in target epics +HC:bcm_select polarized_source !String ! (result: BCM2) +! +!IGL1I00DI24_24M slow_controls_data ![already in Riad's list above] +! +EHCFR_LIXWidth slow_controls_data ! +EHCFR_LIYWidth slow_controls_data ! +EHCFR_ENERGY slow_controls_data ! +! +!IGL1I00DI24_24M slow_controls_data ![This was repeated, see by 4 variables above] +! +HC:0I05_DXIF slow_controls_data !Error on 0I05 X Difference +! +!Epics variables from Hall C beamline BPM and BCM for their auto-gains +! +IPM3C17.XIFG slow_controls_data !stripline bpm x position auto-gain +IPM3C17.YIFG slow_controls_data ! stripline bpm y position auto-gain +IBC3C17.XIFG slow_controls_data !bcm x position auto-gain +IBC3C17.YIFG slow_controls_data !bcm y position auto-gain +IPM3C18.XIFG slow_controls_data ! +IPM3C18.YIFG slow_controls_data ! +IPM3C19.XIFG slow_controls_data ! +IPM3C19.YIFG slow_controls_data ! +IPM3P01.XIFG slow_controls_data ! +IPM3P01.YIFG slow_controls_data ! +IPM3P02A.XIFG slow_controls_data ! +IPM3P02A.YIFG slow_controls_data ! +IPM3P03A.XIFG slow_controls_data ! +IPM3P03A.YIFG slow_controls_data ! +IPM3P02B.XIFG slow_controls_data ! +IPM3P02B.YIFG slow_controls_data ! +IPM3C20.XIFG slow_controls_data ! +IPM3C20.YIFG slow_controls_data ! +IPM3C21.XIFG slow_controls_data ! +IPM3C21.YIFG slow_controls_data ! +IPM3H02.XIFG slow_controls_data ! +IPM3H02.YIFG slow_controls_data ! +IPM3H04.XIFG slow_controls_data ! +IPM3H04.YIFG slow_controls_data ! +! +IPM3H04H slow_controls_data !cavity bpm horizontal +IPM3H04V slow_controls_data !cavity bpm vertical +IBC3H04 slow_controls_data !cavity bcm +IBC3H05 slow_controls_data !hall C bcm (i.e., ibcm1) +IBC3H05A slow_controls_data !hall C bcm (i.e., ibcm2) +! +IPM3H07A.XIFG slow_controls_data ! +IPM3H07A.YIFG slow_controls_data ! +IPM3H07B.XIFG slow_controls_data ! +IPM3H07B.YIFG slow_controls_data ! +IPM3H07C.XIFG slow_controls_data ! +IPM3H07C.YIFG slow_controls_data ! +IPM3H09.XIFG slow_controls_data ! +IPM3H09.YIFG slow_controls_data ! +! +IPM3H09AH slow_controls_data ! +IPM3H09AV slow_controls_data ! +IBC3H09 slow_controls_data ! +! +IPM3H09B.XIFG slow_controls_data ! +IPM3H09B.YIFG slow_controls_data ! +! +!Epics variables from Hall C beamline BPM and BCM for their X and Y positions +! +IPM3C17.XPOS slow_controls_data !stripline bpm x position +IPM3C17.YPOS slow_controls_data !stripline bpm y position +IBC3C17.XPOS slow_controls_data !bcm x position +IBC3C17.YPOS slow_controls_data !bcm y position +IPM3C18.XPOS slow_controls_data ! +IPM3C18.YPOS slow_controls_data ! +IPM3C19.XPOS slow_controls_data ! +IPM3C19.YPOS slow_controls_data ! +IPM3P01.XPOS slow_controls_data ! +IPM3P01.YPOS slow_controls_data ! +IPM3P02A.XPOS slow_controls_data ! +IPM3P02A.YPOS slow_controls_data ! +IPM3P03A.XPOS slow_controls_data ! +IPM3P03A.YPOS slow_controls_data ! +IPM3P02B.XPOS slow_controls_data ! +IPM3P02B.YPOS slow_controls_data ! +IPM3C20.XPOS slow_controls_data ! +IPM3C20.YPOS slow_controls_data ! +IPM3C21.XPOS slow_controls_data ! +IPM3C21.YPOS slow_controls_data ! +IPM3H02.XPOS slow_controls_data ! +IPM3H02.YPOS slow_controls_data ! +IPM3H04.XPOS slow_controls_data ! +IPM3H04.YPOS slow_controls_data ! +! +IPM3H07A.XPOS slow_controls_data ! +IPM3H07A.YPOS slow_controls_data ! +IPM3H07B.XPOS slow_controls_data ! +IPM3H07B.YPOS slow_controls_data ! +IPM3H07C.XPOS slow_controls_data ! +IPM3H07C.YPOS slow_controls_data ! +IPM3H09.XPOS slow_controls_data ! +IPM3H09.YPOS slow_controls_data ! +! +IPM3H09B.XPOS slow_controls_data ! +IPM3H09B.YPOS slow_controls_data ! +! +!Epics variables from Hall C beamline BPM and BCM for their X and Y position offsets +! +IPM3C17.XSOF slow_controls_data !stripline bpm x position offset +IPM3C17.YSOF slow_controls_data ! stripline bpm y position offset +IBC3C17.XSOF slow_controls_data !bcm x position offset +IBC3C17.YSOF slow_controls_data !bcm y position offset +IPM3C18.XSOF slow_controls_data ! +IPM3C18.YSOF slow_controls_data ! +IPM3C19.XSOF slow_controls_data ! +IPM3C19.YSOF slow_controls_data ! +IPM3P01.XSOF slow_controls_data ! +IPM3P01.YSOF slow_controls_data ! +IPM3P02A.XSOF slow_controls_data ! +IPM3P02A.YSOF slow_controls_data ! +IPM3P03A.XSOF slow_controls_data ! +IPM3P03A.YSOF slow_controls_data ! +IPM3P02B.XSOF slow_controls_data ! +IPM3P02B.YSOF slow_controls_data ! +IPM3C20.XSOF slow_controls_data ! +IPM3C20.YSOF slow_controls_data ! +IPM3C21.XSOF slow_controls_data ! +IPM3C21.YSOF slow_controls_data ! +IPM3H02.XSOF slow_controls_data ! +IPM3H02.YSOF slow_controls_data ! +IPM3H04.XSOF slow_controls_data ! +IPM3H04.YSOF slow_controls_data ! +! +IPM3H07A.XSOF slow_controls_data ! +IPM3H07A.YSOF slow_controls_data ! +IPM3H07B.XSOF slow_controls_data ! +IPM3H07B.YSOF slow_controls_data ! +IPM3H07C.XSOF slow_controls_data ! +IPM3H07C.YSOF slow_controls_data ! +IPM3H09.XSOF slow_controls_data ! +IPM3H09.YSOF slow_controls_data ! +! +IPM3H09B.XSOF slow_controls_data ! +IPM3H09B.YSOF slow_controls_data ! +! +! Miscellaneous epics variables: +HC:Q_ONOFF polarized_source !String !Charge feedback (ON/OFF) +! Epics variables for Compton missing. +! +! Fast Feedback (copied from G0 epics.dictionary) +! +FB_A:FB_On polarized_source !String !fast feedback Hall A status (result: OFF) +FB_C:FB_On polarized_source !String !fast feedback Hall C status (result: OFF) +FB_C:status:mbbi2.B7 slow_controls_data !1 or 0 !fast feedback Hall C status flag +FB_C:use_RF polarized_source !String !fast energy lock Hall C status (result: RF OFF) +FB_A:use_RF polarized_source !String !fast energy lock Hall A status (result: RF ON) +FB_A:status:mbbi2.B7 slow_controls_data !1 or 0 !fast feedback Hall A status flag +! +! Hall C Moller information (copied from G0 epics.dictionary) +! +OXSS_RDF slow_controls_data !Leads Field +OXSS_MGFD slow_controls_data !Persistent Field (T) +TARGPOS slow_controls_data !Target position X +COLPOS1 slow_controls_data !Collimator Block 1 +COLPOS2 slow_controls_data !Collimator Block 2 +COLPOS3 slow_controls_data !Collimator Block 3 +COLPOS4 slow_controls_data !Collimator Block 4 +COLPOS5 slow_controls_data !Collimator Block 5 +COLPOS6 slow_controls_data !Collimator Block 6 +COLPOS7 slow_controls_data !Collimator Block 7 +!MHCMQ2SETI slow_controls_data !Supply Set (A) +!MHCMQ2IRBCK slow_controls_data !Current ReadBack (A) +!MQE3M02.S slow_controls_data !Current Set (A) +!The "result" indicates the result obtained from caget command. + +! Added Qtor related 4 variables: qw:qt_mps_i_target,qw:qt_mps_i_set, qw:qt_mps_i_dcct, Q1HallP + +qw:qt_mps_i_target slow_controls_data ! Qtor target curret +qw:qt_mps_i_set slow_controls_data ! Qtor set current +qw:qt_mps_i_dcct slow_controls_data ! Qtor DCCT +Q1HallP slow_controls_data ! Qtor magnetic field read by Hall Probe 1 +! +! +! +! +FB_C:CORR:C1_value.B slow_controls_data ! FFB corrector magnet 1 value +FB_C:CORR:C2_value.B slow_controls_data ! FFB corrector magnet 2 value +FB_C:CORR:C3_value.B slow_controls_data ! FFB corrector magnet 3 value +FB_C:CORR:C4_value.B slow_controls_data ! FFB corrector magnet 4 value +IBC1H04CRCUR2 slow_controls_data ! Hall A MPS BCM Current uA +IBC3H00CRCUR4 slow_controls_data ! Hall C MPS BCM Current uA +IFY0I06I slow_controls_data ! PolCup position: FC1 (is/is not) inserted +IFY0I06R slow_controls_data ! PolCup position: FC1 (is/is not) retracted +IFY0L03I slow_controls_data ! PolCup position: FC2 (is/is not) inserted +IFY0L03R slow_controls_data ! PolCup position: FC2 (is/is not) retracted +IFY1I07I slow_controls_data ! PolCup position: PolCup (is/is not) inserted +IFY1I07R slow_controls_data ! PolCup position: PolCup (is/is not) retracted +IOCSE14:PassSel;r slow_controls_data !String ! IOCSE14 Auto Select +IOCSE14:SEEGainMod;r slow_controls_data !String ! IOCSE14 Auto Gain +IOCSE14:SEEProcMod;r slow_controls_data !String ! IOCSE14 SEE Norm Ops +IOCSE17:PassSel;r slow_controls_data !String ! IOCSE17 Auto Select +IOCSE17:SEEGainMod;r slow_controls_data !String ! IOCSE17 Auto Gain +IOCSE17:SEEProcMod;r slow_controls_data !String ! IOCSE17 SEE Norm Ops +IOCSE18:PassSel;r slow_controls_data !String ! IOCSE18 Auto Select +IOCSE18:SEEGainMod;r slow_controls_data !String ! IOCSE18 Auto Gain +IOCSE18:SEEProcMod;r slow_controls_data !String ! IOCSE18 SEE Norm Ops +IOCSE20:PassSel;r slow_controls_data !String ! IOCSE20 Auto Select +IOCSE20:SEEGainMod;r slow_controls_data !String ! IOCSE20 Auto Gain +IOCSE20:SEEProcMod;r slow_controls_data !String ! IOCSE20 SEE Norm Ops +VCG3H09BTr slow_controls_data ! Scattering Chamber Vacuum psia +qw:exitwindow slow_controls_data ! Exit window temp (C) +rad45_p1 slow_controls_data ! Gamma radiation monitor in Qweak detector shieldhouse +rad45_p2 slow_controls_data ! Neutron radiation monitor in Qweak detector shieldhouse +!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! +! Composite slow control variables +! These are variables for which there is not an actual EPICS variable, +! but a value is generated internally by the QwEPICSEvent class. +!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! +WienMode slow_controls_data String ! This will indicate the spin direction in the hall as defined by the Wien setting + precession + diff --git a/Analysis/prminput/EpicsTable.15178-.map b/Analysis/prminput/EpicsTable.15178-.map new file mode 100644 index 000000000..c93513141 --- /dev/null +++ b/Analysis/prminput/EpicsTable.15178-.map @@ -0,0 +1,731 @@ +! The exclamation mark (!) is for comment in this file. +! +! 06-17-2011: added Qtor related 4 variables: qw:qt_mps_i_target,qw:qt_mps_i_set, qw:qt_mps_i_dcct, Q1HallP +! 07-08-2010: added "String" in more variables by identifying them using +! caget epicsVarName (e.g. caget QW_T_miA) in a machine where caget command can be issued. +! +! 06-28-2010: first svn commit of this table (rsubedi) +! Table for epics variables whose values can be stored in a MySQL database. +! This table has three columns. The first column is the name for an epics +! variable. The second column at the moment is just a flag to insert epics data +! in the MySQL database. The third column is related to those epics variables +! that have only string-value (e.g. the epics varaible for the half wave plate +! is IGL1I00DI24_24M and has either IN or OUT value). +! +! +!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! +! Special keywords +!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! +NominalWienAngle = 30.0 ! This is the "nominal" Wien launch angle in degrees needed to have the spin pointing FORWARD for H+ when IHWP OUT & the Wien is Flip-Right (or Horizontal-Only) +BlinderReversalForRunTwo = 1 ! Set this to 1 to use the extra reversal for Run2. THIS IS NEEDED! + +!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! +! NAME DB_TABLE TYPE COMMENT +!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! +QWTGTPOS slow_controls_data !Vertical position of the target +QWtgt_name slow_controls_data String ! Name of the target position +QWT_miA slow_controls_data !Temp A at manifold inlet K Cernox +QWT_moA slow_controls_data !Temp A at manifold outlet K Cernox +QWT_hxiA slow_controls_data !Temp A at heat exchanger inlet K Cernox Phytron brake +QWT_hxoA slow_controls_data !Temp A at heat exchanger outlet K Cernox Phytron home switch +QWT_piA slow_controls_data !Temp A at pump inlet K Cernox GV open switch +! slow_controls_data !GV closed switch [something to be added here] +QWT_miB slow_controls_data !Temp B at manifold inlet K Cernox Turbo status *5? +QWT_moB slow_controls_data !Temp B at manifold outlet K Cernox CCG *5? +QWT_hxiB slow_controls_data !Temp B at heat exchanger inlet K Cernox Ballast vacuum +QWT_hxoB slow_controls_data !Temp B at heat exchanger outlet K Cernox +QWT_piB slow_controls_data !Temp B at pump inlet K Cernox +QWT_ladderA slow_controls_data !Temp A on dummy tgt ladder K +QWT_USdmA slow_controls_data !Temp A on upstream dummy frame K +QWT_DSdmA slow_controls_data !Temp A on downstream dummy frame K +QWT_phytronA slow_controls_data !Temp A on Phytron motor K +QWT_tableA slow_controls_data !Temp A on Horizontal Motion table K +QWT_ladderB slow_controls_data !Temp B on dummy tgt ladder K +QWT_USdmB slow_controls_data !Temp B on upstream dummy frame K +QWT_DSdmB slow_controls_data !Temp B on downstream dummy frame K +QWT_phytronB slow_controls_data !Temp B on Phytron motor K +QWT_tableB slow_controls_data !Temp B on Horizontal Motion table K +QWT_solidA slow_controls_data !Temp A on solid target frame K +QWT_solidB slow_controls_data !Temp B on solid target frame K +QWT_spareA slow_controls_data !K +QWT_spareB slow_controls_data !K +QWT_pumpA slow_controls_data !Temp A on pump motor house K +QWT_pumpB slow_controls_data !Temp B on pump motor house K +! slow_controls_data !K [something to be added here] +QWT_4kjt slow_controls_data !Coolant Temp at outlet of 4K JT valve K Cernox +QWT_4ko slow_controls_data !Temp of returning 4K coolant K Cernox +QWT_15kjt slow_controls_data !Coolant Temp at outlet of 15K JT valve K Cernox +QWT_15ko slow_controls_data !Temp of returning 15K coolant K Cernox +QW_Pmp_TachSet slow_controls_data !Set value for pump tach Hz +QW_Pmp_VSet slow_controls_data !Set value for pump voltage Volts +QW_Pmp_I1Set slow_controls_data !Set value for pump current phase 1 Amps +QW_Pmp_I2Set slow_controls_data !Set value for pump current phase 2 Amps +QW_Pmp_I3Set slow_controls_data !Set value for pump current phase 3 Amps +QW_Pmp_TachRead slow_controls_data !Read value for pump tach Hz +QW_Pmp_VRead slow_controls_data !Read value for pump voltage Volts +QW_Pmp_I1Read slow_controls_data !Read value for pump current phase 1 Amps +QW_Pmp_I2Read slow_controls_data !Read value for pump current phase 2 Amps +QW_Pmp_I3Read slow_controls_data !Read value for pump current phase 3 Amps +QW_Pmp_Status1 slow_controls_data !Pump controller status bits +QW_Pmp_Status2 slow_controls_data !Pump controller status bits +QW_HPH_ISet slow_controls_data !High Power Heater set current limit Amps +QW_HPH_VSet slow_controls_data !High Power Heater set voltage Volts +QW_HPH_PSet slow_controls_data !High Power Heater set (calculated) power Watts +QW_HPH_IRead slow_controls_data !High Power Heater read current Amps +QW_HPH_VRead slow_controls_data !High Power Heater read voltage Volts +QW_HPH_PRead slow_controls_data !High Power Heater read power Watts +QW_HPH__PID slow_controls_data !Pid mode on or off +QW_HPH_TSet slow_controls_data !HPH set temperature K +QW_HPH_TRead slow_controls_data !HPH read/current temperature K +QW_HPH_Beam_Comp_Switch slow_controls_data !HPH beam compensation switch +QW_pbeam slow_controls_data !Calculated beam power Watts +QW_ibeam slow_controls_data !Beam current uA +QW_HPH_Pmax slow_controls_data !Maximum Heater Power W +QW_HPH_Pman slow_controls_data !smitghg Manual power setting W +QW_HPH_R slow_controls_data !Heater resistance Ohms +QW_HPH_OnOff slow_controls_data !Heater mode +QW_HPH_bmcomp1 slow_controls_data !beam compensation parameter 1 (length) cm +QW_HPH_bmcomp2 slow_controls_data !beam compensation parameter 2 (density) g/cc +QW_HPH_bmcomp3 slow_controls_data !beam compensation parameter 3 (dE/dx) MeV/g/cm^2 +QW_HPH_bmcomp4 slow_controls_data !beam compensation parameter 4 (spare) +QW_HPH_Prop slow_controls_data !PID proportinal gain (typ 600) +QW_HPH_Integ slow_controls_data !PID integral gain (typ 40) +QW_HPH_Deriv slow_controls_data !PID derivative gain (typ 0) +QW_HPH_Scan slow_controls_data !Scan time for PID (typ 1) s +QW_HPH_dmin slow_controls_data !minimum change in power per scan W +QW_HPH_dmax slow_controls_data !maximum change in power per scan W +QW_JT_4Kset slow_controls_data ! +QW_JT_4KRead slow_controls_data ! +QW_JT_4KStep slow_controls_data !4K JT Step size +QW_JT_15KSet slow_controls_data ! +QW_JT_15LRead slow_controls_data ! +QW_JT_15KStep slow_controls_data !15K JT Step size +QW_Phy_ENCSet slow_controls_data !Hor. Motion Phytron set stepper position +QW_Phy_VSet slow_controls_data !Hor. Motion Phytron set Voltage Volts +QW_Phy_ISet slow_controls_data !Hor. Motion Phytron set current Amps +QW_Phy_BrakeSet slow_controls_data !Hor. Motion Phytron set brake value +QW_Phy_ENCRead slow_controls_data !Hor. Motion Phytron read stepper position +QW_Phy_VRead slow_controls_data !Hor. Motion Phytron read Voltage Volts +QW_Phy_IRead slow_controls_data !Hor. Motion Phytron read current Amps +QW_Phy_BrakeRead slow_controls_data !Hor. Motion Phytron read brake value +QW_Phy_Prog slow_controls_data !Hor. Motion Phytron program number +QW_Phy_Out1 slow_controls_data !Hor. Motion Phytron output word 1 +QW_Phy_Out2 slow_controls_data !Hor. Motion Phytron output word 2 +QW_Phy_In1 slow_controls_data !Hor. Motion Phytron input word 1 +QW_Phy_In2 slow_controls_data !Hor. Motion Phytron input word 2 +QW_Phy_Switches slow_controls_data !Hor. Motion Phytron limit switch readback +QW_Phy_ResPos slow_controls_data !Hor. Motion resistive position readout +QW_EC5_ENCSet slow_controls_data !Lifter EC5 set stepper position +QW_EC5_VSet slow_controls_data !Lifter EC5 set Voltage Volts +QW_EC5_ISet slow_controls_data !Lifter EC5 set current Amps +QW_EC5_BrakeSet slow_controls_data !Lifter EC5 set brake value +QW_EC5_ENCRead slow_controls_data !Lifter EC5 read stepper position +QW_EC5_VRead slow_controls_data !Lifter EC5 read Voltage Volts +QW_EC5_IRead slow_controls_data !Lifter EC5 read current Amps +QW_EC5_BrakeRead slow_controls_data !Lifter EC5 read brake value +QW_EC5_Prog slow_controls_data !Lifter EC5 program number +QW_EC5_Out1 slow_controls_data !Lifter EC5 output word 1 +QW_EC5_Out2 slow_controls_data !Lifter EC5 output word 2 +QW_EC5_In1 slow_controls_data !Lifter EC5 input word 1 +QW_EC5_In2 slow_controls_data !Lifter EC5 input word 2 +QW_EC5_Switches slow_controls_data !Lifter EC5 limit switch readback +QW_EC5_AxisStatus slow_controls_data ! +QW_EC5_DriveStatus slow_controls_data ! +QW_EC5_SystemStatus slow_controls_data ! +QW_EC5_ResPos slow_controls_data !Lifter EC5 resistive position readout +QW_PT3 slow_controls_data !Gas panel pressure transducer PT3 psia +QW_PT4 slow_controls_data !Gas panel pressure transducer PT4 psia +QW_PT9 slow_controls_data !Gas panel pressure transducer PT9 psia +QW_PT7 slow_controls_data !Gas panel pressure transducer PT7 psia +QW_PT87 slow_controls_data !Gas panel pressure transducer PT87 psia +QW_PT77 slow_controls_data !Gas panel pressure transducer PT77 psia +QW_PT_Scatt_Chamber slow_controls_data !Scattering Chamber Vacuum psia +QW_PT_Scatt_Chamber_switch slow_controls_data !Scattering Chamber vacuum switch psia +HC_ValveBox_Pos slow_controls_data !Warm return valve position % open +HC_ValveBox_Temp slow_controls_data !Warm return temp K +QW_TgtX0 slow_controls_data !X (Hor) stepper pos for Tgt 0 +QW_TgtY0 slow_controls_data !Y (Ver) stepper pos for Tgt 0 +QW_TgtX1 slow_controls_data ! +QW_TgtY1 slow_controls_data ! +QW_TgtX2 slow_controls_data ! +QW_TgtY2 slow_controls_data ! +QW_TgtX3 slow_controls_data ! +QW_TgtY3 slow_controls_data ! +QW_TgtX4 slow_controls_data ! +QW_TgtY4 slow_controls_data ! +QW_TgtX5 slow_controls_data ! +QW_TgtY5 slow_controls_data ! +QW_TgtX6 slow_controls_data ! +QW_TgtY6 slow_controls_data ! +QW_TgtX7 slow_controls_data ! +QW_TgtY7 slow_controls_data ! +QW_TgtX8 slow_controls_data ! +QW_TgtY8 slow_controls_data ! +QW_TgtX9 slow_controls_data ! +QW_TgtY9 slow_controls_data ! +QW_TgtX10 slow_controls_data ! +QW_TgtY10 slow_controls_data ! +QW_TgtX11 slow_controls_data ! +QW_TgtY11 slow_controls_data ! +QW_TgtX12 slow_controls_data ! +QW_TgtY12 slow_controls_data ! +QW_TgtX13 slow_controls_data ! +QW_TgtY13 slow_controls_data ! +QW_TgtX14 slow_controls_data ! +QW_TgtY14 slow_controls_data ! +QW_TgtX15 slow_controls_data ! +QW_TgtY15 slow_controls_data ! +QW_TgtX16 slow_controls_data ! +QW_TgtY16 slow_controls_data ! +QW_TgtX17 slow_controls_data ! +QW_TgtY17 slow_controls_data ! +QW_TgtX18 slow_controls_data ! +QW_TgtY18 slow_controls_data ! +QW_TgtX19 slow_controls_data ! +QW_TgtY19 slow_controls_data ! +QW_TgtX20 slow_controls_data ! +QW_TgtY20 slow_controls_data ! +QW_TgtX21 slow_controls_data ! +QW_TgtY21 slow_controls_data ! +QW_TgtX22 slow_controls_data ! +QW_TgtY22 slow_controls_data ! +QW_TgtX23 slow_controls_data ! +QW_TgtY23 slow_controls_data ! +QW_TgtX24 slow_controls_data ! +QW_TgtY24 slow_controls_data ! +QW_TgtX25 slow_controls_data ! +QW_TgtY25 slow_controls_data ! +QW_TgtX26 slow_controls_data ! +QW_TgtY26 slow_controls_data ! +QW_Tgt_Raster0 slow_controls_data !Raster requirement for Tgt 0 +QW_Tgt_CurLim0 slow_controls_data !Beam Current Limit for Tgt 0 +QW_Tgt_Raster1 slow_controls_data ! +QW_Tgt_CurLim1 slow_controls_data ! +QW_Tgt_Raster2 slow_controls_data ! +QW_Tgt_CurLim2 slow_controls_data ! +QW_Tgt_Raster3 slow_controls_data ! +QW_Tgt_CurLim3 slow_controls_data ! +QW_Tgt_Raster4 slow_controls_data ! +QW_Tgt_CurLim4 slow_controls_data ! +QW_Tgt_Raster5 slow_controls_data ! +QW_Tgt_CurLim5 slow_controls_data ! +QW_Tgt_Raster6 slow_controls_data ! +QW_Tgt_CurLim6 slow_controls_data ! +QW_Tgt_Raster7 slow_controls_data ! +QW_Tgt_CurLim7 slow_controls_data ! +QW_Tgt_Raster8 slow_controls_data ! +QW_Tgt_CurLim8 slow_controls_data ! +QW_Tgt_Raster9 slow_controls_data ! +QW_Tgt_CurLim9 slow_controls_data ! +QW_Tgt_Raster10 slow_controls_data ! +QW_Tgt_CurLim10 slow_controls_data ! +QW_Tgt_Raster11 slow_controls_data ! +QW_Tgt_CurLim11 slow_controls_data ! +QW_Tgt_Raster12 slow_controls_data ! +QW_Tgt_CurLim12 slow_controls_data ! +QW_Tgt_Raster13 slow_controls_data ! +QW_Tgt_CurLim13 slow_controls_data ! +QW_Tgt_Raster14 slow_controls_data ! +QW_Tgt_CurLim14 slow_controls_data ! +QW_Tgt_Raster15 slow_controls_data ! +QW_Tgt_CurLim15 slow_controls_data ! +QW_Tgt_Raster16 slow_controls_data ! +QW_Tgt_CurLim16 slow_controls_data ! +QW_Tgt_Raster17 slow_controls_data ! +QW_Tgt_CurLim17 slow_controls_data ! +QW_Tgt_Raster18 slow_controls_data ! +QW_Tgt_CurLim18 slow_controls_data ! +QW_Tgt_Raster19 slow_controls_data ! +QW_Tgt_CurLim19 slow_controls_data ! +QW_Tgt_Raster20 slow_controls_data ! +QW_Tgt_CurLim20 slow_controls_data ! +QW_Tgt_Raster21 slow_controls_data ! +QW_Tgt_CurLim21 slow_controls_data ! +QW_Tgt_Raster22 slow_controls_data ! +QW_Tgt_CurLim22 slow_controls_data ! +QW_Tgt_Raster23 slow_controls_data ! +QW_Tgt_CurLim23 slow_controls_data ! +QW_Tgt_Raster24 slow_controls_data ! +QW_Tgt_CurLim24 slow_controls_data ! +QW_Tgt_Raster25 slow_controls_data ! +QW_Tgt_CurLim25 slow_controls_data ! +QW_Tgt_Raster26 slow_controls_data ! +QW_Tgt_CurLim26 slow_controls_data ! +QW_ResEncX slow_controls_data !ADC value of horizontal resistive encoder +QW_ResEncY slow_controls_data !ADC value of vertical resistive encoder +QW_ResEnc_TgtX0 slow_controls_data !Resistive Encoder X (Hor) for Tgt 0 +QW_ResEnc_TgtY0 slow_controls_data !Resistive Encoder Y (Ver) for Tgt 0 +QW_ResEnc_TgtX1 slow_controls_data ! +QW_ResEnc_TgtY1 slow_controls_data ! +QW_ResEnc_TgtX2 slow_controls_data ! +QW_ResEnc_TgtY2 slow_controls_data ! +QW_ResEnc_TgtX3 slow_controls_data ! +QW_ResEnc_TgtY3 slow_controls_data ! +QW_ResEnc_TgtX4 slow_controls_data ! +QW_ResEnc_TgtY4 slow_controls_data ! +QW_ResEnc_TgtX5 slow_controls_data ! +QW_ResEnc_TgtY5 slow_controls_data ! +QW_ResEnc_TgtX6 slow_controls_data ! +QW_ResEnc_TgtY6 slow_controls_data ! +QW_ResEnc_TgtX7 slow_controls_data ! +QW_ResEnc_TgtY7 slow_controls_data ! +QW_ResEnc_TgtX8 slow_controls_data ! +QW_ResEnc_TgtY8 slow_controls_data ! +QW_ResEnc_TgtX9 slow_controls_data ! +QW_ResEnc_TgtY9 slow_controls_data ! +QW_ResEnc_TgtX10 slow_controls_data ! +QW_ResEnc_TgtY10 slow_controls_data ! +QW_ResEnc_TgtX11 slow_controls_data ! +QW_ResEnc_TgtY11 slow_controls_data ! +QW_ResEnc_TgtX12 slow_controls_data ! +QW_ResEnc_TgtY12 slow_controls_data ! +QW_ResEnc_TgtX13 slow_controls_data ! +QW_ResEnc_TgtY13 slow_controls_data ! +QW_ResEnc_TgtX14 slow_controls_data ! +QW_ResEnc_TgtY14 slow_controls_data ! +QW_ResEnc_TgtX15 slow_controls_data ! +QW_ResEnc_TgtY15 slow_controls_data ! +QW_ResEnc_TgtX16 slow_controls_data ! +QW_ResEnc_TgtY16 slow_controls_data ! +QW_ResEnc_TgtX17 slow_controls_data ! +QW_ResEnc_TgtY17 slow_controls_data ! +QW_ResEnc_TgtX18 slow_controls_data ! +QW_ResEnc_TgtY18 slow_controls_data ! +QW_ResEnc_TgtX19 slow_controls_data ! +QW_ResEnc_TgtY19 slow_controls_data ! +QW_ResEnc_TgtX20 slow_controls_data ! +QW_ResEnc_TgtY20 slow_controls_data ! +QW_ResEnc_TgtX21 slow_controls_data ! +QW_ResEnc_TgtY21 slow_controls_data ! +QW_ResEnc_TgtX22 slow_controls_data ! +QW_ResEnc_TgtY22 slow_controls_data ! +QW_ResEnc_TgtX23 slow_controls_data ! +QW_ResEnc_TgtY23 slow_controls_data ! +QW_ResEnc_TgtX24 slow_controls_data ! +QW_ResEnc_TgtY24 slow_controls_data ! +QW_ResEnc_TgtX25 slow_controls_data ! +QW_ResEnc_TgtY25 slow_controls_data ! +QW_ResEnc_TgtX26 slow_controls_data ! +QW_ResEnc_TgtY26 slow_controls_data ! +CFI6731C slow_controls_data !15k Flow g/s +CTD673 slow_controls_data !15K Supply temp at ESR K +CPI673 slow_controls_data !15K Supply pressure at ESR atm +CTD9541 slow_controls_data !20K return temp at ESR K +CPI9541 slow_controls_data !20K return pressure at ESR atm +haCryo_15K_Total_F slow_controls_data !sum of Hall A and Hall C 15K flows g/s +CFI60DLP slow_controls_data !"dirty flowrate" at ESR (warm return) g/s +CTD6614 slow_controls_data !Hall A 15K supply temp K +CFI6711C slow_controls_data !4k Flow g/s +CTD671SC slow_controls_data !4K Supply temp at ESR K +CPI671SC slow_controls_data !4K Supply pressure at ESR atm +CTD672 slow_controls_data !5K return temp at ESR K +CPI672 slow_controls_data !5K return pressure at ESR atm +QWBCM1 slow_controls_data !Beam current in Hall C uA +QWBCM2 slow_controls_data !Beam current in Hall C uA +QWBCM3 slow_controls_data !Beam current in Hall C uA +QWBCM4 slow_controls_data !Beam current in Hall C uA +QWGV_Status slow_controls_data !Status bits of the gate valves +QWHPHIset slow_controls_data !Max Heater Current Set +QWHPHIDACset slow_controls_data !Max Current DAC Set +QWHPHVDACset slow_controls_data !Voltage DAC Set +QWHPHManual slow_controls_data !Manual power setting +QWHPHAuto slow_controls_data !auto power setting +QWHPHheat_pid.ORBV slow_controls_data !Cur Pos +QWHPHheat_pid.OVAL slow_controls_data !Cur Out +QWHPHheat_pid.CVAL slow_controls_data !Cur Inp +QWHPHheat.pidS slow_controls_data !Output +QWHPHheat_pid_VAL slow_controls_data !Set Value +QWHPHmode_bypass.VAL slow_controls_data !Heater mode +QWheat_tot slow_controls_data !Total Power +QWbeam_heat slow_controls_data !Beam Power +! +! The following list of injector/source related Epics variables was provided by Riad Suleiman. +! +VWienAngle slow_controls_data !Vertical Wien Angle +MWF1I04.BDL slow_controls_data !Vertical Wien BDL (G-cm) +IGL1I00OD16_4 polarized_source String !Vertical Wien HV Polarity (on/off) +IGL1I00DAC6 slow_controls_data !Vertical Wien Electrode Voltage +Phi_FG slow_controls_data !Solenoids Angle (Phi_FG) +MFG1I04A.BDL slow_controls_data !First Solenoid BDL (G-cm) +MFG1I04B.BDL slow_controls_data !Second Solenoid BDL (G-cm) +HWienAngle slow_controls_data !Horizontal Wien Angle +MWF0I02.BDL slow_controls_data !Horizontal Wien BDL (G-cm) +IGL1I00OD16_9 slow_controls_data !Horizontal Wien HV Polarity +IGL1I00DAC5 slow_controls_data !Horizontal Wien Electrode Voltage +psub_aa_pos slow_controls_data !Hall A Laser Attenuator (Hall A Laser Attenuator Setting) -- +IGL1I00OD16_16 polarized_source String !IHWP: Insertible Beam Half-wave plate Set(off=out) +IGL1I00DI24_24M polarized_source String !Beam Half-wave plate Read(off=out) () -- +psub_pl_pos slow_controls_data !Rotating waveplate (Rotatable Half Wave Plate Setting) -- +IGLdac3:ao_7 slow_controls_data !IA Cell Setpoint Hall A +IGL1I00AI20 slow_controls_data !IA Cell Setpoint Hall B +IGLdac3:ao_4 slow_controls_data !IA Cell Setpoint Hall C +IGLdac3:ao_5 slow_controls_data !PZT X Setpoint Hall A +IGLdac3:ao_6 slow_controls_data !PZT Y Setpoint Hall A +IGLdac3:ao_0 slow_controls_data !PZT X Setpoint Common (X PZT Voltage ) -- +IGLdac3:ao_1 slow_controls_data !PZT Y Setpoint Common (Y PZT Voltage V) -- +IGLdac2:G2Ch3Pos slow_controls_data !Gun2: PC (PITA) POS +IGLdac2:G2Ch4Neg slow_controls_data !Gun2: PC (PITA) NEG +IGL1I00OD16_8 polarized_source String !Pockels Cell ON/OFF +cdipc_xpos slow_controls_data !Pockels Cell X Stage +cdipc_ypos slow_controls_data !Pockels Cell Y Stage +psub_cx_pos slow_controls_data !Wafer X Stage (X laser position on cathode) -- +psub_cy_pos slow_controls_data !Wafer Y Stage (Y laser position on cathode) -- +SMRPOSA slow_controls_data !Hall A Slit Position (Hall A Chopper Slit Readback) -- +HELCLOCKs slow_controls_data !Helicity Clock Set (result: Free Clock) +HELDELAYs polarized_source String !Helicity Delay Set (result: 8 windows) +HELPATTERNs polarized_source String !Helicity Pattern Set (has a value such as Quartet) +HELCLOCKd slow_controls_data !Helicity Clock Read (result: Free Clock) +HELTSETTLEd slow_controls_data !Helicity Settle Read +HELTSTABLEd slow_controls_data !Helicity Stable Read +HELDELAYd polarized_source String !Helicity Delay Read (result: 8 windows) +HELPATTERNd polarized_source String !Helicity Pattern Read (has a value such as Quartet) +HELFREQ slow_controls_data !Helicity Frequency +! +! The following list is already in the MySql database +! +HC:qint_period slow_controls_data !Charge asymmetry sampling period +laser_a_wavelength slow_controls_data !Hall A laser wavelength nm +HC:0L03_WSUM slow_controls_data !0L03 Charge Asymmetry 4 Wire Sum +! +! psub_cx_pos slow_controls_data !laser position on cathode [already in Riad's list above] +! +SMRPOSB slow_controls_data !Hall B Chopper Slit Readback +R00PGSET slow_controls_data !Prebuncher Setting +IGLdac2:scale_6.A slow_controls_data !Hall B TACO Voltage V +IGL1I00AI27 slow_controls_data !Hall A IA Voltage V +laser_c_wavelength slow_controls_data !Hall C laser wavelength nm +HC:1I04_XDIF slow_controls_data !1I04 X Difference +IGL1I00AI17 slow_controls_data !Dummy Helicity Pockels Cell Voltage V +HC:0L02_DWSUM slow_controls_data !Error on 0L02 Charge Asymmetry 4 Wire Sum +HC:DX_DIF slow_controls_data !dX on X Position Difference to MCC +SMRPOSC slow_controls_data !Hall C Chopper Slit Readback +R00PGMEST slow_controls_data !Prebuncher Setting dB +HC:1I04_DXDIF slow_controls_data !Error on 1I04 X Difference +HC:Q_ASY slow_controls_data !Charge Asymmetry to MCC ppm +HC:1I04_DWSUM slow_controls_data !Error on 1I04 Charge Asymmetry 4 Wire Sum +WienAngle slow_controls_data !Wien Filter Angle Setting degrees +itov2out slow_controls_data !A2 Slit Setting +HC:QPD_XDIF slow_controls_data !QPD X Difference +EHCFR_LIPRC polarized_source !String !Master Focus Location: 1=G0, 0=Pivot +HC:0L02_WSUM slow_controls_data !0L02 Charge Asymmetry 4 Wire Sum +HC:1I04_DYDIF slow_controls_data !Error on 1I04 Y Difference +hel_mag_status.D slow_controls_data !Integrated helicity bit difference +IBCxxxxCRCUR4 slow_controls_data !Hall C MPS BCM Current uA +scaler_calc1 slow_controls_data !Hall B Beam Current (Faraday Cup) nA +! +!psub_cy_pos slow_controls_data !Y laser position on cathode [already in Riad's list above] +! +itov5out slow_controls_data !A3 Slit Setting +IGL1I00DAC3 slow_controls_data !Hall B Seed Level +osc_jitter slow_controls_data !Hall A Laser Phase Jitter +HC:QPD_DWSUM slow_controls_data !Error on QPD Charge Asymmetry 4 Wire Sum +IGL1I00AI24 slow_controls_data !IA Voltage V +HC:P_ONOFF polarized_source String !enable/disable position feedback (ON/OFF) +HC:QPD_WSUM slow_controls_data !QPD Charge Asymmetry 4 Wire Sum +itov7out slow_controls_data !A4 Slit Setting +HC:0L03_DXDIF slow_controls_data !Error on 0L03 X Difference +hallb_transmission slow_controls_data !Hall B Independent Transmission % +! +!SMRPOSA slow_controls_data !Hall A Chopper Slit Readback [already in Riad's list above] +! +HC:0L03_YDIF slow_controls_data !0L03 Y Difference +HC:IBCM_DQASY slow_controls_data !Error on Injector BCM Charge Asymmetry +HC:1I06_DWSUM slow_controls_data !Error on 1I06 Charge Asymmetry 4 Wire Sum +HC:X_DIF slow_controls_data !X Position Difference to MCC +HC:0I05_YDIF slow_controls_data !0I05 Y Difference +IGL1I00DAC2 slow_controls_data !Hall B Control Level +HC:1I06_DXDIF slow_controls_data !Error on 1I06 X Difference +HC:0I05_DWSUM slow_controls_data !Error on 0I05 Charge Asymmetry 4 Wire Sum +HC:QPD_DYDIF slow_controls_data !Error on QPD Y Difference +HC:1I06_WSUM slow_controls_data !1I06 Charge Asymmetry 4 Wire Sum +psub_ab_pos slow_controls_data !Hall B Laser Attenuator Setting +HC:0I05_DYDIF slow_controls_data !Error on 0I05 Y Difference +! +!psub_pl_pos slow_controls_data !Rotatable Half Wave Plate Setting [already in Riad's list above] +! +hallc_photocurrent slow_controls_data !Hall C photocurrent uA +HC:0L02_DYDIF slow_controls_data !Error on 0L02 Y Difference +hac_bcm_average slow_controls_data !Hall A (?) BCM Current uA +ISL0I04DT polarized_source !Master Slit Setting (string value: IN) +IPM2C24A.IENG slow_controls_data !Hall B Beam Current (2C24A) +IBCxxxxCRCUR2 slow_controls_data !Hall A MPS BCM Current uA +HC:0I05_XDIF slow_controls_data !0I05 X Difference +HC:1I02_DYDIF slow_controls_data !Error on 1I02 Y Difference +HC:1I02_DXDIF slow_controls_data !Error on 1I02 X Difference +IGL1I00AI25 slow_controls_data !Hall A X PZT Voltage V +HC:QPD_YDIF slow_controls_data !QPD Y Difference +HC:DY_DIF slow_controls_data !dY on Y Position Difference to MCC +HC:QPD_DXDIF slow_controls_data !Error on QPD X Difference +IGL1I00AI8 slow_controls_data !Gun 2 PITA Voltage Negative V +itov1out slow_controls_data !A1 Slit Setting +qe_halla slow_controls_data !Hall A Quantum Efficiency % +HC:1I02_DWSUM slow_controls_data !Error on 1I02 Charge Asymmetry 4 Wire Sum +hallb_photocurrent slow_controls_data !Hall B photocurrent uA +HC:0L02_XDIF slow_controls_data !0L02 X Difference +HC:1I02_WSUM slow_controls_data !1I02 Charge Asymmetry 4 Wire Sum +hallc_transmission slow_controls_data !Hall C Independent Transmission % +HC:IBCM_QASY slow_controls_data !Injector BCM Charge Asymmetry +! +IGL1I00AI23 slow_controls_data !G0 Y PZT Voltage V [still exists] +IGL1I00AI22 slow_controls_data !G0 X PZT Voltage V [still exists] +! +!IGLdac3:ao_1 slow_controls_data !Y PZT Voltage V [already in Riad's list above] +!IGLdac3:ao_0 slow_controls_data !X PZT Voltage [already in Riad's list above] +! +HC:Y_DIF slow_controls_data !Y Position Difference to MCC +qe_hallb slow_controls_data !Hall B Quantum Efficiency % +IGL1I00AI26 slow_controls_data !Hall A Y PZT Voltage V +laser_b_wavelength slow_controls_data !Hall B laser wavelength nm +! +!psub_aa_pos slow_controls_data !Hall A Laser Attenuator Setting [already in Riad's list above] +! +HC:1I06_YDIF slow_controls_data !1I06 Y Difference +HC:1I02_YDIF slow_controls_data !1I02 Y Difference +HC:DQ_ASY slow_controls_data !Charge Asymmetry Uncertainty ppm +HC:0L02_YDIF slow_controls_data !0L02 Y Difference +IBCxxxxCLOSS slow_controls_data !Machine Energy Loss +psub_ac_pos slow_controls_data !Hall C Laser Attenuator Setting +IGL1I00AI7 slow_controls_data !Gun 2 PITA Voltage Positive V +HC:1I04_YDIF slow_controls_data !1I04 Y Difference +qe_hallc slow_controls_data !Hall C Quantum Efficiency % +HC:0L03_DYDIF slow_controls_data !Error on 0L03 Y Difference +HC:0L03_DWSUM slow_controls_data !Error on 0L03 Charge Asymmetry 4 Wire Sum +HC:0L03_XDIF slow_controls_data !0L03 X Difference +halla_photocurrent slow_controls_data !Hall A photocurrent uA +HC:1I06_XDIF slow_controls_data !1I06 X Difference +IGL1I00PStrans slow_controls_data !Injector transmission +HC:pint_period slow_controls_data !Position difference sampling period +HC:0L02_DXDIF slow_controls_data !Error on 0L02 X Difference +osc2_jitter slow_controls_data !Hall C Laser Phase Jitter +halla_transmission slow_controls_data !Hall A Independent Transmission % +HC:1I04_WSUM slow_controls_data !1I04 Charge Asymmetry 4 Wire Sum +HC:1I06_DYDIF slow_controls_data !Error on 1I06 Y Difference +HC:1I02_XDIF slow_controls_data !1I02 X Difference +HC:0I05_WSUM slow_controls_data !0I05 Charge Asymmetry 4 Wire Sum +HC:bcm_threshold slow_controls_data !BCM threshold cut for charge feedback uA +ibcm1 slow_controls_data !Hall C Beam Current (monitor 1): careful, this is also in target epics +ibcm2 slow_controls_data !Hall C Beam Current (monitor 2): careful, this is also in target epics +HC:bcm_select polarized_source !String ! (result: BCM2) +! +!IGL1I00DI24_24M slow_controls_data ![already in Riad's list above] +! +EHCFR_LIXWidth slow_controls_data ! +EHCFR_LIYWidth slow_controls_data ! +EHCFR_ENERGY slow_controls_data ! +! +!IGL1I00DI24_24M slow_controls_data ![This was repeated, see by 4 variables above] +! +HC:0I05_DXIF slow_controls_data !Error on 0I05 X Difference +! +!Epics variables from Hall C beamline BPM and BCM for their auto-gains +! +IPM3C17.XIFG slow_controls_data !stripline bpm x position auto-gain +IPM3C17.YIFG slow_controls_data ! stripline bpm y position auto-gain +IBC3C17.XIFG slow_controls_data !bcm x position auto-gain +IBC3C17.YIFG slow_controls_data !bcm y position auto-gain +IPM3C18.XIFG slow_controls_data ! +IPM3C18.YIFG slow_controls_data ! +IPM3C19.XIFG slow_controls_data ! +IPM3C19.YIFG slow_controls_data ! +IPM3P01.XIFG slow_controls_data ! +IPM3P01.YIFG slow_controls_data ! +IPM3P02A.XIFG slow_controls_data ! +IPM3P02A.YIFG slow_controls_data ! +IPM3P03A.XIFG slow_controls_data ! +IPM3P03A.YIFG slow_controls_data ! +IPM3P02B.XIFG slow_controls_data ! +IPM3P02B.YIFG slow_controls_data ! +IPM3C20.XIFG slow_controls_data ! +IPM3C20.YIFG slow_controls_data ! +IPM3C21.XIFG slow_controls_data ! +IPM3C21.YIFG slow_controls_data ! +IPM3H02.XIFG slow_controls_data ! +IPM3H02.YIFG slow_controls_data ! +IPM3H04.XIFG slow_controls_data ! +IPM3H04.YIFG slow_controls_data ! +! +IPM3H04H slow_controls_data !cavity bpm horizontal +IPM3H04V slow_controls_data !cavity bpm vertical +IBC3H04 slow_controls_data !cavity bcm +IBC3H05 slow_controls_data !hall C bcm (i.e., ibcm1) +IBC3H05A slow_controls_data !hall C bcm (i.e., ibcm2) +! +IPM3H07A.XIFG slow_controls_data ! +IPM3H07A.YIFG slow_controls_data ! +IPM3H07B.XIFG slow_controls_data ! +IPM3H07B.YIFG slow_controls_data ! +IPM3H07C.XIFG slow_controls_data ! +IPM3H07C.YIFG slow_controls_data ! +IPM3H09.XIFG slow_controls_data ! +IPM3H09.YIFG slow_controls_data ! +! +IPM3H09AH slow_controls_data ! +IPM3H09AV slow_controls_data ! +IBC3H09 slow_controls_data ! +! +IPM3H09B.XIFG slow_controls_data ! +IPM3H09B.YIFG slow_controls_data ! +! +!Epics variables from Hall C beamline BPM and BCM for their X and Y positions +! +IPM3C17.XPOS slow_controls_data !stripline bpm x position +IPM3C17.YPOS slow_controls_data !stripline bpm y position +IBC3C17.XPOS slow_controls_data !bcm x position +IBC3C17.YPOS slow_controls_data !bcm y position +IPM3C18.XPOS slow_controls_data ! +IPM3C18.YPOS slow_controls_data ! +IPM3C19.XPOS slow_controls_data ! +IPM3C19.YPOS slow_controls_data ! +IPM3P01.XPOS slow_controls_data ! +IPM3P01.YPOS slow_controls_data ! +IPM3P02A.XPOS slow_controls_data ! +IPM3P02A.YPOS slow_controls_data ! +IPM3P03A.XPOS slow_controls_data ! +IPM3P03A.YPOS slow_controls_data ! +IPM3P02B.XPOS slow_controls_data ! +IPM3P02B.YPOS slow_controls_data ! +IPM3C20.XPOS slow_controls_data ! +IPM3C20.YPOS slow_controls_data ! +IPM3C21.XPOS slow_controls_data ! +IPM3C21.YPOS slow_controls_data ! +IPM3H02.XPOS slow_controls_data ! +IPM3H02.YPOS slow_controls_data ! +IPM3H04.XPOS slow_controls_data ! +IPM3H04.YPOS slow_controls_data ! +! +IPM3H07A.XPOS slow_controls_data ! +IPM3H07A.YPOS slow_controls_data ! +IPM3H07B.XPOS slow_controls_data ! +IPM3H07B.YPOS slow_controls_data ! +IPM3H07C.XPOS slow_controls_data ! +IPM3H07C.YPOS slow_controls_data ! +IPM3H09.XPOS slow_controls_data ! +IPM3H09.YPOS slow_controls_data ! +! +IPM3H09B.XPOS slow_controls_data ! +IPM3H09B.YPOS slow_controls_data ! +! +!Epics variables from Hall C beamline BPM and BCM for their X and Y position offsets +! +IPM3C17.XSOF slow_controls_data !stripline bpm x position offset +IPM3C17.YSOF slow_controls_data ! stripline bpm y position offset +IBC3C17.XSOF slow_controls_data !bcm x position offset +IBC3C17.YSOF slow_controls_data !bcm y position offset +IPM3C18.XSOF slow_controls_data ! +IPM3C18.YSOF slow_controls_data ! +IPM3C19.XSOF slow_controls_data ! +IPM3C19.YSOF slow_controls_data ! +IPM3P01.XSOF slow_controls_data ! +IPM3P01.YSOF slow_controls_data ! +IPM3P02A.XSOF slow_controls_data ! +IPM3P02A.YSOF slow_controls_data ! +IPM3P03A.XSOF slow_controls_data ! +IPM3P03A.YSOF slow_controls_data ! +IPM3P02B.XSOF slow_controls_data ! +IPM3P02B.YSOF slow_controls_data ! +IPM3C20.XSOF slow_controls_data ! +IPM3C20.YSOF slow_controls_data ! +IPM3C21.XSOF slow_controls_data ! +IPM3C21.YSOF slow_controls_data ! +IPM3H02.XSOF slow_controls_data ! +IPM3H02.YSOF slow_controls_data ! +IPM3H04.XSOF slow_controls_data ! +IPM3H04.YSOF slow_controls_data ! +! +IPM3H07A.XSOF slow_controls_data ! +IPM3H07A.YSOF slow_controls_data ! +IPM3H07B.XSOF slow_controls_data ! +IPM3H07B.YSOF slow_controls_data ! +IPM3H07C.XSOF slow_controls_data ! +IPM3H07C.YSOF slow_controls_data ! +IPM3H09.XSOF slow_controls_data ! +IPM3H09.YSOF slow_controls_data ! +! +IPM3H09B.XSOF slow_controls_data ! +IPM3H09B.YSOF slow_controls_data ! +! +! Miscellaneous epics variables: +HC:Q_ONOFF polarized_source !String !Charge feedback (ON/OFF) +! Epics variables for Compton missing. +! +! Fast Feedback (copied from G0 epics.dictionary) +! +FB_A:FB_On polarized_source !String !fast feedback Hall A status (result: OFF) +FB_C:FB_On polarized_source !String !fast feedback Hall C status (result: OFF) +FB_C:status:mbbi2.B7 slow_controls_data !1 or 0 !fast feedback Hall C status flag +FB_C:use_RF polarized_source !String !fast energy lock Hall C status (result: RF OFF) +FB_A:use_RF polarized_source !String !fast energy lock Hall A status (result: RF ON) +FB_A:status:mbbi2.B7 slow_controls_data !1 or 0 !fast feedback Hall A status flag +! +! Hall C Moller information (copied from G0 epics.dictionary) +! +OXSS_RDF slow_controls_data !Leads Field +OXSS_MGFD slow_controls_data !Persistent Field (T) +TARGPOS slow_controls_data !Target position X +COLPOS1 slow_controls_data !Collimator Block 1 +COLPOS2 slow_controls_data !Collimator Block 2 +COLPOS3 slow_controls_data !Collimator Block 3 +COLPOS4 slow_controls_data !Collimator Block 4 +COLPOS5 slow_controls_data !Collimator Block 5 +COLPOS6 slow_controls_data !Collimator Block 6 +COLPOS7 slow_controls_data !Collimator Block 7 +!MHCMQ2SETI slow_controls_data !Supply Set (A) +!MHCMQ2IRBCK slow_controls_data !Current ReadBack (A) +!MQE3M02.S slow_controls_data !Current Set (A) +!The "result" indicates the result obtained from caget command. + +! Added Qtor related 4 variables: qw:qt_mps_i_target,qw:qt_mps_i_set, qw:qt_mps_i_dcct, Q1HallP + +qw:qt_mps_i_target slow_controls_data ! Qtor target curret +qw:qt_mps_i_set slow_controls_data ! Qtor set current +qw:qt_mps_i_dcct slow_controls_data ! Qtor DCCT +Q1HallP slow_controls_data ! Qtor magnetic field read by Hall Probe 1 +! +! +! +! +FB_C:CORR:C1_value.B slow_controls_data ! FFB corrector magnet 1 value +FB_C:CORR:C2_value.B slow_controls_data ! FFB corrector magnet 2 value +FB_C:CORR:C3_value.B slow_controls_data ! FFB corrector magnet 3 value +FB_C:CORR:C4_value.B slow_controls_data ! FFB corrector magnet 4 value +IBC1H04CRCUR2 slow_controls_data ! Hall A MPS BCM Current uA +IBC3H00CRCUR4 slow_controls_data ! Hall C MPS BCM Current uA +IFY0I06I slow_controls_data ! PolCup position: FC1 (is/is not) inserted +IFY0I06R slow_controls_data ! PolCup position: FC1 (is/is not) retracted +IFY0L03I slow_controls_data ! PolCup position: FC2 (is/is not) inserted +IFY0L03R slow_controls_data ! PolCup position: FC2 (is/is not) retracted +IFY1I07I slow_controls_data ! PolCup position: PolCup (is/is not) inserted +IFY1I07R slow_controls_data ! PolCup position: PolCup (is/is not) retracted +IOCSE14:PassSel;r slow_controls_data !String ! IOCSE14 Auto Select +IOCSE14:SEEGainMod;r slow_controls_data !String ! IOCSE14 Auto Gain +IOCSE14:SEEProcMod;r slow_controls_data !String ! IOCSE14 SEE Norm Ops +IOCSE17:PassSel;r slow_controls_data !String ! IOCSE17 Auto Select +IOCSE17:SEEGainMod;r slow_controls_data !String ! IOCSE17 Auto Gain +IOCSE17:SEEProcMod;r slow_controls_data !String ! IOCSE17 SEE Norm Ops +IOCSE18:PassSel;r slow_controls_data !String ! IOCSE18 Auto Select +IOCSE18:SEEGainMod;r slow_controls_data !String ! IOCSE18 Auto Gain +IOCSE18:SEEProcMod;r slow_controls_data !String ! IOCSE18 SEE Norm Ops +IOCSE20:PassSel;r slow_controls_data !String ! IOCSE20 Auto Select +IOCSE20:SEEGainMod;r slow_controls_data !String ! IOCSE20 Auto Gain +IOCSE20:SEEProcMod;r slow_controls_data !String ! IOCSE20 SEE Norm Ops +VCG3H09BTr slow_controls_data ! Scattering Chamber Vacuum psia +qw:exitwindow slow_controls_data ! Exit window temp (C) +rad45_p1 slow_controls_data ! Gamma radiation monitor in Qweak detector shieldhouse +rad45_p2 slow_controls_data ! Neutron radiation monitor in Qweak detector shieldhouse +IGL1I00DIOHWTB.B2 slow_controls_data ! Passive IHWP setting (0=in,1=out) +IGL1I00DIOFLRD slow_controls_data ! Passive IHWP readback (13056=IN,8960=OUT) +hel_even_1 slow_controls_data ! HelicityMagnet MHE0L01V Even Setpoint +hel_even_2 slow_controls_data ! HelicityMagnet MHE0L02H Even Setpoint +hel_even_3 slow_controls_data ! HelicityMagnet MHE0L03V Even Setpoint +hel_even_4 slow_controls_data ! HelicityMagnet MHE0L03H Even Setpoint +hel_odd_1 slow_controls_data ! HelicityMagnet MHE0L01V Odd Setpoint +hel_odd_2 slow_controls_data ! HelicityMagnet MHE0L02H Odd Setpoint +hel_odd_3 slow_controls_data ! HelicityMagnet MHE0L03V Odd Setpoint +hel_odd_4 slow_controls_data ! HelicityMagnet MHE0L03H Odd Setpoint +!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! +! Composite slow control variables +! These are variables for which there is not an actual EPICS variable, +! but a value is generated internally by the QwEPICSEvent class. +!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! +WienMode slow_controls_data String ! This will indicate the spin direction in the hall as defined by the Wien setting + precession + diff --git a/Analysis/prminput/EpicsTable.map b/Analysis/prminput/EpicsTable.map new file mode 100644 index 000000000..5aad32c68 --- /dev/null +++ b/Analysis/prminput/EpicsTable.map @@ -0,0 +1,720 @@ +! The exclamation mark (!) is for comment in this file. +! +! 06-17-2011: added Qtor related 4 variables: qw:qt_mps_i_target,qw:qt_mps_i_set, qw:qt_mps_i_dcct, Q1HallP +! 07-08-2010: added "String" in more variables by identifying them using +! caget epicsVarName (e.g. caget QW_T_miA) in a machine where caget command can be issued. +! +! 06-28-2010: first svn commit of this table (rsubedi) +! Table for epics variables whose values can be stored in a MySQL database. +! This table has three columns. The first column is the name for an epics +! variable. The second column at the moment is just a flag to insert epics data +! in the MySQL database. The third column is related to those epics variables +! that have only string-value (e.g. the epics varaible for the half wave plate +! is IGL1I00DI24_24M and has either IN or OUT value). +! +! +!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! +! Special keywords +!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! +NominalWienAngle = 30.0 ! This is the "nominal" Wien launch angle in degrees needed to have the spin pointing FORWARD for H+ when IHWP OUT & the Wien is Flip-Right (or Horizontal-Only) + +!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! +! NAME DB_TABLE TYPE COMMENT +!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! +QWTGTPOS slow_controls_data !Vertical position of the target +QWtgt_name slow_controls_data String ! Name of the target position +QWT_miA slow_controls_data !Temp A at manifold inlet K Cernox +QWT_moA slow_controls_data !Temp A at manifold outlet K Cernox +QWT_hxiA slow_controls_data !Temp A at heat exchanger inlet K Cernox Phytron brake +QWT_hxoA slow_controls_data !Temp A at heat exchanger outlet K Cernox Phytron home switch +QWT_piA slow_controls_data !Temp A at pump inlet K Cernox GV open switch +! slow_controls_data !GV closed switch [something to be added here] +QWT_miB slow_controls_data !Temp B at manifold inlet K Cernox Turbo status *5? +QWT_moB slow_controls_data !Temp B at manifold outlet K Cernox CCG *5? +QWT_hxiB slow_controls_data !Temp B at heat exchanger inlet K Cernox Ballast vacuum +QWT_hxoB slow_controls_data !Temp B at heat exchanger outlet K Cernox +QWT_piB slow_controls_data !Temp B at pump inlet K Cernox +QWT_ladderA slow_controls_data !Temp A on dummy tgt ladder K +QWT_USdmA slow_controls_data !Temp A on upstream dummy frame K +QWT_DSdmA slow_controls_data !Temp A on downstream dummy frame K +QWT_phytronA slow_controls_data !Temp A on Phytron motor K +QWT_tableA slow_controls_data !Temp A on Horizontal Motion table K +QWT_ladderB slow_controls_data !Temp B on dummy tgt ladder K +QWT_USdmB slow_controls_data !Temp B on upstream dummy frame K +QWT_DSdmB slow_controls_data !Temp B on downstream dummy frame K +QWT_phytronB slow_controls_data !Temp B on Phytron motor K +QWT_tableB slow_controls_data !Temp B on Horizontal Motion table K +QWT_solidA slow_controls_data !Temp A on solid target frame K +QWT_solidB slow_controls_data !Temp B on solid target frame K +QWT_spareA slow_controls_data !K +QWT_spareB slow_controls_data !K +QWT_pumpA slow_controls_data !Temp A on pump motor house K +QWT_pumpB slow_controls_data !Temp B on pump motor house K +! slow_controls_data !K [something to be added here] +QWT_4kjt slow_controls_data !Coolant Temp at outlet of 4K JT valve K Cernox +QWT_4ko slow_controls_data !Temp of returning 4K coolant K Cernox +QWT_15kjt slow_controls_data !Coolant Temp at outlet of 15K JT valve K Cernox +QWT_15ko slow_controls_data !Temp of returning 15K coolant K Cernox +QW_Pmp_TachSet slow_controls_data !Set value for pump tach Hz +QW_Pmp_VSet slow_controls_data !Set value for pump voltage Volts +QW_Pmp_I1Set slow_controls_data !Set value for pump current phase 1 Amps +QW_Pmp_I2Set slow_controls_data !Set value for pump current phase 2 Amps +QW_Pmp_I3Set slow_controls_data !Set value for pump current phase 3 Amps +QW_Pmp_TachRead slow_controls_data !Read value for pump tach Hz +QW_Pmp_VRead slow_controls_data !Read value for pump voltage Volts +QW_Pmp_I1Read slow_controls_data !Read value for pump current phase 1 Amps +QW_Pmp_I2Read slow_controls_data !Read value for pump current phase 2 Amps +QW_Pmp_I3Read slow_controls_data !Read value for pump current phase 3 Amps +QW_Pmp_Status1 slow_controls_data !Pump controller status bits +QW_Pmp_Status2 slow_controls_data !Pump controller status bits +QW_HPH_ISet slow_controls_data !High Power Heater set current limit Amps +QW_HPH_VSet slow_controls_data !High Power Heater set voltage Volts +QW_HPH_PSet slow_controls_data !High Power Heater set (calculated) power Watts +QW_HPH_IRead slow_controls_data !High Power Heater read current Amps +QW_HPH_VRead slow_controls_data !High Power Heater read voltage Volts +QW_HPH_PRead slow_controls_data !High Power Heater read power Watts +QW_HPH__PID slow_controls_data !Pid mode on or off +QW_HPH_TSet slow_controls_data !HPH set temperature K +QW_HPH_TRead slow_controls_data !HPH read/current temperature K +QW_HPH_Beam_Comp_Switch slow_controls_data !HPH beam compensation switch +QW_pbeam slow_controls_data !Calculated beam power Watts +QW_ibeam slow_controls_data !Beam current uA +QW_HPH_Pmax slow_controls_data !Maximum Heater Power W +QW_HPH_Pman slow_controls_data !smitghg Manual power setting W +QW_HPH_R slow_controls_data !Heater resistance Ohms +QW_HPH_OnOff slow_controls_data !Heater mode +QW_HPH_bmcomp1 slow_controls_data !beam compensation parameter 1 (length) cm +QW_HPH_bmcomp2 slow_controls_data !beam compensation parameter 2 (density) g/cc +QW_HPH_bmcomp3 slow_controls_data !beam compensation parameter 3 (dE/dx) MeV/g/cm^2 +QW_HPH_bmcomp4 slow_controls_data !beam compensation parameter 4 (spare) +QW_HPH_Prop slow_controls_data !PID proportinal gain (typ 600) +QW_HPH_Integ slow_controls_data !PID integral gain (typ 40) +QW_HPH_Deriv slow_controls_data !PID derivative gain (typ 0) +QW_HPH_Scan slow_controls_data !Scan time for PID (typ 1) s +QW_HPH_dmin slow_controls_data !minimum change in power per scan W +QW_HPH_dmax slow_controls_data !maximum change in power per scan W +QW_JT_4Kset slow_controls_data ! +QW_JT_4KRead slow_controls_data ! +QW_JT_4KStep slow_controls_data !4K JT Step size +QW_JT_15KSet slow_controls_data ! +QW_JT_15LRead slow_controls_data ! +QW_JT_15KStep slow_controls_data !15K JT Step size +QW_Phy_ENCSet slow_controls_data !Hor. Motion Phytron set stepper position +QW_Phy_VSet slow_controls_data !Hor. Motion Phytron set Voltage Volts +QW_Phy_ISet slow_controls_data !Hor. Motion Phytron set current Amps +QW_Phy_BrakeSet slow_controls_data !Hor. Motion Phytron set brake value +QW_Phy_ENCRead slow_controls_data !Hor. Motion Phytron read stepper position +QW_Phy_VRead slow_controls_data !Hor. Motion Phytron read Voltage Volts +QW_Phy_IRead slow_controls_data !Hor. Motion Phytron read current Amps +QW_Phy_BrakeRead slow_controls_data !Hor. Motion Phytron read brake value +QW_Phy_Prog slow_controls_data !Hor. Motion Phytron program number +QW_Phy_Out1 slow_controls_data !Hor. Motion Phytron output word 1 +QW_Phy_Out2 slow_controls_data !Hor. Motion Phytron output word 2 +QW_Phy_In1 slow_controls_data !Hor. Motion Phytron input word 1 +QW_Phy_In2 slow_controls_data !Hor. Motion Phytron input word 2 +QW_Phy_Switches slow_controls_data !Hor. Motion Phytron limit switch readback +QW_Phy_ResPos slow_controls_data !Hor. Motion resistive position readout +QW_EC5_ENCSet slow_controls_data !Lifter EC5 set stepper position +QW_EC5_VSet slow_controls_data !Lifter EC5 set Voltage Volts +QW_EC5_ISet slow_controls_data !Lifter EC5 set current Amps +QW_EC5_BrakeSet slow_controls_data !Lifter EC5 set brake value +QW_EC5_ENCRead slow_controls_data !Lifter EC5 read stepper position +QW_EC5_VRead slow_controls_data !Lifter EC5 read Voltage Volts +QW_EC5_IRead slow_controls_data !Lifter EC5 read current Amps +QW_EC5_BrakeRead slow_controls_data !Lifter EC5 read brake value +QW_EC5_Prog slow_controls_data !Lifter EC5 program number +QW_EC5_Out1 slow_controls_data !Lifter EC5 output word 1 +QW_EC5_Out2 slow_controls_data !Lifter EC5 output word 2 +QW_EC5_In1 slow_controls_data !Lifter EC5 input word 1 +QW_EC5_In2 slow_controls_data !Lifter EC5 input word 2 +QW_EC5_Switches slow_controls_data !Lifter EC5 limit switch readback +QW_EC5_AxisStatus slow_controls_data ! +QW_EC5_DriveStatus slow_controls_data ! +QW_EC5_SystemStatus slow_controls_data ! +QW_EC5_ResPos slow_controls_data !Lifter EC5 resistive position readout +QW_PT3 slow_controls_data !Gas panel pressure transducer PT3 psia +QW_PT4 slow_controls_data !Gas panel pressure transducer PT4 psia +QW_PT9 slow_controls_data !Gas panel pressure transducer PT9 psia +QW_PT7 slow_controls_data !Gas panel pressure transducer PT7 psia +QW_PT87 slow_controls_data !Gas panel pressure transducer PT87 psia +QW_PT77 slow_controls_data !Gas panel pressure transducer PT77 psia +QW_PT_Scatt_Chamber slow_controls_data !Scattering Chamber Vacuum psia +QW_PT_Scatt_Chamber_switch slow_controls_data !Scattering Chamber vacuum switch psia +HC_ValveBox_Pos slow_controls_data !Warm return valve position % open +HC_ValveBox_Temp slow_controls_data !Warm return temp K +QW_TgtX0 slow_controls_data !X (Hor) stepper pos for Tgt 0 +QW_TgtY0 slow_controls_data !Y (Ver) stepper pos for Tgt 0 +QW_TgtX1 slow_controls_data ! +QW_TgtY1 slow_controls_data ! +QW_TgtX2 slow_controls_data ! +QW_TgtY2 slow_controls_data ! +QW_TgtX3 slow_controls_data ! +QW_TgtY3 slow_controls_data ! +QW_TgtX4 slow_controls_data ! +QW_TgtY4 slow_controls_data ! +QW_TgtX5 slow_controls_data ! +QW_TgtY5 slow_controls_data ! +QW_TgtX6 slow_controls_data ! +QW_TgtY6 slow_controls_data ! +QW_TgtX7 slow_controls_data ! +QW_TgtY7 slow_controls_data ! +QW_TgtX8 slow_controls_data ! +QW_TgtY8 slow_controls_data ! +QW_TgtX9 slow_controls_data ! +QW_TgtY9 slow_controls_data ! +QW_TgtX10 slow_controls_data ! +QW_TgtY10 slow_controls_data ! +QW_TgtX11 slow_controls_data ! +QW_TgtY11 slow_controls_data ! +QW_TgtX12 slow_controls_data ! +QW_TgtY12 slow_controls_data ! +QW_TgtX13 slow_controls_data ! +QW_TgtY13 slow_controls_data ! +QW_TgtX14 slow_controls_data ! +QW_TgtY14 slow_controls_data ! +QW_TgtX15 slow_controls_data ! +QW_TgtY15 slow_controls_data ! +QW_TgtX16 slow_controls_data ! +QW_TgtY16 slow_controls_data ! +QW_TgtX17 slow_controls_data ! +QW_TgtY17 slow_controls_data ! +QW_TgtX18 slow_controls_data ! +QW_TgtY18 slow_controls_data ! +QW_TgtX19 slow_controls_data ! +QW_TgtY19 slow_controls_data ! +QW_TgtX20 slow_controls_data ! +QW_TgtY20 slow_controls_data ! +QW_TgtX21 slow_controls_data ! +QW_TgtY21 slow_controls_data ! +QW_TgtX22 slow_controls_data ! +QW_TgtY22 slow_controls_data ! +QW_TgtX23 slow_controls_data ! +QW_TgtY23 slow_controls_data ! +QW_TgtX24 slow_controls_data ! +QW_TgtY24 slow_controls_data ! +QW_TgtX25 slow_controls_data ! +QW_TgtY25 slow_controls_data ! +QW_TgtX26 slow_controls_data ! +QW_TgtY26 slow_controls_data ! +QW_Tgt_Raster0 slow_controls_data !Raster requirement for Tgt 0 +QW_Tgt_CurLim0 slow_controls_data !Beam Current Limit for Tgt 0 +QW_Tgt_Raster1 slow_controls_data ! +QW_Tgt_CurLim1 slow_controls_data ! +QW_Tgt_Raster2 slow_controls_data ! +QW_Tgt_CurLim2 slow_controls_data ! +QW_Tgt_Raster3 slow_controls_data ! +QW_Tgt_CurLim3 slow_controls_data ! +QW_Tgt_Raster4 slow_controls_data ! +QW_Tgt_CurLim4 slow_controls_data ! +QW_Tgt_Raster5 slow_controls_data ! +QW_Tgt_CurLim5 slow_controls_data ! +QW_Tgt_Raster6 slow_controls_data ! +QW_Tgt_CurLim6 slow_controls_data ! +QW_Tgt_Raster7 slow_controls_data ! +QW_Tgt_CurLim7 slow_controls_data ! +QW_Tgt_Raster8 slow_controls_data ! +QW_Tgt_CurLim8 slow_controls_data ! +QW_Tgt_Raster9 slow_controls_data ! +QW_Tgt_CurLim9 slow_controls_data ! +QW_Tgt_Raster10 slow_controls_data ! +QW_Tgt_CurLim10 slow_controls_data ! +QW_Tgt_Raster11 slow_controls_data ! +QW_Tgt_CurLim11 slow_controls_data ! +QW_Tgt_Raster12 slow_controls_data ! +QW_Tgt_CurLim12 slow_controls_data ! +QW_Tgt_Raster13 slow_controls_data ! +QW_Tgt_CurLim13 slow_controls_data ! +QW_Tgt_Raster14 slow_controls_data ! +QW_Tgt_CurLim14 slow_controls_data ! +QW_Tgt_Raster15 slow_controls_data ! +QW_Tgt_CurLim15 slow_controls_data ! +QW_Tgt_Raster16 slow_controls_data ! +QW_Tgt_CurLim16 slow_controls_data ! +QW_Tgt_Raster17 slow_controls_data ! +QW_Tgt_CurLim17 slow_controls_data ! +QW_Tgt_Raster18 slow_controls_data ! +QW_Tgt_CurLim18 slow_controls_data ! +QW_Tgt_Raster19 slow_controls_data ! +QW_Tgt_CurLim19 slow_controls_data ! +QW_Tgt_Raster20 slow_controls_data ! +QW_Tgt_CurLim20 slow_controls_data ! +QW_Tgt_Raster21 slow_controls_data ! +QW_Tgt_CurLim21 slow_controls_data ! +QW_Tgt_Raster22 slow_controls_data ! +QW_Tgt_CurLim22 slow_controls_data ! +QW_Tgt_Raster23 slow_controls_data ! +QW_Tgt_CurLim23 slow_controls_data ! +QW_Tgt_Raster24 slow_controls_data ! +QW_Tgt_CurLim24 slow_controls_data ! +QW_Tgt_Raster25 slow_controls_data ! +QW_Tgt_CurLim25 slow_controls_data ! +QW_Tgt_Raster26 slow_controls_data ! +QW_Tgt_CurLim26 slow_controls_data ! +QW_ResEncX slow_controls_data !ADC value of horizontal resistive encoder +QW_ResEncY slow_controls_data !ADC value of vertical resistive encoder +QW_ResEnc_TgtX0 slow_controls_data !Resistive Encoder X (Hor) for Tgt 0 +QW_ResEnc_TgtY0 slow_controls_data !Resistive Encoder Y (Ver) for Tgt 0 +QW_ResEnc_TgtX1 slow_controls_data ! +QW_ResEnc_TgtY1 slow_controls_data ! +QW_ResEnc_TgtX2 slow_controls_data ! +QW_ResEnc_TgtY2 slow_controls_data ! +QW_ResEnc_TgtX3 slow_controls_data ! +QW_ResEnc_TgtY3 slow_controls_data ! +QW_ResEnc_TgtX4 slow_controls_data ! +QW_ResEnc_TgtY4 slow_controls_data ! +QW_ResEnc_TgtX5 slow_controls_data ! +QW_ResEnc_TgtY5 slow_controls_data ! +QW_ResEnc_TgtX6 slow_controls_data ! +QW_ResEnc_TgtY6 slow_controls_data ! +QW_ResEnc_TgtX7 slow_controls_data ! +QW_ResEnc_TgtY7 slow_controls_data ! +QW_ResEnc_TgtX8 slow_controls_data ! +QW_ResEnc_TgtY8 slow_controls_data ! +QW_ResEnc_TgtX9 slow_controls_data ! +QW_ResEnc_TgtY9 slow_controls_data ! +QW_ResEnc_TgtX10 slow_controls_data ! +QW_ResEnc_TgtY10 slow_controls_data ! +QW_ResEnc_TgtX11 slow_controls_data ! +QW_ResEnc_TgtY11 slow_controls_data ! +QW_ResEnc_TgtX12 slow_controls_data ! +QW_ResEnc_TgtY12 slow_controls_data ! +QW_ResEnc_TgtX13 slow_controls_data ! +QW_ResEnc_TgtY13 slow_controls_data ! +QW_ResEnc_TgtX14 slow_controls_data ! +QW_ResEnc_TgtY14 slow_controls_data ! +QW_ResEnc_TgtX15 slow_controls_data ! +QW_ResEnc_TgtY15 slow_controls_data ! +QW_ResEnc_TgtX16 slow_controls_data ! +QW_ResEnc_TgtY16 slow_controls_data ! +QW_ResEnc_TgtX17 slow_controls_data ! +QW_ResEnc_TgtY17 slow_controls_data ! +QW_ResEnc_TgtX18 slow_controls_data ! +QW_ResEnc_TgtY18 slow_controls_data ! +QW_ResEnc_TgtX19 slow_controls_data ! +QW_ResEnc_TgtY19 slow_controls_data ! +QW_ResEnc_TgtX20 slow_controls_data ! +QW_ResEnc_TgtY20 slow_controls_data ! +QW_ResEnc_TgtX21 slow_controls_data ! +QW_ResEnc_TgtY21 slow_controls_data ! +QW_ResEnc_TgtX22 slow_controls_data ! +QW_ResEnc_TgtY22 slow_controls_data ! +QW_ResEnc_TgtX23 slow_controls_data ! +QW_ResEnc_TgtY23 slow_controls_data ! +QW_ResEnc_TgtX24 slow_controls_data ! +QW_ResEnc_TgtY24 slow_controls_data ! +QW_ResEnc_TgtX25 slow_controls_data ! +QW_ResEnc_TgtY25 slow_controls_data ! +QW_ResEnc_TgtX26 slow_controls_data ! +QW_ResEnc_TgtY26 slow_controls_data ! +CFI6731C slow_controls_data !15k Flow g/s +CTD673 slow_controls_data !15K Supply temp at ESR K +CPI673 slow_controls_data !15K Supply pressure at ESR atm +CTD9541 slow_controls_data !20K return temp at ESR K +CPI9541 slow_controls_data !20K return pressure at ESR atm +haCryo_15K_Total_F slow_controls_data !sum of Hall A and Hall C 15K flows g/s +CFI60DLP slow_controls_data !"dirty flowrate" at ESR (warm return) g/s +CTD6614 slow_controls_data !Hall A 15K supply temp K +CFI6711C slow_controls_data !4k Flow g/s +CTD671SC slow_controls_data !4K Supply temp at ESR K +CPI671SC slow_controls_data !4K Supply pressure at ESR atm +CTD672 slow_controls_data !5K return temp at ESR K +CPI672 slow_controls_data !5K return pressure at ESR atm +QWBCM1 slow_controls_data !Beam current in Hall C uA +QWBCM2 slow_controls_data !Beam current in Hall C uA +QWBCM3 slow_controls_data !Beam current in Hall C uA +QWBCM4 slow_controls_data !Beam current in Hall C uA +QWGV_Status slow_controls_data !Status bits of the gate valves +QWHPHIset slow_controls_data !Max Heater Current Set +QWHPHIDACset slow_controls_data !Max Current DAC Set +QWHPHVDACset slow_controls_data !Voltage DAC Set +QWHPHManual slow_controls_data !Manual power setting +QWHPHAuto slow_controls_data !auto power setting +QWHPHheat_pid.ORBV slow_controls_data !Cur Pos +QWHPHheat_pid.OVAL slow_controls_data !Cur Out +QWHPHheat_pid.CVAL slow_controls_data !Cur Inp +QWHPHheat.pidS slow_controls_data !Output +QWHPHheat_pid_VAL slow_controls_data !Set Value +QWHPHmode_bypass.VAL slow_controls_data !Heater mode +QWheat_tot slow_controls_data !Total Power +QWbeam_heat slow_controls_data !Beam Power +! +! The following list of injector/source related Epics variables was provided by Riad Suleiman. +! +VWienAngle slow_controls_data !Vertical Wien Angle +MWF1I04.BDL slow_controls_data !Vertical Wien BDL (G-cm) +IGL1I00OD16_4 polarized_source String !Vertical Wien HV Polarity (on/off) +IGL1I00DAC6 slow_controls_data !Vertical Wien Electrode Voltage +Phi_FG slow_controls_data !Solenoids Angle (Phi_FG) +MFG1I04A.BDL slow_controls_data !First Solenoid BDL (G-cm) +MFG1I04B.BDL slow_controls_data !Second Solenoid BDL (G-cm) +HWienAngle slow_controls_data !Horizontal Wien Angle +MWF0I02.BDL slow_controls_data !Horizontal Wien BDL (G-cm) +IGL1I00OD16_9 slow_controls_data !Horizontal Wien HV Polarity +IGL1I00DAC5 slow_controls_data !Horizontal Wien Electrode Voltage +psub_aa_pos slow_controls_data !Hall A Laser Attenuator (Hall A Laser Attenuator Setting) -- +IGL1I00OD16_16 polarized_source String !IHWP: Insertible Beam Half-wave plate Set(off=out) +IGL1I00DI24_24M polarized_source String !Beam Half-wave plate Read(off=out) () -- +psub_pl_pos slow_controls_data !Rotating waveplate (Rotatable Half Wave Plate Setting) -- +IGLdac3:ao_7 slow_controls_data !IA Cell Setpoint Hall A +IGL1I00AI20 slow_controls_data !IA Cell Setpoint Hall B +IGLdac3:ao_4 slow_controls_data !IA Cell Setpoint Hall C +IGLdac3:ao_5 slow_controls_data !PZT X Setpoint Hall A +IGLdac3:ao_6 slow_controls_data !PZT Y Setpoint Hall A +IGLdac3:ao_0 slow_controls_data !PZT X Setpoint Common (X PZT Voltage ) -- +IGLdac3:ao_1 slow_controls_data !PZT Y Setpoint Common (Y PZT Voltage V) -- +IGLdac2:G2Ch3Pos slow_controls_data !Gun2: PC (PITA) POS +IGLdac2:G2Ch4Neg slow_controls_data !Gun2: PC (PITA) NEG +IGL1I00OD16_8 polarized_source String !Pockels Cell ON/OFF +cdipc_xpos slow_controls_data !Pockels Cell X Stage +cdipc_ypos slow_controls_data !Pockels Cell Y Stage +psub_cx_pos slow_controls_data !Wafer X Stage (X laser position on cathode) -- +psub_cy_pos slow_controls_data !Wafer Y Stage (Y laser position on cathode) -- +SMRPOSA slow_controls_data !Hall A Slit Position (Hall A Chopper Slit Readback) -- +HELCLOCKs slow_controls_data !Helicity Clock Set (result: Free Clock) +HELDELAYs polarized_source String !Helicity Delay Set (result: 8 windows) +HELPATTERNs polarized_source String !Helicity Pattern Set (has a value such as Quartet) +HELCLOCKd slow_controls_data !Helicity Clock Read (result: Free Clock) +HELTSETTLEd slow_controls_data !Helicity Settle Read +HELTSTABLEd slow_controls_data !Helicity Stable Read +HELDELAYd polarized_source String !Helicity Delay Read (result: 8 windows) +HELPATTERNd polarized_source String !Helicity Pattern Read (has a value such as Quartet) +HELFREQ slow_controls_data !Helicity Frequency +! +! The following list is already in the MySql database +! +HC:qint_period slow_controls_data !Charge asymmetry sampling period +laser_a_wavelength slow_controls_data !Hall A laser wavelength nm +HC:0L03_WSUM slow_controls_data !0L03 Charge Asymmetry 4 Wire Sum +! +! psub_cx_pos slow_controls_data !laser position on cathode [already in Riad's list above] +! +SMRPOSB slow_controls_data !Hall B Chopper Slit Readback +R00PGSET slow_controls_data !Prebuncher Setting +IGLdac2:scale_6.A slow_controls_data !Hall B TACO Voltage V +IGL1I00AI27 slow_controls_data !Hall A IA Voltage V +laser_c_wavelength slow_controls_data !Hall C laser wavelength nm +HC:1I04_XDIF slow_controls_data !1I04 X Difference +IGL1I00AI17 slow_controls_data !Dummy Helicity Pockels Cell Voltage V +HC:0L02_DWSUM slow_controls_data !Error on 0L02 Charge Asymmetry 4 Wire Sum +HC:DX_DIF slow_controls_data !dX on X Position Difference to MCC +SMRPOSC slow_controls_data !Hall C Chopper Slit Readback +R00PGMEST slow_controls_data !Prebuncher Setting dB +HC:1I04_DXDIF slow_controls_data !Error on 1I04 X Difference +HC:Q_ASY slow_controls_data !Charge Asymmetry to MCC ppm +HC:1I04_DWSUM slow_controls_data !Error on 1I04 Charge Asymmetry 4 Wire Sum +WienAngle slow_controls_data !Wien Filter Angle Setting degrees +itov2out slow_controls_data !A2 Slit Setting +HC:QPD_XDIF slow_controls_data !QPD X Difference +EHCFR_LIPRC polarized_source !String !Master Focus Location: 1=G0, 0=Pivot +HC:0L02_WSUM slow_controls_data !0L02 Charge Asymmetry 4 Wire Sum +HC:1I04_DYDIF slow_controls_data !Error on 1I04 Y Difference +hel_mag_status.D slow_controls_data !Integrated helicity bit difference +IBCxxxxCRCUR4 slow_controls_data !Hall C MPS BCM Current uA +scaler_calc1 slow_controls_data !Hall B Beam Current (Faraday Cup) nA +! +!psub_cy_pos slow_controls_data !Y laser position on cathode [already in Riad's list above] +! +itov5out slow_controls_data !A3 Slit Setting +IGL1I00DAC3 slow_controls_data !Hall B Seed Level +osc_jitter slow_controls_data !Hall A Laser Phase Jitter +HC:QPD_DWSUM slow_controls_data !Error on QPD Charge Asymmetry 4 Wire Sum +IGL1I00AI24 slow_controls_data !IA Voltage V +HC:P_ONOFF polarized_source String !enable/disable position feedback (ON/OFF) +HC:QPD_WSUM slow_controls_data !QPD Charge Asymmetry 4 Wire Sum +itov7out slow_controls_data !A4 Slit Setting +HC:0L03_DXDIF slow_controls_data !Error on 0L03 X Difference +hallb_transmission slow_controls_data !Hall B Independent Transmission % +! +!SMRPOSA slow_controls_data !Hall A Chopper Slit Readback [already in Riad's list above] +! +HC:0L03_YDIF slow_controls_data !0L03 Y Difference +HC:IBCM_DQASY slow_controls_data !Error on Injector BCM Charge Asymmetry +HC:1I06_DWSUM slow_controls_data !Error on 1I06 Charge Asymmetry 4 Wire Sum +HC:X_DIF slow_controls_data !X Position Difference to MCC +HC:0I05_YDIF slow_controls_data !0I05 Y Difference +IGL1I00DAC2 slow_controls_data !Hall B Control Level +HC:1I06_DXDIF slow_controls_data !Error on 1I06 X Difference +HC:0I05_DWSUM slow_controls_data !Error on 0I05 Charge Asymmetry 4 Wire Sum +HC:QPD_DYDIF slow_controls_data !Error on QPD Y Difference +HC:1I06_WSUM slow_controls_data !1I06 Charge Asymmetry 4 Wire Sum +psub_ab_pos slow_controls_data !Hall B Laser Attenuator Setting +HC:0I05_DYDIF slow_controls_data !Error on 0I05 Y Difference +! +!psub_pl_pos slow_controls_data !Rotatable Half Wave Plate Setting [already in Riad's list above] +! +hallc_photocurrent slow_controls_data !Hall C photocurrent uA +HC:0L02_DYDIF slow_controls_data !Error on 0L02 Y Difference +hac_bcm_average slow_controls_data !Hall A (?) BCM Current uA +ISL0I04DT polarized_source !Master Slit Setting (string value: IN) +IPM2C24A.IENG slow_controls_data !Hall B Beam Current (2C24A) +IBCxxxxCRCUR2 slow_controls_data !Hall A MPS BCM Current uA +HC:0I05_XDIF slow_controls_data !0I05 X Difference +HC:1I02_DYDIF slow_controls_data !Error on 1I02 Y Difference +HC:1I02_DXDIF slow_controls_data !Error on 1I02 X Difference +IGL1I00AI25 slow_controls_data !Hall A X PZT Voltage V +HC:QPD_YDIF slow_controls_data !QPD Y Difference +HC:DY_DIF slow_controls_data !dY on Y Position Difference to MCC +HC:QPD_DXDIF slow_controls_data !Error on QPD X Difference +IGL1I00AI8 slow_controls_data !Gun 2 PITA Voltage Negative V +itov1out slow_controls_data !A1 Slit Setting +qe_halla slow_controls_data !Hall A Quantum Efficiency % +HC:1I02_DWSUM slow_controls_data !Error on 1I02 Charge Asymmetry 4 Wire Sum +hallb_photocurrent slow_controls_data !Hall B photocurrent uA +HC:0L02_XDIF slow_controls_data !0L02 X Difference +HC:1I02_WSUM slow_controls_data !1I02 Charge Asymmetry 4 Wire Sum +hallc_transmission slow_controls_data !Hall C Independent Transmission % +HC:IBCM_QASY slow_controls_data !Injector BCM Charge Asymmetry +! +IGL1I00AI23 slow_controls_data !G0 Y PZT Voltage V [still exists] +IGL1I00AI22 slow_controls_data !G0 X PZT Voltage V [still exists] +! +!IGLdac3:ao_1 slow_controls_data !Y PZT Voltage V [already in Riad's list above] +!IGLdac3:ao_0 slow_controls_data !X PZT Voltage [already in Riad's list above] +! +HC:Y_DIF slow_controls_data !Y Position Difference to MCC +qe_hallb slow_controls_data !Hall B Quantum Efficiency % +IGL1I00AI26 slow_controls_data !Hall A Y PZT Voltage V +laser_b_wavelength slow_controls_data !Hall B laser wavelength nm +! +!psub_aa_pos slow_controls_data !Hall A Laser Attenuator Setting [already in Riad's list above] +! +HC:1I06_YDIF slow_controls_data !1I06 Y Difference +HC:1I02_YDIF slow_controls_data !1I02 Y Difference +HC:DQ_ASY slow_controls_data !Charge Asymmetry Uncertainty ppm +HC:0L02_YDIF slow_controls_data !0L02 Y Difference +IBCxxxxCLOSS slow_controls_data !Machine Energy Loss +psub_ac_pos slow_controls_data !Hall C Laser Attenuator Setting +IGL1I00AI7 slow_controls_data !Gun 2 PITA Voltage Positive V +HC:1I04_YDIF slow_controls_data !1I04 Y Difference +qe_hallc slow_controls_data !Hall C Quantum Efficiency % +HC:0L03_DYDIF slow_controls_data !Error on 0L03 Y Difference +HC:0L03_DWSUM slow_controls_data !Error on 0L03 Charge Asymmetry 4 Wire Sum +HC:0L03_XDIF slow_controls_data !0L03 X Difference +halla_photocurrent slow_controls_data !Hall A photocurrent uA +HC:1I06_XDIF slow_controls_data !1I06 X Difference +IGL1I00PStrans slow_controls_data !Injector transmission +HC:pint_period slow_controls_data !Position difference sampling period +HC:0L02_DXDIF slow_controls_data !Error on 0L02 X Difference +osc2_jitter slow_controls_data !Hall C Laser Phase Jitter +halla_transmission slow_controls_data !Hall A Independent Transmission % +HC:1I04_WSUM slow_controls_data !1I04 Charge Asymmetry 4 Wire Sum +HC:1I06_DYDIF slow_controls_data !Error on 1I06 Y Difference +HC:1I02_XDIF slow_controls_data !1I02 X Difference +HC:0I05_WSUM slow_controls_data !0I05 Charge Asymmetry 4 Wire Sum +HC:bcm_threshold slow_controls_data !BCM threshold cut for charge feedback uA +ibcm1 slow_controls_data !Hall C Beam Current (monitor 1): careful, this is also in target epics +ibcm2 slow_controls_data !Hall C Beam Current (monitor 2): careful, this is also in target epics +HC:bcm_select polarized_source !String ! (result: BCM2) +! +!IGL1I00DI24_24M slow_controls_data ![already in Riad's list above] +! +EHCFR_LIXWidth slow_controls_data ! +EHCFR_LIYWidth slow_controls_data ! +EHCFR_ENERGY slow_controls_data ! +! +!IGL1I00DI24_24M slow_controls_data ![This was repeated, see by 4 variables above] +! +HC:0I05_DXIF slow_controls_data !Error on 0I05 X Difference +! +!Epics variables from Hall C beamline BPM and BCM for their auto-gains +! +IPM3C17.XIFG slow_controls_data !stripline bpm x position auto-gain +IPM3C17.YIFG slow_controls_data ! stripline bpm y position auto-gain +IBC3C17.XIFG slow_controls_data !bcm x position auto-gain +IBC3C17.YIFG slow_controls_data !bcm y position auto-gain +IPM3C18.XIFG slow_controls_data ! +IPM3C18.YIFG slow_controls_data ! +IPM3C19.XIFG slow_controls_data ! +IPM3C19.YIFG slow_controls_data ! +IPM3P01.XIFG slow_controls_data ! +IPM3P01.YIFG slow_controls_data ! +IPM3P02A.XIFG slow_controls_data ! +IPM3P02A.YIFG slow_controls_data ! +IPM3P03A.XIFG slow_controls_data ! +IPM3P03A.YIFG slow_controls_data ! +IPM3P02B.XIFG slow_controls_data ! +IPM3P02B.YIFG slow_controls_data ! +IPM3C20.XIFG slow_controls_data ! +IPM3C20.YIFG slow_controls_data ! +IPM3C21.XIFG slow_controls_data ! +IPM3C21.YIFG slow_controls_data ! +IPM3H02.XIFG slow_controls_data ! +IPM3H02.YIFG slow_controls_data ! +IPM3H04.XIFG slow_controls_data ! +IPM3H04.YIFG slow_controls_data ! +! +IPM3H04H slow_controls_data !cavity bpm horizontal +IPM3H04V slow_controls_data !cavity bpm vertical +IBC3H04 slow_controls_data !cavity bcm +IBC3H05 slow_controls_data !hall C bcm (i.e., ibcm1) +IBC3H05A slow_controls_data !hall C bcm (i.e., ibcm2) +! +IPM3H07A.XIFG slow_controls_data ! +IPM3H07A.YIFG slow_controls_data ! +IPM3H07B.XIFG slow_controls_data ! +IPM3H07B.YIFG slow_controls_data ! +IPM3H07C.XIFG slow_controls_data ! +IPM3H07C.YIFG slow_controls_data ! +IPM3H09.XIFG slow_controls_data ! +IPM3H09.YIFG slow_controls_data ! +! +IPM3H09AH slow_controls_data ! +IPM3H09AV slow_controls_data ! +IBC3H09 slow_controls_data ! +! +IPM3H09B.XIFG slow_controls_data ! +IPM3H09B.YIFG slow_controls_data ! +! +!Epics variables from Hall C beamline BPM and BCM for their X and Y positions +! +IPM3C17.XPOS slow_controls_data !stripline bpm x position +IPM3C17.YPOS slow_controls_data !stripline bpm y position +IBC3C17.XPOS slow_controls_data !bcm x position +IBC3C17.YPOS slow_controls_data !bcm y position +IPM3C18.XPOS slow_controls_data ! +IPM3C18.YPOS slow_controls_data ! +IPM3C19.XPOS slow_controls_data ! +IPM3C19.YPOS slow_controls_data ! +IPM3P01.XPOS slow_controls_data ! +IPM3P01.YPOS slow_controls_data ! +IPM3P02A.XPOS slow_controls_data ! +IPM3P02A.YPOS slow_controls_data ! +IPM3P03A.XPOS slow_controls_data ! +IPM3P03A.YPOS slow_controls_data ! +IPM3P02B.XPOS slow_controls_data ! +IPM3P02B.YPOS slow_controls_data ! +IPM3C20.XPOS slow_controls_data ! +IPM3C20.YPOS slow_controls_data ! +IPM3C21.XPOS slow_controls_data ! +IPM3C21.YPOS slow_controls_data ! +IPM3H02.XPOS slow_controls_data ! +IPM3H02.YPOS slow_controls_data ! +IPM3H04.XPOS slow_controls_data ! +IPM3H04.YPOS slow_controls_data ! +! +IPM3H07A.XPOS slow_controls_data ! +IPM3H07A.YPOS slow_controls_data ! +IPM3H07B.XPOS slow_controls_data ! +IPM3H07B.YPOS slow_controls_data ! +IPM3H07C.XPOS slow_controls_data ! +IPM3H07C.YPOS slow_controls_data ! +IPM3H09.XPOS slow_controls_data ! +IPM3H09.YPOS slow_controls_data ! +! +IPM3H09B.XPOS slow_controls_data ! +IPM3H09B.YPOS slow_controls_data ! +! +!Epics variables from Hall C beamline BPM and BCM for their X and Y position offsets +! +IPM3C17.XSOF slow_controls_data !stripline bpm x position offset +IPM3C17.YSOF slow_controls_data ! stripline bpm y position offset +IBC3C17.XSOF slow_controls_data !bcm x position offset +IBC3C17.YSOF slow_controls_data !bcm y position offset +IPM3C18.XSOF slow_controls_data ! +IPM3C18.YSOF slow_controls_data ! +IPM3C19.XSOF slow_controls_data ! +IPM3C19.YSOF slow_controls_data ! +IPM3P01.XSOF slow_controls_data ! +IPM3P01.YSOF slow_controls_data ! +IPM3P02A.XSOF slow_controls_data ! +IPM3P02A.YSOF slow_controls_data ! +IPM3P03A.XSOF slow_controls_data ! +IPM3P03A.YSOF slow_controls_data ! +IPM3P02B.XSOF slow_controls_data ! +IPM3P02B.YSOF slow_controls_data ! +IPM3C20.XSOF slow_controls_data ! +IPM3C20.YSOF slow_controls_data ! +IPM3C21.XSOF slow_controls_data ! +IPM3C21.YSOF slow_controls_data ! +IPM3H02.XSOF slow_controls_data ! +IPM3H02.YSOF slow_controls_data ! +IPM3H04.XSOF slow_controls_data ! +IPM3H04.YSOF slow_controls_data ! +! +IPM3H07A.XSOF slow_controls_data ! +IPM3H07A.YSOF slow_controls_data ! +IPM3H07B.XSOF slow_controls_data ! +IPM3H07B.YSOF slow_controls_data ! +IPM3H07C.XSOF slow_controls_data ! +IPM3H07C.YSOF slow_controls_data ! +IPM3H09.XSOF slow_controls_data ! +IPM3H09.YSOF slow_controls_data ! +! +IPM3H09B.XSOF slow_controls_data ! +IPM3H09B.YSOF slow_controls_data ! +! +! Miscellaneous epics variables: +HC:Q_ONOFF polarized_source !String !Charge feedback (ON/OFF) +! Epics variables for Compton missing. +! +! Fast Feedback (copied from G0 epics.dictionary) +! +FB_A:FB_On polarized_source !String !fast feedback Hall A status (result: OFF) +FB_C:FB_On polarized_source !String !fast feedback Hall C status (result: OFF) +FB_C:status:mbbi2.B7 slow_controls_data !1 or 0 !fast feedback Hall C status flag +FB_C:use_RF polarized_source !String !fast energy lock Hall C status (result: RF OFF) +FB_A:use_RF polarized_source !String !fast energy lock Hall A status (result: RF ON) +FB_A:status:mbbi2.B7 slow_controls_data !1 or 0 !fast feedback Hall A status flag +! +! Hall C Moller information (copied from G0 epics.dictionary) +! +OXSS_RDF slow_controls_data !Leads Field +OXSS_MGFD slow_controls_data !Persistent Field (T) +TARGPOS slow_controls_data !Target position X +COLPOS1 slow_controls_data !Collimator Block 1 +COLPOS2 slow_controls_data !Collimator Block 2 +COLPOS3 slow_controls_data !Collimator Block 3 +COLPOS4 slow_controls_data !Collimator Block 4 +COLPOS5 slow_controls_data !Collimator Block 5 +COLPOS6 slow_controls_data !Collimator Block 6 +COLPOS7 slow_controls_data !Collimator Block 7 +!MHCMQ2SETI slow_controls_data !Supply Set (A) +!MHCMQ2IRBCK slow_controls_data !Current ReadBack (A) +!MQE3M02.S slow_controls_data !Current Set (A) +!The "result" indicates the result obtained from caget command. + +! Added Qtor related 4 variables: qw:qt_mps_i_target,qw:qt_mps_i_set, qw:qt_mps_i_dcct, Q1HallP + +qw:qt_mps_i_target slow_controls_data ! Qtor target curret +qw:qt_mps_i_set slow_controls_data ! Qtor set current +qw:qt_mps_i_dcct slow_controls_data ! Qtor DCCT +Q1HallP slow_controls_data ! Qtor magnetic field read by Hall Probe 1 +! +! +! +! +FB_C:CORR:C1_value.B slow_controls_data ! FFB corrector magnet 1 value +FB_C:CORR:C2_value.B slow_controls_data ! FFB corrector magnet 2 value +FB_C:CORR:C3_value.B slow_controls_data ! FFB corrector magnet 3 value +FB_C:CORR:C4_value.B slow_controls_data ! FFB corrector magnet 4 value +IBC1H04CRCUR2 slow_controls_data ! Hall A MPS BCM Current uA +IBC3H00CRCUR4 slow_controls_data ! Hall C MPS BCM Current uA +IFY0I06I slow_controls_data ! PolCup position: FC1 (is/is not) inserted +IFY0I06R slow_controls_data ! PolCup position: FC1 (is/is not) retracted +IFY0L03I slow_controls_data ! PolCup position: FC2 (is/is not) inserted +IFY0L03R slow_controls_data ! PolCup position: FC2 (is/is not) retracted +IFY1I07I slow_controls_data ! PolCup position: PolCup (is/is not) inserted +IFY1I07R slow_controls_data ! PolCup position: PolCup (is/is not) retracted +IOCSE14:PassSel;r slow_controls_data !String ! IOCSE14 Auto Select +IOCSE14:SEEGainMod;r slow_controls_data !String ! IOCSE14 Auto Gain +IOCSE14:SEEProcMod;r slow_controls_data !String ! IOCSE14 SEE Norm Ops +IOCSE17:PassSel;r slow_controls_data !String ! IOCSE17 Auto Select +IOCSE17:SEEGainMod;r slow_controls_data !String ! IOCSE17 Auto Gain +IOCSE17:SEEProcMod;r slow_controls_data !String ! IOCSE17 SEE Norm Ops +IOCSE18:PassSel;r slow_controls_data !String ! IOCSE18 Auto Select +IOCSE18:SEEGainMod;r slow_controls_data !String ! IOCSE18 Auto Gain +IOCSE18:SEEProcMod;r slow_controls_data !String ! IOCSE18 SEE Norm Ops +IOCSE20:PassSel;r slow_controls_data !String ! IOCSE20 Auto Select +IOCSE20:SEEGainMod;r slow_controls_data !String ! IOCSE20 Auto Gain +IOCSE20:SEEProcMod;r slow_controls_data !String ! IOCSE20 SEE Norm Ops +VCG3H09BTr slow_controls_data ! Scattering Chamber Vacuum psia +qw:exitwindow slow_controls_data ! Exit window temp (C) +rad45_p1 slow_controls_data ! Gamma radiation monitor in Qweak detector shieldhouse +rad45_p2 slow_controls_data ! Neutron radiation monitor in Qweak detector shieldhouse +!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! +! Composite slow control variables +! These are variables for which there is not an actual EPICS variable, +! but a value is generated internally by the QwEPICSEvent class. +!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! +WienMode slow_controls_data String ! This will indicate the spin direction in the hall as defined by the Wien setting + precession + diff --git a/Analysis/src/QwControl.cc b/Analysis/src/QwControl.cc index a8a6c80a8..446d55928 100755 --- a/Analysis/src/QwControl.cc +++ b/Analysis/src/QwControl.cc @@ -21,9 +21,7 @@ using std::cout; using std::endl; #include "QwTrackingDataserver.h" -#if ROOT_VERSION_CODE < ROOT_VERSION(5,90,0) ClassImp(QwControl) -#endif void* QwRunThread (void* arg) diff --git a/Analysis/src/QwDBInterface.cc b/Analysis/src/QwDBInterface.cc new file mode 100644 index 000000000..0d2f2eba4 --- /dev/null +++ b/Analysis/src/QwDBInterface.cc @@ -0,0 +1,200 @@ +/* + * QwDBInterface.cc + * + * Created on: Dec 14, 2010 + * Author: wdconinc + * Author: jhlee + */ + +#include "QwDBInterface.h" + +// Qweak headers +//#define MYSQLPP_SSQLS_NO_STATICS +#ifdef __USE_DATABASE__ +#include "QwParitySSQLS.h" +#include "QwParityDB.h" +#endif // __USE_DATABASE__ + +std::map QwDBInterface::fPrefix; + +TString QwDBInterface::DetermineMeasurementTypeID(TString type, TString suffix, + Bool_t forcediffs) +{ + if (fPrefix.empty()){ + fPrefix["yield"] = "y"; + fPrefix["difference"] = "d"; + fPrefix["asymmetry"] = "a"; + fPrefix["asymmetry1"] = "a12"; + fPrefix["asymmetry2"] = "aeo"; + } + TString measurement_type(""); + if (fPrefix.count(type)==1){ + measurement_type = fPrefix[type]; + if (measurement_type[0] == 'a' && + (forcediffs + || (suffix == "p" || suffix == "a" + || suffix == "m")) ){ + // Change the type to difference for position, + // angle, or slope asymmetry variables. + measurement_type[0] = 'd'; + } else if (measurement_type[0] == 'y') { + measurement_type += suffix; + } + } + QwDebug << "\n" + << type << ", " << suffix + << " \'" << measurement_type.Data() << "\'" << QwLog::endl; + return measurement_type; +} + +#ifdef __USE_DATABASE__ +void QwDBInterface::SetMonitorID(QwParityDB *db) +{ + fDeviceId = db->GetMonitorID(fDeviceName.Data()); +} + +void QwDBInterface::SetMainDetectorID(QwParityDB *db) +{ + fDeviceId = db->GetMainDetectorID(fDeviceName.Data()); +} + +void QwDBInterface::SetLumiDetectorID(QwParityDB *db) +{ + fDeviceId = db->GetLumiDetectorID(fDeviceName.Data()); +} + +QwDBInterface::EQwDBIDataTableType QwDBInterface::SetDetectorID(QwParityDB *db) +{ + fDeviceId = db->GetMonitorID(fDeviceName.Data(),kFALSE); + if (fDeviceId!=0) return kQwDBI_BeamTable; + fDeviceId = db->GetMainDetectorID(fDeviceName.Data(),kFALSE); + if (fDeviceId!=0) return kQwDBI_MDTable; + fDeviceId = db->GetLumiDetectorID(fDeviceName.Data(),kFALSE); + if (fDeviceId!=0) return kQwDBI_LumiTable; + return kQwDBI_OtherTable; +} +#endif // __USE_DATABASE__ + +template +T QwDBInterface::TypedDBClone() +{ + T row(0); + return row; +} + + +#ifdef __USE_DATABASE__ +/// Specifications of the templated function +/// template \verbatim\endverbatim inline T QwDBInterface::TypedDBClone(); +template<> QwParitySSQLS::md_data +QwDBInterface::TypedDBClone() { + QwParitySSQLS::md_data row(0); + row.analysis_id = fAnalysisId; + row.main_detector_id = fDeviceId; + row.measurement_type_id = fMeasurementTypeId; + row.subblock = fSubblock; + row.n = fN; + row.value = fValue; + row.error = fError; + return row; +} +template<> QwParitySSQLS::lumi_data +QwDBInterface::TypedDBClone() { + QwParitySSQLS::lumi_data row(0); + row.analysis_id = fAnalysisId; + row.lumi_detector_id = fDeviceId; + row.measurement_type_id = fMeasurementTypeId; + row.subblock = fSubblock; + row.n = fN; + row.value = fValue; + row.error = fError; + return row; +} +template<> QwParitySSQLS::beam +QwDBInterface::TypedDBClone() { + QwParitySSQLS::beam row(0); + row.analysis_id = fAnalysisId; + row.monitor_id = fDeviceId; + row.measurement_type_id = fMeasurementTypeId; + row.subblock = fSubblock; + row.n = fN; + row.value = fValue; + row.error = fError; + return row; +} +#endif // __USE_DATABASE__ + + + + +// QwErrDBInterface + +#ifdef __USE_DATABASE__ +void QwErrDBInterface::SetMonitorID(QwParityDB *db) +{ + fDeviceId = db->GetMonitorID(fDeviceName.Data()); +} + +void QwErrDBInterface::SetMainDetectorID(QwParityDB *db) +{ + fDeviceId = db->GetMainDetectorID(fDeviceName.Data()); +} + +void QwErrDBInterface::SetLumiDetectorID(QwParityDB *db) +{ + fDeviceId = db->GetLumiDetectorID(fDeviceName.Data()); +} +#endif // __USE_DATABASE__ +template +T QwErrDBInterface::TypedDBClone() +{ + T row(0); + return row; +} +#ifdef __USE_DATABASE__ +template<> QwParitySSQLS::md_errors +QwErrDBInterface::TypedDBClone() { + QwParitySSQLS::md_errors row(0); + row.analysis_id = fAnalysisId; + row.main_detector_id = fDeviceId; + row.error_code_id = fErrorCodeId; + row.n = fN; + return row; +}; + + +template<> QwParitySSQLS::lumi_errors +QwErrDBInterface::TypedDBClone() { + QwParitySSQLS::lumi_errors row(0); + row.analysis_id = fAnalysisId; + row.lumi_detector_id = fDeviceId; + row.error_code_id = fErrorCodeId; + row.n = fN; + return row; +}; + + + + +template<> QwParitySSQLS::beam_errors +QwErrDBInterface::TypedDBClone() { + QwParitySSQLS::beam_errors row(0); + row.analysis_id = fAnalysisId; + row.monitor_id = fDeviceId; + row.error_code_id = fErrorCodeId; + row.n = fN; + return row; +}; + + +template<> QwParitySSQLS::general_errors +QwErrDBInterface::TypedDBClone() { + QwParitySSQLS::general_errors row(0); + row.analysis_id = fAnalysisId; + row.error_code_id = fErrorCodeId; + row.n = fN; + return row; +}; +#endif // __USE_DATABASE__ + + diff --git a/Analysis/src/QwEPICSEvent.cc b/Analysis/src/QwEPICSEvent.cc index 23cbb4ae1..3b09a6ca0 100755 --- a/Analysis/src/QwEPICSEvent.cc +++ b/Analysis/src/QwEPICSEvent.cc @@ -23,7 +23,7 @@ #define MYSQLPP_SSQLS_NO_STATICS #include "QwParitySSQLS.h" #include "QwParityDB.h" -#endif +#endif //__USE_DATABASE__ /************************************* @@ -1237,8 +1237,7 @@ void QwEPICSEvent::FillSlowControlsSettings(QwParityDB *db) db->Disconnect(); QwDebug << "Leaving QwEPICSEvent::FillSlowControlsStrings()" << QwLog::endl; } -#endif - +#endif //__USE_DATABASE__ TList *QwEPICSEvent::GetEPICSStringValues() { diff --git a/Analysis/src/QwF1TDContainer.cc b/Analysis/src/QwF1TDContainer.cc index 451ce663c..d92ec7251 100755 --- a/Analysis/src/QwF1TDContainer.cc +++ b/Analysis/src/QwF1TDContainer.cc @@ -15,12 +15,10 @@ * \date Tuesday, September 14 23:04:36 EDT 2010 */ -#if ROOT_VERSION_CODE < ROOT_VERSION(5,90,0) ClassImp(QwF1TDC); ClassImp(QwF1TDContainer); ClassImp(F1TDCReferenceSignal); ClassImp(F1TDCReferenceContainer); -#endif // // @@ -134,6 +132,7 @@ QwF1TDC::QwF1TDC() fBuffer = new UInt_t[fWordsPerBuffer]; + ResetCounters(); } @@ -187,6 +186,7 @@ QwF1TDC::QwF1TDC(const Int_t roc, const Int_t slot) fBuffer = new UInt_t[fWordsPerBuffer]; + ResetCounters(); } @@ -1615,7 +1615,7 @@ QwF1TDContainer::CheckDataIntegrity(const UInt_t roc_id, UInt_t *buffer, UInt_t xor_setup_flag = fF1TDCDecoder.IsHeaderXorSetup(); trig_fifo_ok_flag = fF1TDCDecoder.IsNotHeaderTrigFIFO(); event_ok_flag = ( reference_event_num==fF1TDCDecoder.GetTDCHeaderEventNumber() ); - diff_trigger_time = abs( reference_trig_time-fF1TDCDecoder.GetTDCHeaderTriggerTime() ); + diff_trigger_time = abs( int(reference_trig_time)-int(fF1TDCDecoder.GetTDCHeaderTriggerTime()) ); trig_time_ok_flag = (diff_trigger_time == valid_trigger_time_offset[0]) diff --git a/Analysis/src/QwOptions.cc b/Analysis/src/QwOptions.cc index f31280c51..d9c05ada0 100755 --- a/Analysis/src/QwOptions.cc +++ b/Analysis/src/QwOptions.cc @@ -21,6 +21,7 @@ #include #include #include +//#include // Globally defined instance of the options object QwOptions gQwOptions; @@ -28,7 +29,6 @@ QwOptions gQwOptions; // Qweak headers #include "QwLog.h" #include "QwParameterFile.h" -#include "QwSVNVersion.h" // Qweak objects with default options #include "QwSubsystemArray.h" @@ -77,7 +77,7 @@ void QwOptions::DefineOptions(QwOptions& options) #ifdef __USE_DATABASE__ // Define database options QwDatabase::DefineOptions(options); -#endif +#endif //__USE_DATABASE__ // Define ROOT file options QwRootFile::DefineOptions(options); // Define EPICS event options @@ -319,9 +319,9 @@ void QwOptions::Version() #endif QwMessage << "\n Qweak Analysis Framework : " << fArgv[0] << QwLog::endl; - QwMessage << " * Revision: " << QWANA_SVN_REVISION << QwLog::endl; - QwMessage << " * URL: " << QWANA_SVN_URL << QwLog::endl; - QwMessage << " * Last Changed Rev: " << QWANA_SVN_LASTCHANGEDREVISION << QwLog::endl; + // QwMessage << " * Revision: " << QWANA_SVN_REVISION << QwLog::endl; + // QwMessage << " * URL: " << QWANA_SVN_URL << QwLog::endl; + // QwMessage << " * Last Changed Rev: " << QWANA_SVN_LASTCHANGEDREVISION << QwLog::endl; QwMessage << " * ROOT " << root_version << QwLog::endl; } diff --git a/Analysis/src/QwParameterFile.cc b/Analysis/src/QwParameterFile.cc index 61230d597..7f84fe625 100755 --- a/Analysis/src/QwParameterFile.cc +++ b/Analysis/src/QwParameterFile.cc @@ -854,7 +854,9 @@ TString QwParameterFile::LastString(TString in, char* delim) { TObjArray* all_strings = in.Tokenize(delim); TObjString* last_string = (TObjString*) all_strings->Last(); - return last_string->GetString(); + TString return_string = last_string->GetString(); + delete all_strings; + return return_string; }; diff --git a/Analysis/src/QwPromptSummary.cc b/Analysis/src/QwPromptSummary.cc index 46c69a6f2..157a11668 100755 --- a/Analysis/src/QwPromptSummary.cc +++ b/Analysis/src/QwPromptSummary.cc @@ -334,10 +334,11 @@ QwPromptSummary::GetElementByName(TString name) return an_element; } } - + return NULL; }; + TString QwPromptSummary::PrintTextSummaryHeader() { @@ -554,7 +555,6 @@ QwPromptSummary::FillDoubleDifference(TString type, TString name1, TString name2 } } - void QwPromptSummary::PrintCSV() { @@ -585,4 +585,3 @@ QwPromptSummary::PrintTextSummary() return; }; - diff --git a/Analysis/src/QwRunCondition.cc b/Analysis/src/QwRunCondition.cc index dd5975d98..8b66ba7b1 100755 --- a/Analysis/src/QwRunCondition.cc +++ b/Analysis/src/QwRunCondition.cc @@ -6,7 +6,7 @@ */ #include "QwRunCondition.h" -#include "QwSVNVersion.h" +//#include "QwSVNVersion.h" const Int_t QwRunCondition::fCharLength = 127; @@ -74,9 +74,9 @@ QwRunCondition::SetArgs(Int_t argc, Char_t* argv[]) TString svn_revision; TString svn_url; TString svn_lc_revision; - svn_revision = QWANA_SVN_REVISION; - svn_url = QWANA_SVN_URL; - svn_lc_revision = QWANA_SVN_LASTCHANGEDREVISION; + // svn_revision = QWANA_SVN_REVISION; + // svn_url = QWANA_SVN_URL; + // svn_lc_revision = QWANA_SVN_LASTCHANGEDREVISION; // get current ROC flags TString roc_flags; @@ -97,9 +97,9 @@ QwRunCondition::SetArgs(Int_t argc, Char_t* argv[]) program_name.Insert (0, "QwAnalyzer Name : "); argv_list.Insert (0, "QwAnalyzer Options : "); - svn_revision.Insert (0, "QwAnalyzer SVN Revision : "); - svn_url.Insert (0, "QwAnalyzer SVN URL : "); - svn_lc_revision.Insert(0, "QwAnalyzer SVN Last Changed Revision : "); + // svn_revision.Insert (0, "QwAnalyzer SVN Revision : "); + // svn_url.Insert (0, "QwAnalyzer SVN URL : "); + // svn_lc_revision.Insert(0, "QwAnalyzer SVN Last Changed Revision : "); roc_flags.Insert (0, "DAQ ROC flags when QwAnalyzer runs : "); diff --git a/Analysis/src/QwSIS3320_Samples.cc b/Analysis/src/QwSIS3320_Samples.cc index 60e0bdbe4..4d4017d50 100755 --- a/Analysis/src/QwSIS3320_Samples.cc +++ b/Analysis/src/QwSIS3320_Samples.cc @@ -17,7 +17,7 @@ #include "QwSIS3320_Samples.h" #if ROOT_VERSION_CODE < ROOT_VERSION(5,90,0) ClassImp(QwSIS3320_Samples); -#endif +#endif //ROOT_VERSION_CODE < ROOT_VERSION(5,90,0) // System headers #include diff --git a/Analysis/src/QwScaler_Channel.cc b/Analysis/src/QwScaler_Channel.cc index d05b5a031..dac1030a8 100755 --- a/Analysis/src/QwScaler_Channel.cc +++ b/Analysis/src/QwScaler_Channel.cc @@ -21,6 +21,7 @@ const Bool_t VQwScaler_Channel::kDEBUG = kFALSE; void VQwScaler_Channel::InitializeChannel(TString name, TString datatosave) { fNormChannelPtr = NULL; + fNeedsExternalClock = kFALSE; fIsDifferentialScaler = false; SetElementName(name); diff --git a/Analysis/src/VQwSubsystem.cc b/Analysis/src/VQwSubsystem.cc index 20f35dbb4..74206b609 100755 --- a/Analysis/src/VQwSubsystem.cc +++ b/Analysis/src/VQwSubsystem.cc @@ -60,42 +60,37 @@ Int_t VQwSubsystem::LoadDetectorMaps(QwParameterFile& file) // Beammod 1 // 1(6),2(4),3(3),4(1) // map, param, eventcut, geom + // Map file definition if (key == "map" ) { LoadChannelMap(value); // fDetectorMapsNames.push_back(value); - // printf("1\n"); } // Parameter file definition else if (key == "param" ) { LoadInputParameters(value); // fDetectorMapsNames.push_back(value); - // printf("2\n"); } // Event cut file definition else if (key == "eventcut") { LoadEventCuts(value); // fDetectorMapsNames.push_back(value); - // printf("3\n"); } // Geometry file definition else if (key == "geom" ) { LoadGeometryDefinition(value); // fDetectorMapsNames.push_back(value); - // printf("4\n"); } + // Crosstalk file definition + else if (key == "cross" ) { + LoadCrosstalkDefinition(value); + // fDetectorMapsNames.push_back(value); + } //Event type mask else if (key == "mask") { SetEventTypeMask(file.GetUInt(value)); - // printf("5\n"); } - // else { - // printf("whatelse?\n"); // one per subsystem. - // } } - // else { - // printf("something???\n"); // never... - // } } // end of HasVariablePair } // end of while diff --git a/CMakeLists.txt b/CMakeLists.txt index 227ad8e65..b88cd437d 100755 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -7,27 +7,119 @@ project(QwAnalysis) # Local path for cmake modules, before ${CMAKE_ROOT}/Modules/ is checked set(CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/cmake/modules") +# C++11 standard if avialable +include(CheckCXXCompilerFlag) +CHECK_CXX_COMPILER_FLAG("-std=c++0x" COMPILER_SUPPORTS_CXX0X) +CHECK_CXX_COMPILER_FLAG("-std=c++11" COMPILER_SUPPORTS_CXX11) +if(COMPILER_SUPPORTS_CXX11) + message(STATUS "The compiler ${CMAKE_CXX_COMPILER} has C++11 support.") + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11") +elseif(COMPILER_SUPPORTS_CXX0X) + message(STATUS "The compiler ${CMAKE_CXX_COMPILER} has C++0x support.") + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++0x") +else() + message(STATUS "The compiler ${CMAKE_CXX_COMPILER} has no C++11 support.") +endif() + +# Remove some compiler warnings +set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-unknown-warning -Wno-deprecated-declarations -Wno-nonnull-compare") + # Add the project include directory include_directories( ${CMAKE_CURRENT_BINARY_DIR}/include ${CMAKE_CURRENT_SOURCE_DIR}/evio/include ${CMAKE_CURRENT_SOURCE_DIR}/Parity/include ${CMAKE_CURRENT_SOURCE_DIR}/Analysis/include - ${CMAKE_CURRENT_SOURCE_DIR}/Tracking/include ) # Put all QwAnalysis files in my_project_sources file(GLOB my_project_headers ${CMAKE_CURRENT_SOURCE_DIR}/Analysis/include/*.h ${CMAKE_CURRENT_SOURCE_DIR}/Parity/include/*.h - ${CMAKE_CURRENT_SOURCE_DIR}/Tracking/include/*.h - ${CMAKE_CURRENT_BINARY_DIR}/include/QwSVNVersion.h ) file(GLOB my_project_sources - ${CMAKE_CURRENT_SOURCE_DIR}/Analysis/src/*.cc - ${CMAKE_CURRENT_SOURCE_DIR}/Parity/src/*.cc - ${CMAKE_CURRENT_SOURCE_DIR}/Tracking/src/*.cc - ) +# ### ${CMAKE_CURRENT_SOURCE_DIR}/Analysis/src/*.cc +# ${CMAKE_CURRENT_SOURCE_DIR}/Parity/src/*.cc +# ${CMAKE_CURRENT_SOURCE_DIR}/Tracking/src/*.cc +) +list(APPEND my_project_sources + ${CMAKE_CURRENT_SOURCE_DIR}/Analysis/src/MQwCodaControlEvent.cc + ${CMAKE_CURRENT_SOURCE_DIR}/Analysis/src/MQwF1TDC.cc + ${CMAKE_CURRENT_SOURCE_DIR}/Analysis/src/MQwMockable.cc + ${CMAKE_CURRENT_SOURCE_DIR}/Analysis/src/MQwV775TDC.cc + ${CMAKE_CURRENT_SOURCE_DIR}/Analysis/src/QwColor.cc +# ${CMAKE_CURRENT_SOURCE_DIR}/Analysis/src/QwControl.cc +# ${CMAKE_CURRENT_SOURCE_DIR}/Analysis/src/QwDatabase.cc +# ${CMAKE_CURRENT_SOURCE_DIR}/Analysis/src/QwDBInterface.cc + ${CMAKE_CURRENT_SOURCE_DIR}/Analysis/src/QwEPICSEvent.cc + ${CMAKE_CURRENT_SOURCE_DIR}/Analysis/src/QwEventBuffer.cc +# ${CMAKE_CURRENT_SOURCE_DIR}/Analysis/src/QwF1TDContainer.cc + ${CMAKE_CURRENT_SOURCE_DIR}/Analysis/src/QwHistogramHelper.cc + ${CMAKE_CURRENT_SOURCE_DIR}/Analysis/src/QwLog.cc +# ${CMAKE_CURRENT_SOURCE_DIR}/Analysis/src/QwOmnivore.cc + ${CMAKE_CURRENT_SOURCE_DIR}/Analysis/src/QwOptions.cc + ${CMAKE_CURRENT_SOURCE_DIR}/Analysis/src/QwParameterFile.cc + ${CMAKE_CURRENT_SOURCE_DIR}/Analysis/src/QwPMT_Channel.cc + ${CMAKE_CURRENT_SOURCE_DIR}/Analysis/src/QwPromptSummary.cc + ${CMAKE_CURRENT_SOURCE_DIR}/Analysis/src/QwRint.cc + ${CMAKE_CURRENT_SOURCE_DIR}/Analysis/src/QwRootFile.cc + ${CMAKE_CURRENT_SOURCE_DIR}/Analysis/src/QwRunCondition.cc + ${CMAKE_CURRENT_SOURCE_DIR}/Analysis/src/QwScaler_Channel.cc +# ${CMAKE_CURRENT_SOURCE_DIR}/Analysis/src/QwScanner.cc +# ${CMAKE_CURRENT_SOURCE_DIR}/Analysis/src/QwSIS3320_Accumulator.cc +# ${CMAKE_CURRENT_SOURCE_DIR}/Analysis/src/QwSIS3320_Channel.cc +# ${CMAKE_CURRENT_SOURCE_DIR}/Analysis/src/QwSIS3320_LogicalAccumulator.cc +# ${CMAKE_CURRENT_SOURCE_DIR}/Analysis/src/QwSIS3320_Samples.cc + ${CMAKE_CURRENT_SOURCE_DIR}/Analysis/src/QwSubsystemArray.cc + ${CMAKE_CURRENT_SOURCE_DIR}/Analysis/src/QwTypes.cc + ${CMAKE_CURRENT_SOURCE_DIR}/Analysis/src/QwVQWK_Channel.cc + ${CMAKE_CURRENT_SOURCE_DIR}/Analysis/src/VQwHardwareChannel.cc + ${CMAKE_CURRENT_SOURCE_DIR}/Analysis/src/VQwSubsystem.cc +) +list(APPEND my_project_sources + ${CMAKE_CURRENT_SOURCE_DIR}/Parity/src/VQwDataHandler.cc + ${CMAKE_CURRENT_SOURCE_DIR}/Parity/src/QwBCM.cc + ${CMAKE_CURRENT_SOURCE_DIR}/Parity/src/QwBeamDetectorID.cc + ${CMAKE_CURRENT_SOURCE_DIR}/Parity/src/QwBeamLine.cc + ${CMAKE_CURRENT_SOURCE_DIR}/Parity/src/QwBeamMod.cc + ${CMAKE_CURRENT_SOURCE_DIR}/Parity/src/QwBlinder.cc + ${CMAKE_CURRENT_SOURCE_DIR}/Parity/src/QwBPMCavity.cc + ${CMAKE_CURRENT_SOURCE_DIR}/Parity/src/QwBPMStripline.cc + ${CMAKE_CURRENT_SOURCE_DIR}/Parity/src/QwClock.cc + ${CMAKE_CURRENT_SOURCE_DIR}/Parity/src/QwCombinedBCM.cc + ${CMAKE_CURRENT_SOURCE_DIR}/Parity/src/QwCombinedBPM.cc + ${CMAKE_CURRENT_SOURCE_DIR}/Parity/src/QwCombinedPMT.cc +# ${CMAKE_CURRENT_SOURCE_DIR}/Parity/src/QwComptonElectronDetector.cc +# ${CMAKE_CURRENT_SOURCE_DIR}/Parity/src/QwComptonPhotonDetector.cc + ${CMAKE_CURRENT_SOURCE_DIR}/Parity/src/QwDetectorArray.cc + ${CMAKE_CURRENT_SOURCE_DIR}/Parity/src/QwEnergyCalculator.cc + ${CMAKE_CURRENT_SOURCE_DIR}/Parity/src/QwEventRing.cc + ${CMAKE_CURRENT_SOURCE_DIR}/Parity/src/QwFakeHelicity.cc + ${CMAKE_CURRENT_SOURCE_DIR}/Parity/src/QwHaloMonitor.cc + ${CMAKE_CURRENT_SOURCE_DIR}/Parity/src/QwHelicity.cc + ${CMAKE_CURRENT_SOURCE_DIR}/Parity/src/QwHelicityPattern.cc +# ${CMAKE_CURRENT_SOURCE_DIR}/Parity/src/QwIntegratedRaster.cc +# ${CMAKE_CURRENT_SOURCE_DIR}/Parity/src/QwIntegratedRasterChannel.cc + ${CMAKE_CURRENT_SOURCE_DIR}/Parity/src/QwIntegrationPMT.cc + ${CMAKE_CURRENT_SOURCE_DIR}/Parity/src/QwLinearDiodeArray.cc +# ${CMAKE_CURRENT_SOURCE_DIR}/Parity/src/QwLumi.cc + ${CMAKE_CURRENT_SOURCE_DIR}/Parity/src/QwMainCerenkovDetector.cc + ${CMAKE_CURRENT_SOURCE_DIR}/Parity/src/QwMollerDetector.cc + ${CMAKE_CURRENT_SOURCE_DIR}/Parity/src/QwBlindDetectorArray.cc +# ${CMAKE_CURRENT_SOURCE_DIR}/Parity/src/QwParityDB.cc + ${CMAKE_CURRENT_SOURCE_DIR}/Parity/src/QwQPD.cc + ${CMAKE_CURRENT_SOURCE_DIR}/Parity/src/QwCombiner.cc + ${CMAKE_CURRENT_SOURCE_DIR}/Parity/src/QwCombinerSubsystem.cc + ${CMAKE_CURRENT_SOURCE_DIR}/Parity/src/QwScaler.cc + ${CMAKE_CURRENT_SOURCE_DIR}/Parity/src/QwSubsystemArrayParity.cc + ${CMAKE_CURRENT_SOURCE_DIR}/Parity/src/VQwBCM.cc + ${CMAKE_CURRENT_SOURCE_DIR}/Parity/src/VQwBPM.cc + ${CMAKE_CURRENT_SOURCE_DIR}/Parity/src/VQwClock.cc + ${CMAKE_CURRENT_SOURCE_DIR}/Parity/src/QwkRegBlueCorrelator.cc + ${CMAKE_CURRENT_SOURCE_DIR}/Parity/src/LinReg_Bevington_Pebay.cc + ${CMAKE_CURRENT_SOURCE_DIR}/Parity/src/QwCorrelator.cc + ${CMAKE_CURRENT_SOURCE_DIR}/Parity/src/LRBCorrector.cc +) # Put all evio files in my_project_sources (exclude THaEtClient) file(GLOB my_evio_headers @@ -43,11 +135,24 @@ file(GLOB my_evio_sources # Load ROOT and setup include directory find_package(ROOT REQUIRED) include_directories(${ROOT_INCLUDE_DIR}) -set(ROOT_LIBRARIES ${ROOT_LIBRARIES} -lNew -lGui -lMinuit2) +set(ROOT_LIBRARIES "${ROOT_LIBRARIES} -lMinuit2") +execute_process(COMMAND "${ROOTSYS}/root-config --cflags" OUTPUT_VARIABLE ROOT_CXX_FLAGS) +set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${ROOT_CXX_FLAGS}") # Load MYSQLPP -find_package(MYSQLPP REQUIRED) -include_directories(${MYSQLPP_INCLUDE_DIR}) +find_package(MYSQLPP) +IF(MYSQLPP_FOUND) + include_directories(${MYSQLPP_INCLUDE_DIR}) + ## KLUDGE: For now, do not define the __USE_DATABASE__ flag, because we're still missing some of the database support files. --- P.King, 05jun2018 + message("-- The \"__USE_DATABASE__\" flag is commented out in CMakeLists.txt; database support is DISABLED.") + # add_definitions(-D__USE_DATABASE__) + list(APPEND my_project_sources + ${CMAKE_CURRENT_SOURCE_DIR}/Analysis/src/QwDatabase.cc + ${CMAKE_CURRENT_SOURCE_DIR}/Analysis/src/QwDBInterface.cc + ) +ELSE(MYSQLPP_FOUND) + SET(MYSQLPP_LIBRARIES "") +endif(MYSQLPP_FOUND) # Find Boost libraries # There seems to be a bug starting in version 2.8.4 of CMake's boost @@ -57,29 +162,10 @@ find_package(Boost COMPONENTS program_options filesystem system regex REQUIRED) include_directories(${Boost_INCLUDE_DIRS}) link_directories(${Boost_LIBRARY_DIR}) -# Create dictionaries for headers that contain "ClassDef" if ROOT version < 5.90 +# Create dictionaries for headers that contain "ClassDef" if(ROOT_VERSION VERSION_LESS 5.90) -message("Generating evio dictionaries for ROOT ${ROOT_VERSION}...") -foreach(file ${my_evio_headers}) - # Find the header files that have uncommented ClassDef lines - execute_process(COMMAND grep -l "[^/]ClassDef" ${file} OUTPUT_VARIABLE result) - if(result) - # Get path and filename without extension - get_filename_component(file_path ${file} PATH) - get_filename_component(file_name ${file} NAME_WE) - # Add dictionary target with possible LinkDef file - file(MAKE_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/dictionary) - set(dict ${CMAKE_CURRENT_BINARY_DIR}/dictionary/${file_name}Dict) - ROOT_GENERATE_DICTIONARY( - ${dict} - ${file} - OPTIONS -p) - # Add dictionary to evio sources - set(my_evio_sources ${my_evio_sources} ${dict}.cxx) - endif() -endforeach() message("Generating QwAnalysis dictionaries for ROOT ${ROOT_VERSION}...") -foreach(file ${my_project_headers}) +foreach(file ${my_evio_headers} ${my_project_headers}) # Find the header files that have uncommented ClassDef lines execute_process(COMMAND grep -l "[^/]ClassDef" ${file} OUTPUT_VARIABLE result) if(result) @@ -104,6 +190,10 @@ foreach(file ${my_project_headers}) endif() # Add dictionary to project sources set(my_project_sources ${my_project_sources} ${dict}.cxx) + # Add pcm file to list + if(ROOT_VERSION VERSION_GREATER 5.90) + set(pcmfiles ${pcmfiles} ${dict}_rdict.pcm) + endif() endif() endforeach() else() @@ -111,38 +201,47 @@ message("No QwAnalysis dictionaries needed for ROOT ${ROOT_VERSION}.") endif() -# Add target of QwSVNVersion.h +# Add target of QwGitVersion.h add_custom_command( - OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/include/QwSVNVersion.h.does_not_exist - COMMAND ${CMAKE_CURRENT_SOURCE_DIR}/bin/qwsvnversion.sh ${CMAKE_CURRENT_BINARY_DIR}/include/QwSVNVersion.h - WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} - COMMENT "Getting QwSVNVersion information" + OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/include/gitinfo.hh.does_not_exist + COMMAND ${CMAKE_CURRENT_SOURCE_DIR}/bin/pullgitinfo.py ${CMAKE_CURRENT_SOURCE_DIR} + COMMENT "Getting Git information" ) add_custom_command( - OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/include/QwSVNVersion.h + OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/include/gitinfo.hh COMMAND echo -n - DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/include/QwSVNVersion.h.does_not_exist + DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/include/gitinfo.hh.does_not_exist ) set_property( SOURCE ${CMAKE_SOURCE_DIR}/Analysis/src/QwOptions.cc ${CMAKE_SOURCE_DIR}/Analysis/src/QwRunCondition.cc - APPEND PROPERTY OBJECT_DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/include/QwSVNVersion.h + APPEND PROPERTY OBJECT_DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/include/gitinfo.hh ) +# Qweak configure script +set(QWANALYSIS ${CMAKE_SOURCE_DIR}) +set(QW_BIN ${CMAKE_SOURCE_DIR}/bin) +set(QW_LIB ${CMAKE_SOURCE_DIR}/lib) +configure_file(${CMAKE_SOURCE_DIR}/qweak-config.in qweak-config @ONLY) + # Link the evio library add_library(evio SHARED ${my_evio_sources}) target_link_libraries(evio) +install(TARGETS evio DESTINATION ${CMAKE_SOURCE_DIR}/lib) # Link the ROOT libraries -add_library(QwAnalysis SHARED ${CMAKE_CURRENT_BINARY_DIR}/include/QwSVNVersion.h ${my_project_sources} ${my_project_headers}) +add_library(QwAnalysis SHARED ${CMAKE_CURRENT_BINARY_DIR}/include/gitinfo.hh ${my_project_sources} ${my_project_headers}) target_link_libraries(QwAnalysis evio ${ROOT_LIBRARIES} ${MYSQLPP_LIBRARIES} ${Boost_LIBRARIES}) +install(TARGETS QwAnalysis DESTINATION ${CMAKE_SOURCE_DIR}/lib) +# Install pcm files into lib +install(FILES ${pcmfiles} DESTINATION ${CMAKE_SOURCE_DIR}/lib) # Add the target executables file(GLOB exefiles ${CMAKE_SOURCE_DIR}/Parity/main/*.cc ${CMAKE_SOURCE_DIR}/Analysis/main/*.cc - ${CMAKE_SOURCE_DIR}/Tracking/main/*.cc +# ${CMAKE_SOURCE_DIR}/Tracking/main/*.cc ) foreach(file ${exefiles}) get_filename_component(filename ${file} NAME_WE) @@ -152,5 +251,6 @@ foreach(file ${exefiles}) ${filelower} ${ROOT_LIBRARIES} ${MYSQLPP_LIBRARIES} ${Boost_LIBRARIES} QwAnalysis evio ) + install(TARGETS ${filelower} DESTINATION ${CMAKE_SOURCE_DIR}/bin) endforeach() diff --git a/GNUmakefile b/GNUmakefile index c51a911f7..3ef49b690 100755 --- a/GNUmakefile +++ b/GNUmakefile @@ -180,8 +180,7 @@ endif ROOTCONFIG := $(ROOTSYS)/bin/root-config ## ROOTDEFINE := $(shell $(ROOTCONFIG) --features | $(SED) 's/\(\s*\)\([a-zA-Z0-9_]*\)/\1-D__ROOT_HAS_\2/g;y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/') ROOTCFLAGS := $(shell $(ROOTCONFIG) --cflags) -ROOTLIBS := $(shell $(ROOTCONFIG) --new --libs) -lTreePlayer -lGui -# -lMinuit2 removed from listing +ROOTLIBS := $(shell $(ROOTCONFIG) --new --libs) -lTreePlayer -lGui -lMinuit2 # -lNew : for map file capability # -lTreePlayer -lProof : for user loops calling tree # variables under conditions @@ -353,7 +352,7 @@ LIBTOOL = $(LD) ifeq ($(ARCH),Linux) CXX := $(GCC) -CXXFLAGS := -Wall -fPIC -std=c++11 +CXXFLAGS := -Wall -fPIC -Wno-unknown-warning -Wno-misleading-indentation -Wno-deprecated-declarations -Wno-nonnull-compare OPTIM := $(OPTIM) LD = $(GCC) LDFLAGS = -Wl,-rpath,$(QW_LIB) -Wl,--no-as-needed @@ -425,6 +424,92 @@ endif endif +############################ +############################ +# Some set-up for the MySQL library +############################ +############################ +ifndef MYSQL_INC_DIR + ifneq ($(strip $(shell $(FIND) /usr/include -maxdepth 1 -name mysql)),/usr/include/mysql) + $(warning Install the MySQL client library on your system, or set the environment) + $(warning variables MYSQL_INC_DIR and MYSQL_LIB_DIR to the directory with) + $(warning the MySQL headers and libraries, respectively.) + $(warning See the Qweak Wiki for installation and compilation instructions.) + $(warning -> http://qweak.jlab.org/wiki/index.php/Software) + $(warning ) + $(warning Could not find the MySQL library) + else + $(info Setting MYSQL_INC_DIR to /usr/include/mysql) + MYSQL_INC_DIR = /usr/include/mysql + MYSQL_LIB_DIR = /usr/lib/mysql + endif +endif +ifdef MYSQL_LIB_DIR + ifndef MYSQLPP_INC_DIR + ifneq ($(strip $(shell $(FIND) /usr/include -maxdepth 1 -name mysql++)),/usr/include/mysql++) + ifneq ($(strip $(shell $(FIND) /usr/local/include -maxdepth 1 -name mysql++)),/usr/local/include/mysql++) + $(warning Install the MySQL++ library on your system, or set the environment) + $(warning variables MYSQLPP_INC_DIR and MYSQLPP_LIB_DIR to the directory with) + $(warning the MySQL++ headers and libraries, respectively.) + $(warning See the Qweak Wiki for installation and compilation instructions.) + $(warning -> http://qweak.jlab.org/wiki/index.php/Software) + $(warning ) + $(warning Could not find the MySQL++ library) + else + $(warning Setting MYSQLPP_INC_DIR to /usr/local/include/mysql++) + MYSQLPP_INC_DIR = /usr/local/include/mysql++ + MYSQLPP_LIB_DIR = /usr/local/lib + endif + else + $(info Setting MYSQLPP_INC_DIR to /usr/include/mysql++) + MYSQLPP_INC_DIR = /usr/include/mysql++ + MYSQLPP_LIB_DIR = /usr/lib + endif + endif +endif +ifdef MYSQLPP_LIB_DIR +$(info Found the mysql libraries) +MYSQL_INC = -I${MYSQL_INC_DIR} +MYSQL_LIBS = -L${MYSQL_LIB_DIR} -lmysqlclient +MYSQLPP_INC = -I${MYSQLPP_INC_DIR} +MYSQLPP_LIBS = -L${MYSQLPP_LIB_DIR} -lmysqlpp +DEFAULTADD += -D__USE_DATABASE__ +else +MYSQL_INC = +MYSQL_LIBS = +MYSQLPP_INC = +MYSQLPP_LIBS = +endif + +############################ +############################ +# Some set-up for the MySQL++ library +############################ +############################ +#ifndef MYSQLPP_INC_DIR +# ifneq ($(strip $(shell $(FIND) /usr/include -maxdepth 1 -name mysql++)),/usr/include/mysql++) +# ifneq ($(strip $(shell $(FIND) /usr/local/include -maxdepth 1 -name mysql++)),/usr/local/include/mysql++) +# $(warning Install the MySQL++ library on your system, or set the environment) +# $(warning variables MYSQLPP_INC_DIR and MYSQLPP_LIB_DIR to the directory with) +# $(warning the MySQL++ headers and libraries, respectively.) +# $(warning See the Qweak Wiki for installation and compilation instructions.) +# $(warning -> http://qweak.jlab.org/wiki/index.php/Software) +# $(warning ) +# $(warning Could not find the MySQL++ library) +# else +# $(warning Setting MYSQLPP_INC_DIR to /usr/local/include/mysql++) +# MYSQLPP_INC_DIR = /usr/local/include/mysql++ +# MYSQLPP_LIB_DIR = /usr/local/lib +# endif +# else +# $(info Setting MYSQLPP_INC_DIR to /usr/include/mysql++) +# MYSQLPP_INC_DIR = /usr/include/mysql++ +# MYSQLPP_LIB_DIR = /usr/lib +# endif +#endif + + + ############################ ############################ # A few fixes : @@ -456,12 +541,13 @@ endif INCFLAGS = $(patsubst %,-I%,$(sort $(dir $(shell $(FIND) $(QWANALYSIS) | $(GREP) '\$(IncSuf)' | $(SED) '/\$(IncSuf)./d' | $(FILTER_OUT_TRASH) | $(INTO_RELATIVE_PATH) | $(FILTER_OUT_LIBRARYDIR_DEPS))))) # Qw include paths : /SomePath/QwAnalysis/Analysis/include/Foo.h -> -I./Analysis/include/ +INCFLAGS += $(MYSQL_INC) $(MYSQLPP_INC) INCFLAGS += $(BOOST_INC) -I./ # Necessary for dictionary files where include files are quoted with relative # path appended (default behaviour for root-cint) -CPPFLAGS = $(INCFLAGS) $(ROOTCFLAGS) $(CODACFLAGS) $(sort $(DEFAULTADD) $(ADD)) -std=c++11 +CPPFLAGS = $(INCFLAGS) $(ROOTCFLAGS) $(CODACFLAGS) $(sort $(DEFAULTADD) $(ADD)) # ADD should be contained in DEFAULTADD, but DEFAULTADD may be tempered with... CXXFLAGS += $(OPTIM) $(DEBUG) @@ -473,6 +559,7 @@ ifneq ($(CXX),CC) endif LIBS = -L$(QW_LIB) -lQw LIBS += $(ROOTLIBS) $(ROOTGLIBS) $(CODALIBS) +LIBS += $(MYSQL_LIBS) $(MYSQLPP_LIBS) LIBS += $(BOOST_LIBS) $(LDLIBS) ############################ diff --git a/Parity/include/LRBCorrector.h b/Parity/include/LRBCorrector.h new file mode 100644 index 000000000..b8806d8a4 --- /dev/null +++ b/Parity/include/LRBCorrector.h @@ -0,0 +1,73 @@ +/******************************************************************** +File Name: LRBCorrector.h + +Created by: Michael Vallee +Email: mv836315@ohio.edu + +Description: This is the header file of the LRBCorrector class, + which is a child of the VQwDataHandler class. The + functionality of this class is derived from + LinRegBlue. + +Last Modified: August 1, 2018 1:41 PM +********************************************************************/ + +#ifndef LRBCORRECTOR_H_ +#define LRBCORRECTOR_H_ + +// Parent Class +#include "VQwDataHandler.h" + + +//Formerly LRBRegression +class LRBCorrector : public VQwDataHandler { + + public: + + LRBCorrector(QwOptions &options, QwHelicityPattern& helicitypattern, const TString &run = "0"); + + /// \brief Define the configuration options + void static DefineOptions(QwOptions &options); + /// \brief Process the configuration options + void ProcessOptions(QwOptions &options); + + Int_t LoadChannelMap(const std::string& mapfile); + + Int_t ConnectChannels(QwSubsystemArrayParity& asym, QwSubsystemArrayParity& diff); + + void CalcOneOutput(const VQwHardwareChannel* dv, VQwHardwareChannel* output, + std::vector< const VQwHardwareChannel* > &ivs, + std::vector< Double_t > &sens); + + void ProcessData(); + + void LinearRegression(EQwRegType type); + + protected: + + LRBCorrector() { } + + bool fEnableCorrection; + + std::string outPath; + + /// Single event pointer + QwSubsystemArrayParity* fSubsystemArray; + /// Helicity pattern pointer + QwHelicityPattern* fHelicityPattern; + + /// Regression dependent and independent variable map + std::string fRegressionMapFile; + + std::vector< EQwRegType > fIndependentType; + std::vector< std::string > fIndependentName; + + std::vector< const VQwHardwareChannel* > fIndependentVar; + std::vector< Double_t > fIndependentValues; + + std::vector< std::vector< Double_t > > fSensitivity; + +}; + + +#endif // LRBCORRECTOR_H_ diff --git a/Parity/include/LinReg_Bevington_Pebay.h b/Parity/include/LinReg_Bevington_Pebay.h new file mode 100644 index 000000000..03552f63a --- /dev/null +++ b/Parity/include/LinReg_Bevington_Pebay.h @@ -0,0 +1,78 @@ +#ifndef LINREGBEVPEB_h +#define LINREGBEVPEB_h +/********************************************************************* + * $Id: $ + * \author Jan Balewski, MIT, 2010 + ********************************************************************* + * Descripion: + * Utility class accumulating variances and computing alphas based on : + * "Data reduction and error analysis for the physical sciences" / Philip R. Bevington, D. Keith Robinson. Bevington, Philip R., 1933- Boston : McGraw-Hill, c2003. + * "Formulas for Robust, One-Pass Parallel Computation of Covariances and Arbitrary-Order Statistical Moments" Philippe Peba, SANDIA REPORT SAND2008-6212, Unlimited Release, Printed September 2008 + *********************************************************************/ + +#include + +//----------------------------------------- +class LinRegBevPeb { + int par_nP; // number of independent variables + int par_nY; // number of dependent variables + + private: + Long64_t fGoodEventNumber; ///< accumulated so far + + public: + TMatrixD mA, mAsig; ///< found slopes + their stand errors + TMatrixD mRjk; ///< found covariance between IVs + TMatrixD mMP, mMY; ///< mean values accumulators + TMatrixD mVPP, mVPY,mVY2; ///< variances accumulators + + LinRegBevPeb(); + + virtual ~LinRegBevPeb(){}; + + /// processing single events + void accumulate(double *P, double *Y); + void solve(); + double Alpha(int ip, int iy){ return mA(ip,iy);} //ok + bool failed(){ return fGoodEventNumber<2;} + + // after last event + void printSummaryP(); + void printSummaryY(); + void printSummaryYP(); + void printSummaryAlphas(); + + void print(); + void init(); + void setDims(int a, int b){ par_nP=a; par_nY=b;} + + /// Get mean value of a variable, returns error code + Int_t getMeanP(const int i, Double_t &mean ); + Int_t getMeanY(const int i, Double_t &mean ); + + /// Get mean value of a variable, returns error code + Int_t getSigmaP(const int i, Double_t &sigma ); + Int_t getSigmaY(const int i, Double_t &sigma ); + + /// Get mean value of a variable, returns error code + Int_t getCovarianceP ( int i, int j, Double_t &covar ); + Int_t getCovariancePY( int ip, int iy, Double_t &covar ); + + double getUsedEve(){ return fGoodEventNumber;} + + + /// \brief Output stream operator + friend std::ostream& operator<< (std::ostream& stream, const LinRegBevPeb& h); + +}; + +/// Output stream operator +inline std::ostream& operator<< (std::ostream& stream, const LinRegBevPeb& h) { + stream << Form("LinRegBevPeb::<< "); + // stream << Form(" tag correlation>%.3f ", h.par_highCorr); + return stream; +} + + + +#endif diff --git a/Parity/include/QwBeamLine.h b/Parity/include/QwBeamLine.h index 2a242dd9b..cbf02602e 100755 --- a/Parity/include/QwBeamLine.h +++ b/Parity/include/QwBeamLine.h @@ -78,8 +78,8 @@ class QwBeamLine : public VQwSubsystemParity, public MQwSubsystemCloneable &values) const; +#ifdef __USE_DATABASE__ void FillDB_MPS(QwParityDB *db, TString datatype); void FillDB(QwParityDB *db, TString datatype); void FillErrDB(QwParityDB *db, TString datatype); +#endif // __USE_DATABASE__ void WritePromptSummary(QwPromptSummary *ps, TString type); Bool_t Compare(VQwSubsystem *source); diff --git a/Parity/include/MollerMainDetector.h b/Parity/include/QwBlindDetectorArray.h similarity index 91% rename from Parity/include/MollerMainDetector.h rename to Parity/include/QwBlindDetectorArray.h index 3f7e2ecc6..5dd405538 100755 --- a/Parity/include/MollerMainDetector.h +++ b/Parity/include/QwBlindDetectorArray.h @@ -1,5 +1,5 @@ /**********************************************************\ -* File: MollerMainDetector.h * +* File: QwBlindDetectorArray.h * * * * Author: P. M. King * * Time-stamp: <2007-05-08 15:40> * @@ -8,8 +8,8 @@ /// /// \ingroup QwAnalysis_ADC -#ifndef __MOLLERMAINDETECTOR__ -#define __MOLLERMAINDETECTOR__ +#ifndef __QWBLINDDETECTORARRAY__ +#define __QWBLINDDETECTORARRAY__ // System headers #include @@ -18,31 +18,30 @@ #include "VQwSubsystemParity.h" #include "QwIntegrationPMT.h" #include "QwCombinedPMT.h" +#include "QwDetectorArray.h" // Forward declarations class QwBlinder; -class MollerMainDetectorID; +class QwBlindDetectorArrayID; -class MollerMainDetector: - public VQwSubsystemParity, - public MQwSubsystemCloneable -{ +class QwBlindDetectorArray: public QwDetectorArray { + friend class QwCombinedPMT; /****************************************************************** - * Class: MollerMainDetector + * Class: QwBlindDetectorArray * * ******************************************************************/ private: /// Private default constructor (not implemented, will throw linker error on use) - MollerMainDetector(); + QwBlindDetectorArray(); public: /// Constructor with name - MollerMainDetector(const TString& name) - : VQwSubsystem(name),VQwSubsystemParity(name),bNormalization(kFALSE) + QwBlindDetectorArray(const TString& name) + : QwDetectorArray(name) { fTargetCharge.InitializeChannel("q_targ","derived"); fTargetX.InitializeChannel("x_targ","derived"); @@ -52,13 +51,14 @@ class MollerMainDetector: fTargetEnergy.InitializeChannel("e_targ","derived"); }; /// Copy constructor - MollerMainDetector(const MollerMainDetector& source) - : VQwSubsystem(source),VQwSubsystemParity(source), + QwBlindDetectorArray(const QwBlindDetectorArray& source) + : QwDetectorArray(source), fIntegrationPMT(source.fIntegrationPMT), - fCombinedPMT(source.fCombinedPMT) + fCombinedPMT(source.fCombinedPMT), + fMainDetID(source.fMainDetID) { } /// Virtual destructor - virtual ~MollerMainDetector() { }; + virtual ~QwBlindDetectorArray() { }; /* Member functions derived from VQwSubsystemParity. */ @@ -89,8 +89,8 @@ class MollerMainDetector: void ExchangeProcessedData(); void ProcessEvent_2(); - Bool_t PublishInternalValues() const; + Bool_t PublishByRequest(TString device_name); void SetRandomEventParameters(Double_t mean, Double_t sigma); void SetRandomEventAsymmetry(Double_t asymmetry); @@ -174,7 +174,7 @@ class MollerMainDetector: std::vector fIntegrationPMT; std::vector fCombinedPMT; - std::vector fMainDetID; + std::vector fMainDetID; /* * Maybe have an array of QwIntegrationPMT to describe the Sector, Ring, Slice structure? Maybe hold Ring 5 out and have it described as one list by Sector and slice? @@ -206,10 +206,10 @@ class MollerMainDetector: }; -class MollerMainDetectorID +class QwBlindDetectorArrayID { public: - MollerMainDetectorID():fSubbankIndex(-1),fWordInSubbank(-1), + QwBlindDetectorArrayID():fSubbankIndex(-1),fWordInSubbank(-1), fTypeID(kQwUnknownPMT),fIndex(-1), fSubelement(kInvalidSubelementIndex),fmoduletype(""),fdetectorname("") {}; diff --git a/Parity/include/QwBlinder.h b/Parity/include/QwBlinder.h index 6e5ba61d0..7179be409 100755 --- a/Parity/include/QwBlinder.h +++ b/Parity/include/QwBlinder.h @@ -116,7 +116,7 @@ class QwBlinder { /// Write to the database void FillDB(QwParityDB *db, TString datatype); void FillErrDB(QwParityDB *db, TString datatype); -#endif +#endif // __USE_DATABASE__ /// Modifies the device error code variable passed to it, if the blinder is /// not okay. @@ -275,7 +275,6 @@ class QwBlinder { std::vector GenerateDigest(const TString& input) const; std::vector fPatternCounters; ///< Counts the number of events in each failure mode - }; -#endif +#endif //__QWBLINDER__ diff --git a/Parity/include/QwCombiner.h b/Parity/include/QwCombiner.h new file mode 100644 index 000000000..b0aace050 --- /dev/null +++ b/Parity/include/QwCombiner.h @@ -0,0 +1,89 @@ +/* + * QwCombiner.h + * + * Created on: Oct 22, 2010 + * Author: wdconinc + * + * Last Modified: August 1, 2018 1:45 PM + */ + +#ifndef QWCOMBINER_H_ +#define QWCOMBINER_H_ + +// Parent Class +#include "LRBCorrector.h" + +//Formerly QwRegression +class QwCombiner : public LRBCorrector { + + public: + + typedef std::vector< VQwHardwareChannel* >::iterator Iterator_HdwChan; + typedef std::vector< VQwHardwareChannel* >::const_iterator ConstIterator_HdwChan; + + public: + + /// \brief Constructor with single event and helicity pattern + QwCombiner(QwOptions &options, QwSubsystemArrayParity& event, QwHelicityPattern& helicitypattern); + /// \brief Constructor with single event + QwCombiner(QwOptions &options, QwSubsystemArrayParity& event); + /// \brief Constructor with helicity pattern + QwCombiner(QwOptions &options, QwHelicityPattern& helicitypattern); + /// \brief Constructor with only options + QwCombiner(QwOptions &options); + /// \brief Copy constructor + QwCombiner(const QwCombiner &source); + /// Virtual destructor + virtual ~QwCombiner(); + + /// \brief Define the configuration options + void static DefineOptions(QwOptions &options); + /// \brief Process the configuration options + void ProcessOptions(QwOptions &options); + + + /// \brief Load the channels and sensitivities + Int_t LoadChannelMap(const std::string& mapfile); + /// \brief Connect to channels + Int_t ConnectChannels(QwSubsystemArrayParity& event, + QwSubsystemArrayParity& asym, + QwSubsystemArrayParity& diff); + /// \brief Connect to Channels (event only) + Int_t ConnectChannels(QwSubsystemArrayParity& event); + /// \brief Connect to Channels (asymmetry/difference only) + Int_t ConnectChannels(QwSubsystemArrayParity& asym, + QwSubsystemArrayParity& diff); + + /// \brief Linear regression + void LinearRegression(EQwRegType type); + + void ProcessData(); + + protected: + + /// Default constructor (Protected for child class access) + QwCombiner() { }; + + /// List of channels to use in the regression + std::vector< std::vector< EQwRegType > > fIndependentType; + std::vector< std::vector< std::string > > fIndependentName; + + // std::vector< std::pair< VQwHardwareChannel*, VQwHardwareChannel*> > fDependentVar; + // std::vector< std::vector< std::pair< Double_t, const VQwHardwareChannel* > > > fIndependentVar; + std::vector< std::vector< Double_t > > fSensitivity; + std::vector< std::vector< const VQwHardwareChannel* > > fIndependentVar; + +}; // class QwCombiner + +inline std::ostream& operator<< (std::ostream& stream, const QwCombiner::EQwRegType& i) { + switch (i){ + case QwCombiner::kRegTypeMps: stream << "mps"; break; + case QwCombiner::kRegTypeAsym: stream << "asym"; break; + case QwCombiner::kRegTypeDiff: stream << "diff"; break; + default: stream << "Unknown"; + } + return stream; +} + + +#endif // QWCOMBINER_H_ diff --git a/Parity/include/QwRegressionSubsystem.h b/Parity/include/QwCombinerSubsystem.h similarity index 58% rename from Parity/include/QwRegressionSubsystem.h rename to Parity/include/QwCombinerSubsystem.h index 2d43e6e67..e9fadd3fa 100755 --- a/Parity/include/QwRegressionSubsystem.h +++ b/Parity/include/QwCombinerSubsystem.h @@ -1,5 +1,5 @@ /* - * QwRegressionSubsystem.h + * QwCombinerSubsystem.h * * Created on: Aug 11, 2011 * Author: meeker @@ -16,46 +16,46 @@ #include "QwOptions.h" #include "VQwSubsystemParity.h" #include "QwSubsystemArrayParity.h" -#include "QwRegression.h" +#include "QwCombiner.h" class QwParameterFile; /** - * \class QwRegressionSubsystem + * \class QwCombinerSubsystem * * \brief * */ -class QwRegressionSubsystem: public VQwSubsystemParity, - public MQwSubsystemCloneable, - public QwRegression +class QwCombinerSubsystem: public VQwSubsystemParity, + public MQwSubsystemCloneable, + public QwCombiner { public: // Constructors /// \brief Constructor with just name. - /// (use gQwOptions to initialize the QwRegression baseclass) - QwRegressionSubsystem(TString name) - : VQwSubsystem(name), VQwSubsystemParity(name), QwRegression(gQwOptions) { } + /// (use gQwOptions to initialize the QwCombiner baseclass) + QwCombinerSubsystem(TString name) + : VQwSubsystem(name), VQwSubsystemParity(name), QwCombiner(gQwOptions) { } /// \brief Constructor with only options - QwRegressionSubsystem(QwOptions &options, TString name) - : VQwSubsystem(name), VQwSubsystemParity(name), QwRegression(options) { } + QwCombinerSubsystem(QwOptions &options, TString name) + : VQwSubsystem(name), VQwSubsystemParity(name), QwCombiner(options) { } /// \brief Constructor with single event - QwRegressionSubsystem(QwOptions &options, QwSubsystemArrayParity& event, TString name) - : VQwSubsystem(name), VQwSubsystemParity(name), QwRegression(options, event) - { QwMessage << "Constructing QwRegressionSubsystem" << QwLog::endl; } + QwCombinerSubsystem(QwOptions &options, QwSubsystemArrayParity& event, TString name) + : VQwSubsystem(name), VQwSubsystemParity(name), QwCombiner(options, event) + { QwMessage << "Constructing QwCombinerSubsystem" << QwLog::endl; } // Copy Constructor - QwRegressionSubsystem(const QwRegressionSubsystem &source) - : VQwSubsystem(source), VQwSubsystemParity(source), QwRegression(source) { } + QwCombinerSubsystem(const QwCombinerSubsystem &source) + : VQwSubsystem(source), VQwSubsystemParity(source), QwCombiner(source) { } // Destructor - ~QwRegressionSubsystem(); + ~QwCombinerSubsystem(); boost::shared_ptr GetSharedPointerToStaticObject(); - void ProcessOptions(QwOptions &options){QwRegression::ProcessOptions(options);}; + void ProcessOptions(QwOptions &options){QwCombiner::ProcessOptions(options);}; /// \brief Update the running sums void AccumulateRunningSum(VQwSubsystem* input); @@ -66,7 +66,7 @@ class QwRegressionSubsystem: public VQwSubsystemParity, void PrintValue() const; void LinearRegression(){ - QwRegression::LinearRegression(QwRegression::kRegTypeMps); + QwCombiner::LinearRegression(QwCombiner::kRegTypeMps); } @@ -82,10 +82,10 @@ class QwRegressionSubsystem: public VQwSubsystemParity, void Scale(Double_t value); void ConstructBranchAndVector(TTree *tree, TString& prefix, std::vector &values){ - QwRegression::ConstructBranchAndVector(tree,prefix,values); + QwCombiner::ConstructBranchAndVector(tree,prefix,values); } void FillTreeVector(std::vector &values) const{ - QwRegression::FillTreeVector(values); + QwCombiner::FillTreeVector(values); } void ConstructHistograms(TDirectory *folder, TString &prefix); @@ -97,22 +97,30 @@ class QwRegressionSubsystem: public VQwSubsystemParity, - //update the error flag in the subsystem level from the top level routines related to stability checks. This will uniquely update the errorflag at each channel based on the error flag in the corresponding channel in the ev_error subsystem + //update the error flag in the subsystem level from the top level routines related to stability checks + // This will uniquely update the errorflag at each channel based on the error flag in the corresponding channel in the ev_error subsystem void UpdateErrorFlag(const VQwSubsystem *ev_error); /// \brief Derived functions - // not sure if there should be empty definition, no definition or defined + // not sure if there should be empty definition, no definition or defined Int_t LoadChannelMap(TString); Int_t LoadInputParameters(TString); Int_t LoadEventCuts(TString); void ClearEventData(){ - PairIterator element; - for (element = fDependentVar.begin(); - element != fDependentVar.end(); ++element) { - if (element->second != NULL) - element->second->ClearEventData(); - } + for (size_t i = 0; i < fOutputVar.size(); ++i) { + if (fOutputVar.at(i) != NULL) { + fOutputVar.at(i)->ClearEventData(); + } + } + /* + Iterator_HdwChan element; + for (element = fOutputVar.begin(); element != fOutputVar.end(); ++element) { + if (*element != NULL) { + (*element)->ClearEventData(); + } + } + */ }; Int_t ProcessConfigurationBuffer(UInt_t, UInt_t, UInt_t*, UInt_t); Int_t ProcessEvBuffer(UInt_t, UInt_t, UInt_t*, UInt_t); @@ -130,12 +138,12 @@ class QwRegressionSubsystem: public VQwSubsystemParity, * Default Constructor * * Error: tries to call default constructors of base class, - * QwRegression() is private + * QwCombiner() is private */ - // QwRegressionSubsystem() {}; + // QwCombinerSubsystem() {}; -}; // class QwRegressionSubsystem +}; // class QwCombinerSubsystem #endif // __QWREGRESSIONSUBSYSTEM__ diff --git a/Parity/include/QwCorrelator.h b/Parity/include/QwCorrelator.h new file mode 100644 index 000000000..9d9c96c7e --- /dev/null +++ b/Parity/include/QwCorrelator.h @@ -0,0 +1,79 @@ +/******************************************************************** +File Name: QwCorrelator.h + +Created by: Michael Vallee +Email: mv836315@ohio.edu + +Description: This is the header file of the QwCorrelator class, + which is a child of the VQwDataHandler class. The + functionality of this class is derived from + LinRegBlue. + +Last Modified: August 1, 2018 1:43 PM +********************************************************************/ + +#ifndef QWCORRELATOR_H_ +#define QWCORRELATOR_H_ + +// Parent Class +#include "VQwDataHandler.h" + +// LinRegBlue Correlator Class +#include "QwkRegBlueCorrelator.h" + +class QwCorrelator : public VQwDataHandler { + + public: + + void init(const std::string configFName); + void FillCorrelator(); + void CalcCorrelations(); + + QwCorrelator(QwOptions &options, QwHelicityPattern& helicitypattern, const TString &run = "0"); + + void readConfig(const char * configFName); + + /// \brief Define the configuration options + void static DefineOptions(QwOptions &options); + /// \brief Process the configuration options + void ProcessOptions(QwOptions &options); + + /// \brief Connect to Channels (asymmetry/difference only) + Int_t ConnectChannels(QwSubsystemArrayParity& asym, QwSubsystemArrayParity& diff); + + void unpackEvent(); + + Int_t LoadChannelMap(const std::string& mapfile); + + protected: + + bool fEnableCorrelation; + bool fDisableHistos; + + std::string fCorrelatorMapFile; + + std::vector< TString > fIndependentFull; + std::vector< TString > fDependentFull; + + // Using the fDependentType and fDependentName from base class, but override the IV arrays + std::vector< EQwRegType > fIndependentType; + std::vector< std::string > fIndependentName; + + std::vector< const VQwHardwareChannel* > fIndependentVar; + std::vector< Double_t > fIndependentValues; + + std::string fAlphaOutputPath; + std::string fAliasOutputPath; + + + private: + + //Default Constructor + QwCorrelator():corA("input") { }; + + QwkRegBlueCorrelator corA; + +}; + + +#endif //QWCORRELATOR_H_ diff --git a/Parity/include/QwDetectorArray.h b/Parity/include/QwDetectorArray.h new file mode 100644 index 000000000..9b91c3432 --- /dev/null +++ b/Parity/include/QwDetectorArray.h @@ -0,0 +1,246 @@ +/**********************************************************\ +* File: QwDetectorArray.h * +* * +* Author: P. M. King * +* Time-stamp: <2007-05-08 15:40> * +\**********************************************************/ + +/// +/// \ingroup QwAnalysis_ADC + +#ifndef __QWDETECTORARRAY__ +#define __QWDETECTORARRAY__ + +// System headers +#include + +// Qweak headers +#include "VQwSubsystemParity.h" +#include "QwIntegrationPMT.h" +#include "QwCombinedPMT.h" + + +// Forward declarations +class QwDetectorArrayID; + + +class QwDetectorArray: + public VQwSubsystemParity, + public MQwSubsystemCloneable +{ + friend class QwCombinedPMT; + /****************************************************************** + * Class: QwDetectorArray + * + * + ******************************************************************/ + protected: + /// Private default constructor (not implemented, will throw linker error on use) + QwDetectorArray(); + + public: + /// Constructor with name + QwDetectorArray(const TString& name) + : VQwSubsystem(name),VQwSubsystemParity(name),bNormalization(kFALSE) + { + fTargetCharge.InitializeChannel("q_targ","derived"); + fTargetX.InitializeChannel("x_targ","derived"); + fTargetY.InitializeChannel("y_targ","derived"); + fTargetXprime.InitializeChannel("xp_targ","derived"); + fTargetYprime.InitializeChannel("yp_targ","derived"); + fTargetEnergy.InitializeChannel("e_targ","derived"); + }; + /// Copy constructor + QwDetectorArray(const QwDetectorArray& source) + : VQwSubsystem(source),VQwSubsystemParity(source), + fIntegrationPMT(source.fIntegrationPMT), + fCombinedPMT(source.fCombinedPMT), + fMainDetID(source.fMainDetID) + { } + /// Virtual destructor + virtual ~QwDetectorArray() { }; + + /* Member functions derived from VQwSubsystemParity. */ + + /// \brief Define options function + static void DefineOptions(QwOptions &options); + + + void ProcessOptions(QwOptions &options);//Handle command line options + Int_t LoadChannelMap(TString mapfile); + Int_t LoadInputParameters(TString pedestalfile); + Int_t LoadEventCuts(TString filename); + Bool_t ApplySingleEventCuts();//Check for good events by stting limits on the devices readings + void IncrementErrorCounters(); + void PrintErrorCounters() const;// report number of events failed due to HW and event cut faliure + UInt_t GetEventcutErrorFlag();//return the error flag + + //update the error flag in the subsystem level from the top level routines related to stability checks. This will uniquely update the errorflag at each channel based on the error flag in the corresponding channel in the ev_error subsystem + void UpdateErrorFlag(const VQwSubsystem *ev_error); + + + Int_t ProcessConfigurationBuffer(const UInt_t roc_id, const UInt_t bank_id, UInt_t* buffer, UInt_t num_words); + Int_t ProcessEvBuffer(const UInt_t roc_id, const UInt_t bank_id, UInt_t* buffer, UInt_t num_words); + + void ClearEventData(); + Bool_t IsGoodEvent(); + + void ProcessEvent(); + void ExchangeProcessedData(); + void ProcessEvent_2(); + + Bool_t PublishInternalValues() const; + Bool_t PublishByRequest(TString device_name); + + void SetRandomEventParameters(Double_t mean, Double_t sigma); + void SetRandomEventAsymmetry(Double_t asymmetry); + void RandomizeEventData(int helicity = 0, Double_t time = 0.0); + void EncodeEventData(std::vector &buffer); + void RandomizeMollerEvent(int helicity/*, const QwBeamCharge& charge, const QwBeamPosition& xpos, const QwBeamPosition& ypos, const QwBeamAngle& xprime, const QwBeamAngle& yprime, const QwBeamEnergy& energy*/); + + void ConstructHistograms(TDirectory *folder){ + TString tmpstr(""); + ConstructHistograms(folder,tmpstr); + }; + + using VQwSubsystem::ConstructHistograms; + void ConstructHistograms(TDirectory *folder, TString &prefix); + void FillHistograms(); + + using VQwSubsystem::ConstructBranchAndVector; + void ConstructBranchAndVector(TTree *tree, TString &prefix, std::vector &values); + void ConstructBranch(TTree *tree, TString &prefix); + void ConstructBranch(TTree *tree, TString &prefix, QwParameterFile& trim_file ); + + void FillTreeVector(std::vector &values) const; + //void FillDB(QwParityDB *db, TString datatype); + //void FillErrDB(QwParityDB *db, TString datatype); + + const QwIntegrationPMT* GetChannel(const TString name) const; + + Bool_t Compare(VQwSubsystem* source); + + + VQwSubsystem& operator= ( VQwSubsystem *value); + VQwSubsystem& operator+= ( VQwSubsystem *value); + VQwSubsystem& operator-= ( VQwSubsystem *value); + + + void Sum(VQwSubsystem* value1, VQwSubsystem* value2); + void Difference(VQwSubsystem* value1, VQwSubsystem* value2); + void Ratio(VQwSubsystem* numer, VQwSubsystem* denom); + void Scale(Double_t factor); + void Normalize(VQwDataElement* denom); + + void AccumulateRunningSum(VQwSubsystem* value); + //remove one entry from the running sums for devices + void DeaccumulateRunningSum(VQwSubsystem* value); + void CalculateRunningAverage(); + + const QwIntegrationPMT* GetIntegrationPMT(const TString name) const; + const QwCombinedPMT* GetCombinedPMT(const TString name) const; + + void DoNormalization(Double_t factor=1.0); + + Bool_t ApplyHWChecks(){//Check for harware errors in the devices + Bool_t status = kTRUE; + for (size_t i=0; i fIntegrationPMT; + std::vector fCombinedPMT; + std::vector fMainDetID; + +/* +* Maybe have an array of QwIntegrationPMT to describe the Sector, Ring, Slice structure? Maybe hold Ring 5 out and have it described as one list by Sector and slice? + Need a way to define the correlations to all beam parameters for each element. + Need a way to define asymmetries for each element. + Need a way to create the full event data buffers + Start with all channels and modules in a single ROC subbank: make a mock_moller_adc.map with 28 8-channel modules with names like we discussed + Make a new RandomizeEventData which will take the helicity and beam current and beam params, and fill the detector elements as we discussed. +*/ + + + protected: + QwBeamCharge fTargetCharge; + QwBeamPosition fTargetX; + QwBeamPosition fTargetY; + QwBeamAngle fTargetXprime; + QwBeamAngle fTargetYprime; + QwBeamEnergy fTargetEnergy; + + Bool_t bIsExchangedDataValid; + + Bool_t bNormalization; + + private: + + static const Bool_t bDEBUG=kFALSE; + Int_t fMainDetErrorCount; + +}; + + +class QwDetectorArrayID +{ + public: + QwDetectorArrayID():fSubbankIndex(-1),fWordInSubbank(-1), + fTypeID(kQwUnknownPMT),fIndex(-1), + fSubelement(kInvalidSubelementIndex),fmoduletype(""),fdetectorname("") + {}; + + int fSubbankIndex; + int fWordInSubbank; //first word reported for this channel in the subbank + //(eg VQWK channel report 6 words for each event, scalers oly report one word per event) + // The first word of the subbank gets fWordInSubbank=0 + + EQwPMTInstrumentType fTypeID; // type of detector + int fIndex; // index of this detector in the vector containing all the detector of same type + UInt_t fSubelement; // some detectors have many subelements (eg stripline have 4 antenas) + // some have only one sub element(eg lumis have one channel) + + TString fmoduletype; // eg: VQWK, SCALER + TString fdetectorname; + TString fdetectortype; // stripline, IntegrationPMT, ... this string is encoded by fTypeID + + std::vector fCombinedChannelNames; + std::vector fWeight; + + void Print() const; + +}; + + +#endif + + + + + + + + + + + + + diff --git a/Parity/include/QwHelicity.h b/Parity/include/QwHelicity.h index 8635d0ba6..d24884985 100755 --- a/Parity/include/QwHelicity.h +++ b/Parity/include/QwHelicity.h @@ -138,7 +138,7 @@ class QwHelicity: public VQwSubsystemParity, public MQwSubsystemCloneable &values) const; +#ifdef __USE_DATABASE__ void FillDB(QwParityDB *db, TString datatype); void FillErrDB(QwParityDB *db, TString datatype); +#endif // __USE_DATABASE__ void WritePromptSummary(QwPromptSummary *ps, TString type); const VQwDataElement* GetChannel(const TString name) const; diff --git a/Parity/include/QwLumi.h b/Parity/include/QwLumi.h deleted file mode 100755 index a42282804..000000000 --- a/Parity/include/QwLumi.h +++ /dev/null @@ -1,193 +0,0 @@ -/**********************************************************\ -* File: QwLumi.h * -* * -* Author: * -* Time-stamp: * -\**********************************************************/ - -#ifndef __QwLUMI__ -#define __QwLUMI__ - -// System headers -#include - -// ROOT headers -#include "TTree.h" - -// Qweak headers -#include "VQwSubsystemParity.h" - -#include "QwIntegrationPMT.h" -#include "QwCombinedPMT.h" -#include "QwTypes.h" -#include "QwScaler_Channel.h" - - -class QwLumiDetectorID{ - - public: - - QwLumiDetectorID():fSubbankIndex(-1),fWordInSubbank(-1), - fTypeID(kQwUnknownPMT),fIndex(-1), - fSubelement(999999),fmoduletype(""),fdetectorname("") - {}; - - int fSubbankIndex; - int fWordInSubbank; //first word reported for this channel in the subbank - //(eg VQWK channel report 6 words for each event, scalers oly report one word per event) - // The first word of the subbank gets fWordInSubbank=0 - - EQwPMTInstrumentType fTypeID; // type of detector - int fIndex; // index of this detector in the vector containing all the detector of same type - UInt_t fSubelement; // some detectors have many subelements (eg stripline have 4 antenas) some have only one sub element(eg lumis have one channel) - - TString fmoduletype; // eg: VQWK, SCALER - TString fdetectorname; - TString fdetectortype; // IntegrationPMT,fLumiCounter .. this string is encoded by fTypeID - std::vector fCombinedChannelNames; - std::vector fWeight; - void Print() const; - -}; - - -/***************************************************************** -* Class: -******************************************************************/ -class QwLumi : public VQwSubsystemParity, public MQwSubsystemCloneable { - ///// - friend class QwCombinedPMT; - - private: - /// Private default constructor (not implemented, will throw linker error on use) - QwLumi(); - - public: - /// Constructor with name - QwLumi(const TString& name) - : VQwSubsystem(name),VQwSubsystemParity(name),bNormalization(kFALSE) - { - fTargetCharge.InitializeChannel("q_targ","derived"); - }; - /// Copy constructor - QwLumi(const QwLumi& source) - : VQwSubsystem(source),VQwSubsystemParity(source), - fIntegrationPMT(source.fIntegrationPMT),fCombinedPMT(source.fCombinedPMT), - fScalerPMT(source.fScalerPMT), - fLumiDetectorID(source.fLumiDetectorID) - { } - /// Virtual destructor - virtual ~QwLumi() { }; - - - /* derived from VQwSubsystem */ - - /// \brief Define options function - static void DefineOptions(QwOptions &options); - - - void ProcessOptions(QwOptions &options);//Handle command line options - Int_t LoadChannelMap(TString mapfile); - Int_t LoadInputParameters(TString pedestalfile); - Int_t LoadEventCuts(TString filename);//derived from VQwSubsystemParity - Bool_t ApplySingleEventCuts();//derived from VQwSubsystemParity - void IncrementErrorCounters(); - void PrintErrorCounters() const;// report number of events failed due to HW and event cut faliures - UInt_t GetEventcutErrorFlag();//return the error flag - //update the error flag in the subsystem level from the top level routines related to stability checks. This will uniquely update the errorflag at each channel based on the error flag in the corresponding channel in the ev_error subsystem - void UpdateErrorFlag(const VQwSubsystem *ev_error); - - void AccumulateRunningSum(VQwSubsystem* value); - //remove one entry from the running sums for devices - void DeaccumulateRunningSum(VQwSubsystem* value); - void CalculateRunningAverage(); - - Int_t ProcessConfigurationBuffer(const UInt_t roc_id, const UInt_t bank_id, UInt_t* buffer, UInt_t num_words); - Int_t ProcessEvBuffer(const UInt_t roc_id, const UInt_t bank_id, UInt_t* buffer, UInt_t num_words); - void PrintDetectorID() const; - - void ClearEventData(); - Bool_t IsGoodEvent(); - - void ProcessEvent(); - void ExchangeProcessedData(); - void ProcessEvent_2(); - - Bool_t PublishInternalValues() const; - Bool_t PublishByRequest(TString device_name); - - void DoNormalization(Double_t factor=1.0); - - void SetRandomEventParameters(Double_t mean, Double_t sigma); - void SetRandomEventAsymmetry(Double_t asymmetry); - void RandomizeEventData(int helicity = 0, double time = 0.0); - void EncodeEventData(std::vector &buffer); - - VQwSubsystem& operator= (VQwSubsystem *value); - VQwSubsystem& operator+= (VQwSubsystem *value); - VQwSubsystem& operator-= (VQwSubsystem *value); - void Sum(VQwSubsystem *value1, VQwSubsystem *value2); - void Difference(VQwSubsystem *value1, VQwSubsystem *value2); - void Ratio(VQwSubsystem *numer, VQwSubsystem *denom); - void Normalize(VQwDataElement* denom); - void Scale(Double_t factor); - - using VQwSubsystem::ConstructHistograms; - void ConstructHistograms(TDirectory *folder, TString &prefix); - void FillHistograms(); - - void ConstructBranchAndVector(TTree *tree, TString &prefix, std::vector &values); - void ConstructBranch(TTree *tree, TString &prefix); - void ConstructBranch(TTree *tree, TString &prefix, QwParameterFile& trim_file); - void FillTreeVector(std::vector &values) const; - -#ifdef __USE_DATABASE__ - void FillDB(QwParityDB *db, TString datatype); - void FillErrDB(QwParityDB *db, TString datatype); -#endif - - const QwIntegrationPMT* GetChannel(const TString name) const; - const QwIntegrationPMT* GetIntegrationPMT(const TString name) const; - const QwCombinedPMT* GetCombinedPMT(const TString name) const; - - Bool_t Compare(VQwSubsystem *source); - - void PrintValue() const; - void PrintInfo() const; - void WritePromptSummary(QwPromptSummary *ps, TString type); - - std::vector fgDetectorTypeNames; - - -///// - protected: - - EQwPMTInstrumentType GetDetectorTypeID(TString name); - - Int_t GetDetectorIndex(EQwPMTInstrumentType TypeID, TString name); - //when the type and the name is passed the detector index from appropriate vector will be returned - //for example if TypeID is IntegrationPMT then the index of the detector from fIntegrationPMT vector for given name will be returnd. - - std::vector fIntegrationPMT; - std::vector fCombinedPMT; - std::vector fScalerPMT; - - std::vector fLumiDetectorID; - - protected: - QwBeamCharge fTargetCharge; - Bool_t bIsExchangedDataValid; - Bool_t bNormalization; - -///// - private: - Int_t fQwLumiErrorCount; - - static const Bool_t bDEBUG=kFALSE; - -}; - - - - -#endif diff --git a/Parity/include/QwMainCerenkovDetector.h b/Parity/include/QwMainCerenkovDetector.h index 25b064154..9a4500df7 100755 --- a/Parity/include/QwMainCerenkovDetector.h +++ b/Parity/include/QwMainCerenkovDetector.h @@ -112,8 +112,10 @@ class QwMainCerenkovDetector: void ConstructBranch(TTree *tree, TString &prefix, QwParameterFile& trim_file ); void FillTreeVector(std::vector &values) const; - //void FillDB(QwParityDB *db, TString datatype); - //void FillErrDB(QwParityDB *db, TString datatype); +#ifdef __USE_DATABASE__ + void FillDB(QwParityDB *db, TString datatype); + void FillErrDB(QwParityDB *db, TString datatype); +#endif // __USE_DATABASE__ const QwIntegrationPMT* GetChannel(const TString name) const; diff --git a/Parity/include/QwOptionsParity.h b/Parity/include/QwOptionsParity.h index 0a4aefc31..652953b9a 100755 --- a/Parity/include/QwOptionsParity.h +++ b/Parity/include/QwOptionsParity.h @@ -18,33 +18,36 @@ #include "QwOptions.h" // Qweak headers -//#include "QwMainCerenkovDetector.h" -#include "MollerMainDetector.h" -#include "QwLumi.h" +#include "QwMainCerenkovDetector.h" #include "QwEventRing.h" #include "QwHelicity.h" #include "QwHelicityPattern.h" -//#include "QwRegression.h" +#include "VQwDataHandler.h" +#include "LRBCorrector.h" +#include "QwCombiner.h" +#include "QwCorrelator.h" +#include "QwDetectorArray.h" + #ifdef __USE_DATABASE__ #include "QwParityDB.h" -#endif - +#endif //__USE_DATABASE__ void DefineOptionsParity(QwOptions& options) { /* Define general options */ QwOptions::DefineOptions(options); /* Define parity options */ - // QwMainCerenkovDetector::DefineOptions(options); - MollerMainDetector::DefineOptions(options); - QwLumi::DefineOptions(options); + QwMainCerenkovDetector::DefineOptions(options); + QwDetectorArray::DefineOptions(options); QwEventRing::DefineOptions(options); QwHelicity::DefineOptions(options); QwHelicityPattern::DefineOptions(options); - // QwRegression::DefineOptions(options); -#ifdef __USE_QwParityDB + LRBCorrector::DefineOptions(options); + QwCorrelator::DefineOptions(options); + QwCombiner::DefineOptions(options); + #ifdef __USE_DATABASE__ QwParityDB::DefineAdditionalOptions(options); -#endif + #endif //__USE_DATABASE__ } #endif // QWOPTIONSPARITY_H diff --git a/Parity/include/QwParityDB.h b/Parity/include/QwParityDB.h index 64aceaeab..616650160 100755 --- a/Parity/include/QwParityDB.h +++ b/Parity/include/QwParityDB.h @@ -16,7 +16,11 @@ #include // Third Party Headers +#ifdef __USE_DATABASE__ +#pragma GCC diagnostic ignored "-Wdeprecated" #include +#pragma GCC diagnostic pop +#endif // __USE_DATABASE__ // ROOT headers #include "TString.h" diff --git a/Parity/include/QwParitySSQLS.h b/Parity/include/QwParitySSQLS.h index a4cd44460..326f301f7 100755 --- a/Parity/include/QwParitySSQLS.h +++ b/Parity/include/QwParitySSQLS.h @@ -21,8 +21,10 @@ #define MYSQLPP_SSQLS_NO_STATICS #endif +#pragma GCC diagnostic ignored "-Wdeprecated" #include "mysql++.h" #include "ssqls.h" +#pragma GCC diagnostic pop // Exclude from doxygen processing because of numerous warnings /// @cond PARITY_SSQLS diff --git a/Parity/include/QwRegression.h b/Parity/include/QwRegression.h deleted file mode 100755 index 47f28e0c3..000000000 --- a/Parity/include/QwRegression.h +++ /dev/null @@ -1,138 +0,0 @@ -/* - * QwRegression.h - * - * Created on: Oct 22, 2010 - * Author: wdconinc - */ - -#ifndef QWREGRESSION_H_ -#define QWREGRESSION_H_ - -// Qweak headers -#include "QwHelicityPattern.h" -#include "QwSubsystemArrayParity.h" -#include "VQwHardwareChannel.h" - -/** - * ... info to follow ... really, I promise ... - */ -class QwRegression { - - public: - - /// Type of regression variable - enum EQwRegType { - kRegTypeUnknown=0, kRegTypeMps, kRegTypeAsym, kRegTypeDiff - }; - - typedef std::vector< std::pair< VQwHardwareChannel*,VQwHardwareChannel*> >::iterator PairIterator; - typedef std::vector< std::pair< VQwHardwareChannel*,VQwHardwareChannel*> >::const_iterator PairConstIterator; - - public: - - /// \brief Constructor with single event and helicity pattern - QwRegression(QwOptions &options, - QwSubsystemArrayParity& event, - QwHelicityPattern& helicitypattern); - /// \brief Constructor with single event - QwRegression(QwOptions &options, QwSubsystemArrayParity& event); - /// \brief Constructor with helicity pattern - QwRegression(QwOptions &options, QwHelicityPattern& helicitypattern); - /// \brief Constructor with only options - QwRegression(QwOptions &options); - /// \brief Copy constructor - QwRegression(const QwRegression &source); - /// Virtual destructor - virtual ~QwRegression(); - - - /// \brief Define the configuration options - static void DefineOptions(QwOptions &options); - /// \brief Process the configuration options - void ProcessOptions(QwOptions &options); - - - /// \brief Load the channels and sensitivities - Int_t LoadChannelMap(const std::string& mapfile); - /// \brief Connect to channels - Int_t ConnectChannels(QwSubsystemArrayParity& event, - QwSubsystemArrayParity& asym, - QwSubsystemArrayParity& diff); - /// \brief Connect to Channels (event only) - Int_t ConnectChannels(QwSubsystemArrayParity& event); - /// \brief Connect to Channels (asymmetry/difference only) - Int_t ConnectChannels(QwSubsystemArrayParity& asym, - QwSubsystemArrayParity& diff); - - /// \brief Linear regression - void LinearRegression(EQwRegType type); - - - /// \name Tree and vector construction and maintenance - // @{ - /// Construct the tree and vector for this subsystem - void ConstructBranchAndVector(TTree *tree, std::vector &values) { - TString tmpstr(""); - ConstructBranchAndVector(tree,tmpstr,values); - }; - /// \brief Construct a branch and vector for this subsystem with a prefix - void ConstructBranchAndVector(TTree *tree, TString& prefix, std::vector &values); - - /// \brief Fill the vector for this subsystem - void FillTreeVector(std::vector &values) const; - // @} - - - - void AccumulateRunningSum(QwRegression value); - void CalculateRunningAverage(); - void PrintValue() const; - void FillDB(QwParityDB *db, TString datatype); - private: - - /// Private default constructor - QwRegression() { }; - - protected: - /// Flag to enable regression - bool fEnableRegression; - - /// Regression dependent and independent variable map - std::string fRegressionMapFile; - - /// Single event pointer - QwSubsystemArrayParity* fSubsystemArray; - /// Helicity pattern pointer - QwHelicityPattern* fHelicityPattern; - - UInt_t fErrorFlag; - - /// Parse regression variable in type and name - std::pair ParseRegressionVariable(const std::string& variable); - - /// List of channels to use in the regression - std::vector< EQwRegType > fDependentType; - std::vector< std::string > fDependentName; - std::vector< std::vector< EQwRegType > > fIndependentType; - std::vector< std::vector< std::string > > fIndependentName; - std::vector< std::vector< Double_t> > fSensitivity; - - std::vector< EQwRegType > fDependentVarType; - std::vector< std::pair< VQwHardwareChannel*, VQwHardwareChannel*> > fDependentVar; - std::vector< std::vector< std::pair< Double_t, const VQwHardwareChannel* > > > fIndependentVar; - - -}; // class QwRegression - -inline std::ostream& operator<< (std::ostream& stream, const QwRegression::EQwRegType& i) { - switch (i){ - case QwRegression::kRegTypeMps: stream << "mps"; break; - case QwRegression::kRegTypeAsym: stream << "asym"; break; - case QwRegression::kRegTypeDiff: stream << "diff"; break; - default: stream << "Unknown"; - } - return stream; -} - - -#endif // QWREGRESSION_H_ diff --git a/Parity/include/QwSubsystemArrayParity.h b/Parity/include/QwSubsystemArrayParity.h index 2915bb826..21a961e40 100755 --- a/Parity/include/QwSubsystemArrayParity.h +++ b/Parity/include/QwSubsystemArrayParity.h @@ -40,6 +40,11 @@ class QwSubsystemArrayParity: public QwSubsystemArray { public: + friend class VQwDataHandler; + friend class QwCombiner; + friend class QwCorrelator; + friend class LRBCorrector; + /// Constructor with options QwSubsystemArrayParity(QwOptions& options): QwSubsystemArray(options, CanContain),fErrorFlag(0),fErrorFlagTreeIndex(-1) { }; /// Copy constructor by reference diff --git a/Parity/include/QwkRegBlueCorrelator.h b/Parity/include/QwkRegBlueCorrelator.h new file mode 100644 index 000000000..a19dcdcbe --- /dev/null +++ b/Parity/include/QwkRegBlueCorrelator.h @@ -0,0 +1,49 @@ +#ifndef JBCORRELATOR_H +#define JBCORRELATOR_H +/********************************************************************* + * $Id: $ + * \author Jan Balewski, MIT, 2010 + ********************************************************************* + * Descripion: + * Finds correlation and alphas for QW event + *********************************************************************/ + +#include +#include +class TH1; + +#include "LinReg_Bevington_Pebay.h" + +class QwkRegBlueCorrelator { + private: + + TString mCore; + int nP,nY; + + // histograms + enum {mxHA=4}; TH1 * hA[mxHA]; + + // monitoring histos for iv & dv + TH1 ** h1iv, **h2iv, ** h1dv, **h2dv; + void initHistos(std::vector < TString > ivName, std::vector < TString > dvName); + LinRegBevPeb linReg; + + bool fDisableHistos; + + public: + QwkRegBlueCorrelator(const char *core); + ~QwkRegBlueCorrelator(); + void print(); + void init(std::vector < TString > ivName, std::vector < TString > dvName); + void finish(); + void addEvent(double *Pvec, double *Yvec); + void exportAlphas(TString outPath, std::vector < TString > ivName, std::vector < TString > dvName); + void exportAlias(TString outPath, TString macroName, std::vector < TString > ivName, std::vector < TString > dvName); + + void SetDisableHistogramFlag(const bool &flag) { + fDisableHistos = flag; + } + +}; + +#endif diff --git a/Parity/include/VQwDataHandler.h b/Parity/include/VQwDataHandler.h new file mode 100644 index 000000000..9444b037f --- /dev/null +++ b/Parity/include/VQwDataHandler.h @@ -0,0 +1,88 @@ +/***************************************************************************** +File Name: VQwDataHandler.h + +Created by: Michael Vallee +Email: mv836315@ohio.edu + +Description: This is the header file to the VQwDataHandler class. This + class acts as a base class to all regression based classes. + +Last Modified: August 1, 2018 1:39 PM +*****************************************************************************/ + +#ifndef VQWDATAHANDLER_H_ +#define VQWDATAHANDLER_H_ + +// Qweak headers +//#include "QwHelicityPattern.h" +#include "QwSubsystemArrayParity.h" +#include "VQwHardwareChannel.h" + +class QwHelicityPattern; + +class VQwDataHandler { + + public: + + enum EQwRegType { + kRegTypeUnknown=0, kRegTypeMps, kRegTypeAsym, kRegTypeDiff + }; + + typedef std::vector< VQwHardwareChannel* >::iterator Iterator_HdwChan; + typedef std::vector< VQwHardwareChannel* >::const_iterator ConstIterator_HdwChan; + + void ProcessData(); + + virtual ~VQwDataHandler(); + + void AccumulateRunningSum(VQwDataHandler &value); + void CalculateRunningAverage(); + void PrintValue() const; + void FillDB(QwParityDB *db, TString datatype); + + // Fill the vector for this subsystem + void FillTreeVector(std::vector &values) const; + + void ConstructBranchAndVector(TTree *tree, TString& prefix, std::vector& values); + + void get_run_label(TString x) { + run_label = x; + } + + protected: + + VQwDataHandler() { } + + virtual void ProcessOptions(QwOptions &options) = 0; + + virtual Int_t LoadChannelMap(const std::string& mapfile) = 0; + Int_t ConnectChannels(QwSubsystemArrayParity& asym, QwSubsystemArrayParity& diff); + + std::pair ParseRegressionVariable(const std::string& variable); + + //Bool_t PublishInternalValue(const TString &name, const TString &desc, const VQwHardwareChannel *value) const; + //Bool_t PublishByRequest(TString device_name); + + //***************[Variables]*************** + + UInt_t fErrorFlag; + + TString run_label; + + std::string fCorrelatorMapFile; + + std::vector< EQwRegType > fDependentType; + std::vector< std::string > fDependentName; + + std::vector< const VQwHardwareChannel* > fDependentVar; + std::vector< Double_t > fDependentValues; + + std::vector< VQwHardwareChannel* > fOutputVar; + std::vector< Double_t > fOutputValues; + + std::string ParseSeparator; // Used as space between tokens in ParseRegressionVariable + +}; + + +#endif // VQWDATAHANDLER_H_ diff --git a/Parity/main/QwMockDataAnalysis.cc b/Parity/main/QwMockDataAnalysis.cc index 9164f6485..04eed7101 100755 --- a/Parity/main/QwMockDataAnalysis.cc +++ b/Parity/main/QwMockDataAnalysis.cc @@ -22,12 +22,13 @@ #include "QwBeamLine.h" #include "QwOptionsParity.h" #include "QwEventBuffer.h" +#ifdef __USE_DATABASE__ #include "QwParityDB.h" +#endif //__USE_DATABAE__ #include "QwHelicity.h" #include "QwHelicityPattern.h" #include "QwHistogramHelper.h" #include "QwMainCerenkovDetector.h" -#include "QwLumi.h" #include "QwSubsystemArrayParity.h" @@ -242,6 +243,7 @@ int main(int argc, char* argv[]) eventbuffer.CloseDataFile(); eventbuffer.ReportRunSummary(); +#ifdef __USE_DATABASE__ // Write to database if (bDatabase) { QwParityDB* qweak_database = new QwParityDB(); @@ -269,7 +271,7 @@ int main(int argc, char* argv[]) delete qweak_database; qweak_database = NULL; } // end of database write - +#endif //__USE_DATABASE__ } // end of loop over runs diff --git a/Parity/main/QwMockDataGenerator.cc b/Parity/main/QwMockDataGenerator.cc index 6df77c32f..d99b6d19b 100755 --- a/Parity/main/QwMockDataGenerator.cc +++ b/Parity/main/QwMockDataGenerator.cc @@ -20,10 +20,10 @@ #include "QwHelicity.h" #include "QwHelicityPattern.h" #include "QwMainCerenkovDetector.h" -#include "MollerMainDetector.h" -#include "QwLumi.h" +#include "QwBlindDetectorArray.h" //#include "QwScanner.h" #include "QwSubsystemArrayParity.h" +#include "QwDetectorArray.h" // Number of variables to correlate @@ -94,8 +94,8 @@ int main(int argc, char* argv[]) //----------------------------------------------------------------------------------------------- // Get the main detector channels we want to correlate - MollerMainDetector* maindetector = - dynamic_cast(detectors.GetSubsystemByName("Main Detector")); + QwBlindDetectorArray* maindetector = + dynamic_cast(detectors.GetSubsystemByName("Main Detector")); if (! maindetector) QwWarning << "No main detector subsystem defined!" << QwLog::endl; /* diff --git a/Parity/main/QwParity.cc b/Parity/main/QwParity.cc index 7deb039f1..e31f8dc3a 100755 --- a/Parity/main/QwParity.cc +++ b/Parity/main/QwParity.cc @@ -25,15 +25,19 @@ #include "QwRootFile.h" #include "QwOptionsParity.h" #include "QwEventBuffer.h" +#ifdef __USE_DATABASE__ #include "QwParityDB.h" +#endif //__USE_DATABASE__ #include "QwHistogramHelper.h" #include "QwSubsystemArrayParity.h" #include "QwHelicityPattern.h" #include "QwEventRing.h" #include "QwEPICSEvent.h" -#include "QwRegression.h" -#include "QwRegressionSubsystem.h" +#include "QwCombiner.h" +#include "QwCombinerSubsystem.h" #include "QwPromptSummary.h" +#include "QwCorrelator.h" +#include "LRBCorrector.h" // Qweak subsystems // (for correct dependency generation) @@ -41,7 +45,6 @@ #include "QwFakeHelicity.h" #include "QwBeamLine.h" #include "QwMainCerenkovDetector.h" -#include "QwLumi.h" #include "QwBeamMod.h" #include "QwIntegratedRaster.h" @@ -85,10 +88,10 @@ Int_t main(Int_t argc, Char_t* argv[]) /// Create the event buffer QwEventBuffer eventbuffer; eventbuffer.ProcessOptions(gQwOptions); - + #ifdef __USE_DATABASE__ /// Create the database connection QwParityDB database(gQwOptions); - + #endif //__USE_DATABASE__ // QwPromptSummary promptsummary; @@ -98,6 +101,7 @@ Int_t main(Int_t argc, Char_t* argv[]) /// Begin processing for the first run Int_t run_number = eventbuffer.GetRunNumber(); + TString run_label = eventbuffer.GetRunLabel(); /// Set the current event number for parameter file lookup QwParameterFile::SetCurrentRunNumber(run_number); @@ -117,16 +121,14 @@ Int_t main(Int_t argc, Char_t* argv[]) /// Create event-based linear regression subsystem // TString name = "MpsRegression"; - // QwRegressionSubsystem regress_sub(gQwOptions, detectors, name); + // QwCombinerSubsystem regress_sub(gQwOptions, detectors, name); // detectors.push_back(regress_sub.GetSharedPointerToStaticObject()); - /// Create the helicity pattern - QwHelicityPattern helicitypattern(detectors); + /// Create the helicity pattern + // Instead of having run_label in the constructor of helicitypattern, it might + // make since to have it be an option for use globally + QwHelicityPattern helicitypattern(detectors,run_label); helicitypattern.ProcessOptions(gQwOptions); - - /// Create the asymmetry-based linear regression - QwRegression regression(gQwOptions,helicitypattern); - QwRegression running_regression(regression); /// Create the event ring with the subsystem array QwEventRing eventring(gQwOptions,detectors); @@ -139,14 +141,14 @@ Int_t main(Int_t argc, Char_t* argv[]) // Initialize the database connection. + #ifdef __USE_DATABASE__ database.SetupOneRun(eventbuffer); + #endif // __USE_DATABASE__ // Open the ROOT file (close when scope ends) QwRootFile *treerootfile = NULL; QwRootFile *burstrootfile = NULL; QwRootFile *historootfile = NULL; - - TString run_label = eventbuffer.GetRunLabel(); if (gQwOptions.GetValue("single-output-file")) { @@ -168,20 +170,22 @@ Int_t main(Int_t argc, Char_t* argv[]) burstrootfile->WriteParamFileList("mapfiles", detectors); historootfile->WriteParamFileList("mapfiles", detectors); } - + #ifdef __USE_DATABASE__ if (database.AllowsWriteAccess()) { database.FillParameterFiles(detectors); } - + #endif // __USE_DATABASE__ // Construct histograms historootfile->ConstructHistograms("mps_histo", ringoutput); historootfile->ConstructHistograms("hel_histo", helicitypattern); detectors.ShareHistograms(ringoutput); + // Construct tree branches treerootfile->ConstructTreeBranches("Mps_Tree", "MPS event data tree", ringoutput); treerootfile->ConstructTreeBranches("Hel_Tree", "Helicity event data tree", helicitypattern); - treerootfile->ConstructTreeBranches("Hel_Tree_Reg", "Helicity event data tree (regressed)", regression); + treerootfile->ConstructTreeBranches("Hel_Tree_Reg", "Helicity event data tree (regressed)", helicitypattern.return_regression()); + treerootfile->ConstructTreeBranches("Hel_Tree_LRB", "Helicity event data tree (regressed)", helicitypattern.return_regress_from_LRB()); treerootfile->ConstructTreeBranches("Slow_Tree", "EPICS and slow control tree", epicsevent); burstrootfile->ConstructTreeBranches("Burst_Tree", "Burst level data tree", helicitypattern.GetBurstYield(),"yield_"); burstrootfile->ConstructTreeBranches("Burst_Tree", "Burst level data tree", helicitypattern.GetBurstAsymmetry(),"asym_"); @@ -200,19 +204,21 @@ Int_t main(Int_t argc, Char_t* argv[]) // Load the blinder seed from the database for this runlet. + #ifdef __USE_DATABASE__ helicitypattern.UpdateBlinder(&database); + #endif // __USE_DATABASE__ // Find the first EPICS event and try to initialize // the blinder. QwMessage << "Finding first EPICS event" << QwLog::endl; while (eventbuffer.GetNextEvent() == CODA_OK) { if (eventbuffer.IsEPICSEvent()) { - eventbuffer.FillEPICSData(epicsevent); - if (epicsevent.HasDataLoaded()) { - helicitypattern.UpdateBlinder(epicsevent); - // and break out of this event loop - break; - } + eventbuffer.FillEPICSData(epicsevent); + if (epicsevent.HasDataLoaded()) { + helicitypattern.UpdateBlinder(epicsevent); + // and break out of this event loop + break; + } } } epicsevent.ResetCounters(); @@ -232,13 +238,13 @@ Int_t main(Int_t argc, Char_t* argv[]) // Secondly, process EPICS events if (eventbuffer.IsEPICSEvent()) { eventbuffer.FillEPICSData(epicsevent); - if (epicsevent.HasDataLoaded()){ - epicsevent.CalculateRunningValues(); - helicitypattern.UpdateBlinder(epicsevent); + if (epicsevent.HasDataLoaded()){ + epicsevent.CalculateRunningValues(); + helicitypattern.UpdateBlinder(epicsevent); - treerootfile->FillTreeBranches(epicsevent); - treerootfile->FillTree("Slow_Tree"); - } + treerootfile->FillTreeBranches(epicsevent); + treerootfile->FillTree("Slow_Tree"); + } } @@ -246,7 +252,6 @@ Int_t main(Int_t argc, Char_t* argv[]) if (! eventbuffer.IsPhysicsEvent()) continue; - // Fill the subsystem objects with their respective data for this event. eventbuffer.FillSubsystemData(detectors); @@ -254,31 +259,30 @@ Int_t main(Int_t argc, Char_t* argv[]) detectors.ProcessEvent(); - // The event pass the event cut constraints if (detectors.ApplySingleEventCuts()) { - // // TEST - // regress_sub.LinearRegression(); + // // TEST + // regress_sub.LinearRegression(); // Add event to the ring eventring.push(detectors); // Check to see ring is ready if (eventring.IsReady()) { - ringoutput = eventring.pop(); - ringoutput.IncrementErrorCounters(); + ringoutput = eventring.pop(); + ringoutput.IncrementErrorCounters(); - // Accumulate the running sum to calculate the event based running average - runningsum.AccumulateRunningSum(ringoutput); + // Accumulate the running sum to calculate the event based running average + runningsum.AccumulateRunningSum(ringoutput); - // Fill the histograms - historootfile->FillHistograms(ringoutput); + // Fill the histograms + historootfile->FillHistograms(ringoutput); - // Fill mps tree branches - treerootfile->FillTreeBranches(ringoutput); - treerootfile->FillTree("Mps_Tree"); + // Fill mps tree branches + treerootfile->FillTreeBranches(ringoutput); + treerootfile->FillTree("Mps_Tree"); // Load the event into the helicity pattern helicitypattern.LoadEventData(ringoutput); @@ -316,12 +320,14 @@ Int_t main(Int_t argc, Char_t* argv[]) } // Linear regression on asymmetries - regression.LinearRegression(QwRegression::kRegTypeAsym); - running_regression.AccumulateRunningSum(regression); + helicitypattern.ProcessDataHandlerEntry(); // Fill regressed tree branches - treerootfile->FillTreeBranches(regression); - treerootfile->FillTree("Hel_Tree_Reg"); + + treerootfile->FillTreeBranches(helicitypattern.return_regression()); + treerootfile->FillTree("Hel_Tree_Reg"); + treerootfile->FillTreeBranches(helicitypattern.return_regress_from_LRB()); + treerootfile->FillTree("Hel_Tree_LRB"); // Clear the data helicitypattern.ClearEventData(); @@ -353,8 +359,7 @@ Int_t main(Int_t argc, Char_t* argv[]) } } - running_regression.CalculateRunningAverage(); - running_regression.PrintValue(); + helicitypattern.FinishDataHandler(); // This will calculate running averages over single helicity events runningsum.CalculateRunningAverage(); @@ -372,7 +377,7 @@ Int_t main(Int_t argc, Char_t* argv[]) * * * Then, we need to delete the histograms here. * * If we wait until the subsystem destructors, we get a * - * segfault; but in addition to that we should delete them * + * segfault; but in addition to that we should delete them * * here, in case we run over multiple runs at a time. */ if (treerootfile == historootfile) { treerootfile->Write(0,TObject::kOverwrite); @@ -400,6 +405,7 @@ Int_t main(Int_t argc, Char_t* argv[]) promptsummary.PrintCSV(); } // Read from the database + #ifdef __USE_DATABASE__ database.SetupOneRun(eventbuffer); // Each subsystem has its own Connect() and Disconnect() functions. @@ -407,10 +413,10 @@ Int_t main(Int_t argc, Char_t* argv[]) helicitypattern.FillDB(&database); helicitypattern.FillErrDB(&database); epicsevent.FillDB(&database); - running_regression.FillDB(&database,"asymmetry"); + helicitypattern.return_running_regression().FillDB(&database,"asymmetry"); ringoutput.FillDB_MPS(&database, "optics"); } - + #endif // __USE_DATABASE__ //epicsevent.WriteEPICSStringValues(); diff --git a/Parity/prminput/blueReg.conf b/Parity/prminput/blueReg.conf new file mode 100644 index 000000000..4d58eb0b6 --- /dev/null +++ b/Parity/prminput/blueReg.conf @@ -0,0 +1,251 @@ +# Configuration for linRegBlue ( must end with nonempty 'regvars/treetype' block ) +#inpPath /home/cdaq/qweak/QwScratch/rootfiles/QwPass1_ : on cdaql5 +inpPath /home/MRVallee/japan/isu_sample_ : pass3 production +customcut janCut1 yield_bcm_target.hw_sum>40 +minEvents 1000 +# +#.... place aliases before use as IVs or DVs +#alias bpmDD9_9b=asym_qwk_bpm3h09_EffectiveCharge-asym_qwk_bpm3h09b_EffectiveCharge +#alias asym_DD_MDeven_odd=asym_qwk_mdevenbars-asym_qwk_mdoddbars +#alias asym_DD_MD15_37=asym_qwk_md1_qwk_md5-asym_qwk_md3_qwk_md7 +#alias asym_DD_MD26_48=asym_qwk_md2_qwk_md6-asym_qwk_md4_qwk_md8 +#alias diff_bpm_9b_p_4X=diff_qwk_bpm3h09bX+diff_qwk_bpm3h04X +#alias diff_bpm_9b_m_4X=diff_qwk_bpm3h09bX-diff_qwk_bpm3h04X +#alias diff_bpm_9b_p_4Y=diff_qwk_bpm3h09bY+diff_qwk_bpm3h04Y +#alias diff_bpm_9b_m_4Y=diff_qwk_bpm3h09bY-diff_qwk_bpm3h04Y +# +# Dependent and Independent variables for Regression (arbitrary order) +regvars blahblah +dv asym_s1_r1_tr1 +dv asym_s1_r1_open +dv asym_s1_r1_tr2 +dv asym_s1_r1_closed +dv asym_s1_r2_tr1 +dv asym_s1_r2_open +dv asym_s1_r2_tr2 +dv asym_s1_r2_closed +dv asym_s1_r3_tr1 +dv asym_s1_r3_open +dv asym_s1_r3_tr2 +dv asym_s1_r3_closed +dv asym_s1_r4_tr1 +dv asym_s1_r4_open +dv asym_s1_r4_tr2 +dv asym_s1_r4_closed +dv asym_s1_r5a_tr1 +dv asym_s1_r5a_open +dv asym_s1_r5a_tr2 +dv asym_s1_r5a_closed +dv asym_s1_r5b_tr1 +dv asym_s1_r5b_open +dv asym_s1_r5b_tr2 +dv asym_s1_r5b_closed +dv asym_s1_r5c_tr1 +dv asym_s1_r5c_open +dv asym_s1_r5c_tr2 +dv asym_s1_r5c_closed +dv asym_s1_r6_tr1 +dv asym_s1_r6_open +dv asym_s1_r6_tr2 +dv asym_s1_r6_closed +dv asym_s2_r1_tr1 +dv asym_s2_r1_open +dv asym_s2_r1_tr2 +dv asym_s2_r1_closed +dv asym_s2_r2_tr1 +dv asym_s2_r2_open +dv asym_s2_r2_tr2 +dv asym_s2_r2_closed +dv asym_s2_r3_tr1 +dv asym_s2_r3_open +dv asym_s2_r3_tr2 +dv asym_s2_r3_closed +dv asym_s2_r4_tr1 +dv asym_s2_r4_open +dv asym_s2_r4_tr2 +dv asym_s2_r4_closed +dv asym_s2_r5a_tr1 +dv asym_s2_r5a_open +dv asym_s2_r5a_tr2 +dv asym_s2_r5a_closed +dv asym_s2_r5b_tr1 +dv asym_s2_r5b_open +dv asym_s2_r5b_tr2 +dv asym_s2_r5b_closed +dv asym_s2_r5c_tr1 +dv asym_s2_r5c_open +dv asym_s2_r5c_tr2 +dv asym_s2_r5c_closed +dv asym_s2_r6_tr1 +dv asym_s2_r6_open +dv asym_s2_r6_tr2 +dv asym_s2_r6_closed +dv asym_s3_r1_tr1 +dv asym_s3_r1_open +dv asym_s3_r1_tr2 +dv asym_s3_r1_closed +dv asym_s3_r2_tr1 +dv asym_s3_r2_open +dv asym_s3_r2_tr2 +dv asym_s3_r2_closed +dv asym_s3_r3_tr1 +dv asym_s3_r3_open +dv asym_s3_r3_tr2 +dv asym_s3_r3_closed +dv asym_s3_r4_tr1 +dv asym_s3_r4_open +dv asym_s3_r4_tr2 +dv asym_s3_r4_closed +dv asym_s3_r5a_tr1 +dv asym_s3_r5a_open +dv asym_s3_r5a_tr2 +dv asym_s3_r5a_closed +dv asym_s3_r5b_tr1 +dv asym_s3_r5b_open +dv asym_s3_r5b_tr2 +dv asym_s3_r5b_closed +dv asym_s3_r5c_tr1 +dv asym_s3_r5c_open +dv asym_s3_r5c_tr2 +dv asym_s3_r5c_closed +dv asym_s3_r6_tr1 +dv asym_s3_r6_open +dv asym_s3_r6_tr2 +dv asym_s3_r6_closed +dv asym_s4_r1_tr1 +dv asym_s4_r1_open +dv asym_s4_r1_tr2 +dv asym_s4_r1_closed +dv asym_s4_r2_tr1 +dv asym_s4_r2_open +dv asym_s4_r2_tr2 +dv asym_s4_r2_closed +dv asym_s4_r3_tr1 +dv asym_s4_r3_open +dv asym_s4_r3_tr2 +dv asym_s4_r3_closed +dv asym_s4_r4_tr1 +dv asym_s4_r4_open +dv asym_s4_r4_tr2 +dv asym_s4_r4_closed +dv asym_s4_r5a_tr1 +dv asym_s4_r5a_open +dv asym_s4_r5a_tr2 +dv asym_s4_r5a_closed +dv asym_s4_r5b_tr1 +dv asym_s4_r5b_open +dv asym_s4_r5b_tr2 +dv asym_s4_r5b_closed +dv asym_s4_r5c_tr1 +dv asym_s4_r5c_open +dv asym_s4_r5c_tr2 +dv asym_s4_r5c_closed +dv asym_s4_r6_tr1 +dv asym_s4_r6_open +dv asym_s4_r6_tr2 +dv asym_s4_r6_closed +dv asym_s5_r1_tr1 +dv asym_s5_r1_open +dv asym_s5_r1_tr2 +dv asym_s5_r1_closed +dv asym_s5_r2_tr1 +dv asym_s5_r2_open +dv asym_s5_r2_tr2 +dv asym_s5_r2_closed +dv asym_s5_r3_tr1 +dv asym_s5_r3_open +dv asym_s5_r3_tr2 +dv asym_s5_r3_closed +dv asym_s5_r4_tr1 +dv asym_s5_r4_open +dv asym_s5_r4_tr2 +dv asym_s5_r4_closed +dv asym_s5_r5a_tr1 +dv asym_s5_r5a_open +dv asym_s5_r5a_tr2 +dv asym_s5_r5a_closed +dv asym_s5_r5b_tr1 +dv asym_s5_r5b_open +dv asym_s5_r5b_tr2 +dv asym_s5_r5b_closed +dv asym_s5_r5c_tr1 +dv asym_s5_r5c_open +dv asym_s5_r5c_tr2 +dv asym_s5_r5c_closed +dv asym_s5_r6_tr1 +dv asym_s5_r6_open +dv asym_s5_r6_tr2 +dv asym_s5_r6_closed +dv asym_s6_r1_tr1 +dv asym_s6_r1_open +dv asym_s6_r1_tr2 +dv asym_s6_r1_closed +dv asym_s6_r2_tr1 +dv asym_s6_r2_open +dv asym_s6_r2_tr2 +dv asym_s6_r2_closed +dv asym_s6_r3_tr1 +dv asym_s6_r3_open +dv asym_s6_r3_tr2 +dv asym_s6_r3_closed +dv asym_s6_r4_tr1 +dv asym_s6_r4_open +dv asym_s6_r4_tr2 +dv asym_s6_r4_closed +dv asym_s6_r5a_tr1 +dv asym_s6_r5a_open +dv asym_s6_r5a_tr2 +dv asym_s6_r5a_closed +dv asym_s6_r5b_tr1 +dv asym_s6_r5b_open +dv asym_s6_r5b_tr2 +dv asym_s6_r5b_closed +dv asym_s6_r5c_tr1 +dv asym_s6_r5c_open +dv asym_s6_r5c_tr2 +dv asym_s6_r5c_closed +dv asym_s6_r6_tr1 +dv asym_s6_r6_open +dv asym_s6_r6_tr2 +dv asym_s6_r6_closed +dv asym_s7_r1_tr1 +dv asym_s7_r1_open +dv asym_s7_r1_tr2 +dv asym_s7_r1_closed +dv asym_s7_r2_tr1 +dv asym_s7_r2_open +dv asym_s7_r2_tr2 +dv asym_s7_r2_closed +dv asym_s7_r3_tr1 +dv asym_s7_r3_open +dv asym_s7_r3_tr2 +dv asym_s7_r3_closed +dv asym_s7_r4_tr1 +dv asym_s7_r4_open +dv asym_s7_r4_tr2 +dv asym_s7_r4_closed +dv asym_s7_r5a_tr1 +dv asym_s7_r5a_open +dv asym_s7_r5a_tr2 +dv asym_s7_r5a_closed +dv asym_s7_r5b_tr1 +dv asym_s7_r5b_open +dv asym_s7_r5b_tr2 +dv asym_s7_r5b_closed +dv asym_s7_r5c_tr1 +dv asym_s7_r5c_open +dv asym_s7_r5c_tr2 +dv asym_s7_r5c_closed +dv asym_s7_r6_tr1 +dv asym_s7_r6_open +dv asym_s7_r6_tr2 +dv asym_s7_r6_closed + +#----- IVs ----- +iv diff_bpm_targetX +iv diff_bpm_targetY +iv diff_bpm_targetXSlope +iv diff_bpm_targetYSlope +iv diff_target_energy + +treetype Hel_Tree diff --git a/Parity/prminput/mock_detectors.map b/Parity/prminput/mock_detectors.map index be4f32001..bde1d5fd3 100755 --- a/Parity/prminput/mock_detectors.map +++ b/Parity/prminput/mock_detectors.map @@ -13,7 +13,7 @@ geom = mock_beamline_geometry.map -[MollerMainDetector] +[QwDetectorArray] name = Main Detector map = mock_moller_maindet_adc.map param = mock_moller_maindet_pedestal.map diff --git a/Parity/prminput/qwparity_simple.conf b/Parity/prminput/qwparity_simple.conf index a25de3eba..7cd0734fc 100755 --- a/Parity/prminput/qwparity_simple.conf +++ b/Parity/prminput/qwparity_simple.conf @@ -20,7 +20,7 @@ ring.size = 1 ring.stability_cut = 0 QwMainCerenkovDetector.normalize = no -QwLumi.normalize = no +QwLumi.normalize = yes write-promptsummary = no blinder.force-target-out = true diff --git a/Parity/prminput/regression_new.map b/Parity/prminput/regression_new.map new file mode 100644 index 000000000..049af3727 --- /dev/null +++ b/Parity/prminput/regression_new.map @@ -0,0 +1,64 @@ +# Rules for this file +# - no repeating dependent variables in the same section +# (probably also not in different sections, come to think of it) +# +# - Alias names start with "@" after the "asym" or "diff" prefix. +# They should also be all lower case. +# + +# Double differences +[asym:@bpmdd_charge_targetcharge] +asym:bpm_target_EffectiveCharge, 1 +asym:bcm_target, -1 + + + + +##### +##### Some examples, all commented out. +##### + +## This is a simple case: +## two dependent variables +## two independent variables +#[asym:qwk_md1neg, asym:qwk_md1pos] +#diff:x_targ, 0.0, -0.0 +#diff:y_targ, 0.0, -0.0 +# +## four independent variables +## asymmetry for dependent variables +#[asym:qwk_md2neg, asym:qwk_md2pos] +#diff:x_targ, 0.11, -0.11 +#diff:y_targ, 0.12, -0.12 +#diff:xp_targ, 0.10, -0.10 +#diff:yp_targ, 0.09, -0.09 +# +## four dependent variables +#[asym:qwk_md3neg, asym:qwk_md3pos, asym:qwk_md4neg, asym:qwk_md4pos] +#diff:x_targ, 0.11, -0.11, 0.11, -0.11 +#diff:y_targ, 0.12, -0.12, 0.12, -0.12 +#diff:xp_targ, 0.10, -0.10, 0.10, -0.10 +#diff:yp_targ, 0.09, -0.09, 0.09, -0.09 +# +## eight dependent variables +#[asym:qwk_md5neg, asym:qwk_md5pos, asym:qwk_md6neg, asym:qwk_md6pos, asym:qwk_md7neg, asym:qwk_md7pos, asym:qwk_md8neg, asym:qwk_md8pos] +#diff:x_targ, 0.11, -0.11, 0.11, -0.11, 0.11, -0.11, 0.11, -0.11 +#diff:y_targ, 0.12, -0.12, 0.12, -0.12, 0.12, -0.12, 0.12, -0.12 +#diff:xp_targ, 0.10, -0.10, 0.10, -0.10, 0.10, -0.10, 0.10, -0.10 +#diff:yp_targ, 0.09, -0.09, 0.09, -0.09, 0.09, -0.09, 0.09, -0.09 +# +## This is an event case: +## two dependent variables +## two independent variables +## +## Currently disabled because of how we write ROOT trees +## +#[mps:qwk_md1neg, mps:qwk_md1pos] +#mps:x_targ, 1.11, -5.11 +#mps:y_targ, 1.12, -1.12 +# +#[mps:qwk_md2neg, mps:qwk_md2pos] +#mps:x_targ, 0.11, -0.11 +#mps:y_targ, 0.12, -0.12 +#mps:xp_targ, 0.10, -0.10 +#mps:yp_targ, 0.09, -0.09 diff --git a/Parity/src/LRBCorrector.cc b/Parity/src/LRBCorrector.cc new file mode 100644 index 000000000..fb4779af9 --- /dev/null +++ b/Parity/src/LRBCorrector.cc @@ -0,0 +1,238 @@ +/******************************************************************** +File Name: LRBCorrector.cc + +Created by: Michael Vallee +Email: mv836315@ohio.edu + +Description: This is the implementaion file of the LRBCorrector + class, which is a child of the VQwDataHandler class. + The functionality of this class is derived from + LinRegBlue. + +Last Modified: August 1, 2018 1:41 PM +********************************************************************/ + +#include +using namespace std; + +#include "QwHelicityPattern.h" + +#include "LRBCorrector.h" + +// Qweak headers +#include "VQwDataElement.h" +#include "QwVQWK_Channel.h" +#include "QwParameterFile.h" +#define MYSQLPP_SSQLS_NO_STATICS +#ifdef __USE_DATABASE__ +#include "QwParitySSQLS.h" +#include "QwParityDB.h" +#endif // __USE_DATABASE__ + +#include +#include +#include + +#include +#include +#include + +#include + + +LRBCorrector::LRBCorrector(QwOptions &options, QwHelicityPattern& helicitypattern, const TString &run) { + + run_label = run; + ParseSeparator = "_"; + fEnableCorrection = false; + ProcessOptions(options); + LoadChannelMap(fRegressionMapFile); + fHelicityPattern = &helicitypattern; + QwSubsystemArrayParity& asym = helicitypattern.fAsymmetry; + QwSubsystemArrayParity& diff = helicitypattern.fDifference; + ConnectChannels(asym,diff); + +} + +/** + * Defines configuration options using QwOptions functionality. + * @param options Options object + */ +void LRBCorrector::DefineOptions(QwOptions &options) +{ + options.AddOptions("LRBCorrector") + ("enable-lrbcorrection", po::value()->zero_tokens()->default_value(false), + "enable lrb correction"); + options.AddOptions("LRBCorrector") + ("lrbregression-map", po::value()->default_value("regression_new.map"), + "variables and sensitivities for lrb correction"); +} + +/** + * Process configuration options using QwOptions functionality. + * @param options Options object + */ +void LRBCorrector::ProcessOptions(QwOptions &options) +{ + fEnableCorrection = options.GetValue("enable-lrbcorrection"); + fRegressionMapFile = options.GetValue("lrbregression-map"); + outPath = options.GetValue("slope-file-path"); +} + + +Int_t LRBCorrector::LoadChannelMap(const std::string& mapfile) { + + if (fEnableCorrection == false) { + QwWarning << "enable-lrbcorrection is set to false. Skipping LoadChannelMap for LRBCorrector" << QwLog::endl; + return 0; + } + + string TmpFilePath = run_label.Data(); + fRegressionMapFile = "blueR" + TmpFilePath + "new.slope.root"; + string MapFilePath = outPath + "/"; + string tmp = MapFilePath + fRegressionMapFile; + TString corFileName(tmp.c_str()); + QwMessage << "Trying to open " << corFileName << QwLog::endl; + TFile* corFile=new TFile(corFileName); + if( !corFile->IsOpen()) { + printf("Failed to open %s, slopes NOT found\n",corFile->GetName()); + return 0; + } + + TMatrixD *alphasM=0; + alphasM=(TMatrixD *) corFile->Get("slopes"); + assert(alphasM); + + TH1 *dvnames = (TH1 *) corFile->Get("DVname"); + assert(dvnames); + TH1 *ivnames = (TH1 *) corFile->Get("IVname"); + assert(ivnames); + + pair type_name_dv; + pair type_name_iv; + + // Loop through ivnames to get IV type and name + // Loop over # of dep variables + // Push-back the sensitiivity, IV type and IVnames into their respective vectors for each DV + + for (size_t i = 0; i < dvnames->GetXaxis()->GetNbins(); ++i){ + type_name_dv = ParseRegressionVariable(dvnames->GetXaxis()->GetBinLabel(i+1)); + fDependentType.push_back(type_name_dv.first); + fDependentName.push_back(type_name_dv.second); + } + + fSensitivity.resize(fDependentType.size()); + + for (size_t i = 0; i < ivnames->GetXaxis()->GetNbins(); ++i) { + type_name_iv = ParseRegressionVariable(ivnames->GetXaxis()->GetBinLabel(i+1)); + fIndependentType.push_back(type_name_iv.first); + fIndependentName.push_back(type_name_iv.second); + for (size_t j = 0; j < dvnames->GetXaxis()->GetNbins(); ++j) { + fSensitivity[j].push_back(-1.0*(*alphasM)(i,j)); + } + } + + //printf("opened %s, slopes found, dump:\n",corFile->GetName()); + //alphasM->Print(); + corFile->Close(); + +} + + +Int_t LRBCorrector::ConnectChannels( + QwSubsystemArrayParity& asym, + QwSubsystemArrayParity& diff) +{ + VQwDataHandler::ConnectChannels(asym, diff); + + if (fEnableCorrection == false) {return 0;} + + // Add independent variables + for (size_t iv = 0; iv < fIndependentName.size(); iv++) { + // Get the independent variables + const VQwHardwareChannel* iv_ptr = 0; + //QwMessage << "fInpedententType[" << iv << "] = " << fIndependentType.at(iv) + // << "; fInpedententName[" << iv << "] = " << fIndependentName.at(iv) + // << QwLog::endl; + switch (fIndependentType.at(iv)) { + case kRegTypeAsym: + iv_ptr = asym.ReturnInternalValue(fIndependentName.at(iv)); + break; + case kRegTypeDiff: + iv_ptr = diff.ReturnInternalValue(fIndependentName.at(iv)); + break; + default: + QwWarning << "Independent variable for regression has unknown type." + << QwLog::endl; + break; + } + if (iv_ptr) { + //QwMessage << " iv: " << fIndependentName.at(iv) /*<< " (sens = " << fSensitivity.at(dv).at(iv) << ")"*/ << QwLog::endl; + fIndependentVar.push_back(iv_ptr); + } else { + QwWarning << "Independent variable " << fIndependentName.at(iv) << " could not be found." + << QwLog::endl; + } + } + + QwMessage << "In LRBCorrector::ConnectChannels; Number of IVs: " << fIndependentVar.size() + << " Number of DVs: " << fDependentVar.size() << QwLog::endl; + +} + +void LRBCorrector::CalcOneOutput(const VQwHardwareChannel* dv, VQwHardwareChannel* output, + vector< const VQwHardwareChannel* > &ivs, + vector< Double_t > &sens) { + + // if second is NULL, can't do regression + if (output == NULL){ + QwError<<"Second is value is NULL, unable to calculate regression."<ClearEventData(); + }else{ + // Update second value + output->AssignValueFrom(dv); + } + + // Add corrections + for (size_t iv = 0; iv < ivs.size(); iv++) { + output->ScaledAdd(sens.at(iv), ivs.at(iv)); + } + +} + + +void LRBCorrector::ProcessData() { + + for (size_t i = 0; i < fDependentVar.size(); ++i) { + CalcOneOutput(fDependentVar[i], fOutputVar[i], fIndependentVar, fSensitivity[i]); + } + +} + + +void LRBCorrector::LinearRegression(EQwRegType type) +{ + // Return if regression is not enabled + if (! fEnableCorrection){ + QwDebug << "Regression is not enabled!" << QwLog::endl; + return; + } + // Get error flag from QwHelicityPattern + if (fHelicityPattern != NULL){ + fErrorFlag = fHelicityPattern->GetEventcutErrorFlag(); + } else if (fSubsystemArray != NULL){ + fErrorFlag = fSubsystemArray->GetEventcutErrorFlag(); + } else { + QwError << "LRBCorrector::LinearRegression: Can't set fErrorFlag" << QwLog::endl; + fErrorFlag = 0; + } + + ProcessData(); +} diff --git a/Parity/src/LinReg_Bevington_Pebay.cc b/Parity/src/LinReg_Bevington_Pebay.cc new file mode 100644 index 000000000..47b52fab2 --- /dev/null +++ b/Parity/src/LinReg_Bevington_Pebay.cc @@ -0,0 +1,359 @@ +/********************************************************************* + * $Id: $ + * \author Jan Balewski, MIT, 2010 + ********************************************************************* + * Descripion: + * Utility class accumulating variances and computing alphas based on : + * "Data reduction and error analysis for the physical sciences" / Philip R. Bevington, D. Keith Robinson. Bevington, Philip R., 1933- Boston : McGraw-Hill, c2003. + * "Formulas for Robust, One-Pass Parallel Computation of Covariances and Arbitrary-Order Statistical Moments" Philippe Peba, SANDIA REPORT SAND2008-6212, Unlimited Release, Printed September 2008 + *********************************************************************/ + +#include +#include +#include +using namespace std; + +#include "LinReg_Bevington_Pebay.h" + +//================================================= +//================================================= +LinRegBevPeb::LinRegBevPeb() { + +} + +//================================================= +//================================================= +void LinRegBevPeb::init(){ + printf("Init LinReg dims: nP=%d nY=%d\n",par_nP,par_nY); + mMY.ResizeTo(par_nY,1); + mMP.ResizeTo(par_nP,1); + mVPP.ResizeTo(par_nP,par_nP); + mVPY.ResizeTo(par_nP,par_nY); + mVY2.ResizeTo(par_nY,1); + mA.ResizeTo(par_nP,par_nY); + mAsig.ResizeTo(mA); + mRjk.ResizeTo(mVPP); + + fGoodEventNumber=0; + +} + +//================================================= +//================================================= +void LinRegBevPeb::print(){ + printf("LinReg dims: nP=%d nY=%d\n",par_nP,par_nY); + + cout<<"MP:"; mMP.Print(); cout<<"MY: ="; mMY.Print(); + cout<<"VPP:";mVPP.Print(); cout<<"VPY:";mVPY.Print(); cout<<"VY2:=";mVY2.Print(); +} + + +//========================================================== +//========================================================== +void LinRegBevPeb::accumulate(double *P, double *Y){ + + fGoodEventNumber++; + +#if 0 + printf("LinRegBevPeb::accumulate eve=%.0f\n",fGoodEventNumber); + for (int i = 0; i = par_nP ) return -1; + if( fGoodEventNumber<1) return -3; + mean=mMP(i,0); return 0; +} + + +//========================================================== +//========================================================== +Int_t LinRegBevPeb::getMeanY(const int i, Double_t &mean ){ + mean=-1e50; + if(i<0 || i >= par_nY ) return -1; + if( fGoodEventNumber<1) return -3; + mean=mMY(i,0); return 0; +} + + +//========================================================== +//========================================================== +Int_t LinRegBevPeb::getSigmaP(const int i, Double_t &sigma ){ + sigma=-1e50; + if(i<0 || i >= par_nP ) return -1; + if( fGoodEventNumber<2) return -3; + sigma=sqrt(mVPP(i,i)/(fGoodEventNumber-1.)); + return 0; +} + + +//========================================================== +//========================================================== +Int_t LinRegBevPeb::getSigmaY(const int i, Double_t &sigma ){ + sigma=-1e50; + if(i<0 || i >= par_nY ) return -1; + if( fGoodEventNumber<2) return -3; + sigma=sqrt(mVY2(i,0)/(fGoodEventNumber-1.)); + return 0; +} + +//========================================================== +//========================================================== +Int_t LinRegBevPeb::getCovarianceP( int i, int j, Double_t &covar ){ + covar=-1e50; + if( i>j) { int k=i; i=j; j=k; }//swap i & j + //... now we need only upper right triangle + if(i<0 || i >= par_nP ) return -11; + if( fGoodEventNumber<2) return -14; + covar=mVPP(i,j)/(fGoodEventNumber-1.); + return 0; +} + +//========================================================== +//========================================================== +Int_t LinRegBevPeb::getCovariancePY( int ip, int iy, Double_t &covar ){ + covar=-1e50; + //... now we need only upper right triangle + if(ip<0 || ip >= par_nP ) return -11; + if(iy<0 || iy >= par_nY ) return -12; + if( fGoodEventNumber<2) return -14; + covar=mVPY(ip,iy)/(fGoodEventNumber-1.); + return 0; +} + + + +//========================================================== +//========================================================== +void LinRegBevPeb::printSummaryP(){ + cout << Form("\nLinRegBevPeb::printSummaryP seen good eve=%lld",fGoodEventNumber)<2) { // print full matrix + cout << Form("\nname: "); + for (size_t i = 1; i 0.) nSig=meanI/err; + + cout << Form("P%d: %+12.4g %12.3g %.1f ",(int)i,meanI,sigI,nSig); + for (size_t j = 1; j 3.) x='*'; + cout << Form(" slope_%d = %11.3g +/-%11.3g (nSig=%.2f) %c\n",j,val, err,nSig,x); + } + } +} + + +//========================================================== +//========================================================== +void LinRegBevPeb::printSummaryYP(){ + cout << Form("\nLinRegBevPeb::printSummaryYP seen good eve=%lld",fGoodEventNumber)<2) { cout<<" too fiew events, skip"< elements; elements.clear(); @@ -1155,7 +1152,6 @@ void QwBeamLine::EncodeEventData(std::vector &buffer) buffer.insert(buffer.end(), subbankheader.begin(), subbankheader.end()); buffer.insert(buffer.end(), elements.begin(), elements.end()); } - } //*****************************************************************// @@ -1555,7 +1551,6 @@ void QwBeamLine::ProcessEvent() { // Make sure this one comes first! The clocks are needed by // other elements. - for(size_t i=0;iProcessEvent(); @@ -2718,8 +2713,8 @@ void QwBeamLine::CopyTemplatedDataElements(const VQwSubsystem *source) } } -#ifdef __USE_DATABASE__ //*****************************************************************// +#ifdef __USE_DATABASE__ void QwBeamLine::FillDB(QwParityDB *db, TString datatype) { @@ -3111,7 +3106,7 @@ void QwBeamLine::FillErrDB(QwParityDB *db, TString datatype) db->Disconnect(); return; } -#endif +#endif // __USE_DATABASE__ void QwBeamLine::WritePromptSummary(QwPromptSummary *ps, TString type) { diff --git a/Parity/src/QwBeamMod.cc b/Parity/src/QwBeamMod.cc index a742f27f1..f73e68077 100755 --- a/Parity/src/QwBeamMod.cc +++ b/Parity/src/QwBeamMod.cc @@ -16,8 +16,10 @@ #include "QwParameterFile.h" #include "QwHistogramHelper.h" #define MYSQLPP_SSQLS_NO_STATICS +#ifdef __USE_DATABASE__ #include "QwParitySSQLS.h" #include "QwParityDB.h" +#endif // __USE_DATABASE__ // Root plotting headers #include "TCanvas.h" @@ -992,6 +994,7 @@ void QwModChannelID::Print() } //***************************************************************** +#ifdef __USE_DATABASE__ void QwBeamMod::FillDB_MPS(QwParityDB *db, TString datatype) { Bool_t local_print_flag = false; @@ -1059,7 +1062,7 @@ void QwBeamMod::FillErrDB(QwParityDB *db, TString datatype) { return; } - +#endif // __USE_DATABASE__ void QwBeamMod::WritePromptSummary(QwPromptSummary *ps, TString datatype) { diff --git a/Parity/src/QwBlindDetectorArray.cc b/Parity/src/QwBlindDetectorArray.cc new file mode 100644 index 000000000..3fcaafaa4 --- /dev/null +++ b/Parity/src/QwBlindDetectorArray.cc @@ -0,0 +1,1624 @@ +/**********************************************************\ +* File: QwBlindDetectorArray.cc * +* * +* Author: P. M. King * +* Time-stamp: <2007-05-08 15:40> * +\**********************************************************/ + +#include "QwBlindDetectorArray.h" + +// System headers +#include + +// Qweak headers +#include "QwSubsystemArray.h" +#include "QwLog.h" +#ifdef __USE_DATABASE__ +#define MYSQLPP_SSQLS_NO_STATICS +#include "QwParitySSQLS.h" +#include "QwParityDB.h" +#endif +#include "QwPromptSummary.h" + +// Register this subsystem with the factory +RegisterSubsystemFactory(QwBlindDetectorArray); + +/** + * Defines configuration options for QwEventBuffer class using QwOptions + * functionality. + * + * @param options Options object + */ +void QwBlindDetectorArray::DefineOptions(QwOptions &options){ + // Define the execution options + options.AddOptions() + ("QwBlindDetectorArray.normalize", + po::value()->default_bool_value(true), + "Normalize the detectors by beam current"); +} + + +/*! + * Loads the configuration options into this instance of + * QwBlindDetectorArray from the QwOptions object. + * + * @param options Options object + */ +void QwBlindDetectorArray::ProcessOptions(QwOptions &options){ + bNormalization = options.GetValue("QwBlindDetectorArray.normalize"); + if (! bNormalization){ + QwWarning << "QwBlindDetectorArray::ProcessOptions: " + << "Detector yields WILL NOT be normalized." + << QwLog::endl; + } +} + + +//*****************************************************************// +/** + * Publish internal values + * @return + */ +Bool_t QwBlindDetectorArray::PublishInternalValues() const +{ + // Publish variables + Bool_t status = kTRUE; +/* + status = status && PublishInternalValue("qwk_md1neg", "qwk_md1neg", GetIntegrationPMT("qwk_md1neg")->GetChannel("qwk_md1neg")); + status = status && PublishInternalValue("qwk_md1pos", "qwk_md1pos", GetIntegrationPMT("qwk_md1pos")->GetChannel("qwk_md1pos")); + status = status && PublishInternalValue("qwk_md2neg", "qwk_md2neg", GetIntegrationPMT("qwk_md2neg")->GetChannel("qwk_md2neg")); + status = status && PublishInternalValue("qwk_md2pos", "qwk_md2pos", GetIntegrationPMT("qwk_md2pos")->GetChannel("qwk_md2pos")); + status = status && PublishInternalValue("qwk_md3neg", "qwk_md3neg", GetIntegrationPMT("qwk_md3neg")->GetChannel("qwk_md3neg")); + status = status && PublishInternalValue("qwk_md3pos", "qwk_md3pos", GetIntegrationPMT("qwk_md3pos")->GetChannel("qwk_md3pos")); + status = status && PublishInternalValue("qwk_md4neg", "qwk_md4neg", GetIntegrationPMT("qwk_md4neg")->GetChannel("qwk_md4neg")); + status = status && PublishInternalValue("qwk_md4pos", "qwk_md4pos", GetIntegrationPMT("qwk_md4pos")->GetChannel("qwk_md4pos")); + status = status && PublishInternalValue("qwk_md5neg", "qwk_md5neg", GetIntegrationPMT("qwk_md5neg")->GetChannel("qwk_md5neg")); + status = status && PublishInternalValue("qwk_md5pos", "qwk_md5pos", GetIntegrationPMT("qwk_md5pos")->GetChannel("qwk_md5pos")); + status = status && PublishInternalValue("qwk_md6neg", "qwk_md6neg", GetIntegrationPMT("qwk_md6neg")->GetChannel("qwk_md6neg")); + status = status && PublishInternalValue("qwk_md6pos", "qwk_md6pos", GetIntegrationPMT("qwk_md6pos")->GetChannel("qwk_md6pos")); + status = status && PublishInternalValue("qwk_md7neg", "qwk_md7neg", GetIntegrationPMT("qwk_md7neg")->GetChannel("qwk_md7neg")); + status = status && PublishInternalValue("qwk_md7pos", "qwk_md7pos", GetIntegrationPMT("qwk_md7pos")->GetChannel("qwk_md7pos")); + status = status && PublishInternalValue("qwk_md8neg", "qwk_md8neg", GetIntegrationPMT("qwk_md8neg")->GetChannel("qwk_md8neg")); + status = status && PublishInternalValue("qwk_md8pos", "qwk_md8pos", GetIntegrationPMT("qwk_md8pos")->GetChannel("qwk_md8pos")); + status = status && PublishInternalValue("qwk_md9neg", "qwk_md9neg", GetIntegrationPMT("qwk_md9neg")->GetChannel("qwk_md9neg")); + status = status && PublishInternalValue("qwk_md9pos", "qwk_md9pos", GetIntegrationPMT("qwk_md9pos")->GetChannel("qwk_md9pos")); +*/ + +/* + status = status && PublishInternalValue("qwk_md1barsum","qwk_md1barsum", GetCombinedPMT("qwk_md1barsum")->GetChannel("qwk_md1barsum")); + status = status && PublishInternalValue("qwk_md2barsum","qwk_md2barsum", GetCombinedPMT("qwk_md2barsum")->GetChannel("qwk_md2barsum")); + status = status && PublishInternalValue("qwk_md3barsum","qwk_md3barsum", GetCombinedPMT("qwk_md3barsum")->GetChannel("qwk_md3barsum")); + status = status && PublishInternalValue("qwk_md4barsum","qwk_md4barsum", GetCombinedPMT("qwk_md4barsum")->GetChannel("qwk_md4barsum")); + status = status && PublishInternalValue("qwk_md5barsum","qwk_md5barsum", GetCombinedPMT("qwk_md5barsum")->GetChannel("qwk_md5barsum")); + status = status && PublishInternalValue("qwk_md6barsum","qwk_md6barsum", GetCombinedPMT("qwk_md6barsum")->GetChannel("qwk_md6barsum")); + status = status && PublishInternalValue("qwk_md7barsum","qwk_md7barsum", GetCombinedPMT("qwk_md7barsum")->GetChannel("qwk_md7barsum")); + status = status && PublishInternalValue("qwk_md8barsum","qwk_md8barsum", GetCombinedPMT("qwk_md8barsum")->GetChannel("qwk_md8barsum")); + + status = status && PublishInternalValue("qwk_mdallbars","qwk_mdallbars", GetCombinedPMT("qwk_mdallbars")->GetChannel("qwk_mdallbars")); +*/ + + //return status; + + + // TODO: + // The variables should be published based on the parameter file. + // See QwBeamLine class for an implementation. + + // Publish variables through map file + // This should work with bcm, bpmstripline, bpmcavity, combo bpm and combo bcm + for (size_t pp = 0; pp < fPublishList.size(); pp++) { + TString publish_name = fPublishList.at(pp).at(0); + TString device_type = fPublishList.at(pp).at(1); + TString device_name = fPublishList.at(pp).at(2); + TString device_prop = fPublishList.at(pp).at(3); + device_type.ToLower(); + device_prop.ToLower(); + + const VQwHardwareChannel* tmp_channel; + if (device_type == "integrationpmt") { + tmp_channel = GetIntegrationPMT(device_name)->GetChannel(device_name); + } else if (device_type == "combinedpmt") { + tmp_channel = GetCombinedPMT(device_name)->GetChannel(device_name); + } else + QwError << "QwBeamLine::PublishInternalValues() error "<< QwLog::endl; + + if (tmp_channel == NULL) { + QwError << "QwBeamLine::PublishInternalValues(): " << publish_name << " not found" << QwLog::endl; + status |= kFALSE; + } else { + QwDebug << "QwBeamLine::PublishInternalValues(): " << publish_name << " found" << QwLog::endl; + } + status = status && PublishInternalValue(publish_name, publish_name, tmp_channel); + + } + + return status; +} + + +Bool_t QwBlindDetectorArray::PublishByRequest(TString device_name) +{ + Bool_t status = kFALSE; + //std::cerr << "##### device_name==\"" << device_name << "\"" << std::endl; + + for(size_t i=0;i combinedchannelnames; + std::vector weight; + Int_t currentrocread=0; + Int_t currentbankread=0; + Int_t wordsofar=0; + Int_t currentsubbankindex=-1; + Int_t sample_size=0; + + + + // Open the file + QwParameterFile mapstr(mapfile.Data()); + TString varname, varvalue; + + fDetectorMaps.insert(mapstr.GetParamFileNameContents()); + while (mapstr.ReadNextLine()) + { + mapstr.TrimComment('!'); // Remove everything after a '!' character. + mapstr.TrimWhitespace(); // Get rid of leading and trailing spaces. + if (mapstr.LineIsEmpty()) continue; + + if (mapstr.HasVariablePair("=",varname,varvalue)) + { + // This is a declaration line. Decode it. + varname.ToLower(); + UInt_t value = QwParameterFile::GetUInt(varvalue); + + if (varname=="roc") + { + currentrocread=value; + RegisterROCNumber(value,0); + } + else if (varname=="bank") + { + currentbankread=value; + RegisterSubbank(value); + } + else if (varname=="sample_size") + { + sample_size=value; + } + } + else + { + Bool_t lineok = kTRUE; + TString keyword = ""; + TString keyword2 = ""; + TString modtype = ""; + TString dettype = ""; + TString namech = ""; + Int_t modnum = 0; + Int_t channum = 0; + + modtype = mapstr.GetTypedNextToken(); // module type + + if (modtype == "VQWK") + { + modnum = mapstr.GetTypedNextToken(); //slot number + channum = mapstr.GetTypedNextToken(); //channel number + dettype = mapstr.GetTypedNextToken(); //type-purpose of the detector + dettype.ToLower(); + namech = mapstr.GetTypedNextToken(); //name of the detector + namech.ToLower(); + + keyword = mapstr.GetTypedNextToken(); + keyword.ToLower(); + keyword2 = mapstr.GetTypedNextToken(); + keyword2.ToLower(); + } + else if (modtype == "VPMT") + { + channum = mapstr.GetTypedNextToken(); //channel number + Int_t combinedchans = mapstr.GetTypedNextToken(); //number of combined channels + dettype = mapstr.GetTypedNextToken(); //type-purpose of the detector + dettype.ToLower(); + namech = mapstr.GetTypedNextToken(); //name of the detector + namech.ToLower(); + combinedchannelnames.clear(); + for (int i=0; i(); + nameofcombinedchan.ToLower(); + combinedchannelnames.push_back(nameofcombinedchan); + } + weight.clear(); + for (int i=0; i()); + } + keyword = mapstr.GetTypedNextToken(); + keyword.ToLower(); + keyword2 = mapstr.GetTypedNextToken(); + keyword2.ToLower(); + } + + + if (currentsubbankindex!=GetSubbankIndex(currentrocread,currentbankread)) + { + currentsubbankindex=GetSubbankIndex(currentrocread,currentbankread); + wordsofar=0; + } + + QwBlindDetectorArrayID localMainDetID; + localMainDetID.fdetectorname=namech; + localMainDetID.fmoduletype=modtype; + localMainDetID.fSubbankIndex=currentsubbankindex; + localMainDetID.fdetectortype=dettype; + + // localMainDetID.fWordInSubbank=wordsofar; + if (modtype=="VQWK"){ + Int_t offset = QwVQWK_Channel::GetBufferOffset(modnum, channum); + if (offset>=0){ + localMainDetID.fWordInSubbank = wordsofar + offset; + } + } + else if (modtype=="VPMT") + { + localMainDetID.fCombinedChannelNames = combinedchannelnames; + localMainDetID.fWeight = weight; + //std::cout<<"Add in a combined channel"< publishinfo; + while ((section = mapstr.ReadNextSection(varvalue))) { + if (varvalue == "PUBLISH") { + fPublishList.clear(); + while (section->ReadNextLine()) { + section->TrimComment(); // Remove everything after a comment character + section->TrimWhitespace(); // Get rid of leading and trailing spaces + for (int ii = 0; ii < 4; ii++) { + varvalue = section->GetNextToken().c_str(); + if (varvalue.Length()) { + publishinfo.push_back(varvalue); + } + } + if (publishinfo.size() == 4) + fPublishList.push_back(publishinfo); + publishinfo.clear(); + } + } + } + // Print list of variables to publish + QwMessage << "Variables to publish:" << QwLog::endl; + for (size_t jj = 0; jj < fPublishList.size(); jj++) + QwMessage << fPublishList.at(jj).at(0) << " " << fPublishList.at(jj).at(1) << " " + << fPublishList.at(jj).at(2) << " " << fPublishList.at(jj).at(3) << QwLog::endl; + + if (ldebug) + { + std::cout<<"Done with Load channel map\n"; + for (size_t i=0;i=0) + fMainDetID[i].Print(); + } + ldebug=kFALSE; + mapstr.Close(); // Close the file (ifstream) + return 0; +} + + +Int_t QwBlindDetectorArray::LoadEventCuts(TString filename) +{ + Int_t eventcut_flag = 1; + + // Open the file + QwParameterFile mapstr(filename.Data()); + fDetectorMaps.insert(mapstr.GetParamFileNameContents()); + while (mapstr.ReadNextLine()) + { + //std::cout<<"********* In the loop *************"<(); + device_type.ToLower(); + TString device_name = mapstr.GetTypedNextToken(); + device_name.ToLower(); + Int_t det_index = GetDetectorIndex(GetDetectorTypeID(device_type),device_name); + if (det_index == -1) { + QwWarning << " Device not found " << device_name << " of type " << device_type << QwLog::endl; + continue; + } + + if (device_type == GetQwPMTInstrumentTypeName(kQwIntegrationPMT)){ + Double_t LLX = mapstr.GetTypedNextToken(); //lower limit for IntegrationPMT value + Double_t ULX = mapstr.GetTypedNextToken(); //upper limit for IntegrationPMT value + varvalue = mapstr.GetTypedNextToken();//global/local + varvalue.ToLower(); + Double_t stabilitycut = mapstr.GetTypedNextToken(); + QwMessage << "QwBlindDetectorArray Error Code passing to QwIntegrationPMT " << GetGlobalErrorFlag(varvalue,eventcut_flag,stabilitycut) << QwLog::endl; + + //std::cout<<"*****************************"<(); //lower limit for CombinedPMT value + Double_t ULX = mapstr.GetTypedNextToken(); //upper limit for CombinedPMT value + varvalue = mapstr.GetTypedNextToken();//global/local + varvalue.ToLower(); + Double_t stabilitycut = mapstr.GetTypedNextToken(); + QwMessage << "QwBlindDetectorArray Error Code passing to QwCombinedPMT " << GetGlobalErrorFlag(varvalue,eventcut_flag,stabilitycut) << QwLog::endl; + + //std::cout<<"*****************************"<(); //name of the channel + varname.ToLower(); + varname.Remove(TString::kBoth,' '); + varped = mapstr.GetTypedNextToken(); // value of the pedestal + varcal = mapstr.GetTypedNextToken(); // value of the calibration factor + + varnormrate = mapstr.GetTypedNextToken(); // value of the NormRate + varvoltperhz = mapstr.GetTypedNextToken(); // value of the VoltPerHz + varasym = mapstr.GetTypedNextToken(); // value of the asymmetry + varcx = mapstr.GetTypedNextToken(); // value of the coefficient C_x + varcy = mapstr.GetTypedNextToken(); // value of the coefficient C_y + varcxp = mapstr.GetTypedNextToken(); // value of the coefficient C_xp + varcyp = mapstr.GetTypedNextToken(); // value of the coefficient C_yp + varce = mapstr.GetTypedNextToken(); // value of the coefficient C_e + + + if (ldebug) std::cout << "Inputs for channel " << varname << ": ped=" << varped << ": cal=" << varcal << "\n" + << ": varnormrate=" << varnormrate << "\n" + << ": varvoltperhz=" << varvoltperhz << "\n" + << ": asym=" << varasym << "\n" + << ": C_x=" << varcx << ": C_y=" << varcy << "\n" + << ": C_xp=" << varcxp << ": C_yp=" << varcyp << "\n" + << ": C_e=" << varce << "\n"; + + Bool_t notfound=kTRUE; + + if (notfound) + for (size_t i=0;i &buffer) +{ + std::vector elements; + elements.clear(); + + // Get all buffers in the order they are defined in the map file + for (size_t i = 0; i < fMainDetID.size(); i++) + { + // This is a QwIntegrationPMT + if (fMainDetID.at(i).fTypeID == kQwIntegrationPMT) + fIntegrationPMT[fMainDetID.at(i).fIndex].EncodeEventData(elements); + } + + + // If there is element data, generate the subbank header + std::vector subbankheader; + std::vector rocheader; + if (elements.size() > 0) + { + + // Form CODA subbank header + subbankheader.clear(); + subbankheader.push_back(elements.size() + 1); // subbank size + subbankheader.push_back((fCurrentBank_ID << 16) | (0x01 << 8) | (1 & 0xff)); + // subbank tag | subbank type | event number + + // Form CODA bank/roc header + rocheader.clear(); + rocheader.push_back(subbankheader.size() + elements.size() + 1); // bank/roc size + rocheader.push_back((fCurrentROC_ID << 16) | (0x10 << 8) | (1 & 0xff)); + // bank tag == ROC | bank type | event number + + // Add bank header, subbank header and element data to output buffer + buffer.insert(buffer.end(), rocheader.begin(), rocheader.end()); + buffer.insert(buffer.end(), subbankheader.begin(), subbankheader.end()); + buffer.insert(buffer.end(), elements.begin(), elements.end()); + } +} + +void QwBlindDetectorArray::RandomizeMollerEvent(int helicity /*, const QwBeamCharge& charge, const QwBeamPosition& xpos, const QwBeamPosition& ypos, const QwBeamAngle& xprime, const QwBeamAngle& yprime, const QwBeamEnergy& energy*/) +{ +/* fTargetCharge.PrintInfo(); + fTargetX.PrintInfo(); + fTargetY.PrintInfo(); + fTargetXprime.PrintInfo(); + fTargetYprime.PrintInfo(); + fTargetEnergy.PrintInfo();*/ + + for (size_t i = 0; i < fMainDetID.size(); i++) + { + fIntegrationPMT[i].RandomizeMollerEvent(helicity, fTargetCharge, fTargetX, fTargetY, fTargetXprime, fTargetYprime, fTargetEnergy); + // fIntegrationPMT[i].PrintInfo(); + } + +} + +Int_t QwBlindDetectorArray::ProcessConfigurationBuffer(const UInt_t roc_id, const UInt_t bank_id, UInt_t* buffer, UInt_t num_words) +{ + + /* Int_t index = GetSubbankIndex(roc_id,bank_id); + if (index>=0 && num_words>0){ + // We want to process the configuration data for this ROC. + UInt_t words_read = 0; + for (size_t i = 0; i < fMainDetID.size(); i++) { + words_read += fIntegrationPMT[i].ProcessConfigurationBuffer(&(buffer[words_read]), + num_words-words_read); + } + }*/ + return 0; +} + + +Int_t QwBlindDetectorArray::ProcessEvBuffer(const UInt_t roc_id, const UInt_t bank_id, UInt_t* buffer, UInt_t num_words) +{ + Bool_t lkDEBUG=kFALSE; + + Int_t index = GetSubbankIndex(roc_id,bank_id); + + if (index>=0 && num_words>0) + { + // We want to process this ROC. Begin looping through the data. + if (lkDEBUG) + std::cout << "QwBlindDetectorArray::ProcessEvBuffer: " + << "Begin processing ROC" << roc_id + << " and subbank "<IntegrationPMT[ "<CombinedPMT[ "<(ev_error); + if(Compare(tmp)){ + const QwBlindDetectorArray* input = dynamic_cast (ev_error); + + for (size_t i=0;ifIntegrationPMT.size();i++) + this->fIntegrationPMT[i].UpdateErrorFlag(&(input->fIntegrationPMT[i])); + + for (size_t i=0;ifCombinedPMT.size();i++) + this->fCombinedPMT[i].UpdateErrorFlag(&(input->fCombinedPMT[i])); + } +}; + + +void QwBlindDetectorArray::ProcessEvent() +{ + for (size_t i=0;i variable_list; + variable_list.push_back(&fTargetCharge); + variable_list.push_back(&fTargetX); + variable_list.push_back(&fTargetY); + variable_list.push_back(&fTargetXprime); + variable_list.push_back(&fTargetYprime); + variable_list.push_back(&fTargetEnergy); + */ + + // Loop over all variables in the list + /* + //IMPORTANT NOTE ABOUT THE COMMENTED LOOP + //NAMES OF THE variable_list DEVICES WILL BE OVER WRITTEN BY ACTUAL NAMES OF DATA ELEMENTS THAT WE ARE READING FROM THE + //ROUTINE RequestExternalValue(variable->GetElementName(), variable). DO TRY THIS AT HOME! + + + std::vector::iterator variable_iter; + for (variable_iter = variable_list.begin(); variable_iter != variable_list.end(); variable_iter++){ + VQwDataElement* variable = *variable_iter; + //QwWarning << "QwBlindDetectorArray::ExchangeProcessedData for loop "<GetElementName()<< QwLog::endl; + if (RequestExternalValue(variable->GetElementName(), variable)) + { + if (bDEBUG) + dynamic_cast(variable)->PrintInfo(); + //QwWarning << "QwBlindDetectorArray::ExchangeProcessedData Found "<GetElementName()<< QwLog::endl; + } + else + { + bIsExchangedDataValid = kFALSE; + QwError << GetSubsystemName() << " could not get external value for " + << variable->GetElementName() << QwLog::endl; + } + } // end of loop over variables + + */ + + if(RequestExternalValue("q_targ", &fTargetCharge)){ + if (bDEBUG){ + QwWarning << "QwBlindDetectorArray::ExchangeProcessedData Found "<(&fTargetCharge))->PrintInfo(); + } + } + else{ + bIsExchangedDataValid = kFALSE; + QwError << GetSubsystemName() << " could not get external value for " + << fTargetCharge.GetElementName() << QwLog::endl; + } + + if(RequestExternalValue("x_targ", &fTargetX)){ + if (bDEBUG){ + dynamic_cast(&fTargetX)->PrintInfo(); + QwWarning << "QwBlindDetectorArray::ExchangeProcessedData Found "<(&fTargetY)->PrintInfo(); + QwWarning << "QwBlindDetectorArray::ExchangeProcessedData Found "<(&fTargetXprime)->PrintInfo(); + QwWarning << "QwBlindDetectorArray::ExchangeProcessedData Found "<(&fTargetYprime)->PrintInfo(); + QwWarning << "QwBlindDetectorArray::ExchangeProcessedData Found "<(&fTargetEnergy)->PrintInfo(); + QwWarning << "QwBlindDetectorArray::ExchangeProcessedData Found "<DoNormalization(); + } + else + { + QwWarning<<"QwBlindDetectorArray::ProcessEvent_2(): could not get all external values."< &values) +{ + for (size_t i=0;i &values) const +{ + for (size_t i=0;i(value); + if (input->fIntegrationPMT.size()!=fIntegrationPMT.size() || + input->fCombinedPMT.size()!=fCombinedPMT.size() ) + { + res=kFALSE; + // std::cout<<" not the same number of channels \n"; + } + } + return res; +} + + +VQwSubsystem& QwBlindDetectorArray::operator= (VQwSubsystem *value) +{ + // std::cout<<" here in QwBlindDetectorArray::operator= \n"; + if (Compare(value)) + { +// VQwSubsystem::operator=(value); + QwBlindDetectorArray* input = dynamic_cast (value); + + for (size_t i=0;ifIntegrationPMT.size();i++) + this->fIntegrationPMT[i]=input->fIntegrationPMT[i]; + + for (size_t i=0;ifCombinedPMT.size();i++) + (this->fCombinedPMT[i])=(input->fCombinedPMT[i]); + } + return *this; +} + + +VQwSubsystem& QwBlindDetectorArray::operator+= (VQwSubsystem *value) +{ + if (Compare(value)) + { + QwBlindDetectorArray* input= dynamic_cast(value) ; + + for (size_t i=0;ifIntegrationPMT.size();i++) + this->fIntegrationPMT[i]+=input->fIntegrationPMT[i]; + + for (size_t i=0;ifCombinedPMT.size();i++) + this->fCombinedPMT[i]+=input->fCombinedPMT[i]; + + } + return *this; +} + + +VQwSubsystem& QwBlindDetectorArray::operator-= (VQwSubsystem *value) +{ + + if (Compare(value)) + { + QwBlindDetectorArray* input= dynamic_cast(value); + + for (size_t i=0;ifIntegrationPMT.size();i++) + this->fIntegrationPMT[i]-=input->fIntegrationPMT[i]; + + for (size_t i=0;ifCombinedPMT.size();i++) + this->fCombinedPMT[i]-=input->fCombinedPMT[i]; + + } + return *this; +} + + + +void QwBlindDetectorArray::Sum(VQwSubsystem *value1,VQwSubsystem *value2) +{ + if (Compare(value1)&&Compare(value2)) + { + *this = value1; + *this += value2; + } +} + +void QwBlindDetectorArray::Difference(VQwSubsystem *value1,VQwSubsystem *value2) +{ + if (Compare(value1)&&Compare(value2)) + { + *this = value1; + *this -= value2; + } +} + +void QwBlindDetectorArray::Ratio(VQwSubsystem *numer, VQwSubsystem *denom) +{ + if (Compare(numer)&&Compare(denom)) + { + QwBlindDetectorArray* innumer= dynamic_cast(numer) ; + QwBlindDetectorArray* indenom= dynamic_cast(denom) ; + + for (size_t i=0;ifIntegrationPMT.size();i++) + this->fIntegrationPMT[i].Ratio(innumer->fIntegrationPMT[i],indenom->fIntegrationPMT[i]); + + for (size_t i=0;ifCombinedPMT.size();i++) + this->fCombinedPMT[i].Ratio(innumer->fCombinedPMT[i],indenom->fCombinedPMT[i]); + + } + return; +} + + +void QwBlindDetectorArray::Scale(Double_t factor) +{ + for (size_t i=0;i(value1); + + for (size_t i = 0; i < fIntegrationPMT.size(); i++) + fIntegrationPMT[i].AccumulateRunningSum(value->fIntegrationPMT[i]); + for (size_t i = 0; i < fCombinedPMT.size(); i++) + fCombinedPMT[i].AccumulateRunningSum(value->fCombinedPMT[i]); + } +} + +void QwBlindDetectorArray::DeaccumulateRunningSum(VQwSubsystem* value1){ + if (Compare(value1)) { + QwBlindDetectorArray* value = dynamic_cast(value1); + + for (size_t i = 0; i < fIntegrationPMT.size(); i++) + fIntegrationPMT[i].DeaccumulateRunningSum(value->fIntegrationPMT[i]); + for (size_t i = 0; i < fCombinedPMT.size(); i++) + fCombinedPMT[i].DeaccumulateRunningSum(value->fCombinedPMT[i]); + } +}; + + +/** + * Blind the asymmetry + * @param blinder Blinder + */ +void QwBlindDetectorArray::Blind(const QwBlinder *blinder) +{ + for (size_t i = 0; i < fIntegrationPMT.size(); i++) + fIntegrationPMT[i].Blind(blinder); + for (size_t i = 0; i < fCombinedPMT.size(); i++) + fCombinedPMT[i].Blind(blinder); +} + +/** + * Blind the difference using the yield + * @param blinder Blinder + * @param subsys Subsystem + */ +void QwBlindDetectorArray::Blind(const QwBlinder *blinder, const VQwSubsystemParity* subsys) +{ + /// \todo TODO (wdc) At some point we should introduce const-correctness in + /// the Compare() routine to ensure nothing funny happens. This const_casting + /// is just an ugly stop-gap measure. + if (Compare(const_cast(subsys))) { + + const QwBlindDetectorArray* yield = dynamic_cast(subsys); + if (yield == 0) return; + + for (size_t i = 0; i < fIntegrationPMT.size(); i++) + fIntegrationPMT[i].Blind(blinder, yield->fIntegrationPMT[i]); + for (size_t i = 0; i < fCombinedPMT.size(); i++) + fCombinedPMT[i].Blind(blinder, yield->fCombinedPMT[i]); + } +} + +EQwPMTInstrumentType QwBlindDetectorArray::GetDetectorTypeID(TString name) +{ + return GetQwPMTInstrumentType(name); +} + +//*****************************************************************// +Int_t QwBlindDetectorArray::GetDetectorIndex(EQwPMTInstrumentType type_id, TString name) +{ + Bool_t ldebug=kFALSE; + if (ldebug) + { + std::cout<<"QwBlindDetectorArray::GetDetectorIndex\n"; + std::cout<<"type_id=="<"<Normalize(&fTargetCharge); + } + catch (std::exception& e) + { + std::cerr << e.what() << std::endl; + } + } +} + +#ifdef __USE_DATABASE__ +void QwBlindDetectorArray::FillDB(QwParityDB *db, TString datatype) +{ + Bool_t local_print_flag = false; + + if(local_print_flag) { + QwMessage << " --------------------------------------------------------------- " << QwLog::endl; + QwMessage << " QwBlindDetectorArray::FillDB " << QwLog::endl; + QwMessage << " --------------------------------------------------------------- " << QwLog::endl; + } + + std::vector interface; + std::vector entrylist; + + UInt_t analysis_id = db->GetAnalysisID(); + + TString measurement_type; + measurement_type = QwDBInterface::DetermineMeasurementTypeID(datatype); + + UInt_t i,j; + i = j = 0; + if(local_print_flag) QwMessage << QwColor(Qw::kGreen) << "IntegrationPMT" <Connect(); + // Check the entrylist size, if it isn't zero, start to query.. + if( entrylist.size() ) { + mysqlpp::Query query= db->Query(); + query.insert(entrylist.begin(), entrylist.end()); + query.execute(); + } + else { + QwMessage << "QwBlindDetectorArray::FillDB :: This is the case when the entrlylist contains nothing in "<< datatype.Data() << QwLog::endl; + } + db->Disconnect(); + return; +} +#endif + +void QwBlindDetectorArray::PrintValue() const +{ + QwMessage << "=== QwBlindDetectorArray: " << GetSubsystemName() << " ===" << QwLog::endl; + for (size_t i = 0; i < fIntegrationPMT.size(); i++) + fIntegrationPMT[i].PrintValue(); + for (size_t i = 0; i < fCombinedPMT.size(); i++) + fCombinedPMT[i].PrintValue(); +} + +void QwBlindDetectorArray::PrintInfo() const +{ + std::cout<<"Name of the subsystem ="< interface; + std::vector entrylist; + + UInt_t analysis_id = db->GetAnalysisID(); + + UInt_t i,j; + i = j = 0; + if(local_print_flag) QwMessage << QwColor(Qw::kGreen) << "IntegrationPMT" <Connect(); + // Check the entrylist size, if it isn't zero, start to query.. + if( entrylist.size() ) { + mysqlpp::Query query= db->Query(); + query.insert(entrylist.begin(), entrylist.end()); + query.execute(); + } + else { + QwMessage << "QwBlindDetectorArray::FillErrDB :: This is the case when the entrlylist contains nothing in "<< datatype.Data() << QwLog::endl; + } + db->Disconnect(); + + return; +}; +#endif + + +void QwBlindDetectorArray::WritePromptSummary(QwPromptSummary *ps, TString type) +{ + + Bool_t local_print_flag = true; + if(local_print_flag){ + QwMessage << " --------------------------------------------------------------- " << QwLog::endl; + QwMessage << " QwBlindDetectorArrayID::WritePromptSummary() " << QwLog::endl; + QwMessage << " --------------------------------------------------------------- " << QwLog::endl; + } + + // ps->PrintCSV(); + + return; +} + + + +void QwBlindDetectorArrayID::Print() const +{ + + std::cout<Disconnect(); } } -#endif +#endif // __USE_DATABASE__ /*!-------------------------------------------------------------- * This routines checks to see if the stored fBlindTestValues[i] @@ -931,7 +932,6 @@ void QwBlinder::PrintFinalValues() } -#ifdef __USE_DATABASE__ /** * Write the blinding parameters to the database * @param db Database connection @@ -940,6 +940,7 @@ void QwBlinder::PrintFinalValues() * For each analyzed run the database contains a digest of the blinding parameters * and a number of blinded test entries. */ +#ifdef __USE_DATABASE__ void QwBlinder::FillDB(QwParityDB *db, TString datatype) { QwDebug << " --------------------------------------------------------------- " << QwLog::endl; @@ -1046,7 +1047,7 @@ void QwBlinder::FillErrDB(QwParityDB *db, TString datatype) return; }; -#endif +#endif // __USE_DATABASE__ void QwBlinder::SetTargetBlindability(QwBlinder::EQwBlinderStatus status) diff --git a/Parity/src/QwCombinedBPM.cc b/Parity/src/QwCombinedBPM.cc index fd9a5d00a..76718427b 100755 --- a/Parity/src/QwCombinedBPM.cc +++ b/Parity/src/QwCombinedBPM.cc @@ -461,12 +461,7 @@ void QwCombinedBPM::ProcessEvent() static T tmpQADC("tmpQADC"), tmpADC("tmpADC"); - //PrintInfo(); - this->ClearEventData(); - - //PrintInfo(); - //check to see if the fixed parameters are calculated if(!fixedParamCalculated){ if(ldebug) std::cout<<"QwCombinedBPM:Calculating fixed parameters..\n"; @@ -550,8 +545,6 @@ void QwCombinedBPM::ProcessEvent() } } - //PrintInfo(); - return; } @@ -844,7 +837,6 @@ VQwBPM& QwCombinedBPM::operator+= (const VQwBPM &value) return *this; } - template QwCombinedBPM& QwCombinedBPM::operator+= (const QwCombinedBPM &value) { @@ -861,7 +853,6 @@ QwCombinedBPM& QwCombinedBPM::operator+= (const QwCombinedBPM &value) return *this; } - template VQwBPM& QwCombinedBPM::operator-= (const VQwBPM &value) { @@ -895,7 +886,6 @@ void QwCombinedBPM::Ratio(VQwBPM &numer, VQwBPM &denom) *dynamic_cast*>(&denom)); } - template void QwCombinedBPM::Ratio(QwCombinedBPM &numer, QwCombinedBPM &denom) @@ -932,7 +922,6 @@ void QwCombinedBPM::Scale(Double_t factor) return; } - template void QwCombinedBPM::CalculateRunningAverage() { @@ -953,7 +942,6 @@ void QwCombinedBPM::AccumulateRunningSum(const VQwBPM& value) AccumulateRunningSum(*dynamic_cast* >(&value)); } - template void QwCombinedBPM::AccumulateRunningSum(const QwCombinedBPM& value) { diff --git a/Parity/src/QwCombiner.cc b/Parity/src/QwCombiner.cc new file mode 100644 index 000000000..ffdfa016f --- /dev/null +++ b/Parity/src/QwCombiner.cc @@ -0,0 +1,571 @@ +/* + * QwCombiner.cc + * + * Created on: Oct 22, 2010 + * Author: wdconinc + * + * Last Modified: August 1, 2018 1:45 PM + */ + +#include "QwCombiner.h" + +// Qweak headers +#include "VQwDataElement.h" +#include "QwVQWK_Channel.h" +#include "QwParameterFile.h" + +#include "QwHelicityPattern.h" + +#define MYSQLPP_SSQLS_NO_STATICS +#ifdef __USE_DATABASE__ +#include "QwParitySSQLS.h" +#include "QwParityDB.h" +#endif // __USE_DATABASE__ + + +/** Constructor with single event and helicity pattern + * + * @param options Options object + * @param event Single event + * @param helicitypattern Helicity pattern + */ +QwCombiner::QwCombiner( + QwOptions &options, + QwSubsystemArrayParity& event, + QwHelicityPattern& helicitypattern) +{ + ParseSeparator = ":"; + fEnableCorrection = false; + ProcessOptions(options); + fSubsystemArray = &event; + fHelicityPattern = &helicitypattern; + LoadChannelMap(fRegressionMapFile); + QwSubsystemArrayParity& asym = helicitypattern.fAsymmetry; + QwSubsystemArrayParity& diff = helicitypattern.fDifference; + ConnectChannels(event,asym,diff); +} + +/** Constructor with single event + * + * @param options Options object + * @param event Single event + * + */ +QwCombiner::QwCombiner(QwOptions &options, QwSubsystemArrayParity& event) +{ + fHelicityPattern = NULL; + ParseSeparator = ":"; + fEnableCorrection = false; + ProcessOptions(options); + fSubsystemArray = &event; + LoadChannelMap(fRegressionMapFile); + ConnectChannels(event); +} + +/** Constructor with only helicity pattern + * + * @param options Obtions object + * @param helicitypattern Helicity Pattern + * + */ +QwCombiner::QwCombiner(QwOptions &options, QwHelicityPattern& helicitypattern) +{ + fSubsystemArray = NULL; + ParseSeparator = ":"; + fEnableCorrection = false; + ProcessOptions(options); + LoadChannelMap(fRegressionMapFile); + fHelicityPattern = &helicitypattern; + QwSubsystemArrayParity& asym = helicitypattern.fAsymmetry; + QwSubsystemArrayParity& diff = helicitypattern.fDifference; + ConnectChannels(asym,diff); +} + +/** Constructor with options + * + * @param options Obtions object + * + */ +QwCombiner::QwCombiner(QwOptions &options) +{ + fEnableCorrection = false; + ProcessOptions(options); + LoadChannelMap(fRegressionMapFile); +} + + +QwCombiner::QwCombiner(const QwCombiner &source) +{ + fEnableCorrection = source.fEnableCorrection; + fRegressionMapFile = source.fRegressionMapFile; + fErrorFlag = source.fErrorFlag; + this->fDependentVar.resize(source.fDependentVar.size()); + fDependentType.resize(source.fDependentVar.size()); + fOutputVar.resize(source.fDependentVar.size()); + for (size_t i = 0; i < this->fDependentVar.size(); i++) { + const QwVQWK_Channel* vqwk = dynamic_cast(source.fOutputVar[i]); + this->fDependentVar[i] = NULL; + this->fOutputVar[i] = new QwVQWK_Channel(*vqwk, VQwDataElement::kDerived); + fDependentType[i] = source.fDependentType[i]; + } +} + +/// Destructor +QwCombiner::~QwCombiner() +{ + Iterator_HdwChan element; + for (element = fOutputVar.begin(); element != fOutputVar.end(); element++) { + if (*element != NULL){ + delete *element; + } + } + fOutputVar.clear(); +} + +/** + * Defines configuration options using QwOptions functionality. + * @param options Options object + */ +void QwCombiner::DefineOptions(QwOptions &options) +{ + options.AddOptions("Combiner") + ("enable-correction", po::value()->zero_tokens()->default_value(false), + "enable correction"); + options.AddOptions("Combiner") + ("regression-map", po::value()->default_value("regression_new.map"), + "variables and sensitivities for correction"); +} + +/** + * Process configuration options using QwOptions functionality. + * @param options Options object + */ +void QwCombiner::ProcessOptions(QwOptions &options) +{ + fEnableCorrection = options.GetValue("enable-correction"); + fRegressionMapFile = options.GetValue("regression-map"); +} + + +/** Load the channel map + * + * @param mapfile Filename of map file + * @return Zero when success + */ +Int_t QwCombiner::LoadChannelMap(const std::string& mapfile) +{ + // Return if correctiion is not enabled + if (! fEnableCorrection) return 0; + + // Open the file + QwParameterFile map(mapfile); + + // Read the sections of dependent variables + bool keep_header = true; + std::string section_name; + QwParameterFile* section = 0; + std::pair type_name; + while ((section = map.ReadNextSection(section_name,keep_header))) { + + // Store index to the current position in the dv vector + size_t current_dv_start = fDependentName.size(); + + // Add dependent variables from the section header + section->ReadNextLine(); + if (section->LineHasSectionHeader()) { + section->TrimSectionHeader(); + section->TrimWhitespace(); + // Parse section header into tokens separated by a comma + std::string current_token; + std::string previous_token; + do { + previous_token = current_token; + current_token = section->GetNextToken(","); + if (current_token.size() == 0) continue; + // Parse current token into dependent variable type and name + type_name = ParseRegressionVariable(current_token); + fDependentType.push_back(type_name.first); + fDependentName.push_back(type_name.second); + // Resize the vectors of sensitivities and independent variables + fSensitivity.resize(fDependentName.size()); + fIndependentType.resize(fDependentName.size()); + fIndependentName.resize(fDependentName.size()); + } while (current_token.size() != 0); + } else QwError << "Section does not start with header." << QwLog::endl; + + // Add independent variables and sensitivities + while (section->ReadNextLine()) { + // Throw away comments, whitespace, empty lines + section->TrimComment(); + section->TrimWhitespace(); + if (section->LineIsEmpty()) continue; + // Get first token: independent variable + std::string current_token = section->GetNextToken(","); + // Parse current token into independent variable type and name + type_name = ParseRegressionVariable(current_token); + // Loop over dependent variables to set sensitivities + for (size_t dv = current_dv_start; dv < fDependentName.size(); dv++) { + Double_t sensitivity = atof(section->GetNextToken(",").c_str()); + fSensitivity.at(dv).push_back(sensitivity); + fIndependentType.at(dv).push_back(type_name.first); + fIndependentName.at(dv).push_back(type_name.second); + } + } + } + return 0; +} + +/** Connect to the dependent and independent channels + * + * @param event Helicity event structure + * @param asym Asymmetry event structure + * @param diff Difference event structure + * @return Zero on success + */ +Int_t QwCombiner::ConnectChannels( + QwSubsystemArrayParity& event, + QwSubsystemArrayParity& asym, + QwSubsystemArrayParity& diff) +{ + // Return if correction is not enabled + if (! fEnableCorrection) return 0; + + /// Fill vector of pointers to the relevant data elements + for (size_t dv = 0; dv < fDependentName.size(); dv++) { + // Get the dependent variables + + VQwHardwareChannel* dv_ptr = 0; + QwVQWK_Channel* new_vqwk = NULL; + QwVQWK_Channel* vqwk = NULL; + string name = ""; + string reg = "reg_"; + + if(fDependentName.at(dv).at(0) == '@' ){ + name = fDependentName.at(dv).substr(1,fDependentName.at(dv).length()); + }else{ + switch (fDependentType.at(dv)) { + case kRegTypeMps: + dv_ptr = event.ReturnInternalValueForFriends(fDependentName.at(dv)); + break; + case kRegTypeAsym: + dv_ptr = asym.ReturnInternalValueForFriends(fDependentName.at(dv)); + break; + case kRegTypeDiff: + dv_ptr = diff.ReturnInternalValueForFriends(fDependentName.at(dv)); + break; + default: + QwWarning << "Dependent variable for regression has unknown type." + << QwLog::endl; + break; + } + + vqwk = dynamic_cast(dv_ptr); + name = vqwk->GetElementName().Data(); + name.insert(0, reg); + new_vqwk = new QwVQWK_Channel(*vqwk, VQwDataElement::kDerived); + new_vqwk->SetElementName(name); + } + + // alias + if(fDependentName.at(dv).at(0) == '@'){ + //QwMessage << "dv: " << name << QwLog::endl; + new_vqwk = new QwVQWK_Channel(name, VQwDataElement::kDerived); + } + // defined type + else if(dv_ptr!=NULL){ + //QwMessage << "dv: " << fDependentName.at(dv) << QwLog::endl; + }else { + QwWarning << "Dependent variable " << fDependentName.at(dv) << " could not be found, " + << "or is not a VQWK channel." << QwLog::endl; + continue; + } + + // pair creation + if(new_vqwk != NULL){ + fDependentType.push_back(fDependentType.at(dv)); + fDependentVar.push_back(vqwk); + fOutputVar.push_back(new_vqwk); + //fDependentVar.push_back(std::make_pair(vqwk, new_vqwk)); + } + + // Add independent variables + fIndependentVar.resize(fDependentVar.size()); + for (size_t iv = 0; iv < fIndependentName.at(dv).size(); iv++) { + // Get the independent variables + const VQwHardwareChannel* iv_ptr = 0; + switch (fIndependentType.at(dv).at(iv)) { + case kRegTypeMps: + iv_ptr = event.ReturnInternalValue(fIndependentName.at(dv).at(iv)); + break; + case kRegTypeAsym: + iv_ptr = asym.ReturnInternalValue(fIndependentName.at(dv).at(iv)); + break; + case kRegTypeDiff: + iv_ptr = diff.ReturnInternalValue(fIndependentName.at(dv).at(iv)); + break; + default: + QwWarning << "Independent variable for regression has unknown type." + << QwLog::endl; + break; + } + if (iv_ptr) { + //QwMessage << " iv: " << fIndependentName.at(dv).at(iv) << " (sens = " << fSensitivity.at(dv).at(iv) << ")" << QwLog::endl; + fIndependentVar.back().push_back(iv_ptr); + //fIndependentVar.back().push_back(std::make_pair(fSensitivity.at(dv).at(iv), iv_ptr)); + } else { + QwWarning << "Independent variable " << fIndependentName.at(dv).at(iv) << " for regression of " + << "dependent variable " << fDependentName.at(dv) << " could not be found." + << QwLog::endl; + } + } + } + + return 0; + +} +/** Connect to the dependent and independent channels + * + * @param asym Asymmetry event structure + * @param diff Difference event structure + * @return Zero on success + */ +Int_t QwCombiner::ConnectChannels( + QwSubsystemArrayParity& asym, + QwSubsystemArrayParity& diff) +{ + // Return if correction is not enabled + if (! fEnableCorrection) return 0; + + /// Fill vector of pointers to the relevant data elements + for (size_t dv = 0; dv < fDependentName.size(); dv++) { + // Get the dependent variables + + VQwHardwareChannel* dv_ptr = 0; + QwVQWK_Channel* new_vqwk = NULL; + QwVQWK_Channel* vqwk = NULL; + string name = ""; + string reg = "reg_"; + + if (fDependentType.at(dv)==kRegTypeMps){ + // Quietly ignore the MPS type when we're connecting the asym & diff + continue; + } else if(fDependentName.at(dv).at(0) == '@' ){ + name = fDependentName.at(dv).substr(1,fDependentName.at(dv).length()); + }else{ + switch (fDependentType.at(dv)) { + case kRegTypeAsym: + dv_ptr = asym.ReturnInternalValueForFriends(fDependentName.at(dv)); + break; + case kRegTypeDiff: + dv_ptr = diff.ReturnInternalValueForFriends(fDependentName.at(dv)); + break; + default: + QwWarning << "QwCombiner::ConnectChannels(QwSubsystemArrayParity& asym, QwSubsystemArrayParity& diff): Dependent variable, " + << fDependentName.at(dv) + << ", for asym/diff regression does not have proper type, type==" + << fDependentType.at(dv) << "."<< QwLog::endl; + break; + } + + vqwk = dynamic_cast(dv_ptr); + name = vqwk->GetElementName().Data(); + name.insert(0, reg); + new_vqwk = new QwVQWK_Channel(*vqwk, VQwDataElement::kDerived); + new_vqwk->SetElementName(name); + } + + // alias + if(fDependentName.at(dv).at(0) == '@'){ + //QwMessage << "dv: " << name << QwLog::endl; + new_vqwk = new QwVQWK_Channel(name, VQwDataElement::kDerived); + } + // defined type + else if(dv_ptr!=NULL){ + //QwMessage << "dv: " << fDependentName.at(dv) << QwLog::endl; + }else { + QwWarning << "Dependent variable " << fDependentName.at(dv) << " could not be found, " + << "or is not a VQWK channel." << QwLog::endl; + continue; + } + + // pair creation + if(new_vqwk != NULL){ + fDependentType.push_back(fDependentType.at(dv)); + fDependentVar.push_back(vqwk); + fOutputVar.push_back(new_vqwk); + //fDependentVar.push_back(std::make_pair(vqwk, new_vqwk)); + } + + // Add independent variables + fIndependentVar.resize(fDependentVar.size()); + for (size_t iv = 0; iv < fIndependentName.at(dv).size(); iv++) { + // Get the independent variables + const VQwHardwareChannel* iv_ptr = 0; + switch (fIndependentType.at(dv).at(iv)) { + case kRegTypeAsym: + iv_ptr = asym.ReturnInternalValue(fIndependentName.at(dv).at(iv)); + break; + case kRegTypeDiff: + iv_ptr = diff.ReturnInternalValue(fIndependentName.at(dv).at(iv)); + break; + default: + QwWarning << "Independent variable for regression has unknown type." + << QwLog::endl; + break; + } + if (iv_ptr) { + //QwMessage << " iv: " << fIndependentName.at(dv).at(iv) << " (sens = " << fSensitivity.at(dv).at(iv) << ")" << QwLog::endl; + fIndependentVar.back().push_back(iv_ptr); + } else { + QwWarning << "Independent variable " << fIndependentName.at(dv).at(iv) << " for regression of " + << "dependent variable " << fDependentName.at(dv) << " could not be found." + << QwLog::endl; + } + } + } + + return 0; + +} + +/** Connect to the dependent and independent channels + * + * @param event Helicity event structure + * @return Zero on success + */ +Int_t QwCombiner::ConnectChannels(QwSubsystemArrayParity& event) +{ + // Return if correction is not enabled + if (! fEnableCorrection) return 0; + + /// Fill vector of pointers to the relevant data elements + for (size_t dv = 0; dv < fDependentName.size(); dv++) { + // Get the dependent variables + + VQwHardwareChannel* dv_ptr = 0; + QwVQWK_Channel* new_vqwk = NULL; + QwVQWK_Channel* vqwk = NULL; + string name = " s"; + string reg = "reg_"; + + if (fDependentType.at(dv)==kRegTypeAsym || fDependentType.at(dv)==kRegTypeDiff){ + // Quietly skip the asymmetry or difference types. + continue; + } else if(fDependentType.at(dv) != kRegTypeMps){ + QwWarning << "QwCombiner::ConnectChannels(QwSubsystemArrayParity& event): Dependent variable, " + << fDependentName.at(dv) + << ", for MPS regression does not have MPS type, type==" + << fDependentType.at(dv) << "."<< QwLog::endl; + continue; + } else { + if(fDependentName.at(dv).at(0) == '@' ){ + name = fDependentName.at(dv).substr(1,fDependentName.at(dv).length()); + new_vqwk = new QwVQWK_Channel(name, VQwDataElement::kDerived); + } else { + dv_ptr = event.ReturnInternalValueForFriends(fDependentName.at(dv)); + + vqwk = dynamic_cast(dv_ptr); + name = vqwk->GetElementName().Data(); + name.insert(0,reg); + new_vqwk = new QwVQWK_Channel(*vqwk, VQwDataElement::kDerived); + new_vqwk->SetElementName(name); + } + } + + // alias + if(new_vqwk==NULL){ + QwWarning << "Dependent variable " << fDependentName.at(dv) << " could not be found, " + << "or is not a VQWK channel." << QwLog::endl; + continue; + } else { + //QwMessage << "dv: " << new_vqwk->GetElementName() << QwLog::endl; + // pair creation + fDependentType.push_back(fDependentType.at(dv)); + fDependentVar.push_back(vqwk); + fOutputVar.push_back(new_vqwk); + //fDependentVar.push_back(std::make_pair(vqwk, new_vqwk)); + } + + // Add independent variables + fIndependentVar.resize(fDependentVar.size()); + for (size_t iv = 0; iv < fIndependentName.at(dv).size(); iv++) { + // Get the independent variables + const VQwHardwareChannel* iv_ptr = 0; + if(fIndependentType.at(dv).at(iv) == kRegTypeMps){ + iv_ptr = event.ReturnInternalValue(fIndependentName.at(dv).at(iv)); + } else { + QwWarning << "Independent variable for MPS regression has unknown type." + << QwLog::endl; + } + if (iv_ptr) { + //QwMessage << " iv: " << fIndependentName.at(dv).at(iv) << " (sens = " << fSensitivity.at(dv).at(iv) << ")" << QwLog::endl; + fIndependentVar.back().push_back(iv_ptr); + } else { + QwWarning << "Independent variable " << fIndependentName.at(dv).at(iv) << " for regression of " + << "dependent variable " << fDependentName.at(dv) << " could not be found." + << QwLog::endl; + } + } + } + + return 0; +} + + +/// Do the linear regression +void QwCombiner::LinearRegression(EQwRegType type) +{ + // Return if correction is not enabled + if (! fEnableCorrection){ + QwDebug << "Regression is not enabled!" << QwLog::endl; + return; + } + + // Get error flag from QwHelicityPattern + if (fHelicityPattern != NULL){ + fErrorFlag = fHelicityPattern->GetEventcutErrorFlag(); + } else if (fSubsystemArray != NULL){ + fErrorFlag = fSubsystemArray->GetEventcutErrorFlag(); + } else { + QwError << "QwCombiner::LinearRegression: Can't set fErrorFlag" << QwLog::endl; + fErrorFlag = 0; + } + + ProcessData(); + + /* + // Linear regression for each dependent variable + for (size_t dv = 0; dv < fDependentVar.size(); dv++) { + // if second is NULL, can't do regression + if (fOutputVar.at(dv) == NULL){ + QwError<<"Second is value is NULL, unable to calculate regression."<ClearEventData(); + }else{ + // Update second value + fOutputVar.at(dv)->AssignValueFrom(fDependentVar.at(dv)); + } + // Add corrections + for (size_t iv = 0; iv < fIndependentVar.at(dv).size(); iv++) { + fOutputVar.at(dv)->ScaledAdd(fSensitivity.at(dv), fIndependentVar.at(dv)); + //fOutputVar.at(dv)->ScaledAdd(fIndependentVar.at(dv).at(iv).first, fIndependentVar.at(dv).at(iv).second); + } + } + */ +} + + +void QwCombiner::ProcessData() { + + for (size_t i = 0; i < fDependentVar.size(); ++i) { + CalcOneOutput(fDependentVar[i], fOutputVar[i], fIndependentVar[i], fSensitivity[i]); + } + +} + diff --git a/Parity/src/QwCombinerSubsystem.cc b/Parity/src/QwCombinerSubsystem.cc new file mode 100644 index 000000000..2c7a5706f --- /dev/null +++ b/Parity/src/QwCombinerSubsystem.cc @@ -0,0 +1,262 @@ +/* + * QwCombinerSubsystem.cc + * + * Created on: Aug 11, 2011 + * Author: meeker + */ + +#include "QwCombinerSubsystem.h" +#include "VQwSubsystemParity.h" +#include "QwCombiner.h" +#include "QwSubsystemArrayParity.h" +#include "QwParameterFile.h" + +RegisterSubsystemFactory(QwCombinerSubsystem); + + +QwCombinerSubsystem::~QwCombinerSubsystem() +{ +} + +struct null_deleter { + void operator()(void const *) const { } +}; + +boost::shared_ptr QwCombinerSubsystem::GetSharedPointerToStaticObject(){ + boost::shared_ptr px(this, null_deleter()); + return px; +} + +VQwSubsystem& QwCombinerSubsystem::operator=(VQwSubsystem* value) +{ + QwCombinerSubsystem* input= dynamic_cast(value); + if (input!=NULL) { + for(size_t i = 0; i < input->fDependentVar.size(); i++) { + this->fOutputVar.at(i)->AssignValueFrom(input->fOutputVar.at(i)); + } + } + return *this; +} + +VQwSubsystem& QwCombinerSubsystem::operator+=(VQwSubsystem* value) +{ + QwCombinerSubsystem* input = dynamic_cast(value); + if (input!=NULL) { + for(size_t i = 0; i < input->fDependentVar.size(); i++) { + this->fOutputVar.at(i)->AddValueFrom(input->fOutputVar.at(i)); + } + } + return *this; +} + +VQwSubsystem& QwCombinerSubsystem:: operator-=(VQwSubsystem* value) +{ + QwCombinerSubsystem* input = dynamic_cast(value); + if (input!=NULL) { + for(size_t i = 0; ifDependentVar.size(); i++) { + this->fOutputVar.at(i)->SubtractValueFrom(input->fOutputVar.at(i)); + } + } + return *this; +} + +VQwSubsystem& QwCombinerSubsystem:: operator*=(VQwSubsystem* value) +{ + QwCombinerSubsystem* input = dynamic_cast(value); + if (input!=NULL) { + for(size_t i = 0; ifDependentVar.size(); i++) { + this->fOutputVar.at(i)->MultiplyBy(input->fOutputVar.at(i)); + } + } + return *this; +} + +VQwSubsystem& QwCombinerSubsystem:: operator/=(VQwSubsystem* value) +{ + QwCombinerSubsystem* input = dynamic_cast(value); + if (input!=NULL) { + for(size_t i = 0; ifDependentVar.size(); i++) { + this->fOutputVar.at(i)->DivideBy(input->fOutputVar.at(i)); + } + } + return *this; +} + + +void QwCombinerSubsystem::Sum(VQwSubsystem* value1, VQwSubsystem* value2) +{ + *this = value1; + *this += value2; +} + + +void QwCombinerSubsystem::Difference(VQwSubsystem* value1, VQwSubsystem* value2) +{ + *this = value1; + *this -= value2; +} + + +void QwCombinerSubsystem::Ratio(VQwSubsystem* value1, VQwSubsystem* value2) +{ + *this = value1; + *this /= value2; +} + + +void QwCombinerSubsystem::Scale(Double_t value) +{ + for(size_t i = 0; i < this->fDependentVar.size(); i++) + { + this->fOutputVar.at(i)->Scale(value); + } + +}; + +void QwCombinerSubsystem::AccumulateRunningSum(VQwSubsystem* input) +{ + QwCombinerSubsystem* value = dynamic_cast (input); + if (value!=NULL){ + QwCombiner::AccumulateRunningSum(*value); + } +} + +void QwCombinerSubsystem::DeaccumulateRunningSum(VQwSubsystem* input) +{ + QwCombinerSubsystem* value = dynamic_cast (input); + if (value!=NULL) { + for (size_t i = 0; i < value-> fDependentVar.size(); i++) { + fOutputVar.at(i)->DeaccumulateRunningSum(value->fOutputVar.at(i)); + } + } +} + +void QwCombinerSubsystem::CalculateRunningAverage() +{ + QwCombiner::CalculateRunningAverage(); +} + +void QwCombinerSubsystem:: PrintValue() const{ + QwCombiner::PrintValue(); +} + + +void QwCombinerSubsystem::ConstructHistograms(TDirectory *folder, TString &prefix) +{ + for (size_t i = 0; i < fDependentVar.size(); i++){ + fOutputVar.at(i)->ConstructHistograms(folder,prefix); + } +}; + +void QwCombinerSubsystem::FillHistograms() +{ + for (size_t i = 0; i < fDependentVar.size(); i++){ + fOutputVar.at(i)->FillHistograms(); + } +}; + +void QwCombinerSubsystem::DeleteHistograms() +{ + for (size_t i = 0; i < fDependentVar.size(); i++){ + // fOutputVar.at(i)->DeleteHistograms(); + } +}; + +void QwCombinerSubsystem::ConstructBranch(TTree *tree, TString & prefix) +{ + for (size_t i = 0; i < fDependentVar.size(); i++){ + fOutputVar.at(i)->ConstructBranch(tree, prefix); + } +}; + +void QwCombinerSubsystem::ConstructBranch(TTree *tree, TString & prefix, QwParameterFile& trim_file) +{ + TString tmp; + QwParameterFile* nextmodule; + trim_file.RewindToFileStart(); + tmp="Regression"; + trim_file.RewindToFileStart(); + if (trim_file.FileHasModuleHeader(tmp)){ + nextmodule=trim_file.ReadUntilNextModule();//This section contains sub modules and or channels to be included in the tree + for (size_t i = 0; i < fDependentVar.size(); i++){ + fOutputVar.at(i)->ConstructBranch(tree, prefix, *nextmodule); + } + } +}; + + +void QwCombinerSubsystem::IncrementErrorCounters() +{ + /// TODO: Write QwCombinerSubsystem::IncrementErrorCounters +} + +void QwCombinerSubsystem::UpdateErrorFlag(const VQwSubsystem *ev_error){ + /// TODO: Write QwCombinerSubsystem::UpdateErrorFlag + //if (Compare(ev_error)){ + //QwCombinerSubsystem* input = dynamic_cast (ev_error); + //} +}; + + +/// DERIVED FUNCTIONS /// + + +/* All of the functions below are using generic + * returns for testing purposes. + */ + + + +Int_t QwCombinerSubsystem::LoadChannelMap(TString) +{ + Int_t sample = 0; + return sample; +} + + +Int_t QwCombinerSubsystem::LoadInputParameters(TString) +{ + Int_t sample = 0; + return sample; +} + + +Int_t QwCombinerSubsystem::LoadEventCuts(TString) +{ + Int_t sample = 0; + return sample; + +} + +Int_t QwCombinerSubsystem::ProcessConfigurationBuffer(UInt_t, UInt_t, UInt_t*, UInt_t) +{ + Int_t sample = 0; + return sample; +} + + +Int_t QwCombinerSubsystem::ProcessEvBuffer(UInt_t, UInt_t, UInt_t*, UInt_t) +{ + Int_t sample = 0; + return sample; +} + + +Bool_t QwCombinerSubsystem::ApplySingleEventCuts() +{ + return true; +} + +void QwCombinerSubsystem::PrintErrorCounters() const +{ +} + +UInt_t QwCombinerSubsystem::GetEventcutErrorFlag() +{ + return 0; + +} + + + + diff --git a/Parity/src/QwCorrelator.cc b/Parity/src/QwCorrelator.cc new file mode 100644 index 000000000..c1a13c3a7 --- /dev/null +++ b/Parity/src/QwCorrelator.cc @@ -0,0 +1,308 @@ +/******************************************************************** +File Name: QwCorrelator.cc + +Created by: Michael Vallee +Email: mv836315@ohio.edu + +Description: This is the implementation file of the QwCorrelator + class, which is a child of the VQwDataHandler class. + The functionality of this class is derived from + LinRegBlue. + +Last Modified: August 1, 2018 1:43 PM +********************************************************************/ + +#include +using namespace std; + +#include "QwHelicityPattern.h" + +#include "QwCorrelator.h" + +// Qweak headers +#include "VQwDataElement.h" +#include "QwVQWK_Channel.h" +#include "QwParameterFile.h" +#define MYSQLPP_SSQLS_NO_STATICS +#ifdef __USE_DATABASE__ +#include "QwParitySSQLS.h" +#include "QwParityDB.h" +#endif // __USE_DATABASE__ + + +//****************************************************************************************************************************************************** + +QwCorrelator::QwCorrelator(QwOptions &options, QwHelicityPattern& helicitypattern, const TString &run): corA("input") { + + run_label = run; + ParseSeparator = "_"; + fEnableCorrelation = false; + ProcessOptions(options); + init("blueReg.conf"); + corA.SetDisableHistogramFlag(fDisableHistos); + QwSubsystemArrayParity& asym = helicitypattern.fAsymmetry; + QwSubsystemArrayParity& diff = helicitypattern.fDifference; + ConnectChannels(asym, diff); + + if (fEnableCorrelation == true) { + + vector fIndependentName_t; + vector fDependentName_t; + + for (int i = 0; i < fIndependentName.size(); ++i) { + fIndependentName_t.push_back(TString(fIndependentName.at(i))); + } + for (int i = 0; i < fDependentName.size(); ++i) { + fDependentName_t.push_back(TString(fDependentName.at(i))); + } + + corA.init(fIndependentName_t, fDependentName_t); + + } + +} + +void QwCorrelator::init(const std::string configFName) { + + LoadChannelMap(configFName); + +} + + +void QwCorrelator::FillCorrelator() { + + if (! fEnableCorrelation) return; + + UInt_t error; + + for (Int_t i = 0; i < fDependentVar.size(); ++i) { + error |= fDependentVar.at(i)->GetErrorCode(); + fDependentValues.at(i) = (fDependentVar[i]->GetValue()); + //QwMessage << "Loading DV " << fDependentVar.at(i) << " into fDependentValues." << QwLog::endl; + } + for (Int_t i = 0; i < fIndependentVar.size(); ++i) { + error |= fIndependentVar.at(i)->GetErrorCode(); + fIndependentValues.at(i) = (fIndependentVar[i]->GetValue()); + //QwMessage << "Loading IV " << fIndependentVar.at(i) << " into fIndependentValues." << QwLog::endl; + } + + //QwMessage << "fDependentVar has a size of: " << fDependentVar.size() << QwLog::endl; + //QwMessage << "fIndependentVar has a size of: " << fIndependentVar.size() << QwLog::endl; + + if (error == 0) { + corA.addEvent(&fIndependentValues[0],&fDependentValues[0]); + } + +} + + +void QwCorrelator::CalcCorrelations() { + + if (! fEnableCorrelation) return; + + corA.finish(); + + std::string TmpRunLabel = run_label.Data(); + std::string fSlopeFileName = "blueR" + TmpRunLabel + "new.slope.root"; + std::string fSlopeFilePath = fAlphaOutputPath + "/"; + std::string tmp = fSlopeFilePath + fSlopeFileName; + + TString outAlphas=Form(tmp.c_str()); + corA.exportAlphas(outAlphas, fIndependentFull, fDependentFull); + corA.exportAlias(fAliasOutputPath, "/regalias_"+run_label, fIndependentFull, fDependentFull); + +} + + +//****************************************************************************************************************************************************** + + +void QwCorrelator::DefineOptions(QwOptions &options) { + + options.AddOptions("Correlator") + ("enable-correlator", po::value()->zero_tokens()->default_value(false), + "enables correlator"); + options.AddOptions("Correlator") + ("correlator-map", po::value()->default_value("regression.map"), + "variables and sensitivities for regression"); + + options.AddOptions("Correlator") + ("slope-file-path", po::value()->default_value("."), + "Path for the slop files, also used for lrb (alpha)"); + options.AddOptions("Correlator") + ("alias-output-path", po::value()->default_value("."), + "Path for the final correlation output file (alias)"); + +} + + +void QwCorrelator::ProcessOptions(QwOptions &options) { + + fEnableCorrelation = options.GetValue("enable-correlator"); + fCorrelatorMapFile = options.GetValue("correlator-map"); + + fAlphaOutputPath = options.GetValue("slope-file-path"); + fAliasOutputPath = options.GetValue("alias-output-path"); + + fDisableHistos = options.GetValue("disable-histos"); + +} + + +/** Load the channel map + * + * @param mapfile Filename of map file + * @return Zero when success + */ +Int_t QwCorrelator::LoadChannelMap(const std::string& mapfile) +{ + // Return if regression is not enabled + if (! fEnableCorrelation) return 0; + + // Open the file + QwParameterFile map(mapfile); + + // Read the sections of dependent variables + std::pair type_name; + + // Add independent variables and sensitivities + while (map.ReadNextLine()) { + // Throw away comments, whitespace, empty lines + map.TrimComment(); + map.TrimWhitespace(); + if (map.LineIsEmpty()) continue; + // Get first token: label (dv or iv), second token is the name like "asym_blah" + string primary_token = map.GetNextToken(" "); + string current_token = map.GetNextToken(" "); + // Parse current token into independent variable type and name + type_name = ParseRegressionVariable(current_token); + + if (primary_token == "iv") { + fIndependentType.push_back(type_name.first); + fIndependentName.push_back(type_name.second); + fIndependentFull.push_back(current_token); + //QwMessage << "IV Type: " << type_name.first << QwLog::endl; + //QwMessage << "IV Name: " << type_name.second << QwLog::endl; + } + else if (primary_token == "dv") { + fDependentType.push_back(type_name.first); + fDependentName.push_back(type_name.second); + fDependentFull.push_back(current_token); + //QwMessage << "DV Type: " << type_name.first << QwLog::endl; + //QwMessage << "DV Name: " << type_name.second << QwLog::endl; + } + else if (primary_token == "treetype") { + QwMessage << "Tree Type read, ignoring." << QwLog::endl; + } + else { + QwError << "Function LoadChannelMap in QwCorrelator.cc read in invalid primary_token." << QwLog::endl; + } + } + + //QwMessage << "fIndependentType has a size of: " << fIndependentType.size() << QwLog::endl; + //QwMessage << "fIndependentName has a size of: " << fIndependentName.size() << QwLog::endl; + //QwMessage << "fDependentType has a size of: " << fDependentType.size() << QwLog::endl; + //QwMessage << "fDependentName has a size of: " << fDependentName.size() << QwLog::endl; + +} + + +Int_t QwCorrelator::ConnectChannels(QwSubsystemArrayParity& asym, QwSubsystemArrayParity& diff) { + + // Return if regression is not enabled + if (! fEnableCorrelation) return 0; + + /// Fill vector of pointers to the relevant data elements + for (size_t dv = 0; dv < fDependentName.size(); dv++) { + // Get the dependent variables + + VQwHardwareChannel* dv_ptr = 0; + QwVQWK_Channel* new_vqwk = NULL; + QwVQWK_Channel* vqwk = NULL; + string name = ""; + string reg = "reg_"; + + if (fDependentType.at(dv)==kRegTypeMps){ + // Quietly ignore the MPS type when we're connecting the asym & diff + continue; + } else if(fDependentName.at(dv).at(0) == '@' ){ + name = fDependentName.at(dv).substr(1,fDependentName.at(dv).length()); + }else{ + switch (fDependentType.at(dv)) { + case kRegTypeAsym: + dv_ptr = asym.ReturnInternalValueForFriends(fDependentName.at(dv)); + break; + case kRegTypeDiff: + dv_ptr = diff.ReturnInternalValueForFriends(fDependentName.at(dv)); + break; + default: + QwWarning << "QwCombiner::ConnectChannels(QwSubsystemArrayParity& asym, QwSubsystemArrayParity& diff): Dependent variable, " + << fDependentName.at(dv) + << ", for asym/diff regression does not have proper type, type==" + << fDependentType.at(dv) << "."<< QwLog::endl; + break; + } + + vqwk = dynamic_cast(dv_ptr); + name = vqwk->GetElementName().Data(); + name.insert(0, reg); + new_vqwk = new QwVQWK_Channel(*vqwk, VQwDataElement::kDerived); + new_vqwk->SetElementName(name); + } + + // alias + if(fDependentName.at(dv).at(0) == '@'){ + //QwMessage << "dv: " << name << QwLog::endl; + new_vqwk = new QwVQWK_Channel(name, VQwDataElement::kDerived); + } + // defined type + else if(dv_ptr!=NULL){ + //QwMessage << "dv: " << fDependentName.at(dv) << QwLog::endl; + }else { + QwWarning << "Dependent variable " << fDependentName.at(dv) << " could not be found, " + << "or is not a VQWK channel." << QwLog::endl; + continue; + } + + // pair creation + if(vqwk != NULL){ + // fDependentVarType.push_back(fDependentType.at(dv)); + fDependentVar.push_back(vqwk); + } + + } + + // Add independent variables + // fIndependentVar.resize(fDependentVar.size()); + for (size_t iv = 0; iv < fIndependentName.size(); iv++) { + // Get the independent variables + const VQwHardwareChannel* iv_ptr = 0; + switch (fIndependentType.at(iv)) { + case kRegTypeAsym: + iv_ptr = asym.ReturnInternalValue(fIndependentName.at(iv)); + break; + case kRegTypeDiff: + iv_ptr = diff.ReturnInternalValue(fIndependentName.at(iv)); + break; + default: + QwWarning << "Independent variable for regression has unknown type." + << QwLog::endl; + break; + } + if (iv_ptr) { + //QwMessage << " iv: " << fIndependentName.at(iv) << QwLog::endl; + fIndependentVar.push_back(iv_ptr); + } else { + QwWarning << "Independent variable " << fIndependentName.at(iv) << " for regression of could not be found." + << QwLog::endl; + } + + } + fIndependentValues.resize(fIndependentVar.size()); + fDependentValues.resize(fDependentVar.size()); + return 0; + +} + + + diff --git a/Parity/src/MollerMainDetector.cc b/Parity/src/QwDetectorArray.cc similarity index 83% rename from Parity/src/MollerMainDetector.cc rename to Parity/src/QwDetectorArray.cc index d7fe7dc79..a8a8ac243 100755 --- a/Parity/src/MollerMainDetector.cc +++ b/Parity/src/QwDetectorArray.cc @@ -1,11 +1,11 @@ /**********************************************************\ -* File: MollerMainDetector.cc * +* File: QwDetectorArray.cc * * * * Author: P. M. King * * Time-stamp: <2007-05-08 15:40> * \**********************************************************/ -#include "MollerMainDetector.h" +#include "QwDetectorArray.h" // System headers #include @@ -21,7 +21,7 @@ #include "QwPromptSummary.h" // Register this subsystem with the factory -RegisterSubsystemFactory(MollerMainDetector); +RegisterSubsystemFactory(QwDetectorArray); /** * Defines configuration options for QwEventBuffer class using QwOptions @@ -29,10 +29,10 @@ RegisterSubsystemFactory(MollerMainDetector); * * @param options Options object */ -void MollerMainDetector::DefineOptions(QwOptions &options){ +void QwDetectorArray::DefineOptions(QwOptions &options){ // Define the execution options options.AddOptions() - ("MollerMainDetector.normalize", + ("QwDetectorArray.normalize", po::value()->default_bool_value(true), "Normalize the detectors by beam current"); } @@ -40,14 +40,14 @@ void MollerMainDetector::DefineOptions(QwOptions &options){ /*! * Loads the configuration options into this instance of - * MollerMainDetector from the QwOptions object. + * QwDetectorArray from the QwOptions object. * * @param options Options object */ -void MollerMainDetector::ProcessOptions(QwOptions &options){ - bNormalization = options.GetValue("MollerMainDetector.normalize"); +void QwDetectorArray::ProcessOptions(QwOptions &options){ + bNormalization = options.GetValue("QwDetectorArray.normalize"); if (! bNormalization){ - QwWarning << "MollerMainDetector::ProcessOptions: " + QwWarning << "QwDetectorArray::ProcessOptions: " << "Detector yields WILL NOT be normalized." << QwLog::endl; } @@ -59,7 +59,7 @@ void MollerMainDetector::ProcessOptions(QwOptions &options){ * Publish internal values * @return */ -Bool_t MollerMainDetector::PublishInternalValues() const +Bool_t QwDetectorArray::PublishInternalValues() const { // Publish variables Bool_t status = kTRUE; @@ -136,8 +136,34 @@ Bool_t MollerMainDetector::PublishInternalValues() const } +Bool_t QwDetectorArray::PublishByRequest(TString device_name) +{ + Bool_t status = kFALSE; + //std::cerr << "##### device_name==\"" << device_name << "\"" << std::endl; + + for(size_t i=0;i();//global/local varvalue.ToLower(); Double_t stabilitycut = mapstr.GetTypedNextToken(); - QwMessage << "MollerMainDetector Error Code passing to QwIntegrationPMT " << GetGlobalErrorFlag(varvalue,eventcut_flag,stabilitycut) << QwLog::endl; + QwMessage << "QwDetectorArray Error Code passing to QwIntegrationPMT " << GetGlobalErrorFlag(varvalue,eventcut_flag,stabilitycut) << QwLog::endl; //std::cout<<"*****************************"<();//global/local varvalue.ToLower(); Double_t stabilitycut = mapstr.GetTypedNextToken(); - QwMessage << "MollerMainDetector Error Code passing to QwCombinedPMT " << GetGlobalErrorFlag(varvalue,eventcut_flag,stabilitycut) << QwLog::endl; + QwMessage << "QwDetectorArray Error Code passing to QwCombinedPMT " << GetGlobalErrorFlag(varvalue,eventcut_flag,stabilitycut) << QwLog::endl; //std::cout<<"*****************************"< &buffer) +void QwDetectorArray::EncodeEventData(std::vector &buffer) { std::vector elements; elements.clear(); @@ -696,7 +722,7 @@ void MollerMainDetector::EncodeEventData(std::vector &buffer) } } -void MollerMainDetector::RandomizeMollerEvent(int helicity /*, const QwBeamCharge& charge, const QwBeamPosition& xpos, const QwBeamPosition& ypos, const QwBeamAngle& xprime, const QwBeamAngle& yprime, const QwBeamEnergy& energy*/) +void QwDetectorArray::RandomizeMollerEvent(int helicity /*, const QwBeamCharge& charge, const QwBeamPosition& xpos, const QwBeamPosition& ypos, const QwBeamAngle& xprime, const QwBeamAngle& yprime, const QwBeamEnergy& energy*/) { /* fTargetCharge.PrintInfo(); fTargetX.PrintInfo(); @@ -713,7 +739,7 @@ void MollerMainDetector::RandomizeMollerEvent(int helicity /*, const QwBeamChar } -Int_t MollerMainDetector::ProcessConfigurationBuffer(const UInt_t roc_id, const UInt_t bank_id, UInt_t* buffer, UInt_t num_words) +Int_t QwDetectorArray::ProcessConfigurationBuffer(const UInt_t roc_id, const UInt_t bank_id, UInt_t* buffer, UInt_t num_words) { /* Int_t index = GetSubbankIndex(roc_id,bank_id); @@ -729,7 +755,7 @@ Int_t MollerMainDetector::ProcessConfigurationBuffer(const UInt_t roc_id, const } -Int_t MollerMainDetector::ProcessEvBuffer(const UInt_t roc_id, const UInt_t bank_id, UInt_t* buffer, UInt_t num_words) +Int_t QwDetectorArray::ProcessEvBuffer(const UInt_t roc_id, const UInt_t bank_id, UInt_t* buffer, UInt_t num_words) { Bool_t lkDEBUG=kFALSE; @@ -739,7 +765,7 @@ Int_t MollerMainDetector::ProcessEvBuffer(const UInt_t roc_id, const UInt_t bank { // We want to process this ROC. Begin looping through the data. if (lkDEBUG) - std::cout << "MollerMainDetector::ProcessEvBuffer: " + std::cout << "QwDetectorArray::ProcessEvBuffer: " << "Begin processing ROC" << roc_id << " and subbank "<IntegrationPMT[ "<IntegrationPMT[ "<CombinedPMT[ "<CombinedPMT[ "<(ev_error); if(Compare(tmp)){ - const MollerMainDetector* input = dynamic_cast (ev_error); + const QwDetectorArray* input = dynamic_cast (ev_error); for (size_t i=0;ifIntegrationPMT.size();i++) this->fIntegrationPMT[i].UpdateErrorFlag(&(input->fIntegrationPMT[i])); @@ -843,7 +869,7 @@ void MollerMainDetector::UpdateErrorFlag(const VQwSubsystem *ev_error){ }; -void MollerMainDetector::ProcessEvent() +void QwDetectorArray::ProcessEvent() { for (size_t i=0;i::iterator variable_iter; for (variable_iter = variable_list.begin(); variable_iter != variable_list.end(); variable_iter++){ VQwDataElement* variable = *variable_iter; - //QwWarning << "MollerMainDetector::ExchangeProcessedData for loop "<GetElementName()<< QwLog::endl; + //QwWarning << "QwDetectorArray::ExchangeProcessedData for loop "<GetElementName()<< QwLog::endl; if (RequestExternalValue(variable->GetElementName(), variable)) { if (bDEBUG) dynamic_cast(variable)->PrintInfo(); - //QwWarning << "MollerMainDetector::ExchangeProcessedData Found "<GetElementName()<< QwLog::endl; + //QwWarning << "QwDetectorArray::ExchangeProcessedData Found "<GetElementName()<< QwLog::endl; } else { @@ -907,8 +933,8 @@ void MollerMainDetector::ExchangeProcessedData() if(RequestExternalValue("q_targ", &fTargetCharge)){ if (bDEBUG){ - QwWarning << "MollerMainDetector::ExchangeProcessedData Found "<(&fTargetCharge))->PrintInfo(); } } @@ -921,7 +947,7 @@ void MollerMainDetector::ExchangeProcessedData() if(RequestExternalValue("x_targ", &fTargetX)){ if (bDEBUG){ dynamic_cast(&fTargetX)->PrintInfo(); - QwWarning << "MollerMainDetector::ExchangeProcessedData Found "<(&fTargetY)->PrintInfo(); - QwWarning << "MollerMainDetector::ExchangeProcessedData Found "<(&fTargetXprime)->PrintInfo(); - QwWarning << "MollerMainDetector::ExchangeProcessedData Found "<(&fTargetYprime)->PrintInfo(); - QwWarning << "MollerMainDetector::ExchangeProcessedData Found "<(&fTargetEnergy)->PrintInfo(); - QwWarning << "MollerMainDetector::ExchangeProcessedData Found "< &values) +void QwDetectorArray::ConstructBranchAndVector(TTree *tree, TString & prefix, std::vector &values) { for (size_t i=0;i &values) const +void QwDetectorArray::FillTreeVector(std::vector &values) const { for (size_t i=0;i &values) const } -const QwIntegrationPMT* MollerMainDetector::GetChannel(const TString name) const +const QwIntegrationPMT* QwDetectorArray::GetChannel(const TString name) const { return GetIntegrationPMT(name); } -Bool_t MollerMainDetector::Compare(VQwSubsystem *value) +Bool_t QwDetectorArray::Compare(VQwSubsystem *value) { // std::cout<<" Here in QwLumi::Compare \n"; @@ -1108,7 +1134,7 @@ Bool_t MollerMainDetector::Compare(VQwSubsystem *value) } else { - MollerMainDetector* input = dynamic_cast(value); + QwDetectorArray* input = dynamic_cast(value); if (input->fIntegrationPMT.size()!=fIntegrationPMT.size() || input->fCombinedPMT.size()!=fCombinedPMT.size() ) { @@ -1120,13 +1146,13 @@ Bool_t MollerMainDetector::Compare(VQwSubsystem *value) } -VQwSubsystem& MollerMainDetector::operator= (VQwSubsystem *value) +VQwSubsystem& QwDetectorArray::operator= (VQwSubsystem *value) { - // std::cout<<" here in MollerMainDetector::operator= \n"; + // std::cout<<" here in QwDetectorArray::operator= \n"; if (Compare(value)) { // VQwSubsystem::operator=(value); - MollerMainDetector* input = dynamic_cast (value); + QwDetectorArray* input = dynamic_cast (value); for (size_t i=0;ifIntegrationPMT.size();i++) this->fIntegrationPMT[i]=input->fIntegrationPMT[i]; @@ -1138,11 +1164,11 @@ VQwSubsystem& MollerMainDetector::operator= (VQwSubsystem *value) } -VQwSubsystem& MollerMainDetector::operator+= (VQwSubsystem *value) +VQwSubsystem& QwDetectorArray::operator+= (VQwSubsystem *value) { if (Compare(value)) { - MollerMainDetector* input= dynamic_cast(value) ; + QwDetectorArray* input= dynamic_cast(value) ; for (size_t i=0;ifIntegrationPMT.size();i++) this->fIntegrationPMT[i]+=input->fIntegrationPMT[i]; @@ -1155,12 +1181,12 @@ VQwSubsystem& MollerMainDetector::operator+= (VQwSubsystem *value) } -VQwSubsystem& MollerMainDetector::operator-= (VQwSubsystem *value) +VQwSubsystem& QwDetectorArray::operator-= (VQwSubsystem *value) { if (Compare(value)) { - MollerMainDetector* input= dynamic_cast(value); + QwDetectorArray* input= dynamic_cast(value); for (size_t i=0;ifIntegrationPMT.size();i++) this->fIntegrationPMT[i]-=input->fIntegrationPMT[i]; @@ -1174,7 +1200,7 @@ VQwSubsystem& MollerMainDetector::operator-= (VQwSubsystem *value) -void MollerMainDetector::Sum(VQwSubsystem *value1,VQwSubsystem *value2) +void QwDetectorArray::Sum(VQwSubsystem *value1,VQwSubsystem *value2) { if (Compare(value1)&&Compare(value2)) { @@ -1183,7 +1209,7 @@ void MollerMainDetector::Sum(VQwSubsystem *value1,VQwSubsystem *value2) } } -void MollerMainDetector::Difference(VQwSubsystem *value1,VQwSubsystem *value2) +void QwDetectorArray::Difference(VQwSubsystem *value1,VQwSubsystem *value2) { if (Compare(value1)&&Compare(value2)) { @@ -1192,12 +1218,12 @@ void MollerMainDetector::Difference(VQwSubsystem *value1,VQwSubsystem *value2) } } -void MollerMainDetector::Ratio(VQwSubsystem *numer, VQwSubsystem *denom) +void QwDetectorArray::Ratio(VQwSubsystem *numer, VQwSubsystem *denom) { if (Compare(numer)&&Compare(denom)) { - MollerMainDetector* innumer= dynamic_cast(numer) ; - MollerMainDetector* indenom= dynamic_cast(denom) ; + QwDetectorArray* innumer= dynamic_cast(numer) ; + QwDetectorArray* indenom= dynamic_cast(denom) ; for (size_t i=0;ifIntegrationPMT.size();i++) this->fIntegrationPMT[i].Ratio(innumer->fIntegrationPMT[i],indenom->fIntegrationPMT[i]); @@ -1210,7 +1236,7 @@ void MollerMainDetector::Ratio(VQwSubsystem *numer, VQwSubsystem *denom) } -void MollerMainDetector::Scale(Double_t factor) +void QwDetectorArray::Scale(Double_t factor) { for (size_t i=0;i(value1); + QwDetectorArray* value = dynamic_cast(value1); for (size_t i = 0; i < fIntegrationPMT.size(); i++) fIntegrationPMT[i].AccumulateRunningSum(value->fIntegrationPMT[i]); @@ -1255,9 +1281,9 @@ void MollerMainDetector::AccumulateRunningSum(VQwSubsystem* value1) } } -void MollerMainDetector::DeaccumulateRunningSum(VQwSubsystem* value1){ +void QwDetectorArray::DeaccumulateRunningSum(VQwSubsystem* value1){ if (Compare(value1)) { - MollerMainDetector* value = dynamic_cast(value1); + QwDetectorArray* value = dynamic_cast(value1); for (size_t i = 0; i < fIntegrationPMT.size(); i++) fIntegrationPMT[i].DeaccumulateRunningSum(value->fIntegrationPMT[i]); @@ -1267,52 +1293,18 @@ void MollerMainDetector::DeaccumulateRunningSum(VQwSubsystem* value1){ }; -/** - * Blind the asymmetry - * @param blinder Blinder - */ -void MollerMainDetector::Blind(const QwBlinder *blinder) -{ - for (size_t i = 0; i < fIntegrationPMT.size(); i++) - fIntegrationPMT[i].Blind(blinder); - for (size_t i = 0; i < fCombinedPMT.size(); i++) - fCombinedPMT[i].Blind(blinder); -} - -/** - * Blind the difference using the yield - * @param blinder Blinder - * @param subsys Subsystem - */ -void MollerMainDetector::Blind(const QwBlinder *blinder, const VQwSubsystemParity* subsys) -{ - /// \todo TODO (wdc) At some point we should introduce const-correctness in - /// the Compare() routine to ensure nothing funny happens. This const_casting - /// is just an ugly stop-gap measure. - if (Compare(const_cast(subsys))) { - - const MollerMainDetector* yield = dynamic_cast(subsys); - if (yield == 0) return; - - for (size_t i = 0; i < fIntegrationPMT.size(); i++) - fIntegrationPMT[i].Blind(blinder, yield->fIntegrationPMT[i]); - for (size_t i = 0; i < fCombinedPMT.size(); i++) - fCombinedPMT[i].Blind(blinder, yield->fCombinedPMT[i]); - } -} - -EQwPMTInstrumentType MollerMainDetector::GetDetectorTypeID(TString name) +EQwPMTInstrumentType QwDetectorArray::GetDetectorTypeID(TString name) { return GetQwPMTInstrumentType(name); } //*****************************************************************// -Int_t MollerMainDetector::GetDetectorIndex(EQwPMTInstrumentType type_id, TString name) +Int_t QwDetectorArray::GetDetectorIndex(EQwPMTInstrumentType type_id, TString name) { Bool_t ldebug=kFALSE; if (ldebug) { - std::cout<<"MollerMainDetector::GetDetectorIndex\n"; + std::cout<<"QwDetectorArray::GetDetectorIndex\n"; std::cout<<"type_id=="<Disconnect(); return; } #endif -void MollerMainDetector::PrintValue() const +void QwDetectorArray::PrintValue() const { - QwMessage << "=== MollerMainDetector: " << GetSubsystemName() << " ===" << QwLog::endl; + QwMessage << "=== QwDetectorArray: " << GetSubsystemName() << " ===" << QwLog::endl; for (size_t i = 0; i < fIntegrationPMT.size(); i++) fIntegrationPMT[i].PrintValue(); for (size_t i = 0; i < fCombinedPMT.size(); i++) fCombinedPMT[i].PrintValue(); } -void MollerMainDetector::PrintInfo() const +void QwDetectorArray::PrintInfo() const { std::cout<<"Name of the subsystem ="<Disconnect(); @@ -1561,13 +1553,13 @@ void MollerMainDetector::FillErrDB(QwParityDB *db, TString datatype) #endif -void MollerMainDetector::WritePromptSummary(QwPromptSummary *ps, TString type) +void QwDetectorArray::WritePromptSummary(QwPromptSummary *ps, TString type) { Bool_t local_print_flag = true; if(local_print_flag){ QwMessage << " --------------------------------------------------------------- " << QwLog::endl; - QwMessage << " MollerMainDetectorID::WritePromptSummary() " << QwLog::endl; + QwMessage << " QwDetectorArrayID::WritePromptSummary() " << QwLog::endl; QwMessage << " --------------------------------------------------------------- " << QwLog::endl; } @@ -1578,7 +1570,7 @@ void MollerMainDetector::WritePromptSummary(QwPromptSummary *ps, TString type) -void MollerMainDetectorID::Print() const +void QwDetectorArrayID::Print() const { std::cout< subsys_helicity = event.GetSubsystemByType("QwHelicity"); @@ -835,7 +839,7 @@ void QwHelicityPattern::FillErrDB(QwParityDB *db) fAsymmetry.FillErrDB(db, ""); return; }; -#endif +#endif // __USE_DATABASE__ void QwHelicityPattern::WritePromptSummary(QwPromptSummary *ps) { @@ -856,3 +860,25 @@ void QwHelicityPattern::Print() const << fEventLoaded[i] << ", " << fHelicity[i] << QwLog::endl; QwOut << "Is a complete pattern? (n/y:0/1) " << IsCompletePattern() << QwLog::endl; } + +void QwHelicityPattern::ProcessDataHandlerEntry() { + + regression.LinearRegression(QwCombiner::kRegTypeAsym); + running_regression.AccumulateRunningSum(regression); + regress_from_LRB.LinearRegression(QwCombiner::kRegTypeAsym); + correlator.FillCorrelator(); + +} + +void QwHelicityPattern::FinishDataHandler() { + + correlator.CalcCorrelations(); + running_regression.CalculateRunningAverage(); + running_regression.PrintValue(); + +} + + + + + diff --git a/Parity/src/QwIntegratedRaster.cc b/Parity/src/QwIntegratedRaster.cc index d21448b99..99f9db8a3 100755 --- a/Parity/src/QwIntegratedRaster.cc +++ b/Parity/src/QwIntegratedRaster.cc @@ -14,8 +14,10 @@ // Qweak headers #include "QwSubsystemArray.h" #define MYSQLPP_SSQLS_NO_STATICS +#ifdef __USE_DATABASE__ #include "QwParitySSQLS.h" #include "QwParityDB.h" +#endif // __USE_DATABASE__ #include "QwVQWK_Channel.h" // Register this subsystem with the factory @@ -735,6 +737,7 @@ void QwIntegratedRaster::AccumulateRunningSum(VQwSubsystem* value1) //***************************************************************** +#ifdef __USE_DATABASE__ void QwIntegratedRaster::FillDB(QwParityDB *db, TString datatype) { @@ -844,6 +847,7 @@ void QwIntegratedRaster::FillErrDB(QwParityDB *db, TString datatype) return; }; +#endif // __USE_DATABASE__ void QwIntegratedRaster::WritePromptSummary(QwPromptSummary *ps, TString type) { diff --git a/Parity/src/QwLumi.cc b/Parity/src/QwLumi.cc deleted file mode 100755 index 36a61b443..000000000 --- a/Parity/src/QwLumi.cc +++ /dev/null @@ -1,1402 +0,0 @@ -/**********************************************************\ - * File: QwLumi.C * - * * - * Author: * - * Time-stamp: * -\**********************************************************/ - -#include "QwLumi.h" - -// System headers -#include -#include - -// Qweak headers -#include "QwSubsystemArray.h" -#ifdef __USE_DATABASE__ -//#define MYSQLPP_SSQLS_NO_STATICS -#include "QwParitySSQLS.h" -#include "QwParityDB.h" -#endif -#include "QwPromptSummary.h" - -// Register this subsystem with the factory -RegisterSubsystemFactory(QwLumi); - -void QwLumi::DefineOptions(QwOptions &options) -{ - options.AddOptions() - ("QwLumi.normalize", - po::value()->default_bool_value(true), - "Normalize the detectors by beam current"); -} - - -//***************************************************************** -void QwLumi::ProcessOptions(QwOptions &options) -{ - bNormalization = options.GetValue("QwLumi.normalize"); - if (! bNormalization){ - QwWarning << "QwLumi::ProcessOptions: " - << "Detector yields WILL NOT be normalized." - << QwLog::endl; - } -} - -//***************************************************************** -Int_t QwLumi::LoadChannelMap(TString mapfile) -{ - Bool_t ldebug=kFALSE; - - TString varname, varvalue; - TString modtype, dettype, namech, nameofcombinedchan, keyword, keyword2; - Int_t modnum = 0; - Int_t channum = 0; - Int_t combinedchans = 0; - std::vector combinedchannelnames; - std::vector weight; - Int_t currentrocread=0; - Int_t currentbankread=0; - Int_t offset = -1; - Int_t currentsubbankindex=-1; - Int_t fSample_size=0; - - QwParameterFile mapstr(mapfile.Data()); //Open the file - fDetectorMaps.insert(mapstr.GetParamFileNameContents()); - while (mapstr.ReadNextLine()) - { - mapstr.TrimComment('!'); // Remove everything after a '!' character. - mapstr.TrimWhitespace(); // Get rid of leading and trailing spaces. - if (mapstr.LineIsEmpty()) continue; - - if (mapstr.HasVariablePair("=",varname,varvalue)) - { - // This is a declaration line. Decode it. - varname.ToLower(); - UInt_t value = QwParameterFile::GetUInt(varvalue); - - if (varname=="roc") - { - currentrocread=value; - RegisterROCNumber(value,0); - } - else if (varname=="bank") - { - currentbankread=value; - RegisterSubbank(value); - } - else if (varname=="sample_size") - { - fSample_size=value; - } - } - else - { - Bool_t lineok=kTRUE; - keyword = ""; - keyword2 = ""; - // Break this line into tokens to process it. - modtype = mapstr.GetTypedNextToken(); // module type - if (modtype == "VQWK" || modtype == "SCALER") - { - modnum = mapstr.GetTypedNextToken(); //slot number - channum = mapstr.GetTypedNextToken(); //channel number - dettype = mapstr.GetTypedNextToken(); //type-purpose of the detector - dettype.ToLower(); - namech = mapstr.GetTypedNextToken(); //name of the detector - namech.ToLower(); - keyword = mapstr.GetTypedNextToken(); - keyword2 = mapstr.GetTypedNextToken(); - keyword.ToLower(); - keyword2.ToLower(); - } - else if (modtype == "VPMT") - { - channum = mapstr.GetTypedNextToken(); //channel number - combinedchans = mapstr.GetTypedNextToken(); //number of combined channels - dettype = mapstr.GetTypedNextToken(); //type-purpose of the detector - dettype.ToLower(); - namech = mapstr.GetTypedNextToken(); //name of the detector - namech.ToLower(); - //TString nameofchannel; - combinedchannelnames.clear(); - for (int i=0; i(); - nameofcombinedchan.ToLower(); - combinedchannelnames.push_back(nameofcombinedchan); - } - weight.clear(); - for (int i=0; i()); - } - keyword = mapstr.GetTypedNextToken(); - keyword2 = mapstr.GetTypedNextToken(); - keyword.ToLower(); - keyword2.ToLower(); - - - - - - - - } - if(currentsubbankindex!=GetSubbankIndex(currentrocread,currentbankread)) - { - currentsubbankindex=GetSubbankIndex(currentrocread,currentbankread); - } - - - - QwLumiDetectorID localLumiDetectorID; - localLumiDetectorID.fdetectorname=namech; - localLumiDetectorID.fmoduletype=modtype; - localLumiDetectorID.fSubbankIndex=currentsubbankindex; - localLumiDetectorID.fdetectortype=dettype; - - - if(modtype=="VQWK") - { - offset = QwVQWK_Channel::GetBufferOffset(modnum, channum); - localLumiDetectorID.fWordInSubbank = offset; - } - else if(modtype=="SCALER") - { - offset = QwSIS3801D24_Channel::GetBufferOffset(modnum, channum); - localLumiDetectorID.fWordInSubbank = offset; - } - else if (modtype=="VPMT") - { - localLumiDetectorID.fCombinedChannelNames = combinedchannelnames; - localLumiDetectorID.fWeight = weight; - //std::cout<<"Add in a combined channel"<(); - device_type.ToLower(); - TString device_name = mapstr.GetTypedNextToken(); - device_name.ToLower(); - - Int_t det_index = GetDetectorIndex(GetDetectorTypeID(device_type),device_name); - if (det_index == -1) { - QwWarning << " Device not found " << device_name << " of type " << device_type << QwLog::endl; - continue; - } - - if (device_type == GetQwPMTInstrumentTypeName(kQwIntegrationPMT)){ - Double_t LLX = mapstr.GetTypedNextToken(); //lower limit for IntegrationPMT value - Double_t ULX = mapstr.GetTypedNextToken(); //upper limit for IntegrationPMT value - varvalue = mapstr.GetTypedNextToken();//global/loacal - Double_t stabilitycut = mapstr.GetTypedNextToken(); - varvalue.ToLower(); - QwMessage << "QwLumi Error Code passing to QwIntegrationPMT " << GetGlobalErrorFlag(varvalue,eventcut_flag,stabilitycut) << QwLog::endl; - - //std::cout<<"*****************************"<(); //lower limit for IntegrationPMT value - Double_t ULX = mapstr.GetTypedNextToken(); //upper limit for IntegrationPMT value - varvalue = mapstr.GetTypedNextToken();//global/loacal - Double_t stabilitycut=mapstr.GetTypedNextToken(); - varvalue.ToLower(); - QwMessage << "QwLumi Error Code passing to QwCombinedPMT " << GetGlobalErrorFlag(varvalue,eventcut_flag,stabilitycut) << QwLog::endl; - - //std::cout<<"*****************************"<(); //name of the channel - varname.ToLower(); - varname.Remove(TString::kBoth,' '); - varped= mapstr.GetTypedNextToken(); // value of the pedestal - varcal= mapstr.GetTypedNextToken(); // value of the calibration factor - if(ldebug) std::cout<<"inputs for channel "< &buffer) -{ - std::vector elements; - elements.clear(); - - // Get all buffers in the order they are defined in the map file - for (size_t i = 0; i < fLumiDetectorID.size(); i++) { - // This is a QwIntegrationPMT - if (fLumiDetectorID.at(i).fTypeID == kQwIntegrationPMT) - fIntegrationPMT[fLumiDetectorID.at(i).fIndex].EncodeEventData(elements); - } - - // If there is element data, generate the subbank header - std::vector subbankheader; - std::vector rocheader; - if (elements.size() > 0) { - - // Form CODA subbank header - subbankheader.clear(); - subbankheader.push_back(elements.size() + 1); // subbank size - subbankheader.push_back((fCurrentBank_ID << 16) | (0x01 << 8) | (1 & 0xff)); - // subbank tag | subbank type | event number - - // Form CODA bank/roc header - rocheader.clear(); - rocheader.push_back(subbankheader.size() + elements.size() + 1); // bank/roc size - rocheader.push_back((fCurrentROC_ID << 16) | (0x10 << 8) | (1 & 0xff)); - // bank tag == ROC | bank type | event number - - // Add bank header, subbank header and element data to output buffer - buffer.insert(buffer.end(), rocheader.begin(), rocheader.end()); - buffer.insert(buffer.end(), subbankheader.begin(), subbankheader.end()); - buffer.insert(buffer.end(), elements.begin(), elements.end()); - } -} - -//***************************************************************** -Int_t QwLumi::ProcessEvBuffer(const UInt_t roc_id, const UInt_t bank_id, UInt_t* buffer, UInt_t num_words) -{ - Bool_t lkDEBUG=kFALSE; - Bool_t firsttime=kTRUE; - Bool_t issingleevent=kTRUE; - - Int_t index = GetSubbankIndex(roc_id,bank_id); - - if (index>=0 && num_words>0){ - // We want to process this ROC. Begin looping through the data. - if (lkDEBUG) - std::cout << "QwLumi::ProcessEvBuffer: " - << "Begin processing ROC" << roc_id - << " and subbank "<IntegrationPMT[ "<CombinedPMT[ "<(ev_error); - if(Compare(tmp)){ - const QwLumi * input = dynamic_cast (ev_error); - - for (size_t i=0;ifIntegrationPMT.size();i++) - (this->fIntegrationPMT[i]).UpdateErrorFlag(&(input->fIntegrationPMT[i])); - - for (size_t i=0;ifCombinedPMT.size();i++) - (this->fCombinedPMT[i]).UpdateErrorFlag(&(input->fCombinedPMT[i])); - } -}; - - -//***************************************************************** -void QwLumi::ProcessEvent() -{ - if (! HasDataLoaded()) return; - - for (size_t i = 0; i < fIntegrationPMT.size(); i++) - fIntegrationPMT[i].ProcessEvent(); - for (size_t i = 0; i < fCombinedPMT.size(); i++) - fCombinedPMT[i].ProcessEvent(); - for (size_t i = 0; i < fScalerPMT.size(); i++) - fScalerPMT[i].ProcessEvent(); -} - - -/** - * Exchange data between subsystems - */ -void QwLumi::ExchangeProcessedData() -{ - if (! HasDataLoaded()) return; - - bIsExchangedDataValid = kTRUE; - if (bNormalization){ - if(RequestExternalValue("q_targ", &fTargetCharge)){ - if (bDEBUG){ - QwWarning << "QwLumi::ExchangeProcessedData Found "<(&fTargetCharge))->PrintInfo(); - } - } - } -} - - - - -void QwLumi::ProcessEvent_2() -{ - if (! HasDataLoaded()) return; - - if (bIsExchangedDataValid) - { - //data is valid, process it - if (bDEBUG) - { - Double_t pedestal = fTargetCharge.GetPedestal(); - Double_t calfactor = fTargetCharge.GetCalibrationFactor(); - Double_t volts = fTargetCharge.GetAverageVolts(); - std::cout<<"QwLumi::ProcessEvent_2(): processing with exchanged data"<DoNormalization(); - } - else - { - QwWarning <<"QwLumi::ProcessEvent_2(): could not get all external values."<"<::const_iterator IntegrationPMT = fIntegrationPMT.begin(); IntegrationPMT != fIntegrationPMT.end(); ++IntegrationPMT) { - if (IntegrationPMT->GetElementName() == name) { - return &(*IntegrationPMT); - } - } - } - return 0; -} - - -const QwCombinedPMT* QwLumi::GetCombinedPMT(const TString name) const -{ - TString tmpname = name; - tmpname.ToLower(); - if (! fCombinedPMT.empty()) - { - for (size_t i=0;i (value); - - for (size_t i = 0; i < input->fIntegrationPMT.size(); i++) - this->fIntegrationPMT[i] = input->fIntegrationPMT[i]; - for (size_t i = 0; i < input->fCombinedPMT.size(); i++) - this->fCombinedPMT[i] = input->fCombinedPMT[i]; - for (size_t i = 0; i < input->fScalerPMT.size(); i++) - this->fScalerPMT[i] = input->fScalerPMT[i]; - - } - return *this; -} - -//***************************************************************** -VQwSubsystem& QwLumi::operator+= (VQwSubsystem *value) -{ - if (Compare(value)) - { - QwLumi* input= dynamic_cast(value); - - for (size_t i = 0; i < input->fIntegrationPMT.size(); i++) - this->fIntegrationPMT[i] += input->fIntegrationPMT[i]; - for (size_t i = 0; i < input->fCombinedPMT.size(); i++) - this->fCombinedPMT[i] += input->fCombinedPMT[i]; - for (size_t i = 0; i < input->fScalerPMT.size(); i++) - this->fScalerPMT[i] += input->fScalerPMT[i]; - } - return *this; -} - -//***************************************************************** -VQwSubsystem& QwLumi::operator-= (VQwSubsystem *value) -{ - - if (Compare(value)) - { - QwLumi* input= dynamic_cast(value); - - for (size_t i = 0; i < input->fIntegrationPMT.size(); i++) - this->fIntegrationPMT[i] -= input->fIntegrationPMT[i]; - for (size_t i = 0; i < input->fCombinedPMT.size(); i++) - this->fCombinedPMT[i] -= input->fCombinedPMT[i]; - for (size_t i = 0; i < input->fScalerPMT.size(); i++) - this->fScalerPMT[i] -= input->fScalerPMT[i]; - } - return *this; -} - -//***************************************************************** -void QwLumi::Sum(VQwSubsystem *value1, VQwSubsystem *value2) -{ - if (Compare(value1) && Compare(value2)) - { - *this = value1; - *this += value2; - } -} - -//***************************************************************** -void QwLumi::Difference(VQwSubsystem *value1, VQwSubsystem *value2) -{ - if (Compare(value1) && Compare(value2)) - { - *this = value1; - *this -= value2; - } -} - -//***************************************************************** -void QwLumi::Ratio(VQwSubsystem *numer, VQwSubsystem *denom) -{ - if (Compare(numer) && Compare(denom)) - { - QwLumi* innumer = dynamic_cast(numer); - QwLumi* indenom = dynamic_cast(denom); - - for (size_t i = 0; i < innumer->fIntegrationPMT.size(); i++) - this->fIntegrationPMT[i].Ratio(innumer->fIntegrationPMT[i],indenom->fIntegrationPMT[i]); - for (size_t i = 0; i < innumer->fCombinedPMT.size(); i++) - this->fCombinedPMT[i].Ratio(innumer->fCombinedPMT[i],indenom->fCombinedPMT[i]); - for (size_t i = 0; i < innumer->fScalerPMT.size(); i++) - this->fScalerPMT[i].Ratio(innumer->fScalerPMT[i],indenom->fScalerPMT[i]); - } -} - -//***************************************************************** -void QwLumi::Scale(Double_t factor) -{ - for (size_t i = 0; i < fIntegrationPMT.size(); i++) - fIntegrationPMT[i].Scale(factor); - for (size_t i = 0; i < fCombinedPMT.size(); i++) - fCombinedPMT[i].Scale(factor); - for (size_t i = 0; i < fScalerPMT.size(); i++) - fScalerPMT[i].Scale(factor); -} - -//***************************************************************** -void QwLumi::Normalize(VQwDataElement* denom) -{ - for (size_t i = 0; i < fIntegrationPMT.size(); i++) - fIntegrationPMT[i].Normalize(denom); - for (size_t i = 0; i < fCombinedPMT.size(); i++) - fCombinedPMT[i].Normalize(denom); - //for (size_t i = 0; i < fScalerPMT.size(); i++) - //fScalerPMT[i].Normalize(denom); -} - - -//***************************************************************** -Bool_t QwLumi::Compare(VQwSubsystem *value) -{ - // std::cout<<" Here in QwLumi::Compare \n"; - - Bool_t res=kTRUE; - if(typeid(*value)!=typeid(*this)) - { - res=kFALSE; - // std::cout<<" types are not ok \n"; - // std::cout<<" this is bypassed just for now but should be fixed eventually \n"; - } - else - { - QwLumi* input= dynamic_cast(value); - if(input->fIntegrationPMT.size()!=fIntegrationPMT.size() || - input->fCombinedPMT.size()!=fCombinedPMT.size() ) - { - res=kFALSE; - } - if(input->fScalerPMT.size()!=fScalerPMT.size()) - { - res=kFALSE; - } - } - return res; -} - - -//***************************************************************** -void QwLumi::ConstructHistograms(TDirectory *folder, TString &prefix) -{ - for (size_t i = 0; i < fIntegrationPMT.size(); i++) - fIntegrationPMT[i].ConstructHistograms(folder,prefix); - for (size_t i = 0; i < fCombinedPMT.size(); i++) - fCombinedPMT[i].ConstructHistograms(folder,prefix); - for (size_t i = 0; i < fScalerPMT.size(); i++) - fScalerPMT[i].ConstructHistograms(folder,prefix); -} - - -//***************************************************************** -void QwLumi::FillHistograms() -{ - if (! HasDataLoaded()) return; - - for (size_t i = 0; i < fIntegrationPMT.size(); i++) - fIntegrationPMT[i].FillHistograms(); - for (size_t i = 0; i < fCombinedPMT.size(); i++) - fCombinedPMT[i].FillHistograms(); - for (size_t i = 0; i < fScalerPMT.size(); i++) - fScalerPMT[i].FillHistograms(); -} - - -//***************************************************************** -void QwLumi::ConstructBranchAndVector(TTree *tree, TString & prefix, std::vector &values) -{ - for (size_t i = 0; i < fIntegrationPMT.size(); i++) - fIntegrationPMT[i].ConstructBranchAndVector(tree, prefix, values); - for (size_t i = 0; i < fCombinedPMT.size(); i++) - fCombinedPMT[i].ConstructBranchAndVector(tree, prefix, values); - for (size_t i = 0; i < fScalerPMT.size(); i++) - fScalerPMT[i].ConstructBranchAndVector(tree, prefix, values); -} - -//***************************************************************** -void QwLumi::ConstructBranch(TTree *tree, TString & prefix) -{ - for (size_t i = 0; i < fIntegrationPMT.size(); i++) - fIntegrationPMT[i].ConstructBranch(tree, prefix); - for (size_t i = 0; i < fCombinedPMT.size(); i++) - fCombinedPMT[i].ConstructBranch(tree, prefix); - for (size_t i = 0; i < fScalerPMT.size(); i++) - fScalerPMT[i].ConstructBranch(tree, prefix); -} - -//***************************************************************** -void QwLumi::ConstructBranch(TTree *tree, TString & prefix, QwParameterFile& trim_file) -{ - TString tmp; - QwParameterFile* nextmodule; - - tmp="QwIntegrationPMT"; - trim_file.RewindToFileStart(); - if (trim_file.FileHasModuleHeader(tmp)){ - nextmodule=trim_file.ReadUntilNextModule(); - //This section contains sub modules and or channels to be included in the tree - - for(size_t i = 0; i < fIntegrationPMT.size(); i++) - fIntegrationPMT[i].ConstructBranch(tree, prefix,*nextmodule); - for(size_t i = 0; i < fIntegrationPMT.size(); i++) - fScalerPMT[i].ConstructBranch(tree, prefix); - - } - - tmp="QwCombinedPMT"; - trim_file.RewindToFileStart(); - if (trim_file.FileHasModuleHeader(tmp)){ - nextmodule=trim_file.ReadUntilNextModule();//This section contains sub modules and or channels to be included in the tree - for (size_t i=0;i &values) const -{ - if (! HasDataLoaded()) return; - - for(size_t i = 0; i < fIntegrationPMT.size(); i++) - fIntegrationPMT[i].FillTreeVector(values); - for (size_t i=0;i(value1); - - for (size_t i = 0; i < fIntegrationPMT.size(); i++) - fIntegrationPMT[i].AccumulateRunningSum(value->fIntegrationPMT[i]); - - for (size_t i = 0; i < fCombinedPMT.size(); i++) - fCombinedPMT[i].AccumulateRunningSum(value->fCombinedPMT[i]); - } -} - -void QwLumi::DeaccumulateRunningSum(VQwSubsystem* value1){ - if (Compare(value1)) { - QwLumi* value = dynamic_cast(value1); - - for (size_t i = 0; i < fIntegrationPMT.size(); i++) - fIntegrationPMT[i].DeaccumulateRunningSum(value->fIntegrationPMT[i]); - for (size_t i = 0; i < fCombinedPMT.size(); i++) - fCombinedPMT[i].DeaccumulateRunningSum(value->fCombinedPMT[i]); - } -}; - - - -void QwLumi::DoNormalization(Double_t factor) -{ - if (bIsExchangedDataValid) - { - if (bDEBUG) - { - Double_t pedestal = fTargetCharge.GetPedestal(); - Double_t calfactor = fTargetCharge.GetCalibrationFactor(); - Double_t volts = fTargetCharge.GetAverageVolts(); - std::cout<<"QwLumi::ProcessEvent_2(): processing with exchanged data"<Normalize(&fTargetCharge); - } - catch (std::exception& e) - { - std::cerr << e.what() << std::endl; - } - } -} - - - - - - -#ifdef __USE_DATABASE__ -//***************************************************************** -void QwLumi::FillDB(QwParityDB *db, TString datatype) -{ - - Bool_t local_print_flag = false; - if(local_print_flag){ - QwMessage << " --------------------------------------------------------------- " << QwLog::endl; - QwMessage << " QwLumi::FillDB " << QwLog::endl; - QwMessage << " --------------------------------------------------------------- " << QwLog::endl; - } - - std::vector interface; - std::vector entrylist; - - UInt_t analysis_id = db->GetAnalysisID(); - - TString measurement_type; - measurement_type = QwDBInterface::DetermineMeasurementTypeID(datatype); - - UInt_t i,j; - i = j = 0; - if(local_print_flag) QwMessage << QwColor(Qw::kGreen) << "IntegrationPMT" <Connect(); - // Check the entrylist size, if it isn't zero, start to query.. - if( entrylist.size() ) { - mysqlpp::Query query= db->Query(); - query.insert(entrylist.begin(), entrylist.end()); - query.execute(); - } - else { - QwMessage << "QwLumi::FillDB :: This is the case when the entrlylist contains nothing in "<< datatype.Data() << QwLog::endl; - } - - db->Disconnect(); - - return; -} - - - - -void QwLumi::FillErrDB(QwParityDB *db, TString datatype) -{ - - Bool_t local_print_flag = false; - if(local_print_flag){ - QwMessage << " --------------------------------------------------------------- " << QwLog::endl; - QwMessage << " QwLumi::FillErrDB " << QwLog::endl; - QwMessage << " --------------------------------------------------------------- " << QwLog::endl; - } - - std::vector interface; - std::vector entrylist; - - UInt_t analysis_id = db->GetAnalysisID(); - - UInt_t i,j; - i = j = 0; - if(local_print_flag) QwMessage << QwColor(Qw::kGreen) << "IntegrationPMT" <Connect(); - // Check the entrylist size, if it isn't zero, start to query.. - if( entrylist.size() ) { - mysqlpp::Query query= db->Query(); - query.insert(entrylist.begin(), entrylist.end()); - query.execute(); - } - else { - QwMessage << "QwLumi::FillErrDB :: This is the case when the entrlylist contains nothing in "<< datatype.Data() << QwLog::endl; - } - - db->Disconnect(); - - return; -}; -#endif - - -void QwLumi::WritePromptSummary(QwPromptSummary *ps, TString type) -{ - - Bool_t local_print_flag = true; - if(local_print_flag){ - QwMessage << " --------------------------------------------------------------- " << QwLog::endl; - QwMessage << " QwLumi::WritePromptSummary() " << QwLog::endl; - QwMessage << " --------------------------------------------------------------- " << QwLog::endl; - } - - return; -} diff --git a/Parity/src/QwMainCerenkovDetector.cc b/Parity/src/QwMainCerenkovDetector.cc index b015f128b..c43a0f29a 100755 --- a/Parity/src/QwMainCerenkovDetector.cc +++ b/Parity/src/QwMainCerenkovDetector.cc @@ -17,7 +17,7 @@ #define MYSQLPP_SSQLS_NO_STATICS #include "QwParitySSQLS.h" #include "QwParityDB.h" -#endif +#endif //__USE_DATABASE__ #include "QwPromptSummary.h" // Register this subsystem with the factory @@ -631,7 +631,6 @@ void QwMainCerenkovDetector::EncodeEventData(std::vector &buffer) fIntegrationPMT[fMainDetID.at(i).fIndex].EncodeEventData(elements); } - // If there is element data, generate the subbank header std::vector subbankheader; std::vector rocheader; @@ -1397,7 +1396,7 @@ void QwMainCerenkovDetector::FillDB(QwParityDB *db, TString datatype) db->Disconnect(); return; } -#endif +#endif //__USE_DATABASE__ void QwMainCerenkovDetector::PrintValue() const { @@ -1501,7 +1500,7 @@ void QwMainCerenkovDetector::FillErrDB(QwParityDB *db, TString datatype) return; }; -#endif +#endif //__USE_DATABASE__ void QwMainCerenkovDetector::WritePromptSummary(QwPromptSummary *ps, TString type) diff --git a/Parity/src/QwRegression.cc b/Parity/src/QwRegression.cc deleted file mode 100755 index 8e0b610fa..000000000 --- a/Parity/src/QwRegression.cc +++ /dev/null @@ -1,720 +0,0 @@ -/* - * QwRegression.cc - * - * Created on: Oct 22, 2010 - * Author: wdconinc - */ - -#include "QwRegression.h" - -// Qweak headers -#include "VQwDataElement.h" -#include "QwVQWK_Channel.h" -#include "QwParameterFile.h" -#define MYSQLPP_SSQLS_NO_STATICS -#include "QwParitySSQLS.h" -#include "QwParityDB.h" - - -/** Constructor with single event and helicity pattern - * - * @param options Options object - * @param event Single event - * @param helicitypattern Helicity pattern - */ -QwRegression::QwRegression( - QwOptions &options, - QwSubsystemArrayParity& event, - QwHelicityPattern& helicitypattern) -{ - fEnableRegression = false; - ProcessOptions(options); - fSubsystemArray = &event; - fHelicityPattern = &helicitypattern; - LoadChannelMap(fRegressionMapFile); - QwSubsystemArrayParity& asym = helicitypattern.fAsymmetry; - QwSubsystemArrayParity& diff = helicitypattern.fDifference; - ConnectChannels(event,asym,diff); -} - -/** Constructor with single event - * - * @param options Options object - * @param event Single event - * - */ -QwRegression::QwRegression(QwOptions &options, QwSubsystemArrayParity& event):fHelicityPattern(NULL) -{ - fEnableRegression = false; - ProcessOptions(options); - fSubsystemArray = &event; - LoadChannelMap(fRegressionMapFile); - ConnectChannels(event); - -} - -/** Constructor with only helicity pattern - * - * @param options Obtions object - * @param helicitypattern Helicity Pattern - * - */ -QwRegression::QwRegression(QwOptions &options, QwHelicityPattern& helicitypattern):fSubsystemArray(NULL) -{ - fEnableRegression = false; - ProcessOptions(options); - LoadChannelMap(fRegressionMapFile); - fHelicityPattern = &helicitypattern; - QwSubsystemArrayParity& asym = helicitypattern.fAsymmetry; - QwSubsystemArrayParity& diff = helicitypattern.fDifference; - ConnectChannels(asym,diff); -} - -/** Constructor with options - * - * @param options Obtions object - * - */ -QwRegression::QwRegression(QwOptions &options) -{ - fEnableRegression = false; - ProcessOptions(options); - LoadChannelMap(fRegressionMapFile); -} - - -QwRegression::QwRegression(const QwRegression &source): - fEnableRegression(source.fEnableRegression), - fRegressionMapFile(source.fRegressionMapFile), - fErrorFlag(source.fErrorFlag) -{ - this->fDependentVar.resize(source.fDependentVar.size()); - fDependentVarType.resize(source.fDependentVar.size()); - for (size_t i = 0; i < this->fDependentVar.size(); i++) { - const QwVQWK_Channel* vqwk = dynamic_cast(source.fDependentVar[i].second); - this->fDependentVar[i].first = NULL; - this->fDependentVar[i].second = new QwVQWK_Channel(*vqwk, VQwDataElement::kDerived); - fDependentVarType[i] = source.fDependentVarType[i]; - } -} - -/// Destructor -QwRegression::~QwRegression() -{ - PairIterator element; - for (element = fDependentVar.begin(); - element != fDependentVar.end(); element++) { - if (element->second != NULL){ - delete element->second; - } - } - fDependentVar.clear(); -} - - -/** Parse the variable type and name from a section header - * - * @param variable String with variable type and name - * @return Pair of variable type and name - */ -std::pair QwRegression::ParseRegressionVariable( - const std::string& variable) -{ - std::pair type_name; - size_t len = variable.length(); - size_t pos1 = variable.find_first_of(":"); - size_t pos2 = variable.find_first_not_of(":",pos1); - if (pos1 == std::string::npos) { - type_name.first = kRegTypeUnknown; - type_name.second = variable; - } else { - std::string type = variable.substr(0,pos1); - std::string name = variable.substr(pos2,len-pos2); - if (type == "asym") - type_name.first = kRegTypeAsym; - else if (type == "diff") - type_name.first = kRegTypeDiff; - else if (type == "mps") - type_name.first = kRegTypeMps; - else - type_name.first = kRegTypeUnknown; - type_name.second = name; - } - return type_name; -} - - -/** Load the channel map - * - * @param mapfile Filename of map file - * @return Zero when success - */ -Int_t QwRegression::LoadChannelMap(const std::string& mapfile) -{ - // Return if regression is not enabled - if (! fEnableRegression) return 0; - - // Open the file - QwParameterFile map(mapfile); - - // Read the sections of dependent variables - bool keep_header = true; - std::string section_name; - QwParameterFile* section = 0; - std::pair type_name; - while ((section = map.ReadNextSection(section_name,keep_header))) { - - // Store index to the current position in the dv vector - size_t current_dv_start = fDependentName.size(); - - // Add dependent variables from the section header - section->ReadNextLine(); - if (section->LineHasSectionHeader()) { - section->TrimSectionHeader(); - section->TrimWhitespace(); - // Parse section header into tokens separated by a comma - std::string current_token; - std::string previous_token; - do { - previous_token = current_token; - current_token = section->GetNextToken(","); - if (current_token.size() == 0) continue; - // Parse current token into dependent variable type and name - type_name = ParseRegressionVariable(current_token); - fDependentType.push_back(type_name.first); - fDependentName.push_back(type_name.second); - // Resize the vectors of sensitivities and independent variables - fSensitivity.resize(fDependentName.size()); - fIndependentType.resize(fDependentName.size()); - fIndependentName.resize(fDependentName.size()); - } while (current_token.size() != 0); - } else QwError << "Section does not start with header." << QwLog::endl; - - // Add independent variables and sensitivities - while (section->ReadNextLine()) { - // Throw away comments, whitespace, empty lines - section->TrimComment(); - section->TrimWhitespace(); - if (section->LineIsEmpty()) continue; - // Get first token: independent variable - std::string current_token = section->GetNextToken(","); - // Parse current token into independent variable type and name - type_name = ParseRegressionVariable(current_token); - // Loop over dependent variables to set sensitivities - for (size_t dv = current_dv_start; dv < fDependentName.size(); dv++) { - Double_t sensitivity = atof(section->GetNextToken(",").c_str()); - fSensitivity.at(dv).push_back(sensitivity); - fIndependentType.at(dv).push_back(type_name.first); - fIndependentName.at(dv).push_back(type_name.second); - } - } - } - return 0; -} - -/** Connect to the dependent and independent channels - * - * @param event Helicity event structure - * @param asym Asymmetry event structure - * @param diff Difference event structure - * @return Zero on success - */ -Int_t QwRegression::ConnectChannels( - QwSubsystemArrayParity& event, - QwSubsystemArrayParity& asym, - QwSubsystemArrayParity& diff) -{ - // Return if regression is not enabled - if (! fEnableRegression) return 0; - - /// Fill vector of pointers to the relevant data elements - for (size_t dv = 0; dv < fDependentName.size(); dv++) { - // Get the dependent variables - - VQwHardwareChannel* dv_ptr = 0; - QwVQWK_Channel* new_vqwk = NULL; - QwVQWK_Channel* vqwk = NULL; - string name = ""; - string reg = "reg_"; - - if(fDependentName.at(dv).at(0) == '@' ){ - name = fDependentName.at(dv).substr(1,fDependentName.at(dv).length()); - }else{ - switch (fDependentType.at(dv)) { - case kRegTypeMps: - dv_ptr = event.ReturnInternalValueForFriends(fDependentName.at(dv)); - break; - case kRegTypeAsym: - dv_ptr = asym.ReturnInternalValueForFriends(fDependentName.at(dv)); - break; - case kRegTypeDiff: - dv_ptr = diff.ReturnInternalValueForFriends(fDependentName.at(dv)); - break; - default: - QwWarning << "Dependent variable for regression has unknown type." - << QwLog::endl; - break; - } - - vqwk = dynamic_cast(dv_ptr); - name = vqwk->GetElementName().Data(); - name.insert(0, reg); - new_vqwk = new QwVQWK_Channel(*vqwk, VQwDataElement::kDerived); - new_vqwk->SetElementName(name); - } - - // alias - if(fDependentName.at(dv).at(0) == '@'){ - QwMessage << "dv: " << name << QwLog::endl; - new_vqwk = new QwVQWK_Channel(name, VQwDataElement::kDerived); - } - // defined type - else if(dv_ptr!=NULL){ - QwMessage << "dv: " << fDependentName.at(dv) << QwLog::endl; - }else { - QwWarning << "Dependent variable " << fDependentName.at(dv) << " could not be found, " - << "or is not a VQWK channel." << QwLog::endl; - continue; - } - - // pair creation - if(new_vqwk != NULL){ - fDependentVarType.push_back(fDependentType.at(dv)); - fDependentVar.push_back(std::make_pair(vqwk, new_vqwk)); - } - - // Add independent variables - fIndependentVar.resize(fDependentVar.size()); - for (size_t iv = 0; iv < fIndependentName.at(dv).size(); iv++) { - // Get the independent variables - const VQwHardwareChannel* iv_ptr = 0; - switch (fIndependentType.at(dv).at(iv)) { - case kRegTypeMps: - iv_ptr = event.ReturnInternalValue(fIndependentName.at(dv).at(iv)); - break; - case kRegTypeAsym: - iv_ptr = asym.ReturnInternalValue(fIndependentName.at(dv).at(iv)); - break; - case kRegTypeDiff: - iv_ptr = diff.ReturnInternalValue(fIndependentName.at(dv).at(iv)); - break; - default: - QwWarning << "Independent variable for regression has unknown type." - << QwLog::endl; - break; - } - if (iv_ptr) { - QwMessage << " iv: " << fIndependentName.at(dv).at(iv) << " (sens = " - << fSensitivity.at(dv).at(iv) << ")" << QwLog::endl; - fIndependentVar.back().push_back(std::make_pair(fSensitivity.at(dv).at(iv), - iv_ptr)); - } else { - QwWarning << "Independent variable " << fIndependentName.at(dv).at(iv) << " for regression of " - << "dependent variable " << fDependentName.at(dv) << " could not be found." - << QwLog::endl; - } - } - } - - return 0; - -} -/** Connect to the dependent and independent channels - * - * @param asym Asymmetry event structure - * @param diff Difference event structure - * @return Zero on success - */ -Int_t QwRegression::ConnectChannels( - QwSubsystemArrayParity& asym, - QwSubsystemArrayParity& diff) -{ - // Return if regression is not enabled - if (! fEnableRegression) return 0; - - /// Fill vector of pointers to the relevant data elements - for (size_t dv = 0; dv < fDependentName.size(); dv++) { - // Get the dependent variables - - VQwHardwareChannel* dv_ptr = 0; - QwVQWK_Channel* new_vqwk = NULL; - QwVQWK_Channel* vqwk = NULL; - string name = ""; - string reg = "reg_"; - - if (fDependentType.at(dv)==kRegTypeMps){ - // Quietly ignore the MPS type when we're connecting the asym & diff - continue; - } else if(fDependentName.at(dv).at(0) == '@' ){ - name = fDependentName.at(dv).substr(1,fDependentName.at(dv).length()); - }else{ - switch (fDependentType.at(dv)) { - case kRegTypeAsym: - dv_ptr = asym.ReturnInternalValueForFriends(fDependentName.at(dv)); - break; - case kRegTypeDiff: - dv_ptr = diff.ReturnInternalValueForFriends(fDependentName.at(dv)); - break; - default: - QwWarning << "QwRegression::ConnectChannels(QwSubsystemArrayParity& asym, QwSubsystemArrayParity& diff): Dependent variable, " - << fDependentName.at(dv) - << ", for asym/diff regression does not have proper type, type==" - << fDependentType.at(dv) << "."<< QwLog::endl; - break; - } - - vqwk = dynamic_cast(dv_ptr); - name = vqwk->GetElementName().Data(); - name.insert(0, reg); - new_vqwk = new QwVQWK_Channel(*vqwk, VQwDataElement::kDerived); - new_vqwk->SetElementName(name); - } - - // alias - if(fDependentName.at(dv).at(0) == '@'){ - QwMessage << "dv: " << name << QwLog::endl; - new_vqwk = new QwVQWK_Channel(name, VQwDataElement::kDerived); - } - // defined type - else if(dv_ptr!=NULL){ - QwMessage << "dv: " << fDependentName.at(dv) << QwLog::endl; - }else { - QwWarning << "Dependent variable " << fDependentName.at(dv) << " could not be found, " - << "or is not a VQWK channel." << QwLog::endl; - continue; - } - - // pair creation - if(new_vqwk != NULL){ - fDependentVarType.push_back(fDependentType.at(dv)); - fDependentVar.push_back(std::make_pair(vqwk, new_vqwk)); - } - - // Add independent variables - fIndependentVar.resize(fDependentVar.size()); - for (size_t iv = 0; iv < fIndependentName.at(dv).size(); iv++) { - // Get the independent variables - const VQwHardwareChannel* iv_ptr = 0; - switch (fIndependentType.at(dv).at(iv)) { - case kRegTypeAsym: - iv_ptr = asym.ReturnInternalValue(fIndependentName.at(dv).at(iv)); - break; - case kRegTypeDiff: - iv_ptr = diff.ReturnInternalValue(fIndependentName.at(dv).at(iv)); - break; - default: - QwWarning << "Independent variable for regression has unknown type." - << QwLog::endl; - break; - } - if (iv_ptr) { - QwMessage << " iv: " << fIndependentName.at(dv).at(iv) << " (sens = " - << fSensitivity.at(dv).at(iv) << ")" << QwLog::endl; - fIndependentVar.back().push_back(std::make_pair(fSensitivity.at(dv).at(iv), - iv_ptr)); - } else { - QwWarning << "Independent variable " << fIndependentName.at(dv).at(iv) << " for regression of " - << "dependent variable " << fDependentName.at(dv) << " could not be found." - << QwLog::endl; - } - } - } - - return 0; - -} - -/** Connect to the dependent and independent channels - * - * @param event Helicity event structure - * @return Zero on success - */ -Int_t QwRegression::ConnectChannels(QwSubsystemArrayParity& event) -{ - // Return if regression is not enabled - if (! fEnableRegression) return 0; - - /// Fill vector of pointers to the relevant data elements - for (size_t dv = 0; dv < fDependentName.size(); dv++) { - // Get the dependent variables - - VQwHardwareChannel* dv_ptr = 0; - QwVQWK_Channel* new_vqwk = NULL; - QwVQWK_Channel* vqwk = NULL; - string name = " s"; - string reg = "reg_"; - - if (fDependentType.at(dv)==kRegTypeAsym || fDependentType.at(dv)==kRegTypeDiff){ - // Quietly skip the asymmetry or difference types. - continue; - } else if(fDependentType.at(dv) != kRegTypeMps){ - QwWarning << "QwRegression::ConnectChannels(QwSubsystemArrayParity& event): Dependent variable, " - << fDependentName.at(dv) - << ", for MPS regression does not have MPS type, type==" - << fDependentType.at(dv) << "."<< QwLog::endl; - continue; - } else { - if(fDependentName.at(dv).at(0) == '@' ){ - name = fDependentName.at(dv).substr(1,fDependentName.at(dv).length()); - new_vqwk = new QwVQWK_Channel(name, VQwDataElement::kDerived); - } else { - dv_ptr = event.ReturnInternalValueForFriends(fDependentName.at(dv)); - - vqwk = dynamic_cast(dv_ptr); - name = vqwk->GetElementName().Data(); - name.insert(0,reg); - new_vqwk = new QwVQWK_Channel(*vqwk, VQwDataElement::kDerived); - new_vqwk->SetElementName(name); - } - } - - // alias - if(new_vqwk==NULL){ - QwWarning << "Dependent variable " << fDependentName.at(dv) << " could not be found, " - << "or is not a VQWK channel." << QwLog::endl; - continue; - } else { - QwMessage << "dv: " << new_vqwk->GetElementName() << QwLog::endl; - // pair creation - fDependentVarType.push_back(fDependentType.at(dv)); - fDependentVar.push_back(std::make_pair(vqwk, new_vqwk)); - } - - // Add independent variables - fIndependentVar.resize(fDependentVar.size()); - for (size_t iv = 0; iv < fIndependentName.at(dv).size(); iv++) { - // Get the independent variables - const VQwHardwareChannel* iv_ptr = 0; - if(fIndependentType.at(dv).at(iv) == kRegTypeMps){ - iv_ptr = event.ReturnInternalValue(fIndependentName.at(dv).at(iv)); - }else{ - QwWarning << "Independent variable for MPS regression has unknown type." - << QwLog::endl; - } - if (iv_ptr) { - QwMessage << " iv: " << fIndependentName.at(dv).at(iv) << " (sens = " - << fSensitivity.at(dv).at(iv) << ")" << QwLog::endl; - fIndependentVar.back().push_back(std::make_pair(fSensitivity.at(dv).at(iv), - iv_ptr)); - } else { - QwWarning << "Independent variable " << fIndependentName.at(dv).at(iv) << " for regression of " - << "dependent variable " << fDependentName.at(dv) << " could not be found." - << QwLog::endl; - } - } - } - - return 0; -} - -/** - * Defines configuration options using QwOptions functionality. - * @param options Options object - */ -void QwRegression::DefineOptions(QwOptions &options) -{ - options.AddOptions("Linear regression") - ("enable-regression", po::value()->zero_tokens()->default_value(false), - "enable linear regression"); - options.AddOptions("Linear regression") - ("regression-map", po::value()->default_value("regression.map"), - "variables and sensitivities for regression"); -} - -/** - * Process configuration options using QwOptions functionality. - * @param options Options object - */ -void QwRegression::ProcessOptions(QwOptions &options) -{ - fEnableRegression = options.GetValue("enable-regression"); - fRegressionMapFile = options.GetValue("regression-map"); -} - - -/// Do the linear regression -void QwRegression::LinearRegression(EQwRegType type) -{ - // Return if regression is not enabled - if (! fEnableRegression){ - QwDebug << "Regression is not enabled!" << QwLog::endl; - return; - } - // Get error flag from QwHelicityPattern - if (fHelicityPattern != NULL){ - fErrorFlag = fHelicityPattern->GetEventcutErrorFlag(); - } else if (fSubsystemArray != NULL){ - fErrorFlag = fSubsystemArray->GetEventcutErrorFlag(); - } else { - QwError << "QwRegression::LinearRegression: Can't set fErrorFlag" << QwLog::endl; - fErrorFlag = 0; - } - // Linear regression for each dependent variable - for (size_t dv = 0; dv < fDependentVar.size(); dv++) { - // if second is NULL, can't do regression - if (fDependentVar.at(dv).second == NULL){ - QwError<<"Second is value is NULL, unable to calculate regression."<ClearEventData(); - }else{ - // Update second value - fDependentVar.at(dv).second->AssignValueFrom(fDependentVar.at(dv).first); - } - // Add corrections - for (size_t iv = 0; iv < fIndependentVar.at(dv).size(); iv++) { - fDependentVar.at(dv).second->ScaledAdd(fIndependentVar.at(dv).at(iv).first, - fIndependentVar.at(dv).at(iv).second); - } - } -} - - -/** - * Construct the branch and tree vector - * @param tree Tree - * @param prefix Prefix - * @param values Vector of values - */ -void QwRegression::ConstructBranchAndVector( - TTree *tree, - TString& prefix, - std::vector& values) -{ - PairConstIterator element; - for (element = fDependentVar.begin(); - element != fDependentVar.end(); ++element) { - element->second->ConstructBranchAndVector(tree, prefix, values); - } -}; - -/** - * Fill the tree vector - * @param values Vector of values - */ -void QwRegression::FillTreeVector(std::vector& values) const -{ - // Fill the data element - PairConstIterator element; - for (element = fDependentVar.begin(); - element != fDependentVar.end(); ++element) { - if (element->second == NULL) continue; - element->second->FillTreeVector(values); - } -}; - - -void QwRegression::AccumulateRunningSum(QwRegression value) -{ - if (value.fErrorFlag==0){ - for (size_t i = 0; i < value.fDependentVar.size(); i++){ - this->fDependentVar[i].second->AccumulateRunningSum(value.fDependentVar[i].second); - } - } -} - - -void QwRegression::CalculateRunningAverage() -{ - for(size_t i = 0; i < fDependentVar.size(); i++) { - fDependentVar[i].second->CalculateRunningAverage(); - } - - return; -} - - -void QwRegression::PrintValue() const -{ - QwMessage<<"=== QwRegression ==="<PrintValue(); - } -} - -void QwRegression::FillDB(QwParityDB *db, TString datatype) -{ - if (! fEnableRegression){ - QwDebug << " QwRegression::FillDB: Regression is not enabled!" - << QwLog::endl; - return; - } - Bool_t local_print_flag = kTRUE; - - UInt_t analysis_id = db->GetAnalysisID(); - - TString measurement_type; - measurement_type = QwDBInterface::DetermineMeasurementTypeID(datatype); - - std::vector interface; - - std::vector beamlist; - std::vector mdlist; - std::vector lumilist; - - QwDBInterface::EQwDBIDataTableType tabletype; - - - for(size_t i = 0; i < fDependentVar.size(); i++) { - interface.clear(); - fDependentVar[i].second->AddEntriesToList(interface); - for(size_t j=0; jConnect(); - // Check the entrylist size, if it isn't zero, start to query.. - if( beamlist.size() ) { - mysqlpp::Query query= db->Query(); - query.insert(beamlist.begin(), beamlist.end()); - query.execute(); - } else { - QwMessage << "QwRegression::FillDB :: This is the case when the beamlist contains nothing for type="<< measurement_type.Data() - << QwLog::endl; - } - if( mdlist.size() ) { - mysqlpp::Query query= db->Query(); - query.insert(mdlist.begin(), mdlist.end()); - query.execute(); - } else { - QwMessage << "QwRegression::FillDB :: This is the case when the mdlist contains nothing for type="<< measurement_type.Data() - << QwLog::endl; - } - if( lumilist.size() ) { - mysqlpp::Query query= db->Query(); - query.insert(lumilist.begin(), lumilist.end()); - query.execute(); - } else { - QwMessage << "QwRegression::FillDB :: This is the case when the lumilist contains nothing for type="<< measurement_type.Data() - << QwLog::endl; - } - db->Disconnect(); - return; -} - - diff --git a/Parity/src/QwRegressionSubsystem.cc b/Parity/src/QwRegressionSubsystem.cc deleted file mode 100755 index a847dab63..000000000 --- a/Parity/src/QwRegressionSubsystem.cc +++ /dev/null @@ -1,262 +0,0 @@ -/* - * QwRegressionSubsystem.cc - * - * Created on: Aug 11, 2011 - * Author: meeker - */ - -#include "QwRegressionSubsystem.h" -#include "VQwSubsystemParity.h" -#include "QwRegression.h" -#include "QwSubsystemArrayParity.h" -#include "QwParameterFile.h" - -RegisterSubsystemFactory(QwRegressionSubsystem); - - -QwRegressionSubsystem::~QwRegressionSubsystem() -{ -} - -struct null_deleter { - void operator()(void const *) const { } -}; - -boost::shared_ptr QwRegressionSubsystem::GetSharedPointerToStaticObject(){ - boost::shared_ptr px(this, null_deleter()); - return px; -} - -VQwSubsystem& QwRegressionSubsystem::operator=(VQwSubsystem* value) -{ - QwRegressionSubsystem* input= dynamic_cast(value); - if (input!=NULL) { - for(size_t i = 0; i < input->fDependentVar.size(); i++) { - this->fDependentVar.at(i).second->AssignValueFrom(input->fDependentVar.at(i).second); - } - } - return *this; -} - -VQwSubsystem& QwRegressionSubsystem::operator+=(VQwSubsystem* value) -{ - QwRegressionSubsystem* input = dynamic_cast(value); - if (input!=NULL) { - for(size_t i = 0; i < input->fDependentVar.size(); i++) { - this->fDependentVar.at(i).second->AddValueFrom(input->fDependentVar.at(i).second); - } - } - return *this; -} - -VQwSubsystem& QwRegressionSubsystem:: operator-=(VQwSubsystem* value) -{ - QwRegressionSubsystem* input = dynamic_cast(value); - if (input!=NULL) { - for(size_t i = 0; ifDependentVar.size(); i++) { - this->fDependentVar.at(i).second->SubtractValueFrom(input->fDependentVar.at(i).second); - } - } - return *this; -} - -VQwSubsystem& QwRegressionSubsystem:: operator*=(VQwSubsystem* value) -{ - QwRegressionSubsystem* input = dynamic_cast(value); - if (input!=NULL) { - for(size_t i = 0; ifDependentVar.size(); i++) { - this->fDependentVar.at(i).second->MultiplyBy(input->fDependentVar.at(i).second); - } - } - return *this; -} - -VQwSubsystem& QwRegressionSubsystem:: operator/=(VQwSubsystem* value) -{ - QwRegressionSubsystem* input = dynamic_cast(value); - if (input!=NULL) { - for(size_t i = 0; ifDependentVar.size(); i++) { - this->fDependentVar.at(i).second->DivideBy(input->fDependentVar.at(i).second); - } - } - return *this; -} - - -void QwRegressionSubsystem::Sum(VQwSubsystem* value1, VQwSubsystem* value2) -{ - *this = value1; - *this += value2; -} - - -void QwRegressionSubsystem::Difference(VQwSubsystem* value1, VQwSubsystem* value2) -{ - *this = value1; - *this -= value2; -} - - -void QwRegressionSubsystem::Ratio(VQwSubsystem* value1, VQwSubsystem* value2) -{ - *this = value1; - *this /= value2; -} - - -void QwRegressionSubsystem::Scale(Double_t value) -{ - for(size_t i = 0; i < this->fDependentVar.size(); i++) - { - this->fDependentVar.at(i).second->Scale(value); - } - -}; - -void QwRegressionSubsystem::AccumulateRunningSum(VQwSubsystem* input) -{ - QwRegressionSubsystem* value = dynamic_cast (input); - if (value!=NULL){ - QwRegression::AccumulateRunningSum(*value); - } -} - -void QwRegressionSubsystem::DeaccumulateRunningSum(VQwSubsystem* input) -{ - QwRegressionSubsystem* value = dynamic_cast (input); - if (value!=NULL) { - for (size_t i = 0; i < value-> fDependentVar.size(); i++) { - fDependentVar.at(i).second->DeaccumulateRunningSum(value->fDependentVar.at(i).second); - } - } -} - -void QwRegressionSubsystem::CalculateRunningAverage() -{ - QwRegression::CalculateRunningAverage(); -} - -void QwRegressionSubsystem:: PrintValue() const{ - QwRegression::PrintValue(); -} - - -void QwRegressionSubsystem::ConstructHistograms(TDirectory *folder, TString &prefix) -{ - for (size_t i = 0; i < fDependentVar.size(); i++){ - fDependentVar.at(i).second->ConstructHistograms(folder,prefix); - } -}; - -void QwRegressionSubsystem::FillHistograms() -{ - for (size_t i = 0; i < fDependentVar.size(); i++){ - fDependentVar.at(i).second->FillHistograms(); - } -}; - -void QwRegressionSubsystem::DeleteHistograms() -{ - for (size_t i = 0; i < fDependentVar.size(); i++){ - // fDependentVar.at(i).second->DeleteHistograms(); - } -}; - -void QwRegressionSubsystem::ConstructBranch(TTree *tree, TString & prefix) -{ - for (size_t i = 0; i < fDependentVar.size(); i++){ - fDependentVar.at(i).second->ConstructBranch(tree, prefix); - } -}; - -void QwRegressionSubsystem::ConstructBranch(TTree *tree, TString & prefix, QwParameterFile& trim_file) -{ - TString tmp; - QwParameterFile* nextmodule; - trim_file.RewindToFileStart(); - tmp="Regression"; - trim_file.RewindToFileStart(); - if (trim_file.FileHasModuleHeader(tmp)){ - nextmodule=trim_file.ReadUntilNextModule();//This section contains sub modules and or channels to be included in the tree - for (size_t i = 0; i < fDependentVar.size(); i++){ - fDependentVar.at(i).second->ConstructBranch(tree, prefix, *nextmodule); - } - } -}; - - -void QwRegressionSubsystem::IncrementErrorCounters() -{ - /// TODO: Write QwRegressionSubsystem::IncrementErrorCounters -} - -void QwRegressionSubsystem::UpdateErrorFlag(const VQwSubsystem *ev_error){ - /// TODO: Write QwRegressionSubsystem::UpdateErrorFlag - //if (Compare(ev_error)){ - //QwRegressionSubsystem* input = dynamic_cast (ev_error); - //} -}; - - -/// DERIVED FUNCTIONS /// - - -/* All of the functions below are using generic - * returns for testing purposes. - */ - - - -Int_t QwRegressionSubsystem::LoadChannelMap(TString) -{ - Int_t sample = 0; - return sample; -} - - -Int_t QwRegressionSubsystem::LoadInputParameters(TString) -{ - Int_t sample = 0; - return sample; -} - - -Int_t QwRegressionSubsystem::LoadEventCuts(TString) -{ - Int_t sample = 0; - return sample; - -} - -Int_t QwRegressionSubsystem::ProcessConfigurationBuffer(UInt_t, UInt_t, UInt_t*, UInt_t) -{ - Int_t sample = 0; - return sample; -} - - -Int_t QwRegressionSubsystem::ProcessEvBuffer(UInt_t, UInt_t, UInt_t*, UInt_t) -{ - Int_t sample = 0; - return sample; -} - - -Bool_t QwRegressionSubsystem::ApplySingleEventCuts() -{ - return true; -} - -void QwRegressionSubsystem::PrintErrorCounters() const -{ -} - -UInt_t QwRegressionSubsystem::GetEventcutErrorFlag() -{ - return 0; - -} - - - - diff --git a/Parity/src/QwkRegBlueCorrelator.cc b/Parity/src/QwkRegBlueCorrelator.cc new file mode 100644 index 000000000..2d18a68b5 --- /dev/null +++ b/Parity/src/QwkRegBlueCorrelator.cc @@ -0,0 +1,256 @@ +/********************************************************************* + * $Id: $ + * \author Jan Balewski, MIT, 2010 + ********************************************************************* + * Descripion: + * Finds correlation and alphas for QW event + *********************************************************************/ + +#include +#include +using namespace std; + +#include +#include +#include +#include +#include + +#include +#include + +#include "QwkRegBlueCorrelator.h" + +//======================== +//======================== +QwkRegBlueCorrelator::QwkRegBlueCorrelator(const char *core) { + mCore=core; + h1iv=0; + // printf("constr of QwkRegBlueCorrelator=%s\n",mCore.Data()); +} + +//======================== +//======================== +QwkRegBlueCorrelator::~QwkRegBlueCorrelator(){ + printf("destructor QwkRegBlueCorrelator=%s\n",mCore.Data()); + if(h1iv) { // only if previously allocated + delete [] h1iv; + delete [] h2iv; + delete [] h1dv; + delete [] h2dv; + } + printf("destructor QwkRegBlueCorrelator done\n"); +} + +//======================== +//======================== +void QwkRegBlueCorrelator::print() { + +} + + +//======================== +//======================== +void +QwkRegBlueCorrelator::addEvent(double *Pvec, double *Yvec){ + linReg.accumulate(Pvec, Yvec); + // .... monitoring + + if (fDisableHistos == false) { + for(int i=0;iFill(Pvec[i]); + for(int j=i+1;jFill(Pvec[i],Pvec[j]); + } + for(int j=0;jFill(Yvec[j]); + for(int i=0;iFill(Pvec[i],Yvec[j]); + } + } + +} + + +//======================== +//======================== +void QwkRegBlueCorrelator::init(std::vector < TString > ivName, std::vector < TString > dvName) { + nP=ivName.size(); + nY=dvName.size(); + + initHistos(ivName,dvName); + linReg.setDims(nP, nY); + linReg.init(); +} + + +//________________________________________________ +//________________________________________________ +void +QwkRegBlueCorrelator::initHistos(std::vector < TString > Pname, std::vector < TString > Yname){ + printf("QwkRegBlueCorrelator::initHistos()\n"); + TH1*h; + + //..... 1D, iv + h1iv=new TH1 *[nP]; + for(int i=0;iGetXaxis()->SetNdivisions(4); + //h->SetBit(TH1::kCanRebin); + } + + double x1=0; + //..... 2D, iv correlations + h2iv=new TH1 *[nP*nP]; // not all are used + for(int i=0;iGetXaxis()->SetTitleColor(kBlue); + h->GetYaxis()->SetTitleColor(kBlue); + h->GetXaxis()->SetNdivisions(4); + h->GetYaxis()->SetNdivisions(4); + //h->SetBit(TH1::kCanRebin); + } + } + + //..... 1D, dv + h1dv=new TH1 *[nY]; + for(int i=0;iGetXaxis()->SetNdivisions(4); + //h->SetBit(TH1::kCanRebin); + } + + + double y1=0; + //..... 2D, dv-iv correlations + h2dv=new TH1 *[nP*nY]; // not all are used + for(int i=0;iGetXaxis()->SetTitleColor(kBlue); + h->GetYaxis()->SetTitleColor(kBlue); + h->GetXaxis()->SetNdivisions(4); + h->GetYaxis()->SetNdivisions(4); + //h->SetBit(TH1::kCanRebin); + } + } + + // store list of names to be archived + hA[0]=new TH1D(mCore+"NamesIV",Form("IV name list nIV=%d",nP),nP,0,1); + for(int i=0;iFill(Pname[i].Data(),1.*i); + hA[1]=new TH1D(mCore+"NamesDV",Form("DV name list nIV=%d",nY),nY,0,1); + for(int i=0;iFill(Yname[i].Data(),i*1.); +} + + +//________________________________________________ +//________________________________________________ +void +QwkRegBlueCorrelator::finish(){ + + printf("::::::::::::::::QwkRegBlueCorrelator::finish(%s) :::::::::::START\n",mCore.Data()); + if(linReg.failed()) { + printf(" abnormal finish of linReg\n"); + return; + } + + linReg.printSummaryP(); + linReg.printSummaryY(); + linReg.solve(); + linReg.printSummaryAlphas(); + + printf("::::::::::::::::QwkRegBlueCorrelator::finish(%s) :::::::::::END\n",mCore.Data()); +} + + +//________________________________________________ +//________________________________________________ +void +QwkRegBlueCorrelator::exportAlphas(TString outName, std::vector < TString > ivName, std::vector < TString > dvName){ + printf("::::::::::::::::QwkRegBlueCorrelator::exportAlphas(%s) :::::::::::\n",outName.Data()); + TFile* hFile=new TFile(outName,"RECREATE","correlation coefficents"); + + linReg.mA.Write("slopes"); + linReg.mAsig.Write("sigSlopes"); + linReg.mRjk.Write("IV_correlation"); + linReg.mMP.Write("IV_mean"); + linReg.mMY.Write("DV_mean"); + + //add processed matrices + double usedEve=linReg.getUsedEve(); + TMatrixD Mstat(1,1); + Mstat(0,0)=usedEve; + Mstat.Write("MyStat"); + + //... IVs + TMatrixD MsigIV(nP,1); + TH1D hiv("IVname","names of IVs",nP,-0.5,nP-0.5); + double val; + for(int i=0;iClose(); + printf("saved %s\n",hFile->GetName()); +} + + + +//________________________________________________ +//________________________________________________ +void +QwkRegBlueCorrelator::exportAlias(TString outPath, TString macroName,std::vector < TString > Pname, std::vector < TString > Yname){ + + printf("::::::::::::::::QwkRegBlueCorrelator::exportAlias(%s) :::::::::::\n",macroName.Data()); + + + FILE *fd=fopen(outPath+macroName+".C","w"); + fprintf(fd,"%s() {\n",macroName.Data()); + for (int iy = 0; iy SetAlias(\"reg_%s\",\n \"%s",Yname[iy].Data(),Yname[iy].Data()); + for (int j = 0; j < nP; j++) { + double val= -linReg.mA(j,iy); + if(val>0) fprintf(fd,"+"); + fprintf(fd,"%.4e*%s",val,Pname[j].Data()); + } + fprintf(fd,"\");\n"); + + } + + +#if 0 // format +regalias_r5848() { + Hel_Tree->SetAlias("reg_"," +*+*+..."); + Hel_Tree->SetAlias("reg_"," +*+*+..."); + . + . +} + +#endif + fprintf(fd,"}\n"); + fclose(fd); + printf("saved %s\n",macroName.Data()); +} + diff --git a/Parity/src/VQwDataHandler.cc b/Parity/src/VQwDataHandler.cc new file mode 100644 index 000000000..a2dc32147 --- /dev/null +++ b/Parity/src/VQwDataHandler.cc @@ -0,0 +1,333 @@ +/***************************************************************************** +File Name: VQwDataHandler.cc + +Created by: Michael Vallee +Email: mv836315@ohio.edu + +Description: This is the implemetation file to the VQwDataHandler class. + This class acts as a base class to all regression based + classes. + +Last Modified: August 1, 2018 1:39 PM +*****************************************************************************/ + +#include + +using namespace std; + +//header file +#include "VQwDataHandler.h" + +//#include "QwCombiner.h" + +#include "QwVQWK_Channel.h" + +#define MYSQLPP_SSQLS_NO_STATICS +#ifdef __USE_DATABASE__ +#include "QwParitySSQLS.h" +#include "QwParityDB.h" +#endif // __USE_DATABASE__ + + +VQwDataHandler::~VQwDataHandler() { + + for (size_t i = 0; i < fOutputVar.size(); ++i) { + if (fOutputVar.at(i) != NULL){ + delete fOutputVar.at(i); + } + } + fOutputVar.clear(); + +} + + +void VQwDataHandler::ProcessData() { + + for (size_t i = 0; i < fDependentVar.size(); ++i) { + *(fOutputVar.at(i)) = *(fDependentVar[i]); + } + for (size_t i = 0; i < fDependentValues.size(); ++i) { + fOutputValues.at(i) = fDependentValues[i]; + } + +} + + +Int_t VQwDataHandler::ConnectChannels(QwSubsystemArrayParity& asym, QwSubsystemArrayParity& diff) { + + /// Fill vector of pointers to the relevant data elements + for (size_t dv = 0; dv < fDependentName.size(); dv++) { + // Get the dependent variables + + VQwHardwareChannel* dv_ptr = 0; + QwVQWK_Channel* new_vqwk = NULL; + QwVQWK_Channel* vqwk = NULL; + string name = ""; + string reg = "reg_"; + + if (fDependentType.at(dv)==kRegTypeMps) { + // Quietly ignore the MPS type when we're connecting the asym & diff + continue; + } else if(fDependentName.at(dv).at(0) == '@' ) { + name = fDependentName.at(dv).substr(1,fDependentName.at(dv).length()); + }else{ + switch (fDependentType.at(dv)) { + case kRegTypeAsym: + dv_ptr = asym.ReturnInternalValueForFriends(fDependentName.at(dv)); + break; + case kRegTypeDiff: + dv_ptr = diff.ReturnInternalValueForFriends(fDependentName.at(dv)); + break; + default: + QwWarning << "QwCombiner::ConnectChannels(QwSubsystemArrayParity& asym, QwSubsystemArrayParity& diff): Dependent variable, " + << fDependentName.at(dv) + << ", for asym/diff regression does not have proper type, type==" + << fDependentType.at(dv) << "."<< QwLog::endl; + break; + } + + vqwk = dynamic_cast(dv_ptr); + name = vqwk->GetElementName().Data(); + name.insert(0, reg); + new_vqwk = new QwVQWK_Channel(*vqwk, VQwDataElement::kDerived); + new_vqwk->SetElementName(name); + } + + // alias + if(fDependentName.at(dv).at(0) == '@') { + //QwMessage << "dv: " << name << QwLog::endl; + new_vqwk = new QwVQWK_Channel(name, VQwDataElement::kDerived); + } + // defined type + else if(dv_ptr!=NULL) { + //QwMessage << "dv: " << fDependentName.at(dv) << QwLog::endl; + }else { + QwWarning << "Dependent variable " << fDependentName.at(dv) << " could not be found, " + << "or is not a VQWK channel." << QwLog::endl; + continue; + } + + // pair creation + if(new_vqwk != NULL) { + fDependentVar.push_back(vqwk); + fOutputVar.push_back(new_vqwk); + } + } +} + + +pair VQwDataHandler::ParseRegressionVariable(const string& variable) { + + pair type_name; + size_t len = variable.length(); + size_t pos1 = variable.find_first_of(ParseSeparator); + size_t pos2 = variable.find_first_not_of(ParseSeparator,pos1); + if (pos1 == string::npos) { + type_name.first = kRegTypeUnknown; + type_name.second = variable; + } else { + string type = variable.substr(0,pos1); + string name = variable.substr(pos2,len-pos2); + if (type == "asym") + {type_name.first = kRegTypeAsym;} + else if (type == "diff") + {type_name.first = kRegTypeDiff;} + else if (type == "mps") + {type_name.first = kRegTypeMps;} + else + {type_name.first = kRegTypeUnknown;} + type_name.second = name; + } + return type_name; + +} + + +void VQwDataHandler::ConstructBranchAndVector( + TTree *tree, + TString& prefix, + std::vector& values) +{ + for (size_t i = 0; i < fOutputVar.size(); ++i) { + fOutputVar.at(i)->ConstructBranchAndVector(tree, prefix, values); + } +} + + +/** + * Fill the tree vector + * @param values Vector of values + */ +void VQwDataHandler::FillTreeVector(std::vector& values) const +{ + // Fill the data element + for (size_t i = 0; i < fOutputVar.size(); ++i) { + if (fOutputVar.at(i) == NULL) {continue;} + fOutputVar.at(i)->FillTreeVector(values); + } +} + + +void VQwDataHandler::AccumulateRunningSum(VQwDataHandler &value) +{ + if (value.fErrorFlag==0){ + for (size_t i = 0; i < fOutputVar.size(); i++){ + this->fOutputVar[i]->AccumulateRunningSum(fOutputVar[i]); + } + } +} + + +void VQwDataHandler::CalculateRunningAverage() +{ + for(size_t i = 0; i < fOutputVar.size(); i++) { + // calling CalculateRunningAverage in scope of VQwHardwareChannel + fOutputVar[i]->CalculateRunningAverage(); + } + + return; +} + + +void VQwDataHandler::PrintValue() const +{ + QwMessage<<"=== QwCombiner ==="<PrintValue(); + } +} + + +#ifdef __USE_DATABASE__ +void VQwDataHandler::FillDB(QwParityDB *db, TString datatype) +{ + + Bool_t local_print_flag = kTRUE; + + UInt_t analysis_id = db->GetAnalysisID(); + + TString measurement_type; + measurement_type = QwDBInterface::DetermineMeasurementTypeID(datatype); + + std::vector interface; + + std::vector beamlist; + std::vector mdlist; + std::vector lumilist; + + QwDBInterface::EQwDBIDataTableType tabletype; + + + for(size_t i = 0; i < fOutputVar.size(); i++) { + interface.clear(); + fOutputVar[i]->AddEntriesToList(interface); + for(size_t j=0; jConnect(); + // Check the entrylist size, if it isn't zero, start to query.. + if( beamlist.size() ) { + mysqlpp::Query query= db->Query(); + query.insert(beamlist.begin(), beamlist.end()); + query.execute(); + } else { + QwMessage << "QwCombiner::FillDB :: This is the case when the beamlist contains nothing for type="<< measurement_type.Data() + << QwLog::endl; + } + if( mdlist.size() ) { + mysqlpp::Query query= db->Query(); + query.insert(mdlist.begin(), mdlist.end()); + query.execute(); + } else { + QwMessage << "QwCombiner::FillDB :: This is the case when the mdlist contains nothing for type="<< measurement_type.Data() + << QwLog::endl; + } + if( lumilist.size() ) { + mysqlpp::Query query= db->Query(); + query.insert(lumilist.begin(), lumilist.end()); + query.execute(); + } else { + QwMessage << "QwCombiner::FillDB :: This is the case when the lumilist contains nothing for type="<< measurement_type.Data() + << QwLog::endl; + } + db->Disconnect(); + return; +} +#endif // __USE_DATABASE__ + +/* + +Bool_t VQwDataHandler::PublishInternalValue(const TString &name, const TString &desc, const VQwHardwareChannel *value) const { + + Bool_t status = kTRUE; + + if (desc == "integrationpmt") { + value = GetIntegrationPMT(name)->GetChannel(name); + } else if (desc == "combinedpmt") { + value = GetCombinedPMT(name)->GetChannel(name); + } else { + QwError << "VQwDataHandler::PublishInternalValues() error "<< QwLog::endl; + } + + if (desc == NULL) { + QwError << "VQwDataHandler::PublishInternalValues(): " << name << " not found" << QwLog::endl; + status |= kFALSE; + } else { + QwDebug << "VQwDataHandler::PublishInternalValues(): " << name << " found" << QwLog::endl; + } + + return status; + +} + +Bool_t VQwDataHandler::PublishByRequest(TString device_name) { + + Bool_t status = kFALSE; + + for(size_t i=0;i maxlen: + print "WARNING: Truncating info from git"; + boringstring = boringstring[0:maxlen-1] + +for x in boringstring: + fullstring += '\\x'+x.encode('hex') + + + + +newheadertext = """#ifndef __GITINFO_HH +#define __GITINFO_HH + +/* + Generated automatically by cmake process + Encoding: +------------------------------------------------------------- +""" + boringstring + """ +------------------------------------------------------------- +*/ + +#define __GITMAXINFO_SIZE 2048 + +#define gGitInfoStr \"""" + fullstring + '\"' \ ++ \ +""" + +#endif//__GITINFO_HH +""" + + +os.chdir(presentcwd) + +outdir = "include/" +if not os.path.exists(outdir): + os.makedirs(outdir) + +newheader = open( outdir + "/gitinfo.hh", "w") +newheader.write(newheadertext) +newheader.close() + +print "Repository information\n", boringstring diff --git a/cmake/modules/FindMYSQLPP.cmake b/cmake/modules/FindMYSQLPP.cmake index e6cdfe412..76b93c8b2 100755 --- a/cmake/modules/FindMYSQLPP.cmake +++ b/cmake/modules/FindMYSQLPP.cmake @@ -1,6 +1,6 @@ FIND_PATH(MYSQLPP_INCLUDE_PATH mysql++.h + $ENV{MYSQLPP_INC_DIR} /usr/include/mysql++/ - /group/qweak/QwAnalysis/Linux_CentOS6.5-x86_64/MySQL++/local/include/mysql++/ ) FIND_PATH(MYSQL_INCLUDE_PATH mysql.h /usr/include/mysql/) @@ -12,8 +12,8 @@ IF(MYSQL_INCLUDE_PATH AND MYSQLPP_INCLUDE_PATH) ENDIF(MYSQL_INCLUDE_PATH AND MYSQLPP_INCLUDE_PATH) FIND_LIBRARY(MYSQLPP_LIBRARIES mysqlpp + $ENV{MYSQLPP_LIB_DIR} /usr/lib/mysql++/ - /group/qweak/QwAnalysis/Linux_CentOS6.5-x86_64/MySQL++/local/lib ) IF (MYSQLPP_INCLUDE_DIR AND MYSQLPP_LIBRARIES) diff --git a/cmake/modules/FindROOT.cmake b/cmake/modules/FindROOT.cmake index 646e511b4..a1fe6aaf3 100755 --- a/cmake/modules/FindROOT.cmake +++ b/cmake/modules/FindROOT.cmake @@ -31,12 +31,10 @@ else() OUTPUT_STRIP_TRAILING_WHITESPACE) execute_process( - COMMAND ${ROOT_CONFIG_EXECUTABLE} --libs + COMMAND ${ROOT_CONFIG_EXECUTABLE} --glibs OUTPUT_VARIABLE ROOT_LIBRARIES OUTPUT_STRIP_TRAILING_WHITESPACE) - #set(ROOT_LIBRARIES ${ROOT_LIBRARIES} -lThread -lMinuit -lHtml -lVMC -lEG -lGeom -lTreePlayer -lXMLIO -lProof) - #set(ROOT_LIBRARIES ${ROOT_LIBRARIES} -lProofPlayer -lMLP -lSpectrum -lEve -lRGL -lGed -lXMLParser -lPhysics) set(ROOT_LIBRARY_DIR ${ROOTSYS}/lib) # Make variables changeble to the advanced user @@ -49,7 +47,8 @@ endif() include(CMakeParseArguments) -find_program(ROOTCINT_EXECUTABLE rootcint PATHS $ENV{ROOTSYS}/bin) +find_program(ROOTCINT_EXECUTABLE rootcint + PATHS $ENV{ROOTSYS}/bin NO_DEFAULT_PATH) #---------------------------------------------------------------------------- # function ROOT_GENERATE_DICTIONARY( dictionary @@ -92,7 +91,7 @@ function(ROOT_GENERATE_DICTIONARY dictionary) endif() endforeach() #---call rootcint------------------------------------------ - add_custom_command(OUTPUT ${dictionary}.cxx ${dictionary}.h + add_custom_command(OUTPUT ${dictionary}.cxx COMMAND ${ROOTCINT_EXECUTABLE} -cint -f ${dictionary}.cxx -c ${ARG_OPTIONS} ${includedirs} ${headerfiles} ${linkdefs} DEPENDS ${headerfiles} ${linkdefs}) diff --git a/evio/Makefile b/evio/Makefile index ca87058e2..a82d33e26 100755 --- a/evio/Makefile +++ b/evio/Makefile @@ -116,15 +116,14 @@ ifeq ($(OSNAME),Linux) -lPhysics -lPostscript -lProof -lRint -lTree -lUnix -lZip ROOTGLIBS = -lGpad -lGui -lGX11 -lX3d else + ROOTCFLAGS = $(shell root-config --cflags) ROOTLIBS = $(shell root-config --libs) ROOTGLIBS = $(shell root-config --glibs) endif - ROOTCFLAGS = $(shell root-config --cflags) INCLUDES = -I$(shell root-config --incdir) CXX = g++ - CXXFLAGS = -O2 -Wall -fno-exceptions -fPIC $(INCLUDES) - CXXFLAGS += $(ROOTCFLAGS) + CXXFLAGS = -O2 -Wall -fno-exceptions -fPIC $(ROOTCFLAGS) $(INCLUDES) LD = g++ LDFLAGS = SOFLAGS = -shared From 6180c1c03f19d68bc68ec60bab708858d0315060 Mon Sep 17 00:00:00 2001 From: Your Name Date: Sun, 4 Nov 2018 21:27:28 -0500 Subject: [PATCH 006/137] Updating nomenclature for Counting House (and naming BPMs based off of their songsheet name designation - 1H04 = BPM A, 1h04A = BPM B, etc.) --- Parity/prminput/prexCH.conf | 20 +++++++ Parity/prminput/prexCH_beamline.map | 81 ++++++++++++++-------------- Parity/prminput/prexinj_beamline.map | 4 +- 3 files changed, 63 insertions(+), 42 deletions(-) create mode 100644 Parity/prminput/prexCH.conf diff --git a/Parity/prminput/prexCH.conf b/Parity/prminput/prexCH.conf new file mode 100644 index 000000000..b8a502def --- /dev/null +++ b/Parity/prminput/prexCH.conf @@ -0,0 +1,20 @@ +# This configuration file is used to generate +# a ROOT file for injector beam studies +# +# To Run +# qwparity -r 5900 -c injector.conf +# +# Friday, January 7 22:53:34 EDT 2011 +# +detectors = prexCH_detectors.map +chainfiles = no +single-output-file = yes +enable-tree-trim = no +disable-hel-tree = no +disable-histos = no +rootfile-stem = prexCH_ +codafile-stem = parity18_ +codafile-ext = dat + +ring.size = 200 +ring.stability_cut = -1 \ No newline at end of file diff --git a/Parity/prminput/prexCH_beamline.map b/Parity/prminput/prexCH_beamline.map index 572bf1d34..08bb39ab8 100644 --- a/Parity/prminput/prexCH_beamline.map +++ b/Parity/prminput/prexCH_beamline.map @@ -10,55 +10,56 @@ sample_size=464 !ADC0 - VQWK, 0, 0, ble, q_0_0 - VQWK, 0, 1, ble, q_0_1 - VQWK, 0, 2, bcm, cm_us - VQWK, 0, 3, bcm, cm_ds - VQWK, 0, 4, ble, q_0_4 - VQWK, 0, 5, ble, q_0_5 - VQWK, 0, 6, ble, q_0_6 - VQWK, 0, 7, ble, q_0_7 + VQWK, 0, 0, bcm, QWK_0_0 + VQWK, 0, 1, bcm, QWK_0_1 + VQWK, 0, 2, bcm, BCM_US + VQWK, 0, 3, bcm, BCM_DS + VQWK, 0, 4, bcm, QWK_0_4 + VQWK, 0, 5, bcm, QWK_0_5 + VQWK, 0, 6, bcm, QWK_0_6 + VQWK, 0, 7, bcm, QWK_0_7 !ADC1 - VQWK, 1, 0, bpmsee, QWK_1I02XP, UNROTATED - VQWK, 1, 1, bpmsee, QWK_1I02XM, UNROTATED - VQWK, 1, 2, bpmsee, QWK_1I02YP, UNROTATED - VQWK, 1, 3, bpmsee, QWK_1I02YM, UNROTATED - VQWK, 1, 4, ble, QWK_1I04XP, UNROTATED - VQWK, 1, 5, ble, QWK_1I04XM, UNROTATED - VQWK, 1, 6, ble, QWK_1I04YP, UNROTATED - VQWK, 1, 7, ble, QWK_1I04YM, UNROTATED + VQWK, 1, 0, bpmstripline, QWK_SEE_1H04D_XP, UNROTATED + VQWK, 1, 1, bpmstripline, QWK_SEE_1H04D_XM, UNROTATED + VQWK, 1, 2, bpmstripline, QWK_SEE_1H04D_YP, UNROTATED + VQWK, 1, 3, bpmstripline, QWK_SEE_1H04D_YM, UNROTATED + VQWK, 1, 4, bcm, QWK_1_4 + VQWK, 1, 5, bcm, QWK_1_5 + VQWK, 1, 6, bcm, QWK_1_6 + VQWK, 1, 7, bcm, QWK_1_7 !ADC2 - VQWK, 2, 0, ble, QWK_1I06XP, UNROTATED - VQWK, 2, 1, ble, QWK_1I06XM, UNROTATED - VQWK, 2, 2, ble, QWK_1I06YP, UNROTATED - VQWK, 2, 3, ble, QWK_1I06YM, UNROTATED - VQWK, 2, 4, bpmsee, QWK_0I02XP, UNROTATED - VQWK, 2, 5, bpmsee, QWK_0I02XM, UNROTATED - VQWK, 2, 6, bpmsee, QWK_0I02YP, UNROTATED - VQWK, 2, 7, bpmsee, QWK_0I02YM, UNROTATED + VQWK, 2, 0, bcm, QWK_2_0 + VQWK, 2, 1, bcm, QWK_2_1 + VQWK, 2, 2, bcm, QWK_2_2 + VQWK, 2, 3, bcm, QWK_2_3 + VQWK, 2, 4, bpmstripline, QWK_SEE_1H04_XP, UNROTATED + VQWK, 2, 5, bpmstripline, QWK_SEE_1H04_XM, UNROTATED + VQWK, 2, 6, bpmstripline, QWK_SEE_1H04_YP, UNROTATED + VQWK, 2, 7, bpmstripline, QWK_SEE_1H04_YM, UNROTATED !ADC3 - VQWK, 3, 0, bpmcav, QWK_0I02AXP, UNROTATED - VQWK, 3, 1, bpmcav, QWK_0I02AXM, UNROTATED - VQWK, 3, 2, bpmcav, QWK_0I02AYP, UNROTATED - VQWK, 3, 3, ble, QWK_0I02AYM, UNROTATED - VQWK, 3, 4, bpmcav, QWK_0I05XP, UNROTATED - VQWK, 3, 5, bpmcav, QWK_0I05XM, UNROTATED - VQWK, 3, 6, bpmcav, QWK_0I05YP, UNROTATED - VQWK, 3, 7, ble, QWK_0I05YM, UNROTATED + VQWK, 3, 0, bpmcav, QWK_CAV_1H04A_X + VQWK, 3, 1, bpmcav, QWK_CAV_1H04A_Y + VQWK, 3, 2, bpmcav, QWK_CAV_1H04A_Q + VQWK, 3, 3, bcm, QWK_3_3 + VQWK, 3, 4, bpmcav, QWK_CAV_1H04B_X + VQWK, 3, 5, bpmcav, QWK_CAV_1H04B_Y + VQWK, 3, 6, bpmcav, QWK_CAV_1H04B_Q + VQWK, 3, 7, bcm, QWK_3_7 !ADC4 - VQWK, 4, 0, bpmcav, QWK_0I07XP, UNROTATED - VQWK, 4, 1, bpmcav, QWK_0I07XM, UNROTATED - VQWK, 4, 2, bpmcav, QWK_0I07YP, UNROTATED - VQWK, 4, 3, ble, QWK_0I07YM, UNROTATED - VQWK, 4, 4, ble, QWK_0L01XP - VQWK, 4, 5, ble, QWK_0L01XM - VQWK, 4, 6, ble, QWK_0L01YP - VQWK, 4, 7, ble, QWK_0L01YM + VQWK, 4, 0, bpmcav, QWK_CAV_1H04C_X + VQWK, 4, 1, bpmcav, QWK_CAV_1H04C_Y + VQWK, 4, 2, bpmcav, QWK_CAV_1H04C_Q + VQWK, 4, 3, bcm, QWK_4_3 + VQWK, 4, 4, bcm, QWK_4_4 + VQWK, 4, 5, bcm, QWK_4_5 + VQWK, 4, 6, bcm, QWK_4_6 + VQWK, 4, 7, bcm, QWK_4_7 [PUBLISH] +! what is this? q_targ, bcm, qwk_bcm0l02, c diff --git a/Parity/prminput/prexinj_beamline.map b/Parity/prminput/prexinj_beamline.map index 29368e3bf..bb9a6a31c 100644 --- a/Parity/prminput/prexinj_beamline.map +++ b/Parity/prminput/prexinj_beamline.map @@ -27,7 +27,7 @@ sample_size=464 VQWK, 0, 4, bcm, QWK_BCM0L02 VQWK, 0, 5, bcm, QWK_Batery6 VQWK, 0, 6, bcm, QWK_Batery7 - VQWK, 0, 7, bcm, PhaseMonitor + VQWK, 0, 7, bcm, PhaseMonitor !ADC1 @@ -140,7 +140,7 @@ sample_size=464 ! VQWK, 11, 4, bcm, QWK_BCM0L02 ! VQWK, 11, 5, bcm, QWK_Batery6 ! VQWK, 11, 6, bcm, QWK_Batery7 -! VQWK, 11, 7, bcm, PhaseMonitor +! VQWK, 11, 7, bcm, PhaseMonitor [PUBLISH] From b4dffb6695e92fc6544ee5f0525281cdca1832c6 Mon Sep 17 00:00:00 2001 From: Your Name Date: Mon, 5 Nov 2018 11:57:26 -0500 Subject: [PATCH 007/137] Ammended the names in the CH config file a bit more and removed BCMs from the geometry file since they don't have geometry information attributed to them. --- Parity/prminput/prexCH_beamline.map | 22 +++++++++---------- Parity/prminput/prexCH_beamline_geometry.map | 23 ++------------------ 2 files changed, 13 insertions(+), 32 deletions(-) diff --git a/Parity/prminput/prexCH_beamline.map b/Parity/prminput/prexCH_beamline.map index 08bb39ab8..a2abae542 100644 --- a/Parity/prminput/prexCH_beamline.map +++ b/Parity/prminput/prexCH_beamline.map @@ -12,8 +12,8 @@ sample_size=464 !ADC0 VQWK, 0, 0, bcm, QWK_0_0 VQWK, 0, 1, bcm, QWK_0_1 - VQWK, 0, 2, bcm, BCM_US - VQWK, 0, 3, bcm, BCM_DS + VQWK, 0, 2, bcm, QWK_BCM_US + VQWK, 0, 3, bcm, QWK_BCM_DS VQWK, 0, 4, bcm, QWK_0_4 VQWK, 0, 5, bcm, QWK_0_5 VQWK, 0, 6, bcm, QWK_0_6 @@ -40,19 +40,19 @@ sample_size=464 VQWK, 2, 7, bpmstripline, QWK_SEE_1H04_YM, UNROTATED !ADC3 - VQWK, 3, 0, bpmcav, QWK_CAV_1H04A_X - VQWK, 3, 1, bpmcav, QWK_CAV_1H04A_Y - VQWK, 3, 2, bpmcav, QWK_CAV_1H04A_Q + VQWK, 3, 0, bcm, QWK_CAV_1H04A_X + VQWK, 3, 1, bcm, QWK_CAV_1H04A_Y + VQWK, 3, 2, bcm, QWK_CAV_1H04A_Q VQWK, 3, 3, bcm, QWK_3_3 - VQWK, 3, 4, bpmcav, QWK_CAV_1H04B_X - VQWK, 3, 5, bpmcav, QWK_CAV_1H04B_Y - VQWK, 3, 6, bpmcav, QWK_CAV_1H04B_Q + VQWK, 3, 4, bcm, QWK_CAV_1H04B_X + VQWK, 3, 5, bcm, QWK_CAV_1H04B_Y + VQWK, 3, 6, bcm, QWK_CAV_1H04B_Q VQWK, 3, 7, bcm, QWK_3_7 !ADC4 - VQWK, 4, 0, bpmcav, QWK_CAV_1H04C_X - VQWK, 4, 1, bpmcav, QWK_CAV_1H04C_Y - VQWK, 4, 2, bpmcav, QWK_CAV_1H04C_Q + VQWK, 4, 0, bcm, QWK_CAV_1H04C_X + VQWK, 4, 1, bcm, QWK_CAV_1H04C_Y + VQWK, 4, 2, bcm, QWK_CAV_1H04C_Q VQWK, 4, 3, bcm, QWK_4_3 VQWK, 4, 4, bcm, QWK_4_4 VQWK, 4, 5, bcm, QWK_4_5 diff --git a/Parity/prminput/prexCH_beamline_geometry.map b/Parity/prminput/prexCH_beamline_geometry.map index 26835304a..1624c6d43 100644 --- a/Parity/prminput/prexCH_beamline_geometry.map +++ b/Parity/prminput/prexCH_beamline_geometry.map @@ -32,26 +32,7 @@ !!!!! 0L and 0R BPMs, BSEN scale = 18.76/18.81 = 0.99734184 !!!!! 2i BPMs, BSEN scale = 25.67 /18.81 = 1.3647 - bpmstripline, bpm0I01A, 0.0, 0.0, 0.0, 0.728336, 1.000000, 1.000000 unrotated - bpmstripline, bpm1I04, 0.0, 0.0, 0.0, 0.728336, 1.000000, 1.000000 unrotated - bpmstripline, bpm1I02, 0.0, 0.0, 0.0, 0.728336, 1.000000, 1.000000 unrotated - bpmstripline, bpm0I01, 0.0, 0.0, 0.0, 0.728336, 1.000000, 1.000000 unrotated - bpmstripline, bpm1I06, 0.0, 0.0, 0.0, 0.728336, 1.000000, 1.000000 unrotated - bpmstripline, bpm0I02, 0.0, 0.0, 0.0, 0.728336, 1.000000, 1.000000 unrotated - bpmstripline, bpm0I02A, 0.0, 0.0, 0.0, 0.728336, 1.000000, 1.000000 unrotated - bpmstripline, bpm0I05, 0.0, 0.0, 0.0, 0.728336, 1.000000, 1.000000 unrotated - bpmstripline, bpm0I07, 0.0, 0.0, 0.0, 0.728336, 1.000000, 1.000000 unrotated - bpmstripline, bpm0L01, 0.0, 0.0, 0.0, 0.99734184 1.000000, 1.000000 - bpmstripline, bpm0L02, 0.0, 0.0, 0.0, 0.99734184 1.000000, 1.000000 - bpmstripline, bpm0L03, 0.0, 0.0, 0.0, 0.99734184 1.000000, 1.000000 - bpmstripline, bpm0L04, 0.0, 0.0, 0.0, 0.99734184 1.000000, 1.000000 - bpmstripline, bpm0L05, 0.0, 0.0, 0.0, 0.99734184 1.000000, 1.000000 - bpmstripline, bpm0L06, 0.0, 0.0, 0.0, 0.99734184 1.000000, 1.000000 - bpmstripline, bpm0L07, 0.0, 0.0, 0.0, 0.99734184 1.000000, 1.000000 - bpmstripline, bpm0L08, 0.0, 0.0, 0.0, 0.99734184 1.000000, 1.000000 - bpmstripline, bpm0L09, 0.0, 0.0, 0.0, 0.99734184 1.000000, 1.000000 - bpmstripline, bpm0L10, 0.0, 0.0, 0.0, 0.99734184 1.000000, 1.000000 - bpmstripline, bpm2I02, 0.0, 0.0, 0.0, 1.3647, 1.000000, 1.000000 unrotated - bpmstripline, bpm2I01, 0.0, 0.0, 0.0, 1.3647, 1.000000, 1.000000 unrotated + bpmstripline, QWK_SEE_1H04D, 0.0, 0.0, 0.0, 1.0, 1.000000 1.000000 + bpmstripline, QWK_SEE_1H04, 0.0, 0.0, 0.0, 1.0, 1.000000 1.000000 !END From a511e155166ca7470e706f1697c33d3a35b342f0 Mon Sep 17 00:00:00 2001 From: Paul King Date: Mon, 5 Nov 2018 12:28:49 -0500 Subject: [PATCH 008/137] Added a "NO_DEFAULT_PATHS" to the library and header searches in the FindET.cmake module. That should make sure only the specified paths are checked (so we don't find the 32-bit compiled library instead of the special 64-bit compiled one). --- cmake/modules/FindET.cmake | 2 ++ 1 file changed, 2 insertions(+) diff --git a/cmake/modules/FindET.cmake b/cmake/modules/FindET.cmake index f277b6b3f..5c7ac9572 100644 --- a/cmake/modules/FindET.cmake +++ b/cmake/modules/FindET.cmake @@ -9,12 +9,14 @@ PATHS /adaqfs/home/apar/et-12.0/src/libsrc/.Linux-x86_64 # $ENV{CODA}/${arch}/lib # $ENV{CODA}/${CMAKE_SYSTEM_NAME}/lib + NO_DEFAULT_PATH DOC "Event Transport (ET) library" ) find_path(ET_INCLUDE_DIR NAMES et.h PATHS /adaqfs/home/apar/et-12.0/src/libsrc # $ENV{CODA}/common/include + NO_DEFAULT_PATH DOC "Event Transport (ET) header include directory" ) # endif() From 72681547679b2eb0f844e970a845dad869a00a0b Mon Sep 17 00:00:00 2001 From: Cameron Clarke Date: Wed, 7 Nov 2018 17:58:47 -0500 Subject: [PATCH 009/137] Settling on a simpler naming convention per today's analyzer meeting --- Parity/prminput/prexCH_beamline.map | 41 ++++++++++++++--------------- 1 file changed, 20 insertions(+), 21 deletions(-) diff --git a/Parity/prminput/prexCH_beamline.map b/Parity/prminput/prexCH_beamline.map index a2abae542..18659f362 100644 --- a/Parity/prminput/prexCH_beamline.map +++ b/Parity/prminput/prexCH_beamline.map @@ -12,18 +12,17 @@ sample_size=464 !ADC0 VQWK, 0, 0, bcm, QWK_0_0 VQWK, 0, 1, bcm, QWK_0_1 - VQWK, 0, 2, bcm, QWK_BCM_US - VQWK, 0, 3, bcm, QWK_BCM_DS + VQWK, 0, 2, bcm, BCM_US + VQWK, 0, 3, bcm, BCM_DS VQWK, 0, 4, bcm, QWK_0_4 VQWK, 0, 5, bcm, QWK_0_5 VQWK, 0, 6, bcm, QWK_0_6 VQWK, 0, 7, bcm, QWK_0_7 !ADC1 - VQWK, 1, 0, bpmstripline, QWK_SEE_1H04D_XP, UNROTATED - VQWK, 1, 1, bpmstripline, QWK_SEE_1H04D_XM, UNROTATED - VQWK, 1, 2, bpmstripline, QWK_SEE_1H04D_YP, UNROTATED - VQWK, 1, 3, bpmstripline, QWK_SEE_1H04D_YM, UNROTATED + VQWK, 1, 1, bpmstripline, BPME_XM + VQWK, 1, 2, bpmstripline, BPME_YP + VQWK, 1, 3, bpmstripline, BPME_YM VQWK, 1, 4, bcm, QWK_1_4 VQWK, 1, 5, bcm, QWK_1_5 VQWK, 1, 6, bcm, QWK_1_6 @@ -34,25 +33,25 @@ sample_size=464 VQWK, 2, 1, bcm, QWK_2_1 VQWK, 2, 2, bcm, QWK_2_2 VQWK, 2, 3, bcm, QWK_2_3 - VQWK, 2, 4, bpmstripline, QWK_SEE_1H04_XP, UNROTATED - VQWK, 2, 5, bpmstripline, QWK_SEE_1H04_XM, UNROTATED - VQWK, 2, 6, bpmstripline, QWK_SEE_1H04_YP, UNROTATED - VQWK, 2, 7, bpmstripline, QWK_SEE_1H04_YM, UNROTATED + VQWK, 2, 4, bpmstripline, BPMA_XP + VQWK, 2, 5, bpmstripline, BPMA_XM + VQWK, 2, 6, bpmstripline, BPMA_YP + VQWK, 2, 7, bpmstripline, BPMA_YM !ADC3 - VQWK, 3, 0, bcm, QWK_CAV_1H04A_X - VQWK, 3, 1, bcm, QWK_CAV_1H04A_Y - VQWK, 3, 2, bcm, QWK_CAV_1H04A_Q + VQWK, 3, 0, bcm, CAVB_X + VQWK, 3, 1, bcm, CAVB_Y + VQWK, 3, 2, bcm, CAVB_Q VQWK, 3, 3, bcm, QWK_3_3 - VQWK, 3, 4, bcm, QWK_CAV_1H04B_X - VQWK, 3, 5, bcm, QWK_CAV_1H04B_Y - VQWK, 3, 6, bcm, QWK_CAV_1H04B_Q + VQWK, 3, 4, bcm, CAVC_X + VQWK, 3, 5, bcm, CAVC_Y + VQWK, 3, 6, bcm, CAVC_Q VQWK, 3, 7, bcm, QWK_3_7 !ADC4 - VQWK, 4, 0, bcm, QWK_CAV_1H04C_X - VQWK, 4, 1, bcm, QWK_CAV_1H04C_Y - VQWK, 4, 2, bcm, QWK_CAV_1H04C_Q + VQWK, 4, 0, bcm, CAVD_X + VQWK, 4, 1, bcm, CAVD_Y + VQWK, 4, 2, bcm, CAVD_Q VQWK, 4, 3, bcm, QWK_4_3 VQWK, 4, 4, bcm, QWK_4_4 VQWK, 4, 5, bcm, QWK_4_5 @@ -61,5 +60,5 @@ sample_size=464 [PUBLISH] -! what is this? - q_targ, bcm, qwk_bcm0l02, c +! new.tree.variable.name, analysis.class, old.tree.variable.name, element.to.store + q_targ, bcm, BCM_US, c From 55988253e0abbcb93b54c4e55998674a841a2c46 Mon Sep 17 00:00:00 2001 From: Wouter Deconinck Date: Sun, 11 Nov 2018 17:38:03 -0500 Subject: [PATCH 010/137] Convert UInt_t to Long_t before taking difference and abs. Fixes #34. Since both reference_trig_time and fF1TDCDecoder.GetTDCHeaderTriggerTime() return a UInt_t and taking the difference is going to return a UInt_t as well, we should convert to Long_t first. Then the std::abs is well defined and doesn't fail to compile on gcc-8. --- Analysis/src/QwF1TDContainer.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Analysis/src/QwF1TDContainer.cc b/Analysis/src/QwF1TDContainer.cc index b7097ab94..e6cf4e636 100755 --- a/Analysis/src/QwF1TDContainer.cc +++ b/Analysis/src/QwF1TDContainer.cc @@ -1609,7 +1609,7 @@ QwF1TDContainer::CheckDataIntegrity(const ROCID_t roc_id, UInt_t *buffer, UInt_t xor_setup_flag = fF1TDCDecoder.IsHeaderXorSetup(); trig_fifo_ok_flag = fF1TDCDecoder.IsNotHeaderTrigFIFO(); event_ok_flag = ( reference_event_num==fF1TDCDecoder.GetTDCHeaderEventNumber() ); - diff_trigger_time = abs( reference_trig_time-fF1TDCDecoder.GetTDCHeaderTriggerTime() ); + diff_trigger_time = abs( Long_t(reference_trig_time) - Long_t(fF1TDCDecoder.GetTDCHeaderTriggerTime()) ); trig_time_ok_flag = (diff_trigger_time == valid_trigger_time_offset[0]) From fc49dab1d3c89f306e8480beb416a723a9450e01 Mon Sep 17 00:00:00 2001 From: Wouter Deconinck Date: Mon, 12 Nov 2018 07:36:32 -0500 Subject: [PATCH 011/137] Avoid `using namespace std` by specifying std:: when needed. There are potential issues with `using namespace std`, in particular in header files like `THa*.h`. Functions like std::abs() can be called simply as abs() which may cause confusion when another header defines abs(). More detailed reasons: https://stackoverflow.com/questions/1452721/why-is-using-namespace-std-considered-bad-practice --- Parity/src/QwComptonElectronDetector.cc | 14 +++--- evio/include/THaCodaFile.h | 2 - evio/include/THaEtClient.h | 2 - evio/src/THaCodaFile.C | 66 ++++++++++++------------- 4 files changed, 39 insertions(+), 45 deletions(-) diff --git a/Parity/src/QwComptonElectronDetector.cc b/Parity/src/QwComptonElectronDetector.cc index 249e3f5cc..84a5238eb 100755 --- a/Parity/src/QwComptonElectronDetector.cc +++ b/Parity/src/QwComptonElectronDetector.cc @@ -42,8 +42,6 @@ #include "QwLog.h" #include "QwHistogramHelper.h" -using namespace std; - // Ugly, should go inside functions, seems undefined for running sum Int_t notGood=0,myrun; @@ -177,8 +175,8 @@ Int_t QwComptonElectronDetector::LoadChannelMap(TString mapfile) } // end of switch (dettype) else { notGood=notGood+1; - cout<<"***found an undefined data type "< -using namespace std; - class THaCodaFile : public THaCodaData { diff --git a/evio/include/THaEtClient.h b/evio/include/THaEtClient.h index aa1133b8c..707c0517c 100755 --- a/evio/include/THaEtClient.h +++ b/evio/include/THaEtClient.h @@ -33,8 +33,6 @@ #include #include "TString.h" -using namespace std; - // The ET memory file will have this prefix. The suffix is $SESSION. #define ETMEM_PREFIX "/tmp/et_sys_" diff --git a/evio/src/THaCodaFile.C b/evio/src/THaCodaFile.C index dac1be95a..7c78626d7 100755 --- a/evio/src/THaCodaFile.C +++ b/evio/src/THaCodaFile.C @@ -87,9 +87,9 @@ ClassImp(THaCodaFile) } } else { if(CODA_VERBOSE) { - cout << "codaRead ERROR: tried to access a file with handle = NULL" << endl; - cout << "You need to call codaOpen(filename)" << endl; - cout << "or use the constructor with (filename) arg" << endl; + std::cout << "codaRead ERROR: tried to access a file with handle = NULL" << std::endl; + std::cout << "You need to call codaOpen(filename)" << std::endl; + std::cout << "or use the constructor with (filename) arg" << std::endl; } fStatus = CODA_ERROR; } @@ -104,7 +104,7 @@ ClassImp(THaCodaFile) fStatus = evWrite(handle, evbuffer); staterr("write",fStatus); } else { - cout << "codaWrite ERROR: tried to access file with handle = NULL" << endl; + std::cout << "codaWrite ERROR: tried to access file with handle = NULL" << std::endl; fStatus = CODA_ERROR; } return fStatus; @@ -127,19 +127,19 @@ ClassImp(THaCodaFile) int i; if(output_file == filename) { if(CODA_VERBOSE) { - cout << "filterToFile: ERROR: "; - cout << "Input and output files cannot be same " << endl; - cout << "This is to protect you against overwriting data" << endl; + std::cout << "filterToFile: ERROR: "; + std::cout << "Input and output files cannot be same " << std::endl; + std::cout << "This is to protect you against overwriting data" << std::endl; } return CODA_ERROR; } FILE *fp; if ((fp = fopen(output_file.Data(),"r")) != NULL) { if(CODA_VERBOSE) { - cout << "filterToFile: ERROR: "; - cout << "Output file `" << output_file << "' exists " << endl; - cout << "You must remove it by hand first. " << endl; - cout << "This forces you to think and not overwrite data." << endl; + std::cout << "filterToFile: ERROR: "; + std::cout << "Output file `" << output_file << "' exists " << std::endl; + std::cout << "You must remove it by hand first. " << std::endl; + std::cout << "This forces you to think and not overwrite data." << std::endl; } fclose(fp); return CODA_ERROR; @@ -153,11 +153,11 @@ ClassImp(THaCodaFile) int evnum = rawbuff[4]; int oktofilt = 1; if (CODA_DEBUG) { - cout << "Input evtype " << dec << evtype; - cout << " evnum " << evnum << endl; - cout << "max_to_filt = " << max_to_filt << endl; - cout << "evtype size = " << evtypes[0] << endl; - cout << "evlist size = " << evlist[0] << endl; + std::cout << "Input evtype " << std::dec << evtype; + std::cout << " evnum " << evnum << std::endl; + std::cout << "max_to_filt = " << max_to_filt << std::endl; + std::cout << "evtype size = " << evtypes[0] << std::endl; + std::cout << "evlist size = " << evlist[0] << std::endl; } if ( evtypes[0] > 0 ) { oktofilt = 0; @@ -182,13 +182,13 @@ Cont2: if (oktofilt) { nfilt++; if (CODA_DEBUG) { - cout << "Filtering event, nfilt " << dec << nfilt << endl; + std::cout << "Filtering event, nfilt " << std::dec << nfilt << std::endl; } fStatus = fout->codaWrite(getEvBuffer()); if (fStatus != S_SUCCESS) { if (CODA_VERBOSE) { - cout << "Error in filterToFile ! " << endl; - cout << "codaWrite returned status " << fStatus << endl; + std::cout << "Error in filterToFile ! " << std::endl; + std::cout << "codaWrite returned status " << fStatus << std::endl; } goto Finish; } @@ -259,42 +259,42 @@ void THaCodaFile::staterr(TString tried_to, int status) { // and the user has to pay attention to why. if (status == S_SUCCESS) return; // everything is fine. if (tried_to == "open") { - cout << "THaCodaFile: ERROR opening file = " << filename << endl; - cout << "Most likely errors are: " << endl; - cout << " 1. You mistyped the name of file ?" << endl; - cout << " 2. The file has length zero ? " << endl; + std::cout << "THaCodaFile: ERROR opening file = " << filename << std::endl; + std::cout << "Most likely errors are: " << std::endl; + std::cout << " 1. You mistyped the name of file ?" << std::endl; + std::cout << " 2. The file has length zero ? " << std::endl; } switch (status) { case S_EVFILE_TRUNC : - cout << "THaCodaFile ERROR: Truncated event on file read" << endl; - cout << "Evbuffer size is too small. Job aborted." << endl; + std::cout << "THaCodaFile ERROR: Truncated event on file read" << std::endl; + std::cout << "Evbuffer size is too small. Job aborted." << std::endl; exit(0); // If this ever happens, recompile with MAXEVLEN // bigger, and mutter under your breath at the author. case S_EVFILE_BADBLOCK : - cout << "Bad block number encountered " << endl; + std::cout << "Bad block number encountered " << std::endl; break; case S_EVFILE_BADHANDLE : - cout << "Bad handle (file/stream not open) " << endl; + std::cout << "Bad handle (file/stream not open) " << std::endl; break; case S_EVFILE_ALLOCFAIL : - cout << "Failed to allocate event I/O" << endl; + std::cout << "Failed to allocate event I/O" << std::endl; break; case S_EVFILE_BADFILE : - cout << "File format error" << endl; + std::cout << "File format error" << std::endl; break; case S_EVFILE_UNKOPTION : - cout << "Unknown option specified" << endl; + std::cout << "Unknown option specified" << std::endl; break; case S_EVFILE_UNXPTDEOF : - cout << "Unexpected end of file while reading event" << endl; + std::cout << "Unexpected end of file while reading event" << std::endl; break; case EOF: if(CODA_VERBOSE) { - cout << "Normal end of file " << filename << " encountered" << endl; + std::cout << "Normal end of file " << filename << " encountered" << std::endl; } break; default: - cout << "Error status 0x" << hex << status << endl; + std::cout << "Error status 0x" << std::hex << status << std::endl; } }; From b509de7467133229812e3fc65c6412a0d8d4b2a5 Mon Sep 17 00:00:00 2001 From: Wouter Deconinck Date: Mon, 12 Nov 2018 07:57:04 -0500 Subject: [PATCH 012/137] #include is preferred over #include in C++. The old math.h header uses C syntax which imports the functions in the global namespace (rather, C does not have namespaces, so any C headers included in a C++ program will end up in global namespace). By using the C++ header cmath, the functions will be loaded in the std namespace. --- Analysis/include/QwF1TDContainer.h | 2 +- Analysis/src/MQwF1TDC.cc | 2 +- Analysis/src/QwEPICSEvent.cc | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Analysis/include/QwF1TDContainer.h b/Analysis/include/QwF1TDContainer.h index 53e971cc2..df4efd6e9 100755 --- a/Analysis/include/QwF1TDContainer.h +++ b/Analysis/include/QwF1TDContainer.h @@ -8,7 +8,7 @@ */ #include -#include +#include #include "QwTypes.h" diff --git a/Analysis/src/MQwF1TDC.cc b/Analysis/src/MQwF1TDC.cc index edb94d6d8..e11327c72 100755 --- a/Analysis/src/MQwF1TDC.cc +++ b/Analysis/src/MQwF1TDC.cc @@ -10,7 +10,7 @@ #include "QwColor.h" #include "QwLog.h" -#include +#include const UInt_t MQwF1TDC::kF1Mask_SlotNumber = 0xf8000000; diff --git a/Analysis/src/QwEPICSEvent.cc b/Analysis/src/QwEPICSEvent.cc index 23cbb4ae1..10e7c9446 100755 --- a/Analysis/src/QwEPICSEvent.cc +++ b/Analysis/src/QwEPICSEvent.cc @@ -3,7 +3,7 @@ // System headers #include #include -#include +#include // ROOT headers #include "TObject.h" From ebb1ceed12739a74d249972262fc4f455a9885fd Mon Sep 17 00:00:00 2001 From: Wouter Deconinck Date: Mon, 12 Nov 2018 09:41:48 -0500 Subject: [PATCH 013/137] Dockerfile and travis-ci config to build japan in the cloud. Dockerfile builds a docker image based on jlabce:2.2. Adds boost libraries and compiles. Running syntax: docker run jeffersonlab/japan 'qwparity -h' .travis.yml just instructs travis-ci.org to build the docker image and push it to docker hub at https://hub.docker.com/r/jeffersonlab/japan/ Since a docker image is already on docker hub, the following commands should already work: If you have root access or are in the right group (typically docker) docker run jeffersonlab/japan 'qwparity -h' or in singularity for userspace (e.g. on ifarm or institutional systems) singularity run docker://jeffersonlab/japan:latest --- .travis.yml | 22 ++++++++++++++++++++++ Dockerfile | 36 ++++++++++++++++++++++++++++++++++++ 2 files changed, 58 insertions(+) create mode 100644 .travis.yml create mode 100644 Dockerfile diff --git a/.travis.yml b/.travis.yml new file mode 100644 index 000000000..b67949f9b --- /dev/null +++ b/.travis.yml @@ -0,0 +1,22 @@ +sudo: required +services: +- docker + +language: cpp +compiler: gcc + +before_install: +- docker build -t jeffersonlab/japan . +- docker run jeffersonlab/japan +- docker ps -a + +after_success: +- docker login -u "$DOCKER_USERNAME" -p "$DOCKER_PASSWORD"; +- if [ "$TRAVIS_BRANCH" == "master" ] ; then + docker tag jeffersonlab/japan jeffersonlab/japan:latest ; + docker push jeffersonlab/japan:latest ; + else + docker tag jeffersonlab/japan jeffersonlab/japan:$TRAVIS_BRANCH ; + docker push jeffersonlab/japan:$TRAVIS_BRANCH ; + fi + diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 000000000..8aebc03f2 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,36 @@ +FROM jeffersonlab/jlabce:2.2 + +ENV JLAB_VERSION=2.2 +ENV JLAB_ROOT=/jlab +ENV JLAB_SOFTWARE=/jlab/2.2/Linux_CentOS7.5.1804-x86_64-gcc4.8.5 + +ENV JAPAN=/usr/local/japan + +WORKDIR $JAPAN + +# Dependencies +RUN yum install -y \ + boost-devel boost-program-options boost-filesystem boost-system boost-regex \ + mysql++-devel mysql++ + +# Compile japan +ADD . . +RUN source $JLAB_ROOT/$JLAB_VERSION/ce/jlab.sh && \ + mkdir -p $JAPAN/build && \ + pushd $JAPAN/build && \ + cmake .. && \ + make -j$(nproc) && \ + make install && \ + popd + +# Create entry point bash script +RUN echo '#!/bin/bash' > /usr/local/bin/entrypoint.sh && \ + echo 'unset OSRELEASE' >> /usr/local/bin/entrypoint.sh && \ + echo 'source $JLAB_ROOT/$JLAB_VERSION/ce/jlab.sh' >> /usr/local/bin/entrypoint.sh && \ + echo 'export PATH=${JAPAN}/bin:${PATH}' >> /usr/local/bin/entrypoint.sh && \ + echo 'export QWANALYSIS=${JAPAN}' >> /usr/local/bin/entrypoint.sh && \ + echo 'cd $JAPAN && exec $1' >> /usr/local/bin/entrypoint.sh && \ + chmod +x /usr/local/bin/entrypoint.sh + +ENTRYPOINT ["/usr/local/bin/entrypoint.sh"] + From 5a0c05f0ddcdf782b1b910cc95370dffac2f6498 Mon Sep 17 00:00:00 2001 From: Wouter Deconinck Date: Mon, 12 Nov 2018 10:00:25 -0500 Subject: [PATCH 014/137] Travis-ci wants a script stanza or it takes a stab and fails. --- .travis.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.travis.yml b/.travis.yml index b67949f9b..d4b18fbfa 100644 --- a/.travis.yml +++ b/.travis.yml @@ -10,6 +10,8 @@ before_install: - docker run jeffersonlab/japan - docker ps -a +script: + after_success: - docker login -u "$DOCKER_USERNAME" -p "$DOCKER_PASSWORD"; - if [ "$TRAVIS_BRANCH" == "master" ] ; then From 661c56b500102c19f7ceeed5d28915d913a918ac Mon Sep 17 00:00:00 2001 From: Wouter Deconinck Date: Mon, 12 Nov 2018 10:12:36 -0500 Subject: [PATCH 015/137] Travis does want script to do something, so build docker image there. --- .travis.yml | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/.travis.yml b/.travis.yml index d4b18fbfa..ebfaa0bcb 100644 --- a/.travis.yml +++ b/.travis.yml @@ -2,15 +2,8 @@ sudo: required services: - docker -language: cpp -compiler: gcc - -before_install: -- docker build -t jeffersonlab/japan . -- docker run jeffersonlab/japan -- docker ps -a - script: +- docker build -t jeffersonlab/japan . after_success: - docker login -u "$DOCKER_USERNAME" -p "$DOCKER_PASSWORD"; From f9daa6bc3038e589678cd1c60b8f3edc2c90faef Mon Sep 17 00:00:00 2001 From: Paul King Date: Mon, 12 Nov 2018 14:51:44 -0500 Subject: [PATCH 016/137] Added a "NO_DEFAULT_PATH" in the find_program command for "rootcint", which is sometimes needed if ROOT is installed in multiple paths. --- cmake/modules/FindROOT.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cmake/modules/FindROOT.cmake b/cmake/modules/FindROOT.cmake index 646e511b4..fe373b3b9 100755 --- a/cmake/modules/FindROOT.cmake +++ b/cmake/modules/FindROOT.cmake @@ -49,7 +49,7 @@ endif() include(CMakeParseArguments) -find_program(ROOTCINT_EXECUTABLE rootcint PATHS $ENV{ROOTSYS}/bin) +find_program(ROOTCINT_EXECUTABLE rootcint PATHS $ENV{ROOTSYS}/bin NO_DEFAULT_PATH) #---------------------------------------------------------------------------- # function ROOT_GENERATE_DICTIONARY( dictionary From 6fd323ed2b6cecea75673a61ce184985a2ff7c44 Mon Sep 17 00:00:00 2001 From: Wouter Deconinck Date: Tue, 13 Nov 2018 13:29:10 -0500 Subject: [PATCH 017/137] Ignore lib directory (created by make install) --- .gitignore | 1 + 1 file changed, 1 insertion(+) diff --git a/.gitignore b/.gitignore index 1d057b7b2..93ecf1176 100644 --- a/.gitignore +++ b/.gitignore @@ -38,6 +38,7 @@ qwparity_simple qwroot # Directories +lib build output Doxygen/html From bf7346e9b58771f95cd88ce343c26873c8b948bd Mon Sep 17 00:00:00 2001 From: Wouter Deconinck Date: Tue, 13 Nov 2018 13:30:16 -0500 Subject: [PATCH 018/137] Build docker image with respect to JLab CE 2.3 --- Dockerfile | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Dockerfile b/Dockerfile index 8aebc03f2..d98f7e93a 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,8 +1,8 @@ -FROM jeffersonlab/jlabce:2.2 +FROM jeffersonlab/jlabce:2.3 -ENV JLAB_VERSION=2.2 +ENV JLAB_VERSION=2.3 ENV JLAB_ROOT=/jlab -ENV JLAB_SOFTWARE=/jlab/2.2/Linux_CentOS7.5.1804-x86_64-gcc4.8.5 +ENV JLAB_SOFTWARE=/jlab/2.3/Linux_CentOS7.2.1511-x86_64-gcc4.8.5 ENV JAPAN=/usr/local/japan From 135ca0b015e4efca1ddf7876561699b389d508d0 Mon Sep 17 00:00:00 2001 From: Your Name Date: Wed, 14 Nov 2018 09:07:41 -0500 Subject: [PATCH 019/137] temp remove q_targ from publish --- Parity/prminput/prexCH_beamline.map | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Parity/prminput/prexCH_beamline.map b/Parity/prminput/prexCH_beamline.map index a2abae542..67370a249 100644 --- a/Parity/prminput/prexCH_beamline.map +++ b/Parity/prminput/prexCH_beamline.map @@ -62,4 +62,4 @@ sample_size=464 [PUBLISH] ! what is this? - q_targ, bcm, qwk_bcm0l02, c +! q_targ, bcm, qwk_bcm0l02, c From 1ba9fe6ce5a177ec7cb3a8df3ec8bb37b1a4cb31 Mon Sep 17 00:00:00 2001 From: Your Name Date: Thu, 15 Nov 2018 09:01:27 -0500 Subject: [PATCH 020/137] add rootfiles, old db files, random txt files, any build directory and stuff containting test --- .gitignore | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/.gitignore b/.gitignore index 93ecf1176..14f598e64 100644 --- a/.gitignore +++ b/.gitignore @@ -39,13 +39,17 @@ qwroot # Directories lib -build +*build +*test* output Doxygen/html # output *.tar.gz *.tar +*.root +*.db +*.txt #tmp files *~ From 1d3934ce34a2d6418f94485660417500336520de Mon Sep 17 00:00:00 2001 From: cipriangal Date: Thu, 15 Nov 2018 13:34:38 -0500 Subject: [PATCH 021/137] add channel 1,0. change names so that beamline_geometry is happy --- Parity/prminput/prexCH_beamline.map | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/Parity/prminput/prexCH_beamline.map b/Parity/prminput/prexCH_beamline.map index 18659f362..d2ccff9a8 100644 --- a/Parity/prminput/prexCH_beamline.map +++ b/Parity/prminput/prexCH_beamline.map @@ -20,9 +20,10 @@ sample_size=464 VQWK, 0, 7, bcm, QWK_0_7 !ADC1 - VQWK, 1, 1, bpmstripline, BPME_XM - VQWK, 1, 2, bpmstripline, BPME_YP - VQWK, 1, 3, bpmstripline, BPME_YM + VQWK, 1, 0, bpmstripline, BPM4Exp + VQWK, 1, 1, bpmstripline, BPM4Exm + VQWK, 1, 2, bpmstripline, BPM4Eyp + VQWK, 1, 3, bpmstripline, BPM4Eym VQWK, 1, 4, bcm, QWK_1_4 VQWK, 1, 5, bcm, QWK_1_5 VQWK, 1, 6, bcm, QWK_1_6 @@ -33,10 +34,10 @@ sample_size=464 VQWK, 2, 1, bcm, QWK_2_1 VQWK, 2, 2, bcm, QWK_2_2 VQWK, 2, 3, bcm, QWK_2_3 - VQWK, 2, 4, bpmstripline, BPMA_XP - VQWK, 2, 5, bpmstripline, BPMA_XM - VQWK, 2, 6, bpmstripline, BPMA_YP - VQWK, 2, 7, bpmstripline, BPMA_YM + VQWK, 2, 4, bpmstripline, BPM4Axp + VQWK, 2, 5, bpmstripline, BPM4Axm + VQWK, 2, 6, bpmstripline, BPM4Ayp + VQWK, 2, 7, bpmstripline, BPM4Aym !ADC3 VQWK, 3, 0, bcm, CAVB_X @@ -61,4 +62,4 @@ sample_size=464 [PUBLISH] ! new.tree.variable.name, analysis.class, old.tree.variable.name, element.to.store - q_targ, bcm, BCM_US, c + q_targ, bcm, BCM_US, c From c9f44d47b2ca84156542db55d83373906b475e8f Mon Sep 17 00:00:00 2001 From: cipriangal Date: Thu, 15 Nov 2018 13:35:22 -0500 Subject: [PATCH 022/137] default with no cuts. remove old imported cuts from injector. set default current cut for CH --- Parity/prminput/prexCH_beamline_eventcuts.map | 44 +++---------------- 1 file changed, 5 insertions(+), 39 deletions(-) diff --git a/Parity/prminput/prexCH_beamline_eventcuts.map b/Parity/prminput/prexCH_beamline_eventcuts.map index b92e41436..fcec62963 100644 --- a/Parity/prminput/prexCH_beamline_eventcuts.map +++ b/Parity/prminput/prexCH_beamline_eventcuts.map @@ -1,12 +1,11 @@ -!This file contains beamline event cut properties last updated 10/27/2009 based on run 752/755 - +!This file contains beamline event cut properties !********************************************************************************************* !Global switch to turn ON and OFF eventcut check !Available settings !*************************************************** !To turn OFF all checks -! EVENTCUTS = 0 +EVENTCUTS = 0 !*************************************************** !To turn OFF event cuts and perform only HW checks @@ -18,7 +17,7 @@ !*************************************************** !To turn do both event cuts and HW checks and only flag event cut failed events -EVENTCUTS = 3 +!EVENTCUTS = 3 !IMPORTANT !--------- @@ -28,16 +27,8 @@ EVENTCUTS = 3 !*************************************************** !for bcm devices !device_type, device_name, lower limit, upper limit, local(l)/global(g), stability percentage - -bcm, qwk_bcm0l02, 1, 1000000, l, 0 -!bcm, empty1, -2.420e+6, -2.390e+6 -!bcm, empty1, 0, 0, 1, 0 -!bcm, empty2, 0, 0, 1, 0 - -!bcm, qwk_batext1, 0, 0, 1, 0 + bcm, bcmUS, 1, 1e6, l, 0 -!bcm, qwk_batext2, 0, 0, 1, 0 -!for 752 & 755 !for parity mock data run 1000 9.98608e+06 !bcm, qwk_bcm0l03, 8.00e+06, 1.20e+07, 1, 0 @@ -54,33 +45,8 @@ bcm, qwk_bcm0l02, 1, 1000000, l, 0 !So pedestals are applied before appyling the cuts. !device_type, device_name, channel_name, lower limit, upper limit, local(l)/global(g), stability percentage - +! the following line is an example !bpmstripline, qwk_qpd, relx, 2.67319, 4.45531 -!bpmstripline, qwk_qpd, rely, 1.31491, 2.19152 - -!bpmstripline, qwk_1i02, absx, 10, 100000, l, 0 -!bpmstripline, qwk_1i02, xp, 1, 3, l, 0 -!bpmstripline, qwk_1i02, yp, 10, 20, l, 0 -!bpmstripline, qwk_1i04, relx, 0, 0, l, 0 -!bpmstripline, qwk_1i06, relx, 0, 0, l, 0 -!bpmstripline, qwk_0i02, relx, 0, 0, l, 0 -!bpmstripline, qwk_0i02a, relx, 0, 0, l, 0 -!bpmstripline, qwk_0i05, relx, 0, 0, l, 0 -!bpmstripline, qwk_0i07, relx, 0, 0, l, 0 -!bpmstripline, qwk_0l01, relx, 0, 0, l, 0 -!bpmstripline, qwk_0l02, relx, 0, 0, l, 0 -!bpmstripline, qwk_0l03, relx, 0, 0, l, 0 -!bpmstripline, qwk_0l04, relx, 0, 0, l, 0 -!bpmstripline, qwk_0l05, relx, 0, 0, l, 0 -!bpmstripline, qwk_0l06, relx, 0, 0, l, 0 -!bpmstripline, qwk_0l07, relx, 0, 0, l, 0 -!bpmstripline, qwk_0l08, relx, 0, 0, l, 0 -!bpmstripline, qwk_0l09, relx, 0, 0, l, 0 -!bpmstripline, qwk_0l1, relx0, 0, 0, l, 0 -!bpmstripline, qwk_0r01, relx, 0, 0, l, 0 -!bpmstripline, qwk_0r02, relx, 0, 0, l, 0 -!bpmstripline, qwk_0r05, relx, 0, 0, l, 0 -!bpmstripline, qwk_0r06, relx, 0, 0, l, 0 From 3109133abc7582c60a6b88906699dc4f47a9c050 Mon Sep 17 00:00:00 2001 From: cipriangal Date: Thu, 15 Nov 2018 13:36:10 -0500 Subject: [PATCH 023/137] update geometry file according default convention --- Parity/prminput/prexCH_beamline_geometry.map | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Parity/prminput/prexCH_beamline_geometry.map b/Parity/prminput/prexCH_beamline_geometry.map index 1624c6d43..2c9006cec 100644 --- a/Parity/prminput/prexCH_beamline_geometry.map +++ b/Parity/prminput/prexCH_beamline_geometry.map @@ -32,7 +32,7 @@ !!!!! 0L and 0R BPMs, BSEN scale = 18.76/18.81 = 0.99734184 !!!!! 2i BPMs, BSEN scale = 25.67 /18.81 = 1.3647 - bpmstripline, QWK_SEE_1H04D, 0.0, 0.0, 0.0, 1.0, 1.000000 1.000000 - bpmstripline, QWK_SEE_1H04, 0.0, 0.0, 0.0, 1.0, 1.000000 1.000000 + bpmstripline, bpm4A, 0.0, 0.0, 0.0, 1.0, 1.000000 1.000000 + bpmstripline, bpm4E, 0.0, 0.0, 0.0, 1.0, 1.000000 1.000000 !END From 2ae5eb5cf27b1e2b30d0ccb51bf3de52d8bfea52 Mon Sep 17 00:00:00 2001 From: cipriangal Date: Thu, 15 Nov 2018 13:36:55 -0500 Subject: [PATCH 024/137] for now no helicity info. the code assumes +--+. FIXME: this needs to be updated --- Parity/prminput/prexCH_detectors.map | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Parity/prminput/prexCH_detectors.map b/Parity/prminput/prexCH_detectors.map index dbd1ea082..17e298111 100644 --- a/Parity/prminput/prexCH_detectors.map +++ b/Parity/prminput/prexCH_detectors.map @@ -7,6 +7,6 @@ eventcut = prexCH_beamline_eventcuts.map param = prexCH_beamline_pedestal.map -[QwHelicity] - name = Helicity info - map = prexCH_helicity.map +![QwHelicity] +! name = Helicity info +! map = prexCH_helicity.map From 61c7256c204a29859d094a096bca1962c495f6ba Mon Sep 17 00:00:00 2001 From: cipriangal Date: Thu, 15 Nov 2018 13:37:54 -0500 Subject: [PATCH 025/137] this is what we are currently running. the helicity info may be in the flexio, will need to investigate. FIXME: needs to be updated --- Parity/prminput/prexCH_helicity.map | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Parity/prminput/prexCH_helicity.map b/Parity/prminput/prexCH_helicity.map index fd97d3c16..eab51430f 100644 --- a/Parity/prminput/prexCH_helicity.map +++ b/Parity/prminput/prexCH_helicity.map @@ -26,7 +26,7 @@ HelicityDecodingMode=InputRegisterMode ! Set the patternPhase (number of windows in a pattern) for each run range. ! If patternPhase!=4, then also set the NumberPatternsDelayed ! so the reported helicity is delayed by 8 windows (default 2). -!NumberPatternsDelayed=4 +NumberPatternsDelayed=8 PatternPhase=4 @@ -40,7 +40,7 @@ PATTERNPHASEOFFSET=0 !seed size is either 24 bit or 30 bit. default is 30 bit !RandSeedBits=24 -ROC=24 +ROC=23 MarkerWord=0x00003103 ! From c09a5e17cd3f8a2ef1514a4618954b6278de44ba Mon Sep 17 00:00:00 2001 From: Wouter Deconinck Date: Tue, 13 Nov 2018 14:51:18 -0500 Subject: [PATCH 026/137] Remove references to "Tracking" --- CMakeLists.txt | 4 ---- 1 file changed, 4 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index bbb584c88..854c6df83 100755 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -31,20 +31,17 @@ include_directories( ${CMAKE_CURRENT_SOURCE_DIR}/evio/include ${CMAKE_CURRENT_SOURCE_DIR}/Parity/include ${CMAKE_CURRENT_SOURCE_DIR}/Analysis/include - ${CMAKE_CURRENT_SOURCE_DIR}/Tracking/include ) # Put all QwAnalysis files in my_project_sources file(GLOB my_project_headers ${CMAKE_CURRENT_SOURCE_DIR}/Analysis/include/*.h ${CMAKE_CURRENT_SOURCE_DIR}/Parity/include/*.h - ${CMAKE_CURRENT_SOURCE_DIR}/Tracking/include/*.h ${CMAKE_CURRENT_BINARY_DIR}/include/QwSVNVersion.h ) file(GLOB my_project_sources ### ${CMAKE_CURRENT_SOURCE_DIR}/Analysis/src/*.cc ${CMAKE_CURRENT_SOURCE_DIR}/Parity/src/*.cc - ${CMAKE_CURRENT_SOURCE_DIR}/Tracking/src/*.cc ) list(APPEND my_project_sources ${CMAKE_CURRENT_SOURCE_DIR}/Analysis/src/MQwCodaControlEvent.cc @@ -222,7 +219,6 @@ install(FILES ${pcmfiles} DESTINATION ${CMAKE_SOURCE_DIR}/lib) file(GLOB exefiles ${CMAKE_SOURCE_DIR}/Parity/main/*.cc ${CMAKE_SOURCE_DIR}/Analysis/main/*.cc - ${CMAKE_SOURCE_DIR}/Tracking/main/*.cc ) foreach(file ${exefiles}) get_filename_component(filename ${file} NAME_WE) From c5bb2910c1224a3af87dbe7c13ea25e8aab2e064 Mon Sep 17 00:00:00 2001 From: Wouter Deconinck Date: Tue, 20 Nov 2018 10:31:51 -0500 Subject: [PATCH 027/137] Append to CMAKE_MODULE_PATH instead of overwrite --- CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 854c6df83..47b1a6c87 100755 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -23,7 +23,7 @@ if(${CMAKE_SYSTEM_NAME} MATCHES "Darwin") endif() # Local path for cmake modules, before ${CMAKE_ROOT}/Modules/ is checked -set(CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/cmake/modules") +list(APPEND CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/cmake/modules/") # Add the project include directory include_directories( From a92ffb0b93fd1d420688f98b81c1ccb336bee2eb Mon Sep 17 00:00:00 2001 From: Wouter Deconinck Date: Tue, 20 Nov 2018 10:32:08 -0500 Subject: [PATCH 028/137] Remove FindROOT in favor of system installed --- CMakeLists.txt | 3 +- cmake/modules/FindROOT.cmake | 99 ------------------------------------ 2 files changed, 1 insertion(+), 101 deletions(-) delete mode 100755 cmake/modules/FindROOT.cmake diff --git a/CMakeLists.txt b/CMakeLists.txt index 47b1a6c87..b81af521d 100755 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -86,8 +86,7 @@ file(GLOB my_evio_sources # Load ROOT and setup include directory find_package(ROOT REQUIRED) -include_directories(${ROOT_INCLUDE_DIR}) -set(ROOT_LIBRARIES ${ROOT_LIBRARIES} -lNew -lGui -lMinuit2) +include(${ROOT_USE_FILE}) # Load MYSQLPP find_package(MYSQLPP) diff --git a/cmake/modules/FindROOT.cmake b/cmake/modules/FindROOT.cmake deleted file mode 100755 index fe373b3b9..000000000 --- a/cmake/modules/FindROOT.cmake +++ /dev/null @@ -1,99 +0,0 @@ -# - Finds ROOT instalation -# This module sets up ROOT information -# It defines: -# ROOT_FOUND If the ROOT is found -# ROOT_INCLUDE_DIR PATH to the include directory -# ROOT_LIBRARIES Most common libraries -# ROOT_LIBRARY_DIR PATH to the library directory - - -find_program(ROOT_CONFIG_EXECUTABLE root-config - PATHS $ENV{ROOTSYS}/bin NO_DEFAULT_PATH) - -if(NOT ROOT_CONFIG_EXECUTABLE) - set(ROOT_FOUND FALSE) -else() - set(ROOT_FOUND TRUE) - - execute_process( - COMMAND ${ROOT_CONFIG_EXECUTABLE} --prefix - OUTPUT_VARIABLE ROOTSYS - OUTPUT_STRIP_TRAILING_WHITESPACE) - - execute_process( - COMMAND ${ROOT_CONFIG_EXECUTABLE} --version - OUTPUT_VARIABLE ROOT_VERSION - OUTPUT_STRIP_TRAILING_WHITESPACE) - - execute_process( - COMMAND ${ROOT_CONFIG_EXECUTABLE} --incdir - OUTPUT_VARIABLE ROOT_INCLUDE_DIR - OUTPUT_STRIP_TRAILING_WHITESPACE) - - execute_process( - COMMAND ${ROOT_CONFIG_EXECUTABLE} --libs - OUTPUT_VARIABLE ROOT_LIBRARIES - OUTPUT_STRIP_TRAILING_WHITESPACE) - - #set(ROOT_LIBRARIES ${ROOT_LIBRARIES} -lThread -lMinuit -lHtml -lVMC -lEG -lGeom -lTreePlayer -lXMLIO -lProof) - #set(ROOT_LIBRARIES ${ROOT_LIBRARIES} -lProofPlayer -lMLP -lSpectrum -lEve -lRGL -lGed -lXMLParser -lPhysics) - set(ROOT_LIBRARY_DIR ${ROOTSYS}/lib) - - # Make variables changeble to the advanced user - mark_as_advanced(ROOT_CONFIG_EXECUTABLE) - - if(NOT ROOT_FIND_QUIETLY) - message(STATUS "Found ROOT ${ROOT_VERSION} in ${ROOTSYS}") - endif() -endif() - - -include(CMakeParseArguments) -find_program(ROOTCINT_EXECUTABLE rootcint PATHS $ENV{ROOTSYS}/bin NO_DEFAULT_PATH) - -#---------------------------------------------------------------------------- -# function ROOT_GENERATE_DICTIONARY( dictionary -# header1 header2 ... -# LINKDEF linkdef1 ... -# OPTIONS opt1...) -function(ROOT_GENERATE_DICTIONARY dictionary) - CMAKE_PARSE_ARGUMENTS(ARG "" "" "LINKDEF;OPTIONS" "" ${ARGN}) - #---Get the list of header files------------------------- - set(headerfiles) - foreach(fp ${ARG_UNPARSED_ARGUMENTS}) - file(GLOB files ${fp}) - if(files) - foreach(f ${files}) - if(NOT f MATCHES LinkDef) - set(headerfiles ${headerfiles} ${f}) - endif() - endforeach() - else() - set(headerfiles ${headerfiles} ${fp}) - endif() - endforeach() - #---Get the list of include directories------------------ - get_directory_property(incdirs INCLUDE_DIRECTORIES) - set(includedirs) - foreach( d ${incdirs}) - set(includedirs ${includedirs} -I${d}) - endforeach() - #---Get LinkDef.h file------------------------------------ - set(linkdefs) - foreach( f ${ARG_LINKDEF}) - if( IS_ABSOLUTE ${f}) - set(linkdefs ${linkdefs} ${f}) - else() - if(EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/inc/${f}) - set(linkdefs ${linkdefs} ${CMAKE_CURRENT_SOURCE_DIR}/inc/${f}) - else() - set(linkdefs ${linkdefs} ${CMAKE_CURRENT_SOURCE_DIR}/${f}) - endif() - endif() - endforeach() - #---call rootcint------------------------------------------ - add_custom_command(OUTPUT ${dictionary}.cxx ${dictionary}.h - COMMAND ${ROOTCINT_EXECUTABLE} -cint -f ${dictionary}.cxx - -c ${ARG_OPTIONS} ${includedirs} ${headerfiles} ${linkdefs} - DEPENDS ${headerfiles} ${linkdefs}) -endfunction() From 99c6fd959a487a3e28b1510c9f2c1d18b41566cb Mon Sep 17 00:00:00 2001 From: Wouter Deconinck Date: Tue, 20 Nov 2018 16:01:28 -0500 Subject: [PATCH 029/137] Small change to enable printing of all program options when no argument is given for all three executables. Resolves issue #43. --- Parity/main/QwMockDataGenerator.cc | 15 +++++++++++---- Parity/main/QwParity.cc | 23 ++++++++++++----------- Parity/main/QwParity_simple.cc | 23 ++++++++++++----------- 3 files changed, 35 insertions(+), 26 deletions(-) mode change 100755 => 100644 Parity/main/QwMockDataGenerator.cc mode change 100755 => 100644 Parity/main/QwParity.cc mode change 100755 => 100644 Parity/main/QwParity_simple.cc diff --git a/Parity/main/QwMockDataGenerator.cc b/Parity/main/QwMockDataGenerator.cc old mode 100755 new mode 100644 index 6df77c32f..792951a91 --- a/Parity/main/QwMockDataGenerator.cc +++ b/Parity/main/QwMockDataGenerator.cc @@ -48,13 +48,15 @@ inline std::string stringify(int i) { int main(int argc, char* argv[]) { - // First, we set the command line arguments and the configuration filename, - // and we define the options that can be used in them (using QwOptions). - gQwOptions.SetCommandLine(argc, argv); - gQwOptions.SetConfigFile("qwmockdataanalysis.conf"); // Define the command line options DefineOptionsParity(gQwOptions); + /// Without anything, print usage + if (argc == 1) { + gQwOptions.Usage(); + exit(0); + } + // Fill the search paths for the parameter files; this sets a static // variable within the QwParameterFile class which will be used by // all instances. @@ -63,6 +65,11 @@ int main(int argc, char* argv[]) QwParameterFile::AppendToSearchPath(getenv_safe_string("QWANALYSIS") + "/Analysis/prminput"); QwParameterFile::AppendToSearchPath(getenv_safe_string("QWANALYSIS") + "/Parity/prminput"); + // Set the command line arguments and the configuration filename, + // and we define the options that can be used in them (using QwOptions). + gQwOptions.SetCommandLine(argc, argv); + gQwOptions.SetConfigFile("qwmockdataanalysis.conf"); + // Event buffer QwEventBuffer eventbuffer; diff --git a/Parity/main/QwParity.cc b/Parity/main/QwParity.cc old mode 100755 new mode 100644 index 930de2623..4893ccf9d --- a/Parity/main/QwParity.cc +++ b/Parity/main/QwParity.cc @@ -49,8 +49,17 @@ Int_t main(Int_t argc, Char_t* argv[]) { - /// without anything, print usage - if(argc == 1){ + /// Define the command line options + DefineOptionsParity(gQwOptions); + + /// Define additional command line arguments and the configuration filename, + /// and we define the options that can be used in them (using QwOptions). + gQwOptions.AddOptions()("single-output-file", po::value()->default_bool_value(false), "Write a single output file"); + gQwOptions.AddOptions()("print-errorcounters", po::value()->default_bool_value(true), "Print summary of error counters"); + gQwOptions.AddOptions()("write-promptsummary", po::value()->default_bool_value(false), "Write PromptSummary"); + + /// Without anything, print usage + if (argc == 1) { gQwOptions.Usage(); exit(0); } @@ -63,19 +72,11 @@ Int_t main(Int_t argc, Char_t* argv[]) QwParameterFile::AppendToSearchPath(getenv_safe_string("QWANALYSIS") + "/Parity/prminput"); QwParameterFile::AppendToSearchPath(getenv_safe_string("QWANALYSIS") + "/Analysis/prminput"); - /// Then, we set the command line arguments and the configuration filename, - /// and we define the options that can be used in them (using QwOptions). - gQwOptions.AddOptions()("single-output-file", po::value()->default_bool_value(false), "Write a single output file"); - gQwOptions.AddOptions()("print-errorcounters", po::value()->default_bool_value(true), "Print summary of error counters"); - gQwOptions.AddOptions()("write-promptsummary", po::value()->default_bool_value(false), "Write PromptSummary"); - gQwOptions.SetCommandLine(argc, argv); gQwOptions.AddConfigFile("qweak_mysql.conf"); gQwOptions.ListConfigFiles(); - - /// Define the command line options - DefineOptionsParity(gQwOptions); + /// Load command line options for the histogram/tree helper class gQwHists.ProcessOptions(gQwOptions); /// Setup screen and file logging diff --git a/Parity/main/QwParity_simple.cc b/Parity/main/QwParity_simple.cc old mode 100755 new mode 100644 index 29cccaf37..d450c3a96 --- a/Parity/main/QwParity_simple.cc +++ b/Parity/main/QwParity_simple.cc @@ -44,8 +44,17 @@ Int_t main(Int_t argc, Char_t* argv[]) { - /// without anything, print usage - if(argc == 1){ + /// Define the command line options + DefineOptionsParity(gQwOptions); + + /// Define additional command line arguments and the configuration filename, + /// and we define the options that can be used in them (using QwOptions). + gQwOptions.AddOptions()("single-output-file", po::value()->default_bool_value(false), "Write a single output file"); + gQwOptions.AddOptions()("print-errorcounters", po::value()->default_bool_value(true), "Print summary of error counters"); + gQwOptions.AddOptions()("write-promptsummary", po::value()->default_bool_value(false), "Write PromptSummary"); + + /// Without anything, print usage + if (argc == 1) { gQwOptions.Usage(); exit(0); } @@ -58,21 +67,13 @@ Int_t main(Int_t argc, Char_t* argv[]) QwParameterFile::AppendToSearchPath(getenv_safe_string("QWANALYSIS") + "/Parity/prminput"); QwParameterFile::AppendToSearchPath(getenv_safe_string("QWANALYSIS") + "/Analysis/prminput"); - /// Then, we set the command line arguments and the configuration filename, - /// and we define the options that can be used in them (using QwOptions). - gQwOptions.AddOptions()("single-output-file", po::value()->default_bool_value(false), "Write a single output file"); - gQwOptions.AddOptions()("print-errorcounters", po::value()->default_bool_value(true), "Print summary of error counters"); - gQwOptions.AddOptions()("write-promptsummary", po::value()->default_bool_value(false), "Write PromptSummary"); - gQwOptions.SetCommandLine(argc, argv); #ifdef __USE_DATABASE__ gQwOptions.AddConfigFile("qweak_mysql.conf"); #endif gQwOptions.ListConfigFiles(); - - /// Define the command line options - DefineOptionsParity(gQwOptions); + /// Load command line options for the histogram/tree helper class gQwHists.ProcessOptions(gQwOptions); /// Setup screen and file logging From f7845a02e84ffb8da197d0d8c6f83329121e0b59 Mon Sep 17 00:00:00 2001 From: Paul King Date: Fri, 7 Dec 2018 16:03:43 -0500 Subject: [PATCH 030/137] Adding the option to define the input register bits associated with the helicity, multiplet sync, and pair sync, instead of using the default bit assignments (which are used in the injector). --- Parity/include/QwHelicity.h | 13 ++++++-- Parity/prminput/prexCH_detectors.map | 6 ++-- Parity/prminput/prexCH_helicity.map | 45 ++++------------------------ Parity/src/QwHelicity.cc | 42 ++++++++++++++++++++------ 4 files changed, 51 insertions(+), 55 deletions(-) diff --git a/Parity/include/QwHelicity.h b/Parity/include/QwHelicity.h index fb79e0860..10030d34e 100755 --- a/Parity/include/QwHelicity.h +++ b/Parity/include/QwHelicity.h @@ -163,12 +163,16 @@ class QwHelicity: public VQwSubsystemParity, public MQwSubsystemCloneable &buffer) } case kHelInputRegisterMode: { UInt_t input_register = 0x0; - if (fHelicityDelayed == 1) input_register |= kInputReg_HelPlus; - if (fHelicityDelayed == 0) input_register |= kInputReg_HelMinus; // even the mock data has balanced inputs! - if (fPatternPhaseNumber == fMinPatternPhase) input_register |= kInputReg_PatternSync; + if (fHelicityDelayed == 1) input_register |= fInputReg_HelPlus; + if (fHelicityDelayed == 0) input_register |= fInputReg_HelMinus; + if (fPatternPhaseNumber == fMinPatternPhase) input_register |= fInputReg_PatternSync; // Write the words to the buffer localbuffer.push_back(input_register); // input_register @@ -847,6 +855,22 @@ Int_t QwHelicity::LoadChannelMap(TString mapfile) if (mapstr.PopValue("patternbits",value)) { SetHelicityBitPattern(value); } + if (mapstr.PopValue("inputregmask_helicity",value)) { + fInputReg_HelPlus = value; + fInputReg_HelMinus = 0; + } + if (mapstr.PopValue("inputregmask_helplus",value)) { + fInputReg_HelPlus = value; + } + if (mapstr.PopValue("inputregmask_helminus",value)) { + fInputReg_HelMinus = value; + } + if (mapstr.PopValue("inputregmask_pattsync",value)) { + fInputReg_PatternSync = value; + } + if (mapstr.PopValue("inputregmask_pairsync",value)) { + fInputReg_PairSync = value; + } if (mapstr.PopValue("fakempsbit",value)) { fInputReg_FakeMPS = value; QwWarning << " fInputReg_FakeMPS 0x" << std::hex << fInputReg_FakeMPS << std::dec << QwLog::endl; From 1004d27b650e2b627b802b3cbb11cf1208344387 Mon Sep 17 00:00:00 2001 From: Paul King Date: Tue, 11 Dec 2018 13:23:39 -0500 Subject: [PATCH 031/137] Finished adding map file options to specify the helicity bits. The meaning of the bits of the input register can now be specified in the QwHelicity map file, to allow the decoding of both the injector and counting house A helicity data. --- Parity/include/QwHelicity.h | 9 +++------ Parity/prminput/prexCH_helicity.map | 9 ++++++--- Parity/src/QwHelicity.cc | 8 ++++---- 3 files changed, 13 insertions(+), 13 deletions(-) diff --git a/Parity/include/QwHelicity.h b/Parity/include/QwHelicity.h index 10030d34e..d7ef5b3a0 100755 --- a/Parity/include/QwHelicity.h +++ b/Parity/include/QwHelicity.h @@ -149,7 +149,7 @@ class QwHelicity: public VQwSubsystemParity, public MQwSubsystemCloneable Date: Wed, 12 Dec 2018 07:14:09 -0500 Subject: [PATCH 032/137] put cavities in line with stripline naming conventions --- Parity/prminput/prexCH_beamline.map | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/Parity/prminput/prexCH_beamline.map b/Parity/prminput/prexCH_beamline.map index d2ccff9a8..a741a2846 100644 --- a/Parity/prminput/prexCH_beamline.map +++ b/Parity/prminput/prexCH_beamline.map @@ -40,19 +40,19 @@ sample_size=464 VQWK, 2, 7, bpmstripline, BPM4Aym !ADC3 - VQWK, 3, 0, bcm, CAVB_X - VQWK, 3, 1, bcm, CAVB_Y - VQWK, 3, 2, bcm, CAVB_Q + VQWK, 3, 0, bcm, CAV4BX + VQWK, 3, 1, bcm, CAV4BY + VQWK, 3, 2, bcm, CAV4BQ VQWK, 3, 3, bcm, QWK_3_3 - VQWK, 3, 4, bcm, CAVC_X - VQWK, 3, 5, bcm, CAVC_Y - VQWK, 3, 6, bcm, CAVC_Q + VQWK, 3, 4, bcm, CAV4CX + VQWK, 3, 5, bcm, CAV4CY + VQWK, 3, 6, bcm, CAV4CQ VQWK, 3, 7, bcm, QWK_3_7 !ADC4 - VQWK, 4, 0, bcm, CAVD_X - VQWK, 4, 1, bcm, CAVD_Y - VQWK, 4, 2, bcm, CAVD_Q + VQWK, 4, 0, bcm, CAV4DX + VQWK, 4, 1, bcm, CAV4DY + VQWK, 4, 2, bcm, CAV4DQ VQWK, 4, 3, bcm, QWK_4_3 VQWK, 4, 4, bcm, QWK_4_4 VQWK, 4, 5, bcm, QWK_4_5 From 825fd243cb05d82c8cbea0898521a6397cbb31f3 Mon Sep 17 00:00:00 2001 From: Ciprian Gal Date: Wed, 12 Dec 2018 07:20:10 -0500 Subject: [PATCH 033/137] and png and files starting with z_ --- .gitignore | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.gitignore b/.gitignore index 14f598e64..20a666b63 100644 --- a/.gitignore +++ b/.gitignore @@ -50,6 +50,8 @@ Doxygen/html *.root *.db *.txt +*.png #tmp files *~ +z_* From 50cd05b0f1f8d77baaab879847c10b26d69e5f47 Mon Sep 17 00:00:00 2001 From: Paul King Date: Tue, 18 Dec 2018 14:09:19 -0500 Subject: [PATCH 034/137] Changes to allow bank decoding as implemented in Hall A DAQ. By default, if the subbank IDs are 31 or less, they would be interpreted as ROC IDs instead. A new command-line/configuration-file flag has been added to allow low bank ID values. If that flag is set, all ROC banks MUST be built from sub-banks, but then the sub-banks may have any ID value. Subbank IDs cannot be repeated within the same ROC, but they can be repeated in different ROCs. To allow this to work, the configuration file will be re-parsed at the start of each run, so if the new flag is different for different run ranges, we can specify it in an "extra" config file that can be run-ranged. --- Analysis/include/QwEventBuffer.h | 2 ++ Analysis/src/QwEventBuffer.cc | 24 ++++++++++++++++++++++-- Parity/main/QwParity.cc | 3 +++ 3 files changed, 27 insertions(+), 2 deletions(-) diff --git a/Analysis/include/QwEventBuffer.h b/Analysis/include/QwEventBuffer.h index bc6fc0389..9f8573dd5 100755 --- a/Analysis/include/QwEventBuffer.h +++ b/Analysis/include/QwEventBuffer.h @@ -166,6 +166,8 @@ class QwEventBuffer: public MQwCodaControlEvent{ TString fETSession; TString fETStationName; + Bool_t fAllowLowSubbankIDs; + Bool_t fChainDataFiles; std::pair fRunRange; std::string fRunListFileName; diff --git a/Analysis/src/QwEventBuffer.cc b/Analysis/src/QwEventBuffer.cc index 8f7ce5d48..82a506931 100755 --- a/Analysis/src/QwEventBuffer.cc +++ b/Analysis/src/QwEventBuffer.cc @@ -106,6 +106,10 @@ void QwEventBuffer::DefineOptions(QwOptions &options) options.AddDefaultOptions() ("codafile-ext", po::value()->default_value(fDefaultDataFileExtension), "extension of the input CODA filename"); + // Special flag to allow sub-bank IDs less than 31 + options.AddDefaultOptions() + ("allow-low-subbank-ids", po::value()->default_bool_value(false), + "allow the sub-bank ids to be 31 or less, when using this flag, all ROCs must be sub-banked"); // Options specific to the ET clients options.AddOptions("ET system options") ("ET.hostname", po::value(), @@ -170,6 +174,8 @@ void QwEventBuffer::ProcessOptions(QwOptions &options) fDataFileStem = options.GetValue("codafile-stem"); fDataFileExtension = options.GetValue("codafile-ext"); + fAllowLowSubbankIDs = options.GetValue("allow-low-subbank-ids"); + // Open run list file if (fRunListFileName.size() > 0) { fRunListFile = new QwParameterFile(fRunListFileName); @@ -818,6 +824,9 @@ Bool_t QwEventBuffer::FillSubsystemData(QwSubsystemArray &subsystems) } } } else { + QwDebug << "QwEventBuffer::FillSubsystemData: " + << "fROC=="<>16; // Bits 16-31 fSubbankType = (buffer[1]&0xFF00)>>8; // Bits 8-15 fSubbankNum = (buffer[1]&0xFF); // Bits 0-7 - if (fSubbankTag<=31){ + + QwDebug << "QwEventBuffer::DecodeSubbankHeader: " + << "fROC=="<("write-promptsummary")) { QwPromptSummary promptsummary(run_number, eventbuffer.GetSegmentNumber()); From 044f1b99cad3d39c5b2ddb40fba7401c4d6561a6 Mon Sep 17 00:00:00 2001 From: Paul King Date: Thu, 20 Dec 2018 12:17:57 -0500 Subject: [PATCH 035/137] Decode and report SIS3801 header bits. The header bits for the SIS3801 scalers will now be decoded and reported in the raw tree. The header is not bit shifted, and does not have the channel number extracted. If you just want to see the SIS3801 user bits in the header, you would do something like: ((header & 0xc0000000)>>30). --- Analysis/include/QwScaler_Channel.h | 9 ++++++--- Analysis/src/QwScaler_Channel.cc | 22 ++++++++++++++++++++-- 2 files changed, 26 insertions(+), 5 deletions(-) diff --git a/Analysis/include/QwScaler_Channel.h b/Analysis/include/QwScaler_Channel.h index 1b204c96e..3fcda298a 100755 --- a/Analysis/include/QwScaler_Channel.h +++ b/Analysis/include/QwScaler_Channel.h @@ -152,10 +152,9 @@ class VQwScaler_Channel: public VQwHardwareChannel, public MQwMockable { void ConstructHistograms(TDirectory *folder, TString &prefix); void FillHistograms(); - void ConstructBranchAndVector(TTree *tree, TString &prefix, std::vector &values); - + virtual void ConstructBranchAndVector(TTree *tree, TString &prefix, std::vector &values) = 0; + virtual void FillTreeVector(std::vector &values) const = 0; void ConstructBranch(TTree *tree, TString &prefix); - void FillTreeVector(std::vector &values) const; inline void AccumulateRunningSum(const VQwScaler_Channel& value){ AccumulateRunningSum(value, value.fGoodEventCount); @@ -193,6 +192,7 @@ class VQwScaler_Channel: public VQwHardwareChannel, public MQwMockable { protected: static const Bool_t kDEBUG; + UInt_t fHeader; UInt_t fValue_Raw_Old; UInt_t fValue_Raw; Double_t fValue; @@ -230,6 +230,9 @@ class QwScaler_Channel: public VQwScaler_Channel void EncodeEventData(std::vector &buffer); Int_t ProcessEvBuffer(UInt_t* buffer, UInt_t num_words_left, UInt_t index = 0); + void ConstructBranchAndVector(TTree *tree, TString &prefix, std::vector &values); + void FillTreeVector(std::vector &values) const; + }; diff --git a/Analysis/src/QwScaler_Channel.cc b/Analysis/src/QwScaler_Channel.cc index d05b5a031..068db750d 100755 --- a/Analysis/src/QwScaler_Channel.cc +++ b/Analysis/src/QwScaler_Channel.cc @@ -31,6 +31,7 @@ void VQwScaler_Channel::InitializeChannel(TString name, TString datatosave) // Default mockdata parameters SetRandomEventParameters(300.0, 50.0); + fHeader = 0; fValue_Raw_Old = 0; fValue_Raw = 0; fValue = 0.0; @@ -63,6 +64,7 @@ void VQwScaler_Channel::InitializeChannel(TString subsystem, TString instrumentt void VQwScaler_Channel::ClearEventData() { + fHeader = 0; fValue_Raw = 0; fValue = 0.0; fValueM2 = 0.0; @@ -167,6 +169,7 @@ Int_t QwScaler_Channel::ProcessEvBuffer(UInt_t* buffer, UI // Skip over this data. words_read = fNumberOfDataWords; } else if (num_words_left >= fNumberOfDataWords) { + fHeader = (buffer[0] & ~data_mask); fValue_Raw = ((buffer[0] & data_mask) >> data_shift); fValue = fCalibrationFactor * (Double_t(fValue_Raw) - Double_t(fValue_Raw_Old) - fPedestal); words_read = fNumberOfDataWords; @@ -249,7 +252,9 @@ void VQwScaler_Channel::FillHistograms() } } -void VQwScaler_Channel::ConstructBranchAndVector(TTree *tree, TString &prefix, std::vector &values) + +template +void QwScaler_Channel::ConstructBranchAndVector(TTree *tree, TString &prefix, std::vector &values) { if (IsNameEmpty()){ // This channel is not used, so skip setting up the tree. @@ -265,6 +270,10 @@ void VQwScaler_Channel::ConstructBranchAndVector(TTree *tree, TString &prefix, if(fDataToSave==kRaw){ values.push_back(0.0); list += ":raw/D"; + if ((~data_mask) != 0){ + values.push_back(0.0); + list += ":header/D"; + } } fTreeArrayNumEntries = values.size() - fTreeArrayIndex; @@ -284,7 +293,8 @@ void VQwScaler_Channel::ConstructBranch(TTree *tree, TString &prefix) } } -void VQwScaler_Channel::FillTreeVector(std::vector &values) const +template +void QwScaler_Channel::FillTreeVector(std::vector &values) const { if (IsNameEmpty()) { // This channel is not used, so skip setting up the tree. @@ -312,6 +322,10 @@ void VQwScaler_Channel::FillTreeVector(std::vector &values) const values[index++] = this->fErrorFlag; if(fDataToSave==kRaw){ values[index++] = this->fValue_Raw; + if ((~data_mask) != 0){ + values[index++] = this->fHeader; + } + } } } @@ -383,6 +397,7 @@ VQwScaler_Channel& VQwScaler_Channel::operator=(const VQwScaler_Channel &value) if(this == &value) return *this; if (!IsNameEmpty()) { VQwHardwareChannel::operator=(value); + this->fHeader = value.fHeader; this->fValue_Raw = value.fValue_Raw; this->fValue = value.fValue; this->fValueError = value.fValueError; @@ -429,6 +444,7 @@ VQwScaler_Channel& VQwScaler_Channel::operator*= (const VQwScaler_Channel &value { if (!IsNameEmpty()){ this->fValue *= value.fValue; + fHeader = 0; fValue_Raw = 0; this->fValueM2 = 0.0; this->fErrorFlag |= (value.fErrorFlag);//error code is ORed. @@ -511,6 +527,7 @@ void VQwScaler_Channel::Ratio(const VQwScaler_Channel &numer, const VQwScaler_Ch *this /= denom; // Set the raw values to zero. + fHeader = 0; fValue_Raw = 0; // Remaining variables @@ -563,6 +580,7 @@ void VQwScaler_Channel::Product(VQwScaler_Channel &numer, VQwScaler_Channel &den { if (!IsNameEmpty()){ fValue = numer.fValue * denom.fValue; + fHeader = 0; fValue_Raw = 0; // Remaining variables From ea0cf827f78d306c67e4423eb4ebbcb3c11e1d40 Mon Sep 17 00:00:00 2001 From: Paul King Date: Thu, 20 Dec 2018 12:23:04 -0500 Subject: [PATCH 036/137] Added parameter files for the PREX sub-bank data structures. Beginning with run 4747, the PREX data stream from the injector and counting house uses sub-banks in each of the ROC banks. The beamline and helicity map files have been modified to decode that data beginning with that run number. I have also added a "prex.conf" configuration which combines the decodong using the CHA and injector detector maps. This should be expanded as we define the spectrometer data structures. --- Parity/prminput/parity_hist.in | 9 +- Parity/prminput/prex.conf | 22 +++ Parity/prminput/prexCH.conf | 2 + Parity/prminput/prexCH_beamline.4747-.map | 65 ++++++++ Parity/prminput/prexCH_helicity.4747-.map | 43 ++++++ Parity/prminput/prex_detectors.map | 20 +++ Parity/prminput/prexbankflag.4747-.conf | 9 ++ Parity/prminput/prexbankflag.conf | 9 ++ Parity/prminput/prexinj.conf | 2 + Parity/prminput/prexinj_beamline.4747-.map | 167 +++++++++++++++++++++ Parity/prminput/prexinj_helicity.4100-.map | 85 +++++++++++ Parity/prminput/prexinj_helicity.4747-.map | 86 +++++++++++ 12 files changed, 515 insertions(+), 4 deletions(-) create mode 100644 Parity/prminput/prex.conf create mode 100644 Parity/prminput/prexCH_beamline.4747-.map create mode 100644 Parity/prminput/prexCH_helicity.4747-.map create mode 100644 Parity/prminput/prex_detectors.map create mode 100644 Parity/prminput/prexbankflag.4747-.conf create mode 100644 Parity/prminput/prexbankflag.conf create mode 100644 Parity/prminput/prexinj_beamline.4747-.map create mode 100644 Parity/prminput/prexinj_helicity.4100-.map create mode 100644 Parity/prminput/prexinj_helicity.4747-.map diff --git a/Parity/prminput/parity_hist.in b/Parity/prminput/parity_hist.in index 274720e6d..e746b922a 100755 --- a/Parity/prminput/parity_hist.in +++ b/Parity/prminput/parity_hist.in @@ -453,10 +453,10 @@ yield_qwk_.* TH1F 1000 -5.0e2 5.0e2 Counts Events asym.*_qwk_.* TH1F 1000 -5.0e2 5.0e2 Counts Events diff.*_qwk_.* TH1F 1000 -5.0e2 5.0e2 Counts Events -sca_.* TH1F -yield_sca_.* TH1F -asym.*_sca_.* TH1F -diff.*_sca_.* TH1F +sca.* TH1F 101 +yield_sca.* TH1F 101 +asym.*_sca.* TH1F 101 +diff.*_sca.* TH1F 101 ########################################### # Adding some fully wildcarded histogram names. @@ -468,3 +468,4 @@ diff.*_sca_.* TH1F .*_.w TH1F 1000 -5.0e9 5.0e9 CalibratedCounts Events .*_sw-hw_raw TH1F 1000 -5.0e2 5.0e2 Counts Events +.* TH1F 101 diff --git a/Parity/prminput/prex.conf b/Parity/prminput/prex.conf new file mode 100644 index 000000000..e82a6f463 --- /dev/null +++ b/Parity/prminput/prex.conf @@ -0,0 +1,22 @@ +# This configuration file is used to generate +# a ROOT file for injector beam studies +# +# To Run +# qwparity -r 5900 -c injector.conf +# +# Friday, January 7 22:53:34 EDT 2011 +# +add-config = prexbankflag.conf + +detectors = prex_detectors.map +chainfiles = no +single-output-file = yes +enable-tree-trim = no +disable-hel-tree = no +disable-histos = no +rootfile-stem = prexCH_ +codafile-stem = parity18_ +codafile-ext = dat + +ring.size = 200 +ring.stability_cut = -1 \ No newline at end of file diff --git a/Parity/prminput/prexCH.conf b/Parity/prminput/prexCH.conf index b8a502def..6cacafbe3 100644 --- a/Parity/prminput/prexCH.conf +++ b/Parity/prminput/prexCH.conf @@ -6,6 +6,8 @@ # # Friday, January 7 22:53:34 EDT 2011 # +add-config = prexbankflag.conf + detectors = prexCH_detectors.map chainfiles = no single-output-file = yes diff --git a/Parity/prminput/prexCH_beamline.4747-.map b/Parity/prminput/prexCH_beamline.4747-.map new file mode 100644 index 000000000..7467a9a07 --- /dev/null +++ b/Parity/prminput/prexCH_beamline.4747-.map @@ -0,0 +1,65 @@ + +ROC=23 +Bank=0x05 +vqwk_buffer_offset = 1 +!same sample size for ADCs in a given bank +sample_size=16564 +!Sample size should be unchanged - ask Paul King +! +! module.type, module.num chan.num, det.type, det.name, if unrotated then last column ->UNROTATED + + +!ADC0 + VQWK, 0, 0, bcm, QWK_0_0 + VQWK, 0, 1, bcm, QWK_0_1 + VQWK, 0, 2, bcm, BCM_US + VQWK, 0, 3, bcm, BCM_DS + VQWK, 0, 4, bcm, QWK_0_4 + VQWK, 0, 5, bcm, QWK_0_5 + VQWK, 0, 6, bcm, QWK_0_6 + VQWK, 0, 7, bcm, QWK_0_7 + +!ADC1 + VQWK, 1, 0, bpmstripline, BPM4Exp + VQWK, 1, 1, bpmstripline, BPM4Exm + VQWK, 1, 2, bpmstripline, BPM4Eyp + VQWK, 1, 3, bpmstripline, BPM4Eym + VQWK, 1, 4, bcm, QWK_1_4 + VQWK, 1, 5, bcm, QWK_1_5 + VQWK, 1, 6, bcm, QWK_1_6 + VQWK, 1, 7, bcm, QWK_1_7 + +!ADC2 + VQWK, 2, 0, bcm, QWK_2_0 + VQWK, 2, 1, bcm, QWK_2_1 + VQWK, 2, 2, bcm, QWK_2_2 + VQWK, 2, 3, bcm, QWK_2_3 + VQWK, 2, 4, bpmstripline, BPM4Axp + VQWK, 2, 5, bpmstripline, BPM4Axm + VQWK, 2, 6, bpmstripline, BPM4Ayp + VQWK, 2, 7, bpmstripline, BPM4Aym + +!ADC3 + VQWK, 3, 0, bcm, CAVB_X + VQWK, 3, 1, bcm, CAVB_Y + VQWK, 3, 2, bcm, CAVB_Q + VQWK, 3, 3, bcm, QWK_3_3 + VQWK, 3, 4, bcm, CAVC_X + VQWK, 3, 5, bcm, CAVC_Y + VQWK, 3, 6, bcm, CAVC_Q + VQWK, 3, 7, bcm, QWK_3_7 + +!ADC4 + VQWK, 4, 0, bcm, CAVD_X + VQWK, 4, 1, bcm, CAVD_Y + VQWK, 4, 2, bcm, CAVD_Q + VQWK, 4, 3, bcm, QWK_4_3 + VQWK, 4, 4, bcm, QWK_4_4 + VQWK, 4, 5, bcm, QWK_4_5 + VQWK, 4, 6, bcm, QWK_4_6 + VQWK, 4, 7, bcm, QWK_4_7 + + +[PUBLISH] +! new.tree.variable.name, analysis.class, old.tree.variable.name, element.to.store + q_targ, bcm, bcm_us, c diff --git a/Parity/prminput/prexCH_helicity.4747-.map b/Parity/prminput/prexCH_helicity.4747-.map new file mode 100644 index 000000000..c20759356 --- /dev/null +++ b/Parity/prminput/prexCH_helicity.4747-.map @@ -0,0 +1,43 @@ +!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! +!! input file for decoding the helicity subsystem +!! Of note in this file: +!! HelicityDecodingMode : will tell which mode of decoding is in use +!! : for now it can be InputRegisterMode, UserbitMode +!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + +ROC=23 +!!! MarkerWord=0xffb0b444 +Bank=0x1 + +!INPUT REGISTER MODE +HelicityDecodingMode=InputRegisterMode + +! Set the patternPhase (number of windows in a pattern) for each run range. +! If patternPhase!=4, then also set the NumberPatternsDelayed +! so the reported helicity is delayed by 8 windows (default 2). +NumberPatternsDelayed=2 +PatternPhase=4 + +!!! Specify the bitmasks for the patternsync, helicity, and pairsync if needed. +InputRegMask_PattSync=0x20 +InputRegMask_Helicity=0x40 +InputRegMask_PairSync=0x80 +InputRegMask_FakeMPS=0 !!! Do not use a input register bit to indicate a "fake" set of helicity bits + + +!Need to set PATTERNPHASEOFFSET = 1 (when pattern phase starts with 1) or 0 (when pattern phase starts with 0) +!default value for PATTERNPHASEOFFSET = 1 is set within the code itself which works fine with regular injector/beamline/parity mock data +!uncomment below line only if phase number start from 0 +PATTERNPHASEOFFSET=0 + + +! +! module.type, module.num chan.num, det.type, det.name +! +SKIP 2 +WORD, 0, 0, helicitydata, input_register +!END +! +!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! +!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! +!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! diff --git a/Parity/prminput/prex_detectors.map b/Parity/prminput/prex_detectors.map new file mode 100644 index 000000000..df04c94fb --- /dev/null +++ b/Parity/prminput/prex_detectors.map @@ -0,0 +1,20 @@ +# This is an example of a detector definition file. + +[QwBeamLine] + name = Injector + map = prexinj_beamline.map + geom = prexinj_beamline_geometry.map + eventcut = prexinj_beamline_eventcuts.map + param = prexinj_beamline_pedestal.map + +[QwHelicity] + name = Helicity info + map = prexinj_helicity.map + +[QwBeamLine] + name = CountingHouse + map = prexCH_beamline.map + geom = prexCH_beamline_geometry.map + eventcut = prexCH_beamline_eventcuts.map + param = prexCH_beamline_pedestal.map + diff --git a/Parity/prminput/prexbankflag.4747-.conf b/Parity/prminput/prexbankflag.4747-.conf new file mode 100644 index 000000000..a94b7a0dc --- /dev/null +++ b/Parity/prminput/prexbankflag.4747-.conf @@ -0,0 +1,9 @@ +# This configuration file is used to generate +# a ROOT file for injector beam studies +# +# To Run +# qwparity -r 5900 -c injector.conf +# +# Friday, January 7 22:53:34 EDT 2011 +# +allow-low-subbank-ids = yes diff --git a/Parity/prminput/prexbankflag.conf b/Parity/prminput/prexbankflag.conf new file mode 100644 index 000000000..69e30803c --- /dev/null +++ b/Parity/prminput/prexbankflag.conf @@ -0,0 +1,9 @@ +# This configuration file is used to generate +# a ROOT file for injector beam studies +# +# To Run +# qwparity -r 5900 -c injector.conf +# +# Friday, January 7 22:53:34 EDT 2011 +# +allow-low-subbank-ids = no diff --git a/Parity/prminput/prexinj.conf b/Parity/prminput/prexinj.conf index a13cd255d..b7cc1c82f 100644 --- a/Parity/prminput/prexinj.conf +++ b/Parity/prminput/prexinj.conf @@ -6,6 +6,8 @@ # # Friday, January 7 22:53:34 EDT 2011 # +add-config = prexbankflag.conf + detectors = prexinj_detectors.map chainfiles = no single-output-file = yes diff --git a/Parity/prminput/prexinj_beamline.4747-.map b/Parity/prminput/prexinj_beamline.4747-.map new file mode 100644 index 000000000..06b19d424 --- /dev/null +++ b/Parity/prminput/prexinj_beamline.4747-.map @@ -0,0 +1,167 @@ + +ROC=24 +Bank=0x02 +vqwk_buffer_offset=1 + +!same sample size for ADCs in a given bank +sample_size=16644 +! +! +! module.type, module.num chan.num, det.type, det.name + + +!ADC0 + VQWK, 0, 0, bpmstripline, bpm0I01Axp + VQWK, 0, 1, bpmstripline, bpm0I01Axm + VQWK, 0, 2, bpmstripline, bpm0I01Ayp + VQWK, 0, 3, bpmstripline, bpm0I01Aym + VQWK, 0, 4, bpmstripline, bpm1I04xp + VQWK, 0, 5, bpmstripline, bpm1I04xm + VQWK, 0, 6, bpmstripline, bpm1I04yp + VQWK, 0, 7, bpmstripline, bpm1I04ym + +!ADC1 + VQWK, 1, 0, bpmstripline, bpm1I02xp + VQWK, 1, 1, bpmstripline, bpm1I02xm + VQWK, 1, 2, bpmstripline, bpm1I02yp + VQWK, 1, 3, bpmstripline, bpm1I02ym + VQWK, 1, 4, bpmstripline, bpm0I01xp + VQWK, 1, 5, bpmstripline, bpm0I01xm + VQWK, 1, 6, bpmstripline, bpm0I01yp + VQWK, 1, 7, bpmstripline, bpm0I01ym + + +!ADC2 + VQWK, 2, 0, bpmstripline, bpm1I06xp + VQWK, 2, 1, bpmstripline, bpm1I06xm + VQWK, 2, 2, bpmstripline, bpm1I06yp + VQWK, 2, 3, bpmstripline, bpm1I06ym + VQWK, 2, 4, bpmstripline, bpm0I02xp + VQWK, 2, 5, bpmstripline, bpm0I02xm + VQWK, 2, 6, bpmstripline, bpm0I02yp + VQWK, 2, 7, bpmstripline, bpm0I02ym + +!ADC3 + VQWK, 3, 0, bpmstripline, bpm0I02Axp + VQWK, 3, 1, bpmstripline, bpm0I02Axm + VQWK, 3, 2, bpmstripline, bpm0I02Ayp + VQWK, 3, 3, bpmstripline, bpm0I02Aym + VQWK, 3, 4, bpmstripline, bpm0I05xp + VQWK, 3, 5, bpmstripline, bpm0I05xm + VQWK, 3, 6, bpmstripline, bpm0I05yp + VQWK, 3, 7, bpmstripline, bpm0I05ym + +!ADC4 + VQWK, 4, 0, bpmstripline, bpm0I07xp + VQWK, 4, 1, bpmstripline, bpm0I07xm + VQWK, 4, 2, bpmstripline, bpm0I07yp + VQWK, 4, 3, bpmstripline, bpm0I07ym + VQWK, 4, 4, bpmstripline, bpm0L01xp + VQWK, 4, 5, bpmstripline, bpm0L01xm + VQWK, 4, 6, bpmstripline, bpm0L01yp + VQWK, 4, 7, bpmstripline, bpm0L01ym + + +!ADC5 + VQWK, 5, 0, bpmstripline, bpm0L02xp + VQWK, 5, 1, bpmstripline, bpm0L02xm + VQWK, 5, 2, bpmstripline, bpm0L02yp + VQWK, 5, 3, bpmstripline, bpm0L02ym + VQWK, 5, 4, bpmstripline, bpm0L03xp + VQWK, 5, 5, bpmstripline, bpm0L03xm + VQWK, 5, 6, bpmstripline, bpm0L03yp + VQWK, 5, 7, bpmstripline, bpm0L03ym + +!ADC6 + VQWK, 6, 0, bpmstripline, bpm0L04xp + VQWK, 6, 1, bpmstripline, bpm0L04xm + VQWK, 6, 2, bpmstripline, bpm0L04yp + VQWK, 6, 3, bpmstripline, bpm0L04ym + VQWK, 6, 4, bpmstripline, bpm0L05xp + VQWK, 6, 5, bpmstripline, bpm0L05xm + VQWK, 6, 6, bpmstripline, bpm0L05yp + VQWK, 6, 7, bpmstripline, bpm0L05ym + +!ADC7 + VQWK, 7, 0, bpmstripline, bpm0L06xp + VQWK, 7, 1, bpmstripline, bpm0L06xm + VQWK, 7, 2, bpmstripline, bpm0L06yp + VQWK, 7, 3, bpmstripline, bpm0L06ym + VQWK, 7, 4, bpmstripline, bpm0L07xp + VQWK, 7, 5, bpmstripline, bpm0L07xm + VQWK, 7, 6, bpmstripline, bpm0L07yp + VQWK, 7, 7, bpmstripline, bpm0L07ym + +!ADC8 + VQWK, 8, 0, bpmstripline, bpm0L08xp + VQWK, 8, 1, bpmstripline, bpm0L08xm + VQWK, 8, 2, bpmstripline, bpm0L08yp + VQWK, 8, 3, bpmstripline, bpm0L08ym + VQWK, 8, 4, bpmstripline, bpm0L09xp + VQWK, 8, 5, bpmstripline, bpm0L09xm + VQWK, 8, 6, bpmstripline, bpm0L09yp + VQWK, 8, 7, bpmstripline, bpm0L09ym + +!ADC9 + VQWK, 9, 0, bpmstripline, bpm0L10xp + VQWK, 9, 1, bpmstripline, bpm0L10xm + VQWK, 9, 2, bpmstripline, bpm0L10yp + VQWK, 9, 3, bpmstripline, bpm0L10ym + VQWK, 9, 4, bpmstripline, bpm2I02xp + VQWK, 9, 5, bpmstripline, bpm2I02xm + VQWK, 9, 6, bpmstripline, bpm2I02yp + VQWK, 9, 7, bpmstripline, bpm2I02ym + +!ADC10 + VQWK, 10, 0, bpmstripline, bpm2I01xp + VQWK, 10, 1, bpmstripline, bpm2I01xm + VQWK, 10, 2, bpmstripline, bpm2I01yp + VQWK, 10, 3, bpmstripline, bpm2I01ym + VQWK, 10, 4, bcm, BCM0L02 + VQWK, 10, 5, bcm, Batery6 + VQWK, 10, 6, bcm, Batery7 + VQWK, 10, 7, bcm, PhaseMonitor + +!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! +Bank=0x01 +scaler_buffer_offset=6 +normclock=clk4MHz_1 + + SCALER, 0, 0, clock, sca0_0 + SCALER, 0, 1, clock, sca0_1 + SCALER, 0, 2, clock, sca0_2 + SCALER, 0, 3, clock, sca0_3 + SCALER, 0, 4, clock, sca0_4 + SCALER, 0, 5, clock, sca0_5 + SCALER, 0, 6, clock, sca0_6 + SCALER, 0, 7, clock, sca0_7 + SCALER, 0, 8, clock, sca0_8 + SCALER, 0, 9, clock, sca0_9 + SCALER, 0, 10, clock, sca0_10 + SCALER, 0, 11, clock, sca0_11 + SCALER, 0, 12, clock, sca0_12 + SCALER, 0, 13, clock, sca0_13 + SCALER, 0, 14, clock, sca0_14 + SCALER, 0, 15, clock, sca0_15 + + SCALER, 0, 16, halomonitor, sca0_16 + SCALER, 0, 17, clock, clk4MHz_1 + SCALER, 0, 18, clock, clk4MHz_2 + SCALER, 0, 19, clock, clk4MHz_3 + SCALER, 0, 20, halomonitor, sca0_20 + SCALER, 0, 21, halomonitor, sca0_21 + SCALER, 0, 22, halomonitor, sca0_22 + SCALER, 0, 23, halomonitor, sca0_23 + SCALER, 0, 24, halomonitor, sca0_24 + SCALER, 0, 25, halomonitor, sca0_25 + SCALER, 0, 26, halomonitor, sca0_26 + SCALER, 0, 27, halomonitor, sca0_27 + SCALER, 0, 28, halomonitor, sca0_28 + SCALER, 0, 29, halomonitor, sca0_29 + SCALER, 0, 30, halomonitor, sca0_30 + SCALER, 0, 31, halomonitor, sca0_31 + + +[PUBLISH] +# # q_targ, bcm, bcm0l02, c +# q_targ, bpmstripline, bpm0i02, ef ### Effective charge of BPM0i02 diff --git a/Parity/prminput/prexinj_helicity.4100-.map b/Parity/prminput/prexinj_helicity.4100-.map new file mode 100644 index 000000000..9b3046ce2 --- /dev/null +++ b/Parity/prminput/prexinj_helicity.4100-.map @@ -0,0 +1,85 @@ +!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! +!! input file for decoding the helicity subsystem +!! Of note in this file: +!! HelicityDecodingMode : will tell which mode of decoding is in use +!! : for now it can be InputRegisterMode, UserbitMode +!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + +!Injector data during happex data taking: run 12331, 12354, 12356 +!HelicityDecodingMode=InputRegisterMode +!PatternPhase=4 +!ROC=23 +! +! Header=0xfdacf000 +! HAPPEX BMW words +!SKIP 148 +!WORD, 0, 0, helicitydata, ha_cleandata +!WORD, 0, 0, helicitydata, ha_scandata1 +! +!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! +!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! +!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + +!INPUT REGISTER MODE +HelicityDecodingMode=InputRegisterMode + +InputRegMask_FakeMPS=0 !!! Do not use a input register bit to indicate a "fake" set of helicity bits + +! Set the patternPhase (number of windows in a pattern) for each run range. +! If patternPhase!=4, then also set the NumberPatternsDelayed +! so the reported helicity is delayed by 8 windows (default 2). +!NumberPatternsDelayed=4 +PatternPhase=4 + + + +!Need to set PATTERNPHASEOFFSET = 1 (when pattern phase starts with 1) or 0 (when pattern phase starts with 0) +!default value for PATTERNPHASEOFFSET = 1 is set within the code itself which works fine with regular injector/beamline/parity mock data +!uncomment below line only if phase number start from 0 +PATTERNPHASEOFFSET=0 + + +!seed size is either 24 bit or 30 bit. default is 30 bit +!RandSeedBits=24 + +ROC=24 +MarkerWord=0x00003103 + +! +! module.type, module.num chan.num, det.type, det.name +! +WORD, 0, 0, helicitydata, input_register +WORD, 0, 0, helicitydata, output_register +SKIP 1 ! WORD, 0, 0, helicitydata, sca_MPS_num +SKIP 1 ! WORD, 0, 0, helicitydata, sca_PAT_counter +SKIP 1 ! WORD, 0, 0, helicitydata, sca_PAT_phase +SKIP 3 +WORD, 0, 0, helicitydata, cleandata +WORD, 0, 0, helicitydata, scandata1 +WORD, 0, 0, helicitydata, scandata2 +SKIP 1 +!END +! +!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! +!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! +!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + +!USER BIT MODE + +!HelicityDecodingMode= UserbitMode +!PatternPhase=4 +!seed size is either 24 bit or 30 bit. default is 24 bit +!RandSeedBits=24 +!RandSeedBits=30 +!ROC=31 +!Bank=0x3101 +! +! module.type, module.num chan.num, det.type, det.name +! +!WORD, 0, 0, helicitydata, cleandata +!WORD, 0, 0, helicitydata, scandata1 +!WORD, 0, 0, helicitydata, scandata2 +!WORD, 0, 0, helicitydata, scalerheader +!WORD, 0, 0, helicitydata, scalercounter +!WORD, 0, 0, helicitydata, userbit +!END diff --git a/Parity/prminput/prexinj_helicity.4747-.map b/Parity/prminput/prexinj_helicity.4747-.map new file mode 100644 index 000000000..992ba0ef7 --- /dev/null +++ b/Parity/prminput/prexinj_helicity.4747-.map @@ -0,0 +1,86 @@ +!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! +!! input file for decoding the helicity subsystem +!! Of note in this file: +!! HelicityDecodingMode : will tell which mode of decoding is in use +!! : for now it can be InputRegisterMode, UserbitMode +!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + +!Injector data during happex data taking: run 12331, 12354, 12356 +!HelicityDecodingMode=InputRegisterMode +!PatternPhase=4 +!ROC=23 +! +! Header=0xfdacf000 +! HAPPEX BMW words +!SKIP 148 +!WORD, 0, 0, helicitydata, ha_cleandata +!WORD, 0, 0, helicitydata, ha_scandata1 +! +!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! +!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! +!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + +!INPUT REGISTER MODE +HelicityDecodingMode=InputRegisterMode + +InputRegMask_FakeMPS=0 !!! Do not use a input register bit to indicate a "fake" set of helicity bits + +! Set the patternPhase (number of windows in a pattern) for each run range. +! If patternPhase!=4, then also set the NumberPatternsDelayed +! so the reported helicity is delayed by 8 windows (default 2). +!NumberPatternsDelayed=4 +PatternPhase=4 + + + +!Need to set PATTERNPHASEOFFSET = 1 (when pattern phase starts with 1) or 0 (when pattern phase starts with 0) +!default value for PATTERNPHASEOFFSET = 1 is set within the code itself which works fine with regular injector/beamline/parity mock data +!uncomment below line only if phase number start from 0 +PATTERNPHASEOFFSET=0 + + +!seed size is either 24 bit or 30 bit. default is 30 bit +!RandSeedBits=24 + +ROC=24 +Bank=0x3 + +! +! module.type, module.num chan.num, det.type, det.name +! +SKIP 1 ! This is the marker word for PAN +WORD, 0, 0, helicitydata, input_register +WORD, 0, 0, helicitydata, output_register +SKIP 1 ! WORD, 0, 0, helicitydata, sca_MPS_num +SKIP 1 ! WORD, 0, 0, helicitydata, sca_PAT_counter +SKIP 1 ! WORD, 0, 0, helicitydata, sca_PAT_phase +SKIP 3 +WORD, 0, 0, helicitydata, cleandata +WORD, 0, 0, helicitydata, scandata1 +WORD, 0, 0, helicitydata, scandata2 +SKIP 1 +!END +! +!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! +!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! +!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + +!USER BIT MODE + +!HelicityDecodingMode= UserbitMode +!PatternPhase=4 +!seed size is either 24 bit or 30 bit. default is 24 bit +!RandSeedBits=24 +!RandSeedBits=30 +!ROC=31 +!Bank=0x3101 +! +! module.type, module.num chan.num, det.type, det.name +! +!WORD, 0, 0, helicitydata, cleandata +!WORD, 0, 0, helicitydata, scandata1 +!WORD, 0, 0, helicitydata, scandata2 +!WORD, 0, 0, helicitydata, scalerheader +!WORD, 0, 0, helicitydata, scalercounter +!WORD, 0, 0, helicitydata, userbit +!END From 2fd9bbbb4866f508d226871ee4177d0897cdd405 Mon Sep 17 00:00:00 2001 From: Paul King Date: Thu, 20 Dec 2018 13:28:06 -0500 Subject: [PATCH 037/137] Udated THaEtClient.C to use std:: prefix when needed. Modification of this file was missed in the no_using_namespace_std branch until after it was merged into develop. The changes are all in lines relating to standard output. --- evio/src/THaEtClient.C | 72 +++++++++++++++++++++--------------------- 1 file changed, 36 insertions(+), 36 deletions(-) diff --git a/evio/src/THaEtClient.C b/evio/src/THaEtClient.C index edfb93f32..1db7a2fc7 100755 --- a/evio/src/THaEtClient.C +++ b/evio/src/THaEtClient.C @@ -53,7 +53,7 @@ THaEtClient::THaEtClient(TString computer, TString mysession, int smode, THaEtClient::~THaEtClient() { fStatus = codaClose(); - if (fStatus == CODA_ERROR) cout << "ERROR: closing THaEtClient"< bpi*MAXEVLEN) { - cout<<"\nET:codaRead:ERROR: CODA event truncated"< Byte size exceeds bytes "< Byte size exceeds bytes "<= nread) { err = et_events_put(id, my_att, evs, nread); if (err < ET_OK) { - cout<<"THaEtClient::codaRead: ERROR: calling et_events_put"< Date: Thu, 20 Dec 2018 16:51:56 -0500 Subject: [PATCH 038/137] Changed the tree names as described in issue #45. --- Analysis/include/QwRootFile.h | 4 ++-- Analysis/src/QwEPICSEvent.cc | 2 +- Analysis/src/QwRootFile.cc | 10 +++++----- Parity/main/QwParity.cc | 26 +++++++++++++------------- Parity/main/QwParity_simple.cc | 26 +++++++++++++------------- Parity/src/QwBPMStripline.cc | 16 ++++++++++------ Parity/src/QwBeamLine.cc | 2 +- 7 files changed, 45 insertions(+), 41 deletions(-) diff --git a/Analysis/include/QwRootFile.h b/Analysis/include/QwRootFile.h index 309d95ace..cd15abeb2 100755 --- a/Analysis/include/QwRootFile.h +++ b/Analysis/include/QwRootFile.h @@ -617,9 +617,9 @@ void QwRootFile::ConstructTreeBranches( tree = new QwRootTree(name, desc, object, prefix); // Settings only relevant for new trees - if (name == "Mps_Tree") + if (name == "evt") tree->SetPrescaling(fNumMpsEventsToSave, fNumMpsEventsToSkip); - else if (name == "Hel_Tree") + else if (name == "mul") tree->SetPrescaling(fNumHelEventsToSave, fNumHelEventsToSkip); #if ROOT_VERSION_CODE >= ROOT_VERSION(5,26,00) diff --git a/Analysis/src/QwEPICSEvent.cc b/Analysis/src/QwEPICSEvent.cc index 10e7c9446..03e07e137 100755 --- a/Analysis/src/QwEPICSEvent.cc +++ b/Analysis/src/QwEPICSEvent.cc @@ -1295,7 +1295,7 @@ void QwEPICSEvent::WriteEPICSStringValues() << std::endl; } - TTree *slow_tree = (TTree*) file->Get("Slow_Tree"); + TTree *slow_tree = (TTree*) file->Get("slow"); for (std::size_t tagindex=0; tagindex("disable-mps-tree")) DisableTree("Mps_Tree"); - if (options.GetValue("disable-hel-tree")) DisableTree("Hel_Tree"); - if (options.GetValue("disable-burst-tree")) DisableTree("Burst_Tree"); - if (options.GetValue("disable-slow-tree")) DisableTree("Slow_Tree"); + if (options.GetValue("disable-mps-tree")) DisableTree("evt"); + if (options.GetValue("disable-hel-tree")) DisableTree("mul"); + if (options.GetValue("disable-burst-tree")) DisableTree("burst"); + if (options.GetValue("disable-slow-tree")) DisableTree("slow"); // Options 'num-accepted-events' and 'num-discarded-events' for // prescaling of the tree output @@ -311,7 +311,7 @@ Bool_t QwRootFile::HasAnyFilled(TDirectory* d) { if ( TString(name).Contains("mapfile") ) continue; if ( TString(name).Contains("_condition") ) continue; // The EPICS tree doesn't count - if ( TString(name).Contains("Slow_Tree") ) continue; + if ( TString(name).Contains("slow") ) continue; // Recursively check subdirectories. if (obj->IsA()->InheritsFrom( "TDirectory" )) diff --git a/Parity/main/QwParity.cc b/Parity/main/QwParity.cc index 735fbbc6d..a2d03163c 100644 --- a/Parity/main/QwParity.cc +++ b/Parity/main/QwParity.cc @@ -189,13 +189,13 @@ Int_t main(Int_t argc, Char_t* argv[]) detectors.ShareHistograms(ringoutput); // Construct tree branches - treerootfile->ConstructTreeBranches("Mps_Tree", "MPS event data tree", ringoutput); - treerootfile->ConstructTreeBranches("Hel_Tree", "Helicity event data tree", helicitypattern); - treerootfile->ConstructTreeBranches("Hel_Tree_Reg", "Helicity event data tree (regressed)", regression); - treerootfile->ConstructTreeBranches("Slow_Tree", "EPICS and slow control tree", epicsevent); - burstrootfile->ConstructTreeBranches("Burst_Tree", "Burst level data tree", helicitypattern.GetBurstYield(),"yield_"); - burstrootfile->ConstructTreeBranches("Burst_Tree", "Burst level data tree", helicitypattern.GetBurstAsymmetry(),"asym_"); - burstrootfile->ConstructTreeBranches("Burst_Tree", "Burst level data tree", helicitypattern.GetBurstDifference(),"diff_"); + treerootfile->ConstructTreeBranches("evt", "MPS event data tree", ringoutput); + treerootfile->ConstructTreeBranches("mul", "Helicity event data tree", helicitypattern); + treerootfile->ConstructTreeBranches("mulc", "Helicity event data tree (corrected)", regression); + treerootfile->ConstructTreeBranches("slow", "EPICS and slow control tree", epicsevent); + burstrootfile->ConstructTreeBranches("burst", "Burst level data tree", helicitypattern.GetBurstYield(),"yield_"); + burstrootfile->ConstructTreeBranches("burst", "Burst level data tree", helicitypattern.GetBurstAsymmetry(),"asym_"); + burstrootfile->ConstructTreeBranches("burst", "Burst level data tree", helicitypattern.GetBurstDifference(),"diff_"); // Summarize the ROOT file structure //treerootfile->PrintTrees(); @@ -249,7 +249,7 @@ Int_t main(Int_t argc, Char_t* argv[]) helicitypattern.UpdateBlinder(epicsevent); treerootfile->FillTreeBranches(epicsevent); - treerootfile->FillTree("Slow_Tree"); + treerootfile->FillTree("slow"); } } @@ -290,7 +290,7 @@ Int_t main(Int_t argc, Char_t* argv[]) // Fill mps tree branches treerootfile->FillTreeBranches(ringoutput); - treerootfile->FillTree("Mps_Tree"); + treerootfile->FillTree("evt"); // Load the event into the helicity pattern helicitypattern.LoadEventData(ringoutput); @@ -310,7 +310,7 @@ Int_t main(Int_t argc, Char_t* argv[]) // Fill helicity tree branches treerootfile->FillTreeBranches(helicitypattern); - treerootfile->FillTree("Hel_Tree"); + treerootfile->FillTree("mul"); // Burst mode if (helicitypattern.IsEndOfBurst()) { @@ -321,7 +321,7 @@ Int_t main(Int_t argc, Char_t* argv[]) burstrootfile->FillTreeBranches(helicitypattern.GetBurstYield()); burstrootfile->FillTreeBranches(helicitypattern.GetBurstAsymmetry()); burstrootfile->FillTreeBranches(helicitypattern.GetBurstDifference()); - burstrootfile->FillTree("Burst_Tree"); + burstrootfile->FillTree("burst"); // Clear the data helicitypattern.ClearBurstSum(); @@ -331,9 +331,9 @@ Int_t main(Int_t argc, Char_t* argv[]) regression.LinearRegression(QwRegression::kRegTypeAsym); running_regression.AccumulateRunningSum(regression); - // Fill regressed tree branches + // Fill corrected tree branches treerootfile->FillTreeBranches(regression); - treerootfile->FillTree("Hel_Tree_Reg"); + treerootfile->FillTree("mulc"); // Clear the data helicitypattern.ClearEventData(); diff --git a/Parity/main/QwParity_simple.cc b/Parity/main/QwParity_simple.cc index d450c3a96..eaa398e0d 100644 --- a/Parity/main/QwParity_simple.cc +++ b/Parity/main/QwParity_simple.cc @@ -164,13 +164,13 @@ Int_t main(Int_t argc, Char_t* argv[]) detectors.ShareHistograms(ringoutput); // Construct tree branches - treerootfile->ConstructTreeBranches("Mps_Tree", "MPS event data tree", ringoutput); - treerootfile->ConstructTreeBranches("Hel_Tree", "Helicity event data tree", helicitypattern); - // treerootfile->ConstructTreeBranches("Hel_Tree_Reg", "Helicity event data tree (regressed)", regression); - // treerootfile->ConstructTreeBranches("Slow_Tree", "EPICS and slow control tree", epicsevent); - burstrootfile->ConstructTreeBranches("Burst_Tree", "Burst level data tree", helicitypattern.GetBurstYield(),"yield_"); - burstrootfile->ConstructTreeBranches("Burst_Tree", "Burst level data tree", helicitypattern.GetBurstAsymmetry(),"asym_"); - burstrootfile->ConstructTreeBranches("Burst_Tree", "Burst level data tree", helicitypattern.GetBurstDifference(),"diff_"); + treerootfile->ConstructTreeBranches("evt", "MPS event data tree", ringoutput); + treerootfile->ConstructTreeBranches("mul", "Helicity event data tree", helicitypattern); + // treerootfile->ConstructTreeBranches("mulc", "Helicity event data tree (corrected)", regression); + // treerootfile->ConstructTreeBranches("slow", "EPICS and slow control tree", epicsevent); + burstrootfile->ConstructTreeBranches("burst", "Burst level data tree", helicitypattern.GetBurstYield(),"yield_"); + burstrootfile->ConstructTreeBranches("burst", "Burst level data tree", helicitypattern.GetBurstAsymmetry(),"asym_"); + burstrootfile->ConstructTreeBranches("burst", "Burst level data tree", helicitypattern.GetBurstDifference(),"diff_"); // Summarize the ROOT file structure //treerootfile->PrintTrees(); @@ -219,7 +219,7 @@ Int_t main(Int_t argc, Char_t* argv[]) // helicitypattern.UpdateBlinder(epicsevent); // treerootfile->FillTreeBranches(epicsevent); - // treerootfile->FillTree("Slow_Tree"); + // treerootfile->FillTree("slow"); // } // } @@ -260,7 +260,7 @@ Int_t main(Int_t argc, Char_t* argv[]) // Fill mps tree branches treerootfile->FillTreeBranches(ringoutput); - treerootfile->FillTree("Mps_Tree"); + treerootfile->FillTree("evt"); // Load the event into the helicity pattern helicitypattern.LoadEventData(ringoutput); @@ -280,7 +280,7 @@ Int_t main(Int_t argc, Char_t* argv[]) // Fill helicity tree branches treerootfile->FillTreeBranches(helicitypattern); - treerootfile->FillTree("Hel_Tree"); + treerootfile->FillTree("mul"); // Burst mode if (helicitypattern.IsEndOfBurst()) { @@ -291,7 +291,7 @@ Int_t main(Int_t argc, Char_t* argv[]) burstrootfile->FillTreeBranches(helicitypattern.GetBurstYield()); burstrootfile->FillTreeBranches(helicitypattern.GetBurstAsymmetry()); burstrootfile->FillTreeBranches(helicitypattern.GetBurstDifference()); - burstrootfile->FillTree("Burst_Tree"); + burstrootfile->FillTree("burst"); // Clear the data helicitypattern.ClearBurstSum(); @@ -301,9 +301,9 @@ Int_t main(Int_t argc, Char_t* argv[]) // regression.LinearRegression(QwRegression::kRegTypeAsym); // running_regression.AccumulateRunningSum(regression); - // // Fill regressed tree branches + // // Fill corrected tree branches // treerootfile->FillTreeBranches(regression); - // treerootfile->FillTree("Hel_Tree_Reg"); + // treerootfile->FillTree("mulc"); // Clear the data helicitypattern.ClearEventData(); diff --git a/Parity/src/QwBPMStripline.cc b/Parity/src/QwBPMStripline.cc index cb462f361..15dc8a904 100755 --- a/Parity/src/QwBPMStripline.cc +++ b/Parity/src/QwBPMStripline.cc @@ -36,7 +36,7 @@ void QwBPMStripline::InitializeChannel(TString name) for(i=kXAxis;i::InitializeChannel(TString subsystem, TString name) for(i=kXAxis;i::ConstructBranchAndVector(TTree *tree, TString &prefix, for(i=0;i<4;i++) fWire[i].ConstructBranchAndVector(tree,thisprefix,values); } for(i=kXAxis;i::ConstructBranch(TTree *tree, TString &prefix) for(i=0;i<4;i++) fWire[i].ConstructBranch(tree,thisprefix); } for(i=kXAxis;i::ConstructBranch(TTree *tree, TString &prefix, QwParamet for(i=0;i<4;i++) fWire[i].ConstructBranch(tree,thisprefix); } for(i=kXAxis;i::FillTreeVector(std::vector &values) const for(i=0;i<4;i++) fWire[i].FillTreeVector(values); } for(i=kXAxis;i Date: Fri, 21 Dec 2018 09:10:04 -0500 Subject: [PATCH 039/137] Updated the new prexCH map to have the consistent cavity monitor names. --- Parity/prminput/prexCH_beamline.4747-.map | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/Parity/prminput/prexCH_beamline.4747-.map b/Parity/prminput/prexCH_beamline.4747-.map index 7467a9a07..2204342cf 100644 --- a/Parity/prminput/prexCH_beamline.4747-.map +++ b/Parity/prminput/prexCH_beamline.4747-.map @@ -40,19 +40,19 @@ sample_size=16564 VQWK, 2, 7, bpmstripline, BPM4Aym !ADC3 - VQWK, 3, 0, bcm, CAVB_X - VQWK, 3, 1, bcm, CAVB_Y - VQWK, 3, 2, bcm, CAVB_Q + VQWK, 3, 0, bcm, CAV4BX + VQWK, 3, 1, bcm, CAV4BY + VQWK, 3, 2, bcm, CAV4BQ VQWK, 3, 3, bcm, QWK_3_3 - VQWK, 3, 4, bcm, CAVC_X - VQWK, 3, 5, bcm, CAVC_Y - VQWK, 3, 6, bcm, CAVC_Q + VQWK, 3, 4, bcm, CAV4CX + VQWK, 3, 5, bcm, CAV4CY + VQWK, 3, 6, bcm, CAV4CQ VQWK, 3, 7, bcm, QWK_3_7 !ADC4 - VQWK, 4, 0, bcm, CAVD_X - VQWK, 4, 1, bcm, CAVD_Y - VQWK, 4, 2, bcm, CAVD_Q + VQWK, 4, 0, bcm, CAV4DX + VQWK, 4, 1, bcm, CAV4DY + VQWK, 4, 2, bcm, CAV4DQ VQWK, 4, 3, bcm, QWK_4_3 VQWK, 4, 4, bcm, QWK_4_4 VQWK, 4, 5, bcm, QWK_4_5 From eb1df000b8f974ce7d6922f9d43c97e63d3d3446 Mon Sep 17 00:00:00 2001 From: Ciprian Gal Date: Thu, 10 Jan 2019 18:55:36 -0500 Subject: [PATCH 040/137] version 0 of online gui. tests to follow --- panguin/CMakeLists.txt | 81 ++ panguin/include/panguinOnline.hh | 95 +++ panguin/include/panguinOnlineConfig.hh | 56 ++ panguin/include/panguinOnlineLinkDef.h | 10 + panguin/panguin.cc | 78 ++ panguin/src/panguinOnline.cc | 1092 ++++++++++++++++++++++++ panguin/src/panguinOnlineConfig.cc | 529 ++++++++++++ 7 files changed, 1941 insertions(+) create mode 100755 panguin/CMakeLists.txt create mode 100644 panguin/include/panguinOnline.hh create mode 100644 panguin/include/panguinOnlineConfig.hh create mode 100644 panguin/include/panguinOnlineLinkDef.h create mode 100644 panguin/panguin.cc create mode 100644 panguin/src/panguinOnline.cc create mode 100644 panguin/src/panguinOnlineConfig.cc diff --git a/panguin/CMakeLists.txt b/panguin/CMakeLists.txt new file mode 100755 index 000000000..33b0f55bc --- /dev/null +++ b/panguin/CMakeLists.txt @@ -0,0 +1,81 @@ +# Require at least cmake 2.8.4 +cmake_minimum_required(VERSION 2.8.4 FATAL_ERROR) + +# Name of this project +project(panguin) + +message(STATUS "System name ${CMAKE_SYSTEM_NAME}") +#MAC specific variable +if(${CMAKE_SYSTEM_NAME} MATCHES "Darwin") + set(CMAKE_MACOSX_RPATH ON) + set(CMAKE_SKIP_BUILD_RPATH FALSE) + set(CMAKE_BUILD_WITH_INSTALL_RPATH FALSE) + set(CMAKE_INSTALL_RPATH "${CMAKE_INSTALL_PREFIX}/lib") + set(CMAKE_INSTALL_RPATH_USE_LINK_PATH TRUE) + list(FIND CMAKE_PLATFORM_IMPLICIT_LINK_DIRECTORIES "${CMAKE_INSTALL_PREFIX}/lib" isSystemDir) + if("${isSystemDir}" STREQUAL "-1") + set(CMAKE_INSTALL_RPATH "${CMAKE_INSTALL_PREFIX}/lib") + endif() +endif() + +# Local path for cmake modules, before ${CMAKE_ROOT}/Modules/ is checked +set(CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/../cmake/modules") + +# Install directory +if (CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT) + message(STATUS " Install-prefix was at default -> forcing it to the source-dir" ) + message(STATUS " Use -DCMAKE_INSTALL_PREFIX=/usr/local to set to something else" ) + set (CMAKE_INSTALL_PREFIX "${CMAKE_SOURCE_DIR}" + CACHE PATH "default install path" FORCE ) +else() + set(CMAKE_INSTALL_PREFIX ${CMAKE_SOURCE_DIR}) + set(CMAKE_INSTALL_RPATH "${CMAKE_INSTALL_PREFIX}/lib") +endif() + +# Add the project include directory +include_directories(${CMAKE_CURRENT_BINARY_DIR}/include) + +# Load ROOT and setup include directory +find_package(ROOT REQUIRED) +include_directories(${ROOT_INCLUDE_DIR}) +set(ROOT_LIBRARIES ${ROOT_LIBRARIES} -lNew -lGui -lMinuit2) + +add_definitions(-std=c++11) + +ROOT_GENERATE_DICTIONARY( + panguinDict # path to dictionary to generate + LINKDEF "include/panguinOnlineLinkDef.h" # ROOT linkDef file + OPTIONS -p +) + +include_directories(${PROJECT_SOURCE_DIR}/include) + +#---------------------------------------------------------------------------- +# Locate sources and headers for this project +# NB: headers are included so they will show up in IDEs +# +file(GLOB sources ${PROJECT_SOURCE_DIR}/src/*.cc) +file(GLOB headers ${PROJECT_SOURCE_DIR}/include/*.hh) + +#---------------------------------------------------------------------------- +# Add the executable, and link it to the Geant4 libraries +#---------------------------------------------------------------------------- +# Generate dictionaries as well (so we can write objects to ROOT files +# +add_library(panguin-lib SHARED ${sources} ${headers} panguinDict.cxx) +set_target_properties(panguin-lib PROPERTIES OUTPUT_NAME panguin) +target_link_libraries(panguin-lib ${ROOT_LIBRARIES}) + +add_executable(panguin-bin panguin.cc) +set_target_properties(panguin-bin PROPERTIES OUTPUT_NAME panguin) +target_link_libraries(panguin-bin panguin-lib) + +#---------------------------------------------------------------------------- +# +add_custom_target(panguin DEPENDS panguin-bin) + +#---------------------------------------------------------------------------- +# Install the executable to 'bin' directory under CMAKE_INSTALL_PREFIX +# +#install(TARGETS panguin-bin DESTINATION ${CMAKE_INSTALL_BINDIR}) +#install(TARGETS panguin-lib DESTINATION ${CMAKE_INSTALL_LIBDIR}) diff --git a/panguin/include/panguinOnline.hh b/panguin/include/panguinOnline.hh new file mode 100644 index 000000000..899b972a9 --- /dev/null +++ b/panguin/include/panguinOnline.hh @@ -0,0 +1,95 @@ +/////////////////////////////////////////////////////////////////// +// Macro to help with online analysis +// B. Moffit Oct. 2003 +#ifndef panguinOnline_h +#define panguinOnline_h 1 + +#include +#include +#include +#include +#include +#include "TGLabel.h" +#include "TGString.h" +#include +#include +#include +#include +#include +#include +#include "TH1.h" +#include "TH2.h" +#include "TH3.h" +#include "panguinOnlineConfig.hh" + +#define UPDATETIME 2000 + +class OnlineGUI { + // Class that takes care of the GUI + RQ_OBJECT("OnlineGUI") +private: + TGMainFrame *fMain; + TGHorizontalFrame *fTopframe; + TGVerticalFrame *vframe; + TGRadioButton *fRadioPage[50]; + TGPictureButton *wile; + TRootEmbeddedCanvas *fEcanvas; + TGHorizontalFrame *fBottomFrame; + TGHorizontalFrame *hframe; + TGTextButton *fNext; + TGTextButton *fPrev; + TGTextButton *fExit; + TGLabel *fRunNumber; + TGTextButton *fPrint; + TCanvas *fCanvas; // Present Embedded canvas + OnlineConfig *fConfig; + UInt_t current_page; + TFile* fRootFile; + TFile* fGoldenFile; + Bool_t doGolden; + std::vector fRootTree; + std::vector fTreeEntries; + std::vector < std::pair > fileObjects; + std::vector < std::vector > treeVars; + UInt_t runNumber; + TTimer *timer; + Bool_t fUpdate; + Bool_t fFileAlive; + Bool_t fPrintOnly; + TH1D *mytemp1d; + TH2D *mytemp2d; + TH3D *mytemp3d; + TH1D *mytemp1d_golden; + TH2D *mytemp2d_golden; + TH3D *mytemp3d_golden; + +public: + OnlineGUI(OnlineConfig&,Bool_t); + void CreateGUI(const TGWindow *p, UInt_t w, UInt_t h); + virtual ~OnlineGUI(); + void DoDraw(); + void DrawPrev(); + void DrawNext(); + void DoRadio(); + void CheckPageButtons(); + // Specific Draw Methods + Bool_t IsHistogram(TString); + void GetFileObjects(); + void GetTreeVars(); + void GetRootTree(); + UInt_t GetTreeIndex(TString); + UInt_t GetTreeIndexFromName(TString); + void TreeDraw(std::vector ); + void HistDraw(std::vector ); + void MacroDraw(std::vector ); + void DoDrawClear(); + void TimerUpdate(); + void BadDraw(TString); + void CheckRootFile(); + Int_t OpenRootFile(); + void PrintToFile(); + void PrintPages(); + void MyCloseWindow(); + void CloseGUI(); +}; +#endif //panguinOnline_h diff --git a/panguin/include/panguinOnlineConfig.hh b/panguin/include/panguinOnlineConfig.hh new file mode 100644 index 000000000..1240e6320 --- /dev/null +++ b/panguin/include/panguinOnlineConfig.hh @@ -0,0 +1,56 @@ +#ifndef panguinOnlineConfig_h +#define panguinOnlineConfig_h 1 + +#include +#include +#include +#include +#include "TCut.h" + +static TString guiDirectory = "panguin"; + +class OnlineConfig { + //RQ_OBJECT("OnlineConfig");//FIXME cg + // Class that takes care of the config file +private: + TString confFileName; // config filename + std::ifstream *fConfFile; // original config file + void ParseFile(); + std::vector < std::vector > sConfFile; // the config file, in memory + // pageInfo is the vector of the pages containing the sConfFile index + // and how many commands issued within that page (title, 1d, etc.) + TString rootfilename; // Just the name + TString goldenrootfilename; // Golden rootfile for comparisons + TString protorootfile; // Prototype for getting the rootfilename + TString guicolor; // User's choice of background color + TString plotsdir; // Where to store sample plots.. automatically stored as .jpg's). + std::vector < std::pair > pageInfo; + std::vector cutList; + std::vector GetDrawIndex(UInt_t); + Bool_t fFoundCfg; + Bool_t fMonitor; + + +public: + OnlineConfig(); + OnlineConfig(TString); + Bool_t ParseConfig(); + TString GetRootFile() { return rootfilename; }; + TString GetGoldenFile() { return goldenrootfilename; }; + TString GetGuiColor() { return guicolor; }; + TString GetPlotsDir() { return plotsdir; }; + TCut GetDefinedCut(TString ident); + std::vector GetCutIdent(); + // Page utilites + UInt_t GetPageCount() { return pageInfo.size(); }; + std::pair GetPageDim(UInt_t); + Bool_t IsLogy(UInt_t page); + TString GetPageTitle(UInt_t); + UInt_t GetDrawCount(UInt_t); // Number of histograms in a page + std::vector GetDrawCommand(UInt_t,UInt_t); + std::vector SplitString(TString,TString); + void OverrideRootFile(UInt_t); + Bool_t IsMonitor() { return fMonitor; }; +}; + +#endif //panguinOnlineConfig_h diff --git a/panguin/include/panguinOnlineLinkDef.h b/panguin/include/panguinOnlineLinkDef.h new file mode 100644 index 000000000..2d19522f8 --- /dev/null +++ b/panguin/include/panguinOnlineLinkDef.h @@ -0,0 +1,10 @@ +#if defined(__CINT__) || defined(__CLING__) + +#pragma link off all globals; +#pragma link off all classes; +#pragma link off all functions; + +#pragma link C++ class OnlineGUI+; +#pragma link C++ class OnlineConfig+; + +#endif diff --git a/panguin/panguin.cc b/panguin/panguin.cc new file mode 100644 index 000000000..d05e39730 --- /dev/null +++ b/panguin/panguin.cc @@ -0,0 +1,78 @@ +#include "panguinOnline.hh" +#include +#include +#include +#include + +using namespace std; + +void Usage(); +void online(TString type="standard",UInt_t run=0,Bool_t printonly=kFALSE); + +int main(int argc, char **argv){ + TString type="default"; + UInt_t run=0; + Bool_t printonly=kFALSE; + Bool_t showedUsage=kFALSE; + + TApplication theApp("App",&argc,argv,NULL,-1); + + for(Int_t i=1;iIsBatch()) { + gROOT->SetBatch(); + } + } + + OnlineConfig *fconfig = new OnlineConfig(type); + + if(!fconfig->ParseConfig()) { + gApplication->Terminate(); + } + + if(run!=0) fconfig->OverrideRootFile(run); + + new OnlineGUI(*fconfig,printonly); +} + +void Usage(){ + cerr << "Usage: online [-r] [-f] [-P]" << endl; + cerr << "Options:" << endl; + cerr << " -r : runnumber" << endl; + cerr << " -f : configuration file" << endl; + cerr << " -P : Only Print Summary Plots" << endl; + cerr << endl; +} + diff --git a/panguin/src/panguinOnline.cc b/panguin/src/panguinOnline.cc new file mode 100644 index 000000000..75a910246 --- /dev/null +++ b/panguin/src/panguinOnline.cc @@ -0,0 +1,1092 @@ +/////////////////////////////////////////////////////////////////// +// Macro to help with online analysis +// B. Moffit Oct. 2003 + +#include "panguinOnline.hh" +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include "TPaveText.h" +#include +//#define DEBUG +//#define DEBUG2 +//#define NOISY +//#define OLDTIMERUPDATE + +using namespace std; + +/////////////////////////////////////////////////////////////////// +// Class: OnlineGUI +// +// Creates a GUI to display the commands used in OnlineConfig +// +// + +OnlineGUI::OnlineGUI(OnlineConfig& config, Bool_t printonly): + runNumber(0), + timer(0), + fFileAlive(kFALSE) +{ + // Constructor. Get the config pointer, and make the GUI. + + fConfig = &config; + + if(printonly) { + fPrintOnly=kTRUE; + PrintPages(); + } else { + fPrintOnly=kFALSE; + CreateGUI(gClient->GetRoot(),200,200); + } +} + +void OnlineGUI::CreateGUI(const TGWindow *p, UInt_t w, UInt_t h) +{ + + // Open the RootFile. Die if it doesn't exist. + // unless we're watching a file. + fRootFile = new TFile(fConfig->GetRootFile(),"READ"); + if(!fRootFile->IsOpen()) { + cout << "ERROR: rootfile: " << fConfig->GetRootFile() + << " does not exist" + << endl; + if(fConfig->IsMonitor()) { + cout << "Will wait... hopefully.." << endl; + } else { + gApplication->Terminate(); + } + } else { + fFileAlive = kTRUE; + //ObtainRunNumber();//FIXME CG + // Open the Root Trees. Give a warning if it's not there.. + GetFileObjects(); + GetRootTree(); + GetTreeVars(); + for(UInt_t i=0; iGetGoldenFile(); + if(!goldenfilename.IsNull()) { + fGoldenFile = new TFile(goldenfilename,"READ"); + if(!fGoldenFile->IsOpen()) { + cout << "ERROR: goldenrootfile: " << goldenfilename + << " does not exist. Oh well, no comparison plots." + << endl; + doGolden = kFALSE; + fGoldenFile=NULL; + } else { + doGolden = kTRUE; + } + } else { + doGolden=kFALSE; + fGoldenFile=NULL; + } + + + // Create the main frame + fMain = new TGMainFrame(p,w,h); + fMain->Connect("CloseWindow()", "OnlineGUI", this, "MyCloseWindow()"); + ULong_t lightgreen, lightblue, red, mainguicolor; + gClient->GetColorByName("lightgreen",lightgreen); + gClient->GetColorByName("lightblue",lightblue); + gClient->GetColorByName("red",red); + + Bool_t good_color=kFALSE; + TString usercolor = fConfig->GetGuiColor(); + if(!usercolor.IsNull()) { + good_color = gClient->GetColorByName(usercolor,mainguicolor); + } + + if(!good_color) { + if(!usercolor.IsNull()) { + cout << "Bad guicolor (" << usercolor << ").. using default." << endl; + } + if(fConfig->IsMonitor()) { + // Default background color for Online Monitor + mainguicolor = lightgreen; + } else { + // Default background color for Normal Online Display + mainguicolor = lightblue; + } + } + + fMain->SetBackgroundColor(mainguicolor); + + // Top frame, to hold page buttons and canvas + fTopframe = new TGHorizontalFrame(fMain,200,200); + fTopframe->SetBackgroundColor(mainguicolor); + fMain->AddFrame(fTopframe, new TGLayoutHints(kLHintsExpandX + | kLHintsExpandY,10,10,10,1)); + + // Create a verticle frame widget with radio buttons + // This will hold the page buttons + vframe = new TGVerticalFrame(fTopframe,40,200); + vframe->SetBackgroundColor(mainguicolor); + TString buff; + for(UInt_t i=0; iGetPageCount(); i++) { + buff = fConfig->GetPageTitle(i); + fRadioPage[i] = new TGRadioButton(vframe,buff,i); + fRadioPage[i]->SetBackgroundColor(mainguicolor); + } + + fRadioPage[0]->SetState(kButtonDown); + current_page = 0; + + for (UInt_t i=0; iGetPageCount(); i++) { + vframe->AddFrame(fRadioPage[i], new TGLayoutHints(kLHintsLeft | + kLHintsCenterY,5,5,3,4)); + fRadioPage[i]->Connect("Pressed()", "OnlineGUI", this, "DoRadio()"); + } + if(!fConfig->IsMonitor()) { + wile = + new TGPictureButton(vframe,gClient->GetPicture(guiDirectory+"/genius.xpm")); + wile->Connect("Pressed()","OnlineGUI", this,"DoDraw()"); + } else { + wile = + new TGPictureButton(vframe,gClient->GetPicture(guiDirectory+"/panguin.xpm")); + wile->Connect("Pressed()","OnlineGUI", this,"DoDrawClear()"); + } + wile->SetBackgroundColor(mainguicolor); + + vframe->AddFrame(wile,new TGLayoutHints(kLHintsBottom|kLHintsLeft,5,10,4,2)); + + + fTopframe->AddFrame(vframe,new TGLayoutHints(kLHintsCenterX| + kLHintsCenterY,2,2,2,2)); + + // Create canvas widget + fEcanvas = new TRootEmbeddedCanvas("Ecanvas", fTopframe, 800, 600); + fEcanvas->SetBackgroundColor(mainguicolor); + fTopframe->AddFrame(fEcanvas, new TGLayoutHints(kLHintsExpandY,10,10,10,1)); + fCanvas = fEcanvas->GetCanvas(); + + // Create the bottom frame. Contains control buttons + fBottomFrame = new TGHorizontalFrame(fMain,1200,200); + fBottomFrame->SetBackgroundColor(mainguicolor); + fMain->AddFrame(fBottomFrame, new TGLayoutHints(kLHintsExpandX,10,10,10,10)); + + // Create a horizontal frame widget with buttons + hframe = new TGHorizontalFrame(fBottomFrame,1200,40); + hframe->SetBackgroundColor(mainguicolor); + fBottomFrame->AddFrame(hframe,new TGLayoutHints(kLHintsExpandX,200,20,2,2)); + + fPrev = new TGTextButton(hframe,"Prev"); + fPrev->SetBackgroundColor(mainguicolor); + fPrev->Connect("Clicked()","OnlineGUI",this,"DrawPrev()"); + hframe->AddFrame(fPrev, new TGLayoutHints(kLHintsCenterX,5,5,1,1)); + + fNext = new TGTextButton(hframe,"Next"); + fNext->SetBackgroundColor(mainguicolor); + fNext->Connect("Clicked()","OnlineGUI",this,"DrawNext()"); + hframe->AddFrame(fNext, new TGLayoutHints(kLHintsCenterX,5,5,1,1)); + + fExit = new TGTextButton(hframe,"Exit GUI"); + fExit->SetBackgroundColor(red); + fExit->Connect("Clicked()","OnlineGUI",this,"CloseGUI()"); + + hframe->AddFrame(fExit, new TGLayoutHints(kLHintsCenterX,5,5,1,1)); + + TString Buff; + if(runNumber==0) { + Buff = ""; + } else { + Buff = "Run #"; + Buff += runNumber; + } + TGString labelBuff(Buff); + + fRunNumber = new TGLabel(hframe,Buff); + fRunNumber->SetBackgroundColor(mainguicolor); + hframe->AddFrame(fRunNumber,new TGLayoutHints(kLHintsCenterX,5,5,1,1)); + + fPrint = new TGTextButton(hframe,"Print To &File"); + fPrint->SetBackgroundColor(mainguicolor); + fPrint->Connect("Clicked()","OnlineGUI",this,"PrintToFile()"); + hframe->AddFrame(fPrint, new TGLayoutHints(kLHintsCenterX,5,5,1,1)); + + + // Set a name to the main frame + if(fConfig->IsMonitor()) { + fMain->SetWindowName("Parity ANalysis GUI moNitor"); + } else { + fMain->SetWindowName("Online Analysis GUI"); + } + + // Map all sub windows to main frame + fMain->MapSubwindows(); + + // Initialize the layout algorithm + fMain->Resize(fMain->GetDefaultSize()); + + // Map main frame + fMain->MapWindow(); + +#ifdef DEBUG + fMain->Print(); +#endif + + if(fFileAlive) DoDraw(); + + if(fConfig->IsMonitor()) { + timer = new TTimer(); + if(fFileAlive) { + timer->Connect(timer,"Timeout()","OnlineGUI",this,"TimerUpdate()"); + } else { + timer->Connect(timer,"Timeout()","OnlineGUI",this,"CheckRootFile()"); + } + timer->Start(UPDATETIME); + } + +} + +void OnlineGUI::DoDraw() +{ + // The main Drawing Routine. + + gStyle->SetOptStat(1110); + gStyle->SetStatFontSize(0.1); + if (fConfig->IsLogy(current_page)) { + gStyle->SetOptLogy(1); + } else { + gStyle->SetOptLogy(0); + } +// gStyle->SetTitleH(0.10); +// gStyle->SetTitleW(0.40); + gStyle->SetTitleH(0.10); + gStyle->SetTitleW(0.60); + gStyle->SetStatH(0.70); + gStyle->SetStatW(0.35); +// gStyle->SetLabelSize(0.10,"X"); +// gStyle->SetLabelSize(0.10,"Y"); + gStyle->SetLabelSize(0.05,"X"); + gStyle->SetLabelSize(0.05,"Y"); + gStyle->SetPadLeftMargin(0.14); + gStyle->SetNdivisions(505,"X"); + gStyle->SetNdivisions(404,"Y"); + gROOT->ForceStyle(); + + // Determine the dimensions of the canvas.. + UInt_t draw_count = fConfig->GetDrawCount(current_page); + if(draw_count>=8) { + gStyle->SetLabelSize(0.08,"X"); + gStyle->SetLabelSize(0.08,"Y"); + } +// Int_t dim = Int_t(round(sqrt(double(draw_count)))); + pair dim = fConfig->GetPageDim(current_page); + +#ifdef DEBUG + cout << "Dimensions: " << dim.first << "X" + << dim.second << endl; +#endif + + // Create a nice clean canvas. + fCanvas->Clear(); + fCanvas->Divide(dim.first,dim.second); + + vector drawcommand(5); + // Draw the histograms. + for(UInt_t i=0; iGetDrawCommand(current_page,i); + fCanvas->cd(i+1); + if (drawcommand[0] == "macro") { + MacroDraw(drawcommand); + } else if (IsHistogram(drawcommand[0])) { + HistDraw(drawcommand); + } else { + TreeDraw(drawcommand); + } + } + + fCanvas->cd(); + fCanvas->Update(); + + if(!fPrintOnly) { + CheckPageButtons(); + } + +} + +void OnlineGUI::DrawNext() +{ + // Handler for the "Next" button. + fRadioPage[current_page]->SetState(kButtonUp); + // The following line triggers DoRadio(), or at least.. used to + fRadioPage[current_page+1]->SetState(kButtonDown); + current_page++; + DoDraw(); +} + +void OnlineGUI::DrawPrev() +{ + // Handler for the "Prev" button. + fRadioPage[current_page]->SetState(kButtonUp); + // The following line triggers DoRadio(), or at least.. used to + fRadioPage[current_page-1]->SetState(kButtonDown); + current_page--; + DoDraw(); +} + +void OnlineGUI::DoRadio() +{ + // Handle the radio buttons + // Find out which button has been pressed.. + // turn off the previous button... + // then draw the appropriate page. + // This routine also handles the Draw from the Prev/Next buttons + // - makes a call to DoDraw() + + UInt_t pagecount = fConfig->GetPageCount(); + TGButton *btn = (TGButton *) gTQSender; + UInt_t id = btn->WidgetId(); + + if (id <= pagecount) { + fRadioPage[current_page]->SetState(kButtonUp); + } + + current_page = id; + if(!fConfig->IsMonitor()) DoDraw(); + +} + +void OnlineGUI::CheckPageButtons() +{ + // Checks the current page to see if it's the first or last page. + // If so... turn off the appropriate button. + // If not.. turn on both buttons. + + if(current_page==0) { + fPrev->SetState(kButtonDisabled); + if(fConfig->GetPageCount()!=1) + fNext->SetState(kButtonUp); + } else if(current_page==fConfig->GetPageCount()-1) { + fNext->SetState(kButtonDisabled); + if(fConfig->GetPageCount()!=1) + fPrev->SetState(kButtonUp); + } else { + fPrev->SetState(kButtonUp); + fNext->SetState(kButtonUp); + } +} + +Bool_t OnlineGUI::IsHistogram(TString objectname) +{ + // Utility to determine if the objectname provided is a histogram + + for(UInt_t i=0; i + // If there's no good keys.. do nothing. +#ifdef DEBUG + cout << "Keys = " << fRootFile->ReadKeys() << endl; +#endif + if(fRootFile->ReadKeys()==0) { + fUpdate = kFALSE; +// delete fRootFile; +// fRootFile = 0; +// CheckRootFile(); + return; + } + fileObjects.clear(); + TIter next(fRootFile->GetListOfKeys()); + TKey *key = new TKey(); + + // Do the search + while((key=(TKey*)next())!=0) { +#ifdef DEBUG + cout << "Key = " << key << endl; +#endif + TString objname = key->GetName(); + TString objtype = key->GetClassName(); +#ifdef DEBUG + cout << objname << " " << objtype << endl; +#endif + fileObjects.push_back(make_pair(objname,objtype)); + } + fUpdate = kTRUE; + delete key; +} + +void OnlineGUI::GetTreeVars() +{ + // Utility to find all of the variables (leaf's/branches) within a + // Specified TTree and put them within the treeVars vector. + treeVars.clear(); + TObjArray *branchList; + vector currentTree; + + for(UInt_t i=0; iGetListOfBranches(); + TIter next(branchList); + TBranch *brc; + + while((brc=(TBranch*)next())!=0) { + TString found = brc->GetName(); + // Not sure if the line below is so smart... + currentTree.push_back(found); + } + treeVars.push_back(currentTree); + } +#ifdef DEBUG2 + for(UInt_t iTree=0; iTree found; + for(UInt_t i=0; iGet(found.front())); + found.pop_front(); + } + // Initialize the fTreeEntries vector + fTreeEntries.clear(); + for(UInt_t i=0;iSplitString(var,":")[0]; + var = first_var; + } + if(var.Contains("-")) { + TString first_var = fConfig->SplitString(var,"-")[0]; + var = first_var; + } + if(var.Contains("/")) { + TString first_var = fConfig->SplitString(var,"/")[0]; + var = first_var; + } + if(var.Contains("*")) { + TString first_var = fConfig->SplitString(var,"*")[0]; + var = first_var; + } + if(var.Contains("+")) { + TString first_var = fConfig->SplitString(var,"+")[0]; + var = first_var; + } + if(var.Contains("(")) { + TString first_var = fConfig->SplitString(var,"(")[0]; + var = first_var; + } + // This is for variables with multiple dimensions. + if(var.Contains("[")) { + TString first_var = fConfig->SplitString(var,"[")[0]; + var = first_var; + } + +#ifdef OLD_GETTREEINDEX + TObjArray *branchList; + + for(UInt_t i=0; iGetListOfBranches(); + TIter next(branchList); + TBranch *brc; + + while((brc=(TBranch*)next())!=0) { + TString found = brc->GetName(); + if (found == var) { + return i; + } + } + } +#else + for(UInt_t iTree=0; iTreeGetName(); + if(name == treename) { + return iTree; + } + } + + return fRootTree.size()+1; +} + +void OnlineGUI::MacroDraw(vector command) { + // Called by DoDraw(), this will make a call to the defined macro, and + // plot it in it's own pad. One plot per macro, please. + + if(command[1].IsNull()) { + cout << "macro command doesn't contain a macro to execute" << endl; + return; + } + + if(doGolden) fRootFile->cd(); + gROOT->Macro(command[1]); + + +} + +void OnlineGUI::DoDrawClear() { + // Utility to grab the number of entries in each tree. This info is + // then used, if watching a file, to "clear" the TreeDraw + // histograms, and begin looking at new data. + for(UInt_t i=0; iGetEntries(); + } + + +} + +void OnlineGUI::TimerUpdate() { + // Called periodically by the timer, if "watchfile" is indicated + // in the config. Reloads the ROOT file, and updates the current page. +#ifdef DEBUG + cout << "Update Now" << endl; +#endif + +#ifdef OLDTIMERUPDATE + fRootFile = new TFile(fConfig->GetRootFile(),"READ"); + if(fRootFile->IsZombie()) { + cout << "New run not yet available. Waiting..." << endl; + fRootFile->Close(); + delete fRootFile; + fRootFile = 0; + timer->Reset(); + timer->Disconnect(); + timer->Connect(timer,"Timeout()","OnlineGUI",this,"CheckRootFile()"); + return; + } + + // Update the runnumber + //ObtainRunNumber();//FIXME CG + if(runNumber != 0) { + TString rnBuff = "Run #"; + rnBuff += runNumber; + fRunNumber->SetText(rnBuff.Data()); + hframe->Layout(); + } + + // Open the Root Trees. Give a warning if it's not there.. + GetFileObjects(); + if (fUpdate) { // Only do this stuff if their are valid keys + GetRootTree(); + GetTreeVars(); + for(UInt_t i=0; iClose(); + fRootFile->Delete(); + delete fRootFile; + fRootFile = 0; +#else + + if(fRootFile->IsZombie() || (fRootFile->GetSize() == -1) + || (fRootFile->ReadKeys()==0)) { + cout << "New run not yet available. Waiting..." << endl; + fRootFile->Close(); + delete fRootFile; + fRootFile = 0; + timer->Reset(); + timer->Disconnect(); + timer->Connect(timer,"Timeout()","OnlineGUI",this,"CheckRootFile()"); + return; + } + for(UInt_t i=0; iRefresh(); + } + DoDraw(); + timer->Reset(); + +#endif + +} + +void OnlineGUI::BadDraw(TString errMessage) { + // Routine to display (in Pad) why a particular draw method has + // failed. + TPaveText *pt = new TPaveText(0.1,0.1,0.9,0.9,"brNDC"); + pt->SetBorderSize(3); + pt->SetFillColor(10); + pt->SetTextAlign(22); + pt->SetTextFont(72); + pt->SetTextColor(2); + pt->AddText(errMessage.Data()); + pt->Draw(); +// cout << errMessage << endl; + +} + + +void OnlineGUI::CheckRootFile() { + // Check the path to the rootfile (should follow symbolic links) + // ... If found: + // Reopen new root file, + // Reconnect the timer to TimerUpdate() + + if(gSystem->AccessPathName(fConfig->GetRootFile())==0) { + cout << "Found the new run" << endl; +#ifndef OLDTIMERUPDATE + if(OpenRootFile()==0) { +#endif + timer->Reset(); + timer->Disconnect(); + timer->Connect(timer,"Timeout()","OnlineGUI",this,"TimerUpdate()"); +#ifndef OLDTIMERUPDATE + } +#endif + } else { + TString rnBuff = "Waiting for run"; + fRunNumber->SetText(rnBuff.Data()); + hframe->Layout(); + } + +} + +Int_t OnlineGUI::OpenRootFile() { + + + fRootFile = new TFile(fConfig->GetRootFile(),"READ"); + if(fRootFile->IsZombie() || (fRootFile->GetSize() == -1) + || (fRootFile->ReadKeys()==0)) { + cout << "New run not yet available. Waiting..." << endl; + fRootFile->Close(); + delete fRootFile; + fRootFile = 0; + timer->Reset(); + timer->Disconnect(); + timer->Connect(timer,"Timeout()","OnlineGUI",this,"CheckRootFile()"); + return -1; + } + + // Update the runnumber + //ObtainRunNumber();//FIXME cg + if(runNumber != 0) { + TString rnBuff = "Run #"; + rnBuff += runNumber; + fRunNumber->SetText(rnBuff.Data()); + hframe->Layout(); + } + + // Open the Root Trees. Give a warning if it's not there.. + GetFileObjects(); + if (fUpdate) { // Only do this stuff if their are valid keys + GetRootTree(); + GetTreeVars(); + for(UInt_t i=0; i command) { + // Called by DoDraw(), this will plot a histogram. + + Bool_t showGolden=kFALSE; + if(doGolden) showGolden=kTRUE; + + if(command.size()==2) + if(command[1]=="noshowgolden") { + showGolden = kFALSE; + } + cout<<"showGolden= "<cd(); + mytemp1d = (TH1D*)gDirectory->Get(command[0]); + if(mytemp1d->GetEntries()==0) { + BadDraw("Empty Histogram"); + } else { + if(showGolden) { + fGoldenFile->cd(); + mytemp1d_golden = (TH1D*)gDirectory->Get(command[0]); + mytemp1d_golden->SetLineColor(30); + mytemp1d_golden->SetFillColor(30); + Int_t fillstyle=3027; + if(fPrintOnly) fillstyle=3010; + mytemp1d_golden->SetFillStyle(fillstyle); + mytemp1d_golden->Draw(); + cout<<"one golden histo drawn"<Draw("sames"); + } else { + mytemp1d->Draw(); + } + } + break; + } + if(fileObjects[i].second.Contains("TH2")) { + if(showGolden) fRootFile->cd(); + mytemp2d = (TH2D*)gDirectory->Get(command[0]); + if(mytemp2d->GetEntries()==0) { + BadDraw("Empty Histogram"); + } else { +// These are commented out for some reason (specific to DVCS?) +// if(showGolden) { +// fGoldenFile->cd(); +// mytemp2d_golden = (TH2D*)gDirectory->Get(command[0]); +// mytemp2d_golden->SetMarkerColor(2); +// mytemp2d_golden->Draw(); + //mytemp2d->Draw("sames"); +// } else { + mytemp2d->Draw(); +// } + } + break; + } + if(fileObjects[i].second.Contains("TH3")) { + if(showGolden) fRootFile->cd(); + mytemp3d = (TH3D*)gDirectory->Get(command[0]); + if(mytemp3d->GetEntries()==0) { + BadDraw("Empty Histogram"); + } else { + mytemp3d->Draw(); + if(showGolden) { + fGoldenFile->cd(); + mytemp3d_golden = (TH3D*)gDirectory->Get(command[0]); + mytemp3d_golden->SetMarkerColor(2); + mytemp3d_golden->Draw(); + mytemp3d->Draw("sames"); + } else { + mytemp3d->Draw(); + } + } + break; + } + } + } + +} + +void OnlineGUI::TreeDraw(vector command) { + // Called by DoDraw(), this will plot a Tree Variable + + TString var = command[0]; + + // Combine the cuts (definecuts and specific cuts) + TCut cut = ""; + TString tempCut; + if(command.size()>1) { + tempCut = command[1]; + vector cutIdents = fConfig->GetCutIdent(); + for(UInt_t i=0; iGetDefinedCut(cutIdents[i]); + tempCut.ReplaceAll(cutIdents[i],cut_found); + } + } + cut = (TCut)tempCut; + } + + // Determine which Tree the variable comes from, then draw it. + UInt_t iTree; + if(command[4].IsNull()) { + iTree = GetTreeIndex(var); + } else { + iTree = GetTreeIndexFromName(command[4]); + } + TString drawopt = command[2]; + Int_t errcode=0; + if(drawopt.IsNull() && var.Contains(":")) drawopt = "box"; + if(drawopt=="scat") drawopt = ""; + if (iTree <= fRootTree.size() ) { + errcode = fRootTree[iTree]->Draw(var,cut,drawopt, + 1000000000,fTreeEntries[iTree]); + TObject *hobj = (TObject*)gROOT->FindObject("htemp"); + if(errcode==-1) { + BadDraw(var+" not found"); + } else if (errcode!=0) { + if(!command[3].IsNull()) { + TH1* thathist = (TH1*)hobj; + thathist->SetTitle(command[3]); + } + } else { + BadDraw("Empty Histogram"); + } + } else { + BadDraw(var+" not found"); + if (fConfig->IsMonitor()){ + // Maybe we missed it... look again. I dont like the code + // below... maybe I can come up with something better + GetFileObjects(); + GetRootTree(); + GetTreeVars(); + } + } +} + +void OnlineGUI::PrintToFile() +{ + // Routine to print the current page to a File. + // A file dialog pop's up to request the file name. + fCanvas = fEcanvas->GetCanvas(); + gStyle->SetPaperSize(20,24); + static TString dir("printouts"); + TGFileInfo fi; + const char *myfiletypes[] = + { "All files","*", + "PostScript files","*.ps", + "Encapsulated PostScript files","*.eps", + "GIF files","*.gif", + "JPG files","*.jpg", + 0, 0 }; + fi.fFileTypes = myfiletypes; + fi.fIniDir = StrDup(dir.Data()); + + new TGFileDialog(gClient->GetRoot(), fMain, kFDSave, &fi); + if(fi.fFilename!=NULL) fCanvas->Print(fi.fFilename); +} + +void OnlineGUI::PrintPages() { + // Routine to go through each defined page, and print the output to + // a postscript file. (good for making sample histograms). + + // Open the RootFile + // unless we're watching a file. + fRootFile = new TFile(fConfig->GetRootFile(),"READ"); + if(!fRootFile->IsOpen()) { + cout << "ERROR: rootfile: " << fConfig->GetRootFile() + << " does not exist" + << endl; + gApplication->Terminate(); + } else { + fFileAlive = kTRUE; + //ObtainRunNumber();//FIXME cg + // Open the Root Trees. Give a warning if it's not there.. + GetFileObjects(); + GetRootTree(); + GetTreeVars(); + for(UInt_t i=0; iGetGoldenFile(); + if(!goldenfilename.IsNull()) { + fGoldenFile = new TFile(goldenfilename,"READ"); + if(!fGoldenFile->IsOpen()) { + cout << "ERROR: goldenrootfile: " << goldenfilename + << " does not exist. Oh well, no comparison plots." + << endl; + doGolden = kFALSE; + fGoldenFile=NULL; + } else { + doGolden = kTRUE; + } + } else { + doGolden=kFALSE; + fGoldenFile=NULL; + } + + // Added this decision to make reasonable aspect ration for web content + // if (confFileName) { + fCanvas = new TCanvas("fCanvas","trythis",1000,800); + // } else { + // I'm not sure exactly how this works. But it does. + // fCanvas = new TCanvas("fCanvas","trythis",850,1100); + // } +// TCanvas *maincanvas = new TCanvas("maincanvas","whatever",850,1100); +// maincanvas->SetCanvas(fCanvas); + TLatex *lt = new TLatex(); + + TString plotsdir = fConfig->GetPlotsDir(); + Bool_t useGIF = kFALSE; + if(!plotsdir.IsNull()) useGIF = kTRUE; + + TString filename = "summaryplots"; + if(runNumber!=0) { + filename += "_"; + filename += runNumber; + } else { + printf(" Warning for pretty plots: runNumber = %i\n",runNumber); + } + + if(useGIF) { + filename.Prepend(plotsdir+"/"); + filename += "_pageXXXX.gif"; + } + else filename += ".ps"; + + TString pagehead = "Summary Plots"; + if(runNumber!=0) { + pagehead += "(Run #"; + pagehead += runNumber; + pagehead += ")"; + } + // pagehead += ": "; + + gStyle->SetPalette(1); + gStyle->SetTitleX(0.15); + gStyle->SetTitleY(0.9); + gStyle->SetPadBorderMode(0); + gStyle->SetHistLineColor(1); + gStyle->SetHistFillColor(1); + if(!useGIF) fCanvas->Print(filename+"["); + TString origFilename = filename; + for(UInt_t i=0; iGetPageCount(); i++) { + current_page=i; + DoDraw(); + TString pagename = pagehead; + pagename += " "; + pagename += i; + pagename += ": "; + pagename += fConfig->GetPageTitle(current_page); + lt->SetTextSize(0.025); + lt->DrawLatex(0.05,0.98,pagename); + if(useGIF) { + filename = origFilename; + filename.ReplaceAll("XXXX",Form("%02d",current_page)); + cout << "Printing page " << current_page + << " to file = " << filename << endl; + } + fCanvas->Print(filename); + } + if(!useGIF) fCanvas->Print(filename+"]"); + + gApplication->Terminate(); +} + +void OnlineGUI::MyCloseWindow() +{ + fMain->SendCloseMessage(); + cout << "OnlineGUI Closed." << endl; + if(timer!=NULL) { + timer->Stop(); + delete timer; + } + delete fPrint; + delete fExit; + delete fRunNumber; + delete fPrev; + delete fNext; + delete wile; + for(UInt_t i=0; iGetPageCount(); i++) + delete fRadioPage[i]; + delete hframe; + delete fEcanvas; + delete fBottomFrame; + delete vframe; + delete fTopframe; + delete fMain; + if(fGoldenFile!=NULL) delete fGoldenFile; + if(fRootFile!=NULL) delete fRootFile; + delete fConfig; + + gApplication->Terminate(); +} + +void OnlineGUI::CloseGUI() +{ + // Routine to take care of the Exit GUI button + fMain->SendCloseMessage(); +} + +OnlineGUI::~OnlineGUI() +{ + // fMain->SendCloseMessage(); + if(timer!=NULL) { + timer->Stop(); + delete timer; + } + delete fPrint; + delete fExit; + delete fRunNumber; + delete fPrev; + delete fNext; + delete wile; + for(UInt_t i=0; iGetPageCount(); i++) + delete fRadioPage[i]; + delete hframe; + delete fEcanvas; + delete vframe; + delete fBottomFrame; + delete fTopframe; + delete fMain; + if(fGoldenFile!=NULL) delete fGoldenFile; + if(fRootFile!=NULL) delete fRootFile; + delete fConfig; +} diff --git a/panguin/src/panguinOnlineConfig.cc b/panguin/src/panguinOnlineConfig.cc new file mode 100644 index 000000000..c861b98ee --- /dev/null +++ b/panguin/src/panguinOnlineConfig.cc @@ -0,0 +1,529 @@ +#include "panguinOnlineConfig.hh" +#include +#include +#include +#include +#include +//#define DEBUG +//#define DEBUG2 +//#define NOISY +//#define OLDTIMERUPDATE + +using namespace std; + +/////////////////////////////////////////////////////////////////// +// Class: OnlineConfig +// +// Utility class that reads in a text file (.cfg) and +// stores it's contents. +// + +OnlineConfig::OnlineConfig() +{ + // Constructor. Without an argument, will use default "standard" config + fMonitor = kFALSE; + OnlineConfig("standard"); +} + +OnlineConfig::OnlineConfig(TString anatype) +{ + // Constructor. Takes the config anatype as the only argument. + // Loads up the configuration file, and stores it's contents for access. + + confFileName = anatype; + confFileName += ".cfg"; + fMonitor = kFALSE; + fFoundCfg = kFALSE; + + // ifstream *fConfFile = new ifstream(confFileName.Data()); + fConfFile = new ifstream(confFileName.Data()); + if ( ! (*fConfFile) ) { + cerr << "OnlineConfig() WARNING: config file " << confFileName.Data() + << " does not exist" << endl; + cerr << " Checking the " << guiDirectory << " directory" << endl; + confFileName.Prepend(guiDirectory+"/"); + fConfFile = new ifstream(confFileName.Data()); + if ( ! (*fConfFile) ) { + confFileName = guiDirectory+"/default.cfg"; + cout << "OnlineConfig() Trying " << confFileName.Data() + << " as default configuration." << endl + << " (May be ok.)" << endl; + fConfFile = new ifstream(confFileName.Data()); + if ( ! (*fConfFile) ) { + cerr << "OnlineConfig() WARNING: no file " + << confFileName.Data() <close(); + delete fConfFile; + +} + +void OnlineConfig::ParseFile() +{ + // Reads in the Config File, and makes the proper calls to put + // the information contained into memory. + + if(!fFoundCfg) { + return; + } + + TString comment = "#"; + vector strvect; + TString sinput, sline; + while (sline.ReadLine(*fConfFile)) { + if(sline.Contains(comment)) continue; + strvect = SplitString(sline," "); + sConfFile.push_back(strvect); + } + +#ifdef DEBUG + cout << "OnlineConfig::ParseFile()\n"; + for(UInt_t ii=0; ii3) { + cerr << "cut command has too many arguments" << endl; + continue; + } + TCut tempCut(sConfFile[i][1],sConfFile[i][2]); + // cutList.push_back(make_pair(sConfFile[i][1],sConfFile[i][2])); + cutList.push_back(tempCut); + } + if(sConfFile[i][0] == "rootfile") { + if(sConfFile[i].size() != 2) { + cerr << "WARNING: rootfile command does not have the " + << "correct number of arguments" + << endl; + continue; + } + if(!rootfilename.IsNull()) { + cerr << "WARNING: too many rootfile's defined. " + << " Will only use the first one." + << endl; + continue; + } + rootfilename = sConfFile[i][1]; + } + if(sConfFile[i][0] == "goldenrootfile") { + if(sConfFile[i].size() != 2) { + cerr << "WARNING: goldenfile command does not have the " + << "correct number of arguments" + << endl; + continue; + } + if(!goldenrootfilename.IsNull()) { + cerr << "WARNING: too many goldenrootfile's defined. " + << " Will only use the first one." + << endl; + continue; + } + goldenrootfilename = sConfFile[i][1]; + } + if(sConfFile[i][0] == "protorootfile") { + if(sConfFile[i].size() != 2) { + cerr << "WARNING: protorootfile command does not have the " + << "correct number of arguments" + << endl; + continue; + } + if(!protorootfile.IsNull()) { + cerr << "WARNING: too many protorootfile's defined. " + << " Will only use the first one." + << endl; + continue; + } + protorootfile = sConfFile[i][1]; + } + if(sConfFile[i][0] == "guicolor") { + if(sConfFile[i].size() != 2) { + cerr << "WARNING: guicolor command does not have the " + << "correct number of arguments (needs 1)" + << endl; + continue; + } + if(!guicolor.IsNull()) { + cerr << "WARNING: too many guicolor's defined. " + << " Will only use the first one." + << endl; + continue; + } + guicolor = sConfFile[i][1]; + } + if(sConfFile[i][0] == "plotsdir") { + if(sConfFile[i].size() != 2) { + cerr << "WARNING: plotsdir command does not have the " + << "correct number of arguments (needs 1)" + << endl; + continue; + } + if(!plotsdir.IsNull()) { + cerr << "WARNING: too many plotdir's defined. " + << " Will only use the first one." + << endl; + continue; + } + plotsdir = sConfFile[i][1]; + } + + } + +#ifdef NOISY + cout << "OnlineConfig::ParseConfig()\n"; + for(UInt_t i=0; i OnlineConfig::GetCutIdent() { + // Returns a vector of the cut identifiers, specified in config + vector out; + + for(UInt_t i=0; i OnlineConfig::GetPageDim(UInt_t page) +{ + // If defined in the config, will return those dimensions + // for the indicated page. Otherwise, will return the + // calculated dimensions required to fit all histograms. + + pair outDim; + + // This is the page index in sConfFile. + UInt_t page_index = pageInfo[page].first; + + UInt_t size1 = 2; + if (IsLogy(page)) size1 = 3; // last word is "logy" + + // If the dimensions are defined, return them. + if(sConfFile[page_index].size()>size1-1) { + if(sConfFile[page_index].size() == size1) { + outDim = make_pair(UInt_t(atoi(sConfFile[page_index][1])), + UInt_t(atoi(sConfFile[page_index][1]))); + return outDim; + } else if (sConfFile[page_index].size() == size1+1) { + outDim = make_pair(UInt_t(atoi(sConfFile[page_index][1])), + UInt_t(atoi(sConfFile[page_index][2]))); + return outDim; + } else { + cout << "Warning: newpage command has too many arguments. " + << "Will automatically determine dimensions of page." + << endl; + } + } + + // If not defined, return the "default." + UInt_t draw_count = GetDrawCount(page); + UInt_t dim = UInt_t(TMath::Nint(sqrt(double(draw_count+1)))); + outDim = make_pair(dim,dim); + + return outDim; +} + +TString OnlineConfig::GetPageTitle(UInt_t page) +{ + // Returns the title of the page. + // if it is not defined in the config, then return "Page #" + + TString title; + + UInt_t iter_command = pageInfo[page].first+1; + + for(UInt_t i=0; i OnlineConfig::GetDrawIndex(UInt_t page) +{ + // Returns an index of where to find the draw commands within a page + // within the sConfFile vector + + vector index; + UInt_t iter_command = pageInfo[page].first+1; + + for(UInt_t i=0; i OnlineConfig::GetDrawCommand(UInt_t page, UInt_t nCommand) +{ + // Returns the vector of strings pertaining to a specific page, and + // draw command from the config. + // Return vector of TStrings: + // 0: variable + // 1: cut + // 2: type + // 3: title + // 4: treename + + vector out_command(5); + vector command_vector = GetDrawIndex(page); + UInt_t index = command_vector[nCommand]; + +#ifdef DEBUG + cout << "OnlineConfig::GetDrawCommand(" << page << "," + << nCommand << ")" << endl; +#endif + for(UInt_t i=0; i=1) { + out_command[0] = sConfFile[index][0]; + } + if(sConfFile[index].size()>=2) { + if((sConfFile[index][1] != "-type") && + (sConfFile[index][1] != "-title") && + (sConfFile[index][1] != "-tree")) + out_command[1] = sConfFile[index][1]; + } + + // Now go through the rest of that line.. + for (UInt_t i=1; i OnlineConfig::SplitString(TString instring,TString delim) +{ + // Utility to split up a string on the deliminator. + // returns a vector of strings. + + vector v; + + TString remainingString = instring; + TString tempstring = instring; + int i; + + while (remainingString.Index(delim) != -1) { + i = remainingString.Index(delim); + tempstring.Remove(i); + v.push_back(tempstring); + remainingString.Remove(0,i+1); + while(remainingString.Index(delim) == 0) { + remainingString.Remove(0,1); + } + tempstring = remainingString; + } + + while(tempstring.EndsWith(delim)) { + tempstring.Chop(); + } + + if(!tempstring.IsNull()) v.push_back(tempstring); + + return v; +} + +void OnlineConfig::OverrideRootFile(UInt_t runnumber) +{ + // Override the ROOT file defined in the cfg file If + // protorootfile is used, construct filename using it, otherwise + // uses a helper macro "GetRootFileName.C(UInt_t runnumber) + + if(!protorootfile.IsNull()) { + // Made more robust for slug number changing length Dalton 2009-09-21 + // TString rn = ""; + // rn += runnumber; + // protorootfile.ReplaceAll("XXXXX",rn.Data()); + char runnostr[10]; + sprintf(runnostr,"%04i",runnumber); + protorootfile.ReplaceAll("XXXXX",runnostr); + rootfilename = protorootfile; + } else { + rootfilename = "";//GetRootFileName(runnumber);//FIXME cg + } + + cout << "Overridden File name: " << rootfilename << endl; +} + From 54902ef37331218e166c33495ed424e62b4a6f13 Mon Sep 17 00:00:00 2001 From: Ciprian Gal Date: Fri, 11 Jan 2019 11:49:19 -0500 Subject: [PATCH 041/137] compiles and analyzes a static file --- panguin/CMakeLists.txt | 4 +++- panguin/include/panguinOnline.hh | 1 + panguin/include/panguinOnlineConfig.hh | 4 +--- panguin/src/panguinOnlineConfig.cc | 33 ++++++++++++++++++-------- 4 files changed, 28 insertions(+), 14 deletions(-) diff --git a/panguin/CMakeLists.txt b/panguin/CMakeLists.txt index 33b0f55bc..db009609b 100755 --- a/panguin/CMakeLists.txt +++ b/panguin/CMakeLists.txt @@ -36,7 +36,7 @@ endif() include_directories(${CMAKE_CURRENT_BINARY_DIR}/include) # Load ROOT and setup include directory -find_package(ROOT REQUIRED) +find_package(ROOT 6 REQUIRED) include_directories(${ROOT_INCLUDE_DIR}) set(ROOT_LIBRARIES ${ROOT_LIBRARIES} -lNew -lGui -lMinuit2) @@ -44,6 +44,8 @@ add_definitions(-std=c++11) ROOT_GENERATE_DICTIONARY( panguinDict # path to dictionary to generate + include/panguinOnlineConfig.hh + include/panguinOnline.hh LINKDEF "include/panguinOnlineLinkDef.h" # ROOT linkDef file OPTIONS -p ) diff --git a/panguin/include/panguinOnline.hh b/panguin/include/panguinOnline.hh index 899b972a9..76d3bf162 100644 --- a/panguin/include/panguinOnline.hh +++ b/panguin/include/panguinOnline.hh @@ -91,5 +91,6 @@ public: void PrintPages(); void MyCloseWindow(); void CloseGUI(); + ClassDef(OnlineGUI,0); }; #endif //panguinOnline_h diff --git a/panguin/include/panguinOnlineConfig.hh b/panguin/include/panguinOnlineConfig.hh index 1240e6320..13532a834 100644 --- a/panguin/include/panguinOnlineConfig.hh +++ b/panguin/include/panguinOnlineConfig.hh @@ -7,10 +7,9 @@ #include #include "TCut.h" -static TString guiDirectory = "panguin"; +static TString guiDirectory = "macros"; class OnlineConfig { - //RQ_OBJECT("OnlineConfig");//FIXME cg // Class that takes care of the config file private: TString confFileName; // config filename @@ -30,7 +29,6 @@ private: Bool_t fFoundCfg; Bool_t fMonitor; - public: OnlineConfig(); OnlineConfig(TString); diff --git a/panguin/src/panguinOnlineConfig.cc b/panguin/src/panguinOnlineConfig.cc index c861b98ee..567a2a916 100644 --- a/panguin/src/panguinOnlineConfig.cc +++ b/panguin/src/panguinOnlineConfig.cc @@ -4,6 +4,7 @@ #include #include #include +#include //#define DEBUG //#define DEBUG2 //#define NOISY @@ -37,8 +38,7 @@ OnlineConfig::OnlineConfig(TString anatype) // ifstream *fConfFile = new ifstream(confFileName.Data()); fConfFile = new ifstream(confFileName.Data()); - if ( ! (*fConfFile) ) { - cerr << "OnlineConfig() WARNING: config file " << confFileName.Data() + if ( ! (*fConfFile) ) { cerr << "OnlineConfig() WARNING: config file " << confFileName.Data() << " does not exist" << endl; cerr << " Checking the " << guiDirectory << " directory" << endl; confFileName.Prepend(guiDirectory+"/"); @@ -510,20 +510,33 @@ void OnlineConfig::OverrideRootFile(UInt_t runnumber) // Override the ROOT file defined in the cfg file If // protorootfile is used, construct filename using it, otherwise // uses a helper macro "GetRootFileName.C(UInt_t runnumber) - + cout<< "Root file defined before was: "< Date: Fri, 11 Jan 2019 11:49:37 -0500 Subject: [PATCH 042/137] pictures and default macro --- panguin/macros/default.cfg | 37 + panguin/macros/genius.xpm | 1362 +++++++++++++++++++ panguin/macros/panguin.xpm | 2646 ++++++++++++++++++++++++++++++++++++ 3 files changed, 4045 insertions(+) create mode 100644 panguin/macros/default.cfg create mode 100644 panguin/macros/genius.xpm create mode 100644 panguin/macros/panguin.xpm diff --git a/panguin/macros/default.cfg b/panguin/macros/default.cfg new file mode 100644 index 000000000..254e46940 --- /dev/null +++ b/panguin/macros/default.cfg @@ -0,0 +1,37 @@ +# Configuration file for the online GUI +# This file is for ADCs +# All lines containing "#" are treated as comments (ignored) +# Last line MUST be blank. +# Multiple spaces are treated as one space. +# To switch to log scale, add the option logy after the name of +# the histogram + +# Default root file to look at +#rootfile pan.root +rootfile /adaqfs/home/apar/ciprian/pan/ROOTfiles/parity18_4416_standard.root +##rootfile /adaq1/work1/apar/ciprian/parity18_4416_standard.root +##rootfile /dev/shm//QwMemMapFile.map + +# Prototype rootfilename.. overrides GetRootFileName.C + ##protorootfile /adaql1/work1/parity/parity04_XXXXX_standard.root +#protorootfile /adaql1/work1/apar/ciprian/parity18_4416_standard.root + +# Defined cuts +definecut evcut (ev_num>1000) +definecut mevcut (m_ev_num>1000) + +# Uncomment the below line to monitor the fill of a ROOTfile. +#watchfile + +newpage 1 4 + title BCMs vs Event Number + bcm1:ev_num evcut -type scat -title "BCM1 vs Eventnumber" + bcm2:ev_num -title "BCM2 vs Event Number" -type box + bcm5:ev_num evcut -type prof -title "Prof example" + (1-bcm1/bcm2):(ev_num*3600) abs(bcm1<5e4) -title "What is this?" -tree R + +newpage 1 2 + title BCM asymmetries + asym_bcm1 ok_cut + asym_bcm2 ok_cut + diff --git a/panguin/macros/genius.xpm b/panguin/macros/genius.xpm new file mode 100644 index 000000000..45aacb865 --- /dev/null +++ b/panguin/macros/genius.xpm @@ -0,0 +1,1362 @@ +/* XPM */ +static char * genius_xpm[] = { +"72 117 1242 2", +" c None", +". c #8C7863", +"+ c #93806A", +"@ c #C2A488", +"# c #E4BFA0", +"$ c #53463B", +"% c #F0C9A8", +"& c #CEAD91", +"* c #42372A", +"= c #F5CEAD", +"- c #C3A589", +"; c #462F14", +"> c #866E56", +", c #D3B295", +"' c #C0A288", +") c #D9B698", +"! c #4F3719", +"~ c #C8A687", +"{ c #F3CCAC", +"] c #EBC6A6", +"^ c #826E5C", +"/ c #E7C1A2", +"( c #BB9D82", +"_ c #4C3820", +": c #705839", +"< c #DCB797", +"[ c #EEC7A7", +"} c #CAAC8F", +"| c #A98E77", +"1 c #ECC6A5", +"2 c #C2A587", +"3 c #624829", +"4 c #A68666", +"5 c #EFC7A7", +"6 c #E1BF9F", +"7 c #958169", +"8 c #695845", +"9 c #D2B294", +"0 c #F0C8A8", +"a c #E6C0A0", +"b c #49361C", +"c c #88673F", +"d c #C8A586", +"e c #F3CCAB", +"f c #E1BE9F", +"g c #9C876F", +"h c #493725", +"i c #957B63", +"j c #EBC5A5", +"k c #CEAF93", +"l c #95806C", +"m c #4D4028", +"n c #7E5C2E", +"o c #977957", +"p c #DFBB9D", +"q c #F7CEAD", +"r c #EDC6A6", +"s c #B0977C", +"t c #4B351D", +"u c #775A3D", +"v c #CDAB8F", +"w c #F5CDAC", +"x c #C2A388", +"y c #6B4D25", +"z c #896737", +"A c #AF9376", +"B c #F1CBAB", +"C c #C6A789", +"D c #4F3F29", +"E c #6C4F29", +"F c #9A7B5D", +"G c #EBC5A6", +"H c #F3CBAA", +"I c #87715C", +"J c #674C27", +"K c #8A642F", +"L c #8D714E", +"M c #E8C5A3", +"N c #F6CEAD", +"O c #EAC4A4", +"P c #B79D80", +"Q c #694D24", +"R c #886842", +"S c #DCB99B", +"T c #DCB799", +"U c #7A582B", +"V c #88612B", +"W c #AD9179", +"X c #F4CEAD", +"Y c #DBB89A", +"Z c #664922", +"` c #7E5E32", +" . c #A3876E", +".. c #87715E", +"+. c #110E09", +"@. c #543C1B", +"#. c #89622D", +"$. c #6A5028", +"%. c #EEC7A8", +"&. c #CBAA8F", +"*. c #5F441E", +"=. c #7C592A", +"-. c #896B4B", +";. c #EAC4A5", +">. c #F4CDAC", +",. c #CAAA8E", +"'. c #927F69", +"). c #1C150C", +"!. c #795728", +"~. c #90672E", +"{. c #9B7D59", +"]. c #F4CBAB", +"^. c #F3CEAD", +"/. c #EDC8A7", +"(. c #B99B80", +"_. c #614D2E", +":. c #7F5B29", +"<. c #89673B", +"[. c #C19F81", +"}. c #C2A689", +"|. c #382512", +"1. c #412E16", +"2. c #90682F", +"3. c #7C592B", +"4. c #B59575", +"5. c #F2CEAD", +"6. c #DDBA9B", +"7. c #5A503D", +"8. c #79582A", +"9. c #8A6435", +"0. c #AB8A6C", +"a. c #F0CCAB", +"b. c #D9B89B", +"c. c #201912", +"d. c #7B582A", +"e. c #946B31", +"f. c #856338", +"g. c #C19F82", +"h. c #DAB899", +"i. c #8B7A5F", +"j. c #2C261D", +"k. c #392D1D", +"l. c #6B4B24", +"m. c #8C6633", +"n. c #917455", +"o. c #D7B497", +"p. c #F4CCAC", +"q. c #D1B094", +"r. c #917966", +"s. c #735129", +"t. c #936931", +"u. c #A37B4E", +"v. c #DEB897", +"w. c #88715D", +"x. c #45311A", +"y. c #694A23", +"z. c #8B622E", +"A. c #936F49", +"B. c #D2B092", +"C. c #DDB99B", +"D. c #6A5B4C", +"E. c #382815", +"F. c #8F6630", +"G. c #AD8458", +"H. c #E8C1A1", +"I. c #DBB89B", +"J. c #5C4A37", +"K. c #6E4F25", +"L. c #8E672F", +"M. c #7F5D31", +"N. c #B7977B", +"O. c #F2CAAA", +"P. c #EAC3A4", +"Q. c #A78B72", +"R. c #7C5729", +"S. c #A88255", +"T. c #E9C3A1", +"U. c #F0CCA9", +"V. c #8D7A63", +"W. c #7F5B2A", +"X. c #886433", +"Y. c #A28468", +"Z. c #EFCAA9", +"`. c #E1BB9D", +" + c #9E836D", +".+ c #614724", +"++ c #A98153", +"@+ c #E7C09F", +"#+ c #DBB899", +"$+ c #7D7059", +"%+ c #634A28", +"&+ c #8C652F", +"*+ c #8E704B", +"=+ c #E0BC9C", +"-+ c #B99F83", +";+ c #D7B495", +">+ c #5F492A", +",+ c #866643", +"'+ c #D5B192", +")+ c #E4C1A1", +"!+ c #594120", +"~+ c #856333", +"{+ c #B39675", +"]+ c #F2CBAA", +"^+ c #C5A489", +"/+ c #8F7964", +"(+ c #614A2D", +"_+ c #B9997D", +":+ c #D7B596", +"<+ c #705025", +"[+ c #92714B", +"}+ c #DDBB9B", +"|+ c #E6C0A1", +"1+ c #B6967F", +"2+ c #422F16", +"3+ c #AC8E71", +"4+ c #D2AE92", +"5+ c #5A4930", +"6+ c #765832", +"7+ c #8D765B", +"8+ c #D1B092", +"9+ c #937B66", +"0+ c #5E4524", +"a+ c #A78966", +"b+ c #E9C3A4", +"c+ c #BC9E83", +"d+ c #3E3327", +"e+ c #A0876D", +"f+ c #A88F76", +"g+ c #A0886F", +"h+ c #5C4022", +"i+ c #5F492E", +"j+ c #EAC3A3", +"k+ c #D6B495", +"l+ c #AB8F79", +"m+ c #C9A98E", +"n+ c #1A1108", +"o+ c #453017", +"p+ c #C4A389", +"q+ c #826D5B", +"r+ c #C3A48A", +"s+ c #E9C4A4", +"t+ c #94806B", +"u+ c #9A836D", +"v+ c #D8B597", +"w+ c #C3A489", +"x+ c #302922", +"y+ c #6B502B", +"z+ c #83623E", +"A+ c #6D5336", +"B+ c #BB9A7F", +"C+ c #ECC5A4", +"D+ c #B3957B", +"E+ c #AF947C", +"F+ c #967E68", +"G+ c #D6B396", +"H+ c #F6CDAC", +"I+ c #BFA085", +"J+ c #615442", +"K+ c #484131", +"L+ c #765831", +"M+ c #8F672F", +"N+ c #8E693F", +"O+ c #C4A082", +"P+ c #A18870", +"Q+ c #B9997C", +"R+ c #DFBB9C", +"S+ c #DDB89B", +"T+ c #DFB89A", +"U+ c #DEBA9C", +"V+ c #BAA084", +"W+ c #1A1E1F", +"X+ c #110D08", +"Y+ c #604521", +"Z+ c #946A31", +"`+ c #A77B4A", +" @ c #AE8669", +".@ c #75604F", +"+@ c #F6CFAE", +"@@ c #D1B193", +"#@ c #BEA086", +"$@ c #7E5D4B", +"%@ c #8B725E", +"&@ c #99856C", +"*@ c #434343", +"=@ c #565656", +"-@ c #271C0C", +";@ c #694C22", +">@ c #8C6738", +",@ c #7B4731", +"'@ c #BD957C", +")@ c #C6A88B", +"!@ c #776653", +"~@ c #7E6957", +"{@ c #987A64", +"]@ c #4D2F24", +"^@ c #67493A", +"/@ c #A98C74", +"(@ c #D0B193", +"_@ c #98816C", +":@ c #BDA087", +"<@ c #7D6759", +"[@ c #372E26", +"}@ c #130F0B", +"|@ c #979694", +"1@ c #484848", +"2@ c #4D351A", +"3@ c #785628", +"4@ c #785729", +"5@ c #672D18", +"6@ c #D9AB8E", +"7@ c #F1C9A8", +"8@ c #89725D", +"9@ c #736252", +"0@ c #E7C3A3", +"a@ c #A2826B", +"b@ c #693325", +"c@ c #5F3224", +"d@ c #A78B74", +"e@ c #F0CAA9", +"f@ c #F1CBAA", +"g@ c #B89D7F", +"h@ c #493E2B", +"i@ c #1B1914", +"j@ c #030202", +"k@ c #161616", +"l@ c #060605", +"m@ c #684F2A", +"n@ c #85612D", +"o@ c #8A632E", +"p@ c #813D20", +"q@ c #B88D71", +"r@ c #D8B496", +"s@ c #D1AF92", +"t@ c #D3B490", +"u@ c #99856A", +"v@ c #9B846D", +"w@ c #967E65", +"x@ c #7D634F", +"y@ c #743F2D", +"z@ c #A1816A", +"A@ c #D3B396", +"B@ c #D5B497", +"C@ c #E1BFA0", +"D@ c #DCB899", +"E@ c #E2BE9F", +"F@ c #C3A58A", +"G@ c #B3977E", +"H@ c #B1977D", +"I@ c #5B4C3D", +"J@ c #060504", +"K@ c #000000", +"L@ c #050403", +"M@ c #010101", +"N@ c #4E4236", +"O@ c #51412B", +"P@ c #80623B", +"Q@ c #967446", +"R@ c #927144", +"S@ c #7A4A30", +"T@ c #573E2C", +"U@ c #947F61", +"V@ c #A08A65", +"W@ c #CAB27E", +"X@ c #B0986E", +"Y@ c #78654B", +"Z@ c #8C765B", +"`@ c #766653", +" # c #B1977E", +".# c #8E7963", +"+# c #A38870", +"@# c #CCAC90", +"## c #B09479", +"$# c #B2967D", +"%# c #8A7662", +"&# c #C5A48A", +"*# c #DAB89A", +"=# c #463B31", +"-# c #14110E", +";# c #322922", +"># c #2C251F", +",# c #836D5B", +"'# c #B99F82", +")# c #B89C81", +"!# c #C7A88A", +"~# c #D6B291", +"{# c #D3B08F", +"]# c #C2A084", +"^# c #AC8F75", +"/# c #BFA480", +"(# c #A3906A", +"_# c #BEA67E", +":# c #D2AF8C", +"<# c #D7B496", +"[# c #C5A68A", +"}# c #BA9D82", +"|# c #887460", +"1# c #B5977D", +"2# c #A98D75", +"3# c #B4967C", +"4# c #E2BD9F", +"5# c #DDBD9E", +"6# c #CEAE92", +"7# c #D4B295", +"8# c #ECC8A8", +"9# c #BDA086", +"0# c #AD927A", +"a# c #947E6A", +"b# c #8D7662", +"c# c #D1AE91", +"d# c #F3CDAC", +"e# c #CCAC8E", +"f# c #C1A388", +"g# c #B29880", +"h# c #C2A58A", +"i# c #E8C3A3", +"j# c #F4CDAD", +"k# c #E4BF9F", +"l# c #DCB89A", +"m# c #F3CBAB", +"n# c #F2CBAB", +"o# c #F2CCAB", +"p# c #DFBC9C", +"q# c #A68F77", +"r# c #A28870", +"s# c #D3B296", +"t# c #A18771", +"u# c #CAAB8E", +"v# c #DEBEA1", +"w# c #CFB299", +"x# c #E3BDA2", +"y# c #F1CAAA", +"z# c #E0BB9E", +"A# c #CCAD91", +"B# c #E4C0A0", +"C# c #F5CEAC", +"D# c #EBC7A6", +"E# c #E3BE9F", +"F# c #A58C72", +"G# c #C0A589", +"H# c #E6C3A3", +"I# c #9C846F", +"J# c #DAB598", +"K# c #F2CCAC", +"L# c #CEAE93", +"M# c #CFAE97", +"N# c #E2C0A5", +"O# c #E8C4A7", +"P# c #EAC6A7", +"Q# c #CFAE93", +"R# c #9B846F", +"S# c #9D856F", +"T# c #99826C", +"U# c #957B66", +"V# c #EDCAA9", +"W# c #EDC9A8", +"X# c #EEC9A8", +"Y# c #D0AD91", +"Z# c #D2AF91", +"`# c #E6C2A3", +" $ c #E5C0A1", +".$ c #CCAB8F", +"+$ c #AA8F78", +"@$ c #EEC8AA", +"#$ c #EECAAB", +"$$ c #F2CFAC", +"%$ c #F0CBAB", +"&$ c #A58D76", +"*$ c #726350", +"=$ c #6A5947", +"-$ c #846E5B", +";$ c #645547", +">$ c #A18872", +",$ c #EAC5A6", +"'$ c #D0AE91", +")$ c #BC9E84", +"!$ c #E5C1A2", +"~$ c #ECC6A6", +"{$ c #ECC5A5", +"]$ c #F3CFAD", +"^$ c #E7C3A2", +"/$ c #D5B194", +"($ c #211D16", +"_$ c #20160C", +":$ c #645847", +"<$ c #B0967C", +"[$ c #F3CAAA", +"}$ c #F6CDAD", +"|$ c #ECC7A7", +"1$ c #D0AF92", +"2$ c #B4967D", +"3$ c #9D8261", +"4$ c #8F7658", +"5$ c #CAA88B", +"6$ c #E9C0A0", +"7$ c #48371F", +"8$ c #4D3719", +"9$ c #2A1E0F", +"0$ c #40301C", +"a$ c #6F4D25", +"b$ c #6D4E25", +"c$ c #C9A98D", +"d$ c #D6B497", +"e$ c #BEA186", +"f$ c #674D30", +"g$ c #6B4E26", +"h$ c #866A4A", +"i$ c #D5B494", +"j$ c #EDC3A2", +"k$ c #705227", +"l$ c #8D662F", +"m$ c #8C652E", +"n$ c #5B4220", +"o$ c #5B401F", +"p$ c #7D5B2A", +"q$ c #BC9D84", +"r$ c #CCAA8E", +"s$ c #583D1A", +"t$ c #674A23", +"u$ c #826849", +"v$ c #DFBA9C", +"w$ c #F2C9A8", +"x$ c #5C492C", +"y$ c #87622E", +"z$ c #7C5A29", +"A$ c #4E371A", +"B$ c #725226", +"C$ c #8A642E", +"D$ c #DBB89C", +"E$ c #F5CDAD", +"F$ c #CAAA8D", +"G$ c #6E5D4B", +"H$ c #4C3518", +"I$ c #6D4E22", +"J$ c #9E8264", +"K$ c #E9C6A6", +"L$ c #F1CAA9", +"M$ c #7E5A2B", +"N$ c #936933", +"O$ c #966735", +"P$ c #825E2C", +"Q$ c #624721", +"R$ c #745428", +"S$ c #78582C", +"T$ c #85602D", +"U$ c #4C371C", +"V$ c #B5997F", +"W$ c #C9AA8D", +"X$ c #D9B899", +"Y$ c #B99A81", +"Z$ c #725E4C", +"`$ c #473317", +" % c #755C3B", +".% c #D5B395", +"+% c #835F2E", +"@% c #8F6730", +"#% c #8C612E", +"$% c #8B6230", +"%% c #795529", +"&% c #926A31", +"*% c #664823", +"=% c #6E5B43", +"-% c #4E4030", +";% c #655948", +">% c #604728", +",% c #A8896C", +"'% c #EEC8A7", +")% c #A58B73", +"!% c #5D462B", +"~% c #5E4725", +"{% c #3C2C14", +"]% c #241A0B", +"^% c #674B26", +"/% c #7D592A", +"(% c #775526", +"_% c #946833", +":% c #906631", +"<% c #573F22", +"[% c #4C3F33", +"}% c #44311C", +"|% c #765326", +"1% c #654924", +"2% c #5F4522", +"3% c #937550", +"4% c #E4C1A0", +"5% c #E3C0A0", +"6% c #A08367", +"7% c #86673E", +"8% c #785728", +"9% c #6C4E23", +"0% c #503B1C", +"a% c #47331E", +"b% c #523A1E", +"c% c #89622C", +"d% c #8C662F", +"e% c #59411F", +"f% c #39352A", +"g% c #543F22", +"h% c #694D26", +"i% c #604622", +"j% c #523A1D", +"k% c #835A2F", +"l% c #916930", +"m% c #896638", +"n% c #BF9E7E", +"o% c #F4CCAB", +"p% c #EDC8A8", +"q% c #C5A686", +"r% c #816643", +"s% c #886230", +"t% c #402D15", +"u% c #0D0905", +"v% c #1D150A", +"w% c #6C4E25", +"x% c #926930", +"y% c #6E5128", +"z% c #413523", +"A% c #2D2419", +"B% c #7B582D", +"C% c #89632E", +"D% c #906930", +"E% c #624620", +"F% c #473318", +"G% c #916A32", +"H% c #967850", +"I% c #DDB898", +"J% c #D0AE92", +"K% c #9A7858", +"L% c #7F5C2D", +"M% c #583F1F", +"N% c #6C4D24", +"O% c #8E662F", +"P% c #785629", +"Q% c #865F2D", +"R% c #89632F", +"S% c #916830", +"T% c #785428", +"U% c #37291A", +"V% c #4B371B", +"W% c #936A31", +"X% c #876435", +"Y% c #B99878", +"Z% c #D8B799", +"`% c #9C7855", +" & c #5E4326", +".& c #5A4020", +"+& c #8E6730", +"@& c #725228", +"#& c #705027", +"$& c #856034", +"%& c #7A5A30", +"&& c #6B4F2E", +"*& c #3B3325", +"=& c #402E14", +"-& c #886B49", +";& c #E4C2A3", +">& c #D9B394", +",& c #81664F", +"'& c #433220", +")& c #6B4C25", +"!& c #936A30", +"~& c #77572C", +"{& c #5C482D", +"]& c #765426", +"^& c #805D2D", +"/& c #CBAB8B", +"(& c #D8B699", +"_& c #796754", +":& c #49371E", +"<& c #7E5D2E", +"[& c #94683A", +"}& c #64513D", +"|& c #2A251E", +"1& c #7C5B2D", +"2& c #866C50", +"3& c #937B61", +"4& c #5F492D", +"5& c #855F2D", +"6& c #8F6432", +"7& c #7F6446", +"8& c #342716", +"9& c #7F5C2B", +"0& c #795829", +"a& c #865D30", +"b& c #926731", +"c& c #8A6841", +"d& c #E5C0A0", +"e& c #E6C1A0", +"f& c #CEAF90", +"g& c #EFCAAA", +"h& c #9D8163", +"i& c #4D3924", +"j& c #6D4F26", +"k& c #89612E", +"l& c #6B5031", +"m& c #8D6630", +"n& c #8D642E", +"o& c #916732", +"p& c #8D6838", +"q& c #AC9077", +"r& c #EECAA8", +"s& c #937E68", +"t& c #A1876E", +"u& c #77572F", +"v& c #402E13", +"w& c #795D32", +"x& c #8B632C", +"y& c #7D6447", +"z& c #574022", +"A& c #8A632D", +"B& c #63461F", +"C& c #765527", +"D& c #8E6834", +"E& c #AC8C6C", +"F& c #EDC9A9", +"G& c #937F68", +"H& c #CCAD92", +"I& c #87643B", +"J& c #5F441F", +"K& c #312514", +"L& c #634925", +"M& c #8A622D", +"N& c #6A5339", +"O& c #7A592C", +"P& c #926931", +"Q& c #664822", +"R& c #674920", +"S& c #956D35", +"T& c #B7936A", +"U& c #EEC9A7", +"V& c #9D886E", +"W& c #A68B73", +"X& c #5C4527", +"Y& c #8D652F", +"Z& c #664B2A", +"`& c #4C3922", +" * c #845F2C", +".* c #42311B", +"+* c #684B23", +"@* c #88612D", +"#* c #41301B", +"$* c #745529", +"%* c #946B33", +"&* c #A28058", +"** c #DDBA9C", +"=* c #ECC9A9", +"-* c #98836B", +";* c #A18970", +">* c #7E5D31", +",* c #49351A", +"'* c #815D2B", +")* c #7E5B2A", +"!* c #634722", +"~* c #533B20", +"{* c #87602E", +"]* c #88602F", +"^* c #836546", +"/* c #CEAD92", +"(* c #F1CCAA", +"_* c #AE957C", +":* c #9E876E", +"<* c #8B6635", +"[* c #8F6830", +"}* c #543D1D", +"|* c #805D2B", +"1* c #7A5829", +"2* c #705226", +"3* c #8A622E", +"4* c #392917", +"5* c #815A2A", +"6* c #6C502B", +"7* c #745F4B", +"8* c #F0CBA7", +"9* c #8F7763", +"0* c #604528", +"a* c #906830", +"b* c #604620", +"c* c #805D2C", +"d* c #2D2317", +"e* c #926A30", +"f* c #65472A", +"g* c #201A12", +"h* c #422F1A", +"i* c #87612D", +"j* c #695135", +"k* c #A58C75", +"l* c #CDAB90", +"m* c #E4BE9D", +"n* c #CBAC90", +"o* c #645546", +"p* c #654E2D", +"q* c #785528", +"r* c #8C642E", +"s* c #28231A", +"t* c #4A361A", +"u* c #7F5C2A", +"v* c #664D2C", +"w* c #28241D", +"x* c #362A1A", +"y* c #6E5942", +"z* c #C6A78C", +"A* c #F5CCAB", +"B* c #C9AB8F", +"C* c #855E2B", +"D* c #6F5025", +"E* c #3B2A16", +"F* c #352712", +"G* c #755527", +"H* c #7C5A2D", +"I* c #946931", +"J* c #AE8E70", +"K* c #EAC6A6", +"L* c #F0C9A9", +"M* c #E6C2A2", +"N* c #725329", +"O* c #795629", +"P* c #655645", +"Q* c #463218", +"R* c #775628", +"S* c #7B592B", +"T* c #745328", +"U* c #765830", +"V* c #DAB896", +"W* c #B39980", +"X* c #615242", +"Y* c #55402A", +"Z* c #835E2E", +"`* c #6D4E24", +" = c #0C0A08", +".= c #322414", +"+= c #7B5829", +"@= c #85602C", +"#= c #634824", +"$= c #684822", +"%= c #775B36", +"&= c #E1BC9D", +"*= c #6E5D4C", +"== c #4F3A1D", +"-= c #694924", +";= c #6C4F26", +">= c #533F22", +",= c #5C523C", +"'= c #6A4A23", +")= c #674822", +"!= c #86612D", +"~= c #A1835E", +"{= c #A68972", +"]= c #1C150D", +"^= c #634A27", +"/= c #312415", +"(= c #5C411F", +"_= c #6E5025", +":= c #745227", +"<= c #8A6738", +"[= c #B5977A", +"}= c #F6CFAD", +"|= c #CFB092", +"1= c #3A3225", +"2= c #504131", +"3= c #543F1E", +"4= c #86612C", +"5= c #59411E", +"6= c #23190B", +"7= c #5D4A35", +"8= c #876331", +"9= c #8E6F4A", +"0= c #DBBB9C", +"a= c #4F3B1E", +"b= c #76552A", +"c= c #7E5C2B", +"d= c #845F2B", +"e= c #6A4A22", +"f= c #402D14", +"g= c #705125", +"h= c #8A6534", +"i= c #A7896A", +"j= c #684C21", +"k= c #63471F", +"l= c #6B4C22", +"m= c #644820", +"n= c #624720", +"o= c #7A5E3B", +"p= c #CEAB8D", +"q= c #D1B296", +"r= c #614320", +"s= c #785529", +"t= c #7D5A2A", +"u= c #765526", +"v= c #725636", +"w= c #BE9F84", +"x= c #EEC8A8", +"y= c #C6A88C", +"z= c #564025", +"A= c #715026", +"B= c #48341E", +"C= c #664A22", +"D= c #825D2C", +"E= c #694E28", +"F= c #89642F", +"G= c #876333", +"H= c #B09071", +"I= c #D9B497", +"J= c #47361E", +"K= c #6A4D24", +"L= c #3D2C15", +"M= c #694D27", +"N= c #745027", +"O= c #7F5A2A", +"P= c #7E592B", +"Q= c #805C2B", +"R= c #7E5D32", +"S= c #B49679", +"T= c #80705B", +"U= c #4E391C", +"V= c #2D2012", +"W= c #634821", +"X= c #845A2C", +"Y= c #755429", +"Z= c #805C2C", +"`= c #88632E", +" - c #7F6444", +".- c #D5B294", +"+- c #D3B093", +"@- c #534839", +"#- c #4B3820", +"$- c #332614", +"%- c #543C1D", +"&- c #583E1F", +"*- c #885E2E", +"=- c #614522", +"-- c #674C23", +";- c #8B652E", +">- c #745A36", +",- c #B8997E", +"'- c #D0AD90", +")- c #292012", +"!- c #5B4526", +"~- c #664A24", +"{- c #815B2C", +"]- c #835F2C", +"^- c #684B24", +"/- c #684923", +"(- c #835E2C", +"_- c #443117", +":- c #553D1C", +"<- c #88612E", +"[- c #78532D", +"}- c #987D65", +"|- c #635344", +"1- c #392913", +"2- c #6D4F25", +"3- c #815E2C", +"4- c #87622D", +"5- c #624722", +"6- c #8B642E", +"7- c #513A1C", +"8- c #5C431F", +"9- c #7E5A2A", +"0- c #432F1B", +"a- c #B5977E", +"b- c #C7A78B", +"c- c #4A3821", +"d- c #432F16", +"e- c #4E391B", +"f- c #624621", +"g- c #875F2D", +"h- c #7D592B", +"i- c #5C4120", +"j- c #6E4F26", +"k- c #674A24", +"l- c #8E6630", +"m- c #523C1C", +"n- c #B6987C", +"o- c #8C6F50", +"p- c #6C4C26", +"q- c #2E2110", +"r- c #443219", +"s- c #84602D", +"t- c #644822", +"u- c #765428", +"v- c #885F2E", +"w- c #805A2B", +"x- c #765528", +"y- c #604520", +"z- c #684922", +"A- c #553A1B", +"B- c #4C3A21", +"C- c #614620", +"D- c #674924", +"E- c #DEBA9B", +"F- c #A58564", +"G- c #8C6736", +"H- c #886233", +"I- c #4F3A1B", +"J- c #715128", +"K- c #7D5828", +"L- c #50391F", +"M- c #3E2E17", +"N- c #83643E", +"O- c #826745", +"P- c #906A38", +"Q- c #815E30", +"R- c #3C352A", +"S- c #674921", +"T- c #57401E", +"U- c #6F4F22", +"V- c #715126", +"W- c #6A4D25", +"X- c #684C23", +"Y- c #614623", +"Z- c #4A3825", +"`- c #775C38", +" ; c #88612C", +".; c #7D5827", +"+; c #674B24", +"@; c #745427", +"#; c #7D5B2B", +"$; c #5E4321", +"%; c #3D2F1C", +"&; c #292114", +"*; c #735227", +"=; c #845D31", +"-; c #54422A", +";; c #171007", +">; c #785E3C", +",; c #815D2A", +"'; c #715226", +"); c #735126", +"!; c #382B19", +"~; c #8C6635", +"{; c #605138", +"]; c #5B4222", +"^; c #8B642F", +"/; c #825E2B", +"(; c #433117", +"_; c #4D391F", +":; c #875E2D", +"<; c #936B31", +"[; c #483319", +"}; c #735327", +"|; c #694E2D", +"1; c #7A5929", +"2; c #866331", +"3; c #4F4531", +"4; c #6C4E27", +"5; c #433118", +"6; c #624520", +"7; c #825D2B", +"8; c #413324", +"9; c #6F532C", +"0; c #2C2415", +"a; c #382B1A", +"b; c #543E28", +"c; c #86602D", +"d; c #5B411E", +"e; c #3B2A13", +"f; c #493419", +"g; c #6D4E26", +"h; c #4B3C2B", +"i; c #6A4D2A", +"j; c #4D371C", +"k; c #22180C", +"l; c #7D5A2B", +"m; c #322411", +"n; c #473419", +"o; c #825B2C", +"p; c #291D0E", +"q; c #433018", +"r; c #664924", +"s; c #654722", +"t; c #574831", +"u; c #795828", +"v; c #775528", +"w; c #29251C", +"x; c #4F391D", +"y; c #644722", +"z; c #6C4F28", +"A; c #6D4F24", +"B; c #88622D", +"C; c #644922", +"D; c #523C1D", +"E; c #7A5B32", +"F; c #553B1D", +"G; c #735325", +"H; c #6A4F2A", +"I; c #6E5026", +"J; c #6F532D", +"K; c #6F552F", +"L; c #4D3519", +"M; c #1A120A", +"N; c #5F4420", +"O; c #89632D", +"P; c #523D1E", +"Q; c #332511", +"R; c #805C2A", +"S; c #5F4520", +"T; c #7F633B", +"U; c #5C411E", +"V; c #402E19", +"W; c #5E4221", +"X; c #5B3F1E", +"Y; c #3B2B15", +"Z; c #84602C", +"`; c #483418", +" > c #1B140B", +".> c #191309", +"+> c #755427", +"@> c #89622E", +"#> c #1A1611", +"$> c #120D07", +"%> c #412F17", +"&> c #795626", +"*> c #362C20", +"=> c #413117", +"-> c #443218", +";> c #4F3D28", +">> c #815C2B", +",> c #715227", +"'> c #7D5928", +")> c #6C5A39", +"!> c #483F2E", +"~> c #7F592C", +"{> c #7E592A", +"]> c #795931", +"^> c #654823", +"/> c #47341B", +"(> c #604724", +"_> c #4D381A", +":> c #564024", +"<> c #855F2C", +"[> c #4C3A1E", +"}> c #8E652F", +"|> c #845C2E", +"1> c #7B572B", +"2> c #7E5B2B", +"3> c #4C361B", +"4> c #6E4E26", +"5> c #5D4728", +"6> c #755428", +"7> c #564021", +"8> c #936832", +"9> c #82582F", +"0> c #543E1D", +"a> c #614421", +"b> c #705024", +"c> c #8C642D", +"d> c #563F1F", +"e> c #4E3819", +"f> c #463219", +"g> c #87612C", +"h> c #664C29", +"i> c #6F5430", +"j> c #6F5229", +"k> c #72542B", +"l> c #906730", +"m> c #91682E", +"n> c #6A4C23", +"o> c #020101", +"p> c #060503", +"q> c #322B20", +"r> c #483318", +"s> c #8D6730", +"t> c #8A6531", +"u> c #6B4D24", +"v> c #644926", +"w> c #332414", +"x> c #7D592C", +"y> c #78552A", +"z> c #705C45", +"A> c #74582F", +"B> c #664622", +"C> c #8D642F", +"D> c #725327", +"E> c #443018", +"F> c #251A0C", +"G> c #22180D", +"H> c #7E5A29", +"I> c #614824", +"J> c #7A5D36", +"K> c #816137", +"L> c #755B33", +"M> c #694D25", +"N> c #815C2D", +"O> c #574426", +"P> c #5D4422", +"Q> c #684B22", +"R> c #8B652F", +"S> c #8C6732", +"T> c #86622E", +"U> c #8A632F", +"V> c #624822", +"W> c #4E3A1F", +"X> c #2F2110", +"Y> c #4B361A", +"Z> c #402C16", +"`> c #5D431F", +" , c #916730", +"., c #91672F", +"+, c #5E4527", +"@, c #745E3B", +"#, c #534025", +"$, c #362712", +"%, c #382914", +"&, c #372813", +"*, c #3A2A14", +"=, c #564023", +"-, c #583F1E", +";, c #7C5929", +">, c #8C642F", +",, c #674E2E", +"', c #553F24", +"), c #59421F", +"!, c #5D411F", +"~, c #7B5929", +"{, c #5A411E", +"], c #5D4523", +"^, c #7E5A27", +"/, c #422F17", +"(, c #8E662E", +"_, c #755227", +":, c #70532A", +"<, c #785527", +"[, c #3F2D15", +"}, c #735426", +"|, c #634D2F", +"1, c #392A16", +"2, c #513A1B", +"3, c #835E2D", +"4, c #342617", +"5, c #77572A", +"6, c #765629", +"7, c #4C3A25", +"8, c #79572B", +"9, c #725027", +"0, c #433628", +"a, c #1D1915", +"b, c #080808", +"c, c #030303", +"d, c #372F28", +"e, c #181512", +"f, c #130F0C", +"g, c #FFFFFF", +" ", +" . + ", +" @ # ", +" $ % & ", +" * = - ", +" ; > = , ' ) ", +" ! ~ { ] ^ / ( ", +" _ : < [ } | 1 2 ", +" 3 4 5 6 7 8 9 0 a ", +" b c d e f g h i j k l ", +" m n o p q r s t u v w x ", +" y z A B q w C D E F G H I ", +" J K L M N q O P Q R S N T ", +" U V W = X N Y Z ` .X X .. ", +" +.@.#.$.%.N = = &. *.=.-.;.= >.,.'. ", +" ).!.~.{.].N ^./.(. _.:.<.[.w X N }. ", +" |.1.2.3.4.5.= = 6.7. 8.9.0.] N a.b. ", +" c.d.e.f.g.= N X h.i.j.k.l.m.n.o.q p.q.r. ", +" s.t.u.v.N = = f w.x.y.z.A.B.X N C.D. ", +" E.F.G.H.^.N N I.J.K.L.M.N.O.= N P.Q. ", +" R.S.T.= ^.U.V. W.X.Y.{ = X Z.`. + ", +" .+++@+N = #+$+%+&+*+=+q { f -+;+ ", +" >+,+'+N )+ !+~+{+]+O.^+/+ ", +" (+_+w :+ <+[+}+|+1+ ", +" 2+3+0 4+ 5+6+7+8+9+ ", +" 0+a+b+c+ d+e+f+g+ ", +" h+i+j+k+ l+b+m+ ", +" n+o+p+q+r+]+X s+t+u+v+w+ ", +" x+y+z+A+B+C+D+E+F+G+H+I+J+ ", +" K+L+M+N+O+P+Q+@ R+S+T+U+V+ W+ ", +" X+Y+Z+`+ @.@+@@@#@9+$@%@&@ *@=@ ", +" -@;@e.>@,@'@q )@!@~@{@]@^@ /@(@_@:@<@[@ }@|@1@ ", +" 2@3@e.4@5@6@q 7@8@9@0@a@b@c@ d@/ e@f@f@|+g@h@ i@j@k@l@ ", +" m@n@e.o@p@q@r@s@t@u@v@w@x@y@z@A@B@C@D@E@F@G@H@I@J@K@L@M@ ", +" N@O@P@Q@R@S@T@U@V@W@X@!@Y@Z@`@ #.#+#@###$#%#&#*#=#-#;#># ", +" ,#'#)#!#~#{#]#^#/#(#_#:#<#[#}#|#1#2#3#4#5#6#7#O.8#9#0#a# ", +" b#c#d#>.H+U+e#f#g#h#i#H w j#f@k#l#m#n#o#= N >.H+X X >.p#q# ", +" r#i#N q X s#t#u#v#w#x#{ w y#z#A#B#C#>.D#p r N X X q = E#F# ", +" G#H#= q w k I#J#H+K#L#M#N#O#P#Q#R#S#T# U#V#W#X#7@Y# ", +" Z#`#^.X $.$+$G+= N N H y#@$#$$$%$p &$ *$=$-$ ", +" ;$>$,$X N '$)$!$H+X = N w ~${$H N ]$^$/$ ($_$ ", +" :$<$[$= N N N X N }$|$1$2$3$4$5$w ^.f@6$ 7$8$9$0$a$b$ ", +" c$X = q = N X N d$e$ f$g$h$i$N >.j$ k$l$m$n$o$M+p$ ", +" q$>.N q ^.N = r$ s$t$u$v$w w$ x$y$e.e.z$A$B$C$Q ", +" D$[ E$N X H F$G$ H$I$J$K$L$ M$N$O$Z+P$Q$R$S$T$U$ ", +" V$@ W$X$Y$Z$ `$ %.%, +%@%#%Z+$%%%&%F.Z+*% ", +" =%-%;% >%,%'%)%!%~%{%]% ^%/%(%e._%:%e.e.o@<% ", +" [%}%|%1%2%3%4%5%6%7%8%9%0% a%b%c%e.e.e.e.d%e% f%g%h%i% ", +" j%k%F.l%L.m%n%o%p%q%r%s%t%u%v%w%e.e.e.e.x%y%z%A%B%C%D%L.E% ", +" F%e.e.e.e.e.G%H%I%X N J%K%L%M%N%M+e.e.e.e.O%P%Q%R%o@&+S%Z+T% ", +" U%V%e.e.e.e.e.W%X%Y%^.= N Z%`% &.&L.e.e.e.e.+&@&#& $&%&&& ", +" *&=&e.e.e.e.e.e.+&-&;&q q = >&,&'&)&!&e.e.e.~&{& ", +" ]&e.e.e.e.e.e.e.^&/&N q %$w (&_& :&<&&%[&}& ", +" |&1&e.e.e.e.L.t.e.e.2&= q (&H ] 3& 4&5&6&7& ", +" 8&9&e.e.M+0&a&b&e.e.c&d&q e&f&g&h&i& j&k& ", +" l&m&e.n&*%4@o&Z+e.e.p&q&= r&s&^.t&u&v& w&x&y& ", +" z&@%A&B&C&&%e.e.e.e.D&E&^.F&G&= H&I&J&K&L&M&N& ", +" O&P&Q&R&2.e.e.e.e.e.S&T&U&g&V&q W&X&Y&Z&`& *.* ", +" +*C$@*#*$*x%e.e.e.e.e.%*&***=*-*N ;*>*e.P$,*'*`$ ", +" )*e.!* ~*{*e.e.e.e.e.]*^*/*(*_*^.:*<*e.[*}*|*1* ", +" 2*W%3* 4*5*W%e.e.e.e.6*7*&.8*4#% 9*0*R%a*b* *c*d* ", +" 3 e*_%f* g*h*i*e.e.e.e.j*k*l*m*N n*o* p*L%q*r*&+2%s* ", +" t*u*e. *v* w*x*|*e.e.e.e.y*z*) A*g&B*!@ L&C*Z+e*D*E* ", +" F*G*x%e.H* 5&e.e.e.I*J*K*L*q M*c+ N*+&e.@%O* ", +" P*Q*R*e.e.S* T*e.e.e.U*V*^.= N W*X* Y*Z*&%x%`* ", +" =.=+=e.e.@=#= $=e.e.&%%=&=q q E@*= ==-=;=>=,= ", +" '=Y&e.e.$* )=e.e.!=~=]+N A*{= ]=7$^= ", +" /=(=e*e.L._= :=e.e.<=[=q }=|= ", +" 1=2=3=4=l%+&5=6=7=8=e.@%9=0== F& ", +" a=b=c=d=e=f=g=M+h=i=] N U+ ", +" j=k=l=m=n=o=p=X p.q= ", +" r=s=t=u=v=w=>.x=y= ", +" z=A=B=C=D=E=F=W%G=H=L*0 I= ", +" J=K=L= M=Z+N=O=P=Q=e.e.R=S=w S T= ", +" U=e.1*V=W=e.X=Y=Z=@%e.`= -.-q +-@- ", +" #-$-%-x%W%&-Y+e.*-=---;-l%>-,->.= '- ", +" )-!-~-{-C%]-^-z$e.3@/-t.(-_-:-<-[-}-r = d#|- ", +" 1-2-3-4-W%e.P&4@5- *C%Z t=6-7-8-9-0-a-N w b-c- ", +" d-e-f-R*l%!=g-h-i-%-)*j-k-Q=S%l-y.m-n-d##+o-p- ", +" q-r-W.a*s-t-u-v-w-x-y-z-A-B-b*C-D-=.Y%E-F-G-H- ", +" I-4-e.x%Y=J-l$W%W%W%C$K-L- M-K.i*P&N-O-P-&%Q-R- ", +" S-@=e.e.e.!=T-U-V-W-X-Y-Z- `- ;e.e..;+;a*e.@;L@ ", +" l=l%e.e.e.e.S%#;$;%;&; *;!&e.=;-;g=x%8%;; ", +" >;,;e.e.e.e.e.';'*);!; A$m$e.~;{;];^;/;(; ", +" _;:;o@<;e.e.6-[;};|; 1;e.2;3; 4;@%p$ ", +" 5;6;7;e.e.e.=.8;9;0; o$x%P$a; b;c;d; ", +" e;f;]-e.e.l%g;h;i; j;!=t=k; 4@l; ", +" m;]-e.e.L.n; k; o;W.p; q;&+r; ", +" /;e.e.m& j@ s; *_- t;l-u; ", +" ]-e.e.v; w; x;C$y; z;e.A; ", +" B;e.e.C; D;a*E; e%e.&%F; ", +" G;!&&%H; I;e.J; K;e.!&L;M; ", +" N;O;4=P; Q;R;e.S; T;S%e*U;V; ", +" W;X; Y;Z;e.g= K &%`; > ", +" .>+>e.@> 4-M+#> ", +" $>%>L.m$,* 4-&> ", +" *>)&B;=> 4--> ", +" ;>>>,> '>)> !> ", +" ~>{> ]>^> <%/>(>_>p; ", +" y- :>^- );<>i*W%;-u;Q [> ", +" y+ V% V-O%P&}>|>1>&+O%2>3> ", +" 4>5> 6>7> M%7;e.8>9>Q$+>0>a>b>c><;d> ", +" e>U;f>g>h>i> j>k>l$e.e.t.l>e.e.e.m>C=n>C$[*== ", +" o>p>q> 5;9-r>x%s>t> *o@W%e.e.e.e.e.e.e.e.e.l$u>g=;-v> ", +" w>e;x>y>#*z> A>O%B>C>W%W%e.e.e.e.e.e.e.e.e.e.e.e.e*D>E>F> ", +" G>_$2+H>e.e.!&+>I>J>K>L>M>&+e.N>O>P>Q>9&R>S>T>u*u*u*Q=R;|*T>U>V>W> ", +" X>Y>Z>`>O;<;C$ ,e.e.W%.,e.e.e.C$+, @,#,$,$,$,%,&,*,=, ", +" -,Q$n>O%W%;,^->,e.e.e.e.e.W%u*,, ", +" ',C&),L.e.l$U;!,O%e.e.e.e.e.~,{, ", +" ],S-^,e.e.>>'=m$e.e.e.e.l%(% ", +" Z /,(,e.e._,n>e.e.e.e.6-:, ", +" <,[,M+e.e.l.<>e.e.e.B;}, ", +" |,1,M+e.e.2,t.e.e.3,V% ", +" 4,5,6,G*7,8,4@9,0, ", +" a,b,c,d,e,f, ", +" ", +" g,"}; diff --git a/panguin/macros/panguin.xpm b/panguin/macros/panguin.xpm new file mode 100644 index 000000000..9bedd7d46 --- /dev/null +++ b/panguin/macros/panguin.xpm @@ -0,0 +1,2646 @@ +/* XPM */ +static char * panguin_xpm[] = { +"72 103 2540 2", +" c None", +". c #FEFEFE", +"+ c #FAFAF6", +"@ c #FAF9F1", +"# c #FAFAF2", +"$ c #FCFCF7", +"% c #FDFDFD", +"& c #FCFCFC", +"* c #FCFCFB", +"= c #FEFEFC", +"- c #FDFDF9", +"; c #FCFCF6", +"> c #FDFDFA", +", c #FCFEFD", +"' c #FDFEFE", +") c #FEFEFD", +"! c #FBFBF8", +"~ c #FCFCF8", +"{ c #F9F9F6", +"] c #FDFDFB", +"^ c #FCFDFB", +"/ c #FCFCF9", +"( c #FDFDFC", +"_ c #FCFCF5", +": c #FBFCF7", +"< c #F9F9F4", +"[ c #E6E6E6", +"} c #ACAAAF", +"| c #DDDDD5", +"1 c #FAF9F0", +"2 c #FBFBF6", +"3 c #FBFBF7", +"4 c #9F9EA1", +"5 c #353139", +"6 c #0E0E13", +"7 c #5C5951", +"8 c #F3F1ED", +"9 c #F8F8F8", +"0 c #FBFBFA", +"a c #FCFDFC", +"b c #F7F6F4", +"c c #FAFAFA", +"d c #FBFBFB", +"e c #E9EAE9", +"f c #29292A", +"g c #07060C", +"h c #47453A", +"i c #413E20", +"j c #858383", +"k c #F9F9F9", +"l c #F7F7F4", +"m c #FBFCFB", +"n c #D9D9D9", +"o c #74716A", +"p c #4A4642", +"q c #919190", +"r c #F8F8F6", +"s c #FDFDF8", +"t c #F7F8F7", +"u c #8D8C8C", +"v c #47422E", +"w c #37341F", +"x c #625937", +"y c #A8A559", +"z c #1A1211", +"A c #D2D1D1", +"B c #FBFAF3", +"C c #FAFBFA", +"D c #FBFAF5", +"E c #D1D1D0", +"F c #3F3E40", +"G c #7B765A", +"H c #585448", +"I c #464545", +"J c #F8F7F7", +"K c #B8B9B8", +"L c #201E17", +"M c #AAA559", +"N c #847A48", +"O c #4A441B", +"P c #E2DD76", +"Q c #474020", +"R c #74726B", +"S c #B9B7B1", +"T c #F3F4F2", +"U c #FCFBFB", +"V c #FAFAF7", +"W c #F4F3F2", +"X c #DBDBD9", +"Y c #B9BBB5", +"Z c #A09E8F", +"` c #7D7C6A", +" . c #313026", +".. c #1A170F", +"+. c #BAB67C", +"@. c #403E2E", +"#. c #B4B0AF", +"$. c #FDFEFD", +"%. c #F2F2F2", +"&. c #484542", +"*. c #57542D", +"=. c #F8F482", +"-. c #E0D98A", +";. c #3C341A", +">. c #D3D271", +",. c #D5D082", +"'. c #888056", +"). c #464225", +"!. c #4C4742", +"~. c #908D85", +"{. c #B0AAA5", +"]. c #C8C7C6", +"^. c #ADABA8", +"/. c #83837E", +"(. c #7E7B77", +"_. c #8E8B80", +":. c #706C62", +"<. c #57533F", +"[. c #544D30", +"}. c #5A5427", +"|. c #8D8B50", +"1. c #C2C093", +"2. c #545344", +"3. c #5B543C", +"4. c #625938", +"5. c #605E5B", +"6. c #F7F7F5", +"7. c #F8F9F5", +"8. c #CAC8C7", +"9. c #2A2613", +"0. c #D2CF6B", +"a. c #F3EB5E", +"b. c #F5EE7F", +"c. c #847B4E", +"d. c #4F4F23", +"e. c #EAE87B", +"f. c #F5F16A", +"g. c #ECE371", +"h. c #C3BC69", +"i. c #BBAF69", +"j. c #898046", +"k. c #878049", +"l. c #74703B", +"m. c #868140", +"n. c #B5AC61", +"o. c #BDB45E", +"p. c #BFB96C", +"q. c #DBD370", +"r. c #F2E970", +"s. c #F8F172", +"t. c #EEEB7B", +"u. c #695E37", +"v. c #76713C", +"w. c #D6CB85", +"x. c #1C150F", +"y. c #A2A4A2", +"z. c #F6FAF9", +"A. c #FBFDFD", +"B. c #FBFCFC", +"C. c #F9FDFC", +"D. c #F8F8F7", +"E. c #F9F8F4", +"F. c #F7F7F7", +"G. c #FBFCFA", +"H. c #F8F9F6", +"I. c #918C94", +"J. c #2B2715", +"K. c #E3DD8B", +"L. c #F7ED65", +"M. c #F7EF64", +"N. c #E5E06F", +"O. c #524E22", +"P. c #7B7A34", +"Q. c #EDEB68", +"R. c #F6F261", +"S. c #F7EF6E", +"T. c #F8EE67", +"U. c #F7EF63", +"V. c #F8F265", +"W. c #F6F067", +"X. c #F7F06D", +"Y. c #F7F16C", +"Z. c #F7EF68", +"`. c #F6F275", +" + c #F3ED6C", +".+ c #EEEA79", +"++ c #B1B659", +"@+ c #565824", +"#+ c #A79B57", +"$+ c #F3EC76", +"%+ c #ABA854", +"&+ c #3D3937", +"*+ c #E4E7E5", +"=+ c #F5FAF9", +"-+ c #FAFCFB", +";+ c #F8FDFC", +">+ c #E1E2E2", +",+ c #787678", +"'+ c #575755", +")+ c #5A5956", +"!+ c #555656", +"~+ c #7F8080", +"{+ c #CACAC9", +"]+ c #F3F4F3", +"^+ c #B1AFB0", +"/+ c #252114", +"(+ c #BFBA78", +"_+ c #F1E970", +":+ c #F7EF60", +"<+ c #F4ED5F", +"[+ c #E4DE71", +"}+ c #90814E", +"|+ c #5B5326", +"1+ c #B4B058", +"2+ c #F6EF6F", +"3+ c #F7EB65", +"4+ c #F5EB63", +"5+ c #F7ED61", +"6+ c #F8EE5C", +"7+ c #F8F063", +"8+ c #F6EE71", +"9+ c #F2EB79", +"0+ c #DBD368", +"a+ c #867336", +"b+ c #827B2E", +"c+ c #8B9441", +"d+ c #CBCB6B", +"e+ c #F6EB6F", +"f+ c #D9D176", +"g+ c #332A11", +"h+ c #AAA3A2", +"i+ c #F8FAFA", +"j+ c #FBFDFC", +"k+ c #9C9B9B", +"l+ c #222121", +"m+ c #050404", +"n+ c #010001", +"o+ c #141414", +"p+ c #1E1D1B", +"q+ c #090808", +"r+ c #141415", +"s+ c #3D3C3E", +"t+ c #8A8A8A", +"u+ c #34302C", +"v+ c #17120A", +"w+ c #88813C", +"x+ c #F3EE6F", +"y+ c #F9F168", +"z+ c #F5EE67", +"A+ c #F6EF7D", +"B+ c #C2BB67", +"C+ c #76712B", +"D+ c #F2ED6F", +"E+ c #F7EE67", +"F+ c #F8EF68", +"G+ c #F7ED6C", +"H+ c #EEE677", +"I+ c #D9CE66", +"J+ c #B3A549", +"K+ c #6D6426", +"L+ c #7D7731", +"M+ c #C2B65D", +"N+ c #E9E066", +"O+ c #F3EC6A", +"P+ c #F4EB68", +"Q+ c #F7EC66", +"R+ c #D1CC6E", +"S+ c #202114", +"T+ c #BEC1C0", +"U+ c #D7D7D7", +"V+ c #D7D4D5", +"W+ c #D2D6D4", +"X+ c #EFF3F2", +"Y+ c #F1F1F1", +"Z+ c #858585", +"`+ c #0F0E0F", +" @ c #020102", +".@ c #070607", +"+@ c #030203", +"@@ c #252324", +"#@ c #595A58", +"$@ c #3F3F3D", +"%@ c #101014", +"&@ c #050509", +"*@ c #090707", +"=@ c #13110F", +"-@ c #060505", +";@ c #100F08", +">@ c #8D885D", +",@ c #BDBD6E", +"'@ c #E2DC7D", +")@ c #F6F17B", +"!@ c #F5EE6D", +"~@ c #F3ED5C", +"{@ c #F4ED64", +"]@ c #F3EE67", +"^@ c #F7F067", +"/@ c #C7BE4A", +"(@ c #6A5820", +"_@ c #675725", +":@ c #B0A559", +"<@ c #E5DE73", +"[@ c #F8ED69", +"}@ c #F7EB67", +"|@ c #F7ED5B", +"1@ c #F6EF5D", +"2@ c #F6EC66", +"3@ c #A6A64F", +"4@ c #141208", +"5@ c #3D1920", +"6@ c #551A25", +"7@ c #581921", +"8@ c #35161B", +"9@ c #433E3E", +"0@ c #C6C7C6", +"a@ c #FAFCFA", +"b@ c #9D9D9C", +"c@ c #343334", +"d@ c #757474", +"e@ c #9B9D9D", +"f@ c #6B6A6B", +"g@ c #646365", +"h@ c #585857", +"i@ c #2B2A2B", +"j@ c #222028", +"k@ c #0D0D11", +"l@ c #0E0E0E", +"m@ c #4B4A4B", +"n@ c #797B7C", +"o@ c #68666A", +"p@ c #2C2831", +"q@ c #12120D", +"r@ c #1E1B09", +"s@ c #514C20", +"t@ c #938D4B", +"u@ c #DDD671", +"v@ c #F8F273", +"w@ c #F5EF66", +"x@ c #F6F060", +"y@ c #F7F169", +"z@ c #F6ED71", +"A@ c #F7F17A", +"B@ c #F6ED6D", +"C@ c #F7F069", +"D@ c #F7ED67", +"E@ c #F6EC70", +"F@ c #F7EC68", +"G@ c #F5EA5D", +"H@ c #F7F065", +"I@ c #D6D56A", +"J@ c #39230F", +"K@ c #72283E", +"L@ c #C73A65", +"M@ c #D63D69", +"N@ c #D43664", +"O@ c #BC365E", +"P@ c #521826", +"Q@ c #282221", +"R@ c #D7D7D6", +"S@ c #818181", +"T@ c #020101", +"U@ c #2B2B2B", +"V@ c #B3B3B3", +"W@ c #CCCCCB", +"X@ c #D0D0D0", +"Y@ c #D0CED2", +"Z@ c #CECFD0", +"`@ c #D0CFCC", +" # c #C8C8CD", +".# c #AAACAC", +"+# c #696760", +"@# c #1F1F1D", +"## c #262629", +"$# c #676467", +"%# c #8C8B8C", +"&# c #858783", +"*# c #5E5F59", +"=# c #3B3B3D", +"-# c #131116", +";# c #231D12", +"># c #7A7838", +",# c #DBD277", +"'# c #F2ED69", +")# c #F7EF5E", +"!# c #F8EE5F", +"~# c #F7EC63", +"{# c #F7EE5F", +"]# c #F7ED62", +"^# c #F6EF62", +"/# c #F5EC63", +"(# c #F7EC64", +"_# c #F4EE74", +":# c #6E713D", +"<# c #470E19", +"[# c #CE3762", +"}# c #E03868", +"|# c #8D263B", +"1# c #BC3358", +"2# c #E72D62", +"3# c #BC4264", +"4# c #320C12", +"5# c #605B5C", +"6# c #F8F6F7", +"7# c #C0C1C1", +"8# c #060405", +"9# c #040404", +"0# c #828282", +"a# c #CACACC", +"b# c #CCCCD0", +"c# c #CACACB", +"d# c #CACACA", +"e# c #CBCBD0", +"f# c #CECECD", +"g# c #CECECA", +"h# c #B5B8B6", +"i# c #737577", +"j# c #1E1D1F", +"k# c #191717", +"l# c #1A1A1A", +"m# c #373836", +"n# c #888A87", +"o# c #A1A1A6", +"p# c #646367", +"q# c #181519", +"r# c #231B11", +"s# c #938B4B", +"t# c #E9E572", +"u# c #F8EF67", +"v# c #F7EC62", +"w# c #F5EB61", +"x# c #F7EB5D", +"y# c #F7ED5F", +"z# c #F6EF5A", +"A# c #F6ED63", +"B# c #F5EC70", +"C# c #B3B35C", +"D# c #332013", +"E# c #9E2A4C", +"F# c #DD3D6E", +"G# c #7E243F", +"H# c #4F111A", +"I# c #BD385B", +"J# c #E73367", +"K# c #E23465", +"L# c #82273F", +"M# c #2B1F21", +"N# c #E1E3E3", +"O# c #E6E7E7", +"P# c #262222", +"Q# c #040303", +"R# c #717071", +"S# c #D2D2D2", +"T# c #CDCDCC", +"U# c #CBCBCB", +"V# c #CBCBCC", +"W# c #CCCCCC", +"X# c #CDCECD", +"Y# c #CDCDCD", +"Z# c #C7C6C6", +"`# c #B7B7B7", +" $ c #8B8B8B", +".$ c #484948", +"+$ c #2B2A2A", +"@$ c #1F1E22", +"#$ c #808080", +"$$ c #A3A4A7", +"%$ c #60605F", +"&$ c #282821", +"*$ c #48431E", +"=$ c #C1BE62", +"-$ c #F6F27B", +";$ c #F8EF6C", +">$ c #F5ED60", +",$ c #F7EE6D", +"'$ c #F4EB84", +")$ c #B2A261", +"!$ c #361F0E", +"~$ c #852F3E", +"{$ c #D33C66", +"]$ c #C03159", +"^$ c #2A0607", +"/$ c #531521", +"($ c #D23D62", +"_$ c #DE3765", +":$ c #E72D60", +"<$ c #C73E62", +"[$ c #3A1A1C", +"}$ c #C7C5C4", +"|$ c #FCFDFD", +"1$ c #9C9C9C", +"2$ c #070606", +"3$ c #1E1D1E", +"4$ c #B6B8B8", +"5$ c #CECDCD", +"6$ c #CBCCCC", +"7$ c #CBCBCA", +"8$ c #CFCFCE", +"9$ c #C6C8C8", +"0$ c #818282", +"a$ c #333333", +"b$ c #1A1A1B", +"c$ c #4E4C48", +"d$ c #686468", +"e$ c #4F4953", +"f$ c #23211D", +"g$ c #706242", +"h$ c #DFD98A", +"i$ c #B7B257", +"j$ c #D9D676", +"k$ c #A0964E", +"l$ c #504525", +"m$ c #1E0B0A", +"n$ c #80273E", +"o$ c #DA3B6C", +"p$ c #C73662", +"q$ c #6D1320", +"r$ c #702834", +"s$ c #420C13", +"t$ c #A93052", +"u$ c #DC3A67", +"v$ c #E43665", +"w$ c #CD3C64", +"x$ c #4C191B", +"y$ c #CDC5C4", +"z$ c #F0F1F1", +"A$ c #5D5D5D", +"B$ c #838283", +"C$ c #CBCCCB", +"D$ c #CACBCB", +"E$ c #CFCFCF", +"F$ c #909093", +"G$ c #3B3B3F", +"H$ c #0E0E12", +"I$ c #2E2F31", +"J$ c #717174", +"K$ c #42403E", +"L$ c #2C281F", +"M$ c #141007", +"N$ c #261F0E", +"O$ c #230D0D", +"P$ c #31090D", +"Q$ c #7A263D", +"R$ c #CB3E6D", +"S$ c #E0376C", +"T$ c #8A2846", +"U$ c #661C2A", +"V$ c #CF3C67", +"W$ c #952638", +"X$ c #BA2D4D", +"Y$ c #E53361", +"Z$ c #DF3663", +"`$ c #BA3A5E", +" % c #351618", +".% c #CAC9C8", +"+% c #DCDCDC", +"@% c #343434", +"#% c #161516", +"$% c #BDBEBD", +"%% c #CCCBCC", +"&% c #CCCDD2", +"*% c #C8CCCF", +"=% c #A4A9A6", +"-% c #515350", +";% c #202120", +">% c #3B3B3A", +",% c #464747", +"'% c #232125", +")% c #251420", +"!% c #7E3953", +"~% c #AF395A", +"{% c #D74360", +"]% c #DC335D", +"^% c #E33562", +"/% c #A92548", +"(% c #BA325A", +"_% c #E83265", +":% c #DC3963", +"<% c #E63263", +"[% c #E92D61", +"}% c #DB3563", +"|% c #8B2945", +"1% c #393233", +"2% c #E9E9E9", +"3% c #322F31", +"4% c #B7B8B8", +"5% c #CACDC9", +"6% c #CCCCC5", +"7% c #CBCDC4", +"8% c #CCCFC9", +"9% c #A6A7A6", +"0% c #767877", +"a% c #3C3D3F", +"b% c #565558", +"c% c #675962", +"d% c #36141C", +"e% c #69192A", +"f% c #CD3760", +"g% c #E2345E", +"h% c #E5335C", +"i% c #E33060", +"j% c #E73162", +"k% c #EB3165", +"l% c #E6335D", +"m% c #EB3066", +"n% c #E92C62", +"o% c #D53B67", +"p% c #4C0F1A", +"q% c #2E292D", +"r% c #665F64", +"s% c #9D9D9D", +"t% c #F9FAFA", +"u% c #DBDCDC", +"v% c #353435", +"w% c #302F30", +"x% c #B8B8B8", +"y% c #CCCBCB", +"z% c #CCCDC4", +"A% c #CCCDC2", +"B% c #CBCCC8", +"C% c #CAC9CB", +"D% c #CECCCE", +"E% c #D1D2D2", +"F% c #BEC1BF", +"G% c #484848", +"H% c #292424", +"I% c #282425", +"J% c #100405", +"K% c #390F15", +"L% c #9D3251", +"M% c #DD3764", +"N% c #E5335E", +"O% c #DD335C", +"P% c #E63464", +"Q% c #E13562", +"R% c #E53363", +"S% c #E63567", +"T% c #952D4B", +"U% c #1A0405", +"V% c #150E15", +"W% c #35292E", +"X% c #1B1A1A", +"Y% c #DEDEDE", +"Z% c #F4F4F4", +"`% c #B8B8B7", +" & c #212121", +".& c #272828", +"+& c #A8A7A8", +"@& c #D1D0D0", +"#& c #CFD0CE", +"$& c #CDCDCE", +"%& c #CCCDCD", +"&& c #CCCACF", +"*& c #CDCDD2", +"=& c #858B88", +"-& c #41403E", +";& c #1D1312", +">& c #290B0F", +",& c #952847", +"'& c #D73562", +")& c #E33566", +"!& c #EA3166", +"~& c #D63965", +"{& c #B32E55", +"]& c #591825", +"^& c #0A0606", +"/& c #1C131B", +"(& c #433741", +"_& c #060507", +":& c #1C1B1C", +"<& c #444445", +"[& c #BFBFBF", +"}& c #2D2C2D", +"|& c #161617", +"1& c #A5A4A5", +"2& c #CBCDCC", +"3& c #CDCCCD", +"4& c #C5C5C5", +"5& c #7B7979", +"6& c #4D4D4D", +"7& c #7D7C7C", +"8& c #9C9B9C", +"9& c #CDCECE", +"0& c #CCCCCE", +"a& c #CCCCCD", +"b& c #C9CBCA", +"c& c #CDD0CE", +"d& c #CECDCC", +"e& c #9C9999", +"f& c #2E2F2E", +"g& c #050303", +"h& c #160406", +"i& c #591828", +"j& c #B23C60", +"k& c #DF396A", +"l& c #CA3A69", +"m& c #862B4A", +"n& c #3B131F", +"o& c #392F39", +"p& c #120F15", +"q& c #050308", +"r& c #0B050A", +"s& c #080307", +"t& c #2A242B", +"u& c #1E1B1F", +"v& c #B1AEB1", +"w& c #FCFDFA", +"x& c #D6D6D6", +"y& c #232222", +"z& c #272627", +"A& c #B7B6B5", +"B& c #CECFCE", +"C& c #CCCAC9", +"D& c #CCCDCC", +"E& c #C3C3C3", +"F& c #747474", +"G& c #464546", +"H& c #515050", +"I& c #141314", +"J& c #4E4D4D", +"K& c #A1A0A0", +"L& c #CFD0D1", +"M& c #CFCECC", +"N& c #C8C8C9", +"O& c #CACCCB", +"P& c #CFCCCD", +"Q& c #B8BDBA", +"R& c #5A5D5C", +"S& c #141313", +"T& c #150303", +"U& c #3A1015", +"V& c #782336", +"W& c #531B2B", +"X& c #371C26", +"Y& c #675266", +"Z& c #5D4F63", +"`& c #332A36", +" * c #0D0406", +".* c #0C0406", +"+* c #1C171F", +"@* c #4B4249", +"#* c #4F4951", +"$* c #F3F2F2", +"%* c #F7F8F8", +"&* c #C1C0C0", +"** c #131313", +"=* c #1A191A", +"-* c #A0A1A1", +";* c #6D6D6D", +">* c #9FA0A0", +",* c #F7F7F8", +"'* c #D6D5D6", +")* c #B9B9B8", +"!* c #A3A4A4", +"~* c #2A2A2A", +"{* c #131212", +"]* c #40403F", +"^* c #CACBCC", +"/* c #CFCBCB", +"(* c #D2D1D3", +"_* c #C8CECB", +":* c #C8D1CE", +"<* c #A4ABAB", +"[* c #262627", +"}* c #080102", +"|* c #0E0202", +"1* c #382B32", +"2* c #635E66", +"3* c #241E29", +"4* c #08060F", +"5* c #050309", +"6* c #0A0101", +"7* c #2D252B", +"8* c #514851", +"9* c #110F14", +"0* c #4F4E4F", +"a* c #E8E8E8", +"b* c #C7C4C6", +"c* c #111010", +"d* c #7A7A7A", +"e* c #CCCDCB", +"f* c #B6B6B5", +"g* c #555556", +"h* c #F3F3F3", +"i* c #F9FAF9", +"j* c #EDEEEE", +"k* c #969696", +"l* c #3C3C3D", +"m* c #181818", +"n* c #424143", +"o* c #8D8C8D", +"p* c #B8B7B7", +"q* c #A19E9E", +"r* c #CCC7CA", +"s* c #C9CCCA", +"t* c #A9B0AE", +"u* c #252827", +"v* c #030204", +"w* c #09070D", +"x* c #111016", +"y* c #030309", +"z* c #020207", +"A* c #020204", +"B* c #0A0A0A", +"C* c #08070C", +"D* c #120E11", +"E* c #0D0B0E", +"F* c #A4A3A5", +"G* c #151415", +"H* c #565656", +"I* c #BCBCBC", +"J* c #555454", +"K* c #BEBFBF", +"L* c #AAABAB", +"M* c #111011", +"N* c #2F3131", +"O* c #6A686A", +"P* c #B5AEAF", +"Q* c #D3CACB", +"R* c #D2CCCC", +"S* c #D1D3D1", +"T* c #B1B5B4", +"U* c #323438", +"V* c #060609", +"W* c #050409", +"X* c #040207", +"Y* c #030104", +"Z* c #040304", +"`* c #242324", +" = c #060606", +".= c #060509", +"+= c #0A090B", +"@= c #0E0D0E", +"#= c #8E8E8E", +"$= c #1C1C1C", +"%= c #6B6B6B", +"&= c #F1F1F0", +"*= c #FAFBFB", +"== c #F6F6F6", +"-= c #F5F5F5", +";= c #919191", +">= c #080707", +",= c #252726", +"'= c #9CA0A0", +")= c #615C60", +"!= c #B2A1A7", +"~= c #9E9297", +"{= c #AAA8A6", +"]= c #CDD1D2", +"^= c #C6CACC", +"/= c #5D5F60", +"(= c #09090A", +"_= c #060202", +":= c #0D0407", +"<= c #32272D", +"[= c #070204", +"}= c #090909", +"|= c #302F31", +"1= c #E0E0E0", +"2= c #B7B9B9", +"3= c #212222", +"4= c #DADADA", +"5= c #DAD9DA", +"6= c #4F4C4F", +"7= c #D1D1D1", +"8= c #E1DFE1", +"9= c #6C6B6D", +"0= c #F4F3F3", +"a= c #B4B2B2", +"b= c #0C0808", +"c= c #030202", +"d= c #151615", +"e= c #6D726E", +"f= c #585757", +"g= c #201819", +"h= c #818283", +"i= c #909392", +"j= c #626564", +"k= c #C8CECC", +"l= c #848782", +"m= c #070404", +"n= c #241E24", +"o= c #150C14", +"p= c #0A060C", +"q= c #0E0C0E", +"r= c #BABABB", +"s= c #E6E7E8", +"t= c #838383", +"u= c #4E504F", +"v= c #3D3C3C", +"w= c #6C6B6B", +"x= c #A2A1A1", +"y= c #EDECEA", +"z= c #F2F4F4", +"A= c #626263", +"B= c #959899", +"C= c #FAFAF9", +"D= c #7D7D7A", +"E= c #080808", +"F= c #B0B0B0", +"G= c #9A9B9A", +"H= c #090809", +"I= c #949594", +"J= c #E5E5E5", +"K= c #322E30", +"L= c #030102", +"M= c #171716", +"N= c #7F7D7C", +"O= c #9A9999", +"P= c #8A8E8B", +"Q= c #787878", +"R= c #777776", +"S= c #606060", +"T= c #ADAEAB", +"U= c #7F817F", +"V= c #0B0B0A", +"W= c #0B0D0D", +"X= c #0B0B11", +"Y= c #16131B", +"Z= c #221B28", +"`= c #15141A", +" - c #424245", +".- c #F1F1EC", +"+- c #525353", +"@- c #060203", +"#- c #1A100E", +"$- c #2D1E15", +"%- c #140604", +"&- c #0D0605", +"*- c #0D0B0C", +"=- c #2C2726", +"-- c #4C4746", +";- c #4E4D4B", +">- c #605F5E", +",- c #7A7A7B", +"'- c #A3A2A3", +")- c #16161B", +"!- c #656767", +"~- c #4F4948", +"{- c #201412", +"]- c #100201", +"^- c #1E191A", +"/- c #B5B4B5", +"(- c #888788", +"_- c #060506", +":- c #9B9B9A", +"<- c #5A5959", +"[- c #191819", +"}- c #A7A8A8", +"|- c #656566", +"1- c #595859", +"2- c #767575", +"3- c #999897", +"4- c #5A5D5B", +"5- c #1B1B1D", +"6- c #5D4F65", +"7- c #886A99", +"8- c #54445E", +"9- c #0D0C13", +"0- c #AAAAAD", +"a- c #FAFDFB", +"b- c #929293", +"c- c #090506", +"d- c #361E15", +"e- c #BE8F73", +"f- c #DCA07A", +"g- c #BF8868", +"h- c #94694E", +"i- c #583C2B", +"j- c #3E2519", +"k- c #341C0F", +"l- c #361C12", +"m- c #341E14", +"n- c #221009", +"o- c #1F0E0B", +"p- c #301C12", +"q- c #492B1C", +"r- c #875D43", +"s- c #AC7A5A", +"t- c #A67C60", +"u- c #916752", +"v- c #3A2D27", +"w- c #746C68", +"x- c #171616", +"y- c #CCCACB", +"z- c #8C8C8B", +"A- c #010102", +"B- c #252525", +"C- c #646564", +"D- c #474848", +"E- c #454545", +"F- c #676665", +"G- c #464547", +"H- c #5E5D5E", +"I- c #474747", +"J- c #1F1E1F", +"K- c #3E3044", +"L- c #816690", +"M- c #7E6A8A", +"N- c #1E1B23", +"O- c #555658", +"P- c #FCFCFA", +"Q- c #E5E9E9", +"R- c #333338", +"S- c #140503", +"T- c #AB795F", +"U- c #EEA376", +"V- c #F49E62", +"W- c #F39E66", +"X- c #EFA370", +"Y- c #F2A776", +"Z- c #E59D6E", +"`- c #E19B6F", +" ; c #DF9B70", +".; c #E19D72", +"+; c #CA8861", +"@; c #C58560", +"#; c #DB9B74", +"$; c #E5A378", +"%; c #F2A675", +"&; c #F2A069", +"*; c #F1A069", +"=; c #E7A881", +"-; c #573324", +";; c #463E39", +">; c #7E7B7A", +",; c #969797", +"'; c #313031", +"); c #959595", +"!; c #484749", +"~; c #5A5A5A", +"{; c #4A4A4A", +"]; c #969695", +"^; c #A2A2A2", +"/; c #252327", +"(; c #3B343F", +"_; c #4B3A50", +":; c #826E8D", +"<; c #302B33", +"[; c #9B9EA0", +"}; c #060508", +"|; c #3C2015", +"1; c #E09E75", +"2; c #F59D61", +"3; c #F59E5C", +"4; c #F39D5E", +"5; c #F1A164", +"6; c #F09F63", +"7; c #F1A165", +"8; c #F2A066", +"9; c #F0A066", +"0; c #EE9F65", +"a; c #EEA068", +"b; c #EE9F68", +"c; c #EE9E6A", +"d; c #F29F69", +"e; c #F69B60", +"f; c #F79C5F", +"g; c #F49C5E", +"h; c #F1A46F", +"i; c #A57B5F", +"j; c #362B26", +"k; c #020203", +"l; c #6B6A6C", +"m; c #59595A", +"n; c #A8A7A7", +"o; c #343436", +"p; c #423846", +"q; c #332E38", +"r; c #221D26", +"s; c #1F1E20", +"t; c #CDCCCE", +"u; c #EBEAEA", +"v; c #323235", +"w; c #0A0303", +"x; c #886344", +"y; c #EDA46E", +"z; c #F3A060", +"A; c #F4A062", +"B; c #ECA167", +"C; c #EBA26A", +"D; c #F09E6B", +"E; c #F39F69", +"F; c #F19E69", +"G; c #F09F6A", +"H; c #F29E6B", +"I; c #F09F6B", +"J; c #F19F6C", +"K; c #F19E6B", +"L; c #F49E68", +"M; c #F69D67", +"N; c #F79D64", +"O; c #EFA16D", +"P; c #C69477", +"Q; c #3D2F2B", +"R; c #F2F1F1", +"S; c #999899", +"T; c #201E1E", +"U; c #504F4F", +"V; c #838282", +"W; c #8E8D8E", +"X; c #6B6C6B", +"Y; c #444444", +"Z; c #4E4E4F", +"`; c #908E8F", +" > c #312D31", +".> c #443F47", +"+> c #242226", +"@> c #C0C2C2", +"#> c #0E0B0C", +"$> c #1F0E09", +"%> c #C38B66", +"&> c #F0A169", +"*> c #F4A060", +"=> c #F0A166", +"-> c #EBA16C", +";> c #ECA06A", +">> c #F59E64", +",> c #F69D64", +"'> c #F69F63", +")> c #F69E63", +"!> c #F69D63", +"~> c #F29F65", +"{> c #ECA16D", +"]> c #EEA06C", +"^> c #F5A068", +"/> c #F1A16A", +"(> c #DEA07A", +"_> c #806858", +":> c #F3F2EF", +"<> c #767677", +"[> c #484849", +"}> c #5D5C5D", +"|> c #8E8E8D", +"1> c #979897", +"2> c #302F2F", +"3> c #18191A", +"4> c #1B1A1B", +"5> c #BDBDBD", +"6> c #FEFDFD", +"7> c #F3F2F3", +"8> c #0D0303", +"9> c #724F3C", +"0> c #E9A878", +"a> c #F49C62", +"b> c #F79D63", +"c> c #F59E66", +"d> c #F19F66", +"e> c #F49E63", +"f> c #EFA165", +"g> c #EFA064", +"h> c #F1A163", +"i> c #F1A064", +"j> c #F39F62", +"k> c #F3A05F", +"l> c #ECA16C", +"m> c #ECA06D", +"n> c #F39D64", +"o> c #F59D5F", +"p> c #ECA06E", +"q> c #E4C0A0", +"r> c #FAF8EF", +"s> c #0B0B0B", +"t> c #A3A3A3", +"u> c #6D6E6D", +"v> c #898888", +"w> c #575757", +"x> c #151516", +"y> c #3D3D3C", +"z> c #3C3C3C", +"A> c #676867", +"B> c #212021", +"C> c #262626", +"D> c #B6B8B7", +"E> c #F9FCFB", +"F> c #C0BFBE", +"G> c #100C0E", +"H> c #4C2B1B", +"I> c #D89B72", +"J> c #EFA26F", +"K> c #F39F65", +"L> c #F59E67", +"M> c #F39E67", +"N> c #F49D65", +"O> c #EF9F6B", +"P> c #F0A06B", +"Q> c #EFA06B", +"R> c #F29F68", +"S> c #F3A062", +"T> c #EEA168", +"U> c #EFA06A", +"V> c #F09D64", +"W> c #ECA475", +"X> c #F3DEC8", +"Y> c #FCFBF4", +"Z> c #020104", +"`> c #030205", +" , c #1E1A1C", +"., c #C6C2C7", +"+, c #4F4F51", +"@, c #464646", +"#, c #666565", +"$, c #181718", +"%, c #292929", +"&, c #454444", +"*, c #454746", +"=, c #67696A", +"-, c #616261", +";, c #3D3D3D", +">, c #FBFCF8", +",, c #F9FAF8", +"', c #F7F9F4", +"), c #F5FBFA", +"!, c #C2C4C4", +"~, c #1F1E1E", +"{, c #1B120D", +"], c #C48B65", +"^, c #F3A46C", +"/, c #F19F69", +"(, c #EE9C66", +"_, c #F1A068", +":, c #F0A069", +"<, c #F19F68", +"[, c #F0A068", +"}, c #F09F67", +"|, c #F0A067", +"1, c #F3A067", +"2, c #E0A87E", +"3, c #EFDABC", +"4, c #F0E9DA", +"5, c #878B8E", +"6, c #BBBEC2", +"7, c #DDDEDE", +"8, c #DEDEDC", +"9, c #545351", +"0, c #0A0A09", +"a, c #0E0E0F", +"b, c #080806", +"c, c #292427", +"d, c #564E55", +"e, c #565252", +"f, c #494949", +"g, c #3E3F3E", +"h, c #363838", +"i, c #515252", +"j, c #535353", +"k, c #505051", +"l, c #616161", +"m, c #4E4F4F", +"n, c #242424", +"o, c #7E7D7D", +"p, c #333233", +"q, c #DCDBDA", +"r, c #F9FCFC", +"s, c #F8FBFA", +"t, c #FBFBF4", +"u, c #F8F9F2", +"v, c #C2C6C6", +"w, c #2E2D2F", +"x, c #1B0C08", +"y, c #AB7958", +"z, c #EBA06D", +"A, c #F09D65", +"B, c #F5A168", +"C, c #F29E68", +"D, c #F29F67", +"E, c #F29E67", +"F, c #F19F67", +"G, c #F1A067", +"H, c #F2A067", +"I, c #F09F62", +"J, c #EEA269", +"K, c #C09274", +"L, c #3F312E", +"M, c #3F3D3F", +"N, c #232126", +"O, c #181719", +"P, c #1D1717", +"Q, c #0C0504", +"R, c #110B0A", +"S, c #171313", +"T, c #040305", +"U, c #050505", +"V, c #9C9A9B", +"W, c #4B4749", +"X, c #131214", +"Y, c #4B4B4C", +"Z, c #636262", +"`, c #525252", +" ' c #525151", +".' c #606160", +"+' c #303030", +"@' c #6B6B6C", +"#' c #808181", +"$' c #F9F8F8", +"%' c #F9F9F0", +"&' c #F6F8F5", +"*' c #C8C9C9", +"=' c #2D2C2F", +"-' c #1F0D08", +";' c #A06C4F", +">' c #F2A065", +",' c #F4A066", +"'' c #F09E68", +")' c #F4A067", +"!' c #F59E65", +"~' c #F49E65", +"{' c #F2A068", +"]' c #F09E65", +"^' c #E8A273", +"/' c #CB916A", +"(' c #8A5B41", +"_' c #5B3622", +":' c #4D2F1E", +"<' c #644638", +"[' c #8D6C5B", +"}' c #311C16", +"|' c #090203", +"1' c #040405", +"2' c #0D0C0D", +"3' c #929191", +"4' c #575759", +"5' c #4D4D4C", +"6' c #434343", +"7' c #4D4C4D", +"8' c #565959", +"9' c #4C4C4C", +"0' c #4C4D4D", +"a' c #656565", +"b' c #5D5C5C", +"c' c #949695", +"d' c #E2E2E2", +"e' c #F8FCFB", +"f' c #FAFCFC", +"g' c #E8E9E6", +"h' c #B7B6B2", +"i' c #605A58", +"j' c #342621", +"k' c #633C28", +"l' c #C1855B", +"m' c #EC9F6C", +"n' c #ED9E68", +"o' c #F1A06B", +"p' c #F4A068", +"q' c #F49E64", +"r' c #F89D63", +"s' c #F69E64", +"t' c #F29D65", +"u' c #EF9D66", +"v' c #F2A06A", +"w' c #F3A069", +"x' c #EF9D65", +"y' c #F09E69", +"z' c #F1A26C", +"A' c #F39D65", +"B' c #F1A36C", +"C' c #E59E6F", +"D' c #945635", +"E' c #7E472E", +"F' c #9D6A4D", +"G' c #946E59", +"H' c #100503", +"I' c #191919", +"J' c #908F90", +"K' c #606062", +"L' c #1F1F1F", +"M' c #616060", +"N' c #3E3E3F", +"O' c #3C3B3C", +"P' c #373838", +"Q' c #1C1B1B", +"R' c #3B3A3B", +"S' c #383838", +"T' c #4A4949", +"U' c #2D2C2C", +"V' c #C8C7C7", +"W' c #F5F5F4", +"X' c #9B9691", +"Y' c #2A2726", +"Z' c #20140F", +"`' c #7D5942", +" ) c #D5976A", +".) c #F3A874", +"+) c #F0A676", +"@) c #EDA172", +"#) c #F19F6B", +"$) c #F09F69", +"%) c #F0A06A", +"&) c #F59D65", +"*) c #F69F65", +"=) c #F39F67", +"-) c #F1A26D", +";) c #EEA16D", +">) c #F39F68", +",) c #F09F68", +"') c #F4A169", +")) c #F59F62", +"!) c #F59E5E", +"~) c #EE9E69", +"{) c #EDA06D", +"]) c #EEA270", +"^) c #F2A778", +"/) c #F0A376", +"() c #D49D7B", +"_) c #2E1D16", +":) c #050406", +"<) c #242124", +"[) c #8C8D8D", +"}) c #444746", +"|) c #0D0D0D", +"1) c #4F4F4F", +"2) c #3A3A3A", +"3) c #0A0909", +"4) c #6E6D6E", +"5) c #7C7B7C", +"6) c #555555", +"7) c #0C0C0C", +"8) c #100F10", +"9) c #E4E4E4", +"0) c #F8F9F7", +"a) c #7D7671", +"b) c #1F0F0C", +"c) c #6E4D3C", +"d) c #D09C74", +"e) c #EEA573", +"f) c #F0A06D", +"g) c #CF8761", +"h) c #7A3D28", +"i) c #D29061", +"j) c #F6A061", +"k) c #F19C63", +"l) c #F39E65", +"m) c #E9A071", +"n) c #EAA375", +"o) c #EF9F6A", +"p) c #F5A36C", +"q) c #F09E67", +"r) c #F3A16A", +"s) c #EFA16E", +"t) c #E49C6C", +"u) c #EAA273", +"v) c #ECA273", +"w) c #E8A173", +"x) c #ECA170", +"y) c #EE9F6A", +"z) c #F69D66", +"A) c #DDA27B", +"B) c #382517", +"C) c #040308", +"D) c #151114", +"E) c #6A6A6B", +"F) c #8F9191", +"G) c #1B1B1B", +"H) c #B1B1B1", +"I) c #B4B4B4", +"J) c #242525", +"K) c #F6F7F7", +"L) c #FDFEFC", +"M) c #E9EAE8", +"N) c #2F2925", +"O) c #735448", +"P) c #E2A985", +"Q) c #F3A068", +"R) c #EF9E68", +"S) c #EC9E6C", +"T) c #DF966A", +"U) c #D1885D", +"V) c #EBA06B", +"W) c #ECA16F", +"X) c #C68961", +"Y) c #A86F51", +"Z) c #C67F52", +"`) c #EF9E67", +" ! c #F1A06A", +".! c #E79D6B", +"+! c #8E6249", +"@! c #3F261B", +"#! c #542D1D", +"$! c #C2845F", +"%! c #F39F63", +"&! c #F49F66", +"*! c #F49D60", +"=! c #DE9E71", +"-! c #050508", +";! c #413A42", +">! c #413C40", +",! c #454546", +"'! c #262525", +")! c #D9D8D8", +"!! c #C6C6C6", +"~! c #505050", +"{! c #0C0B0C", +"]! c #070707", +"^! c #A9A9A9", +"/! c #FAFDFD", +"(! c #EAEAE9", +"_! c #302825", +":! c #5B4136", +"~ c #ECA576", +",~ c #7A543B", +"'~ c #110B09", +")~ c #49494A", +"!~ c #8E908D", +"~~ c #E1DED9", +"{~ c #BBBCBC", +"]~ c #616162", +"^~ c #B5B5B5", +"/~ c #B6B6B6", +"(~ c #F6F6F4", +"_~ c #756D6A", +":~ c #1A0806", +"<~ c #7C4C33", +"[~ c #E6A376", +"}~ c #F3A169", +"|~ c #F69E60", +"1~ c #F69C5E", +"2~ c #EAA173", +"3~ c #EF9F6F", +"4~ c #F3A066", +"5~ c #EA9D6F", +"6~ c #ECA175", +"7~ c #F2A05D", +"8~ c #F4A05D", +"9~ c #F49F62", +"0~ c #EF9F68", +"a~ c #EEA267", +"b~ c #EE9E67", +"c~ c #F69E6A", +"d~ c #F69D68", +"e~ c #F29E6F", +"f~ c #E29C77", +"g~ c #9C7058", +"h~ c #54281B", +"i~ c #A6725A", +"j~ c #E8A47E", +"k~ c #DC9E78", +"l~ c #997251", +"m~ c #AB7E64", +"n~ c #6C4532", +"o~ c #A4694B", +"p~ c #E8A270", +"q~ c #EC9A60", +"r~ c #E9A068", +"s~ c #D08868", +"t~ c #82543B", +"u~ c #7D675B", +"v~ c #A3A3A2", +"w~ c #EAEFEE", +"x~ c #FBFCF9", +"y~ c #949496", +"z~ c #555457", +"A~ c #EBEAEB", +"B~ c #F2F1F0", +"C~ c #787677", +"D~ c #1C1718", +"E~ c #5B4133", +"F~ c #B38368", +"G~ c #EBA477", +"H~ c #F3A06A", +"I~ c #F79E66", +"J~ c #F69C63", +"K~ c #F39E6B", +"L~ c #EEA06D", +"M~ c #EEA16A", +"N~ c #EBA262", +"O~ c #EE9E64", +"P~ c #EF9E65", +"Q~ c #F39D6A", +"R~ c #F0A375", +"S~ c #F59E6F", +"T~ c #F89C64", +"U~ c #F39F5E", +"V~ c #EEA264", +"W~ c #EDA56F", +"X~ c #E09C73", +"Y~ c #BD7E5C", +"Z~ c #A16142", +"`~ c #704527", +" { c #23100B", +".{ c #463434", +"+{ c #B17362", +"@{ c #9C624C", +"#{ c #9E634C", +"${ c #A2624F", +"%{ c #B77F63", +"&{ c #966A4A", +"*{ c #9E6648", +"={ c #91603F", +"-{ c #68462F", +";{ c #70584C", +">{ c #806369", +",{ c #CABEB9", +"'{ c #F5F4F2", +"){ c #F9FBFB", +"!{ c #F9FBFA", +"~{ c #FAFBF7", +"{{ c #F4F2EF", +"]{ c #AFB1B2", +"^{ c #2A292F", +"/{ c #373839", +"({ c #757475", +"_{ c #C0C1C3", +":{ c #29262B", +"<{ c #180C0C", +"[{ c #533C31", +"}{ c #A77558", +"|{ c #D6966D", +"1{ c #EFA271", +"2{ c #F2A274", +"3{ c #F0A076", +"4{ c #F0A173", +"5{ c #ED9F6C", +"6{ c #F5A06A", +"7{ c #F79E68", +"8{ c #F59D6C", +"9{ c #EEA37B", +"0{ c #F19E73", +"a{ c #F3A172", +"b{ c #DDA072", +"c{ c #B48660", +"d{ c #795742", +"e{ c #53271B", +"f{ c #681E14", +"g{ c #A52E1C", +"h{ c #CA3B2A", +"i{ c #963231", +"j{ c #1B0604", +"k{ c #581512", +"l{ c #722721", +"m{ c #2C0B07", +"n{ c #45140F", +"o{ c #6B1E16", +"p{ c #9D2F23", +"q{ c #C43625", +"r{ c #C93E3C", +"s{ c #461D15", +"t{ c #8B8D89", +"u{ c #F0F8F7", +"v{ c #F7FCFB", +"w{ c #F7FAFA", +"x{ c #D4D2D0", +"y{ c #595857", +"z{ c #0B0A0C", +"A{ c #2C2B2C", +"B{ c #E7E8E8", +"C{ c #FCFBF9", +"D{ c #89898A", +"E{ c #232124", +"F{ c #130808", +"G{ c #25120A", +"H{ c #412015", +"I{ c #5E3324", +"J{ c #835847", +"K{ c #885A49", +"L{ c #98664C", +"M{ c #B3805D", +"N{ c #B97D5C", +"O{ c #B97E5C", +"P{ c #B37854", +"Q{ c #805742", +"R{ c #785544", +"S{ c #6C4E41", +"T{ c #331E14", +"U{ c #120803", +"V{ c #240403", +"W{ c #973C2D", +"X{ c #CD4B36", +"Y{ c #D74426", +"Z{ c #CA4C25", +"`{ c #7A251C", +" ] c #582512", +".] c #B8442C", +"+] c #A24232", +"@] c #4F1A0F", +"#] c #C24932", +"$] c #D34B23", +"%] c #E1481D", +"&] c #E83F1D", +"*] c #D3412C", +"=] c #3A1C17", +"-] c #C6C5BA", +";] c #F7F8F2", +">] c #F6FBFA", +",] c #EDEFEE", +"'] c #8C8A8B", +")] c #181617", +"!] c #030305", +"~] c #777777", +"{] c #F8FAF3", +"]] c #DFE1E0", +"^] c #A6A7AB", +"/] c #7C7D80", +"(] c #535354", +"_] c #2E2A2A", +":] c #32312F", +"<] c #2E2728", +"[] c #221A1A", +"}] c #302324", +"|] c #170D0E", +"1] c #0A0304", +"2] c #0C0404", +"3] c #040203", +"4] c #05050B", +"5] c #2F0605", +"6] c #BA3D24", +"7] c #E83F18", +"8] c #E33F1D", +"9] c #AF542F", +"0] c #44110C", +"a] c #933B31", +"b] c #CF4A37", +"c] c #661713", +"d] c #A03423", +"e] c #E83D1F", +"f] c #E83E18", +"g] c #E74216", +"h] c #DF441E", +"i] c #9B3827", +"j] c #524447", +"k] c #F3F6F5", +"l] c #E0E0DF", +"m] c #373435", +"n] c #040409", +"o] c #030308", +"p] c #191818", +"q] c #CECECE", +"r] c #F7FCFA", +"s] c #F3FBFA", +"t] c #FCFBF5", +"u] c #FCFDF9", +"v] c #F4F6F5", +"w] c #EDF0EF", +"x] c #F0F1EF", +"y] c #E6E6E5", +"z] c #AEABB1", +"A] c #999397", +"B] c #312F33", +"C] c #020208", +"D] c #020001", +"E] c #070202", +"F] c #060303", +"G] c #060206", +"H] c #1E0402", +"I] c #993F33", +"J] c #CE4631", +"K] c #B03E24", +"L] c #472818", +"M] c #4B3A40", +"N] c #4D1718", +"O] c #722C28", +"P] c #370E0B", +"Q] c #B7402B", +"R] c #E7401D", +"S] c #E83C1C", +"T] c #E6401B", +"U] c #CF4931", +"V] c #582317", +"W] c #938E8E", +"X] c #D7DBDB", +"Y] c #787472", +"Z] c #050202", +"`] c #030103", +" ^ c #5C5B5C", +".^ c #F2F2F1", +"+^ c #C9C9C9", +"@^ c #8E8D8C", +"#^ c #080608", +"$^ c #010002", +"%^ c #040102", +"&^ c #040103", +"*^ c #150503", +"=^ c #51241D", +"-^ c #6A3130", +";^ c #6C494D", +">^ c #B5B7B1", +",^ c #E8E7E6", +"'^ c #989296", +")^ c #6A6368", +"!^ c #220B08", +"~^ c #B7412B", +"{^ c #E34318", +"]^ c #E64216", +"^^ c #DD432C", +"/^ c #A93C36", +"(^ c #56302F", +"_^ c #C0BFBF", +":^ c #2B2D2E", +"<^ c #292829", +"[^ c #ECECEC", +"}^ c #D1D1D2", +"|^ c #818382", +"1^ c #3E3D3E", +"2^ c #040101", +"3^ c #272827", +"4^ c #908D89", +"5^ c #BAB2AC", +"6^ c #E2DBD7", +"7^ c #F5F3F2", +"8^ c #F3F7F4", +"9^ c #CED0D0", +"0^ c #201313", +"a^ c #A24033", +"b^ c #E14024", +"c^ c #E04325", +"d^ c #BA4938", +"e^ c #3F140D", +"f^ c #281A1B", +"g^ c #181816", +"h^ c #F8F9F8", +"i^ c #E8E9E9", +"j^ c #7B7B7B", +"k^ c #040202", +"l^ c #050506", +"m^ c #5E5E5F", +"n^ c #EBEDEC", +"o^ c #F6FBF9", +"p^ c #F8F9F9", +"q^ c #F4F8F4", +"r^ c #FAFAF5", +"s^ c #F6F9F8", +"t^ c #6B6766", +"u^ c #461411", +"v^ c #CA4541", +"w^ c #C84639", +"x^ c #48130F", +"y^ c #0A0504", +"z^ c #070706", +"A^ c #828181", +"B^ c #EAE9E9", +"C^ c #3F3E3F", +"D^ c #ECEDEC", +"E^ c #FAFDFC", +"F^ c #FAFCF9", +"G^ c #FBFBF5", +"H^ c #FBFBF9", +"I^ c #DDE0DE", +"J^ c #422D2C", +"K^ c #641818", +"L^ c #6F2A28", +"M^ c #1C100F", +"N^ c #080908", +"O^ c #040306", +"P^ c #040504", +"Q^ c #7E7D7E", +"R^ c #ADADAD", +"S^ c #CDCFCC", +"T^ c #D8D5D5", +"U^ c #9D9492", +"V^ c #BFBCB9", +"W^ c #464443", +"X^ c #010103", +"Y^ c #7E7E7E", +"Z^ c #C7C7C7", +"`^ c #121111", +" / c #8A8B8D", +"./ c #F6F7F6", +"+/ c #F9FCFA", +"@/ c #F4FAF9", +"#/ c #EDF6F5", +"$/ c #424242", +"%/ c #070103", +"&/ c #030001", +"*/ c #F4F4F3", +"=/ c #F6F8F6", +"-/ c #F9FBF9", +";/ c #F6FAFA", +">/ c #454445", +",/ c #020103", +"'/ c #8F8A90", +")/ c #FAFBF9", +"!/ c #F8FCF9", +"~/ c #454344", +"{/ c #7D7C7D", +"]/ c #363435", +"^/ c #EDEDED", +"// c #424142", +"(/ c #807F7F", +"_/ c #737373", +":/ c #131213", +"( c #393939", +",( c #171617", +"'( c #CFD0D0", +")( c #121112", +"!( c #C4C4C5", +"~( c #DBDADA", +"{( c #F9F9F8", +"]( c #282828", +"^( c #4B4B4B", +"/( c #8A8B8B", +"(( c #2F3031", +"_( c #868686", +":( c #DFDEDF", +"<( c #EEEDEE", +"[( c #F5F6F6", +"}( c #2A2829", +"|( c #4B4A4A", +"1( c #515051", +"2( c #6A6A6A", +"3( c #C4C2C4", +"4( c #F3F3F2", +"5( c #272727", +"6( c #737273", +"7( c #9E9E9D", +"8( c #E1E1E0", +"9( c #727272", +"0( c #8C8A87", +"a( c #E4E6E6", +"b( c #F2F2F3", +"c( c #B4B5B5", +"d( c #F3F4F4", +"e( c #A0A0A1", +"f( c #212020", +"g( c #A9A8A9", +"h( c #252425", +"i( c #C5C6C6", +"j( c #1B191A", +"k( c #B4B3B3", +"l( c #767676", +"m( c #EEEFEF", +"n( c #D0D1D1", +"o( c #6A6A69", +"p( c #807F81", +"q( c #C9C8C9", +"r( c #646465", +"s( c #F2F3F3", +"t( c #676464", +"u( c #BABABA", +"v( c #BEBEBE", +"w( c #2F2F2F", +"x( c #BFC0C0", +"y( c #2F2E2F", +"z( c #EEEFEE", +"A( c #8D8D8D", +"B( c #585859", +"C( c #DDDCDB", +"D( c #DEDDDE", +"E( c #EAEAEA", +"F( c #C1C1C1", +"G( c #C0BFC0", +"H( c #868585", +"I( c #D7D8D8", +"J( c #AFAFAF", +"K( c #757575", +"L( c #858484", +"M( c #818081", +"N( c #7F7E7F", +"O( c #878787", +"P( c #979798", +"Q( c #727172", +"R( c #3E3B3A", +"S( c #737272", +"T( c #C7C7C6", +"U( c #949494", +"V( c #5E5F60", +"W( c #807F80", +"X( c #D3D4D3", +"Y( c #DFDFDF", +"Z( c #696768", +"`( c #B9BABA", +" _ c #7C7B7A", +"._ c #858582", +"+_ c #B2B3B2", +"@_ c #595959", +"#_ c #514F4F", +"$_ c #070507", +"%_ c #7D7E7E", +"&_ c #F4F3F0", +"*_ c #EEEFEA", +"=_ c #EDF0EE", +"-_ c #EFF0EF", +";_ c #EAECEB", +">_ c #D1D2D1", +",_ c #7C7B7B", +"'_ c #3C3939", +")_ c #4D4D4F", +"!_ c #615F60", +"~_ c #676466", +"{_ c #837E7E", +"]_ c #66605D", +"^_ c #4D4340", +"/_ c #7D7A7C", +"(_ c #8D8A8B", +"__ c #777170", +":_ c #B1AFAD", +"<_ c #9C9B99", +"[_ c #A8A6A6", +"}_ c #8A8989", +"|_ c #B0AFAE", +"1_ c #908D8D", +"2_ c #888482", +"3_ c #A6A29E", +"4_ c #8B8482", +"5_ c #615E5D", +"6_ c #494846", +"7_ c #0C0B0B", +"8_ c #555651", +"9_ c #7D7D7D", +"0_ c #363434", +"a_ c #3A3535", +"b_ c #383331", +"c_ c #A19D9A", +"d_ c #EAEBEB", +"e_ c #E4E4E2", +"f_ c #DCD9D4", +"g_ c #D8CEC7", +"h_ c #B5A69F", +"i_ c #AFA7A2", +"j_ c #948B86", +"k_ c #847A77", +"l_ c #887B72", +"m_ c #877A72", +"n_ c #8A7B73", +"o_ c #705A4B", +"p_ c #705848", +"q_ c #735841", +"r_ c #765744", +"s_ c #6D4B37", +"t_ c #624531", +"u_ c #4E2D21", +"v_ c #45281E", +"w_ c #1A110A", +"x_ c #090302", +"y_ c #140C09", +"z_ c #120806", +"A_ c #3B271D", +"B_ c #5E402F", +"C_ c #7A5542", +"D_ c #3C1F18", +"E_ c #090101", +"F_ c #241813", +"G_ c #403028", +"H_ c #422C24", +"I_ c #746260", +"J_ c #534641", +"K_ c #3A2E2C", +"L_ c #92908D", +"M_ c #928D8B", +"N_ c #3D3838", +"O_ c #807A79", +"P_ c #767273", +"Q_ c #49484C", +"R_ c #110E13", +"S_ c #151314", +"T_ c #4A4847", +"U_ c #333535", +"V_ c #242528", +"W_ c #AFB2B4", +"X_ c #CACCCC", +"Y_ c #E5E6E4", +"Z_ c #F5F9F8", +"`_ c #ECEDED", +" : c #9A9A9A", +".: c #707071", +"+: c #959494", +"@: c #1D1C1D", +"#: c #5B5B5B", +"$: c #848385", +"%: c #B2B1B1", +"&: c #8B8A8B", +"*: c #3D3C3D", +"=: c #5C5C5C", +"-: c #727273", +";: c #F4F5F5", +">: c #B0ACAB", +",: c #7B736B", +"': c #6F5E55", +"): c #755740", +"!: c #A57F63", +"~: c #A47554", +"{: c #A97655", +"]: c #AE7954", +"^: c #C88E68", +"/: c #CF966D", +"(: c #D1946D", +"_: c #D19367", +":: c #D2946A", +"<: c #DE9A6D", +"[: c #ECA579", +"}: c #EBA57D", +"|: c #E6A780", +"1: c #E7A780", +"2: c #E4A67C", +"3: c #EDAC7C", +"4: c #E4A777", +"5: c #CC956B", +"6: c #B27C54", +"7: c #C38B65", +"8: c #A7795B", +"9: c #724533", +"0: c #AA826B", +"a: c #AC836B", +"b: c #A47E66", +"c: c #402617", +"d: c #7A5B42", +"e: c #9F765F", +"f: c #8D674F", +"g: c #957464", +"h: c #7F6151", +"i: c #725D4C", +"j: c #A58266", +"k: c #9A6F54", +"l: c #7A4E38", +"m: c #75503A", +"n: c #72523E", +"o: c #5E4737", +"p: c #2A1D16", +"q: c #918379", +"r: c #B3AEAC", +"s: c #D6D5D5", +"t: c #25262C", +"u: c #5A5C5F", +"v: c #AAAFB1", +"w: c #838589", +"x: c #BFC0C2", +"y: c #717272", +"z: c #2A2B2B", +"A: c #323031", +"B: c #262526", +"C: c #4C4B4C", +"D: c #EBEBEB", +"E: c #F8F7F6", +"F: c #AFACAA", +"G: c #6E5E58", +"H: c #503A32", +"I: c #765242", +"J: c #B18363", +"K: c #D0956E", +"L: c #DC9667", +"M: c #DC9768", +"N: c #E09563", +"O: c #E19260", +"P: c #ED9C64", +"Q: c #F4A469", +"R: c #F39F6A", +"S: c #F29D68", +"T: c #F3A16C", +"U: c #E59664", +"V: c #D08C62", +"W: c #BF815D", +"X: c #966343", +"Y: c #946646", +"Z: c #7D5438", +"`: c #8A593A", +" < c #915938", +".< c #9E693D", +"+< c #B17545", +"@< c #B57848", +"#< c #C78D5B", +"$< c #CF9168", +"%< c #CA8B64", +"&< c #C88B64", +"*< c #985939", +"=< c #7D412D", +"-< c #724228", +";< c #7C4A33", +">< c #7A472F", +",< c #77412C", +"'< c #804A32", +")< c #996847", +"!< c #916044", +"~< c #8B6349", +"{< c #906C57", +"]< c #6C4F3D", +"^< c #332C2A", +"/< c #5C5A57", +"(< c #201E1C", +"_< c #1F1B1E", +":< c #3B3537", +"<< c #302A2C", +"[< c #292125", +"}< c #1A1415", +"|< c #1A191B", +"1< c #272626", +"2< c #373736", +"3< c #A4A4A4", +"4< c #8C8B8B", +"5< c #E1E2E1", +"6< c #FAF9F8", +"7< c #E0DAD4", +"8< c #B2A8A4", +"9< c #807167", +"0< c #7D685B", +"a< c #856F66", +"b< c #847066", +"c< c #897366", +"d< c #7E6556", +"e< c #664639", +"f< c #6D4B3A", +"g< c #8D6750", +"h< c #BD8865", +"i< c #D99D6F", +"j< c #D1976E", +"k< c #935E43", +"l< c #7E4528", +"m< c #884F34", +"n< c #A76A42", +"o< c #C1815B", +"p< c #C98E63", +"q< c #DF9E73", +"r< c #EAA374", +"s< c #EFA572", +"t< c #F4A36E", +"u< c #F4A166", +"v< c #F3A163", +"w< c #F2A166", +"x< c #F2A06B", +"y< c #F4A26F", +"z< c #F0A572", +"A< c #EDA675", +"B< c #EBA374", +"C< c #E09C70", +"D< c #E19E72", +"E< c #E39E70", +"F< c #D69261", +"G< c #C27F52", +"H< c #C28157", +"I< c #B06D3D", +"J< c #A2663F", +"K< c #845842", +"L< c #623D31", +"M< c #452B21", +"N< c #2B1911", +"O< c #150804", +"P< c #0E0402", +"Q< c #110807", +"R< c #151011", +"S< c #201E1F", +"T< c #292828", +"U< c #090708", +"V< c #1E1E1E", +"W< c #FDFCFB", +"X< c #F0EDEC", +"Y< c #DFD9D5", +"Z< c #AAA5A3", +"`< c #756C64", +" [ c #544536", +".[ c #2F170D", +"+[ c #744F3C", +"@[ c #DFA781", +"#[ c #EBA578", +"$[ c #F1A674", +"%[ c #F2A06C", +"&[ c #F6A060", +"*[ c #F49E5F", +"=[ c #F3A061", +"-[ c #EFA163", +";[ c #F59F60", +">[ c #F49D66", +",[ c #F49E69", +"'[ c #F0A168", +")[ c #EB9F6E", +"![ c #EBA272", +"~[ c #EF9D62", +"{[ c #F39F66", +"][ c #F6A064", +"^[ c #F6A369", +"/[ c #F0A470", +"([ c #F0A87A", +"_[ c #E6A274", +":[ c #D5986F", +"<[ c #B9865F", +"[[ c #91694D", +"}[ c #734F3B", +"|[ c #412B20", +"1[ c #707171", +"2[ c #4F4E4E", +"3[ c #A3A2A2", +"4[ c #C4C3C3", +"5[ c #F5F9F9", +"6[ c #F7FBFA", +"7[ c #F6FCFB", +"8[ c #F8FCFC", +"9[ c #DBDCDB", +"0[ c #494544", +"a[ c #45342B", +"b[ c #6A503D", +"c[ c #99674A", +"d[ c #B1724C", +"e[ c #D79062", +"f[ c #F5A773", +"g[ c #F5A36D", +"h[ c #F49D5F", +"i[ c #F5A065", +"j[ c #F59F6B", +"k[ c #EFA16C", +"l[ c #EDA070", +"m[ c #F2A16A", +"n[ c #F2A26C", +"o[ c #F1A062", +"p[ c #EFA05E", +"q[ c #F3A366", +"r[ c #EFA367", +"s[ c #F1A772", +"t[ c #EEAB80", +"u[ c #DDA47C", +"v[ c #794D35", +"w[ c #0B0808", +"x[ c #C5C5C4", +"y[ c #FCFDF8", +"z[ c #D2CFD1", +"A[ c #9F9B9A", +"B[ c #6F6A69", +"C[ c #7F7975", +"D[ c #766C64", +"E[ c #655247", +"F[ c #554234", +"G[ c #7B5843", +"H[ c #8D6249", +"I[ c #AF7A5D", +"J[ c #B77E5A", +"K[ c #D39875", +"L[ c #D89770", +"M[ c #E99D6C", +"N[ c #EEA677", +"O[ c #EEA375", +"P[ c #EFA175", +"Q[ c #EF9E6F", +"R[ c #F3A06D", +"S[ c #F49F6D", +"T[ c #F09E6A", +"U[ c #F0A26E", +"V[ c #EFA474", +"W[ c #D08B5F", +"X[ c #D49167", +"Y[ c #D99A72", +"Z[ c #BE8867", +"`[ c #AE7A55", +" } c #8D5A44", +".} c #9B7055", +"+} c #7B5E4A", +"@} c #625042", +"#} c #5F524B", +"$} c #827C77", +"%} c #F1F3F2", +"&} c #F1F0ED", +"*} c #E0DBD9", +"=} c #D7D2CC", +"-} c #B4ACA6", +";} c #A89C97", +">} c #736A64", +",} c #43342F", +"'} c #2C1C17", +")} c #432D1E", +"!} c #503729", +"~} c #735340", +"{} c #916654", +"]} c #92624F", +"^} c #B0795E", +"/} c #C28364", +"(} c #A9755B", +"_} c #8D6149", +":} c #8D6550", +"<} c #664031", +"[} c #533628", +"}} c #41271C", +"|} c #735C54", +"1} c #786964", +"2} c #7A6D69", +"3} c #ADA099", +"4} c #ACA4A2", +"5} c #E0DCD5", +"6} c #E7E2DE", +"7} c #EDECE9", +"8} c #F3F3F1", +"9} c #E6E7E6", +"0} c #C5C6C3", +"a} c #C3C4C0", +"b} c #B9B9B5", +"c} c #948F8A", +"d} c #968F87", +"e} c #968E85", +"f} c #A39386", +"g} c #A99283", +"h} c #9F8E83", +"i} c #998C83", +"j} c #978F87", +"k} c #ACA5A0", +"l} c #C4BFBC", +"m} c #D3D2D0", +"n} c #F9F9F7", +"o} c #F7FDFC", +"p} c #F7FAF9", +"q} c #F5FCFB", +". . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . + @ # $ % & * = . . . . . . . . - ; > . % = ; , ' ) % & % ! > . . . . . . . . . . ", +". . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ) ~ { ] ^ / > ( ) . . . . . . . . - _ ] . . > : ' . . ) . . = ) . . . . . . . . . . ", +". . . . . . . . . . . . . . . . . . . . . . . . . . . . . . = < [ } | 1 2 3 . . . . . . . . - ; ; ] . ) ] > . . . . . . ) . . . . . . . . . . . ", +". . . . . . . . . . . . . . . . . . . . . . . . . . . . . . % 4 5 6 7 8 9 0 % . . . . . . . . ] ( . % . a ] ( b ] ) > ) . . . . . . . . . . . . ", +". . . . . . . . . . . . . . . . . . . . . . . . . . . . c d e f g h i j k l ] . % m . a & d ( % & * d > & n o p q r s ] . . . . . . . . . . . . ", +". . . . . . . . . . . . . . . . . . . . . . . . . . . d 0 t u v w x y z A B ; ] & & & % & . a & & C 2 D E F G H I J - > . . . . . . . . . . . . ", +". . . . . . . . . . . . . . . . . . . . . . . . . . . & & K L M N O P Q R S T * m & % U d * V W X Y Z ` ...+.@.#.% - s ) ) . . . . . . . . . . ", +". . . . . . . . . . . . . . . . . . . % $.% . . ( . $.* %.&.*.=.-.;.>.,.'.).!.~.{.].^./.(._.:.<.[.}.|.1.2.3.4.5.6.( ( > a ' . . . . . . . . . . ", +". . . . . . . . . . . . . . . . . . . d & d & s . & 7.* 8.9.0.a.b.c.d.e.f.g.h.i.j.k.l.m.n.o.p.q.r.s.t.u.v.w.x.y.z.A.% % B.C.. . . . . . . . . . ", +". . . . . . . . . . . . . . . . . . . % % c D.E.F.G.H.% I.J.K.L.M.N.O.P.Q.R.S.T.U.V.W.X.Y.Z.`. +.+++@+#+$+%+&+*+=+-+C.;+& % . . . . . . . . . . ", +". . . . . . . . . . . . . . . . . . . 9 >+,+'+)+!+~+{+]+^+/+(+_+:+<+[+}+|+1+2+3+4+5+6+7+8+9+0+a+b+c+d+e+f+g+h+-+i+& A.j+d % . . . . . . . . . . ", +". . . . . . . . . . . . . . . % & & & k+l+m+n+o+p+q+r+s+t+u+v+w+x+y+z+A+B+C+D+E+F+G+H+I+J+K+L+M+N+O+P+Q+R+S+T+U+V+W+X+j+m . . . . . . . . . . . ", +". . . . . . . . . . . . . . . B.C Y+Z+`+ @.@+@@@#@$@%@&@*@=@-@;@>@,@'@)@!@~@{@]@^@/@(@_@:@<@x+[@}@|@1@2@3@4@5@6@7@8@9@0@a@& . . . . . . . . . . ", +". . . . . . . . . . . . . . . . & b@+@c@d@e@f@g@h@i@j@k@l@m@n@o@p@q@r@s@t@u@v@w@x@y@z@A@B@C@D@E@F@G@H@I@J@K@L@M@N@O@P@Q@R@% . . . . . . . . . . ", +". . . . . . . . . . . . . . . & & S@T@U@V@W@X@Y@Z@`@ #.#+#@###$#%#&#*#=#-#;#>#,#'#)#!#~#L.{#]#^#/#(#_#:#<#[#}#|#1#2#3#4#5#6#. . . . . . . . . . ", +". . . . . . . . . . . . . . . . ( 7#8#9#0#X@a#b#c#d#e#f#g#h#i#j#k#l#m#n#o#p#q#r#s#t#u#v#w#x#y#z#A#B#C#D#E#F#G#H#I#J#K#L#M#N#' . . . . . . . . . ", +". . . . . . . . . . . . . . . . & O#P#Q#R#S#T#U#U#U#V#W#U#X#Y#Z#`# $.$+$@$#$$$%$&$*$=$-$;$Z.>$,$'$)$!$~${$]$^$/$($_$:$<$[$}$. . . . . . . . . . ", +". . . . . . . . . . . . . . . d . |$1$2$3$4$5$U#U#U#W#W@6$7$U#6$c#8$S#9$0$a$b$c$d$e$f$g$h$i$j$k$l$m$n$o$p$q$r$s$t$u$v$w$x$y$. . . . . . . . . . ", +". . . . . . . . . . . . . . . . . & z$A$2$B$X#U#W#U#U#W@Y#W#W#d#W@C$6$D$E$T#F$G$H$I$J$K$L$M$N$O$P$Q$R$S$T$U$V$W$X$Y$Z$`$ %.%. . . . . . . . . . ", +". . . . . . . . . . . . . . . . . . d +%@%#%$%W#U#W#W#U#U#7$U#W#7$%%Y#6$U#D$&%*%=%-%;%>%,%'%)%!%~%{%]%^%/%(%_%:%<%[%}%|%1%2%F.C & . . . . . . . ", +". . . . . . . . . . . . . . . . . . . a W@3%i@4%Y#W#C$U#U#U#U#U#U#W#7$7$%%V#5%6%7%8%9%0%a%b%c%d%e%f%g%h%i%j%k%l%m%n%o%p%q%r%s%* t%a . . . . . . ", +". . . . . . . . . . . . . . . . . . . c B.u%v%w%x%T#W#U#U#U#U#U#U#U#%%W#U#y%z%A%B%C%D%E%F%G%H%I%J%K%L%M%N%O%P%Q%R%S%T%U%V%W%X%Y%Z%. & & % . . . ", +". . . . . . . . . . . . . . . . . . . c c C `% &.&+&W@U#U#U#U#C$U#U#W#E$@&#&$&%&D%e#&&e#*&7$=&-&;&P#>&,&'&)&!&<%~&{&]&^&/&(&_&:&<&Y%% % % . . . ", +". . . . . . . . . . . . . . . . . . . . % . t%[&}&|&1&X#2&V#W#W#y%3&4&5&6&7&0$8&9&0&C$d#a&b&c&d&e&f&g&h&i&j&k&l&m&n&o&p&q&r&s&t&u&v&C m w&) . . ", +". . . . . . . . . . . . . . . . . . . . . . . & x&y&z&A&B&C&V#Y#D&E&F&G&H&I&.@l@J&K&L&M&N&d#O&5$P&Q&R&S&T&U&V&W&X&Y&Z&`& *.*+*@*#*$*a ( ( . . . ", +". . . . . . . . . . . . . . . . . . . . . . . %*c &***=*-*E$d#U#Y#;*>*Z%,*'*)*!*~*{*]*s%^*X@a&/*(*_*:*<*[*}*|*1*2*3*4*5*6*7*8*9*0*a*. % = . . . ", +". . . . . . . . . . . . . . . % . . . . . . . d & c b*i@c*d*E$e*f*g*h*. k & d i*j*k*l*m*n*o*p*F&q*r*X#s*t*u*v*w*x*y*z*A*m+B*C*D*E*F*& & % % . . ", +". . . . . . . . . . . . . . . . & % . % m & % . . . . u%A$G*H*I*J*K*$.& c m C d 0 d Z%L*6&M*N*F&O*P*Q*R*S*T*U*V*W*X*Y*Z*`* =.=+=@=E&. . . . . . ", +". . . . . . . . . . . . . . . % & c . % m & . . . . . & h*#=#%$=%=9 &=k *=& ==C & m . d -=;=>=,='=)=!=~={=]=^=/=(=_=:=<=<=[=}=.@|=1=. . . . . . ", +". . . . . . . . . . . . . . . d % ( % 0 9 * d . . . % & C k 2=3=4=5=6=7=-+8=9=0=& . a %*d a=b=c=d=e=f=g=h=i=j=k=l=q+m=n=o=p=Q#q=r=% . . . . . . ", +". . . . . . . . . . . . . . . - > s=t=u=v=w=x=A y=( & % ) z=A=B=C=D=E=F=*=G=H=I=% C % m & J=K=L=c=M=N=O=P=Q=R=S=T=U=V=W=X=Y=Z=`= -%.) = . . . . ", +". . . . . . . . . . . . . . . $ .-+-@-#-$-%-&-*-=---;->-,-'-)-!-~-{-]-^-/-(-_-:-d % . . . d <-n+n+ @[-}-|-1-2-G=3-4-l*~*5-6-7-8-9-0-w&s > ) . . ", +". . . . . . . . . . . . . . . a-b-c-d-e-f-g-h-i-j-k-l-m-n-o-p-q-r-s-t-u-v-w-x-y-. % $.. . . z-n+A-n+ @B-}-C-D-E-F-G-H-I-J-K-L-M-N-O-9 ! P-$.. . ", +". . . . . . . . . . . . . . ' Q-R-S-T-U-V-W-X-Y-Z-`- ;.;+;@;#;$;%;&;*;=;-;;;>;9 a & . . . . ,; @n+n+Q# @';);!;~;{;];^;{;/;(;_;:;<;1-k G.& . . . ", +". . . . . . . . . . . . & . j+[;};|;1;2;3;4;5;6;7;8;9;0;a;b;c;d;e;f;g;h;i;j;&=m % a . . . . k*n+n++@Q#k; @{;x%^;l;m;%=n;o;p;q;r;s;t;d % C . . . ", +". . . . . . . . . . . . & i*u;v;w;x;y;z;A;B;C;D;E;F;G;H;I;J;K;d;L;M;N;O;P;Q;R;. . . . . . . S;n+n+n+T@c=Q#T;U;V;W;X;Y;Z;`; >.>+>@>& . ( . . . . ", +". . . . . . . . . . . % C . 4&#>$>%>&>*>=>->;>>>,>'>)>,>!>)>)>~>{>]>^>/>(>_>:>. . . . . . . k*n+n+ @+@n+Z*<>;*[>}>|>1>t=h@2>3>4>5>6>d ^ ( ) . . ", +". . . . . . . . . . . % % 7>H&8>9>0>a>b>c>d>e>9;7;f>g>h>i>h>j>k>l>m>n>o>p>q>r>) . . . . . . S;n+n+n+T@+@s>t>t=0#u>v>w>x>y>z>A>B>C>D>~ ] > . . . ", +"] . . . . ) ( ~ ] j+;+E>-+F>G>H>I>J>K>L>M>L>N>G;O>O>P>Q>I;Q>R>S>T>U>K>V-V>W>X>Y>~ * ( . ( G.,;Z>`>n+c= @ ,.,+,@,#,';$,%,&,*,=,-,a$;,`#>,) . . . ", +"a-. . ' ' . > E>=+,,',),!,~,{,],^,/,(,/,_,G;/,:,R><,[,R>_,},<,|,R>_,1,R>R>[,2,3,4,X@5,6,7,8,9,0,a,+@+@b,c,d,e,f,g,h,i,j,k,A$l,m,n,o,p,q,& . . . ", +"C.. . % . |$, r,s,t,u,v,w,x,y,z,&;A,B,C,D,E,E,D,<,F,F,_,D,D,G,R>8;R>&;/,_,H,I,J,K,L,M,N,O,P,Q,R,S,T,U,}=V,W,X,B-Y,Z,`, 'w>.'f=+'@,0*@'#'$'. . . ", +"C.% d ( % -+C.w&%'&'*'='-';'>','''V>)'!'~'~'W-R><,{'_,R>D,{'R>|,D,R>|,R>{'{']'G,^'/'('_':'<'['}'|'Q#1'2'3'4'5'6'6&7'8'9'{;0'a'6&b'~*c'';d'. . . ", +"-+& 0 w&3 e'f'g'h'i'j'k'l'm'n'o'o'p'q'r's't'u'v'<,/,D,:,_,D,D,D,R>R>H,G,w'x'y'z'A'~>B'C'D'E'F'G'H'+@+@I'J'K'L'L';,k,M'N'O'I P'Q'R'S'T'U'V'. . . ", +". . % . H.W'X'Y'Z'`' ).)+)@)#)$)%)D,&)*)=)-);)d;D,>)*;R>D,R>[,{'R>,)R>')u'/,))!)o>q'~){)])^)/)()_)T@:)<)[)})|)1)2)3)s>4)5)6)w%7) @I&8)J-9). . . ", +"] . . % 0)a)b)c)d)e)f)g)h)i)j)k)/,D,c>l)O>m)n)o)p)q)&;_,{'_,_,,)F,<,')A,r)q)s)t)u)v)w)x)y)<,z)A)B)Q#C)D)E)F)G)H)%.I)T'J)E= @T@n+ @9#Q#9'K)% . . ", +"; L)|$e'M)N)O)P)Q)R)S)T)U)V)7;_,,)E,W-_,W)X)Y)Z)`)&;F,8;8;F,D,_,/,{'&;,) !.!+!@!#!$!O;%!~>&!*!=!B) @-!;!>!,!'!)!C=% h*!!~!{!Q#c=n+m+]!^!& . . . ", +"> . /!f'(!_!:!1!2!3!4!8;5!G;6!7!8!9!0!a!b!c!d!e!d>f!g!h!i!j!k!l!m!n!o!p!q!r!s!t!a>u!v!w!A*x!y!z!A!B!& & . |$c p*I-H=+@Z*C!Z%% . . . ", +"] ( ) ( m D!E!F!G!H!e>I!!'<,J!K!L!M!N!O!P!Q!R!S!T!U!V!W!''C,X!Y!Z!`! ~.~+~@~#~$~%~&~*~=~-~;~>~,~'~)~!~~~m {~]~t%& a . . . & ==Y#^~/~J=t%d . . . ", +"> . A./!*=(~_~:~<~[~}~|~1~F;2~3~X!!'=)4~G;5~6~7~8~9~0~a~b~c~d~e~f~g~h~i~j~k~l~m~n~o~p~q~r~s~t~u~v~w~~ ; x~y~z~A~% ) . . . % . & C d d . a . . . ", +"- ) ) A.E>m B~C~D~E~F~G~H~I~J~K~L~M~B;N~O~P~Q~R~S~T~U~V~W~X~Y~Z~`~ {.{+{@{#{${%{&{*{={-{;{>{,{'{){!{~{{{]{^{/{({9 & . . . & . % d . % & d . . . ", +"= . . A.A., , t%_{:{<{[{}{|{1{2{3{4{5{M~6{7{8{9{0{a{b{c{d{e{f{g{h{i{j{k{l{m{n{o{p{q{r{s{t{u{v{w{e'C x{y{z{Z>v*A{B{% & & . . . . % . . % . . . . ", +"= . . . . A.' C{3 (!D{E{F{G{H{I{J{K{L{M{N{O{P{Q{R{S{T{U{V{W{X{Y{Z{`{ ].]+]@]#]$]%]&]*]=]-];]>]/!,]'])]!]T,Z*n+Z*~]9 . . % $.. . . . . . . . . . ", +". . . ) ) = ) ^ {]x~,,]]^]/](]_]:]<][]}]|]1]2]3]g&c=4]4]5]6]7]8]9]0]a]b]c]d]e]f]g]h]i]j]k]r l]s%m]_-n]o] @ @n++@p]q]d d d . . . . . . . . . . . ", +". . . > ] ] = r]s]E>: t]u]0 v]w]x]y]z]A]B]z*C]D]E]F]A*G]H]I]J]K]L]M]N]O]P]Q]R]S]T]U]V]W]X]Y]T;_-Z]`]o]z*c=Q# @Q#c= ^c d % % . . . . . . . . . . ", +". . . . . . . $.f'j+] m ] ( .^+^@^Y,@=#^Z>n+$^%^L= =Z*&^*^=^-^;^>^,^'^)^!^~^{^]^^^/^(^_^:^-@n+n+n+n+n+n+n+n+n+n+n+<^[^& $.. . . . . . . . . . . ", +". . . . . . . % & d & d }^|^1^_-n+ @$^n+n+n+n+2^+@Q#U,3^4^5^6^7^8^t m 9^0^a^b^c^d^e^f^g^ @9#n+n+n+n+n+n+n+n+n+n+n+_-!!. d . . . . . . . . . . . ", +". . . . . . . % h^d i^j^**Q# @ @n+ @ @ @n+n+n+k^c=l^m^n^C.o^p^|$q^r^i*s^t^u^v^w^x^y^Z*v*Q#z^n+n+n+n+n+n+n+n+n+n+n+n+A^% a % . . . . . . . . . . ", +". . . . . . . & % B^v=U,c=c= @$^$^n+ @n+n+n+n+m++@C^D^m E^;+i+a F^G^H^E>I^J^K^L^M^N^Z*O^c=P^n+n+n+n+n+n+n+n+n+n+n+n+Q^& . . . . . . . . . . . . ", +". . . . . . . . . R^q+ @n+n+n+n+n+n+n+n+n+n+n+m+#%S^C ,,i*& . % ) - - -+v{T^U^V^W^w!X^$^n+D]n+n+n+n+n+n+n+n+n+n+n+n+Y^. . . . . . . . . . . . . ", +". . . . . . . . & Z^`^n+n+n+n+n+n+n+n+n+n+n+n+_& /./D.( * C d . . = P-+/j+a @/#/$/%/Z>n+n+&/n+n+n+n+n+n+n+n+n+n+n+n+Y^. . . . . . . . . . . . . ", +". . . . . . . % c */G& @n+n+n+n+n+n+n+n+n+n+n+c@2%i*=/-/-+% |$( $.. ] w&] % ;/@/>/%^,/n+T@&/n+n+n+n+n+n+n+n+n+n+n+n+Y^. . . . . . . . . . . . . ", +". . . . . . . . m C E&8)n+n+n+n+n+T@T@T@T@n+T,'/d )/!/!{E>A.] ) & . $.) ] ) % H^~/n+n+n+n+n+n+n+n+n+n+n+n+n+n+n+n+n+{/. . % . . . . . . . . . . ", +". . . . . . . . . % ./t=M*+@c=c=+@c= @n+Q#Z*]/^/c ) m . . . . . . . . . . . . C //n+n+n+n+n+n+n+n+n+n+n+n+n+n+n+n+n+(/% % . . . . . . . . . . . ", +". . . . . . . . & . % ==U#_/:/U, @c=Z*T@ @X%R@m . . . . . . . . . . . . . . . . . . . % % *=!!q/n+n+n+n+n+n+n+n+n+n+n+n+n+n+ =+^& . & . . . . . . . . . . ", +". . . . . . . . . . . % c B.r/v%o/. m . . . . . . . . . . . . . . . . . . . . % . ==6/T@ @T@n+n+n+n+n+n+n+n+n+n+ @s/%.& & . . . . . . . . . . . ", +". . . . . . . . . . . % m t/u/#$-=d & . . . . . . . . . . . . . . . . . . . . . . . v/w/Q# @n+n+n+n+n+n+n+n+n++@ @Z,B.. & . . . . . . . . . . . ", +". . . . . . . . . . . a 9 x/y/z/& d & . . . . . . . . . . . . . . . . . . . . . . . z/R'n+m+n+n+n+n+n+n+n+n+c= @4>A/. . % . . . . . . . . . . . ", +". . . . . . . . . . . % B/C/D/% % & m . . . . . . . . . . . . . . . . . . . . . . % & d*n+ @n+n+n+n+n+n+n+$^+@E/F/9 % % d . . . . . . . . . . . ", +". . . . . . . . . . . ' G/S&4=. . . . . . . . . . . . . . . . . . . . . . . . . . . & H/B-+@n+n+n+n+n+n+n+ @c=J-I/& d i*% . . . . . . . . . . . ", +". . . . . . . . . . . % J/:/Y%. . . . . . . . . . . . . . . . . . . . . . . . . . . C 9 K/Z*n+n+n+n+n+n+n+n+-@L/M/N/d C % . . . . . . . . . . . ", +". . . . . . . . . . . . R#O/P/. . . . . . . . . . . . . . . . . . . . . . . . . . . d d Q/[-n+n+n+n+n+n+n+n+c@R/m/w>%.a . . . . . . . . . . . . ", +". . . . . . . . . . . . S/U,K&% % . . . . . . . . . . . . . . . . . . . . . . . . . . d % o/-@n+n+n+n+n+n+n+]!T/U/q/V/d % % . . . . . . . . . . ", +". . . . . . . . . . . % W/Z*X/./c C a . . . . . . . . . . . . % & d d & C C % . m % a % % Y/Z/n+n+n++@ @n++@Q#`/ ( @7&% i*% . . . . . . . . . . ", +". . . . . . . . . . . & J=L'=*.(% d & . . . . . . . . . . . & & m t +(k d k m % . & % % k @(n+n+n+n+T@n+n+ @T@T@ @Z*v/& % . . . . . . . . . . . ", +". . . . . . . . . . . & K)#(-@$(^/% & . . . . . . . . . . . a a C k %(==& d c C % d . m &(B*n+n+n+n+E/ @Q# @n+ @n+3)U#. i*. . . . . . . . . . . ", +". . . . . . . . . . . . d %.*(_-#'k d . . . % . . . . . . . . a & & % *==(-(R^*=& & . ;(>(n+n+n+n+n+n+n+.@Y;n+ @T@,(J=& a % . . . . . . . . . . ", +". . . . . . . . . . . % d c '()(7)p/c a & & & . . . . % d & d c % c . p^!(~(N/{(F.d c a*](c=n+n+n+ @c=m+^(/(n+n+c=((;(% % . . . . . . . . . . . ", +". . . . . . . . . . . . & C k _(2$#%:(a % C % . . . . % . d B.m . a k % % m & h*<(a & [(O' @n+n+n+n+n+2$!*}( @T@+@|(9 % % . . . . . . . . . . . ", +". . . . . . . . . . . . % % 0 ;(1( @2(2%d . $.. . . . m C v]3(7=d m 4(i*d & % % m & % k n;*-n+n+n+n++@5(6(m+n+n+2'7(& . & . . . . . . . . . . . ", +". . . . . . . . . . . % % % & & 8(2> @7&p^& & & h*% . d +^9(0(a(b(c(2/^/a d %.c % % d(& i*e(=*O/O/O/f(g(h(c=n+c=A{2%. % . . . . . . . . . . . . ", +". . . . . . . . . . . . . . . % d i(j(M*k(i*d ==l(#=m(& n(P/V;o(S;[&[ %*Y%#=p(2%K)q(r(s(2%t(+^u(v()~v>w(_-c=Z>#%5>!{. . . . . . . . . . . . . . ", +". . . . . . . . . . . . . . . & d d x(y(d/^~z/i*z(A(B(O=C(l/D(Z%E(F(G(H(d*7=I(J(K(L(5>+&2/M(N(;*O(-@@=m+ @T@.@P(% $.. . . . . . . . . . . . . . ", +". . . . . . . . . . . . . . . % c *={(U#s+O/U@Q(x&==^/c'R(S(T(U(V(W(X(Y({~Z(({V@`( _._+_S@Z,@_$=:/Z;#_m*Z*$_%_F.i*& . . . . . . . . . . . . . . ", +") % f'/!v{B.$.' ) . % ] ) ] ] &_*_=_-_;_>_,_'_T,G*)_!_~_{_]_^_`*/_(___:_<_[_}_|_1_2_3_4_5_6_7_8_9_1^0_a_b_c_F.. . k U+d_t%. . 9 Y+p^% L)( % $.% ", +"H^% B.s,e_f_g_h_i_i_j_k_l_m_n_o_p_q_r_s_t_u_v_w_x_y_z_A_B_C_D_E_F_G_H_I_J_K_L_M_N_O_P_G&Q_R_S_T_U_V_W_X_Y_Z_`_ :.:+:@:w%#:$:%:&:*:=:9(-:5)y%;:& ", +"{(F.>:,:':):!:~:{:]:^:/:(:_:::<:[:}:|:1:2:3:4:5:6:7:8:9:0:a:b:c:d:e:f:g:h:i:j:k:l:m:n:o:p:q:r:s:s%t:u:v:w:x:y:z:U/2'w/Q#c=n+c=Z*m+{!A:B:7_C:D:C ", +"& E:F:G:H:I:J:K:L:M:N:O:P:H,Q:R:S:M>T:U:V:W:X:Y:Z:`: <.<+<@<#<$<%<&<*<=<-<;<><,<'<)vA.E^E^. . $.W>*>&[*[S>=[-[i>;[*)>[,[C, !'[)[![|!%)~[{[][^[/[([_[:[<[[[}[|[3]c=$,1[2[3[4&A/H/4[a&c . . % . . . ", +". ' . ' E^, A.e'/!C.C.r,5[6[7[8[9[0[a[b[c[d[e[z,f[g[[!l)R>K!>)h[i[j[S:X!C,M>k[l[L~K!R>m[I;n[o[p[q[r[s[t[u[v[w[1^x[9 |$& c % i*& d m . . . . . . ", +") . ) - > 3 - ; - y[> ] > * & c & 4(z[A[B[C[D[E[F[G[H[I[J[K[L[M[N[O[P[Q[R[S[x},}'})}!}~}{}]}^}/}(}_}:}<}[}}}|}1}2}3}4}5}6}7}8}' . . . . % . . . % . . . . . . . . . ", +". . . . . . . . . . . . . . . . . . . . . . . % % d % . c 9}0}a}b}c}d}e}f}g}h}i}j}k}l}m}n}B.% . ) * . . . . . . . . . . . . . . . . . . . . . . ", +". . . . . . . . . . . . . . . . . . . . . . . . % m & & & c . 0 E^A./!o}p}H.F^P-$.. ' e'q}7[B.* ( % . . . ) . . . . . . . . . . . . . . . . . . "}; From ed6378d41108b994df697090b9b37f45c2041d9e Mon Sep 17 00:00:00 2001 From: Ciprian Gal Date: Mon, 14 Jan 2019 08:58:42 -0500 Subject: [PATCH 043/137] look after rootfiles created by pan not the raw data --- panguin/src/panguinOnlineConfig.cc | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/panguin/src/panguinOnlineConfig.cc b/panguin/src/panguinOnlineConfig.cc index 567a2a916..f69e0d329 100644 --- a/panguin/src/panguinOnlineConfig.cc +++ b/panguin/src/panguinOnlineConfig.cc @@ -517,17 +517,17 @@ void OnlineConfig::OverrideRootFile(UInt_t runnumber) protorootfile.ReplaceAll("XXXXX",runnostr); rootfilename = protorootfile; } else { - string fnmRoot="/adaq2/data1/apar/"; - if(getenv("QW_DATA")) - fnmRoot = getenv("QW_DATA"); + string fnmRoot="/adaq1/work1/apar/japanOutput/"; + if(getenv("QW_ROOTFILES")) + fnmRoot = getenv("QW_ROOTFILES"); else - cout<<"QW_DATA env variable was not found going with default: "<< fnmRoot< Date: Mon, 14 Jan 2019 09:13:15 -0500 Subject: [PATCH 044/137] let -f just accept full path and file name --- panguin/src/panguinOnlineConfig.cc | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/panguin/src/panguinOnlineConfig.cc b/panguin/src/panguinOnlineConfig.cc index f69e0d329..827fbe72d 100644 --- a/panguin/src/panguinOnlineConfig.cc +++ b/panguin/src/panguinOnlineConfig.cc @@ -32,11 +32,10 @@ OnlineConfig::OnlineConfig(TString anatype) // Loads up the configuration file, and stores it's contents for access. confFileName = anatype; - confFileName += ".cfg"; + //confFileName += ".cfg";//Not sure what this would be needed DELETEME cg fMonitor = kFALSE; fFoundCfg = kFALSE; - // ifstream *fConfFile = new ifstream(confFileName.Data()); fConfFile = new ifstream(confFileName.Data()); if ( ! (*fConfFile) ) { cerr << "OnlineConfig() WARNING: config file " << confFileName.Data() << " does not exist" << endl; From 16556ef86bdac0edee938eeef91a3de39b92d2da Mon Sep 17 00:00:00 2001 From: Ciprian Gal Date: Mon, 14 Jan 2019 09:27:52 -0500 Subject: [PATCH 045/137] default summary plots printed in pdf --- panguin/src/panguinOnline.cc | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/panguin/src/panguinOnline.cc b/panguin/src/panguinOnline.cc index 75a910246..e5ab33476 100644 --- a/panguin/src/panguinOnline.cc +++ b/panguin/src/panguinOnline.cc @@ -900,13 +900,14 @@ void OnlineGUI::TreeDraw(vector command) { void OnlineGUI::PrintToFile() { // Routine to print the current page to a File. - // A file dialog pop's up to request the file name. + // A file dialog pops up to request the file name. fCanvas = fEcanvas->GetCanvas(); gStyle->SetPaperSize(20,24); static TString dir("printouts"); TGFileInfo fi; const char *myfiletypes[] = { "All files","*", + "Portable Document Format","*.pdf", "PostScript files","*.ps", "Encapsulated PostScript files","*.eps", "GIF files","*.gif", @@ -989,7 +990,7 @@ void OnlineGUI::PrintPages() { filename.Prepend(plotsdir+"/"); filename += "_pageXXXX.gif"; } - else filename += ".ps"; + else filename += ".pdf"; TString pagehead = "Summary Plots"; if(runNumber!=0) { From 622f88a494ba3b78968f08d738fd4ae9dfb90a4c Mon Sep 17 00:00:00 2001 From: Ciprian Gal Date: Mon, 14 Jan 2019 09:28:09 -0500 Subject: [PATCH 046/137] add ps pdf output to ignore --- .gitignore | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.gitignore b/.gitignore index 20a666b63..588726046 100644 --- a/.gitignore +++ b/.gitignore @@ -51,6 +51,8 @@ Doxygen/html *.db *.txt *.png +*.pdf +*.ps #tmp files *~ From 94461b8c09c63c216fb49062c13f50ac9d076f28 Mon Sep 17 00:00:00 2001 From: Ciprian Gal Date: Mon, 14 Jan 2019 09:30:50 -0500 Subject: [PATCH 047/137] basic instructions --- panguin/README.md | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) create mode 100644 panguin/README.md diff --git a/panguin/README.md b/panguin/README.md new file mode 100644 index 000000000..8200e46f5 --- /dev/null +++ b/panguin/README.md @@ -0,0 +1,30 @@ +# PANGUIN + +Simple program that reads a configuration file and plots from a file. Searches for trees and branch names to find the correct tree. + +If you have your QW_ROOTFILES env set it will search for a file with the correct run number in that folder assuming the format prexXXX_####.root, where XXX is the configuraiton (for now we have CH, INJ, ALL). + +This has been tested to compile on adaq3 using cmake. + +## Use +Running without arguments will load the macros/default.cfg macro and run that. + +### f option +``` +./build/panguin -f path/to/nameOfAna.cfg +``` +This will read in the configuration files and execute the commands within. + +### r option +``` +./build/panguin -r XXXX +``` + where XXXX is your run number. This will load the default.cfg macro (if you want to run your own macro use the -f option as well) and look for your run number as explained above. + +### P option +``` +./build/panguin -P +``` + This can(should) be used in conjuction with the previous options. It will use your config file (or the default) to print a file called summaryplots.pdf with plots generated from the rootfile it reads. + + From 141ce1b3aba910069822374900de62a06c8aff96 Mon Sep 17 00:00:00 2001 From: Wouter Deconinck Date: Wed, 16 Jan 2019 13:49:19 -0500 Subject: [PATCH 048/137] Ignore SetupFiles/SET_ME_UP.* --- .gitignore | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.gitignore b/.gitignore index 20a666b63..c9e9007c3 100644 --- a/.gitignore +++ b/.gitignore @@ -55,3 +55,6 @@ Doxygen/html #tmp files *~ z_* + +# setup files +SetupFiles/SET_ME_UP.* From 78acf777414b37fec731eb4969019e7871b52909 Mon Sep 17 00:00:00 2001 From: Wouter Deconinck Date: Wed, 16 Jan 2019 17:53:29 -0500 Subject: [PATCH 049/137] Bunch of new files for the Podd FindROOT to work. --- cmake/QwAnalysisConfig.cmake.in | 16 ++ cmake/modules/CMakeEnv.cmake | 192 ++++++++++++++++ cmake/modules/CompileInfo.cmake | 48 ++++ cmake/modules/FindROOT.cmake | 290 +++++++++++++++++++++++++ cmake/modules/WriteProjectConfig.cmake | 80 +++++++ cmake/scripts/mk_rootdict.sh | 96 ++++++++ evio/include/THaCodaDataLinkDef.h | 0 evio/include/THaCodaFileLinkDef.h | 0 8 files changed, 722 insertions(+) create mode 100644 cmake/QwAnalysisConfig.cmake.in create mode 100644 cmake/modules/CMakeEnv.cmake create mode 100644 cmake/modules/CompileInfo.cmake create mode 100644 cmake/modules/FindROOT.cmake create mode 100644 cmake/modules/WriteProjectConfig.cmake create mode 100755 cmake/scripts/mk_rootdict.sh create mode 100644 evio/include/THaCodaDataLinkDef.h create mode 100644 evio/include/THaCodaFileLinkDef.h diff --git a/cmake/QwAnalysisConfig.cmake.in b/cmake/QwAnalysisConfig.cmake.in new file mode 100644 index 000000000..fb52e7519 --- /dev/null +++ b/cmake/QwAnalysisConfig.cmake.in @@ -0,0 +1,16 @@ +@PACKAGE_INIT@ + +message(STATUS "Found @PROJECT_NAME@: @PACKAGE_CMAKE_INSTALL_PREFIX@ (found version @PROJECT_VERSION@@EXTVERS@)") + +set_and_check(@PROJECT_NAME_UC@_DIR "@PACKAGE_CMAKE_INSTALL_PREFIX@") +set_and_check(@PROJECT_NAME_UC@_INCLUDE_DIR "@PACKAGE_CMAKE_INSTALL_INCLUDEDIR@") + +if(IS_DIRECTORY "@PACKAGE_INSTALL_CONFIGDIR@/modules") + list(APPEND CMAKE_MODULE_PATH "@PACKAGE_INSTALL_CONFIGDIR@/modules") +endif() + +@FIND_DEPENDENCY_COMMANDS@ + +include("@PACKAGE_TARGETS_FILE@") + +check_required_components(@PROJECT_NAME_UC@) diff --git a/cmake/modules/CMakeEnv.cmake b/cmake/modules/CMakeEnv.cmake new file mode 100644 index 000000000..8bc1be9c2 --- /dev/null +++ b/cmake/modules/CMakeEnv.cmake @@ -0,0 +1,192 @@ +# CMake settings and utility functions for projects + +include(CheckCXXCompilerFlag) + +#---------------------------------------------------------------------------- +# Set default build type to RelWithDebInfo +if(NOT CMAKE_BUILD_TYPE AND NOT CMAKE_CONFIGURATION_TYPES) + set(CMAKE_BUILD_TYPE RelWithDebInfo CACHE STRING "Build type" FORCE) + set_property(CACHE CMAKE_BUILD_TYPE PROPERTY STRINGS + "Debug" "Release" "RelWithDebInfo" "MinSizeRel") +endif() + +#---------------------------------------------------------------------------- +# Build options +option(WITH_DEBUG "Enable support for detailed debug messages" ON) + +#---------------------------------------------------------------------------- +# Project-specific build flags +if(${CMAKE_SYSTEM_NAME} MATCHES Darwin) + set(CMAKE_SHARED_LINKER_FLAGS + "${CMAKE_SHARED_LINKER_FLAGS} -Wl,-undefined,dynamic_lookup") + list(REMOVE_DUPLICATES CMAKE_SHARED_LINKER_FLAGS) +endif() + +#---------------------------------------------------------------------------- +# Useful shorthands +string(TOLOWER ${PROJECT_NAME} PROJECT_NAME_LC) +string(TOUPPER ${PROJECT_NAME} PROJECT_NAME_UC) +if("${CMAKE_PROJECT_NAME}" STREQUAL "${PROJECT_NAME}") + set(MAIN_PROJECT_NAME ${PROJECT_NAME}) + string(TOLOWER ${PROJECT_NAME} MAIN_PROJECT_NAME_LC) +endif() +if(NOT PROJECT_VERSION_PATCH) + set(PROJECT_VERSION_PATCH 0) +endif() +if(NOT PROJECT_VERSION_MINOR) + set(PROJECT_VERSION_MINOR 0) +endif() +if(NOT PROJECT_VERSION_MAJOR) + set(PROJECT_VERSION_MAJOR 0) +endif() +math(EXPR ${PROJECT_NAME_UC}_VERCODE + "${PROJECT_VERSION_MAJOR} * 65536 + ${PROJECT_VERSION_MINOR} * 256 + ${PROJECT_VERSION_PATCH}") + +#============================================================================ +# Remove duplicates from space-separated list of items +function(remove_duplicates _invar _outvar) + separate_arguments(_invar) + list(REMOVE_DUPLICATES _invar) + string(REPLACE ";" " " _invar "${_invar}") + set(${_outvar} "${_invar}" PARENT_SCOPE) +endfunction() + +#---------------------------------------------------------------------------- +# Get list of definitions for given target as list of -DXXX +# (needed for generating ROOT dictionaries) +function(get_target_definitions TARGET DEFINES) + get_target_property(defs ${TARGET} COMPILE_DEFINITIONS) + if(defs) + foreach(d IN LISTS defs) + list(APPEND deflist -D${d}) + endforeach(d) + set(${DEFINES} ${deflist} PARENT_SCOPE) + endif() +endfunction(get_target_definitions) + +#---------------------------------------------------------------------------- +# Set project's CXX level if no "-std=xxx" flag given in CXX_FLAGS +macro(set_cxx_std CXX_FLAGS) + string(REGEX MATCH "(^| +)-std=([^ ]*)" std_flag "${CXX_FLAGS}") + if(NOT CMAKE_MATCH_COUNT GREATER 1) + if(DEFINED ROOT_VERSION AND NOT ${ROOT_VERSION} VERSION_LESS 6) + set(CMAKE_CXX_STANDARD 11) + set(CMAKE_CXX_STANDARD_REQUIRED TRUE) + set(CMAKE_CXX_EXTENSIONS FALSE) + endif() + endif() + unset(std_flag) +endmacro(set_cxx_std) + +#---------------------------------------------------------------------------- +# Set our CXX flags plus "_suggested_flags" without any -IXXX options +macro(set_compiler_flags _suggested_flags) + check_cxx_compiler_flag(-pipe cxx-compiler-supports-pipe) + check_cxx_compiler_flag(-fsigned-char cxx-compiler-supports-fsigned-char) + check_cxx_compiler_flag(-fomit-frame-pointer cxx-compiler-supports-fomit-frame-pointer) + check_cxx_compiler_flag(-mtune=generic cxx-compiler-supports-mtune-generic) + if(APPLE) + check_cxx_compiler_flag(-Qunused-arguments cxx-compiler-supports-Qunused-arguments) + endif() + if(cxx-compiler-supports-pipe) + set(${PROJECT_NAME_UC}_CXX_FLAGS "${${PROJECT_NAME_UC}_CXX_FLAGS} -pipe") + endif() + if(cxx-compiler-supports-fsigned-char) + set(${PROJECT_NAME_UC}_CXX_FLAGS "${${PROJECT_NAME_UC}_CXX_FLAGS} -fsigned-char") + endif() + if(cxx-compiler-supports-mtune-generic) + set(${PROJECT_NAME_UC}_CXX_FLAGS "${${PROJECT_NAME_UC}_CXX_FLAGS} -mtune=generic") + endif() + if(cxx-compiler-supports-Qunused-arguments) + set(${PROJECT_NAME_UC}_CXX_FLAGS "${${PROJECT_NAME_UC}_CXX_FLAGS} -Qunused-arguments") + endif() + set(${PROJECT_NAME_UC}_CXX_FLAGS "${${PROJECT_NAME_UC}_CXX_FLAGS} ${_suggested_flags}") + if(${PROJECT_NAME_UC}_CXX_FLAGS) + remove_duplicates(${${PROJECT_NAME_UC}_CXX_FLAGS} ${PROJECT_NAME_UC}_CXX_FLAGS) + set_cxx_std(${${PROJECT_NAME_UC}_CXX_FLAGS}) + endif() + string(STRIP "${${PROJECT_NAME_UC}_CXX_FLAGS}" ${PROJECT_NAME_UC}_CXX_FLAGS_LIST) + separate_arguments(${PROJECT_NAME_UC}_CXX_FLAGS_LIST) + unset(cxx-compiler-supports-pipe) + unset(cxx-compiler-supports-fsigned-char) + unset(cxx-compiler-supports-fexceptions) + unset(cxx-compiler-supports-mtune-generic) + unset(cxx-compiler-supports-Qunused-arguments) + # Configuration dependent options. Avoid ugly generator expressions + if(cxx-compiler-supports-fomit-frame-pointer) + set(CMAKE_CXX_FLAGS_RELWITHDEBINFO "${CMAKE_CXX_FLAGS_RELWITHDEBINFO} -fno-omit-frame-pointer") + endif() + set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -O0") +endmacro(set_compiler_flags) + +#---------------------------------------------------------------------------- +# Set warning flags according to given argument(s) +macro(set_diagnostic_flags) + cmake_parse_arguments(SDF "WALL;WEXTRA;WERROR" "" "" ${ARGN}) + if(SDF_UNPARSED_ARGUMENTS) + message(FATAL_ERROR + "set_diagnostic_flags: Unrecognized arguments: ${SDF_UNPARSED_ARGUMENTS}" + ) + endif() + + if(SDF_WALL OR SDF_WEXTRA) + set(${PROJECT_NAME_UC}_DIAG_FLAGS "${${PROJECT_NAME_UC}_DIAG_FLAGS} -Wall") + endif() + if(SDF_WEXTRA) + set(${PROJECT_NAME_UC}_DIAG_FLAGS + "${${PROJECT_NAME_UC}_DIAG_FLAGS} -Wextra -Wno-missing-field-initializers -Wno-unused-parameter" + ) + endif() + if(SDF_WERROR) + set(${PROJECT_NAME_UC}_DIAG_FLAGS "${${PROJECT_NAME_UC}_DIAG_FLAGS} -Werror") + endif() + if(${ARGC} GREATER 0) + remove_duplicates(${${PROJECT_NAME_UC}_DIAG_FLAGS} ${PROJECT_NAME_UC}_DIAG_FLAGS) + endif() + string(STRIP "${${PROJECT_NAME_UC}_DIAG_FLAGS}" ${PROJECT_NAME_UC}_DIAG_FLAGS_LIST) + separate_arguments(${PROJECT_NAME_UC}_DIAG_FLAGS_LIST) +endmacro(set_diagnostic_flags) + +#---------------------------------------------------------------------------- +# Print build configuration details (build type, project-wde compiler flags) +function(report_build_info) + string(TOUPPER ${CMAKE_BUILD_TYPE} BUILD_TYPE_UC) + message(STATUS "Compiling for ${CMAKE_SYSTEM_NAME} with ${CMAKE_CXX_COMPILER} version ${CMAKE_CXX_COMPILER_VERSION}") + message(STATUS "Build type ${CMAKE_BUILD_TYPE}") + message(STATUS "${PROJECT_NAME_UC}_CXX_FLAGS = ${${PROJECT_NAME_UC}_CXX_FLAGS} ${${PROJECT_NAME_UC}_DIAG_FLAGS}") + message(STATUS "CMAKE_CXX_FLAGS_${BUILD_TYPE_UC} = ${CMAKE_CXX_FLAGS_${BUILD_TYPE_UC}}") +endfunction(report_build_info) + +#---------------------------------------------------------------------------- +# Support for keeping track of dependencies loaded via our FindXXX scripts + +# Dependencies already found +set_property(GLOBAL PROPERTY ${PROJECT_NAME_UC}_DEPENDENCY_LIST "") +# Commands to write to Config.cmake +set_property(GLOBAL PROPERTY ${PROJECT_NAME_UC}_FIND_DEPENDENCY_COMMANDS "") + +function(config_add_dependency item) + get_property(deplist GLOBAL PROPERTY ${PROJECT_NAME_UC}_DEPENDENCY_LIST) + list(FIND deplist ${item} found) + if(${found} LESS 0) + set_property(GLOBAL APPEND PROPERTY ${PROJECT_NAME_UC}_DEPENDENCY_LIST ${item}) + get_property(commands GLOBAL PROPERTY ${PROJECT_NAME_UC}_FIND_DEPENDENCY_COMMANDS) + list(LENGTH commands ncmd) + if(ncmd EQUAL 0) + set_property(GLOBAL APPEND PROPERTY ${PROJECT_NAME_UC}_FIND_DEPENDENCY_COMMANDS + "include(CMakeFindDependencyMacro)") + endif() + cmake_parse_arguments(CAD "" "" "" ${ARGN}) + set(version) + if(CAD_UNPARSED_ARGUMENTS) + list(GET CAD_UNPARSED_ARGUMENTS 0 version) + endif() + if(version) + set_property(GLOBAL APPEND PROPERTY ${PROJECT_NAME_UC}_FIND_DEPENDENCY_COMMANDS + "find_dependency(${item} ${version})") + else() + set_property(GLOBAL APPEND PROPERTY ${PROJECT_NAME_UC}_FIND_DEPENDENCY_COMMANDS + "find_dependency(${item})") + endif() + endif() +endfunction() diff --git a/cmake/modules/CompileInfo.cmake b/cmake/modules/CompileInfo.cmake new file mode 100644 index 000000000..4551ca4c3 --- /dev/null +++ b/cmake/modules/CompileInfo.cmake @@ -0,0 +1,48 @@ +# Get metadata about the configuration and build process +# The actual work is done by a small helper script. + +# If shell scripts are not supported on some platform, one could put logic here +# to select a platform-specfic script/program +set(_compileinfo_cmd get_compileinfo.sh) + +find_program(GET_COMPILEINFO ${_compileinfo_cmd} + HINTS + ${CMAKE_CURRENT_LIST_DIR}/.. + PATH_SUFFIXES scripts + DOC "External helper program to report current build metadata" + ) +if(NOT GET_COMPILEINFO) + message(FATAL_ERROR + "CompileInfo: Cannot find ${_compileinfo_cmd}. Check your installation.") +endif() + +execute_process(COMMAND "${GET_COMPILEINFO}" "${CMAKE_CXX_COMPILER}" + OUTPUT_VARIABLE _compileinfo_out + ERROR_VARIABLE _compileinfo_err + OUTPUT_STRIP_TRAILING_WHITESPACE + ) + +if(_compileinfo_err) + message(FATAL_ERROR "Error running ${_compileinfo_cmd}: +_compileinfo_err") +endif() + +string(REGEX REPLACE "\n" ";" _compileinfo "${_compileinfo_out}") +list(LENGTH _compileinfo _compileinfo_len) +if(NOT _compileinfo_len EQUAL 7) + message(FATAL_ERROR + "Need exactly 7 items from ${_compileinfo_cmd}, got ${_compileinfo_len}") +endif() +list(GET _compileinfo 0 ${PROJECT_NAME_UC}_BUILD_DATE) +list(GET _compileinfo 1 ${PROJECT_NAME_UC}_BUILD_DATETIME) +list(GET _compileinfo 2 ${PROJECT_NAME_UC}_PLATFORM) +list(GET _compileinfo 3 ${PROJECT_NAME_UC}_NODE) +list(GET _compileinfo 4 ${PROJECT_NAME_UC}_BUILD_USER) +list(GET _compileinfo 5 ${PROJECT_NAME_UC}_GIT_REVISION) +list(GET _compileinfo 6 ${PROJECT_NAME_UC}_CXX_VERSION) + +unset(_compileinfo_cmd) +unset(_compileinfo_out) +unset(_compileinfo_err) +unset(_compileinfo_len) +unset(_compileinfo) diff --git a/cmake/modules/FindROOT.cmake b/cmake/modules/FindROOT.cmake new file mode 100644 index 000000000..45c94177c --- /dev/null +++ b/cmake/modules/FindROOT.cmake @@ -0,0 +1,290 @@ +# Find ROOT installation. We supply or own search module because +# +# (a) ROOT 5 does not provide a CMake configuration module, and we still +# want to support ROOT 5 for the moment; and +# (b) ROOT 6's ROOTConfig.cmake is a bit too heavy for our purposes. +# +# Among other things, ROOT 6's ROOTConfig-targets.cmake, which +# is invoked by ROOTConfig.cmake, requires all components to be present, +# which clashes with partial RPM installs from EPEL on RHEL. Using ROOT's +# CMake configuration always requires users to install all components built +# by the packager, even those that are never needed. We don't want that. + +if(NOT TARGET ROOT::Libraries) + +if(NOT ROOT_CONFIG_EXEC) + # Only execute this if not already done + # (spawning a bunch of root-config processes is quite slow) + + # Find root-config either in $CMAKE_PREFIX_PATH/bin, $ROOTSYS/bin, if defined, + # or in $PATH. + if(DEFINED ENV{ROOTSYS}) + set(ROOTBIN $ENV{ROOTSYS}/bin) + endif() + find_program(ROOT_CONFIG_EXEC root-config + HINTS "${ROOTBIN}" + DOC "ROOT configuration utility program" + ) + unset(ROOTBIN) + + if(ROOT_CONFIG_EXEC) + execute_process( + COMMAND ${ROOT_CONFIG_EXEC} --prefix + OUTPUT_VARIABLE _rootsys + OUTPUT_STRIP_TRAILING_WHITESPACE + ) + set(ROOTSYS ${_rootsys} CACHE PATH "ROOT installation prefix" FORCE) + #message( STATUS "ROOTSYS = ${ROOTSYS}" ) + else() + message(FATAL_ERROR "Cannot find ROOT") + endif() + unset(_rootsys) + mark_as_advanced(ROOT_CONFIG_EXEC) + + execute_process(COMMAND ${ROOT_CONFIG_EXEC} --version + OUTPUT_VARIABLE _config_version + OUTPUT_STRIP_TRAILING_WHITESPACE + ) + string(REGEX REPLACE "^([0-9]+)\\.([0-9]+)/([0-9]+).*" "\\1.\\2.\\3" + _version "${_config_version}") + set(ROOT_CONFIG_VERSION ${_config_version} CACHE STRING + "ROOT version from root-config" FORCE) + set(ROOT_VERSION ${_version} CACHE STRING "ROOT version found" FORCE) + mark_as_advanced(ROOT_CONFIG_VERSION) + unset(_config_version) + unset(_version) + + execute_process( + COMMAND ${ROOT_CONFIG_EXEC} --bindir + OUTPUT_VARIABLE _bindir + OUTPUT_STRIP_TRAILING_WHITESPACE + ) + set(ROOT_BINARY_DIR "${_bindir}" CACHE PATH "ROOT binary directory" FORCE) + unset(_bindir) + + execute_process( + COMMAND ${ROOT_CONFIG_EXEC} --libdir + OUTPUT_VARIABLE _libdir + OUTPUT_STRIP_TRAILING_WHITESPACE + ) + set(ROOT_LIBRARY_DIR "${_libdir}" CACHE PATH "ROOT library directory" FORCE) + unset(_libdir) + + execute_process( + COMMAND ${ROOT_CONFIG_EXEC} --incdir + OUTPUT_VARIABLE _incdir + OUTPUT_STRIP_TRAILING_WHITESPACE + ) + set(ROOT_INCLUDE_DIR "${_incdir}" CACHE PATH "ROOT include directory" FORCE) + unset(_incdir) + + execute_process( + COMMAND ${ROOT_CONFIG_EXEC} --cflags + OUTPUT_VARIABLE _cxx_flags + OUTPUT_STRIP_TRAILING_WHITESPACE + ) + # Remove include directories from compiler flags; they are handled separately + string(REGEX REPLACE "-I[^ ]*" "" _cxx_flags "${_cxx_flags}") + set(ROOT_CXX_FLAGS "${_cxx_flags}" CACHE STRING "ROOT C++ compiler flags" FORCE) + mark_as_advanced(ROOT_CXX_FLAGS) + unset(_cxx_flags) + + execute_process( + COMMAND ${ROOT_CONFIG_EXEC} --ldflags + OUTPUT_VARIABLE _ldflags + OUTPUT_STRIP_TRAILING_WHITESPACE + ) + set(ROOT_LD_FLAGS "${_ldflags}" CACHE STRING "ROOT linker flags" FORCE) + mark_as_advanced(ROOT_LD_FLAGS) + unset(_ldflags) + + execute_process( + COMMAND ${ROOT_CONFIG_EXEC} --libs + OUTPUT_VARIABLE _libs + OUTPUT_STRIP_TRAILING_WHITESPACE + ) + set(ROOT_LIB_FLAGS "${_libs}" CACHE STRING "Linker flags for ROOT libraries" FORCE) + mark_as_advanced(ROOT_LIB_FLAGS) + unset(_libs) +endif(NOT ROOT_CONFIG_EXEC) + +# We need some of these variables as ;-lists +set(ROOT_CXXFLAG_LIST ${ROOT_CXX_FLAGS}) +separate_arguments(ROOT_CXXFLAG_LIST) + +# Get list of ROOT's core libraries from the output of "root-config --libs" +separate_arguments(ROOT_LIB_FLAGS) +string(REPLACE "-l" "" ROOT_LIB_FLAGS "${ROOT_LIB_FLAGS}") + +# Find absolute paths to the core libraries plus any requested components +set(ROOT_LIBRARIES) +set(targetlist) +list(REMOVE_DUPLICATES ROOT_FIND_COMPONENTS) +foreach(_lib IN LISTS ROOT_LIB_FLAGS ROOT_FIND_COMPONENTS) + if(_lib MATCHES "^[A-Z].+") + find_library(ROOT_${_lib}_LIBRARY ${_lib} HINTS ${ROOT_LIBRARY_DIR}) + mark_as_advanced(ROOT_${_lib}_LIBRARY) + if(ROOT_${_lib}_LIBRARY) + add_library(ROOT::${_lib} SHARED IMPORTED) + set_target_properties(ROOT::${_lib} PROPERTIES + INTERFACE_INCLUDE_DIRECTORIES "${ROOT_INCLUDE_DIR}" + IMPORTED_LINK_INTERFACE_LANGUAGES "CXX" + IMPORTED_LOCATION "${ROOT_${_lib}_LIBRARY}" + INTERFACE_COMPILE_OPTIONS + "$<$>:${ROOT_CXXFLAG_LIST}>" + ) + list(APPEND ROOT_LIBRARIES ${ROOT_${_lib}_LIBRARY}) + list(REMOVE_ITEM ROOT_FIND_COMPONENTS ${_lib}) + list(APPEND targetlist ROOT::${_lib}) + endif() + endif() +endforeach() +if(ROOT_LIBRARIES) + list(REMOVE_DUPLICATES ROOT_LIBRARIES) +endif() + +add_library(ROOT::Libraries INTERFACE IMPORTED) +set_target_properties(ROOT::Libraries PROPERTIES + INTERFACE_INCLUDE_DIRECTORIES "${ROOT_INCLUDE_DIRS}" + ) +set_target_properties(ROOT::Libraries PROPERTIES + INTERFACE_LINK_LIBRARIES "${targetlist}" + ) +unset(targetlist) + +# If any requested components are remaining, they weren't found above, +# so report a warning or an error +foreach(_remaining ${ROOT_FIND_COMPONENTS}) + if(ROOT_FIND_REQUIRED_${_remaining}) + message(FATAL_ERROR "ROOT component ${_remaining} not found") + elseif(NOT ROOT_FIND_QUIETLY) + message(WARNING " ROOT component ${_remaining} not found") + endif() + unset(ROOT_FIND_REQUIRED_${_remaining}) +endforeach() + +include(FindPackageHandleStandardArgs) +find_package_handle_standard_args(ROOT + REQUIRED_VARS ROOTSYS ROOT_LIBRARY_DIR ROOT_BINARY_DIR ROOT_INCLUDE_DIR + ROOT_CONFIG_EXEC ROOT_LIBRARIES + VERSION_VAR ROOT_VERSION + ) + +endif(NOT TARGET ROOT::Libraries) + +find_program(MK_ROOTDICT mk_rootdict.sh + HINTS + ${CMAKE_CURRENT_LIST_DIR}/.. + PATH_SUFFIXES scripts + DOC "Wrapper script for ROOT dictionary generator" + ) +if(NOT MK_ROOTDICT) + message(FATAL_ERROR + "FindROOT: Cannot find mk_rootdict.sh. Check your installation.") +endif() + +# BUILD_ROOT_DICTIONARY(dictionary +# LINKDEF +# [ TARGETS [ ... ] +# [ INCLUDEDIRS [ ] +# [ PCMNAME ] +#
[
... ] ) +# +# Build ROOT dictionary for ROOT 5 and 6 +# +# Arguments: +# dictionary: dictionary base name (required). Output file will be +# ${dictionary}Dict.cxx +# LINKDEF: name of LinkDef.h file (required) +# TARGETS: CMake targets from which to get -I arguments and -D definitions +# INCLUDEDIRS: paths to use for -I arguments +# OPTIONS: additional options for rootcling/rootcint +# PCMNAME: base name of PCM file (ROOT 6 only). Defaults to ${dictionary}. +# Output will be lib${pcmname}_rdict.pcm. +# +# Creates a custom target ${dictionary}_ROOTDICT. +# With ROOT 6, also installs the PCM file in ${CMAKE_INSTALL_LIBDIR} +# +function(build_root_dictionary dictionary) + + if(DEFINED ROOT_VERSION AND DEFINED ROOTSYS) + if(NOT ${ROOT_VERSION} VERSION_LESS 6) + find_program(ROOTCLING rootcling HINTS "${ROOTSYS}/bin") + if(NOT ROOTCLING) + message(FATAL_ERROR + "root_generate_dictionary: Cannot find rootcling. Check ROOT installation.") + endif() + else() + find_program(ROOTCINT rootcint HINTS "${ROOTSYS}/bin") + if(NOT ROOTCINT) + message(FATAL_ERROR + "root_generate_dictionary: Cannot find rootcint. Check ROOT installation.") + endif() + endif() + else() + message(FATAL_ERROR "root_generate_dictionary: ROOT is not set up") + endif() + + cmake_parse_arguments(RGD "" "PCMNAME" "INCLUDEDIRS;LINKDEF;OPTIONS;TARGETS" ${ARGN}) + + if(NOT RGD_LINKDEF) + message(FATAL_ERROR "root_generate_dictionary: Required argument LINKDEF missing") + endif() + + # Compile definitions and include directories from the given target(s) + set(defines) + set(incdirs) + foreach(tgt IN LISTS RGD_TARGETS) + list(APPEND defines $) + list(APPEND incdirs $) + endforeach() + + # Add any explicitly specified include directories + list(APPEND incdirs ${RGD_INCLUDEDIRS}) + + if(ROOTCLING) + # ROOT6 + if(RGD_PCMNAME) + set(pcmname ${RGD_PCMNAME}) + else() + set(pcmname ${dictionary}) + endif() + add_custom_command( + OUTPUT ${dictionary}Dict.cxx lib${pcmname}_rdict.pcm + COMMAND ${MK_ROOTDICT} + ARGS + ${ROOTCLING} + -f ${dictionary}Dict.cxx + -s lib${pcmname} + ${RGD_OPTIONS} + INCDIRS "${incdirs}" + DEFINES "${defines}" + ${RGD_UNPARSED_ARGUMENTS} + ${RGD_LINKDEF} + VERBATIM + DEPENDS ${RGD_UNPARSED_ARGUMENTS} ${RGD_LINKDEF} + ) + set(PCM_FILE ${CMAKE_CURRENT_BINARY_DIR}/lib${pcmname}_rdict.pcm) + install(FILES ${PCM_FILE} DESTINATION ${CMAKE_INSTALL_LIBDIR}) + else() + # ROOT5 + add_custom_command( + OUTPUT ${dictionary}Dict.cxx + COMMAND ${MK_ROOTDICT} + ARGS + ${ROOTCINT} + -f ${dictionary}Dict.cxx + -c ${RGD_OPTIONS} + INCDIRS "${incdirs}" + DEFINES "${defines}" + ${RGD_UNPARSED_ARGUMENTS} + ${RGD_LINKDEF} + VERBATIM + DEPENDS ${RGD_UNPARSED_ARGUMENTS} ${RGD_LINKDEF} + ) + endif() + add_custom_target(${dictionary}_ROOTDICT + DEPENDS ${dictionary}Dict.cxx + ) +endfunction() diff --git a/cmake/modules/WriteProjectConfig.cmake b/cmake/modules/WriteProjectConfig.cmake new file mode 100644 index 000000000..c5b655988 --- /dev/null +++ b/cmake/modules/WriteProjectConfig.cmake @@ -0,0 +1,80 @@ +# Create Config.cmake and ConfigVersion.cmake + +include(CMakePackageConfigHelpers) + +#---------------------------------------------------------------------------- +# Install project-specific modules and scripts. The module directory will be +# appended to CMAKE_MODULE_PATH when loading this project's configuration file +# +if(IS_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/modules) + install(DIRECTORY + ${CMAKE_CURRENT_SOURCE_DIR}/modules + DESTINATION ${INSTALL_CONFIGDIR} + ) +endif() + +if(IS_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/scripts) + install(DIRECTORY + ${CMAKE_CURRENT_SOURCE_DIR}/scripts + DESTINATION ${INSTALL_CONFIGDIR} + USE_SOURCE_PERMISSIONS + ) +endif() + +#---------------------------------------------------------------------------- +# Generate project configuration and targets files. Do this only for the +# main project, though, not for submodules since their targets are included +# in the main configuration file +# +if("${CMAKE_PROJECT_NAME}" STREQUAL "${PROJECT_NAME}") + #---------------------------------------------------------------------------- + # Convert the ;-list of find_dependency() commands to a sequence of lines + # + get_property(commands GLOBAL PROPERTY ${PROJECT_NAME_UC}_FIND_DEPENDENCY_COMMANDS) + set(FIND_DEPENDENCY_COMMANDS) + foreach(cmd IN LISTS commands) + if(NOT FIND_DEPENDENCY_COMMANDS) + set( FIND_DEPENDENCY_COMMANDS "${cmd}") + else() + set( FIND_DEPENDENCY_COMMANDS + "${FIND_DEPENDENCY_COMMANDS}\n${cmd}") + endif() + endforeach() + + #---------------------------------------------------------------------------- + # Configure and install the project configuration and version files + # + set(TARGETS_FILE ${INSTALL_CONFIGDIR}/${PROJECT_NAME}Targets.cmake) + configure_package_config_file( + ${PROJECT_NAME}Config.cmake.in + ${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}Config.cmake + INSTALL_DESTINATION ${INSTALL_CONFIGDIR} + PATH_VARS + INSTALL_CONFIGDIR + CMAKE_INSTALL_PREFIX + CMAKE_INSTALL_INCLUDEDIR + TARGETS_FILE + ) + + write_basic_package_version_file( + ${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}ConfigVersion.cmake + VERSION ${PROJECT_VERSION} + COMPATIBILITY AnyNewerVersion + ) + + install(FILES + ${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}Config.cmake + ${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}ConfigVersion.cmake + DESTINATION ${INSTALL_CONFIGDIR} + ) + + #---------------------------------------------------------------------------- + # Install and export targets defined by this project + # + install(EXPORT ${PROJECT_NAME_LC}-exports + FILE ${PROJECT_NAME}Targets.cmake + NAMESPACE ${PROJECT_NAME}:: + DESTINATION ${INSTALL_CONFIGDIR} + ) + +endif() diff --git a/cmake/scripts/mk_rootdict.sh b/cmake/scripts/mk_rootdict.sh new file mode 100755 index 000000000..a6ce90fd8 --- /dev/null +++ b/cmake/scripts/mk_rootdict.sh @@ -0,0 +1,96 @@ +#!/bin/bash +# +# mk_rootdict.sh. Wrapper script around rootcling/rootcont. +# +# Process INCDIRS followed by ""-quoted ;-list into sequence of -I directives; +# similarly, translate DEFINES followed by ;-list into sequence of -D arguments. +# Remove duplicates while preserving order (keep only first occurrence found). +# Quote any paths and definitions containing spaces. +# Call rootcling/rootcint with the translated arguments, preserving the rest +# of the command line. +# +# In part, this is a workaround for a CMake limitation. Until version 3.8, +# CMake was unable to pass ;-lists properly to an external command via +# add_custom_command. Version 3.8 added the COMMAND_EXPAND_LISTS option +# that removes this limitation. However, even with this option, +# parsing command line arguments instead with this script still has advantages: +# (a) it removes duplicate list entries, which CMake is still unable to do with +# generator expressions; and (b) it allows us to support lower CMake versions +# than the rather recent 3.8 (April 2017). The downside is the dependence on bash. + +ROOTCLING="$1" +shift + +POSITIONAL=() +PREOPTIONS=() +OPTIONS=() +INCDIRS=() +DEFINES=() +PCMNAME=() +while [[ $# -gt 0 ]]; do + key="$1" + case $key in + -f) + PREOPTIONS+=("$1") + shift + ;; + -v*) + PREOPTIONS+=("$1") + shift + ;; + *) + break + esac +done + +DICTNAME="$1" +shift + +while [[ $# -gt 0 ]]; do + key="$1" + case $key in + -s) + PCMNAME+=("$1") + shift + PCMNAME+=("$1") + shift + ;; + INCDIRS) + if [ "$2"x != "x" ]; then + while read inc; do + if echo $inc | grep -q " "; then + inc=\""$inc"\" + fi + INCDIRS+=("-I$inc") + done < <(echo $2 | sed -e 's/^;//' -e 's/;$//' -e 's/;;/;/g' | tr ';' '\n' | \ + awk '!nseen[$0]++') + fi + shift 2 + ;; + DEFINES) + if [ "$2"x != "x" ]; then + while read def; do + if echo $def | grep -q " "; then + def=\""$def"\" + fi + INCDIRS+=("-D$def") + done < <(echo $2 | sed -e 's/^;//' -e 's/;$//' -e 's/;;/;/g' | tr ';' '\n' | \ + awk '!nseen[$0]++') + fi + shift 2 + ;; + -*) + OPTIONS+=("$1") + shift + ;; + *) + POSITIONAL+=("$1") + shift + ;; + esac +done + +# echo "=========== translated command: ================" +# echo $ROOTCLING ${PREOPTIONS[@]} $DICTNAME ${PCMNAME[@]} ${OPTIONS[@]} ${INCDIRS[@]} ${DEFINES[@]} ${POSITIONAL[@]} +# echo "=========== end translated command =============" +eval $ROOTCLING ${PREOPTIONS[@]} $DICTNAME ${PCMNAME[@]} ${OPTIONS[@]} ${INCDIRS[@]} ${DEFINES[@]} ${POSITIONAL[@]} diff --git a/evio/include/THaCodaDataLinkDef.h b/evio/include/THaCodaDataLinkDef.h new file mode 100644 index 000000000..e69de29bb diff --git a/evio/include/THaCodaFileLinkDef.h b/evio/include/THaCodaFileLinkDef.h new file mode 100644 index 000000000..e69de29bb From 5bb2554f9c1fbc67c1cdc3df2be4a687707fcbb3 Mon Sep 17 00:00:00 2001 From: Wouter Deconinck Date: Wed, 16 Jan 2019 17:56:53 -0500 Subject: [PATCH 050/137] Update .gitignore Don't ignore *.txt since that matches CMakeLists.txt --- .gitignore | 1 - 1 file changed, 1 deletion(-) diff --git a/.gitignore b/.gitignore index c9e9007c3..a6caceee1 100644 --- a/.gitignore +++ b/.gitignore @@ -49,7 +49,6 @@ Doxygen/html *.tar *.root *.db -*.txt *.png #tmp files From dd45b57fa8c83d0b4e1be968822041a48300d125 Mon Sep 17 00:00:00 2001 From: Wouter Deconinck Date: Tue, 20 Nov 2018 16:01:28 -0500 Subject: [PATCH 051/137] Small change to enable printing of all program options when no argument is given for all three executables. Resolves issue #43. --- Parity/main/QwMockDataGenerator.cc | 15 +++++++++++---- Parity/main/QwParity.cc | 23 ++++++++++++----------- Parity/main/QwParity_simple.cc | 23 ++++++++++++----------- 3 files changed, 35 insertions(+), 26 deletions(-) mode change 100755 => 100644 Parity/main/QwMockDataGenerator.cc mode change 100755 => 100644 Parity/main/QwParity.cc mode change 100755 => 100644 Parity/main/QwParity_simple.cc diff --git a/Parity/main/QwMockDataGenerator.cc b/Parity/main/QwMockDataGenerator.cc old mode 100755 new mode 100644 index 6df77c32f..792951a91 --- a/Parity/main/QwMockDataGenerator.cc +++ b/Parity/main/QwMockDataGenerator.cc @@ -48,13 +48,15 @@ inline std::string stringify(int i) { int main(int argc, char* argv[]) { - // First, we set the command line arguments and the configuration filename, - // and we define the options that can be used in them (using QwOptions). - gQwOptions.SetCommandLine(argc, argv); - gQwOptions.SetConfigFile("qwmockdataanalysis.conf"); // Define the command line options DefineOptionsParity(gQwOptions); + /// Without anything, print usage + if (argc == 1) { + gQwOptions.Usage(); + exit(0); + } + // Fill the search paths for the parameter files; this sets a static // variable within the QwParameterFile class which will be used by // all instances. @@ -63,6 +65,11 @@ int main(int argc, char* argv[]) QwParameterFile::AppendToSearchPath(getenv_safe_string("QWANALYSIS") + "/Analysis/prminput"); QwParameterFile::AppendToSearchPath(getenv_safe_string("QWANALYSIS") + "/Parity/prminput"); + // Set the command line arguments and the configuration filename, + // and we define the options that can be used in them (using QwOptions). + gQwOptions.SetCommandLine(argc, argv); + gQwOptions.SetConfigFile("qwmockdataanalysis.conf"); + // Event buffer QwEventBuffer eventbuffer; diff --git a/Parity/main/QwParity.cc b/Parity/main/QwParity.cc old mode 100755 new mode 100644 index 930de2623..4893ccf9d --- a/Parity/main/QwParity.cc +++ b/Parity/main/QwParity.cc @@ -49,8 +49,17 @@ Int_t main(Int_t argc, Char_t* argv[]) { - /// without anything, print usage - if(argc == 1){ + /// Define the command line options + DefineOptionsParity(gQwOptions); + + /// Define additional command line arguments and the configuration filename, + /// and we define the options that can be used in them (using QwOptions). + gQwOptions.AddOptions()("single-output-file", po::value()->default_bool_value(false), "Write a single output file"); + gQwOptions.AddOptions()("print-errorcounters", po::value()->default_bool_value(true), "Print summary of error counters"); + gQwOptions.AddOptions()("write-promptsummary", po::value()->default_bool_value(false), "Write PromptSummary"); + + /// Without anything, print usage + if (argc == 1) { gQwOptions.Usage(); exit(0); } @@ -63,19 +72,11 @@ Int_t main(Int_t argc, Char_t* argv[]) QwParameterFile::AppendToSearchPath(getenv_safe_string("QWANALYSIS") + "/Parity/prminput"); QwParameterFile::AppendToSearchPath(getenv_safe_string("QWANALYSIS") + "/Analysis/prminput"); - /// Then, we set the command line arguments and the configuration filename, - /// and we define the options that can be used in them (using QwOptions). - gQwOptions.AddOptions()("single-output-file", po::value()->default_bool_value(false), "Write a single output file"); - gQwOptions.AddOptions()("print-errorcounters", po::value()->default_bool_value(true), "Print summary of error counters"); - gQwOptions.AddOptions()("write-promptsummary", po::value()->default_bool_value(false), "Write PromptSummary"); - gQwOptions.SetCommandLine(argc, argv); gQwOptions.AddConfigFile("qweak_mysql.conf"); gQwOptions.ListConfigFiles(); - - /// Define the command line options - DefineOptionsParity(gQwOptions); + /// Load command line options for the histogram/tree helper class gQwHists.ProcessOptions(gQwOptions); /// Setup screen and file logging diff --git a/Parity/main/QwParity_simple.cc b/Parity/main/QwParity_simple.cc old mode 100755 new mode 100644 index 29cccaf37..d450c3a96 --- a/Parity/main/QwParity_simple.cc +++ b/Parity/main/QwParity_simple.cc @@ -44,8 +44,17 @@ Int_t main(Int_t argc, Char_t* argv[]) { - /// without anything, print usage - if(argc == 1){ + /// Define the command line options + DefineOptionsParity(gQwOptions); + + /// Define additional command line arguments and the configuration filename, + /// and we define the options that can be used in them (using QwOptions). + gQwOptions.AddOptions()("single-output-file", po::value()->default_bool_value(false), "Write a single output file"); + gQwOptions.AddOptions()("print-errorcounters", po::value()->default_bool_value(true), "Print summary of error counters"); + gQwOptions.AddOptions()("write-promptsummary", po::value()->default_bool_value(false), "Write PromptSummary"); + + /// Without anything, print usage + if (argc == 1) { gQwOptions.Usage(); exit(0); } @@ -58,21 +67,13 @@ Int_t main(Int_t argc, Char_t* argv[]) QwParameterFile::AppendToSearchPath(getenv_safe_string("QWANALYSIS") + "/Parity/prminput"); QwParameterFile::AppendToSearchPath(getenv_safe_string("QWANALYSIS") + "/Analysis/prminput"); - /// Then, we set the command line arguments and the configuration filename, - /// and we define the options that can be used in them (using QwOptions). - gQwOptions.AddOptions()("single-output-file", po::value()->default_bool_value(false), "Write a single output file"); - gQwOptions.AddOptions()("print-errorcounters", po::value()->default_bool_value(true), "Print summary of error counters"); - gQwOptions.AddOptions()("write-promptsummary", po::value()->default_bool_value(false), "Write PromptSummary"); - gQwOptions.SetCommandLine(argc, argv); #ifdef __USE_DATABASE__ gQwOptions.AddConfigFile("qweak_mysql.conf"); #endif gQwOptions.ListConfigFiles(); - - /// Define the command line options - DefineOptionsParity(gQwOptions); + /// Load command line options for the histogram/tree helper class gQwHists.ProcessOptions(gQwOptions); /// Setup screen and file logging From 0bafcee01e42879cd33c386bed7c49f908b90db5 Mon Sep 17 00:00:00 2001 From: Ciprian Gal Date: Wed, 12 Dec 2018 07:14:09 -0500 Subject: [PATCH 052/137] put cavities in line with stripline naming conventions --- Parity/prminput/prexCH_beamline.map | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/Parity/prminput/prexCH_beamline.map b/Parity/prminput/prexCH_beamline.map index d2ccff9a8..a741a2846 100644 --- a/Parity/prminput/prexCH_beamline.map +++ b/Parity/prminput/prexCH_beamline.map @@ -40,19 +40,19 @@ sample_size=464 VQWK, 2, 7, bpmstripline, BPM4Aym !ADC3 - VQWK, 3, 0, bcm, CAVB_X - VQWK, 3, 1, bcm, CAVB_Y - VQWK, 3, 2, bcm, CAVB_Q + VQWK, 3, 0, bcm, CAV4BX + VQWK, 3, 1, bcm, CAV4BY + VQWK, 3, 2, bcm, CAV4BQ VQWK, 3, 3, bcm, QWK_3_3 - VQWK, 3, 4, bcm, CAVC_X - VQWK, 3, 5, bcm, CAVC_Y - VQWK, 3, 6, bcm, CAVC_Q + VQWK, 3, 4, bcm, CAV4CX + VQWK, 3, 5, bcm, CAV4CY + VQWK, 3, 6, bcm, CAV4CQ VQWK, 3, 7, bcm, QWK_3_7 !ADC4 - VQWK, 4, 0, bcm, CAVD_X - VQWK, 4, 1, bcm, CAVD_Y - VQWK, 4, 2, bcm, CAVD_Q + VQWK, 4, 0, bcm, CAV4DX + VQWK, 4, 1, bcm, CAV4DY + VQWK, 4, 2, bcm, CAV4DQ VQWK, 4, 3, bcm, QWK_4_3 VQWK, 4, 4, bcm, QWK_4_4 VQWK, 4, 5, bcm, QWK_4_5 From 7d3e988faf41070f6684393a43abac5f5c9e72ac Mon Sep 17 00:00:00 2001 From: Ciprian Gal Date: Wed, 12 Dec 2018 07:20:10 -0500 Subject: [PATCH 053/137] and png and files starting with z_ --- .gitignore | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.gitignore b/.gitignore index 14f598e64..20a666b63 100644 --- a/.gitignore +++ b/.gitignore @@ -50,6 +50,8 @@ Doxygen/html *.root *.db *.txt +*.png #tmp files *~ +z_* From 62d27f749a08a9193454cbe80c56b13de3784ab5 Mon Sep 17 00:00:00 2001 From: Wouter Deconinck Date: Mon, 12 Nov 2018 07:36:32 -0500 Subject: [PATCH 054/137] Avoid `using namespace std` by specifying std:: when needed. There are potential issues with `using namespace std`, in particular in header files like `THa*.h`. Functions like std::abs() can be called simply as abs() which may cause confusion when another header defines abs(). More detailed reasons: https://stackoverflow.com/questions/1452721/why-is-using-namespace-std-considered-bad-practice --- Parity/src/QwComptonElectronDetector.cc | 14 +++--- evio/include/THaCodaFile.h | 2 - evio/include/THaEtClient.h | 2 - evio/src/THaCodaFile.C | 66 ++++++++++++------------- 4 files changed, 39 insertions(+), 45 deletions(-) diff --git a/Parity/src/QwComptonElectronDetector.cc b/Parity/src/QwComptonElectronDetector.cc index 249e3f5cc..84a5238eb 100755 --- a/Parity/src/QwComptonElectronDetector.cc +++ b/Parity/src/QwComptonElectronDetector.cc @@ -42,8 +42,6 @@ #include "QwLog.h" #include "QwHistogramHelper.h" -using namespace std; - // Ugly, should go inside functions, seems undefined for running sum Int_t notGood=0,myrun; @@ -177,8 +175,8 @@ Int_t QwComptonElectronDetector::LoadChannelMap(TString mapfile) } // end of switch (dettype) else { notGood=notGood+1; - cout<<"***found an undefined data type "< -using namespace std; - class THaCodaFile : public THaCodaData { diff --git a/evio/include/THaEtClient.h b/evio/include/THaEtClient.h index aa1133b8c..707c0517c 100755 --- a/evio/include/THaEtClient.h +++ b/evio/include/THaEtClient.h @@ -33,8 +33,6 @@ #include #include "TString.h" -using namespace std; - // The ET memory file will have this prefix. The suffix is $SESSION. #define ETMEM_PREFIX "/tmp/et_sys_" diff --git a/evio/src/THaCodaFile.C b/evio/src/THaCodaFile.C index dac1be95a..7c78626d7 100755 --- a/evio/src/THaCodaFile.C +++ b/evio/src/THaCodaFile.C @@ -87,9 +87,9 @@ ClassImp(THaCodaFile) } } else { if(CODA_VERBOSE) { - cout << "codaRead ERROR: tried to access a file with handle = NULL" << endl; - cout << "You need to call codaOpen(filename)" << endl; - cout << "or use the constructor with (filename) arg" << endl; + std::cout << "codaRead ERROR: tried to access a file with handle = NULL" << std::endl; + std::cout << "You need to call codaOpen(filename)" << std::endl; + std::cout << "or use the constructor with (filename) arg" << std::endl; } fStatus = CODA_ERROR; } @@ -104,7 +104,7 @@ ClassImp(THaCodaFile) fStatus = evWrite(handle, evbuffer); staterr("write",fStatus); } else { - cout << "codaWrite ERROR: tried to access file with handle = NULL" << endl; + std::cout << "codaWrite ERROR: tried to access file with handle = NULL" << std::endl; fStatus = CODA_ERROR; } return fStatus; @@ -127,19 +127,19 @@ ClassImp(THaCodaFile) int i; if(output_file == filename) { if(CODA_VERBOSE) { - cout << "filterToFile: ERROR: "; - cout << "Input and output files cannot be same " << endl; - cout << "This is to protect you against overwriting data" << endl; + std::cout << "filterToFile: ERROR: "; + std::cout << "Input and output files cannot be same " << std::endl; + std::cout << "This is to protect you against overwriting data" << std::endl; } return CODA_ERROR; } FILE *fp; if ((fp = fopen(output_file.Data(),"r")) != NULL) { if(CODA_VERBOSE) { - cout << "filterToFile: ERROR: "; - cout << "Output file `" << output_file << "' exists " << endl; - cout << "You must remove it by hand first. " << endl; - cout << "This forces you to think and not overwrite data." << endl; + std::cout << "filterToFile: ERROR: "; + std::cout << "Output file `" << output_file << "' exists " << std::endl; + std::cout << "You must remove it by hand first. " << std::endl; + std::cout << "This forces you to think and not overwrite data." << std::endl; } fclose(fp); return CODA_ERROR; @@ -153,11 +153,11 @@ ClassImp(THaCodaFile) int evnum = rawbuff[4]; int oktofilt = 1; if (CODA_DEBUG) { - cout << "Input evtype " << dec << evtype; - cout << " evnum " << evnum << endl; - cout << "max_to_filt = " << max_to_filt << endl; - cout << "evtype size = " << evtypes[0] << endl; - cout << "evlist size = " << evlist[0] << endl; + std::cout << "Input evtype " << std::dec << evtype; + std::cout << " evnum " << evnum << std::endl; + std::cout << "max_to_filt = " << max_to_filt << std::endl; + std::cout << "evtype size = " << evtypes[0] << std::endl; + std::cout << "evlist size = " << evlist[0] << std::endl; } if ( evtypes[0] > 0 ) { oktofilt = 0; @@ -182,13 +182,13 @@ Cont2: if (oktofilt) { nfilt++; if (CODA_DEBUG) { - cout << "Filtering event, nfilt " << dec << nfilt << endl; + std::cout << "Filtering event, nfilt " << std::dec << nfilt << std::endl; } fStatus = fout->codaWrite(getEvBuffer()); if (fStatus != S_SUCCESS) { if (CODA_VERBOSE) { - cout << "Error in filterToFile ! " << endl; - cout << "codaWrite returned status " << fStatus << endl; + std::cout << "Error in filterToFile ! " << std::endl; + std::cout << "codaWrite returned status " << fStatus << std::endl; } goto Finish; } @@ -259,42 +259,42 @@ void THaCodaFile::staterr(TString tried_to, int status) { // and the user has to pay attention to why. if (status == S_SUCCESS) return; // everything is fine. if (tried_to == "open") { - cout << "THaCodaFile: ERROR opening file = " << filename << endl; - cout << "Most likely errors are: " << endl; - cout << " 1. You mistyped the name of file ?" << endl; - cout << " 2. The file has length zero ? " << endl; + std::cout << "THaCodaFile: ERROR opening file = " << filename << std::endl; + std::cout << "Most likely errors are: " << std::endl; + std::cout << " 1. You mistyped the name of file ?" << std::endl; + std::cout << " 2. The file has length zero ? " << std::endl; } switch (status) { case S_EVFILE_TRUNC : - cout << "THaCodaFile ERROR: Truncated event on file read" << endl; - cout << "Evbuffer size is too small. Job aborted." << endl; + std::cout << "THaCodaFile ERROR: Truncated event on file read" << std::endl; + std::cout << "Evbuffer size is too small. Job aborted." << std::endl; exit(0); // If this ever happens, recompile with MAXEVLEN // bigger, and mutter under your breath at the author. case S_EVFILE_BADBLOCK : - cout << "Bad block number encountered " << endl; + std::cout << "Bad block number encountered " << std::endl; break; case S_EVFILE_BADHANDLE : - cout << "Bad handle (file/stream not open) " << endl; + std::cout << "Bad handle (file/stream not open) " << std::endl; break; case S_EVFILE_ALLOCFAIL : - cout << "Failed to allocate event I/O" << endl; + std::cout << "Failed to allocate event I/O" << std::endl; break; case S_EVFILE_BADFILE : - cout << "File format error" << endl; + std::cout << "File format error" << std::endl; break; case S_EVFILE_UNKOPTION : - cout << "Unknown option specified" << endl; + std::cout << "Unknown option specified" << std::endl; break; case S_EVFILE_UNXPTDEOF : - cout << "Unexpected end of file while reading event" << endl; + std::cout << "Unexpected end of file while reading event" << std::endl; break; case EOF: if(CODA_VERBOSE) { - cout << "Normal end of file " << filename << " encountered" << endl; + std::cout << "Normal end of file " << filename << " encountered" << std::endl; } break; default: - cout << "Error status 0x" << hex << status << endl; + std::cout << "Error status 0x" << std::hex << status << std::endl; } }; From bb11cf690deb1270d9946e32017ed2f7b330e390 Mon Sep 17 00:00:00 2001 From: Paul King Date: Thu, 20 Dec 2018 13:28:06 -0500 Subject: [PATCH 055/137] Udated THaEtClient.C to use std:: prefix when needed. Modification of this file was missed in the no_using_namespace_std branch until after it was merged into develop. The changes are all in lines relating to standard output. --- evio/src/THaEtClient.C | 72 +++++++++++++++++++++--------------------- 1 file changed, 36 insertions(+), 36 deletions(-) diff --git a/evio/src/THaEtClient.C b/evio/src/THaEtClient.C index edfb93f32..1db7a2fc7 100755 --- a/evio/src/THaEtClient.C +++ b/evio/src/THaEtClient.C @@ -53,7 +53,7 @@ THaEtClient::THaEtClient(TString computer, TString mysession, int smode, THaEtClient::~THaEtClient() { fStatus = codaClose(); - if (fStatus == CODA_ERROR) cout << "ERROR: closing THaEtClient"< bpi*MAXEVLEN) { - cout<<"\nET:codaRead:ERROR: CODA event truncated"< Byte size exceeds bytes "< Byte size exceeds bytes "<= nread) { err = et_events_put(id, my_att, evs, nread); if (err < ET_OK) { - cout<<"THaEtClient::codaRead: ERROR: calling et_events_put"< Date: Fri, 7 Dec 2018 16:03:43 -0500 Subject: [PATCH 056/137] Adding the option to define the input register bits associated with the helicity, multiplet sync, and pair sync, instead of using the default bit assignments (which are used in the injector). --- Parity/include/QwHelicity.h | 13 ++++++-- Parity/prminput/prexCH_detectors.map | 6 ++-- Parity/prminput/prexCH_helicity.map | 45 ++++------------------------ Parity/src/QwHelicity.cc | 42 ++++++++++++++++++++------ 4 files changed, 51 insertions(+), 55 deletions(-) diff --git a/Parity/include/QwHelicity.h b/Parity/include/QwHelicity.h index fb79e0860..10030d34e 100755 --- a/Parity/include/QwHelicity.h +++ b/Parity/include/QwHelicity.h @@ -163,12 +163,16 @@ class QwHelicity: public VQwSubsystemParity, public MQwSubsystemCloneable &buffer) } case kHelInputRegisterMode: { UInt_t input_register = 0x0; - if (fHelicityDelayed == 1) input_register |= kInputReg_HelPlus; - if (fHelicityDelayed == 0) input_register |= kInputReg_HelMinus; // even the mock data has balanced inputs! - if (fPatternPhaseNumber == fMinPatternPhase) input_register |= kInputReg_PatternSync; + if (fHelicityDelayed == 1) input_register |= fInputReg_HelPlus; + if (fHelicityDelayed == 0) input_register |= fInputReg_HelMinus; + if (fPatternPhaseNumber == fMinPatternPhase) input_register |= fInputReg_PatternSync; // Write the words to the buffer localbuffer.push_back(input_register); // input_register @@ -847,6 +855,22 @@ Int_t QwHelicity::LoadChannelMap(TString mapfile) if (mapstr.PopValue("patternbits",value)) { SetHelicityBitPattern(value); } + if (mapstr.PopValue("inputregmask_helicity",value)) { + fInputReg_HelPlus = value; + fInputReg_HelMinus = 0; + } + if (mapstr.PopValue("inputregmask_helplus",value)) { + fInputReg_HelPlus = value; + } + if (mapstr.PopValue("inputregmask_helminus",value)) { + fInputReg_HelMinus = value; + } + if (mapstr.PopValue("inputregmask_pattsync",value)) { + fInputReg_PatternSync = value; + } + if (mapstr.PopValue("inputregmask_pairsync",value)) { + fInputReg_PairSync = value; + } if (mapstr.PopValue("fakempsbit",value)) { fInputReg_FakeMPS = value; QwWarning << " fInputReg_FakeMPS 0x" << std::hex << fInputReg_FakeMPS << std::dec << QwLog::endl; From 01307c80079652d26d90b3638bddf2eb34444a8a Mon Sep 17 00:00:00 2001 From: Paul King Date: Tue, 11 Dec 2018 13:23:39 -0500 Subject: [PATCH 057/137] Finished adding map file options to specify the helicity bits. The meaning of the bits of the input register can now be specified in the QwHelicity map file, to allow the decoding of both the injector and counting house A helicity data. --- Parity/include/QwHelicity.h | 9 +++------ Parity/prminput/prexCH_helicity.map | 9 ++++++--- Parity/src/QwHelicity.cc | 8 ++++---- 3 files changed, 13 insertions(+), 13 deletions(-) diff --git a/Parity/include/QwHelicity.h b/Parity/include/QwHelicity.h index 10030d34e..d7ef5b3a0 100755 --- a/Parity/include/QwHelicity.h +++ b/Parity/include/QwHelicity.h @@ -149,7 +149,7 @@ class QwHelicity: public VQwSubsystemParity, public MQwSubsystemCloneable Date: Tue, 18 Dec 2018 14:09:19 -0500 Subject: [PATCH 058/137] Changes to allow bank decoding as implemented in Hall A DAQ. By default, if the subbank IDs are 31 or less, they would be interpreted as ROC IDs instead. A new command-line/configuration-file flag has been added to allow low bank ID values. If that flag is set, all ROC banks MUST be built from sub-banks, but then the sub-banks may have any ID value. Subbank IDs cannot be repeated within the same ROC, but they can be repeated in different ROCs. To allow this to work, the configuration file will be re-parsed at the start of each run, so if the new flag is different for different run ranges, we can specify it in an "extra" config file that can be run-ranged. --- Analysis/include/QwEventBuffer.h | 2 ++ Analysis/src/QwEventBuffer.cc | 24 ++++++++++++++++++++++-- Parity/main/QwParity.cc | 3 +++ 3 files changed, 27 insertions(+), 2 deletions(-) diff --git a/Analysis/include/QwEventBuffer.h b/Analysis/include/QwEventBuffer.h index bc6fc0389..9f8573dd5 100755 --- a/Analysis/include/QwEventBuffer.h +++ b/Analysis/include/QwEventBuffer.h @@ -166,6 +166,8 @@ class QwEventBuffer: public MQwCodaControlEvent{ TString fETSession; TString fETStationName; + Bool_t fAllowLowSubbankIDs; + Bool_t fChainDataFiles; std::pair fRunRange; std::string fRunListFileName; diff --git a/Analysis/src/QwEventBuffer.cc b/Analysis/src/QwEventBuffer.cc index 8f7ce5d48..82a506931 100755 --- a/Analysis/src/QwEventBuffer.cc +++ b/Analysis/src/QwEventBuffer.cc @@ -106,6 +106,10 @@ void QwEventBuffer::DefineOptions(QwOptions &options) options.AddDefaultOptions() ("codafile-ext", po::value()->default_value(fDefaultDataFileExtension), "extension of the input CODA filename"); + // Special flag to allow sub-bank IDs less than 31 + options.AddDefaultOptions() + ("allow-low-subbank-ids", po::value()->default_bool_value(false), + "allow the sub-bank ids to be 31 or less, when using this flag, all ROCs must be sub-banked"); // Options specific to the ET clients options.AddOptions("ET system options") ("ET.hostname", po::value(), @@ -170,6 +174,8 @@ void QwEventBuffer::ProcessOptions(QwOptions &options) fDataFileStem = options.GetValue("codafile-stem"); fDataFileExtension = options.GetValue("codafile-ext"); + fAllowLowSubbankIDs = options.GetValue("allow-low-subbank-ids"); + // Open run list file if (fRunListFileName.size() > 0) { fRunListFile = new QwParameterFile(fRunListFileName); @@ -818,6 +824,9 @@ Bool_t QwEventBuffer::FillSubsystemData(QwSubsystemArray &subsystems) } } } else { + QwDebug << "QwEventBuffer::FillSubsystemData: " + << "fROC=="<>16; // Bits 16-31 fSubbankType = (buffer[1]&0xFF00)>>8; // Bits 8-15 fSubbankNum = (buffer[1]&0xFF); // Bits 0-7 - if (fSubbankTag<=31){ + + QwDebug << "QwEventBuffer::DecodeSubbankHeader: " + << "fROC=="<("write-promptsummary")) { QwPromptSummary promptsummary(run_number, eventbuffer.GetSegmentNumber()); From 358abcf470a6c909159dfedd03d6ff9cbf0c20d5 Mon Sep 17 00:00:00 2001 From: Paul King Date: Thu, 20 Dec 2018 12:17:57 -0500 Subject: [PATCH 059/137] Decode and report SIS3801 header bits. The header bits for the SIS3801 scalers will now be decoded and reported in the raw tree. The header is not bit shifted, and does not have the channel number extracted. If you just want to see the SIS3801 user bits in the header, you would do something like: ((header & 0xc0000000)>>30). --- Analysis/include/QwScaler_Channel.h | 9 ++++++--- Analysis/src/QwScaler_Channel.cc | 22 ++++++++++++++++++++-- 2 files changed, 26 insertions(+), 5 deletions(-) diff --git a/Analysis/include/QwScaler_Channel.h b/Analysis/include/QwScaler_Channel.h index 1b204c96e..3fcda298a 100755 --- a/Analysis/include/QwScaler_Channel.h +++ b/Analysis/include/QwScaler_Channel.h @@ -152,10 +152,9 @@ class VQwScaler_Channel: public VQwHardwareChannel, public MQwMockable { void ConstructHistograms(TDirectory *folder, TString &prefix); void FillHistograms(); - void ConstructBranchAndVector(TTree *tree, TString &prefix, std::vector &values); - + virtual void ConstructBranchAndVector(TTree *tree, TString &prefix, std::vector &values) = 0; + virtual void FillTreeVector(std::vector &values) const = 0; void ConstructBranch(TTree *tree, TString &prefix); - void FillTreeVector(std::vector &values) const; inline void AccumulateRunningSum(const VQwScaler_Channel& value){ AccumulateRunningSum(value, value.fGoodEventCount); @@ -193,6 +192,7 @@ class VQwScaler_Channel: public VQwHardwareChannel, public MQwMockable { protected: static const Bool_t kDEBUG; + UInt_t fHeader; UInt_t fValue_Raw_Old; UInt_t fValue_Raw; Double_t fValue; @@ -230,6 +230,9 @@ class QwScaler_Channel: public VQwScaler_Channel void EncodeEventData(std::vector &buffer); Int_t ProcessEvBuffer(UInt_t* buffer, UInt_t num_words_left, UInt_t index = 0); + void ConstructBranchAndVector(TTree *tree, TString &prefix, std::vector &values); + void FillTreeVector(std::vector &values) const; + }; diff --git a/Analysis/src/QwScaler_Channel.cc b/Analysis/src/QwScaler_Channel.cc index d05b5a031..068db750d 100755 --- a/Analysis/src/QwScaler_Channel.cc +++ b/Analysis/src/QwScaler_Channel.cc @@ -31,6 +31,7 @@ void VQwScaler_Channel::InitializeChannel(TString name, TString datatosave) // Default mockdata parameters SetRandomEventParameters(300.0, 50.0); + fHeader = 0; fValue_Raw_Old = 0; fValue_Raw = 0; fValue = 0.0; @@ -63,6 +64,7 @@ void VQwScaler_Channel::InitializeChannel(TString subsystem, TString instrumentt void VQwScaler_Channel::ClearEventData() { + fHeader = 0; fValue_Raw = 0; fValue = 0.0; fValueM2 = 0.0; @@ -167,6 +169,7 @@ Int_t QwScaler_Channel::ProcessEvBuffer(UInt_t* buffer, UI // Skip over this data. words_read = fNumberOfDataWords; } else if (num_words_left >= fNumberOfDataWords) { + fHeader = (buffer[0] & ~data_mask); fValue_Raw = ((buffer[0] & data_mask) >> data_shift); fValue = fCalibrationFactor * (Double_t(fValue_Raw) - Double_t(fValue_Raw_Old) - fPedestal); words_read = fNumberOfDataWords; @@ -249,7 +252,9 @@ void VQwScaler_Channel::FillHistograms() } } -void VQwScaler_Channel::ConstructBranchAndVector(TTree *tree, TString &prefix, std::vector &values) + +template +void QwScaler_Channel::ConstructBranchAndVector(TTree *tree, TString &prefix, std::vector &values) { if (IsNameEmpty()){ // This channel is not used, so skip setting up the tree. @@ -265,6 +270,10 @@ void VQwScaler_Channel::ConstructBranchAndVector(TTree *tree, TString &prefix, if(fDataToSave==kRaw){ values.push_back(0.0); list += ":raw/D"; + if ((~data_mask) != 0){ + values.push_back(0.0); + list += ":header/D"; + } } fTreeArrayNumEntries = values.size() - fTreeArrayIndex; @@ -284,7 +293,8 @@ void VQwScaler_Channel::ConstructBranch(TTree *tree, TString &prefix) } } -void VQwScaler_Channel::FillTreeVector(std::vector &values) const +template +void QwScaler_Channel::FillTreeVector(std::vector &values) const { if (IsNameEmpty()) { // This channel is not used, so skip setting up the tree. @@ -312,6 +322,10 @@ void VQwScaler_Channel::FillTreeVector(std::vector &values) const values[index++] = this->fErrorFlag; if(fDataToSave==kRaw){ values[index++] = this->fValue_Raw; + if ((~data_mask) != 0){ + values[index++] = this->fHeader; + } + } } } @@ -383,6 +397,7 @@ VQwScaler_Channel& VQwScaler_Channel::operator=(const VQwScaler_Channel &value) if(this == &value) return *this; if (!IsNameEmpty()) { VQwHardwareChannel::operator=(value); + this->fHeader = value.fHeader; this->fValue_Raw = value.fValue_Raw; this->fValue = value.fValue; this->fValueError = value.fValueError; @@ -429,6 +444,7 @@ VQwScaler_Channel& VQwScaler_Channel::operator*= (const VQwScaler_Channel &value { if (!IsNameEmpty()){ this->fValue *= value.fValue; + fHeader = 0; fValue_Raw = 0; this->fValueM2 = 0.0; this->fErrorFlag |= (value.fErrorFlag);//error code is ORed. @@ -511,6 +527,7 @@ void VQwScaler_Channel::Ratio(const VQwScaler_Channel &numer, const VQwScaler_Ch *this /= denom; // Set the raw values to zero. + fHeader = 0; fValue_Raw = 0; // Remaining variables @@ -563,6 +580,7 @@ void VQwScaler_Channel::Product(VQwScaler_Channel &numer, VQwScaler_Channel &den { if (!IsNameEmpty()){ fValue = numer.fValue * denom.fValue; + fHeader = 0; fValue_Raw = 0; // Remaining variables From 4253f45ceb7a4a4c57fa6613669bc3c808468799 Mon Sep 17 00:00:00 2001 From: Paul King Date: Thu, 20 Dec 2018 12:23:04 -0500 Subject: [PATCH 060/137] Added parameter files for the PREX sub-bank data structures. Beginning with run 4747, the PREX data stream from the injector and counting house uses sub-banks in each of the ROC banks. The beamline and helicity map files have been modified to decode that data beginning with that run number. I have also added a "prex.conf" configuration which combines the decodong using the CHA and injector detector maps. This should be expanded as we define the spectrometer data structures. --- Parity/prminput/parity_hist.in | 9 +- Parity/prminput/prex.conf | 22 +++ Parity/prminput/prexCH.conf | 2 + Parity/prminput/prexCH_beamline.4747-.map | 65 ++++++++ Parity/prminput/prexCH_helicity.4747-.map | 43 ++++++ Parity/prminput/prex_detectors.map | 20 +++ Parity/prminput/prexbankflag.4747-.conf | 9 ++ Parity/prminput/prexbankflag.conf | 9 ++ Parity/prminput/prexinj.conf | 2 + Parity/prminput/prexinj_beamline.4747-.map | 167 +++++++++++++++++++++ Parity/prminput/prexinj_helicity.4100-.map | 85 +++++++++++ Parity/prminput/prexinj_helicity.4747-.map | 86 +++++++++++ 12 files changed, 515 insertions(+), 4 deletions(-) create mode 100644 Parity/prminput/prex.conf create mode 100644 Parity/prminput/prexCH_beamline.4747-.map create mode 100644 Parity/prminput/prexCH_helicity.4747-.map create mode 100644 Parity/prminput/prex_detectors.map create mode 100644 Parity/prminput/prexbankflag.4747-.conf create mode 100644 Parity/prminput/prexbankflag.conf create mode 100644 Parity/prminput/prexinj_beamline.4747-.map create mode 100644 Parity/prminput/prexinj_helicity.4100-.map create mode 100644 Parity/prminput/prexinj_helicity.4747-.map diff --git a/Parity/prminput/parity_hist.in b/Parity/prminput/parity_hist.in index 274720e6d..e746b922a 100755 --- a/Parity/prminput/parity_hist.in +++ b/Parity/prminput/parity_hist.in @@ -453,10 +453,10 @@ yield_qwk_.* TH1F 1000 -5.0e2 5.0e2 Counts Events asym.*_qwk_.* TH1F 1000 -5.0e2 5.0e2 Counts Events diff.*_qwk_.* TH1F 1000 -5.0e2 5.0e2 Counts Events -sca_.* TH1F -yield_sca_.* TH1F -asym.*_sca_.* TH1F -diff.*_sca_.* TH1F +sca.* TH1F 101 +yield_sca.* TH1F 101 +asym.*_sca.* TH1F 101 +diff.*_sca.* TH1F 101 ########################################### # Adding some fully wildcarded histogram names. @@ -468,3 +468,4 @@ diff.*_sca_.* TH1F .*_.w TH1F 1000 -5.0e9 5.0e9 CalibratedCounts Events .*_sw-hw_raw TH1F 1000 -5.0e2 5.0e2 Counts Events +.* TH1F 101 diff --git a/Parity/prminput/prex.conf b/Parity/prminput/prex.conf new file mode 100644 index 000000000..e82a6f463 --- /dev/null +++ b/Parity/prminput/prex.conf @@ -0,0 +1,22 @@ +# This configuration file is used to generate +# a ROOT file for injector beam studies +# +# To Run +# qwparity -r 5900 -c injector.conf +# +# Friday, January 7 22:53:34 EDT 2011 +# +add-config = prexbankflag.conf + +detectors = prex_detectors.map +chainfiles = no +single-output-file = yes +enable-tree-trim = no +disable-hel-tree = no +disable-histos = no +rootfile-stem = prexCH_ +codafile-stem = parity18_ +codafile-ext = dat + +ring.size = 200 +ring.stability_cut = -1 \ No newline at end of file diff --git a/Parity/prminput/prexCH.conf b/Parity/prminput/prexCH.conf index b8a502def..6cacafbe3 100644 --- a/Parity/prminput/prexCH.conf +++ b/Parity/prminput/prexCH.conf @@ -6,6 +6,8 @@ # # Friday, January 7 22:53:34 EDT 2011 # +add-config = prexbankflag.conf + detectors = prexCH_detectors.map chainfiles = no single-output-file = yes diff --git a/Parity/prminput/prexCH_beamline.4747-.map b/Parity/prminput/prexCH_beamline.4747-.map new file mode 100644 index 000000000..7467a9a07 --- /dev/null +++ b/Parity/prminput/prexCH_beamline.4747-.map @@ -0,0 +1,65 @@ + +ROC=23 +Bank=0x05 +vqwk_buffer_offset = 1 +!same sample size for ADCs in a given bank +sample_size=16564 +!Sample size should be unchanged - ask Paul King +! +! module.type, module.num chan.num, det.type, det.name, if unrotated then last column ->UNROTATED + + +!ADC0 + VQWK, 0, 0, bcm, QWK_0_0 + VQWK, 0, 1, bcm, QWK_0_1 + VQWK, 0, 2, bcm, BCM_US + VQWK, 0, 3, bcm, BCM_DS + VQWK, 0, 4, bcm, QWK_0_4 + VQWK, 0, 5, bcm, QWK_0_5 + VQWK, 0, 6, bcm, QWK_0_6 + VQWK, 0, 7, bcm, QWK_0_7 + +!ADC1 + VQWK, 1, 0, bpmstripline, BPM4Exp + VQWK, 1, 1, bpmstripline, BPM4Exm + VQWK, 1, 2, bpmstripline, BPM4Eyp + VQWK, 1, 3, bpmstripline, BPM4Eym + VQWK, 1, 4, bcm, QWK_1_4 + VQWK, 1, 5, bcm, QWK_1_5 + VQWK, 1, 6, bcm, QWK_1_6 + VQWK, 1, 7, bcm, QWK_1_7 + +!ADC2 + VQWK, 2, 0, bcm, QWK_2_0 + VQWK, 2, 1, bcm, QWK_2_1 + VQWK, 2, 2, bcm, QWK_2_2 + VQWK, 2, 3, bcm, QWK_2_3 + VQWK, 2, 4, bpmstripline, BPM4Axp + VQWK, 2, 5, bpmstripline, BPM4Axm + VQWK, 2, 6, bpmstripline, BPM4Ayp + VQWK, 2, 7, bpmstripline, BPM4Aym + +!ADC3 + VQWK, 3, 0, bcm, CAVB_X + VQWK, 3, 1, bcm, CAVB_Y + VQWK, 3, 2, bcm, CAVB_Q + VQWK, 3, 3, bcm, QWK_3_3 + VQWK, 3, 4, bcm, CAVC_X + VQWK, 3, 5, bcm, CAVC_Y + VQWK, 3, 6, bcm, CAVC_Q + VQWK, 3, 7, bcm, QWK_3_7 + +!ADC4 + VQWK, 4, 0, bcm, CAVD_X + VQWK, 4, 1, bcm, CAVD_Y + VQWK, 4, 2, bcm, CAVD_Q + VQWK, 4, 3, bcm, QWK_4_3 + VQWK, 4, 4, bcm, QWK_4_4 + VQWK, 4, 5, bcm, QWK_4_5 + VQWK, 4, 6, bcm, QWK_4_6 + VQWK, 4, 7, bcm, QWK_4_7 + + +[PUBLISH] +! new.tree.variable.name, analysis.class, old.tree.variable.name, element.to.store + q_targ, bcm, bcm_us, c diff --git a/Parity/prminput/prexCH_helicity.4747-.map b/Parity/prminput/prexCH_helicity.4747-.map new file mode 100644 index 000000000..c20759356 --- /dev/null +++ b/Parity/prminput/prexCH_helicity.4747-.map @@ -0,0 +1,43 @@ +!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! +!! input file for decoding the helicity subsystem +!! Of note in this file: +!! HelicityDecodingMode : will tell which mode of decoding is in use +!! : for now it can be InputRegisterMode, UserbitMode +!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + +ROC=23 +!!! MarkerWord=0xffb0b444 +Bank=0x1 + +!INPUT REGISTER MODE +HelicityDecodingMode=InputRegisterMode + +! Set the patternPhase (number of windows in a pattern) for each run range. +! If patternPhase!=4, then also set the NumberPatternsDelayed +! so the reported helicity is delayed by 8 windows (default 2). +NumberPatternsDelayed=2 +PatternPhase=4 + +!!! Specify the bitmasks for the patternsync, helicity, and pairsync if needed. +InputRegMask_PattSync=0x20 +InputRegMask_Helicity=0x40 +InputRegMask_PairSync=0x80 +InputRegMask_FakeMPS=0 !!! Do not use a input register bit to indicate a "fake" set of helicity bits + + +!Need to set PATTERNPHASEOFFSET = 1 (when pattern phase starts with 1) or 0 (when pattern phase starts with 0) +!default value for PATTERNPHASEOFFSET = 1 is set within the code itself which works fine with regular injector/beamline/parity mock data +!uncomment below line only if phase number start from 0 +PATTERNPHASEOFFSET=0 + + +! +! module.type, module.num chan.num, det.type, det.name +! +SKIP 2 +WORD, 0, 0, helicitydata, input_register +!END +! +!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! +!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! +!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! diff --git a/Parity/prminput/prex_detectors.map b/Parity/prminput/prex_detectors.map new file mode 100644 index 000000000..df04c94fb --- /dev/null +++ b/Parity/prminput/prex_detectors.map @@ -0,0 +1,20 @@ +# This is an example of a detector definition file. + +[QwBeamLine] + name = Injector + map = prexinj_beamline.map + geom = prexinj_beamline_geometry.map + eventcut = prexinj_beamline_eventcuts.map + param = prexinj_beamline_pedestal.map + +[QwHelicity] + name = Helicity info + map = prexinj_helicity.map + +[QwBeamLine] + name = CountingHouse + map = prexCH_beamline.map + geom = prexCH_beamline_geometry.map + eventcut = prexCH_beamline_eventcuts.map + param = prexCH_beamline_pedestal.map + diff --git a/Parity/prminput/prexbankflag.4747-.conf b/Parity/prminput/prexbankflag.4747-.conf new file mode 100644 index 000000000..a94b7a0dc --- /dev/null +++ b/Parity/prminput/prexbankflag.4747-.conf @@ -0,0 +1,9 @@ +# This configuration file is used to generate +# a ROOT file for injector beam studies +# +# To Run +# qwparity -r 5900 -c injector.conf +# +# Friday, January 7 22:53:34 EDT 2011 +# +allow-low-subbank-ids = yes diff --git a/Parity/prminput/prexbankflag.conf b/Parity/prminput/prexbankflag.conf new file mode 100644 index 000000000..69e30803c --- /dev/null +++ b/Parity/prminput/prexbankflag.conf @@ -0,0 +1,9 @@ +# This configuration file is used to generate +# a ROOT file for injector beam studies +# +# To Run +# qwparity -r 5900 -c injector.conf +# +# Friday, January 7 22:53:34 EDT 2011 +# +allow-low-subbank-ids = no diff --git a/Parity/prminput/prexinj.conf b/Parity/prminput/prexinj.conf index a13cd255d..b7cc1c82f 100644 --- a/Parity/prminput/prexinj.conf +++ b/Parity/prminput/prexinj.conf @@ -6,6 +6,8 @@ # # Friday, January 7 22:53:34 EDT 2011 # +add-config = prexbankflag.conf + detectors = prexinj_detectors.map chainfiles = no single-output-file = yes diff --git a/Parity/prminput/prexinj_beamline.4747-.map b/Parity/prminput/prexinj_beamline.4747-.map new file mode 100644 index 000000000..06b19d424 --- /dev/null +++ b/Parity/prminput/prexinj_beamline.4747-.map @@ -0,0 +1,167 @@ + +ROC=24 +Bank=0x02 +vqwk_buffer_offset=1 + +!same sample size for ADCs in a given bank +sample_size=16644 +! +! +! module.type, module.num chan.num, det.type, det.name + + +!ADC0 + VQWK, 0, 0, bpmstripline, bpm0I01Axp + VQWK, 0, 1, bpmstripline, bpm0I01Axm + VQWK, 0, 2, bpmstripline, bpm0I01Ayp + VQWK, 0, 3, bpmstripline, bpm0I01Aym + VQWK, 0, 4, bpmstripline, bpm1I04xp + VQWK, 0, 5, bpmstripline, bpm1I04xm + VQWK, 0, 6, bpmstripline, bpm1I04yp + VQWK, 0, 7, bpmstripline, bpm1I04ym + +!ADC1 + VQWK, 1, 0, bpmstripline, bpm1I02xp + VQWK, 1, 1, bpmstripline, bpm1I02xm + VQWK, 1, 2, bpmstripline, bpm1I02yp + VQWK, 1, 3, bpmstripline, bpm1I02ym + VQWK, 1, 4, bpmstripline, bpm0I01xp + VQWK, 1, 5, bpmstripline, bpm0I01xm + VQWK, 1, 6, bpmstripline, bpm0I01yp + VQWK, 1, 7, bpmstripline, bpm0I01ym + + +!ADC2 + VQWK, 2, 0, bpmstripline, bpm1I06xp + VQWK, 2, 1, bpmstripline, bpm1I06xm + VQWK, 2, 2, bpmstripline, bpm1I06yp + VQWK, 2, 3, bpmstripline, bpm1I06ym + VQWK, 2, 4, bpmstripline, bpm0I02xp + VQWK, 2, 5, bpmstripline, bpm0I02xm + VQWK, 2, 6, bpmstripline, bpm0I02yp + VQWK, 2, 7, bpmstripline, bpm0I02ym + +!ADC3 + VQWK, 3, 0, bpmstripline, bpm0I02Axp + VQWK, 3, 1, bpmstripline, bpm0I02Axm + VQWK, 3, 2, bpmstripline, bpm0I02Ayp + VQWK, 3, 3, bpmstripline, bpm0I02Aym + VQWK, 3, 4, bpmstripline, bpm0I05xp + VQWK, 3, 5, bpmstripline, bpm0I05xm + VQWK, 3, 6, bpmstripline, bpm0I05yp + VQWK, 3, 7, bpmstripline, bpm0I05ym + +!ADC4 + VQWK, 4, 0, bpmstripline, bpm0I07xp + VQWK, 4, 1, bpmstripline, bpm0I07xm + VQWK, 4, 2, bpmstripline, bpm0I07yp + VQWK, 4, 3, bpmstripline, bpm0I07ym + VQWK, 4, 4, bpmstripline, bpm0L01xp + VQWK, 4, 5, bpmstripline, bpm0L01xm + VQWK, 4, 6, bpmstripline, bpm0L01yp + VQWK, 4, 7, bpmstripline, bpm0L01ym + + +!ADC5 + VQWK, 5, 0, bpmstripline, bpm0L02xp + VQWK, 5, 1, bpmstripline, bpm0L02xm + VQWK, 5, 2, bpmstripline, bpm0L02yp + VQWK, 5, 3, bpmstripline, bpm0L02ym + VQWK, 5, 4, bpmstripline, bpm0L03xp + VQWK, 5, 5, bpmstripline, bpm0L03xm + VQWK, 5, 6, bpmstripline, bpm0L03yp + VQWK, 5, 7, bpmstripline, bpm0L03ym + +!ADC6 + VQWK, 6, 0, bpmstripline, bpm0L04xp + VQWK, 6, 1, bpmstripline, bpm0L04xm + VQWK, 6, 2, bpmstripline, bpm0L04yp + VQWK, 6, 3, bpmstripline, bpm0L04ym + VQWK, 6, 4, bpmstripline, bpm0L05xp + VQWK, 6, 5, bpmstripline, bpm0L05xm + VQWK, 6, 6, bpmstripline, bpm0L05yp + VQWK, 6, 7, bpmstripline, bpm0L05ym + +!ADC7 + VQWK, 7, 0, bpmstripline, bpm0L06xp + VQWK, 7, 1, bpmstripline, bpm0L06xm + VQWK, 7, 2, bpmstripline, bpm0L06yp + VQWK, 7, 3, bpmstripline, bpm0L06ym + VQWK, 7, 4, bpmstripline, bpm0L07xp + VQWK, 7, 5, bpmstripline, bpm0L07xm + VQWK, 7, 6, bpmstripline, bpm0L07yp + VQWK, 7, 7, bpmstripline, bpm0L07ym + +!ADC8 + VQWK, 8, 0, bpmstripline, bpm0L08xp + VQWK, 8, 1, bpmstripline, bpm0L08xm + VQWK, 8, 2, bpmstripline, bpm0L08yp + VQWK, 8, 3, bpmstripline, bpm0L08ym + VQWK, 8, 4, bpmstripline, bpm0L09xp + VQWK, 8, 5, bpmstripline, bpm0L09xm + VQWK, 8, 6, bpmstripline, bpm0L09yp + VQWK, 8, 7, bpmstripline, bpm0L09ym + +!ADC9 + VQWK, 9, 0, bpmstripline, bpm0L10xp + VQWK, 9, 1, bpmstripline, bpm0L10xm + VQWK, 9, 2, bpmstripline, bpm0L10yp + VQWK, 9, 3, bpmstripline, bpm0L10ym + VQWK, 9, 4, bpmstripline, bpm2I02xp + VQWK, 9, 5, bpmstripline, bpm2I02xm + VQWK, 9, 6, bpmstripline, bpm2I02yp + VQWK, 9, 7, bpmstripline, bpm2I02ym + +!ADC10 + VQWK, 10, 0, bpmstripline, bpm2I01xp + VQWK, 10, 1, bpmstripline, bpm2I01xm + VQWK, 10, 2, bpmstripline, bpm2I01yp + VQWK, 10, 3, bpmstripline, bpm2I01ym + VQWK, 10, 4, bcm, BCM0L02 + VQWK, 10, 5, bcm, Batery6 + VQWK, 10, 6, bcm, Batery7 + VQWK, 10, 7, bcm, PhaseMonitor + +!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! +Bank=0x01 +scaler_buffer_offset=6 +normclock=clk4MHz_1 + + SCALER, 0, 0, clock, sca0_0 + SCALER, 0, 1, clock, sca0_1 + SCALER, 0, 2, clock, sca0_2 + SCALER, 0, 3, clock, sca0_3 + SCALER, 0, 4, clock, sca0_4 + SCALER, 0, 5, clock, sca0_5 + SCALER, 0, 6, clock, sca0_6 + SCALER, 0, 7, clock, sca0_7 + SCALER, 0, 8, clock, sca0_8 + SCALER, 0, 9, clock, sca0_9 + SCALER, 0, 10, clock, sca0_10 + SCALER, 0, 11, clock, sca0_11 + SCALER, 0, 12, clock, sca0_12 + SCALER, 0, 13, clock, sca0_13 + SCALER, 0, 14, clock, sca0_14 + SCALER, 0, 15, clock, sca0_15 + + SCALER, 0, 16, halomonitor, sca0_16 + SCALER, 0, 17, clock, clk4MHz_1 + SCALER, 0, 18, clock, clk4MHz_2 + SCALER, 0, 19, clock, clk4MHz_3 + SCALER, 0, 20, halomonitor, sca0_20 + SCALER, 0, 21, halomonitor, sca0_21 + SCALER, 0, 22, halomonitor, sca0_22 + SCALER, 0, 23, halomonitor, sca0_23 + SCALER, 0, 24, halomonitor, sca0_24 + SCALER, 0, 25, halomonitor, sca0_25 + SCALER, 0, 26, halomonitor, sca0_26 + SCALER, 0, 27, halomonitor, sca0_27 + SCALER, 0, 28, halomonitor, sca0_28 + SCALER, 0, 29, halomonitor, sca0_29 + SCALER, 0, 30, halomonitor, sca0_30 + SCALER, 0, 31, halomonitor, sca0_31 + + +[PUBLISH] +# # q_targ, bcm, bcm0l02, c +# q_targ, bpmstripline, bpm0i02, ef ### Effective charge of BPM0i02 diff --git a/Parity/prminput/prexinj_helicity.4100-.map b/Parity/prminput/prexinj_helicity.4100-.map new file mode 100644 index 000000000..9b3046ce2 --- /dev/null +++ b/Parity/prminput/prexinj_helicity.4100-.map @@ -0,0 +1,85 @@ +!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! +!! input file for decoding the helicity subsystem +!! Of note in this file: +!! HelicityDecodingMode : will tell which mode of decoding is in use +!! : for now it can be InputRegisterMode, UserbitMode +!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + +!Injector data during happex data taking: run 12331, 12354, 12356 +!HelicityDecodingMode=InputRegisterMode +!PatternPhase=4 +!ROC=23 +! +! Header=0xfdacf000 +! HAPPEX BMW words +!SKIP 148 +!WORD, 0, 0, helicitydata, ha_cleandata +!WORD, 0, 0, helicitydata, ha_scandata1 +! +!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! +!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! +!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + +!INPUT REGISTER MODE +HelicityDecodingMode=InputRegisterMode + +InputRegMask_FakeMPS=0 !!! Do not use a input register bit to indicate a "fake" set of helicity bits + +! Set the patternPhase (number of windows in a pattern) for each run range. +! If patternPhase!=4, then also set the NumberPatternsDelayed +! so the reported helicity is delayed by 8 windows (default 2). +!NumberPatternsDelayed=4 +PatternPhase=4 + + + +!Need to set PATTERNPHASEOFFSET = 1 (when pattern phase starts with 1) or 0 (when pattern phase starts with 0) +!default value for PATTERNPHASEOFFSET = 1 is set within the code itself which works fine with regular injector/beamline/parity mock data +!uncomment below line only if phase number start from 0 +PATTERNPHASEOFFSET=0 + + +!seed size is either 24 bit or 30 bit. default is 30 bit +!RandSeedBits=24 + +ROC=24 +MarkerWord=0x00003103 + +! +! module.type, module.num chan.num, det.type, det.name +! +WORD, 0, 0, helicitydata, input_register +WORD, 0, 0, helicitydata, output_register +SKIP 1 ! WORD, 0, 0, helicitydata, sca_MPS_num +SKIP 1 ! WORD, 0, 0, helicitydata, sca_PAT_counter +SKIP 1 ! WORD, 0, 0, helicitydata, sca_PAT_phase +SKIP 3 +WORD, 0, 0, helicitydata, cleandata +WORD, 0, 0, helicitydata, scandata1 +WORD, 0, 0, helicitydata, scandata2 +SKIP 1 +!END +! +!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! +!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! +!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + +!USER BIT MODE + +!HelicityDecodingMode= UserbitMode +!PatternPhase=4 +!seed size is either 24 bit or 30 bit. default is 24 bit +!RandSeedBits=24 +!RandSeedBits=30 +!ROC=31 +!Bank=0x3101 +! +! module.type, module.num chan.num, det.type, det.name +! +!WORD, 0, 0, helicitydata, cleandata +!WORD, 0, 0, helicitydata, scandata1 +!WORD, 0, 0, helicitydata, scandata2 +!WORD, 0, 0, helicitydata, scalerheader +!WORD, 0, 0, helicitydata, scalercounter +!WORD, 0, 0, helicitydata, userbit +!END diff --git a/Parity/prminput/prexinj_helicity.4747-.map b/Parity/prminput/prexinj_helicity.4747-.map new file mode 100644 index 000000000..992ba0ef7 --- /dev/null +++ b/Parity/prminput/prexinj_helicity.4747-.map @@ -0,0 +1,86 @@ +!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! +!! input file for decoding the helicity subsystem +!! Of note in this file: +!! HelicityDecodingMode : will tell which mode of decoding is in use +!! : for now it can be InputRegisterMode, UserbitMode +!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + +!Injector data during happex data taking: run 12331, 12354, 12356 +!HelicityDecodingMode=InputRegisterMode +!PatternPhase=4 +!ROC=23 +! +! Header=0xfdacf000 +! HAPPEX BMW words +!SKIP 148 +!WORD, 0, 0, helicitydata, ha_cleandata +!WORD, 0, 0, helicitydata, ha_scandata1 +! +!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! +!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! +!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + +!INPUT REGISTER MODE +HelicityDecodingMode=InputRegisterMode + +InputRegMask_FakeMPS=0 !!! Do not use a input register bit to indicate a "fake" set of helicity bits + +! Set the patternPhase (number of windows in a pattern) for each run range. +! If patternPhase!=4, then also set the NumberPatternsDelayed +! so the reported helicity is delayed by 8 windows (default 2). +!NumberPatternsDelayed=4 +PatternPhase=4 + + + +!Need to set PATTERNPHASEOFFSET = 1 (when pattern phase starts with 1) or 0 (when pattern phase starts with 0) +!default value for PATTERNPHASEOFFSET = 1 is set within the code itself which works fine with regular injector/beamline/parity mock data +!uncomment below line only if phase number start from 0 +PATTERNPHASEOFFSET=0 + + +!seed size is either 24 bit or 30 bit. default is 30 bit +!RandSeedBits=24 + +ROC=24 +Bank=0x3 + +! +! module.type, module.num chan.num, det.type, det.name +! +SKIP 1 ! This is the marker word for PAN +WORD, 0, 0, helicitydata, input_register +WORD, 0, 0, helicitydata, output_register +SKIP 1 ! WORD, 0, 0, helicitydata, sca_MPS_num +SKIP 1 ! WORD, 0, 0, helicitydata, sca_PAT_counter +SKIP 1 ! WORD, 0, 0, helicitydata, sca_PAT_phase +SKIP 3 +WORD, 0, 0, helicitydata, cleandata +WORD, 0, 0, helicitydata, scandata1 +WORD, 0, 0, helicitydata, scandata2 +SKIP 1 +!END +! +!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! +!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! +!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + +!USER BIT MODE + +!HelicityDecodingMode= UserbitMode +!PatternPhase=4 +!seed size is either 24 bit or 30 bit. default is 24 bit +!RandSeedBits=24 +!RandSeedBits=30 +!ROC=31 +!Bank=0x3101 +! +! module.type, module.num chan.num, det.type, det.name +! +!WORD, 0, 0, helicitydata, cleandata +!WORD, 0, 0, helicitydata, scandata1 +!WORD, 0, 0, helicitydata, scandata2 +!WORD, 0, 0, helicitydata, scalerheader +!WORD, 0, 0, helicitydata, scalercounter +!WORD, 0, 0, helicitydata, userbit +!END From 0469391e2d7492df162d1bdb7d0d46a99a2154f1 Mon Sep 17 00:00:00 2001 From: Paul King Date: Fri, 21 Dec 2018 09:10:04 -0500 Subject: [PATCH 061/137] Updated the new prexCH map to have the consistent cavity monitor names. --- Parity/prminput/prexCH_beamline.4747-.map | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/Parity/prminput/prexCH_beamline.4747-.map b/Parity/prminput/prexCH_beamline.4747-.map index 7467a9a07..2204342cf 100644 --- a/Parity/prminput/prexCH_beamline.4747-.map +++ b/Parity/prminput/prexCH_beamline.4747-.map @@ -40,19 +40,19 @@ sample_size=16564 VQWK, 2, 7, bpmstripline, BPM4Aym !ADC3 - VQWK, 3, 0, bcm, CAVB_X - VQWK, 3, 1, bcm, CAVB_Y - VQWK, 3, 2, bcm, CAVB_Q + VQWK, 3, 0, bcm, CAV4BX + VQWK, 3, 1, bcm, CAV4BY + VQWK, 3, 2, bcm, CAV4BQ VQWK, 3, 3, bcm, QWK_3_3 - VQWK, 3, 4, bcm, CAVC_X - VQWK, 3, 5, bcm, CAVC_Y - VQWK, 3, 6, bcm, CAVC_Q + VQWK, 3, 4, bcm, CAV4CX + VQWK, 3, 5, bcm, CAV4CY + VQWK, 3, 6, bcm, CAV4CQ VQWK, 3, 7, bcm, QWK_3_7 !ADC4 - VQWK, 4, 0, bcm, CAVD_X - VQWK, 4, 1, bcm, CAVD_Y - VQWK, 4, 2, bcm, CAVD_Q + VQWK, 4, 0, bcm, CAV4DX + VQWK, 4, 1, bcm, CAV4DY + VQWK, 4, 2, bcm, CAV4DQ VQWK, 4, 3, bcm, QWK_4_3 VQWK, 4, 4, bcm, QWK_4_4 VQWK, 4, 5, bcm, QWK_4_5 From bdb6bd08182cf06df690671713fbbc4bd8b6c6e7 Mon Sep 17 00:00:00 2001 From: Wouter Deconinck Date: Wed, 16 Jan 2019 13:49:19 -0500 Subject: [PATCH 062/137] Ignore SetupFiles/SET_ME_UP.* --- .gitignore | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.gitignore b/.gitignore index 20a666b63..c9e9007c3 100644 --- a/.gitignore +++ b/.gitignore @@ -55,3 +55,6 @@ Doxygen/html #tmp files *~ z_* + +# setup files +SetupFiles/SET_ME_UP.* From 8668f0c1ce42bb4bec33da48bce5dcff331a0c64 Mon Sep 17 00:00:00 2001 From: Wouter Deconinck Date: Wed, 16 Jan 2019 17:54:14 -0500 Subject: [PATCH 063/137] Changes to FindET in line with Podd --- cmake/modules/FindET.cmake | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/cmake/modules/FindET.cmake b/cmake/modules/FindET.cmake index 5c7ac9572..19f6e5e3b 100644 --- a/cmake/modules/FindET.cmake +++ b/cmake/modules/FindET.cmake @@ -3,6 +3,7 @@ ### In principle this could be generalized, but would need to have guards ### to verify the library has been compiled with the correct flag. +set(arch ${CMAKE_SYSTEM_NAME}-${CMAKE_SYSTEM_PROCESSOR}) # if( DEFINED ENV{CODA} ) find_library(ET_LIBRARY et @@ -21,7 +22,13 @@ ) # endif() -message("Foud ET: ${ET_INCLUDE_DIR}, ${ET_LIBRARY}") +if(NOT TARGET EVIO::ET AND ET_LIBRARY AND ET_INCLUDE_DIR) + add_library(EVIO::ET SHARED IMPORTED) + set_target_properties(EVIO::ET PROPERTIES + INTERFACE_INCLUDE_DIRECTORIES "${ET_INCLUDE_DIR}" + IMPORTED_LOCATION "${ET_LIBRARY}" + ) +endif() include(FindPackageHandleStandardArgs) -FIND_PACKAGE_HANDLE_STANDARD_ARGS(ET "The ET libraries were not found; online analysis will be disabled." ET_INCLUDE_DIR ET_LIBRARY) +find_package_handle_standard_args(ET ET_INCLUDE_DIR ET_LIBRARY) From 2e35d399da50c385af4dcdce55871e0bdb7f8de9 Mon Sep 17 00:00:00 2001 From: Wouter Deconinck Date: Wed, 16 Jan 2019 18:13:21 -0500 Subject: [PATCH 064/137] CMakeLists.txt to build evio as subdirectory --- evio/CMakeLists.txt | 95 +++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 95 insertions(+) create mode 100644 evio/CMakeLists.txt diff --git a/evio/CMakeLists.txt b/evio/CMakeLists.txt new file mode 100644 index 000000000..d5168718d --- /dev/null +++ b/evio/CMakeLists.txt @@ -0,0 +1,95 @@ +cmake_minimum_required(VERSION 3.5) + + +#---------------------------------------------------------------------------- +# Sources and headers +# +file(GLOB my_evio_headers + include/THaCoda*.h + include/evio.h + ) +file(GLOB my_evio_sources + src/THaCoda*.C + src/evio.C + src/swap_util.C + ) + + +#---------------------------------------------------------------------------- +# CODA ET +# +find_package(ET) +IF(ET_FOUND) + add_definitions(-D__CODA_ET) + include_directories(${ET_INCLUDE_DIR}) + list(APPEND my_evio_headers + include/THaEtClient.h + ) + list(APPEND my_evio_sources + src/THaEtClient.C + ) +else(ET_FOUND) + set(ET_LIBRARY "") +endif(ET_FOUND) + + +#---------------------------------------------------------------------------- +# dictionaries +# +message(STATUS "Generating evio dictionaries for ROOT ${ROOT_VERSION}...") +foreach(file ${my_evio_headers}) + # Find the header files that have uncommented ClassDef lines + execute_process(COMMAND grep -l "[^/]ClassDef" ${file} OUTPUT_VARIABLE result) + if(result) + # Get path and filename without extension + get_filename_component(file_path ${file} PATH) + get_filename_component(file_name ${file} NAME_WE) + # Add dictionary target with possible LinkDef file + set(dict ${CMAKE_CURRENT_BINARY_DIR}/${file_name}Dict) + set(linkdef ${file_path}/${file_name}LinkDef.h) + if(NOT EXISTS ${linkdef}) + file(TOUCH ${linkdef}) + endif() + build_root_dictionary(${file_name} ${file} + TARGETS evio + LINKDEF ${linkdef} + ) + # Add dictionary to evio sources + set(my_evio_sources ${my_evio_sources} ${file_name}Dict.cxx) + endif() +endforeach() + + +#---------------------------------------------------------------------------- +# evio library +# +add_library(evio SHARED ${my_evio_sources}) + +target_include_directories(evio + PUBLIC + $ + $ + $ + ) + +target_compile_options(evio + PUBLIC + ${${PROJECT_NAME_UC}_CXX_FLAGS_LIST} + PRIVATE + ${${PROJECT_NAME_UC}_DIAG_FLAGS_LIST} + ) + +target_link_libraries(evio + PUBLIC + ROOT::Libraries + ) + +install(TARGETS evio + EXPORT ${MAIN_PROJECT_NAME_LC}-exports + LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} + ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} + RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} + ) + +install(FILES ${my_evio_headers} DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}) + From 92d50340bf63d48d8538dd8d95197a34951093ea Mon Sep 17 00:00:00 2001 From: Wouter Deconinck Date: Wed, 16 Jan 2019 18:13:41 -0500 Subject: [PATCH 065/137] CMakeLists.txt to build everything using modern FindROOT.cmake --- CMakeLists.txt | 331 ++++++++++++++++++++++++------------------------- 1 file changed, 162 insertions(+), 169 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index b81af521d..393ac3d22 100755 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,15 +1,28 @@ -# Require at least cmake 2.8.4 -cmake_minimum_required(VERSION 2.8.4 FATAL_ERROR) +cmake_minimum_required(VERSION 3.5) # Name of this project -project(QwAnalysis) +project(QwAnalysis VERSION 0.1 LANGUAGES CXX) -# Install in the -set(CMAKE_INSTALL_PREFIX ${CMAKE_SOURCE_DIR}) -set(CMAKE_INSTALL_RPATH "${CMAKE_INSTALL_PREFIX}/lib") +# Local path for cmake modules +list(APPEND CMAKE_MODULE_PATH "${PROJECT_SOURCE_DIR}/cmake/modules/") +# Default install path is the source directory +if (CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT) + message(STATUS " Install-prefix was at default -> forcing it to the source-dir" ) + message(STATUS " Use -DCMAKE_INSTALL_PREFIX=/usr/local to set to something else" ) + set (CMAKE_INSTALL_PREFIX "${CMAKE_SOURCE_DIR}" + CACHE PATH "default install path" FORCE) +endif() + +# Use our modules and utility functions +include(CMakeEnv) + +# Install in GNU-style directory layout +include(GNUInstallDirs) +set(INSTALL_CONFIGDIR "${CMAKE_INSTALL_LIBDIR}/${PROJECT_NAME}") + +# Mac support message(STATUS "System name ${CMAKE_SYSTEM_NAME}") -#MAC specific variable if(${CMAKE_SYSTEM_NAME} MATCHES "Darwin") set(CMAKE_MACOSX_RPATH ON) set(CMAKE_SKIP_BUILD_RPATH FALSE) @@ -22,137 +35,91 @@ if(${CMAKE_SYSTEM_NAME} MATCHES "Darwin") endif() endif() -# Local path for cmake modules, before ${CMAKE_ROOT}/Modules/ is checked -list(APPEND CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/cmake/modules/") - -# Add the project include directory -include_directories( - ${CMAKE_CURRENT_BINARY_DIR}/include - ${CMAKE_CURRENT_SOURCE_DIR}/evio/include - ${CMAKE_CURRENT_SOURCE_DIR}/Parity/include - ${CMAKE_CURRENT_SOURCE_DIR}/Analysis/include - ) -# Put all QwAnalysis files in my_project_sources -file(GLOB my_project_headers - ${CMAKE_CURRENT_SOURCE_DIR}/Analysis/include/*.h - ${CMAKE_CURRENT_SOURCE_DIR}/Parity/include/*.h - ${CMAKE_CURRENT_BINARY_DIR}/include/QwSVNVersion.h - ) +#---------------------------------------------------------------------------- +# Sources and headers +# file(GLOB my_project_sources - ### ${CMAKE_CURRENT_SOURCE_DIR}/Analysis/src/*.cc - ${CMAKE_CURRENT_SOURCE_DIR}/Parity/src/*.cc - ) -list(APPEND my_project_sources - ${CMAKE_CURRENT_SOURCE_DIR}/Analysis/src/MQwCodaControlEvent.cc - ${CMAKE_CURRENT_SOURCE_DIR}/Analysis/src/MQwF1TDC.cc - ${CMAKE_CURRENT_SOURCE_DIR}/Analysis/src/MQwMockable.cc - ${CMAKE_CURRENT_SOURCE_DIR}/Analysis/src/MQwV775TDC.cc - ${CMAKE_CURRENT_SOURCE_DIR}/Analysis/src/QwColor.cc - ${CMAKE_CURRENT_SOURCE_DIR}/Analysis/src/QwEPICSEvent.cc - ${CMAKE_CURRENT_SOURCE_DIR}/Analysis/src/QwEventBuffer.cc - ${CMAKE_CURRENT_SOURCE_DIR}/Analysis/src/QwF1TDContainer.cc - ${CMAKE_CURRENT_SOURCE_DIR}/Analysis/src/QwHistogramHelper.cc - ${CMAKE_CURRENT_SOURCE_DIR}/Analysis/src/QwLog.cc - ${CMAKE_CURRENT_SOURCE_DIR}/Analysis/src/QwOmnivore.cc - ${CMAKE_CURRENT_SOURCE_DIR}/Analysis/src/QwOptions.cc - ${CMAKE_CURRENT_SOURCE_DIR}/Analysis/src/QwParameterFile.cc - ${CMAKE_CURRENT_SOURCE_DIR}/Analysis/src/QwPMT_Channel.cc - ${CMAKE_CURRENT_SOURCE_DIR}/Analysis/src/QwPromptSummary.cc - ${CMAKE_CURRENT_SOURCE_DIR}/Analysis/src/QwRint.cc - ${CMAKE_CURRENT_SOURCE_DIR}/Analysis/src/QwRootFile.cc - ${CMAKE_CURRENT_SOURCE_DIR}/Analysis/src/QwRunCondition.cc - ${CMAKE_CURRENT_SOURCE_DIR}/Analysis/src/QwScaler_Channel.cc - ${CMAKE_CURRENT_SOURCE_DIR}/Analysis/src/QwSIS3320_Accumulator.cc - ${CMAKE_CURRENT_SOURCE_DIR}/Analysis/src/QwSIS3320_LogicalAccumulator.cc - ${CMAKE_CURRENT_SOURCE_DIR}/Analysis/src/QwSIS3320_Samples.cc - ${CMAKE_CURRENT_SOURCE_DIR}/Analysis/src/QwSubsystemArray.cc - ${CMAKE_CURRENT_SOURCE_DIR}/Analysis/src/QwTypes.cc - ${CMAKE_CURRENT_SOURCE_DIR}/Analysis/src/QwVQWK_Channel.cc - ${CMAKE_CURRENT_SOURCE_DIR}/Analysis/src/VQwHardwareChannel.cc - ${CMAKE_CURRENT_SOURCE_DIR}/Analysis/src/VQwSubsystem.cc -) - -# Put all evio files in my_project_sources (exclude THaEtClient) -file(GLOB my_evio_headers - ${CMAKE_CURRENT_SOURCE_DIR}/evio/include/THaCoda*.h - ${CMAKE_CURRENT_SOURCE_DIR}/evio/include/evio.h + Analysis/src/*.cc + Parity/src/*.cc ) -file(GLOB my_evio_sources - ${CMAKE_CURRENT_SOURCE_DIR}/evio/src/THaCoda*.C - ${CMAKE_CURRENT_SOURCE_DIR}/evio/src/evio.C - ${CMAKE_CURRENT_SOURCE_DIR}/evio/src/swap_util.C +file(GLOB my_project_headers + Analysis/include/*.h + Parity/include/*.h ) -# Load ROOT and setup include directory -find_package(ROOT REQUIRED) -include(${ROOT_USE_FILE}) - -# Load MYSQLPP +#---------------------------------------------------------------------------- +# MYSQLPP +# find_package(MYSQLPP) IF(MYSQLPP_FOUND) + config_add_dependency(MYSQLPP) include_directories(${MYSQLPP_INCLUDE_DIR}) ## KLUDGE: For now, do not define the __USE_DATABASE__ flag, because we're still missing some of the database support files. --- P.King, 05jun2018 - message("-- The \"__USE_DATABASE__\" flag is commented out in CMakeLists.txt; database support is DISABLED.") + message(STATUS " The \"__USE_DATABASE__\" flag is commented out in CMakeLists.txt; database support is DISABLED.") # add_definitions(-D__USE_DATABASE__) - # list(APPEND my_project_sources - # ${CMAKE_CURRENT_SOURCE_DIR}/Analysis/src/QwDatabase.cc - # ) - message("-- Forcing MYSQLPP_LIBRARIES to \"\".") - SET(MYSQLPP_LIBRARIES "") + message(STATUS " Forcing MYSQLPP_LIBRARIES to \"\".") + set(MYSQLPP_LIBRARIES "") ELSE(MYSQLPP_FOUND) - SET(MYSQLPP_LIBRARIES "") + set(MYSQLPP_LIBRARIES "") + list(REMOVE_ITEM my_project_sources + Analysis/src/QwDatabase.cc + ) endif(MYSQLPP_FOUND) -# Find Boost libraries -# There seems to be a bug starting in version 2.8.4 of CMake's boost -# finding process. As such, we'll disable it here and require 2.8.4 or higher -SET( Boost_NO_BOOST_CMAKE ON ) +#---------------------------------------------------------------------------- +# Boost +# find_package(Boost COMPONENTS program_options filesystem system regex REQUIRED) include_directories(${Boost_INCLUDE_DIRS}) link_directories(${Boost_LIBRARY_DIR}) -# Find the CODA ET libaries -find_package(ET) -IF(ET_FOUND) - add_definitions(-D__CODA_ET) - include_directories(${ET_INCLUDE_DIR}) - list(APPEND my_evio_headers - ${CMAKE_CURRENT_SOURCE_DIR}/evio/include/THaEtClient.h - ) - list(APPEND my_evio_sources - ${CMAKE_CURRENT_SOURCE_DIR}/evio/src/THaEtClient.C - ) -else(ET_FOUND) - SET(ET_LIBRARY "") -endif(ET_FOUND) +#---------------------------------------------------------------------------- +# ROOT +# +set(minimum_root_version 6.0) +find_package(ROOT ${minimum_root_version} REQUIRED) +config_add_dependency(ROOT ${minimum_root_version}) -add_definitions(-std=c++11) -# Create dictionaries for headers that contain "ClassDef" -message("Generating evio dictionaries for ROOT ${ROOT_VERSION}...") -foreach(file ${my_evio_headers}) - # Find the header files that have uncommented ClassDef lines - execute_process(COMMAND grep -l "[^/]ClassDef" ${file} OUTPUT_VARIABLE result) - if(result) - # Get path and filename without extension - get_filename_component(file_path ${file} PATH) - get_filename_component(file_name ${file} NAME_WE) - # Add dictionary target with possible LinkDef file - set(dict ${CMAKE_CURRENT_BINARY_DIR}/${file_name}Dict) - ROOT_GENERATE_DICTIONARY( - ${dict} - ${file} - OPTIONS -p) - # Add dictionary to evio sources - set(my_evio_sources ${my_evio_sources} ${dict}.cxx) - # Add pcm file to list - if(ROOT_VERSION VERSION_GREATER 5.90) - set(pcmfiles ${pcmfiles} ${dict}_rdict.pcm) - endif() - endif() -endforeach() -message("Generating QwAnalysis dictionaries for ROOT ${ROOT_VERSION}...") +#---------------------------------------------------------------------------- +# gitinfo.hh +# +add_custom_command( + OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/include/gitinfo.hh.does_not_exist + COMMAND ${CMAKE_CURRENT_SOURCE_DIR}/bin/pullgitinfo.py ${CMAKE_CURRENT_SOURCE_DIR} + COMMENT "Getting Git information" + ) +add_custom_command( + OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/include/gitinfo.hh + COMMAND echo -n + DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/include/gitinfo.hh.does_not_exist + ) +set_property( + SOURCE Analysis/src/QwOptions.cc Analysis/src/QwRunCondition.cc + APPEND PROPERTY OBJECT_DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/include/gitinfo.hh + ) + + +#---------------------------------------------------------------------------- +# Compiler flags +# +set_compiler_flags("${ROOT_CXX_FLAGS}") +#set_diagnostic_flags(WALL WEXTRA) +set_diagnostic_flags(WALL) +report_build_info() + + +#---------------------------------------------------------------------------- +# evio library +# +add_subdirectory(evio) +include_directories(evio/include) + +#---------------------------------------------------------------------------- +# main dictionaries +# +message(STATUS "Generating ${PROJECT_NAME} dictionaries for ROOT ${ROOT_VERSION}...") foreach(file ${my_project_headers}) # Find the header files that have uncommented ClassDef lines execute_process(COMMAND grep -l "[^/]ClassDef" ${file} OUTPUT_VARIABLE result) @@ -163,74 +130,93 @@ foreach(file ${my_project_headers}) # Add dictionary target with possible LinkDef file set(dict ${CMAKE_CURRENT_BINARY_DIR}/${file_name}Dict) set(linkdef ${file_path}/${file_name}LinkDef.h) - if(EXISTS ${linkdef}) - ROOT_GENERATE_DICTIONARY( - ${dict} - ${file} - LINKDEF ${linkdef} - OPTIONS -p) - else() - ROOT_GENERATE_DICTIONARY( - ${dict} - ${file} - OPTIONS -p) + if(NOT EXISTS ${linkdef}) + file(TOUCH ${linkdef}) endif() + build_root_dictionary(${file_name} ${file} + TARGETS ${PROJECT_NAME} + LINKDEF ${linkdef} + ) # Add dictionary to project sources set(my_project_sources ${my_project_sources} ${dict}.cxx) - # Add pcm file to list - if(ROOT_VERSION VERSION_GREATER 5.90) - set(pcmfiles ${pcmfiles} ${dict}_rdict.pcm) - endif() endif() endforeach() -# Add target of QwGitVersion.h -add_custom_command( - OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/include/gitinfo.hh.does_not_exist - COMMAND ${CMAKE_CURRENT_SOURCE_DIR}/bin/pullgitinfo.py ${CMAKE_CURRENT_SOURCE_DIR} - COMMENT "Getting Git information" - ) -add_custom_command( - OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/include/gitinfo.hh - COMMAND echo -n - DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/include/gitinfo.hh.does_not_exist - ) -set_property( - SOURCE ${CMAKE_SOURCE_DIR}/Analysis/src/QwOptions.cc ${CMAKE_SOURCE_DIR}/Analysis/src/QwRunCondition.cc - APPEND PROPERTY OBJECT_DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/include/gitinfo.hh + +#---------------------------------------------------------------------------- +# main library +# +add_library(${PROJECT_NAME} SHARED ${my_project_sources} ${my_project_headers} + ${CMAKE_CURRENT_BINARY_DIR}/include/gitinfo.hh) + +target_include_directories(${PROJECT_NAME} + PUBLIC + $ + $ + $ + $ ) -# Link the evio library -add_library(evio SHARED ${my_evio_sources}) -target_link_libraries(evio) -install(TARGETS evio DESTINATION "${CMAKE_INSTALL_PREFIX}/lib") +target_compile_options(${PROJECT_NAME} + PUBLIC + ${${PROJECT_NAME_UC}_CXX_FLAGS_LIST} + PRIVATE + ${${PROJECT_NAME_UC}_DIAG_FLAGS_LIST} + ) -# Link the ROOT libraries -add_library(QwAnalysis SHARED ${CMAKE_CURRENT_BINARY_DIR}/include/gitinfo.hh ${my_project_sources} ${my_project_headers}) -target_link_libraries(QwAnalysis - evio ${ROOT_LIBRARIES} ${MYSQLPP_LIBRARIES} ${Boost_LIBRARIES}) -install(TARGETS QwAnalysis DESTINATION "${CMAKE_INSTALL_PREFIX}/lib") +target_link_libraries(${PROJECT_NAME} + PRIVATE + evio + PUBLIC + ROOT::Libraries + ${MYSQLPP_LIBRARIES} + ${Boost_LIBRARIES} + ) -# Install pcm files into lib -install(FILES ${pcmfiles} DESTINATION ${CMAKE_SOURCE_DIR}/lib) +install(TARGETS ${PROJECT_NAME} + EXPORT ${MAIN_PROJECT_NAME_LC}-exports + LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} + ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} + RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} + ) +install(FILES ${my_project_headers} DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}) -# Add the target executables +#---------------------------------------------------------------------------- +# executables +# file(GLOB exefiles - ${CMAKE_SOURCE_DIR}/Parity/main/*.cc - ${CMAKE_SOURCE_DIR}/Analysis/main/*.cc - ) + Parity/main/*.cc + Analysis/main/*.cc +) foreach(file ${exefiles}) get_filename_component(filename ${file} NAME_WE) string(TOLOWER ${filename} filelower) + add_executable(${filelower} ${file}) - target_link_libraries( - ${filelower} - ${ROOT_LIBRARIES} ${MYSQLPP_LIBRARIES} ${Boost_LIBRARIES} QwAnalysis evio ${ET_LIBRARY} - ) - install(TARGETS ${filelower} DESTINATION "${CMAKE_INSTALL_PREFIX}/bin") + + target_link_libraries(${filelower} + PRIVATE + ${PROJECT_NAME} + ) + target_compile_options(${filelower} + PUBLIC + ${${PROJECT_NAME_UC}_CXX_FLAGS_LIST} + PRIVATE + ${${PROJECT_NAME_UC}_DIAG_FLAGS_LIST} + ) + if(${CMAKE_SYSTEM_NAME} MATCHES Linux) + target_compile_options(${filelower} PUBLIC -fPIC) + endif() + + install(TARGETS ${filelower} + DESTINATION ${CMAKE_INSTALL_BINDIR} + ) endforeach() -# uninstall target + +#---------------------------------------------------------------------------- +# uninstall +# if(NOT TARGET uninstall) configure_file( "${CMAKE_CURRENT_SOURCE_DIR}/cmake/cmake_uninstall.cmake.in" @@ -240,3 +226,10 @@ if(NOT TARGET uninstall) add_custom_target(uninstall COMMAND ${CMAKE_COMMAND} -P ${CMAKE_CURRENT_BINARY_DIR}/cmake_uninstall.cmake) endif() + + +#---------------------------------------------------------------------------- +# cmake config +# +add_subdirectory(cmake) + From 279652c38e1fbe18e1240345b2a626ebf5b2a2e4 Mon Sep 17 00:00:00 2001 From: Wouter Deconinck Date: Wed, 16 Jan 2019 19:01:21 -0500 Subject: [PATCH 066/137] Remove frequently included header warning --- Analysis/include/QwRootFile.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Analysis/include/QwRootFile.h b/Analysis/include/QwRootFile.h index 309d95ace..b9623ad16 100755 --- a/Analysis/include/QwRootFile.h +++ b/Analysis/include/QwRootFile.h @@ -413,7 +413,8 @@ class QwRootFile { void Map() { if (fRootFile) fRootFile->Map(); } void Close() { if (!fMakePermanent) fMakePermanent = HasAnyFilled(); - if (fMapFile) fMapFile->Close(); if (fRootFile) fRootFile->Close(); + if (fMapFile) fMapFile->Close(); + if (fRootFile) fRootFile->Close(); } // Wrapped functionality From 44a81ba61ddd6bb5c97c58581ecd3c0ba0f93acb Mon Sep 17 00:00:00 2001 From: Wouter Deconinck Date: Wed, 16 Jan 2019 19:01:44 -0500 Subject: [PATCH 067/137] Load MySQL++ library again (can be disabled again later) --- CMakeLists.txt | 2 -- 1 file changed, 2 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 393ac3d22..507cd19bc 100755 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -58,8 +58,6 @@ IF(MYSQLPP_FOUND) ## KLUDGE: For now, do not define the __USE_DATABASE__ flag, because we're still missing some of the database support files. --- P.King, 05jun2018 message(STATUS " The \"__USE_DATABASE__\" flag is commented out in CMakeLists.txt; database support is DISABLED.") # add_definitions(-D__USE_DATABASE__) - message(STATUS " Forcing MYSQLPP_LIBRARIES to \"\".") - set(MYSQLPP_LIBRARIES "") ELSE(MYSQLPP_FOUND) set(MYSQLPP_LIBRARIES "") list(REMOVE_ITEM my_project_sources From 19b7c9c7b91cc587a9a6b9dcf7fd5650da81927e Mon Sep 17 00:00:00 2001 From: Wouter Deconinck Date: Wed, 16 Jan 2019 19:10:58 -0500 Subject: [PATCH 068/137] Better linkdef for evio --- evio/include/THaCodaDataLinkDef.h | 9 +++++++++ evio/include/THaCodaFileLinkDef.h | 10 ++++++++++ 2 files changed, 19 insertions(+) diff --git a/evio/include/THaCodaDataLinkDef.h b/evio/include/THaCodaDataLinkDef.h index e69de29bb..8d1d8f85f 100644 --- a/evio/include/THaCodaDataLinkDef.h +++ b/evio/include/THaCodaDataLinkDef.h @@ -0,0 +1,9 @@ +#ifdef __CINT__ + +#pragma link off all globals; +#pragma link off all classes; +#pragma link off all functions; + +#pragma link C++ class THaCodaData+; + +#endif diff --git a/evio/include/THaCodaFileLinkDef.h b/evio/include/THaCodaFileLinkDef.h index e69de29bb..e16c214e7 100644 --- a/evio/include/THaCodaFileLinkDef.h +++ b/evio/include/THaCodaFileLinkDef.h @@ -0,0 +1,10 @@ +#ifdef __CINT__ + +#pragma link off all globals; +#pragma link off all classes; +#pragma link off all functions; + +#pragma link C++ class THaCodaFile+; + +#endif + From 5444f8f3b7086fe13c23cc63d9c59c9ddd51e0ee Mon Sep 17 00:00:00 2001 From: Wouter Deconinck Date: Wed, 16 Jan 2019 19:15:25 -0500 Subject: [PATCH 069/137] Right, one I forgot to commit due to .gitignore... --- cmake/CMakeLists.txt | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 cmake/CMakeLists.txt diff --git a/cmake/CMakeLists.txt b/cmake/CMakeLists.txt new file mode 100644 index 000000000..4d7eec868 --- /dev/null +++ b/cmake/CMakeLists.txt @@ -0,0 +1,5 @@ +# Create Config.cmake and ConfigVersion.cmake +# This will also install the Modules and scripts subdirectories +# if they exist + +include(WriteProjectConfig) From 3ef8f6ca5c7d89ee16f7b5801be1ab107f0bb44b Mon Sep 17 00:00:00 2001 From: Wouter Deconinck Date: Thu, 17 Jan 2019 12:51:12 -0500 Subject: [PATCH 070/137] Created THaEtClient and removed file(TOUCH) for missing linkdefs --- CMakeLists.txt | 3 --- evio/CMakeLists.txt | 3 --- evio/include/THaEtClientLinkDef.h | 10 ++++++++++ 3 files changed, 10 insertions(+), 6 deletions(-) create mode 100644 evio/include/THaEtClientLinkDef.h diff --git a/CMakeLists.txt b/CMakeLists.txt index 507cd19bc..445c58757 100755 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -128,9 +128,6 @@ foreach(file ${my_project_headers}) # Add dictionary target with possible LinkDef file set(dict ${CMAKE_CURRENT_BINARY_DIR}/${file_name}Dict) set(linkdef ${file_path}/${file_name}LinkDef.h) - if(NOT EXISTS ${linkdef}) - file(TOUCH ${linkdef}) - endif() build_root_dictionary(${file_name} ${file} TARGETS ${PROJECT_NAME} LINKDEF ${linkdef} diff --git a/evio/CMakeLists.txt b/evio/CMakeLists.txt index d5168718d..cc3b168ab 100644 --- a/evio/CMakeLists.txt +++ b/evio/CMakeLists.txt @@ -47,9 +47,6 @@ foreach(file ${my_evio_headers}) # Add dictionary target with possible LinkDef file set(dict ${CMAKE_CURRENT_BINARY_DIR}/${file_name}Dict) set(linkdef ${file_path}/${file_name}LinkDef.h) - if(NOT EXISTS ${linkdef}) - file(TOUCH ${linkdef}) - endif() build_root_dictionary(${file_name} ${file} TARGETS evio LINKDEF ${linkdef} diff --git a/evio/include/THaEtClientLinkDef.h b/evio/include/THaEtClientLinkDef.h new file mode 100644 index 000000000..4d822cdd8 --- /dev/null +++ b/evio/include/THaEtClientLinkDef.h @@ -0,0 +1,10 @@ +#ifdef __CINT__ + +#pragma link off all globals; +#pragma link off all classes; +#pragma link off all functions; + +#pragma link C++ class THaEtClient+; + +#endif + From 1dfde9d4b3fa936e6d26092f0c24f28775b6538f Mon Sep 17 00:00:00 2001 From: Wouter Deconinck Date: Thu, 17 Jan 2019 12:54:30 -0500 Subject: [PATCH 071/137] Link evio against ET if CODA is found --- evio/CMakeLists.txt | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/evio/CMakeLists.txt b/evio/CMakeLists.txt index cc3b168ab..ca3e9c873 100644 --- a/evio/CMakeLists.txt +++ b/evio/CMakeLists.txt @@ -76,10 +76,18 @@ target_compile_options(evio ${${PROJECT_NAME_UC}_DIAG_FLAGS_LIST} ) +if(ET_FOUND) target_link_libraries(evio PUBLIC + EVIO::ET ROOT::Libraries ) +else() +target_link_libraries(evio + PUBLIC + ROOT::Libraries + ) +endif() install(TARGETS evio EXPORT ${MAIN_PROJECT_NAME_LC}-exports From 8fe6c8a7ef508f5542eced8c4634b8f707e6979d Mon Sep 17 00:00:00 2001 From: Ciprian Gal Date: Thu, 17 Jan 2019 16:54:03 -0500 Subject: [PATCH 072/137] use absolute paths to avoid errors --- CMakeLists.txt | 2 +- evio/CMakeLists.txt | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 445c58757..d9fffbf4e 100755 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -61,7 +61,7 @@ IF(MYSQLPP_FOUND) ELSE(MYSQLPP_FOUND) set(MYSQLPP_LIBRARIES "") list(REMOVE_ITEM my_project_sources - Analysis/src/QwDatabase.cc + ${PROJECT_SOURCE_DIR}/Analysis/src/QwDatabase.cc ) endif(MYSQLPP_FOUND) diff --git a/evio/CMakeLists.txt b/evio/CMakeLists.txt index ca3e9c873..3c0b60ad9 100644 --- a/evio/CMakeLists.txt +++ b/evio/CMakeLists.txt @@ -23,10 +23,10 @@ IF(ET_FOUND) add_definitions(-D__CODA_ET) include_directories(${ET_INCLUDE_DIR}) list(APPEND my_evio_headers - include/THaEtClient.h + ${PROJECT_SOURCE_DIR}/evio/include/THaEtClient.h ) list(APPEND my_evio_sources - src/THaEtClient.C + ${PROJECT_SOURCE_DIR}/evio/src/THaEtClient.C ) else(ET_FOUND) set(ET_LIBRARY "") From e399941e9be2b4ec053a7af0cc5dcf6aa3a20198 Mon Sep 17 00:00:00 2001 From: Paul King Date: Fri, 18 Jan 2019 13:30:59 -0500 Subject: [PATCH 073/137] Update executable search in FindROOT.cmake. I've added a "NO_CMAKE_ENVIRONMENT_PATH" to all find_program (and find_library) lines in the FindROOT.cmake file. I have also copied the "find_package(ET)" from the evio CMakeList into the main CMakeList, in order to also define the "__CODA_ET" variable for the QwAnalysis compilaiton, nad not just the evio compilaiton. Likely there is a more clever way to do this within cmake, but this does seem to work. --- CMakeLists.txt | 7 +++++++ cmake/modules/FindROOT.cmake | 8 +++++--- 2 files changed, 12 insertions(+), 3 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index d9fffbf4e..6fae2fc2a 100755 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -114,6 +114,13 @@ report_build_info() add_subdirectory(evio) include_directories(evio/include) +find_package(ET) +IF(ET_FOUND) + # The QwEventBuffer class also needs to see the "__CODA_ET" define, + # not just the EVIO library. + add_definitions(-D__CODA_ET) +ENDIF(ET_FOUND) + #---------------------------------------------------------------------------- # main dictionaries # diff --git a/cmake/modules/FindROOT.cmake b/cmake/modules/FindROOT.cmake index 45c94177c..b5eab412c 100644 --- a/cmake/modules/FindROOT.cmake +++ b/cmake/modules/FindROOT.cmake @@ -24,6 +24,7 @@ if(NOT ROOT_CONFIG_EXEC) find_program(ROOT_CONFIG_EXEC root-config HINTS "${ROOTBIN}" DOC "ROOT configuration utility program" + NO_CMAKE_ENVIRONMENT_PATH ) unset(ROOTBIN) @@ -122,7 +123,7 @@ set(targetlist) list(REMOVE_DUPLICATES ROOT_FIND_COMPONENTS) foreach(_lib IN LISTS ROOT_LIB_FLAGS ROOT_FIND_COMPONENTS) if(_lib MATCHES "^[A-Z].+") - find_library(ROOT_${_lib}_LIBRARY ${_lib} HINTS ${ROOT_LIBRARY_DIR}) + find_library(ROOT_${_lib}_LIBRARY ${_lib} HINTS ${ROOT_LIBRARY_DIR} NO_CMAKE_ENVIRONMENT_PATH) mark_as_advanced(ROOT_${_lib}_LIBRARY) if(ROOT_${_lib}_LIBRARY) add_library(ROOT::${_lib} SHARED IMPORTED) @@ -177,6 +178,7 @@ find_program(MK_ROOTDICT mk_rootdict.sh ${CMAKE_CURRENT_LIST_DIR}/.. PATH_SUFFIXES scripts DOC "Wrapper script for ROOT dictionary generator" + NO_CMAKE_ENVIRONMENT_PATH ) if(NOT MK_ROOTDICT) message(FATAL_ERROR @@ -210,13 +212,13 @@ function(build_root_dictionary dictionary) if(DEFINED ROOT_VERSION AND DEFINED ROOTSYS) if(NOT ${ROOT_VERSION} VERSION_LESS 6) - find_program(ROOTCLING rootcling HINTS "${ROOTSYS}/bin") + find_program(ROOTCLING rootcling HINTS "${ROOTSYS}/bin" NO_CMAKE_ENVIRONMENT_PATH) if(NOT ROOTCLING) message(FATAL_ERROR "root_generate_dictionary: Cannot find rootcling. Check ROOT installation.") endif() else() - find_program(ROOTCINT rootcint HINTS "${ROOTSYS}/bin") + find_program(ROOTCINT rootcint HINTS "${ROOTSYS}/bin" NO_CMAKE_ENVIRONMENT_PATH) if(NOT ROOTCINT) message(FATAL_ERROR "root_generate_dictionary: Cannot find rootcint. Check ROOT installation.") From d007774a991242a16390b02b2cc627a6a6dd6874 Mon Sep 17 00:00:00 2001 From: Paul King Date: Fri, 18 Jan 2019 19:52:50 -0500 Subject: [PATCH 074/137] Added parameter files for the PREX SAMs and main detectors. Working with Cameron, I have added initial map and pedestal files for the SAMs and the PREX main detectors, and a map for the synchronization scalers. The MollerMainDetector and QwLumi classes needed a small change to support the extra buffer word at the start of the subbank. --- Parity/prminput/prex_detectors.map | 13 ++++ Parity/prminput/prex_maindet.map | 29 ++++++++ Parity/prminput/prex_maindet_pedestal.map | 18 +++++ Parity/prminput/prex_sam.map | 15 ++++ Parity/prminput/prex_sam_pedestal.map | 8 ++ Parity/prminput/prex_scaler.map | 20 +++++ Parity/prminput/prexinj_helicity.4830-.map | 86 ++++++++++++++++++++++ Parity/src/MollerMainDetector.cc | 7 +- Parity/src/QwLumi.cc | 7 +- 9 files changed, 201 insertions(+), 2 deletions(-) create mode 100644 Parity/prminput/prex_maindet.map create mode 100644 Parity/prminput/prex_maindet_pedestal.map create mode 100644 Parity/prminput/prex_sam.map create mode 100644 Parity/prminput/prex_sam_pedestal.map create mode 100644 Parity/prminput/prex_scaler.map create mode 100644 Parity/prminput/prexinj_helicity.4830-.map diff --git a/Parity/prminput/prex_detectors.map b/Parity/prminput/prex_detectors.map index df04c94fb..9135fe9fb 100644 --- a/Parity/prminput/prex_detectors.map +++ b/Parity/prminput/prex_detectors.map @@ -18,3 +18,16 @@ eventcut = prexCH_beamline_eventcuts.map param = prexCH_beamline_pedestal.map +[QwLumi] + name = SAMs + map = prex_sam.map + param = prex_sam_pedestal.map + +[MollerMainDetector] + name = MainDets + map = prex_maindet.map + param = prex_maindet_pedestal.map + +[QwScaler] + name = SyncScalers + map = prex_scaler.map diff --git a/Parity/prminput/prex_maindet.map b/Parity/prminput/prex_maindet.map new file mode 100644 index 000000000..fc1e16eca --- /dev/null +++ b/Parity/prminput/prex_maindet.map @@ -0,0 +1,29 @@ +ROC=25 +Bank=0x5 +vqwk_buffer_offset=1 + +sample_size=16564 + + VQWK, 0, 0, IntegrationPMT, usl + VQWK, 0, 1, IntegrationPMT, dsl + VQWK, 0, 2, IntegrationPMT, atl1 + VQWK, 0, 3, IntegrationPMT, atl2 + VQWK, 0, 4, IntegrationPMT, vqwk_25_0ch4 + VQWK, 0, 5, IntegrationPMT, vqwk_25_0ch5 + VQWK, 0, 6, IntegrationPMT, vqwk_25_0ch6 + VQWK, 0, 7, IntegrationPMT, vqwk_25_0ch7 + +ROC=26 +Bank=0x5 +vqwk_buffer_offset=1 +sample_size=16564 + + VQWK, 0, 0, IntegrationPMT, usr + VQWK, 0, 1, IntegrationPMT, dsr + VQWK, 0, 2, IntegrationPMT, atr1 + VQWK, 0, 3, IntegrationPMT, atr2 + VQWK, 0, 4, IntegrationPMT, vqwk_26_0ch4 + VQWK, 0, 5, IntegrationPMT, vqwk_26_0ch5 + VQWK, 0, 6, IntegrationPMT, vqwk_26_0ch6 + VQWK, 0, 7, IntegrationPMT, vqwk_26_0ch7 + diff --git a/Parity/prminput/prex_maindet_pedestal.map b/Parity/prminput/prex_maindet_pedestal.map new file mode 100644 index 000000000..210437d1f --- /dev/null +++ b/Parity/prminput/prex_maindet_pedestal.map @@ -0,0 +1,18 @@ +usl , 0 , 76.293e-6 +dsl , 0 , 76.293e-6 +atl1 , 0 , 76.293e-6 +atl2 , 0 , 76.293e-6 +vqwk_25_0ch4 , 0 , 76.293e-6 +vqwk_25_0ch5 , 0 , 76.293e-6 +vqwk_25_0ch6 , 0 , 76.293e-6 +vqwk_25_0ch7 , 0 , 76.293e-6 + +usr , 0 , 76.293e-6 +dsr , 0 , 76.293e-6 +atr1 , 0 , 76.293e-6 +atr2 , 0 , 76.293e-6 +vqwk_26_0ch4 , 0 , 76.293e-6 +vqwk_26_0ch5 , 0 , 76.293e-6 +vqwk_26_0ch6 , 0 , 76.293e-6 +vqwk_26_0ch7 , 0 , 76.293e-6 + diff --git a/Parity/prminput/prex_sam.map b/Parity/prminput/prex_sam.map new file mode 100644 index 000000000..de5f85041 --- /dev/null +++ b/Parity/prminput/prex_sam.map @@ -0,0 +1,15 @@ +ROC=26 +Bank=0x5 +vqwk_buffer_offset=1 + +sample_size=16564 + + VQWK, 1, 0, IntegrationPMT, sam1 + VQWK, 1, 1, IntegrationPMT, sam2 + VQWK, 1, 2, IntegrationPMT, sam3 + VQWK, 1, 3, IntegrationPMT, sam4 + VQWK, 1, 4, IntegrationPMT, sam5 + VQWK, 1, 5, IntegrationPMT, sam6 + VQWK, 1, 6, IntegrationPMT, sam7 + VQWK, 1, 7, IntegrationPMT, sam8 + diff --git a/Parity/prminput/prex_sam_pedestal.map b/Parity/prminput/prex_sam_pedestal.map new file mode 100644 index 000000000..8d89ae98f --- /dev/null +++ b/Parity/prminput/prex_sam_pedestal.map @@ -0,0 +1,8 @@ +sam1 , 0 , 76.293e-6 +sam2 , 0 , 76.293e-6 +sam3 , 0 , 76.293e-6 +sam4 , 0 , 76.293e-6 +sam5 , 0 , 76.293e-6 +sam6 , 0 , 76.293e-6 +sam7 , 0 , 76.293e-6 +sam8 , 0 , 76.293e-6 diff --git a/Parity/prminput/prex_scaler.map b/Parity/prminput/prex_scaler.map new file mode 100644 index 000000000..b2753e601 --- /dev/null +++ b/Parity/prminput/prex_scaler.map @@ -0,0 +1,20 @@ +ROC=23 +bank=0x2 +! module.type module.num chan.num, det.type, det.name + SIS3801D32, 0, 2, syncscal, chouse_fr + SIS3801D32, 0, 3, syncscal, chouse_f1 + SIS3801D32, 0, 4, syncscal, chouse_f2 + +ROC=25 +bank=0x2 +! module.type module.num chan.num, det.type, det.name + SIS3801D32, 0, 30, syncscal, lhrs_f1 + SIS3801D32, 0, 31, syncscal, lhrs_f2 + +ROC=26 +bank=0x2 +! module.type module.num chan.num, det.type, det.name + SIS3801D32, 0, 30, syncscal, rhrs_f1 + SIS3801D32, 0, 31, syncscal, rhrs_f2 + +!!! Also should be scalers in the injector... diff --git a/Parity/prminput/prexinj_helicity.4830-.map b/Parity/prminput/prexinj_helicity.4830-.map new file mode 100644 index 000000000..19335eb6d --- /dev/null +++ b/Parity/prminput/prexinj_helicity.4830-.map @@ -0,0 +1,86 @@ +!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! +!! input file for decoding the helicity subsystem +!! Of note in this file: +!! HelicityDecodingMode : will tell which mode of decoding is in use +!! : for now it can be InputRegisterMode, UserbitMode +!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + +!Injector data during happex data taking: run 12331, 12354, 12356 +!HelicityDecodingMode=InputRegisterMode +!PatternPhase=4 +!ROC=23 +! +! Header=0xfdacf000 +! HAPPEX BMW words +!SKIP 148 +!WORD, 0, 0, helicitydata, ha_cleandata +!WORD, 0, 0, helicitydata, ha_scandata1 +! +!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! +!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! +!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + +!INPUT REGISTER MODE +HelicityDecodingMode=InputRegisterMode + +InputRegMask_FakeMPS=0 !!! Do not use a input register bit to indicate a "fake" set of helicity bits + +! Set the patternPhase (number of windows in a pattern) for each run range. +! If patternPhase!=4, then also set the NumberPatternsDelayed +! so the reported helicity is delayed by 8 windows (default 2). +!NumberPatternsDelayed=4 +PatternPhase=8 + + + +!Need to set PATTERNPHASEOFFSET = 1 (when pattern phase starts with 1) or 0 (when pattern phase starts with 0) +!default value for PATTERNPHASEOFFSET = 1 is set within the code itself which works fine with regular injector/beamline/parity mock data +!uncomment below line only if phase number start from 0 +PATTERNPHASEOFFSET=0 + + +!seed size is either 24 bit or 30 bit. default is 30 bit +!RandSeedBits=24 + +ROC=24 +Bank=0x3 + +! +! module.type, module.num chan.num, det.type, det.name +! +SKIP 1 ! This is the marker word for PAN +WORD, 0, 0, helicitydata, input_register +WORD, 0, 0, helicitydata, output_register +SKIP 1 ! WORD, 0, 0, helicitydata, sca_MPS_num +SKIP 1 ! WORD, 0, 0, helicitydata, sca_PAT_counter +SKIP 1 ! WORD, 0, 0, helicitydata, sca_PAT_phase +SKIP 3 +WORD, 0, 0, helicitydata, cleandata +WORD, 0, 0, helicitydata, scandata1 +WORD, 0, 0, helicitydata, scandata2 +SKIP 1 +!END +! +!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! +!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! +!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + +!USER BIT MODE + +!HelicityDecodingMode= UserbitMode +!PatternPhase=4 +!seed size is either 24 bit or 30 bit. default is 24 bit +!RandSeedBits=24 +!RandSeedBits=30 +!ROC=31 +!Bank=0x3101 +! +! module.type, module.num chan.num, det.type, det.name +! +!WORD, 0, 0, helicitydata, cleandata +!WORD, 0, 0, helicitydata, scandata1 +!WORD, 0, 0, helicitydata, scandata2 +!WORD, 0, 0, helicitydata, scalerheader +!WORD, 0, 0, helicitydata, scalercounter +!WORD, 0, 0, helicitydata, userbit +!END diff --git a/Parity/src/MollerMainDetector.cc b/Parity/src/MollerMainDetector.cc index a31e6e9c1..56bb2998d 100755 --- a/Parity/src/MollerMainDetector.cc +++ b/Parity/src/MollerMainDetector.cc @@ -158,6 +158,7 @@ Int_t MollerMainDetector::LoadChannelMap(TString mapfile) mapstr.SetCommentChars("!"); UInt_t value; + size_t vqwk_buffer_offset; while (mapstr.ReadNextLine()) { @@ -165,6 +166,10 @@ Int_t MollerMainDetector::LoadChannelMap(TString mapfile) if (mapstr.PopValue("sample_size",value)) { sample_size=value; } + if (mapstr.PopValue("vqwk_buffer_offset",value)) { + vqwk_buffer_offset=value; + } + mapstr.TrimComment('!'); // Remove everything after a '!' character. mapstr.TrimWhitespace(); // Get rid of leading and trailing spaces. if (mapstr.LineIsEmpty()) continue; @@ -235,7 +240,7 @@ Int_t MollerMainDetector::LoadChannelMap(TString mapfile) // localMainDetID.fWordInSubbank=wordsofar; if (modtype=="VQWK"){ - Int_t offset = QwVQWK_Channel::GetBufferOffset(modnum, channum); + Int_t offset = QwVQWK_Channel::GetBufferOffset(modnum, channum)+vqwk_buffer_offset; if (offset>=0){ localMainDetID.fWordInSubbank = wordsofar + offset; } diff --git a/Parity/src/QwLumi.cc b/Parity/src/QwLumi.cc index 0a7f187c5..06bbf15ec 100755 --- a/Parity/src/QwLumi.cc +++ b/Parity/src/QwLumi.cc @@ -67,12 +67,17 @@ Int_t QwLumi::LoadChannelMap(TString mapfile) mapstr.SetCommentChars("!"); UInt_t value; + size_t vqwk_buffer_offset; while (mapstr.ReadNextLine()) { RegisterRocBankMarker(mapstr); if (mapstr.PopValue("sample_size",value)) { fSample_size=value; } + if (mapstr.PopValue("vqwk_buffer_offset",value)) { + vqwk_buffer_offset=value; + } + mapstr.TrimComment('!'); // Remove everything after a '!' character. mapstr.TrimWhitespace(); // Get rid of leading and trailing spaces. if (mapstr.LineIsEmpty()) continue; @@ -144,7 +149,7 @@ Int_t QwLumi::LoadChannelMap(TString mapfile) if(modtype=="VQWK") { - offset = QwVQWK_Channel::GetBufferOffset(modnum, channum); + offset = QwVQWK_Channel::GetBufferOffset(modnum, channum) + vqwk_buffer_offset; localLumiDetectorID.fWordInSubbank = offset; } else if(modtype=="SCALER") From ad878dcfc857adf957292bcc244835a12e200632 Mon Sep 17 00:00:00 2001 From: Paul King Date: Tue, 22 Jan 2019 21:42:17 -0500 Subject: [PATCH 075/137] Cmake changes to almost get the feedback analyzer working. Added a modeule to find the EPICS libraries on the adaq cluster, and a CMakeList to compile the Feedback library if both EPICS and ET have been found. I wasn't able to get the QwFeedback library and the feedback executable to both be compiled and linked though. Maybe @wdconinc can look at it... --- CMakeLists.txt | 8 ++++ Feedback/CMakeLists.txt | 77 +++++++++++++++++++++++++++++++++++ Feedback/main/QwFeedback.cc | 9 +--- Feedback/src/cfSockCli.cc | 6 +++ cmake/modules/FindEPICS.cmake | 34 ++++++++++++++++ 5 files changed, 126 insertions(+), 8 deletions(-) create mode 100644 Feedback/CMakeLists.txt create mode 100644 Feedback/src/cfSockCli.cc create mode 100644 cmake/modules/FindEPICS.cmake diff --git a/CMakeLists.txt b/CMakeLists.txt index 6fae2fc2a..1ca884a2e 100755 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -215,6 +215,14 @@ foreach(file ${exefiles}) ) endforeach() +#---------------------------------------------------------------------------- +# Build feedback library and executable +add_subdirectory(Feedback) +#add_executable(feedback ${CMAKE_CURRENT_SOURCE_DIR}/Feedback/main/QwFeedback.cc) +#target_link_libraries(feedback Qwfeedback) + + + #---------------------------------------------------------------------------- # uninstall diff --git a/Feedback/CMakeLists.txt b/Feedback/CMakeLists.txt new file mode 100644 index 000000000..27ae946f7 --- /dev/null +++ b/Feedback/CMakeLists.txt @@ -0,0 +1,77 @@ +cmake_minimum_required(VERSION 3.5) + +#---------------------------------------------------------------------------- +# ROOT +# +set(minimum_root_version 6.0) +find_package(ROOT ${minimum_root_version} REQUIRED) +config_add_dependency(ROOT ${minimum_root_version}) + +#---------------------------------------------------------------------------- +# CODA ET +# +find_package(ET) + +#---------------------------------------------------------------------------- +# EPICS +find_package(EPICS) + +message(STATUS "*********** In Feedback Cmake") +set_compiler_flags("${ROOT_CXX_FLAGS}") +#set_diagnostic_flags(WALL WEXTRA) +set_diagnostic_flags(WALL) +report_build_info() + +#---------------------------------------------------------------------------- +# Feedback needs both ET and EPICS +IF(ET_FOUND) +IF(EPICS_FOUND) + include_directories(${ROOT_INCLUDE_DIR}) + include_directories(${ET_INCLUDE_DIR}) + include_directories(${EPICS_INCLUDE_DIR} + ${EPICS_INCLUDE_DIR}/os/Linux + ${EPICS_INCLUDE_DIR}/compiler/gcc) + include_directories(${PROJECT_SOURCE_DIR}/Analysis/include + ${PROJECT_SOURCE_DIR}/Parity/include) + include_directories(${CMAKE_CURRENT_SOURCE_DIR}/include) + + set(feedback_sources + ${CMAKE_CURRENT_SOURCE_DIR}/src/GreenMonster.cc + ${CMAKE_CURRENT_SOURCE_DIR}/src/QwEPICSControl.cc + ${CMAKE_CURRENT_SOURCE_DIR}/src/QwHelicityCorrelatedFeedback.cc + ${CMAKE_CURRENT_SOURCE_DIR}/src/cfSockCli.cc + ) + add_library(QwFeedback SHARED ${feedback_sources}) + target_include_directories(QwFeedback PUBLIC + ${CMAKE_CURRENT_SOURCE_DIR}/include + $ + $ + $ + ) + target_compile_options(QwFeedback + PUBLIC + ${${PROJECT_NAME_UC}_CXX_FLAGS_LIST} + PRIVATE + ${${PROJECT_NAME_UC}_DIAG_FLAGS_LIST} + ) +target_link_libraries(QwFeedback + PUBLIC + EVIO::ET + ROOT::Libraries + ${EPICS_CA_LIBRARY} ${EPICS_CAS_LIBRARY} ${EPICS_COM_LIBRARY} ${EPICS_GDD_LIBRARY} + ) + +install(TARGETS QwFeedback + EXPORT ${MAIN_PROJECT_NAME_LC}-exports + LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} + ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} + RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} + ) + +install(FILES ${my_feedback_headers} DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}) + +endif(EPICS_FOUND) +endif(ET_FOUND) + + + diff --git a/Feedback/main/QwFeedback.cc b/Feedback/main/QwFeedback.cc index fc031e47a..a92cc49e3 100644 --- a/Feedback/main/QwFeedback.cc +++ b/Feedback/main/QwFeedback.cc @@ -35,7 +35,6 @@ #include "QwFakeHelicity.h" #include "QwBeamLine.h" #include "QwMainCerenkovDetector.h" -#include "QwScanner.h" #include "QwLumi.h" #include "QwBeamMod.h" #include "QwVQWK_Channel.h" @@ -224,12 +223,6 @@ Int_t main(Int_t argc, Char_t* argv[]) failed_events_counts++; } - // Burst mode - if (eventbuffer.IsEndOfBurst()) { - helicitypattern.AccumulateRunningBurstSum(); - helicitypattern.CalculateBurstAverage(); - helicitypattern.ClearBurstSum(); - } @@ -246,7 +239,7 @@ Int_t main(Int_t argc, Char_t* argv[]) // Print the event cut error summery for each subsystem - detectors.GetEventcutErrorCounters(); + // detectors.GetEventcutErrorCounters(); // Read from the datebase diff --git a/Feedback/src/cfSockCli.cc b/Feedback/src/cfSockCli.cc new file mode 100644 index 000000000..ca6b18179 --- /dev/null +++ b/Feedback/src/cfSockCli.cc @@ -0,0 +1,6 @@ +extern "C" { + #include "cfSockCli.c" +} /* End extern "C" */ + + + diff --git a/cmake/modules/FindEPICS.cmake b/cmake/modules/FindEPICS.cmake new file mode 100644 index 000000000..c8437646a --- /dev/null +++ b/cmake/modules/FindEPICS.cmake @@ -0,0 +1,34 @@ +### The path for EPICS is restricted to a single copy on the Hall A cluster +### which has been compiled for 64-bit architecture. +### In principle this could be generalized, but would need to have guards +### to verify the library has been compiled with the correct flag. + + +find_library(EPICS_CA_LIBRARY ca + PATHS /adaqfs/apps/epics/lib/linux-x86_64 + DOC "EPICS CA library" + ) +find_library(EPICS_CAS_LIBRARY cas + PATHS /adaqfs/apps/epics/lib/linux-x86_64 + DOC "EPICS CAS library" + ) +find_library(EPICS_COM_LIBRARY Com + PATHS /adaqfs/apps/epics/lib/linux-x86_64 + DOC "EPICS COM library" + ) +find_library(EPICS_GDD_LIBRARY gdd + PATHS /adaqfs/apps/epics/lib/linux-x86_64 + DOC "EPICS GDD library" + ) +# Needs to build this line: -L/adaqfs/apps/epics/lib/linux-x86_64 -lca -lcas -lCom -lgdd + +find_path(EPICS_INCLUDE_DIR + NAMES cadef.h + PATHS /adaqfs/apps/epics/include + # $ENV{CODA}/common/include + DOC "EPICS header include base directory" + ) +# Needs to get all three: -I /adaqfs/apps/epics/include -I /adaqfs/apps/epics/include/os/Linux -I /adaqfs/apps/epics/include/compiler/gcc + +include(FindPackageHandleStandardArgs) +FIND_PACKAGE_HANDLE_STANDARD_ARGS(EPICS "The EPICS libraries were not found; feedback analysis will be disabled." EPICS_CA_LIBRARY EPICS_CAS_LIBRARY EPICS_COM_LIBRARY EPICS_GDD_LIBRARY EPICS_INCLUDE_DIR) From 8f81d1ae8438cc8f92944c8bc9d10e6b07a4bb4e Mon Sep 17 00:00:00 2001 From: Paul King Date: Tue, 22 Jan 2019 21:50:09 -0500 Subject: [PATCH 076/137] Renamed PREX parameter files to "prexOLD*" due to run number reset. On January 14, 2019, the parity run number was rese to start at 1000. The parameter files which were written to decode the previous injector and counting house data were renamed to "prexOLD*". To analyze a run taken before then, use "prexOLD.conf", and for more recent runs, use "prex.conf". --- Parity/prminput/prexOLD.conf | 22 +++++++++++++++++++ ...747-.map => prexOLD_CH_beamline.4747-.map} | 0 ...747-.map => prexOLD_CH_helicity.4747-.map} | 0 ...4747-.conf => prexOLD_bankflag.4747-.conf} | 0 ...rexbankflag.conf => prexOLD_bankflag.conf} | 0 Parity/prminput/prexOLD_detectors.map | 19 ++++++++++++++++ ...00-.map => prexOLD_inj_beamline.4000-.map} | 0 ...47-.map => prexOLD_inj_beamline.4747-.map} | 0 ...> prexOLD_inj_beamline_pedestal.4000-.map} | 0 ...00-.map => prexOLD_inj_helicity.4000-.map} | 0 ...00-.map => prexOLD_inj_helicity.4100-.map} | 0 ...47-.map => prexOLD_inj_helicity.4747-.map} | 0 ...30-.map => prexOLD_inj_helicity.4830-.map} | 0 13 files changed, 41 insertions(+) create mode 100644 Parity/prminput/prexOLD.conf rename Parity/prminput/{prexCH_beamline.4747-.map => prexOLD_CH_beamline.4747-.map} (100%) rename Parity/prminput/{prexCH_helicity.4747-.map => prexOLD_CH_helicity.4747-.map} (100%) rename Parity/prminput/{prexbankflag.4747-.conf => prexOLD_bankflag.4747-.conf} (100%) rename Parity/prminput/{prexbankflag.conf => prexOLD_bankflag.conf} (100%) create mode 100644 Parity/prminput/prexOLD_detectors.map rename Parity/prminput/{prexinj_beamline.4000-.map => prexOLD_inj_beamline.4000-.map} (100%) rename Parity/prminput/{prexinj_beamline.4747-.map => prexOLD_inj_beamline.4747-.map} (100%) rename Parity/prminput/{prexinj_beamline_pedestal.4000-.map => prexOLD_inj_beamline_pedestal.4000-.map} (100%) rename Parity/prminput/{prexinj_helicity.4000-.map => prexOLD_inj_helicity.4000-.map} (100%) rename Parity/prminput/{prexinj_helicity.4100-.map => prexOLD_inj_helicity.4100-.map} (100%) rename Parity/prminput/{prexinj_helicity.4747-.map => prexOLD_inj_helicity.4747-.map} (100%) rename Parity/prminput/{prexinj_helicity.4830-.map => prexOLD_inj_helicity.4830-.map} (100%) diff --git a/Parity/prminput/prexOLD.conf b/Parity/prminput/prexOLD.conf new file mode 100644 index 000000000..b34aefa05 --- /dev/null +++ b/Parity/prminput/prexOLD.conf @@ -0,0 +1,22 @@ +# This configuration file is used to generate +# a ROOT file for injector beam studies +# +# To Run +# qwparity -r 5900 -c injector.conf +# +# Friday, January 7 22:53:34 EDT 2011 +# +add-config = prexOLD_bankflag.conf + +detectors = prexOLD_detectors.map +chainfiles = no +single-output-file = yes +enable-tree-trim = no +disable-hel-tree = no +disable-histos = no +rootfile-stem = prexCH_ +codafile-stem = parity18_ +codafile-ext = dat + +ring.size = 200 +ring.stability_cut = -1 \ No newline at end of file diff --git a/Parity/prminput/prexCH_beamline.4747-.map b/Parity/prminput/prexOLD_CH_beamline.4747-.map similarity index 100% rename from Parity/prminput/prexCH_beamline.4747-.map rename to Parity/prminput/prexOLD_CH_beamline.4747-.map diff --git a/Parity/prminput/prexCH_helicity.4747-.map b/Parity/prminput/prexOLD_CH_helicity.4747-.map similarity index 100% rename from Parity/prminput/prexCH_helicity.4747-.map rename to Parity/prminput/prexOLD_CH_helicity.4747-.map diff --git a/Parity/prminput/prexbankflag.4747-.conf b/Parity/prminput/prexOLD_bankflag.4747-.conf similarity index 100% rename from Parity/prminput/prexbankflag.4747-.conf rename to Parity/prminput/prexOLD_bankflag.4747-.conf diff --git a/Parity/prminput/prexbankflag.conf b/Parity/prminput/prexOLD_bankflag.conf similarity index 100% rename from Parity/prminput/prexbankflag.conf rename to Parity/prminput/prexOLD_bankflag.conf diff --git a/Parity/prminput/prexOLD_detectors.map b/Parity/prminput/prexOLD_detectors.map new file mode 100644 index 000000000..c5e4225cc --- /dev/null +++ b/Parity/prminput/prexOLD_detectors.map @@ -0,0 +1,19 @@ +# This is an example of a detector definition file. + +[QwBeamLine] + name = Injector + map = prexOLD_inj_beamline.map + geom = prexinj_beamline_geometry.map + eventcut = prexinj_beamline_eventcuts.map + param = prexinj_beamline_pedestal.map + +[QwHelicity] + name = Helicity info + map = prexOLD_inj_helicity.map + +[QwBeamLine] + name = CountingHouse + map = prexOLD_CH_beamline.map + geom = prexCH_beamline_geometry.map + eventcut = prexCH_beamline_eventcuts.map + param = prexCH_beamline_pedestal.map diff --git a/Parity/prminput/prexinj_beamline.4000-.map b/Parity/prminput/prexOLD_inj_beamline.4000-.map similarity index 100% rename from Parity/prminput/prexinj_beamline.4000-.map rename to Parity/prminput/prexOLD_inj_beamline.4000-.map diff --git a/Parity/prminput/prexinj_beamline.4747-.map b/Parity/prminput/prexOLD_inj_beamline.4747-.map similarity index 100% rename from Parity/prminput/prexinj_beamline.4747-.map rename to Parity/prminput/prexOLD_inj_beamline.4747-.map diff --git a/Parity/prminput/prexinj_beamline_pedestal.4000-.map b/Parity/prminput/prexOLD_inj_beamline_pedestal.4000-.map similarity index 100% rename from Parity/prminput/prexinj_beamline_pedestal.4000-.map rename to Parity/prminput/prexOLD_inj_beamline_pedestal.4000-.map diff --git a/Parity/prminput/prexinj_helicity.4000-.map b/Parity/prminput/prexOLD_inj_helicity.4000-.map similarity index 100% rename from Parity/prminput/prexinj_helicity.4000-.map rename to Parity/prminput/prexOLD_inj_helicity.4000-.map diff --git a/Parity/prminput/prexinj_helicity.4100-.map b/Parity/prminput/prexOLD_inj_helicity.4100-.map similarity index 100% rename from Parity/prminput/prexinj_helicity.4100-.map rename to Parity/prminput/prexOLD_inj_helicity.4100-.map diff --git a/Parity/prminput/prexinj_helicity.4747-.map b/Parity/prminput/prexOLD_inj_helicity.4747-.map similarity index 100% rename from Parity/prminput/prexinj_helicity.4747-.map rename to Parity/prminput/prexOLD_inj_helicity.4747-.map diff --git a/Parity/prminput/prexinj_helicity.4830-.map b/Parity/prminput/prexOLD_inj_helicity.4830-.map similarity index 100% rename from Parity/prminput/prexinj_helicity.4830-.map rename to Parity/prminput/prexOLD_inj_helicity.4830-.map From 2ea8ed9722e425f73e0caf0030f026cfd53a5098 Mon Sep 17 00:00:00 2001 From: Paul King Date: Tue, 22 Jan 2019 21:55:02 -0500 Subject: [PATCH 077/137] Added new parameter files for the PREX runs after 14 January 2019. The "unranged" parameter files for PREX have been copied from the oldest run-ranged of the old PREX configuration files. --- Parity/prminput/prex.conf | 4 +- Parity/prminput/prexCH_beamline.map | 8 +- Parity/prminput/prexbankflag.conf | 9 + Parity/prminput/prexinj_beamline.map | 248 +++++++++++++++------------ Parity/prminput/prexinj_helicity.map | 7 +- 5 files changed, 154 insertions(+), 122 deletions(-) create mode 100644 Parity/prminput/prexbankflag.conf diff --git a/Parity/prminput/prex.conf b/Parity/prminput/prex.conf index e82a6f463..617daa957 100644 --- a/Parity/prminput/prex.conf +++ b/Parity/prminput/prex.conf @@ -14,8 +14,8 @@ single-output-file = yes enable-tree-trim = no disable-hel-tree = no disable-histos = no -rootfile-stem = prexCH_ -codafile-stem = parity18_ +rootfile-stem = prexALL_ +codafile-stem = parity_ALL_ codafile-ext = dat ring.size = 200 diff --git a/Parity/prminput/prexCH_beamline.map b/Parity/prminput/prexCH_beamline.map index a741a2846..2204342cf 100644 --- a/Parity/prminput/prexCH_beamline.map +++ b/Parity/prminput/prexCH_beamline.map @@ -1,9 +1,9 @@ ROC=23 -MarkerWord=0xff902902 -!!!Bank=0x3102 +Bank=0x05 +vqwk_buffer_offset = 1 !same sample size for ADCs in a given bank -sample_size=464 +sample_size=16564 !Sample size should be unchanged - ask Paul King ! ! module.type, module.num chan.num, det.type, det.name, if unrotated then last column ->UNROTATED @@ -62,4 +62,4 @@ sample_size=464 [PUBLISH] ! new.tree.variable.name, analysis.class, old.tree.variable.name, element.to.store - q_targ, bcm, BCM_US, c + q_targ, bcm, bcm_us, c diff --git a/Parity/prminput/prexbankflag.conf b/Parity/prminput/prexbankflag.conf new file mode 100644 index 000000000..a94b7a0dc --- /dev/null +++ b/Parity/prminput/prexbankflag.conf @@ -0,0 +1,9 @@ +# This configuration file is used to generate +# a ROOT file for injector beam studies +# +# To Run +# qwparity -r 5900 -c injector.conf +# +# Friday, January 7 22:53:34 EDT 2011 +# +allow-low-subbank-ids = yes diff --git a/Parity/prminput/prexinj_beamline.map b/Parity/prminput/prexinj_beamline.map index bb9a6a31c..06b19d424 100644 --- a/Parity/prminput/prexinj_beamline.map +++ b/Parity/prminput/prexinj_beamline.map @@ -1,147 +1,167 @@ ROC=24 -MarkerWord=0xff902902 -!!!Bank=0x3102 +Bank=0x02 +vqwk_buffer_offset=1 + !same sample size for ADCs in a given bank -sample_size=464 +sample_size=16644 ! ! -! module.type, module.num chan.num, det.type, det.name, if unrotated then last column ->UNROTATED +! module.type, module.num chan.num, det.type, det.name !ADC0 -! VQWK, 0, 0, bpmstripline, QWK_0I01XP -! VQWK, 0, 1, bpmstripline, QWK_0I01XM -! VQWK, 0, 2, bpmstripline, QWK_0I01YP -! VQWK, 0, 3, bpmstripline, QWK_0I01YM -! VQWK, 0, 4, bpmstripline, QWK_0I01AXP -! VQWK, 0, 5, bpmstripline, QWK_0I01AXM -! VQWK, 0, 6, bpmstripline, QWK_0I01AYP -! VQWK, 0, 7, bpmstripline, QWK_0I01AYM - -!ADC11 - VQWK, 0, 0, bpmstripline, QWK_0R06XP - VQWK, 0, 1, bpmstripline, QWK_0R06XM - VQWK, 0, 2, bpmstripline, QWK_0R06YP - VQWK, 0, 3, bpmstripline, QWK_0R06YM - VQWK, 0, 4, bcm, QWK_BCM0L02 - VQWK, 0, 5, bcm, QWK_Batery6 - VQWK, 0, 6, bcm, QWK_Batery7 - VQWK, 0, 7, bcm, PhaseMonitor - + VQWK, 0, 0, bpmstripline, bpm0I01Axp + VQWK, 0, 1, bpmstripline, bpm0I01Axm + VQWK, 0, 2, bpmstripline, bpm0I01Ayp + VQWK, 0, 3, bpmstripline, bpm0I01Aym + VQWK, 0, 4, bpmstripline, bpm1I04xp + VQWK, 0, 5, bpmstripline, bpm1I04xm + VQWK, 0, 6, bpmstripline, bpm1I04yp + VQWK, 0, 7, bpmstripline, bpm1I04ym !ADC1 - VQWK, 1, 0, bpmstripline, QWK_1I02XP, UNROTATED - VQWK, 1, 1, bpmstripline, QWK_1I02XM, UNROTATED - VQWK, 1, 2, bpmstripline, QWK_1I02YP, UNROTATED - VQWK, 1, 3, bpmstripline, QWK_1I02YM, UNROTATED - VQWK, 1, 4, bpmstripline, QWK_1I04XP, UNROTATED - VQWK, 1, 5, bpmstripline, QWK_1I04XM, UNROTATED - VQWK, 1, 6, bpmstripline, QWK_1I04YP, UNROTATED - VQWK, 1, 7, bpmstripline, QWK_1I04YM, UNROTATED + VQWK, 1, 0, bpmstripline, bpm1I02xp + VQWK, 1, 1, bpmstripline, bpm1I02xm + VQWK, 1, 2, bpmstripline, bpm1I02yp + VQWK, 1, 3, bpmstripline, bpm1I02ym + VQWK, 1, 4, bpmstripline, bpm0I01xp + VQWK, 1, 5, bpmstripline, bpm0I01xm + VQWK, 1, 6, bpmstripline, bpm0I01yp + VQWK, 1, 7, bpmstripline, bpm0I01ym !ADC2 - VQWK, 2, 0, bpmstripline, QWK_1I06XP, UNROTATED - VQWK, 2, 1, bpmstripline, QWK_1I06XM, UNROTATED - VQWK, 2, 2, bpmstripline, QWK_1I06YP, UNROTATED - VQWK, 2, 3, bpmstripline, QWK_1I06YM, UNROTATED - VQWK, 2, 4, bpmstripline, QWK_0I02XP, UNROTATED - VQWK, 2, 5, bpmstripline, QWK_0I02XM, UNROTATED - VQWK, 2, 6, bpmstripline, QWK_0I02YP, UNROTATED - VQWK, 2, 7, bpmstripline, QWK_0I02YM, UNROTATED + VQWK, 2, 0, bpmstripline, bpm1I06xp + VQWK, 2, 1, bpmstripline, bpm1I06xm + VQWK, 2, 2, bpmstripline, bpm1I06yp + VQWK, 2, 3, bpmstripline, bpm1I06ym + VQWK, 2, 4, bpmstripline, bpm0I02xp + VQWK, 2, 5, bpmstripline, bpm0I02xm + VQWK, 2, 6, bpmstripline, bpm0I02yp + VQWK, 2, 7, bpmstripline, bpm0I02ym !ADC3 - VQWK, 3, 0, bpmstripline, QWK_0I02AXP, UNROTATED - VQWK, 3, 1, bpmstripline, QWK_0I02AXM, UNROTATED - VQWK, 3, 2, bpmstripline, QWK_0I02AYP, UNROTATED - VQWK, 3, 3, bpmstripline, QWK_0I02AYM, UNROTATED - VQWK, 3, 4, bpmstripline, QWK_0I05XP, UNROTATED - VQWK, 3, 5, bpmstripline, QWK_0I05XM, UNROTATED - VQWK, 3, 6, bpmstripline, QWK_0I05YP, UNROTATED - VQWK, 3, 7, bpmstripline, QWK_0I05YM, UNROTATED + VQWK, 3, 0, bpmstripline, bpm0I02Axp + VQWK, 3, 1, bpmstripline, bpm0I02Axm + VQWK, 3, 2, bpmstripline, bpm0I02Ayp + VQWK, 3, 3, bpmstripline, bpm0I02Aym + VQWK, 3, 4, bpmstripline, bpm0I05xp + VQWK, 3, 5, bpmstripline, bpm0I05xm + VQWK, 3, 6, bpmstripline, bpm0I05yp + VQWK, 3, 7, bpmstripline, bpm0I05ym !ADC4 - VQWK, 4, 0, bpmstripline, QWK_0I07XP, UNROTATED - VQWK, 4, 1, bpmstripline, QWK_0I07XM, UNROTATED - VQWK, 4, 2, bpmstripline, QWK_0I07YP, UNROTATED - VQWK, 4, 3, bpmstripline, QWK_0I07YM, UNROTATED - VQWK, 4, 4, bpmstripline, QWK_0L01XP - VQWK, 4, 5, bpmstripline, QWK_0L01XM - VQWK, 4, 6, bpmstripline, QWK_0L01YP - VQWK, 4, 7, bpmstripline, QWK_0L01YM + VQWK, 4, 0, bpmstripline, bpm0I07xp + VQWK, 4, 1, bpmstripline, bpm0I07xm + VQWK, 4, 2, bpmstripline, bpm0I07yp + VQWK, 4, 3, bpmstripline, bpm0I07ym + VQWK, 4, 4, bpmstripline, bpm0L01xp + VQWK, 4, 5, bpmstripline, bpm0L01xm + VQWK, 4, 6, bpmstripline, bpm0L01yp + VQWK, 4, 7, bpmstripline, bpm0L01ym !ADC5 - VQWK, 5, 0, bpmstripline, QWK_0L02XP - VQWK, 5, 1, bpmstripline, QWK_0L02XM - VQWK, 5, 2, bpmstripline, QWK_0L02YP - VQWK, 5, 3, bpmstripline, QWK_0L02YM - VQWK, 5, 4, bpmstripline, QWK_0L03XP - VQWK, 5, 5, bpmstripline, QWK_0L03XM - VQWK, 5, 6, bpmstripline, QWK_0L03YP - VQWK, 5, 7, bpmstripline, QWK_0L03YM + VQWK, 5, 0, bpmstripline, bpm0L02xp + VQWK, 5, 1, bpmstripline, bpm0L02xm + VQWK, 5, 2, bpmstripline, bpm0L02yp + VQWK, 5, 3, bpmstripline, bpm0L02ym + VQWK, 5, 4, bpmstripline, bpm0L03xp + VQWK, 5, 5, bpmstripline, bpm0L03xm + VQWK, 5, 6, bpmstripline, bpm0L03yp + VQWK, 5, 7, bpmstripline, bpm0L03ym !ADC6 - VQWK, 6, 0, bpmstripline, QWK_0L04XP - VQWK, 6, 1, bpmstripline, QWK_0L04XM - VQWK, 6, 2, bpmstripline, QWK_0L04YP - VQWK, 6, 3, bpmstripline, QWK_0L04YM - VQWK, 6, 4, bpmstripline, QWK_0L05XP - VQWK, 6, 5, bpmstripline, QWK_0L05XM - VQWK, 6, 6, bpmstripline, QWK_0L05YP - VQWK, 6, 7, bpmstripline, QWK_0L05YM + VQWK, 6, 0, bpmstripline, bpm0L04xp + VQWK, 6, 1, bpmstripline, bpm0L04xm + VQWK, 6, 2, bpmstripline, bpm0L04yp + VQWK, 6, 3, bpmstripline, bpm0L04ym + VQWK, 6, 4, bpmstripline, bpm0L05xp + VQWK, 6, 5, bpmstripline, bpm0L05xm + VQWK, 6, 6, bpmstripline, bpm0L05yp + VQWK, 6, 7, bpmstripline, bpm0L05ym !ADC7 - VQWK, 7, 0, bpmstripline, QWK_0L06XP - VQWK, 7, 1, bpmstripline, QWK_0L06XM - VQWK, 7, 2, bpmstripline, QWK_0L06YP - VQWK, 7, 3, bpmstripline, QWK_0L06YM - VQWK, 7, 4, bpmstripline, QWK_0L07XP - VQWK, 7, 5, bpmstripline, QWK_0L07XM - VQWK, 7, 6, bpmstripline, QWK_0L07YP - VQWK, 7, 7, bpmstripline, QWK_0L07YM + VQWK, 7, 0, bpmstripline, bpm0L06xp + VQWK, 7, 1, bpmstripline, bpm0L06xm + VQWK, 7, 2, bpmstripline, bpm0L06yp + VQWK, 7, 3, bpmstripline, bpm0L06ym + VQWK, 7, 4, bpmstripline, bpm0L07xp + VQWK, 7, 5, bpmstripline, bpm0L07xm + VQWK, 7, 6, bpmstripline, bpm0L07yp + VQWK, 7, 7, bpmstripline, bpm0L07ym !ADC8 - VQWK, 8, 0, bpmstripline, QWK_0L08XP - VQWK, 8, 1, bpmstripline, QWK_0L08XM - VQWK, 8, 2, bpmstripline, QWK_0L08YP - VQWK, 8, 3, bpmstripline, QWK_0L08YM - VQWK, 8, 4, bpmstripline, QWK_0L09XP - VQWK, 8, 5, bpmstripline, QWK_0L09XM - VQWK, 8, 6, bpmstripline, QWK_0L09YP - VQWK, 8, 7, bpmstripline, QWK_0L09YM + VQWK, 8, 0, bpmstripline, bpm0L08xp + VQWK, 8, 1, bpmstripline, bpm0L08xm + VQWK, 8, 2, bpmstripline, bpm0L08yp + VQWK, 8, 3, bpmstripline, bpm0L08ym + VQWK, 8, 4, bpmstripline, bpm0L09xp + VQWK, 8, 5, bpmstripline, bpm0L09xm + VQWK, 8, 6, bpmstripline, bpm0L09yp + VQWK, 8, 7, bpmstripline, bpm0L09ym !ADC9 - VQWK, 9, 0, bpmstripline, QWK_0L10XP - VQWK, 9, 1, bpmstripline, QWK_0L10XM - VQWK, 9, 2, bpmstripline, QWK_0L10YP - VQWK, 9, 3, bpmstripline, QWK_0L10YM - VQWK, 9, 4, bpmstripline, QWK_0R03XP - VQWK, 9, 5, bpmstripline, QWK_0R03XM - VQWK, 9, 6, bpmstripline, QWK_0R03YP - VQWK, 9, 7, bpmstripline, QWK_0R03YM + VQWK, 9, 0, bpmstripline, bpm0L10xp + VQWK, 9, 1, bpmstripline, bpm0L10xm + VQWK, 9, 2, bpmstripline, bpm0L10yp + VQWK, 9, 3, bpmstripline, bpm0L10ym + VQWK, 9, 4, bpmstripline, bpm2I02xp + VQWK, 9, 5, bpmstripline, bpm2I02xm + VQWK, 9, 6, bpmstripline, bpm2I02yp + VQWK, 9, 7, bpmstripline, bpm2I02ym !ADC10 - VQWK, 10, 0, bpmstripline, QWK_0R04XP - VQWK, 10, 1, bpmstripline, QWK_0R04XM - VQWK, 10, 2, bpmstripline, QWK_0R04YP - VQWK, 10, 3, bpmstripline, QWK_0R04YM - VQWK, 10, 4, bpmstripline, QWK_0R05XP - VQWK, 10, 5, bpmstripline, QWK_0R05XM - VQWK, 10, 6, bpmstripline, QWK_0R05YP - VQWK, 10, 7, bpmstripline, QWK_0R05YM - -!ADC11 -! VQWK, 11, 0, bpmstripline, QWK_0R06XP -! VQWK, 11, 1, bpmstripline, QWK_0R06XM -! VQWK, 11, 2, bpmstripline, QWK_0R06YP -! VQWK, 11, 3, bpmstripline, QWK_0R06YM -! VQWK, 11, 4, bcm, QWK_BCM0L02 -! VQWK, 11, 5, bcm, QWK_Batery6 -! VQWK, 11, 6, bcm, QWK_Batery7 -! VQWK, 11, 7, bcm, PhaseMonitor + VQWK, 10, 0, bpmstripline, bpm2I01xp + VQWK, 10, 1, bpmstripline, bpm2I01xm + VQWK, 10, 2, bpmstripline, bpm2I01yp + VQWK, 10, 3, bpmstripline, bpm2I01ym + VQWK, 10, 4, bcm, BCM0L02 + VQWK, 10, 5, bcm, Batery6 + VQWK, 10, 6, bcm, Batery7 + VQWK, 10, 7, bcm, PhaseMonitor + +!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! +Bank=0x01 +scaler_buffer_offset=6 +normclock=clk4MHz_1 + + SCALER, 0, 0, clock, sca0_0 + SCALER, 0, 1, clock, sca0_1 + SCALER, 0, 2, clock, sca0_2 + SCALER, 0, 3, clock, sca0_3 + SCALER, 0, 4, clock, sca0_4 + SCALER, 0, 5, clock, sca0_5 + SCALER, 0, 6, clock, sca0_6 + SCALER, 0, 7, clock, sca0_7 + SCALER, 0, 8, clock, sca0_8 + SCALER, 0, 9, clock, sca0_9 + SCALER, 0, 10, clock, sca0_10 + SCALER, 0, 11, clock, sca0_11 + SCALER, 0, 12, clock, sca0_12 + SCALER, 0, 13, clock, sca0_13 + SCALER, 0, 14, clock, sca0_14 + SCALER, 0, 15, clock, sca0_15 + + SCALER, 0, 16, halomonitor, sca0_16 + SCALER, 0, 17, clock, clk4MHz_1 + SCALER, 0, 18, clock, clk4MHz_2 + SCALER, 0, 19, clock, clk4MHz_3 + SCALER, 0, 20, halomonitor, sca0_20 + SCALER, 0, 21, halomonitor, sca0_21 + SCALER, 0, 22, halomonitor, sca0_22 + SCALER, 0, 23, halomonitor, sca0_23 + SCALER, 0, 24, halomonitor, sca0_24 + SCALER, 0, 25, halomonitor, sca0_25 + SCALER, 0, 26, halomonitor, sca0_26 + SCALER, 0, 27, halomonitor, sca0_27 + SCALER, 0, 28, halomonitor, sca0_28 + SCALER, 0, 29, halomonitor, sca0_29 + SCALER, 0, 30, halomonitor, sca0_30 + SCALER, 0, 31, halomonitor, sca0_31 [PUBLISH] - q_targ, bcm, qwk_bcm0l02, c +# # q_targ, bcm, bcm0l02, c +# q_targ, bpmstripline, bpm0i02, ef ### Effective charge of BPM0i02 diff --git a/Parity/prminput/prexinj_helicity.map b/Parity/prminput/prexinj_helicity.map index fd97d3c16..19335eb6d 100644 --- a/Parity/prminput/prexinj_helicity.map +++ b/Parity/prminput/prexinj_helicity.map @@ -23,11 +23,13 @@ !INPUT REGISTER MODE HelicityDecodingMode=InputRegisterMode +InputRegMask_FakeMPS=0 !!! Do not use a input register bit to indicate a "fake" set of helicity bits + ! Set the patternPhase (number of windows in a pattern) for each run range. ! If patternPhase!=4, then also set the NumberPatternsDelayed ! so the reported helicity is delayed by 8 windows (default 2). !NumberPatternsDelayed=4 -PatternPhase=4 +PatternPhase=8 @@ -41,11 +43,12 @@ PATTERNPHASEOFFSET=0 !RandSeedBits=24 ROC=24 -MarkerWord=0x00003103 +Bank=0x3 ! ! module.type, module.num chan.num, det.type, det.name ! +SKIP 1 ! This is the marker word for PAN WORD, 0, 0, helicitydata, input_register WORD, 0, 0, helicitydata, output_register SKIP 1 ! WORD, 0, 0, helicitydata, sca_MPS_num From c3b149ec351ac798fb2ac28b7a9e24dc28cd509d Mon Sep 17 00:00:00 2001 From: Paul King Date: Wed, 23 Jan 2019 21:04:44 -0500 Subject: [PATCH 078/137] Final cleanup from merge between master and pking.merge_from_QwAna_2. This is in my fork of JAPAN, so this version of 'master' is still pretty out of date, but the qwmockdatagenerator and qwparity can be built and run. The old detector classes have been replaced by QwDetectorArray and QwBlindDetectorArray. --- CMakeLists.txt | 6 +++- Parity/include/QwBlindDetectorArray.h | 12 +++---- Parity/include/QwDetectorArray.h | 6 ++-- Parity/include/QwOptionsParity.h | 6 ---- Parity/main/QwMockDataGenerator.cc | 4 +-- Parity/prminput/mock_data_parameters.map | 2 +- Parity/src/QwBlindDetectorArray.cc | 44 ++++++++---------------- Parity/src/QwCombinerSubsystem.cc | 4 +-- 8 files changed, 33 insertions(+), 51 deletions(-) mode change 100755 => 100644 Parity/include/QwBlindDetectorArray.h diff --git a/CMakeLists.txt b/CMakeLists.txt index 7ec5cf89e..66ac1c1b1 100755 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -38,6 +38,10 @@ file(GLOB my_project_headers ${CMAKE_CURRENT_SOURCE_DIR}/Analysis/include/*.h ${CMAKE_CURRENT_SOURCE_DIR}/Parity/include/*.h ) +list(REMOVE_ITEM my_project_headers + ${CMAKE_CURRENT_SOURCE_DIR}/Analysis/include/QwSIS3320_Samples.h + ${CMAKE_CURRENT_SOURCE_DIR}/Analysis/include/QwF1TDContainer.h +) file(GLOB my_project_sources # ### ${CMAKE_CURRENT_SOURCE_DIR}/Analysis/src/*.cc # ${CMAKE_CURRENT_SOURCE_DIR}/Parity/src/*.cc @@ -82,7 +86,7 @@ list(APPEND my_project_sources ${CMAKE_CURRENT_SOURCE_DIR}/Parity/src/QwBCM.cc ${CMAKE_CURRENT_SOURCE_DIR}/Parity/src/QwBeamDetectorID.cc ${CMAKE_CURRENT_SOURCE_DIR}/Parity/src/QwBeamLine.cc - ${CMAKE_CURRENT_SOURCE_DIR}/Parity/src/QwBeamMod.cc +# ${CMAKE_CURRENT_SOURCE_DIR}/Parity/src/QwBeamMod.cc ${CMAKE_CURRENT_SOURCE_DIR}/Parity/src/QwBlinder.cc ${CMAKE_CURRENT_SOURCE_DIR}/Parity/src/QwBPMCavity.cc ${CMAKE_CURRENT_SOURCE_DIR}/Parity/src/QwBPMStripline.cc diff --git a/Parity/include/QwBlindDetectorArray.h b/Parity/include/QwBlindDetectorArray.h old mode 100755 new mode 100644 index da4db37a1..1be08647c --- a/Parity/include/QwBlindDetectorArray.h +++ b/Parity/include/QwBlindDetectorArray.h @@ -18,16 +18,16 @@ #include "VQwSubsystemParity.h" #include "QwIntegrationPMT.h" #include "QwCombinedPMT.h" -#include "QwDetectorArray.h" - // Forward declarations class QwBlinder; class QwBlindDetectorArrayID; -class QwBlindDetectorArray: public QwDetectorArray { - +class QwBlindDetectorArray: + public VQwSubsystemParity, + public MQwSubsystemCloneable +{ friend class QwCombinedPMT; /****************************************************************** * Class: QwBlindDetectorArray @@ -41,7 +41,7 @@ class QwBlindDetectorArray: public QwDetectorArray { public: /// Constructor with name QwBlindDetectorArray(const TString& name) - : QwDetectorArray(name) + : VQwSubsystem(name),VQwSubsystemParity(name),bNormalization(kFALSE) { fTargetCharge.InitializeChannel("q_targ","derived"); fTargetX.InitializeChannel("x_targ","derived"); @@ -52,7 +52,7 @@ class QwBlindDetectorArray: public QwDetectorArray { }; /// Copy constructor QwBlindDetectorArray(const QwBlindDetectorArray& source) - : QwDetectorArray(source), + : VQwSubsystem(source),VQwSubsystemParity(source), fIntegrationPMT(source.fIntegrationPMT), fCombinedPMT(source.fCombinedPMT), fMainDetID(source.fMainDetID) diff --git a/Parity/include/QwDetectorArray.h b/Parity/include/QwDetectorArray.h index 9b91c3432..ce2417a3e 100644 --- a/Parity/include/QwDetectorArray.h +++ b/Parity/include/QwDetectorArray.h @@ -34,7 +34,7 @@ class QwDetectorArray: * * ******************************************************************/ - protected: + private: /// Private default constructor (not implemented, will throw linker error on use) QwDetectorArray(); @@ -79,8 +79,8 @@ class QwDetectorArray: void UpdateErrorFlag(const VQwSubsystem *ev_error); - Int_t ProcessConfigurationBuffer(const UInt_t roc_id, const UInt_t bank_id, UInt_t* buffer, UInt_t num_words); - Int_t ProcessEvBuffer(const UInt_t roc_id, const UInt_t bank_id, UInt_t* buffer, UInt_t num_words); + Int_t ProcessConfigurationBuffer(const ROCID_t roc_id, const BankID_t bank_id, UInt_t* buffer, UInt_t num_words); + Int_t ProcessEvBuffer(const ROCID_t roc_id, const BankID_t bank_id, UInt_t* buffer, UInt_t num_words); void ClearEventData(); Bool_t IsGoodEvent(); diff --git a/Parity/include/QwOptionsParity.h b/Parity/include/QwOptionsParity.h index dc24382e9..31ce7a4f1 100755 --- a/Parity/include/QwOptionsParity.h +++ b/Parity/include/QwOptionsParity.h @@ -18,9 +18,6 @@ #include "QwOptions.h" // Qweak headers -//#include "QwMainCerenkovDetector.h" -#include "MollerMainDetector.h" -#include "QwLumi.h" #include "QwEventRing.h" #include "QwHelicity.h" #include "QwHelicityPattern.h" @@ -39,10 +36,7 @@ void DefineOptionsParity(QwOptions& options) QwOptions::DefineOptions(options); /* Define parity options */ - // QwMainCerenkovDetector::DefineOptions(options); QwDetectorArray::DefineOptions(options); - MollerMainDetector::DefineOptions(options); - QwLumi::DefineOptions(options); QwEventRing::DefineOptions(options); QwHelicity::DefineOptions(options); QwHelicityPattern::DefineOptions(options); diff --git a/Parity/main/QwMockDataGenerator.cc b/Parity/main/QwMockDataGenerator.cc index d99b6d19b..1dc0336f6 100755 --- a/Parity/main/QwMockDataGenerator.cc +++ b/Parity/main/QwMockDataGenerator.cc @@ -94,8 +94,8 @@ int main(int argc, char* argv[]) //----------------------------------------------------------------------------------------------- // Get the main detector channels we want to correlate - QwBlindDetectorArray* maindetector = - dynamic_cast(detectors.GetSubsystemByName("Main Detector")); + QwDetectorArray* maindetector = + dynamic_cast(detectors.GetSubsystemByName("Main Detector")); if (! maindetector) QwWarning << "No main detector subsystem defined!" << QwLog::endl; /* diff --git a/Parity/prminput/mock_data_parameters.map b/Parity/prminput/mock_data_parameters.map index 1683aed98..63a403881 100755 --- a/Parity/prminput/mock_data_parameters.map +++ b/Parity/prminput/mock_data_parameters.map @@ -18,7 +18,7 @@ combinedbpm, bpm_target, ypos 0.0e-2, 0.0, 1.0e combinedbpm, bpm_target, xslope 0.0e-6, 0.0, 1.0e-7 combinedbpm, bpm_target, yslope 0.0e-6, 0.0, 1.0e-7 -CombinedBPM drifts amplitude (abs), phase shift (rad), frequency (Hz) +! CombinedBPM drifts amplitude (abs), phase shift (rad), frequency (Hz) combinedbpm, bpm_target, xpos drift 1.0e-2, 0.456, 29.0 combinedbpm, bpm_target, ypos drift 1.0e-2, 0.456, 37.0 combinedbpm, bpm_target, xslope drift 3.0e-6, 0.654, 41.0 diff --git a/Parity/src/QwBlindDetectorArray.cc b/Parity/src/QwBlindDetectorArray.cc index 3fcaafaa4..f90a622c0 100644 --- a/Parity/src/QwBlindDetectorArray.cc +++ b/Parity/src/QwBlindDetectorArray.cc @@ -182,35 +182,21 @@ Int_t QwBlindDetectorArray::LoadChannelMap(TString mapfile) TString varname, varvalue; fDetectorMaps.insert(mapstr.GetParamFileNameContents()); + mapstr.EnableGreediness(); + mapstr.SetCommentChars("!"); + + UInt_t value; + while (mapstr.ReadNextLine()) { + RegisterRocBankMarker(mapstr); + if (mapstr.PopValue("sample_size",value)) { + sample_size=value; + } mapstr.TrimComment('!'); // Remove everything after a '!' character. mapstr.TrimWhitespace(); // Get rid of leading and trailing spaces. if (mapstr.LineIsEmpty()) continue; - if (mapstr.HasVariablePair("=",varname,varvalue)) - { - // This is a declaration line. Decode it. - varname.ToLower(); - UInt_t value = QwParameterFile::GetUInt(varvalue); - - if (varname=="roc") - { - currentrocread=value; - RegisterROCNumber(value,0); - } - else if (varname=="bank") - { - currentbankread=value; - RegisterSubbank(value); - } - else if (varname=="sample_size") - { - sample_size=value; - } - } - else - { Bool_t lineok = kTRUE; TString keyword = ""; TString keyword2 = ""; @@ -263,9 +249,9 @@ Int_t QwBlindDetectorArray::LoadChannelMap(TString mapfile) } - if (currentsubbankindex!=GetSubbankIndex(currentrocread,currentbankread)) + if (currentsubbankindex!=GetSubbankIndex(fCurrentROC_ID,fCurrentBank_ID)) { - currentsubbankindex=GetSubbankIndex(currentrocread,currentbankread); + currentsubbankindex=GetSubbankIndex(fCurrentROC_ID,fCurrentBank_ID); wordsofar=0; } @@ -359,9 +345,7 @@ Int_t QwBlindDetectorArray::LoadChannelMap(TString mapfile) if (lineok) fMainDetID.push_back(localMainDetID); - } - } - + } // End of "while (mapstr.ReadNextLine())" //std::cout<<"linking combined channels"< Date: Thu, 24 Jan 2019 16:52:04 -0500 Subject: [PATCH 079/137] Fixed two missing initializations and removed data exchange requests used by mock data. The scaler channels should be initialized to not require a refreence clock, unless one is specified in the channel map. The helicity decoder bit counter was not explicity set to zero on initialization, and if it happened to evaluate to greater than the psuedorandom generator array, the predictor can get stuck off. Both of these are now fixed. I also have temporarily commeted out a series of external data exchange requests in the MollerMainDetector class whcih are needed for mock-data generation. Thos ought to be shifted into the mock-data function within the MollerMainDetector class, and will be later. --- Analysis/src/QwScaler_Channel.cc | 1 + Parity/src/MollerMainDetector.cc | 7 ++++++- Parity/src/QwHelicity.cc | 11 ++++++----- 3 files changed, 13 insertions(+), 6 deletions(-) diff --git a/Analysis/src/QwScaler_Channel.cc b/Analysis/src/QwScaler_Channel.cc index 068db750d..af190ef7d 100755 --- a/Analysis/src/QwScaler_Channel.cc +++ b/Analysis/src/QwScaler_Channel.cc @@ -21,6 +21,7 @@ const Bool_t VQwScaler_Channel::kDEBUG = kFALSE; void VQwScaler_Channel::InitializeChannel(TString name, TString datatosave) { fNormChannelPtr = NULL; + fNeedsExternalClock = kFALSE; fIsDifferentialScaler = false; SetElementName(name); diff --git a/Parity/src/MollerMainDetector.cc b/Parity/src/MollerMainDetector.cc index 56bb2998d..3ad6cd057 100755 --- a/Parity/src/MollerMainDetector.cc +++ b/Parity/src/MollerMainDetector.cc @@ -906,6 +906,9 @@ void MollerMainDetector::ExchangeProcessedData() << fTargetCharge.GetElementName() << QwLog::endl; } + /* KLUDGE: comment this out for now, to avoid warnings on apar@adaq analysis. + * This maybe should be shifted into the Randomize function anyway... + * pking; 20190124. if(RequestExternalValue("x_targ", &fTargetX)){ if (bDEBUG){ dynamic_cast(&fTargetX)->PrintInfo(); @@ -960,7 +963,9 @@ void MollerMainDetector::ExchangeProcessedData() QwError << GetSubsystemName() << " could not get external value for " << fTargetEnergy.GetElementName() << QwLog::endl; } - + *** End of KLUDGE-20190124 + */ + // Print targetX and targetY and compare them with those from the rootfile, e.g. "Scan()" // std::cout << fTargetCharge <<" "<< fTargetX<<" "<< fTargetY<<" "<< fTargetXprime<<" "<< fTargetYprime<<" "<< fTargetEnergy << std::endl; diff --git a/Parity/src/QwHelicity.cc b/Parity/src/QwHelicity.cc index 350c770e6..e7aec98d3 100755 --- a/Parity/src/QwHelicity.cc +++ b/Parity/src/QwHelicity.cc @@ -68,6 +68,7 @@ QwHelicity::QwHelicity(const TString& name) fHelicityDelayed=kUndefinedHelicity; fHelicityBitPlus=kFALSE; fHelicityBitMinus=kFALSE; + n_ranbits = 0; fGoodHelicity=kFALSE; fGoodPattern=kFALSE; fHelicityDecodingMode=-1; @@ -83,11 +84,11 @@ QwHelicity::QwHelicity(const TString& name) QwHelicity::QwHelicity(const QwHelicity& source) : VQwSubsystem(source.GetSubsystemName()), VQwSubsystemParity(source.GetSubsystemName()), - fInputReg_HelPlus(fInputReg_HelPlus), - fInputReg_HelMinus(fInputReg_HelMinus), - fInputReg_PatternSync(fInputReg_PatternSync), - fInputReg_PairSync(fInputReg_PairSync), - fHelicityBitPattern(kDefaultHelicityBitPattern), + fInputReg_HelPlus(source.fInputReg_HelPlus), + fInputReg_HelMinus(source.fInputReg_HelMinus), + fInputReg_PatternSync(source.fInputReg_PatternSync), + fInputReg_PairSync(source.fInputReg_PairSync), + fHelicityBitPattern(source.fHelicityBitPattern), kPatternCounter(source.kPatternCounter), kMpsCounter(source.kMpsCounter), kPatternPhase(source.kPatternPhase), From 27d646a95a924d2cf12d3ca2ba17bba454ddca03 Mon Sep 17 00:00:00 2001 From: Paul King Date: Thu, 24 Jan 2019 17:17:13 -0500 Subject: [PATCH 080/137] Several parameter file changes to support the injector and counting house DAQ tests. --- Parity/prminput/prex.conf | 2 +- Parity/prminput/prexCH.conf | 4 ++-- Parity/prminput/prexCH_detectors.map | 4 ++++ Parity/prminput/prexCH_scaler.map | 8 ++++++++ Parity/prminput/prexinj.conf | 4 ++-- Parity/prminput/prexinj_helicity.map | 2 +- 6 files changed, 18 insertions(+), 6 deletions(-) create mode 100644 Parity/prminput/prexCH_scaler.map diff --git a/Parity/prminput/prex.conf b/Parity/prminput/prex.conf index 617daa957..01aca8ef3 100644 --- a/Parity/prminput/prex.conf +++ b/Parity/prminput/prex.conf @@ -19,4 +19,4 @@ codafile-stem = parity_ALL_ codafile-ext = dat ring.size = 200 -ring.stability_cut = -1 \ No newline at end of file +ring.stability_cut = -1 diff --git a/Parity/prminput/prexCH.conf b/Parity/prminput/prexCH.conf index 6cacafbe3..a858142f0 100644 --- a/Parity/prminput/prexCH.conf +++ b/Parity/prminput/prexCH.conf @@ -15,8 +15,8 @@ enable-tree-trim = no disable-hel-tree = no disable-histos = no rootfile-stem = prexCH_ -codafile-stem = parity18_ +codafile-stem = parity_CH_ codafile-ext = dat ring.size = 200 -ring.stability_cut = -1 \ No newline at end of file +ring.stability_cut = -1 diff --git a/Parity/prminput/prexCH_detectors.map b/Parity/prminput/prexCH_detectors.map index dbd1ea082..e42ede632 100644 --- a/Parity/prminput/prexCH_detectors.map +++ b/Parity/prminput/prexCH_detectors.map @@ -10,3 +10,7 @@ [QwHelicity] name = Helicity info map = prexCH_helicity.map + +[QwScaler] + name = SyncScalers + map = prexCH_scaler.map diff --git a/Parity/prminput/prexCH_scaler.map b/Parity/prminput/prexCH_scaler.map new file mode 100644 index 000000000..e29179366 --- /dev/null +++ b/Parity/prminput/prexCH_scaler.map @@ -0,0 +1,8 @@ +ROC=23 +bank=0x2 +! module.type module.num chan.num, det.type, det.name + SIS3801D32, 0, 0, bmwscal, bmwscal + SIS3801D32, 0, 2, syncscal, chouse_fr + SIS3801D32, 0, 3, syncscal, chouse_f1 + SIS3801D32, 0, 4, syncscal, chouse_f2 + diff --git a/Parity/prminput/prexinj.conf b/Parity/prminput/prexinj.conf index b7cc1c82f..f456bf909 100644 --- a/Parity/prminput/prexinj.conf +++ b/Parity/prminput/prexinj.conf @@ -15,8 +15,8 @@ enable-tree-trim = no disable-hel-tree = no disable-histos = no rootfile-stem = prexinj_ -codafile-stem = parity18_injector_ +codafile-stem = parity_INJ_ codafile-ext = dat ring.size = 200 -ring.stability_cut = -1 \ No newline at end of file +ring.stability_cut = -1 diff --git a/Parity/prminput/prexinj_helicity.map b/Parity/prminput/prexinj_helicity.map index 19335eb6d..992ba0ef7 100644 --- a/Parity/prminput/prexinj_helicity.map +++ b/Parity/prminput/prexinj_helicity.map @@ -29,7 +29,7 @@ InputRegMask_FakeMPS=0 !!! Do not use a input register bit to indicate a "fak ! If patternPhase!=4, then also set the NumberPatternsDelayed ! so the reported helicity is delayed by 8 windows (default 2). !NumberPatternsDelayed=4 -PatternPhase=8 +PatternPhase=4 From ae3f05c46caf7a38620660c541672a6e8c76e07c Mon Sep 17 00:00:00 2001 From: Your Name Date: Thu, 24 Jan 2019 17:34:05 -0500 Subject: [PATCH 081/137] Don't use default paths when finding EPICS libraries This avoids picking up the libca.so from CODA when we want the more up-to-date one in EPICS. --- cmake/modules/FindEPICS.cmake | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/cmake/modules/FindEPICS.cmake b/cmake/modules/FindEPICS.cmake index c8437646a..5f4b6e137 100644 --- a/cmake/modules/FindEPICS.cmake +++ b/cmake/modules/FindEPICS.cmake @@ -6,18 +6,22 @@ find_library(EPICS_CA_LIBRARY ca PATHS /adaqfs/apps/epics/lib/linux-x86_64 + NO_DEFAULT_PATH DOC "EPICS CA library" ) find_library(EPICS_CAS_LIBRARY cas PATHS /adaqfs/apps/epics/lib/linux-x86_64 + NO_DEFAULT_PATH DOC "EPICS CAS library" ) find_library(EPICS_COM_LIBRARY Com PATHS /adaqfs/apps/epics/lib/linux-x86_64 + NO_DEFAULT_PATH DOC "EPICS COM library" ) find_library(EPICS_GDD_LIBRARY gdd PATHS /adaqfs/apps/epics/lib/linux-x86_64 + NO_DEFAULT_PATH DOC "EPICS GDD library" ) # Needs to build this line: -L/adaqfs/apps/epics/lib/linux-x86_64 -lca -lcas -lCom -lgdd From f71d4b155ccdb15cc81196846ce2fff66612b105 Mon Sep 17 00:00:00 2001 From: Your Name Date: Thu, 24 Jan 2019 17:35:00 -0500 Subject: [PATCH 082/137] Public link QwAnalysis into QwFeedback and build executable here --- Feedback/CMakeLists.txt | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) diff --git a/Feedback/CMakeLists.txt b/Feedback/CMakeLists.txt index 27ae946f7..560160174 100644 --- a/Feedback/CMakeLists.txt +++ b/Feedback/CMakeLists.txt @@ -54,10 +54,12 @@ IF(EPICS_FOUND) PRIVATE ${${PROJECT_NAME_UC}_DIAG_FLAGS_LIST} ) +message (STATUS "${EPICS_CA_LIBRARY} ${EPICS_CAS_LIBRARY} ${EPICS_COM_LIBRARY} ${EPICS_GDD_LIBRARY}") target_link_libraries(QwFeedback PUBLIC EVIO::ET ROOT::Libraries + ${PROJECT_NAME} ${EPICS_CA_LIBRARY} ${EPICS_CAS_LIBRARY} ${EPICS_COM_LIBRARY} ${EPICS_GDD_LIBRARY} ) @@ -68,6 +70,37 @@ install(TARGETS QwFeedback RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} ) + +file(GLOB exefiles + main/*.cc +) +foreach(file ${exefiles}) + get_filename_component(filename ${file} NAME_WE) + string(TOLOWER ${filename} filelower) + + add_executable(${filelower} ${file}) + + target_link_libraries(${filelower} + PRIVATE + QwFeedback + ${PROJECT_NAME} + ) + target_compile_options(${filelower} + PUBLIC + ${${PROJECT_NAME_UC}_CXX_FLAGS_LIST} + PRIVATE + ${${PROJECT_NAME_UC}_DIAG_FLAGS_LIST} + ) + if(${CMAKE_SYSTEM_NAME} MATCHES Linux) + target_compile_options(${filelower} PUBLIC -fPIC) + endif() + + install(TARGETS ${filelower} + DESTINATION ${CMAKE_INSTALL_BINDIR} + ) +endforeach() + + install(FILES ${my_feedback_headers} DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}) endif(EPICS_FOUND) From fc0f40f3fcffd16e7918918bf899c538a02dcb63 Mon Sep 17 00:00:00 2001 From: Your Name Date: Thu, 24 Jan 2019 17:36:27 -0500 Subject: [PATCH 083/137] Since we build executables in Feedback/CMakeLists.txt, we don't need to keep these commented lines. --- CMakeLists.txt | 5 ----- 1 file changed, 5 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 1ca884a2e..fbedd03e0 100755 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -218,11 +218,6 @@ endforeach() #---------------------------------------------------------------------------- # Build feedback library and executable add_subdirectory(Feedback) -#add_executable(feedback ${CMAKE_CURRENT_SOURCE_DIR}/Feedback/main/QwFeedback.cc) -#target_link_libraries(feedback Qwfeedback) - - - #---------------------------------------------------------------------------- # uninstall From 1e8b9629e3e701742831b68349754d0af2e8e87e Mon Sep 17 00:00:00 2001 From: Paul King Date: Thu, 24 Jan 2019 20:24:05 -0500 Subject: [PATCH 084/137] Temporary root file names will now be "probably unique" I have reverted the rootfile class to use a probably unique temporary root file name instead of using "test001.root". This lets us be generating multiple rootfile simultaneously. The file names will be like: prexALL_1034.adaq3.jlab.org.25115.root with the machine name and process ID as the 3rd and 4th pieces of the name. On successful completion, the file will be renamed like: prexALL_1034.root --- Analysis/src/QwRootFile.cc | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/Analysis/src/QwRootFile.cc b/Analysis/src/QwRootFile.cc index bdc670ac0..10d984e89 100755 --- a/Analysis/src/QwRootFile.cc +++ b/Analysis/src/QwRootFile.cc @@ -78,16 +78,16 @@ QwRootFile::QwRootFile(const TString& run_label) fPermanentName = rootfilename + Form("/%s%s.root", fRootFileStem.Data(), run_label.Data()); -// rootfilename += Form("/%s%s.%s.%d.root", -// fRootFileStem.Data(), run_label.Data(), -// hostname.Data(), pid); - rootfilename += "/test001.root"; - std::cerr << rootfilename << std::endl; + rootfilename += Form("/%s%s.%s.%d.root", + fRootFileStem.Data(), run_label.Data(), + hostname.Data(), pid); fRootFile = new TFile(rootfilename.Data(), "RECREATE", "myfile1"); if (! fRootFile) { QwError << "ROOT file " << rootfilename << " could not be opened!" << QwLog::endl; return; + } else { + QwMessage << "Opened temporary rootfile " << rootfilename << QwLog::endl; } TString run_condition_name = Form("%s_condition", run_label.Data()); From 2ebe66d7074efb873884c151e17a7f0e1fd99e26 Mon Sep 17 00:00:00 2001 From: Paul King Date: Fri, 25 Jan 2019 10:37:44 -0500 Subject: [PATCH 085/137] More parameter files for PREX data while we're doing testing. Modified the main detector map to leave all channels unblinded for now. Corrected the helicity decoding for the counting-house standalone mode, but some of those CH standalone runs do not have valid helicity data anyway. Added a special detector map for CH standalone runs which does not try to decode the helicity data; to use it, do "qwparity --config prexCH.conf --detectors prexCH_detectors_no_hel.map ...". Patterns and asymmetries will be calculated as if events always form "+ - - +" quartets. --- Parity/prminput/prexCH_detectors_no_hel.map | 16 +++++++++ Parity/prminput/prexCH_helicity.map | 14 ++------ Parity/prminput/prex_maindet.map | 40 +++++++++++---------- 3 files changed, 41 insertions(+), 29 deletions(-) create mode 100644 Parity/prminput/prexCH_detectors_no_hel.map diff --git a/Parity/prminput/prexCH_detectors_no_hel.map b/Parity/prminput/prexCH_detectors_no_hel.map new file mode 100644 index 000000000..5adf3322c --- /dev/null +++ b/Parity/prminput/prexCH_detectors_no_hel.map @@ -0,0 +1,16 @@ +# This is an example of a detector definition file. + +[QwBeamLine] + name = CountingHouse + map = prexCH_beamline.map + geom = prexCH_beamline_geometry.map + eventcut = prexCH_beamline_eventcuts.map + param = prexCH_beamline_pedestal.map + +#[QwHelicity] +# name = Helicity info +# map = prexCH_helicity.map + +[QwScaler] + name = SyncScalers + map = prexCH_scaler.map diff --git a/Parity/prminput/prexCH_helicity.map b/Parity/prminput/prexCH_helicity.map index af7806ff2..c20759356 100644 --- a/Parity/prminput/prexCH_helicity.map +++ b/Parity/prminput/prexCH_helicity.map @@ -6,7 +6,8 @@ !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! ROC=23 -MarkerWord=0xffb0b444 +!!! MarkerWord=0xffb0b444 +Bank=0x1 !INPUT REGISTER MODE HelicityDecodingMode=InputRegisterMode @@ -33,17 +34,8 @@ PATTERNPHASEOFFSET=0 ! ! module.type, module.num chan.num, det.type, det.name ! -SKIP 1 +SKIP 2 WORD, 0, 0, helicitydata, input_register -WORD, 0, 0, helicitydata, output_register -SKIP 1 ! WORD, 0, 0, helicitydata, sca_MPS_num -SKIP 1 ! WORD, 0, 0, helicitydata, sca_PAT_counter -SKIP 1 ! WORD, 0, 0, helicitydata, sca_PAT_phase -SKIP 3 -WORD, 0, 0, helicitydata, cleandata -WORD, 0, 0, helicitydata, scandata1 -WORD, 0, 0, helicitydata, scandata2 -SKIP 1 !END ! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! diff --git a/Parity/prminput/prex_maindet.map b/Parity/prminput/prex_maindet.map index fc1e16eca..9fd8efd36 100644 --- a/Parity/prminput/prex_maindet.map +++ b/Parity/prminput/prex_maindet.map @@ -3,27 +3,31 @@ Bank=0x5 vqwk_buffer_offset=1 sample_size=16564 - - VQWK, 0, 0, IntegrationPMT, usl - VQWK, 0, 1, IntegrationPMT, dsl - VQWK, 0, 2, IntegrationPMT, atl1 - VQWK, 0, 3, IntegrationPMT, atl2 - VQWK, 0, 4, IntegrationPMT, vqwk_25_0ch4 - VQWK, 0, 5, IntegrationPMT, vqwk_25_0ch5 - VQWK, 0, 6, IntegrationPMT, vqwk_25_0ch6 - VQWK, 0, 7, IntegrationPMT, vqwk_25_0ch7 +! +! Force all channels to be "not_blindable" during testing +! + VQWK, 0, 0, IntegrationPMT, usl not_blindable + VQWK, 0, 1, IntegrationPMT, dsl not_blindable + VQWK, 0, 2, IntegrationPMT, atl1 not_blindable + VQWK, 0, 3, IntegrationPMT, atl2 not_blindable + VQWK, 0, 4, IntegrationPMT, vqwk_25_0ch4 not_blindable + VQWK, 0, 5, IntegrationPMT, vqwk_25_0ch5 not_blindable + VQWK, 0, 6, IntegrationPMT, vqwk_25_0ch6 not_blindable + VQWK, 0, 7, IntegrationPMT, vqwk_25_0ch7 not_blindable ROC=26 Bank=0x5 vqwk_buffer_offset=1 sample_size=16564 - - VQWK, 0, 0, IntegrationPMT, usr - VQWK, 0, 1, IntegrationPMT, dsr - VQWK, 0, 2, IntegrationPMT, atr1 - VQWK, 0, 3, IntegrationPMT, atr2 - VQWK, 0, 4, IntegrationPMT, vqwk_26_0ch4 - VQWK, 0, 5, IntegrationPMT, vqwk_26_0ch5 - VQWK, 0, 6, IntegrationPMT, vqwk_26_0ch6 - VQWK, 0, 7, IntegrationPMT, vqwk_26_0ch7 +! +! Force all channels to be "not_blindable" during testing +! + VQWK, 0, 0, IntegrationPMT, usr not_blindable + VQWK, 0, 1, IntegrationPMT, dsr not_blindable + VQWK, 0, 2, IntegrationPMT, atr1 not_blindable + VQWK, 0, 3, IntegrationPMT, atr2 not_blindable + VQWK, 0, 4, IntegrationPMT, vqwk_26_0ch4 not_blindable + VQWK, 0, 5, IntegrationPMT, vqwk_26_0ch5 not_blindable + VQWK, 0, 6, IntegrationPMT, vqwk_26_0ch6 not_blindable + VQWK, 0, 7, IntegrationPMT, vqwk_26_0ch7 not_blindable From cb0d81f78c3ab86f13c097ae6c85765c91369f00 Mon Sep 17 00:00:00 2001 From: Paul King Date: Sat, 26 Jan 2019 15:36:47 -0500 Subject: [PATCH 086/137] Delete Feedback/Makefile We don't need to keep the Makefile for the Feedback analyzer, since we're now using cmake. --- Feedback/Makefile | 165 ---------------------------------------------- 1 file changed, 165 deletions(-) delete mode 100644 Feedback/Makefile diff --git a/Feedback/Makefile b/Feedback/Makefile deleted file mode 100644 index d40cc77f8..000000000 --- a/Feedback/Makefile +++ /dev/null @@ -1,165 +0,0 @@ - -############## -# Environment : -############## - -SHELL = /bin/sh -ARCH = $(shell uname) -MAKE = $(word $(words $(shell which gmake)),$(shell which gmake)) -# system dependent, but '/usr/bin/gmake' is incorrect on some system) -# the trick is to get rid of any verbose parts that precedes the return -AWK = gawk -BASENAME := basename -CAT := cat -CD := cd -CHMOD := chmod -DIRNAME := dirname -ECHO := echo -FIND := find -GCC := gcc - # This must be the GNU compiler collection : explicit use of - # flag '-M' for automatic search for dependencies - # It is not correlated to $(CXX) and $(LD) which depend on $(ARCH) -GREP := grep -LS := ls -MAKE := make -RM-f := \rm -f -RM-rf := \rm -rf - # 'rm' is often aliases as 'rm -i', so '\rm' instead -MV := \mv -CP := \cp -ROOTCINT := rootcint -SED := sed -e -TOUCH := touch -CXX = - -#### VPATH = $QWANALYSIS/lib:$QWANALYSIS/Analysis/include:$QWANALYSIS/Analysis/src:$QWANALYSIS/Parity/include:$QWANALYSIS/Parity/src - - - -MYSRCDIR = ./src -MYINCDIR = ./include - -VPATH = ./main:./src - - - - -ifndef CODA - $(error Error: The CODA variable is not defined; the feedback analyzer requires linking against a complete CODA installation.) -endif - -################## -################## -### Get the flags from the QWANALYSIS build -################## - -QWEAKLIBS := $(shell ${QWANALYSIS}/bin/qweak-config --libs) -QWEAKLDFLAGS := $(shell ${QWANALYSIS}/bin/qweak-config --ldflags) -# When we get the QwAnalysis include paths, turn paths like "./*" into "${QWANALYSIS}/*". -REGEXP_QWANA := $(shell ${ECHO} ${QWANALYSIS} | ${SED} 's/\//\\\//g') -QWEAKCPPFLAGS := $(shell ${QWANALYSIS}/bin/qweak-config --cppflags | sed 's/I\./I${REGEXP_QWANA}/g' ) - -################## - -ifeq ($(ARCH),Linux) - CXX = g++ - LINKER = g++ - CFLAGS = -Wall -fPIC -O3 - ###CFLAGS = -Wall -fPIC -endif - -ifeq ($(ARCH),SunOS) - CXX = CC - LINKER = CC - CFLAGS = -KPIC - CLIBS = -lm -lposix4 -lsocket -lnsl -lresolv -ldl -endif - -##### - - -################## -# JLab EPICS libs -################## -ifdef EPICS - EPICSFLAGS := -I$(EPICS)/base/include -I$(EPICS)/base/include/os/Linux - # On the cdaq cluster, the library directory is different between the 3.13 - # and 3.14 EPICS versions - ifeq ($(shell $(AWK) '$$2="EPICS_REVISION" {print $$3}' $(EPICS)/base/include/epicsVersion.h),13) - EPICSLIBS := -L${EPICS}/base/lib/Linux -lca -lcas -lCom -lAs -lgdd - else - EPICSLIBS := -L${EPICS}/base/lib/linux-x86 -lca -lcas -lCom -lgdd - endif -else - $(error Aborting : EPICS library is not accessible from the system) -endif - -############## -############## -############## - -CFLAGS += $(EPICSFLAGS) -I${MYINCDIR} -CPPFLAGS = $(QWEAKCPPFLAGS) -LDFLAGS = $(QWEAKLDFLAGS) -LIBS = $(EPICSLIBS) $(QWEAKLIBS) -L$(QW_LIB) -lQw - -############## -############## -############## - -MYSRCFILES= $(shell find $(MYSRCDIR) -name \*.cc -or -name \*.c) -MYINCFILES= $(shell find $(MYINCDIR) -name \*.h) - -MYOBJFILES= $(shell echo $(MYSRCFILES)|sed -e 's/\.cc/\.o/g' -e 's/\.c/\.o/g') - -############## - -default : qwfeedback -all: default - -qwfeedback : main/QwFeedback.o $(MYOBJFILES) - @echo - @echo - @echo - @echo - @echo "########## Making \"qwfeedback\" ##########" - @echo Local source files used: $(MYOBJFILES). - @echo Local include files used: $(MYINCFILES). - @echo "########## Making \"qwfeedback\" ##########"> .lastbuild-qwfeedback - @echo $(shell date) >> .lastbuild-qwfeedback - @echo Local source files used: $(MYOBJFILES). >>.lastbuild-qwfeedback - @echo Local include files used: $(MYINCFILES).>>.lastbuild-qwfeedback - @echo - ${LINKER} ${CFLAGS} ${filter-out %.a %.so, $^} ${LDFLAGS} ${LIBS} -o $@ - @echo - @echo "###### Finished making \"qwfeedback\" ######" - @echo "###### Finished making \"qwfeedback\" ######" >>.lastbuild-qwfeedback - @echo - -clean: - rm -f *.o */*.o core qwfeedback *~ */*~ - -main/%.o: main/%.cc $(MYINCFILES) - @echo "######" - $(CXX) ${CFLAGS} ${CPPFLAGS} -o $@ -c $< - @echo "######" - -src/%.o: src/%.cc include/%.h - @echo "######" - $(CXX) ${CFLAGS} ${CPPFLAGS} -o $@ -c $< - @echo "######" - -src/%.o: src/%.c include/%.h - @echo "######" - $(GCC) ${CFLAGS} -o $@ -c $< - @echo "######" - -%.o: %.cc - ${CXX} ${CFLAGS} ${CPPFLAGS} -c $< - @echo "######" - - - - - From 5a5d0d4a09e6e93409b530adeacee866f032e4c2 Mon Sep 17 00:00:00 2001 From: Paul King Date: Sat, 26 Jan 2019 19:26:40 -0500 Subject: [PATCH 087/137] More parameter file updates for the PREX data files since run 1000. The SAM and maindetector subsystems needed to have an eventcuts file to set them in cut mode "3", and the CHA beamline eventcuts file needed to be changed to put it in that mode too. Corrected the VQWK number of samples expected from the injector (16564) and the LHRS crate (8000) in the runs beginning with run 1000. --- Parity/prminput/prexCH_beamline_eventcuts.map | 4 ++-- Parity/prminput/prex_detectors.map | 3 +++ Parity/prminput/prex_maindet.map | 2 +- Parity/prminput/prex_maindet_eventcuts.map | 1 + Parity/prminput/prex_sam_eventcuts.map | 1 + Parity/prminput/prexinj_beamline.map | 2 +- 6 files changed, 9 insertions(+), 4 deletions(-) create mode 100644 Parity/prminput/prex_maindet_eventcuts.map create mode 100644 Parity/prminput/prex_sam_eventcuts.map diff --git a/Parity/prminput/prexCH_beamline_eventcuts.map b/Parity/prminput/prexCH_beamline_eventcuts.map index fcec62963..f7391f4cc 100644 --- a/Parity/prminput/prexCH_beamline_eventcuts.map +++ b/Parity/prminput/prexCH_beamline_eventcuts.map @@ -5,7 +5,7 @@ !Available settings !*************************************************** !To turn OFF all checks -EVENTCUTS = 0 +!EVENTCUTS = 0 !*************************************************** !To turn OFF event cuts and perform only HW checks @@ -17,7 +17,7 @@ EVENTCUTS = 0 !*************************************************** !To turn do both event cuts and HW checks and only flag event cut failed events -!EVENTCUTS = 3 +EVENTCUTS = 3 !IMPORTANT !--------- diff --git a/Parity/prminput/prex_detectors.map b/Parity/prminput/prex_detectors.map index 9135fe9fb..88b33207e 100644 --- a/Parity/prminput/prex_detectors.map +++ b/Parity/prminput/prex_detectors.map @@ -22,12 +22,15 @@ name = SAMs map = prex_sam.map param = prex_sam_pedestal.map + eventcut = prex_sam_eventcuts.map [MollerMainDetector] name = MainDets map = prex_maindet.map param = prex_maindet_pedestal.map + eventcut = prex_maindet_eventcuts.map [QwScaler] name = SyncScalers map = prex_scaler.map + eventcut = prex_scaler_eventcuts.map diff --git a/Parity/prminput/prex_maindet.map b/Parity/prminput/prex_maindet.map index 9fd8efd36..f7d2624a7 100644 --- a/Parity/prminput/prex_maindet.map +++ b/Parity/prminput/prex_maindet.map @@ -2,7 +2,7 @@ ROC=25 Bank=0x5 vqwk_buffer_offset=1 -sample_size=16564 +sample_size=8000 ! ! Force all channels to be "not_blindable" during testing ! diff --git a/Parity/prminput/prex_maindet_eventcuts.map b/Parity/prminput/prex_maindet_eventcuts.map new file mode 100644 index 000000000..3cf20a1bd --- /dev/null +++ b/Parity/prminput/prex_maindet_eventcuts.map @@ -0,0 +1 @@ +EVENTCUTS = 3 diff --git a/Parity/prminput/prex_sam_eventcuts.map b/Parity/prminput/prex_sam_eventcuts.map new file mode 100644 index 000000000..3cf20a1bd --- /dev/null +++ b/Parity/prminput/prex_sam_eventcuts.map @@ -0,0 +1 @@ +EVENTCUTS = 3 diff --git a/Parity/prminput/prexinj_beamline.map b/Parity/prminput/prexinj_beamline.map index 06b19d424..413f048af 100644 --- a/Parity/prminput/prexinj_beamline.map +++ b/Parity/prminput/prexinj_beamline.map @@ -4,7 +4,7 @@ Bank=0x02 vqwk_buffer_offset=1 !same sample size for ADCs in a given bank -sample_size=16644 +sample_size=16564 ! ! ! module.type, module.num chan.num, det.type, det.name From 14e7d9176df7575e1b707a73bb6fb47ae19546e0 Mon Sep 17 00:00:00 2001 From: Your Name Date: Sun, 27 Jan 2019 16:45:56 -0500 Subject: [PATCH 088/137] Modifications to the merge_from_QwAna_2 to produce matching results compared to master and develop branches With these changes, the mock data generator has been verified to produce a datafile which matches that produced on "master" (commit 5a5d0d4), and the analysis of that data file produces runningsum outputs which match the analysis on the "master" branch. The analysis of PREX test run 1098 produces runningsum outputs which match the analysis on the "develop" branch (commit 5a5d0d4). The changes to QwHelicity are very similar to changes which had been made in develop. --- Parity/include/QwOptionsParity.h | 2 + Parity/prminput/mock_beamline_eventcuts.map | 1 + Parity/prminput/mock_detectors.map | 4 +- .../mock_moller_maindet_eventcuts.map | 1 + Parity/prminput/qwparity_simple.conf | 4 +- Parity/src/QwBeamLine.cc | 14 +- Parity/src/QwBlindDetectorArray.cc | 125 +++++++++--------- Parity/src/QwDetectorArray.cc | 121 ++++++++--------- Parity/src/QwHelicity.cc | 12 +- 9 files changed, 141 insertions(+), 143 deletions(-) create mode 100644 Parity/prminput/mock_beamline_eventcuts.map create mode 100644 Parity/prminput/mock_moller_maindet_eventcuts.map mode change 100755 => 100644 Parity/src/QwHelicity.cc diff --git a/Parity/include/QwOptionsParity.h b/Parity/include/QwOptionsParity.h index 31ce7a4f1..ad0c393ac 100755 --- a/Parity/include/QwOptionsParity.h +++ b/Parity/include/QwOptionsParity.h @@ -26,6 +26,7 @@ #include "QwCombiner.h" #include "QwCorrelator.h" #include "QwDetectorArray.h" +#include "QwBlindDetectorArray.h" #ifdef __USE_DATABASE__ #include "QwParityDB.h" @@ -37,6 +38,7 @@ void DefineOptionsParity(QwOptions& options) /* Define parity options */ QwDetectorArray::DefineOptions(options); + QwBlindDetectorArray::DefineOptions(options); QwEventRing::DefineOptions(options); QwHelicity::DefineOptions(options); QwHelicityPattern::DefineOptions(options); diff --git a/Parity/prminput/mock_beamline_eventcuts.map b/Parity/prminput/mock_beamline_eventcuts.map new file mode 100644 index 000000000..3cf20a1bd --- /dev/null +++ b/Parity/prminput/mock_beamline_eventcuts.map @@ -0,0 +1 @@ +EVENTCUTS = 3 diff --git a/Parity/prminput/mock_detectors.map b/Parity/prminput/mock_detectors.map index bde1d5fd3..1b7414a82 100755 --- a/Parity/prminput/mock_detectors.map +++ b/Parity/prminput/mock_detectors.map @@ -11,10 +11,10 @@ map = mock_qweak_beamline.map param = mock_qweak_pedestal.map geom = mock_beamline_geometry.map - + eventcut = mock_beamline_eventcuts.map [QwDetectorArray] name = Main Detector map = mock_moller_maindet_adc.map param = mock_moller_maindet_pedestal.map - + eventcut = mock_moller_maindet_eventcuts.map diff --git a/Parity/prminput/mock_moller_maindet_eventcuts.map b/Parity/prminput/mock_moller_maindet_eventcuts.map new file mode 100644 index 000000000..3cf20a1bd --- /dev/null +++ b/Parity/prminput/mock_moller_maindet_eventcuts.map @@ -0,0 +1 @@ +EVENTCUTS = 3 diff --git a/Parity/prminput/qwparity_simple.conf b/Parity/prminput/qwparity_simple.conf index 7cd0734fc..2898752df 100755 --- a/Parity/prminput/qwparity_simple.conf +++ b/Parity/prminput/qwparity_simple.conf @@ -19,8 +19,8 @@ enable-alternateasym = no ring.size = 1 ring.stability_cut = 0 -QwMainCerenkovDetector.normalize = no -QwLumi.normalize = yes +QwBlindDetectorArray.normalize = no +QwDetectorArray.normalize = yes write-promptsummary = no blinder.force-target-out = true diff --git a/Parity/src/QwBeamLine.cc b/Parity/src/QwBeamLine.cc index 1254f95a1..7ab22691a 100755 --- a/Parity/src/QwBeamLine.cc +++ b/Parity/src/QwBeamLine.cc @@ -124,11 +124,11 @@ Int_t QwBeamLine::LoadChannelMap(TString mapfile) mapstr.AddBreakpointKeyword("begin"); mapstr.AddBreakpointKeyword("end"); - Int_t buffer_offset; /* Allow some extra words at the start of a bank. - * The buffer_offset value will be reset at the - * start of each ROC or bank declaration, so should - * be relisted for each bank. - */ + Int_t buffer_offset = 0; /* Allow some extra words at the start of a bank. + * The buffer_offset value will be reset at the + * start of each ROC or bank declaration, so should + * be relisted for each bank. + */ while (mapstr.ReadNextLine() && mapstr.SkipSection("PUBLISH")) { RegisterRocBankMarker(mapstr); // Remove the "vqwk_buffer_offset" and "scaler_buffer_offset" @@ -437,12 +437,10 @@ Int_t QwBeamLine::LoadEventCuts(TString filename) // Open the file QwParameterFile mapstr(filename.Data()); fDetectorMaps.insert(mapstr.GetParamFileNameContents()); - int testval = 0; while (mapstr.ReadNextLine()){ - testval++; mapstr.TrimComment('!'); // Remove everything after a '!' character. mapstr.TrimWhitespace(); // Get rid of leading and trailing spaces. - if (mapstr.LineIsEmpty()) {QwMessage << "" << testval << QwLog::endl; continue;} + if (mapstr.LineIsEmpty()) {continue;} TString varname, varvalue; if (mapstr.HasVariablePair("=",varname,varvalue)){ diff --git a/Parity/src/QwBlindDetectorArray.cc b/Parity/src/QwBlindDetectorArray.cc index f90a622c0..0e9ef1825 100644 --- a/Parity/src/QwBlindDetectorArray.cc +++ b/Parity/src/QwBlindDetectorArray.cc @@ -157,7 +157,7 @@ Bool_t QwBlindDetectorArray::PublishByRequest(TString device_name) break; } if (!status) - QwError << "QwLumi::PublishByRequest: Failed to publish channel name: " << device_name << QwLog::endl; + QwError << "QwBlindDetectorArray::PublishByRequest: Failed to publish channel name: " << device_name << QwLog::endl; return status; } @@ -186,6 +186,7 @@ Int_t QwBlindDetectorArray::LoadChannelMap(TString mapfile) mapstr.SetCommentChars("!"); UInt_t value; + size_t vqwk_buffer_offset = 0; while (mapstr.ReadNextLine()) { @@ -193,6 +194,9 @@ Int_t QwBlindDetectorArray::LoadChannelMap(TString mapfile) if (mapstr.PopValue("sample_size",value)) { sample_size=value; } + if (mapstr.PopValue("vqwk_buffer_offset",value)) { + vqwk_buffer_offset=value; + } mapstr.TrimComment('!'); // Remove everything after a '!' character. mapstr.TrimWhitespace(); // Get rid of leading and trailing spaces. if (mapstr.LineIsEmpty()) continue; @@ -263,7 +267,7 @@ Int_t QwBlindDetectorArray::LoadChannelMap(TString mapfile) // localMainDetID.fWordInSubbank=wordsofar; if (modtype=="VQWK"){ - Int_t offset = QwVQWK_Channel::GetBufferOffset(modnum, channum); + Int_t offset = QwVQWK_Channel::GetBufferOffset(modnum, channum)+vqwk_buffer_offset; if (offset>=0){ localMainDetID.fWordInSubbank = wordsofar + offset; } @@ -715,6 +719,61 @@ void QwBlindDetectorArray::RandomizeMollerEvent(int helicity /*, const QwBeamCh fTargetYprime.PrintInfo(); fTargetEnergy.PrintInfo();*/ + if(RequestExternalValue("x_targ", &fTargetX)){ + if (bDEBUG){ + dynamic_cast(&fTargetX)->PrintInfo(); + QwWarning << "QwBlindDetectorArray::RandomizeMollerEvent Found "<(&fTargetY)->PrintInfo(); + QwWarning << "QwBlindDetectorArray::RandomizeMollerEvent Found "<(&fTargetXprime)->PrintInfo(); + QwWarning << "QwBlindDetectorArray::RandomizeMollerEvent Found "<(&fTargetYprime)->PrintInfo(); + QwWarning << "QwBlindDetectorArray::RandomizeMollerEvent Found "<(&fTargetEnergy)->PrintInfo(); + QwWarning << "QwBlindDetectorArray::RandomizeMollerEvent Found "<(&fTargetX)->PrintInfo(); - QwWarning << "QwBlindDetectorArray::ExchangeProcessedData Found "<(&fTargetY)->PrintInfo(); - QwWarning << "QwBlindDetectorArray::ExchangeProcessedData Found "<(&fTargetXprime)->PrintInfo(); - QwWarning << "QwBlindDetectorArray::ExchangeProcessedData Found "<(&fTargetYprime)->PrintInfo(); - QwWarning << "QwBlindDetectorArray::ExchangeProcessedData Found "<(&fTargetEnergy)->PrintInfo(); - QwWarning << "QwBlindDetectorArray::ExchangeProcessedData Found "<(&fTargetX)->PrintInfo(); + QwWarning << "QwDetectorArray::RandomizeMollerEvent Found "<(&fTargetY)->PrintInfo(); + QwWarning << "QwDetectorArray::RandomizeMollerEvent Found "<(&fTargetXprime)->PrintInfo(); + QwWarning << "QwDetectorArray::RandomizeMollerEvent Found "<(&fTargetYprime)->PrintInfo(); + QwWarning << "QwDetectorArray::RandomizeMollerEvent Found "<(&fTargetEnergy)->PrintInfo(); + QwWarning << "QwDetectorArray::RandomizeMollerEvent Found "<(&fTargetX)->PrintInfo(); - QwWarning << "QwDetectorArray::ExchangeProcessedData Found "<(&fTargetY)->PrintInfo(); - QwWarning << "QwDetectorArray::ExchangeProcessedData Found "<(&fTargetXprime)->PrintInfo(); - QwWarning << "QwDetectorArray::ExchangeProcessedData Found "<(&fTargetYprime)->PrintInfo(); - QwWarning << "QwDetectorArray::ExchangeProcessedData Found "<(&fTargetEnergy)->PrintInfo(); - QwWarning << "QwDetectorArray::ExchangeProcessedData Found "< Date: Sun, 27 Jan 2019 17:16:08 -0500 Subject: [PATCH 089/137] Removed the QwMainCerenkovDetector class. This class was replaced by the QwBlindDetectorArray, but the class files had not been removed until now. --- Parity/include/QwMainCerenkovDetector.h | 243 ---- Parity/main/QwMockDataGenerator.cc | 1 - Parity/main/QwParity.cc | 1 - Parity/src/QwMainCerenkovDetector.cc | 1531 ----------------------- 4 files changed, 1776 deletions(-) delete mode 100755 Parity/include/QwMainCerenkovDetector.h delete mode 100755 Parity/src/QwMainCerenkovDetector.cc diff --git a/Parity/include/QwMainCerenkovDetector.h b/Parity/include/QwMainCerenkovDetector.h deleted file mode 100755 index 07d5e6c07..000000000 --- a/Parity/include/QwMainCerenkovDetector.h +++ /dev/null @@ -1,243 +0,0 @@ -/**********************************************************\ -* File: QwMainCerenkovDetector.h * -* * -* Author: P. M. King * -* Time-stamp: <2007-05-08 15:40> * -\**********************************************************/ - -/// -/// \ingroup QwAnalysis_ADC - -#ifndef __QWMAINCERENKOVDETECTOR__ -#define __QWMAINCERENKOVDETECTOR__ - -// System headers -#include - -// Qweak headers -#include "VQwSubsystemParity.h" -#include "QwIntegrationPMT.h" -#include "QwCombinedPMT.h" - - -// Forward declarations -class QwBlinder; -class QwMainCerenkovDetectorID; - - -class QwMainCerenkovDetector: - public VQwSubsystemParity, - public MQwSubsystemCloneable -{ - friend class QwCombinedPMT; - /****************************************************************** - * Class: QwMainCerenkovDetector - * - * - ******************************************************************/ - private: - /// Private default constructor (not implemented, will throw linker error on use) - QwMainCerenkovDetector(); - - public: - /// Constructor with name - QwMainCerenkovDetector(const TString& name) - : VQwSubsystem(name),VQwSubsystemParity(name),bNormalization(kFALSE) - { - fTargetCharge.InitializeChannel("q_targ","derived"); - fTargetX.InitializeChannel("x_targ","derived"); - fTargetY.InitializeChannel("y_targ","derived"); - fTargetXprime.InitializeChannel("xp_targ","derived"); - fTargetYprime.InitializeChannel("yp_targ","derived"); - fTargetEnergy.InitializeChannel("e_targ","derived"); - }; - /// Copy constructor - QwMainCerenkovDetector(const QwMainCerenkovDetector& source) - : VQwSubsystem(source),VQwSubsystemParity(source), - fIntegrationPMT(source.fIntegrationPMT), - fCombinedPMT(source.fCombinedPMT) - { } - /// Virtual destructor - virtual ~QwMainCerenkovDetector() { }; - - /* Member functions derived from VQwSubsystemParity. */ - - /// \brief Define options function - static void DefineOptions(QwOptions &options); - - - void ProcessOptions(QwOptions &options);//Handle command line options - Int_t LoadChannelMap(TString mapfile); - Int_t LoadInputParameters(TString pedestalfile); - Int_t LoadEventCuts(TString filename); - Bool_t ApplySingleEventCuts();//Check for good events by stting limits on the devices readings - void IncrementErrorCounters(); - void PrintErrorCounters() const;// report number of events failed due to HW and event cut faliure - UInt_t GetEventcutErrorFlag();//return the error flag - - //update the error flag in the subsystem level from the top level routines related to stability checks. This will uniquely update the errorflag at each channel based on the error flag in the corresponding channel in the ev_error subsystem - void UpdateErrorFlag(const VQwSubsystem *ev_error); - - - Int_t ProcessConfigurationBuffer(const ROCID_t roc_id, const BankID_t bank_id, UInt_t* buffer, UInt_t num_words); - Int_t ProcessEvBuffer(const ROCID_t roc_id, const BankID_t bank_id, UInt_t* buffer, UInt_t num_words); - - void ClearEventData(); - Bool_t IsGoodEvent(); - - void ProcessEvent(); - void ExchangeProcessedData(); - void ProcessEvent_2(); - - - Bool_t PublishInternalValues() const; - - void SetRandomEventParameters(Double_t mean, Double_t sigma); - void SetRandomEventAsymmetry(Double_t asymmetry); - void RandomizeEventData(int helicity = 0, Double_t time = 0.0); - void EncodeEventData(std::vector &buffer); - - void ConstructHistograms(TDirectory *folder){ - TString tmpstr(""); - ConstructHistograms(folder,tmpstr); - }; - - using VQwSubsystem::ConstructHistograms; - void ConstructHistograms(TDirectory *folder, TString &prefix); - void FillHistograms(); - - using VQwSubsystem::ConstructBranchAndVector; - void ConstructBranchAndVector(TTree *tree, TString &prefix, std::vector &values); - void ConstructBranch(TTree *tree, TString &prefix); - void ConstructBranch(TTree *tree, TString &prefix, QwParameterFile& trim_file ); - - void FillTreeVector(std::vector &values) const; -#ifdef __USE_DATABASE__ - void FillDB(QwParityDB *db, TString datatype); - void FillErrDB(QwParityDB *db, TString datatype); -#endif // __USE_DATABASE__ - - const QwIntegrationPMT* GetChannel(const TString name) const; - - Bool_t Compare(VQwSubsystem* source); - - - /// \brief Blind the asymmetry - void Blind(const QwBlinder *blinder); - /// \brief Blind the difference using the yield - void Blind(const QwBlinder *blinder, const VQwSubsystemParity* subsys); - - - VQwSubsystem& operator= ( VQwSubsystem *value); - VQwSubsystem& operator+= ( VQwSubsystem *value); - VQwSubsystem& operator-= ( VQwSubsystem *value); - - - void Sum(VQwSubsystem* value1, VQwSubsystem* value2); - void Difference(VQwSubsystem* value1, VQwSubsystem* value2); - void Ratio(VQwSubsystem* numer, VQwSubsystem* denom); - void Scale(Double_t factor); - void Normalize(VQwDataElement* denom); - - void AccumulateRunningSum(VQwSubsystem* value); - //remove one entry from the running sums for devices - void DeaccumulateRunningSum(VQwSubsystem* value); - void CalculateRunningAverage(); - - const QwIntegrationPMT* GetIntegrationPMT(const TString name) const; - const QwCombinedPMT* GetCombinedPMT(const TString name) const; - - void DoNormalization(Double_t factor=1.0); - - Bool_t ApplyHWChecks(){//Check for harware errors in the devices - Bool_t status = kTRUE; - for (size_t i=0; i fIntegrationPMT; - std::vector fCombinedPMT; - std::vector fMainDetID; - - protected: - QwBeamCharge fTargetCharge; - QwBeamPosition fTargetX; - QwBeamPosition fTargetY; - QwBeamAngle fTargetXprime; - QwBeamAngle fTargetYprime; - QwBeamEnergy fTargetEnergy; - - Bool_t bIsExchangedDataValid; - - Bool_t bNormalization; - - private: - - static const Bool_t bDEBUG=kFALSE; - Int_t fMainDetErrorCount; - -}; - - -class QwMainCerenkovDetectorID -{ - public: - QwMainCerenkovDetectorID():fSubbankIndex(-1),fWordInSubbank(-1), - fTypeID(kQwUnknownPMT),fIndex(-1), - fSubelement(kInvalidSubelementIndex),fmoduletype(""),fdetectorname("") - {}; - - int fSubbankIndex; - int fWordInSubbank; //first word reported for this channel in the subbank - //(eg VQWK channel report 6 words for each event, scalers oly report one word per event) - // The first word of the subbank gets fWordInSubbank=0 - - EQwPMTInstrumentType fTypeID; // type of detector - int fIndex; // index of this detector in the vector containing all the detector of same type - UInt_t fSubelement; // some detectors have many subelements (eg stripline have 4 antenas) - // some have only one sub element(eg lumis have one channel) - - TString fmoduletype; // eg: VQWK, SCALER - TString fdetectorname; - TString fdetectortype; // stripline, IntegrationPMT, ... this string is encoded by fTypeID - - std::vector fCombinedChannelNames; - std::vector fWeight; - - void Print() const; - -}; - - -#endif - - - - - - - - - - - - - diff --git a/Parity/main/QwMockDataGenerator.cc b/Parity/main/QwMockDataGenerator.cc index 25a0edcf5..39ecaa803 100644 --- a/Parity/main/QwMockDataGenerator.cc +++ b/Parity/main/QwMockDataGenerator.cc @@ -19,7 +19,6 @@ #include "QwEventBuffer.h" #include "QwHelicity.h" #include "QwHelicityPattern.h" -#include "QwMainCerenkovDetector.h" #include "QwBlindDetectorArray.h" //#include "QwScanner.h" #include "QwSubsystemArrayParity.h" diff --git a/Parity/main/QwParity.cc b/Parity/main/QwParity.cc index 6e21fbd25..504e91bc7 100644 --- a/Parity/main/QwParity.cc +++ b/Parity/main/QwParity.cc @@ -44,7 +44,6 @@ #include "QwHelicity.h" #include "QwFakeHelicity.h" #include "QwBeamLine.h" -#include "QwMainCerenkovDetector.h" #include "QwBeamMod.h" #include "QwIntegratedRaster.h" diff --git a/Parity/src/QwMainCerenkovDetector.cc b/Parity/src/QwMainCerenkovDetector.cc deleted file mode 100755 index 5ed39bad9..000000000 --- a/Parity/src/QwMainCerenkovDetector.cc +++ /dev/null @@ -1,1531 +0,0 @@ -/**********************************************************\ -* File: QwMainCerenkovDetector.cc * -* * -* Author: P. M. King * -* Time-stamp: <2007-05-08 15:40> * -\**********************************************************/ - -#include "QwMainCerenkovDetector.h" - -// System headers -#include - -// Qweak headers -#include "QwSubsystemArray.h" -#include "QwLog.h" -#ifdef __USE_DATABASE__ -#define MYSQLPP_SSQLS_NO_STATICS -#include "QwParitySSQLS.h" -#include "QwParityDB.h" -#endif //__USE_DATABASE__ -#include "QwPromptSummary.h" - -// Register this subsystem with the factory -RegisterSubsystemFactory(QwMainCerenkovDetector); - -/** - * Defines configuration options for QwEventBuffer class using QwOptions - * functionality. - * - * @param options Options object - */ -void QwMainCerenkovDetector::DefineOptions(QwOptions &options){ - // Define the execution options - options.AddOptions() - ("QwMainCerenkovDetector.normalize", - po::value()->default_bool_value(true), - "Normalize the detectors by beam current"); -} - - -/*! - * Loads the configuration options into this instance of - * QwMainCerenkovDetector from the QwOptions object. - * - * @param options Options object - */ -void QwMainCerenkovDetector::ProcessOptions(QwOptions &options){ - bNormalization = options.GetValue("QwMainCerenkovDetector.normalize"); - if (! bNormalization){ - QwWarning << "QwMainCerenkovDetector::ProcessOptions: " - << "Detector yields WILL NOT be normalized." - << QwLog::endl; - } -} - - -//*****************************************************************// -/** - * Publish internal values - * @return - */ -Bool_t QwMainCerenkovDetector::PublishInternalValues() const -{ - // Publish variables - Bool_t status = kTRUE; - - status = status && PublishInternalValue("qwk_md1neg", "qwk_md1neg", GetIntegrationPMT("qwk_md1neg")->GetChannel("qwk_md1neg")); - status = status && PublishInternalValue("qwk_md1pos", "qwk_md1pos", GetIntegrationPMT("qwk_md1pos")->GetChannel("qwk_md1pos")); - status = status && PublishInternalValue("qwk_md2neg", "qwk_md2neg", GetIntegrationPMT("qwk_md2neg")->GetChannel("qwk_md2neg")); - status = status && PublishInternalValue("qwk_md2pos", "qwk_md2pos", GetIntegrationPMT("qwk_md2pos")->GetChannel("qwk_md2pos")); - status = status && PublishInternalValue("qwk_md3neg", "qwk_md3neg", GetIntegrationPMT("qwk_md3neg")->GetChannel("qwk_md3neg")); - status = status && PublishInternalValue("qwk_md3pos", "qwk_md3pos", GetIntegrationPMT("qwk_md3pos")->GetChannel("qwk_md3pos")); - status = status && PublishInternalValue("qwk_md4neg", "qwk_md4neg", GetIntegrationPMT("qwk_md4neg")->GetChannel("qwk_md4neg")); - status = status && PublishInternalValue("qwk_md4pos", "qwk_md4pos", GetIntegrationPMT("qwk_md4pos")->GetChannel("qwk_md4pos")); - status = status && PublishInternalValue("qwk_md5neg", "qwk_md5neg", GetIntegrationPMT("qwk_md5neg")->GetChannel("qwk_md5neg")); - status = status && PublishInternalValue("qwk_md5pos", "qwk_md5pos", GetIntegrationPMT("qwk_md5pos")->GetChannel("qwk_md5pos")); - status = status && PublishInternalValue("qwk_md6neg", "qwk_md6neg", GetIntegrationPMT("qwk_md6neg")->GetChannel("qwk_md6neg")); - status = status && PublishInternalValue("qwk_md6pos", "qwk_md6pos", GetIntegrationPMT("qwk_md6pos")->GetChannel("qwk_md6pos")); - status = status && PublishInternalValue("qwk_md7neg", "qwk_md7neg", GetIntegrationPMT("qwk_md7neg")->GetChannel("qwk_md7neg")); - status = status && PublishInternalValue("qwk_md7pos", "qwk_md7pos", GetIntegrationPMT("qwk_md7pos")->GetChannel("qwk_md7pos")); - status = status && PublishInternalValue("qwk_md8neg", "qwk_md8neg", GetIntegrationPMT("qwk_md8neg")->GetChannel("qwk_md8neg")); - status = status && PublishInternalValue("qwk_md8pos", "qwk_md8pos", GetIntegrationPMT("qwk_md8pos")->GetChannel("qwk_md8pos")); - status = status && PublishInternalValue("qwk_md9neg", "qwk_md9neg", GetIntegrationPMT("qwk_md9neg")->GetChannel("qwk_md9neg")); - status = status && PublishInternalValue("qwk_md9pos", "qwk_md9pos", GetIntegrationPMT("qwk_md9pos")->GetChannel("qwk_md9pos")); - -/* - status = status && PublishInternalValue("qwk_md1barsum","qwk_md1barsum", GetCombinedPMT("qwk_md1barsum")->GetChannel("qwk_md1barsum")); - status = status && PublishInternalValue("qwk_md2barsum","qwk_md2barsum", GetCombinedPMT("qwk_md2barsum")->GetChannel("qwk_md2barsum")); - status = status && PublishInternalValue("qwk_md3barsum","qwk_md3barsum", GetCombinedPMT("qwk_md3barsum")->GetChannel("qwk_md3barsum")); - status = status && PublishInternalValue("qwk_md4barsum","qwk_md4barsum", GetCombinedPMT("qwk_md4barsum")->GetChannel("qwk_md4barsum")); - status = status && PublishInternalValue("qwk_md5barsum","qwk_md5barsum", GetCombinedPMT("qwk_md5barsum")->GetChannel("qwk_md5barsum")); - status = status && PublishInternalValue("qwk_md6barsum","qwk_md6barsum", GetCombinedPMT("qwk_md6barsum")->GetChannel("qwk_md6barsum")); - status = status && PublishInternalValue("qwk_md7barsum","qwk_md7barsum", GetCombinedPMT("qwk_md7barsum")->GetChannel("qwk_md7barsum")); - status = status && PublishInternalValue("qwk_md8barsum","qwk_md8barsum", GetCombinedPMT("qwk_md8barsum")->GetChannel("qwk_md8barsum")); - - status = status && PublishInternalValue("qwk_mdallbars","qwk_mdallbars", GetCombinedPMT("qwk_mdallbars")->GetChannel("qwk_mdallbars")); -*/ - - return status; - - - // TODO: - // The variables should be published based on the parameter file. - // See QwBeamLine class for an implementation. - - // Publish variables through map file - // This should work with bcm, bpmstripline, bpmcavity, combo bpm and combo bcm - for (size_t pp = 0; pp < fPublishList.size(); pp++) { - TString publish_name = fPublishList.at(pp).at(0); - TString device_type = fPublishList.at(pp).at(1); - TString device_name = fPublishList.at(pp).at(2); - TString device_prop = fPublishList.at(pp).at(3); - device_type.ToLower(); - device_prop.ToLower(); - - const VQwHardwareChannel* tmp_channel; - if (device_type == "integrationpmt") { - tmp_channel = GetIntegrationPMT(device_name)->GetChannel(device_name); - } else if (device_type == "combinedpmt") { - tmp_channel = GetCombinedPMT(device_name)->GetChannel(device_name); - } else - QwError << "QwBeamLine::PublishInternalValues() error "<< QwLog::endl; - - if (tmp_channel == NULL) { - QwError << "QwBeamLine::PublishInternalValues(): " << publish_name << " not found" << QwLog::endl; - status |= kFALSE; - } else { - QwDebug << "QwBeamLine::PublishInternalValues(): " << publish_name << " found" << QwLog::endl; - } - status = status && PublishInternalValue(publish_name, publish_name, tmp_channel); - - } - - return status; -} - - -//*****************************************************************// -Int_t QwMainCerenkovDetector::LoadChannelMap(TString mapfile) -{ - Bool_t ldebug=kFALSE; - - std::vector combinedchannelnames; - std::vector weight; - Int_t currentrocread=0; - Int_t currentbankread=0; - Int_t wordsofar=0; - Int_t currentsubbankindex=-1; - Int_t sample_size=0; - - - - // Open the file - QwParameterFile mapstr(mapfile.Data()); - TString varname, varvalue; - - fDetectorMaps.insert(mapstr.GetParamFileNameContents()); - while (mapstr.ReadNextLine()) - { - mapstr.TrimComment('!'); // Remove everything after a '!' character. - mapstr.TrimWhitespace(); // Get rid of leading and trailing spaces. - if (mapstr.LineIsEmpty()) continue; - - if (mapstr.HasVariablePair("=",varname,varvalue)) - { - // This is a declaration line. Decode it. - varname.ToLower(); - UInt_t value = QwParameterFile::GetUInt(varvalue); - - RegisterRocBankMarker(mapstr); - if (varname=="sample_size") - { - sample_size=value; - } - } - else - { - Bool_t lineok = kTRUE; - TString keyword = ""; - TString keyword2 = ""; - TString modtype = ""; - TString dettype = ""; - TString namech = ""; - Int_t modnum = 0; - Int_t channum = 0; - - modtype = mapstr.GetTypedNextToken(); // module type - - if (modtype == "VQWK") - { - modnum = mapstr.GetTypedNextToken(); //slot number - channum = mapstr.GetTypedNextToken(); //channel number - dettype = mapstr.GetTypedNextToken(); //type-purpose of the detector - dettype.ToLower(); - namech = mapstr.GetTypedNextToken(); //name of the detector - namech.ToLower(); - - keyword = mapstr.GetTypedNextToken(); - keyword.ToLower(); - keyword2 = mapstr.GetTypedNextToken(); - keyword2.ToLower(); - } - else if (modtype == "VPMT") - { - channum = mapstr.GetTypedNextToken(); //channel number - Int_t combinedchans = mapstr.GetTypedNextToken(); //number of combined channels - dettype = mapstr.GetTypedNextToken(); //type-purpose of the detector - dettype.ToLower(); - namech = mapstr.GetTypedNextToken(); //name of the detector - namech.ToLower(); - combinedchannelnames.clear(); - for (int i=0; i(); - nameofcombinedchan.ToLower(); - combinedchannelnames.push_back(nameofcombinedchan); - } - weight.clear(); - for (int i=0; i()); - } - keyword = mapstr.GetTypedNextToken(); - keyword.ToLower(); - keyword2 = mapstr.GetTypedNextToken(); - keyword2.ToLower(); - } - - - if (currentsubbankindex!=GetSubbankIndex(currentrocread,currentbankread)) - { - currentsubbankindex=GetSubbankIndex(currentrocread,currentbankread); - wordsofar=0; - } - - QwMainCerenkovDetectorID localMainDetID; - localMainDetID.fdetectorname=namech; - localMainDetID.fmoduletype=modtype; - localMainDetID.fSubbankIndex=currentsubbankindex; - localMainDetID.fdetectortype=dettype; - - // localMainDetID.fWordInSubbank=wordsofar; - if (modtype=="VQWK"){ - Int_t offset = QwVQWK_Channel::GetBufferOffset(modnum, channum); - if (offset>=0){ - localMainDetID.fWordInSubbank = wordsofar + offset; - } - } - else if (modtype=="VPMT") - { - localMainDetID.fCombinedChannelNames = combinedchannelnames; - localMainDetID.fWeight = weight; - //std::cout<<"Add in a combined channel"< publishinfo; - while ((section = mapstr.ReadNextSection(varvalue))) { - if (varvalue == "PUBLISH") { - fPublishList.clear(); - while (section->ReadNextLine()) { - section->TrimComment(); // Remove everything after a comment character - section->TrimWhitespace(); // Get rid of leading and trailing spaces - for (int ii = 0; ii < 4; ii++) { - varvalue = section->GetNextToken().c_str(); - if (varvalue.Length()) { - publishinfo.push_back(varvalue); - } - } - if (publishinfo.size() == 4) - fPublishList.push_back(publishinfo); - publishinfo.clear(); - } - } - } - // Print list of variables to publish - QwMessage << "Variables to publish:" << QwLog::endl; - for (size_t jj = 0; jj < fPublishList.size(); jj++) - QwMessage << fPublishList.at(jj).at(0) << " " << fPublishList.at(jj).at(1) << " " - << fPublishList.at(jj).at(2) << " " << fPublishList.at(jj).at(3) << QwLog::endl; - - if (ldebug) - { - std::cout<<"Done with Load channel map\n"; - for (size_t i=0;i=0) - fMainDetID[i].Print(); - } - ldebug=kFALSE; - mapstr.Close(); // Close the file (ifstream) - return 0; -} - - -Int_t QwMainCerenkovDetector::LoadEventCuts(TString filename) -{ - Int_t eventcut_flag = 1; - - // Open the file - QwParameterFile mapstr(filename.Data()); - fDetectorMaps.insert(mapstr.GetParamFileNameContents()); - while (mapstr.ReadNextLine()) - { - //std::cout<<"********* In the loop *************"<(); - device_type.ToLower(); - TString device_name = mapstr.GetTypedNextToken(); - device_name.ToLower(); - Int_t det_index = GetDetectorIndex(GetDetectorTypeID(device_type),device_name); - if (det_index == -1) { - QwWarning << " Device not found " << device_name << " of type " << device_type << QwLog::endl; - continue; - } - - if (device_type == GetQwPMTInstrumentTypeName(kQwIntegrationPMT)){ - Double_t LLX = mapstr.GetTypedNextToken(); //lower limit for IntegrationPMT value - Double_t ULX = mapstr.GetTypedNextToken(); //upper limit for IntegrationPMT value - varvalue = mapstr.GetTypedNextToken();//global/local - varvalue.ToLower(); - Double_t stabilitycut = mapstr.GetTypedNextToken(); - QwMessage << "QwMainCerenkovDetector Error Code passing to QwIntegrationPMT " << GetGlobalErrorFlag(varvalue,eventcut_flag,stabilitycut) << QwLog::endl; - - //std::cout<<"*****************************"<(); //lower limit for CombinedPMT value - Double_t ULX = mapstr.GetTypedNextToken(); //upper limit for CombinedPMT value - varvalue = mapstr.GetTypedNextToken();//global/local - varvalue.ToLower(); - Double_t stabilitycut = mapstr.GetTypedNextToken(); - QwMessage << "QwMainCerenkovDetector Error Code passing to QwCombinedPMT " << GetGlobalErrorFlag(varvalue,eventcut_flag,stabilitycut) << QwLog::endl; - - //std::cout<<"*****************************"<(); //name of the channel - varname.ToLower(); - varname.Remove(TString::kBoth,' '); - varped= mapstr.GetTypedNextToken(); // value of the pedestal - varcal= mapstr.GetTypedNextToken(); // value of the calibration factor - if (ldebug) std::cout<<"inputs for channel "< &buffer) -{ - std::vector elements; - elements.clear(); - - // Get all buffers in the order they are defined in the map file - for (size_t i = 0; i < fMainDetID.size(); i++) - { - // This is a QwIntegrationPMT - if (fMainDetID.at(i).fTypeID == kQwIntegrationPMT) - fIntegrationPMT[fMainDetID.at(i).fIndex].EncodeEventData(elements); - } - - // If there is element data, generate the subbank header - std::vector subbankheader; - std::vector rocheader; - if (elements.size() > 0) - { - - // Form CODA subbank header - subbankheader.clear(); - subbankheader.push_back(elements.size() + 1); // subbank size - subbankheader.push_back((fCurrentBank_ID << 16) | (0x01 << 8) | (1 & 0xff)); - // subbank tag | subbank type | event number - - // Form CODA bank/roc header - rocheader.clear(); - rocheader.push_back(subbankheader.size() + elements.size() + 1); // bank/roc size - rocheader.push_back((fCurrentROC_ID << 16) | (0x10 << 8) | (1 & 0xff)); - // bank tag == ROC | bank type | event number - - // Add bank header, subbank header and element data to output buffer - buffer.insert(buffer.end(), rocheader.begin(), rocheader.end()); - buffer.insert(buffer.end(), subbankheader.begin(), subbankheader.end()); - buffer.insert(buffer.end(), elements.begin(), elements.end()); - } -} - - - -Int_t QwMainCerenkovDetector::ProcessConfigurationBuffer(const ROCID_t roc_id, const BankID_t bank_id, UInt_t* buffer, UInt_t num_words) -{ - - /* Int_t index = GetSubbankIndex(roc_id,bank_id); - if (index>=0 && num_words>0){ - // We want to process the configuration data for this ROC. - UInt_t words_read = 0; - for (size_t i = 0; i < fMainDetID.size(); i++) { - words_read += fIntegrationPMT[i].ProcessConfigurationBuffer(&(buffer[words_read]), - num_words-words_read); - } - }*/ - return 0; -} - - -Int_t QwMainCerenkovDetector::ProcessEvBuffer(const ROCID_t roc_id, const BankID_t bank_id, UInt_t* buffer, UInt_t num_words) -{ - Bool_t lkDEBUG=kFALSE; - - Int_t index = GetSubbankIndex(roc_id,bank_id); - - if (index>=0 && num_words>0) - { - // We want to process this ROC. Begin looping through the data. - if (lkDEBUG) - std::cout << "QwMainCerenkovDetector::ProcessEvBuffer: " - << "Begin processing ROC" << roc_id - << " and subbank "<IntegrationPMT[ "<CombinedPMT[ "<(ev_error); - if(Compare(tmp)){ - const QwMainCerenkovDetector* input = dynamic_cast (ev_error); - - for (size_t i=0;ifIntegrationPMT.size();i++) - this->fIntegrationPMT[i].UpdateErrorFlag(&(input->fIntegrationPMT[i])); - - for (size_t i=0;ifCombinedPMT.size();i++) - this->fCombinedPMT[i].UpdateErrorFlag(&(input->fCombinedPMT[i])); - } -}; - - -void QwMainCerenkovDetector::ProcessEvent() -{ - for (size_t i=0;i variable_list; - variable_list.push_back(&fTargetCharge); - variable_list.push_back(&fTargetX); - variable_list.push_back(&fTargetY); - variable_list.push_back(&fTargetXprime); - variable_list.push_back(&fTargetYprime); - variable_list.push_back(&fTargetEnergy); - */ - - // Loop over all variables in the list - /* - //IMPORTANT NOTE ABOUT THE COMMENTED LOOP - //NAMES OF THE variable_list DEVICES WILL BE OVER WRITTEN BY ACTUAL NAMES OF DATA ELEMENTS THAT WE ARE READING FROM THE - //ROUTINE RequestExternalValue(variable->GetElementName(), variable). DO TRY THIS AT HOME! - - - std::vector::iterator variable_iter; - for (variable_iter = variable_list.begin(); variable_iter != variable_list.end(); variable_iter++){ - VQwDataElement* variable = *variable_iter; - //QwWarning << "QwMainCerenkovDetector::ExchangeProcessedData for loop "<GetElementName()<< QwLog::endl; - if (RequestExternalValue(variable->GetElementName(), variable)) - { - if (bDEBUG) - dynamic_cast(variable)->PrintInfo(); - //QwWarning << "QwMainCerenkovDetector::ExchangeProcessedData Found "<GetElementName()<< QwLog::endl; - } - else - { - bIsExchangedDataValid = kFALSE; - QwError << GetSubsystemName() << " could not get external value for " - << variable->GetElementName() << QwLog::endl; - } - } // end of loop over variables - - */ - - if(RequestExternalValue("q_targ", &fTargetCharge)){ - if (bDEBUG){ - QwWarning << "QwMainCerenkovDetector::ExchangeProcessedData Found "<(&fTargetCharge))->PrintInfo(); - } - } - else{ - bIsExchangedDataValid = kFALSE; - QwError << GetSubsystemName() << " could not get external value for " - << fTargetCharge.GetElementName() << QwLog::endl; - } - /* - if(RequestExternalValue("x_targ", &fTargetX)){ - if (bDEBUG){ - dynamic_cast(&fTargetX)->PrintInfo(); - QwWarning << "QwMainCerenkovDetector::ExchangeProcessedData Found "<(&fTargetY)->PrintInfo(); - QwWarning << "QwMainCerenkovDetector::ExchangeProcessedData Found "<(&fTargetXprime)->PrintInfo(); - QwWarning << "QwMainCerenkovDetector::ExchangeProcessedData Found "<(&fTargetYprime)->PrintInfo(); - QwWarning << "QwMainCerenkovDetector::ExchangeProcessedData Found "<(&fTargetEnergy)->PrintInfo(); - QwWarning << "QwMainCerenkovDetector::ExchangeProcessedData Found "<DoNormalization(); - } - else - { - QwWarning<<"QwMainCerenkovDetector::ProcessEvent_2(): could not get all external values."< &values) -{ - for (size_t i=0;i &values) const -{ - for (size_t i=0;i(value); - if (input->fIntegrationPMT.size()!=fIntegrationPMT.size() || - input->fCombinedPMT.size()!=fCombinedPMT.size() ) - { - res=kFALSE; - // std::cout<<" not the same number of channels \n"; - } - } - return res; -} - - -VQwSubsystem& QwMainCerenkovDetector::operator= (VQwSubsystem *value) -{ - // std::cout<<" here in QwMainCerenkovDetector::operator= \n"; - if (Compare(value)) - { -// VQwSubsystem::operator=(value); - QwMainCerenkovDetector* input = dynamic_cast (value); - - for (size_t i=0;ifIntegrationPMT.size();i++) - this->fIntegrationPMT[i]=input->fIntegrationPMT[i]; - - for (size_t i=0;ifCombinedPMT.size();i++) - (this->fCombinedPMT[i])=(input->fCombinedPMT[i]); - } - return *this; -} - - -VQwSubsystem& QwMainCerenkovDetector::operator+= (VQwSubsystem *value) -{ - if (Compare(value)) - { - QwMainCerenkovDetector* input= dynamic_cast(value) ; - - for (size_t i=0;ifIntegrationPMT.size();i++) - this->fIntegrationPMT[i]+=input->fIntegrationPMT[i]; - - for (size_t i=0;ifCombinedPMT.size();i++) - this->fCombinedPMT[i]+=input->fCombinedPMT[i]; - - } - return *this; -} - - -VQwSubsystem& QwMainCerenkovDetector::operator-= (VQwSubsystem *value) -{ - - if (Compare(value)) - { - QwMainCerenkovDetector* input= dynamic_cast(value); - - for (size_t i=0;ifIntegrationPMT.size();i++) - this->fIntegrationPMT[i]-=input->fIntegrationPMT[i]; - - for (size_t i=0;ifCombinedPMT.size();i++) - this->fCombinedPMT[i]-=input->fCombinedPMT[i]; - - } - return *this; -} - - - -void QwMainCerenkovDetector::Sum(VQwSubsystem *value1,VQwSubsystem *value2) -{ - if (Compare(value1)&&Compare(value2)) - { - *this = value1; - *this += value2; - } -} - -void QwMainCerenkovDetector::Difference(VQwSubsystem *value1,VQwSubsystem *value2) -{ - if (Compare(value1)&&Compare(value2)) - { - *this = value1; - *this -= value2; - } -} - -void QwMainCerenkovDetector::Ratio(VQwSubsystem *numer, VQwSubsystem *denom) -{ - if (Compare(numer)&&Compare(denom)) - { - QwMainCerenkovDetector* innumer= dynamic_cast(numer) ; - QwMainCerenkovDetector* indenom= dynamic_cast(denom) ; - - for (size_t i=0;ifIntegrationPMT.size();i++) - this->fIntegrationPMT[i].Ratio(innumer->fIntegrationPMT[i],indenom->fIntegrationPMT[i]); - - for (size_t i=0;ifCombinedPMT.size();i++) - this->fCombinedPMT[i].Ratio(innumer->fCombinedPMT[i],indenom->fCombinedPMT[i]); - - } - return; -} - - -void QwMainCerenkovDetector::Scale(Double_t factor) -{ - for (size_t i=0;i(value1); - - for (size_t i = 0; i < fIntegrationPMT.size(); i++) - fIntegrationPMT[i].AccumulateRunningSum(value->fIntegrationPMT[i]); - for (size_t i = 0; i < fCombinedPMT.size(); i++) - fCombinedPMT[i].AccumulateRunningSum(value->fCombinedPMT[i]); - } -} - -void QwMainCerenkovDetector::DeaccumulateRunningSum(VQwSubsystem* value1){ - if (Compare(value1)) { - QwMainCerenkovDetector* value = dynamic_cast(value1); - - for (size_t i = 0; i < fIntegrationPMT.size(); i++) - fIntegrationPMT[i].DeaccumulateRunningSum(value->fIntegrationPMT[i]); - for (size_t i = 0; i < fCombinedPMT.size(); i++) - fCombinedPMT[i].DeaccumulateRunningSum(value->fCombinedPMT[i]); - } -}; - - -/** - * Blind the asymmetry - * @param blinder Blinder - */ -void QwMainCerenkovDetector::Blind(const QwBlinder *blinder) -{ - for (size_t i = 0; i < fIntegrationPMT.size(); i++) - fIntegrationPMT[i].Blind(blinder); - for (size_t i = 0; i < fCombinedPMT.size(); i++) - fCombinedPMT[i].Blind(blinder); -} - -/** - * Blind the difference using the yield - * @param blinder Blinder - * @param subsys Subsystem - */ -void QwMainCerenkovDetector::Blind(const QwBlinder *blinder, const VQwSubsystemParity* subsys) -{ - /// \todo TODO (wdc) At some point we should introduce const-correctness in - /// the Compare() routine to ensure nothing funny happens. This const_casting - /// is just an ugly stop-gap measure. - if (Compare(const_cast(subsys))) { - - const QwMainCerenkovDetector* yield = dynamic_cast(subsys); - if (yield == 0) return; - - for (size_t i = 0; i < fIntegrationPMT.size(); i++) - fIntegrationPMT[i].Blind(blinder, yield->fIntegrationPMT[i]); - for (size_t i = 0; i < fCombinedPMT.size(); i++) - fCombinedPMT[i].Blind(blinder, yield->fCombinedPMT[i]); - } -} - -EQwPMTInstrumentType QwMainCerenkovDetector::GetDetectorTypeID(TString name) -{ - return GetQwPMTInstrumentType(name); -} - -//*****************************************************************// -Int_t QwMainCerenkovDetector::GetDetectorIndex(EQwPMTInstrumentType type_id, TString name) -{ - Bool_t ldebug=kFALSE; - if (ldebug) - { - std::cout<<"QwMainCerenkovDetector::GetDetectorIndex\n"; - std::cout<<"type_id=="<"<Normalize(&fTargetCharge); - } - catch (std::exception& e) - { - std::cerr << e.what() << std::endl; - } - } -} - -#ifdef __USE_DATABASE__ -void QwMainCerenkovDetector::FillDB(QwParityDB *db, TString datatype) -{ - Bool_t local_print_flag = false; - - if(local_print_flag) { - QwMessage << " --------------------------------------------------------------- " << QwLog::endl; - QwMessage << " QwMainCerenkovDetector::FillDB " << QwLog::endl; - QwMessage << " --------------------------------------------------------------- " << QwLog::endl; - } - - std::vector interface; - std::vector entrylist; - - UInt_t analysis_id = db->GetAnalysisID(); - - TString measurement_type; - measurement_type = QwDBInterface::DetermineMeasurementTypeID(datatype); - - UInt_t i,j; - i = j = 0; - if(local_print_flag) QwMessage << QwColor(Qw::kGreen) << "IntegrationPMT" <Connect(); - // Check the entrylist size, if it isn't zero, start to query.. - if( entrylist.size() ) { - mysqlpp::Query query= db->Query(); - query.insert(entrylist.begin(), entrylist.end()); - query.execute(); - } - else { - QwMessage << "QwMainCerenkovDetector::FillDB :: This is the case when the entrlylist contains nothing in "<< datatype.Data() << QwLog::endl; - } - db->Disconnect(); - return; -} -#endif //__USE_DATABASE__ - -void QwMainCerenkovDetector::PrintValue() const -{ - QwMessage << "=== QwMainCerenkovDetector: " << GetSubsystemName() << " ===" << QwLog::endl; - for (size_t i = 0; i < fIntegrationPMT.size(); i++) - fIntegrationPMT[i].PrintValue(); - for (size_t i = 0; i < fCombinedPMT.size(); i++) - fCombinedPMT[i].PrintValue(); -} - -void QwMainCerenkovDetector::PrintInfo() const -{ - std::cout<<"Name of the subsystem ="< interface; - std::vector entrylist; - - UInt_t analysis_id = db->GetAnalysisID(); - - UInt_t i,j; - i = j = 0; - if(local_print_flag) QwMessage << QwColor(Qw::kGreen) << "IntegrationPMT" <Connect(); - // Check the entrylist size, if it isn't zero, start to query.. - if( entrylist.size() ) { - mysqlpp::Query query= db->Query(); - query.insert(entrylist.begin(), entrylist.end()); - query.execute(); - } - else { - QwMessage << "QwMainCerenkovDetector::FillErrDB :: This is the case when the entrlylist contains nothing in "<< datatype.Data() << QwLog::endl; - } - db->Disconnect(); - - return; -}; -#endif //__USE_DATABASE__ - - -void QwMainCerenkovDetector::WritePromptSummary(QwPromptSummary *ps, TString type) -{ - - Bool_t local_print_flag = true; - if(local_print_flag){ - QwMessage << " --------------------------------------------------------------- " << QwLog::endl; - QwMessage << " QwMainCerenkovDetectorID::WritePromptSummary() " << QwLog::endl; - QwMessage << " --------------------------------------------------------------- " << QwLog::endl; - } - - // ps->PrintCSV(); - - return; -} - - - -void QwMainCerenkovDetectorID::Print() const -{ - - std::cout< Date: Sun, 27 Jan 2019 18:04:37 -0500 Subject: [PATCH 090/137] Fixes to merge branch for the data handler classes. The QwLumi and QwMainDetector classes have been removed, so don't include them in QwFeedback. Update the names of the detector subsystem types in prex_detectors. --- Feedback/main/QwFeedback.cc | 3 --- Parity/prminput/prex_detectors.map | 4 ++-- 2 files changed, 2 insertions(+), 5 deletions(-) diff --git a/Feedback/main/QwFeedback.cc b/Feedback/main/QwFeedback.cc index a92cc49e3..457bcf8c9 100644 --- a/Feedback/main/QwFeedback.cc +++ b/Feedback/main/QwFeedback.cc @@ -34,9 +34,6 @@ #include "QwHelicity.h" #include "QwFakeHelicity.h" #include "QwBeamLine.h" -#include "QwMainCerenkovDetector.h" -#include "QwLumi.h" -#include "QwBeamMod.h" #include "QwVQWK_Channel.h" diff --git a/Parity/prminput/prex_detectors.map b/Parity/prminput/prex_detectors.map index 88b33207e..2f5b12af4 100644 --- a/Parity/prminput/prex_detectors.map +++ b/Parity/prminput/prex_detectors.map @@ -18,13 +18,13 @@ eventcut = prexCH_beamline_eventcuts.map param = prexCH_beamline_pedestal.map -[QwLumi] +[QwDetectorArray] name = SAMs map = prex_sam.map param = prex_sam_pedestal.map eventcut = prex_sam_eventcuts.map -[MollerMainDetector] +[QwBlindDetectorArray] name = MainDets map = prex_maindet.map param = prex_maindet_pedestal.map From 6b25ee3ee5fac8573155e6d224d27bfd723d22c8 Mon Sep 17 00:00:00 2001 From: Wouter Deconinck Date: Tue, 20 Nov 2018 13:30:57 -0500 Subject: [PATCH 091/137] Initial import of HAPPEX 18-bit ADC --- Analysis/include/QwADC18_Channel.h | 305 +++++++ Analysis/src/QwADC18_Channel.cc | 1224 +++++++++++++++++++++++++++ CMakeLists.txt | 6 +- Parity/prminput/adc18.conf | 30 + Parity/prminput/adc18_adc.map | 25 + Parity/prminput/adc18_detectors.map | 9 + Parity/prminput/adc18_helicity.map | 18 + Parity/prminput/adc18_pedestal.map | 18 + 8 files changed, 1632 insertions(+), 3 deletions(-) create mode 100755 Analysis/include/QwADC18_Channel.h create mode 100755 Analysis/src/QwADC18_Channel.cc create mode 100755 Parity/prminput/adc18.conf create mode 100755 Parity/prminput/adc18_adc.map create mode 100755 Parity/prminput/adc18_detectors.map create mode 100755 Parity/prminput/adc18_helicity.map create mode 100755 Parity/prminput/adc18_pedestal.map diff --git a/Analysis/include/QwADC18_Channel.h b/Analysis/include/QwADC18_Channel.h new file mode 100755 index 000000000..9bfb85acc --- /dev/null +++ b/Analysis/include/QwADC18_Channel.h @@ -0,0 +1,305 @@ +/**********************************************************\ +* File: QwADC18_Channel.h * +* * +* Author: P. M. King, W. Deconinck, B. Michaels * +\**********************************************************/ + +#ifndef __QwADC18_CHANNEL__ +#define __QwADC18_CHANNEL__ + +// System headers +#include + +// ROOT headers +#include "TTree.h" + +// Qweak headers +#include "VQwHardwareChannel.h" +#include "MQwMockable.h" + +// Forward declarations +class QwBlinder; +class QwParameterFile; +#ifdef __USE_DATABASE__ +class QwErrDBInterface; +#endif + +/// +/// \ingroup QwAnalysis_ADC +/// +/// \ingroup QwAnalysis_BL +class QwADC18_Channel: public VQwHardwareChannel, public MQwMockable { +/****************************************************************//** + * Class: QwADC18_Channel + * Base class containing decoding functions for the HAPPEX 18-bit ADC + * The functions in this class will decode a single channel + * worth of ADC18_Channel data and provide the components + * through member functions. + ******************************************************************/ + public: + static Int_t GetBufferOffset(Int_t moduleindex, Int_t channelindex); + static void PrintErrorCounterHead(); + static void PrintErrorCounterTail(); + + static const Double_t kTimePerSample; + + using MQwMockable::LoadMockDataParameters; + + using VQwHardwareChannel::GetRawValue; + using VQwHardwareChannel::GetValue; + using VQwHardwareChannel::GetValueM2; + using VQwHardwareChannel::GetValueError; + using VQwHardwareChannel::GetValueWidth; + + using VQwHardwareChannel::AccumulateRunningSum; + using VQwHardwareChannel::DeaccumulateRunningSum; + + public: + QwADC18_Channel(): MQwMockable() { + InitializeChannel("",""); + SetADC18SaturationLimt(8.5);//FIXME set the default saturation limit + }; + QwADC18_Channel(TString name, TString datatosave = "raw"): MQwMockable() { + InitializeChannel(name, datatosave); + SetADC18SaturationLimt(8.5);//FIXME set the default saturation limit + }; + QwADC18_Channel(const QwADC18_Channel& value): + VQwHardwareChannel(value), MQwMockable(value), + fNumberOfSamples_map(value.fNumberOfSamples_map), + fSaturationABSLimit(value.fSaturationABSLimit) + { + *this = value; + }; + QwADC18_Channel(const QwADC18_Channel& value, VQwDataElement::EDataToSave datatosave): + VQwHardwareChannel(value,datatosave), MQwMockable(value), + fNumberOfSamples_map(value.fNumberOfSamples_map), + fSaturationABSLimit(value.fSaturationABSLimit) + { + *this = value; + }; + virtual ~QwADC18_Channel() { }; + + /// \brief Initialize the fields in this object + void InitializeChannel(TString name, TString datatosave); + + /// \brief Initialize the fields in this object + void InitializeChannel(TString subsystem, TString instrumenttype, TString name, TString datatosave); + + void LoadChannelParameters(QwParameterFile ¶mfile); + + // Will update the default sample size for the module. + void SetDefaultSampleSize(size_t num_samples_map) { + // This will be checked against the no.of samples read by the module + fNumberOfSamples_map = num_samples_map; + }; + + void ClearEventData(); + + /// Internally generate random event data + void RandomizeEventData(int helicity = 0.0, double time = 0.0); + + /// Forces the event "number of samples" varible to be what was expected from the mapfile. + /// NOTE: this should only be used in mock data generation! + void ForceMapfileSampleSize() {fNumberOfSamples = fNumberOfSamples_map;}; + +//------------------------------------------------------------------------------------------ + virtual void SmearByResolution(double resolution); +//------------------------------------------------------------------------------------------ + + void SetEventData(Double_t value); + void SetRawEventData(); + + /// Encode the event data into a CODA buffer + void EncodeEventData(std::vector &buffer); + + /// Decode the event data from a CODA buffer + Int_t ProcessEvBuffer(UInt_t* buffer, UInt_t num_words_left, UInt_t index = 0); + + /// Process the event data according to pedestal and calibration factor + void ProcessEvent(); + + QwADC18_Channel& operator= (const QwADC18_Channel &value); + void AssignScaledValue(const QwADC18_Channel &value, Double_t scale); + void AssignValueFrom(const VQwDataElement* valueptr); + void AddValueFrom(const VQwHardwareChannel* valueptr); + void SubtractValueFrom(const VQwHardwareChannel* valueptr); + void MultiplyBy(const VQwHardwareChannel* valueptr); + void DivideBy(const VQwHardwareChannel* valueptr); + void ArcTan(const QwADC18_Channel &value); + + QwADC18_Channel& operator+= (const QwADC18_Channel &value); + QwADC18_Channel& operator-= (const QwADC18_Channel &value); + QwADC18_Channel& operator*= (const QwADC18_Channel &value); + + VQwHardwareChannel& operator+=(const VQwHardwareChannel* input); + VQwHardwareChannel& operator-=(const VQwHardwareChannel* input); + VQwHardwareChannel& operator*=(const VQwHardwareChannel* input); + VQwHardwareChannel& operator/=(const VQwHardwareChannel* input); + + const QwADC18_Channel operator+ (const QwADC18_Channel &value) const; + const QwADC18_Channel operator- (const QwADC18_Channel &value) const; + const QwADC18_Channel operator* (const QwADC18_Channel &value) const; + void Sum(const QwADC18_Channel &value1, const QwADC18_Channel &value2); + void Difference(const QwADC18_Channel &value1, const QwADC18_Channel &value2); + void Ratio(const QwADC18_Channel &numer, const QwADC18_Channel &denom); + void Product(const QwADC18_Channel &value1, const QwADC18_Channel &value2); + void DivideBy(const QwADC18_Channel& denom); + void AddChannelOffset(Double_t Offset); + void Scale(Double_t Offset); + + inline void AccumulateRunningSum(const QwADC18_Channel& value){ + AccumulateRunningSum(value, value.fGoodEventCount); + } + void AccumulateRunningSum(const QwADC18_Channel& value, Int_t count); + void AccumulateRunningSum(const VQwHardwareChannel *value, Int_t count){ + const QwADC18_Channel *tmp_ptr = dynamic_cast(value); + if (tmp_ptr != NULL) AccumulateRunningSum(*tmp_ptr, count); + }; + ////deaccumulate one value from the running sum + inline void DeaccumulateRunningSum(const QwADC18_Channel& value){ + AccumulateRunningSum(value, -1); + }; + /* + void DeaccumulateRunningSum(VQwHardwareChannel *value){ + const QwADC18_Channel *tmp_ptr = dynamic_cast(value); + if (tmp_ptr != NULL) DeaccumulateRunningSum(*tmp_ptr); + }; + */ + + void CalculateRunningAverage(); + + Bool_t MatchSequenceNumber(size_t seqnum); + Bool_t MatchNumberOfSamples(size_t numsamp); + + /*Event cut related routines*/ + //check values read from modules are at desired level + Bool_t ApplySingleEventCuts(Double_t LL, Double_t UL); + //check values read from modules are at desired level by comparing upper and lower limits (fULimit and fLLimit) set on this channel + Bool_t ApplySingleEventCuts(); + // report number of events failed due to HW and event cut faliure + void PrintErrorCounters() const; + + // FIXME Set the absolute staturation limit in volts + void SetADC18SaturationLimt(Double_t sat_volts = 8.5){ + fSaturationABSLimit = sat_volts; + } + + // Get the absolute staturation limit in volts + Double_t GetADC18SaturationLimt(){ + return fSaturationABSLimit; + } + + + // Check for harware errors in the devices. This will return the device error code. + Int_t ApplyHWChecks(); + + // Update the error counters based on the internal fErrorFlag + void IncrementErrorCounters(); + + /*End*/ + + Int_t GetRawValue(size_t element) const { return fValue_Raw; }; + Double_t GetValue(size_t element) const { return fValue; }; + Double_t GetValueM2(size_t element) const { return fValueM2; }; + Double_t GetValueError(size_t element) const { return fValueError; }; + + void ConstructHistograms(TDirectory *folder, TString &prefix); + void FillHistograms(); + + void ConstructBranchAndVector(TTree *tree, TString &prefix, std::vector &values); + void ConstructBranch(TTree *tree, TString &prefix); + void FillTreeVector(std::vector &values) const; + + Double_t GetAverageVolts() const; + + size_t GetSequenceNumber() const {return (fSequenceNumber);}; + size_t GetNumberOfSamples() const {return (fNumberOfSamples);}; + + void SetCalibrationToVolts(){SetCalibrationFactor(kADC18_VoltsPerBit);}; + + friend std::ostream& operator<< (std::ostream& stream, const QwADC18_Channel& channel); + void PrintValue() const; + void PrintInfo() const; + + /// \brief Blind this channel as an asymmetry + void Blind(const QwBlinder *blinder); + /// \brief Blind this channel as a difference + void Blind(const QwBlinder *blinder, const QwADC18_Channel& yield); + + void ScaledAdd(Double_t scale, const VQwHardwareChannel *value); + +#ifdef __USE_DATABASE__ + // Error Counters exist in QwADC18_Channel, not in VQwHardwareChannel + // + void AddErrEntriesToList(std::vector &row_list); +#endif + + protected: + QwADC18_Channel& operator/= (const QwADC18_Channel &value); + + private: + UInt_t fValue_Raw; + Double_t fValue; + Double_t fValueM2; + Double_t fValueError; + + private: + static const Bool_t kDEBUG; + static const Int_t kWordsPerChannel; //no.of words per channel in the CODA buffer + static const Int_t kMaxChannels; //no.of channels per module + + /// Pointer to the running sum for this channel + QwADC18_Channel* fRunningSum; + + /*! \name ADC Calibration */ + // @{ + static const Double_t kADC18_VoltsPerBit; + //@} + + + /*! \name Channel information data members */ + + /*! \name Channel configuration data members */ + // @{ + + size_t fSequenceNumber; ///< Event sequence number for this channel + size_t fPreviousSequenceNumber; ///< Previous event sequence number for this channel + size_t fNumberOfSamples; ///< Number of samples read through the module + size_t fNumberOfSamples_map; ///< Number of samples in the expected to read through the module. This value is set in the QwBeamline map file + + // Set of error counters for each HW test. + Int_t fErrorCount_HWSat; ///< check to see ADC channel is saturated + Int_t fErrorCount_sample; ///< for sample size check + Int_t fErrorCount_SW_HW; ///< HW_sum==SW_sum check + Int_t fErrorCount_Sequence; ///< sequence number check + Int_t fErrorCount_SameHW; ///< check to see ADC returning same HW value + Int_t fErrorCount_ZeroHW; ///< check to see ADC returning zero + + Int_t fNumEvtsWithEventCutsRejected; ///< Counts the Event cut rejected events + + + + Int_t fADC_Same_NumEvt; ///< Keep track of how many events with same ADC value returned + Int_t fSequenceNo_Prev; ///< Keep the sequence number of the last event + Int_t fSequenceNo_Counter; ///< Internal counter to keep track of the sequence number + Double_t fPrev_HardwareBlockSum; ///< Previous Module-based sum of the four sub-blocks + + + + Double_t fSaturationABSLimit;/// + +// Qweak headers +#include "QwLog.h" +#include "QwUnits.h" +#include "QwBlinder.h" +#include "QwHistogramHelper.h" +#ifdef __USE_DATABASE__ +#include "QwDBInterface.h" +#endif + +const Bool_t QwADC18_Channel::kDEBUG = kFALSE; + +const Int_t QwADC18_Channel::kWordsPerChannel = 6; // FIXME +const Int_t QwADC18_Channel::kMaxChannels = 8; // FIXME + +const Double_t QwADC18_Channel::kTimePerSample = 2.0 * Qw::us; // FIXME + +/*! Conversion factor to translate the average bit count in an ADC + * channel into average voltage. + * The base factor is roughly 76 uV per count, and zero counts corresponds + * to zero voltage. + * Store as the exact value for 20 V range, 18 bit ADC. + */ +const Double_t QwADC18_Channel::kADC18_VoltsPerBit = (20./(1<<18)); // FIXME + +/*! Static member function to return the word offset within a data buffer + * given the module number index and the channel number index. + * @param moduleindex Module index within this buffer; counts from zero + * @param channelindex Channel index within this module; counts from zero + * @return The number of words offset to the beginning of this + * channel's data from the beginning of the ADC18 buffer. + */ +Int_t QwADC18_Channel::GetBufferOffset(Int_t moduleindex, Int_t channelindex){ + Int_t offset = -1; + if (moduleindex<0 ){ + QwError << "QwADC18_Channel::GetBufferOffset: Invalid module index," + << moduleindex + << ". Must be zero or greater." + << QwLog::endl; + } else if (channelindex<0 || channelindex>kMaxChannels){ + QwError << "QwADC18_Channel::GetBufferOffset: Invalid channel index," + << channelindex + << ". Must be in range [0," << kMaxChannels << "]." + << QwLog::endl; + } else { + offset = ( (moduleindex * kMaxChannels) + channelindex ) + * kWordsPerChannel; + } + return offset; + } + + +/********************************************************/ +Int_t QwADC18_Channel::ApplyHWChecks() +{ + Bool_t fEventIsGood=kTRUE; + Bool_t bStatus; + if (bEVENTCUTMODE>0){//Global switch to ON/OFF event cuts set at the event cut file + + if (bDEBUG) + QwWarning<<" QwQWVK_Channel "<0){//we have ADC stuck with same value + if (bDEBUG) QwWarning<<" BCM hardware sum is same for more than "< GetADC18SaturationLimt()){ + if (bDEBUG) + QwWarning << this->GetElementName()<<" "< &buffer) +{ + UInt_t localbuf[kWordsPerChannel] = {0}; + + if (IsNameEmpty()) { + // This channel is not used, but is present in the data stream. + // Fill in with zero. + localbuf.push_back( 0 ); + } else { + localbuf.push_back( ((fValue_Raw << data_shift) & data_mask) ); + } + + for (Int_t i = 0; i < kWordsPerChannel; i++) { + buffer.push_back(localbuf[i]); + } +} + + +// FIXME here goes the decoding of raw data from CODA blocks +Int_t QwADC18_Channel::ProcessEvBuffer(UInt_t* buffer, UInt_t num_words_left, UInt_t index) +{ + UInt_t mask31x = 0x80000000; // Header bit mask + UInt_t mask3029x = 0x60000000; // Channel number mask + UInt_t mask2625x = 0x06000000; // Divider value mask + UInt_t mask2422x = 0x01c00000; // Data type mask + UInt_t mask21x = 0x00200000; // Data type 0 value sign mask + UInt_t mask200x = 0x001fffff; // Data type 0 value field mask + UInt_t mask2118x = 0x003c0000; // Data types 1-2 sample number mask + UInt_t mask170x = 0x0003ffff; // Data types 1-2 value field mask + UInt_t mask150x = 0x0000ffff; // Data type 4 value field mask + + UInt_t words_read = 0; + if (IsNameEmpty()){ + // This channel is not used, but is present in the data stream. + // Skip over this data. + words_read = fNumberOfDataWords; + } else if (num_words_left >= fNumberOfDataWords) { + + UInt_t rawd = buffer[0]; + + // "Actual" values from data word + Int_t act_dtype = (rawd & mask2422x) >> 22; + Int_t act_chan = act_dtype != 4 ? ((rawd & mask3029x) >> 29) : 0; + Int_t act_dvalue = (rawd & mask2625x) >> 25; + Int_t act_snum = act_dtype == 1 || act_dtype == 2 ? + ((rawd & mask2118x) >> 18) : 0; + + fValue_Raw = act_dvalue; // FIXME ??? + fValue = fCalibrationFactor * (Double_t(fValue_Raw) - fPedestal); + + words_read = fNumberOfDataWords; + } else { + QwError << "QwADC18_Channel::ProcessEvBuffer: Not enough words!" << QwLog::endl; + } + return words_read; +} + + + +void QwADC18_Channel::ProcessEvent() +{ + // FIXME error checking +} + +Double_t QwADC18_Channel::GetAverageVolts() const +{ + return fValue * kADC18_VoltsPerBit / fNumberOfSamples; +} + +void QwADC18_Channel::PrintInfo() const +{ + QwMessage<<"***************************************"<Fill(GetValue()); + if (fHistograms[index] != NULL && (fErrorFlag)==0) + fHistograms[index++]->Fill(GetValueRaw()); + } + else if(fDataToSave==kDerived) + { + if (fHistograms[index] != NULL && (fErrorFlag)==0) + fHistograms[index++]->Fill(GetValue()); + } + } +} + +void QwADC18_Channel::ConstructBranchAndVector(TTree *tree, TString &prefix, std::vector &values) +{ + if (IsNameEmpty()){ + // This channel is not used, so skip setting up the tree. + } else { + TString basename = prefix + GetElementName(); + fTreeArrayIndex = values.size(); + + TString list; + + values.push_back(0.0); + list = "value/D"; + + values.push_back(0.0); + list += ":Device_Error_Code/D"; + + if (fDataToSave == kRaw){ + values.push_back(0.0); + list += ":raw/D"; + } + + fTreeArrayNumEntries = values.size() - fTreeArrayIndex; + if (gQwHists.MatchDeviceParamsFromList(basename.Data())) + tree->Branch(basename, &(values[fTreeArrayIndex]), list); + } +} + +void QwADC18_Channel::ConstructBranch(TTree *tree, TString &prefix) +{ + if (IsNameEmpty()){ + // This channel is not used, so skip setting up the tree. + } else { + TString basename = prefix + GetElementName(); + tree->Branch(basename, &fValue, basename+"/D"); + } +} + + +void QwADC18_Channel::FillTreeVector(std::vector &values) const +{ + if (IsNameEmpty()) { + // This channel is not used, so skip setting up the tree. + } else if (fTreeArrayNumEntries < 0) { + QwError << "VQwScaler_Channel::FillTreeVector: fTreeArrayNumEntries==" + << fTreeArrayNumEntries << QwLog::endl; + } else if (fTreeArrayNumEntries == 0) { + static bool warned = false; + if (!warned) { + QwError << "VQwScaler_Channel::FillTreeVector: fTreeArrayNumEntries==" + << fTreeArrayNumEntries << " (no branch constructed?)" << QwLog::endl; + QwError << "Offending element is " << GetElementName() << QwLog::endl; + warned = true; + } + } else if (values.size() < fTreeArrayIndex+fTreeArrayNumEntries) { + QwError << "VQwScaler_Channel::FillTreeVector: values.size()==" + << values.size() << " name: " << fElementName + << "; fTreeArrayIndex+fTreeArrayNumEntries==" + << fTreeArrayIndex << '+' << fTreeArrayNumEntries << '=' + << fTreeArrayIndex+fTreeArrayNumEntries + << QwLog::endl; + } else { + size_t index = fTreeArrayIndex; + values[index++] = this->fValue; + values[index++] = this->fErrorFlag; + if(fDataToSave==kRaw){ + values[index++] = this->fValue_Raw; + } + } +} + + +QwADC18_Channel& QwADC18_Channel::operator= (const QwADC18_Channel &value) +{ + if (this == &value) return *this; + + if (!IsNameEmpty()) { + VQwHardwareChannel::operator=(value); + this->fValue_Raw = value.fValue_Raw; + this->fValue = value.fValue; + this->fValueError = value.fValueError; + this->fValueM2 = value.fValueM2; + } + return *this; +} + +void QwADC18_Channel::AssignScaledValue(const QwADC18_Channel &value, + Double_t scale) +{ + if(this == &value) return; + + if (!IsNameEmpty()) { + this->fValue = value.fValue * scale; + this->fValueError = value.fValueError; + this->fValueM2 = value.fValueM2 * scale * scale; + this->fErrorFlag = value.fErrorFlag;//error code is updated. + this->fGoodEventCount = value.fGoodEventCount; + } +} + +void QwADC18_Channel::AssignValueFrom(const VQwDataElement* valueptr) +{ + const QwADC18_Channel* tmpptr; + tmpptr = dynamic_cast(valueptr); + if (tmpptr!=NULL){ + *this = *tmpptr; + } else { + TString loc="Standard exception from QwADC18_Channel::AssignValueFrom = " + +valueptr->GetElementName()+" is an incompatable type."; + throw std::invalid_argument(loc.Data()); + } +} +void QwADC18_Channel::AddValueFrom(const VQwHardwareChannel* valueptr) +{ + const QwADC18_Channel* tmpptr; + tmpptr = dynamic_cast(valueptr); + if (tmpptr!=NULL){ + *this += *tmpptr; + } else { + TString loc="Standard exception from QwADC18_Channel::AddValueFrom = " + +valueptr->GetElementName()+" is an incompatable type."; + throw std::invalid_argument(loc.Data()); + } +} +void QwADC18_Channel::SubtractValueFrom(const VQwHardwareChannel* valueptr) +{ + const QwADC18_Channel* tmpptr; + tmpptr = dynamic_cast(valueptr); + if (tmpptr!=NULL){ + *this -= *tmpptr; + } else { + TString loc="Standard exception from QwADC18_Channel::SubtractValueFrom = " + +valueptr->GetElementName()+" is an incompatable type."; + throw std::invalid_argument(loc.Data()); + } +} +void QwADC18_Channel::MultiplyBy(const VQwHardwareChannel* valueptr) +{ + const QwADC18_Channel* tmpptr; + tmpptr = dynamic_cast(valueptr); + if (tmpptr!=NULL){ + *this *= *tmpptr; + } else { + TString loc="Standard exception from QwADC18_Channel::MultiplyBy = " + +valueptr->GetElementName()+" is an incompatable type."; + throw std::invalid_argument(loc.Data()); + } +} +void QwADC18_Channel::DivideBy(const VQwHardwareChannel* valueptr) +{ + const QwADC18_Channel* tmpptr; + tmpptr = dynamic_cast(valueptr); + if (tmpptr!=NULL){ + *this /= *tmpptr; + } else { + TString loc="Standard exception from QwADC18_Channel::DivideBy = " + +valueptr->GetElementName()+" is an incompatable type."; + throw std::invalid_argument(loc.Data()); + } +} + + +const QwADC18_Channel QwADC18_Channel::operator+ (const QwADC18_Channel &value) const +{ + QwADC18_Channel result = *this; + result += value; + return result; +} + +QwADC18_Channel& QwADC18_Channel::operator+= (const QwADC18_Channel &value) +{ + if (!IsNameEmpty()) { + this->fValue += value.fValue; + this->fValueM2 = 0.0; + this->fErrorFlag |= value.fErrorFlag;//error code is ORed. + } + return *this; +} + +const QwADC18_Channel QwADC18_Channel::operator- (const QwADC18_Channel &value) const +{ + QwADC18_Channel result = *this; + result -= value; + return result; +} + +QwADC18_Channel& QwADC18_Channel::operator-= (const QwADC18_Channel &value) +{ + if (!IsNameEmpty()){ + this->fValue -= value.fValue; + this->fValueM2 = 0.0; + this->fErrorFlag |= (value.fErrorFlag);//error code is ORed. + } + return *this; +} + +const QwADC18_Channel QwADC18_Channel::operator* (const QwADC18_Channel &value) const +{ + QwADC18_Channel result = *this; + result *= value; + return result; +} + +QwADC18_Channel& QwADC18_Channel::operator*= (const QwADC18_Channel &value) +{ + if (!IsNameEmpty()){ + this->fValue *= value.fValue; + this->fValue_Raw = 0; + this->fValueM2 = 0.0; + this->fErrorFlag |= (value.fErrorFlag);//error code is ORed. + } + return *this; +} + +VQwHardwareChannel& QwADC18_Channel::operator+=(const VQwHardwareChannel *source) +{ + const QwADC18_Channel* tmpptr; + tmpptr = dynamic_cast(source); + if (tmpptr!=NULL){ + *this += *tmpptr; + } else { + TString loc="Standard exception from QwADC18_Channel::operator+= " + +source->GetElementName()+" " + +this->GetElementName()+" are not of the same type"; + throw(std::invalid_argument(loc.Data())); + } + return *this; +} + +VQwHardwareChannel& QwADC18_Channel::operator-=(const VQwHardwareChannel *source) +{ + const QwADC18_Channel* tmpptr; + tmpptr = dynamic_cast(source); + if (tmpptr!=NULL){ + *this -= *tmpptr; + } else { + TString loc="Standard exception from QwADC18_Channel::operator-= " + +source->GetElementName()+" " + +this->GetElementName()+" are not of the same type"; + throw(std::invalid_argument(loc.Data())); + } + return *this; +} + +VQwHardwareChannel& QwADC18_Channel::operator*=(const VQwHardwareChannel *source) +{ + const QwADC18_Channel* tmpptr; + tmpptr = dynamic_cast(source); + if (tmpptr!=NULL){ + *this *= *tmpptr; + } else { + TString loc="Standard exception from QwADC18_Channel::operator*= " + +source->GetElementName()+" " + +this->GetElementName()+" are not of the same type"; + throw(std::invalid_argument(loc.Data())); + } + return *this; +} + +VQwHardwareChannel& QwADC18_Channel::operator/=(const VQwHardwareChannel *source) +{ + const QwADC18_Channel* tmpptr; + tmpptr = dynamic_cast(source); + if (tmpptr!=NULL){ + *this /= *tmpptr; + } else { + TString loc="Standard exception from QwADC18_Channel::operator/= " + +source->GetElementName()+" " + +this->GetElementName()+" are not of the same type"; + throw(std::invalid_argument(loc.Data())); + } + return *this; +} + + +void QwADC18_Channel::Sum(const QwADC18_Channel &value1, const QwADC18_Channel &value2) +{ + *this = value1; + *this += value2; +} + +void QwADC18_Channel::Difference(const QwADC18_Channel &value1, const QwADC18_Channel &value2) +{ + *this = value1; + *this -= value2; +} + +void QwADC18_Channel::Ratio(const QwADC18_Channel &numer, const QwADC18_Channel &denom) +{ + if (!IsNameEmpty()) { + *this = numer; + *this /= denom; + + // Set the raw values to zero. + fValue_Raw = 0; + + // Remaining variables + fGoodEventCount = denom.fGoodEventCount; + fErrorFlag = (numer.fErrorFlag|denom.fErrorFlag);//error code is ORed. + } +} + +QwADC18_Channel& QwADC18_Channel::operator/= (const QwADC18_Channel &denom) +{ + // In this function, leave the "raw" variables untouched. + Double_t ratio; + Double_t variance; + if (!IsNameEmpty()) { + // The variances are calculated using the following formula: + // Var[ratio] = ratio^2 (Var[numer] / numer^2 + Var[denom] / denom^2) + // + // This requires that both the numerator and denominator are non-zero! + // + if (this->fValue != 0.0 && denom.fValue != 0.0){ + ratio = (this->fValue) / (denom.fValue); + variance = ratio * ratio * + (this->fValueM2 / this->fValue / this->fValue + + denom.fValueM2 / denom.fValue / denom.fValue); + fValue = ratio; + fValueM2 = variance; + } else if (this->fValue == 0.0) { + fValue = 0.0; + fValueM2 = 0.0; + } else { + QwVerbose << "Attempting to divide by zero in " + << GetElementName() << QwLog::endl; + fValue = 0.0; + fValueM2 = 0.0; + } + + // Remaining variables + // Don't change fGoodEventCount. + // 'OR' the device error codes together. + fErrorFlag |= denom.fErrorFlag; + } + + // Nanny + if (fValue != fValue) + QwWarning << "Angry Nanny: NaN detected in " << GetElementName() << QwLog::endl; + return *this; +} + +//-------------------------------------------------------------------------------------------- + +void QwADC18_Channel::ArcTan(const QwADC18_Channel &value) +{ + if (!IsNameEmpty()) { + this->fValue = atan(value.fValue); + } + // FIXME stuff missing here +} + +//-------------------------------------------------------------------------------------------- +void QwADC18_Channel::Product(const QwADC18_Channel &value1, const QwADC18_Channel &value2) +{ + if (!IsNameEmpty()){ + fValue = value1.fValue * value2.fValue; + fValue_Raw = 0; + + // Remaining variables + fGoodEventCount = value2.fGoodEventCount; + fErrorFlag = (value1.fErrorFlag | value2.fErrorFlag);//error code is ORed. + } +} + +/** +This function will add a offset to the hw_sum and add the same offset for blocks. + */ +void QwADC18_Channel::AddChannelOffset(Double_t offset) +{ + if (!IsNameEmpty()) + { + fValue += offset; + } +} + +void QwADC18_Channel::Scale(Double_t scale) +{ + if (!IsNameEmpty()) + { + fValue *= scale; + fValueM2 *= scale * scale; + } +} + +void QwADC18_Channel::DivideBy(const QwADC18_Channel &denom) +{ + *this /= denom; +} + + +/** Moments and uncertainty calculation on the running sums and averages + * The calculation of the first and second moments of the running sum is not + * completely straightforward due to numerical instabilities associated with + * small variances and large average values. The naive computation taking + * the difference of the square of the average and the average of the squares + * leads to the subtraction of two very large numbers to get a small number. + * + * Alternative algorithms (including for higher order moments) are supplied in + * Pebay, Philippe (2008), "Formulas for Robust, One-Pass Parallel Computation + * of Covariances and Arbitrary-Order Statistical Moments", Technical Report + * SAND2008-6212, Sandia National Laboratories. + * http://infoserve.sandia.gov/sand_doc/2008/086212.pdf + * + * In the following formulas the moments \f$ M^1 \f$ and \f$ M^2 \f$ are defined + * \f{eqnarray} + * M^1 & = & \frac{1}{n} \sum^n y \\ + * M^2 & = & \sum^n (y - \mu) + * \f} + * + * Recurrence relations for the addition of a single event: + * \f{eqnarray} + * M^1_n & = & M^1_{n-1} + \frac{y - M^1_{n-1}}{n} \\ + * M^2_n & = & M^2_{n-1} + (y - M^1_{n-1})(y - M^1_n) + * \f} + * + * For the addition of an already accumulated sum: + * \f{eqnarray} + * M^1 & = & M^1_1 + n_2 \frac{M^1_2 - M^1_1}{n} \\ + * M^2 & = & M^2_1 + M^2_2 + n_1 n_2 \frac{(M^1_2 - M^1_1)^2}{n} + * \f} + * + * In these recursive formulas we start from \f$ M^1 = y \f$ and \f$ M^2 = 0 \f$. + * + * To calculate the mean and standard deviation we use + * \f{eqnarray} + * \mu & = & M^1 \\ + * \sigma^2 & = & \frac{1}{n} M^2 + * \f} + * The standard deviation is a biased estimator, but this is what ROOT uses. + * Better would be to divide by \f$ (n-1) \f$. + * + * We use the formulas provided there for the calculation of the first and + * second moments (i.e. average and variance). + */ +/** + * Accumulate the running moments M1 and M2 + * @param value Object (single event or accumulated) to add to running moments + * @param count Number of good events in value + */ +void QwADC18_Channel::AccumulateRunningSum(const QwADC18_Channel& value, Int_t count) +{ + // Moment calculations + Int_t n1 = fGoodEventCount; + Int_t n2 = count; + + // If there are no good events, check whether device HW is good + if (n2 == 0 && value.fErrorFlag == 0) { + n2 = 1; + } + Int_t n = n1 + n2; + + // Set up variables + Double_t M11 = fValue; + Double_t M12 = value.fValue; + Double_t M22 = value.fValueM2; + if (n2 == 0) { + // no good events for addition + return; + } else if (n2 == 1) { + // simple version for addition of single event + fGoodEventCount++; + fValue += (M12 - M11) / n; + fValueM2 += (M12 - M11) * (M12 - fValue); // note: using updated mean + } else if (n2 > 1) { + // general version for addition of multi-event sets + fGoodEventCount += n2; + fValue += n2 * (M12 - M11) / n; + fValueM2 += M22 + n1 * n2 * (M12 - M11) * (M12 - M11) / n; + } + + // Nanny + if (fValue != fValue) + QwWarning << "Angry Nanny: NaN detected in " << GetElementName() << QwLog::endl; +} + + +void QwADC18_Channel::CalculateRunningAverage() +{ + // See notes in QwVQWK_Channel; we are using: + // error = sqrt(M2)/n, + // or alternately we could use the unbiased estimator for both + // the sigma and error on the mean: + // error = sqrt(M2)/(n-1) + if(fGoodEventCount > 0) { + fValueError = sqrt(fValueM2) / fGoodEventCount; + } else { + fValueError = 0.0; + } +} + + +void QwADC18_Channel::PrintValue() const +{ + QwMessage << std::setprecision(8) + << std::setw(18) << std::left << GetSubsystemName() << "" + << std::setw(18) << std::left << GetModuleType() << "" + << std::setw(18) << std::left << GetElementName() << "" + << std::setw(12) << std::left << GetValue() << " +/- " + << std::setw(12) << std::left << GetValueError() << " sig " + << std::setw(12) << std::left << GetValueSumWidth() << "" + << std::setw(12) << std::left << fGoodEventCount << "" + << QwLog::endl; +} + +std::ostream& operator<< (std::ostream& stream, const QwADC18_Channel& channel) +{ + stream << channel.GetHardwareSum(); + return stream; +} + +/** + * Blind this channel as an asymmetry + * @param blinder Blinder + */ +void QwADC18_Channel::Blind(const QwBlinder *blinder) +{ + if (!IsNameEmpty()) { + if (blinder->IsBlinderOkay() && ((fErrorFlag)==0) ){ + blinder->BlindValue(fValue); + } else { + blinder->ModifyThisErrorCode(fErrorFlag); + fValue = 0.0; + } + } +} + +/** + * Blind this channel as a difference with specified yield + * @param blinder Blinder + * @param yield Corresponding yield + */ +void QwADC18_Channel::Blind(const QwBlinder *blinder, const QwADC18_Channel& yield) +{ + if (!IsNameEmpty()) { + if (blinder->IsBlinderOkay() && ((fErrorFlag) ==0) ){ + blinder->BlindValue(fValue, yield.fValue); + } else { + blinder->ModifyThisErrorCode(fErrorFlag);//update the HW error code + fValue = 0.0; + } + } +} + +Bool_t QwADC18_Channel::MatchSequenceNumber(size_t seqnum) +{ + Bool_t status = kTRUE; + if (!IsNameEmpty()){ + status = (fSequenceNumber == seqnum); + } + return status; +} + +Bool_t QwADC18_Channel::MatchNumberOfSamples(size_t numsamp) +{ + Bool_t status = kTRUE; + if (!IsNameEmpty()){ + status = (fNumberOfSamples==numsamp); + if (! status){ + if (bDEBUG) + QwError << "QwADC18_Channel::MatchNumberOfSamples: Channel " + << GetElementName() + << " had fNumberOfSamples==" << fNumberOfSamples + << " and was supposed to have " << numsamp + << std::endl; + PrintChannel(); + } + } + return status; +} + +Bool_t QwADC18_Channel::ApplySingleEventCuts(Double_t LL,Double_t UL)//only check to see HW_Sum is within these given limits +{ + Bool_t status = kFALSE; + + if (LL==0 && UL==0){ + status=kTRUE; + } else if (GetValue()<=UL && GetValue()>=LL){ + if ((fErrorFlag & kPreserveError)!=0) + status=kTRUE; + else + status=kFALSE;//If the device HW is failed + } + std::cout<<(this->fErrorFlag & kPreserveError)<=2){//Global switch to ON/OFF event cuts set at the event cut file + + if (fULimit==0 && fLLimit==0){ + status=kTRUE; + } else if (GetValue()<=fULimit && GetValue()>=fLLimit){ + if ((fErrorFlag)==0) + status=kTRUE; + else + status=kFALSE;//If the device HW is failed + } + else{ + if (GetValue()> fULimit) + fErrorFlag|=kErrorFlag_EventCut_U; + else + fErrorFlag|=kErrorFlag_EventCut_L; + status=kFALSE; + } + + if (bEVENTCUTMODE==3){ + status=kTRUE; //Update the event cut fail flag but pass the event. + } + + + } + else{ + status=kTRUE; + //fErrorFlag=0;//we need to keep the device error codes + } + + return status; +} + +void QwADC18_Channel::PrintErrorCounterHead() +{ + TString message; + message = Form("%30s","Device name"); + message += Form("%9s", "HW Sat"); + message += Form("%9s", "Sample"); + message += Form("%9s", "SW_HW"); + message += Form("%9s", "Sequence"); + message += Form("%9s", "SameHW"); + message += Form("%9s", "ZeroHW"); + message += Form("%9s", "EventCut"); + QwMessage << "---------------------------------------------------------------------------------------------" << QwLog::endl; + QwMessage << message << QwLog::endl; + QwMessage << "---------------------------------------------------------------------------------------------" << QwLog::endl; +} + +void QwADC18_Channel::PrintErrorCounterTail() +{ + QwMessage << "---------------------------------------------------------------------------------------------" << QwLog::endl; +} + +void QwADC18_Channel::PrintErrorCounters() const +{ + TString message; + if (fErrorCount_sample || fErrorCount_SW_HW || fErrorCount_Sequence || fErrorCount_SameHW || fErrorCount_ZeroHW || fErrorCount_HWSat || fNumEvtsWithEventCutsRejected) { + message = Form("%30s", GetElementName().Data()); + message += Form("%9d", fErrorCount_HWSat); + message += Form("%9d", fErrorCount_sample); + message += Form("%9d", fErrorCount_SW_HW); + message += Form("%9d", fErrorCount_Sequence); + message += Form("%9d", fErrorCount_SameHW); + message += Form("%9d", fErrorCount_ZeroHW); + message += Form("%9d", fNumEvtsWithEventCutsRejected); + + if((fDataToSave == kRaw) && (!kFoundPedestal||!kFoundGain)){ + message += " >>>>> No Pedestal or Gain in map file"; + } + + QwMessage << message << QwLog::endl; + } +} + +void QwADC18_Channel::ScaledAdd(Double_t scale, const VQwHardwareChannel *value) +{ + const QwADC18_Channel* input = dynamic_cast(value); + + // follows same steps as += but w/ scaling factor + if(input!=NULL && !IsNameEmpty()){ + // QwWarning << "Adding " << input->GetElementName() + // << " to " << GetElementName() + // << " with scale factor " << scale + // << QwLog::endl; + // PrintValue(); + // input->PrintValue(); + this->fValue_raw = 0; + this->fValueSum += scale * input->fValueSum; + this->fValueM2 = 0.0; + this->fNumberOfSamples += input->fNumberOfSamples; + this->fSequenceNumber = 0; + this->fErrorFlag |= (input->fErrorFlag); + } + // QwWarning << "Finsihed with addition" << QwLog::endl; + // PrintValue(); +} + +#ifdef __USE_DATABASE__ +void QwADC18_Channel::AddErrEntriesToList(std::vector &row_list) +{ + + // TString message; + // message = Form("%30s",GetElementName().Data()); + // message += Form("%9d", fErrorCount_HWSat); + // message += Form("%9d", fErrorCount_sample); + // message += Form("%9d", fErrorCount_SW_HW); + // message += Form("%9d", fErrorCount_Sequence); + // message += Form("%9d", fErrorCount_SameHW); + // message += Form("%9d", fErrorCount_ZeroHW); + // message += Form("%9d", fNumEvtsWithEventCutsRejected); + // QwMessage << message << QwLog::endl; + + // kErrorFlag_ADC18_Sat =0x1; //ADC18 Saturation Cut. Currently saturation limit is set to +/-8.5V + // kErrorFlag_sample =0x2; //If sample size mis-matches with the default value in the map file. + // kErrorFlag_SW_HW =0x4; //If software sum and hardware sum are not equal. + // kErrorFlag_Sequence =0x8; //If the ADC sequence number is not incrementing properly + // kErrorFlag_SameHW =0x10; //If ADC value keep returning the same value + // kErrorFlag_ZeroHW =0x20; //Check to see ADC is returning zero + + + + // kErrorFlag_EventCut_L =0x40; //Flagged if lower limit of the event cut has failed + // kErrorFlag_EventCut_U =0x80; //Flagged if upper limit of the event cut has failed + // >>>>>> fNumEvtsWithEventCutsRejected + + + // outside QwADC18_Channel + // kErrorFlag_BlinderFail = 0x0200;// in Decimal 512 to identify the blinder fail flag + // kStabilityCutError = 0x10000000;// in Decimal 2^28 to identify the stability cut failure + + // This is my modified mysql DB, Thursday, December 8 16:40:36 EST 2011, jhlee + // Error code must be matched to MySQL DB + // + // mysql> select * from error_code; + // +---------------+------------------------------+ + // | error_code_id | quantity | + // +---------------+------------------------------+ + // | 1 | kErrorFlag_ADC18_Sat | + // | 2 | kErrorFlag_sample | + // | 3 | kErrorFlag_SW_HW | + // | 4 | kErrorFlag_Sequence | + // | 5 | kErrorFlag_SameHW | + // | 6 | kErrorFlag_ZeroHW | + // | 7 | kErrorFlag_EventCut_Rejected | + // | 8 | kErrorFlag_EventCut_L | + // | 9 | kErrorFlag_EventCut_U | + // | 10 | kErrorFlag_BlinderFail | + // | 11 | kStabilityCutError | + // +---------------+------------------------------+ + // 11 rows in set (0.00 sec) + + + QwErrDBInterface row; + TString name = GetElementName(); + + row.Reset(); + row.SetDeviceName(name); + row.SetErrorCodeId(1); + row.SetN(fErrorCount_HWSat); + row_list.push_back(row); + + row.Reset(); + row.SetDeviceName(name); + row.SetErrorCodeId(2); + row.SetN(fErrorCount_sample); + row_list.push_back(row); + + row.Reset(); + row.SetDeviceName(name); + row.SetErrorCodeId(3); + row.SetN(fErrorCount_SW_HW); + row_list.push_back(row); + + + row.Reset(); + row.SetDeviceName(name); + row.SetErrorCodeId(4); + row.SetN(fErrorCount_Sequence); + row_list.push_back(row); + + + row.Reset(); + row.SetDeviceName(name); + row.SetErrorCodeId(5); + row.SetN(fErrorCount_SameHW); + row_list.push_back(row); + + row.Reset(); + row.SetDeviceName(name); + row.SetErrorCodeId(6); + row.SetN(fErrorCount_ZeroHW); + row_list.push_back(row); + + + row.Reset(); + row.SetDeviceName(name); + row.SetErrorCodeId(7); + row.SetN(fNumEvtsWithEventCutsRejected); + row_list.push_back(row); + return; + +} +#endif diff --git a/CMakeLists.txt b/CMakeLists.txt index 3ac118075..1f187b600 100755 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -44,9 +44,9 @@ file(GLOB my_project_sources Parity/src/*.cc ) list(REMOVE_ITEM my_project_sources - ${PROJECT_SOURCE_DIR}/Analysis/src/QwF1TDContainer.cc - ${PROJECT_SOURCE_DIR}/Analysis/src/QwSIS3320_Samples.cc - ) + ${PROJECT_SOURCE_DIR}/Analysis/src/QwF1TDContainer.cc + ${PROJECT_SOURCE_DIR}/Analysis/src/QwSIS3320_Samples.cc + ) file(GLOB my_project_headers Analysis/include/*.h diff --git a/Parity/prminput/adc18.conf b/Parity/prminput/adc18.conf new file mode 100755 index 000000000..100e4c77f --- /dev/null +++ b/Parity/prminput/adc18.conf @@ -0,0 +1,30 @@ +# +# Configuration file for the HAPPEX ADC18 tests. +# + +detectors = mock_detectors.map + +rootfile-stem = adc18_ +codafile-stem = adc18_ +codafile-ext = log + +chainfiles = no +single-output-file = TRUE +disable-slow-tree = yes +disable-burst-tree = yes +enable-burstsum = no +enable-differences = no +enable-alternateasym = no + +ring.size = 1 +ring.stability_cut = 0 + +write-promptsummary = no +blinder.force-target-out = true + +[QwLog] +color = no +loglevel-file = 0 +#loglevel-screen = 0 +print-function = no +print-signature = no diff --git a/Parity/prminput/adc18_adc.map b/Parity/prminput/adc18_adc.map new file mode 100755 index 000000000..63de812e8 --- /dev/null +++ b/Parity/prminput/adc18_adc.map @@ -0,0 +1,25 @@ +ROC=6 +Bank=0x6110 +sample_size=16680 + +! module.type, module.num, module.chan, det.type, det.name +VQWK, 0, 0, IntegrationPMT, VQWK0 +VQWK, 0, 1, IntegrationPMT, VQWK1 +VQWK, 0, 2, IntegrationPMT, VQWK2 +VQWK, 0, 3, IntegrationPMT, VQWK3 +VQWK, 0, 4, IntegrationPMT, VQWK4 +VQWK, 0, 5, IntegrationPMT, VQWK5 +VQWK, 0, 6, IntegrationPMT, VQWK6 +VQWK, 0, 7, IntegrationPMT, VQWK7 + +! module.type, module.num, module.chan, det.type, det.name +ADC18, 0, 0, IntegrationPMT, ADC0 +ADC18, 0, 1, IntegrationPMT, ADC1 +ADC18, 0, 2, IntegrationPMT, ADC2 +ADC18, 0, 3, IntegrationPMT, ADC3 +ADC18, 0, 4, IntegrationPMT, ADC4 +ADC18, 0, 5, IntegrationPMT, ADC5 +ADC18, 0, 6, IntegrationPMT, ADC6 +ADC18, 0, 7, IntegrationPMT, ADC7 + +!END diff --git a/Parity/prminput/adc18_detectors.map b/Parity/prminput/adc18_detectors.map new file mode 100755 index 000000000..a1dc59c7d --- /dev/null +++ b/Parity/prminput/adc18_detectors.map @@ -0,0 +1,9 @@ +[QwHelicity] + name = Helicity Info + map = adc18_qweak_helicity.map + +[MainDetector] + name = Main Detector + map = adc18_adc.map + param = adc18_pedestal.map + diff --git a/Parity/prminput/adc18_helicity.map b/Parity/prminput/adc18_helicity.map new file mode 100755 index 000000000..c8c05648c --- /dev/null +++ b/Parity/prminput/adc18_helicity.map @@ -0,0 +1,18 @@ +HelicityDecodingMode=InputRegisterMode +PatternPhase=4 +RandSeedBits=30 + +ROC=31 +Bank=0x3103 + +! module.type, module.num chan.num, det.type, det.name +! +WORD, 0, 0, helicitydata, input_register +WORD, 0, 0, helicitydata, output_register +WORD, 0, 0, helicitydata, MPS_counter +WORD, 0, 0, helicitydata, PAT_counter +WORD, 0, 0, helicitydata, PAT_phase +WORD, 0, 0, helicitydata, cleandata +WORD, 0, 0, helicitydata, scandata1 +WORD, 0, 0, helicitydata, scandata2 +!END diff --git a/Parity/prminput/adc18_pedestal.map b/Parity/prminput/adc18_pedestal.map new file mode 100755 index 000000000..e1480bca1 --- /dev/null +++ b/Parity/prminput/adc18_pedestal.map @@ -0,0 +1,18 @@ +! Name Offset Gain NormRate(Hz/uA) VoltPerHz Asym C_x C_y C_xp C_yp C_e +VQWK0 0.000000 1.000000 55000000 1.09E-09 0.000001 0.974928 -0.222521 9749.279122 -2225.431860 1000.000000 +VQWK1 0.000000 1.000000 55000000 1.09E-09 0.000001 1.000000 0.000000 10000.000000 0.000000 1000.000000 +VQWK2 0.000000 1.000000 55000000 1.09E-09 0.000001 0.974928 0.222521 9749.279122 2225.431860 1000.000000 +VQWK3 0.000000 1.000000 55000000 1.09E-09 0.000001 0.900969 0.433884 9009.688679 4339.271275 1000.000000 +VQWK4 0.000000 1.000000 55000000 1.09E-09 0.000001 0.974928 -0.222521 9750.254050 -2225.654381 1000.000000 +VQWK5 0.000000 1.000000 55000000 1.09E-09 0.000001 1.000000 0.000000 10001.000000 0.000000 1000.000000 +VQWK6 0.000000 1.000000 55000000 1.09E-09 0.000001 0.974928 0.222521 9750.254050 2225.654381 1000.000000 +VQWK7 0.000000 1.000000 55000000 1.09E-09 0.000001 0.900969 0.433884 9010.589648 4339.705159 1000.000000 +! +ADC0 0.000000 1.000000 55000000 1.09E-09 0.000001 0.974928 -0.222521 9749.279122 -2225.431860 1000.000000 +ADC1 0.000000 1.000000 55000000 1.09E-09 0.000001 1.000000 0.000000 10000.000000 0.000000 1000.000000 +ADC2 0.000000 1.000000 55000000 1.09E-09 0.000001 0.974928 0.222521 9749.279122 2225.431860 1000.000000 +ADC3 0.000000 1.000000 55000000 1.09E-09 0.000001 0.900969 0.433884 9009.688679 4339.271275 1000.000000 +ADC4 0.000000 1.000000 55000000 1.09E-09 0.000001 0.974928 -0.222521 9750.254050 -2225.654381 1000.000000 +ADC5 0.000000 1.000000 55000000 1.09E-09 0.000001 1.000000 0.000000 10001.000000 0.000000 1000.000000 +ADC6 0.000000 1.000000 55000000 1.09E-09 0.000001 0.974928 0.222521 9750.254050 2225.654381 1000.000000 +ADC7 0.000000 1.000000 55000000 1.09E-09 0.000001 0.900969 0.433884 9010.589648 4339.705159 1000.000000 From 1d274de6f77463520b89d8d5e30065a9476f67a1 Mon Sep 17 00:00:00 2001 From: Wouter Deconinck Date: Tue, 20 Nov 2018 14:15:46 -0500 Subject: [PATCH 092/137] All compiler errors fixed. --- Analysis/src/QwADC18_Channel.cc | 112 ++++++++++++-------------------- 1 file changed, 41 insertions(+), 71 deletions(-) diff --git a/Analysis/src/QwADC18_Channel.cc b/Analysis/src/QwADC18_Channel.cc index eaa0c64e7..fa60ab358 100755 --- a/Analysis/src/QwADC18_Channel.cc +++ b/Analysis/src/QwADC18_Channel.cc @@ -70,15 +70,6 @@ Int_t QwADC18_Channel::ApplyHWChecks() fErrorFlag |= kErrorFlag_sample; } - // Check SW and HW return the same sum - bStatus = (GetRawValue() == GetRawSoftwareSum()); - //fEventIsGood = bStatus; - if (!bStatus) { - fErrorFlag |= kErrorFlag_SW_HW; - } - - - //check sequence number fSequenceNo_Prev++; if (fSequenceNo_Counter==0 || GetSequenceNumber()==0){//starting the data run @@ -90,36 +81,6 @@ Int_t QwADC18_Channel::ApplyHWChecks() fErrorFlag|=kErrorFlag_Sequence; if (bDEBUG) QwWarning<<" QwQWVK_Channel "<0){//we have ADC stuck with same value - if (bDEBUG) QwWarning<<" BCM hardware sum is same for more than "< GetADC18SaturationLimt()){ - if (bDEBUG) - QwWarning << this->GetElementName()<<" "< &buffer) { + UInt_t mask31x = 0x80000000; // Header bit mask + UInt_t mask3029x = 0x60000000; // Channel number mask + UInt_t mask2625x = 0x06000000; // Divider value mask + UInt_t mask2422x = 0x01c00000; // Data type mask + UInt_t mask21x = 0x00200000; // Data type 0 value sign mask + UInt_t mask200x = 0x001fffff; // Data type 0 value field mask + UInt_t mask2118x = 0x003c0000; // Data types 1-2 sample number mask + UInt_t mask170x = 0x0003ffff; // Data types 1-2 value field mask + UInt_t mask150x = 0x0000ffff; // Data type 4 value field mask + UInt_t localbuf[kWordsPerChannel] = {0}; if (IsNameEmpty()) { // This channel is not used, but is present in the data stream. // Fill in with zero. - localbuf.push_back( 0 ); + localbuf[0] = 0; } else { - localbuf.push_back( ((fValue_Raw << data_shift) & data_mask) ); + localbuf[0] = ((fValue_Raw << 22) & mask2422x); } for (Int_t i = 0; i < kWordsPerChannel; i++) { @@ -364,7 +337,7 @@ void QwADC18_Channel::PrintInfo() const QwMessage<<"fCalibrationFactor= "<PrintValue(); - this->fValue_raw = 0; - this->fValueSum += scale * input->fValueSum; + this->fValue_Raw = 0; + this->fValue += scale * input->fValue; this->fValueM2 = 0.0; this->fNumberOfSamples += input->fNumberOfSamples; this->fSequenceNumber = 0; @@ -1119,7 +1092,6 @@ void QwADC18_Channel::ScaledAdd(Double_t scale, const VQwHardwareChannel *value) #ifdef __USE_DATABASE__ void QwADC18_Channel::AddErrEntriesToList(std::vector &row_list) { - // TString message; // message = Form("%30s",GetElementName().Data()); // message += Form("%9d", fErrorCount_HWSat); @@ -1133,40 +1105,38 @@ void QwADC18_Channel::AddErrEntriesToList(std::vector &row_lis // kErrorFlag_ADC18_Sat =0x1; //ADC18 Saturation Cut. Currently saturation limit is set to +/-8.5V // kErrorFlag_sample =0x2; //If sample size mis-matches with the default value in the map file. - // kErrorFlag_SW_HW =0x4; //If software sum and hardware sum are not equal. // kErrorFlag_Sequence =0x8; //If the ADC sequence number is not incrementing properly // kErrorFlag_SameHW =0x10; //If ADC value keep returning the same value // kErrorFlag_ZeroHW =0x20; //Check to see ADC is returning zero - - + + // kErrorFlag_EventCut_L =0x40; //Flagged if lower limit of the event cut has failed // kErrorFlag_EventCut_U =0x80; //Flagged if upper limit of the event cut has failed // >>>>>> fNumEvtsWithEventCutsRejected - - + // outside QwADC18_Channel // kErrorFlag_BlinderFail = 0x0200;// in Decimal 512 to identify the blinder fail flag // kStabilityCutError = 0x10000000;// in Decimal 2^28 to identify the stability cut failure - + // This is my modified mysql DB, Thursday, December 8 16:40:36 EST 2011, jhlee // Error code must be matched to MySQL DB - // + // // mysql> select * from error_code; // +---------------+------------------------------+ // | error_code_id | quantity | // +---------------+------------------------------+ - // | 1 | kErrorFlag_ADC18_Sat | - // | 2 | kErrorFlag_sample | - // | 3 | kErrorFlag_SW_HW | - // | 4 | kErrorFlag_Sequence | - // | 5 | kErrorFlag_SameHW | - // | 6 | kErrorFlag_ZeroHW | - // | 7 | kErrorFlag_EventCut_Rejected | - // | 8 | kErrorFlag_EventCut_L | - // | 9 | kErrorFlag_EventCut_U | - // | 10 | kErrorFlag_BlinderFail | - // | 11 | kStabilityCutError | + // | 1 | kErrorFlag_ADC18_Sat | + // | 2 | kErrorFlag_sample | + // | 3 | kErrorFlag_SW_HW | + // | 4 | kErrorFlag_Sequence | + // | 5 | kErrorFlag_SameHW | + // | 6 | kErrorFlag_ZeroHW | + // | 7 | kErrorFlag_EventCut_Rejected | + // | 8 | kErrorFlag_EventCut_L | + // | 9 | kErrorFlag_EventCut_U | + // | 10 | kErrorFlag_BlinderFail | + // | 11 | kStabilityCutError | // +---------------+------------------------------+ // 11 rows in set (0.00 sec) From 4cce67a223b3bcd287ff887c15e76700e589d3ea Mon Sep 17 00:00:00 2001 From: Wouter Deconinck Date: Tue, 20 Nov 2018 15:25:27 -0500 Subject: [PATCH 093/137] Reenable number of samples since also in HAPPEX ADC --- Analysis/src/QwADC18_Channel.cc | 110 ++++++++++++++++++++++++++++---- 1 file changed, 96 insertions(+), 14 deletions(-) diff --git a/Analysis/src/QwADC18_Channel.cc b/Analysis/src/QwADC18_Channel.cc index fa60ab358..bbc69e690 100755 --- a/Analysis/src/QwADC18_Channel.cc +++ b/Analysis/src/QwADC18_Channel.cc @@ -14,7 +14,7 @@ const Bool_t QwADC18_Channel::kDEBUG = kFALSE; -const Int_t QwADC18_Channel::kWordsPerChannel = 6; // FIXME +const Int_t QwADC18_Channel::kWordsPerChannel = 1; // FIXME const Int_t QwADC18_Channel::kMaxChannels = 8; // FIXME const Double_t QwADC18_Channel::kTimePerSample = 2.0 * Qw::us; // FIXME @@ -115,8 +115,8 @@ void QwADC18_Channel::InitializeChannel(TString name, TString datatosave) { SetElementName(name); SetDataToSave(datatosave); - SetNumberOfDataWords(6); - SetNumberOfSubElements(5); + SetNumberOfDataWords(1); + SetNumberOfSubElements(1); kFoundPedestal = 0; kFoundGain = 0; @@ -204,7 +204,8 @@ void QwADC18_Channel::ClearEventData() fValue = 0.0; fValueM2 = 0.0; fValueError = 0.0; - + fSequenceNumber = 0; + fNumberOfSamples = 0; fGoodEventCount = 0; fErrorFlag = 0; } @@ -222,13 +223,15 @@ void QwADC18_Channel::RandomizeEventData(int helicity, double time) + drift; fValue = value; - fValue_Raw = Int_t(value / fCalibrationFactor + fPedestal); + fSequenceNumber = 0; + fNumberOfSamples = fNumberOfSamples_map; } void QwADC18_Channel::SmearByResolution(double resolution) { fValue = resolution*GetRandomValue(); fValueM2 = 0.0; + fNumberOfSamples = fNumberOfSamples_map; SetRawEventData(); } @@ -240,11 +243,14 @@ void QwADC18_Channel::SetEventData(Double_t value) { fValue = value; fValue_Raw = (UInt_t)value; + fSequenceNumber = 0; + fNumberOfSamples = fNumberOfSamples_map; } void QwADC18_Channel::SetRawEventData() { - fValue_Raw = Int_t(fValue / fCalibrationFactor + fPedestal); + fNumberOfSamples = fNumberOfSamples_map; + fValue_Raw = Int_t(fValue / fCalibrationFactor + fPedestal) * fNumberOfSamples; }; // FIXME here goes the encoding of raw data into CODA blocks @@ -267,7 +273,23 @@ void QwADC18_Channel::EncodeEventData(std::vector &buffer) // Fill in with zero. localbuf[0] = 0; } else { - localbuf[0] = ((fValue_Raw << 22) & mask2422x); + localbuf[0] |= mask31x & (0 << 31); + localbuf[0] |= mask3029x & (0 << 29); + localbuf[0] |= mask2625x & (0 << 25); + UInt_t exp_dtype = 1; + switch (exp_dtype) { + case 0: + break; + case 1: + case 2: + localbuf[0] |= mask2422x & (2 << 22); + localbuf[0] |= mask170x & fValue_Raw; + break; + case 4: + break; + default: + QwError << "QwADC18_Channel::ProcessEvBuffer: Unknown data type" << QwLog::endl; + } } for (Int_t i = 0; i < kWordsPerChannel; i++) { @@ -296,16 +318,58 @@ Int_t QwADC18_Channel::ProcessEvBuffer(UInt_t* buffer, UInt_t num_words_left, UI words_read = fNumberOfDataWords; } else if (num_words_left >= fNumberOfDataWords) { + // Read raw 32-bit word UInt_t rawd = buffer[0]; // "Actual" values from data word - Int_t act_dtype = (rawd & mask2422x) >> 22; - Int_t act_chan = act_dtype != 4 ? ((rawd & mask3029x) >> 29) : 0; - Int_t act_dvalue = (rawd & mask2625x) >> 25; - Int_t act_snum = act_dtype == 1 || act_dtype == 2 ? - ((rawd & mask2118x) >> 18) : 0; + UInt_t act_dtype = (rawd & mask2422x) >> 22; + UInt_t act_chan = (act_dtype != 4) ? + ((rawd & mask3029x) >> 29) : 0; + UInt_t act_dvalue = (rawd & mask2625x) >> 25; + UInt_t act_snum = (act_dtype == 1 || act_dtype == 2) ? + ((rawd & mask2118x) >> 18) : 0; + + // Header check + if (rawd & mask31x != 0) { + QwError << "QwADC18_Channel::ProcessEvBuffer: Received header word" << QwLog::endl; + return 0; + } + + // Interpret by data type + switch(act_dtype) { + case 0: + static UInt_t prev_dvalue = act_dvalue; + if (act_dvalue != prev_dvalue) { + QwError << "QwADC18_Channel::ProcessEvBuffer: Number of samples changed" << QwLog::endl; + } + fValue_Raw = rawd & mask200x; + if (rawd & mask21x) fValue_Raw = -((~fValue_Raw & 0x1fffffff) + 1); + fNumberOfSamples = (1 << act_dvalue); + break; + case 1: + case 2: + if (act_snum != fNumberOfSamples) { + QwError << "QwADC18_Channel::ProcessEvBuffer: Divider value non-zero" << QwLog::endl; + return 0; + } + if (act_dvalue != 0) { + QwError << "QwADC18_Channel::ProcessEvBuffer: Divider value non-zero" << QwLog::endl; + return 0; + } + fValue_Raw = rawd & mask170x; + break; + case 4: + if (act_dvalue != 0) { + QwError << "QwADC18_Channel::ProcessEvBuffer: Divider value non-zero" << QwLog::endl; + return 0; + } + fValue_Raw = rawd & mask150x; + break; + default: + QwError << "QwADC18_Channel::ProcessEvBuffer: Unknown data type" << QwLog::endl; + return 0; + } - fValue_Raw = act_dvalue; // FIXME ??? fValue = fCalibrationFactor * (Double_t(fValue_Raw) - fPedestal); words_read = fNumberOfDataWords; @@ -319,7 +383,25 @@ Int_t QwADC18_Channel::ProcessEvBuffer(UInt_t* buffer, UInt_t num_words_left, UI void QwADC18_Channel::ProcessEvent() { - // FIXME error checking + if (fNumberOfSamples == 0 && fValue_Raw == 0) { + // There isn't valid data for this channel. Just flag it and move on. + fValue = 0.0; + fValueM2 = 0.0; + fErrorFlag |= kErrorFlag_sample; + } else if (fNumberOfSamples == 0) { + // This is probably a more serious problem. + QwWarning << "QwADC18_Channel::ProcessEvent: Channel " + << GetElementName() + << " has fNumberOfSamples == 0 but has valid data in the value filed." + << "Flag this as an error." + << QwLog::endl; + fValue = 0.0; + fValueM2 = 0.0; + fErrorFlag |= kErrorFlag_sample; + } else { + fValue = fCalibrationFactor * ( (Double_t(fValue_Raw) / fNumberOfSamples) - fPedestal ); + fValueM2 = 0.0; // second moment is zero for single events + } } Double_t QwADC18_Channel::GetAverageVolts() const From 9996691fca402019820f1d709b7f3c03d90136fb Mon Sep 17 00:00:00 2001 From: Wouter Deconinck Date: Sun, 25 Nov 2018 16:05:22 -0500 Subject: [PATCH 094/137] Updated config files for ADC18 testing --- Parity/prminput/adc18.conf | 5 ++++- Parity/prminput/adc18_adc.map | 18 +----------------- Parity/prminput/adc18_detectors.map | 6 +----- Parity/prminput/adc18_pedestal.map | 22 ++++------------------ 4 files changed, 10 insertions(+), 41 deletions(-) diff --git a/Parity/prminput/adc18.conf b/Parity/prminput/adc18.conf index 100e4c77f..b6f56ab16 100755 --- a/Parity/prminput/adc18.conf +++ b/Parity/prminput/adc18.conf @@ -2,7 +2,7 @@ # Configuration file for the HAPPEX ADC18 tests. # -detectors = mock_detectors.map +detectors = adc18_detectors.map rootfile-stem = adc18_ codafile-stem = adc18_ @@ -28,3 +28,6 @@ loglevel-file = 0 #loglevel-screen = 0 print-function = no print-signature = no + +[MollerMainDetector] +normalize = no diff --git a/Parity/prminput/adc18_adc.map b/Parity/prminput/adc18_adc.map index 63de812e8..b4d1be098 100755 --- a/Parity/prminput/adc18_adc.map +++ b/Parity/prminput/adc18_adc.map @@ -1,25 +1,9 @@ -ROC=6 -Bank=0x6110 -sample_size=16680 - -! module.type, module.num, module.chan, det.type, det.name -VQWK, 0, 0, IntegrationPMT, VQWK0 -VQWK, 0, 1, IntegrationPMT, VQWK1 -VQWK, 0, 2, IntegrationPMT, VQWK2 -VQWK, 0, 3, IntegrationPMT, VQWK3 -VQWK, 0, 4, IntegrationPMT, VQWK4 -VQWK, 0, 5, IntegrationPMT, VQWK5 -VQWK, 0, 6, IntegrationPMT, VQWK6 -VQWK, 0, 7, IntegrationPMT, VQWK7 +ROC=23 ! module.type, module.num, module.chan, det.type, det.name ADC18, 0, 0, IntegrationPMT, ADC0 ADC18, 0, 1, IntegrationPMT, ADC1 ADC18, 0, 2, IntegrationPMT, ADC2 ADC18, 0, 3, IntegrationPMT, ADC3 -ADC18, 0, 4, IntegrationPMT, ADC4 -ADC18, 0, 5, IntegrationPMT, ADC5 -ADC18, 0, 6, IntegrationPMT, ADC6 -ADC18, 0, 7, IntegrationPMT, ADC7 !END diff --git a/Parity/prminput/adc18_detectors.map b/Parity/prminput/adc18_detectors.map index a1dc59c7d..efe8223a6 100755 --- a/Parity/prminput/adc18_detectors.map +++ b/Parity/prminput/adc18_detectors.map @@ -1,8 +1,4 @@ -[QwHelicity] - name = Helicity Info - map = adc18_qweak_helicity.map - -[MainDetector] +[MollerMainDetector] name = Main Detector map = adc18_adc.map param = adc18_pedestal.map diff --git a/Parity/prminput/adc18_pedestal.map b/Parity/prminput/adc18_pedestal.map index e1480bca1..da79c4dbc 100755 --- a/Parity/prminput/adc18_pedestal.map +++ b/Parity/prminput/adc18_pedestal.map @@ -1,18 +1,4 @@ -! Name Offset Gain NormRate(Hz/uA) VoltPerHz Asym C_x C_y C_xp C_yp C_e -VQWK0 0.000000 1.000000 55000000 1.09E-09 0.000001 0.974928 -0.222521 9749.279122 -2225.431860 1000.000000 -VQWK1 0.000000 1.000000 55000000 1.09E-09 0.000001 1.000000 0.000000 10000.000000 0.000000 1000.000000 -VQWK2 0.000000 1.000000 55000000 1.09E-09 0.000001 0.974928 0.222521 9749.279122 2225.431860 1000.000000 -VQWK3 0.000000 1.000000 55000000 1.09E-09 0.000001 0.900969 0.433884 9009.688679 4339.271275 1000.000000 -VQWK4 0.000000 1.000000 55000000 1.09E-09 0.000001 0.974928 -0.222521 9750.254050 -2225.654381 1000.000000 -VQWK5 0.000000 1.000000 55000000 1.09E-09 0.000001 1.000000 0.000000 10001.000000 0.000000 1000.000000 -VQWK6 0.000000 1.000000 55000000 1.09E-09 0.000001 0.974928 0.222521 9750.254050 2225.654381 1000.000000 -VQWK7 0.000000 1.000000 55000000 1.09E-09 0.000001 0.900969 0.433884 9010.589648 4339.705159 1000.000000 -! -ADC0 0.000000 1.000000 55000000 1.09E-09 0.000001 0.974928 -0.222521 9749.279122 -2225.431860 1000.000000 -ADC1 0.000000 1.000000 55000000 1.09E-09 0.000001 1.000000 0.000000 10000.000000 0.000000 1000.000000 -ADC2 0.000000 1.000000 55000000 1.09E-09 0.000001 0.974928 0.222521 9749.279122 2225.431860 1000.000000 -ADC3 0.000000 1.000000 55000000 1.09E-09 0.000001 0.900969 0.433884 9009.688679 4339.271275 1000.000000 -ADC4 0.000000 1.000000 55000000 1.09E-09 0.000001 0.974928 -0.222521 9750.254050 -2225.654381 1000.000000 -ADC5 0.000000 1.000000 55000000 1.09E-09 0.000001 1.000000 0.000000 10001.000000 0.000000 1000.000000 -ADC6 0.000000 1.000000 55000000 1.09E-09 0.000001 0.974928 0.222521 9750.254050 2225.654381 1000.000000 -ADC7 0.000000 1.000000 55000000 1.09E-09 0.000001 0.900969 0.433884 9010.589648 4339.705159 1000.000000 +ADC0 0.000000 1.000000 +ADC1 0.000000 1.000000 +ADC2 0.000000 1.000000 +ADC3 0.000000 1.000000 From fbb534277fd483f60b360f9c577db96c8a3636c4 Mon Sep 17 00:00:00 2001 From: Wouter Deconinck Date: Sun, 25 Nov 2018 16:05:44 -0500 Subject: [PATCH 095/137] No helicity in ADC18 testing --- Parity/prminput/adc18_helicity.map | 18 ------------------ 1 file changed, 18 deletions(-) delete mode 100755 Parity/prminput/adc18_helicity.map diff --git a/Parity/prminput/adc18_helicity.map b/Parity/prminput/adc18_helicity.map deleted file mode 100755 index c8c05648c..000000000 --- a/Parity/prminput/adc18_helicity.map +++ /dev/null @@ -1,18 +0,0 @@ -HelicityDecodingMode=InputRegisterMode -PatternPhase=4 -RandSeedBits=30 - -ROC=31 -Bank=0x3103 - -! module.type, module.num chan.num, det.type, det.name -! -WORD, 0, 0, helicitydata, input_register -WORD, 0, 0, helicitydata, output_register -WORD, 0, 0, helicitydata, MPS_counter -WORD, 0, 0, helicitydata, PAT_counter -WORD, 0, 0, helicitydata, PAT_phase -WORD, 0, 0, helicitydata, cleandata -WORD, 0, 0, helicitydata, scandata1 -WORD, 0, 0, helicitydata, scandata2 -!END From 398198df46a0102f1262e0f76710e6cc9b021bc8 Mon Sep 17 00:00:00 2001 From: Wouter Deconinck Date: Thu, 17 Jan 2019 15:36:19 -0500 Subject: [PATCH 096/137] Changes to test map since ADC18 will be used for BCM channels first --- Parity/prminput/adc18_adc.map | 8 ++++---- Parity/prminput/adc18_detectors.map | 5 ++--- 2 files changed, 6 insertions(+), 7 deletions(-) diff --git a/Parity/prminput/adc18_adc.map b/Parity/prminput/adc18_adc.map index b4d1be098..2f792bba7 100755 --- a/Parity/prminput/adc18_adc.map +++ b/Parity/prminput/adc18_adc.map @@ -1,9 +1,9 @@ ROC=23 ! module.type, module.num, module.chan, det.type, det.name -ADC18, 0, 0, IntegrationPMT, ADC0 -ADC18, 0, 1, IntegrationPMT, ADC1 -ADC18, 0, 2, IntegrationPMT, ADC2 -ADC18, 0, 3, IntegrationPMT, ADC3 +ADC18, 0, 0, bcm, ADC0 +ADC18, 0, 1, bcm, ADC1 +ADC18, 0, 2, bcm, ADC2 +ADC18, 0, 3, bcm, ADC3 !END diff --git a/Parity/prminput/adc18_detectors.map b/Parity/prminput/adc18_detectors.map index efe8223a6..844cfad2a 100755 --- a/Parity/prminput/adc18_detectors.map +++ b/Parity/prminput/adc18_detectors.map @@ -1,5 +1,4 @@ -[MollerMainDetector] - name = Main Detector +[QwBeamLine] + name = Beamline map = adc18_adc.map param = adc18_pedestal.map - From 5f0f85ccf111049e30deb59f74b0296285ecc1fb Mon Sep 17 00:00:00 2001 From: Wouter Deconinck Date: Thu, 17 Jan 2019 15:39:07 -0500 Subject: [PATCH 097/137] Initial VQwBCM support for ADC18 --- Parity/src/VQwBCM.cc | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/Parity/src/VQwBCM.cc b/Parity/src/VQwBCM.cc index 34079bcf9..8f14137ae 100755 --- a/Parity/src/VQwBCM.cc +++ b/Parity/src/VQwBCM.cc @@ -20,6 +20,7 @@ // Qweak types that we want to use in this template #include "QwVQWK_Channel.h" +#include "QwADC18_Channel.h" #include "QwScaler_Channel.h" @@ -36,6 +37,8 @@ VQwBCM* VQwBCM::Create(TString subsystemname, TString name, TString type, TStrin // simple), just list out the types of BCM's supported by this code!!! if( type == "VQWK") { return new QwBCM(subsystemname,name,type); + } else if ( type == "ADC18" ) { + return new QwBCM(subsystemname,name,type,clock); } else if ( type == "SIS3801" ) { return new QwBCM(subsystemname,name,type,clock); } else if ( type == "SCALER" || type == "SIS3801D24" ) { @@ -56,6 +59,8 @@ VQwBCM* VQwBCM::Create(const VQwBCM& source) // simple), just list out the types of BCM's supported by this code!!! if( type == "VQWK") { return new QwBCM(dynamic_cast&>(source)); + } else if ( type == "ADC18" ) { + return new QwBCM(dynamic_cast&>(source)); } else if ( type == "SIS3801" ) { return new QwBCM(dynamic_cast&>(source)); } else if ( type == "SCALER" || type == "SIS3801D24" ) { @@ -79,7 +84,9 @@ VQwBCM* VQwBCM::CreateCombo(TString subsystemname, TString name, TString type) // simple), just list out the types of BCM's supported by this code!!! if( type == "VQWK") { return new QwCombinedBCM(subsystemname,name,type); - } else if ( type == "SIS3801" ) { // Default SCALER channel + } else if ( type == "ADC18" ) { + return new QwCombinedBCM(subsystemname,name,type); + } else if ( type == "SIS3801" ) { return new QwCombinedBCM(subsystemname,name,type); } else if ( type == "SCALER" || type == "SIS3801D24" ) { return new QwCombinedBCM(subsystemname,name,type); @@ -99,7 +106,9 @@ VQwBCM* VQwBCM::CreateCombo(const VQwBCM& source) // simple), just list out the types of BCM's supported by this code!!! if( type == "VQWK") { return new QwCombinedBCM(dynamic_cast&>(source)); - } else if ( type == "SIS3801" ) { // Default SCALER channel + } else if ( type == "ADC18" ) { + return new QwCombinedBCM(dynamic_cast&>(source)); + } else if ( type == "SIS3801" ) { return new QwCombinedBCM(dynamic_cast&>(source)); } else if ( type == "SCALER" || type == "SIS3801D24" ) { return new QwCombinedBCM(dynamic_cast&>(source)); From 3090f407d77f3b8003eae297928bcc342fe3e779 Mon Sep 17 00:00:00 2001 From: Wouter Deconinck Date: Thu, 17 Jan 2019 19:11:03 -0500 Subject: [PATCH 098/137] Create QwBCM template instantiations --- Parity/src/QwBCM.cc | 8 +++++--- Parity/src/QwCombinedBCM.cc | 8 +++++--- 2 files changed, 10 insertions(+), 6 deletions(-) diff --git a/Parity/src/QwBCM.cc b/Parity/src/QwBCM.cc index da64c0c78..09b513bed 100755 --- a/Parity/src/QwBCM.cc +++ b/Parity/src/QwBCM.cc @@ -17,6 +17,7 @@ // Qweak types that we want to use in this template #include "QwVQWK_Channel.h" +#include "QwADC18_Channel.h" #include "QwScaler_Channel.h" /********************************************************/ @@ -563,6 +564,7 @@ Double_t QwBCM::GetValueWidth() return fBeamCurrent.GetValueWidth(); } -template class QwBCM; -template class QwBCM; -template class QwBCM; +template class QwBCM; +template class QwBCM; +template class QwBCM; +template class QwBCM; diff --git a/Parity/src/QwCombinedBCM.cc b/Parity/src/QwCombinedBCM.cc index 90dccadd2..93bc1a5ad 100755 --- a/Parity/src/QwCombinedBCM.cc +++ b/Parity/src/QwCombinedBCM.cc @@ -17,6 +17,7 @@ // Qweak types that we want to use in this template #include "QwVQWK_Channel.h" +#include "QwADC18_Channel.h" #include "QwScaler_Channel.h" @@ -427,6 +428,7 @@ void QwCombinedBCM::FillTreeVector(std::vector &values) const */ /********************************************************/ -template class QwCombinedBCM; -template class QwCombinedBCM; -template class QwCombinedBCM; +template class QwCombinedBCM; +template class QwCombinedBCM; +template class QwCombinedBCM; +template class QwCombinedBCM; From f1cdc624e6011b9a887cfacc4529ed45a242f5c8 Mon Sep 17 00:00:00 2001 From: Wouter Deconinck Date: Mon, 28 Jan 2019 14:37:50 -0500 Subject: [PATCH 099/137] Avoid some compiler warnings due to size_t and signed ints --- Parity/src/LRBCorrector.cc | 6 +++--- Parity/src/QwCorrelator.cc | 8 ++++---- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/Parity/src/LRBCorrector.cc b/Parity/src/LRBCorrector.cc index fb4779af9..cd554e726 100644 --- a/Parity/src/LRBCorrector.cc +++ b/Parity/src/LRBCorrector.cc @@ -115,7 +115,7 @@ Int_t LRBCorrector::LoadChannelMap(const std::string& mapfile) { // Loop over # of dep variables // Push-back the sensitiivity, IV type and IVnames into their respective vectors for each DV - for (size_t i = 0; i < dvnames->GetXaxis()->GetNbins(); ++i){ + for (Int_t i = 0; i < dvnames->GetXaxis()->GetNbins(); ++i){ type_name_dv = ParseRegressionVariable(dvnames->GetXaxis()->GetBinLabel(i+1)); fDependentType.push_back(type_name_dv.first); fDependentName.push_back(type_name_dv.second); @@ -123,11 +123,11 @@ Int_t LRBCorrector::LoadChannelMap(const std::string& mapfile) { fSensitivity.resize(fDependentType.size()); - for (size_t i = 0; i < ivnames->GetXaxis()->GetNbins(); ++i) { + for (Int_t i = 0; i < ivnames->GetXaxis()->GetNbins(); ++i) { type_name_iv = ParseRegressionVariable(ivnames->GetXaxis()->GetBinLabel(i+1)); fIndependentType.push_back(type_name_iv.first); fIndependentName.push_back(type_name_iv.second); - for (size_t j = 0; j < dvnames->GetXaxis()->GetNbins(); ++j) { + for (Int_t j = 0; j < dvnames->GetXaxis()->GetNbins(); ++j) { fSensitivity[j].push_back(-1.0*(*alphasM)(i,j)); } } diff --git a/Parity/src/QwCorrelator.cc b/Parity/src/QwCorrelator.cc index c1a13c3a7..9014fac78 100644 --- a/Parity/src/QwCorrelator.cc +++ b/Parity/src/QwCorrelator.cc @@ -49,10 +49,10 @@ QwCorrelator::QwCorrelator(QwOptions &options, QwHelicityPattern& helicitypatter vector fIndependentName_t; vector fDependentName_t; - for (int i = 0; i < fIndependentName.size(); ++i) { + for (size_t i = 0; i < fIndependentName.size(); ++i) { fIndependentName_t.push_back(TString(fIndependentName.at(i))); } - for (int i = 0; i < fDependentName.size(); ++i) { + for (size_t i = 0; i < fDependentName.size(); ++i) { fDependentName_t.push_back(TString(fDependentName.at(i))); } @@ -75,12 +75,12 @@ void QwCorrelator::FillCorrelator() { UInt_t error; - for (Int_t i = 0; i < fDependentVar.size(); ++i) { + for (size_t i = 0; i < fDependentVar.size(); ++i) { error |= fDependentVar.at(i)->GetErrorCode(); fDependentValues.at(i) = (fDependentVar[i]->GetValue()); //QwMessage << "Loading DV " << fDependentVar.at(i) << " into fDependentValues." << QwLog::endl; } - for (Int_t i = 0; i < fIndependentVar.size(); ++i) { + for (size_t i = 0; i < fIndependentVar.size(); ++i) { error |= fIndependentVar.at(i)->GetErrorCode(); fIndependentValues.at(i) = (fIndependentVar[i]->GetValue()); //QwMessage << "Loading IV " << fIndependentVar.at(i) << " into fIndependentValues." << QwLog::endl; From b5bbeee8800f3e72688becd6081dba7764d37e86 Mon Sep 17 00:00:00 2001 From: Wouter Deconinck Date: Mon, 28 Jan 2019 14:46:23 -0500 Subject: [PATCH 100/137] Do not store hex-encoded string but use C++11 multiline string literal Defined as const char* const to ensure local scoping per C++11 3.5/3. --- Analysis/src/QwOptions.cc | 2 +- Analysis/src/QwRunCondition.cc | 10 ++-------- bin/pullgitinfo.py | 25 +++---------------------- 3 files changed, 6 insertions(+), 31 deletions(-) diff --git a/Analysis/src/QwOptions.cc b/Analysis/src/QwOptions.cc index 26efb6cd0..52748064f 100755 --- a/Analysis/src/QwOptions.cc +++ b/Analysis/src/QwOptions.cc @@ -319,7 +319,7 @@ void QwOptions::Version() #endif QwMessage << "\n Qweak Analysis Framework : " << fArgv[0] << QwLog::endl; - QwMessage << " * GIT info: " << gGitInfoStr << QwLog::endl; + QwMessage << " * GIT info: " << gGitInfo << QwLog::endl; // QwMessage << " * Revision: " << QWANA_SVN_REVISION << QwLog::endl; // QwMessage << " * URL: " << QWANA_SVN_URL << QwLog::endl; // QwMessage << " * Last Changed Rev: " << QWANA_SVN_LASTCHANGEDREVISION << QwLog::endl; diff --git a/Analysis/src/QwRunCondition.cc b/Analysis/src/QwRunCondition.cc index c302627fd..19a4633cd 100755 --- a/Analysis/src/QwRunCondition.cc +++ b/Analysis/src/QwRunCondition.cc @@ -41,7 +41,7 @@ QwRunCondition::SetArgs(Int_t argc, Char_t* argv[]) #if ROOT_VERSION_CODE < ROOT_VERSION(6,0,0) root_version += ", SVN : "; root_version += gROOT->GetSvnRevision(); - root_version += " "; + root_version += " "; root_version += gROOT->GetSvnBranch(); #else // ROOT_VERSION_CODE >= ROOT_VERSION(6,0,0) root_version += ", GIT : "; @@ -69,11 +69,6 @@ QwRunCondition::SetArgs(Int_t argc, Char_t* argv[]) TTimeStamp time_stamp; TString current_time = time_stamp.AsString("l"); // local time - // source code information ~ git - char gitInfo[__GITMAXINFO_SIZE]; - gitInfo[0]='\0'; - strcpy(gitInfo,gGitInfoStr); - // get current ROC flags TString roc_flags; // if one of the cdaq cluster AND the user must be a "cdaq", @@ -83,7 +78,6 @@ QwRunCondition::SetArgs(Int_t argc, Char_t* argv[]) else { roc_flags = "Invalid, because the system is not cdaqlx and the user is not cdaq."; } - // insert some comments at the beginning of strings... root_version.Insert (0, "ROOT Version : "); @@ -104,7 +98,7 @@ QwRunCondition::SetArgs(Int_t argc, Char_t* argv[]) this -> Add(user_name); this -> Add(argv_list); this -> Add(current_time); - this -> Add(gitInfo); + this -> Add(gGitInfo); this -> Add(roc_flags); return; diff --git a/bin/pullgitinfo.py b/bin/pullgitinfo.py index 98be7a4a0..400a4c85c 100755 --- a/bin/pullgitinfo.py +++ b/bin/pullgitinfo.py @@ -10,7 +10,6 @@ f = os.popen("git remote -v && git log -n 1 && git status -bs && echo \" ROOT version\" `root-config --version` && echo \" `cmake --version`\" && echo \"\nGenerated at `date`\"") boringstring = ""; -fullstring = ""; if( f != 0): for line in f: @@ -18,37 +17,19 @@ else: boringstring = "git information unavailable" -maxlen = 2048 - boringstring += "Source dir " + os.getcwd() boringstring += "\nBuild dir " + presentcwd + "\n" -if len(boringstring) > maxlen: - print "WARNING: Truncating info from git"; - boringstring = boringstring[0:maxlen-1] - -for x in boringstring: - fullstring += '\\x'+x.encode('hex') - - - - newheadertext = """#ifndef __GITINFO_HH #define __GITINFO_HH /* Generated automatically by cmake process - Encoding: -------------------------------------------------------------- -""" + boringstring + """ -------------------------------------------------------------- */ -#define __GITMAXINFO_SIZE 2048 - -#define gGitInfoStr \"""" + fullstring + '\"' \ -+ \ -""" +const char* const gGitInfo = R\"gitinfo( +""" + boringstring + """ +)gitinfo\"; #endif//__GITINFO_HH """ From e0d50f418bb24dc222758a5b0f068832fac2c1df Mon Sep 17 00:00:00 2001 From: Wouter Deconinck Date: Mon, 28 Jan 2019 17:26:41 -0500 Subject: [PATCH 101/137] Change to git info processing [WIP] - gGitInfo is now provided by a .cc file and defined as external in the two source files that use it (no more compile time dependency) - gitinfo.cc is created from gitinfo.cc.in by the CMakeGitInfo module. - The CMakeGitInfo modules checks whether the git state has changed before it creates gitinfo.cc again. --- Analysis/src/QwOptions.cc | 5 +- Analysis/src/QwRunCondition.cc | 4 +- CMakeLists.txt | 37 ++--- bin/pullgitinfo.py | 48 ------ cmake/modules/CMakeGitInfo.cmake | 254 +++++++++++++++++++++++++++++++ cmake/templates/gitinfo.cc.in | 15 ++ 6 files changed, 288 insertions(+), 75 deletions(-) delete mode 100755 bin/pullgitinfo.py create mode 100644 cmake/modules/CMakeGitInfo.cmake create mode 100644 cmake/templates/gitinfo.cc.in diff --git a/Analysis/src/QwOptions.cc b/Analysis/src/QwOptions.cc index 52748064f..6729cb6aa 100755 --- a/Analysis/src/QwOptions.cc +++ b/Analysis/src/QwOptions.cc @@ -14,7 +14,6 @@ # endif #endif - #include "QwOptions.h" // System headers @@ -28,7 +27,6 @@ QwOptions gQwOptions; // Qweak headers #include "QwLog.h" #include "QwParameterFile.h" -#include "gitinfo.hh" // Qweak objects with default options #include "QwSubsystemArray.h" @@ -40,6 +38,9 @@ QwOptions gQwOptions; #include "QwRootFile.h" #include "QwHistogramHelper.h" +// External objects +extern const char* const gGitInfo; + // Initialize the static command line arguments to zero int QwOptions::fArgc = 0; char** QwOptions::fArgv = 0; diff --git a/Analysis/src/QwRunCondition.cc b/Analysis/src/QwRunCondition.cc index 19a4633cd..75862e95c 100755 --- a/Analysis/src/QwRunCondition.cc +++ b/Analysis/src/QwRunCondition.cc @@ -6,7 +6,9 @@ */ #include "QwRunCondition.h" -#include "gitinfo.hh" + +// External objects +extern const char* const gGitInfo; const Int_t QwRunCondition::fCharLength = 127; diff --git a/CMakeLists.txt b/CMakeLists.txt index 3ac118075..d92c5b3c0 100755 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -40,20 +40,20 @@ endif() # Sources and headers # file(GLOB my_project_sources - Analysis/src/*.cc - Parity/src/*.cc - ) + Analysis/src/*.cc + Parity/src/*.cc + ) list(REMOVE_ITEM my_project_sources ${PROJECT_SOURCE_DIR}/Analysis/src/QwF1TDContainer.cc ${PROJECT_SOURCE_DIR}/Analysis/src/QwSIS3320_Samples.cc ) file(GLOB my_project_headers - Analysis/include/*.h - Parity/include/*.h - ) + Analysis/include/*.h + Parity/include/*.h + ) list(REMOVE_ITEM my_project_headers - ${PROJECT_SOURCE_DIR}/Analysis/include/QwF1TDContainer.h + ${PROJECT_SOURCE_DIR}/Analysis/include/QwF1TDContainer.h ${PROJECT_SOURCE_DIR}/Analysis/include/QwSIS3320_Samples.h ) @@ -90,22 +90,12 @@ config_add_dependency(ROOT ${minimum_root_version}) #---------------------------------------------------------------------------- -# gitinfo.hh +# gitinfo.cc # -add_custom_command( - OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/include/gitinfo.hh.does_not_exist - COMMAND ${CMAKE_CURRENT_SOURCE_DIR}/bin/pullgitinfo.py ${CMAKE_CURRENT_SOURCE_DIR} - COMMENT "Getting Git information" - ) -add_custom_command( - OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/include/gitinfo.hh - COMMAND echo -n - DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/include/gitinfo.hh.does_not_exist - ) -set_property( - SOURCE Analysis/src/QwOptions.cc Analysis/src/QwRunCondition.cc - APPEND PROPERTY OBJECT_DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/include/gitinfo.hh - ) +set(PRE_CONFIGURE_FILE ${PROJECT_SOURCE_DIR}/cmake/templates/gitinfo.cc.in) +set(POST_CONFIGURE_FILE ${CMAKE_CURRENT_BINARY_DIR}/gitinfo.cc) +include(CMakeGitInfo) +set(my_project_sources ${my_project_sources} ${POST_CONFIGURE_FILE}) #---------------------------------------------------------------------------- @@ -157,8 +147,7 @@ endforeach() #---------------------------------------------------------------------------- # main library # -add_library(${PROJECT_NAME} SHARED ${my_project_sources} ${my_project_headers} - ${CMAKE_CURRENT_BINARY_DIR}/include/gitinfo.hh) +add_library(${PROJECT_NAME} SHARED ${my_project_sources} ${my_project_headers}) target_include_directories(${PROJECT_NAME} PUBLIC diff --git a/bin/pullgitinfo.py b/bin/pullgitinfo.py deleted file mode 100755 index 400a4c85c..000000000 --- a/bin/pullgitinfo.py +++ /dev/null @@ -1,48 +0,0 @@ -#!/usr/bin/python - -import os -import sys - -presentcwd = os.getcwd() -os.chdir(sys.argv[1]) - - -f = os.popen("git remote -v && git log -n 1 && git status -bs && echo \" ROOT version\" `root-config --version` && echo \" `cmake --version`\" && echo \"\nGenerated at `date`\"") - -boringstring = ""; - -if( f != 0): - for line in f: - boringstring += line -else: - boringstring = "git information unavailable" - -boringstring += "Source dir " + os.getcwd() -boringstring += "\nBuild dir " + presentcwd + "\n" - -newheadertext = """#ifndef __GITINFO_HH -#define __GITINFO_HH - -/* - Generated automatically by cmake process -*/ - -const char* const gGitInfo = R\"gitinfo( -""" + boringstring + """ -)gitinfo\"; - -#endif//__GITINFO_HH -""" - - -os.chdir(presentcwd) - -outdir = "include/" -if not os.path.exists(outdir): - os.makedirs(outdir) - -newheader = open( outdir + "/gitinfo.hh", "w") -newheader.write(newheadertext) -newheader.close() - -print "Repository information\n", boringstring diff --git a/cmake/modules/CMakeGitInfo.cmake b/cmake/modules/CMakeGitInfo.cmake new file mode 100644 index 000000000..a09e01fc2 --- /dev/null +++ b/cmake/modules/CMakeGitInfo.cmake @@ -0,0 +1,254 @@ +# Source: https://github.com/andrew-hardin/cmake-git-version-tracking +# Original license: MIT License +# Current license: MIT License +# +# This file defines the functions and targets needed to monitor +# the state of a git repo. If the state changes (e.g. a commit is made), +# then a file gets reconfigured. +# +# The behavior of this script can be modified by defining any of these variables: +# +# PRE_CONFIGURE_FILE (REQUIRED) +# -- The path to the file that'll be configured. +# +# POST_CONFIGURE_FILE (REQUIRED) +# -- The path to the configured PRE_CONFIGURE_FILE. +# +# GIT_STATE_FILE (OPTIONAL) +# -- The path to the file used to store the previous build's git state. +# Defaults to the current binary directory. +# +# GIT_WORKING_DIR (OPTIONAL) +# -- The directory from which git commands will be run. +# Defaults to the directory with the top level CMakeLists.txt. +# +# GIT_EXECUTABLE (OPTIONAL) +# -- The path to the git executable. It'll automatically be set if the +# user doesn't supply a path. +# +# Script design: +# - This script was designed similar to a Python application +# with a Main() function. I wanted to keep it compact to +# simplify "copy + paste" usage. +# +# - This script is made to operate in two CMake contexts: +# 1. Configure time context (when build files are created). +# 2. Build time context (called via CMake -P) +# If you see something odd (e.g. the NOT DEFINED clauses), +# consider that it can run in one of two contexts. + +# Short hand for converting paths to absolute. +macro(PATH_TO_ABSOLUTE var_name) + get_filename_component(${var_name} "${${var_name}}" ABSOLUTE) +endmacro() + +# Check that a required variable is set. +macro(CHECK_REQUIRED_VARIABLE var_name) + if(NOT DEFINED ${var_name}) + message(FATAL_ERROR "The \"${var_name}\" variable must be defined.") + endif() + PATH_TO_ABSOLUTE(${var_name}) +endmacro() + +# Check that an optional variable is set, or, set it to a default value. +macro(CHECK_OPTIONAL_VARIABLE var_name default_value) + if(NOT DEFINED ${var_name}) + set(${var_name} ${default_value}) + endif() + PATH_TO_ABSOLUTE(${var_name}) +endmacro() + +CHECK_REQUIRED_VARIABLE(PRE_CONFIGURE_FILE) +CHECK_REQUIRED_VARIABLE(POST_CONFIGURE_FILE) +CHECK_OPTIONAL_VARIABLE(GIT_STATE_FILE "${CMAKE_BINARY_DIR}/git-state") +CHECK_OPTIONAL_VARIABLE(GIT_WORKING_DIR "${CMAKE_SOURCE_DIR}") + +# Check the optional git variable. +# If it's not set, we'll try to find it using the CMake packaging system. +if(NOT DEFINED GIT_EXECUTABLE) + find_package(Git QUIET REQUIRED) +endif() +CHECK_REQUIRED_VARIABLE(GIT_EXECUTABLE) + + + +# Function: GitStateChangedAction +# Description: this function is executed when the state of the git +# repo changes (e.g. a commit is made). +function(GitStateChangedAction _state_as_list) + # Set variables by index, then configure the file w/ these variables defined. + LIST(GET _state_as_list 0 GIT_RETRIEVED_STATE) + LIST(GET _state_as_list 1 GIT_HEAD_SHA1) + LIST(GET _state_as_list 2 GIT_IS_DIRTY) + LIST(GET _state_as_list 3 GIT_STATUS) + LIST(GET _state_as_list 4 GIT_LOG) + LIST(GET _state_as_list 5 GEANT_VERSION) + LIST(GET _state_as_list 6 ROOT_VERSION) + string(TIMESTAMP DATE) + configure_file("${PRE_CONFIGURE_FILE}" "${POST_CONFIGURE_FILE}" @ONLY) +endfunction() + + + +# Function: GetGitState +# Description: gets the current state of the git repo. +# Args: +# _working_dir (in) string; the directory from which git commands will be executed. +# _state (out) list; a collection of variables representing the state of the +# repository (e.g. commit SHA). +function(GetGitState _working_dir _state) + + # Get the hash for HEAD. + set(_success "true") + execute_process(COMMAND + "${GIT_EXECUTABLE}" rev-parse --verify HEAD + WORKING_DIRECTORY "${_working_dir}" + RESULT_VARIABLE res + OUTPUT_VARIABLE _hashvar + ERROR_QUIET + OUTPUT_STRIP_TRAILING_WHITESPACE) + if(NOT res EQUAL 0) + set(_success "false") + set(_hashvar "GIT-NOTFOUND") + endif() + + # Get whether or not the working tree is dirty. + execute_process(COMMAND + "${GIT_EXECUTABLE}" status --branch --short --porcelain + WORKING_DIRECTORY "${_working_dir}" + RESULT_VARIABLE res + OUTPUT_VARIABLE _git_status + ERROR_QUIET + OUTPUT_STRIP_TRAILING_WHITESPACE) + if(NOT res EQUAL 0) + set(_success "false") + set(_dirty "false") + else() + if(NOT "${_git_status}" STREQUAL "") + set(_dirty "true") + else() + set(_dirty "false") + endif() + endif() + + # Get last commit log message + execute_process(COMMAND + "${GIT_EXECUTABLE}" --no-pager log -n 1 + WORKING_DIRECTORY "${_working_dir}" + RESULT_VARIABLE res + OUTPUT_VARIABLE _git_log + ERROR_QUIET + OUTPUT_STRIP_TRAILING_WHITESPACE) + if(NOT res EQUAL 0) + set(_success "false") + set(_git_log "GIT-NOTFOUND") + endif() + + # Get geant4 version string + execute_process(COMMAND + geant4-config --version + WORKING_DIRECTORY "${_working_dir}" + RESULT_VARIABLE res + OUTPUT_VARIABLE _geant_version + ERROR_QUIET + OUTPUT_STRIP_TRAILING_WHITESPACE) + if(NOT res EQUAL 0) + set(_success "false") + set(_geant_version "GEANT-CONFIG-NOTFOUND") + endif() + + # Get ROOT version string + execute_process(COMMAND + root-config --version + WORKING_DIRECTORY "${_working_dir}" + RESULT_VARIABLE res + OUTPUT_VARIABLE _root_version + ERROR_QUIET + OUTPUT_STRIP_TRAILING_WHITESPACE) + if(NOT res EQUAL 0) + set(_success "false") + set(_root_version "ROOT-CONFIG-NOTFOUND") + endif() + + # Return a list of our variables to the parent scope. + set(${_state} ${_success} ${_hashvar} ${_dirty} ${_git_status} ${_git_log} ${_geant_version} ${_root_version} PARENT_SCOPE) +endfunction() + + + +# Function: CheckGit +# Description: check if the git repo has changed. If so, update the state file. +# Args: +# _working_dir (in) string; the directory from which git commands will be ran. +# _state_changed (out) bool; whether or no the state of the repo has changed. +# _state (out) list; the repository state as a list (e.g. commit SHA). +function(CheckGit _working_dir _state_changed _state) + + # Get the current state of the repo. + GetGitState("${_working_dir}" state) + + # Set the output _state variable. + # (Passing by reference in CMake is awkward...) + set(${_state} ${state} PARENT_SCOPE) + + # Check if the state has changed compared to the backup on disk. + if(EXISTS "${GIT_STATE_FILE}") + file(READ "${GIT_STATE_FILE}" OLD_HEAD_CONTENTS) + if(OLD_HEAD_CONTENTS STREQUAL "${state}") + # State didn't change. + set(${_state_changed} "false" PARENT_SCOPE) + return() + endif() + endif() + + # The state has changed. + # We need to update the state file on disk. + # Future builds will compare their state to this file. + file(WRITE "${GIT_STATE_FILE}" "${state}") + set(${_state_changed} "true" PARENT_SCOPE) +endfunction() + + + +# Function: SetupGitMonitoring +# Description: this function sets up custom commands that make the build system +# check the state of git before every build. If the state has +# changed, then a file is configured. +function(SetupGitMonitoring) + add_custom_target(check_git_repository + ALL + DEPENDS ${PRE_CONFIGURE_FILE} + BYPRODUCTS ${POST_CONFIGURE_FILE} + COMMENT "Checking the git repository for changes..." + COMMAND + ${CMAKE_COMMAND} + -D_BUILD_TIME_CHECK_GIT=TRUE + -DGIT_WORKING_DIR=${GIT_WORKING_DIR} + -DGIT_EXECUTABLE=${GIT_EXECUTABLE} + -DGIT_STATE_FILE=${GIT_STATE_FILE} + -DPRE_CONFIGURE_FILE=${PRE_CONFIGURE_FILE} + -DPOST_CONFIGURE_FILE=${POST_CONFIGURE_FILE} + -P "${CMAKE_CURRENT_LIST_FILE}") +endfunction() + + + +# Function: Main +# Description: primary entry-point to the script. Functions are selected based +# on whether it's configure or build time. +function(Main) + if(_BUILD_TIME_CHECK_GIT) + # Check if the repo has changed. + # If so, run the change action. + CheckGit("${GIT_WORKING_DIR}" did_change state) + if(did_change) + GitStateChangedAction("${state}") + endif() + else() + # Executes at configure time. + SetupGitMonitoring() + endif() +endfunction() + +# And off we go... +Main() diff --git a/cmake/templates/gitinfo.cc.in b/cmake/templates/gitinfo.cc.in new file mode 100644 index 000000000..798249b84 --- /dev/null +++ b/cmake/templates/gitinfo.cc.in @@ -0,0 +1,15 @@ +/* + Generated automatically by cmake process +*/ + +const char* const gGitInfo = R"gitinfo( +@GIT_LOG@ +@GIT_STATUS@ +Geant4 version @GEANT_VERSION@ +ROOT version @ROOT_VERSION@ +CMake version @CMAKE_VERSION@ +Generated at @DATE@ +Source dir @CMAKE_BINARY_DIR@ +Build dir @CMAKE_SOURCE_DIR@ +)gitinfo"; + From e7330171fac66540b9b2df8b70c1d39dc198f203 Mon Sep 17 00:00:00 2001 From: Paul King Date: Mon, 28 Jan 2019 20:27:07 -0500 Subject: [PATCH 102/137] Updated the panguin CMakeList to work with our new FindRoot. A few minor changes were needed to compile panguin on the adaq machines with the new FindRoot. Also added an example panguin config file to plot variables from JAPAN rootfiles. --- panguin/CMakeLists.txt | 23 +++++++---- panguin/macros/japan_example.cfg | 70 ++++++++++++++++++++++++++++++++ 2 files changed, 85 insertions(+), 8 deletions(-) create mode 100644 panguin/macros/japan_example.cfg diff --git a/panguin/CMakeLists.txt b/panguin/CMakeLists.txt index db009609b..599fa204b 100755 --- a/panguin/CMakeLists.txt +++ b/panguin/CMakeLists.txt @@ -4,6 +4,10 @@ cmake_minimum_required(VERSION 2.8.4 FATAL_ERROR) # Name of this project project(panguin) +# Install in GNU-style directory layout (copied from japan/CMakeLists.txt) +include(GNUInstallDirs) + + message(STATUS "System name ${CMAKE_SYSTEM_NAME}") #MAC specific variable if(${CMAKE_SYSTEM_NAME} MATCHES "Darwin") @@ -36,22 +40,25 @@ endif() include_directories(${CMAKE_CURRENT_BINARY_DIR}/include) # Load ROOT and setup include directory -find_package(ROOT 6 REQUIRED) +find_package(ROOT 6 REQUIRED New Gui Minuit2) include_directories(${ROOT_INCLUDE_DIR}) -set(ROOT_LIBRARIES ${ROOT_LIBRARIES} -lNew -lGui -lMinuit2) add_definitions(-std=c++11) -ROOT_GENERATE_DICTIONARY( - panguinDict # path to dictionary to generate - include/panguinOnlineConfig.hh - include/panguinOnline.hh - LINKDEF "include/panguinOnlineLinkDef.h" # ROOT linkDef file + +build_root_dictionary( + panguin # path to dictionary to generate + ${PROJECT_SOURCE_DIR}/include/panguinOnlineConfig.hh + ${PROJECT_SOURCE_DIR}/include/panguinOnline.hh + TARGETS panguin + LINKDEF "${PROJECT_SOURCE_DIR}/include/panguinOnlineLinkDef.h" # ROOT linkDef file OPTIONS -p ) + include_directories(${PROJECT_SOURCE_DIR}/include) + #---------------------------------------------------------------------------- # Locate sources and headers for this project # NB: headers are included so they will show up in IDEs @@ -66,7 +73,7 @@ file(GLOB headers ${PROJECT_SOURCE_DIR}/include/*.hh) # add_library(panguin-lib SHARED ${sources} ${headers} panguinDict.cxx) set_target_properties(panguin-lib PROPERTIES OUTPUT_NAME panguin) -target_link_libraries(panguin-lib ${ROOT_LIBRARIES}) +target_link_libraries(panguin-lib PUBLIC ROOT::Libraries) add_executable(panguin-bin panguin.cc) set_target_properties(panguin-bin PROPERTIES OUTPUT_NAME panguin) diff --git a/panguin/macros/japan_example.cfg b/panguin/macros/japan_example.cfg new file mode 100644 index 000000000..e4c2621f1 --- /dev/null +++ b/panguin/macros/japan_example.cfg @@ -0,0 +1,70 @@ +# Configuration file for the online GUI +# This file is for ADCs +# All lines containing "#" are treated as comments (ignored) +# Last line MUST be blank. +# Multiple spaces are treated as one space. +# To switch to log scale, add the option logy after the name of +# the histogram + +# Default root file to look at +#rootfile pan.root +rootfile /adaq1/work1/apar/japanOutput/prexALL_1098.root +##rootfile /adaq1/work1/apar/ciprian/parity18_4416_standard.root +##rootfile /dev/shm//QwMemMapFile.map + +# Prototype rootfilename.. overrides GetRootFileName.C + ##protorootfile /adaql1/work1/parity/parity04_XXXXX_standard.root +#protorootfile /adaql1/work1/apar/ciprian/parity18_4416_standard.root + +# Defined cuts +definecut evcut (event_number>1) +definecut bcmds_cut (-1*bcm_ds>1) + +# Uncomment the below line to monitor the fill of a ROOTfile. +#watchfile + +newpage 1 4 + title BCMs vs Event Number + bcm0l02:event_number evcut -type scat -title "BCM0L02 vs Eventnumber" + bcm_us:event_number -title "BCM upstream vs Event Number" -type box + (-1*bcm_ds):event_number evcut -type prof -title "BCM downstream Profile example" -tree Mps_Tree + (1-bcm_us/bcm_ds):(event_number*3600) bcmds_cut -title "What is this?" -tree Mps_Tree + +newpage 1 2 + title BCM asymmetries + asym_bcm_us ErrorFlag==0 + asym_bcm_ds ErrorFlag==0 + +newpage 2 4 + title LHRS channel yields + yield_usl ErrorFlag==0&&yield_usl.Device_Error_Code==0 + yield_dsl ErrorFlag==0&&yield_dsl.Device_Error_Code==0 + yield_atl1 ErrorFlag==0&&yield_atl1.Device_Error_Code==0 + yield_atl2 ErrorFlag==0&&yield_atl2.Device_Error_Code==0 + yield_vqwk_25_0ch4 ErrorFlag==0&&yield_vqwk_25_0ch4.Device_Error_Code==0 + yield_vqwk_25_0ch5 ErrorFlag==0&&yield_vqwk_25_0ch5.Device_Error_Code==0 + yield_vqwk_25_0ch6 ErrorFlag==0&&yield_vqwk_25_0ch6.Device_Error_Code==0 + yield_vqwk_25_0ch7 ErrorFlag==0&&yield_vqwk_25_0ch7.Device_Error_Code==0 + +newpage 2 4 + title LHRS channel asymmetries + asym_usl ErrorFlag==0&&asym_usl.Device_Error_Code==0 + asym_dsl ErrorFlag==0&&asym_dsl.Device_Error_Code==0 + asym_atl1 ErrorFlag==0&&asym_atl1.Device_Error_Code==0 + asym_atl2 ErrorFlag==0&&asym_atl2.Device_Error_Code==0 + asym_vqwk_25_0ch4 ErrorFlag==0&&asym_vqwk_25_0ch4.Device_Error_Code==0 + asym_vqwk_25_0ch5 ErrorFlag==0&&asym_vqwk_25_0ch5.Device_Error_Code==0 + asym_vqwk_25_0ch6 ErrorFlag==0&&asym_vqwk_25_0ch6.Device_Error_Code==0 + asym_vqwk_25_0ch7 ErrorFlag==0&&asym_vqwk_25_0ch7.Device_Error_Code==0 + +newpage 2 4 + title LHRS channel double differences to asym_dsl + asym_usl-asym_dsl ErrorFlag==0&&asym_usl.Device_Error_Code==0&&abs(asym_dsl)>1.0e-4 + asym_dsl ErrorFlag==0&&asym_dsl.Device_Error_Code==0&&abs(asym_dsl)>1.0e-4 + asym_atl1-asym_dsl ErrorFlag==0&&asym_atl1.Device_Error_Code==0&&abs(asym_dsl)>1.0e-4 + asym_atl2-asym_dsl ErrorFlag==0&&asym_atl2.Device_Error_Code==0&&abs(asym_dsl)>1.0e-4 + asym_vqwk_25_0ch4-asym_dsl ErrorFlag==0&&asym_vqwk_25_0ch4.Device_Error_Code==0&&abs(asym_dsl)>1.0e-4 + asym_vqwk_25_0ch5-asym_dsl ErrorFlag==0&&asym_vqwk_25_0ch5.Device_Error_Code==0&&abs(asym_dsl)>1.0e-4 + asym_vqwk_25_0ch6-asym_dsl ErrorFlag==0&&asym_vqwk_25_0ch6.Device_Error_Code==0&&abs(asym_dsl)>1.0e-4 + asym_vqwk_25_0ch7-asym_dsl ErrorFlag==0&&asym_vqwk_25_0ch7.Device_Error_Code==0&&abs(asym_dsl)>1.0e-4 + From bda3446be1132481083d955433566d6dbf4325d2 Mon Sep 17 00:00:00 2001 From: Wouter Deconinck Date: Tue, 29 Jan 2019 16:11:17 -0500 Subject: [PATCH 103/137] Execute check_git_repository on first run --- cmake/modules/CMakeGitInfo.cmake | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) diff --git a/cmake/modules/CMakeGitInfo.cmake b/cmake/modules/CMakeGitInfo.cmake index a09e01fc2..042d71196 100644 --- a/cmake/modules/CMakeGitInfo.cmake +++ b/cmake/modules/CMakeGitInfo.cmake @@ -215,13 +215,8 @@ endfunction() # check the state of git before every build. If the state has # changed, then a file is configured. function(SetupGitMonitoring) - add_custom_target(check_git_repository - ALL - DEPENDS ${PRE_CONFIGURE_FILE} - BYPRODUCTS ${POST_CONFIGURE_FILE} - COMMENT "Checking the git repository for changes..." - COMMAND - ${CMAKE_COMMAND} + message(STATUS "Adding check_git_repository target...") + set(CMD ${CMAKE_COMMAND} -D_BUILD_TIME_CHECK_GIT=TRUE -DGIT_WORKING_DIR=${GIT_WORKING_DIR} -DGIT_EXECUTABLE=${GIT_EXECUTABLE} @@ -229,6 +224,13 @@ function(SetupGitMonitoring) -DPRE_CONFIGURE_FILE=${PRE_CONFIGURE_FILE} -DPOST_CONFIGURE_FILE=${POST_CONFIGURE_FILE} -P "${CMAKE_CURRENT_LIST_FILE}") + add_custom_target(check_git_repository + ALL + DEPENDS ${PRE_CONFIGURE_FILE} + BYPRODUCTS ${POST_CONFIGURE_FILE} + COMMENT "Checking the git repository for changes..." + COMMAND ${CMD}) + execute_process(COMMAND ${CMD}) endfunction() @@ -242,7 +244,10 @@ function(Main) # If so, run the change action. CheckGit("${GIT_WORKING_DIR}" did_change state) if(did_change) + message(STATUS "Git status has changed") GitStateChangedAction("${state}") + else() + message(STATUS "Git status unchanged") endif() else() # Executes at configure time. From 2f73d6dc77a80e1345957fedab325ec28f0792ae Mon Sep 17 00:00:00 2001 From: Wouter Deconinck Date: Tue, 29 Jan 2019 16:11:37 -0500 Subject: [PATCH 104/137] Define gGitInfo as extern --- cmake/templates/gitinfo.cc.in | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/cmake/templates/gitinfo.cc.in b/cmake/templates/gitinfo.cc.in index 798249b84..d89c83f8f 100644 --- a/cmake/templates/gitinfo.cc.in +++ b/cmake/templates/gitinfo.cc.in @@ -2,14 +2,13 @@ Generated automatically by cmake process */ -const char* const gGitInfo = R"gitinfo( +extern const char* const gGitInfo = R"gitinfo( @GIT_LOG@ @GIT_STATUS@ Geant4 version @GEANT_VERSION@ -ROOT version @ROOT_VERSION@ -CMake version @CMAKE_VERSION@ + ROOT version @ROOT_VERSION@ + CMake version @CMAKE_VERSION@ Generated at @DATE@ Source dir @CMAKE_BINARY_DIR@ Build dir @CMAKE_SOURCE_DIR@ )gitinfo"; - From cf7763e16982fa13f434578de17eccd488871876 Mon Sep 17 00:00:00 2001 From: Wouter Deconinck Date: Tue, 29 Jan 2019 16:13:07 -0500 Subject: [PATCH 105/137] Mark QwOptions and QwRunCondition as explicit dependent on gitinfo.cc Add gitinfo.cc to project sources. --- CMakeLists.txt | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index d92c5b3c0..ce60c875c 100755 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -93,9 +93,14 @@ config_add_dependency(ROOT ${minimum_root_version}) # gitinfo.cc # set(PRE_CONFIGURE_FILE ${PROJECT_SOURCE_DIR}/cmake/templates/gitinfo.cc.in) -set(POST_CONFIGURE_FILE ${CMAKE_CURRENT_BINARY_DIR}/gitinfo.cc) +set(POST_CONFIGURE_FILE ${CMAKE_BINARY_DIR}/gitinfo.cc) include(CMakeGitInfo) -set(my_project_sources ${my_project_sources} ${POST_CONFIGURE_FILE}) +set_source_files_properties( + ${PROJECT_SOURCE_DIR}/Analysis/src/QwOptions.cc + ${PROJECT_SOURCE_DIR}/Analysis/src/QwRunCondition.cc + PROPERTIES OBJECTS_DEPEND ${POST_CONFIGURE_FILE} + ) +list(APPEND my_project_sources ${POST_CONFIGURE_FILE}) #---------------------------------------------------------------------------- From 684fef90bbd8c640ee2d63eff4d201992429748e Mon Sep 17 00:00:00 2001 From: Wouter Deconinck Date: Tue, 29 Jan 2019 16:38:43 -0500 Subject: [PATCH 106/137] Not an actual dependency of QwOptions on gitinfo.cc and didn't do anything to affect ordering anyway. --- CMakeLists.txt | 5 ----- 1 file changed, 5 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index ce60c875c..89c23681e 100755 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -95,11 +95,6 @@ config_add_dependency(ROOT ${minimum_root_version}) set(PRE_CONFIGURE_FILE ${PROJECT_SOURCE_DIR}/cmake/templates/gitinfo.cc.in) set(POST_CONFIGURE_FILE ${CMAKE_BINARY_DIR}/gitinfo.cc) include(CMakeGitInfo) -set_source_files_properties( - ${PROJECT_SOURCE_DIR}/Analysis/src/QwOptions.cc - ${PROJECT_SOURCE_DIR}/Analysis/src/QwRunCondition.cc - PROPERTIES OBJECTS_DEPEND ${POST_CONFIGURE_FILE} - ) list(APPEND my_project_sources ${POST_CONFIGURE_FILE}) From 10288916443f8c340394b1af9ef95c9f20e9d1f0 Mon Sep 17 00:00:00 2001 From: Wouter Deconinck Date: Tue, 29 Jan 2019 19:15:25 -0500 Subject: [PATCH 107/137] Remove check_git_repository as default target, make it a dependency of library instead --- CMakeLists.txt | 1 + cmake/modules/CMakeGitInfo.cmake | 1 - 2 files changed, 1 insertion(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 89c23681e..8f12eb070 100755 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -148,6 +148,7 @@ endforeach() # main library # add_library(${PROJECT_NAME} SHARED ${my_project_sources} ${my_project_headers}) +add_dependencies(${PROJECT_NAME} check_git_repository) target_include_directories(${PROJECT_NAME} PUBLIC diff --git a/cmake/modules/CMakeGitInfo.cmake b/cmake/modules/CMakeGitInfo.cmake index 042d71196..7e1fdd286 100644 --- a/cmake/modules/CMakeGitInfo.cmake +++ b/cmake/modules/CMakeGitInfo.cmake @@ -225,7 +225,6 @@ function(SetupGitMonitoring) -DPOST_CONFIGURE_FILE=${POST_CONFIGURE_FILE} -P "${CMAKE_CURRENT_LIST_FILE}") add_custom_target(check_git_repository - ALL DEPENDS ${PRE_CONFIGURE_FILE} BYPRODUCTS ${POST_CONFIGURE_FILE} COMMENT "Checking the git repository for changes..." From d677490d4ddd366ed02af32a915dffb9440d12c8 Mon Sep 17 00:00:00 2001 From: Wouter Deconinck Date: Tue, 29 Jan 2019 19:23:02 -0500 Subject: [PATCH 108/137] Fix confusing indentation --- Analysis/src/QwSubsystemArray.cc | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/Analysis/src/QwSubsystemArray.cc b/Analysis/src/QwSubsystemArray.cc index 501d87799..7e0cbf4f7 100755 --- a/Analysis/src/QwSubsystemArray.cc +++ b/Analysis/src/QwSubsystemArray.cc @@ -359,11 +359,12 @@ Int_t QwSubsystemArray::ProcessEvBuffer( UInt_t* buffer, UInt_t num_words) { - if (!empty()) + if (!empty()) { SetDataLoaded(kTRUE); - for (iterator subsys = begin(); subsys != end(); ++subsys){ + for (iterator subsys = begin(); subsys != end(); ++subsys) { (*subsys)->ProcessEvBuffer(event_type, roc_id, bank_id, buffer, num_words); } + } return 0; } From 89aac33123f353a73196857cb289c8bb3b02a7ca Mon Sep 17 00:00:00 2001 From: Wouter Deconinck Date: Tue, 29 Jan 2019 19:23:15 -0500 Subject: [PATCH 109/137] Fix confusing indentation --- Parity/src/QwLinearDiodeArray.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Parity/src/QwLinearDiodeArray.cc b/Parity/src/QwLinearDiodeArray.cc index 635908669..a2011503d 100755 --- a/Parity/src/QwLinearDiodeArray.cc +++ b/Parity/src/QwLinearDiodeArray.cc @@ -329,7 +329,7 @@ void QwLinearDiodeArray::ProcessEvent() std::cout<<" event number= "<GetErrorCode(); fIndependentValues.at(i) = (fIndependentVar[i]->GetValue()); //QwMessage << "Loading IV " << fIndependentVar.at(i) << " into fIndependentValues." << QwLog::endl; From a8f42b38dc79ff52eb48cd1d62ec4038bed1c24c Mon Sep 17 00:00:00 2001 From: Wouter Deconinck Date: Mon, 28 Jan 2019 14:46:23 -0500 Subject: [PATCH 112/137] Do not store hex-encoded string but use C++11 multiline string literal Defined as const char* const to ensure local scoping per C++11 3.5/3. --- Analysis/src/QwOptions.cc | 2 +- Analysis/src/QwRunCondition.cc | 10 ++-------- bin/pullgitinfo.py | 25 +++---------------------- 3 files changed, 6 insertions(+), 31 deletions(-) diff --git a/Analysis/src/QwOptions.cc b/Analysis/src/QwOptions.cc index 26efb6cd0..52748064f 100755 --- a/Analysis/src/QwOptions.cc +++ b/Analysis/src/QwOptions.cc @@ -319,7 +319,7 @@ void QwOptions::Version() #endif QwMessage << "\n Qweak Analysis Framework : " << fArgv[0] << QwLog::endl; - QwMessage << " * GIT info: " << gGitInfoStr << QwLog::endl; + QwMessage << " * GIT info: " << gGitInfo << QwLog::endl; // QwMessage << " * Revision: " << QWANA_SVN_REVISION << QwLog::endl; // QwMessage << " * URL: " << QWANA_SVN_URL << QwLog::endl; // QwMessage << " * Last Changed Rev: " << QWANA_SVN_LASTCHANGEDREVISION << QwLog::endl; diff --git a/Analysis/src/QwRunCondition.cc b/Analysis/src/QwRunCondition.cc index c302627fd..19a4633cd 100755 --- a/Analysis/src/QwRunCondition.cc +++ b/Analysis/src/QwRunCondition.cc @@ -41,7 +41,7 @@ QwRunCondition::SetArgs(Int_t argc, Char_t* argv[]) #if ROOT_VERSION_CODE < ROOT_VERSION(6,0,0) root_version += ", SVN : "; root_version += gROOT->GetSvnRevision(); - root_version += " "; + root_version += " "; root_version += gROOT->GetSvnBranch(); #else // ROOT_VERSION_CODE >= ROOT_VERSION(6,0,0) root_version += ", GIT : "; @@ -69,11 +69,6 @@ QwRunCondition::SetArgs(Int_t argc, Char_t* argv[]) TTimeStamp time_stamp; TString current_time = time_stamp.AsString("l"); // local time - // source code information ~ git - char gitInfo[__GITMAXINFO_SIZE]; - gitInfo[0]='\0'; - strcpy(gitInfo,gGitInfoStr); - // get current ROC flags TString roc_flags; // if one of the cdaq cluster AND the user must be a "cdaq", @@ -83,7 +78,6 @@ QwRunCondition::SetArgs(Int_t argc, Char_t* argv[]) else { roc_flags = "Invalid, because the system is not cdaqlx and the user is not cdaq."; } - // insert some comments at the beginning of strings... root_version.Insert (0, "ROOT Version : "); @@ -104,7 +98,7 @@ QwRunCondition::SetArgs(Int_t argc, Char_t* argv[]) this -> Add(user_name); this -> Add(argv_list); this -> Add(current_time); - this -> Add(gitInfo); + this -> Add(gGitInfo); this -> Add(roc_flags); return; diff --git a/bin/pullgitinfo.py b/bin/pullgitinfo.py index 98be7a4a0..400a4c85c 100755 --- a/bin/pullgitinfo.py +++ b/bin/pullgitinfo.py @@ -10,7 +10,6 @@ f = os.popen("git remote -v && git log -n 1 && git status -bs && echo \" ROOT version\" `root-config --version` && echo \" `cmake --version`\" && echo \"\nGenerated at `date`\"") boringstring = ""; -fullstring = ""; if( f != 0): for line in f: @@ -18,37 +17,19 @@ else: boringstring = "git information unavailable" -maxlen = 2048 - boringstring += "Source dir " + os.getcwd() boringstring += "\nBuild dir " + presentcwd + "\n" -if len(boringstring) > maxlen: - print "WARNING: Truncating info from git"; - boringstring = boringstring[0:maxlen-1] - -for x in boringstring: - fullstring += '\\x'+x.encode('hex') - - - - newheadertext = """#ifndef __GITINFO_HH #define __GITINFO_HH /* Generated automatically by cmake process - Encoding: -------------------------------------------------------------- -""" + boringstring + """ -------------------------------------------------------------- */ -#define __GITMAXINFO_SIZE 2048 - -#define gGitInfoStr \"""" + fullstring + '\"' \ -+ \ -""" +const char* const gGitInfo = R\"gitinfo( +""" + boringstring + """ +)gitinfo\"; #endif//__GITINFO_HH """ From ec6877a91d3407f857d5b3d666895c322e1d16dd Mon Sep 17 00:00:00 2001 From: Paul King Date: Mon, 28 Jan 2019 20:27:07 -0500 Subject: [PATCH 113/137] Updated the panguin CMakeList to work with our new FindRoot. A few minor changes were needed to compile panguin on the adaq machines with the new FindRoot. Also added an example panguin config file to plot variables from JAPAN rootfiles. --- panguin/CMakeLists.txt | 23 +++++++---- panguin/macros/japan_example.cfg | 70 ++++++++++++++++++++++++++++++++ 2 files changed, 85 insertions(+), 8 deletions(-) create mode 100644 panguin/macros/japan_example.cfg diff --git a/panguin/CMakeLists.txt b/panguin/CMakeLists.txt index db009609b..599fa204b 100755 --- a/panguin/CMakeLists.txt +++ b/panguin/CMakeLists.txt @@ -4,6 +4,10 @@ cmake_minimum_required(VERSION 2.8.4 FATAL_ERROR) # Name of this project project(panguin) +# Install in GNU-style directory layout (copied from japan/CMakeLists.txt) +include(GNUInstallDirs) + + message(STATUS "System name ${CMAKE_SYSTEM_NAME}") #MAC specific variable if(${CMAKE_SYSTEM_NAME} MATCHES "Darwin") @@ -36,22 +40,25 @@ endif() include_directories(${CMAKE_CURRENT_BINARY_DIR}/include) # Load ROOT and setup include directory -find_package(ROOT 6 REQUIRED) +find_package(ROOT 6 REQUIRED New Gui Minuit2) include_directories(${ROOT_INCLUDE_DIR}) -set(ROOT_LIBRARIES ${ROOT_LIBRARIES} -lNew -lGui -lMinuit2) add_definitions(-std=c++11) -ROOT_GENERATE_DICTIONARY( - panguinDict # path to dictionary to generate - include/panguinOnlineConfig.hh - include/panguinOnline.hh - LINKDEF "include/panguinOnlineLinkDef.h" # ROOT linkDef file + +build_root_dictionary( + panguin # path to dictionary to generate + ${PROJECT_SOURCE_DIR}/include/panguinOnlineConfig.hh + ${PROJECT_SOURCE_DIR}/include/panguinOnline.hh + TARGETS panguin + LINKDEF "${PROJECT_SOURCE_DIR}/include/panguinOnlineLinkDef.h" # ROOT linkDef file OPTIONS -p ) + include_directories(${PROJECT_SOURCE_DIR}/include) + #---------------------------------------------------------------------------- # Locate sources and headers for this project # NB: headers are included so they will show up in IDEs @@ -66,7 +73,7 @@ file(GLOB headers ${PROJECT_SOURCE_DIR}/include/*.hh) # add_library(panguin-lib SHARED ${sources} ${headers} panguinDict.cxx) set_target_properties(panguin-lib PROPERTIES OUTPUT_NAME panguin) -target_link_libraries(panguin-lib ${ROOT_LIBRARIES}) +target_link_libraries(panguin-lib PUBLIC ROOT::Libraries) add_executable(panguin-bin panguin.cc) set_target_properties(panguin-bin PROPERTIES OUTPUT_NAME panguin) diff --git a/panguin/macros/japan_example.cfg b/panguin/macros/japan_example.cfg new file mode 100644 index 000000000..e4c2621f1 --- /dev/null +++ b/panguin/macros/japan_example.cfg @@ -0,0 +1,70 @@ +# Configuration file for the online GUI +# This file is for ADCs +# All lines containing "#" are treated as comments (ignored) +# Last line MUST be blank. +# Multiple spaces are treated as one space. +# To switch to log scale, add the option logy after the name of +# the histogram + +# Default root file to look at +#rootfile pan.root +rootfile /adaq1/work1/apar/japanOutput/prexALL_1098.root +##rootfile /adaq1/work1/apar/ciprian/parity18_4416_standard.root +##rootfile /dev/shm//QwMemMapFile.map + +# Prototype rootfilename.. overrides GetRootFileName.C + ##protorootfile /adaql1/work1/parity/parity04_XXXXX_standard.root +#protorootfile /adaql1/work1/apar/ciprian/parity18_4416_standard.root + +# Defined cuts +definecut evcut (event_number>1) +definecut bcmds_cut (-1*bcm_ds>1) + +# Uncomment the below line to monitor the fill of a ROOTfile. +#watchfile + +newpage 1 4 + title BCMs vs Event Number + bcm0l02:event_number evcut -type scat -title "BCM0L02 vs Eventnumber" + bcm_us:event_number -title "BCM upstream vs Event Number" -type box + (-1*bcm_ds):event_number evcut -type prof -title "BCM downstream Profile example" -tree Mps_Tree + (1-bcm_us/bcm_ds):(event_number*3600) bcmds_cut -title "What is this?" -tree Mps_Tree + +newpage 1 2 + title BCM asymmetries + asym_bcm_us ErrorFlag==0 + asym_bcm_ds ErrorFlag==0 + +newpage 2 4 + title LHRS channel yields + yield_usl ErrorFlag==0&&yield_usl.Device_Error_Code==0 + yield_dsl ErrorFlag==0&&yield_dsl.Device_Error_Code==0 + yield_atl1 ErrorFlag==0&&yield_atl1.Device_Error_Code==0 + yield_atl2 ErrorFlag==0&&yield_atl2.Device_Error_Code==0 + yield_vqwk_25_0ch4 ErrorFlag==0&&yield_vqwk_25_0ch4.Device_Error_Code==0 + yield_vqwk_25_0ch5 ErrorFlag==0&&yield_vqwk_25_0ch5.Device_Error_Code==0 + yield_vqwk_25_0ch6 ErrorFlag==0&&yield_vqwk_25_0ch6.Device_Error_Code==0 + yield_vqwk_25_0ch7 ErrorFlag==0&&yield_vqwk_25_0ch7.Device_Error_Code==0 + +newpage 2 4 + title LHRS channel asymmetries + asym_usl ErrorFlag==0&&asym_usl.Device_Error_Code==0 + asym_dsl ErrorFlag==0&&asym_dsl.Device_Error_Code==0 + asym_atl1 ErrorFlag==0&&asym_atl1.Device_Error_Code==0 + asym_atl2 ErrorFlag==0&&asym_atl2.Device_Error_Code==0 + asym_vqwk_25_0ch4 ErrorFlag==0&&asym_vqwk_25_0ch4.Device_Error_Code==0 + asym_vqwk_25_0ch5 ErrorFlag==0&&asym_vqwk_25_0ch5.Device_Error_Code==0 + asym_vqwk_25_0ch6 ErrorFlag==0&&asym_vqwk_25_0ch6.Device_Error_Code==0 + asym_vqwk_25_0ch7 ErrorFlag==0&&asym_vqwk_25_0ch7.Device_Error_Code==0 + +newpage 2 4 + title LHRS channel double differences to asym_dsl + asym_usl-asym_dsl ErrorFlag==0&&asym_usl.Device_Error_Code==0&&abs(asym_dsl)>1.0e-4 + asym_dsl ErrorFlag==0&&asym_dsl.Device_Error_Code==0&&abs(asym_dsl)>1.0e-4 + asym_atl1-asym_dsl ErrorFlag==0&&asym_atl1.Device_Error_Code==0&&abs(asym_dsl)>1.0e-4 + asym_atl2-asym_dsl ErrorFlag==0&&asym_atl2.Device_Error_Code==0&&abs(asym_dsl)>1.0e-4 + asym_vqwk_25_0ch4-asym_dsl ErrorFlag==0&&asym_vqwk_25_0ch4.Device_Error_Code==0&&abs(asym_dsl)>1.0e-4 + asym_vqwk_25_0ch5-asym_dsl ErrorFlag==0&&asym_vqwk_25_0ch5.Device_Error_Code==0&&abs(asym_dsl)>1.0e-4 + asym_vqwk_25_0ch6-asym_dsl ErrorFlag==0&&asym_vqwk_25_0ch6.Device_Error_Code==0&&abs(asym_dsl)>1.0e-4 + asym_vqwk_25_0ch7-asym_dsl ErrorFlag==0&&asym_vqwk_25_0ch7.Device_Error_Code==0&&abs(asym_dsl)>1.0e-4 + From 93be35ac1310d7673a4a3f4874eb35a7164f25ca Mon Sep 17 00:00:00 2001 From: Wouter Deconinck Date: Tue, 29 Jan 2019 19:23:02 -0500 Subject: [PATCH 114/137] Fix confusing indentation --- Analysis/src/QwSubsystemArray.cc | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/Analysis/src/QwSubsystemArray.cc b/Analysis/src/QwSubsystemArray.cc index 501d87799..7e0cbf4f7 100755 --- a/Analysis/src/QwSubsystemArray.cc +++ b/Analysis/src/QwSubsystemArray.cc @@ -359,11 +359,12 @@ Int_t QwSubsystemArray::ProcessEvBuffer( UInt_t* buffer, UInt_t num_words) { - if (!empty()) + if (!empty()) { SetDataLoaded(kTRUE); - for (iterator subsys = begin(); subsys != end(); ++subsys){ + for (iterator subsys = begin(); subsys != end(); ++subsys) { (*subsys)->ProcessEvBuffer(event_type, roc_id, bank_id, buffer, num_words); } + } return 0; } From f935a0ad69fb219a3deee970bb89b99759e13b21 Mon Sep 17 00:00:00 2001 From: Wouter Deconinck Date: Tue, 29 Jan 2019 19:23:15 -0500 Subject: [PATCH 115/137] Fix confusing indentation --- Parity/src/QwLinearDiodeArray.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Parity/src/QwLinearDiodeArray.cc b/Parity/src/QwLinearDiodeArray.cc index 635908669..a2011503d 100755 --- a/Parity/src/QwLinearDiodeArray.cc +++ b/Parity/src/QwLinearDiodeArray.cc @@ -329,7 +329,7 @@ void QwLinearDiodeArray::ProcessEvent() std::cout<<" event number= "< Date: Wed, 30 Jan 2019 21:16:52 -0500 Subject: [PATCH 118/137] First actually working ADC18 readout... On at least run 3970... --- Analysis/include/QwADC18_Channel.h | 4 +- Analysis/src/QwADC18_Channel.cc | 140 ++++++++++++++++------------- Parity/prminput/adc18_beamline.map | 46 ++++++++-- 3 files changed, 124 insertions(+), 66 deletions(-) diff --git a/Analysis/include/QwADC18_Channel.h b/Analysis/include/QwADC18_Channel.h index 9bfb85acc..c712abce5 100755 --- a/Analysis/include/QwADC18_Channel.h +++ b/Analysis/include/QwADC18_Channel.h @@ -113,6 +113,7 @@ class QwADC18_Channel: public VQwHardwareChannel, public MQwMockable { void EncodeEventData(std::vector &buffer); /// Decode the event data from a CODA buffer + Int_t ProcessDataWord(UInt_t word); Int_t ProcessEvBuffer(UInt_t* buffer, UInt_t num_words_left, UInt_t index = 0); /// Process the event data according to pedestal and calibration factor @@ -245,7 +246,8 @@ class QwADC18_Channel: public VQwHardwareChannel, public MQwMockable { private: static const Bool_t kDEBUG; - static const Int_t kWordsPerChannel; //no.of words per channel in the CODA buffer + static const Int_t kHeaderWordsPerModule; //no.of header words per module in the CODA buffer + static const Int_t kDataWordsPerChannel; //no.of data words per channel in the CODA buffer static const Int_t kMaxChannels; //no.of channels per module /// Pointer to the running sum for this channel diff --git a/Analysis/src/QwADC18_Channel.cc b/Analysis/src/QwADC18_Channel.cc index bbc69e690..df464a9a6 100755 --- a/Analysis/src/QwADC18_Channel.cc +++ b/Analysis/src/QwADC18_Channel.cc @@ -14,8 +14,9 @@ const Bool_t QwADC18_Channel::kDEBUG = kFALSE; -const Int_t QwADC18_Channel::kWordsPerChannel = 1; // FIXME -const Int_t QwADC18_Channel::kMaxChannels = 8; // FIXME +const Int_t QwADC18_Channel::kHeaderWordsPerModule = 13; +const Int_t QwADC18_Channel::kDataWordsPerChannel = 3; +const Int_t QwADC18_Channel::kMaxChannels = 4; const Double_t QwADC18_Channel::kTimePerSample = 2.0 * Qw::us; // FIXME @@ -47,8 +48,8 @@ Int_t QwADC18_Channel::GetBufferOffset(Int_t moduleindex, Int_t channelindex){ << ". Must be in range [0," << kMaxChannels << "]." << QwLog::endl; } else { - offset = ( (moduleindex * kMaxChannels) + channelindex ) - * kWordsPerChannel; + offset = moduleindex * (kHeaderWordsPerModule + kMaxChannels * kDataWordsPerChannel) + + kHeaderWordsPerModule + channelindex * kDataWordsPerChannel; } return offset; } @@ -266,7 +267,7 @@ void QwADC18_Channel::EncodeEventData(std::vector &buffer) UInt_t mask170x = 0x0003ffff; // Data types 1-2 value field mask UInt_t mask150x = 0x0000ffff; // Data type 4 value field mask - UInt_t localbuf[kWordsPerChannel] = {0}; + UInt_t localbuf[kDataWordsPerChannel] = {0}; if (IsNameEmpty()) { // This channel is not used, but is present in the data stream. @@ -288,20 +289,17 @@ void QwADC18_Channel::EncodeEventData(std::vector &buffer) case 4: break; default: - QwError << "QwADC18_Channel::ProcessEvBuffer: Unknown data type" << QwLog::endl; + QwError << "QwADC18_Channel::EncodeEventData: Unknown data type" << QwLog::endl; } } - for (Int_t i = 0; i < kWordsPerChannel; i++) { + for (Int_t i = 0; i < kDataWordsPerChannel; i++) { buffer.push_back(localbuf[i]); } } - -// FIXME here goes the decoding of raw data from CODA blocks -Int_t QwADC18_Channel::ProcessEvBuffer(UInt_t* buffer, UInt_t num_words_left, UInt_t index) +Int_t QwADC18_Channel::ProcessDataWord(UInt_t rawd) { - UInt_t mask31x = 0x80000000; // Header bit mask UInt_t mask3029x = 0x60000000; // Channel number mask UInt_t mask2625x = 0x06000000; // Divider value mask UInt_t mask2422x = 0x01c00000; // Data type mask @@ -311,68 +309,90 @@ Int_t QwADC18_Channel::ProcessEvBuffer(UInt_t* buffer, UInt_t num_words_left, UI UInt_t mask170x = 0x0003ffff; // Data types 1-2 value field mask UInt_t mask150x = 0x0000ffff; // Data type 4 value field mask + // "Actual" values from data word + UInt_t act_dtype = (rawd & mask2422x) >> 22; + UInt_t act_chan = (act_dtype != 4) ? + ((rawd & mask3029x) >> 29) : 0; + UInt_t act_dvalue = (rawd & mask2625x) >> 25; + UInt_t act_snum = (act_dtype == 1 || act_dtype == 2) ? + ((rawd & mask2118x) >> 18) : 0; + + // Interpret by data type + switch (act_dtype) { + case 0: + static UInt_t prev_dvalue = act_dvalue; + if (act_dvalue != prev_dvalue) { + QwError << "QwADC18_Channel::ProcessEvBuffer: Number of samples changed" << QwLog::endl; + return 0; + } + fValue_Raw = rawd & mask200x; + if (rawd & mask21x) fValue_Raw = -((~fValue_Raw & 0x1fffffff) + 1); + fNumberOfSamples = (1 << act_dvalue); + break; + case 1: + case 2: + if (act_snum != fNumberOfSamples) { + QwError << "QwADC18_Channel::ProcessEvBuffer: Divider value non-zero" << QwLog::endl; + return 0; + } + if (act_dvalue != 0) { + QwError << "QwADC18_Channel::ProcessEvBuffer: Divider value non-zero" << QwLog::endl; + return 0; + } + fValue_Raw = rawd & mask170x; + break; + case 4: + if (act_dvalue != 0) { + QwError << "QwADC18_Channel::ProcessEvBuffer: Divider value non-zero" << QwLog::endl; + return 0; + } + fValue_Raw = rawd & mask150x; + break; + default: + QwError << "QwADC18_Channel::ProcessEvBuffer: Unknown data type" << QwLog::endl; + return 0; + } + + return fValue_Raw; +} + +// FIXME here goes the decoding of raw data from CODA blocks +Int_t QwADC18_Channel::ProcessEvBuffer(UInt_t* buffer, UInt_t num_words_left, UInt_t index) +{ + // Print buffer + if (false) { + QwOut << GetElementName() << " : " << QwLog::endl << std::hex; + Int_t n = 25; + for (size_t i = 0; i < num_words_left; i++) { + QwOut << "0x" << std::setfill('0') << std::setw(8) << buffer[i] << " "; + if (i % n == n - 1) QwOut << QwLog::endl; + } + QwOut << std::dec << std::setfill(' ') << std::setw(0) << QwLog::endl; + } + + UInt_t mask31x = 0x80000000; // Header bit mask + UInt_t words_read = 0; if (IsNameEmpty()){ // This channel is not used, but is present in the data stream. // Skip over this data. - words_read = fNumberOfDataWords; + words_read = kDataWordsPerChannel; } else if (num_words_left >= fNumberOfDataWords) { - // Read raw 32-bit word UInt_t rawd = buffer[0]; - // "Actual" values from data word - UInt_t act_dtype = (rawd & mask2422x) >> 22; - UInt_t act_chan = (act_dtype != 4) ? - ((rawd & mask3029x) >> 29) : 0; - UInt_t act_dvalue = (rawd & mask2625x) >> 25; - UInt_t act_snum = (act_dtype == 1 || act_dtype == 2) ? - ((rawd & mask2118x) >> 18) : 0; - // Header check - if (rawd & mask31x != 0) { - QwError << "QwADC18_Channel::ProcessEvBuffer: Received header word" << QwLog::endl; - return 0; - } - - // Interpret by data type - switch(act_dtype) { - case 0: - static UInt_t prev_dvalue = act_dvalue; - if (act_dvalue != prev_dvalue) { - QwError << "QwADC18_Channel::ProcessEvBuffer: Number of samples changed" << QwLog::endl; - } - fValue_Raw = rawd & mask200x; - if (rawd & mask21x) fValue_Raw = -((~fValue_Raw & 0x1fffffff) + 1); - fNumberOfSamples = (1 << act_dvalue); - break; - case 1: - case 2: - if (act_snum != fNumberOfSamples) { - QwError << "QwADC18_Channel::ProcessEvBuffer: Divider value non-zero" << QwLog::endl; - return 0; - } - if (act_dvalue != 0) { - QwError << "QwADC18_Channel::ProcessEvBuffer: Divider value non-zero" << QwLog::endl; - return 0; - } - fValue_Raw = rawd & mask170x; - break; - case 4: - if (act_dvalue != 0) { - QwError << "QwADC18_Channel::ProcessEvBuffer: Divider value non-zero" << QwLog::endl; - return 0; - } - fValue_Raw = rawd & mask150x; - break; - default: - QwError << "QwADC18_Channel::ProcessEvBuffer: Unknown data type" << QwLog::endl; - return 0; + if ((rawd & mask31x) != 0) { + QwError << "QwADC18_Channel::ProcessEvBuffer: Received header word 0x" << std::hex << rawd << " " << (rawd & mask31x) << std::dec << QwLog::endl; + return kHeaderWordsPerModule; } + fValue_Raw = ProcessDataWord(buffer[0]); + fValue_Raw = ProcessDataWord(buffer[1]); + fValue_Raw = ProcessDataWord(buffer[2]); fValue = fCalibrationFactor * (Double_t(fValue_Raw) - fPedestal); - words_read = fNumberOfDataWords; + words_read = kDataWordsPerChannel; } else { QwError << "QwADC18_Channel::ProcessEvBuffer: Not enough words!" << QwLog::endl; } diff --git a/Parity/prminput/adc18_beamline.map b/Parity/prminput/adc18_beamline.map index 1b2454165..d067e342d 100755 --- a/Parity/prminput/adc18_beamline.map +++ b/Parity/prminput/adc18_beamline.map @@ -1,11 +1,47 @@ ROC=23 -sample_size=16564 +! ADC18 buffer offset for run 3970 from Bob +adc18_buffer_offset=36 ! module.type, module.num, module.chan, det.type, det.name -ADC18, 0, 0, bcm, ADC0 -ADC18, 0, 1, bcm, ADC1 -ADC18, 0, 2, bcm, ADC2 -ADC18, 0, 3, bcm, ADC3 +ADC18, 0, 0, bcm, ADC00 +ADC18, 0, 1, bcm, ADC01 +ADC18, 0, 2, bcm, ADC02 +ADC18, 0, 3, bcm, ADC03 + +ADC18, 1, 0, bcm, ADC10 +ADC18, 1, 1, bcm, ADC11 +ADC18, 1, 2, bcm, ADC12 +ADC18, 1, 3, bcm, ADC13 + +ADC18, 2, 0, bcm, ADC20 +ADC18, 2, 1, bcm, ADC21 +ADC18, 2, 2, bcm, ADC22 +ADC18, 2, 3, bcm, ADC23 + +ADC18, 3, 0, bcm, ADC30 +ADC18, 3, 1, bcm, ADC31 +ADC18, 3, 2, bcm, ADC32 +ADC18, 3, 3, bcm, ADC33 + +ADC18, 4, 0, bcm, ADC40 +ADC18, 4, 1, bcm, ADC41 +ADC18, 4, 2, bcm, ADC42 +ADC18, 4, 3, bcm, ADC43 + +ADC18, 5, 0, bcm, ADC50 +ADC18, 5, 1, bcm, ADC51 +ADC18, 5, 2, bcm, ADC52 +ADC18, 5, 3, bcm, ADC53 + +ADC18, 6, 0, bcm, ADC60 +ADC18, 6, 1, bcm, ADC61 +ADC18, 6, 2, bcm, ADC62 +ADC18, 6, 3, bcm, ADC63 + +ADC18, 7, 0, bcm, ADC70 +ADC18, 7, 1, bcm, ADC71 +ADC18, 7, 2, bcm, ADC72 +ADC18, 7, 3, bcm, ADC73 !END From 0a2bd0cf3fd0f9f9304c3c0aa66e28d916f9b3b1 Mon Sep 17 00:00:00 2001 From: Cameron Clarke Date: Thu, 31 Jan 2019 18:35:31 -0500 Subject: [PATCH 119/137] Creating new testing conf that doesn't normalize detector channels --- Parity/prminput/prex_testing.conf | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 Parity/prminput/prex_testing.conf diff --git a/Parity/prminput/prex_testing.conf b/Parity/prminput/prex_testing.conf new file mode 100644 index 000000000..2b062aebf --- /dev/null +++ b/Parity/prminput/prex_testing.conf @@ -0,0 +1,24 @@ +# This configuration file is used to generate +# a ROOT file for injector beam studies +# +# To Run +# qwparity -r 5900 -c injector.conf +# +# Friday, January 7 22:53:34 EDT 2011 +# +add-config = prexbankflag.conf + +detectors = prex_detectors.map +chainfiles = no +single-output-file = yes +enable-tree-trim = no +disable-hel-tree = no +disable-histos = no +rootfile-stem = prexALL_ +codafile-stem = parity_ALL_ +codafile-ext = dat +QwDetectorArray.normalize = 0 +QwBlindDetectorArray.normalize = 0 + +ring.size = 200 +ring.stability_cut = -1 From 7576fe2408554dbae340fd96c8beb3245c1b3148 Mon Sep 17 00:00:00 2001 From: Cameron Clarke Date: Thu, 31 Jan 2019 22:40:09 -0500 Subject: [PATCH 120/137] Adding macros, examples of how to use panguin, except I don't know how to open the root files for looping over --- panguin/macros/asymmetryPlot.C | 41 +++++++++++ panguin/macros/asymmetryPlot_vector.C | 35 +++++++++ panguin/macros/autoCorrelation.C | 90 +++++++++++++++++++++++ panguin/macros/autoCorrelation_panguin.C | 73 +++++++++++++++++++ panguin/macros/japan_macro_example.cfg | 93 ++++++++++++++++++++++++ panguin/macros/setPlotStyle.C | 20 +++++ 6 files changed, 352 insertions(+) create mode 100644 panguin/macros/asymmetryPlot.C create mode 100644 panguin/macros/asymmetryPlot_vector.C create mode 100644 panguin/macros/autoCorrelation.C create mode 100644 panguin/macros/autoCorrelation_panguin.C create mode 100644 panguin/macros/japan_macro_example.cfg create mode 100644 panguin/macros/setPlotStyle.C diff --git a/panguin/macros/asymmetryPlot.C b/panguin/macros/asymmetryPlot.C new file mode 100644 index 000000000..7b9351412 --- /dev/null +++ b/panguin/macros/asymmetryPlot.C @@ -0,0 +1,41 @@ +/************************************************************** + * * + * Author: Cameron Clarke * + * Date: 1-31-2019 * + * Purpose: A script that loops through events in the * + * event-based tree and generates auto-correlations * + * and also estimates the helicity pattern-tree and * + * the alternating-pair-wise ppm asymmetry noise * + * floor for a ~7 volt signal or a mid-range scaler * + * * + **************************************************************/ + +#include +#include +#include +#include "TTree.h" + +void asymmetryPlot(std::string channel) { + + gStyle->SetOptStat(0); + + TTree *oldPatternTree = (TTree*)gDirectory->Get("Hel_Tree"); + TTree *newPatternTree = new TTree("noise_Hel_Tree","Tree of Pattern based noise"); + + Double_t patternAsyms; + oldPatternTree->SetBranchAddress( Form("asym_%s",channel.c_str()), &patternAsyms ); + Int_t numEntries = oldPatternTree->GetEntries(); + + // Calculate noise floor from pattern tree directly, no steps for this + //std::vector < Double_t > *patternNoises;// = new std::vector < Double_t >; + Double_t patternNoises; + TBranch *patternNoisesBranch; + patternNoisesBranch = newPatternTree->Branch(Form("pattern_noise_%s",channel.c_str()), &patternNoises); + newPatternTree->SetEntries(numEntries); + for (int j = 0; j < numEntries; j++) { + oldPatternTree->GetEntry(j); + patternNoises=patternAsyms; + patternNoisesBranch->Fill(); + } + newPatternTree->Draw(Form("pattern_noise_%s",channel.c_str())); +} diff --git a/panguin/macros/asymmetryPlot_vector.C b/panguin/macros/asymmetryPlot_vector.C new file mode 100644 index 000000000..e2fb01633 --- /dev/null +++ b/panguin/macros/asymmetryPlot_vector.C @@ -0,0 +1,35 @@ +/************************************************************** + * * + * Author: Cameron Clarke * + * Date: 1-31-2019 * + * Purpose: A script that loops through events in the * + * event-based tree and generates auto-correlations * + * and also estimates the helicity pattern-tree and * + * the alternating-pair-wise ppm asymmetry noise * + * floor for a ~7 volt signal or a mid-range scaler * + * * + **************************************************************/ + +#include +#include +#include "TTree.h" + +void asymmetryPlot(std::string channel) { + + gStyle->SetOptStat(0); + + TTree *oldPatternTree = (TTree*)gDirectory->Get("Hel_Tree"); + TTree *newPatternTree = new TTree("noise_Hel_Tree","Tree of Pattern based noise"); + + std::vector < Double_t > *patternAsyms = 0; + oldPatternTree->SetBranchAddress( Form("asym_%s",channel.c_str()) , &patternAsyms ); + + // Calculate noise floor from pattern tree directly, no steps for this + std::vector < Double_t > *patternNoises; + newPatternTree->Branch(Form("pattern_noise_%s",channel.c_str()), &patternNoises); + for (size_t i = 0; i < oldPatternTree->GetEntries(); i++) { + oldPatternTree->GetEntry(i); + patternNoises->push_back(patternAsyms->at(patternAsyms->size()-1)); + } + newPatternTree->Draw(Form("pattern_noise_%s",channel.c_str())); +} diff --git a/panguin/macros/autoCorrelation.C b/panguin/macros/autoCorrelation.C new file mode 100644 index 000000000..7b4078e25 --- /dev/null +++ b/panguin/macros/autoCorrelation.C @@ -0,0 +1,90 @@ +/************************************************************** + * * + * Author: Cameron Clarke * + * Date: 1-31-2019 * + * Purpose: A script that loops through events in the * + * event-based tree and generates auto-correlations * + * and also estimates the helicity pattern-tree and * + * the alternating-pair-wise ppm asymmetry noise * + * floor for a ~7 volt signal or a mid-range scaler * + * * + **************************************************************/ + +void autoCorrelation(TString channel, TString drawoption, Int_t n_steps = 1, Bool_t just_noise_floor=false, Bool_t just_auto_correlation=false, Bool_t ignore_helicity_pattern) { + + gStyle->SetOptStat(0); + + TTree *oldEventTree = (TTree*)gDirectory->Get("Mps_Tree"); + TTree *oldPatternTree = (TTree*)gDirectory->Get("Hel_Tree"); + TTree *newEventTree = new TTree("noise_Mps_Tree","Tree of Event based noise"); + TTree *newPatternTree = new TTree("noise_Hel_Tree","Tree of Pattern based noise"); + + std::vector < Double_t > *dataValues = 0; + std::vector < Int_t > *evNums = 0; + std::vector < Double_t > *patternAsyms = 0; + + oldEventTree->SetBranchAddress( Form("%s",channel) , &dataValues ); + oldEventTree->SetBranchAddress( Form("event_number") , &evNums ); + oldPatternTree->SetBranchAddress( Form("asym_%s",channel) , &patternAsyms ); + + const int nStepsToCheck = 10; + // Calculate nStepsToCheck number of event separated (event based) differences of yields and asymmetry + std::vector < Double_t > newEvNums[nStepsToCheck]; + Double_t stepValues[nStepsToCheck] = {0.0}; // Array of steps, where the index refers to how many events ago the data refers to + std::vector < Double_t > stepNoises[nStepsToCheck]; + std::vector < Double_t > relNoises[nStepsToCheck]; + // Calculate noise floor from pattern tree directly, no steps for this + std::vector < Double_t > *patternNoises; + for (int steps = 0; steps < nStepsToCheck; steps++) { + newEventTree->Branch(Form("event_number") , newEvNums[steps] ); + newEventTree->Branch(Form("values_%dstep_%s",steps+1,channel) , stepValues[steps] ); + newEventTree->Branch(Form("step_%dstep_%s",steps+1,channel) , stepNoises[steps] ); + newEventTree->Branch(Form("rel_%dstep_%s",steps+1,channel) , relNoises[steps] ); + } + newPatternTree->Branch(Form("pattern_noise_%s",channel) , &patternNoises ); + // Assume we start at event 0, and use this variable to check for skipped events (due to decoding errors or DAQ deadtime problems) + Int_t prior_event_number = 0; + Int_t current_event_number = 1; + Double_t noise_step = 0.0; + Double_t noise_rel = 0.0; + + for (size_t i = 0; i < eventTree->GetEntries(); i++) { + eventTree->GetEntry(i); + // There should only ever be one value in each branch per entry, so checking for the length is overkill - just use the last value for safety + //// for (size_t j = 0; j < evnum->size(); j++) + current_event_number = evNums->at(evnum->size()-1); + if (current_event_number != (1 + prior_event_number)) { + // If an event is skipped then update the current run number and loop back through, skipping calculations + prior_event_number = current_event_number; + } + else { + for (int steps1 = nStepsToCheck-1; steps1 > 0; steps1--) { // Shift all data by 1 upwards in the array + stepValues[steps1] = stepValues[steps-1]; + } + stepValues[0] = dataValues->at(dataValues->size()-1); // Grab the new data value - Get the last value in the branch for this event, because I am paranoid + if ((current_event_number-prior_event_number)>nStepsToCheck){ + for (int steps2 = 0; steps2 < nStepsToCheck; steps2++) { + noise_step = stepValues[steps2] - stepValues[0]; // Take the difference w.r.t. the step2-th previous value + noise_rel = (stepValues[steps2] - stepValues[0])/(stepValues[step2] + stepValues[0]); + // Take the relative difference (pair asymmetry) w.r.t. the step2-th previous value + stepNoises[steps2].push_back(noise_step); + relNoises[steps2].push_back(noise_rel); + } + } + } + prior_event_number = current_event_number; + } + + for (int steps3 = 0; steps3 < nStepsToCheck; steps3++) { + c1->cd(steps3); + newEventTree->Draw(Form("rel_%dstep_%s",step3+1,channel)); + } + + if (!ignore_helicity_pattern){ + for (size_t i = 0; i < patternTree->GetEntries(); i++) { + patternTree->GetEntry(i); + patternNoises.push_back(patternAsyms->at(patternAsyms->size()-1)); + } + newPatternTree->Draw(); + } +} diff --git a/panguin/macros/autoCorrelation_panguin.C b/panguin/macros/autoCorrelation_panguin.C new file mode 100644 index 000000000..77d0e8770 --- /dev/null +++ b/panguin/macros/autoCorrelation_panguin.C @@ -0,0 +1,73 @@ +/************************************************************** + * * + * Author: Cameron Clarke * + * Date: 1-31-2019 * + * Purpose: A script that loops through events in the * + * event-based tree and generates auto-correlations * + * and the alternating-pair-wise ppm asymmetry noise * + * floor for a ~7 volt signal or a mid-range scaler * + * * + **************************************************************/ + +void autoCorrelation(TString channel, TString drawoption, Int_t n_steps = 1, Bool_t just_noise_floor=false, Bool_t just_auto_correlation=false) { + + gStyle->SetOptStat(0); + + TTree *oldEventTree = (TTree*)gDirectory->Get("Mps_Tree"); + TTree *newEventTree = new TTree("noise_Mps_Tree","Tree of Event based noise"); + + std::vector < Double_t > *dataValues = 0; + std::vector < Int_t > *evNums = 0; + + oldEventTree->SetBranchAddress( Form("%s",channel) , &dataValues ); + oldEventTree->SetBranchAddress( Form("event_number") , &evNums ); + + const int nStepsToCheck = 10; + // Calculate nStepsToCheck number of event separated (event based) differences of yields and asymmetry + std::vector < Double_t > newEvNums[nStepsToCheck]; + Double_t stepValues[nStepsToCheck] = {0.0}; // Array of steps, where the index refers to how many events ago the data refers to + std::vector < Double_t > stepNoises[nStepsToCheck]; + std::vector < Double_t > relNoises[nStepsToCheck]; + for (int steps = 0; steps < nStepsToCheck; steps++) { + newEventTree->Branch(Form("event_number") , newEvNums[steps] ); + newEventTree->Branch(Form("values_%dstep_%s",steps+1,channel) , stepValues[steps] ); + newEventTree->Branch(Form("step_%dstep_%s",steps+1,channel) , stepNoises[steps] ); + newEventTree->Branch(Form("rel_%dstep_%s",steps+1,channel) , relNoises[steps] ); + } + // Assume we start at event 0, and use this variable to check for skipped events (due to decoding errors or DAQ deadtime problems) + Int_t prior_event_number = 0; + Int_t current_event_number = 1; + Double_t noise_step = 0.0; + Double_t noise_rel = 0.0; + + for (size_t i = 0; i < eventTree->GetEntries(); i++) { + eventTree->GetEntry(i); + // There should only ever be one value in each branch per entry, so checking for the length is overkill - just use the last value for safety + //// for (size_t j = 0; j < evnum->size(); j++) + current_event_number = evNums->at(evnum->size()-1); + if (current_event_number != (1 + prior_event_number)) { + // If an event is skipped then update the current run number and loop back through, skipping calculations + prior_event_number = current_event_number; + } + else { + for (int steps1 = nStepsToCheck-1; steps1 > 0; steps1--) { // Shift all data by 1 upwards in the array + stepValues[steps1] = stepValues[steps-1]; + } + stepValues[0] = dataValues->at(dataValues->size()-1); // Grab the new data value - Get the last value in the branch for this event, because I am paranoid + if ((current_event_number-prior_event_number)>nStepsToCheck){ + for (int steps2 = 0; steps2 < nStepsToCheck; steps2++) { + if (steps2 == n_steps){ + noise_step = stepValues[steps2] - stepValues[0]; // Take the difference w.r.t. the step2-th previous value + noise_rel = (stepValues[steps2] - stepValues[0])/(stepValues[step2] + stepValues[0]); + // Take the relative difference (pair asymmetry) w.r.t. the step2-th previous value + stepNoises[steps2].push_back(noise_step); + relNoises[steps2].push_back(noise_rel); + } + } + } + } + prior_event_number = current_event_number; + } + + newEventTree->Draw(Form("rel_%dstep_%s",step3+1,channel)); +} diff --git a/panguin/macros/japan_macro_example.cfg b/panguin/macros/japan_macro_example.cfg new file mode 100644 index 000000000..6d78c2afd --- /dev/null +++ b/panguin/macros/japan_macro_example.cfg @@ -0,0 +1,93 @@ +# Configuration file for the online GUI +# This file is for ADCs +# All lines containing "#" are treated as comments (ignored) +# Last line MUST be blank. +# Multiple spaces are treated as one space. +# To switch to log scale, add the option logy after the name of +# the histogram + +# Valid entries include: +# To create a new TCanvas with a set number of plots in it +# Specify with: newpage [x] [y] [TCanvas options] +# Tree drawing +# Specify with: +# Variable drawing +# Specify with: variables cuts -type [type] -title [title] -tree [tree name] +# Page title setting: +# Specify with: title Your Title Here +# Macro execution +# Specify with: macro path/to/macro.C(options) +# Additional options: +# -noshow golden + +# Default root file to look at +#rootfile pan.root +#goldenrootfile /adaq1/work1/apar/japanOutput/prexALL_1033.root +rootfile /adaq1/work1/apar/japanOutput/prexALL_1033.root +##rootfile /dev/shm/QwMemMapFile.map + +# Prototype rootfilename.. overrides GetRootFileName.C + ##protorootfile /adaql1/work1/parity/parity04_XXXXX_standard.root +#protorootfile /adaql1/work1/apar/ciprian/parity18_4416_standard.root + +# Defined cuts +definecut evcut (event_number>1) +definecut bcmds_cut (-1*bcm_ds>1) + +# Uncomment the below line to monitor the fill of a ROOTfile. +#watchfile + +newpage 1 4 + title BCMs vs Event Number + bcm0l02:event_number evcut -type scat -title "BCM0L02 vs Eventnumber" + bcm_us:event_number -title "BCM upstream vs Event Number" -type box + (-1*bcm_ds):event_number evcut -type prof -title "BCM downstream Profile example" -tree Mps_Tree + (1-bcm_us/bcm_ds):(event_number*3600) bcmds_cut -title "What is this?" -tree Mps_Tree + +newpage 1 2 + title BCM asymmetries + asym_bcm_us ErrorFlag==0 + asym_bcm_ds ErrorFlag==0 + +newpage 2 4 + title LHRS channel yields + yield_usl ErrorFlag==0&&yield_usl.Device_Error_Code==0 + yield_dsl ErrorFlag==0&&yield_dsl.Device_Error_Code==0 + yield_atl1 ErrorFlag==0&&yield_atl1.Device_Error_Code==0 + yield_atl2 ErrorFlag==0&&yield_atl2.Device_Error_Code==0 + yield_vqwk_25_0ch4 ErrorFlag==0&&yield_vqwk_25_0ch4.Device_Error_Code==0 + yield_vqwk_25_0ch5 ErrorFlag==0&&yield_vqwk_25_0ch5.Device_Error_Code==0 + yield_vqwk_25_0ch6 ErrorFlag==0&&yield_vqwk_25_0ch6.Device_Error_Code==0 + yield_vqwk_25_0ch7 ErrorFlag==0&&yield_vqwk_25_0ch7.Device_Error_Code==0 + +newpage 2 4 + title LHRS channel asymmetries + asym_usl ErrorFlag==0&&asym_usl.Device_Error_Code==0 + asym_dsl ErrorFlag==0&&asym_dsl.Device_Error_Code==0 + asym_atl1 ErrorFlag==0&&asym_atl1.Device_Error_Code==0 + asym_atl2 ErrorFlag==0&&asym_atl2.Device_Error_Code==0 + asym_vqwk_25_0ch4 ErrorFlag==0&&asym_vqwk_25_0ch4.Device_Error_Code==0 + asym_vqwk_25_0ch5 ErrorFlag==0&&asym_vqwk_25_0ch5.Device_Error_Code==0 + asym_vqwk_25_0ch6 ErrorFlag==0&&asym_vqwk_25_0ch6.Device_Error_Code==0 + asym_vqwk_25_0ch7 ErrorFlag==0&&asym_vqwk_25_0ch7.Device_Error_Code==0 + +newpage 2 4 + title LHRS channel double differences to asym_dsl + asym_usl-asym_dsl ErrorFlag==0&&asym_usl.Device_Error_Code==0&&abs(asym_dsl)>1.0e-4 + asym_dsl ErrorFlag==0&&asym_dsl.Device_Error_Code==0&&abs(asym_dsl)>1.0e-4 + asym_atl1-asym_dsl ErrorFlag==0&&asym_atl1.Device_Error_Code==0&&abs(asym_dsl)>1.0e-4 + asym_atl2-asym_dsl ErrorFlag==0&&asym_atl2.Device_Error_Code==0&&abs(asym_dsl)>1.0e-4 + asym_vqwk_25_0ch4-asym_dsl ErrorFlag==0&&asym_vqwk_25_0ch4.Device_Error_Code==0&&abs(asym_dsl)>1.0e-4 + asym_vqwk_25_0ch5-asym_dsl ErrorFlag==0&&asym_vqwk_25_0ch5.Device_Error_Code==0&&abs(asym_dsl)>1.0e-4 + asym_vqwk_25_0ch6-asym_dsl ErrorFlag==0&&asym_vqwk_25_0ch6.Device_Error_Code==0&&abs(asym_dsl)>1.0e-4 + asym_vqwk_25_0ch7-asym_dsl ErrorFlag==0&&asym_vqwk_25_0ch7.Device_Error_Code==0&&abs(asym_dsl)>1.0e-4 + +newpage 1 2 + title Color Test + yield_bcm_us:yield_bcm_ds:(yield_bcm_us-yield_bcm_ds) ErrorFlag==0 -type * + macro ./macros/setPlotStyle.C() + yield_bcm_us:yield_bcm_ds:(yield_bcm_us-yield_bcm_ds) ErrorFlag==0 -type COLZ + +newpage 1 1 + title Noise Floor Test + macro ./macros/asymmetryPlot.C("vqwk_26_0ch7") diff --git a/panguin/macros/setPlotStyle.C b/panguin/macros/setPlotStyle.C new file mode 100644 index 000000000..904c99592 --- /dev/null +++ b/panguin/macros/setPlotStyle.C @@ -0,0 +1,20 @@ +/************************************************************** + * * + * Author: Cameron Clarke * + * Date: 1-31-2019 * + * Purpose: A script for setting a 255-level color axis * + * * + **************************************************************/ + +void setPlotStyle() +{ + const Int_t NRGBs = 5; + const Int_t NCont = 255; + // See class TColor documentation and SetPalette() command + Double_t stops[NRGBs] = { 0.00, 0.34, 0.61, 0.84, 1.00 }; + Double_t red[NRGBs] = { 0.00, 0.00, 0.87, 1.00, 0.51 }; + Double_t green[NRGBs] = { 0.00, 0.81, 1.00, 0.20, 0.00 }; + Double_t blue[NRGBs] = { 0.51, 1.00, 0.12, 0.00, 0.00 }; + TColor::CreateGradientColorTable(NRGBs, stops, red, green, blue, NCont); + gStyle->SetNumberContours(NCont); +} From 06ededfeebd5b2bf2aa33a72648b9b1a544de32c Mon Sep 17 00:00:00 2001 From: Ciprian Gal Date: Fri, 1 Feb 2019 06:56:44 -0500 Subject: [PATCH 121/137] example for macro functionality --- panguin/README.md | 2 +- panguin/macros/default.cfg | 4 ++++ panguin/macros/exampleMacro1.C | 4 ++++ panguin/macros/exampleMacro2.C | 3 +++ 4 files changed, 12 insertions(+), 1 deletion(-) create mode 100644 panguin/macros/exampleMacro1.C create mode 100644 panguin/macros/exampleMacro2.C diff --git a/panguin/README.md b/panguin/README.md index 8200e46f5..8b195a71c 100644 --- a/panguin/README.md +++ b/panguin/README.md @@ -1,6 +1,6 @@ # PANGUIN -Simple program that reads a configuration file and plots from a file. Searches for trees and branch names to find the correct tree. +Simple program that reads a configuration file and plots from a file. Searches for trees and branch names to find the correct tree. Plots the result of a macro (n.b. your macro should only make one plot). If you have your QW_ROOTFILES env set it will search for a file with the correct run number in that folder assuming the format prexXXX_####.root, where XXX is the configuraiton (for now we have CH, INJ, ALL). diff --git a/panguin/macros/default.cfg b/panguin/macros/default.cfg index 254e46940..93d64fbd0 100644 --- a/panguin/macros/default.cfg +++ b/panguin/macros/default.cfg @@ -35,3 +35,7 @@ newpage 1 2 asym_bcm1 ok_cut asym_bcm2 ok_cut +newpage 1 3 + title Use some macros + macro exampleMacro1.C + macro exampleMacro2.C diff --git a/panguin/macros/exampleMacro1.C b/panguin/macros/exampleMacro1.C new file mode 100644 index 000000000..fd8293205 --- /dev/null +++ b/panguin/macros/exampleMacro1.C @@ -0,0 +1,4 @@ +void exampleMacro1(){ + TF1 *f=new TF1("f1","sin(x)/x",0.,10.); + f->Draw(); +} diff --git a/panguin/macros/exampleMacro2.C b/panguin/macros/exampleMacro2.C new file mode 100644 index 000000000..6eba9d33e --- /dev/null +++ b/panguin/macros/exampleMacro2.C @@ -0,0 +1,3 @@ +void exampleMacro2(){ + R->Draw("bcm1:ev_num","ev_num>1000"); +} From f6556a276f3602ff9bcea8400a9984235862e9d7 Mon Sep 17 00:00:00 2001 From: Wouter Deconinck Date: Fri, 1 Feb 2019 14:49:50 -0500 Subject: [PATCH 122/137] Add DAC header for testing --- Parity/prminput/adc18_beamline.map | 1 + 1 file changed, 1 insertion(+) diff --git a/Parity/prminput/adc18_beamline.map b/Parity/prminput/adc18_beamline.map index d067e342d..2b2f89b91 100755 --- a/Parity/prminput/adc18_beamline.map +++ b/Parity/prminput/adc18_beamline.map @@ -4,6 +4,7 @@ ROC=23 adc18_buffer_offset=36 ! module.type, module.num, module.chan, det.type, det.name +ADC18, 0, -1, bcm, DAC0 ADC18, 0, 0, bcm, ADC00 ADC18, 0, 1, bcm, ADC01 ADC18, 0, 2, bcm, ADC02 From 813fb6585ef0a8b6bc1619d277cd776d1d3b485f Mon Sep 17 00:00:00 2001 From: Wouter Deconinck Date: Fri, 1 Feb 2019 17:08:16 -0500 Subject: [PATCH 123/137] Store japan in /jlab, use $* in entrypoint --- Dockerfile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Dockerfile b/Dockerfile index d98f7e93a..3d9396649 100644 --- a/Dockerfile +++ b/Dockerfile @@ -4,7 +4,7 @@ ENV JLAB_VERSION=2.3 ENV JLAB_ROOT=/jlab ENV JLAB_SOFTWARE=/jlab/2.3/Linux_CentOS7.2.1511-x86_64-gcc4.8.5 -ENV JAPAN=/usr/local/japan +ENV JAPAN=/jlab/japan WORKDIR $JAPAN @@ -29,7 +29,7 @@ RUN echo '#!/bin/bash' > /usr/local/bin/entrypoi echo 'source $JLAB_ROOT/$JLAB_VERSION/ce/jlab.sh' >> /usr/local/bin/entrypoint.sh && \ echo 'export PATH=${JAPAN}/bin:${PATH}' >> /usr/local/bin/entrypoint.sh && \ echo 'export QWANALYSIS=${JAPAN}' >> /usr/local/bin/entrypoint.sh && \ - echo 'cd $JAPAN && exec $1' >> /usr/local/bin/entrypoint.sh && \ + echo 'cd $JAPAN && exec $*' >> /usr/local/bin/entrypoint.sh && \ chmod +x /usr/local/bin/entrypoint.sh ENTRYPOINT ["/usr/local/bin/entrypoint.sh"] From 48a7a4a2be9bd6af3bddf2f3e8c15be336ebfb64 Mon Sep 17 00:00:00 2001 From: Cameron Clarke Date: Fri, 1 Feb 2019 18:00:03 -0500 Subject: [PATCH 124/137] Adding some macro examples with ROOT IO for PANGUIN --- panguin/macros/asymmetryPlot.C | 41 ------------------ panguin/macros/asymmetryPlot_example.C | 57 ++++++++++++++++++++++++++ panguin/macros/japan_macro_example.cfg | 47 +-------------------- 3 files changed, 58 insertions(+), 87 deletions(-) delete mode 100644 panguin/macros/asymmetryPlot.C create mode 100644 panguin/macros/asymmetryPlot_example.C diff --git a/panguin/macros/asymmetryPlot.C b/panguin/macros/asymmetryPlot.C deleted file mode 100644 index 7b9351412..000000000 --- a/panguin/macros/asymmetryPlot.C +++ /dev/null @@ -1,41 +0,0 @@ -/************************************************************** - * * - * Author: Cameron Clarke * - * Date: 1-31-2019 * - * Purpose: A script that loops through events in the * - * event-based tree and generates auto-correlations * - * and also estimates the helicity pattern-tree and * - * the alternating-pair-wise ppm asymmetry noise * - * floor for a ~7 volt signal or a mid-range scaler * - * * - **************************************************************/ - -#include -#include -#include -#include "TTree.h" - -void asymmetryPlot(std::string channel) { - - gStyle->SetOptStat(0); - - TTree *oldPatternTree = (TTree*)gDirectory->Get("Hel_Tree"); - TTree *newPatternTree = new TTree("noise_Hel_Tree","Tree of Pattern based noise"); - - Double_t patternAsyms; - oldPatternTree->SetBranchAddress( Form("asym_%s",channel.c_str()), &patternAsyms ); - Int_t numEntries = oldPatternTree->GetEntries(); - - // Calculate noise floor from pattern tree directly, no steps for this - //std::vector < Double_t > *patternNoises;// = new std::vector < Double_t >; - Double_t patternNoises; - TBranch *patternNoisesBranch; - patternNoisesBranch = newPatternTree->Branch(Form("pattern_noise_%s",channel.c_str()), &patternNoises); - newPatternTree->SetEntries(numEntries); - for (int j = 0; j < numEntries; j++) { - oldPatternTree->GetEntry(j); - patternNoises=patternAsyms; - patternNoisesBranch->Fill(); - } - newPatternTree->Draw(Form("pattern_noise_%s",channel.c_str())); -} diff --git a/panguin/macros/asymmetryPlot_example.C b/panguin/macros/asymmetryPlot_example.C new file mode 100644 index 000000000..92f46fed7 --- /dev/null +++ b/panguin/macros/asymmetryPlot_example.C @@ -0,0 +1,57 @@ +/************************************************************** + * * + * Author: Cameron Clarke * + * Date: 1-31-2019 * + * Title: asymmetryPlot_example(string channel) * + * Purpose: A script that loops through patterns and generates* + * a new branch with the asymmetries in it. This is * + * intended simply to serve as an example of how to * + * properly access a JAPAN output tree, define a * + * struct to store the data itself, and then make a * + * new tree (or any other manipulation) to look at * + * your results. This is a fully functioning macro * + * in PANGUIN and in ROOT in general as well, and it * + * only represents one possible way of accessing and * + * manipulating JAPAN ROOT output. * + * * + **************************************************************/ + +#include +#include +#include +#include "TTree.h" + +void asymmetryPlot_example(std::string channel) { + + gStyle->SetOptStat(0); + + // To grab the root tree output we can assume that PANGUIN has successfully opened a root file + TTree *oldPatternTree = (TTree*)gDirectory->Get("Hel_Tree"); + // Find out how many entries are in the tree so we can loop over the pattern tree later + Int_t numEntries = oldPatternTree->GetEntries(); + // Make a new ROOT tree to store the new data in (this is just an academic example) + TTree *newPatternTree = new TTree("noise_Hel_Tree","Tree of Pattern based noise"); + + // Define a new struct that will hold the individual leaves from the branch of interest + typedef struct {Double_t hw_sum, block[4],numsamp,errorcode;} PATTERNASYMS; + + // Make an instance of the struct + PATTERNASYMS patternAsyms; + // Assign that instance to the new ROOT tree's branch location of interest + oldPatternTree->SetBranchAddress( Form("asym_%s",channel.c_str()), &patternAsyms ); + + // Make a double to hold the data that is the result of our manipulation + Double_t patternNoises; // call the asymmetry "noise", as an unblinded asym is also the noise floor + // Make a new branch to hold the data, but this object is ideally not manipulated much + TBranch *patternNoisesBranch; + // Assign that branch to hold the double we made earlier as the contents of each entry + patternNoisesBranch = newPatternTree->Branch(Form("pattern_noise_%s",channel.c_str()), &patternNoises); + for (int j = 0; j < numEntries; j++) { + // Loop over the input file's entries and fill the new tree with the results of one of the leaves + oldPatternTree->GetEntry(j); + patternNoises=patternAsyms.hw_sum; + newPatternTree->Fill(); + } + // Draw your results + newPatternTree->Draw(Form("pattern_noise_%s",channel.c_str())); +} diff --git a/panguin/macros/japan_macro_example.cfg b/panguin/macros/japan_macro_example.cfg index 6d78c2afd..8415acbbd 100644 --- a/panguin/macros/japan_macro_example.cfg +++ b/panguin/macros/japan_macro_example.cfg @@ -37,51 +37,6 @@ definecut bcmds_cut (-1*bcm_ds>1) # Uncomment the below line to monitor the fill of a ROOTfile. #watchfile -newpage 1 4 - title BCMs vs Event Number - bcm0l02:event_number evcut -type scat -title "BCM0L02 vs Eventnumber" - bcm_us:event_number -title "BCM upstream vs Event Number" -type box - (-1*bcm_ds):event_number evcut -type prof -title "BCM downstream Profile example" -tree Mps_Tree - (1-bcm_us/bcm_ds):(event_number*3600) bcmds_cut -title "What is this?" -tree Mps_Tree - -newpage 1 2 - title BCM asymmetries - asym_bcm_us ErrorFlag==0 - asym_bcm_ds ErrorFlag==0 - -newpage 2 4 - title LHRS channel yields - yield_usl ErrorFlag==0&&yield_usl.Device_Error_Code==0 - yield_dsl ErrorFlag==0&&yield_dsl.Device_Error_Code==0 - yield_atl1 ErrorFlag==0&&yield_atl1.Device_Error_Code==0 - yield_atl2 ErrorFlag==0&&yield_atl2.Device_Error_Code==0 - yield_vqwk_25_0ch4 ErrorFlag==0&&yield_vqwk_25_0ch4.Device_Error_Code==0 - yield_vqwk_25_0ch5 ErrorFlag==0&&yield_vqwk_25_0ch5.Device_Error_Code==0 - yield_vqwk_25_0ch6 ErrorFlag==0&&yield_vqwk_25_0ch6.Device_Error_Code==0 - yield_vqwk_25_0ch7 ErrorFlag==0&&yield_vqwk_25_0ch7.Device_Error_Code==0 - -newpage 2 4 - title LHRS channel asymmetries - asym_usl ErrorFlag==0&&asym_usl.Device_Error_Code==0 - asym_dsl ErrorFlag==0&&asym_dsl.Device_Error_Code==0 - asym_atl1 ErrorFlag==0&&asym_atl1.Device_Error_Code==0 - asym_atl2 ErrorFlag==0&&asym_atl2.Device_Error_Code==0 - asym_vqwk_25_0ch4 ErrorFlag==0&&asym_vqwk_25_0ch4.Device_Error_Code==0 - asym_vqwk_25_0ch5 ErrorFlag==0&&asym_vqwk_25_0ch5.Device_Error_Code==0 - asym_vqwk_25_0ch6 ErrorFlag==0&&asym_vqwk_25_0ch6.Device_Error_Code==0 - asym_vqwk_25_0ch7 ErrorFlag==0&&asym_vqwk_25_0ch7.Device_Error_Code==0 - -newpage 2 4 - title LHRS channel double differences to asym_dsl - asym_usl-asym_dsl ErrorFlag==0&&asym_usl.Device_Error_Code==0&&abs(asym_dsl)>1.0e-4 - asym_dsl ErrorFlag==0&&asym_dsl.Device_Error_Code==0&&abs(asym_dsl)>1.0e-4 - asym_atl1-asym_dsl ErrorFlag==0&&asym_atl1.Device_Error_Code==0&&abs(asym_dsl)>1.0e-4 - asym_atl2-asym_dsl ErrorFlag==0&&asym_atl2.Device_Error_Code==0&&abs(asym_dsl)>1.0e-4 - asym_vqwk_25_0ch4-asym_dsl ErrorFlag==0&&asym_vqwk_25_0ch4.Device_Error_Code==0&&abs(asym_dsl)>1.0e-4 - asym_vqwk_25_0ch5-asym_dsl ErrorFlag==0&&asym_vqwk_25_0ch5.Device_Error_Code==0&&abs(asym_dsl)>1.0e-4 - asym_vqwk_25_0ch6-asym_dsl ErrorFlag==0&&asym_vqwk_25_0ch6.Device_Error_Code==0&&abs(asym_dsl)>1.0e-4 - asym_vqwk_25_0ch7-asym_dsl ErrorFlag==0&&asym_vqwk_25_0ch7.Device_Error_Code==0&&abs(asym_dsl)>1.0e-4 - newpage 1 2 title Color Test yield_bcm_us:yield_bcm_ds:(yield_bcm_us-yield_bcm_ds) ErrorFlag==0 -type * @@ -90,4 +45,4 @@ newpage 1 2 newpage 1 1 title Noise Floor Test - macro ./macros/asymmetryPlot.C("vqwk_26_0ch7") + macro ./macros/asymmetryPlot_example.C("vqwk_26_0ch7") From e7cb671f1e78fe2d2e9ca7953156e41cb7425f51 Mon Sep 17 00:00:00 2001 From: Cameron Clarke Date: Sat, 2 Feb 2019 17:45:32 -0500 Subject: [PATCH 125/137] I have gotten to the level of modularly generating analyzed data and reusing it in subsequent PANGUIN plots. However, the macro's memory persists, subsequent re-use from succeeding. --- panguin/macros/asymmetryPlot_example.C | 74 ++++++++++++++++++-------- panguin/macros/japan_macro_example.cfg | 7 ++- 2 files changed, 58 insertions(+), 23 deletions(-) diff --git a/panguin/macros/asymmetryPlot_example.C b/panguin/macros/asymmetryPlot_example.C index 92f46fed7..bcd99f6c8 100644 --- a/panguin/macros/asymmetryPlot_example.C +++ b/panguin/macros/asymmetryPlot_example.C @@ -20,38 +20,68 @@ #include #include #include "TTree.h" +//#include "japantypes.hh" void asymmetryPlot_example(std::string channel) { gStyle->SetOptStat(0); // To grab the root tree output we can assume that PANGUIN has successfully opened a root file - TTree *oldPatternTree = (TTree*)gDirectory->Get("Hel_Tree"); + TFile *oldFile = gFile; + TTree *oldPatternTree = (TTree*)oldFile->Get("Hel_Tree"); + std::string dir = (std::string)gDirectory->CurrentDirectory()->GetPath(); // Find out how many entries are in the tree so we can loop over the pattern tree later Int_t numEntries = oldPatternTree->GetEntries(); // Make a new ROOT tree to store the new data in (this is just an academic example) - TTree *newPatternTree = new TTree("noise_Hel_Tree","Tree of Pattern based noise"); - - // Define a new struct that will hold the individual leaves from the branch of interest - typedef struct {Double_t hw_sum, block[4],numsamp,errorcode;} PATTERNASYMS; - - // Make an instance of the struct - PATTERNASYMS patternAsyms; - // Assign that instance to the new ROOT tree's branch location of interest - oldPatternTree->SetBranchAddress( Form("asym_%s",channel.c_str()), &patternAsyms ); + TTree *newPatternTree; + TFile *resultsFile; + std::string outputFile = Form("second_pass_%s.root",channel.c_str()); + // Check to see if analysis has been run before + if(gSystem->AccessPathName(outputFile.c_str())){ + // Write a new root file for output + resultsFile = new TFile(outputFile.c_str(),"RECREATE"); + // Create a new tree to store results in + newPatternTree = new TTree("noise_Hel_Tree","Tree of Pattern based noise"); - // Make a double to hold the data that is the result of our manipulation - Double_t patternNoises; // call the asymmetry "noise", as an unblinded asym is also the noise floor - // Make a new branch to hold the data, but this object is ideally not manipulated much - TBranch *patternNoisesBranch; - // Assign that branch to hold the double we made earlier as the contents of each entry - patternNoisesBranch = newPatternTree->Branch(Form("pattern_noise_%s",channel.c_str()), &patternNoises); - for (int j = 0; j < numEntries; j++) { - // Loop over the input file's entries and fill the new tree with the results of one of the leaves - oldPatternTree->GetEntry(j); - patternNoises=patternAsyms.hw_sum; - newPatternTree->Fill(); + // Make an instance of the struct we need to read the old Tree's data + typedef struct { + Double_t hw_sum; + Double_t block0; + Double_t block1; + Double_t block2; + Double_t block3; + Double_t numsamp; + Double_t errorcode; + } PATTERNASYMS; + PATTERNASYMS patternAsyms; + // Assign that instance to the new ROOT tree's branch location of interest + oldPatternTree->SetBranchAddress( Form("asym_%s",channel.c_str()), &patternAsyms ); + + // Make a double to hold the data that is the result of our manipulation + Double_t patternNoises; // call the asymmetry "noise", as an unblinded asym is also the noise floor + // Make a new branch to hold the data, but this object is ideally not manipulated much + TBranch *patternNoisesBranch; + // Assign that branch to hold the double we made earlier as the contents of each entry + patternNoisesBranch = newPatternTree->Branch(Form("pattern_noise_%s",channel.c_str()), &patternNoises); + for (int j = 0; j < numEntries; j++) { + // Loop over the input file's entries and fill the new tree with the results of one of the leaves + oldPatternTree->GetEntry(j); + patternNoises=patternAsyms.hw_sum; + newPatternTree->Fill(); + } + // Save your root tree for later use + resultsFile->Write(); + newPatternTree->Draw(Form("pattern_noise_%s",channel.c_str())); } // Draw your results - newPatternTree->Draw(Form("pattern_noise_%s",channel.c_str())); + else{ + resultsFile = new TFile(outputFile.c_str(),"READ"); + newPatternTree = (TTree*)resultsFile->Get("noise_Hel_Tree"); + newPatternTree->Draw(Form("pattern_noise_%s",channel.c_str())); + } + + delete newPatternTree; + resultsFile->Close(); + delete resultsFile; + gFile=oldFile; } diff --git a/panguin/macros/japan_macro_example.cfg b/panguin/macros/japan_macro_example.cfg index 8415acbbd..15ecb011c 100644 --- a/panguin/macros/japan_macro_example.cfg +++ b/panguin/macros/japan_macro_example.cfg @@ -43,6 +43,11 @@ newpage 1 2 macro ./macros/setPlotStyle.C() yield_bcm_us:yield_bcm_ds:(yield_bcm_us-yield_bcm_ds) ErrorFlag==0 -type COLZ -newpage 1 1 +newpage 1 5 title Noise Floor Test + asym_vqwk_26_0ch7 macro ./macros/asymmetryPlot_example.C("vqwk_26_0ch7") + asym_vqwk_26_0ch6 pattern_number>10 + macro ./macros/asymmetryPlot_example.C("vqwk_26_0ch6") + macro ./macros/asymmetryPlot_example.C("vqwk_26_0ch5") + macro ./macros/asymmetryPlot_example.C("vqwk_26_0ch4") From aca75ca9a7566b60f156319fa9a5dd967e7af142 Mon Sep 17 00:00:00 2001 From: Cameron Clarke Date: Sat, 2 Feb 2019 18:55:52 -0500 Subject: [PATCH 126/137] I got this to work by compiling the macro and then using gSystem calls on it. This isn't the most elegant solution, but it at least works and serves as a starting point for more --- panguin/macros/Makefile | 5 + panguin/macros/asymmetryPlot_compile.C | 110 ++++++++++++++++++++++ panguin/macros/asymmetryPlot_diffs.C | 46 +++++++++ panguin/macros/asymmetryPlot_modular.C | 66 +++++++++++++ panguin/macros/asymmetryPlot_wrapper.C | 89 +++++++++++++++++ panguin/macros/japan_compiled_example.cfg | 51 ++++++++++ panguin/macros/japan_modular_example.cfg | 48 ++++++++++ panguin/macros/japantypes.hh | 10 ++ 8 files changed, 425 insertions(+) create mode 100644 panguin/macros/Makefile create mode 100644 panguin/macros/asymmetryPlot_compile.C create mode 100644 panguin/macros/asymmetryPlot_diffs.C create mode 100644 panguin/macros/asymmetryPlot_modular.C create mode 100644 panguin/macros/asymmetryPlot_wrapper.C create mode 100644 panguin/macros/japan_compiled_example.cfg create mode 100644 panguin/macros/japan_modular_example.cfg create mode 100644 panguin/macros/japantypes.hh diff --git a/panguin/macros/Makefile b/panguin/macros/Makefile new file mode 100644 index 000000000..b00b48672 --- /dev/null +++ b/panguin/macros/Makefile @@ -0,0 +1,5 @@ +make testComp: + g++ -g -c asymmetryPlot_compile.C -o comp.o `root-config --cflags --glibs` + g++ comp.o -o compTest `root-config --cflags --glibs` + rm comp.o + diff --git a/panguin/macros/asymmetryPlot_compile.C b/panguin/macros/asymmetryPlot_compile.C new file mode 100644 index 000000000..efb13410e --- /dev/null +++ b/panguin/macros/asymmetryPlot_compile.C @@ -0,0 +1,110 @@ +/************************************************************** + * * + * Author: Cameron Clarke * + * Date: 1-31-2019 * + * Title: asymmetryPlot_example(string channel) * + * Purpose: A script that loops through patterns and generates* + * a new branch with the asymmetries in it. This is * + * intended simply to serve as an example of how to * + * properly access a JAPAN output tree, define a * + * struct to store the data itself, and then make a * + * new tree (or any other manipulation) to look at * + * your results. This is a fully functioning macro * + * in PANGUIN and in ROOT in general as well, and it * + * only represents one possible way of accessing and * + * manipulating JAPAN ROOT output. * + * * + **************************************************************/ + +#include +#include +#include +#include "TTree.h" +#include "TFile.h" +#include "TCanvas.h" +#include +#include +#include +//#include "japantypes.hh" + +int main(int argc, char **argv) +{ + std::string rootfile = "input.root"; + std::string channel = "usr"; + if (argc <= 1 || argc > 3) + { + std::cerr << "Usage: ./compTest char*:rootfileName char*:variable" << std::endl; + exit(0); + } + if (argc >= 2) + { + std::string fileName(argv[1]); + rootfile = fileName; + } + if (argc >= 3) + { + std::string channelName(argv[2]); + channel = channelName; + } + + // To grab the root tree output we can assume that PANGUIN has successfully opened a root file + TFile *oldFile = new TFile(rootfile.c_str(),"READ"); + TTree *oldPatternTree = (TTree*)oldFile->Get("Hel_Tree"); + std::string dir = (std::string)gDirectory->CurrentDirectory()->GetPath(); + // Find out how many entries are in the tree so we can loop over the pattern tree later + Int_t numEntries = oldPatternTree->GetEntries(); + // Make a new ROOT tree to store the new data in (this is just an academic example) + TTree *newPatternTree; + TFile *resultsFile; + std::string outputFile = Form("second_pass_%s.root",channel.c_str()); + // Check to see if analysis has been run before + std::ifstream file(outputFile.c_str()); + if(!file){ + // Write a new root file for output + resultsFile = new TFile(outputFile.c_str(),"RECREATE"); + // Create a new tree to store results in + newPatternTree = new TTree("noise_Hel_Tree","Tree of Pattern based noise"); + + // Make an instance of the struct we need to read the old Tree's data + typedef struct { + Double_t hw_sum; + Double_t block0; + Double_t block1; + Double_t block2; + Double_t block3; + Double_t numsamp; + Double_t errorcode; + } PATTERNASYMS; + PATTERNASYMS patternAsyms; + // Assign that instance to the new ROOT tree's branch location of interest + oldPatternTree->SetBranchAddress( Form("asym_%s",channel.c_str()), &patternAsyms ); + + // Make a double to hold the data that is the result of our manipulation + Double_t patternNoises; // call the asymmetry "noise", as an unblinded asym is also the noise floor + // Make a new branch to hold the data, but this object is ideally not manipulated much + TBranch *patternNoisesBranch; + // Assign that branch to hold the double we made earlier as the contents of each entry + patternNoisesBranch = newPatternTree->Branch(Form("pattern_noise_%s",channel.c_str()), &patternNoises); + for (int j = 0; j < numEntries; j++) { + // Loop over the input file's entries and fill the new tree with the results of one of the leaves + oldPatternTree->GetEntry(j); + patternNoises=patternAsyms.hw_sum; + newPatternTree->Fill(); + } + // Save your root tree for later use + resultsFile->Write(); + newPatternTree->Draw(Form("pattern_noise_%s",channel.c_str())); + } + // Draw your results + else{ + resultsFile = new TFile(outputFile.c_str(),"READ"); + newPatternTree = (TTree*)resultsFile->Get("noise_Hel_Tree"); + newPatternTree->Draw(Form("pattern_noise_%s",channel.c_str())); + } + + delete newPatternTree; + resultsFile->Close(); + delete resultsFile; + delete oldFile; + return 0; +} diff --git a/panguin/macros/asymmetryPlot_diffs.C b/panguin/macros/asymmetryPlot_diffs.C new file mode 100644 index 000000000..a268ed7b7 --- /dev/null +++ b/panguin/macros/asymmetryPlot_diffs.C @@ -0,0 +1,46 @@ +/************************************************************** + * * + * Author: Cameron Clarke * + * Date: 1-31-2019 * + * Purpose: A script that loops through events in the * + * event-based tree and generates auto-correlations * + * and also estimates the helicity pattern-tree and * + * the alternating-pair-wise ppm asymmetry noise * + * floor for a ~7 volt signal or a mid-range scaler * + * * + **************************************************************/ + +#include +#include +#include +#include "TTree.h" + +void asymmetryPlot(std::string channel) { + + gStyle->SetOptStat(0); + + TTree *oldPatternTree = (TTree*)gDirectory->Get("Hel_Tree"); + Int_t numEntries = oldPatternTree->GetEntries(); + std::cout<<"N entries = "<SetBranchAddress( Form("asym_%s",channel.c_str()), &patternAsyms ); + + Double_t patternNoises; + TBranch *patternNoisesBranch; + patternNoisesBranch = newPatternTree->Branch(Form("pattern_noise_%s",channel.c_str()), &patternNoises); + for (int j = 0; j < numEntries-1; j++) { + oldPatternTree->GetEntry(j); + patternNoises=patternAsyms.hw_sum; + oldPatternTree->GetEntry(j+1); + patternNoises-=patternAsyms.hw_sum; + newPatternTree->Fill(); + } + oldPatternTree->Draw(Form("asym_%s",channel.c_str())); + newPatternTree->SetLineColor(2); + newPatternTree->Draw(Form("pattern_noise_%s",channel.c_str()),"","same"); + newPatternTree->Draw(Form("pattern_noise_%s",channel.c_str())); +} diff --git a/panguin/macros/asymmetryPlot_modular.C b/panguin/macros/asymmetryPlot_modular.C new file mode 100644 index 000000000..197c29e3b --- /dev/null +++ b/panguin/macros/asymmetryPlot_modular.C @@ -0,0 +1,66 @@ +/************************************************************** + * * + * Author: Cameron Clarke * + * Date: 1-31-2019 * + * Title: asymmetryPlot_modular(string channel) * + * Purpose: A script that loops through patterns and generates* + * a new branch with the asymmetries in it. This is * + * intended simply to serve as an example of how to * + * properly access a JAPAN output tree, define a * + * struct to store the data itself, and then make a * + * new tree (or any other manipulation) to look at * + * your results. This is a fully functioning macro * + * in PANGUIN and in ROOT in general as well, and it * + * only represents one possible way of accessing and * + * manipulating JAPAN ROOT output. * + * * + **************************************************************/ + +#include +#include +#include +#include "TTree.h" +#include "japantypes.hh" + +void asymmetryPlot_modular(std::string channel) { + + gStyle->SetOptStat(0); + + // Make an instance of the relevant data type's struct + PATTERNASYMS patternAsyms; + + std::string tree = "Hel_Tree"; + std::string modifier = "noise"; + std::string description = "Tree of Pattern based noise"; + + // To grab the root tree output we can assume that PANGUIN has successfully opened a root file + TTree *oldPatternTree = (TTree*)gDirectory->Get("Hel_Tree"); + // Assign that instance to the new ROOT tree's branch location of interest + oldPatternTree->SetBranchAddress( Form("asym_%s",channel.c_str()), &patternAsyms ); + // Make a new ROOT tree to store the new data in (this is just an academic example) + TTree *newPatternTree = new TTree(Form("%s_%s",modifier.c_str(),tree.c_str()),Form("%s",description.c_str())); + + // Make a double to hold the data that is the result of our manipulation + Double_t patternNoises; // call the asymmetry "noise", as an unblinded asym is also the noise floor + //PATTERNASYMS patternBranches; + // Make a new branch to hold the data, but this object is ideally not manipulated much + TBranch *patternNoisesBranch; + //TBranch *patternBranch; + // Assign that branch to hold the double we made earlier as the contents of each entry + patternNoisesBranch = newPatternTree->Branch(Form("pattern_noise_%s",channel.c_str()), &patternNoises); + //patternBranch = newPatternTree->Branch(Form("pattern_%s",channel.c_str()), &patternBranches); + + // Find out how many entries are in the tree so we can loop over the pattern tree later + Int_t numEntries = oldPatternTree->GetEntries(); + + for (int j = 0; j < numEntries; j++) { + // Loop over the input file's entries and fill the new tree with the results of one of the leaves + oldPatternTree->GetEntry(j); + patternNoises = patternAsyms.hw_sum; + //patternBranches = fillPATTERNASYMS(patternAsyms); + newPatternTree->Fill(); + } + // Draw your results + newPatternTree->Draw(Form("pattern_noise_%s",channel.c_str())); + //newPatternTree->Draw(Form("pattern_%s",channel.c_str())); +} diff --git a/panguin/macros/asymmetryPlot_wrapper.C b/panguin/macros/asymmetryPlot_wrapper.C new file mode 100644 index 000000000..60d84bf41 --- /dev/null +++ b/panguin/macros/asymmetryPlot_wrapper.C @@ -0,0 +1,89 @@ +/************************************************************** + * * + * Author: Cameron Clarke * + * Date: 1-31-2019 * + * Title: asymmetryPlot_example(string channel) * + * Purpose: A script that loops through patterns and generates* + * a new branch with the asymmetries in it. This is * + * intended simply to serve as an example of how to * + * properly access a JAPAN output tree, define a * + * struct to store the data itself, and then make a * + * new tree (or any other manipulation) to look at * + * your results. This is a fully functioning macro * + * in PANGUIN and in ROOT in general as well, and it * + * only represents one possible way of accessing and * + * manipulating JAPAN ROOT output. * + * * + **************************************************************/ + +#include +#include +#include +#include "TTree.h" +//#include "japantypes.hh" + +void asymmetryPlot_wrapper(std::string channel) { + + gStyle->SetOptStat(0); + + // To grab the root tree output we can assume that PANGUIN has successfully opened a root file + TFile *oldFile = gFile; + TTree *oldPatternTree = (TTree*)oldFile->Get("Hel_Tree"); + std::string dir = (std::string)gDirectory->CurrentDirectory()->GetPath(); + // Find out how many entries are in the tree so we can loop over the pattern tree later + Int_t numEntries = oldPatternTree->GetEntries(); + // Make a new ROOT tree to store the new data in (this is just an academic example) + TTree *newPatternTree; + TFile *resultsFile; + std::string outputFile = Form("second_pass_%s.root",channel.c_str()); + // Check to see if analysis has been run before + //gSystem->Exec(Form("./compTest %s %s",dir.c_str(),channel.c_str())); + gSystem->Exec(Form("./compTest test.root %s",channel.c_str())); + if(gSystem->AccessPathName(outputFile.c_str())){ + // Write a new root file for output + resultsFile = new TFile(outputFile.c_str(),"RECREATE"); + // Create a new tree to store results in + newPatternTree = new TTree("noise_Hel_Tree","Tree of Pattern based noise"); + + // Make an instance of the struct we need to read the old Tree's data + typedef struct { + Double_t hw_sum; + Double_t block0; + Double_t block1; + Double_t block2; + Double_t block3; + Double_t numsamp; + Double_t errorcode; + } PATTERNASYMS; + PATTERNASYMS patternAsyms; + // Assign that instance to the new ROOT tree's branch location of interest + oldPatternTree->SetBranchAddress( Form("asym_%s",channel.c_str()), &patternAsyms ); + + // Make a double to hold the data that is the result of our manipulation + Double_t patternNoises; // call the asymmetry "noise", as an unblinded asym is also the noise floor + // Make a new branch to hold the data, but this object is ideally not manipulated much + TBranch *patternNoisesBranch; + // Assign that branch to hold the double we made earlier as the contents of each entry + patternNoisesBranch = newPatternTree->Branch(Form("pattern_noise_%s",channel.c_str()), &patternNoises); + for (int j = 0; j < numEntries; j++) { + // Loop over the input file's entries and fill the new tree with the results of one of the leaves + oldPatternTree->GetEntry(j); + patternNoises=patternAsyms.hw_sum; + newPatternTree->Fill(); + } + // Save your root tree for later use + resultsFile->Write(); + newPatternTree->Draw(Form("pattern_noise_%s",channel.c_str())); + } + // Draw your results + else{ + resultsFile = new TFile(outputFile.c_str(),"READ"); + newPatternTree = (TTree*)resultsFile->Get("noise_Hel_Tree"); + newPatternTree->Draw(Form("pattern_noise_%s",channel.c_str())); + } + + delete newPatternTree; + resultsFile->Close(); + delete resultsFile; + gFile=oldFile; +} diff --git a/panguin/macros/japan_compiled_example.cfg b/panguin/macros/japan_compiled_example.cfg new file mode 100644 index 000000000..010f70f18 --- /dev/null +++ b/panguin/macros/japan_compiled_example.cfg @@ -0,0 +1,51 @@ +# Configuration file for the online GUI +# This file is for ADCs +# All lines containing "#" are treated as comments (ignored) +# Last line MUST be blank. +# Multiple spaces are treated as one space. +# To switch to log scale, add the option logy after the name of +# the histogram + +# Valid entries include: +# To create a new TCanvas with a set number of plots in it +# Specify with: newpage [x] [y] [TCanvas options] +# Tree drawing +# Specify with: +# Variable drawing +# Specify with: variables cuts -type [type] -title [title] -tree [tree name] +# Page title setting: +# Specify with: title Your Title Here +# Macro execution +# Specify with: macro path/to/macro.C(options) +# Additional options: +# -noshow golden + +# Default root file to look at +#rootfile pan.root +#goldenrootfile /adaq1/work1/apar/japanOutput/prexALL_1033.root +rootfile /adaq1/work1/apar/japanOutput/prexALL_1033.root +##rootfile /dev/shm/QwMemMapFile.map + +# Prototype rootfilename.. overrides GetRootFileName.C + ##protorootfile /adaql1/work1/parity/parity04_XXXXX_standard.root +#protorootfile /adaql1/work1/apar/ciprian/parity18_4416_standard.root + +# Defined cuts +definecut evcut (event_number>1) +definecut bcmds_cut (-1*bcm_ds>1) + +# Uncomment the below line to monitor the fill of a ROOTfile. +#watchfile + +newpage 1 2 + title Color Test + yield_bcm_us:yield_bcm_ds:(yield_bcm_us-yield_bcm_ds) ErrorFlag==0 -type * + macro ./macros/setPlotStyle.C() + yield_bcm_us:yield_bcm_ds:(yield_bcm_us-yield_bcm_ds) ErrorFlag==0 -type COLZ + +newpage 2 2 + title Noise Floor Test + macro ./macros/asymmetryPlot_wrapper.C("vqwk_26_0ch7") + macro ./macros/asymmetryPlot_wrapper.C("vqwk_26_0ch6") + macro ./macros/asymmetryPlot_wrapper.C("vqwk_26_0ch5") + macro ./macros/asymmetryPlot_wrapper.C("vqwk_26_0ch4") diff --git a/panguin/macros/japan_modular_example.cfg b/panguin/macros/japan_modular_example.cfg new file mode 100644 index 000000000..50b9bc0e0 --- /dev/null +++ b/panguin/macros/japan_modular_example.cfg @@ -0,0 +1,48 @@ +# Configuration file for the online GUI +# This file is for ADCs +# All lines containing "#" are treated as comments (ignored) +# Last line MUST be blank. +# Multiple spaces are treated as one space. +# To switch to log scale, add the option logy after the name of +# the histogram + +# Valid entries include: +# To create a new TCanvas with a set number of plots in it +# Specify with: newpage [x] [y] [TCanvas options] +# Tree drawing +# Specify with: +# Variable drawing +# Specify with: variables cuts -type [type] -title [title] -tree [tree name] +# Page title setting: +# Specify with: title Your Title Here +# Macro execution +# Specify with: macro path/to/macro.C(options) +# Additional options: +# -noshow golden + +# Default root file to look at +#rootfile pan.root +#goldenrootfile /adaq1/work1/apar/japanOutput/prexALL_1033.root +rootfile /adaq1/work1/apar/japanOutput/prexALL_1033.root +##rootfile /dev/shm/QwMemMapFile.map + +# Prototype rootfilename.. overrides GetRootFileName.C + ##protorootfile /adaql1/work1/parity/parity04_XXXXX_standard.root +#protorootfile /adaql1/work1/apar/ciprian/parity18_4416_standard.root + +# Defined cuts +definecut evcut (event_number>1) +definecut bcmds_cut (-1*bcm_ds>1) + +# Uncomment the below line to monitor the fill of a ROOTfile. +#watchfile + +newpage 1 2 + title Color Test + yield_bcm_us:yield_bcm_ds:(yield_bcm_us-yield_bcm_ds) ErrorFlag==0 -type * + macro ./macros/setPlotStyle.C() + yield_bcm_us:yield_bcm_ds:(yield_bcm_us-yield_bcm_ds) ErrorFlag==0 -type COLZ + +newpage 1 1 + title Noise Floor Test + macro ./macros/asymmetryPlot_modular.C("vqwk_26_0ch7") diff --git a/panguin/macros/japantypes.hh b/panguin/macros/japantypes.hh new file mode 100644 index 000000000..2bb7e6267 --- /dev/null +++ b/panguin/macros/japantypes.hh @@ -0,0 +1,10 @@ +// Define a new struct that will hold the individual leaves from the branch of interest +typedef struct { + Double_t hw_sum; + Double_t block0; + Double_t block1; + Double_t block2; + Double_t block3; + Double_t numsamp; + Double_t errorcode; +} PATTERNASYMS; From b2fde2317e245ecc8cd8508d15fe9d9988b34eed Mon Sep 17 00:00:00 2001 From: Wouter Deconinck Date: Mon, 4 Feb 2019 10:22:05 -0500 Subject: [PATCH 127/137] Added all header lines to test file --- Parity/prminput/adc18_beamline.map | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/Parity/prminput/adc18_beamline.map b/Parity/prminput/adc18_beamline.map index 2b2f89b91..ecedeb87f 100755 --- a/Parity/prminput/adc18_beamline.map +++ b/Parity/prminput/adc18_beamline.map @@ -4,42 +4,49 @@ ROC=23 adc18_buffer_offset=36 ! module.type, module.num, module.chan, det.type, det.name -ADC18, 0, -1, bcm, DAC0 +ADC18, 0, -1, bcm, DAC0 ADC18, 0, 0, bcm, ADC00 ADC18, 0, 1, bcm, ADC01 ADC18, 0, 2, bcm, ADC02 ADC18, 0, 3, bcm, ADC03 +ADC18, 1, -1, bcm, DAC1 ADC18, 1, 0, bcm, ADC10 ADC18, 1, 1, bcm, ADC11 ADC18, 1, 2, bcm, ADC12 ADC18, 1, 3, bcm, ADC13 +ADC18, 2, -1, bcm, DAC2 ADC18, 2, 0, bcm, ADC20 ADC18, 2, 1, bcm, ADC21 ADC18, 2, 2, bcm, ADC22 ADC18, 2, 3, bcm, ADC23 +ADC18, 3, -1, bcm, DAC3 ADC18, 3, 0, bcm, ADC30 ADC18, 3, 1, bcm, ADC31 ADC18, 3, 2, bcm, ADC32 ADC18, 3, 3, bcm, ADC33 +ADC18, 4, -1, bcm, DAC4 ADC18, 4, 0, bcm, ADC40 ADC18, 4, 1, bcm, ADC41 ADC18, 4, 2, bcm, ADC42 ADC18, 4, 3, bcm, ADC43 +ADC18, 5, -1, bcm, DAC5 ADC18, 5, 0, bcm, ADC50 ADC18, 5, 1, bcm, ADC51 ADC18, 5, 2, bcm, ADC52 ADC18, 5, 3, bcm, ADC53 +ADC18, 6, -1, bcm, DAC6 ADC18, 6, 0, bcm, ADC60 ADC18, 6, 1, bcm, ADC61 ADC18, 6, 2, bcm, ADC62 ADC18, 6, 3, bcm, ADC63 +ADC18, 7, -1, bcm, DAC7 ADC18, 7, 0, bcm, ADC70 ADC18, 7, 1, bcm, ADC71 ADC18, 7, 2, bcm, ADC72 From 2b5c8eaaf0e4b92d665ec72c4999fd2eaf9b4477 Mon Sep 17 00:00:00 2001 From: Paul King Date: Mon, 4 Feb 2019 14:36:03 -0500 Subject: [PATCH 128/137] Fixed inconsistent indentation in one place. --- Parity/main/QwParity.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Parity/main/QwParity.cc b/Parity/main/QwParity.cc index 86f256769..2988a5c48 100644 --- a/Parity/main/QwParity.cc +++ b/Parity/main/QwParity.cc @@ -90,7 +90,7 @@ Int_t main(Int_t argc, Char_t* argv[]) eventbuffer.ProcessOptions(gQwOptions); /// Create the database connection -#ifdef __USE_DATABASE__ + #ifdef __USE_DATABASE__ QwParityDB database(gQwOptions); #endif //__USE_DATABASE__ From af93d1bcc39ee063990ee97e3bed9b23deb8f922 Mon Sep 17 00:00:00 2001 From: Paul King Date: Mon, 4 Feb 2019 18:04:48 -0500 Subject: [PATCH 129/137] Updating macros - see sams.cfg for SAM noise floor calculations --- panguin/macros/asymmetryPlot_compile.C | 16 +++++-- panguin/macros/asymmetryPlot_wrapper.C | 15 +++++-- panguin/macros/japan_compiled_example.cfg | 13 +++++- panguin/macros/japan_example.cfg | 10 +++++ panguin/macros/japan_modular_example.cfg | 34 ++++++++++++--- panguin/macros/sams.cfg | 53 +++++++++++++++++++++++ 6 files changed, 128 insertions(+), 13 deletions(-) create mode 100644 panguin/macros/sams.cfg diff --git a/panguin/macros/asymmetryPlot_compile.C b/panguin/macros/asymmetryPlot_compile.C index efb13410e..4eb70adc2 100644 --- a/panguin/macros/asymmetryPlot_compile.C +++ b/panguin/macros/asymmetryPlot_compile.C @@ -29,8 +29,9 @@ int main(int argc, char **argv) { - std::string rootfile = "input.root"; + std::string rootfile = "run_1033.root"; std::string channel = "usr"; + //std::string number = "1111"; if (argc <= 1 || argc > 3) { std::cerr << "Usage: ./compTest char*:rootfileName char*:variable" << std::endl; @@ -46,16 +47,24 @@ int main(int argc, char **argv) std::string channelName(argv[2]); channel = channelName; } - - // To grab the root tree output we can assume that PANGUIN has successfully opened a root file + // number = parsed filename, so just the number part. + //int first = 0; + //int last = 99; + //first = rootfile.find("_"); + //last = rootfile.find("."); + //number = rootfile.substr(first+1,last-4).c_str(); + + // To grab the root tree output we can assume that PANGUIN has successfully opened a root file TFile *oldFile = new TFile(rootfile.c_str(),"READ"); TTree *oldPatternTree = (TTree*)oldFile->Get("Hel_Tree"); + TTree *oldEventTree = (TTree*)oldFile->Get("Mps_Tree"); std::string dir = (std::string)gDirectory->CurrentDirectory()->GetPath(); // Find out how many entries are in the tree so we can loop over the pattern tree later Int_t numEntries = oldPatternTree->GetEntries(); // Make a new ROOT tree to store the new data in (this is just an academic example) TTree *newPatternTree; TFile *resultsFile; + //std::string outputFile = Form("second_pass_%s_%s.root",number.c_str(),channel.c_str()); std::string outputFile = Form("second_pass_%s.root",channel.c_str()); // Check to see if analysis has been run before std::ifstream file(outputFile.c_str()); @@ -78,6 +87,7 @@ int main(int argc, char **argv) PATTERNASYMS patternAsyms; // Assign that instance to the new ROOT tree's branch location of interest oldPatternTree->SetBranchAddress( Form("asym_%s",channel.c_str()), &patternAsyms ); + oldPatternTree->SetBranchAddress( Form("asym_%s",channel.c_str()), &patternAsyms ); // Make a double to hold the data that is the result of our manipulation Double_t patternNoises; // call the asymmetry "noise", as an unblinded asym is also the noise floor diff --git a/panguin/macros/asymmetryPlot_wrapper.C b/panguin/macros/asymmetryPlot_wrapper.C index 60d84bf41..86f85cdf0 100644 --- a/panguin/macros/asymmetryPlot_wrapper.C +++ b/panguin/macros/asymmetryPlot_wrapper.C @@ -29,16 +29,24 @@ void asymmetryPlot_wrapper(std::string channel) { // To grab the root tree output we can assume that PANGUIN has successfully opened a root file TFile *oldFile = gFile; TTree *oldPatternTree = (TTree*)oldFile->Get("Hel_Tree"); - std::string dir = (std::string)gDirectory->CurrentDirectory()->GetPath(); + //std::string dir = (std::string)gDirectory->CurrentDirectory()->GetPath(); // Find out how many entries are in the tree so we can loop over the pattern tree later Int_t numEntries = oldPatternTree->GetEntries(); // Make a new ROOT tree to store the new data in (this is just an academic example) TTree *newPatternTree; TFile *resultsFile; + + //std::string number = "1111"; + + //number = dir.substr(dir.find("_")+1,4).c_str(); + //std::string outputFile = Form("second_pass_%s_%s.root",number.c_str(),channel.c_str()); std::string outputFile = Form("second_pass_%s.root",channel.c_str()); + //gSystem->Exec(Form("CURRENT_RUN=%s"),dir.substr(dir.find("_")+1,4).c_str()); + // Check to see if analysis has been run before - //gSystem->Exec(Form("./compTest %s %s",dir.c_str(),channel.c_str())); - gSystem->Exec(Form("./compTest test.root %s",channel.c_str())); + //gSystem->Exec(Form("ln -sf ${QW_ROOTFILES}/prex*%s.root run_%s.root",number.c_str(),number.c_str())); + //gSystem->Exec(Form("./compTest run_%s.root %s",number.c_str(),channel.c_str())); + gSystem->Exec(Form("./compTest run.root %s",channel.c_str())); if(gSystem->AccessPathName(outputFile.c_str())){ // Write a new root file for output resultsFile = new TFile(outputFile.c_str(),"RECREATE"); @@ -85,5 +93,6 @@ void asymmetryPlot_wrapper(std::string channel) { delete newPatternTree; resultsFile->Close(); delete resultsFile; + //delete dir; gFile=oldFile; } diff --git a/panguin/macros/japan_compiled_example.cfg b/panguin/macros/japan_compiled_example.cfg index 010f70f18..cfca5b5fc 100644 --- a/panguin/macros/japan_compiled_example.cfg +++ b/panguin/macros/japan_compiled_example.cfg @@ -12,7 +12,7 @@ # Tree drawing # Specify with: # Variable drawing -# Specify with: variables cuts -type [type] -title [title] -tree [tree name] +# Specify with: [variables] [cuts] -type [type] -title [title] -tree [tree name] # Page title setting: # Specify with: title Your Title Here # Macro execution @@ -49,3 +49,14 @@ newpage 2 2 macro ./macros/asymmetryPlot_wrapper.C("vqwk_26_0ch6") macro ./macros/asymmetryPlot_wrapper.C("vqwk_26_0ch5") macro ./macros/asymmetryPlot_wrapper.C("vqwk_26_0ch4") + +newpage 2 4 + title Noise Floor Test + macro ./macros/asymmetryPlot_wrapper.C("sam1") + macro ./macros/asymmetryPlot_wrapper.C("sam2") + macro ./macros/asymmetryPlot_wrapper.C("sam3") + macro ./macros/asymmetryPlot_wrapper.C("sam4") + macro ./macros/asymmetryPlot_wrapper.C("sam5") + macro ./macros/asymmetryPlot_wrapper.C("sam6") + macro ./macros/asymmetryPlot_wrapper.C("sam7") + macro ./macros/asymmetryPlot_wrapper.C("sam8") diff --git a/panguin/macros/japan_example.cfg b/panguin/macros/japan_example.cfg index e4c2621f1..428ac6cf3 100644 --- a/panguin/macros/japan_example.cfg +++ b/panguin/macros/japan_example.cfg @@ -68,3 +68,13 @@ newpage 2 4 asym_vqwk_25_0ch6-asym_dsl ErrorFlag==0&&asym_vqwk_25_0ch6.Device_Error_Code==0&&abs(asym_dsl)>1.0e-4 asym_vqwk_25_0ch7-asym_dsl ErrorFlag==0&&asym_vqwk_25_0ch7.Device_Error_Code==0&&abs(asym_dsl)>1.0e-4 +newpage 2 4 + title SAMs + asym_sam1 + asym_sam2 + asym_sam3 + asym_sam4 + asym_sam5 + asym_sam6 + asym_sam7 + asym_sam8 diff --git a/panguin/macros/japan_modular_example.cfg b/panguin/macros/japan_modular_example.cfg index 50b9bc0e0..7ca5045a2 100644 --- a/panguin/macros/japan_modular_example.cfg +++ b/panguin/macros/japan_modular_example.cfg @@ -37,12 +37,34 @@ definecut bcmds_cut (-1*bcm_ds>1) # Uncomment the below line to monitor the fill of a ROOTfile. #watchfile -newpage 1 2 - title Color Test - yield_bcm_us:yield_bcm_ds:(yield_bcm_us-yield_bcm_ds) ErrorFlag==0 -type * - macro ./macros/setPlotStyle.C() - yield_bcm_us:yield_bcm_ds:(yield_bcm_us-yield_bcm_ds) ErrorFlag==0 -type COLZ +newpage 1 1 + title Noise Floor Test + macro ./macros/asymmetryPlot_modular.C("sam1") + +newpage 1 1 + title Noise Floor Test + macro ./macros/asymmetryPlot_modular.C("sam2") + +newpage 1 1 + title Noise Floor Test + macro ./macros/asymmetryPlot_modular.C("sam3") + +newpage 1 1 + title Noise Floor Test + macro ./macros/asymmetryPlot_modular.C("sam4") + +newpage 1 1 + title Noise Floor Test + macro ./macros/asymmetryPlot_modular.C("sam5") + +newpage 1 1 + title Noise Floor Test + macro ./macros/asymmetryPlot_modular.C("sam6") + +newpage 1 1 + title Noise Floor Test + macro ./macros/asymmetryPlot_modular.C("sam7") newpage 1 1 title Noise Floor Test - macro ./macros/asymmetryPlot_modular.C("vqwk_26_0ch7") + macro ./macros/asymmetryPlot_modular.C("sam8") diff --git a/panguin/macros/sams.cfg b/panguin/macros/sams.cfg new file mode 100644 index 000000000..db49108db --- /dev/null +++ b/panguin/macros/sams.cfg @@ -0,0 +1,53 @@ +# Configuration file for the online GUI +# This file is for ADCs +# All lines containing "#" are treated as comments (ignored) +# Last line MUST be blank. +# Multiple spaces are treated as one space. +# To switch to log scale, add the option logy after the name of +# the histogram + +# Default root file to look at +#rootfile pan.root +rootfile /adaq1/work1/apar/japanOutput/prexALL_1098.root +##rootfile /adaq1/work1/apar/ciprian/parity18_4416_standard.root +##rootfile /dev/shm//QwMemMapFile.map + +# Prototype rootfilename.. overrides GetRootFileName.C + ##protorootfile /adaql1/work1/parity/parity04_XXXXX_standard.root +#protorootfile /adaql1/work1/apar/ciprian/parity18_4416_standard.root + +# Defined cuts +definecut evcut (pattern_number>1) +definecut cuts (event_number>1) +definecut bcmds_cut (-1*bcm_ds>1) + +# Uncomment the below line to monitor the fill of a ROOTfile. +#watchfile + +newpage 1 3 + title SAMs test + sam1>>g1(100,-0.0112,-0.0108) cuts -tree Mps_Tree -title Volts + sam1:event_number>>g2(2500,0,2500,100,-0.0112,-0.0108) cuts -tree Mps_Tree -type * -title Volts vs Event + asym_sam1*yield_sam1/7 -title PPM noise floor at max 7V signal + +newpage 2 4 + title SAMs PPM noise floor at max 7V signal + asym_sam1*yield_sam1/7>>h1(100,-1e-5,1e-5) evcut -tree Hel_Tree + asym_sam2*yield_sam2/7>>h2(100,-1e-5,1e-5) evcut -tree Hel_Tree + asym_sam3*yield_sam3/7>>h3(100,-1e-5,1e-5) evcut -tree Hel_Tree + asym_sam4*yield_sam4/7>>h4(100,-1e-5,1e-5) evcut -tree Hel_Tree + asym_sam5*yield_sam5/7>>h5(100,-1e-5,1e-5) evcut -tree Hel_Tree + asym_sam6*yield_sam6/7>>h6(100,-1e-5,1e-5) evcut -tree Hel_Tree + asym_sam7*yield_sam7/7>>h7(100,-1e-5,1e-5) evcut -tree Hel_Tree + asym_sam8*yield_sam8/7>>h8(100,-1e-5,1e-5) evcut -tree Hel_Tree + +newpage 2 4 + title SAMs (PPM noise floor at max 7V signal) correlations w.r.t. SAM 1 + asym_sam1*yield_sam1/7:asym_sam1*yield_sam1/7>>j1(100,-1e-5,1e-5,100,-1e-5,1e-5) evcut -tree Hel_Tree -type . + asym_sam2*yield_sam2/7:asym_sam1*yield_sam1/7>>j2(100,-1e-5,1e-5,100,-1e-5,1e-5) evcut -tree Hel_Tree -type . + asym_sam3*yield_sam3/7:asym_sam1*yield_sam1/7>>j3(100,-1e-5,1e-5,100,-1e-5,1e-5) evcut -tree Hel_Tree -type . + asym_sam4*yield_sam4/7:asym_sam1*yield_sam1/7>>j4(100,-1e-5,1e-5,100,-1e-5,1e-5) evcut -tree Hel_Tree -type . + asym_sam5*yield_sam5/7:asym_sam1*yield_sam1/7>>j5(100,-1e-5,1e-5,100,-1e-5,1e-5) evcut -tree Hel_Tree -type . + asym_sam6*yield_sam6/7:asym_sam1*yield_sam1/7>>j6(100,-1e-5,1e-5,100,-1e-5,1e-5) evcut -tree Hel_Tree -type . + asym_sam7*yield_sam7/7:asym_sam1*yield_sam1/7>>j7(100,-1e-5,1e-5,100,-1e-5,1e-5) evcut -tree Hel_Tree -type . + asym_sam8*yield_sam8/7:asym_sam1*yield_sam1/7>>j8(100,-1e-5,1e-5,100,-1e-5,1e-5) evcut -tree Hel_Tree -type . From 944a65902460957523cd4bd41c64fa58e514c408 Mon Sep 17 00:00:00 2001 From: Wouter Deconinck Date: Mon, 4 Feb 2019 10:23:13 -0500 Subject: [PATCH 130/137] ADC18: save diff, peak, base, then turn into raw, then turn into value --- Analysis/include/QwADC18_Channel.h | 11 +++-- Analysis/src/QwADC18_Channel.cc | 71 +++++++++++++++++++++--------- 2 files changed, 58 insertions(+), 24 deletions(-) diff --git a/Analysis/include/QwADC18_Channel.h b/Analysis/include/QwADC18_Channel.h index c712abce5..7bce1a523 100755 --- a/Analysis/include/QwADC18_Channel.h +++ b/Analysis/include/QwADC18_Channel.h @@ -10,14 +10,12 @@ // System headers #include -// ROOT headers -#include "TTree.h" - // Qweak headers #include "VQwHardwareChannel.h" #include "MQwMockable.h" // Forward declarations +class TTree; class QwBlinder; class QwParameterFile; #ifdef __USE_DATABASE__ @@ -239,7 +237,11 @@ class QwADC18_Channel: public VQwHardwareChannel, public MQwMockable { QwADC18_Channel& operator/= (const QwADC18_Channel &value); private: + UInt_t fDiff_Raw; + UInt_t fBase_Raw; + UInt_t fPeak_Raw; UInt_t fValue_Raw; + Double_t fValue; Double_t fValueM2; Double_t fValueError; @@ -253,6 +255,9 @@ class QwADC18_Channel: public VQwHardwareChannel, public MQwMockable { /// Pointer to the running sum for this channel QwADC18_Channel* fRunningSum; + /// Pointer to the DAC channel for this channel + QwADC18_Channel* fDAC; + /*! \name ADC Calibration */ // @{ static const Double_t kADC18_VoltsPerBit; diff --git a/Analysis/src/QwADC18_Channel.cc b/Analysis/src/QwADC18_Channel.cc index df464a9a6..04ba18712 100755 --- a/Analysis/src/QwADC18_Channel.cc +++ b/Analysis/src/QwADC18_Channel.cc @@ -3,6 +3,9 @@ // System headers #include +// ROOT headers +#include + // Qweak headers #include "QwLog.h" #include "QwUnits.h" @@ -201,7 +204,9 @@ void QwADC18_Channel::LoadChannelParameters(QwParameterFile ¶mfile){ void QwADC18_Channel::ClearEventData() { - fValue_Raw = 0; + fDiff_Raw = 0; + fBase_Raw = 0; + fPeak_Raw = 0; fValue = 0.0; fValueM2 = 0.0; fValueError = 0.0; @@ -243,7 +248,9 @@ void QwADC18_Channel::SmearByResolution(double resolution) void QwADC18_Channel::SetEventData(Double_t value) { fValue = value; - fValue_Raw = (UInt_t)value; + fDiff_Raw = (UInt_t) value; + fPeak_Raw = (UInt_t) value; + fBase_Raw = (UInt_t) 0; fSequenceNumber = 0; fNumberOfSamples = fNumberOfSamples_map; } @@ -251,7 +258,8 @@ void QwADC18_Channel::SetEventData(Double_t value) void QwADC18_Channel::SetRawEventData() { fNumberOfSamples = fNumberOfSamples_map; - fValue_Raw = Int_t(fValue / fCalibrationFactor + fPedestal) * fNumberOfSamples; + fDiff_Raw = Int_t(fValue / fCalibrationFactor + fPedestal) * fNumberOfSamples; + fPeak_Raw = Int_t(fValue / fCalibrationFactor + fPedestal) * fNumberOfSamples; }; // FIXME here goes the encoding of raw data into CODA blocks @@ -284,7 +292,7 @@ void QwADC18_Channel::EncodeEventData(std::vector &buffer) case 1: case 2: localbuf[0] |= mask2422x & (2 << 22); - localbuf[0] |= mask170x & fValue_Raw; + localbuf[0] |= mask170x & fPeak_Raw; break; case 4: break; @@ -318,6 +326,7 @@ Int_t QwADC18_Channel::ProcessDataWord(UInt_t rawd) ((rawd & mask2118x) >> 18) : 0; // Interpret by data type + UInt_t value_raw = 0; switch (act_dtype) { case 0: static UInt_t prev_dvalue = act_dvalue; @@ -325,9 +334,10 @@ Int_t QwADC18_Channel::ProcessDataWord(UInt_t rawd) QwError << "QwADC18_Channel::ProcessEvBuffer: Number of samples changed" << QwLog::endl; return 0; } - fValue_Raw = rawd & mask200x; - if (rawd & mask21x) fValue_Raw = -((~fValue_Raw & 0x1fffffff) + 1); + value_raw = rawd & mask200x; + if (rawd & mask21x) value_raw = -((~value_raw & 0x1fffffff) + 1); fNumberOfSamples = (1 << act_dvalue); + return value_raw; break; case 1: case 2: @@ -339,21 +349,19 @@ Int_t QwADC18_Channel::ProcessDataWord(UInt_t rawd) QwError << "QwADC18_Channel::ProcessEvBuffer: Divider value non-zero" << QwLog::endl; return 0; } - fValue_Raw = rawd & mask170x; + return rawd & mask170x; break; case 4: if (act_dvalue != 0) { QwError << "QwADC18_Channel::ProcessEvBuffer: Divider value non-zero" << QwLog::endl; return 0; } - fValue_Raw = rawd & mask150x; + return rawd & mask150x; break; default: QwError << "QwADC18_Channel::ProcessEvBuffer: Unknown data type" << QwLog::endl; return 0; } - - return fValue_Raw; } // FIXME here goes the decoding of raw data from CODA blocks @@ -387,10 +395,9 @@ Int_t QwADC18_Channel::ProcessEvBuffer(UInt_t* buffer, UInt_t num_words_left, UI return kHeaderWordsPerModule; } - fValue_Raw = ProcessDataWord(buffer[0]); - fValue_Raw = ProcessDataWord(buffer[1]); - fValue_Raw = ProcessDataWord(buffer[2]); - fValue = fCalibrationFactor * (Double_t(fValue_Raw) - fPedestal); + fDiff_Raw = ProcessDataWord(buffer[0]); + fPeak_Raw = ProcessDataWord(buffer[1]); + fBase_Raw = ProcessDataWord(buffer[2]); words_read = kDataWordsPerChannel; } else { @@ -403,7 +410,7 @@ Int_t QwADC18_Channel::ProcessEvBuffer(UInt_t* buffer, UInt_t num_words_left, UI void QwADC18_Channel::ProcessEvent() { - if (fNumberOfSamples == 0 && fValue_Raw == 0) { + if (fNumberOfSamples == 0 && fDiff_Raw == 0) { // There isn't valid data for this channel. Just flag it and move on. fValue = 0.0; fValueM2 = 0.0; @@ -419,7 +426,7 @@ void QwADC18_Channel::ProcessEvent() fValueM2 = 0.0; fErrorFlag |= kErrorFlag_sample; } else { - fValue = fCalibrationFactor * ( (Double_t(fValue_Raw) / fNumberOfSamples) - fPedestal ); + fValue = fCalibrationFactor * ( (Double_t(fDiff_Raw) / fNumberOfSamples) - fPedestal ); fValueM2 = 0.0; // second moment is zero for single events } } @@ -439,7 +446,9 @@ void QwADC18_Channel::PrintInfo() const QwMessage<<"fCalibrationFactor= "< &values) const values[index++] = this->fErrorFlag; if(fDataToSave==kRaw){ values[index++] = this->fValue_Raw; + values[index++] = this->fDiff_Raw; + values[index++] = this->fPeak_Raw; + values[index++] = this->fBase_Raw; } } } @@ -581,6 +599,9 @@ QwADC18_Channel& QwADC18_Channel::operator= (const QwADC18_Channel &value) if (!IsNameEmpty()) { VQwHardwareChannel::operator=(value); + this->fDiff_Raw = value.fDiff_Raw; + this->fPeak_Raw = value.fPeak_Raw; + this->fBase_Raw = value.fBase_Raw; this->fValue_Raw = value.fValue_Raw; this->fValue = value.fValue; this->fValueError = value.fValueError; @@ -710,7 +731,9 @@ QwADC18_Channel& QwADC18_Channel::operator*= (const QwADC18_Channel &value) { if (!IsNameEmpty()){ this->fValue *= value.fValue; - this->fValue_Raw = 0; + this->fDiff_Raw = 0; + this->fPeak_Raw = 0; + this->fBase_Raw = 0; this->fValueM2 = 0.0; this->fErrorFlag |= (value.fErrorFlag);//error code is ORed. } @@ -797,7 +820,9 @@ void QwADC18_Channel::Ratio(const QwADC18_Channel &numer, const QwADC18_Channel *this /= denom; // Set the raw values to zero. - fValue_Raw = 0; + fDiff_Raw = 0; + fPeak_Raw = 0; + fBase_Raw = 0; // Remaining variables fGoodEventCount = denom.fGoodEventCount; @@ -860,7 +885,9 @@ void QwADC18_Channel::Product(const QwADC18_Channel &value1, const QwADC18_Chann { if (!IsNameEmpty()){ fValue = value1.fValue * value2.fValue; - fValue_Raw = 0; + fDiff_Raw = 0; + fPeak_Raw = 0; + fBase_Raw = 0; // Remaining variables fGoodEventCount = value2.fGoodEventCount; @@ -1180,7 +1207,9 @@ void QwADC18_Channel::ScaledAdd(Double_t scale, const VQwHardwareChannel *value) // << QwLog::endl; // PrintValue(); // input->PrintValue(); - this->fValue_Raw = 0; + this->fDiff_Raw = 0; + this->fPeak_Raw = 0; + this->fBase_Raw = 0; this->fValue += scale * input->fValue; this->fValueM2 = 0.0; this->fNumberOfSamples += input->fNumberOfSamples; From a73d3a3ff1838613d94ced97f8e96e6b6d093815 Mon Sep 17 00:00:00 2001 From: Wouter Deconinck Date: Tue, 5 Feb 2019 09:34:42 -0500 Subject: [PATCH 131/137] Make ADC18 bit masks static const --- Analysis/include/QwADC18_Channel.h | 12 +++++++++++ Analysis/src/QwADC18_Channel.cc | 33 +++++++++++------------------- 2 files changed, 24 insertions(+), 21 deletions(-) diff --git a/Analysis/include/QwADC18_Channel.h b/Analysis/include/QwADC18_Channel.h index 7bce1a523..430c579c8 100755 --- a/Analysis/include/QwADC18_Channel.h +++ b/Analysis/include/QwADC18_Channel.h @@ -252,6 +252,18 @@ class QwADC18_Channel: public VQwHardwareChannel, public MQwMockable { static const Int_t kDataWordsPerChannel; //no.of data words per channel in the CODA buffer static const Int_t kMaxChannels; //no.of channels per module + private: + static const UInt_t mask31x; // = 0x80000000; // Header bit mask + static const UInt_t mask3029x; // = 0x60000000; // Channel number mask + static const UInt_t mask2625x; // = 0x06000000; // Divider value mask + static const UInt_t mask2422x; // = 0x01c00000; // Data type mask + static const UInt_t mask21x; // = 0x00200000; // Data type 0 value sign mask + static const UInt_t mask200x; // = 0x001fffff; // Data type 0 value field mask + static const UInt_t mask2118x; // = 0x003c0000; // Data types 1-2 sample number mask + static const UInt_t mask170x; // = 0x0003ffff; // Data types 1-2 value field mask + static const UInt_t mask150x; // = 0x0000ffff; // Data type 4 value field mask + + /// Pointer to the running sum for this channel QwADC18_Channel* fRunningSum; diff --git a/Analysis/src/QwADC18_Channel.cc b/Analysis/src/QwADC18_Channel.cc index 04ba18712..bb198b2ee 100755 --- a/Analysis/src/QwADC18_Channel.cc +++ b/Analysis/src/QwADC18_Channel.cc @@ -21,6 +21,18 @@ const Int_t QwADC18_Channel::kHeaderWordsPerModule = 13; const Int_t QwADC18_Channel::kDataWordsPerChannel = 3; const Int_t QwADC18_Channel::kMaxChannels = 4; +const UInt_t QwADC18_Channel::mask31x = 0x80000000; // Header bit mask +const UInt_t QwADC18_Channel::mask3029x = 0x60000000; // Channel number mask +const UInt_t QwADC18_Channel::mask2625x = 0x06000000; // Divider value mask +const UInt_t QwADC18_Channel::mask2422x = 0x01c00000; // Data type mask +const UInt_t QwADC18_Channel::mask21x = 0x00200000; // Data type 0 value sign mask +const UInt_t QwADC18_Channel::mask200x = 0x001fffff; // Data type 0 value field mask +const UInt_t QwADC18_Channel::mask2118x = 0x003c0000; // Data types 1-2 sample number mask +const UInt_t QwADC18_Channel::mask170x = 0x0003ffff; // Data types 1-2 value field mask +const UInt_t QwADC18_Channel::mask150x = 0x0000ffff; // Data type 4 value field mask + + + const Double_t QwADC18_Channel::kTimePerSample = 2.0 * Qw::us; // FIXME /*! Conversion factor to translate the average bit count in an ADC @@ -265,16 +277,6 @@ void QwADC18_Channel::SetRawEventData() // FIXME here goes the encoding of raw data into CODA blocks void QwADC18_Channel::EncodeEventData(std::vector &buffer) { - UInt_t mask31x = 0x80000000; // Header bit mask - UInt_t mask3029x = 0x60000000; // Channel number mask - UInt_t mask2625x = 0x06000000; // Divider value mask - UInt_t mask2422x = 0x01c00000; // Data type mask - UInt_t mask21x = 0x00200000; // Data type 0 value sign mask - UInt_t mask200x = 0x001fffff; // Data type 0 value field mask - UInt_t mask2118x = 0x003c0000; // Data types 1-2 sample number mask - UInt_t mask170x = 0x0003ffff; // Data types 1-2 value field mask - UInt_t mask150x = 0x0000ffff; // Data type 4 value field mask - UInt_t localbuf[kDataWordsPerChannel] = {0}; if (IsNameEmpty()) { @@ -308,15 +310,6 @@ void QwADC18_Channel::EncodeEventData(std::vector &buffer) Int_t QwADC18_Channel::ProcessDataWord(UInt_t rawd) { - UInt_t mask3029x = 0x60000000; // Channel number mask - UInt_t mask2625x = 0x06000000; // Divider value mask - UInt_t mask2422x = 0x01c00000; // Data type mask - UInt_t mask21x = 0x00200000; // Data type 0 value sign mask - UInt_t mask200x = 0x001fffff; // Data type 0 value field mask - UInt_t mask2118x = 0x003c0000; // Data types 1-2 sample number mask - UInt_t mask170x = 0x0003ffff; // Data types 1-2 value field mask - UInt_t mask150x = 0x0000ffff; // Data type 4 value field mask - // "Actual" values from data word UInt_t act_dtype = (rawd & mask2422x) >> 22; UInt_t act_chan = (act_dtype != 4) ? @@ -378,8 +371,6 @@ Int_t QwADC18_Channel::ProcessEvBuffer(UInt_t* buffer, UInt_t num_words_left, UI QwOut << std::dec << std::setfill(' ') << std::setw(0) << QwLog::endl; } - UInt_t mask31x = 0x80000000; // Header bit mask - UInt_t words_read = 0; if (IsNameEmpty()){ // This channel is not used, but is present in the data stream. From c9678fd859fa04046393ed88b5a079eb35b41651 Mon Sep 17 00:00:00 2001 From: Paul King Date: Tue, 5 Feb 2019 13:07:48 -0500 Subject: [PATCH 132/137] The helicity-toggle option in JAPAN still assumes that the Helicity input register data matters, when in fact it should just ignore it and only go by event number even/odd for its asymmetry calculation --- Parity/prminput/prex_pair.conf | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) create mode 100644 Parity/prminput/prex_pair.conf diff --git a/Parity/prminput/prex_pair.conf b/Parity/prminput/prex_pair.conf new file mode 100644 index 000000000..1c6229fcd --- /dev/null +++ b/Parity/prminput/prex_pair.conf @@ -0,0 +1,30 @@ +# This configuration file is used to generate +# a ROOT file for injector beam studies +# +# To Run +# qwparity -r 5900 -c injector.conf +# +# Friday, January 7 22:53:34 EDT 2011 +# +add-config = prexbankflag.conf + +detectors = prex_detectors.map +chainfiles = no +single-output-file = yes +enable-tree-trim = no +disable-hel-tree = no +disable-histos = no +rootfile-stem = prexALL_ +codafile-stem = parity_ALL_ +codafile-ext = dat + +ring.size = 200 +ring.stability_cut = -1 + +enable-differences = 1 + +QwDetectorArray.normalize = 0 +QwBlindDetectorArray.normalize = 0 + +helicity.toggle-mode = 1 + From 0cce610d008b064b7ed73f6fa0b6552cb8947f1e Mon Sep 17 00:00:00 2001 From: Paul King Date: Tue, 5 Feb 2019 17:47:36 -0500 Subject: [PATCH 133/137] Updating .map files with new unser placed in 4th (of 5) CH ADCs and modified sync test scalers --- Parity/prminput/prexCH_beamline.1194-.map | 65 +++++++++++++++++++++++ Parity/prminput/prexCH_scaler.1194-.map | 9 ++++ Parity/prminput/prex_scaler.1194-.map | 21 ++++++++ 3 files changed, 95 insertions(+) create mode 100644 Parity/prminput/prexCH_beamline.1194-.map create mode 100644 Parity/prminput/prexCH_scaler.1194-.map create mode 100644 Parity/prminput/prex_scaler.1194-.map diff --git a/Parity/prminput/prexCH_beamline.1194-.map b/Parity/prminput/prexCH_beamline.1194-.map new file mode 100644 index 000000000..9196e9036 --- /dev/null +++ b/Parity/prminput/prexCH_beamline.1194-.map @@ -0,0 +1,65 @@ + +ROC=23 +Bank=0x05 +vqwk_buffer_offset = 1 +!same sample size for ADCs in a given bank +sample_size=16564 +!Sample size should be unchanged - ask Paul King +! +! module.type, module.num chan.num, det.type, det.name, if unrotated then last column ->UNROTATED + + +!ADC0 + VQWK, 0, 0, bcm, QWK_0_0 + VQWK, 0, 1, bcm, QWK_0_1 + VQWK, 0, 2, bcm, BCM_US + VQWK, 0, 3, bcm, BCM_DS + VQWK, 0, 4, bcm, QWK_0_4 + VQWK, 0, 5, bcm, QWK_0_5 + VQWK, 0, 6, bcm, QWK_0_6 + VQWK, 0, 7, bcm, QWK_0_7 + +!ADC1 + VQWK, 1, 0, bpmstripline, BPM4Exp + VQWK, 1, 1, bpmstripline, BPM4Exm + VQWK, 1, 2, bpmstripline, BPM4Eyp + VQWK, 1, 3, bpmstripline, BPM4Eym + VQWK, 1, 4, bcm, QWK_1_4 + VQWK, 1, 5, bcm, QWK_1_5 + VQWK, 1, 6, bcm, QWK_1_6 + VQWK, 1, 7, bcm, QWK_1_7 + +!ADC2 + VQWK, 2, 0, bcm, QWK_2_0 + VQWK, 2, 1, bcm, QWK_2_1 + VQWK, 2, 2, bcm, QWK_2_2 + VQWK, 2, 3, bcm, QWK_2_3 + VQWK, 2, 4, bpmstripline, BPM4Axp + VQWK, 2, 5, bpmstripline, BPM4Axm + VQWK, 2, 6, bpmstripline, BPM4Ayp + VQWK, 2, 7, bpmstripline, BPM4Aym + +!ADC3 + VQWK, 3, 0, bcm, CAV4BX + VQWK, 3, 1, bcm, CAV4BY + VQWK, 3, 2, bcm, CAV4BQ + VQWK, 3, 3, bcm, QWK_3_3 + VQWK, 3, 4, bcm, CAV4CX + VQWK, 3, 5, bcm, CAV4CY + VQWK, 3, 6, bcm, CAV4CQ + VQWK, 3, 7, bcm, unser + +!ADC4 + VQWK, 4, 0, bcm, CAV4DX + VQWK, 4, 1, bcm, CAV4DY + VQWK, 4, 2, bcm, CAV4DQ + VQWK, 4, 3, bcm, QWK_4_3 + VQWK, 4, 4, bcm, QWK_4_4 + VQWK, 4, 5, bcm, QWK_4_5 + VQWK, 4, 6, bcm, QWK_4_6 + VQWK, 4, 7, bcm, QWK_4_7 + + +[PUBLISH] +! new.tree.variable.name, analysis.class, old.tree.variable.name, element.to.store + q_targ, bcm, bcm_us, c diff --git a/Parity/prminput/prexCH_scaler.1194-.map b/Parity/prminput/prexCH_scaler.1194-.map new file mode 100644 index 000000000..2ed2fd09d --- /dev/null +++ b/Parity/prminput/prexCH_scaler.1194-.map @@ -0,0 +1,9 @@ +ROC=23 +bank=0x2 +! module.type module.num chan.num, det.type, det.name + SIS3801D32, 0, 0, bmwscal, bmwscal + SIS3801D32, 0, 16, syncscal, chouse_fr + SIS3801D32, 0, 17, syncscal, chouse_f1 + SIS3801D32, 0, 18, syncscal, chouse_f2 + SIS3801D32, 0, 31, syncscal, clock_4mhz + diff --git a/Parity/prminput/prex_scaler.1194-.map b/Parity/prminput/prex_scaler.1194-.map new file mode 100644 index 000000000..94039682a --- /dev/null +++ b/Parity/prminput/prex_scaler.1194-.map @@ -0,0 +1,21 @@ +ROC=23 +bank=0x2 +! module.type module.num chan.num, det.type, det.name + SIS3801D32, 0, 16, syncscal, chouse_fr + SIS3801D32, 0, 17, syncscal, chouse_f1 + SIS3801D32, 0, 18, syncscal, chouse_f2 + SIS3801D32, 0, 31, syncscal, clock_4mhz + +ROC=25 +bank=0x2 +! module.type module.num chan.num, det.type, det.name + SIS3801D32, 0, 30, syncscal, lhrs_f1 + SIS3801D32, 0, 31, syncscal, lhrs_f2 + +ROC=26 +bank=0x2 +! module.type module.num chan.num, det.type, det.name + SIS3801D32, 0, 30, syncscal, rhrs_f1 + SIS3801D32, 0, 31, syncscal, rhrs_f2 + +!!! Also should be scalers in the injector... From a3389ad86b82752398bc51d7c5999051504f5473 Mon Sep 17 00:00:00 2001 From: Wouter Deconinck Date: Wed, 6 Feb 2019 09:56:49 -0500 Subject: [PATCH 134/137] Rename ADC18 test pedestal file No more missing gain or pedestal error counters... --- Parity/prminput/adc18_beamline_pedestal.map | 47 +++++++++++++++++++++ Parity/prminput/adc18_detectors.map | 2 +- Parity/prminput/adc18_pedestal.map | 4 -- 3 files changed, 48 insertions(+), 5 deletions(-) create mode 100644 Parity/prminput/adc18_beamline_pedestal.map delete mode 100755 Parity/prminput/adc18_pedestal.map diff --git a/Parity/prminput/adc18_beamline_pedestal.map b/Parity/prminput/adc18_beamline_pedestal.map new file mode 100644 index 000000000..872ec1f7d --- /dev/null +++ b/Parity/prminput/adc18_beamline_pedestal.map @@ -0,0 +1,47 @@ +DAC0,0.0,1.0 +ADC00,0.0,1.0 +ADC01,0.0,1.0 +ADC02,0.0,1.0 +ADC03,0.0,1.0 + +DAC1,0.0,1.0 +ADC10,0.0,1.0 +ADC11,0.0,1.0 +ADC12,0.0,1.0 +ADC13,0.0,1.0 + +DAC2,0.0,1.0 +ADC20,0.0,1.0 +ADC21,0.0,1.0 +ADC22,0.0,1.0 +ADC23,0.0,1.0 + +DAC3,0.0,1.0 +ADC30,0.0,1.0 +ADC31,0.0,1.0 +ADC32,0.0,1.0 +ADC33,0.0,1.0 + +DAC4,0.0,1.0 +ADC40,0.0,1.0 +ADC41,0.0,1.0 +ADC42,0.0,1.0 +ADC43,0.0,1.0 + +DAC5,0.0,1.0 +ADC50,0.0,1.0 +ADC51,0.0,1.0 +ADC52,0.0,1.0 +ADC53,0.0,1.0 + +DAC6,0.0,1.0 +ADC60,0.0,1.0 +ADC61,0.0,1.0 +ADC62,0.0,1.0 +ADC63,0.0,1.0 + +DAC7,0.0,1.0 +ADC70,0.0,1.0 +ADC71,0.0,1.0 +ADC72,0.0,1.0 +ADC73,0.0,1.0 diff --git a/Parity/prminput/adc18_detectors.map b/Parity/prminput/adc18_detectors.map index 1d4f531d5..c6d520caa 100755 --- a/Parity/prminput/adc18_detectors.map +++ b/Parity/prminput/adc18_detectors.map @@ -1,4 +1,4 @@ [QwBeamLine] name = Beamline map = adc18_beamline.map -param = adc18_pedestal.map +param = adc18_beamline_pedestal.map diff --git a/Parity/prminput/adc18_pedestal.map b/Parity/prminput/adc18_pedestal.map deleted file mode 100755 index da79c4dbc..000000000 --- a/Parity/prminput/adc18_pedestal.map +++ /dev/null @@ -1,4 +0,0 @@ -ADC0 0.000000 1.000000 -ADC1 0.000000 1.000000 -ADC2 0.000000 1.000000 -ADC3 0.000000 1.000000 From 3c26b2304e254fc22714c186e4c52b27dd72eae5 Mon Sep 17 00:00:00 2001 From: Wouter Deconinck Date: Wed, 6 Feb 2019 12:29:18 -0500 Subject: [PATCH 135/137] Accept negative channel number Ugh but easiest to get header to work. --- Parity/src/QwBeamDetectorID.cc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Parity/src/QwBeamDetectorID.cc b/Parity/src/QwBeamDetectorID.cc index 48160bb7e..5702fd1d8 100755 --- a/Parity/src/QwBeamDetectorID.cc +++ b/Parity/src/QwBeamDetectorID.cc @@ -33,8 +33,8 @@ QwBeamDetectorID::QwBeamDetectorID(Int_t subbankid, { Int_t modnum, channum; fmoduletype = paramfile.GetTypedNextToken(); - modnum = paramfile.GetTypedNextToken(); //slot number - channum = paramfile.GetTypedNextToken(); //channel number + modnum = paramfile.GetTypedNextToken(); //slot number + channum = paramfile.GetTypedNextToken(); //channel number fdetectortype = paramfile.GetTypedNextToken(); //type-purpose of the detector fChannelName = paramfile.GetTypedNextToken(); //name of the detector fmoduletype.ToUpper(); From 71a2f8c8a43294479b8fd060817e213cc0e6d5d7 Mon Sep 17 00:00:00 2001 From: Wouter Deconinck Date: Wed, 6 Feb 2019 12:30:13 -0500 Subject: [PATCH 136/137] Added module footer and bank header and footer size This now reads all values in 3970 and writes to ROOT file. DAC not connected to ADC channels yet. --- Analysis/include/QwADC18_Channel.h | 4 + Analysis/src/QwADC18_Channel.cc | 136 +++++++++++++++++++++-------- 2 files changed, 102 insertions(+), 38 deletions(-) diff --git a/Analysis/include/QwADC18_Channel.h b/Analysis/include/QwADC18_Channel.h index 430c579c8..5f9bfa60c 100755 --- a/Analysis/include/QwADC18_Channel.h +++ b/Analysis/include/QwADC18_Channel.h @@ -111,6 +111,7 @@ class QwADC18_Channel: public VQwHardwareChannel, public MQwMockable { void EncodeEventData(std::vector &buffer); /// Decode the event data from a CODA buffer + Bool_t IsHeaderWord(UInt_t word) const; Int_t ProcessDataWord(UInt_t word); Int_t ProcessEvBuffer(UInt_t* buffer, UInt_t num_words_left, UInt_t index = 0); @@ -248,7 +249,10 @@ class QwADC18_Channel: public VQwHardwareChannel, public MQwMockable { private: static const Bool_t kDEBUG; + static const Int_t kHeaderWordsPerBank; //no.of header words per bank in the CODA buffer + static const Int_t kFooterWordsPerBank; //no.of footer words per bank in the CODA buffer static const Int_t kHeaderWordsPerModule; //no.of header words per module in the CODA buffer + static const Int_t kFooterWordsPerModule; //no.of footer words per module in the CODA buffer static const Int_t kDataWordsPerChannel; //no.of data words per channel in the CODA buffer static const Int_t kMaxChannels; //no.of channels per module diff --git a/Analysis/src/QwADC18_Channel.cc b/Analysis/src/QwADC18_Channel.cc index bb198b2ee..2bab2fe57 100755 --- a/Analysis/src/QwADC18_Channel.cc +++ b/Analysis/src/QwADC18_Channel.cc @@ -17,7 +17,10 @@ const Bool_t QwADC18_Channel::kDEBUG = kFALSE; -const Int_t QwADC18_Channel::kHeaderWordsPerModule = 13; +const Int_t QwADC18_Channel::kHeaderWordsPerBank = 1; +const Int_t QwADC18_Channel::kFooterWordsPerBank = 1; +const Int_t QwADC18_Channel::kHeaderWordsPerModule = 12; +const Int_t QwADC18_Channel::kFooterWordsPerModule = 1; const Int_t QwADC18_Channel::kDataWordsPerChannel = 3; const Int_t QwADC18_Channel::kMaxChannels = 4; @@ -46,28 +49,38 @@ const Double_t QwADC18_Channel::kADC18_VoltsPerBit = (20./(1<<18)); // FIXME /*! Static member function to return the word offset within a data buffer * given the module number index and the channel number index. * @param moduleindex Module index within this buffer; counts from zero - * @param channelindex Channel index within this module; counts from zero + * @param channelindex Channel index within this module; counts from -1 (header) * @return The number of words offset to the beginning of this * channel's data from the beginning of the ADC18 buffer. */ -Int_t QwADC18_Channel::GetBufferOffset(Int_t moduleindex, Int_t channelindex){ - Int_t offset = -1; - if (moduleindex<0 ){ - QwError << "QwADC18_Channel::GetBufferOffset: Invalid module index," - << moduleindex - << ". Must be zero or greater." - << QwLog::endl; - } else if (channelindex<0 || channelindex>kMaxChannels){ - QwError << "QwADC18_Channel::GetBufferOffset: Invalid channel index," - << channelindex - << ". Must be in range [0," << kMaxChannels << "]." - << QwLog::endl; +Int_t QwADC18_Channel::GetBufferOffset(Int_t moduleindex, Int_t channelindex) +{ + Int_t offset = -1; + if (moduleindex<0 ){ + QwError << "QwADC18_Channel::GetBufferOffset: Invalid module index," + << moduleindex + << ". Must be zero or greater." + << QwLog::endl; + } else if (channelindex<-1 || channelindex>kMaxChannels){ + QwError << "QwADC18_Channel::GetBufferOffset: Invalid channel index," + << channelindex + << ". Must be in range [-1," << kMaxChannels << "]." + << QwLog::endl; + } else { + if (channelindex == -1) { + // Header + offset = kHeaderWordsPerBank + + moduleindex * (kHeaderWordsPerModule + kMaxChannels * kDataWordsPerChannel + kFooterWordsPerModule); } else { - offset = moduleindex * (kHeaderWordsPerModule + kMaxChannels * kDataWordsPerChannel) - + kHeaderWordsPerModule + channelindex * kDataWordsPerChannel; + // Data word + offset = kHeaderWordsPerBank + + moduleindex * (kHeaderWordsPerModule + kMaxChannels * kDataWordsPerChannel + kFooterWordsPerModule) + + kHeaderWordsPerModule + + channelindex * kDataWordsPerChannel; } - return offset; } + return offset; +} /********************************************************/ @@ -308,6 +321,11 @@ void QwADC18_Channel::EncodeEventData(std::vector &buffer) } } +Bool_t QwADC18_Channel::IsHeaderWord(UInt_t rawd) const +{ + return ((rawd & mask31x) != 0); +} + Int_t QwADC18_Channel::ProcessDataWord(UInt_t rawd) { // "Actual" values from data word @@ -321,10 +339,10 @@ Int_t QwADC18_Channel::ProcessDataWord(UInt_t rawd) // Interpret by data type UInt_t value_raw = 0; switch (act_dtype) { - case 0: + case 0: // Diff word static UInt_t prev_dvalue = act_dvalue; if (act_dvalue != prev_dvalue) { - QwError << "QwADC18_Channel::ProcessEvBuffer: Number of samples changed" << QwLog::endl; + QwError << "QwADC18_Channel::ProcessEvBuffer: Number of samples changed " << act_dvalue << " " << prev_dvalue << QwLog::endl; return 0; } value_raw = rawd & mask200x; @@ -332,27 +350,27 @@ Int_t QwADC18_Channel::ProcessDataWord(UInt_t rawd) fNumberOfSamples = (1 << act_dvalue); return value_raw; break; - case 1: - case 2: + case 1: // Peak word + case 2: // Base word if (act_snum != fNumberOfSamples) { - QwError << "QwADC18_Channel::ProcessEvBuffer: Divider value non-zero" << QwLog::endl; + QwError << "QwADC18_Channel::ProcessEvBuffer: Number of samples changed " << act_snum << " " << fNumberOfSamples << QwLog::endl; return 0; } if (act_dvalue != 0) { - QwError << "QwADC18_Channel::ProcessEvBuffer: Divider value non-zero" << QwLog::endl; + QwError << "QwADC18_Channel::ProcessEvBuffer: Divider value non-zero 0x" << std::hex << rawd << std::dec << QwLog::endl; return 0; } return rawd & mask170x; break; - case 4: + case 4: // DAC word if (act_dvalue != 0) { - QwError << "QwADC18_Channel::ProcessEvBuffer: Divider value non-zero" << QwLog::endl; + QwError << "QwADC18_Channel::ProcessEvBuffer: Divider value non-zero 0x" << std::hex << rawd << std::dec << QwLog::endl; return 0; } return rawd & mask150x; break; default: - QwError << "QwADC18_Channel::ProcessEvBuffer: Unknown data type" << QwLog::endl; + QwError << "QwADC18_Channel::ProcessEvBuffer: Unknown data type 0x" << std::hex << rawd << std::dec << QwLog::endl; return 0; } } @@ -360,8 +378,10 @@ Int_t QwADC18_Channel::ProcessDataWord(UInt_t rawd) // FIXME here goes the decoding of raw data from CODA blocks Int_t QwADC18_Channel::ProcessEvBuffer(UInt_t* buffer, UInt_t num_words_left, UInt_t index) { + Bool_t debug = false; + // Print buffer - if (false) { + if (debug) { QwOut << GetElementName() << " : " << QwLog::endl << std::hex; Int_t n = 25; for (size_t i = 0; i < num_words_left; i++) { @@ -372,28 +392,68 @@ Int_t QwADC18_Channel::ProcessEvBuffer(UInt_t* buffer, UInt_t num_words_left, UI } UInt_t words_read = 0; - if (IsNameEmpty()){ + if (IsNameEmpty()) { // This channel is not used, but is present in the data stream. // Skip over this data. words_read = kDataWordsPerChannel; } else if (num_words_left >= fNumberOfDataWords) { - UInt_t rawd = buffer[0]; + // Is this a header word? + if (IsHeaderWord(buffer[0])) { + + // Debug output + if (debug) { + QwOut << " : header " << std::hex; + UInt_t n = kHeaderWordsPerModule; + for (size_t i = 0; i < n && i < num_words_left; i++) { + QwOut << "0x" << std::setfill('0') << std::setw(8) << buffer[i] << " "; + } + QwOut << std::dec << std::setfill(' ') << std::setw(0) << QwLog::endl; + } - // Header check - if ((rawd & mask31x) != 0) { - QwError << "QwADC18_Channel::ProcessEvBuffer: Received header word 0x" << std::hex << rawd << " " << (rawd & mask31x) << std::dec << QwLog::endl; - return kHeaderWordsPerModule; - } + // Check if enough words left + if (num_words_left < kHeaderWordsPerModule) { + QwError << "QwADC18_Channel::ProcessEvBuffer: Not enough words left!" << QwLog::endl; + return num_words_left; + } - fDiff_Raw = ProcessDataWord(buffer[0]); - fPeak_Raw = ProcessDataWord(buffer[1]); - fBase_Raw = ProcessDataWord(buffer[2]); + // FIXME Catch 0xfa180bad + + // Header word: read DAC value + fValue_Raw = ProcessDataWord(buffer[kHeaderWordsPerModule-1]); + + words_read = kHeaderWordsPerModule; + + } else { + + // Debug output + if (debug) { + QwOut << " : channel " << std::hex; + UInt_t n = kDataWordsPerChannel; + for (size_t i = 0; i < n && i < num_words_left; i++) { + QwOut << "0x" << std::setfill('0') << std::setw(8) << buffer[i] << " "; + } + QwOut << std::dec << std::setfill(' ') << std::setw(0) << QwLog::endl; + } + + // Check if enough words left + if (num_words_left < kDataWordsPerChannel) { + QwError << "QwADC18_Channel::ProcessEvBuffer: Not enough words left!" << QwLog::endl; + return num_words_left; + } + + // Data channel words: read diff, peak, base + fDiff_Raw = ProcessDataWord(buffer[0]); + fPeak_Raw = ProcessDataWord(buffer[1]); + fBase_Raw = ProcessDataWord(buffer[2]); + + words_read = kDataWordsPerChannel; + } - words_read = kDataWordsPerChannel; } else { QwError << "QwADC18_Channel::ProcessEvBuffer: Not enough words!" << QwLog::endl; } + return words_read; } From 5f60c75a99ab8ad884065d23e46b10686f0a6bcc Mon Sep 17 00:00:00 2001 From: Cameron Clarke Date: Thu, 7 Feb 2019 11:35:25 -0500 Subject: [PATCH 137/137] Updating .conf files with new changes coming from updates to CRL reading g0inj.flags file for all 4 crates --- Parity/prminput/prexCH_beamline.1194-.map | 2 +- Parity/prminput/prexCH_beamline.1199-.map | 65 +++++++++++++++++++++++ Parity/prminput/prex_maindet.1194-.map | 33 ++++++++++++ Parity/prminput/prex_maindet.1199-.map | 33 ++++++++++++ Parity/prminput/prex_sam.1194-.map | 15 ++++++ Parity/prminput/prex_sam.1199-.map | 15 ++++++ 6 files changed, 162 insertions(+), 1 deletion(-) create mode 100644 Parity/prminput/prexCH_beamline.1199-.map create mode 100644 Parity/prminput/prex_maindet.1194-.map create mode 100644 Parity/prminput/prex_maindet.1199-.map create mode 100644 Parity/prminput/prex_sam.1194-.map create mode 100644 Parity/prminput/prex_sam.1199-.map diff --git a/Parity/prminput/prexCH_beamline.1194-.map b/Parity/prminput/prexCH_beamline.1194-.map index 9196e9036..f6c550f62 100644 --- a/Parity/prminput/prexCH_beamline.1194-.map +++ b/Parity/prminput/prexCH_beamline.1194-.map @@ -3,7 +3,7 @@ ROC=23 Bank=0x05 vqwk_buffer_offset = 1 !same sample size for ADCs in a given bank -sample_size=16564 +sample_size=1984 !Sample size should be unchanged - ask Paul King ! ! module.type, module.num chan.num, det.type, det.name, if unrotated then last column ->UNROTATED diff --git a/Parity/prminput/prexCH_beamline.1199-.map b/Parity/prminput/prexCH_beamline.1199-.map new file mode 100644 index 000000000..9196e9036 --- /dev/null +++ b/Parity/prminput/prexCH_beamline.1199-.map @@ -0,0 +1,65 @@ + +ROC=23 +Bank=0x05 +vqwk_buffer_offset = 1 +!same sample size for ADCs in a given bank +sample_size=16564 +!Sample size should be unchanged - ask Paul King +! +! module.type, module.num chan.num, det.type, det.name, if unrotated then last column ->UNROTATED + + +!ADC0 + VQWK, 0, 0, bcm, QWK_0_0 + VQWK, 0, 1, bcm, QWK_0_1 + VQWK, 0, 2, bcm, BCM_US + VQWK, 0, 3, bcm, BCM_DS + VQWK, 0, 4, bcm, QWK_0_4 + VQWK, 0, 5, bcm, QWK_0_5 + VQWK, 0, 6, bcm, QWK_0_6 + VQWK, 0, 7, bcm, QWK_0_7 + +!ADC1 + VQWK, 1, 0, bpmstripline, BPM4Exp + VQWK, 1, 1, bpmstripline, BPM4Exm + VQWK, 1, 2, bpmstripline, BPM4Eyp + VQWK, 1, 3, bpmstripline, BPM4Eym + VQWK, 1, 4, bcm, QWK_1_4 + VQWK, 1, 5, bcm, QWK_1_5 + VQWK, 1, 6, bcm, QWK_1_6 + VQWK, 1, 7, bcm, QWK_1_7 + +!ADC2 + VQWK, 2, 0, bcm, QWK_2_0 + VQWK, 2, 1, bcm, QWK_2_1 + VQWK, 2, 2, bcm, QWK_2_2 + VQWK, 2, 3, bcm, QWK_2_3 + VQWK, 2, 4, bpmstripline, BPM4Axp + VQWK, 2, 5, bpmstripline, BPM4Axm + VQWK, 2, 6, bpmstripline, BPM4Ayp + VQWK, 2, 7, bpmstripline, BPM4Aym + +!ADC3 + VQWK, 3, 0, bcm, CAV4BX + VQWK, 3, 1, bcm, CAV4BY + VQWK, 3, 2, bcm, CAV4BQ + VQWK, 3, 3, bcm, QWK_3_3 + VQWK, 3, 4, bcm, CAV4CX + VQWK, 3, 5, bcm, CAV4CY + VQWK, 3, 6, bcm, CAV4CQ + VQWK, 3, 7, bcm, unser + +!ADC4 + VQWK, 4, 0, bcm, CAV4DX + VQWK, 4, 1, bcm, CAV4DY + VQWK, 4, 2, bcm, CAV4DQ + VQWK, 4, 3, bcm, QWK_4_3 + VQWK, 4, 4, bcm, QWK_4_4 + VQWK, 4, 5, bcm, QWK_4_5 + VQWK, 4, 6, bcm, QWK_4_6 + VQWK, 4, 7, bcm, QWK_4_7 + + +[PUBLISH] +! new.tree.variable.name, analysis.class, old.tree.variable.name, element.to.store + q_targ, bcm, bcm_us, c diff --git a/Parity/prminput/prex_maindet.1194-.map b/Parity/prminput/prex_maindet.1194-.map new file mode 100644 index 000000000..c6acc13fd --- /dev/null +++ b/Parity/prminput/prex_maindet.1194-.map @@ -0,0 +1,33 @@ +ROC=25 +Bank=0x5 +vqwk_buffer_offset=1 + +sample_size=1984 +! +! Force all channels to be "not_blindable" during testing +! + VQWK, 0, 0, IntegrationPMT, usl not_blindable + VQWK, 0, 1, IntegrationPMT, dsl not_blindable + VQWK, 0, 2, IntegrationPMT, atl1 not_blindable + VQWK, 0, 3, IntegrationPMT, atl2 not_blindable + VQWK, 0, 4, IntegrationPMT, vqwk_25_0ch4 not_blindable + VQWK, 0, 5, IntegrationPMT, vqwk_25_0ch5 not_blindable + VQWK, 0, 6, IntegrationPMT, vqwk_25_0ch6 not_blindable + VQWK, 0, 7, IntegrationPMT, vqwk_25_0ch7 not_blindable + +ROC=26 +Bank=0x5 +vqwk_buffer_offset=1 +sample_size=1984 +! +! Force all channels to be "not_blindable" during testing +! + VQWK, 0, 0, IntegrationPMT, usr not_blindable + VQWK, 0, 1, IntegrationPMT, dsr not_blindable + VQWK, 0, 2, IntegrationPMT, atr1 not_blindable + VQWK, 0, 3, IntegrationPMT, atr2 not_blindable + VQWK, 0, 4, IntegrationPMT, vqwk_26_0ch4 not_blindable + VQWK, 0, 5, IntegrationPMT, vqwk_26_0ch5 not_blindable + VQWK, 0, 6, IntegrationPMT, vqwk_26_0ch6 not_blindable + VQWK, 0, 7, IntegrationPMT, vqwk_26_0ch7 not_blindable + diff --git a/Parity/prminput/prex_maindet.1199-.map b/Parity/prminput/prex_maindet.1199-.map new file mode 100644 index 000000000..9fd8efd36 --- /dev/null +++ b/Parity/prminput/prex_maindet.1199-.map @@ -0,0 +1,33 @@ +ROC=25 +Bank=0x5 +vqwk_buffer_offset=1 + +sample_size=16564 +! +! Force all channels to be "not_blindable" during testing +! + VQWK, 0, 0, IntegrationPMT, usl not_blindable + VQWK, 0, 1, IntegrationPMT, dsl not_blindable + VQWK, 0, 2, IntegrationPMT, atl1 not_blindable + VQWK, 0, 3, IntegrationPMT, atl2 not_blindable + VQWK, 0, 4, IntegrationPMT, vqwk_25_0ch4 not_blindable + VQWK, 0, 5, IntegrationPMT, vqwk_25_0ch5 not_blindable + VQWK, 0, 6, IntegrationPMT, vqwk_25_0ch6 not_blindable + VQWK, 0, 7, IntegrationPMT, vqwk_25_0ch7 not_blindable + +ROC=26 +Bank=0x5 +vqwk_buffer_offset=1 +sample_size=16564 +! +! Force all channels to be "not_blindable" during testing +! + VQWK, 0, 0, IntegrationPMT, usr not_blindable + VQWK, 0, 1, IntegrationPMT, dsr not_blindable + VQWK, 0, 2, IntegrationPMT, atr1 not_blindable + VQWK, 0, 3, IntegrationPMT, atr2 not_blindable + VQWK, 0, 4, IntegrationPMT, vqwk_26_0ch4 not_blindable + VQWK, 0, 5, IntegrationPMT, vqwk_26_0ch5 not_blindable + VQWK, 0, 6, IntegrationPMT, vqwk_26_0ch6 not_blindable + VQWK, 0, 7, IntegrationPMT, vqwk_26_0ch7 not_blindable + diff --git a/Parity/prminput/prex_sam.1194-.map b/Parity/prminput/prex_sam.1194-.map new file mode 100644 index 000000000..579a74e9a --- /dev/null +++ b/Parity/prminput/prex_sam.1194-.map @@ -0,0 +1,15 @@ +ROC=26 +Bank=0x5 +vqwk_buffer_offset=1 + +sample_size=1984 + + VQWK, 1, 0, IntegrationPMT, sam1 + VQWK, 1, 1, IntegrationPMT, sam2 + VQWK, 1, 2, IntegrationPMT, sam3 + VQWK, 1, 3, IntegrationPMT, sam4 + VQWK, 1, 4, IntegrationPMT, sam5 + VQWK, 1, 5, IntegrationPMT, sam6 + VQWK, 1, 6, IntegrationPMT, sam7 + VQWK, 1, 7, IntegrationPMT, sam8 + diff --git a/Parity/prminput/prex_sam.1199-.map b/Parity/prminput/prex_sam.1199-.map new file mode 100644 index 000000000..de5f85041 --- /dev/null +++ b/Parity/prminput/prex_sam.1199-.map @@ -0,0 +1,15 @@ +ROC=26 +Bank=0x5 +vqwk_buffer_offset=1 + +sample_size=16564 + + VQWK, 1, 0, IntegrationPMT, sam1 + VQWK, 1, 1, IntegrationPMT, sam2 + VQWK, 1, 2, IntegrationPMT, sam3 + VQWK, 1, 3, IntegrationPMT, sam4 + VQWK, 1, 4, IntegrationPMT, sam5 + VQWK, 1, 5, IntegrationPMT, sam6 + VQWK, 1, 6, IntegrationPMT, sam7 + VQWK, 1, 7, IntegrationPMT, sam8 +