Better filtering of saturation.
Previously, saturated data points were not used, but steps including saturated steps will then still be biased. Now, if any point within a step saturates the step is not used. Results look better both per pixel and overall. Note this requires full rerun (createHistoFile).
This commit is contained in:
@ -205,6 +205,9 @@ int main(int argc, char* argv[]) {
|
|||||||
jungfrauPixelMask *pixelMaskObject = new jungfrauPixelMask();
|
jungfrauPixelMask *pixelMaskObject = new jungfrauPixelMask();
|
||||||
bool pixel_mask [NCH];
|
bool pixel_mask [NCH];
|
||||||
|
|
||||||
|
bool saturation_mask [NCH];
|
||||||
|
std::fill_n(saturation_mask, NCH, true);
|
||||||
|
|
||||||
jungfrauPedestal *pedestalObject = new jungfrauPedestal();
|
jungfrauPedestal *pedestalObject = new jungfrauPedestal();
|
||||||
pedestalObject->pedestalSetNFrames(640);
|
pedestalObject->pedestalSetNFrames(640);
|
||||||
|
|
||||||
@ -481,14 +484,15 @@ int main(int argc, char* argv[]) {
|
|||||||
uint16_t adc = imagedptr[i]&0x3fff;
|
uint16_t adc = imagedptr[i]&0x3fff;
|
||||||
uint16_t gain = (imagedptr[i]&0xc000) >> 14;
|
uint16_t gain = (imagedptr[i]&0xc000) >> 14;
|
||||||
|
|
||||||
if (adc > 0) {
|
gain_histos[i]->Fill(gain);
|
||||||
gain_histos[i]->Fill(gain);
|
if (gain == 0) {
|
||||||
if (gain == 0) {
|
adc_histos_g0[i]->Fill(adc);
|
||||||
adc_histos_g0[i]->Fill(adc);
|
} else if (gain == 1) {
|
||||||
} else if (gain == 1) {
|
adc_histos_g1[i]->Fill(adc);
|
||||||
adc_histos_g1[i]->Fill(adc);
|
} else if (gain == 3) {
|
||||||
} else if (gain == 3) {
|
adc_histos_g2[i]->Fill(adc);
|
||||||
adc_histos_g2[i]->Fill(adc);
|
if (adc == 0) {
|
||||||
|
saturation_mask[i] = false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -560,9 +564,11 @@ int main(int argc, char* argv[]) {
|
|||||||
adcermap_avg_g0[j/640-1]->Fill(i%NC,i/NC,adc_histos_g0[i]->GetMeanError());
|
adcermap_avg_g0[j/640-1]->Fill(i%NC,i/NC,adc_histos_g0[i]->GetMeanError());
|
||||||
adcmap_avg_g1[j/640-1]->Fill(i%NC,i/NC,adc_histos_g1[i]->GetMean());
|
adcmap_avg_g1[j/640-1]->Fill(i%NC,i/NC,adc_histos_g1[i]->GetMean());
|
||||||
adcermap_avg_g1[j/640-1]->Fill(i%NC,i/NC,adc_histos_g1[i]->GetMeanError());
|
adcermap_avg_g1[j/640-1]->Fill(i%NC,i/NC,adc_histos_g1[i]->GetMeanError());
|
||||||
adcmap_avg_g2[j/640-1]->Fill(i%NC,i/NC,adc_histos_g2[i]->GetMean());
|
if (saturation_mask[i] == true) {
|
||||||
adcermap_avg_g2[j/640-1]->Fill(i%NC,i/NC,adc_histos_g2[i]->GetMeanError());
|
adcmap_avg_g2[j/640-1]->Fill(i%NC,i/NC,adc_histos_g2[i]->GetMean());
|
||||||
|
adcermap_avg_g2[j/640-1]->Fill(i%NC,i/NC,adc_histos_g2[i]->GetMeanError());
|
||||||
|
}
|
||||||
|
|
||||||
if (gain_histos[i]->GetEntries() > 0) {
|
if (gain_histos[i]->GetEntries() > 0) {
|
||||||
gain_avg->Fill(gain_histos[i]->GetMean());
|
gain_avg->Fill(gain_histos[i]->GetMean());
|
||||||
}
|
}
|
||||||
@ -573,7 +579,9 @@ int main(int argc, char* argv[]) {
|
|||||||
adc_avg_g1->Fill(adc_histos_g1[i]->GetMean());
|
adc_avg_g1->Fill(adc_histos_g1[i]->GetMean());
|
||||||
}
|
}
|
||||||
if (adc_histos_g2[i]->GetEntries() > 0) {
|
if (adc_histos_g2[i]->GetEntries() > 0) {
|
||||||
adc_avg_g2->Fill(adc_histos_g2[i]->GetMean());
|
if (saturation_mask[i] == true) {
|
||||||
|
adc_avg_g2->Fill(adc_histos_g2[i]->GetMean());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
gain_histos[i]->Reset();
|
gain_histos[i]->Reset();
|
||||||
@ -672,6 +680,7 @@ int main(int argc, char* argv[]) {
|
|||||||
adc_avg_g0->Reset();
|
adc_avg_g0->Reset();
|
||||||
adc_avg_g1->Reset();
|
adc_avg_g1->Reset();
|
||||||
adc_avg_g2->Reset();
|
adc_avg_g2->Reset();
|
||||||
|
std::fill_n(saturation_mask, NCH, true);
|
||||||
}
|
}
|
||||||
} // end of while
|
} // end of while
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user