Changeset 17647 for trunk/FACT++
- Timestamp:
- 04/03/14 19:35:18 (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/FACT++/src/feedback.cc
r17234 r17647 10 10 #include "Console.h" 11 11 #include "externals/PixelMap.h" 12 #include "externals/Interpolator2D.h"13 12 14 13 #include "tools.h" … … 491 490 */ 492 491 492 double UdrpAvg = 0; 493 double UdrpRms = 0; 494 493 495 for (int i=0; i<320/*BIAS::kNumChannels*/; i++) 494 496 { … … 526 528 527 529 // This is assuming that the broken pixels have a 390 Ohm instead of 3900 Ohm serial resistor 528 if (i==66) // Pixel 830(66) 529 R5 = 300; // 2400 = 1/(3/3900 + 1/390) 530 if (i==191 || i==193) // Pixel 583(191) / Pixel 1401(193) 531 R5 = 390/1.4; // 379 = 1/(4/3900 + 1/390) 530 if (i==66 || i==193) // Pixel 830(66) / Pixel 583(191) 531 R5 = 1./((N-1)/3900.+1/1000.); 532 if (i==191) // Pixel 1399(193) 533 R5 = 1./((N-1)/3900.+1/390.); 534 if (i==17 || i==206) // dead pixel 923(80) / dead pixel 424(927) 535 R5 = 3900./(N-1); // cannot identify third dead pixel in light-pulser data 532 536 533 537 // The measurement resistor 534 const double R8 = 100;538 const double R8 = 0; 535 539 536 540 // Total resistance of branch with diodes (R4+R5) … … 543 547 // we get: 544 548 // 545 // I[R=3900] = Iout * 1/(10+(N-1)) 546 // I[R= 390] = Iout * (1 - 1/ 549 // I[R=3900] = Iout * 1/(10+(N-1)) = Iout /(N+9) 550 // I[R= 390] = Iout * (1 - 1/(10+(N-1))) = Iout * (N+8)/(N+9) 547 551 // 548 552 // I[R=390] / I[R=3900] = N+8 … … 551 555 552 556 // Voltage drop in R4/R5 branch (for the G-APDs with correct resistor) 553 const double Udrp = R*Iout; 557 // The voltage drop should not be <0, otherwise an unphysical value 558 // would be amplified when Uset is calculated. 559 const double Udrp = Iout<0 ? 0 : R*Iout; 554 560 555 561 // Nominal breakdown voltage with correction for temperature dependence … … 558 564 // Current overvoltage (at a G-APD with the correct 3900 Ohm resistor) 559 565 //const double Uov = U9-Udrp-Ubd>0 ? U9-Udrp-Ubd : 0; 560 const double Uov = U9-Udrp-Ubd>-0. 34 ? U9-Udrp-Ubd : -0.34;566 const double Uov = U9-Udrp-Ubd>-0.44/*-0.34*/ ? U9-Udrp-Ubd : -0.44/*-0.34*/; 561 567 562 568 // Iout linear with U9 above Ubd … … 581 587 double Iapd = Iout/N; 582 588 589 // Rtot = Uapd/Iout 590 // Ich = Uapd/Rch = (Rtot*Iout) / Rch = Rtot/Rch * Iout 591 // 592 // Rtot = 3900/N 593 // Rch = 3900 594 // 595 // Rtot = 1./((N-1)/3900 + 1/X) X=390 or X=1000 596 // Rch = 3900 597 // 598 // Rtot/Rch = 1/((N-1)/3900 + 1/X)/3900 599 // Rtot/Rch = 1/( [ X*(N-1) + 3900 ] / [ 3900 * X ])/3900 600 // Rtot/Rch = X/( [ X*(N-1)/3900 + 1 ] )/3900 601 // Rtot/Rch = X/( [ X*(N-1) + 3900 ] ) 602 // Rtot/Rch = 1/( [ (N-1) + 3900/X ] ) 603 // 604 // Rtot/Rch[390Ohm] = 1/( [ N + 9.0 ] ) 605 // Rtot/Rch[1000Ohm] = 1/( [ N + 2.9 ] ) 606 // 583 607 // In this and the previosu case we neglect the resistance of the G-APDs, but we can make an 584 608 // assumption: The differential resistance depends more on the NSB than on the PDE, … … 588 612 // resistor is large enough that the increase of the overvoltage does not dramatically 589 613 // increase the current flow as compared to the total current flow. 590 if (i==66 || i==191 || i==193) 591 Iapd = Iout/(N+9); // Iapd = R5*Iout/3900; 614 if (i==66 || i==193) // Iout/13 15.8 / Iout/14 16.8 615 Iapd = Iout/(N+2.9); 616 if (i==191) // Iout/7.9 38.3 617 Iapd = Iout/(N+9); 618 if (i==17 || i==206) 619 Iapd = Iout/(N-1); 620 621 622 // 3900 + Rapd = I0 -> Uapd = Utot - 3900*I0 623 // 3900 + Rapd = I0 -> Uapd = Utot - 3900*I0 624 // 3900 + Rapd = I0 -> Uapd = Utot - 3900*I0 625 // 390 + Rx = Ix -> Uapd = Utot - 390*Ix 626 627 // Iout = N*I0 + Ix 592 628 593 629 // The differential resistance of the G-APD, i.e. the dependence of the … … 600 636 //const double Uset = Ubd + overvoltage + R*Iov*N; 601 637 //const double Uset = Uov<0.3 ? Ubd + overvoltage + Udrp : Ubd + overvoltage + Udrp*pow(overvoltage/Uov, 1.66); 602 const double Uset = Uov<0 ? 603 Ubd + overvoltage + Udrp*pow(overvoltage/0.34+1, 1.66) : 604 Ubd + overvoltage + Udrp*pow((overvoltage+0.34)/(Uov+0.34), 1.66); 638 const double Uset = 639 640 // Uov<0 ? 641 // Ubd + overvoltage + Udrp*pow(overvoltage/0.44/*0.34*/+1, 1.85/*1.66*/) : 642 // Ubd + overvoltage + Udrp*pow((overvoltage+0.44/*0.34*/)/(Uov+0.44/*0.34*/), 1.85/*1.66*/); 643 644 // Uov<0 ? 645 // Ubd + overvoltage + Udrp*pow(overvoltage+0.44, 1.3213+0.2475*(overvoltage+0.44)) : 646 // Ubd + overvoltage + Udrp*pow(overvoltage+0.44, 1.3213+0.2475*(overvoltage+0.44))/pow(Uov+0.44, 1.3213+0.2475*(Uov+0.44)); 647 648 // This estimation is based on the linear increase of the 649 // gain with voltage and the increase of the crosstalk with 650 // voltage, as measured with the overvoltage-tests (OVTEST) 651 652 Uov+0.44<0.022 ? 653 Ubd + overvoltage + Udrp* 654 exp(0.6*(overvoltage-Uov))*pow((overvoltage+0.44), 0.6) : 655 Ubd + overvoltage + Udrp* 656 exp(0.6*(overvoltage-Uov))*pow((overvoltage+0.44)/(Uov+0.44), 0.6); 657 658 659 605 660 606 661 if (fabs(overvoltage-Uov)>0.033) … … 643 698 644 699 med[2][num[2]++] = iapd; 700 701 UdrpAvg += Udrp; 702 UdrpRms += Udrp*Udrp; 645 703 } 646 704 } … … 655 713 vec.data(), BIAS::kNumChannels*sizeof(float)); 656 714 715 UdrpAvg /= 320; 716 UdrpRms /= 320; 717 UdrpRms -= UdrpAvg*UdrpAvg; 718 UdrpRms = UdrpRms<0 ? 0 : sqrt(UdrpRms); 719 657 720 ostringstream msg; 658 msg << setprecision(4) << "Sending new absolute offset: dU(" << fTemp << "degC)=" << fTempOffsetAvg << "V+-" << fTempOffsetRms << ", Unom=" << overvoltage << "V, Uov=" << (num[0]+num[1]>0?(avg[0]+avg[1])/(num[0]+num[1]):0) << " [N=" << Ndev[0] << "/" << Ndev[1] << "/" << Ndev[2] << "]"; 721 msg << fixed; 722 msg << setprecision(2) << "Sending U: dU(" << fTemp << "degC)=" 723 << setprecision(3) << fTempOffsetAvg << "V+-" << fTempOffsetRms << " Udrp=" 724 << UdrpAvg << "V+-" << UdrpRms; 725 msg.unsetf(ios_base::floatfield); 726 msg << " Unom=" << overvoltage << "V Uov=" << (num[0]+num[1]>0?(avg[0]+avg[1])/(num[0]+num[1]):0) << " [N=" << Ndev[0] << "/" << Ndev[1] << "/" << Ndev[2] << "]"; 659 727 Info(msg); 660 728 }
Note:
See TracChangeset
for help on using the changeset viewer.