Subversion Repositories f9daq

Compare Revisions

Ignore whitespace Rev 35 → Rev 37

/sipmScan/examples/biasScan.C/thresholdScan.C
16,7 → 16,7
 
double getNoise(TH2F*, int, int);
 
int thresholdScan(char filename[256] = "test", char plopt[256]="th", int chXstart=0, int chXend=7, int chYstart=0, int chYend=7, bool debug = false)
int biasScan(char filename[256] = "test", char plopt[256]="th", int chXstart=0, int chXend=7, int chYstart=0, int chYend=7, bool debug = false)
{
const int c_nChannels = 64;
const double c_xOffset = 1; // mm
46,32 → 46,6
return(0);
}
 
if (strstr(plopt, "th") != NULL) {
TCanvas* canvas1 = new TCanvas("canvas1","",800,800);
canvas1->cd();
//gPad->SetLogz();
//canvas1->SetLogz();
TH2F* h_threshold = (TH2F*) rootfile->Get("h_threshold");
h_threshold->SetTitleOffset(1.5,"y");
//h_threshold->GetZaxis()->SetRangeUser(0,1000);
h_threshold->SetContour(20);
h_threshold->Draw("colz");
TCanvas* canvas2 = new TCanvas("canvas2","",1600,800);
canvas2->Divide(2);
TH1D* h_projection1 = h_threshold->ProjectionY("Ch 37",38,38);
canvas2->cd(1);
//h_projection1->GetYaxis()->SetRangeUser(0,1000);
//gPad->SetLogy();
h_projection1->Draw();
TH1D* h_projection2 = h_threshold->ProjectionY("Ch 38",39,39);
canvas2->cd(2);
//gPad->SetLogy();
h_projection2->Draw();
}
if(strstr(plopt, "tdc") != NULL) {
TCanvas *canvas21 = new TCanvas("canvas21","canvas21",1600,800);
TH3F* h0 = (TH3F*) rootfile->Get("h_correctedTDC");
118,9 → 92,42
h_timeWalk->Draw("colz");
}
if (strstr(plopt, "bias") != NULL) {
TCanvas* canvas01 = new TCanvas("canvas01","",800, 800);
canvas01->cd();
TH2F* h_bias = (TH2F*) rootfile->Get("h_bias");
h_bias->Draw("colz");
}
if (strstr(plopt, "th") != NULL) {
TCanvas* canvas1 = new TCanvas("canvas1","",800,800);
canvas1->cd();
//gPad->SetLogz();
//canvas1->SetLogz();
TH2F* h_threshold = (TH2F*) rootfile->Get("h_threshold");
h_threshold->SetTitleOffset(1.5,"y");
//h_threshold->GetZaxis()->SetRangeUser(0,1000);
h_threshold->SetContour(20);
h_threshold->Draw("colz");
TCanvas* canvas2 = new TCanvas("canvas2","",1600,800);
canvas2->Divide(2);
TH1D* h_projection1 = h_threshold->ProjectionY("Ch 37",38,38);
canvas2->cd(1);
//h_projection1->GetYaxis()->SetRangeUser(0,1000);
//gPad->SetLogy();
h_projection1->Draw();
TH1D* h_projection2 = h_threshold->ProjectionY("Ch 38",39,39);
canvas2->cd(2);
//gPad->SetLogy();
h_projection2->Draw();
}
if(strstr(plopt,"16") != NULL)
{
TH2F* h_threshold = (TH2F*) rootfile->Get("h_threshold");
TH2F* h_threshold = (TH2F*) rootfile->Get("h_bias");
TCanvas* canvas = new TCanvas("canvas","",1600,1600);
canvas->cd();
TVirtualPad *main = new TPad("main","main",0,0,1,1,10,1);
136,12 → 143,25
char name[128];
sprintf(name,"Channel %d",channel);
h_projection->SetTitle(name);
h_projection->DrawCopy();
h_projection->DrawCopy("ex0");
}
}
printf("\n");
}
if(strstr(plopt, "1ch") != NULL)
{
TH2F* h_bias = (TH2F*) rootfile->Get("h_bias");
TCanvas* canvas = new TCanvas("canvas","",1600,1600);
canvas->cd();
int channel = map[chXstart][chXend];
TH1D* h_projection = h_bias->ProjectionY("",channel+1,channel+1);
char name[128];
sprintf(name,"Channel %d",channel);
h_projection->SetTitle(name);
h_projection->DrawCopy("ex0");
}
if( strstr(plopt, "all") != NULL ) {
TCanvas *canvas2 = new TCanvas("canvas2","Hits x;;",2000,2000);
TCanvas *canvas3 = new TCanvas("canvas3","Hits y;;",2000,2000);