corrected Makefile target install_inc

git-svn-id: file:///afs/psi.ch/project/sls_det_software/svn/slsDetectorSoftware@708 951219d9-93cf-4727-9268-0efd64621fa3
This commit is contained in:
bergamaschi 2013-12-16 10:45:58 +00:00
parent a485e33e82
commit 3fa2fe5392
3 changed files with 27 additions and 22 deletions

View File

@ -82,6 +82,6 @@ install: package
install_inc:
$(shell test -d $(DESTDIR) || mkdir -p $(DESTDIR))
cp -P slsDetector/slsDetectorUsers.h slsDetectorAnalysis/detectorData.h $(DESTDIR) slsReceiver/slsReceiverUsers.h
cp -P slsDetector/slsDetectorUsers.h slsDetectorAnalysis/detectorData.h $(DESTDIR) slsReceiver/slsReceiverUsers.h $(DESTDIR)

View File

@ -16,13 +16,12 @@ singlePhotonFilter::singlePhotonFilter(int nx, int ny,
int16_t *m, int16_t *s, CircularFifo<char>* f, int d, int* tfcaught, int* fcaught,uint32_t* cframenum):
#ifdef MYROOT1
myTree(NULL),
myFile(NULL),
#else
myFile(NULL),
nHitsPerFile(0),
nTotalHits(0),
#endif
myFile(NULL),
nHitsPerFrame(0),
nChannelsX(nx),
nChannelsY(ny),
@ -67,6 +66,9 @@ singlePhotonFilter::singlePhotonFilter(int nx, int ny,
#ifndef MYROOT1
//photonHitList=(single_photon_hit**) (new int*[nChannelsX*nChannelsY/(nClusterX*nClusterY)*1000]);
photonHitList=new single_photon_hit*[nChannelsX*nChannelsY/(nClusterX*nClusterY)*1000];
for (int ii=0; ii<nChannelsX*nChannelsY/(nClusterX*nClusterY)*1000; ii++)
photonHitList[ii]=new single_photon_hit(nClusterX, nClusterY);
cout << nClusterX << " " << nClusterY << " " << nClusterX*nClusterY << endl;
#endif
sqrtCluster = sqrt(nClusterX*nClusterY);
@ -228,16 +230,16 @@ int singlePhotonFilter::writeToFile(){
/*cout<<"writing "<< nHitsPerFrame << " hits to file" << endl;*/
for (ii=0; ii<nHitsPerFrame; ii++) {
photonHitList[ii]->write(myFile);
delete photonHitList[ii];
// delete photonHitList[ii];
}
delete photonHitList[ii];
// delete photonHitList[ii];
// photonHitList[0]=new single_photon_hit(nClusterX,nClusterY);
// fwrite((void*)(photonHitList), 1, sizeof(single_photon_hit)*nHitsPerFrame, myFile);
/*framesInFile += nHitsPerFrame;*/
nHitsPerFrame = 0;
nHitsPerFrame = 0;
//cout<<"Exiting writeToFile"<<endl;
return OK;
return OK;
}else
cout << "ERROR: Could not write to " << nHitsPerFrame <<" hits to file as file doesnt exist" << endl;
@ -412,10 +414,6 @@ int singlePhotonFilter::verifyFrame(char *inData){
}
void singlePhotonFilter::findHits(){
int ir,ic,r,c,i;
int currentIndex;
@ -423,7 +421,7 @@ void singlePhotonFilter::findHits(){
int clusterIndex;
// single_photon_hit *hit;
double* clusterData;// = hit.data;
double clusterData[nClusterX*nClusterY];// = hit.data;
double sigmarms;
double clusterrms;
double clusterped;
@ -491,8 +489,7 @@ void singlePhotonFilter::findHits(){
#endif
clusteriframe -= f0;
myData = (int16_t*)isData;
if (nHitsPerFrame==0)
photonHitList[nHitsPerFrame]=new single_photon_hit(nClusterX, nClusterY);
clusterData=photonHitList[nHitsPerFrame]->data;
@ -566,7 +563,9 @@ void singlePhotonFilter::findHits(){
#ifdef MYROOT1
myTree->Fill();
#else
// photonHitList[nHitsPerFrame].data = clusterData;
for (int ix=0; ix<nClusterX*nClusterY; ix++)
photonHitList[nHitsPerFrame]->data[ix] = clusterData[ix];
photonHitList[nHitsPerFrame]->x = ic;
photonHitList[nHitsPerFrame]->y = ir;
photonHitList[nHitsPerFrame]->rms = clusterrms;
@ -575,7 +574,11 @@ void singlePhotonFilter::findHits(){
//hit.write(myFile);
nHitsPerFrame++;
photonHitList[nHitsPerFrame]=new single_photon_hit(nClusterX,nClusterY);
// cout << nHitsPerFrame << " " << nChannelsX*nChannelsY/(nClusterX*nClusterY)*1000 << endl;
// photonHitList[nHitsPerFrame]=new single_photon_hit(nClusterX,nClusterY);
// cout << "done" << endl;
nHitsPerFile++;
nTotalHits++;
if(nHitsPerFile >= MAX_HITS_PER_FILE-1)
@ -596,6 +599,7 @@ void singlePhotonFilter::findHits(){
//write for each frame, not packet
pthread_mutex_lock(&write_mutex);
cout << "write to file " << nHitsPerFrame << endl;
writeToFile();
pthread_mutex_unlock(&write_mutex);
@ -628,7 +632,7 @@ void singlePhotonFilter::findHits(){
delete [] clusterData;
// delete [] clusterData;
}

View File

@ -21,11 +21,12 @@ typedef int int32_t;
class single_photon_hit {
public:
single_photon_hit(int nx, int ny): dx(nx), dy(ny) {data=new double[dx*dy];};
single_photon_hit(int nx, int ny=1): dx(nx), dy(ny) {data=new double[dx*dy];};
~single_photon_hit(){delete [] data;};
void write(FILE *myFile) {fwrite((void*)this, 1, 3*sizeof(int)+2*sizeof(double), myFile); fwrite((void*)data, 1, dx*dy*sizeof(double), myFile);};
void read(FILE *myFile) {fread((void*)this, 1, 3*sizeof(int)+2*sizeof(double), myFile); fread((void*)data, 1, dx*dy*sizeof(double), myFile);};
void set_data(double v, int ix, int iy=0){data[(iy+ny/2)*nx+ix+nx/2]=v;};
double get_data(int ix, int iy=0){return data[(iy+ny/2)*nx+ix+nx/2];};
int x; /**< x-coordinate of the center of hit */