Changeset 3652 in Sophya for trunk/AddOn/TAcq/brproc.cc
- Timestamp:
- Jun 15, 2009, 10:57:12 AM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/AddOn/TAcq/brproc.cc
r3651 r3652 11 11 #include "ntuple.h" 12 12 #include "datatable.h" 13 #include "histos.h" 13 14 #include "fioarr.h" 14 15 #include "timestamp.h" … … 34 35 /* --Methode-- */ 35 36 BRProcARaw2C::BRProcARaw2C(RAcqMemZoneMgr& mem, string& path, uint_4 nmean, 36 uint_4 nmax, bool fg notrl, int card)37 uint_4 nmax, bool fghist, bool fgnotrl, int card) 37 38 : memgr(mem) 38 39 { … … 42 43 path_ = path; 43 44 fgnotrl_ = fgnotrl; 45 fghist_ = fghist; 44 46 card_ = card; 45 47 if (pmutfftw==NULL) pmutfftw=new ZMutex; … … 90 92 double ms1,ms2,ms12,ms12re,ms12im,ms12phi; 91 93 ----*/ 94 // Time sample histograms 95 Histo h1(-0.5, 255.5, 256); 96 Histo h2(-0.5, 255.5, 256); 92 97 // Initialisation pour calcul FFT 93 98 TVector< complex<r_4> > cfour1; // composant TF … … 152 157 curtt=paq.TimeTag()-firsttt; 153 158 // Traitement voie 1 154 for(sa_size_t j=0; j<vx.Size(); j++) 155 vx(j) = (r_4)(*(paq.Data1()+j))-127.5; 159 if (fghist_) { 160 for(sa_size_t j=0; j<vx.Size(); j++) { 161 r_4 vts=(r_4)(*(paq.Data1()+j)); 162 h1.Add((r_8)vts); 163 vx(j) = vts-127.5; 164 } 165 } 166 else { 167 for(sa_size_t j=0; j<vx.Size(); j++) 168 vx(j) = (r_4)(*(paq.Data1()+j))-127.5; 169 } 156 170 // fftwf_complex* coeff1 = (fftwf_complex*)(procbuff+i*procpaqsz); 157 171 fftwf_execute(plan1); … … 162 176 memcpy(procbuff+i*procpaqsz, cfour1.Data(), sizeof(complex<r_4>)*cfour1.Size()); 163 177 // Traitement voie 2 164 for(sa_size_t j=0; j<vx.Size(); j++) 165 vx(j) = (r_4)(*(paq.Data2()+j))-127.5; 166 178 if (fghist_) { 179 for(sa_size_t j=0; j<vx.Size(); j++) { 180 r_4 vts=(r_4)(*(paq.Data2()+j)); 181 h2.Add((r_8)vts); 182 vx(j) = vts-127.5; 183 } 184 } 185 else { 186 for(sa_size_t j=0; j<vx.Size(); j++) 187 vx(j) = (r_4)(*(paq.Data2()+j))-127.5; 188 } 167 189 fftwf_execute(plan2); 168 190 for(sa_size_t j=0; j<spectreV2.Size(); j++) … … 225 247 spectreV2.Info()["EndTT"] = curtt; 226 248 visiV12.Info()["EndTT"] = curtt; 227 249 { 228 250 sprintf(fname,"%s_%d.ppf",path_.c_str(),(int)ifile); 229 251 POutPersist po(fname); … … 231 253 string tag2="specV2"; 232 254 string tag12="visiV12"; 255 string tagh1="tshV1"; 256 string tagh2="tshV2"; 233 257 if (card_==2) { 234 258 tag1 = "specV3"; 235 259 tag2 = "specV4"; 260 tagh1 = "tshV1"; 261 tagh2 = "tshV2"; 236 262 tag12="visiV34"; 237 263 } … … 239 265 po << PPFNameTag(tag2) << spectreV2; 240 266 po << PPFNameTag(tag12) << visiV12; 241 } 267 if (fghist_) { 268 po << PPFNameTag(tagh1) << h1; 269 po << PPFNameTag(tagh2) << h2; 270 } 271 } 242 272 spectreV1 = (r_4)(0.); 243 273 spectreV2 = (r_4)(0.); 244 274 visiV12 = complex<r_4>(0., 0.); 275 if (fghist_) { 276 h1.Zero(); 277 h2.Zero(); 278 } 245 279 nzm = 0; ifile++; 246 280 // ts.SetNow();
Note:
See TracChangeset
for help on using the changeset viewer.