Added pedestal plots.
This commit is contained in:
@@ -57,6 +57,14 @@ int main(int argc, char* argv[]) {
|
||||
jungfrauPedestal *pedestalObject = new jungfrauPedestal();
|
||||
pedestalObject->pedestalSetNFrames(640);
|
||||
|
||||
TH2F* pedestalsG0 = new TH2F("pedestalsG0","",NC,-0.5,NC-0.5,NR,-0.5,NR-0.5);
|
||||
TH2F* pedestalsG1 = new TH2F("pedestalsG1","",NC,-0.5,NC-0.5,NR,-0.5,NR-0.5);
|
||||
TH2F* pedestalsG2 = new TH2F("pedestalsG2","",NC,-0.5,NC-0.5,NR,-0.5,NR-0.5);
|
||||
|
||||
TH2F* pedeRMSG0 = new TH2F("pedeRMSG0","",NC,-0.5,NC-0.5,NR,-0.5,NR-0.5);
|
||||
TH2F* pedeRMSG1 = new TH2F("pedeRMSG1","",NC,-0.5,NC-0.5,NR,-0.5,NR-0.5);
|
||||
TH2F* pedeRMSG2 = new TH2F("pedeRMSG2","",NC,-0.5,NC-0.5,NR,-0.5,NR-0.5);
|
||||
|
||||
jungfrauPixelMask *pixelMaskObject = new jungfrauPixelMask();
|
||||
static int pixel_mask [NCH];
|
||||
pixelMaskObject->initialisePixelMask(pixel_mask);
|
||||
@@ -70,8 +78,6 @@ int main(int argc, char* argv[]) {
|
||||
pixelMaskObject->maskSupercolumn(4,2, pixel_mask);
|
||||
}
|
||||
|
||||
int frame_counter = 0;
|
||||
|
||||
static TH1I *adc_histos_g1 [NCH];
|
||||
static TH1I *adc_histos_g2 [NCH];
|
||||
static TH1I *gain_histos [NCH];
|
||||
@@ -116,18 +122,9 @@ int main(int argc, char* argv[]) {
|
||||
static double adcmeanerrs_g1[NCH][35];
|
||||
static double adcmeanerrs_g2[NCH][35];
|
||||
|
||||
float pede_ene[1];
|
||||
double pede_ene[1];
|
||||
pede_ene[0] = 0.01;
|
||||
|
||||
float pede_val1[NCH];
|
||||
float pede_val2[NCH];
|
||||
|
||||
TCanvas *mapcanvas = new TCanvas("mapcanvas","",150,10,800,400);
|
||||
mapcanvas->SetLeftMargin(0.1);
|
||||
mapcanvas->SetRightMargin(0.13);
|
||||
mapcanvas->SetTopMargin(0.08);
|
||||
mapcanvas->SetBottomMargin(0.15);
|
||||
|
||||
TCanvas *c1 = new TCanvas("c1","");
|
||||
|
||||
// calculate pixel mask
|
||||
@@ -149,40 +146,105 @@ int main(int argc, char* argv[]) {
|
||||
pixelMaskObject->plotPixelMask(pixel_mask,savename);
|
||||
cout << "after chip mask, n masked pixels is " << pixelMaskObject->getNMasked(pixel_mask) << endl;
|
||||
|
||||
// calculate pedestals
|
||||
for (int j = 0; j < 640; j++) {
|
||||
frame_counter++;
|
||||
thisfile->readNextFrame();
|
||||
pedestalObject->addFrameToPedestalCalculation(thisfile->getFrameDataHandle());
|
||||
}
|
||||
cout << pedestalObject->pedestalOfChannel(0) << endl;
|
||||
cout << pedestalObject->rmsOfChannel(0) << endl;
|
||||
pedestalObject->pedestalClear();
|
||||
|
||||
for (int j = 0; j < 640; j++) {
|
||||
frame_counter++;
|
||||
thisfile->readNextFrame();
|
||||
pedestalObject->addFrameToPedestalCalculation(thisfile->getFrameDataHandle());
|
||||
}
|
||||
for (int i = 0; i < NCH; i++) {
|
||||
pede_val1[i] = pedestalObject->pedestalOfChannel(i);
|
||||
if (pixel_mask[i] == 1) {
|
||||
pedestalsG0->Fill(i%NC,i/NC,pedestalObject->pedestalOfChannel(i));
|
||||
pedeRMSG0->Fill(i%NC,i/NC,pedestalObject->rmsOfChannel(i));
|
||||
}
|
||||
}
|
||||
cout << pedestalObject->pedestalOfChannel(0) << endl;
|
||||
cout << pedestalObject->rmsOfChannel(0) << endl;
|
||||
pedestalObject->pedestalClear();
|
||||
|
||||
for (int j = 0; j < 640; j++) {
|
||||
frame_counter++;
|
||||
thisfile->readNextFrame();
|
||||
pedestalObject->addFrameToPedestalCalculation(thisfile->getFrameDataHandle());
|
||||
}
|
||||
for (int i = 0; i < NCH; i++) {
|
||||
pede_val2[i] = pedestalObject->pedestalOfChannel(i);
|
||||
if (pixel_mask[i] == 1) {
|
||||
pedestalsG1->Fill(i%NC,i/NC,pedestalObject->pedestalOfChannel(i));
|
||||
pedeRMSG1->Fill(i%NC,i/NC,pedestalObject->rmsOfChannel(i));
|
||||
}
|
||||
}
|
||||
cout << pedestalObject->pedestalOfChannel(0) << endl;
|
||||
cout << pedestalObject->rmsOfChannel(0) << endl;
|
||||
pedestalObject->pedestalClear();
|
||||
|
||||
for (int j = 0; j < 640; j++) {
|
||||
thisfile->readNextFrame();
|
||||
pedestalObject->addFrameToPedestalCalculation(thisfile->getFrameDataHandle());
|
||||
}
|
||||
for (int i = 0; i < NCH; i++) {
|
||||
if (pixel_mask[i] == 1) {
|
||||
pedestalsG2->Fill(i%NC,i/NC,pedestalObject->pedestalOfChannel(i));
|
||||
pedeRMSG2->Fill(i%NC,i/NC,pedestalObject->rmsOfChannel(i));
|
||||
}
|
||||
}
|
||||
pedestalObject->pedestalClear();
|
||||
|
||||
thisfile->close();
|
||||
|
||||
TCanvas *mapcanvas = new TCanvas("mapcanvas","",150,10,800,400);
|
||||
mapcanvas->SetLeftMargin(0.1);
|
||||
mapcanvas->SetRightMargin(0.13);
|
||||
mapcanvas->SetTopMargin(0.08);
|
||||
mapcanvas->SetBottomMargin(0.15);
|
||||
|
||||
pedestalsG0->GetXaxis()->SetTitle("Column");
|
||||
pedestalsG0->GetYaxis()->SetTitle("Row");
|
||||
pedestalsG0->GetYaxis()->SetTitleOffset(0.7);
|
||||
pedestalsG0->Draw("colz");
|
||||
sprintf(savename,"plots/M%s/CurrentSource/pedeG0.png", module_str.c_str());
|
||||
mapcanvas->SaveAs((const char *)(savename));
|
||||
|
||||
pedestalsG1->GetXaxis()->SetTitle("Column");
|
||||
pedestalsG1->GetYaxis()->SetTitle("Row");
|
||||
pedestalsG1->GetYaxis()->SetTitleOffset(0.7);
|
||||
pedestalsG1->Draw("colz");
|
||||
sprintf(savename,"plots/M%s/CurrentSource/pedeG1.png", module_str.c_str());
|
||||
mapcanvas->SaveAs((const char *)(savename));
|
||||
|
||||
pedestalsG2->GetXaxis()->SetTitle("Column");
|
||||
pedestalsG2->GetYaxis()->SetTitle("Row");
|
||||
pedestalsG2->GetYaxis()->SetTitleOffset(0.7);
|
||||
pedestalsG2->Draw("colz");
|
||||
sprintf(savename,"plots/M%s/CurrentSource/pedeG2.png", module_str.c_str());
|
||||
mapcanvas->SaveAs((const char *)(savename));
|
||||
|
||||
pedeRMSG0->GetXaxis()->SetTitle("Column");
|
||||
pedeRMSG0->GetYaxis()->SetTitle("Row");
|
||||
pedeRMSG0->GetYaxis()->SetTitleOffset(0.7);
|
||||
pedeRMSG0->GetZaxis()->SetRangeUser(0,25);
|
||||
pedeRMSG0->Draw("colz");
|
||||
sprintf(savename,"plots/M%s/CurrentSource/pedeRMSG0.png", module_str.c_str());
|
||||
mapcanvas->SaveAs((const char *)(savename));
|
||||
|
||||
pedeRMSG1->GetXaxis()->SetTitle("Column");
|
||||
pedeRMSG1->GetYaxis()->SetTitle("Row");
|
||||
pedeRMSG1->GetYaxis()->SetTitleOffset(0.7);
|
||||
if (module_str == "006") {
|
||||
pedeRMSG1->GetZaxis()->SetRangeUser(0,400);
|
||||
} else if (module_str == "008" || module_str == "021" || module_str == "022" || module_str == "032" || module_str == "044") {
|
||||
pedeRMSG1->GetZaxis()->SetRangeUser(0,15);
|
||||
}
|
||||
pedeRMSG1->Draw("colz");
|
||||
sprintf(savename,"plots/M%s/CurrentSource/pedeRMSG1.png", module_str.c_str());
|
||||
mapcanvas->SaveAs((const char *)(savename));
|
||||
|
||||
pedeRMSG2->GetXaxis()->SetTitle("Column");
|
||||
pedeRMSG2->GetYaxis()->SetTitle("Row");
|
||||
pedeRMSG2->GetYaxis()->SetTitleOffset(0.7);
|
||||
if (module_str == "006") {
|
||||
pedeRMSG2->GetZaxis()->SetRangeUser(0,400);
|
||||
} else if (module_str == "008" || module_str == "021" || module_str == "022" || module_str == "032" || module_str == "044") {
|
||||
pedeRMSG2->GetZaxis()->SetRangeUser(0,15);
|
||||
}
|
||||
pedeRMSG2->Draw("colz");
|
||||
sprintf(savename,"plots/M%s/CurrentSource/pedeRMSG2.png", module_str.c_str());
|
||||
mapcanvas->SaveAs((const char *)(savename));
|
||||
|
||||
int frame_counter = 0;
|
||||
int j = 0;
|
||||
int nfiles = 0;
|
||||
if (module_str == "032" || module_str == "021" || module_str == "022") {
|
||||
@@ -461,8 +523,8 @@ int main(int argc, char* argv[]) {
|
||||
|
||||
if (r1_adc.size() > 1 && r3_adc.size() > 1) {
|
||||
|
||||
float this_pede_val1[1] = {pede_val1[i]};
|
||||
float this_pede_val2[1] = {pede_val2[i]};
|
||||
double this_pede_val1[1] = {pedestalsG1->GetBinContent((i%NC)+1,(i/NC)+1)};
|
||||
double this_pede_val2[1] = {pedestalsG2->GetBinContent((i%NC)+1,(i/NC)+1)};
|
||||
|
||||
TGraph *grap_p1 = new TGraph(1,pede_ene,this_pede_val1);
|
||||
TGraph *grap_p2 = new TGraph(1,pede_ene,this_pede_val2);
|
||||
|
||||
Reference in New Issue
Block a user