mirror of
https://github.com/slsdetectorgroup/slsDetectorPackage.git
synced 2025-06-23 18:17:59 +02:00
finished removing using namespace std
This commit is contained in:
@ -12,7 +12,7 @@
|
||||
#include <queue>
|
||||
#include <math.h>
|
||||
|
||||
using namespace std;
|
||||
;
|
||||
/**
|
||||
@short class handling the data file I/O flags
|
||||
*/
|
||||
|
@ -13,7 +13,7 @@
|
||||
#include "sls_detector_defs.h"
|
||||
#endif
|
||||
|
||||
using namespace std;
|
||||
;
|
||||
|
||||
class angCalLogClass {
|
||||
|
||||
@ -27,7 +27,7 @@ class angCalLogClass {
|
||||
char *argv[2]; \
|
||||
argv[0]=cmd; \
|
||||
sprintf(cmd,"_%d.angcal",det->getFileIndex()); \
|
||||
outfile.open(string(det->getFilePath()+string("/")+det->getFileName()+string(cmd)).c_str()); \
|
||||
outfile.open( std::string(det->getFilePath()+ std::string("/")+det->getFileName()+ std::string(cmd)).c_str()); \
|
||||
outfile.precision(8);
|
||||
myDet=new slsDetectorCommand(det); \
|
||||
if (outfile.is_open()) { \
|
||||
@ -44,12 +44,12 @@ class angCalLogClass {
|
||||
#endif
|
||||
|
||||
|
||||
int addStep(double pos, string fname) {std::cout.precision(5); outfile << pos << " " << fname << endl; return 0;};
|
||||
int addStep(double pos, std::string fname) {std::cout.precision(5); outfile << pos << " " << fname << endl; return 0;};
|
||||
|
||||
|
||||
//
|
||||
|
||||
int readHeader(ifstream &infile, int &maxmod, int &nmod, int &chanspermod, char *angconvfile, double &globaloff, double &fineoff, int &angdir, char *ffdir, char *fffile, char *badfile ) { \
|
||||
int readHeader(std::ifstream &infile, int &maxmod, int &nmod, int &chanspermod, char *angconvfile, double &globaloff, double &fineoff, int &angdir, char *ffdir, char *fffile, char *badfile ) { \
|
||||
nmod=0; chanspermod=0; globaloff=0; fineoff=0; angdir=1; \
|
||||
strcpy(angconvfile,"none"); strcpy(ffdir,"none"); strcpy(fffile,"none"); strcpy(badfile,"none"); \
|
||||
char line[1000], myvar[100], myarg[100]; \
|
||||
@ -57,14 +57,14 @@ class angCalLogClass {
|
||||
for (int iv=0; iv<nvars; iv++) { \
|
||||
infile.getline(line,1000); \
|
||||
sscanf(line,"%s %s", myvar, myarg); \
|
||||
if (string(myvar)!=string(vars[iv]))
|
||||
if ( std::string(myvar)!= std::string(vars[iv]))
|
||||
cout << "Found variable " << myvar << " instead of " << vars[iv] << endl;
|
||||
else
|
||||
switch (iv) { \
|
||||
case 0: \
|
||||
if (string(myarg).find("Mythen")!=string::npos) \
|
||||
if ( std::string(myarg).find("Mythen")!= std::string::npos) \
|
||||
chanspermod=1280; \
|
||||
else if (string(myarg).find("Gotthard")!=string::npos) \
|
||||
else if ( std::string(myarg).find("Gotthard")!= std::string::npos) \
|
||||
chanspermod=1280; \
|
||||
else \
|
||||
chanspermod=65535; \
|
||||
@ -106,7 +106,7 @@ class angCalLogClass {
|
||||
return 0; \
|
||||
};
|
||||
|
||||
int getStep(ifstream &infile, double &threshold, char *datafname){ \
|
||||
int getStep(std::ifstream &infile, double &threshold, char *datafname){ \
|
||||
char line[1000]; \
|
||||
float v;
|
||||
infile.getline(line,1000); \
|
||||
@ -140,7 +140,7 @@ class angCalLogClass {
|
||||
#ifndef MYROOT
|
||||
slsDetectorCommand *myDet;
|
||||
#endif
|
||||
ofstream outfile;
|
||||
std::ofstream outfile;
|
||||
|
||||
char vars[100][100];
|
||||
int nvars;
|
||||
|
@ -19,7 +19,7 @@
|
||||
//double angle(int ichan, double encoder, double totalOffset, double conv_r, double center, double offset, double tilt, int direction)
|
||||
|
||||
|
||||
// using namespace std;
|
||||
//
|
||||
|
||||
/**
|
||||
@short Angular conversion constants needed for a detector module
|
||||
@ -256,7 +256,7 @@ class angularConversion : public virtual slsDetectorBase, public angularConversi
|
||||
/**
|
||||
returns the angular conversion file
|
||||
*/
|
||||
std::string getAngularConversionFile(){if (setAngularCorrectionMask()) return string(angConvFile); else return string("none");};
|
||||
std::string getAngularConversionFile(){if (setAngularCorrectionMask()) return std::string(angConvFile); else return std::string("none");};
|
||||
|
||||
|
||||
/**
|
||||
|
@ -19,7 +19,7 @@
|
||||
|
||||
class angleConversionConstant;
|
||||
|
||||
using namespace std;
|
||||
;
|
||||
|
||||
/**
|
||||
@short Angular conversion constants needed for a detector module
|
||||
@ -47,7 +47,7 @@ class angularConversionStatic
|
||||
|
||||
|
||||
|
||||
//virtual int readAngularConversion(string fname)=0;
|
||||
//virtual int readAngularConversion(std::string fname)=0;
|
||||
|
||||
|
||||
|
||||
@ -60,7 +60,7 @@ class angularConversionStatic
|
||||
\param angOff pointer to array of angleConversionConstants
|
||||
\returns OK or FAIL
|
||||
*/
|
||||
static int readAngularConversion(string fname, int nmod, angleConversionConstant *angOff);
|
||||
static int readAngularConversion(std::string fname, int nmod, angleConversionConstant *angOff);
|
||||
|
||||
/**
|
||||
reads an angular conversion file
|
||||
@ -70,7 +70,7 @@ class angularConversionStatic
|
||||
\returns OK or FAIL
|
||||
|
||||
*/
|
||||
static int readAngularConversion(ifstream& ifs, int nmod, angleConversionConstant *angOff);
|
||||
static int readAngularConversion(std::ifstream& ifs, int nmod, angleConversionConstant *angOff);
|
||||
/**
|
||||
writes an angular conversion file
|
||||
\param fname file to be written
|
||||
@ -78,7 +78,7 @@ class angularConversionStatic
|
||||
\param angOff pointer to array of angleConversionConstants
|
||||
\returns OK or FAIL
|
||||
*/
|
||||
static int writeAngularConversion(string fname, int nmod, angleConversionConstant *angOff);
|
||||
static int writeAngularConversion(std::string fname, int nmod, angleConversionConstant *angOff);
|
||||
|
||||
/**
|
||||
writes an angular conversion file
|
||||
@ -87,7 +87,7 @@ class angularConversionStatic
|
||||
\param angOff pointer to array of angleConversionConstants
|
||||
\returns OK or FAIL
|
||||
*/
|
||||
static int writeAngularConversion(ofstream& ofs, int nmod, angleConversionConstant *angOff);
|
||||
static int writeAngularConversion(std::ofstream& ofs, int nmod, angleConversionConstant *angOff);
|
||||
|
||||
/**
|
||||
sets the arrays of the merged data to 0. NB The array should be created with size nbins >= 360./getBinSize();
|
||||
|
@ -7,16 +7,16 @@
|
||||
#include <sstream>
|
||||
#include <string.h>
|
||||
|
||||
// using namespace std;
|
||||
//
|
||||
class badChannelCorrections{
|
||||
|
||||
public:
|
||||
|
||||
static int readBadChannelCorrectionFile(std::string fname, int &nbad, int *badlist){ ifstream infile(fname.c_str()); int nb=-1; if (infile.is_open()) {nb=readBadChannelCorrectionFile(infile,nbad,badlist); infile.close();}; return nb;};
|
||||
static int readBadChannelCorrectionFile(std::string fname, int &nbad, int *badlist){ std::ifstream infile(fname.c_str()); int nb=-1; if (infile.is_open()) {nb=readBadChannelCorrectionFile(infile,nbad,badlist); infile.close();}; return nb;};
|
||||
|
||||
|
||||
|
||||
static int readBadChannelCorrectionFile(ifstream &infile, int &nbad, int *badlist, int moff=0){ \
|
||||
static int readBadChannelCorrectionFile(std::ifstream &infile, int &nbad, int *badlist, int moff=0){ \
|
||||
int interrupt=0; \
|
||||
int ich; \
|
||||
int chmin,chmax; \
|
||||
@ -30,7 +30,7 @@ class badChannelCorrections{
|
||||
interrupt=1; \
|
||||
break; \
|
||||
} \
|
||||
if (str.find('-')!=string::npos) { \
|
||||
if (str.find('-')!=std::string::npos) { \
|
||||
ssstr >> chmin ; \
|
||||
ssstr.str(str.substr(str.find('-')+1,str.size())); \
|
||||
ssstr >> chmax; \
|
||||
@ -47,7 +47,7 @@ class badChannelCorrections{
|
||||
return nbad; };
|
||||
|
||||
|
||||
static int setBadChannelCorrection(ifstream &infile, int &nbad, int *badlist, int moff){ \
|
||||
static int setBadChannelCorrection(std::ifstream &infile, int &nbad, int *badlist, int moff){ \
|
||||
int retval=readBadChannelCorrectionFile(infile,nbad,badlist); \
|
||||
for (int ich=0; ich<nbad; ich++) { badlist[ich]=badlist[ich]+moff; }; \
|
||||
return retval; \
|
||||
|
@ -15,7 +15,7 @@
|
||||
#include "sls_detector_defs.h"
|
||||
#endif
|
||||
|
||||
using namespace std;
|
||||
;
|
||||
|
||||
class enCalLogClass {
|
||||
|
||||
@ -32,7 +32,7 @@ class enCalLogClass {
|
||||
strcpy(vars[3],"modulenumber"); \
|
||||
argv[0]=cmd; \
|
||||
sprintf(cmd,"_%d.encal",det->getFileIndex()); \
|
||||
outfile.open(string(det->getFilePath()+string("/")+det->getFileName()+string(cmd)).c_str()); \
|
||||
outfile.open(std::string(det->getFilePath()+std::string("/")+det->getFileName()+std::string(cmd)).c_str()); \
|
||||
myDet=new slsDetectorCommand(det); \
|
||||
strcpy(cmd,vars[0]); \
|
||||
outfile << cmd << " " << myDet->executeLine(1,argv,slsDetectorDefs::GET_ACTION) << endl; \
|
||||
@ -58,12 +58,12 @@ class enCalLogClass {
|
||||
#endif
|
||||
|
||||
|
||||
int addStep(double threshold, string fname) {outfile << threshold << " " << fname << endl; return 0;};
|
||||
int addStep(double threshold, std::string fname) {outfile << threshold << " " << fname << endl; return 0;};
|
||||
|
||||
|
||||
//
|
||||
|
||||
int readHeader(ifstream &infile, char *settings, int &nmod, int &chanspermod, int *mods ) { \
|
||||
int readHeader(std::ifstream &infile, char *settings, int &nmod, int &chanspermod, int *mods ) { \
|
||||
nmod=0; strcpy(settings,"unknown"); chanspermod=0; \
|
||||
char line[1000],myarg[100]; \
|
||||
int dum; \
|
||||
@ -75,9 +75,9 @@ class enCalLogClass {
|
||||
break; \
|
||||
case 1: \
|
||||
sscanf(line,"type %s", myarg); \
|
||||
if (string(myarg).find("Mythen")!=string::npos) \
|
||||
if (std::string(myarg).find("Mythen")!=std::string::npos) \
|
||||
chanspermod=1280; \
|
||||
else if (string(myarg).find("Gotthard")!=string::npos) \
|
||||
else if (std::string(myarg).find("Gotthard")!=std::string::npos) \
|
||||
chanspermod=1280; \
|
||||
else \
|
||||
chanspermod=65535; \
|
||||
@ -101,7 +101,7 @@ class enCalLogClass {
|
||||
return 0; \
|
||||
};
|
||||
|
||||
int getStep(ifstream &infile, double &threshold, char *datafname){ \
|
||||
int getStep(std::ifstream &infile, double &threshold, char *datafname){ \
|
||||
char line[1000]; \
|
||||
float v;
|
||||
infile.getline(line,1000); \
|
||||
@ -122,7 +122,7 @@ class enCalLogClass {
|
||||
#ifndef MYROOT
|
||||
slsDetectorCommand *myDet;
|
||||
#endif
|
||||
ofstream outfile;
|
||||
std::ofstream outfile;
|
||||
char vars[4][100];
|
||||
|
||||
};
|
||||
|
@ -16,7 +16,7 @@ class TGraphErrors;
|
||||
#endif
|
||||
|
||||
|
||||
using namespace std;
|
||||
|
||||
|
||||
|
||||
|
||||
|
@ -13,7 +13,7 @@
|
||||
#include <cmath>
|
||||
#include <string>
|
||||
|
||||
using namespace std;
|
||||
|
||||
/**
|
||||
@short class handling the energy calibration and trim files IO
|
||||
*/
|
||||
@ -39,7 +39,7 @@ class energyConversion
|
||||
\returns OK if successful, else FAIL or -1
|
||||
|
||||
*/
|
||||
static int readCalibrationFile(string fname, double &gain, double &offset);
|
||||
static int readCalibrationFile(std::string fname, double &gain, double &offset);
|
||||
|
||||
/**
|
||||
writes a calibration file
|
||||
@ -48,7 +48,7 @@ class energyConversion
|
||||
\param offset
|
||||
\returns OK if successful, else FAIL or -1
|
||||
*/
|
||||
static int writeCalibrationFile(string fname, double gain, double offset);
|
||||
static int writeCalibrationFile(std::string fname, double gain, double offset);
|
||||
|
||||
/**
|
||||
reads a calibration file
|
||||
@ -57,7 +57,7 @@ class energyConversion
|
||||
\param offset reference to the offset variable
|
||||
\returns OK if successful, else FAIL or -1
|
||||
*/
|
||||
static int readCalibrationFile(string fname, int *gain, int *offset);
|
||||
static int readCalibrationFile(std::string fname, int *gain, int *offset);
|
||||
|
||||
/**
|
||||
writes a calibration file
|
||||
@ -66,7 +66,7 @@ class energyConversion
|
||||
\param offset reference to the offset variable
|
||||
\returns OK if successful, else FAIL or -1
|
||||
*/
|
||||
static int writeCalibrationFile(string fname, int *gain, int *offset);
|
||||
static int writeCalibrationFile(std::string fname, int *gain, int *offset);
|
||||
|
||||
|
||||
|
||||
@ -108,7 +108,7 @@ class energyConversion
|
||||
\returns the pointer to myMod or NULL if reading the file failed
|
||||
*/
|
||||
|
||||
sls_detector_module* readSettingsFile(string fname, detectorType myDetectorType, int& iodelay, int& tau, sls_detector_module* myMod=NULL, int tb=1);
|
||||
sls_detector_module* readSettingsFile(std::string fname, detectorType myDetectorType, int& iodelay, int& tau, sls_detector_module* myMod=NULL, int tb=1);
|
||||
|
||||
/**
|
||||
writes a trim/settings file
|
||||
@ -121,7 +121,7 @@ class energyConversion
|
||||
|
||||
\sa ::sls_detector_module mythenDetector::writeSettingsFile(string, sls_detector_module)
|
||||
*/
|
||||
int writeSettingsFile(string fname, detectorType myDetectorType, sls_detector_module mod, int iodelay, int tau);
|
||||
int writeSettingsFile(std::string fname, detectorType myDetectorType, sls_detector_module mod, int iodelay, int tau);
|
||||
|
||||
/** allocates the momery for a detector module structure
|
||||
\param myDetectorType detector type (needed for number of channels, chips, dacs etc.)
|
||||
|
@ -14,7 +14,7 @@
|
||||
#include <math.h>
|
||||
#include <semaphore.h>
|
||||
|
||||
// using namespace std;
|
||||
//
|
||||
/**
|
||||
@short class handling the data file I/O flags
|
||||
*/
|
||||
|
@ -18,7 +18,7 @@ using std::endl;
|
||||
using std::cout;
|
||||
|
||||
#include "sls_detector_defs.h"
|
||||
// using namespace std;
|
||||
//
|
||||
/**
|
||||
@short class handling the data file I/O flags
|
||||
*/
|
||||
|
@ -16,7 +16,7 @@
|
||||
#include <queue>
|
||||
#include <math.h>
|
||||
|
||||
using namespace std;
|
||||
;
|
||||
|
||||
|
||||
typedef double double32_t;
|
||||
|
@ -8,7 +8,7 @@
|
||||
#endif
|
||||
#include <time.h>
|
||||
|
||||
|
||||
using namespace std;
|
||||
//#define VERBOSE
|
||||
|
||||
static void* startProcessData(void *n){
|
||||
|
@ -21,7 +21,7 @@
|
||||
class postProcessingFuncs;
|
||||
|
||||
|
||||
// using namespace std;
|
||||
//
|
||||
|
||||
#define MAX_BADCHANS 20000
|
||||
|
||||
@ -75,7 +75,7 @@ class postProcessing : public angularConversion, public fileIO, public badChanne
|
||||
\param fname file with bad channel list ("" disable)
|
||||
\returns 0 if bad channel disabled, >0 otherwise
|
||||
*/
|
||||
virtual int setBadChannelCorrection(string fname="")=0;
|
||||
virtual int setBadChannelCorrection(std::string fname="")=0;
|
||||
|
||||
|
||||
/**
|
||||
@ -85,7 +85,7 @@ class postProcessing : public angularConversion, public fileIO, public badChanne
|
||||
\param badlist array of badchannels
|
||||
\returns 0 if bad channel disabled, >0 otherwise
|
||||
*/
|
||||
virtual int setBadChannelCorrection(string fname, int &nbad, int *badlist, int off=0)=0;
|
||||
virtual int setBadChannelCorrection(std::string fname, int &nbad, int *badlist, int off=0)=0;
|
||||
using badChannelCorrections::setBadChannelCorrection;
|
||||
|
||||
/**
|
||||
@ -116,26 +116,26 @@ class postProcessing : public angularConversion, public fileIO, public badChanne
|
||||
|
||||
|
||||
/** returns the bad channel list file */
|
||||
string getBadChannelCorrectionFile() {if ((*correctionMask)&(1<< DISCARD_BAD_CHANNELS)) return string(badChanFile); else return string("none");};
|
||||
std::string getBadChannelCorrectionFile() {if ((*correctionMask)&(1<< DISCARD_BAD_CHANNELS)) return std::string(badChanFile); else return std::string("none");};
|
||||
|
||||
|
||||
/**
|
||||
get flat field corrections file directory
|
||||
\returns flat field correction file directory
|
||||
*/
|
||||
string getFlatFieldCorrectionDir(){return string(flatFieldDir);};
|
||||
std::string getFlatFieldCorrectionDir(){return std::string(flatFieldDir);};
|
||||
/**
|
||||
set flat field corrections file directory
|
||||
\param flat field correction file directory
|
||||
\returns flat field correction file directory
|
||||
*/
|
||||
string setFlatFieldCorrectionDir(string dir){strcpy(flatFieldDir,dir.c_str()); return string(flatFieldDir);};
|
||||
std::string setFlatFieldCorrectionDir(std::string dir){strcpy(flatFieldDir,dir.c_str()); return std::string(flatFieldDir);};
|
||||
|
||||
/**
|
||||
get flat field corrections file name
|
||||
\returns flat field correction file name
|
||||
*/
|
||||
string getFlatFieldCorrectionFile(){ if ((*correctionMask)&(1<<FLAT_FIELD_CORRECTION)) return string(flatFieldFile); else return string("none");};
|
||||
std::string getFlatFieldCorrectionFile(){ if ((*correctionMask)&(1<<FLAT_FIELD_CORRECTION)) return std::string(flatFieldFile); else return std::string("none");};
|
||||
|
||||
|
||||
|
||||
@ -170,7 +170,7 @@ s
|
||||
\returns nothing
|
||||
|
||||
*/
|
||||
void doProcessing(double* myData, int delflag, string fname);
|
||||
void doProcessing(double* myData, int delflag, std::string fname);
|
||||
|
||||
|
||||
/**
|
||||
@ -258,7 +258,7 @@ s
|
||||
|
||||
|
||||
void initDataset(int refresh);
|
||||
void addFrame(double *data, double pos, double i0, double t, string fname, double var);
|
||||
void addFrame(double *data, double pos, double i0, double t, std::string fname, double var);
|
||||
void finalizeDataset(double *a, double *v, double *e, int &np);
|
||||
|
||||
virtual detectorType getDetectorsType(int pos=-1)=0;
|
||||
@ -293,11 +293,11 @@ s
|
||||
/**
|
||||
data queue
|
||||
*/
|
||||
queue<int*> dataQueue;
|
||||
std::queue<int*> dataQueue;
|
||||
/**
|
||||
queue containing the postprocessed data
|
||||
*/
|
||||
queue<detectorData*> finalDataQueue;
|
||||
std::queue<detectorData*> finalDataQueue;
|
||||
|
||||
/** data queue size */
|
||||
int queuesize;
|
||||
|
@ -25,7 +25,7 @@
|
||||
class angularConversion;
|
||||
class fileIO;
|
||||
|
||||
using namespace std;
|
||||
;
|
||||
|
||||
#define MAX_BADCHANS 2000
|
||||
|
||||
|
@ -1,6 +1,6 @@
|
||||
#include "postProcessingFuncs.h"
|
||||
#include "angleConversionConstant.h"
|
||||
|
||||
using namespace std;
|
||||
//#define VERBOSE
|
||||
|
||||
postProcessingFuncs::postProcessingFuncs(int *nModules,int *chPerMod,int modMask[],int badCh[], double ffcoeff[], double fferr[], double* t, int *dir, double angRadius[], double angOffset[], double angCentre[], double* to, double* bs, double *sX, double *sY):
|
||||
|
@ -17,7 +17,7 @@
|
||||
#include "angularConversionStatic.h"
|
||||
class angleConversionConstant;
|
||||
|
||||
using namespace std;
|
||||
|
||||
|
||||
|
||||
class postProcessingFuncs : public virtual angularConversionStatic
|
||||
|
@ -18,7 +18,7 @@
|
||||
|
||||
class angularConversion;
|
||||
|
||||
using namespace std;
|
||||
;
|
||||
|
||||
#define MAX_BADCHANS 2000
|
||||
|
||||
|
@ -34,7 +34,7 @@
|
||||
#include "runningStat.h"
|
||||
#include "movingStat.h"
|
||||
#include "single_photon_hit.h"
|
||||
using namespace std;
|
||||
|
||||
|
||||
|
||||
typedef double double32_t;
|
||||
|
Reference in New Issue
Block a user