Pixel mask as bool, and some repointing.

This commit is contained in:
redford_s
2018-05-07 16:18:27 +02:00
parent b50bd83c4c
commit 500ef26b36
9 changed files with 90 additions and 93 deletions

View File

@ -1,11 +1,11 @@
// file to take current source scan files, analyse and plot them.
#include "/afs/psi.ch/project/mythen/sophie/sls_detector_calibration/jungfrauCommonHeader.h"
#include "/afs/psi.ch/project/mythen/sophie/sls_detector_calibration/jungfrauCommonFunctions.h"
#include "../sls_detector_calibration/jungfrauCommonHeader.h"
#include "../sls_detector_calibration/jungfrauCommonFunctions.h"
#include "/afs/psi.ch/project/mythen/sophie/sls_detector_calibration/jungfrauFile.C"
#include "/afs/psi.ch/project/mythen/sophie/sls_detector_calibration/jungfrauPedestal.C"
#include "/afs/psi.ch/project/mythen/sophie/sls_detector_calibration/jungfrauPixelMask.C"
#include "../sls_detector_calibration/jungfrauFile.C"
#include "../sls_detector_calibration/jungfrauPedestal.C"
#include "../sls_detector_calibration/jungfrauPixelMask.C"
#include "TGraph.h"
#include "TGraphErrors.h"
@ -104,7 +104,7 @@ int main(int argc, char* argv[]) {
jungfrauFile *thisfile = new jungfrauFile();
jungfrauPixelMask *pixelMaskObject = new jungfrauPixelMask();
static int pixel_mask [NCH];
bool pixel_mask [NCH];
jungfrauPedestal *pedestalObject = new jungfrauPedestal();
pedestalObject->pedestalSetNFrames(640);
@ -167,19 +167,19 @@ int main(int argc, char* argv[]) {
for (int i = 0; i < 640; i++) {
thisfile->readNextFrame();
pixelMaskObject->maskIfGainNot(0, thisfile->getFrameDataHandle(), (int*)(&pixel_mask));
pixelMaskObject->maskIfGainNot(0, thisfile->getFrameDataHandle(), pixel_mask);
}
cout << "after G0, n masked pixels is " << pixelMaskObject->getNMasked(pixel_mask) << endl;
for (int i = 0; i < 640; i++) {
thisfile->readNextFrame();
pixelMaskObject->maskIfGainNot(1, thisfile->getFrameDataHandle(), (int*)(&pixel_mask));
pixelMaskObject->maskIfGainNot(1, thisfile->getFrameDataHandle(), pixel_mask);
}
cout << "after G1, n masked pixels is " << pixelMaskObject->getNMasked(pixel_mask) << endl;
for (int i = 0; i < 640; i++) {
thisfile->readNextFrame();
pixelMaskObject->maskIfGainNot(3, thisfile->getFrameDataHandle(), (int*)(&pixel_mask));
pixelMaskObject->maskIfGainNot(3, thisfile->getFrameDataHandle(), pixel_mask);
}
cout << "after G2, n masked pixels is " << pixelMaskObject->getNMasked(pixel_mask) << endl;
@ -195,7 +195,7 @@ int main(int argc, char* argv[]) {
pedestalObject->addFrameToPedestalCalculation(thisfile->getFrameDataHandle());
}
for (int i = 0; i < NCH; i++) {
if (pixel_mask[i] == 1) {
if (pixel_mask[i] == true) {
pedestalsG0->Fill(i%NC,i/NC,pedestalObject->pedestalOfChannel(i));
pedeRMSG0->Fill(i%NC,i/NC,pedestalObject->rmsOfChannel(i));
}
@ -207,7 +207,7 @@ int main(int argc, char* argv[]) {
pedestalObject->addFrameToPedestalCalculation(thisfile->getFrameDataHandle());
}
for (int i = 0; i < NCH; i++) {
if (pixel_mask[i] == 1) {
if (pixel_mask[i] == true) {
pedestalsG1->Fill(i%NC,i/NC,pedestalObject->pedestalOfChannel(i));
pedeRMSG1->Fill(i%NC,i/NC,pedestalObject->rmsOfChannel(i));
}
@ -219,7 +219,7 @@ int main(int argc, char* argv[]) {
pedestalObject->addFrameToPedestalCalculation(thisfile->getFrameDataHandle());
}
for (int i = 0; i < NCH; i++) {
if (pixel_mask[i] == 1) {
if (pixel_mask[i] == true) {
pedestalsG2->Fill(i%NC,i/NC,pedestalObject->pedestalOfChannel(i));
pedeRMSG2->Fill(i%NC,i/NC,pedestalObject->rmsOfChannel(i));
}
@ -387,7 +387,7 @@ int main(int argc, char* argv[]) {
for (int i = 0; i < NCH; i++) {
if ((j-1) < 10 || (j > 8075 && j < 8085)) {
if (pixel_mask[i] == 1) {
if (pixel_mask[i] == true) {
uint16_t adc = imagedptr[i]&0x3fff;
uint16_t gain = (imagedptr[i]&0xc000) >> 14;
adcmap_all->Fill(i%NC,i/NC,adc);
@ -398,7 +398,7 @@ int main(int argc, char* argv[]) {
if (((i/NC <= 255) && (i%64 == (j-1)%64)) ||
((i/NC >= 256) &&((-1*(i-524287))%64 == (j-1)%64))) {
if (pixel_mask[i] == 1) {
if (pixel_mask[i] == true) {
uint16_t adc = imagedptr[i]&0x3fff;
uint16_t gain = (imagedptr[i]&0xc000) >> 14;
@ -474,7 +474,7 @@ int main(int argc, char* argv[]) {
}
for (int i = 0; i < NCH; i++) {
if (pixel_mask[i] == 1) {
if (pixel_mask[i] == true) {
gainmap_avg->Fill(i%NC,i/NC,gain_histos[i]->GetMean());
adcmap_avg_g0[j/640-1]->Fill(i%NC,i/NC,adc_histos_g0[i]->GetMean());
@ -799,7 +799,7 @@ int main(int argc, char* argv[]) {
for (int i = 0; i < NCH; i++) {
if (pixel_mask[i] == 1) {
if (pixel_mask[i] == true) {
vector<double> r0_adc;
vector<double> r0_filter;