program runs (fixed detector size in jungfrauLGADStrixelsDataQuadH5.h)

This commit is contained in:
hinger_v 2024-09-05 17:03:31 +02:00
parent 16bfcc17ce
commit 7b4740ced2
2 changed files with 196 additions and 186 deletions

View File

@ -138,8 +138,8 @@ class jungfrauLGADStrixelsDataQuadH5 : public slsDetectorData<uint16_t> {
int ix, iy = 0; int ix, iy = 0;
// remapping loop // remapping loop
for (int ipy = y0; ipy <= y1; ipy++) { for (int ipy = y0; ipy <= y1; ++ipy) {
for (int ipx = x0; ipx <= x1; ipx++) { for (int ipx = x0; ipx <= x1; ++ipx) {
ix = int((ipx - x0) / multiplicator); ix = int((ipx - x0) / multiplicator);
for (int m = 0; m < multiplicator; ++m) { for (int m = 0; m < multiplicator; ++m) {
@ -264,16 +264,21 @@ class jungfrauLGADStrixelsDataQuadH5 : public slsDetectorData<uint16_t> {
jungfrauLGADStrixelsDataQuadH5(uint16_t xmin = 0, uint16_t xmax = 0, jungfrauLGADStrixelsDataQuadH5(uint16_t xmin = 0, uint16_t xmax = 0,
uint16_t ymin = 0, uint16_t ymax = 0) uint16_t ymin = 0, uint16_t ymax = 0)
: slsDetectorData<uint16_t>( : slsDetectorData<uint16_t>(
nc_strixel, //nc_strixel,
nr_strixel * 2 + nr_center, //nr_strixel * 2 + nr_center,
nc_strixel * ( nr_strixel * 2 + nr_center ) * 2 ) { //nc_strixel * ( nr_strixel * 2 + nr_center ) * 2
512/2,
1024*2,
512 * 1024 * 2 ) {
std::cout << "Jungfrau strixels quad with full module data " std::cout << "Jungfrau strixels quad with full module data "
<< std::endl; << std::endl;
// Fill all strixels with dummy values // Fill all strixels with dummy values
for (int ix = 0; ix != nc_strixel; ++ix) { //for (int ix = 0; ix != nc_strixel; ++ix) {
for (int iy = 0; iy != nr_strixel * 2 + nr_center; ++iy) { // for (int iy = 0; iy != nr_strixel * 2 + nr_center; ++iy) {
dataMap[iy][ix] = sizeof(header); //mayb another value is safer for (int ix = 0; ix != 512/2; ++ix) {
for (int iy = 0; iy != 1024*2; ++iy) {
dataMap[iy][ix] = sizeof(header); //maybe another value is safer
} }
} }

View File

@ -113,8 +113,10 @@ int main(int argc, char *argv[]) {
std::string line{}; std::string line{};
while (!inputs.eof()) { while (!inputs.eof()) {
std::getline(inputs, line); std::getline(inputs, line);
if(line.find(".h5") != std::string::npos) {
filenames.emplace_back(line); filenames.emplace_back(line);
std::cout << line << " line.max_size() " << line.max_size() << " filenames.capacity() " << filenames.capacity() << '\n'; std::cout << line << std::endl; //" line.max_size() " << line.max_size() << " filenames.capacity() " << filenames.capacity() << '\n';
}
} }
inputs.close(); inputs.close();
std::cout << "---- Reached end of txt-file. ----" << std::endl; std::cout << "---- Reached end of txt-file. ----" << std::endl;
@ -133,8 +135,8 @@ int main(int argc, char *argv[]) {
// Define decoder // Define decoder
std::cout << "Jungfrau strixel quad h5" << std::endl; std::cout << "Jungfrau strixel quad h5" << std::endl;
//jungfrauLGADStrixelsDataQuadH5* decoder = new jungfrauLGADStrixelsDataQuadH5(); jungfrauLGADStrixelsDataQuadH5* decoder = new jungfrauLGADStrixelsDataQuadH5();
auto decoder = std::make_unique<jungfrauLGADStrixelsDataQuadH5>(); //auto decoder = std::make_unique<jungfrauLGADStrixelsDataQuadH5>();
int nx = 1024 / 3, ny = 512 * 3; int nx = 1024 / 3, ny = 512 * 3;
//Cluster finder ROI //Cluster finder ROI
@ -162,9 +164,9 @@ int main(int argc, char *argv[]) {
uint32_t nnx, nny; uint32_t nnx, nny;
//singlePhotonDetector* filter = singlePhotonDetector* filter =
// new singlePhotonDetector(decoder.get(), 3, nsigma, 1, NULL, nped, 200, -1, -1, NULL, NULL); new singlePhotonDetector(decoder, 3, nsigma, 1, NULL, nped, 200, -1, -1, NULL, NULL);
auto filter = std::make_unique<singlePhotonDetector>(decoder.get(), 3, nsigma, 1, nullptr, nped, 200, -1, -1, nullptr, nullptr); //auto filter = std::make_unique<singlePhotonDetector>(decoder.get(), 3, nsigma, 1, nullptr, nped, 200, -1, -1, nullptr, nullptr);
thr = 0.15 * thr; thr = 0.15 * thr;
filter->newDataSet(); filter->newDataSet();
@ -184,9 +186,9 @@ int main(int argc, char *argv[]) {
char* buff; char* buff;
//multiThreadedCountingDetector* mt = multiThreadedCountingDetector* mt =
// new multiThreadedCountingDetector(filter, nthreads, fifosize); new multiThreadedCountingDetector(filter, nthreads, fifosize);
auto mt = std::make_unique<multiThreadedCountingDetector>(filter.get(), nthreads, fifosize); //auto mt = std::make_unique<multiThreadedCountingDetector>(filter.get(), nthreads, fifosize);
mt->setClusterSize(csize, csize); mt->setClusterSize(csize, csize);
#ifndef ANALOG #ifndef ANALOG
@ -346,7 +348,7 @@ int main(int argc, char *argv[]) {
while ( decoder->readNextFrame(*fileh5, framenumber, iframe, buff) ) { while ( decoder->readNextFrame(*fileh5, framenumber, iframe, buff) ) {
//std::cout << "Here! " << framenumber << " "; //std::cout << "Here! " << framenumber << " ";
// //push // //push
if ((ifr + 1) % 100 == 0) { if ((ifr + 1) % 1000 == 0) {
std::cout << " ****" std::cout << " ****"
<< decoder->getValue(buff, 20, 20); // << std::endl; << decoder->getValue(buff, 20, 20); // << std::endl;
} }
@ -357,7 +359,7 @@ int main(int argc, char *argv[]) {
mt->popFree(buff); mt->popFree(buff);
++ifr; ++ifr;
if (ifr % 100 == 0) if (ifr % 1000 == 0)
std::cout << " " << ifr << " " << framenumber << std::endl; std::cout << " " << ifr << " " << framenumber << std::endl;
if (nframes > 0) { if (nframes > 0) {
if (ifr % nframes == 0) { if (ifr % nframes == 0) {
@ -405,8 +407,11 @@ int main(int argc, char *argv[]) {
mt->writeImage(imgfname.c_str(), thr1); mt->writeImage(imgfname.c_str(), thr1);
} }
//delete decoder
//delete filter; //delete filter;
//delete mt; delete mt;
delete filter;
delete decoder;
delete buff; delete buff;
return 0; return 0;