compareHistogramClassVector2.push_back(runs[runi]->histogram->normalized->calibrated);
compareHistogramClassVector.push_back(runs[runi]->histogram->normalized);
// compareHistogramClassVector2.push_back(runs[runi]->histogramthreshold);
- /*compareHistogramVector*/.push_back(runs[runi]->histogram->normalized->calibrated->Seed);
+ compareHistogramVector.push_back(runs[runi]->histogram->normalized->calibrated->Seed);
compareHistogramVector2.push_back(runs[runi]->histogram->normalized->Seed);
//runs[runi]->plot1DHistogram(runs[runi]->histogram->normalized->calibrated, runs[runi]->histogram->normalized->calibrated->Seed, "landau", 1);
// runs[runi]->plot1DHistogram(runs[runi]->histogramwoRTS->normalized->calibrated, runs[runi]->histogramwoRTS->normalized->calibrated->Seed, "landau", true);
//cout << left << setw(width) << setfill(' ') << "Veto Peak"; filecontent += Form("Veto Peak\t");
// cout << left << setw(width+2) << setfill(' ') << "Veto Integral"; filecontent += Form("Veto Integral\t");
// cout << left << setw(width+2) << setfill(' ') << "Sum Integral"; filecontent += Form("Veto Integral\t");
- cout << left << setw(width-2) << setfill(' ') << "RTS pixel"; filecontent += Form("RTS pixel\t");
+ Float_t printRTSpixel = 0;
+ if (printRTSpixel > 0) { cout << left << setw(width-2) << setfill(' ') << "RTS pixel"; filecontent += Form("RTS pixel\t"); }
+ Float_t printSeedIntegral = 1;
+ if (printSeedIntegral > 0) { cout << left << setw(width) << setfill(' ') << "Seed int"; filecontent += Form("Seed integral\t"); }
cout << left << setw(width+2) << setfill(' ') << "Leakage"; filecontent += Form("Leakage cur.\t");
cout << left << setw(width-2) << setfill(' ') << "Noise"; filecontent += Form("Noise\t");
cout << left << setw(width) << setfill(' ') << "Noise threshold"; filecontent += Form("Noise threshold\t");
//cout << left << setw(width) << setfill(' ') << printTableElement(curhistogramclassp->posVeto,ptCompareHistogramClassVector->at(0)->posVeto); filecontent += Form("%s\t", printTableElement(curhistogramclassp->posVeto,ptCompareHistogramClassVector->at(0)->posVeto).c_str());
// cout << left << setw(width+2) << setfill(' ') << printTableElement(curhistogramclassp->integralVeto,ptCompareHistogramClassVector->at(0)->integralVeto,2); filecontent += Form("%s\t", printTableElement(curhistogramclassp->integralVeto,ptCompareHistogramClassVector->at(0)->integralVeto,4).c_str());
// cout << left << setw(width+2) << setfill(' ') << printTableElement(curhistogramclassp->integralSum,ptCompareHistogramClassVector->at(0)->integralSum,2); filecontent += Form("%s\t", printTableElement(curhistogramclassp->integralSum,ptCompareHistogramClassVector->at(0)->integralSum,4).c_str());
- cout << left << setw(width-2) << setfill(' ') << printTableElement((float)curhistogramclassp->RTSpixel.size(),(float)ptCompareHistogramClassVector->at(0)->RTSpixel.size(),0); filecontent += Form("%s\t", printTableElement((float)curhistogramclassp->RTSpixel.size(),(float)ptCompareHistogramClassVector->at(0)->RTSpixel.size(),0).c_str());
+ if (printRTSpixel > 0) { cout << left << setw(width-2) << setfill(' ') << printTableElement((float)curhistogramclassp->RTSpixel.size(),(float)ptCompareHistogramClassVector->at(0)->RTSpixel.size(),0); filecontent += Form("%s\t", printTableElement((float)curhistogramclassp->RTSpixel.size(),(float)ptCompareHistogramClassVector->at(0)->RTSpixel.size(),0).c_str()); }
+ if (printSeedIntegral > 0) { cout << left << setw(width) << setfill(' ') << printTableElement(curhistogramclassp->integralSeed,ptCompareHistogramClassVector->at(0)->integralSeed); filecontent += Form("%s\t", printTableElement(curhistogramclassp->integralSeed,ptCompareHistogramClassVector->at(0)->integralSeed).c_str()); }
cout << left << setw(width+2) << setfill(' ') << printTableElement((float)curhistogramclassp->medianLeakageCurrent,(float)ptCompareHistogramClassVector->at(0)->medianLeakageCurrent,1); filecontent += Form("%s\t", printTableElement((float)curhistogramclassp->medianLeakageCurrent,(float)ptCompareHistogramClassVector->at(0)->medianLeakageCurrent,1).c_str());
cout << left << setw(width-2) << setfill(' ') << printTableElement(curhistogramclassp->avgNoise,ptCompareHistogramClassVector->at(0)->avgNoise); filecontent += Form("%s\t", printTableElement(curhistogramclassp->avgNoise,ptCompareHistogramClassVector->at(0)->avgNoise).c_str());
cout << left << setw(width) << setfill(' ') << printTableElement(curhistogramclassp->noisethresholdborder,ptCompareHistogramClassVector->at(0)->noisethresholdborder); filecontent += Form("%s\t", printTableElement(curhistogramclassp->noisethresholdborder,ptCompareHistogramClassVector->at(0)->noisethresholdborder).c_str());
calibrated->posSeed = posSeed * gain;
calibrated->posSum = posSum * gain;
calibrated->posVeto = posVeto * gain;
- calibrated->integralVeto = integralVeto * gain;
- calibrated->integralSum = integralVeto * gain;
+ calibrated->integralSeed = integralSeed;
+ calibrated->integralVeto = integralVeto;
+ calibrated->integralSum = integralVeto;
calibrated->posSeedPerc = posSeedPerc;
calibrated->sigmaSeedPerc = sigmaSeedPerc;
calibrated->avgNoise = avgNoise * gain;
calibrated->avgNoisePlus = avgNoisePlus * gain;
calibrated->avgNoiseMinus = avgNoiseMinus * gain;
- calibrated->sr90IntegralVal = sr90IntegralVal * gain;
+ calibrated->sr90IntegralVal = sr90IntegralVal;
calibrated->StoN = StoN;
calibrated->CCE_in_Perc_1 = CCE_in_Perc_1;
calibrated->CCE_in_Perc_25 = CCE_in_Perc_25;
normalized->posSeed = posSeed;
normalized->posSum = posSum;
normalized->posVeto = posVeto;
+ normalized->integralSeed = integralSeed/frames_found*pow10(6);
+ normalized->integralVeto= integralVeto/frames_found*pow10(6);
normalized->integralVeto= integralVeto/frames_found*pow10(6);
normalized->integralSum = integralSum/frames_found*pow10(6);
normalized->posSeedPerc = posSeedPerc;
normalized->avgNoise = avgNoise;
normalized->avgNoisePlus = avgNoisePlus;
normalized->avgNoiseMinus = avgNoiseMinus;
- normalized->sr90IntegralVal = sr90IntegralVal;
+ normalized->sr90IntegralVal = sr90IntegralVal/frames_found*pow10(6);
normalized->StoN = StoN;
normalized->CCE_in_Perc_1 = CCE_in_Perc_1;
normalized->CCE_in_Perc_25 = CCE_in_Perc_25;
{
histogrampointer->GetXaxis()->UnZoom();
posMaxValHist = (histogrampointer->GetBinCenter(histogrampointer->FindLastBinAbove(1,1)));
-// cout << colorcyan << "maxvalhist: " << posMaxValHist << endlr;
-// cout << colorcyan << "noiseborder: " << noiseborder << endlr;
+
+ if (verbose) {
+ cout << colorcyan << "maxvalhist: " << posMaxValHist << endlr;
+ cout << colorcyan << "noiseborder: " << noiseborder << endlr;
+ }
// histogrampointer->GetXaxis()->SetRange(noiseborder,histogrampointer->FindLastBinAbove(0)); // look only for maxima with x greater than noiseborder, cut away noise
histogrampointer->GetXaxis()->SetRange(histogrampointer->FindBin(noiseborder),histogrampointer->FindBin(posMaxValHist)); // look only for maxima with x greater than noiseborder, cut away noise
const Double_t def_peakcenter=histogrampointer->GetBinCenter(histogrampointer->GetMaximumBin());
// cout << colorcyan << "def_peakcenter: " << def_peakcenter << endlr;
// cout << colorcyan << "histogrampointer->GetMaximumBin(): " << histogrampointer->GetMaximumBin() << endlr;
- const Double_t def_gausssig=-8.68052;
+ const Double_t def_gausssig=8.68052;
const Double_t def_distgauss=20.4;
const Double_t def_bgslope=0;
const Double_t def_bgoffs=histogrampointer->GetBinContent(histogrampointer->FindBin((noiseborder+def_peakcenter)/2));
fitFunc->SetParLimits(1,def_peakcenter*0.8,def_peakcenter*1.2);
fitFunc->SetParName(2,"Gaussian sigma");
fitFunc->SetParameter(2,def_gausssig);
+ fitFunc->SetParLimits(2,0,10000);
fitFunc->SetParName(3,"Distance from Gauss");
fitFunc->SetParameter(3,def_distgauss);
fitFunc->SetParLimits(3,0,def_distgauss*2);
double integralbg = bgfct->Integral(parameters[1] - 2*parameters[2] ,parameters[1] + 2*parameters[2]); // integral value of histogram (NOT fit)
parameters[6] -= integralbg;
- cout << colorcyan << "Integral from bin : " << histogrampointer->FindBin(parameters[7]) << " to " << histogrampointer->GetXaxis()->FindBin(parameters[1] + 2*parameters[2]) << endlr;
- cout << colorcyan << "Integral from val : " << parameters[7] << " to " << parameters[1] + 2*parameters[2] << endlr;
- cout << colorcyan << "Integral value: " << parameters[6] << endlr;
- cout << colorcyan << "Integral bg: " << integralbg << endlr;
+ if (verbose) {
+ cout << colorcyan << "Integral from bin : " << histogrampointer->FindBin(parameters[7]) << " to " << histogrampointer->GetXaxis()->FindBin(parameters[1] + 2*parameters[2]) << endlr;
+ cout << colorcyan << "Integral from val : " << parameters[7] << " to " << parameters[1] + 2*parameters[2] << endlr;
+ cout << colorcyan << "Integral value: " << parameters[6] << endlr;
+ cout << colorcyan << "Integral bg: " << integralbg << endlr;
+ }
// DEBUG
// TCanvas* canvas = new TCanvas(histogrampointer->GetName(), histogrampointer->GetName(), 900, 700);
/// fitted position of the most probable value of the seed spectrum
Float_t posSeed=0;
+ /// fintegral over the Seed peak, 4 sigma area
+ Double_t integralSeed=0;
/// fitted position of the most probable value in the over cluster summed spectrum
Float_t posSum=0;
/// fintegral over the sum peak, normalized to number of events
systemparam systemparamPXI (800*16,800,75,150,150);
systemparam systemparamFSBB (2800,2800/4,25,10,100);
systemparam systemparamUSBMi19 (400/*maxbin*/,400/1/*nbins*/, 25/*vetothreshold*/, 10/*maxbinnoise*/, 100/*nbinsnoise*/);
- systemparam systemparamPipper2 (1000,1000,15,10,100);
+ systemparam systemparamPipper2 (1000,500,15,10,100);
if (labbook.system.EqualTo("USB") && labbook.chipGen.EqualTo("Mi34") )
cursystemparam = systemparamUSB;
else if (labbook.system.EqualTo("USB") && labbook.chipGen.EqualTo("FSBB") )
constructUpdateString(&sqlupdatequery, "SeedPeak", histogramthreshold->normalized->posSeed, 4);
constructUpdateString(&sqlupdatequery, "AvgF0", labbook.averageF0, 6);
constructUpdateString(&sqlupdatequery, "SigmaF0", labbook.sigmaF0, 6);
+ constructUpdateString(&sqlupdatequery, "SeedIntegralMinusBG2Sigma", histogramthreshold->normalized->integralSeed, 10);
constructUpdateString(&sqlupdatequery, "VetoPeak", histogramthreshold->normalized->posVeto, 4);
constructUpdateString(&sqlupdatequery, "VetoIntegral", histogramthreshold->normalized->integralVeto, 10);
constructUpdateString(&sqlupdatequery, "SumIntegral", histogramthreshold->normalized->integralSum, 10);
(*curHistogramClass)->integralVeto = parameters[6];
}
if (labbook.chipGen.EqualTo("Pipper2"))
- parameters = (*curHistogramClass)->FitPerform((*curHistogramClass)->Seed, "gaus");
+ parameters = (*curHistogramClass)->FitPerform((*curHistogramClass)->Seed, "GaussTail");
else
parameters = (*curHistogramClass)->FitPerform((*curHistogramClass)->Seed, "landau");
+ (*curHistogramClass)->integralSeed = parameters[6];
(*curHistogramClass)->posSeed = parameters[1];
parameters = (*curHistogramClass)->FitPerform((*curHistogramClass)->Sum, "gaus");
(*curHistogramClass)->posSum = parameters[1];
cout << "background slope : " << parameters[4] << endl;
cout << "background offset: " << parameters[5] << endl;
//TF1 *f1 = new TF1("f1","[0] +[1]*x +gaus(2)",0,5);
- TF1 *f1 = new TF1("f1","[0] +[1]*x",100,250);
+ TF1 *f1 = new TF1("f1","[0] +[1]*x",0,1000);
f1->SetParameters(parameters[5],parameters[4]);
f1->Draw("SAME");
}