Commit cd8cf4be authored by Mauro Dinardo's avatar Mauro Dinardo
Browse files

Implemented pixel unstuck in pixelalive

parent 10271ba0
......@@ -445,11 +445,10 @@ float RD53Interface::ReadChipMonitor(ReadoutChip* pChip, const char* observableN
{
this->setBoard(pChip->getBeBoardId());
const float measError = 4.0; // Current or Voltage measurement error due to MONITOR_CONFIG resolution [%]
const unsigned int actualVoltRescale = 2; // Voltage scale factor: measured voltage is 1/2 of actual voltage in order to measure values which are greater than ADC swing (which is ~0.9 V)
float value;
bool isCurrentNotVoltage;
uint32_t voltageObservable(0), currentObservable(0), observable;
const float measError = 4.0; // Current or Voltage measurement error due to MONITOR_CONFIG resolution [%]
float value;
bool isCurrentNotVoltage;
uint32_t voltageObservable(0), currentObservable(0), observable;
const std::unordered_map<std::string, uint32_t> currentMultiplexer = {
{"Iref", 0x00}, {"IBIASP1_SYNC", 0x01}, {"IBIASP2_SYNC", 0x02}, {"IBIAS_DISC_SYNC", 0x03}, {"IBIAS_SF_SYNC", 0x04}, {"ICTRL_SYNCT_SYNC", 0x05}, {"IBIAS_KRUM_SYNC", 0x06},
......@@ -492,7 +491,7 @@ float RD53Interface::ReadChipMonitor(ReadoutChip* pChip, const char* observableN
}
else
{
value = measureVoltageCurrent(pChip, observable, isCurrentNotVoltage) * (isCurrentNotVoltage == true ? 1 : actualVoltRescale);
value = measureVoltageCurrent(pChip, observable, isCurrentNotVoltage);
LOG(INFO) << BOLDBLUE << "\t--> " << observableName << ": " << BOLDYELLOW << std::setprecision(3) << value << " +/- " << value * measError / 100 << BOLDBLUE
<< (isCurrentNotVoltage == true ? " uA" : " V") << std::setprecision(-1) << RESET;
}
......
......@@ -190,6 +190,7 @@
<Setting name="ThrStop"> 440 </Setting>
<Setting name="TargetThr"> 2000 </Setting>
<Setting name="TargetOcc"> 1e-6 </Setting>
<Setting name="UnstuckPixels"> 1 </Setting>
<Setting name="ThrEquResetTDAC"> 0 </Setting>
......
......@@ -27,6 +27,7 @@ void PixelAlive::ConfigureCalibration()
nHITxCol = this->findValueInSettings("nHITxCol");
doFast = this->findValueInSettings("DoFast");
thrOccupancy = this->findValueInSettings("TargetOcc");
unstuckPixels = this->findValueInSettings("UnstuckPixels");
doDisplay = this->findValueInSettings("DisplayHisto");
doUpdateChip = this->findValueInSettings("UpdateChipCfg");
saveBinaryData = this->findValueInSettings("SaveBinaryData");
......@@ -247,8 +248,12 @@ std::shared_ptr<DetectorDataContainer> PixelAlive::analyze()
->at(cChip->getIndex())
->getChannel<OccupancyAndPh>(row, col)
.fOccupancy;
static_cast<RD53*>(cChip)->enablePixel(row, col, injType == INJtype::None ? occupancy <= thrOccupancy : occupancy >= thrOccupancy);
if((*static_cast<RD53*>(cChip)->getPixelsMask())[col].Enable[row] == false) nMaskedPixelsPerCalib++;
bool enable = (injType == INJtype::None ? occupancy <= thrOccupancy : occupancy >= thrOccupancy);
if(unstuckPixels == false)
static_cast<RD53*>(cChip)->enablePixel(row, col, enable);
else if(enable == false)
static_cast<RD53*>(cChip)->setTDAC(row, col, 0);
if(enable == false) nMaskedPixelsPerCalib++;
}
LOG(INFO) << BOLDBLUE << "\t--> Number of potentially masked pixels in this iteration: " << BOLDYELLOW << nMaskedPixelsPerCalib << RESET;
......
......@@ -59,6 +59,7 @@ class PixelAlive : public Tool
size_t injType;
size_t nHITxCol;
float thrOccupancy;
bool unstuckPixels;
enum INJtype
{
None,
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment