Main Page | Modules | Namespace List | Class Hierarchy | Alphabetical List | Data Structures | File List | Namespace Members | Data Fields | Related Pages

NoiseOccupancyScan.h

00001 #ifndef NOISEOCCUPANCYSCAN_H
00002 #define NOISEOCCUPANCYSCAN_H
00003 
00004 #include <cmath>  // For fabs
00005 
00006 #include "../ipc/Sct_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 <CommonWithDsp/ABCD/ABCDscans.h>
00014 
00015 using namespace Sct;
00016 using namespace SctCalibrationController::Ipc;
00017 namespace SctCalibrationController {
00018 namespace Scripts {
00019 
00020 class NoiseOccupancyScan  : public ScanRequestImpl {
00021 public:
00022     static ScanRequestImpl& noiseOccupancyScan() {
00023       static NoiseOccupancyScan request;
00024       Sct_SctApi_T_SctApi* api = CalibrationControllerImpl::instance().getApi();
00025       Sct_SctApi_T_Scan* s = 0;
00026       APIRETCALL(api, s, createScan(&st), "Failed to create scan")
00027 
00028     request.setScan(s);
00029 
00030         APICALL(s, setNTrigs(&st, 1000), "Failed to set triggers")
00031     
00032         Sct_SctApi_T_Trigger* t = 0;
00033       APIRETCALL(s, t, getTrigger1(&st), "Failed to get Trigger1")
00034     
00035         APICALL(t, calL1A(&st, 0x82), "Failed to set trigger type")
00036 
00037         APICALL(s, configure(&st, ST_TTHR, 20, -80, -5), "Failed to set Scan information")
00038 
00039     // Too slow to do 1e6 triggers (almost 10mins for these on two modules)
00040 /*         APICALL(s, setVariableTrigRange(&st, 0, 4, 1000000), "Failed to set trigger count"); */
00041         APICALL(s, setVariableTrigRange(&st, 0, 8, 100000), "Failed to set trigger count");
00042         APICALL(s, setVariableTrigRange(&st, 9, 11, 10000), "Failed to set trigger count");
00043         APICALL(s, setVariableTrigRange(&st, 12, 20, 1000), "Failed to set trigger count");
00044 
00045     return request;
00046     }
00047     
00048 private:
00049     NoiseOccupancyScan(){;} 
00050 };
00051     
00052 }
00053 }
00054 
00055 #endif //THRESHOLDSCAN_H

Generated on Thu Jul 15 09:50:49 2004 for SCT DAQ/DCS Software - C++ by doxygen 1.3.5