1 |
// |
// |
2 |
// Check the calorimter calibrations - Emiliano Mocchiutti |
// Check the calorimter calibrations - Emiliano Mocchiutti |
3 |
// |
// |
4 |
// FCaloCHKCALIB.c version 1.07 (2006-05-29) |
// FCaloCHKCALIB.c version 1.11 (2006-07-17) |
5 |
// |
// |
6 |
// The only input needed is the path to the directory created by YODA for the data file you want to analyze. |
// The only input needed is the path to the directory created by YODA for the data file you want to analyze. |
7 |
// |
// |
8 |
// Changelog: |
// Changelog: |
9 |
// |
// |
10 |
|
// 1.07 - 1.11 (2006-07-17): Adapted to flight conditions. |
11 |
|
// |
12 |
// 1.06 - 1.07 (2006-05-29): Fixed bug in output filename when input is not in the form DW_YYMMDD_NNN. Changed threshold for bad strip warning (from 0.005 to 0.03). |
// 1.06 - 1.07 (2006-05-29): Fixed bug in output filename when input is not in the form DW_YYMMDD_NNN. Changed threshold for bad strip warning (from 0.005 to 0.03). |
13 |
// |
// |
14 |
// 1.05 - 1.06 (2006-03-22): Add optimize flag in compiling the script! |
// 1.05 - 1.06 (2006-03-22): Add optimize flag in compiling the script! |
64 |
}; |
}; |
65 |
} |
} |
66 |
|
|
|
// TString getFilename(const TString filename){ |
|
|
// const string fil = (const char*)filename; |
|
|
// Int_t posiz = fil.find("dw_"); |
|
|
// if ( posiz == -1 ) posiz = fil.find("DW_"); |
|
|
// if ( posiz == -1 ) return 0; |
|
|
// Int_t posiz2 = posiz+13; |
|
|
// TString file2; |
|
|
// stringcopy(file2,filename,posiz,posiz2); |
|
|
// TString pdat(".dat"); |
|
|
// stringappend(file2,pdat); |
|
|
// return file2; |
|
|
// } |
|
67 |
TString getFilename(const TString filename){ |
TString getFilename(const TString filename){ |
68 |
// |
// |
69 |
const string fil = gSystem->BaseName(filename.Data()); |
const string fil = gSystem->BaseName(filename.Data()); |
186 |
}; |
}; |
187 |
}; |
}; |
188 |
// |
// |
|
// // |
|
|
// const string fil = (const char*)filename; |
|
|
// Int_t posiz = fil.find("dw_"); |
|
|
// if ( posiz == -1 ) posiz = fil.find("DW_"); |
|
|
// Int_t posiz2 = posiz+13; |
|
|
// TString file2; |
|
|
// stringcopy(file2,filename,posiz,posiz2); |
|
|
// // |
|
|
// const char *figrec = file2; |
|
189 |
// |
// |
190 |
const string fil = gSystem->BaseName(filename.Data()); |
const string fil = gSystem->BaseName(filename.Data()); |
191 |
Int_t posiz = fil.find(".root"); |
Int_t posiz = fil.find(".root"); |
320 |
gDirectory->Delete("C14"); |
gDirectory->Delete("C14"); |
321 |
gDirectory->Delete("C15"); |
gDirectory->Delete("C15"); |
322 |
gDirectory->Delete("C16"); |
gDirectory->Delete("C16"); |
323 |
TH1F *calped = new TH1F("C14","calped",4230,-3.5,4227.5); |
//TH1F *calped = new TH1F("C14","calped",4230,-3.5,4227.5); |
324 |
TH1F *calrms = new TH1F("C15","calrms",4230,-3.5,4228.5); |
// TH1F *calrms = new TH1F("C15","calrms",4230,-3.5,4228.5); |
325 |
|
TH1F *calped = new TH1F("C14","calped",2112,-3.5,4227.5); |
326 |
|
// TH1F *calrms = new TH1F("C15","calrms",264,-2.,4226.); |
327 |
|
TH1F *calrms = new TH1F("C15","calrms",2112,-3.5,4228.5); |
328 |
TH1F *calbad = new TH1F("C16","calgood",4230,-3.5,4228.5); |
TH1F *calbad = new TH1F("C16","calgood",4230,-3.5,4228.5); |
329 |
// |
// |
330 |
gDirectory->Delete("C17"); |
gDirectory->Delete("C17"); |
444 |
incalped++; |
incalped++; |
445 |
}; |
}; |
446 |
calrms->Fill((float)j,(calib.calrms[l][m][n]/4.)); |
calrms->Fill((float)j,(calib.calrms[l][m][n]/4.)); |
447 |
if ( (calib.calrms[l][m][n]/4.) > 7. || (calib.calrms[l][m][n]/4.) < 1. ){ |
if ( (((calib.calrms[l][m][n]/4.) > 7. || (calib.calrms[l][m][n]/4.) < 1.) && (j < 3440 && j > 3550)) || ( (j > 3439 && j < 3551) && ((calib.calrms[l][m][n]/4.) > 150. || (calib.calrms[l][m][n]/4.) < 1.)) ){ |
448 |
outcalrms++; |
outcalrms++; |
449 |
} else { |
} else { |
450 |
incalrms++; |
incalrms++; |
454 |
// |
// |
455 |
if ( n < 6 ){ |
if ( n < 6 ){ |
456 |
calthr->Fill((float)g,(float)calib.calthr[l][m][n]); |
calthr->Fill((float)g,(float)calib.calthr[l][m][n]); |
457 |
if ( calib.calthr[l][m][n] > 21. || calib.calthr[l][m][n] < 12. ){ |
if ( (calib.calthr[l][m][n] > 21. || calib.calthr[l][m][n] < 12.) && (g < 215 && g > 221) ){ |
458 |
outcalthr++; |
outcalthr++; |
459 |
} else { |
} else { |
460 |
incalthr++; |
incalthr++; |
461 |
}; |
}; |
462 |
calvar->Fill((float)g,(float)calib.calvar[l][m][n]); |
calvar->Fill((float)g,(float)calib.calvar[l][m][n]); |
463 |
if ( calib.calvar[l][m][n] > 8. || calib.calvar[l][m][n] < 1. ){ |
if ( (calib.calvar[l][m][n] > 8. || calib.calvar[l][m][n] < 1. ) && (g < 215 && g > 221) ){ |
464 |
outcalvar++; |
outcalvar++; |
465 |
} else { |
} else { |
466 |
incalvar++; |
incalvar++; |
647 |
calped->GetXaxis()->SetNdivisions(322); |
calped->GetXaxis()->SetNdivisions(322); |
648 |
calped->SetXTitle("strip"); |
calped->SetXTitle("strip"); |
649 |
calped->SetYTitle("ADC channels"); |
calped->SetYTitle("ADC channels"); |
650 |
|
calped->SetMaximum(3000.); |
651 |
|
calped->SetMinimum(-3000.); |
652 |
calped->Draw(); |
calped->Draw(); |
653 |
TPolyLine *banda1; |
TPolyLine *banda1; |
654 |
Double_t xc[4] = {0.,4224.,4224.,0.}; |
Double_t xc[4] = {0.,4224.,4224.,0.}; |
660 |
banda1->Draw("fSAME"); |
banda1->Draw("fSAME"); |
661 |
TPolyLine *banda2; |
TPolyLine *banda2; |
662 |
Double_t xc2[4] = {4031.5,4047.5,4047.5,4031.5}; |
Double_t xc2[4] = {4031.5,4047.5,4047.5,4031.5}; |
663 |
Double_t yc2[4] = {-2500.,-2500.,28000.,28000.}; |
// Double_t yc2[4] = {-2500.,-2500.,28000.,28000.}; |
664 |
|
Double_t yc2[4] = {-3000.,-3000.,3000.,3000.}; |
665 |
banda2 = new TPolyLine(4,xc2,yc2); |
banda2 = new TPolyLine(4,xc2,yc2); |
666 |
banda2->SetLineColor(5); |
banda2->SetLineColor(5); |
667 |
banda2->SetFillColor(5); |
banda2->SetFillColor(5); |
679 |
banda1->SetFillColor(5); |
banda1->SetFillColor(5); |
680 |
banda1->SetLineWidth(1); |
banda1->SetLineWidth(1); |
681 |
banda1->Draw("fSAME"); |
banda1->Draw("fSAME"); |
682 |
|
Float_t minrm = calrms->GetMinimum(); |
683 |
|
Float_t maxrm = calrms->GetMaximum(); |
684 |
|
Double_t xrm2[4] = {3449.,3551.,3551.,3449.}; |
685 |
|
Double_t yrm2[4] = {minrm,minrm,maxrm,maxrm}; |
686 |
|
banda2 = new TPolyLine(4,xrm2,yrm2); |
687 |
|
banda2->SetLineColor(5); |
688 |
|
banda2->SetFillColor(5); |
689 |
|
banda2->SetLineWidth(1); |
690 |
|
banda2->Draw("fSAME"); |
691 |
calrms->SetXTitle("strip"); |
calrms->SetXTitle("strip"); |
692 |
calrms->SetYTitle("ADC channels"); |
calrms->SetYTitle("ADC channels"); |
693 |
calrms->Draw("SAME"); |
calrms->Draw("SAME"); |
729 |
banda1->SetFillColor(5); |
banda1->SetFillColor(5); |
730 |
banda1->SetLineWidth(1); |
banda1->SetLineWidth(1); |
731 |
banda1->Draw("fSAME"); |
banda1->Draw("fSAME"); |
732 |
|
// |
733 |
|
minrm = calthr->GetMinimum(); |
734 |
|
maxrm = 1.05*calthr->GetMaximum(); |
735 |
|
Double_t xth2[4] = {215.,221.,221.,215.}; |
736 |
|
Double_t yth2[4] = {minrm,minrm,maxrm,maxrm}; |
737 |
|
banda2 = new TPolyLine(4,xth2,yth2); |
738 |
|
banda2->SetLineColor(5); |
739 |
|
banda2->SetFillColor(5); |
740 |
|
banda2->SetLineWidth(1); |
741 |
|
banda2->Draw("fSAME"); |
742 |
|
// |
743 |
calthr->Draw("SAME"); |
calthr->Draw("SAME"); |
744 |
f3pd2->cd(); |
f3pd2->cd(); |
745 |
|
// gPad->SetLogy(); |
746 |
calvar->GetXaxis()->SetNdivisions(644); |
calvar->GetXaxis()->SetNdivisions(644); |
747 |
calvar->SetXTitle("pre-amplifier"); |
calvar->SetXTitle("pre-amplifier"); |
748 |
calvar->SetYTitle("ADC channels"); |
calvar->SetYTitle("ADC channels"); |
754 |
banda1->SetFillColor(5); |
banda1->SetFillColor(5); |
755 |
banda1->SetLineWidth(1); |
banda1->SetLineWidth(1); |
756 |
banda1->Draw("fSAME"); |
banda1->Draw("fSAME"); |
757 |
|
// |
758 |
|
minrm = calvar->GetMinimum(); |
759 |
|
maxrm = 1.05*calvar->GetMaximum(); |
760 |
|
Double_t xva2[4] = {215.,221.,221.,215.}; |
761 |
|
Double_t yva2[4] = {minrm,minrm,maxrm,maxrm}; |
762 |
|
banda2 = new TPolyLine(4,xva2,yva2); |
763 |
|
banda2->SetLineColor(5); |
764 |
|
banda2->SetFillColor(5); |
765 |
|
banda2->SetLineWidth(1); |
766 |
|
banda2->Draw("fSAME"); |
767 |
|
// |
768 |
calvar->Draw("SAME"); |
calvar->Draw("SAME"); |
769 |
f3pd3->cd(); |
f3pd3->cd(); |
770 |
calbase->GetXaxis()->SetNdivisions(644); |
calbase->GetXaxis()->SetNdivisions(644); |