| 1 | #include "racquproc.h"
 | 
|---|
| 2 | 
 | 
|---|
| 3 | #include <stdlib.h>
 | 
|---|
| 4 | #include <string.h>
 | 
|---|
| 5 | #include <unistd.h>
 | 
|---|
| 6 | #include <fstream>
 | 
|---|
| 7 | #include <signal.h>
 | 
|---|
| 8 | 
 | 
|---|
| 9 | #include "pexceptions.h"
 | 
|---|
| 10 | #include "tvector.h"
 | 
|---|
| 11 | #include "ntuple.h"
 | 
|---|
| 12 | #include "datatable.h"
 | 
|---|
| 13 | #include "histos.h"
 | 
|---|
| 14 | #include "fioarr.h"
 | 
|---|
| 15 | #include "matharr.h"
 | 
|---|
| 16 | #include "timestamp.h"
 | 
|---|
| 17 | #include "ctimer.h"
 | 
|---|
| 18 | #include "fftpserver.h"
 | 
|---|
| 19 | #include "fftwserver.h"
 | 
|---|
| 20 | 
 | 
|---|
| 21 | #include "FFTW/fftw3.h"
 | 
|---|
| 22 | 
 | 
|---|
| 23 | 
 | 
|---|
| 24 | #include "pciewrap.h"
 | 
|---|
| 25 | #include "brpaqu.h"
 | 
|---|
| 26 | #include "brproc.h"
 | 
|---|
| 27 | 
 | 
|---|
| 28 | 
 | 
|---|
| 29 | //---------------------------------------------------------------
 | 
|---|
| 30 | // Classe thread de traitement donnees ADC avec 2 voies par frame
 | 
|---|
| 31 | //---------------------------------------------------------------
 | 
|---|
| 32 | 
 | 
|---|
| 33 | // Mutex pour eviter le plantage du a FFTW qui ne semble pas thread-safe
 | 
|---|
| 34 | static ZMutex* pmutfftw=NULL;
 | 
|---|
| 35 | 
 | 
|---|
| 36 | /* --Methode-- */
 | 
|---|
| 37 | BRProcARaw2C::BRProcARaw2C(RAcqMemZoneMgr& mem, string& path, uint_4 nmean, 
 | 
|---|
| 38 |                            uint_4 nmax, bool fghist, uint_4 nfsmap, bool fgnotrl, int card)
 | 
|---|
| 39 |   :  memgr(mem) 
 | 
|---|
| 40 | {
 | 
|---|
| 41 |   nmax_ = nmax; 
 | 
|---|
| 42 |   nmean_ = nmean;
 | 
|---|
| 43 |   nfsmap_ = nfsmap;
 | 
|---|
| 44 |   stop_ = false;        
 | 
|---|
| 45 |   path_ = path; 
 | 
|---|
| 46 |   fgnotrl_ = fgnotrl;
 | 
|---|
| 47 |   fghist_ = fghist;
 | 
|---|
| 48 |   card_ = card;
 | 
|---|
| 49 |   if (pmutfftw==NULL) pmutfftw=new ZMutex;  
 | 
|---|
| 50 | }
 | 
|---|
| 51 | 
 | 
|---|
| 52 | /* --Methode-- */
 | 
|---|
| 53 | void BRProcARaw2C::Stop()
 | 
|---|
| 54 | {
 | 
|---|
| 55 |  stop_=true;
 | 
|---|
| 56 |  // cout <<" BRProcARaw2C::Stop ... > STOP " << endl;
 | 
|---|
| 57 | }
 | 
|---|
| 58 | 
 | 
|---|
| 59 | 
 | 
|---|
| 60 | static inline r_4 Zmod2(complex<r_4> z) 
 | 
|---|
| 61 | { return (z.real()*z.real()+z.imag()*z.imag()); }
 | 
|---|
| 62 | 
 | 
|---|
| 63 | static inline string card2name_(int card)
 | 
|---|
| 64 | {
 | 
|---|
| 65 |   if (card==2) return " (Chan3,4) ";
 | 
|---|
| 66 |   else return " (Chan1,2) ";
 | 
|---|
| 67 | }
 | 
|---|
| 68 | /* --Methode-- */
 | 
|---|
| 69 | void BRProcARaw2C::run()
 | 
