some more changes to receiver

git-svn-id: file:///afs/psi.ch/project/sls_det_software/svn/slsDetectorSoftware@692 951219d9-93cf-4727-9268-0efd64621fa3
This commit is contained in:
l_maliakal_d
2013-11-14 14:18:30 +00:00
parent 00620db119
commit 0202d16d48
9 changed files with 50 additions and 42 deletions

View File

@ -2,10 +2,10 @@
#define SVNURL "file:///afs/psi.ch/project/sls_det_software/svn/slsDetectorSoftware/eigerDetectorServer" #define SVNURL "file:///afs/psi.ch/project/sls_det_software/svn/slsDetectorSoftware/eigerDetectorServer"
//#define SVNREPPATH "" //#define SVNREPPATH ""
#define SVNREPUUID "951219d9-93cf-4727-9268-0efd64621fa3" #define SVNREPUUID "951219d9-93cf-4727-9268-0efd64621fa3"
//#define SVNREV 0x660 //#define SVNREV 0x670
//#define SVNKIND "" //#define SVNKIND ""
//#define SVNSCHED "" //#define SVNSCHED ""
#define SVNAUTH "l_maliakal_d" #define SVNAUTH "johnson_i"
#define SVNREV 0x660 #define SVNREV 0x670
#define SVNDATE 0x20130904 #define SVNDATE 0x20130913
// //

View File

@ -2,10 +2,10 @@
#define SVNURL "file:///afs/psi.ch/project/sls_det_software/svn/slsDetectorSoftware/gotthardDetectorServer" #define SVNURL "file:///afs/psi.ch/project/sls_det_software/svn/slsDetectorSoftware/gotthardDetectorServer"
//#define SVNREPPATH "" //#define SVNREPPATH ""
#define SVNREPUUID "951219d9-93cf-4727-9268-0efd64621fa3" #define SVNREPUUID "951219d9-93cf-4727-9268-0efd64621fa3"
//#define SVNREV 0x659 //#define SVNREV 0x676
//#define SVNKIND "" //#define SVNKIND ""
//#define SVNSCHED "" //#define SVNSCHED ""
#define SVNAUTH "l_maliakal_d" #define SVNAUTH "l_maliakal_d"
#define SVNREV 0x659 #define SVNREV 0x676
#define SVNDATE 0x20130829 #define SVNDATE 0x20131002
// //

View File

@ -2,10 +2,10 @@
#define SVNURL "file:///afs/psi.ch/project/sls_det_software/svn/slsDetectorSoftware/moenchDetectorServer" #define SVNURL "file:///afs/psi.ch/project/sls_det_software/svn/slsDetectorSoftware/moenchDetectorServer"
//#define SVNREPPATH "" //#define SVNREPPATH ""
#define SVNREPUUID "951219d9-93cf-4727-9268-0efd64621fa3" #define SVNREPUUID "951219d9-93cf-4727-9268-0efd64621fa3"
//#define SVNREV 0x659 //#define SVNREV 0x673
//#define SVNKIND "" //#define SVNKIND ""
//#define SVNSCHED "" //#define SVNSCHED ""
#define SVNAUTH "l_maliakal_d" #define SVNAUTH "bergamaschi"
#define SVNREV 0x659 #define SVNREV 0x673
#define SVNDATE 0x20130829 #define SVNDATE 0x20130918
// //

View File

@ -2,10 +2,10 @@
#define SVNURL "file:///afs/psi.ch/project/sls_det_software/svn/slsDetectorSoftware/mythenDetectorServer" #define SVNURL "file:///afs/psi.ch/project/sls_det_software/svn/slsDetectorSoftware/mythenDetectorServer"
//#define SVNREPPATH "" //#define SVNREPPATH ""
#define SVNREPUUID "951219d9-93cf-4727-9268-0efd64621fa3" #define SVNREPUUID "951219d9-93cf-4727-9268-0efd64621fa3"
//#define SVNREV 0x659 //#define SVNREV 0x660
//#define SVNKIND "" //#define SVNKIND ""
//#define SVNSCHED "" //#define SVNSCHED ""
#define SVNAUTH "l_maliakal_d" #define SVNAUTH "l_maliakal_d"
#define SVNREV 0x659 #define SVNREV 0x660
#define SVNDATE 0x20130829 #define SVNDATE 0x20130904
// //

