Changeset 3647 in Sophya for trunk/AddOn/TAcq/brproc.cc


Ignore:
Timestamp:
Jun 12, 2009, 4:49:47 PM (16 years ago)
Author:
ansari
Message:

Petites amelioration programme traitrement donnees de Pittsburgh - Reza 12/06/2009

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/AddOn/TAcq/brproc.cc

    r3646 r3647  
    1010#include "tvector.h"
    1111#include "ntuple.h"
     12#include "datatable.h"
    1213#include "fioarr.h"
    1314#include "timestamp.h"
     
    7879//    filog << " ... NMaxMemZones=" << nmax_ << " NMean=" << nmean_ << " Step=" << step_ << endl;       
    7980
    80 // NTuple
     81/*----DELETE  NTuple
    8182    const char* nnames[8] = {"fcs","tts","s1","s2","s12","s12re","s12im","s12phi"};
    8283    NTuple nt(8, nnames);
     
    8485    uint_4 nmnt = 0;
    8586    double ms1,ms2,ms12,ms12re,ms12im,ms12phi;
     87----*/
    8688// Initialisation pour calcul FFT
    8789    TVector< complex<r_4> > cfour1;  // composant TF
     
    113115    uint_4 ifile = 0;                           
    114116    uint_4 nzm = 0; 
     117
     118    uint_4 curfc=0;
     119    uint_8 curtt=0;
     120    uint_8 firsttt=0;
     121    bool fgfirst=true;
    115122    for (uint_4 kmz=0; kmz<nmax_; kmz++) {
    116123      if (stop_) break;
     
    126133        break; 
    127134      }
    128       nmnt=0;  ms1=ms2=ms12=ms12re=ms12im=ms12phi=0.;
     135//---- DELETE      nmnt=0;  ms1=ms2=ms12=ms12re=ms12im=ms12phi=0.;
    129136      for(uint_4 i=0; i<memgr.NbPaquets(); i++) {
    130137            BRPaquet paq(NULL, buff+i*paqsz, paqsz);
    131138        if (!pcheck.Check(paq)) continue;   // on ne traite que les paquets OK
    132        
     139        if (fgfirst) { firsttt=paq.TimeTag(); fgfirst=false; }
     140        curfc=paq.FrameCounter();
     141        curtt=paq.TimeTag()-firsttt;
    133142// Traitement voie 1       
    134143            for(sa_size_t j=0; j<vx.Size(); j++)
     
    154163          visiV12(j)+=cfour1(j)*conj(cfour2(j));
    155164//        for(sa_size_t j=0; j<visiV12.Size(); j++) visiV12(j)+=zp1[j]*zp2[j];
     165        if (nzm==0) {
     166          spectreV1.Info()["StartFC"] = curfc;
     167          spectreV2.Info()["StartFC"] = curfc;
     168          visiV12.Info()["StartFC"] = curfc;
     169          spectreV1.Info()["StartTT"] = curtt;
     170          spectreV2.Info()["StartTT"] = curtt;
     171          visiV12.Info()["StartTT"] = curtt;
     172        }
    156173        nzm++;   
     174/*----DELETE
    157175        if (nmnt==0)  { xnt[0]=paq.FrameCounter();  xnt[1]=paq.TimeTag(); }
    158176        for(sa_size_t j=2700; j<2800; j++) {
     
    163181        }
    164182        nmnt++;   
     183----*/
    165184        totnbytesproc += paq.DataSize();
    166185        totnbytesout += (2*sizeof(complex<r_4>)*cfour1.Size());
    167186
    168187      } // Fin de boucle sur les paquets d'une zone
     188
     189/*---- DELETE
    169190      if (nmnt>0)  {
    170191        double fnorm = (double)nmnt*(2800-2700);
     
    177198        nt.Fill(xnt);
    178199      }
     200----*/
    179201      if ((nzm >= nmean_) || ((kmz==(nmax_-1))&&(nzm>1))) {
    180202        spectreV1 /= (r_4)(nzm);
     
    186208        spectreV2.Info()["NPaqMoy"] = nzm;
    187209        visiV12.Info()["NPaqMoy"] = nzm;
     210        spectreV1.Info()["EndFC"] = curfc;
     211        spectreV2.Info()["EndFC"] = curfc;
     212        visiV12.Info()["EndFC"] = curfc;
     213        spectreV1.Info()["EndTT"] = curtt;
     214        spectreV2.Info()["EndTT"] = curtt;
     215        visiV12.Info()["EndTT"] = curtt;
    188216            {
    189217        sprintf(fname,"%s_%d.ppf",path_.c_str(),(int)ifile);
     
    214242  cout << " ------------  BRProcARaw2C::run() END " << card2name_(card_)
    215243       << " ------------ " << endl;
    216   {     
     244/*---- DELETE
     245  {
     246  nt.Info()["FirstTT"]=firsttt;     
    217247  cout << nt;
    218248  sprintf(fname,"%s_nt.ppf",path_.c_str());
     
    220250  po << PPFNameTag("ntv12") << nt;
    221251  cout << " BRProcARaw2C::run() created NTuple file " << fname << card2name_(card_) << endl;
    222   }     
     252  }
     253---- */
    223254  ts.SetNow();
    224255  tm.SplitQ();
     
    320351         << " *8="  << szfour*8 << endl;
    321352
     353    DataTable dt;
     354    dt.AddLongColumn("fc1");
     355    dt.AddLongColumn("fc2");
     356    dt.AddLongColumn("tt1");
     357    dt.AddLongColumn("tt2");
     358    DataTableRow dtr = dt.EmptyRow();
     359
    322360    uint_4 nzm = 0;
    323361    uint_4 totnoksfc = 0;
     
    325363    uint_4 totnpaq = 0;
    326364    uint_4 ifile = 0;
     365
     366    uint_4 curfc=0;
     367    uint_8 curtt=0;
     368    uint_4 curfc2=0;
     369    uint_8 curtt2=0;
     370    uint_8 firsttt=0;
     371    uint_8 firsttt2=0;
     372    bool fgfirst=true;
    327373    for (uint_4 kmz=0; kmz<nmax_; kmz++) {
    328374      uint_4 noksfc = 0;
     
    377423        // Les deux framecounters sont identiques ...
    378424        noksfc++;
     425        curfc=paq1.FrameCounter();
     426        curfc2=paq2.FrameCounter();
     427        if (fgfirst) {
     428          firsttt=paq1.TimeTag();  firsttt=paq2.TimeTag();
     429          cout << " BRProcBRaw4C()/Info First FC="<<curfc<<" , "<<curfc2<<" -> TT="
     430               << firsttt<<" , "<<firsttt2 <<endl;
     431          fgfirst=false;
     432        }
     433        curtt=paq1.TimeTag()-firsttt;
     434        curtt2=paq2.TimeTag()-firsttt2;
     435        dtr[0]=curfc;  dtr[1]=curtt;
     436        dtr[2]=curfc2;  dtr[3]=curtt2;
     437        dt.AddRow(dtr);
     438
    379439        complex<r_4>* zp1 = (complex<r_4>*)(procbuff1+i1*procpaqsz);
    380440        complex<r_4>* zp2 = (complex<r_4>*)(procbuff1+i1*procpaqsz+procpaqsz/2);
     
    387447          visiV24(j)+=zp2[j]*conj(zp4[j]);
    388448        }
     449        if (nzm==0) {
     450          visiV13.Info()["StartFC"] = curfc;
     451          visiV14.Info()["StartFC"] = curfc;
     452          visiV23.Info()["StartFC"] = curfc;
     453          visiV24.Info()["StartFC"] = curfc;
     454          visiV13.Info()["StartTT"] = curtt;
     455          visiV14.Info()["StartTT"] = curtt;
     456          visiV23.Info()["StartTT"] = curtt;
     457          visiV24.Info()["StartTT"] = curtt;
     458        }
    389459        nzm++;  i1++; i2++;
    390460        totnbytesproc += 2*paq1.DataSize();
     
    402472        visiV23.Info()["NPaqMoy"] = nzm;
    403473        visiV24.Info()["NPaqMoy"] = nzm;
     474        visiV13.Info()["EndFC"] = curfc;
     475        visiV14.Info()["EndFC"] = curfc;
     476        visiV23.Info()["EndFC"] = curfc;
     477        visiV24.Info()["EndFC"] = curfc;
     478        visiV13.Info()["EndTT"] = curtt;
     479        visiV14.Info()["EndTT"] = curtt;
     480        visiV23.Info()["EndTT"] = curtt;
     481        visiV24.Info()["EndTT"] = curtt;
    404482        char fname[512];
    405483        {
     
    427505    }  // Fin de boucle sur les zones a traiter
    428506    cout << " ------------------  BRProcBRaw4C::run() END ----------------- " << endl;
     507    {     
     508    dt.Info()["FirstTT1"]=firsttt;     
     509    dt.Info()["FirstTT2"]=firsttt2;     
     510    cout << dt;
     511    char fname[512];
     512    sprintf(fname,"%s_fctt.ppf",path_.c_str());
     513    POutPersist po(fname);
     514    po << PPFNameTag("ttfc") << dt;
     515    cout << " BRProcBRaw4C::run() created TimeTag/FrameCounter file " << fname  << endl;
     516    }     
    429517    ts.SetNow();
    430518    tm.SplitQ();
Note: See TracChangeset for help on using the changeset viewer.