Changeset 18337 for trunk/FACT++/src
- Timestamp:
- 09/30/15 09:12:44 (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/FACT++/src/feedback.cc
r18191 r18337 74 74 75 75 vector<double> fVoltOffset; 76 77 uint16_t fMoonMode; 76 78 77 79 uint16_t fCurrentRequestInterval; … … 493 495 494 496 // ------------------------------------------------------------------------------------- 497 // Inner patches to be blocked (operated below the operation voltage) in moon mode 498 499 static const array<int, 14> inner0 = 500 {{ 501 62, 63, 130, 131, 132, 133, 134, 502 135, 222, 223, 292, 293, 294, 295, 503 }}; 504 505 static const array<int, 23> inner1 = 506 {{ 507 58, 59, 60, 61, 129, 138, 139, 140, 141, 142, 143, 218, 508 219, 220, 221, 290, 291, 298, 299, 300, 301, 302, 303, 509 }}; 510 511 static const array<int, 43> inner2 = 512 {{ 513 42, 43, 44, 45, 55, 56, 57, 70, 71, 78, 79, 514 96, 97, 98, 99, 102, 103, 128, 136, 137, 159, 202, 515 203, 204, 205, 214, 216, 217, 228, 230, 231, 256, 257, 516 258, 259, 262, 263, 288, 289, 296, 297, 310, 318 517 }}; 518 519 // ------------------------------------------------------------------------------------- 495 520 496 521 // Nominal overvoltage (w.r.t. the bias setup values) … … 546 571 continue; 547 572 573 // Check if this is a blocked channel 574 const bool blocked = 575 (fMoonMode>0 && std::find(inner0.begin(), inner0.end(), i)!=inner0.end()) || 576 (fMoonMode>1 && std::find(inner1.begin(), inner1.end(), i)!=inner1.end()) || 577 (fMoonMode>2 && std::find(inner2.begin(), inner2.end(), i)!=inner2.end()); 578 548 579 // Number of G-APDs in this patch 549 580 const int N = hv.count(); … … 613 644 614 645 // Nominal operation voltage with correction for temperature dependence 615 const double Uop = fVoltGapd[i] + fVoltOffset[i] + fTempOffset[i]; 646 const double Uop = fVoltGapd[i] + fVoltOffset[i] + fTempOffset[i] 647 + (blocked ? -5 : 0); 616 648 617 649 // Current overvoltage (at a G-APD with the correct 3900 Ohm resistor) … … 685 717 vec[i] = Uset; 686 718 687 // Calculate statistics only for channels with a valid calibration 688 //if (Uov>0) 719 const double iapd = Iapd*1e6; // A --> uA 720 721 data.I[i] = iapd; 722 data.Uov[i] = Uov; 723 724 if (!blocked) 689 725 { 690 726 const int g = hv.group(); … … 699 735 max[g] = Uov; 700 736 701 const double iapd = Iapd*1e6; // A --> uA702 703 data.I[i] = iapd;704 737 data.Iavg += iapd; 705 738 data.Irms += iapd*iapd; 706 707 data.Uov[i] = Uov;708 739 709 740 med[2][num[2]++] = iapd; … … 932 963 } 933 964 965 int SetMoonMode(const EventImp &evt) 966 { 967 if (!CheckEventSize(evt.GetSize(), "SetMoonMode", 2)) 968 return kSM_FatalError; 969 970 fMoonMode = evt.GetUShort(); 971 if (fMoonMode>3) 972 fMoonMode=3; 973 974 Info("New moon mode: "+to_string(fMoonMode)); 975 976 return GetCurrentState(); 977 } 978 934 979 int Calibrate() 935 980 { … … 979 1024 out << "Starting feedback with an offset of " << fUserOffset << "V"; 980 1025 Message(out); 1026 1027 if (fMoonMode>0) 1028 Message("Moon mode "+to_string(fMoonMode)+" turned on."); 981 1029 982 1030 return Feedback::State::kWaitingForData; … … 1154 1202 "|U[V]:Offset per bias channels"), 1155 1203 fVoltOffset(416), 1204 fMoonMode(0), 1156 1205 fCurrentRequestInterval(0), 1157 1206 fNumCalibIgnore(30), … … 1237 1286 (bind(&StateMachineFeedback::LoadCalibration, this)) 1238 1287 (""); 1288 1289 AddEvent("SET_MOON_MODE", "S:1", Feedback::State::kConnected, Feedback::State::kCalibrated) 1290 (bind(&StateMachineFeedback::SetMoonMode, this, placeholders::_1)) 1291 ("Operate central pixels at 5V below nominal voltage. 0:off, 1:minimal, 2:medium, 3:maximum size."); 1239 1292 1240 1293
Note:
See TracChangeset
for help on using the changeset viewer.