00001 #ifndef CHARACTERIZATIONSEQUENCE_H 00002 #define CHARACTERIZATIONSEQUENCE_H 00003 00004 #include "../ipc/SequenceRequest.h" 00005 #include "../ipc/TestRequest.h" 00006 #include "../ipc/CalibrationController.h" 00007 #include "../ipc/TestLibrary.h" 00008 #include "../ipc/Sct_CalibrationController.hh" 00009 #include <iostream> 00010 00011 using namespace std; 00012 00013 namespace SctCalibrationController { 00014 00015 using namespace Ipc; 00016 00017 namespace Scripts { 00018 00019 class CharacterizationSequence : public SequenceRequestImpl { 00020 public: 00021 static CharacterizationSequence& instance() { 00022 static CharacterizationSequence cs; 00023 return cs; 00024 } 00025 00026 virtual string startSequence(Sct_SctApi_T_SctApi& api) { 00027 this->api = &api; 00028 return "CharacterizationSequence"; 00029 } 00030 00031 virtual TestRequest* getNextTest(unsigned long index) { 00032 TestLibrary& tl = CalibrationControllerImpl::instance().getTestLibrary(); 00033 switch (index) { 00034 case 0: 00035 return &tl.nmask(); 00036 case 1: 00037 #warning Only Barrel combinations of bypass included in characterization sequence 00038 return &tl.fullBypassBarrel(); 00039 case 2: 00040 return &tl.pipeline(); 00041 case 3: 00042 return &tl.strobeDelay(); 00043 case 4: 00044 return &tl.threePointGain(); 00045 case 5: 00046 return &tl.trimRange(); 00047 case 6: 00048 return &tl.responseCurve(); 00049 case 7: 00050 return &tl.noiseOccupancy(); 00051 case 8: 00052 return &tl.timeWalk(); 00053 default: 00054 return 0; 00055 } 00056 } 00057 00058 virtual void endSequence() { 00059 api = 0; 00060 } 00061 00062 private: 00063 Sct_SctApi_T_SctApi* api; 00064 CharacterizationSequence() {} 00065 }; 00066 } 00067 } 00068 #endif //CHARACTERIZATIONSEQUENCE_H