Added a proper pixel mask, use it and save it.

This commit is contained in:
redford_s
2017-04-04 14:33:43 +02:00
parent 10a24f0c2c
commit 491b3b5b86

View File

@@ -85,7 +85,7 @@ int main(int argc, char* argv[]) {
adc_histos_g2[i] = new TH1I(histogramNameStreamg2.str().c_str(),"",100,0,17000);
ostringstream histogramNameStream2;
histogramNameStream2 << "gain_histos_" << i;
gain_histos[i] = new TH1I(histogramNameStream2.str().c_str(),"",100,-1,4);
gain_histos[i] = new TH1I(histogramNameStream2.str().c_str(),"",4,-0.5,3.5);
}
double filter[35];
@@ -130,6 +130,25 @@ int main(int argc, char* argv[]) {
TCanvas *c1 = new TCanvas("c1","");
// calculate pixel mask
for (int i = 0; i < 640; i++) {
thisfile->readNextFrame();
pixelMaskObject->maskIfGainNot(0, thisfile->getFrameDataHandle(), (int*)(&pixel_mask));
}
for (int i = 0; i < 640; i++) {
thisfile->readNextFrame();
pixelMaskObject->maskIfGainNot(1, thisfile->getFrameDataHandle(), (int*)(&pixel_mask));
}
for (int i = 0; i < 640; i++) {
thisfile->readNextFrame();
pixelMaskObject->maskIfGainNot(3, thisfile->getFrameDataHandle(), (int*)(&pixel_mask));
}
thisfile->rewind();
sprintf(savename,"plots/M%s/CurrentSource/pixelmask.png", module_str.c_str());
pixelMaskObject->plotPixelMask(pixel_mask,savename);
cout << "after chip mask, n masked pixels is " << pixelMaskObject->getNMasked(pixel_mask) << endl;
for (int j = 0; j < 640; j++) {
frame_counter++;
thisfile->readNextFrame();
@@ -249,9 +268,7 @@ int main(int argc, char* argv[]) {
int last_frame = 0;
if (module_str == "032" || module_str == "021" || module_str == "022") {
last_frame = 19199;
} else if (module_str == "006" || module_str == "008") {
last_frame = 24319;
} else if (module_str == "044") {
} else if (module_str == "006" || module_str == "008" || module_str == "044") {
last_frame = 24319;
}