View File

@ -87,8 +87,8 @@ void slsDetectorUtils::acquire(int delflag){
eclog=new enCalLogClass(this); eclog=new enCalLogClass(this);
setJoinThread(0); setJoinThread(0);
positionFinished(0); positionFinished(0);

View File

@ -2,10 +2,10 @@
#define SVNURLLIB "file:///afs/psi.ch/project/sls_det_software/svn/slsDetectorSoftware" #define SVNURLLIB "file:///afs/psi.ch/project/sls_det_software/svn/slsDetectorSoftware"
//#define SVNREPPATH "" //#define SVNREPPATH ""
#define SVNREPUUIDLIB "951219d9-93cf-4727-9268-0efd64621fa3" #define SVNREPUUIDLIB "951219d9-93cf-4727-9268-0efd64621fa3"
//#define SVNREV 0x659 //#define SVNREV 0x691
//#define SVNKIND "" //#define SVNKIND ""
//#define SVNSCHED "" //#define SVNSCHED ""
#define SVNAUTHLIB "l_maliakal_d" #define SVNAUTHLIB "l_maliakal_d"
#define SVNREVLIB 0x659 #define SVNREVLIB 0x691
#define SVNDATELIB 0x20130829 #define SVNDATELIB 0x20131114
// //

View File

@ -5,6 +5,7 @@
#include "singlePhotonFilter.h" #include "singlePhotonFilter.h"
#include <errno.h> #include <errno.h>
#define BUF_SIZE (16*1024*1024) //16mb #define BUF_SIZE (16*1024*1024) //16mb
@ -113,7 +114,12 @@ singlePhotonFilter::~singlePhotonFilter(){
int singlePhotonFilter::enableCompression(bool enable){ int singlePhotonFilter::enableCompression(bool enable){
//#ifdef VERBOSE //#ifdef VERBOSE
cout << "Compression set to " << enable << endl; cout << "Compression set to " << enable;
#ifdef MYROOT
cout << " with root" << endl;
#else
cout << " without root" << endl;
#endif
//#endif //#endif
if(enable){ if(enable){
threads_mask = 0x0; threads_mask = 0x0;
@ -136,7 +142,7 @@ int singlePhotonFilter::enableCompression(bool enable){
for(int i=0; i<NUM_THREADS; ++i){ for(int i=0; i<NUM_THREADS; ++i){
//cancel threads //cancel threads
while(pthread_cancel(find_hits_thread[i])!=0) while(pthread_cancel(find_hits_thread[i])!=0)
cout << "Unable to cancel Thread " << index << endl;/*pthread_join(find_hits_thread[i],NULL);*/ cout << "Unable to cancel Thread " << i << endl;/*pthread_join(find_hits_thread[i],NULL);*/
pthread_mutex_lock(&write_mutex); pthread_mutex_lock(&write_mutex);
closeFile(); closeFile();
pthread_mutex_unlock(&write_mutex); pthread_mutex_unlock(&write_mutex);
@ -159,23 +165,22 @@ void* singlePhotonFilter::createThreads(void *this_pointer){
int singlePhotonFilter::initTree(){ int singlePhotonFilter::initTree(){
#ifdef MYROOT #ifdef MYROOT
if(myFile) { writeToFile();
writeToFile(); closeFile();
closeFile(); sprintf(savefilename, "%s/%s_f%012d_%d.root", filePath,fileName,nTotalHits,fileIndex);
}
outfname = string(outfname).replace(".raw",".root");
//fName.replace(".raw",".png");
//sprintf(outfname, "%s/%s.root", outdir, fname);
//file
myFile = new TFile(savefilename, "RECREATE"); /** later return error if it exists */
//tree
char c1[10],c2[10],cdata[100]; char c1[10],c2[10],cdata[100];
sprintf(c1,"%d",nClusterX); sprintf(c1,"%d",nClusterX);
sprintf(c2,"%d",nClusterY); sprintf(c2,"%d",nClusterY);
sprintf(cdata,"data[%s][%s]/D",c1,c2); sprintf(cdata,"data[%s][%s]/D",c1,c2);
//file
myFile = new TFile(outfname, "RECREATE"); /** later return error if it exists */ sprintf(savefilename, "%s_f%012d_%d", fileName,nTotalHits,fileIndex);
//tree myTree = new TTree(savefilename, savefilename);
myTree = new TTree(fname, fname);
myTree->Branch("iframe",&myPhotonHit->iframe,"iframe/I"); myTree->Branch("iframe",&myPhotonHit->iframe,"iframe/I");
myTree->Branch("x",&myPhotonHit->x,"x/I"); myTree->Branch("x",&myPhotonHit->x,"x/I");
myTree->Branch("y",&myPhotonHit->y,"y/I"); myTree->Branch("y",&myPhotonHit->y,"y/I");
@ -198,11 +203,14 @@ int singlePhotonFilter::initTree(){
int singlePhotonFilter::writeToFile(){ int singlePhotonFilter::writeToFile(){
#ifdef MYROOT
if((myTree) && (myFile))
myTree->Write();
#else
if(nHitsPerFrame){ if(nHitsPerFrame){
#ifdef MYROOT
if((myTree) && (myFile)){
myTree->Write();
return OK;
}else
cout << "ERROR: Could not write to " << nHitsPerFrame << " hits to file as file or tree doesnt exist" << endl;
#else
if(myFile){ if(myFile){
/*cout<<"writing "<< nHitsPerFrame << " hits to file" << endl;*/ /*cout<<"writing "<< nHitsPerFrame << " hits to file" << endl;*/
fwrite((void*)(photonHitList), 1, sizeof(single_photon_hit)*nHitsPerFrame, myFile); fwrite((void*)(photonHitList), 1, sizeof(single_photon_hit)*nHitsPerFrame, myFile);
@ -210,9 +218,9 @@ int singlePhotonFilter::writeToFile(){
//cout<<"Exiting writeToFile"<<endl; //cout<<"Exiting writeToFile"<<endl;
return OK; return OK;
}else }else
cout << "ERROR: Could not write to " << nHitsPerFrame <<" hits to file as myfile doesnt exist" << endl; cout << "ERROR: Could not write to " << nHitsPerFrame <<" hits to file as file doesnt exist" << endl;
}
#endif #endif
}
return FAIL; return FAIL;
} }

View File

@ -200,7 +200,7 @@ slsReceiverFunctionList::slsReceiverFunctionList(detectorType det):
/*cout<<"offset["<<i*y+j<<"]:"<<map[i*y+j]<<"\t";*/ /*cout<<"offset["<<i*y+j<<"]:"<<map[i*y+j]<<"\t";*/
offset += 1; offset += 1;
} }
cout<<endl;
filter = new singlePhotonFilter(x,y,GOTTHARD_FRAME_INDEX_MASK, GOTTHARD_PACKET_INDEX_MASK, GOTTHARD_FRAME_INDEX_OFFSET, filter = new singlePhotonFilter(x,y,GOTTHARD_FRAME_INDEX_MASK, GOTTHARD_PACKET_INDEX_MASK, GOTTHARD_FRAME_INDEX_OFFSET,
0, GOTTHARD_PACKETS_PER_FRAME, 1,map, mask,fifofree,GOTTHARD_BUFFER_SIZE); 0, GOTTHARD_PACKETS_PER_FRAME, 1,map, mask,fifofree,GOTTHARD_BUFFER_SIZE);

View File

@ -2,10 +2,10 @@
#define SVNURL "file:///afs/psi.ch/project/sls_det_software/svn/slsDetectorSoftware/slsReceiver" #define SVNURL "file:///afs/psi.ch/project/sls_det_software/svn/slsDetectorSoftware/slsReceiver"
//#define SVNREPPATH "" //#define SVNREPPATH ""
#define SVNREPUUID "951219d9-93cf-4727-9268-0efd64621fa3" #define SVNREPUUID "951219d9-93cf-4727-9268-0efd64621fa3"
//#define SVNREV 0x659 //#define SVNREV 0x685
//#define SVNKIND "" //#define SVNKIND ""
//#define SVNSCHED "" //#define SVNSCHED ""
#define SVNAUTH "l_maliakal_d" #define SVNAUTH "l_maliakal_d"
#define SVNREV 0x659 #define SVNREV 0x685
#define SVNDATE 0x20130829 #define SVNDATE 0x20131114
// //