|---|
| 70 | {
 | 
|---|
| 71 |   setRC(1);     
 | 
|---|
| 72 |   try {
 | 
|---|
| 73 |     Timer tm("BRProcARaw2C", false);
 | 
|---|
| 74 |     TimeStamp ts; 
 | 
|---|
| 75 |     BRPaqChecker pcheck(!fgnotrl_);  // Verification/comptage des paquets 
 | 
|---|
| 76 |     
 | 
|---|
| 77 |     size_t totnbytesout = 0;
 | 
|---|
| 78 |     size_t totnbytesproc = 0;
 | 
|---|
| 79 | 
 | 
|---|
| 80 |     cout << " BRProcARaw2C::run() - Starting " << ts << " NMaxMemZones=" << nmax_ 
 | 
|---|
| 81 |          << " NMean=" << nmean_ << card2name_(card_) << endl;   
 | 
|---|
| 82 |     cout << " BRProcARaw2C::run()... - Output Data Path: " << path_ << endl;
 | 
|---|
| 83 |     char fname[512];
 | 
|---|
| 84 | //    sprintf(fname,"%s/proc.log",path_.c_str());
 | 
|---|
| 85 | //    ofstream filog(fname);
 | 
|---|
| 86 | //    filog << " BRProcARaw2C::run() - starting log file " << ts << endl;                      
 | 
|---|
| 87 | //    filog << " ... NMaxMemZones=" << nmax_ << " NMean=" << nmean_ << " Step=" << step_ << endl;       
 | 
|---|
| 88 | 
 | 
|---|
| 89 | /*----DELETE   NTuple 
 | 
|---|
| 90 |     const char* nnames[8] = {"fcs","tts","s1","s2","s12","s12re","s12im","s12phi"};
 | 
|---|
| 91 |     NTuple nt(8, nnames);
 | 
|---|
| 92 |     double xnt[10];
 | 
|---|
| 93 |     uint_4 nmnt = 0;
 | 
|---|
| 94 |     double ms1,ms2,ms12,ms12re,ms12im,ms12phi;
 | 
|---|
| 95 | ----*/
 | 
|---|
| 96 | // Time sample histograms 
 | 
|---|
| 97 |    Histo h1(-0.5, 255.5, 256);
 | 
|---|
| 98 |    Histo h2(-0.5, 255.5, 256);
 | 
|---|
| 99 | // Initialisation pour calcul FFT 
 | 
|---|
| 100 |     TVector< complex<r_4> > cfour1;  // composant TF
 | 
|---|
| 101 |     uint_4 paqsz = memgr.PaqSize();
 | 
|---|
| 102 |     uint_4 procpaqsz = memgr.ProcPaqSize();
 | 
|---|
| 103 |     
 | 
|---|
| 104 |    
 | 
|---|
| 105 |     BRPaquet pq(NULL, NULL, paqsz); 
 | 
|---|
| 106 |     TVector<r_4> vx(pq.DataSize()/2);
 | 
|---|
| 107 |     int szfour = pq.DataSize()/2/2+1;
 | 
|---|
| 108 |     cfour1.SetSize(szfour);
 | 
|---|
| 109 | /*
 | 
|---|
| 110 |     vx = (r_4)(0.);
 | 
|---|
| 111 |     FFTPackServer ffts;
 | 
|---|
| 112 |     ffts.FFTForward(vx, cfour1);
 | 
|---|
| 113 |     szfour = cfour1.Size();
 | 
|---|
| 114 | */
 | 
|---|
| 115 | 
 | 
|---|
| 116 |     bool fgtimfreq = false;  // true->cartes temps<>frequences
 | 
|---|
| 117 |     if (nfsmap_>0) fgtimfreq=true;
 | 
|---|
| 118 | 
 | 
|---|
| 119 |     TVector< complex<r_4> > cfour2(cfour1.Size());
 | 
|---|
| 120 |     
 | 
|---|
| 121 |     TVector<r_4> spectreV1(cfour1.Size());
 | 
|---|
| 122 |     TVector<r_4> spectreV2(cfour1.Size());
 | 
|---|
| 123 |     TVector<r_4> moyspecV1(cfour1.Size());   // Moyenne des Spectres 
 | 
|---|
| 124 |     TVector<r_4> moyspecV2(cfour1.Size());
 | 
|---|
| 125 |     TVector<r_4> sigspecV1(cfour1.Size());   // Sigma des Spectres
 | 
|---|
| 126 |     TVector<r_4> sigspecV2(cfour1.Size());
 | 
|---|
| 127 |     TVector< complex<r_4> > visiV12( cfour1.Size() );
 | 
|---|
| 128 | 
 | 
|---|
| 129 |     TMatrix<r_4> timfreqV1, timfreqV2;   // Cartes temps<>frequences
 | 
|---|
| 130 |     if (fgtimfreq) {
 | 
|---|
| 131 |       timfreqV1.SetSize(nmean_, spectreV1.Size()/nfsmap_);
 | 
|---|
| 132 |       timfreqV2.SetSize(nmean_, spectreV2.Size()/nfsmap_);
 | 
|---|
| 133 |     }
 | 
|---|
| 134 |     cout << " *DBG*BRProcARaw2C PaqSz=" << paqsz << " ProcPaqSize=" << procpaqsz 
 | 
|---|
| 135 |          << " procpaqsz/2=" << procpaqsz/2 << " cfour1.Size()=" << cfour1.Size()
 | 
|---|
| 136 |          << " *8="  << cfour1.Size()*8 << endl;
 | 
|---|
| 137 | 
 | 
|---|
| 138 |     pmutfftw->lock();
 | 
|---|
| 139 |     fftwf_plan plan1 = fftwf_plan_dft_r2c_1d(vx.Size(), vx.Data(), 
 | 
|---|
| 140 |                           (fftwf_complex*)cfour1.Data(), FFTW_ESTIMATE); 
 | 
|---|
| 141 |     fftwf_plan plan2 = fftwf_plan_dft_r2c_1d(vx.Size(), vx.Data(), 
 | 
|---|
| 142 |                           (fftwf_complex*)cfour2.Data(), FFTW_ESTIMATE); 
 | 
|---|
| 143 |     pmutfftw->unlock();
 | 
|---|
| 144 | 
 | 
|---|
| 145 |     uint_4 ifile = 0;                           
 | 
|---|
| 146 |     uint_4 nzm = 0;  // Nb de paquets moyennes pour le calcul de chaque spectre
 | 
|---|
| 147 |     uint_4 nmoyspec = 0;  // Nb de spectres moyennes
 | 
|---|
| 148 | 
 | 
|---|
| 149 |     uint_4 curfc=0;
 | 
|---|
| 150 |     uint_8 curtt=0;
 | 
|---|
| 151 |     uint_8 firsttt=0;
 | 
|---|
| 152 |     bool fgfirst=true;
 | 
|---|
| 153 |     for (uint_4 kmz=0; kmz<nmax_; kmz++) {
 | 
|---|
| 154 |       if (stop_) break;
 | 
|---|
| 155 |       int mid = memgr.FindMemZoneId(MemZA_ProcA);
 | 
|---|
| 156 |       Byte* buff = memgr.GetMemZone(mid);
 | 
|---|
| 157 |       if (buff == NULL) {
 | 
|---|
| 158 |          cout << " BRProcARaw2C::run()/ERROR memgr.GetMemZone(" << mid << ") -> NULL" << endl;
 | 
|---|
| 159 |              break;             
 | 
|---|
| 160 |       }
 | 
|---|
| 161 |       Byte* procbuff = memgr.GetProcMemZone(mid);
 | 
|---|
| 162 |       if (procbuff == NULL) {
 | 
|---|
| 163 |             cout << " BRProcARaw2C::run()/ERROR memgr.GetProcMemZone(" << mid << ") -> NULL" << endl;
 | 
|---|
| 164 |         break;  
 | 
|---|
| 165 |       }
 | 
|---|
| 166 | //---- DELETE      nmnt=0;  ms1=ms2=ms12=ms12re=ms12im=ms12phi=0.;
 | 
|---|
| 167 |       for(uint_4 i=0; i<memgr.NbPaquets(); i++) {
 | 
|---|
| 168 |             BRPaquet paq(NULL, buff+i*paqsz, paqsz); 
 | 
|---|
| 169 |         if (!pcheck.Check(paq)) continue;   // on ne traite que les paquets OK
 | 
|---|
| 170 |         if (fgfirst) { firsttt=paq.TimeTag(); fgfirst=false; } 
 | 
|---|
| 171 |         curfc=paq.FrameCounter();
 | 
|---|
| 172 |         curtt=paq.TimeTag()-firsttt;
 | 
|---|
| 173 | // Traitement voie 1        
 | 
|---|
| 174 |         if (fghist_) {
 | 
|---|
| 175 |           for(sa_size_t j=0; j<vx.Size(); j++) {
 | 
|---|
| 176 |             r_4 vts=(r_4)(*(paq.Data1()+j));
 | 
|---|
| 177 |             h1.Add((r_8)vts);
 | 
|---|
| 178 |             vx(j) = vts-127.5;
 | 
|---|
| 179 |           }
 | 
|---|
| 180 |         }
 | 
|---|
| 181 |         else {
 | 
|---|
| 182 |           for(sa_size_t j=0; j<vx.Size(); j++) 
 | 
|---|
| 183 |             vx(j) = (r_4)(*(paq.Data1()+j))-127.5;
 | 
|---|
| 184 |         }
 | 
|---|
| 185 | //        fftwf_complex* coeff1 = (fftwf_complex*)(procbuff+i*procpaqsz);
 | 
|---|
| 186 |             fftwf_execute(plan1); 
 | 
|---|
| 187 | //        complex<r_4>* zp1 = (complex<r_4>*)(vx.Data());
 | 
|---|
| 188 | //        ffts.FFTForward(vx, cfour1);
 | 
|---|
| 189 |         for(sa_size_t j=0; j<spectreV1.Size(); j++) 
 | 
|---|
| 190 |           spectreV1(j) += Zmod2(cfour1(j));
 | 
|---|
| 191 |         memcpy(procbuff+i*procpaqsz, cfour1.Data(), sizeof(complex<r_4>)*cfour1.Size());
 | 
|---|
| 192 |         if (fgtimfreq) {   // Remplissage tableau temps-frequence
 | 
|---|
| 193 |           for(sa_size_t c=1; c<timfreqV1.NCols(); c++) {
 | 
|---|
| 194 |             for(sa_size_t j=c*nfsmap_; j<(c+1)*nfsmap_; j++) 
 | 
|---|
| 195 |               timfreqV1(nzm, c) += Zmod2(cfour1(j));
 | 
|---|
| 196 |           }
 | 
|---|
| 197 |         }
 | 
|---|
| 198 | // Traitement voie 2        
 | 
|---|
| 199 |         if (fghist_) {
 | 
|---|
| 200 |           for(sa_size_t j=0; j<vx.Size(); j++) {
 | 
|---|
| 201 |             r_4 vts=(r_4)(*(paq.Data2()+j));
 | 
|---|
| 202 |             h2.Add((r_8)vts);
 | 
|---|
| 203 |             vx(j) = vts-127.5;
 | 
|---|
| 204 |           }
 | 
|---|
| 205 |         }
 | 
|---|
| 206 |         else {
 | 
|---|
| 207 |           for(sa_size_t j=0; j<vx.Size(); j++) 
 | 
|---|
| 208 |             vx(j) = (r_4)(*(paq.Data2()+j))-127.5;
 | 
|---|
| 209 |         }
 | 
|---|
| 210 |         fftwf_execute(plan2); 
 | 
|---|
| 211 |         for(sa_size_t j=0; j<spectreV2.Size(); j++) 
 | 
|---|
| 212 |           spectreV2(j) += Zmod2(cfour2(j));  // Zmod2(zp2[j]); 
 | 
|---|
| 213 |         memcpy(procbuff+i*procpaqsz+procpaqsz/2, cfour2.Data(), sizeof(complex<r_4>)*cfour2.Size());
 | 
|---|
| 214 |         if (fgtimfreq) {   // Remplissage tableau temps-frequence
 | 
|---|
| 215 |           for(sa_size_t c=1; c<timfreqV2.NCols(); c++) {
 | 
|---|
| 216 |             for(sa_size_t j=c*nfsmap_; j<(c+1)*nfsmap_; j++) 
 | 
|---|
| 217 |               timfreqV2(nzm,c) += Zmod2(cfour2(j));
 | 
|---|
| 218 |           }
 | 
|---|
| 219 |         }
 | 
|---|
| 220 | 
 | 
|---|
| 221 | // Calcul correlation (visibilite V1 * V2)
 | 
|---|
| 222 |         for(sa_size_t j=0; j<visiV12.Size(); j++) 
 | 
|---|
| 223 |           visiV12(j)+=cfour1(j)*conj(cfour2(j));
 | 
|---|
| 224 | //        for(sa_size_t j=0; j<visiV12.Size(); j++) visiV12(j)+=zp1[j]*zp2[j];
 | 
|---|
| 225 |         if (nzm==0) {
 | 
|---|
| 226 |           spectreV1.Info()["StartFC"] = curfc;
 | 
|---|
| 227 |           spectreV2.Info()["StartFC"] = curfc;
 | 
|---|
| 228 |           visiV12.Info()["StartFC"] = curfc;
 | 
|---|
| 229 |           spectreV1.Info()["StartTT"] = curtt;
 | 
|---|
| 230 |           spectreV2.Info()["StartTT"] = curtt;
 | 
|---|
| 231 |           visiV12.Info()["StartTT"] = curtt;
 | 
|---|
| 232 |         }
 | 
|---|
| 233 |         nzm++;   
 | 
|---|
| 234 | /*----DELETE
 | 
|---|
| 235 |         if (nmnt==0)  { xnt[0]=paq.FrameCounter();  xnt[1]=paq.TimeTag(); }
 | 
|---|
| 236 |         for(sa_size_t j=2700; j<2800; j++) { 
 | 
|---|
| 237 |           ms1 += Zmod2(cfour1(j)); ms2 += Zmod2(cfour2(j)); 
 | 
|---|
| 238 |           complex<r_4> zvis =  cfour1(j)*conj(cfour2(j));
 | 
|---|
| 239 |           ms12 += Zmod2(zvis);   ms12re += zvis.real();  ms12im += zvis.imag();
 | 
|---|
| 240 |           ms12phi+= atan2(zvis.imag(),zvis.real());
 | 
|---|
| 241 |         } 
 | 
|---|
| 242 |         nmnt++;    
 | 
|---|
| 243 | ----*/
 | 
|---|
| 244 |         totnbytesproc += paq.DataSize();
 | 
|---|
| 245 |         totnbytesout += (2*sizeof(complex<r_4>)*cfour1.Size());
 | 
|---|
| 246 | 
 | 
|---|
| 247 |       } // Fin de boucle sur les paquets d'une zone
 | 
|---|
| 248 | 
 | 
|---|
| 249 | /*---- DELETE
 | 
|---|
| 250 |       if (nmnt>0)  {
 | 
|---|
| 251 |         double fnorm = (double)nmnt*(2800-2700); 
 | 
|---|
| 252 |         xnt[2] = ms1 /= fnorm;
 | 
|---|
| 253 |         xnt[3] = ms2 /= fnorm;
 | 
|---|
| 254 |         xnt[4] = ms12 /= fnorm;
 | 
|---|
| 255 |         xnt[5] = ms12re /= fnorm;
 | 
|---|
| 256 |         xnt[6] = ms12im /= fnorm;
 | 
|---|
| 257 |         xnt[7] = ms12phi /= fnorm;
 | 
|---|
| 258 |         nt.Fill(xnt);
 | 
|---|
| 259 |       }
 | 
|---|
| 260 | ----*/
 | 
|---|
| 261 |       if ((nzm >= nmean_) || ((kmz==(nmax_-1))&&(nzm>1))) {
 | 
|---|
| 262 |         spectreV1 /= (r_4)(nzm);
 | 
|---|
| 263 |         spectreV2 /= (r_4)(nzm);
 | 
|---|
| 264 | 
 | 
|---|
| 265 |         // pour le calcul des moyennes et sigmas de ces spectres 
 | 
|---|
| 266 |         moyspecV1 += spectreV1;
 | 
|---|
| 267 |         moyspecV2 += spectreV2;
 | 
|---|
| 268 |         sigspecV1 += (spectreV1 && spectreV1);
 | 
|---|
| 269 |         sigspecV2 += (spectreV2 && spectreV2);
 | 
|---|
| 270 |         nmoyspec++;
 | 
|---|
| 271 | 
 | 
|---|
| 272 |         visiV12 /= complex<r_4>((r_4)nzm, 0.);
 | 
|---|
| 273 | 
 | 
|---|
| 274 |         spectreV1.Info()["NPaqMoy"] = nzm;
 | 
|---|
| 275 |         spectreV2.Info()["NPaqMoy"] = nzm;
 | 
|---|
| 276 |         visiV12.Info()["NPaqMoy"] = nzm;
 | 
|---|
| 277 |         spectreV1.Info()["EndFC"] = curfc;
 | 
|---|
| 278 |         spectreV2.Info()["EndFC"] = curfc;
 | 
|---|
| 279 |         visiV12.Info()["EndFC"] = curfc;
 | 
|---|
| 280 |         spectreV1.Info()["EndTT"] = curtt;
 | 
|---|
| 281 |         spectreV2.Info()["EndTT"] = curtt;
 | 
|---|
| 282 |         visiV12.Info()["EndTT"] = curtt;
 | 
|---|
| 283 |         {
 | 
|---|
| 284 |         sprintf(fname,"%s_%d.ppf",path_.c_str(),(int)ifile);
 | 
|---|
| 285 |         POutPersist po(fname);
 | 
|---|
| 286 |         string tag1="specV1";
 | 
|---|
| 287 |         string tag2="specV2";
 | 
|---|
| 288 |         string tag12="visiV12";
 | 
|---|
| 289 |         string tagh1="tshV1";
 | 
|---|
| 290 |         string tagh2="tshV2";
 | 
|---|
| 291 |         string tagtf1="timfreqV1";
 | 
|---|
| 292 |         string tagtf2="timfreqV2";
 | 
|---|
| 293 |         if (card_==2) {
 | 
|---|
| 294 |           tag1 = "specV3";
 | 
|---|
| 295 |           tag2 = "specV4";
 | 
|---|
| 296 |           tagh1 = "tshV1";
 | 
|---|
| 297 |           tagh2 = "tshV2";
 | 
|---|
| 298 |           tag12="visiV34";
 | 
|---|
| 299 |           tagtf1="timfreqV3";
 | 
|---|
| 300 |           tagtf2="timfreqV4";
 | 
|---|
| 301 |         }
 | 
|---|
| 302 |         po << PPFNameTag(tag1) << spectreV1; 
 | 
|---|
| 303 |         po << PPFNameTag(tag2) << spectreV2; 
 | 
|---|
| 304 |         po << PPFNameTag(tag12) << visiV12; 
 | 
|---|
| 305 |         if (fghist_) {
 | 
|---|
| 306 |           po << PPFNameTag(tagh1) << h1; 
 | 
|---|
| 307 |           po << PPFNameTag(tagh2) << h2; 
 | 
|---|
| 308 |         }
 | 
|---|
| 309 |         if (fgtimfreq) {
 | 
|---|
| 310 |           timfreqV1 /= (r_4)nzm;
 | 
|---|
| 311 |           timfreqV2 /= (r_4)nzm;
 | 
|---|
| 312 |           po << PPFNameTag(tagtf1) << timfreqV1; 
 | 
|---|
| 313 |           po << PPFNameTag(tagtf2) << timfreqV2; 
 | 
|---|
| 314 |         }
 | 
|---|
| 315 |         }
 | 
|---|
| 316 |         spectreV1 = (r_4)(0.);
 | 
|---|
| 317 |         spectreV2 = (r_4)(0.);
 | 
|---|
| 318 |         visiV12 = complex<r_4>(0., 0.);
 | 
|---|
| 319 |         if (fghist_) {
 | 
|---|
| 320 |           h1.Zero();
 | 
|---|
| 321 |           h2.Zero();
 | 
|---|
| 322 |         }
 | 
|---|
| 323 |         if (fgtimfreq) {
 | 
|---|
| 324 |           timfreqV1 = (r_4)(0.);
 | 
|---|
| 325 |           timfreqV2 = (r_4)(0.);
 | 
|---|
| 326 |         }
 | 
|---|
| 327 |         nzm = 0;  ifile++; 
 | 
|---|
| 328 | //        ts.SetNow();
 | 
|---|
| 329 | //        filog << ts << " :  proc file  " << fname << endl;                   
 | 
|---|
| 330 |         cout << " BRProcARaw2C::run() created file  " << fname << card2name_(card_) << endl;
 | 
|---|
| 331 |       }   
 | 
|---|
| 332 |       
 | 
|---|
| 333 |       memgr.FreeMemZone(mid, MemZS_ProcA);
 | 
|---|
| 334 |     }  // Fin de boucle sur les zones a traiter 
 | 
|---|
| 335 |   cout << " ------------  BRProcARaw2C::run() END " << card2name_(card_) 
 | 
|---|
| 336 |        << " ------------ " << endl;
 | 
|---|
| 337 | /*---- DELETE
 | 
|---|
| 338 |   {
 | 
|---|
| 339 |   nt.Info()["FirstTT"]=firsttt;     
 | 
|---|
| 340 |   cout << nt;
 | 
|---|
| 341 |   sprintf(fname,"%s_nt.ppf",path_.c_str());
 | 
|---|
| 342 |   POutPersist po(fname);
 | 
|---|
| 343 |   po << PPFNameTag("ntv12") << nt; 
 | 
|---|
| 344 |   cout << " BRProcARaw2C::run() created NTuple file " << fname << card2name_(card_) << endl;
 | 
|---|
| 345 |   }
 | 
|---|
| 346 | ---- */ 
 | 
|---|
| 347 |   if (nmoyspec>0) {  // Calcul des moyennes et sigmas des spectres 
 | 
|---|
| 348 |     r_4 fnms = nmoyspec;
 | 
|---|
| 349 |     moyspecV1 /= fnms;
 | 
|---|
| 350 |     moyspecV2 /= fnms;
 | 
|---|
| 351 |     sigspecV1 /= fnms;
 | 
|---|
| 352 |     sigspecV2 /= fnms;
 | 
|---|
| 353 |     sigspecV1 -= (moyspecV1 && moyspecV1);
 | 
|---|
| 354 |     sigspecV2 -= (moyspecV2 && moyspecV2);
 | 
|---|
| 355 |     sigspecV1 = Sqrt(sigspecV1);
 | 
|---|
| 356 |     sigspecV2 = Sqrt(sigspecV2);
 | 
|---|
| 357 |     TVector<r_4> rsbV1, rsbV2;   // Rapport signal/bruit
 | 
|---|
| 358 |     moyspecV1.DivElt(sigspecV1, rsbV1, false, true);
 | 
|---|
| 359 |     moyspecV2.DivElt(sigspecV2, rsbV2, false, true);
 | 
|---|
| 360 |     sprintf(fname,"%s_ms.ppf",path_.c_str());
 | 
|---|
| 361 |     POutPersist po(fname);
 | 
|---|
| 362 |     po << PPFNameTag("moyspecV1") << moyspecV1; 
 | 
|---|
| 363 |     po << PPFNameTag("moyspecV2") << moyspecV2; 
 | 
|---|
| 364 |     po << PPFNameTag("sigspecV1") << sigspecV1; 
 | 
|---|
| 365 |     po << PPFNameTag("sigspecV2") << sigspecV2; 
 | 
|---|
| 366 |     po << PPFNameTag("rsbV1") << rsbV1; 
 | 
|---|
| 367 |     po << PPFNameTag("rsbV2") << rsbV2; 
 | 
|---|
| 368 |     cout << " BRProcARaw2C::run() created moysigspec file " << fname << card2name_(card_) << endl;
 | 
|---|
| 369 |   }
 | 
|---|
| 370 | 
 | 
|---|
| 371 |   ts.SetNow();
 | 
|---|
| 372 |   tm.SplitQ();
 | 
|---|
| 373 |   cout << "  TotalProc= " << totnbytesproc/(1024*1024) << " MBytes, rate= " 
 | 
|---|
| 374 |        << (double)(totnbytesproc)/1024./tm.PartialElapsedTimems() << " MB/s" 
 | 
|---|
| 375 |        << " ProcDataOut=" <<  totnbytesout/(1024*1024) << " MB" << endl;    
 | 
|---|
| 376 |   cout << pcheck;
 | 
|---|
| 377 |   cout << " BRProcARaw2C::run()/Timing: " << card2name_(card_) << endl; 
 | 
|---|
| 378 |   tm.Print();
 | 
|---|
| 379 |   cout << " ---------------------------------------------------------- " << endl;
 | 
|---|
| 380 |     
 | 
|---|
| 381 |   }
 | 
|---|
| 382 |   catch (PException& exc) {
 | 
|---|
| 383 |     cout << " BRProcARaw2C::run()/catched PException " << exc.Msg() << endl;
 | 
|---|
| 384 |     setRC(3);   
 | 
|---|
| 385 |     return; 
 | 
|---|
| 386 |   }
 | 
|---|
| 387 |   catch(...) {
 | 
|---|
| 388 |     cout << " BRProcARaw2C::run()/catched unknown ... exception " << endl;
 | 
|---|
| 389 |     setRC(4);   
 | 
|---|
| 390 |     return; 
 | 
|---|
| 391 |   }
 | 
|---|
| 392 |   setRC(0);
 | 
|---|
| 393 |   return;
 | 
|---|
| 394 | }   
 | 
