mirror of
https://github.com/slsdetectorgroup/slsDetectorPackage.git
synced 2025-06-14 13:57:13 +02:00
Compare commits
1 Commits
con3
...
moenchv0.1
Author | SHA1 | Date | |
---|---|---|---|
52f74142b1 |
@ -1,4 +1,4 @@
|
|||||||
hostname bchip085+
|
hostname bchip011+
|
||||||
|
|
||||||
patword 0000 0000000000000000
|
patword 0000 0000000000000000
|
||||||
patword 0001 0000000000000000
|
patword 0001 0000000000000000
|
||||||
@ -416,27 +416,30 @@ patwaittime2 0
|
|||||||
|
|
||||||
|
|
||||||
####mcp2011
|
####mcp2011
|
||||||
|
#0:rx_tcpport 1955
|
||||||
#0:rx_udpip 10.1.1.102
|
#0:rx_udpip 10.1.1.102
|
||||||
#0:detectorip 10.1.1.19
|
#0:detectorip 10.1.1.19
|
||||||
#0:rx_udpport 32410
|
#0:rx_udpport 32411
|
||||||
####gui listening to
|
####gui listening to
|
||||||
#zmqip 129.129.202.131
|
#zmqip 129.129.202.106
|
||||||
#zmqport 30001
|
#zmqport 50001
|
||||||
####data streaming out of
|
####data streaming out of
|
||||||
#rx_zmqip 10.1.2.103
|
#rx_zmqip 10.1.2.103
|
||||||
#rx_zmqport 30003
|
#rx_zmqport 50003
|
||||||
|
|
||||||
#0:rx_hostname mpc2011
|
#0:rx_hostname mpc2011
|
||||||
|
|
||||||
####mx-test-1
|
####pcmoench01
|
||||||
|
0:rx_tcpport 1977
|
||||||
0:rx_udpip 10.1.1.100
|
0:rx_udpip 10.1.1.100
|
||||||
0:detectorip 10.1.1.19
|
0:detectorip 10.1.1.19
|
||||||
0:rx_udpport 32410
|
0:rx_udpport 32410
|
||||||
####gui listening to (on receiver pc)
|
####gui listening to (on receiver pc)
|
||||||
zmqip 129.129.202.92
|
zmqip 129.129.202.92
|
||||||
zmqport 30001
|
zmqport 50001
|
||||||
####data streaming out of
|
####data streaming out of
|
||||||
rx_zmqip 10.1.1.100
|
rx_zmqip 10.1.1.100
|
||||||
rx_zmqport 30003
|
rx_zmqport 50003
|
||||||
0:rx_hostname pcmoench01
|
0:rx_hostname pcmoench01
|
||||||
|
|
||||||
|
|
||||||
|
@ -854,9 +854,11 @@ template <class dataType> class analogDetector {
|
|||||||
if (g==0) g=-1.;
|
if (g==0) g=-1.;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (det)
|
if (det) {
|
||||||
|
/* if (det->getChannel(data, ix, iy)>=0x3fff) */
|
||||||
|
/* cout << ix << " " << iy << " " << det->getChannel(data, ix, iy) <<endl; */
|
||||||
val= (dataSign*det->getValue(data, ix, iy)-getPedestal(ix,iy,cm))/g;
|
val= (dataSign*det->getValue(data, ix, iy)-getPedestal(ix,iy,cm))/g;
|
||||||
else
|
} else
|
||||||
val= (((double*)data)[iy*nx+ix]-getPedestal(ix,iy))/g;
|
val= (((double*)data)[iy*nx+ix]-getPedestal(ix,iy))/g;
|
||||||
|
|
||||||
#ifdef ROOTSPECTRUM
|
#ifdef ROOTSPECTRUM
|
||||||
|
@ -2,7 +2,7 @@
|
|||||||
#define MOENCH03T1RECDATANEW_H
|
#define MOENCH03T1RECDATANEW_H
|
||||||
#include "slsDetectorData.h"
|
#include "slsDetectorData.h"
|
||||||
|
|
||||||
#define VERSION_V2
|
//#define VERSION_V2
|
||||||
/**
|
/**
|
||||||
@short structure for a Detector Packet or Image Header
|
@short structure for a Detector Packet or Image Header
|
||||||
@li frameNumber is the frame number
|
@li frameNumber is the frame number
|
||||||
@ -33,7 +33,7 @@
|
|||||||
uint16_t roundRNumber; /**< is the round robin set number */
|
uint16_t roundRNumber; /**< is the round robin set number */
|
||||||
uint8_t detType; /**< is the detector type see :: detectorType */
|
uint8_t detType; /**< is the detector type see :: detectorType */
|
||||||
uint8_t version; /**< is the version number of this structure format */
|
uint8_t version; /**< is the version number of this structure format */
|
||||||
#ifdef VERSION_V2
|
#ifndef VERSION_V1
|
||||||
uint64_t packetCaught[8]; /**< is the version number of this structure format */
|
uint64_t packetCaught[8]; /**< is the version number of this structure format */
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
@ -22,6 +22,10 @@
|
|||||||
#include "moench03Ctb10GbT1Data.h"
|
#include "moench03Ctb10GbT1Data.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#ifdef REORDERED
|
||||||
|
#include "moench03T1ReorderedData.h"
|
||||||
|
#endif
|
||||||
|
|
||||||
// #include "interpolatingDetector.h"
|
// #include "interpolatingDetector.h"
|
||||||
//#include "etaInterpolationPosXY.h"
|
//#include "etaInterpolationPosXY.h"
|
||||||
// #include "linearInterpolation.h"
|
// #include "linearInterpolation.h"
|
||||||
@ -48,7 +52,7 @@ int main(int argc, char *argv[]) {
|
|||||||
}
|
}
|
||||||
int p=10000;
|
int p=10000;
|
||||||
int fifosize=1000;
|
int fifosize=1000;
|
||||||
int nthreads=24;
|
int nthreads=1;
|
||||||
int nsubpix=25;
|
int nsubpix=25;
|
||||||
int etabins=nsubpix*10;
|
int etabins=nsubpix*10;
|
||||||
double etamin=-1, etamax=2;
|
double etamin=-1, etamax=2;
|
||||||
@ -83,6 +87,14 @@ int main(int argc, char *argv[]) {
|
|||||||
cout << "OLD RECEIVER DATA!"<<endl;
|
cout << "OLD RECEIVER DATA!"<<endl;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#ifdef REORDERED
|
||||||
|
moench03T1ReorderedData *decoder=new moench03T1ReorderedData();
|
||||||
|
cout << "REORDERED DATA!"<<endl;
|
||||||
|
#endif
|
||||||
|
|
||||||
|
|
||||||
|
decoder->getDetectorSize(nx,ny);
|
||||||
|
cout << "nx " << nx << " ny " << ny << endl;
|
||||||
|
|
||||||
//moench03T1ZmqData *decoder=new moench03T1ZmqData();
|
//moench03T1ZmqData *decoder=new moench03T1ZmqData();
|
||||||
singlePhotonDetector *filter=new singlePhotonDetector(decoder,csize, nsigma, 1, 0, nped, 200);
|
singlePhotonDetector *filter=new singlePhotonDetector(decoder,csize, nsigma, 1, 0, nped, 200);
|
||||||
@ -183,11 +195,18 @@ int main(int argc, char *argv[]) {
|
|||||||
// cout << "*"<<ifr++<<"*"<<ff<< endl;
|
// cout << "*"<<ifr++<<"*"<<ff<< endl;
|
||||||
// cout << ff << " " << np << endl;
|
// cout << ff << " " << np << endl;
|
||||||
// //push
|
// //push
|
||||||
mt->pushData(buff);
|
// for (int ix=0; ix<400; ix++)
|
||||||
|
// for (int iy=0; iy<400; iy++) {
|
||||||
|
// if (decoder->getChannel(buff, ix, iy)<3000 || decoder->getChannel(buff, ix, iy)>8000) {
|
||||||
|
// cout << ifr << " " << ff << " " << ix << " " << iy << " " << decoder->getChannel(buff, ix, iy) << endl ;
|
||||||
|
// }
|
||||||
|
// }
|
||||||
|
|
||||||
|
mt->pushData(buff);
|
||||||
// // //pop
|
// // //pop
|
||||||
mt->nextThread();
|
mt->nextThread();
|
||||||
// // // cout << " " << (void*)buff;
|
// // // cout << " " << (void*)buff;
|
||||||
mt->popFree(buff);
|
mt->popFree(buff);
|
||||||
ifr++;
|
ifr++;
|
||||||
if (ifr%10000==0) cout << ifr << " " << ff << endl;
|
if (ifr%10000==0) cout << ifr << " " << ff << endl;
|
||||||
ff=-1;
|
ff=-1;
|
||||||
|
@ -57,8 +57,6 @@ int main(int argc, char *argv[]) {
|
|||||||
uint16_t data[NY*NX];
|
uint16_t data[NY*NX];
|
||||||
|
|
||||||
|
|
||||||
int size = 327680;////atoi(argv[3]);
|
|
||||||
|
|
||||||
int* image;
|
int* image;
|
||||||
|
|
||||||
int ff, np;
|
int ff, np;
|
||||||
@ -76,8 +74,6 @@ int main(int argc, char *argv[]) {
|
|||||||
|
|
||||||
char fname[10000];
|
char fname[10000];
|
||||||
char outfname[10000];
|
char outfname[10000];
|
||||||
char imgfname[10000];
|
|
||||||
char pedfname[10000];
|
|
||||||
// strcpy(pedfname,argv[6]);
|
// strcpy(pedfname,argv[6]);
|
||||||
char fn[10000];
|
char fn[10000];
|
||||||
|
|
||||||
@ -98,7 +94,7 @@ int main(int argc, char *argv[]) {
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
char* buff;
|
char buff[dsize];
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@ -112,7 +108,7 @@ int main(int argc, char *argv[]) {
|
|||||||
sprintf(outfname,"%s/%s_image.raw",outdir,fn);
|
sprintf(outfname,"%s/%s_image.raw",outdir,fn);
|
||||||
std::time(&end_time);
|
std::time(&end_time);
|
||||||
cout << std::ctime(&end_time) << endl;
|
cout << std::ctime(&end_time) << endl;
|
||||||
cout << fname << " " << outfname << " " << imgfname << endl;
|
// cout << fname << " " << outfname << " " << imgfname << endl;
|
||||||
filebin.open((const char *)(fname), ios::in | ios::binary);
|
filebin.open((const char *)(fname), ios::in | ios::binary);
|
||||||
// //open file
|
// //open file
|
||||||
if (filebin.is_open()){
|
if (filebin.is_open()){
|
||||||
@ -126,10 +122,14 @@ int main(int argc, char *argv[]) {
|
|||||||
// //while read frame
|
// //while read frame
|
||||||
ff=-1;
|
ff=-1;
|
||||||
while (decoder->readNextFrame(filebin, ff, np,buff)) {
|
while (decoder->readNextFrame(filebin, ff, np,buff)) {
|
||||||
for (int ix=0; ix<400; ix++)
|
for (int ix=0; ix<400; ix++) {
|
||||||
for (int iy=0; iy<400; iy++)
|
for (int iy=0; iy<400; iy++) {
|
||||||
data[iy*NX+ix]=decoder->getChannel(buff,ix,iy);
|
data[iy*400+ix]=decoder->getChannel(buff,ix,iy);
|
||||||
|
if (data[iy*NX+ix]<3000 || data[iy*NX+ix]>8000) {
|
||||||
|
cout << ifr << " " << ff << " " << ix << " " << iy << " " << data[iy*NX+ix] << " " << decoder->getChannel(buff,ix,iy) << endl;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
ifr++;
|
ifr++;
|
||||||
|
|
||||||
fwrite(&ff, 8, 1,of);//write detector frame number
|
fwrite(&ff, 8, 1,of);//write detector frame number
|
||||||
@ -138,7 +138,7 @@ int main(int argc, char *argv[]) {
|
|||||||
|
|
||||||
if (ifr%10000==0) cout << ifr << " " << ff << endl;
|
if (ifr%10000==0) cout << ifr << " " << ff << endl;
|
||||||
ff=-1;
|
ff=-1;
|
||||||
|
// break;
|
||||||
}
|
}
|
||||||
cout << "--" << endl;
|
cout << "--" << endl;
|
||||||
filebin.close();
|
filebin.close();
|
||||||
|
@ -2,6 +2,7 @@
|
|||||||
#include <iostream>
|
#include <iostream>
|
||||||
|
|
||||||
|
|
||||||
|
#define VERSION_V1
|
||||||
|
|
||||||
//#include "moench03T1ZmqData.h"
|
//#include "moench03T1ZmqData.h"
|
||||||
#ifdef NEWRECEIVER
|
#ifdef NEWRECEIVER
|
||||||
@ -52,14 +53,14 @@ int main(int argc, char *argv[]) {
|
|||||||
|
|
||||||
int p=10000;
|
int p=10000;
|
||||||
int fifosize=1000;
|
int fifosize=1000;
|
||||||
int nthreads=8;
|
int nthreads=1;
|
||||||
int nsubpix=25;
|
int nsubpix=25;
|
||||||
int etabins=nsubpix*10;
|
int etabins=nsubpix*10;
|
||||||
double etamin=-1, etamax=2;
|
double etamin=-1, etamax=2;
|
||||||
int csize=3;
|
int csize=3;
|
||||||
int save=1;
|
int save=1;
|
||||||
int nsigma=5;
|
int nsigma=5;
|
||||||
int nped=1000;
|
int nped=10000;
|
||||||
int ndark=100;
|
int ndark=100;
|
||||||
int ok;
|
int ok;
|
||||||
int iprog=0;
|
int iprog=0;
|
||||||
@ -169,7 +170,11 @@ int main(int argc, char *argv[]) {
|
|||||||
//#ifndef ANALOG
|
//#ifndef ANALOG
|
||||||
if (thr>0) {
|
if (thr>0) {
|
||||||
cout << "threshold is " << thr << endl;
|
cout << "threshold is " << thr << endl;
|
||||||
|
|
||||||
|
//#ifndef ANALOG
|
||||||
filter->setThreshold(thr);
|
filter->setThreshold(thr);
|
||||||
|
//#endif
|
||||||
|
|
||||||
} else
|
} else
|
||||||
cf=1;
|
cf=1;
|
||||||
//#endif
|
//#endif
|
||||||
@ -184,7 +189,9 @@ int main(int argc, char *argv[]) {
|
|||||||
cout << std::ctime(&end_time) << endl;
|
cout << std::ctime(&end_time) << endl;
|
||||||
|
|
||||||
char* buff;
|
char* buff;
|
||||||
|
|
||||||
multiThreadedAnalogDetector *mt=new multiThreadedAnalogDetector(filter,nthreads,fifosize);
|
multiThreadedAnalogDetector *mt=new multiThreadedAnalogDetector(filter,nthreads,fifosize);
|
||||||
|
|
||||||
#ifndef ANALOG
|
#ifndef ANALOG
|
||||||
mt->setDetectorMode(ePhotonCounting);
|
mt->setDetectorMode(ePhotonCounting);
|
||||||
cout << "Counting!" << endl;
|
cout << "Counting!" << endl;
|
||||||
@ -197,8 +204,7 @@ int main(int argc, char *argv[]) {
|
|||||||
mt->setDetectorMode(eAnalog);
|
mt->setDetectorMode(eAnalog);
|
||||||
cout << "Analog!" << endl;
|
cout << "Analog!" << endl;
|
||||||
cf=0;
|
cf=0;
|
||||||
// #ifdef ANALOG
|
// thr1=thr;
|
||||||
// thr1=thr;
|
|
||||||
#endif
|
#endif
|
||||||
// }
|
// }
|
||||||
|
|
||||||
@ -229,11 +235,14 @@ int main(int argc, char *argv[]) {
|
|||||||
if (filebin.is_open()){
|
if (filebin.is_open()){
|
||||||
ff=-1;
|
ff=-1;
|
||||||
while (decoder->readNextFrame(filebin, ff, np,buff)) {
|
while (decoder->readNextFrame(filebin, ff, np,buff)) {
|
||||||
mt->pushData(buff);
|
if (np==40) {
|
||||||
mt->nextThread();
|
mt->pushData(buff);
|
||||||
mt->popFree(buff);
|
mt->nextThread();
|
||||||
ifr++;
|
mt->popFree(buff);
|
||||||
if (ifr%10000==0)
|
ifr++;
|
||||||
|
if (ifr%10000==0)
|
||||||
|
cout << ifr << " " << ff << " " << np << endl;
|
||||||
|
} else
|
||||||
cout << ifr << " " << ff << " " << np << endl;
|
cout << ifr << " " << ff << " " << np << endl;
|
||||||
ff=-1;
|
ff=-1;
|
||||||
}
|
}
|
||||||
@ -244,16 +253,18 @@ int main(int argc, char *argv[]) {
|
|||||||
cout << std::ctime(&end_time) << endl;
|
cout << std::ctime(&end_time) << endl;
|
||||||
|
|
||||||
} else
|
} else
|
||||||
cout << "Could not open "<< fname << " for reading " << endl;
|
cout << "Could not open pedestal file "<< fname << " for reading " << endl;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
ifr=0;
|
ifr=0;
|
||||||
int ifile=0;
|
int ifile=0;
|
||||||
|
|
||||||
|
mt->setFrameMode(eFrame);
|
||||||
|
|
||||||
for (int irun=runmin; irun<=runmax; irun++) {
|
for (int irun=runmin; irun<=runmax; irun++) {
|
||||||
cout << "DATA " ;
|
cout << "DATA " ;
|
||||||
mt->setFrameMode(eFrame);
|
|
||||||
// sprintf(fn,fformat,irun);
|
// sprintf(fn,fformat,irun);
|
||||||
sprintf(ffname,"%s/%s.raw",indir,fformat);
|
sprintf(ffname,"%s/%s.raw",indir,fformat);
|
||||||
sprintf(fname,ffname,irun);
|
sprintf(fname,ffname,irun);
|
||||||
@ -270,8 +281,7 @@ int main(int argc, char *argv[]) {
|
|||||||
// //open file
|
// //open file
|
||||||
ifile=0;
|
ifile=0;
|
||||||
if (filebin.is_open()){
|
if (filebin.is_open()){
|
||||||
if (thr<=0) {
|
if (thr<=0 && cf!=0) { //cluster finder
|
||||||
if (cf) {
|
|
||||||
if (of==NULL) {
|
if (of==NULL) {
|
||||||
of=fopen(cfname,"w");
|
of=fopen(cfname,"w");
|
||||||
if (of) {
|
if (of) {
|
||||||
@ -283,35 +293,36 @@ int main(int argc, char *argv[]) {
|
|||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
}
|
}
|
||||||
// //while read frame
|
// //while read frame
|
||||||
ff=-1;
|
ff=-1;
|
||||||
ifr=0;
|
ifr=0;
|
||||||
while (decoder->readNextFrame(filebin, ff, np,buff)) {
|
while (decoder->readNextFrame(filebin, ff, np,buff)) {
|
||||||
|
if (np==40) {
|
||||||
// cout << "*"<<ifr++<<"*"<<ff<< endl;
|
// cout << "*"<<ifr++<<"*"<<ff<< endl;
|
||||||
// cout << ff << " " << np << endl;
|
// cout << ff << " " << np << endl;
|
||||||
// //push
|
// //push
|
||||||
mt->pushData(buff);
|
mt->pushData(buff);
|
||||||
// // //pop
|
// // //pop
|
||||||
mt->nextThread();
|
mt->nextThread();
|
||||||
// // // cout << " " << (void*)buff;
|
// // // cout << " " << (void*)buff;
|
||||||
mt->popFree(buff);
|
mt->popFree(buff);
|
||||||
ifr++;
|
ifr++;
|
||||||
if (ifr%1000==0) cout << ifr << " " << ff << endl;
|
if (ifr%1000==0) cout << ifr << " " << ff << endl;
|
||||||
if (nframes>0) {
|
if (nframes>0) {
|
||||||
if (ifr%nframes==0) {
|
if (ifr%nframes==0) {
|
||||||
//The name has an additional "_fXXXXX" at the end, where "XXXXX" is the initial frame number of the image (0,1000,2000...)
|
//The name has an additional "_fXXXXX" at the end, where "XXXXX" is the initial frame number of the image (0,1000,2000...)
|
||||||
|
|
||||||
sprintf(ffname,"%s/%s_f%05d.tiff",outdir,fformat,ifile);
|
sprintf(ffname,"%s/%s_f%05d.tiff",outdir,fformat,ifile);
|
||||||
sprintf(imgfname,ffname,irun);
|
sprintf(imgfname,ffname,irun);
|
||||||
//cout << "Writing tiff to " << imgfname << " " << thr1 << endl;
|
//cout << "Writing tiff to " << imgfname << " " << thr1 << endl;
|
||||||
mt->writeImage(imgfname, thr1);
|
mt->writeImage(imgfname, thr1);
|
||||||
mt->clearImage();
|
mt->clearImage();
|
||||||
ifile++;
|
ifile++;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
} else
|
||||||
|
cout << ifr << " " << ff << " " << np << endl;
|
||||||
ff=-1;
|
ff=-1;
|
||||||
}
|
}
|
||||||
cout << "--" << endl;
|
cout << "--" << endl;
|
||||||
|
@ -324,8 +324,11 @@ public:
|
|||||||
img=dets[ii]->getImage();
|
img=dets[ii]->getImage();
|
||||||
for (int i=0; i<nn; i++) {
|
for (int i=0; i<nn; i++) {
|
||||||
if (ii==0)
|
if (ii==0)
|
||||||
image[i]=img[i];
|
// if (img[i]>0)
|
||||||
else
|
image[i]=img[i];
|
||||||
|
// else
|
||||||
|
// image[i]=0;
|
||||||
|
else //if (img[i]>0)
|
||||||
image[i]+=img[i];
|
image[i]+=img[i];
|
||||||
//if (img[i]) cout << "det " << ii << " pix " << i << " val " << img[i] << " " << image[i] << endl;
|
//if (img[i]) cout << "det " << ii << " pix " << i << " val " << img[i] << " " << image[i] << endl;
|
||||||
}
|
}
|
||||||
@ -359,11 +362,14 @@ public:
|
|||||||
float *gm=new float[nn];
|
float *gm=new float[nn];
|
||||||
if (gm) {
|
if (gm) {
|
||||||
for (int ix=0; ix<nn; ix++) {
|
for (int ix=0; ix<nn; ix++) {
|
||||||
if (t)
|
if (t) {
|
||||||
gm[ix]=(image[ix])/t;
|
if (image[ix]<0)
|
||||||
else
|
gm[ix]=0;
|
||||||
|
else
|
||||||
|
gm[ix]=(image[ix])/t;
|
||||||
|
} else
|
||||||
gm[ix]=image[ix];
|
gm[ix]=image[ix];
|
||||||
|
|
||||||
//if (image[ix]>0 && ix/nnx<350) cout << ix/nnx << " " << ix%nnx << " " << image[ix]<< " " << gm[ix] << endl;
|
//if (image[ix]>0 && ix/nnx<350) cout << ix/nnx << " " << ix%nnx << " " << image[ix]<< " " << gm[ix] << endl;
|
||||||
}
|
}
|
||||||
//cout << "image " << nnx << " " << nny << endl;
|
//cout << "image " << nnx << " " << nny << endl;
|
||||||
|
Reference in New Issue
Block a user