Changeset 2004 in Sophya for trunk/ArchTOIPipe
- Timestamp:
- May 15, 2002, 6:03:43 PM (23 years ago)
- Location:
- trunk/ArchTOIPipe/ProcWSophya
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/ArchTOIPipe/ProcWSophya/simoffset.cc
r2000 r2004 16 16 17 17 SimpleOffsetEstimator::SimpleOffsetEstimator(int mwsz, int nptfit, int degpol) 18 : poly( degpol)18 : poly((degpol > 1)?degpol:1) 19 19 { 20 20 mWSz = (mwsz > 8) ? mwsz : 8; 21 21 nPtFit = (nptfit > degpol+2) ? nptfit : degpol+2; 22 degPol = (degpol > 1)?degpol:1; 22 23 totnscount = 0; 23 24 totnbblock = 0; … … 32 33 { 33 34 os << "\n ------------------------------------------------------ \n" 34 << " Simple Deglitcher::PrintStatus() - MeanWSize= " << mWSz << " NPtFit="35 << nPtFit << " DegPoly=" << poly.Degre() << endl;35 << " SimpleOffsetEstimator::PrintStatus() - MeanWSize= " << mWSz << " NPtFit=" 36 << nPtFit << " DegPoly=" << degPol << " poly.Degre()=" << poly.Degre() << endl; 36 37 TOIProcessor::PrintStatus(os); 37 38 os << " ProcessedSampleCount=" << ProcessedSampleCount() << endl; … … 115 116 116 117 int nbblkok = 0; 117 118 119 bool fginiXYdone = false; 120 118 121 double sn0 = 0.; 119 122 double nok = 0.; … … 140 143 nok++; 141 144 } 142 if (nbblkok == 0) { 145 146 sn0 = (double)(k+wsize/2); 147 148 if (!fginiXYdone) { 149 if (nok > 0.5) { 150 mean /= nok; 151 meanx /= nok; 152 sig = sig/nok-mean*mean; 153 } 143 154 X = RegularSequence(k+wsize*0.5, (double)wsize); 144 155 Y = mean; 145 156 YErr = (nok > 0.5) ? sqrt(mean) : 1.; 146 } 147 148 sn0 = (double)(k+wsize/2); 149 157 fginiXYdone = true; 158 } 159 150 160 if (nok > 3.) { 151 161 mean /= nok; … … 161 171 X0 = X; 162 172 X0 -= sn0; 163 poly.Fit(X,Y,YErr,poly.Degre(),errCoef); 164 173 if (nbblkok > poly.Degre()+1) 174 poly.Fit(X0,Y,YErr,degPol,errCoef); 175 else { 176 poly[0] = mean; 177 for(int jj=1; jj<=poly.Degre(); jj++) poly[jj] = 0.; 178 } 179 /* 180 if (nbblkok < 8) { 181 cout << "------ DBG-X " << nbblkok << "," << nok << " degre=" << poly.Degre() << endl; 182 cout << "DBG-A X0=" << X0 << endl; 183 cout << "DBG-A Y=" << Y << endl; 184 cout << "DBG-A YErr=" << YErr << endl; 185 cout << "DBG-A poly= " << poly << endl; 186 } 187 */ 165 188 166 189 // Calcul des valeurs d'offset en sortie -
trunk/ArchTOIPipe/ProcWSophya/simoffset.h
r2000 r2004 43 43 int mWSz; 44 44 int nPtFit; 45 int degPol; 45 46 Poly poly; 46 47 bool ntpoly;
Note:
See TracChangeset
for help on using the changeset viewer.