some debugging of the post processing funcs

git-svn-id: file:///afs/psi.ch/project/sls_det_software/svn/slsDetectorSoftware@698 951219d9-93cf-4727-9268-0efd64621fa3
This commit is contained in:
bergamaschi
2013-11-27 12:00:04 +00:00
parent 1ed2ba63b5
commit 0c3f1d95b9
5 changed files with 139 additions and 79 deletions

View File

@ -2821,13 +2821,13 @@ int multiSlsDetector::getBadChannelCorrection(int *bad) {
if (((thisMultiDetector->correctionMask)&(1<< DISCARD_BAD_CHANNELS))==0) if (((thisMultiDetector->correctionMask)&(1<< DISCARD_BAD_CHANNELS))==0)
return 0; return 0;
else //else
cout << "bad chans corr enabled "<< thisMultiDetector->correctionMask << endl; // cout << "bad chans corr enabled "<< thisMultiDetector->correctionMask << endl;
for (int idet=0; idet<thisMultiDetector->numberOfDetectors; idet++) { for (int idet=0; idet<thisMultiDetector->numberOfDetectors; idet++) {
if (detectors[idet]) { if (detectors[idet]) {
nd=detectors[idet]->getBadChannelCorrection(); nd=detectors[idet]->getBadChannelCorrection();
cout << "det " << idet << " nbad " << nd << endl; // cout << "det " << idet << " nbad " << nd << endl;
if (nd>0) { if (nd>0) {
bd = new int[nd]; bd = new int[nd];
nd=detectors[idet]->getBadChannelCorrection(bd); nd=detectors[idet]->getBadChannelCorrection(bd);

View File

@ -67,6 +67,8 @@ int angularConversion::deleteMerging() {
int angularConversion::resetMerging() { int angularConversion::resetMerging() {
getAngularConversionParameter(BIN_SIZE); getAngularConversionParameter(BIN_SIZE);
cout << "reset merging * " << endl;
mergingBins=new double[nBins]; mergingBins=new double[nBins];
@ -83,6 +85,8 @@ int angularConversion::resetMerging() {
} }
int angularConversion::resetMerging(double *mp, double *mv, double *me, int *mm) { int angularConversion::resetMerging(double *mp, double *mv, double *me, int *mm) {
cout << "reset merging " << endl;
getAngularConversionParameter(BIN_SIZE); getAngularConversionParameter(BIN_SIZE);
if (nBins) if (nBins)
return angularConversionStatic::resetMerging(mp, mv, me, mm,nBins); return angularConversionStatic::resetMerging(mp, mv, me, mm,nBins);
@ -94,6 +98,7 @@ int angularConversion::resetMerging(double *mp, double *mv, double *me, int *mm)
int angularConversion::finalizeMerging() { int angularConversion::finalizeMerging() {
cout << "finalize merging *" << endl;
int np=finalizeMerging(mergingBins, mergingCounts, mergingErrors, mergingMultiplicity); int np=finalizeMerging(mergingBins, mergingCounts, mergingErrors, mergingMultiplicity);
if (mergingMultiplicity) if (mergingMultiplicity)

View File

@ -24,6 +24,9 @@ angularConversionStatic::~angularConversionStatic(){
double* angularConversionStatic::convertAngles(double pos, int nch, int *chansPerMod, angleConversionConstant **angOff, int *mF, double fo, double go, int angdir) { double* angularConversionStatic::convertAngles(double pos, int nch, int *chansPerMod, angleConversionConstant **angOff, int *mF, double fo, double go, int angdir) {
// cout << "PPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPP convert angles " << endl;
int imod=0; int imod=0;
double *ang=new double[nch]; double *ang=new double[nch];
double enc=pos; double enc=pos;
@ -86,6 +89,7 @@ double* angularConversionStatic::convertAngles(double pos, int nch, int *chansPe
double angularConversionStatic::convertAngle(double pos, int ich, angleConversionConstant *p, int mF, double fo, double go, int angdir) { double angularConversionStatic::convertAngle(double pos, int ich, angleConversionConstant *p, int mF, double fo, double go, int angdir) {
// cout << "PPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPP convert angle " << endl;
// if (p) // if (p)
// cout << pos << endl << fo+go << endl << p->r_conversion << endl << p->center << endl << p->offset << endl << mF << endl << angdir << endl; // cout << pos << endl << fo+go << endl << p->r_conversion << endl << p->center << endl << p->offset << endl << mF << endl << angdir << endl;
// else // else
@ -148,6 +152,7 @@ double angularConversionStatic::convertAngle(double pos, int ich, angleConversio
double angularConversionStatic::convertAngle(double pos, int ich, int *chansPerMod, angleConversionConstant **angOff, int *mF, double fo, double go, int angdir) { double angularConversionStatic::convertAngle(double pos, int ich, int *chansPerMod, angleConversionConstant **angOff, int *mF, double fo, double go, int angdir) {
// cout << "PPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPP convert angles xx" << endl;
int imod=0; int imod=0;
double ang; double ang;
// double enc=0, trans=0; // double enc=0, trans=0;
@ -302,6 +307,7 @@ int angularConversionStatic:: writeAngularConversion(ofstream& outfile, int nmod
//static //static
int angularConversionStatic::resetMerging(double *mp, double *mv, double *me, int *mm, int nb) { int angularConversionStatic::resetMerging(double *mp, double *mv, double *me, int *mm, int nb) {
// cout << "PPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPP reset merging " << endl;
#ifdef VERBOSE #ifdef VERBOSE
cout << "creating merging arrays "<< nb << endl; cout << "creating merging arrays "<< nb << endl;
@ -320,13 +326,14 @@ int angularConversionStatic::resetMerging(double *mp, double *mv, double *me, in
//static //static
int angularConversionStatic::finalizeMerging(double *mp, double *mv, double *me, int *mm,int nb) { int angularConversionStatic::finalizeMerging(double *mp, double *mv, double *me, int *mm,int nb) {
// cout << "PPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPP finalize merging " << endl;
int np=0; int np=0;
for (int ibin=0; ibin<nb; ibin++) { for (int ibin=0; ibin<nb; ibin++) {
if (mm[ibin]>0) { if (mm[ibin]>0) {
// #ifdef VERBOSE #ifdef VERBOSE
// cout << "finalize " << ibin << " "<< mm[ibin] << " " << mp[ibin]<< mv[ibin] << me[ibin] << endl; cout << "finalize " << ibin << " "<< mm[ibin] << " " << mp[ibin]<< " " << mv[ibin] << " " << me[ibin] << endl;
// #endif #endif
mp[np]=mp[ibin]/mm[ibin]; mp[np]=mp[ibin]/mm[ibin];
mv[np]=mv[ibin]/mm[ibin]; mv[np]=mv[ibin]/mm[ibin];
me[np]=me[ibin]/mm[ibin]; me[np]=me[ibin]/mm[ibin];
@ -334,7 +341,8 @@ int angularConversionStatic::finalizeMerging(double *mp, double *mv, double *me,
mm[np]=mm[ibin]; mm[np]=mm[ibin];
np++; np++;
} }
} }
// cout << endl ;
return np; return np;
} }
@ -342,6 +350,7 @@ int angularConversionStatic::finalizeMerging(double *mp, double *mv, double *me,
int angularConversionStatic::addToMerging(double *p1, double *v1, double *e1, double *mp, double *mv,double *me, int *mm, int nchans, double binsize,int nbins, int *badChanMask ) { int angularConversionStatic::addToMerging(double *p1, double *v1, double *e1, double *mp, double *mv,double *me, int *mm, int nchans, double binsize,int nbins, int *badChanMask ) {
// cout << "PPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPP add to merging " << endl;
double binmi=-180.; double binmi=-180.;
int ibin=0; int ibin=0;
@ -404,6 +413,7 @@ int angularConversionStatic::addToMerging(double *p1, double *v1, double *e1, d
int angularConversionStatic::addPointToMerging(double p1, double v1, double e1, double *mp, double *mv,double *me, int *mm, double binsize,int nbins) { int angularConversionStatic::addPointToMerging(double p1, double v1, double e1, double *mp, double *mv,double *me, int *mm, double binsize,int nbins) {
// cout << "PPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPP add point to merging "<< v1 << " " << e1 << endl;
double binmi=-180.; double binmi=-180.;
int ibin=0; int ibin=0;
@ -429,6 +439,7 @@ int angularConversionStatic::addPointToMerging(double p1, double v1, double e1,
if (ibin<nbins && ibin>=0) { if (ibin<nbins && ibin>=0) {
// cout << "before " << ibin << " " << mp[ibin] << " " << mv[ibin] << " " << me[ibin] << endl;
mp[ibin]+=p1; mp[ibin]+=p1;
mv[ibin]+=v1; mv[ibin]+=v1;
if (e1) if (e1)
@ -436,6 +447,7 @@ int angularConversionStatic::addPointToMerging(double p1, double v1, double e1,
else else
me[ibin]+=v1; me[ibin]+=v1;
mm[ibin]++; mm[ibin]++;
// cout << "after " << ibin << " " << mp[ibin] << " " << mv[ibin] << " " << me[ibin] << endl;
// #ifdef VERBOSE // #ifdef VERBOSE
// cout << "add " << ibin << " "<< mm[ibin] << " " << mp[ibin]<< mv[ibin] << me[ibin] << endl; // cout << "add " << ibin << " "<< mm[ibin] << " " << mp[ibin]<< mv[ibin] << me[ibin] << endl;

View File

@ -132,7 +132,7 @@ void postProcessing::processFrame(int *myData, int delflag) {
} else } else
if (dataReady){ if (dataReady){
cout << "callback arg "<< getCurrentProgress()<< " " << (fname+string(".raw")).c_str() << " " << getTotalNumberOfChannels() << endl; // cout << "callback arg "<< getCurrentProgress()<< " " << (fname+string(".raw")).c_str() << " " << getTotalNumberOfChannels() << endl;
thisData=new detectorData(fdata,NULL,NULL,getCurrentProgress(),(fname+string(".raw")).c_str(),getTotalNumberOfChannels()); thisData=new detectorData(fdata,NULL,NULL,getCurrentProgress(),(fname+string(".raw")).c_str(),getTotalNumberOfChannels());
dataReady(thisData, currentFrameIndex, pCallbackArg); dataReady(thisData, currentFrameIndex, pCallbackArg);
@ -183,9 +183,9 @@ void postProcessing::processFrame(int *myData, int delflag) {
void postProcessing::doProcessing(double *lfdata, int delflag, string fname) { void postProcessing::doProcessing(double *lfdata, int delflag, string fname) {
#ifdef VERBOSE #ifdef VERBOSE
cout << "do processing - data size is " << arraySize << endl; cout << "??????????????????????????????????????????? do processing - data size is " << arraySize << endl;
#endif #endif
int np; int np;
@ -255,7 +255,7 @@ void postProcessing::doProcessing(double *lfdata, int delflag, string fname) {
if (dataReady) { if (dataReady) {
cout << "callback arg "<< getCurrentProgress()<< " " << (fname+ext).c_str() << " " << np << endl; // cout << "callback arg "<< getCurrentProgress()<< " " << (fname+ext).c_str() << " " << np << endl;
thisData=new detectorData(val,err,ang,getCurrentProgress(),(fname+ext).c_str(),np); thisData=new detectorData(val,err,ang,getCurrentProgress(),(fname+ext).c_str(),np);
dataReady(thisData, currentFrameIndex, pCallbackArg); dataReady(thisData, currentFrameIndex, pCallbackArg);
@ -306,9 +306,9 @@ int postProcessing::fillBadChannelMask() {
delete [] badChannelMask; delete [] badChannelMask;
//#ifdef VERBOSE #ifdef VERBOSE
cout << " nchans " << getTotalNumberOfChannels() << endl; cout << " nchans " << getTotalNumberOfChannels() << endl;
//#endif #endif
badChannelMask=new int[getTotalNumberOfChannels()]; badChannelMask=new int[getTotalNumberOfChannels()];
@ -350,8 +350,8 @@ int postProcessing::fillBadChannelMask() {
#ifdef VERBOSE #ifdef VERBOSE
cout << "deleting bad channel mask beacuse no bad channel correction is selected" << endl; cout << "deleting bad channel mask beacuse no bad channel correction is selected" << endl;
#endif #endif
//delete [] badChannelMask; delete [] badChannelMask;
//badChannelMask=NULL; badChannelMask=NULL;
} }
} }
@ -371,7 +371,7 @@ void* postProcessing::processData(int delflag) {
if(setReceiverOnline()==OFFLINE_FLAG){ if(setReceiverOnline()==OFFLINE_FLAG){
#ifdef VERBOSE #ifdef VERBOSE
std::cout<< " processing data - threaded mode " << *threadedProcessing << endl; std::cout<< " ??????????????????????????????????????????? processing data - threaded mode " << *threadedProcessing << endl;
#endif #endif
@ -741,6 +741,7 @@ void postProcessing::initDataset(int r) {
fillBadChannelMask(); fillBadChannelMask();
// cout << "pp bad channel mask " << badChannelMask << endl; // cout << "pp bad channel mask " << badChannelMask << endl;
//cout << "EEEEEEEEEEEEEEEEEEEE init dataset " << endl;
ppFun->initDataset(&nmod,chPM,mM,badChannelMask, ffcoeff, fferr, &tdead, &angdir, angRad, angOff, angCenter, &to, &bs, &sx, &sy); ppFun->initDataset(&nmod,chPM,mM,badChannelMask, ffcoeff, fferr, &tdead, &angdir, angRad, angOff, angCenter, &to, &bs, &sx, &sy);
#ifdef VERBOSE #ifdef VERBOSE
@ -766,7 +767,7 @@ void postProcessing::initDataset(int r) {
} else { } else {
cout << "implicit inti dataset! " << endl; // cout << "EEEEEEEEEEEEEEEEEEEE init dataset XXXX " << endl;
ppFun->initDataset(); ppFun->initDataset();
@ -781,12 +782,20 @@ void postProcessing::initDataset(int r) {
void postProcessing::addFrame(double *data, double pos, double i0, double t, string fname, double var) { void postProcessing::addFrame(double *data, double pos, double i0, double t, string fname, double var) {
ppFun->addFrame(data, &pos, &i0, &t, fname.c_str(), &var); // cout << "EEEEEEEEEEEEEEEEEEEE add frame " << pos << " " << i0 << endl;
if (*correctionMask&(1<< I0_NORMALIZATION))
ppFun->addFrame(data, &pos, &i0, &t, fname.c_str(), &var);
else
ppFun->addFrame(data, &pos,NULL, &t, fname.c_str(), &var);
} }
void postProcessing::finalizeDataset(double *a, double *v, double *e, int &np) { void postProcessing::finalizeDataset(double *a, double *v, double *e, int &np) {
// cout << "EEEEEEEEEEEEEEEEEEEE finalize dataset " << endl;
ppFun->finalizeDataset(a, v, e, &np); ppFun->finalizeDataset(a, v, e, &np);
} }

View File

@ -12,17 +12,19 @@ postProcessingFuncs::postProcessingFuncs(int *nModules,int *chPerMod,int modMask
int postProcessingFuncs::initDataset() { int postProcessingFuncs::initDataset() {
// cout << "AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA init dataset " << endl;
if (nBins) { if (nBins) {
mp=new double[nBins]; mp=new double[nBins];
mv=new double[nBins]; mv=new double[nBins];
me=new double[nBins]; me=new double[nBins];
mm=new int[nBins]; mm=new int[nBins];
resetMerging(mp,mv,me,mm, nBins); resetMerging(mp,mv,me,mm, nBins);
cout << "nbins " << nBins << endl; // cout << "nbins " << nBins << endl;
} else { } else {
mv=new double[totalChans]; mv=new double[totalChans];
me=new double[totalChans]; me=new double[totalChans];
cout << "nchans " << totalChans << endl; // cout << "nchans " << totalChans << endl;
} }
totalI0=0; totalI0=0;
@ -32,6 +34,8 @@ int postProcessingFuncs::initDataset() {
int postProcessingFuncs::finalizeDataset(double *ang, double *val, double *err, int *np) { int postProcessingFuncs::finalizeDataset(double *ang, double *val, double *err, int *np) {
// cout << "AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA finalize dataset " << endl;
if (nBins) if (nBins)
*np=finalizeMerging(mp,mv,me,mm,nBins); *np=finalizeMerging(mp,mv,me,mm,nBins);
else else
@ -78,14 +82,25 @@ int postProcessingFuncs::addFrame(double *data, double *pos, double *I0, double
double p1, vin, ein, vout, eout; double p1, vin, ein, vout, eout;
double e=0.; double e=0.;
double i0=*I0; double i0;
int imod=0, ch0=0; int imod=0, ch0=0;
int chlast=chansPerMod[0]-1; int chlast=chansPerMod[0]-1;
int nchmod=chansPerMod[0]; int nchmod=chansPerMod[0];
if (i0>0)
if (I0>0) {
i0=*I0;
totalI0+=i0; totalI0+=i0;
} else
i0=-1;
// if (badChannelMask)
// cout << "---------------- Discarding bad chans " << endl;
// cout << "AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA add frame " << i0 << endl;
for (int ich=0; ich<totalChans; ich++) { for (int ich=0; ich<totalChans; ich++) {
@ -108,9 +123,9 @@ int postProcessingFuncs::addFrame(double *data, double *pos, double *I0, double
if (tDead) { if (tDead) {
#ifdef VERBOSE //#ifdef VERBOSE
cout << "ppFuncs ratecorrect" << endl; // cout << "ppFuncs ratecorrect" << endl;
#endif //#endif
rateCorrect(vin, ein, vout, eout, tDead, *expTime); rateCorrect(vin, ein, vout, eout, tDead, *expTime);
vin=vout; vin=vout;
ein=eout; ein=eout;
@ -118,9 +133,9 @@ int postProcessingFuncs::addFrame(double *data, double *pos, double *I0, double
//ffcorrect //ffcorrect
if (ffCoeff) { if (ffCoeff) {
#ifdef VERBOSE //#ifdef VERBOSE
cout << "ppFuncs ffcorrect" << endl; // cout << "ppFuncs ffcorrect" << endl;
#endif //#endif
if (ffErr) if (ffErr)
e=ffErr[ich]; e=ffErr[ich];
else else
@ -131,19 +146,21 @@ int postProcessingFuncs::addFrame(double *data, double *pos, double *I0, double
//i0correct //i0correct
if (i0>0) { if (i0>0) {
#ifdef VERBOSE //#ifdef VERBOSE
cout << "ppFuncs i0 norm" << endl; // cout << "ppFuncs i0 norm" << endl;
#endif //#endif
vout/=i0; vout/=i0;
eout/=i0; eout/=i0;
} }
if (badChannelMask) { if (badChannelMask) {
#ifdef VERBOSE //#ifdef VERBOSE
cout << "ppFuncs badchans" << endl; // cout << "ppFuncs badchans" << endl;
#endif //#endif
if (badChannelMask[ich]) if (badChannelMask[ich]) {
// cout << "------------------ Discarding channel " << ich << endl;
continue; continue;
}
} }
if (nBins) { if (nBins) {
//angconv //angconv
@ -157,7 +174,7 @@ int postProcessingFuncs::addFrame(double *data, double *pos, double *I0, double
p1=convertAngle(*pos,ich-ch0,angConv[imod],moduleMask[imod],totalOffset,0,angDir); p1=convertAngle(*pos,ich-ch0,angConv[imod],moduleMask[imod],totalOffset,0,angDir);
// #ifdef VERBOSE // #ifdef VERBOSE
// cout << "ppFuncs merge" << endl; // cout << "************************** ppFuncs merge" << endl;
// #endif // #endif
addPointToMerging(p1,vout,eout,mp,mv,me,mm, binSize, nBins); addPointToMerging(p1,vout,eout,mp,mv,me,mm, binSize, nBins);
@ -180,16 +197,17 @@ int postProcessingFuncs::addFrame(double *data, double *pos, double *I0, double
int postProcessingFuncs::initDataset(int *nModules,int *chPerMod,int modMask[],int badCh[], double ffcoeff[], double fferr[], double* t, int *dir, double angRadius[], double angOffset[], double angCenter[], double* to, double* bs, double *sX, double *sY) { int postProcessingFuncs::initDataset(int *nModules,int *chPerMod,int modMask[],int badCh[], double ffcoeff[], double fferr[], double* t, int *dir, double angRadius[], double angOffset[], double angCenter[], double* to, double* bs, double *sX, double *sY) {
#ifdef VERBOSE // cout << "AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA init dataset XXXXXX " << endl;
cout << "delete pointers " << endl; //#ifdef VERBOSE
#endif // cout << "delete pointers " << endl;
//#endif
deletePointers(); deletePointers();
#ifdef VERBOSE //#ifdef VERBOSE
cout << "nmod " << endl; // cout << "nmod " << endl;
#endif //#endif
if (nModules) if (nModules)
nMods=*nModules; nMods=*nModules;
@ -197,9 +215,9 @@ int postProcessingFuncs::initDataset(int *nModules,int *chPerMod,int modMask[],i
nMods=0; nMods=0;
#ifdef VERBOSE //#ifdef VERBOSE
cout << nMods << endl; //cout << nMods << endl;
#endif //#endif
#ifdef VERBOSE #ifdef VERBOSE
cout << "tdead " << endl; cout << "tdead " << endl;
#endif #endif
@ -225,18 +243,18 @@ int postProcessingFuncs::initDataset(int *nModules,int *chPerMod,int modMask[],i
#endif #endif
#ifdef VERBOSE //#ifdef VERBOSE
cout << "binsize " << endl; // cout << "binsize " << endl;
#endif //#endif
if (bs) if (bs)
binSize=*bs; binSize=*bs;
else else
binSize=0; binSize=0;
#ifdef VERBOSE //#ifdef VERBOSE
cout << binSize << endl; // cout << binSize << endl;
#endif //#endif
#ifdef VERBOSE #ifdef VERBOSE
cout << "samplex " << endl; cout << "samplex " << endl;
#endif #endif
@ -259,17 +277,17 @@ int postProcessingFuncs::initDataset(int *nModules,int *chPerMod,int modMask[],i
#ifdef VERBOSE #ifdef VERBOSE
cout << sampleY << endl; cout << sampleY << endl;
#endif #endif
#ifdef VERBOSE //#ifdef VERBOSE
cout << "angdir " << endl; // cout << "angdir " << endl;
#endif //#endif
if (dir) if (dir)
angDir=*dir; angDir=*dir;
else else
angDir=1; angDir=1;
#ifdef VERBOSE //#ifdef VERBOSE
cout << angDir << endl; // cout << angDir << endl;
#endif //#endif
totalChans=0; totalChans=0;
@ -281,26 +299,32 @@ int postProcessingFuncs::initDataset(int *nModules,int *chPerMod,int modMask[],i
nBins=0; nBins=0;
if (angRadius && angOffset && angCenter && (binSize>0)) { if (angRadius && angOffset && angCenter && (binSize>0)) {
// cout << "??????? creating angConv"<< endl;
angConv=new angleConversionConstant*[nMods]; angConv=new angleConversionConstant*[nMods];
nBins=(int)(360./binSize)+1; nBins=(int)(360./binSize)+1;
} }
#ifdef VERBOSE //#ifdef VERBOSE
cout << "nBins " << nBins << endl; //cout << "nBins " << nBins << endl;
#endif //#endif
for (int im=0; im<nMods; im++) { for (int im=0; im<nMods; im++) {
//#ifdef VERBOSE //#ifdef VERBOSE
// cout << "MODULE "<< im << endl; //cout << "MODULE "<< im << endl;
//#endif //#endif
chansPerMod[im]=chPerMod[im]; chansPerMod[im]=chPerMod[im];
//cout << chansPerMod[im] << endl;
moduleMask[im]=modMask[im]; moduleMask[im]=modMask[im];
//cout << modMask[im] << endl;
totalChans+=chansPerMod[im]; totalChans+=chansPerMod[im];
//cout << totalChans << endl;
if (angConv) { if (angConv) {
//cout << "??????? angConv"<< endl;
angConv[im]=new angleConversionConstant(angCenter[im], angRadius[im], angOffset[im], 0); angConv[im]=new angleConversionConstant(angCenter[im], angRadius[im], angOffset[im], 0);
//cout << angCenter[im] << " " << chansPerMod[im] << " " << angRadius[im] << " " << angOffset[im] << " " << moduleMask[im] << endl;
} }
// cout << angCenter[im] << " " << chansPerMod[im] << " " << angRadius[im] << " " << angOffset[im] << " " << moduleMask[im] << endl; //else cout << "no ang conv " << endl;
} }
// cout << "finished modules loop" << endl;
#ifdef VERBOSE #ifdef VERBOSE
cout << "badchans " << endl; cout << "badchans " << endl;
@ -334,7 +358,7 @@ int postProcessingFuncs::initDataset(int *nModules,int *chPerMod,int modMask[],i
// cout << " init ff " << ich << " " << ffCoeff[ich] << ffcoeff[ich] << endl; // cout << " init ff " << ich << " " << ffCoeff[ich] << ffcoeff[ich] << endl;
} }
//cout << "init dataset finished " << endl;
return 0; return 0;
} }
@ -345,25 +369,35 @@ int postProcessingFuncs::initDataset(int *nModules,int *chPerMod,int modMask[],i
void postProcessingFuncs::deletePointers() { void postProcessingFuncs::deletePointers() {
delete [] chansPerMod; delete [] chansPerMod;
chansPerMod=NULL;
delete [] moduleMask; delete [] moduleMask;
if (badChannelMask) moduleMask=NULL;
if (badChannelMask) {
delete [] badChannelMask; delete [] badChannelMask;
badChannelMask=NULL;
}
if (ffCoeff) if (ffCoeff) {
delete [] ffCoeff; delete [] ffCoeff;
ffCoeff=NULL;
if (ffErr) }
if (ffErr) {
delete [] ffErr; delete [] ffErr;
ffErr=NULL;
if (angConv) { }
for (int im=0; im<nMods; im++) { if (angConv) {
if (angConv[im]) for (int im=0; im<nMods; im++) {
delete angConv[im]; if (angConv[im])
} delete angConv[im];
delete [] angConv;
} }
// cout << "deleting angConv "<< angConv << endl;
delete [] angConv;
angConv=NULL;
}
// cout << "angConv pointer " << angConv << endl;
} }