}
cout << colorwhite << "setSystemSpecificParameters():" << endlr;
setSystemSpecificParameters();
+ cout << colorwhite << "setMatrixSpecificParameters():" << endlr;
+ setMatrixSpecificParameters();
cout << colorwhite << "generateReadableRunCode():" << endlr;
generateReadableRunCode();
cout << colorwhite << "initRootParameters():" << endlr;
sensorinfostruct sensorinfoMi34PXI( 16, /* rows */ 64 /* columns */ );
sensorinfostruct sensorinfoPegasus( 8, 56 );
sensorinfostruct sensorinfoFSBB( 8, 208 );
+
if (labbook.system.EqualTo("USB") && labbook.chipGen.EqualTo("Mi34") )
sensorinfocur=sensorinfoMi34USB;
else if (labbook.system.EqualTo("USB") && labbook.chipGen.EqualTo("FSBB") )
sensorinfocur=sensorinfoPegasus;
}
+void Run::setMatrixSpecificParameters()
+{
+ submatrix_x_start = 0;
+ submatrix_x_end = sensorinfocur.columns;
+ submatrix_y_start = 0;
+ submatrix_y_end = sensorinfocur.rows;
+}
+
+
+void Run::setSubMatrixBorders(u_int x_start, u_int x_end, u_int y_start, u_int y_end)
+{
+ submatrix_x_start = x_start;
+ submatrix_x_end = x_end;
+ submatrix_y_start = y_start;
+ submatrix_y_end = y_end;
+}
+
+void Run::selectSubMatrixFSBB(TString matrixname)
+{
+ if (matrixname.EqualTo("A0"))
+ setSubMatrixBorders(0, sensorinfocur.columns, 0, sensorinfocur.rows/2-2);
+ else if (matrixname.EqualTo("A1"))
+ setSubMatrixBorders(0, sensorinfocur.columns, sensorinfocur.rows/2+2, sensorinfocur.rows);
+ else
+ cout << colorred << "Error in selectSubMatrixFSBB(), given submatrix with name: " << matrixname << " not known. " << endlr;
+}
+
template <typename T>
string Run::prepareSQLStatement( T statement )
{
{
for(Int_t hiti=0; (unsigned int)hiti<processed->fFrameInfo.hits;hiti++)
{
- histogram.numberofhits++;
-
- // histogram with the single pixel
- histogram.Seed->Fill(processed->fFrameInfo.p[12][hiti]);
-
- // sum histogram
- pixelSum = 0;
- notSeedSum = 0;
- if(labbook.chipGen=="FSBB")
- {
- Float_t clusterArray[processed->clustersize*processed->clustersize];
- Int_t index[processed->clustersize*processed->clustersize];
- for (Int_t clusteri=0; clusteri<processed->clustersize*processed->clustersize; clusteri++)
- {
- clusterArray[clusteri] = processed->fFrameInfo.p[clusteri][hiti];
- if (clusteri != 12)
- notSeedSum += processed->fFrameInfo.p[clusteri][hiti];
- }
- TMath::Sort(processed->clustersize*processed->clustersize,clusterArray,index,1);
- for (Int_t clusteri=0; clusteri<4; clusteri++)
- {
- pixelSum += clusterArray[index[clusteri]];
-
- }
- }
- else
- {
- for (Int_t clusteri=0; clusteri<processed->clustersize*processed->clustersize; clusteri++)
- {
- pixelSum += processed->fFrameInfo.p[clusteri][hiti];
- if (clusteri != 12)
- notSeedSum += processed->fFrameInfo.p[clusteri][hiti];
- }
- }
- histogram.Sum->Fill(pixelSum);
-
- // veto spectrum
- if (TMath::Abs(notSeedSum) < systemparamcur.vetothreshold && (labbook.source.Contains("Fe")||labbook.source.Contains("Cd")))
- histogram.Veto->Fill(processed->fFrameInfo.p[12][hiti]); // histogram with the single pixel
-
- if (processed->fFrameInfo.pixelthreshold[hiti]>0)
+ uint pixel_column_x = processed->fFrameInfo.pixel[hiti]%sensorinfocur.columns; // column of seed
+ uint pixel_row_y = processed->fFrameInfo.pixel[hiti]/sensorinfocur.columns; // row of seed
+ if (false) {
+ cout << "submatrix_x_start: " << submatrix_x_start << ", submatrix_x_end: " << submatrix_x_end << endl;
+ cout << "submatrix_y_start: " << submatrix_y_start << ", submatrix_y_end: " << submatrix_y_end << endl;
+ cout << "pixel_column_x: " << pixel_column_x << ", pixel_row_y: " << pixel_row_y << endl;
+ }
+ 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
{
- histogramthreshold.numberofhits++;
+ histogram.numberofhits++;
+
+ // histogram with the single pixel
+ histogram.Seed->Fill(processed->fFrameInfo.p[12][hiti]);
+
+ // sum histogram
+ pixelSum = 0;
+ notSeedSum = 0;
+ if(labbook.chipGen=="FSBB")
+ {
+ Float_t clusterArray[processed->clustersize*processed->clustersize];
+ Int_t index[processed->clustersize*processed->clustersize];
+ for (Int_t clusteri=0; clusteri<processed->clustersize*processed->clustersize; clusteri++)
+ {
+ clusterArray[clusteri] = processed->fFrameInfo.p[clusteri][hiti];
+ if (clusteri != 12)
+ notSeedSum += processed->fFrameInfo.p[clusteri][hiti];
+ }
+ TMath::Sort(processed->clustersize*processed->clustersize,clusterArray,index,1);
+ for (Int_t clusteri=0; clusteri<4; clusteri++)
+ {
+ pixelSum += clusterArray[index[clusteri]];
+
+ }
+ }
+ else
+ {
+ for (Int_t clusteri=0; clusteri<processed->clustersize*processed->clustersize; clusteri++)
+ {
+ pixelSum += processed->fFrameInfo.p[clusteri][hiti];
+ if (clusteri != 12)
+ notSeedSum += processed->fFrameInfo.p[clusteri][hiti];
+ }
+ }
+ histogram.Sum->Fill(pixelSum);
- histogramthreshold.Seed->Fill(processed->fFrameInfo.p[12][hiti]);
- histogramthreshold.Sum->Fill(pixelSum);
+ // veto spectrum
if (TMath::Abs(notSeedSum) < systemparamcur.vetothreshold && (labbook.source.Contains("Fe")||labbook.source.Contains("Cd")))
- histogramthreshold.Veto->Fill(processed->fFrameInfo.p[12][hiti]); // histogram with the single pixel
+ histogram.Veto->Fill(processed->fFrameInfo.p[12][hiti]); // histogram with the single pixel
+
+ if (processed->fFrameInfo.pixelthreshold[hiti]>0)
+ {
+ histogramthreshold.numberofhits++;
+
+ histogramthreshold.Seed->Fill(processed->fFrameInfo.p[12][hiti]);
+ histogramthreshold.Sum->Fill(pixelSum);
+ if (TMath::Abs(notSeedSum) < systemparamcur.vetothreshold && (labbook.source.Contains("Fe")||labbook.source.Contains("Cd")))
+ histogramthreshold.Veto->Fill(processed->fFrameInfo.p[12][hiti]); // histogram with the single pixel
+ }
}
}
}
if (processed->fFrameInfo.hits<(unsigned int)10)
{
for(Int_t hiti=0; (unsigned int)hiti<processed->fFrameInfo.hits;hiti++)
- {
- if (processed->fFrameInfo.pixel[hiti]%2==0) // Diode sitzt oben im SeedPixel, da nach PitchY angeordnet
- {
- for (Int_t clusteri=0; clusteri<processed->clustersize*processed->clustersize; clusteri++)
- {
- if ((clusteri%processed->clustersize)%2==0 || rotateangle == 0)
- {
- // betrachte für Pixel mit Diode links
- xcoord = (clusteri%processed->clustersize)*curpixelinfo.pitchY+11;
- ycoord = (int)(clusteri/processed->clustersize)*curpixelinfo.pitchX+11;
- xcoord_old = xcoord;
- xcoord = xcoord*TMath::Cos(rotateangle/180*TMath::Pi())-ycoord*TMath::Sin(rotateangle/180*TMath::Pi());
- ycoord = xcoord_old*TMath::Sin(rotateangle/180*TMath::Pi())+ycoord*TMath::Cos(rotateangle/180*TMath::Pi());
- }
- else
- {
- // betrachte für Pixel mit Diode links
- xcoord = (clusteri%processed->clustersize)*curpixelinfo.pitchY+11;
- ycoord = (int)(clusteri/processed->clustersize)*curpixelinfo.pitchX+curpixelinfo.pitchX/2+11;
- xcoord_old = xcoord;
- xcoord = xcoord*TMath::Cos(rotateangle/180*TMath::Pi())-ycoord*TMath::Sin(rotateangle/180*TMath::Pi());
- ycoord = xcoord_old*TMath::Sin(rotateangle/180*TMath::Pi())+ycoord*TMath::Cos(rotateangle/180*TMath::Pi());
- }
-// cout << colorwhite << "oben: xcoord: " << xcoord << ", ycoord: " << ycoord << endl;
-
- histogram.histAvgCluster->Fill(xcoord,ycoord,processed->fFrameInfo.p[clusteri][hiti]);
- if (processed->fFrameInfo.pixelthreshold[hiti]>0)
- histogramthreshold.histAvgCluster->Fill(xcoord,ycoord,processed->fFrameInfo.p[clusteri][hiti]);
- }
+ {
+ uint pixel_column_x = processed->fFrameInfo.pixel[hiti]%sensorinfocur.columns; // column of seed
+ uint pixel_row_y = processed->fFrameInfo.pixel[hiti]/sensorinfocur.columns; // row of seed
+ if (false) {
+ cout << "submatrix_x_start: " << submatrix_x_start << ", submatrix_x_end: " << submatrix_x_end << endl;
+ cout << "submatrix_y_start: " << submatrix_y_start << ", submatrix_y_end: " << submatrix_y_end << endl;
+ cout << "pixel_column_x: " << pixel_column_x << ", pixel_row_y: " << pixel_row_y << endl;
}
- else // Diode sitzt unten im SeedPixel, da nach PitchY angeordnet
+ 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
{
- for (Int_t clusteri=0; clusteri<processed->clustersize*processed->clustersize; clusteri++)
+ if (processed->fFrameInfo.pixel[hiti]%2==0) // Diode sitzt oben im SeedPixel, da nach PitchY angeordnet
{
- if ((clusteri%processed->clustersize)%2==1 || rotateangle == 0)
+ for (Int_t clusteri=0; clusteri<processed->clustersize*processed->clustersize; clusteri++)
{
- // betrachte für Pixel mit Diode links
- xcoord = (clusteri%processed->clustersize)*curpixelinfo.pitchY+11;
- ycoord = (int)(clusteri/processed->clustersize)*curpixelinfo.pitchX+11;
- xcoord_old = xcoord;
- xcoord = xcoord*TMath::Cos(rotateangle/180*TMath::Pi())-ycoord*TMath::Sin(rotateangle/180*TMath::Pi());
- ycoord = xcoord_old*TMath::Sin(rotateangle/180*TMath::Pi())+ycoord*TMath::Cos(rotateangle/180*TMath::Pi());
- }
- else
+ if ((clusteri%processed->clustersize)%2==0 || rotateangle == 0)
+ {
+ // betrachte für Pixel mit Diode links
+ xcoord = (clusteri%processed->clustersize)*curpixelinfo.pitchY+11;
+ ycoord = (int)(clusteri/processed->clustersize)*curpixelinfo.pitchX+11;
+ xcoord_old = xcoord;
+ xcoord = xcoord*TMath::Cos(rotateangle/180*TMath::Pi())-ycoord*TMath::Sin(rotateangle/180*TMath::Pi());
+ ycoord = xcoord_old*TMath::Sin(rotateangle/180*TMath::Pi())+ycoord*TMath::Cos(rotateangle/180*TMath::Pi());
+ }
+ else
+ {
+ // betrachte für Pixel mit Diode links
+ xcoord = (clusteri%processed->clustersize)*curpixelinfo.pitchY+11;
+ ycoord = (int)(clusteri/processed->clustersize)*curpixelinfo.pitchX+curpixelinfo.pitchX/2+11;
+ xcoord_old = xcoord;
+ xcoord = xcoord*TMath::Cos(rotateangle/180*TMath::Pi())-ycoord*TMath::Sin(rotateangle/180*TMath::Pi());
+ ycoord = xcoord_old*TMath::Sin(rotateangle/180*TMath::Pi())+ycoord*TMath::Cos(rotateangle/180*TMath::Pi());
+ }
+ // cout << colorwhite << "oben: xcoord: " << xcoord << ", ycoord: " << ycoord << endl;
+
+ histogram.histAvgCluster->Fill(xcoord,ycoord,processed->fFrameInfo.p[clusteri][hiti]);
+ if (processed->fFrameInfo.pixelthreshold[hiti]>0)
+ histogramthreshold.histAvgCluster->Fill(xcoord,ycoord,processed->fFrameInfo.p[clusteri][hiti]);
+ }
+ }
+ else // Diode sitzt unten im SeedPixel, da nach PitchY angeordnet
+ {
+ for (Int_t clusteri=0; clusteri<processed->clustersize*processed->clustersize; clusteri++)
{
- // betrachte für Pixel mit Diode links
- xcoord = (clusteri%processed->clustersize)*curpixelinfo.pitchY+11;
- ycoord = (int)(clusteri/processed->clustersize)*curpixelinfo.pitchX+curpixelinfo.pitchX/2+11;
- xcoord_old = xcoord;
- xcoord = xcoord*TMath::Cos(rotateangle/180*TMath::Pi())-ycoord*TMath::Sin(rotateangle/180*TMath::Pi());
- ycoord = xcoord_old*TMath::Sin(rotateangle/180*TMath::Pi())+ycoord*TMath::Cos(rotateangle/180*TMath::Pi());
+ if ((clusteri%processed->clustersize)%2==1 || rotateangle == 0)
+ {
+ // betrachte für Pixel mit Diode links
+ xcoord = (clusteri%processed->clustersize)*curpixelinfo.pitchY+11;
+ ycoord = (int)(clusteri/processed->clustersize)*curpixelinfo.pitchX+11;
+ xcoord_old = xcoord;
+ xcoord = xcoord*TMath::Cos(rotateangle/180*TMath::Pi())-ycoord*TMath::Sin(rotateangle/180*TMath::Pi());
+ ycoord = xcoord_old*TMath::Sin(rotateangle/180*TMath::Pi())+ycoord*TMath::Cos(rotateangle/180*TMath::Pi());
+ }
+ else
+ {
+ // betrachte für Pixel mit Diode links
+ xcoord = (clusteri%processed->clustersize)*curpixelinfo.pitchY+11;
+ ycoord = (int)(clusteri/processed->clustersize)*curpixelinfo.pitchX+curpixelinfo.pitchX/2+11;
+ xcoord_old = xcoord;
+ xcoord = xcoord*TMath::Cos(rotateangle/180*TMath::Pi())-ycoord*TMath::Sin(rotateangle/180*TMath::Pi());
+ ycoord = xcoord_old*TMath::Sin(rotateangle/180*TMath::Pi())+ycoord*TMath::Cos(rotateangle/180*TMath::Pi());
+ }
+ // cout << colorwhite << "unten: xcoord: " << xcoord << ", ycoord: " << ycoord << endl;
+
+ histogram.histAvgCluster->Fill(xcoord,ycoord,processed->fFrameInfo.p[clusteri][hiti]);
+ if (processed->fFrameInfo.pixelthreshold[hiti]>0)
+ histogramthreshold.histAvgCluster->Fill(xcoord,ycoord,processed->fFrameInfo.p[clusteri][hiti]);
}
- // cout << colorwhite << "unten: xcoord: " << xcoord << ", ycoord: " << ycoord << endl;
-
- histogram.histAvgCluster->Fill(xcoord,ycoord,processed->fFrameInfo.p[clusteri][hiti]);
- if (processed->fFrameInfo.pixelthreshold[hiti]>0)
- histogramthreshold.histAvgCluster->Fill(xcoord,ycoord,processed->fFrameInfo.p[clusteri][hiti]);
}
}
}