|---|
| 395 | 
 | 
|---|
| 396 | //---------------------------------------------------------------------
 | 
|---|
| 397 | // Classe thread de traitement 2 x 2 voies/frames (Apres BRProcARaw2C)
 | 
|---|
| 398 | //---------------------------------------------------------------------
 | 
|---|
| 399 | 
 | 
|---|
| 400 | /* --Methode-- */
 | 
|---|
| 401 | BRProcBRaw4C::BRProcBRaw4C(RAcqMemZoneMgr& mem1, RAcqMemZoneMgr& mem2, 
 | 
|---|
| 402 |                            string& path, uint_4 nmean, uint_4 nmax, bool fgnotrl)
 | 
|---|
| 403 |   :  memgr1(mem1), memgr2(mem2) 
 | 
|---|
| 404 | {
 | 
|---|
| 405 |   nmax_ = nmax; 
 | 
|---|
| 406 |   nmean_ = nmean;
 | 
|---|
| 407 |   stop_ = false;        
 | 
|---|
| 408 |   path_ = path; 
 | 
|---|
| 409 |   fgnotrl_ = fgnotrl;
 | 
|---|
| 410 | }
 | 
|---|
| 411 | 
 | 
|---|
| 412 | /* --Methode-- */
 | 
|---|
| 413 | void BRProcBRaw4C::Stop()
 | 
