// if (runi == 2)
// runs[runi]->setSubMatrixBorders(100,120,100,120);
//runs[runi]->setFixedThresholdValueElectrons(1440);
- runs[runi]->setFixedThresholdValueADU(runs[runi]->labbook.posSeedDB*0.7);
+// float_t cutval = runs[runi]->histogramwoRTS->Sum->GetBinCenter(runs[runi]->histogramwoRTS->Sum->FindLastBinAbove(3,1));
+// runs[runi]->setFixedThresholdValueADU(cutval*0.6);
//runs[runi]->setNoisethresholdborderADU(800);
//runs[runi]->setNoisethresholdborderE(220);
// runs[runi]->analyzeFrame(6384);
-// runs[runi]->analyzeFrame(6605);
+// runs[runi]->analyzeFrame(1970548);
// runs[runi]->analyzeFrame(1994914);
// runs[runi]->analyzeFrame(680);
// runs[runi]->analyzeFrame(685);
gROOT->SetBatch(kFALSE);
// Uncomment below to do classical analysis withour RTS
- compareHistogramClassVector.push_back(runs[runi]->histogramwoRTS->normalized);
+ compareHistogramClassVector.push_back(runs[runi]->histogramwoRTS);
+ compareHistogramClassVector.push_back(runs[runi]->histogramfixedthreshold);
+
// compareHistogramClassVector2.push_back(runs[runi]->histogramwoRTS);
-// compareHistogramClassVector.push_back(runs[runi]->histogram->normalized);
+ compareHistogramClassVector2.push_back(runs[runi]->histogram->normalized);
+ compareHistogramClassVector2.push_back(runs[runi]->histogramwoRTS->normalized);
+ compareHistogramClassVector2.push_back(runs[runi]->histogramwoRTSAggresive->normalized);
// compareHistogramClassVector2.push_back(runs[runi]->histogramwoRTS->normalized);
// compareHistogramClassVector.push_back(runs[runi]->histogramwoRTS->normalized);
// compareHistogramClassVector.push_back(runs[runi]->histogramfixedthreshold->normalized);
// compareHistogramVector.push_back(runs[runi]->histogramfixedthreshold->Seed);
// compareHistogramVector.push_back(runs[runi]->histogramfixedthreshold->normalized->Seed);
// runs[runi]->plot1DHistogram( runs[runi]->histogramfixedthreshold->normalized->Seed, "gaus", true, false, false, 500);
- runs[runi]->plot1DHistogram( runs[runi]->histogramwoRTS->normalized->Seed, "GaussTail");
+ //runs[runi]->plot1DHistogram( runs[runi]->histogramwoRTS->normalized->Seed, "GaussTail");
+ //runs[runi]->plot1DHistogram( runs[runi]->histogramwoRTS->a_Sum[0]);
+ compareHistogramVector.push_back(runs[runi]->histogramwoRTS->a_Sum[0]); // Seed
+ compareHistogramVector.push_back(runs[runi]->histogramwoRTS->a_Sum[1]); // Seed + next bigger charge pixel
+ compareHistogramVector.push_back(runs[runi]->histogramwoRTS->a_Sum[2]); // Seed + 2
+ compareHistogramVector.push_back(runs[runi]->histogramwoRTS->a_Sum[8]); // Sum over 9 pixel in cluster
+ compareHistogramVector.push_back(runs[runi]->histogramwoRTS->a_Sum[24]); // Sum over 25 pixel in cluster
+
+
// runs[runi]->plot1DHistogram( runs[runi]->histogramfixedthreshold->normalized->Seed, "gaus", true, false, false, runs[runi]->histogramfixedthreshold->normalized->fixedThresholdValue);
// runs[runi]->plot1DHistogram( runs[runi]->histogramfixedthreshold->normalized->Sum, "gaus", true, false, false, 500);
// plot RTS pixel histogram
-// runs[runi]->plot1DHistogram( runs[runi]->histogramwoRTS->pixeltimefiredDistrib, "", 0);
+ runs[runi]->plot1DHistogram( runs[runi]->histogramwoRTS->pixeltimefiredDistrib, "", 0);
histogramwoRTSAggresive = new HistogramType(" more RTS cleaned", &cursystemparam, &cursensorinfo, humanreadablestr, &labbook, this, rootcolors[plotStyle], rootlinestyle[plotStyle]);
histogramwoRTSAggresive->maskRTSpixel = true;
- histogramwoRTSAggresive->RTSthreshold = 1.5;
+ histogramwoRTSAggresive->RTSthreshold = 4;
HistogramClassVector.push_back(histogramwoRTSAggresive);
// histogramwoRTSAggresivethreshold = new HistogramType(" Threshold, more RTS cleaned", &cursystemparam, &cursensorinfo, humanreadablestr, &labbook, this, rootcolors[plotStyle], rootlinestyle[plotStyle] );
// histogramwoRTSAggresivethreshold->maskRTSpixel = true;
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,200,15,10,100);
+ systemparam systemparamPipper2 (1000,200,25,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, "Avg.Noise+", histogramclassToUseForDB->normalized->calibrated->avgNoisePlus, 3, 0, 1000);
if (histogramclassToUseForDB->normalized->calibrated != 0)
constructUpdateString(&sqlupdatequery, "Avg.Noise-", histogramclassToUseForDB->normalized->calibrated->avgNoiseMinus, 3, 0, 1000);
- constructUpdateString(&sqlupdatequery, "CCE_1", histogramclassToUseForDB->normalized->CCE_in_Perc_1, 2, 0 , 100);
- constructUpdateString(&sqlupdatequery, "CCE_25", histogramclassToUseForDB->normalized->CCE_in_Perc_25, 2, 0 , 100);
+ constructUpdateString(&sqlupdatequery, "CCE_1", histogramclassToUseForDB->normalized->CCE_in_Perc_1, 2, 0 , 110);
+ constructUpdateString(&sqlupdatequery, "CCE_25", histogramclassToUseForDB->normalized->CCE_in_Perc_25, 2, 0 , 110);
constructUpdateString(&sqlupdatequery, "StoN", histogramclassToUseForDB->normalized->StoN, 3, 0 , 100);
constructUpdateString(&sqlupdatequery, "Avg.NoiseADC", histogramclassToUseForDB->normalized->avgNoise, 2, 0 , 1000);
constructUpdateString(&sqlupdatequery, "Avg.NoiseADC+", histogramclassToUseForDB->normalized->avgNoisePlus, 2, 0 , 1000);
Bool_t Run::binSeedSumVeto()
{
- /// collected charge in cluster
+ /// size of cluster array, 5 x 5 = 25
Int_t completeclustersize = processed->clustersize*processed->clustersize;
Float_t a_pixelSum[completeclustersize];
Float_t a_notSeedSum[completeclustersize];
a_pixelSum[clusteri] = 0;
a_notSeedSum[clusteri] = 0;
}
+ //cout << colorpurple << framei << endlr;
// look only at 3x3 cluster around seed
-// if( labbook.chipGen=="FSBB" || labbook.chipGen=="Pipper2") {
-// for (Int_t clusteri=0; clusteri<sqrt(completeclustersize); clusteri++)
-// processed->fFrameInfo.p[clusteri][hiti] = 0;
-// for (Int_t clusteri=completeclustersize-sqrt(completeclustersize); clusteri<completeclustersize; clusteri++)
-// processed->fFrameInfo.p[clusteri][hiti] = 0;
-// for (Int_t clusteri=0; clusteri<completeclustersize; clusteri=clusteri+sqrt(completeclustersize))
-// processed->fFrameInfo.p[clusteri][hiti] = 0;
-// for (Int_t clusteri=4; clusteri<completeclustersize; clusteri=clusteri+sqrt(completeclustersize))
-// processed->fFrameInfo.p[clusteri][hiti] = 0;
-// }
+ if( labbook.chipGen=="FSBB" || labbook.chipGen=="Pipper2") {
+ for (Int_t clusteri=0; clusteri<sqrt(completeclustersize); clusteri++)
+ processed->fFrameInfo.p[clusteri][hiti] = -9999;
+ for (Int_t clusteri=completeclustersize-sqrt(completeclustersize); clusteri<completeclustersize; clusteri++)
+ processed->fFrameInfo.p[clusteri][hiti] = -9999;
+ for (Int_t clusteri=0; clusteri<completeclustersize; clusteri=clusteri+sqrt(completeclustersize))
+ processed->fFrameInfo.p[clusteri][hiti] = -9999;
+ for (Int_t clusteri=4; clusteri<completeclustersize; clusteri=clusteri+sqrt(completeclustersize))
+ processed->fFrameInfo.p[clusteri][hiti] = -9999;
+ }
- // DEBUG
+// DEBUG
// for (Int_t clusteri=0; clusteri<sqrt(completeclustersize); clusteri++) {
// for (Int_t clusterj=0; clusterj<sqrt(completeclustersize); clusterj++)
// cout << " " << processed->fFrameInfo.p[clusteri*5+clusterj][hiti];
TMath::Sort(completeclustersize,clusterArray,index,1);
for (Int_t clusteri=0; clusteri<completeclustersize; clusteri++)
{
- pixelSum += clusterArray[index[clusteri]];
- for (Int_t clusterj=clusteri; clusterj<completeclustersize; clusterj++) {
- a_pixelSum[clusterj] += clusterArray[index[clusteri]];
- }
-
- if (index[clusteri] != 12) {
- notSeedSum += processed->fFrameInfo.p[clusteri][hiti];
- for (Int_t clusterj=clusteri; clusterj<completeclustersize; clusterj++) { // not used yet
- a_notSeedSum[clusterj] += clusterArray[index[clusteri]];
- }
- }
-
+ if (clusterArray[index[clusteri]] > -9000) {
+ pixelSum += clusterArray[index[clusteri]];
+ for (Int_t clusterj=clusteri; clusterj<completeclustersize; clusterj++) {
+ a_pixelSum[clusterj] += clusterArray[index[clusteri]];
+ }
+
+ if (index[clusteri] != 12) {
+ notSeedSum += processed->fFrameInfo.p[index[clusteri]][hiti];
+ for (Int_t clusterj=clusteri; clusterj<completeclustersize; clusterj++) { // not used yet
+ a_notSeedSum[clusterj] += clusterArray[index[clusteri]];
+ }
+ }
+ }
}
histogram->Sum->Fill(pixelSum);
for (Int_t clusterj=0; clusterj<completeclustersize; clusterj++) {
if (TMath::Abs(notSeedSum) < cursystemparam.vetothreshold && (labbook.source.Contains("Fe")||labbook.source.Contains("Cd")))
histogram->Veto->Fill(processed->fFrameInfo.p[12][hiti]); // histogram with the single pixel
-
- // bin the fixed threshold for charge histogram class
- if (histogramfixedthreshold != 0) {
- if (pixelSum > histogramfixedthreshold->fixedThresholdValue) // charge is more then histogramfixedthreshold->fixedThresholdValue in whole cluster
- {
- histogramfixedthreshold->numberofhits++;
- fillAHistogramsinclass(histogramfixedthreshold, hiti, completeclustersize, pixelSum, notSeedSum, &a_pixelSum[0], &a_notSeedSum[0]);
- }
- }
-
+
if (processed->fFrameInfo.pixelthreshold[hiti]>0)
{
histogramthreshold->numberofhits++;
} // end loop over hits in frame
}
} // end loop over all frames
+
+ // histogramfixedthreshold relies on "histogram", therefore histogram has to be completly filled before a threshold can be Set
+ for (Int_t framei=0; framei<processed->fHitTree->GetEntries(); framei++) // loop over all frames
+ {
+ processed->fHitTree->GetEntry(framei);
+ {
+ for(Int_t hiti=0; (unsigned int)hiti<processed->fFrameInfo.hits;hiti++)
+ {
+ uint pixel_column_x = processed->fFrameInfo.pixel[hiti]%cursensorinfo.columns; // column of seed
+ uint pixel_row_y = processed->fFrameInfo.pixel[hiti]/cursensorinfo.columns; // row of seed
+ if (pixel_column_x >= submatrix_x_start && pixel_column_x < submatrix_x_end && pixel_row_y >= submatrix_y_start && pixel_row_y < submatrix_y_end) // Diode sitzt oben im SeedPixel, da nach PitchY angeordnet
+ {
+ pixelSum = 0;
+ notSeedSum = 0;
+ // sum histogram
+ for (Int_t clusteri=0; clusteri<completeclustersize; clusteri++) {
+ a_pixelSum[clusteri] = 0;
+ a_notSeedSum[clusteri] = 0;
+ }
+ // look only at 3x3 cluster around seed
+ if( labbook.chipGen=="FSBB" || labbook.chipGen=="Pipper2") {
+ for (Int_t clusteri=0; clusteri<sqrt(completeclustersize); clusteri++)
+ processed->fFrameInfo.p[clusteri][hiti] = -9999;
+ for (Int_t clusteri=completeclustersize-sqrt(completeclustersize); clusteri<completeclustersize; clusteri++)
+ processed->fFrameInfo.p[clusteri][hiti] = -9999;
+ for (Int_t clusteri=0; clusteri<completeclustersize; clusteri=clusteri+sqrt(completeclustersize))
+ processed->fFrameInfo.p[clusteri][hiti] = -9999;
+ for (Int_t clusteri=4; clusteri<completeclustersize; clusteri=clusteri+sqrt(completeclustersize))
+ processed->fFrameInfo.p[clusteri][hiti] = -9999;
+ }
+
+ Float_t clusterArray[completeclustersize];// temp variable clusterArray necessary, because Sort only accepts 1-dim arrays
+ for (Int_t clusteri=0; clusteri<completeclustersize; clusteri++) {
+ clusterArray[clusteri] = processed->fFrameInfo.p[clusteri][hiti];
+ }
+ Int_t index[completeclustersize];
+ TMath::Sort(completeclustersize,clusterArray,index,1);
+ for (Int_t clusteri=0; clusteri<completeclustersize; clusteri++)
+ {
+ if (clusterArray[index[clusteri]] > -9000) {
+ pixelSum += clusterArray[index[clusteri]];
+ for (Int_t clusterj=clusteri; clusterj<completeclustersize; clusterj++) {
+ a_pixelSum[clusterj] += clusterArray[index[clusteri]];
+ }
+
+ if (index[clusteri] != 12) {
+ notSeedSum += processed->fFrameInfo.p[index[clusteri]][hiti];
+ for (Int_t clusterj=clusteri; clusterj<completeclustersize; clusterj++) { // not used yet
+ a_notSeedSum[clusterj] += clusterArray[index[clusteri]];
+ }
+ }
+ }
+ }
+
+ // bin the fixed threshold for charge histogram class
+ if (histogramfixedthreshold != 0) {
+ if (histogramfixedthreshold->fixedThresholdValue <= 0) {
+ float_t cutval = histogram->Sum->GetBinCenter(histogram->Sum->FindLastBinAbove(3,1));
+ setFixedThresholdValueADU(cutval*0.8);
+ }
+ if (pixelSum > histogramfixedthreshold->fixedThresholdValue) // charge is more then histogramfixedthreshold->fixedThresholdValue in whole cluster
+ {
+ histogramfixedthreshold->numberofhits++;
+ fillAHistogramsinclass(histogramfixedthreshold, hiti, completeclustersize, pixelSum, notSeedSum, &a_pixelSum[0], &a_notSeedSum[0]);
+ }
+ }
+ }
+ }
+ }
+ }
+
+
+
// gROOT->SetBatch(kTRUE);
for (vector<HistogramType*>::iterator curHistogramClass = HistogramClassVector.begin(); curHistogramClass != HistogramClassVector.end(); curHistogramClass++) {
Double_t* parameters = (Double_t *)calloc(11, sizeof(Double_t)); // allocate 11 parameters for safety, maximum 10 used at the moment