COMMENT "TC laser run"
# include XEC setting script
INCLUDE xec_settings
RUNDESCRIPTION "TC laser run"
SET Nrun, 1
SET Freq, 1200
ODBSET "/Experiment/Run Parameters/SQL/SPX/SPXConfId", 79, 0
ODBGET "/Sequencer/Variables/Freq", Freq
ODBSET "/Sequencer/Variables/Freq", 1200, 1
SET Power, 12
SET Temp, 15
SET LaserFreq, 40
SET Nevent, 3000
ODBGET "/Sequencer/Variables/Nevent", Nevent
ODBSET "/Sequencer/Variables/Nevent", 3000, 1
SET Gain, 100
SET PzcLevel, 7
# Reset XEC setting
CALL setup_ADC, 0
CALL setup_DRS, 0
ODBSUBDIR "/Equipment/Trigger/Settings/WaveDAQ/"
ODBSET "AUXCrate/AUX-13/SamplingFrequency", $Freq, 0
ODBSET "AUXCrate/AUX-13/FrontendPzcLevel", 3, 0
ODBSET "AUXCrate/AUX-13/FrontendGain[14]", 1, 0
ODBSET "AUXCrate/AUX-13/FrontendPzc[14]", n, 0
ODBSET "AUXCrate/AUX-13/FrontendGain[15]", 1, 0
ODBSET "AUXCrate/AUX-13/FrontendPzc[15]", y, 0
ODBSET "AUXCrate/AUX-13/DRSChannelTxEnable", 0x3FFFFx,0
ODBSET "AUXCrate/AUX-13/ZeroSuppressionEnable", n, 0
ODBSET "TCUS1Crate/TU1-*/SamplingFrequency", $Freq, 0
ODBSET "TCUS1Crate/TU1-*/FrontendPzcLevel", $PzcLevel, 0
ODBSET "TCUS1Crate/TU1-*/FrontendPzc[*]", y, 0
ODBSET "TCUS1Crate/TU1-*/DRSChannelTxEnable", 0x3FFFF,0
ODBSET "TCUS1Crate/TU1-*/ZeroSuppressionEnable", n, 0
ODBSET "TCUS1Crate/TU1-*/FrontendGain[*]", $Gain, 0
ODBSET "TCUS1Crate/TU1-6/FrontendGain[*]", 50, 0
ODBSET "TCUS1Crate/TU1-*/TDCChannelTxEnable", 0,0
ENDODBSUBDIR
ODBSUBDIR "/Equipment/Trigger/Settings/WaveDAQ"
ODBSET "Trigger/MASTER/TriggerPrescaling[*]", 0, 0
ODBSET "Trigger/MASTER/TriggerEnable[*]", n, 0
ODBSET "Trigger/MASTER/TriggerPrescaling[63]", 1, 0
ODBSET "Trigger/MASTER/TriggerEnable[63]", y, 0
ODBSET "Trigger/MASTER/Write TRGC", y, 0
ODBSET "Trigger/MASTER/Write TGEN", y, 0
ODBSET "Trigger/MASTER/Write XEC", n, 0
ODBSet "Trigger/TC/Write SPX", n, 0
ENDODBSUBDIR
ODBSUBDIR ""
ENDODBSUBDIR
ODBSET "/Equipment/Trigger/Settings/Reload all", y, 1
WAIT ODBValue, "/Equipment/Trigger/Variables/Config busy", ==, 0
WAIT seconds, 2
ODBSUBDIR "/Equipment/Trigger/Settings/WaveDAQ"
ODBSET "Trigger/MASTER/TriggerPrescaling[*]", 0, 0
ODBSET "Trigger/MASTER/TriggerEnable[*]", n, 0
ODBSET "Trigger/MASTER/TriggerPrescaling[63]", 100, 0
ODBSET "Trigger/MASTER/TriggerEnable[63]", y, 1
ENDODBSUBDIR
ODBSUBDIR ""
ENDODBSUBDIR
CAT description, "TC pedestal"
ODBSET "/Experiment/Run Parameters/Run description", $description, 1
LOOP $Nrun
TRANSITION start
WAIT events, 1000
TRANSITION stop
ENDLOOP
ODBSUBDIR "/Equipment/Trigger/Settings/WaveDAQ"
ODBSET "Trigger/MASTER/TriggerPrescaling[*]", 0, 0
ODBSET "Trigger/MASTER/TriggerEnable[*]", n, 0
ODBSET "Trigger/MASTER/TriggerPrescaling[23]", 1, 0
ODBSET "Trigger/MASTER/TriggerEnable[23]", y, 1
ENDODBSUBDIR
ODBSUBDIR "/Equipment/Laser/Variables/"
ODBSET "Output[0]", $LaserFreq, 0
ODBSET "Output[1]", 1, 0
ODBSET "Output[2]", 1, 0
ODBSET "Output[3]", 1, 0
ODBSET "Output[4]", 0, 1
ENDODBSUBDIR
WAIT seconds, 10
ODBSUBDIR ""
ENDODBSUBDIR
CAT description, "Laser run, sector: 4, frequency: ", $Freq, ", clock: square, power: ", $Power, ", attenuator: 0, temperature: ", $Temp
ODBSET "/Experiment/Run Parameters/Run description", $description, 1
LOOP $Nrun
TRANSITION start
WAIT events, $Nevent
TRANSITION stop
ENDLOOP
ODBSUBDIR "/Equipment/Laser/Variables/"
ODBSET "Output[1]", 1, 0
ODBSET "Output[2]", 0, 0
ODBSET "Output[3]", 0, 0
ODBSET "Output[4]", 1, 1
ENDODBSUBDIR
WAIT seconds, 10
ODBSUBDIR ""
ENDODBSUBDIR
CAT description, "Laser run, sector: 5, frequency: ", $Freq, ", clock: square, power: ", $Power, ", attenuator: 0, temperature: ", $Temp
ODBSET "/Experiment/Run Parameters/Run description", $description, 1
LOOP $Nrun
TRANSITION start
WAIT events, $Nevent
TRANSITION stop
ENDLOOP
ODBSUBDIR "/Equipment/Laser/Variables"
ODBSET "Output[1]", 0, 0
ODBSET "Output[2]", 1, 0
ODBSET "Output[3]", 0, 0
ODBSET "Output[4]", 1, 1
ENDODBSUBDIR
WAIT seconds, 10
ODBSUBDIR ""
ENDODBSUBDIR
CAT description, "Laser run, sector: 6, frequency: ", $Freq, ", clock: square, power: ", $Power, ", attenuator: 0, temperature: ", $Temp
ODBSET "/Experiment/Run Parameters/Run description", $description, 1
LOOP $Nrun
TRANSITION start
WAIT events, $Nevent
TRANSITION stop
ENDLOOP
ODBSUBDIR "/Equipment/Laser/Variables"
ODBSET "Output[1]", 1, 0
ODBSET "Output[2]", 1, 0
ODBSET "Output[3]", 0, 0
ODBSET "Output[4]", 1, 1
ENDODBSUBDIR
WAIT seconds, 10
ODBSUBDIR ""
ENDODBSUBDIR
CAT description, "Laser run, sector: 7, frequency: ", $Freq, ", clock: square, power: ", $Power, ", attenuator: 0, temperature: ", $Temp
ODBSET "/Experiment/Run Parameters/Run description", $description, 1
LOOP $Nrun
TRANSITION start
WAIT events, $Nevent
TRANSITION stop
ENDLOOP
ODBSUBDIR "/Equipment/Laser/Variables"
ODBSET "Output[0]", 0, 0
ODBSET "Output[1]", 1, 0
ODBSET "Output[2]", 0, 0
ODBSET "Output[3]", 0, 0
ODBSET "Output[4]", 0, 1
ENDODBSUBDIR
ODBSUBDIR "/Equipment/Trigger/Settings/WaveDAQ"
ODBSET "AUXCrate/AUX-13/SamplingFrequency", 1200, 0
ODBSET "AUXCrate/AUX-13/FrontendPzcLevel", 7, 0
ODBSET "AUXCrate/AUX-13/FrontendGain[14]", 1, 0
ODBSET "AUXCrate/AUX-13/FrontendPzc[14]", n, 0
ODBSET "AUXCrate/AUX-13/FrontendGain[15]", 1, 0
ODBSET "AUXCrate/AUX-13/FrontendPzc[15]", n, 1
ENDODBSUBDIR
|