Changeset 10691
- Timestamp:
- 05/12/11 22:55:23 (14 years ago)
- Location:
- trunk/FACT++
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/FACT++/gui/FactGui.h
r10678 r10691 1007 1007 1008 1008 fTriggerInterval->setValue(sdata.fTriggerInterval); 1009 fPhysicsCoincidence->setValue(sdata.f CoincidencePhysics);1010 fCalibCoincidence->setValue(sdata.f CoincidenceCalib);1009 fPhysicsCoincidence->setValue(sdata.fMultiplicityPhysics); 1010 fCalibCoincidence->setValue(sdata.fMultiplicityCalib); 1011 1011 fPhysicsWindow->setValue(sdata.fWindowPhysics); 1012 1012 fCalibWindow->setValue(sdata.fWindowCalib); -
trunk/FACT++/src/HeadersFTM.cc
r10649 r10691 104 104 out << ((fTriggerSequence>> 5)&0x1f) << ":"; 105 105 out << ((fTriggerSequence>>10)&0x1f) << " (LPint:LPext:PED)" << endl; 106 out << "Coinc. physics: " << std::setw(2) << f CoincidencePhysics << "/N ";106 out << "Coinc. physics: " << std::setw(2) << fMultiplicityPhysics << "/N "; 107 107 out << fWindowPhysics*4+8 << "ns" << endl; 108 out << "Coinc. calib: " << std::setw(2) << f CoincidenceCalib << "/N ";108 out << "Coinc. calib: " << std::setw(2) << fMultiplicityCalib << "/N "; 109 109 out << fWindowCalib*4+8 << "ns" << endl; 110 110 out << "Trigger delay: " << fDelayTrigger*4+8 << "ns" << endl; -
trunk/FACT++/src/HeadersFTM.h
r10622 r10691 152 152 }; 153 153 154 /// Command codes for FTM communication 154 155 enum Commands 155 156 { 156 kCmdRead = 0x0001, 157 kCmdWrite = 0x0002, 158 kCmdStartRun = 0x0004, 159 kCmdStopRun = 0x0008, 160 kCmdPing = 0x0010, 161 kCmdCrateReset = 0x0020, 162 kCmdDisableReports = 0x0040, 157 kCmdRead = 0x0001, ///< Request data 158 kCmdWrite = 0x0002, ///< Send data 159 kCmdStartRun = 0x0004, ///< Start the trigger 160 kCmdStopRun = 0x0008, ///< Stop the trigger 161 kCmdPing = 0x0010, ///< Ping all FTUs (get FTU list) 162 kCmdCrateReset = 0x0020, 163 kCmdDisableReports = 0x0040, ///< Disable transmission of rate-reports (dynamic data) 163 164 kCmdToggleLed = 0xc000, 164 165 165 kWriteStaticData = 0x0001, 166 kWriteRegister = 0x0004, 167 168 kReadStaticData = 0x0001, 169 kReadDynamicData = 0x0002, 170 kReadRegister = 0x0004, 166 kCmdStaticData = 0x0001, ///< Specifies that static (configuration) data is read/written 167 kCmdDynamicData = 0x0002, ///< Specifies that dynamic data is read/written 168 kCmdRegister = 0x0004, ///< Specifies that a register is read/written 171 169 172 170 kStartRun = 0x0001, … … 174 172 }; 175 173 174 175 /// Types sent in the header of the following data 176 176 enum Types 177 177 { 178 kHeader = 0, //Local extension to identify a header in fCounter179 kStaticData = 1, 180 kDynamicData = 2, 181 kFtuList = 3, 182 kErrorList = 4, 183 kRegister = 5, 178 kHeader = 0, ///< Local extension to identify a header in fCounter 179 kStaticData = 1, ///< Static (configuration) data 180 kDynamicData = 2, ///< Dynamic data (rates) 181 kFtuList = 3, ///< FTU list (answer of ping) 182 kErrorList = 4, ///< Error list (error when FTU communication failed) 183 kRegister = 5, ///< A requested register value 184 184 }; 185 185 … … 194 194 enum 195 195 { 196 kDelimiterStart = 0xfb01, 197 kDelimiterEnd = 0x04fe 196 kDelimiterStart = 0xfb01, ///< Start delimiter send before each header 197 kDelimiterEnd = 0x04fe ///< End delimiter send after each data block 198 198 }; 199 199 200 200 struct Header 201 201 { 202 uint16_t fDelimiter; 203 uint16_t fType; 204 uint16_t fDataSize; 205 uint16_t fState; 202 uint16_t fDelimiter; /// Start delimiter 203 uint16_t fType; /// Type of the data to be received after the header 204 uint16_t fDataSize; /// Size in words to be received after the header 205 uint16_t fState; /// State of the FTM state machine 206 206 uint64_t fBoardId; 207 207 uint16_t fFirmwareId; … … 276 276 enum 277 277 { 278 kMax Coincidence = 40,278 kMaxMultiplicity = 40, ///< Maximum for required trigger multiplicity 279 279 kMaxWindow = 0xf, 280 280 kMaxDeadTime = 0xffff, … … 304 304 uint16_t fTriggerSequence; // 3x5bit 305 305 uint64_t fDummy0; 306 uint16_t f CoincidencePhysics;307 uint16_t f CoincidenceCalib;306 uint16_t fMultiplicityPhysics; 307 uint16_t fMultiplicityCalib; 308 308 uint16_t fDelayTrigger; 309 309 uint16_t fDelayTimeMarker; … … 377 377 uint16_t fTriggerSeqPed; // only 5bits used 378 378 //28 379 uint16_t f CoincidencePhysics; // 0-40380 uint16_t f CoincidenceCalib; // 0-40379 uint16_t fMultiplicityPhysics; // 0-40 380 uint16_t fMultiplicityCalib; // 0-40 381 381 //32 382 382 uint16_t fWindowPhysics; … … 421 421 fTriggerSeqLPext((d.fTriggerSequence>>5)&0x1f), 422 422 fTriggerSeqPed((d.fTriggerSequence>>10)&0x1f), 423 f CoincidencePhysics(d.fCoincidencePhysics),424 f CoincidenceCalib(d.fCoincidenceCalib),423 fMultiplicityPhysics(d.fMultiplicityPhysics), 424 fMultiplicityCalib(d.fMultiplicityCalib), 425 425 fWindowPhysics(d.fWindowPhysics*4+8), 426 426 fWindowCalib(d.fWindowCalib*4+8), -
trunk/FACT++/src/StateMachineImp.h
r10688 r10691 18 18 /// Derived classes must define different state-number for 19 19 /// their purpose 20 enum 20 enum DefaultStates_t 21 21 { 22 22 kSM_NotReady = -1, ///< Mainloop not running, state machine stopped … … 24 24 kSM_Error = 0x100, ///< Error states should be between 0x100 and 0xffff 25 25 kSM_FatalError = 0xffff, ///< Fatal error: stop program 26 } defaultstates_t;26 }; 27 27 28 28 private: -
trunk/FACT++/src/ftm.cc
r10592 r10691 76 76 fStaticData.clear(); 77 77 78 fStaticData.f CoincidencePhysics = 1;79 fStaticData.f CoincidenceCalib = 40;80 fStaticData.fWindowCalib = 1;81 fStaticData.fWindowPhysics = 0;82 fStaticData.fDelayTrigger = 21;83 fStaticData.fDelayTimeMarker = 42;84 fStaticData.fDeadTime = 84;78 fStaticData.fMultiplicityPhysics = 1; 79 fStaticData.fMultiplicityCalib = 40; 80 fStaticData.fWindowCalib = 1; 81 fStaticData.fWindowPhysics = 0; 82 fStaticData.fDelayTrigger = 21; 83 fStaticData.fDelayTimeMarker = 42; 84 fStaticData.fDeadTime = 84; 85 85 86 86 fStaticData.fClockConditioner[0] = 100; … … 265 265 switch (fBufCommand[2]) 266 266 { 267 case k ReadStaticData:267 case kCmdStaticData: 268 268 cout << "-> STATIC" << endl; 269 269 … … 275 275 return; 276 276 277 case k ReadDynamicData:277 case kCmdDynamicData: 278 278 cout << "-> DYNAMIC" << endl; 279 279 … … 285 285 return; 286 286 287 case k ReadRegister:287 case kCmdRegister: 288 288 fCommand = fBufCommand; 289 289 cout << "-> REGISTER" << endl; … … 299 299 switch (fBufCommand[2]) 300 300 { 301 case k WriteRegister:301 case kCmdRegister: 302 302 fCommand = fBufCommand; 303 303 cout << "-> REGISTER" << endl; … … 307 307 return; 308 308 309 case k WriteStaticData:309 case kCmdStaticData: 310 310 fCommand = fBufCommand; 311 311 cout << "-> STATIC DATA" << endl; … … 376 376 switch (fCommand[2]) 377 377 { 378 case k WriteRegister:378 case kCmdRegister: 379 379 { 380 380 const uint16_t addr = ntohs(fBufCommand[0]); … … 387 387 break; 388 388 389 case k WriteStaticData:389 case kCmdStaticData: 390 390 { 391 391 cout << "-> SET STATIC DATA" << endl; -
trunk/FACT++/src/ftmctrl.cc
r10688 r10691 505 505 void CmdReqDynDat() 506 506 { 507 PostCmd(FTM::kCmdRead, FTM::k ReadDynamicData);507 PostCmd(FTM::kCmdRead, FTM::kCmdDynamicData); 508 508 } 509 509 510 510 void CmdReqStatDat() 511 511 { 512 PostCmd(FTM::kCmdRead, FTM::k ReadStaticData);512 PostCmd(FTM::kCmdRead, FTM::kCmdStaticData); 513 513 } 514 514 515 515 void CmdSendStatDat() 516 516 { 517 PostCmd(fStaticData.HtoN(), FTM::kCmdWrite, FTM::k WriteStaticData);517 PostCmd(fStaticData.HtoN(), FTM::kCmdWrite, FTM::kCmdStaticData); 518 518 519 519 // Request the changed configuration to ensure the … … 553 553 554 554 const boost::array<uint16_t, 2> data = {{ addr, val }}; 555 PostCmd(data, FTM::kCmdWrite, FTM::k WriteRegister);555 PostCmd(data, FTM::kCmdWrite, FTM::kCmdRegister); 556 556 557 557 // Request the changed configuration to ensure the … … 568 568 569 569 const boost::array<uint16_t, 1> data = {{ addr }}; 570 PostCmd(data, FTM::kCmdRead, FTM::k ReadRegister);570 PostCmd(data, FTM::kCmdRead, FTM::kCmdRegister); 571 571 572 572 return true; … … 813 813 } 814 814 815 bool SetTrigger Coincidence(uint16_t n)816 { 817 if (n==0 || n>FTM::StaticData::kMax Coincidence)815 bool SetTriggerMultiplicity(uint16_t n) 816 { 817 if (n==0 || n>FTM::StaticData::kMaxMultiplicity) 818 818 return false; 819 819 820 if (n==fStaticData.f CoincidencePhysics)820 if (n==fStaticData.fMultiplicityPhysics) 821 821 return true; 822 822 823 fStaticData.f CoincidencePhysics = n;823 fStaticData.fMultiplicityPhysics = n; 824 824 825 825 CmdSendStatDat(); … … 843 843 } 844 844 845 bool SetCalib Coincidence(uint16_t n)846 { 847 if (n==0 || n>FTM::StaticData::kMax Coincidence)845 bool SetCalibMultiplicity(uint16_t n) 846 { 847 if (n==0 || n>FTM::StaticData::kMaxMultiplicity) 848 848 return false; 849 849 850 if (n==fStaticData.f CoincidenceCalib)850 if (n==fStaticData.fMultiplicityCalib) 851 851 return true; 852 852 853 fStaticData.f CoincidenceCalib = n;853 fStaticData.fMultiplicityCalib = n; 854 854 855 855 CmdSendStatDat(); … … 1264 1264 } 1265 1265 1266 int SetTrigger Coincidence(const EventImp &evt)1267 { 1268 if (!CheckEventSize(evt.GetSize(), "SetTrigger Coincidence", 2))1269 return T::kSM_FatalError; 1270 1271 if (!fFTM.SetTrigger Coincidence(evt.GetUShort()))1272 T::Warn("SetTrigger Coincidence- Value out of range.");1273 1274 return T::GetCurrentState(); 1275 } 1276 1277 int SetCalib Coincidence(const EventImp &evt)1278 { 1279 if (!CheckEventSize(evt.GetSize(), "SetCalib Coincidence", 2))1280 return T::kSM_FatalError; 1281 1282 if (!fFTM.SetCalib Coincidence(evt.GetUShort()))1283 T::Warn("SetCalib Coincidence- Value out of range.");1266 int SetTriggerMultiplicity(const EventImp &evt) 1267 { 1268 if (!CheckEventSize(evt.GetSize(), "SetTriggerMultiplicity", 2)) 1269 return T::kSM_FatalError; 1270 1271 if (!fFTM.SetTriggerMultiplicity(evt.GetUShort())) 1272 T::Warn("SetTriggerMultiplicity - Value out of range."); 1273 1274 return T::GetCurrentState(); 1275 } 1276 1277 int SetCalibMultiplicity(const EventImp &evt) 1278 { 1279 if (!CheckEventSize(evt.GetSize(), "SetCalibMultiplicity", 2)) 1280 return T::kSM_FatalError; 1281 1282 if (!fFTM.SetCalibMultiplicity(evt.GetUShort())) 1283 T::Warn("SetCalibMultiplicity - Value out of range."); 1284 1284 1285 1285 return T::GetCurrentState(); … … 1516 1516 "|LPext[int]:number of triggers of the external light pulser"); 1517 1517 1518 AddEvent("SET_TRIGGER_ COINCIDENCE", "S:1", kStateIdle)1519 (boost::bind(&StateMachineFTM::SetTrigger Coincidence, this, _1))1520 ("Setup the coincidencecondition for physcis triggers"1518 AddEvent("SET_TRIGGER_Multiplicity", "S:1", kStateIdle) 1519 (boost::bind(&StateMachineFTM::SetTriggerMultiplicity, this, _1)) 1520 ("Setup the Multiplicity condition for physcis triggers" 1521 1521 "|N[int]:Number of requirered coincident triggers from sum-patches (1-40)"); 1522 1522 … … 1525 1525 (""); 1526 1526 1527 AddEvent("SET_CALIBRATION_ COINCIDENCE", "S:1", kStateIdle)1528 (boost::bind(&StateMachineFTM::SetCalib Coincidence, this, _1))1529 ("Setup the coincidencecondition for artificial (calibration) triggers"1527 AddEvent("SET_CALIBRATION_Multiplicity", "S:1", kStateIdle) 1528 (boost::bind(&StateMachineFTM::SetCalibMultiplicity, this, _1)) 1529 ("Setup the Multiplicity condition for artificial (calibration) triggers" 1530 1530 "|N[int]:Number of requirered coincident triggers from sum-patches (1-40)"); 1531 1531
Note:
See TracChangeset
for help on using the changeset viewer.