mirror of
https://github.com/slsdetectorgroup/slsDetectorPackage.git
synced 2025-06-23 10:07:59 +02:00
enCalLog and angCalLog added
git-svn-id: file:///afs/psi.ch/project/sls_det_software/svn/slsDetectorSoftware@233 951219d9-93cf-4727-9268-0efd64621fa3
This commit is contained in:
62
slsDetectorSoftware/slsDetectorAnalysis/angCalLogClass.h
Normal file
62
slsDetectorSoftware/slsDetectorAnalysis/angCalLogClass.h
Normal file
@ -0,0 +1,62 @@
|
||||
#ifndef ANGCALLOGCLASS_H
|
||||
#define ANGCALLOGCLASS_H
|
||||
|
||||
#include <iostream>
|
||||
#include <fstream>
|
||||
#include "slsDetectorCommand.h"
|
||||
#include "slsDetectorUtils.h"
|
||||
#include "sls_detector_defs.h"
|
||||
|
||||
using namespace std;
|
||||
|
||||
class angCalLogClass {
|
||||
|
||||
|
||||
public:
|
||||
|
||||
|
||||
angCalLogClass(slsDetectorUtils *det){ \
|
||||
char cmd[1000];
|
||||
char *argv[2]; \
|
||||
argv[0]=cmd; \
|
||||
sprintf(cmd,"_%d.angcal",det->getFileIndex()); \
|
||||
outfile.open(string(det->getFilePath()+string("/")+det->getFileName()+string(cmd)).c_str()); \
|
||||
myDet=new slsDetectorCommand(det); \
|
||||
strcpy(cmd,"nmod"); \
|
||||
outfile << myDet->executeLine(1,argv,slsDetectorDefs::GET_ACTION) << endl; \
|
||||
strcpy(cmd,"angconv"); \
|
||||
outfile << myDet->executeLine(1,argv,slsDetectorDefs::GET_ACTION) << endl; \
|
||||
strcpy(cmd,"globaloff"); \
|
||||
outfile << myDet->executeLine(1,argv,slsDetectorDefs::GET_ACTION) << endl; \
|
||||
strcpy(cmd,"fineoff"); \
|
||||
outfile << myDet->executeLine(1,argv,slsDetectorDefs::GET_ACTION) << endl; \
|
||||
strcpy(cmd,"angdir"); \
|
||||
outfile << myDet->executeLine(1,argv,slsDetectorDefs::GET_ACTION) << endl; \
|
||||
strcpy(cmd,"ffdir"); \
|
||||
outfile << myDet->executeLine(1,argv,slsDetectorDefs::GET_ACTION) << endl; \
|
||||
strcpy(cmd,"flatfield"); \
|
||||
outfile << myDet->executeLine(1,argv,slsDetectorDefs::GET_ACTION) << endl; \
|
||||
strcpy(cmd,"badchannels"); \
|
||||
outfile << myDet->executeLine(1,argv,slsDetectorDefs::GET_ACTION) << endl; \
|
||||
};
|
||||
|
||||
~angCalLogClass(){delete myDet; outfile.close();};
|
||||
|
||||
int addStep(double pos, string fname) {outfile << pos << " " << fname << endl; return 0;};
|
||||
|
||||
|
||||
|
||||
private:
|
||||
|
||||
slsDetectorCommand *myDet;
|
||||
ofstream outfile;
|
||||
|
||||
|
||||
|
||||
};
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
#endif
|
54
slsDetectorSoftware/slsDetectorAnalysis/enCalLogClass.h
Normal file
54
slsDetectorSoftware/slsDetectorAnalysis/enCalLogClass.h
Normal file
@ -0,0 +1,54 @@
|
||||
#ifndef ENCALLOGCLASS_H
|
||||
#define ENCALLOGCLASS_H
|
||||
|
||||
#include <iostream>
|
||||
#include <fstream>
|
||||
#include "slsDetectorCommand.h"
|
||||
#include "slsDetectorUtils.h"
|
||||
#include "sls_detector_defs.h"
|
||||
|
||||
using namespace std;
|
||||
|
||||
class enCalLogClass {
|
||||
|
||||
|
||||
public:
|
||||
|
||||
|
||||
enCalLogClass(slsDetectorUtils *det){ \
|
||||
char cmd[1000];
|
||||
char *argv[2]; \
|
||||
argv[0]=cmd; \
|
||||
sprintf(cmd,"_%d.encal",det->getFileIndex()); \
|
||||
outfile.open(string(det->getFilePath()+string("/")+det->getFileName()+string(cmd)).c_str()); \
|
||||
myDet=new slsDetectorCommand(det); \
|
||||
strcpy(cmd,"settings"); \
|
||||
outfile << myDet->executeLine(1,argv,slsDetectorDefs::GET_ACTION) << endl; \
|
||||
strcpy(cmd,"nmod"); \
|
||||
outfile << myDet->executeLine(1,argv,slsDetectorDefs::GET_ACTION) << endl; \
|
||||
for (int im=0; im<det->setNumberOfModules(); im++) { \
|
||||
sprintf(cmd,"modulenumber:%d",im); \
|
||||
outfile << myDet->executeLine(1,argv,slsDetectorDefs::GET_ACTION) << endl; \
|
||||
}; \
|
||||
};
|
||||
|
||||
~enCalLogClass(){delete myDet; outfile.close();};
|
||||
|
||||
int addStep(double threshold, string fname) {outfile << threshold << " " << fname << endl; return 0;};
|
||||
|
||||
|
||||
|
||||
private:
|
||||
|
||||
slsDetectorCommand *myDet;
|
||||
ofstream outfile;
|
||||
|
||||
|
||||
|
||||
};
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
#endif
|
@ -119,17 +119,17 @@ class postProcessing : public angularConversion, public fileIO {
|
||||
static int rateCorrect(double datain, double errin, double &dataout, double &errout, double tau, double t);
|
||||
|
||||
|
||||
int enableWriteToFile(int i=-1) {if (i>0) ((*correctionMask)|=(1<<WRITE_FILE)); if(i==0) ((*correctionMask)&=~(1<< WRITE_FILE)); return ((*correctionMask)&(1<< WRITE_FILE));};
|
||||
int enableWriteToFile(int i=-1) {if (i>0) ((*correctionMask)|=(1<<WRITE_FILE)); else if (i==0) ((*correctionMask)&=~(1<< WRITE_FILE)); return (((*correctionMask)&(1<< WRITE_FILE ))>>WRITE_FILE) ;};
|
||||
|
||||
|
||||
int setAngularCorrectionMask(int i=-1){if (i==0) (*correctionMask)&=~(1<< ANGULAR_CONVERSION); if (i>0) (*correctionMask)|=(1<< ANGULAR_CONVERSION); return ((*correctionMask)&(1<< ANGULAR_CONVERSION));};
|
||||
int setAngularCorrectionMask(int i=-1){if (i==0) (*correctionMask)&=~(1<< ANGULAR_CONVERSION); if (i>0) (*correctionMask)|=(1<< ANGULAR_CONVERSION); return (((*correctionMask)&(1<< ANGULAR_CONVERSION))>>ANGULAR_CONVERSION);};
|
||||
|
||||
|
||||
|
||||
int enableAngularConversion(int i=-1) {if (i>0) return setAngularConversionFile("default"); if (i==0) return setAngularConversionFile(""); return setAngularCorrectionMask();};
|
||||
|
||||
|
||||
int enableBadChannelCorrection(int i=-1) {if (i>0) return setBadChannelCorrection("default"); if (i==0) return setBadChannelCorrection(""); return ((*correctionMask)&(1<< DISCARD_BAD_CHANNELS));};
|
||||
int enableBadChannelCorrection(int i=-1) {if (i>0) return setBadChannelCorrection("default"); if (i==0) return setBadChannelCorrection(""); return (((*correctionMask)&(1<< DISCARD_BAD_CHANNELS))>>DISCARD_BAD_CHANNELS);};
|
||||
|
||||
|
||||
|
||||
|
Reference in New Issue
Block a user