// legend entries
Float_t height = ntuplepvectorpointer->size() * 0.03;
// TLegend* leg1 = new TLegend(0.3,0.89-height,0.95,0.89);//(0.6,0.7,0.89,0.89);
- TLegend* leg1 = new TLegend(0.7,0.89-height,0.95,0.89);//(0.6,0.7,0.89,0.89);
+ TLegend* leg1 = new TLegend(0.6,0.89-height,0.95,0.89);//(0.6,0.7,0.89,0.89);
leg1->SetTextSize(0.025);
leg1->SetFillStyle(1001);
leg1->SetTextFont(132);
// legend entries
Float_t height = ptCompareHistogramVector->size() * 0.03;
// TLegend* leg1 = new TLegend(0.3,0.89-height,0.95,0.89);//(0.6,0.7,0.89,0.89);
- TLegend* leg1 = new TLegend(0.7,0.89-height,0.95,0.89);//(0.6,0.7,0.89,0.89);
+ TLegend* leg1 = new TLegend(0.1,0.89-height,0.95,0.89);//(0.6,0.7,0.89,0.89);
leg1->SetTextSize(0.025);
+ leg1->SetNColumns(3);
leg1->SetFillStyle(1001);
leg1->SetTextFont(132);
leg1->SetFillColor(0);
// legend entries
Float_t height = ptCompareHistogramClassVector->size() * 0.055;
- TLegend* leg1 = new TLegend(0.7,0.89-height,0.95,0.89);//(0.6,0.7,0.89,0.89);
+ TLegend* leg1 = new TLegend(0.6,0.89-height,0.95,0.89);//(0.6,0.7,0.89,0.89);
leg1->SetTextSize(0.035);
leg1->SetFillStyle(0);
leg1->SetTextFont(132);
// legend entries
Float_t height = ptCompareHistogramClassVector->size() * 0.055;
- TLegend* leg1 = new TLegend(0.7,0.89-height,0.95,0.89);//(0.6,0.7,0.89,0.89);
+ TLegend* leg1 = new TLegend(0.6,0.89-height,0.95,0.89);//(0.6,0.7,0.89,0.89);
leg1->SetTextSize(0.035);
leg1->SetFillStyle(0);
leg1->SetTextFont(132);
initHistogramCustom(pixeltimefiredDistrib, "Fire counter" + histogramdescription, color, style, 0, labbook->frames_foundDB/100, labbook->frames_foundDB/100, "times fired", "Counts");
initHistogramCustom(LeakageCurrentInPixel, "Leakage current per pixel" + histogramdescription, color, style, 0, cursensorinfo->columns*cursensorinfo->rows, cursensorinfo->columns*cursensorinfo->rows, "Pixel index", "Average CDS");
initHistogramCustom(LeakageCurrentInPixelSorted, "Leakage current per pixel sorted" + histogramdescription, color, style, 0, cursensorinfo->columns*cursensorinfo->rows, cursensorinfo->columns*cursensorinfo->rows, "Pixel index", "Average CDS");
- initHistogramCustom(LeakageCurrentDistrib, "Average Leakage current per pixel" + histogramdescription, color, style, -100, 400, 1000, "Average CDS", "Count");
+ initHistogramCustom(LeakageCurrentDistrib, "Average Leakage current per pixel" + histogramdescription, color, style, -100, 400, 1000, "Average CDS [ADU]", "Entries");
// initHistogram(LeakageCurrentInPixelSorted, "Leakage current" + histogramdescription, color, style);
initHistogramCustom(pixelHadGoodVeto, "Number of times pixel had good veto" + histogramdescription, color, style, 0, cursensorinfo->columns*cursensorinfo->rows, cursensorinfo->columns*cursensorinfo->rows, "Pixel index", "Counter good veto");
}
void HistogramType::initHistogram(TH1FO* &histogrampointer, TString prefix, Int_t color, Int_t style) {
- histogrampointer=(TH1FO*)new TH1F(Form("%d %s",labbook->runnumber, prefix.Data()), Form("%s, %s",prefix.Data(), humanreadablestr.Data()), cursystempar->nbins, 0, cursystempar->maxbin);
+// histogrampointer=(TH1FO*)new TH1F(Form("%d %s",labbook->runnumber, prefix.Data()), Form("%s, %s",prefix.Data(), humanreadablestr.Data()), cursystempar->nbins, 0, cursystempar->maxbin);
+ histogrampointer=(TH1FO*)new TH1F(Form("%d %s",labbook->runnumber, prefix.Data()), Form("%s",prefix.Data()), cursystempar->nbins, 0, cursystempar->maxbin);
histogrampointer->SetLineStyle(style);
histogrampointer->SetLineColor(color);
histogrampointer->SetStats(kTRUE);
}
void HistogramType::initHistogramCustom(TH1FO* &histogrampointer, TString prefix, Int_t color, Int_t style, Double_t xLow, Double_t xUp, Int_t nBins, TString xaxistitle, TString yaxistitle) {
- histogrampointer=(TH1FO*)new TH1F(Form("%d %s",labbook->runnumber, prefix.Data()), Form("%s, %s",prefix.Data(), humanreadablestr.Data()), nBins, xLow, xUp);
+// histogrampointer=(TH1FO*)new TH1F(Form("%d %s",labbook->runnumber, prefix.Data()), Form("%s, %s",prefix.Data(), humanreadablestr.Data()), nBins, xLow, xUp);
+ histogrampointer=(TH1FO*)new TH1F(Form("%d %s",labbook->runnumber, prefix.Data()), Form("%s",prefix.Data()), nBins, xLow, xUp);
histogrampointer->SetLineStyle(style);
histogrampointer->SetLineColor(color);
histogrampointer->SetStats(kTRUE);
void HistogramType::initHistogramArray(vector<TH1FO*>* histogramarraypointer, int numberofhisto, TString prefix, Int_t color, Int_t style) {
for (int i=0; i < numberofhisto; ++i) {
- TH1FO* histogrampointer = (TH1FO*)new TH1F(Form("%d %s %d",labbook->runnumber, prefix.Data(), i+1), Form("%s %d, %s",prefix.Data(), i+1, humanreadablestr.Data()), cursystempar->nbins, 0, cursystempar->maxbin);
+// TH1FO* histogrampointer = (TH1FO*)new TH1F(Form("%d %s %d",labbook->runnumber, prefix.Data(), i+1), Form("%s %d, %s",prefix.Data(), i+1, humanreadablestr.Data()), cursystempar->nbins, 0, cursystempar->maxbin);
+ TH1FO* histogrampointer = (TH1FO*)new TH1F(Form("%d %s %d",labbook->runnumber, prefix.Data(), i+1), Form("%s %d",prefix.Data(), i+1), cursystempar->nbins, 0, cursystempar->maxbin);
histogrampointer->SetLineStyle(style);
histogrampointer->SetLineColor(color);
histogrampointer->SetStats(kTRUE);
}
gain = gotgain;
calibrated = new HistogramType(histogramdescription+" calibrated", cursystempar, cursensorinfo, humanreadablestr, labbook, run, color, style);
- if (Seed != 0) calibrateHistogram(calibrated->Seed, Seed);
- if (Sum9 != 0) calibrateHistogram(calibrated->Sum9, Sum9);
- if (Sum25 != 0) calibrateHistogram(calibrated->Sum25, Sum25);
+ if (Seed != 0) calibrateHistogram(calibrated->Seed, Seed, gain, "Collected charge [e]", Form("Entries [1/%.1f e]",calibrated->Seed->GetBinWidth(1)));
+ if (Sum9 != 0) calibrateHistogram(calibrated->Sum9, Sum9, gain, "Collected charge [e]", Form("Entries [1/%.1f e]",calibrated->Sum9->GetBinWidth(1)));
+ if (Sum25 != 0) calibrateHistogram(calibrated->Sum25, Sum25, gain, "Collected charge [e]", Form("Entries [1/%.1f e]",calibrated->Sum25->GetBinWidth(1)));
for (unsigned int i=0; i < a_Sum9.size(); ++i) {
calibrated->a_Sum9.push_back(a_Sum9[i]);
- calibrateHistogram(calibrated->a_Sum9[i], a_Sum9[i]);
+ calibrateHistogram(calibrated->a_Sum9[i], a_Sum9[i], gain, "Collected charge [e]", Form("Entries [1/%.1f e]",calibrated->a_Sum9[i]->GetBinWidth(1)));
}
for (unsigned int i=0; i < a_Sum25.size(); ++i) {
calibrated->a_Sum25.push_back(a_Sum25[i]);
- calibrateHistogram(calibrated->a_Sum25[i], a_Sum25[i]);
+ calibrateHistogram(calibrated->a_Sum25[i], a_Sum25[i], gain, "Collected charge [e]", Form("Entries [1/%.1f e]",calibrated->a_Sum25[i]->GetBinWidth(1)));
}
- if (Veto != 0) calibrateHistogram(calibrated->Veto, Veto);
- if (Noise != 0) calibrateHistogram(calibrated->Noise, Noise);
+ if (Veto != 0) calibrateHistogram(calibrated->Veto, Veto, gain, "Collected charge [e]", Form("Entries [1/%.1f e]",calibrated->Veto->GetBinWidth(1)));
+ if (Noise != 0) calibrateHistogram(calibrated->Noise, Noise, gain, "Collected charge [e]", Form("Entries [1/%.1f e]",calibrated->Noise->GetBinWidth(1)));
if (pixeltimefired != 0) calibrated->pixeltimefired = pixeltimefired;
if (pixeltimefiredDistrib != 0) calibrated->pixeltimefiredDistrib = pixeltimefiredDistrib;
if (SeedPerc != 0) calibrated->SeedPerc = SeedPerc;
if (clustermultiplicity != 0) calibrated->clustermultiplicity = clustermultiplicity;
if (histAvgCluster != 0) calibrate2DHistogramCounts(calibrated->histAvgCluster, histAvgCluster);
- if (LeakageCurrentDistrib != 0) calibrateHistogram(calibrated->LeakageCurrentDistrib,LeakageCurrentDistrib, gain / 3.7 / pow10(-3) * (1.6*pow10(-19)) * pow10(15));
+ if (LeakageCurrentDistrib != 0) calibrateHistogram(calibrated->LeakageCurrentDistrib,LeakageCurrentDistrib, gain / 3.7 / pow10(-3) * (1.6*pow10(-19)) * pow10(15), "Average CDS [fA]", Form("Entries [1/%.1f fA]",calibrated->LeakageCurrentDistrib->GetBinWidth(1)));
if (LeakageCurrentInPixel != 0) calibrateHistogramYAxis(calibrated->LeakageCurrentInPixel, LeakageCurrentInPixel, gain / 3.7 / pow10(-3) * (1.6*pow10(-19)) * pow10(15));
if (LeakageCurrentInPixelSorted != 0) calibrateHistogramYAxis(calibrated->LeakageCurrentInPixelSorted,LeakageCurrentInPixelSorted, gain / 3.7 / pow10(-3) * (1.6*pow10(-19)) * pow10(15));
return 1;
}
-void HistogramType::calibrateHistogram(TH1FO* &histogrampointernew, TH1FO* &histogrampointerold, Double_t scalefactor) {
+void HistogramType::calibrateHistogram(TH1FO* &histogrampointernew, TH1FO* &histogrampointerold, Double_t scalefactor, TString newxAxisLabel, TString newyAxisLabel ) {
histogrampointernew = (TH1FO*)histogrampointerold->Clone();
histogrampointernew->SetName(Form("%s Calibr.", histogrampointerold->GetName()));
histogrampointernew->SetTitle(Form("%s Calibr.", histogrampointerold->GetTitle()));
- histogrampointernew->GetXaxis()->SetTitle("Collected charge [e]");
+ if (!newxAxisLabel.EqualTo("")) {
+ histogrampointernew->GetXaxis()->SetTitle(newxAxisLabel);
+ }
int nbins = histogrampointernew->GetXaxis()->GetNbins();
double new_bins[nbins+1];
if (scalefactor == 0)
new_bins[i] = histogrampointernew->GetBinLowEdge(i)*scalefactor;
// cout << "histogrampointernew->GetBinCenter(i): " << histogrampointernew->GetBinLowEdge(i) << " * gain " << gain << " = " << histogrampointernew->GetBinLowEdge(i)*gain << endl;
}
- histogrampointernew->SetBins(nbins, new_bins);
- histogrampointernew->GetYaxis()->SetTitle(Form("Entries [1/%.1f e]",histogrampointernew->GetBinWidth(1)));
+ histogrampointernew->SetBins(nbins, new_bins);
+ if (!newyAxisLabel.EqualTo("")) {
+ histogrampointernew->GetYaxis()->SetTitle(newyAxisLabel);
+ }
histogrampointernew->itsHistogramType = histogrampointerold->itsHistogramType;
}
#endif
+
cout << "---------- 1. loop over all classes --------" << endl;
for (vector<HistogramType*>::iterator curHistogramClass = HistogramClassVector.begin(); curHistogramClass != HistogramClassVector.end(); curHistogramClass++) {
cout << "Processing histograms in class: <" << colorwhite << (*curHistogramClass)->histogramdescription << colorreset << " >" << endlr;
+ cout << colorwhite << " BinFiringRates():" << endlr;
BinFiringRates(*curHistogramClass);
if ((*curHistogramClass)->maskRTSpixel) {
// if (labbook.chipGen=="Mi19") {
if (labbook.source.Contains("Fe"))
gain = 1640.0/vetopeakposition;
else if (labbook.source.Contains("Cd"))
- gain = 6140.0/vetopeakposition;
+ gain = 6140.0/vetopeakposition;
+ if (gain > 0) {
+ cout << " Gain for the calibrated class: " << gain << endlr;
+ }
curHistogramClassPt->calibrateHistograms(gain);
curHistogramClassPt->normalized->calibrateHistograms(gain);
// TFitResultPtr* fit_result_ptr;
fit_result = new TFitResult();
// fit_result_ptr = new TFitResultPtr();
- TString canvastitle = Form("%s %s", onehistogram->GetName(), runcode.Data());
+ TString canvastitle = Form("%s %s", onehistogram->GetTitle(), runcode.Data());
TString canvasname = Form("%s %s %d", onehistogram->GetName(), runcode.Data(), random);
- TCanvas* canvas = new TCanvas(canvasname, canvastitle, 900, 700);
+ TCanvas* canvas = new TCanvas(canvasname, canvastitle, 1200, 800);
+
+ TPaveText *owntitle = new TPaveText(0.1,0.9,0.930401,0.995,"nbNDC");
+ owntitle->SetFillStyle(0);
+ owntitle->SetBorderSize(0);
+ owntitle->SetTextAlign(22);
+ owntitle->SetTextSize(0.025);
+ owntitle->SetTextFont(42);
+
if (titlestr.Length()>0)
onehistogram->SetTitle(titlestr);
if (logscale) {
onehistogram->GetYaxis()->SetRangeUser(0.1,endrangeY*5);
else
onehistogram->GetYaxis()->SetRangeUser(0,endrangeY*1.25);
- TLegend* leg = new TLegend(0.2,0.85,0.89,0.89);//(0.6,0.7,0.89,0.89);
+ TLegend* leg = new TLegend(0.2,0.85,0.89,0.89);//(0.6,0.7,0.89,0.89);
+ leg->SetNColumns(3);
leg->SetFillColor(0);
leg->SetBorderSize(0);
if (legendstr.Length() < 1)
leg->SetTextSize(0.025);
leg->Draw();
+
+ owntitle->Clear();
+ owntitle->AddText(onehistogram->GetName());
+ vector<TString> headerStringsVector;
+ TString title1 = Form(" %s, %s, %s, %.0fx%.0f #mum^{2} pitch, %s\nT=%.0f {}^{o}C, %.1f MRad, %.1f*10^{13} n_{eq}/cm^{2}, %.2f Mhz", labbook.source.Data(),
+ labbook.chipGen.Data(), labbook.matrix.Data(), curpixelinfo.pitchX, curpixelinfo.pitchY, curpixelinfo.comment.Data(),
+ labbook.tempSens, labbook.radDoseIon, labbook.radDoseNonIon, labbook.clock);
+ if (labbook.depletionV >= 0)
+ title1 += Form(", U_{dep}=%.1f V", labbook.depletionV);
+
+ TString title2 = Form("%s", labbook.comment.Data());
+
+ headerStringsVector.push_back(title1);
+ TObjArray *humanreadablestrings = trimRunnumberAtBegin(title1).Tokenize("\n");
+ headerStringsVector.push_back(((TObjString *)(humanreadablestrings->At(0)))->String());
+ headerStringsVector.push_back(((TObjString *)(humanreadablestrings->At(1)))->String());
+ headerStringsVector.push_back(title2);
+ owntitle->AddText(Form("%s", headerStringsVector.at(1).Data()));
+ owntitle->AddText(headerStringsVector.at(2));
+ owntitle->Draw("SAME");
// canvas->Draw();
// canvas->Update();