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,9 +1,9 @@
#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/jungfrauPixelMask.C"
#include "/afs/psi.ch/project/mythen/sophie/sls_detector_calibration/jungfrauPedestal.C"
#include "../sls_detector_calibration/jungfrauFile.C"
#include "../sls_detector_calibration/jungfrauPixelMask.C"
#include "../sls_detector_calibration/jungfrauPedestal.C"
#include "TGraphErrors.h"
#include "TF1.h"
@ -22,7 +22,6 @@ int main(int argc, char* argv[]) {
cout << "arg 2: specify data location" << endl;
cout << "arg 3: specify pede file" << endl;
cout << "arg 4: specify data file" << endl;
cout << "eg: ./JFMC_DirectBeamScan 006 /data_pool/Module_006_161116 100us_500Hz_QS_allgain_pede_1055 100us_500Hz_QS_beam_scan_a" << endl;
cout << " " << endl;
exit(1);
}
@ -35,7 +34,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(1000); // using 1000 frames, rolling window
@ -80,15 +79,15 @@ int main(int argc, char* argv[]) {
for (int i = 0; i < 1000; i++) {
thisfile->readNextFrame();
pixelMaskObject->maskIfGainNot(0, thisfile->getFrameDataHandle(), (int*)(&pixel_mask));
pixelMaskObject->maskIfGainNot(0, thisfile->getFrameDataHandle(), pixel_mask);
}
for (int i = 0; i < 1000; i++) {
thisfile->readNextFrame();
pixelMaskObject->maskIfGainNot(1, thisfile->getFrameDataHandle(), (int*)(&pixel_mask));
pixelMaskObject->maskIfGainNot(1, thisfile->getFrameDataHandle(), pixel_mask);
}
for (int i = 0; i < 999; i++) {
thisfile->readNextFrame();
pixelMaskObject->maskIfGainNot(3, thisfile->getFrameDataHandle(), (int*)(&pixel_mask));
pixelMaskObject->maskIfGainNot(3, thisfile->getFrameDataHandle(), pixel_mask);
}
thisfile->rewind();
@ -102,7 +101,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));
}
@ -114,7 +113,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));
}
@ -126,7 +125,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));
}
@ -247,7 +246,7 @@ int main(int argc, char* argv[]) {
if (framecounter%1000 == 0) {
for (int i = 0; i < NCH; i++) {
if (pixel_mask[i] == 1) {
if (pixel_mask[i] == true) {
avg_adc_g0_map[framecounter/1000 -1]->SetBinContent((i%NC)+1,(i/NC)+1,pedestalObjectG0->pedestalOfChannel(i));
avg_adcer_g0_map[framecounter/1000 -1]->SetBinContent((i%NC)+1,(i/NC)+1,pedestalObjectG0->semOfChannel(i));
@ -352,7 +351,7 @@ int main(int argc, char* argv[]) {
TH2F* range1minmap = new TH2F("range1minmap","",NC,-0.5,NC-0.5,NR,-0.5,NR-0.5);
for (int i = 0; i < NCH; i++) {
if (pixel_mask[i] == 1) {
if (pixel_mask[i] == true) {
vector<double> r0_adc;
vector<double> r0_adcer;