mirror of
https://github.com/slsdetectorgroup/slsDetectorPackage.git
synced 2025-04-24 23:30:03 +02:00
some more changes to receiver
git-svn-id: file:///afs/psi.ch/project/sls_det_software/svn/slsDetectorSoftware@696 951219d9-93cf-4727-9268-0efd64621fa3
This commit is contained in:
parent
ff856d91a4
commit
3b3e4eb8c3
@ -1,7 +1,7 @@
|
|||||||
CFLAGS= -DC_ONLY -fPIC
|
CFLAGS= -DC_ONLY -fPIC
|
||||||
#FLAGS+= #-DVERBOSE -DVERYVERBOSE
|
#FLAGS+= #-DVERBOSE -DVERYVERBOSE
|
||||||
|
|
||||||
DFLAGS= -DDACS_INT -DTHIS_PATH='"$(shell pwd)"' -DSLS_RECEIVER_FUNCTION_LIST $(shell root-config --cflags --glibs) -DMYROOT1
|
DFLAGS= -DDACS_INT -DTHIS_PATH='"$(shell pwd)"' -DSLS_RECEIVER_FUNCTION_LIST #$(shell root-config --cflags --glibs) -DMYROOT1
|
||||||
|
|
||||||
#ASM=$(shell echo "/lib/modules/`uname -r`/build/include")
|
#ASM=$(shell echo "/lib/modules/`uname -r`/build/include")
|
||||||
|
|
||||||
|
@ -172,7 +172,7 @@ int singlePhotonFilter::initTree(){
|
|||||||
|
|
||||||
//file
|
//file
|
||||||
myFile = new TFile(savefilename, "RECREATE"); /** later return error if it exists */
|
myFile = new TFile(savefilename, "RECREATE"); /** later return error if it exists */
|
||||||
|
cout<<"File created: "<<savefilename<<endl;
|
||||||
//tree
|
//tree
|
||||||
char c1[10],c2[10],cdata[100];
|
char c1[10],c2[10],cdata[100];
|
||||||
sprintf(c1,"%d",nClusterX);
|
sprintf(c1,"%d",nClusterX);
|
||||||
@ -235,9 +235,9 @@ int singlePhotonFilter::closeFile(){
|
|||||||
if (myFile){
|
if (myFile){
|
||||||
myFile = myTree->GetCurrentFile();
|
myFile = myTree->GetCurrentFile();
|
||||||
myFile->Close();
|
myFile->Close();
|
||||||
delete myFile;
|
myFile = NULL;//delete myFile;
|
||||||
}
|
}
|
||||||
delete myTree;
|
myTree = NULL;//delete myTree;
|
||||||
}
|
}
|
||||||
#else
|
#else
|
||||||
if(myFile)
|
if(myFile)
|
||||||
@ -536,12 +536,14 @@ void singlePhotonFilter::findHits(){
|
|||||||
isData += 4096;
|
isData += 4096;
|
||||||
myData += 2048;
|
myData += 2048;
|
||||||
|
|
||||||
|
/*
|
||||||
if ((clusteriframe%1000 == 0) && (clusteriframe != 0) ){
|
if ((clusteriframe%1000 == 0) && (clusteriframe != 0) ){
|
||||||
cout << dec << "Frame: " << clusteriframe << " Hit Avg over last frames: " <<
|
cout << dec << "Frame: " << clusteriframe << " Hit Avg over last frames: " <<
|
||||||
nHitStat->Mean() << " .. "<<nHitStat->StandardDeviation() << endl;
|
nHitStat->Mean() << " .. "<<nHitStat->StandardDeviation() << endl;
|
||||||
cout<<"writing "<< nHitsPerFrame << " hits to file" << endl;
|
cout<<"writing "<< nHitsPerFrame << " hits to file" << endl;
|
||||||
}
|
}
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -16,7 +16,9 @@
|
|||||||
//all max frames defined in sls_detector_defs.h. 20000 gotthard, 100000 for short gotthard, 1000 for moench
|
//all max frames defined in sls_detector_defs.h. 20000 gotthard, 100000 for short gotthard, 1000 for moench
|
||||||
|
|
||||||
|
|
||||||
#define GOTTHARD_FIFO_SIZE 25000//11
|
|
||||||
|
//#define GOTTHARD_FIFO_SIZE 25000
|
||||||
|
#define GOTTHARD_FIFO_SIZE 11
|
||||||
#define GOTTHARD_ALIGNED_FRAME_SIZE 4096
|
#define GOTTHARD_ALIGNED_FRAME_SIZE 4096
|
||||||
#define GOTTHARD_PACKETS_PER_FRAME 2
|
#define GOTTHARD_PACKETS_PER_FRAME 2
|
||||||
#define GOTTHARD_ONE_PACKET_SIZE 1286
|
#define GOTTHARD_ONE_PACKET_SIZE 1286
|
||||||
@ -35,7 +37,8 @@
|
|||||||
#define GOTTHARD_PACKET_INDEX_MASK 0x1
|
#define GOTTHARD_PACKET_INDEX_MASK 0x1
|
||||||
|
|
||||||
|
|
||||||
#define GOTTHARD_NUM_JOBS_P_THREAD 5000//20000//3 with 25 frames
|
//#define GOTTHARD_NUM_JOBS_P_THREAD 5000//20000
|
||||||
|
#define GOTTHARD_NUM_JOBS_P_THREAD 3//with 25 frames
|
||||||
#define GOTTHARD_SHORT_NUM_JOBS_P_THREAD 2500//40000
|
#define GOTTHARD_SHORT_NUM_JOBS_P_THREAD 2500//40000
|
||||||
#define MOENCH_NUM_JOBS_P_THREAD 1000//10000
|
#define MOENCH_NUM_JOBS_P_THREAD 1000//10000
|
||||||
|
|
||||||
|
@ -540,7 +540,7 @@ int slsReceiverFunctionList::startListening(){
|
|||||||
|
|
||||||
if (!fifofree->isEmpty()) {
|
if (!fifofree->isEmpty()) {
|
||||||
if (ret!=0)
|
if (ret!=0)
|
||||||
fifofree->pop(buffer);
|
while(!fifofree->pop(buffer));
|
||||||
|
|
||||||
|
|
||||||
if(ret == -3){
|
if(ret == -3){
|
||||||
@ -574,6 +574,7 @@ int slsReceiverFunctionList::startListening(){
|
|||||||
//#ifdef VERYVERBOSE
|
//#ifdef VERYVERBOSE
|
||||||
cerr << "recvfrom() failed:"<<endl;;// << receiver_threads_running<<endl;
|
cerr << "recvfrom() failed:"<<endl;;// << receiver_threads_running<<endl;
|
||||||
fifofree->push(buffer);
|
fifofree->push(buffer);
|
||||||
|
cout<<"***************buffer pushed!!"<<(void*)buffer<<endl;
|
||||||
//#endif
|
//#endif
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
@ -644,7 +645,7 @@ int slsReceiverFunctionList::startListening(){
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
cout<<"end of listening buffer with:"<<(void*)buffer<<endl;
|
||||||
delete tempchar;
|
delete tempchar;
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
@ -833,7 +834,6 @@ int slsReceiverFunctionList::startWriting(){
|
|||||||
/*cout<<"wbuf:"<<(void*)wbuf<<endl;*/
|
/*cout<<"wbuf:"<<(void*)wbuf<<endl;*/
|
||||||
//filter and write
|
//filter and write
|
||||||
if(iJob==-2){
|
if(iJob==-2){
|
||||||
/*cout<<"startingmem changed"<<endl;*/
|
|
||||||
startingmem = wbuf;
|
startingmem = wbuf;
|
||||||
/*cout<<"***************startingmem:"<<(void*)startingmem<<endl;
|
/*cout<<"***************startingmem:"<<(void*)startingmem<<endl;
|
||||||
cout<<"mem0:"<<(void*)mem0<<endl;*/
|
cout<<"mem0:"<<(void*)mem0<<endl;*/
|
||||||
@ -847,11 +847,19 @@ int slsReceiverFunctionList::startWriting(){
|
|||||||
++pointinfifo;
|
++pointinfifo;
|
||||||
++iJob;
|
++iJob;
|
||||||
|
|
||||||
|
/*if((((wbuf-mem0)/4096)+1)!=pointinfifo){
|
||||||
|
cout<<"+++++++++++++++++++++ wbuf:"<<(void*)wbuf<<endl;
|
||||||
|
cout<<"pointfifo:"<<pointinfifo<<endl;
|
||||||
|
cout<<"value:"<<((wbuf-mem0)/4096)+1<<endl;
|
||||||
|
cout<<"starting mem:"<<((startingmem-mem0)/4096)+1<<endl;
|
||||||
|
}*/
|
||||||
|
|
||||||
if(pointinfifo >= (fifosize-1)){
|
if(pointinfifo >= (fifosize-1)){
|
||||||
/*cout<<"*** sending not normally "<<iJob<<endl;
|
/*cout<<"*** sending not normally "<<iJob<<endl;
|
||||||
cout<<"value:"<<((startingmem-mem0)/4096)+1<<endl;
|
cout<<"value:"<<((wbuf-mem0)/4096)+1<<endl;
|
||||||
cout<<"pointfifo:"<<pointinfifo<<endl;
|
cout<<"pointfifo:"<<pointinfifo<<endl;
|
||||||
cout<<"iJob:"<<iJob<<endl;*/
|
cout<<"last sent:"<<(void*)wbuf<<endl;*/
|
||||||
|
|
||||||
filter->assignJobsForThread(startingmem,iJob);
|
filter->assignJobsForThread(startingmem,iJob);
|
||||||
startingmem = mem0;
|
startingmem = mem0;
|
||||||
iJob = 0;
|
iJob = 0;
|
||||||
@ -863,9 +871,10 @@ int slsReceiverFunctionList::startWriting(){
|
|||||||
}
|
}
|
||||||
else if(iJob>=(numJobsPerThread)){
|
else if(iJob>=(numJobsPerThread)){
|
||||||
/*cout<<"*** sending normally "<<numJobsPerThread<<endl;
|
/*cout<<"*** sending normally "<<numJobsPerThread<<endl;
|
||||||
cout<<"value:"<<((startingmem-mem0)/4096)+1<<endl;
|
cout<<"value:"<<((wbuf-mem0)/4096)+1<<endl;
|
||||||
cout<<"pointfifo:"<<pointinfifo<<endl;
|
cout<<"pointfifo:"<<pointinfifo<<endl;
|
||||||
cout<<"iJob:"<<iJob<<endl;*/
|
cout<<"last sent:"<<(void*)wbuf<<endl;*/
|
||||||
|
//if(((startingmem-mem0)/4096)+numJobsPerThread)>
|
||||||
filter->assignJobsForThread(startingmem,numJobsPerThread);
|
filter->assignJobsForThread(startingmem,numJobsPerThread);
|
||||||
iJob = -2;
|
iJob = -2;
|
||||||
}
|
}
|
||||||
@ -962,6 +971,7 @@ int slsReceiverFunctionList::startWriting(){
|
|||||||
else{
|
else{
|
||||||
//all jobs done
|
//all jobs done
|
||||||
if(filter->checkIfJobsDone()){
|
if(filter->checkIfJobsDone()){
|
||||||
|
if(fifo->isEmpty()){
|
||||||
//its all done
|
//its all done
|
||||||
pthread_mutex_lock(&status_mutex);
|
pthread_mutex_lock(&status_mutex);
|
||||||
status = RUN_FINISHED;
|
status = RUN_FINISHED;
|
||||||
@ -970,13 +980,14 @@ int slsReceiverFunctionList::startWriting(){
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
//standard way
|
//standard way
|
||||||
else{
|
else{
|
||||||
pthread_mutex_lock(&status_mutex);
|
pthread_mutex_lock(&status_mutex);
|
||||||
status = RUN_FINISHED;
|
status = RUN_FINISHED;
|
||||||
pthread_mutex_unlock(&(status_mutex));
|
pthread_mutex_unlock(&(status_mutex));
|
||||||
cout << "Status: Run Finished" << endl;
|
cout << "***** Status: Run Finished *****" << endl;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
//acquisition not done in detector
|
//acquisition not done in detector
|
||||||
|
Loading…
x
Reference in New Issue
Block a user