mirror of
https://github.com/slsdetectorgroup/slsDetectorPackage.git
synced 2025-04-23 23:10:02 +02:00
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:
parent
00620db119
commit
0202d16d48
@ -2,10 +2,10 @@
|
||||
#define SVNURL "file:///afs/psi.ch/project/sls_det_software/svn/slsDetectorSoftware/eigerDetectorServer"
|
||||
//#define SVNREPPATH ""
|
||||
#define SVNREPUUID "951219d9-93cf-4727-9268-0efd64621fa3"
|
||||
//#define SVNREV 0x660
|
||||
//#define SVNREV 0x670
|
||||
//#define SVNKIND ""
|
||||
//#define SVNSCHED ""
|
||||
#define SVNAUTH "l_maliakal_d"
|
||||
#define SVNREV 0x660
|
||||
#define SVNDATE 0x20130904
|
||||
#define SVNAUTH "johnson_i"
|
||||
#define SVNREV 0x670
|
||||
#define SVNDATE 0x20130913
|
||||
//
|
||||
|
@ -2,10 +2,10 @@
|
||||
#define SVNURL "file:///afs/psi.ch/project/sls_det_software/svn/slsDetectorSoftware/gotthardDetectorServer"
|
||||
//#define SVNREPPATH ""
|
||||
#define SVNREPUUID "951219d9-93cf-4727-9268-0efd64621fa3"
|
||||
//#define SVNREV 0x659
|
||||
//#define SVNREV 0x676
|
||||
//#define SVNKIND ""
|
||||
//#define SVNSCHED ""
|
||||
#define SVNAUTH "l_maliakal_d"
|
||||
#define SVNREV 0x659
|
||||
#define SVNDATE 0x20130829
|
||||
#define SVNREV 0x676
|
||||
#define SVNDATE 0x20131002
|
||||
//
|
||||
|
@ -2,10 +2,10 @@
|
||||
#define SVNURL "file:///afs/psi.ch/project/sls_det_software/svn/slsDetectorSoftware/moenchDetectorServer"
|
||||
//#define SVNREPPATH ""
|
||||
#define SVNREPUUID "951219d9-93cf-4727-9268-0efd64621fa3"
|
||||
//#define SVNREV 0x659
|
||||
//#define SVNREV 0x673
|
||||
//#define SVNKIND ""
|
||||
//#define SVNSCHED ""
|
||||
#define SVNAUTH "l_maliakal_d"
|
||||
#define SVNREV 0x659
|
||||
#define SVNDATE 0x20130829
|
||||
#define SVNAUTH "bergamaschi"
|
||||
#define SVNREV 0x673
|
||||
#define SVNDATE 0x20130918
|
||||
//
|
||||
|
@ -2,10 +2,10 @@
|
||||
#define SVNURL "file:///afs/psi.ch/project/sls_det_software/svn/slsDetectorSoftware/mythenDetectorServer"
|
||||
//#define SVNREPPATH ""
|
||||
#define SVNREPUUID "951219d9-93cf-4727-9268-0efd64621fa3"
|
||||
//#define SVNREV 0x659
|
||||
//#define SVNREV 0x660
|
||||
//#define SVNKIND ""
|
||||
//#define SVNSCHED ""
|
||||
#define SVNAUTH "l_maliakal_d"
|
||||
#define SVNREV 0x659
|
||||
#define SVNDATE 0x20130829
|
||||
#define SVNREV 0x660
|
||||
#define SVNDATE 0x20130904
|
||||
//
|
||||
|
@ -87,8 +87,8 @@ void slsDetectorUtils::acquire(int delflag){
|
||||
eclog=new enCalLogClass(this);
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
setJoinThread(0);
|
||||
positionFinished(0);
|
||||
|
||||
|
@ -2,10 +2,10 @@
|
||||
#define SVNURLLIB "file:///afs/psi.ch/project/sls_det_software/svn/slsDetectorSoftware"
|
||||
//#define SVNREPPATH ""
|
||||
#define SVNREPUUIDLIB "951219d9-93cf-4727-9268-0efd64621fa3"
|
||||
//#define SVNREV 0x659
|
||||
//#define SVNREV 0x691
|
||||
//#define SVNKIND ""
|
||||
//#define SVNSCHED ""
|
||||
#define SVNAUTHLIB "l_maliakal_d"
|
||||
#define SVNREVLIB 0x659
|
||||
#define SVNDATELIB 0x20130829
|
||||
#define SVNREVLIB 0x691
|
||||
#define SVNDATELIB 0x20131114
|
||||
//
|
||||
|
@ -5,6 +5,7 @@
|
||||
#include "singlePhotonFilter.h"
|
||||
#include <errno.h>
|
||||
|
||||
|
||||
#define BUF_SIZE (16*1024*1024) //16mb
|
||||
|
||||
|
||||
@ -113,7 +114,12 @@ singlePhotonFilter::~singlePhotonFilter(){
|
||||
|
||||
int singlePhotonFilter::enableCompression(bool enable){
|
||||
//#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
|
||||
if(enable){
|
||||
threads_mask = 0x0;
|
||||
@ -136,7 +142,7 @@ int singlePhotonFilter::enableCompression(bool enable){
|
||||
for(int i=0; i<NUM_THREADS; ++i){
|
||||
//cancel threads
|
||||
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);
|
||||
closeFile();
|
||||
pthread_mutex_unlock(&write_mutex);
|
||||
@ -159,23 +165,22 @@ void* singlePhotonFilter::createThreads(void *this_pointer){
|
||||
|
||||
int singlePhotonFilter::initTree(){
|
||||
#ifdef MYROOT
|
||||
if(myFile) {
|
||||
writeToFile();
|
||||
closeFile();
|
||||
}
|
||||
outfname = string(outfname).replace(".raw",".root");
|
||||
//fName.replace(".raw",".png");
|
||||
//sprintf(outfname, "%s/%s.root", outdir, fname);
|
||||
writeToFile();
|
||||
closeFile();
|
||||
sprintf(savefilename, "%s/%s_f%012d_%d.root", filePath,fileName,nTotalHits,fileIndex);
|
||||
|
||||
//file
|
||||
myFile = new TFile(savefilename, "RECREATE"); /** later return error if it exists */
|
||||
|
||||
//tree
|
||||
char c1[10],c2[10],cdata[100];
|
||||
sprintf(c1,"%d",nClusterX);
|
||||
sprintf(c2,"%d",nClusterY);
|
||||
sprintf(cdata,"data[%s][%s]/D",c1,c2);
|
||||
|
||||
//file
|
||||
myFile = new TFile(outfname, "RECREATE"); /** later return error if it exists */
|
||||
//tree
|
||||
myTree = new TTree(fname, fname);
|
||||
|
||||
sprintf(savefilename, "%s_f%012d_%d", fileName,nTotalHits,fileIndex);
|
||||
myTree = new TTree(savefilename, savefilename);
|
||||
myTree->Branch("iframe",&myPhotonHit->iframe,"iframe/I");
|
||||
myTree->Branch("x",&myPhotonHit->x,"x/I");
|
||||
myTree->Branch("y",&myPhotonHit->y,"y/I");
|
||||
@ -198,11 +203,14 @@ int singlePhotonFilter::initTree(){
|
||||
|
||||
|
||||
int singlePhotonFilter::writeToFile(){
|
||||
#ifdef MYROOT
|
||||
if((myTree) && (myFile))
|
||||
myTree->Write();
|
||||
#else
|
||||
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){
|
||||
/*cout<<"writing "<< nHitsPerFrame << " hits to file" << endl;*/
|
||||
fwrite((void*)(photonHitList), 1, sizeof(single_photon_hit)*nHitsPerFrame, myFile);
|
||||
@ -210,9 +218,9 @@ int singlePhotonFilter::writeToFile(){
|
||||
//cout<<"Exiting writeToFile"<<endl;
|
||||
return OK;
|
||||
}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
|
||||
}
|
||||
return FAIL;
|
||||
}
|
||||
|
||||
|
@ -200,7 +200,7 @@ slsReceiverFunctionList::slsReceiverFunctionList(detectorType det):
|
||||
/*cout<<"offset["<<i*y+j<<"]:"<<map[i*y+j]<<"\t";*/
|
||||
offset += 1;
|
||||
}
|
||||
cout<<endl;
|
||||
|
||||
|
||||
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);
|
||||
|
@ -2,10 +2,10 @@
|
||||
#define SVNURL "file:///afs/psi.ch/project/sls_det_software/svn/slsDetectorSoftware/slsReceiver"
|
||||
//#define SVNREPPATH ""
|
||||
#define SVNREPUUID "951219d9-93cf-4727-9268-0efd64621fa3"
|
||||
//#define SVNREV 0x659
|
||||
//#define SVNREV 0x685
|
||||
//#define SVNKIND ""
|
||||
//#define SVNSCHED ""
|
||||
#define SVNAUTH "l_maliakal_d"
|
||||
#define SVNREV 0x659
|
||||
#define SVNDATE 0x20130829
|
||||
#define SVNREV 0x685
|
||||
#define SVNDATE 0x20131114
|
||||
//
|
||||
|
Loading…
x
Reference in New Issue
Block a user