Subversion Repositories f9daq

Compare Revisions

Ignore whitespace Rev 49 → Rev 50

/sipmScan/examples/biasScan.C
99,6 → 99,103
canvas01->cd();
TH2F* h_bias = (TH2F*) rootfile->Get("h_bias");
h_bias->Draw("colz");
 
TCanvas* canvas02 = new TCanvas("canvas02","",800, 800);
//canvas02->Divide(2,2);
canvas02->cd();
TH3F* h_biasThreshold = (TH3F*) rootfile->Get("h_biasThreshold");
//h_biasThreshold->Draw();
//canvas02->cd(2);
//h_biasThreshold->GetXaxis()->SetRange(1,5);
h_biasThreshold->Project3D("zy");
h_biasThreshold_zy->DrawCopy("colz");
 
TCanvas* canvas03 = new TCanvas("canvas03","",1200, 1200);
canvas03->Divide(4,4);
int x1=0;
int x2=3;
int y1=0;
int y2=3;
for(int j=x1; j<=x2; j++){
for(int k=y1; k<=y2; k++){
int channel = map[j][k];
int canvasPosition = 4*(4-k-1) + 4 - j;
canvas03->cd(canvasPosition);
h_biasThreshold->GetXaxis()->SetRange(channel+1,channel+1);
char histoName[128];
sprintf(histoName, "Ch %d", channel);
h_biasThreshold->Project3D("zy");
//sprintf(option, "h_biasThresholsd_zy%f", channel);
h_biasThreshold_zy->SetTitle(histoName);
h_biasThreshold_zy->DrawCopy("colz");
 
}
}
TCanvas* canvas04 = new TCanvas("canvas04","",1200, 1200);
canvas04->Divide(4,4);
int x1=0;
int x2=3;
int y1=4;
int y2=7;
for(int j=x1; j<=x2; j++){
for(int k=y1; k<=y2; k++){
int channel = map[j][k];
int canvasPosition = 4*(8-k-1) + 4 - j;
canvas04->cd(canvasPosition);
h_biasThreshold->GetXaxis()->SetRange(channel+1,channel+1);
char histoName[128];
sprintf(histoName, "Ch %d", channel);
h_biasThreshold->Project3D("zy");
//sprintf(option, "h_biasThresholsd_zy%f", channel);
h_biasThreshold_zy->SetTitle(histoName);
h_biasThreshold_zy->DrawCopy("colz");
 
}
}
TCanvas* canvas05 = new TCanvas("canvas05","",1200, 1200);
canvas05->Divide(4,4);
int x1=4;
int x2=7;
int y1=0;
int y2=3;
for(int j=x1; j<=x2; j++){
for(int k=y1; k<=y2; k++){
int channel = map[j][k];
int canvasPosition = 4*(4-k-1) + 8 - j;
canvas05->cd(canvasPosition);
h_biasThreshold->GetXaxis()->SetRange(channel+1,channel+1);
char histoName[128];
sprintf(histoName, "Ch %d", channel);
h_biasThreshold->Project3D("zy");
//sprintf(option, "h_biasThresholsd_zy%f", channel);
h_biasThreshold_zy->SetTitle(histoName);
h_biasThreshold_zy->DrawCopy("colz");
 
}
}
 
TCanvas* canvas06 = new TCanvas("canvas06","",1200, 1200);
canvas06->Divide(4,4);
int x1=4;
int x2=7;
int y1=4;
int y2=7;
for(int j=x1; j<=x2; j++){
for(int k=y1; k<=y2; k++){
int channel = map[j][k];
int canvasPosition = 4*(8-k-1) + 8 - j;
canvas06->cd(canvasPosition);
h_biasThreshold->GetXaxis()->SetRange(channel+1,channel+1);
char histoName[128];
sprintf(histoName, "Ch %d", channel);
h_biasThreshold->Project3D("zy");
//sprintf(option, "h_biasThresholsd_zy%f", channel);
h_biasThreshold_zy->SetTitle(histoName);
h_biasThreshold_zy->DrawCopy("colz");
 
}
}
 
}
if (strstr(plopt, "th") != NULL) {
/sipmScan/examples/sipm.C
347,6 → 347,7
sprintf(hname, "h2d%d", chPosition);
TH2F* h_2d = (TH2F*)rootfile->Get(hname);
h_2d->Draw("colz");
if ( !((i == parameter2) and (j == parameter1)) ) h_2d->GetZaxis()->SetRangeUser(0,200);
} //x
}
377,6 → 378,7
//TH2F* h_corrected = new TH2F("h_corrected","h_corrected",binsX, minX, maxX, binsY, minY, maxY);
double noise = getNoise(h_2d, 1, 70);
noise = 50;
if(debug) printf("Noise = %f\n", noise);
for(int k=minX; k<=maxX; k++) {
for(int j=minY; j<=maxY; j++) {
383,13 → 385,11
double signal = h_2d->GetBinContent(k,j); // detected
//double p = ((signal - noise) > 1) ? (signal-noise) : 1;
double p = signal - noise;
/*
p /= 1000.;
p /= 10000.;
double p0 = 1.0 - p; // events with zero photons
//double eta = (-log(p0) * p0 ) / (1-p0-0.00001);
double eta = -log(p0); // constant of the poissonian statistics
if (debug) printf("p=%f p0=%f log(p0)=%f eta=%f\n",p,p0,log(p0),eta);
*/
//double x = xLowUser + k*(xUpUser - xLowUser) / double(binsX);
double x = h_2d->GetXaxis()->GetBinCenter(k);
//double y = yLowUser + j*(yUpUser-yLowUser)/double(binsY);
401,10 → 401,10
//h_corrected->SetTitle("n_pe = - ln P(0);x[mm];y[mm]");
h_corrected->SetTitle(";x[mm];y[mm]");
//gStyle->SetPalette(52,0); // black and white for print
//h_corrected->GetZaxis()->SetRangeUser(-0.05,1);
//h_corrected->SetContour(100);
//gStyle->SetPalette(1);
//SetGS();
//gStyle->SetPalette(1); //black and white 2nd option
//SetGS(); // inverse
h_corrected->GetZaxis()->SetRangeUser(-0.05,0.30);
h_corrected->SetContour(30);
h_corrected->Draw("colz");
// collection efficiency