From 50acdf562827f203102b0da9210a7a4f3123169d Mon Sep 17 00:00:00 2001 From: l_cartier Date: Wed, 29 Jan 2014 12:52:21 +0000 Subject: [PATCH] filter runs from 1..159 git-svn-id: file:///afs/psi.ch/project/sls_det_software/svn/slsDetectorCalibration@27 113b152e-814d-439b-b186-022a431db7b5 --- slsDetectorCalibration/moenchReadData.C | 2 +- slsDetectorCalibration/moenchReadDataMT.C | 8 ++++++++ 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/slsDetectorCalibration/moenchReadData.C b/slsDetectorCalibration/moenchReadData.C index 7c4dcb297..a6245fbba 100644 --- a/slsDetectorCalibration/moenchReadData.C +++ b/slsDetectorCalibration/moenchReadData.C @@ -53,7 +53,7 @@ Loops over data file to find single photons, fills the tree (and writes it to fi */ -THStack *moenchReadData(char *fformat, char *tit, int runmin, int runmax, int nbins=1500, int hmin=-500, int hmax=1000, int sign=1, double hc=0, int xmin=0, int xmax=NC, int ymin=0, int ymax=NR, int cmsub=0, int hitfinder=1) { +THStack *moenchReadData(char *fformat, char *tit, int runmin, int runmax, int nbins=1500, int hmin=-500, int hmax=1000, int sign=1, double hc=0, int xmin=1, int xmax=NC-1, int ymin=1, int ymax=NR-1, int cmsub=0, int hitfinder=1) { moench02ModuleData *decoder=new moench02ModuleData(hc); moenchCommonMode *cmSub=NULL; diff --git a/slsDetectorCalibration/moenchReadDataMT.C b/slsDetectorCalibration/moenchReadDataMT.C index c109da251..0720909c4 100644 --- a/slsDetectorCalibration/moenchReadDataMT.C +++ b/slsDetectorCalibration/moenchReadDataMT.C @@ -12,10 +12,13 @@ typedef struct task_s{ } Task; void *moenchMakeTreeTask(void *p){ + TThread::Lock(); char fname[1000]; Task *t = (Task *)p; sprintf(fname,"%s%s_%i.root",t->tdir,t->tname,t->treeIndex); TFile *f = new TFile(fname,"RECREATE"); + cout << "Call moenchReadData(" << t->fformat << "," << t->tname << "," << t->runmin<< "," << t->runmax <<")" << endl; + TThread::UnLock(); moenchReadData(t->fformat,t->tname,t->runmin,t->runmax); f->Close(); return 0; @@ -38,6 +41,11 @@ void moenchReadDataMT(char *fformat, char *tit, char *tdir, int runmin, int runo threads[i] = new TThread(threadName, moenchMakeTreeTask, t); threads[i]->Run(); } + + for(int i = 0; i < nThreads; i++){ + threads[i]->Join(); + } + }