|---|
| 414 | {
 | 
|---|
| 415 |  stop_=true;
 | 
|---|
| 416 |  // cout <<" BRProcBRaw4C::Stop ... > STOP " << endl;
 | 
|---|
| 417 | }
 | 
|---|
| 418 | 
 | 
|---|
| 419 | 
 | 
|---|
| 420 | /* --Methode-- */
 | 
|---|
| 421 | void BRProcBRaw4C::run()
 | 
|---|
| 422 | {
 | 
|---|
| 423 |   setRC(1);     
 | 
|---|
| 424 |   try {
 | 
|---|
| 425 |     Timer tm("BRProcBRaw4C", false);
 | 
|---|
| 426 |     TimeStamp ts; 
 | 
|---|
| 427 |     BRPaqChecker pcheck1(!fgnotrl_);  // Verification/comptage des paquets 
 | 
|---|
| 428 |     BRPaqChecker pcheck2(!fgnotrl_);  // Verification/comptage des paquets 
 | 
|---|
| 429 | 
 | 
|---|
| 430 |     size_t totnbytesout = 0;
 | 
|---|
| 431 |     size_t totnbytesproc = 0;
 | 
|---|
| 432 | 
 | 
|---|
| 433 |     cout << " BRProcBRaw4C::run() - Starting " << ts << " NMaxMemZones=" << nmax_ 
 | 
|---|
| 434 |          << " NMean=" << nmean_ << endl;        
 | 
|---|
| 435 |     cout << " BRProcBRaw4C::run()... - Output Data Path: " << path_ << endl;
 | 
|---|
| 436 | 
 | 
|---|
| 437 |     uint_4 paqsz = memgr1.PaqSize();
 | 
|---|
| 438 |     uint_4 procpaqsz = memgr1.ProcPaqSize();
 | 
|---|
| 439 |     if ((paqsz != memgr2.PaqSize())||(procpaqsz!= memgr2.ProcPaqSize())) {
 | 
|---|
| 440 |       cout << "BRProcBRaw4C::run()/ERROR : different paquet size -> stop \n ...(PaqSz1="
 | 
|---|
| 441 |            << paqsz << " Sz2=" << memgr2.PaqSize() << " ProcPaqSz1=" 
 | 
|---|
| 442 |            << procpaqsz << " Sz2=" << memgr2.ProcPaqSize() << " )" << endl;
 | 
|---|
| 443 |       setRC(9); 
 | 
|---|
| 444 |       return;   
 | 
|---|
| 445 |     }
 | 
|---|
| 446 | 
 | 
|---|
| 447 |     TVector< complex<r_4> > cfour;  // composant TF
 | 
|---|
| 448 |     BRPaquet pq(NULL, NULL, paqsz);     
 | 
|---|
| 449 | /*   
 | 
|---|
| 450 |     TVector<r_4> vx(pq.DataSize()/2);
 | 
|---|
| 451 |     vx = (r_4)(0.);
 | 
|---|
| 452 |     FFTPackServer ffts;
 | 
|---|
| 453 |     ffts.FFTForward(vx, cfour);
 | 
|---|
| 454 |     
 | 
|---|
| 455 |     TVector< complex<r_4> > visiV13( cfour.Size() );
 | 
|---|
| 456 |     TVector< complex<r_4> > visiV14( cfour.Size() );
 | 
|---|
| 457 |     TVector< complex<r_4> > visiV23( cfour.Size() );
 | 
|---|
| 458 |     TVector< complex<r_4> > visiV24( cfour.Size() );
 | 
|---|
| 459 | */
 | 
|---|
| 460 |     int szfour = pq.DataSize()/2/2+1;
 | 
|---|
| 461 | //    int szfour = (paqsz-40)/2+1;
 | 
|---|
| 462 |     TVector< complex<r_4> > visiV13( szfour  );
 | 
|---|
| 463 |     TVector< complex<r_4> > visiV14( szfour );
 | 
|---|
| 464 |     TVector< complex<r_4> > visiV23( szfour );
 | 
|---|
| 465 |     TVector< complex<r_4> > visiV24( szfour );
 | 
|---|
| 466 |     // cout << " *DBG*AAAAA ---- Vectors OK" << endl; 
 | 
|---|
| 467 |     cout << " *DBG*BRProcBRaw4C PaqSz=" << paqsz << " ProcPaqSize=" << procpaqsz 
 | 
|---|
| 468 |          << " procpaqsz/2=" << procpaqsz/2 << " cfour.Size()=" << szfour
 | 
|---|
| 469 |          << " *8="  << szfour*8 << endl;
 | 
|---|
| 470 | 
 | 
|---|
| 471 |     DataTable dt;
 | 
|---|
| 472 |     dt.AddLongColumn("fc1");
 | 
|---|
| 473 |     dt.AddLongColumn("tt1");
 | 
|---|
| 474 |     dt.AddLongColumn("fc2");
 | 
|---|
| 475 |     dt.AddLongColumn("tt2");
 | 
|---|
| 476 |     DataTableRow dtr = dt.EmptyRow();
 | 
|---|
| 477 | 
 | 
|---|
| 478 |     uint_4 nzm = 0;
 | 
|---|
| 479 |     uint_4 totnoksfc = 0;
 | 
|---|
| 480 |     uint_4 totnokpaq = 0;
 | 
|---|
| 481 |     uint_4 totnpaq = 0;
 | 
|---|
| 482 |     uint_4 ifile = 0;
 | 
|---|
| 483 | 
 | 
|---|
| 484 |     uint_4 curfc=0;
 | 
|---|
| 485 |     uint_8 curtt=0;
 | 
|---|
| 486 |     uint_4 curfc2=0;
 | 
|---|
| 487 |     uint_8 curtt2=0;
 | 
|---|
| 488 |     uint_8 firsttt=0;
 | 
|---|
| 489 |     uint_8 firsttt2=0;
 | 
|---|
| 490 |     bool fgfirst=true;
 | 
|---|
| 491 |     for (uint_4 kmz=0; kmz<nmax_; kmz++) {
 | 
|---|
| 492 |       uint_4 noksfc = 0;
 | 
|---|
| 493 |       uint_4 nokpaq = 0;
 | 
|---|
| 494 |       if (stop_) break;
 | 
|---|
| 495 |        // cout << " *DBG*BBBBB" << kmz << endl; 
 | 
|---|
| 496 | 
 | 
|---|
| 497 |       int mid1 = memgr1.FindMemZoneId(MemZA_ProcB);
 | 
|---|
| 498 |       Byte* buff1 = memgr1.GetMemZone(mid1);
 | 
|---|
| 499 |       if (buff1 == NULL) {
 | 
|---|
| 500 |          cout << " BRProcBRaw4C::run()/ERROR memgr.GetMemZone(" << mid1 << ") -> NULL" << endl;
 | 
|---|
| 501 |              break;             
 | 
|---|
| 502 |       }
 | 
|---|
| 503 |       Byte* procbuff1 = memgr1.GetProcMemZone(mid1);
 | 
|---|
| 504 |       if (procbuff1 == NULL) {
 | 
|---|
| 505 |             cout << " BRProcBRaw4C::run()/ERROR memgr.GetProcMemZone(" << mid1 << ") -> NULL" << endl;
 | 
|---|
| 506 |         break;  
 | 
|---|
| 507 |       }
 | 
|---|
| 508 |       int mid2 = memgr2.FindMemZoneId(MemZA_ProcB);
 | 
|---|
| 509 |       Byte* buff2 = memgr2.GetMemZone(mid2);
 | 
|---|
| 510 |       if (buff1 == NULL) {
 | 
|---|
| 511 |          cout << " BRProcBRaw4C::run()/ERROR memgr.GetMemZone(" << mid2 << ") -> NULL" << endl;
 | 
|---|
| 512 |              break;             
 | 
|---|
| 513 |       }
 | 
|---|
| 514 |       Byte* procbuff2 = memgr2.GetProcMemZone(mid2);
 | 
|---|
| 515 |       if (procbuff2 == NULL) {
 | 
|---|
| 516 |             cout << " BRProcBRaw4C::run()/ERROR memgr.GetProcMemZone(" << mid2 << ") -> NULL" << endl;
 | 
|---|
| 517 |         break;  
 | 
|---|
| 518 |       }
 | 
|---|
| 519 |       uint_4 i1,i2;
 | 
|---|
| 520 |       i1=i2=0;
 | 
|---|
| 521 | //      cout << " *DBG*CCCCCC " << kmz << " memgr1.NbPaquets() =" << memgr1.NbPaquets() << endl;
 | 
|---|
| 522 |       while((i1<memgr1.NbPaquets())&&(i2<memgr2.NbPaquets())) {
 | 
|---|
| 523 |         BRPaquet paq1(NULL, buff1+i1*paqsz, paqsz); 
 | 
|---|
| 524 |         BRPaquet paq2(NULL, buff2+i2*paqsz, paqsz); 
 | 
|---|
| 525 |         totnpaq++;
 | 
|---|
| 526 | //        cout << " DBG["<<kmz<<"] i1,i2=" << i1 <<","<<i2<<" FC1,FC2=" <<paq1.FrameCounter()
 | 
|---|
| 527 | //<<","<<paq2.FrameCounter()<<endl;
 | 
|---|
| 528 |         // on ne traite que les paquets OK
 | 
|---|
| 529 |         if (!pcheck1.Check(paq1)) { i1++; continue; } 
 | 
|---|
| 530 |         if (!pcheck2.Check(paq2)) { i2++; continue; }
 | 
|---|
| 531 |         nokpaq++;
 | 
|---|
| 532 |         if (paq1.FrameCounter()<paq2.FrameCounter()) { i1++; continue; }  
 | 
|---|
| 533 |         if (paq2.FrameCounter()<paq1.FrameCounter()) { i2++; continue; }  
 | 
|---|
| 534 | //        cout << " DBG["<<kmz<<"]OKOK i1,i2=" << i1 <<","<<i2<<" FC1,FC2=" <<paq1.FrameCounter()
 | 
|---|
| 535 | // <<","<<paq2.FrameCounter()<<endl;
 | 
|---|
| 536 | 
 | 
|---|
| 537 |         if ((i1>=memgr1.NbPaquets())||(i2>=memgr1.NbPaquets())) {
 | 
|---|
| 538 |           cout << " *BUG*BUG i1=" << i1 << " i2=" << i2 << endl;
 | 
|---|
| 539 |           break;
 | 
|---|
| 540 |         }
 | 
|---|
| 541 |         // Les deux framecounters sont identiques ...
 | 
|---|
| 542 |         noksfc++;
 | 
|---|
| 543 |         curfc=paq1.FrameCounter();
 | 
|---|
| 544 |         curfc2=paq2.FrameCounter();
 | 
|---|
| 545 |         if (fgfirst) { 
 | 
|---|
| 546 |           firsttt=paq1.TimeTag();  firsttt2=paq2.TimeTag(); 
 | 
|---|
| 547 |           cout << " BRProcBRaw4C()/Info First FC="<<curfc<<" , "<<curfc2<<" -> TT=" 
 | 
|---|
| 548 |                << firsttt<<" , "<<firsttt2 <<endl;
 | 
|---|
| 549 |           fgfirst=false; 
 | 
|---|
| 550 |         } 
 | 
|---|
| 551 |         curtt=paq1.TimeTag()-firsttt;
 | 
|---|
| 552 |         curtt2=paq2.TimeTag()-firsttt2;
 | 
|---|
| 553 |         dtr[0]=curfc;  dtr[1]=curtt;
 | 
|---|
| 554 |         dtr[2]=curfc2;  dtr[3]=curtt2;
 | 
|---|
| 555 |         dt.AddRow(dtr);
 | 
|---|
| 556 | 
 | 
|---|
| 557 |         complex<r_4>* zp1 = (complex<r_4>*)(procbuff1+i1*procpaqsz);
 | 
|---|
| 558 |         complex<r_4>* zp2 = (complex<r_4>*)(procbuff1+i1*procpaqsz+procpaqsz/2);
 | 
|---|
| 559 |         complex<r_4>* zp3 = (complex<r_4>*)(procbuff2+i2*procpaqsz);
 | 
|---|
| 560 |         complex<r_4>* zp4 = (complex<r_4>*)(procbuff2+i2*procpaqsz+procpaqsz/2);
 | 
|---|
| 561 |         for(sa_size_t j=0; j<visiV13.Size(); j++) { 
 | 
|---|
| 562 |           visiV13(j)+=zp1[j]*conj(zp3[j]);
 | 
|---|
| 563 |           visiV14(j)+=zp1[j]*conj(zp4[j]);
 | 
|---|
| 564 |           visiV23(j)+=zp2[j]*conj(zp3[j]);
 | 
|---|
| 565 |           visiV24(j)+=zp2[j]*conj(zp4[j]);
 | 
|---|
| 566 |         }
 | 
|---|
| 567 |         if (nzm==0) {
 | 
|---|
| 568 |           visiV13.Info()["StartFC"] = curfc;
 | 
|---|
| 569 |           visiV14.Info()["StartFC"] = curfc;
 | 
|---|
| 570 |           visiV23.Info()["StartFC"] = curfc;
 | 
|---|
| 571 |           visiV24.Info()["StartFC"] = curfc;
 | 
|---|
| 572 |           visiV13.Info()["StartTT"] = curtt;
 | 
|---|
| 573 |           visiV14.Info()["StartTT"] = curtt;
 | 
|---|
| 574 |           visiV23.Info()["StartTT"] = curtt;
 | 
|---|
| 575 |           visiV24.Info()["StartTT"] = curtt;
 | 
|---|
| 576 |         }
 | 
|---|
| 577 |         nzm++;  i1++; i2++;
 | 
|---|
| 578 |         totnbytesproc += 2*paq1.DataSize();
 | 
|---|
| 579 |       } // Fin de boucle sur les paquets d'une zone
 | 
|---|
| 580 |       memgr1.FreeMemZone(mid1, MemZS_ProcB);
 | 
|---|
| 581 |       memgr2.FreeMemZone(mid2, MemZS_ProcB);
 | 
|---|
| 582 | 
 | 
|---|
| 583 |       if ((nzm >= nmean_) || ((kmz==(nmax_-1))&&(nzm>1))) {
 | 
|---|
| 584 |         visiV13 /= complex<r_4>((r_4)nzm, 0.);
 | 
|---|
| 585 |         visiV14 /= complex<r_4>((r_4)nzm, 0.);
 | 
|---|
| 586 |         visiV23 /= complex<r_4>((r_4)nzm, 0.);
 | 
|---|
| 587 |         visiV24 /= complex<r_4>((r_4)nzm, 0.);
 | 
|---|
| 588 |         visiV13.Info()["NPaqMoy"] = nzm;
 | 
|---|
| 589 |         visiV14.Info()["NPaqMoy"] = nzm;
 | 
|---|
| 590 |         visiV23.Info()["NPaqMoy"] = nzm;
 | 
|---|
| 591 |         visiV24.Info()["NPaqMoy"] = nzm;
 | 
|---|
| 592 |         visiV13.Info()["EndFC"] = curfc;
 | 
|---|
| 593 |         visiV14.Info()["EndFC"] = curfc;
 | 
|---|
| 594 |         visiV23.Info()["EndFC"] = curfc;
 | 
|---|
| 595 |         visiV24.Info()["EndFC"] = curfc;
 | 
|---|
| 596 |         visiV13.Info()["EndTT"] = curtt;
 | 
|---|
| 597 |         visiV14.Info()["EndTT"] = curtt;
 | 
|---|
| 598 |         visiV23.Info()["EndTT"] = curtt;
 | 
|---|
| 599 |         visiV24.Info()["EndTT"] = curtt;
 | 
|---|
| 600 |         char fname[512];
 | 
|---|
| 601 |         {
 | 
|---|
| 602 |         sprintf(fname,"%s_%d.ppf",path_.c_str(),(int)ifile);
 | 
|---|
| 603 |         POutPersist po(fname);
 | 
|---|
| 604 |         po << PPFNameTag("visiV13") << visiV13; 
 | 
|---|
| 605 |         po << PPFNameTag("visiV14") << visiV14; 
 | 
|---|
| 606 |         po << PPFNameTag("visiV23") << visiV23; 
 | 
|---|
| 607 |         po << PPFNameTag("visiV24") << visiV24; 
 | 
|---|
| 608 |         }
 | 
|---|
| 609 |         visiV13 = complex<r_4>(0., 0.);
 | 
|---|
| 610 |         visiV14 = complex<r_4>(0., 0.);
 | 
|---|
| 611 |         visiV23 = complex<r_4>(0., 0.);
 | 
|---|
| 612 |         visiV24 = complex<r_4>(0., 0.);
 | 
|---|
| 613 |         nzm = 0;  ifile++; 
 | 
|---|
| 614 | //        ts.SetNow();
 | 
|---|
| 615 | //        filog << ts << " :  proc file  " << fname << endl;                   
 | 
|---|
| 616 |         cout << " BRProcBRaw4C::run() created file  " << fname << endl;
 | 
|---|
| 617 |       }   
 | 
|---|
| 618 |       double okfrac = (nokpaq>1)?((double)noksfc/(double)nokpaq*100.):0.;
 | 
|---|
| 619 |       cout << "BRProcBRaw4C ["<<kmz<<"] NOKPaq=" << nokpaq << " NSameFC=" << noksfc 
 | 
|---|
| 620 |            << " (" << okfrac << " %)" << endl;
 | 
|---|
| 621 |       totnokpaq += nokpaq;
 | 
|---|
| 622 |       totnoksfc += noksfc;
 | 
|---|
| 623 |     }  // Fin de boucle sur les zones a traiter 
 | 
|---|
| 624 |     cout << " ------------------  BRProcBRaw4C::run() END ----------------- " << endl;
 | 
|---|
| 625 |     {     
 | 
|---|
| 626 |     dt.Info()["FirstTT1"]=firsttt;     
 | 
|---|
| 627 |     dt.Info()["FirstTT2"]=firsttt2;     
 | 
|---|
| 628 |     cout << dt;
 | 
|---|
| 629 |     char fname[512];
 | 
|---|
| 630 |     sprintf(fname,"%s_fctt.ppf",path_.c_str());
 | 
|---|
| 631 |     POutPersist po(fname);
 | 
|---|
| 632 |     po << PPFNameTag("ttfc") << dt; 
 | 
|---|
| 633 |     cout << " BRProcBRaw4C::run() created TimeTag/FrameCounter file " << fname  << endl;
 | 
|---|
| 634 |     }     
 | 
|---|
| 635 |     ts.SetNow();
 | 
|---|
| 636 |     tm.SplitQ();
 | 
|---|
| 637 |     cout << "  TotalProc= " << totnbytesproc/(1024*1024) << " MBytes, rate= " 
 | 
|---|
| 638 |          << (double)(totnbytesproc)/1024./tm.PartialElapsedTimems() << " MB/s" << endl;
 | 
|---|
| 639 |     double totokfrac = (totnokpaq>1)?((double)totnoksfc/(double)totnokpaq*100.):0.;
 | 
|---|
| 640 |     cout << " NOkPaq1,2=" << totnokpaq << " /TotNPaq=" << totnpaq << " TotNSameFC=" 
 | 
|---|
| 641 |          << totnoksfc << " (" << totokfrac << " %)" << endl;
 | 
|---|
| 642 | //  cout << pcheck1;
 | 
|---|
| 643 | //  cout << pcheck2;
 | 
|---|
| 644 |     cout << " BRProcBRaw4C::run()/Timing: \n"; 
 | 
|---|
| 645 |     tm.Print();
 | 
|---|
| 646 |     cout << " ---------------------------------------------------------- " << endl;
 | 
|---|
| 647 | }
 | 
|---|
| 648 |   catch (PException& exc) {
 | 
|---|
| 649 |     cout << " BRProcBRaw4C::run()/catched PException " << exc.Msg() << endl;
 | 
|---|
| 650 |     setRC(3);   
 | 
|---|
| 651 |     return; 
 | 
|---|
| 652 |   }
 | 
|---|
| 653 |   catch(...) {
 | 
|---|
| 654 |     cout << " BRProcBRaw4C::run()/catched unknown ... exception " << endl;
 | 
|---|
| 655 |     setRC(4);   
 | 
|---|
| 656 |     return; 
 | 
|---|
| 657 |   }
 | 
|---|
| 658 |   setRC(0);
 | 
|---|
| 659 |   return;
 | 
|---|
| 660 | }   
 | 
|---|
| 661 | 
 | 
|---|
| 662 | 
 | 
|---|