#include "machdefs.h" #include "toimanager.h" #include "pexceptions.h" #include "ntuple.h" #include "ktoibad.h" //////////////////////////////////////////////////////////////////////// // Flag des sample hors dynamique //////////////////////////////////////////////////////////////////////// FlagOutOfRange::FlagOutOfRange(r_8 vmin,r_8 vmax,uint_8 flag) : VMin(vmin), VMax(vmax), flgBad(flag) { if(VMaxsne) { cout<<"FlagOutOfRange::run() - Bad sample interval"<VMax) { // Pixel out of range nbad++; fgbolo |= flgBad; } putData(0,sn,bolo,fgbolo); } cout<<"FlagOutOfRange::run(): Fin de boucle: nbad="<sne) { cout<<"FlagGlitch::run() - Bad sample interval"<0) for(int_4 sn=snb;snPush((r_8)sn,bolog); } for(int_4 sn=snb;sn<=sne;sn++) { int_4 lp = (mLPsnb<=sn && sn<=mLPsne) ? mLP%10: 0; r_8 bolog; uint_8 fgbolog=0; getData(0,sn,bolog,fgbolog); if(fgbolog & flgNotLookAt) { putData(0,sn,bolog,fgbolog); continue; } // i // <---lm---><--lg--><---lm---> // | c=0 | | c=1 | // ideb | | ifin // ifin ideb r_8 bolo; uint_8 fgbolo=0; int_4 ifill[2] = {sn-lgs2-1,sn+lgs2+lm}; if(lp>1) printf(">>>> sn=%d v=(%f,%ld) ifill=[%d,%d]\n" ,sn,bolog,fgbolog,ifill[0],ifill[1]); if(ifill[0]Pop(); else Slpb[0]->Push((r_8)ifill[0],bolo); if((int_4)Slpb[0]->NPoints()Pop(); else Slpb[1]->Push((r_8)ifill[1],bolo); } else Slpb[1]->Pop(); if((int_4)Slpb[1]->NPoints()Compute(mean); slin[c] = Slpb[c]->Compute(a0,a1); ypred[c] = a0+a1*sn; if(lp>1) printf("... c=%d m=%f s=%f ypred=%f slin=%f (%d)\n" ,c,mean,s[c],ypred[c],slin[c],Slpb[c]->NPoints()); if(slin[c]<0. || s[c]<0.) { putData(0,sn,bolog,fgbolog); continue; } } if(intuple>0) { xnt_[0] = sn; xnt_[1] = bolog; xnt_[2] = s[0]; xnt_[3] = s[1]; xnt_[4] = slin[0]; xnt_[5] = slin[1]; xnt_[6] = ypred[0]; xnt_[7] = ypred[1]; nt_.Fill(xnt_); } // Si les predictions ne sont pas compatibles (sig), pas de deglitch r_8 yy = ypred[1]-ypred[0]; r_8 sy = nsg*sqrt(s[0]*s[0]+s[1]*s[1]); if(lp>1) printf("... yy=|%f| > sy=%f ???\n",yy,sy); if(fabs(yy) > sy) { putData(0,sn,bolog,fgbolog); continue; } // Si la valeur est entre les 2 predictions, pas de deglitch r_8 dp0 = ypred[0]; r_8 dp1 = ypred[1]; if(ypred[1]1) printf("... %f dans [%f,%f] ???\n",bolog,dp0,dp1); if(dp01) printf("... dp0=%f > %f et dp1=%f > %f ???\n" ,dp0,slin[0],dp1,slin[1]); if(dp0 < slin[0] || dp1 < slin[1]) { putData(0,sn,bolog,fgbolog); continue; } // C'est un glitch nflag++; fgbolog |= flgGlitch; if(lp>1) printf("......... Glitch en sn=%d ... %d glitches found\n",sn,nflag); putData(0,sn,bolog,fgbolog); } if(mLP) cout<<"FlagGlitch::run(): Fin de boucle: nflag="<0) { char *fileout_ = "flagglitch.ppf"; string tag_ = "nfg"; POutPersist pos_(fileout_); pos_.PutObject(nt_,tag_); } //--------------------------------------------------------- } catch (PException & exc) { cout<<"FlagGlitch: Catched Exception "<<(string)typeid(exc).name() <<"\n .... Msg= "<<---lm---> //////////////////////////////////////////////////////////////////////// FlagAroundFlag::FlagAroundFlag(uint_4 lm,uint_8 flgs) { // Mise en forme des arguments LSide = lm; SetFlag(); SetFlagAroundFlag(flgs); SetLimits(); } FlagAroundFlag::~FlagAroundFlag() { } void FlagAroundFlag::Print(::ostream & os) { os<<"FlagAroundFlag::Print" <<" LSide="<sne) { cout<<"FlagAroundFlag::run() - Bad sample interval"<VMax)) { // Pixel out of range nbad++; fgbolo |= flgBad; } else if(fgbolo&flgSample) { // Pixel flaggue flgSample nflag++; } else if(fgbolo&flgAround) { // Pixel deja flagge around? nflagalready++; } else if(LSide>0) { // Pixel a flagguer? int_4 ideb = sn-LSide, ifin = sn+LSide; for(int_4 i=ideb;i<=ifin;i++) { // Y a t-il un "mauvais" pixel autour? if(isne || i==sn) continue; r_8 b; uint_8 fg=0; getData(0,i,b,fg); if(fg&flgSample) {fgbolo |= flgAround; nflagged++; break;} } } putData(0,sn,bolo,fgbolo); } cout<<"FlagAroundFlag::run(): Fin de boucle: nflag="<