00001 #ifndef NOISEOCCUPANCYSCAN_H
00002 #define NOISEOCCUPANCYSCAN_H
00003
00004 #include <cmath>
00005
00006 #include "../ipc/CalibrationController.hh"
00007 #include "../CalibrationControllerImpl.h"
00008 #include "../ipc/ScanRequest.h"
00009 #include "../SctApiAccessException.h"
00010 #include "../SctApiCall.h"
00011 #include "Sct/LogicErrors.h"
00012
00013 #include <Sct/AbcdScans.h>
00014
00015 using namespace Sct;
00016 using namespace SctCalibrationController::Ipc;
00017 namespace SctCalibrationController {
00018 namespace Scripts {
00019
00022 class NoiseOccupancyScan : public ScanRequestImpl {
00023 public:
00024 static ScanRequestImpl& noiseOccupancyScan() {
00025 static NoiseOccupancyScan request;
00026 Sct_SctApi::SctApiIPC_var api = CalibrationControllerImpl::instance()->getApi();
00027 Sct_SctApi::Scan_var s;
00028 APIRETCALL(api, s, createScan(), "Failed to create scan")
00029
00030 request.setScanNice(s);
00031
00032 APICALL(s, setNTrigs(1000), "Failed to set triggers")
00033
00034 Sct_SctApi::Trigger_var t;
00035 APIRETCALL(s, t, getTrigger1(), "Failed to get Trigger1")
00036
00037 APICALL(t, singleL1A(), "Failed to set trigger type")
00038
00039 APICALL(s, configure(ST_TTHR, 20, -80, -5), "Failed to set Scan information")
00040
00041
00042 APICALL(s, setOption(Sct_SctApi::Scan::ope, 1), "Failed to set ope option")
00043
00044
00045
00046 APICALL(s, setVariableTrigRange(0, 8, 100000), "Failed to set trigger count");
00047 APICALL(s, setVariableTrigRange(9, 11, 10000), "Failed to set trigger count");
00048 APICALL(s, setVariableTrigRange(12, 20, 1000), "Failed to set trigger count");
00049
00050 return request;
00051 }
00052
00053 private:
00054 NoiseOccupancyScan(){;}
00055 };
00056
00057 }
00058 }
00059
00060 #endif //THRESHOLDSCAN_H