| 1 | // This may look like C code, but it is really -*- C++ -*-
 | 
|---|
| 2 | #ifndef KTOIBAD_H
 | 
|---|
| 3 | #define KTOIBAD_H
 | 
|---|
| 4 | 
 | 
|---|
| 5 | #include "toiprocessor.h"
 | 
|---|
| 6 | #include "flagtoidef.h"
 | 
|---|
| 7 | #include "slinparbuff.h"
 | 
|---|
| 8 | 
 | 
|---|
| 9 | //////////////////////////////////////////////////////
 | 
|---|
| 10 | //-- Pour flagguer les samples hors dynamique
 | 
|---|
| 11 | //   toi BoloIn ---> |FlagOutOfRange| ---> toi BoloOut
 | 
|---|
| 12 | //////////////////////////////////////////////////////
 | 
|---|
| 13 | class FlagOutOfRange : public TOIProcessor {
 | 
|---|
| 14 | public:
 | 
|---|
| 15 |   FlagOutOfRange(r_8 vmin,r_8 vmax,uint_8 flag=FlgToiOut);
 | 
|---|
| 16 |   virtual ~FlagOutOfRange();
 | 
|---|
| 17 | 
 | 
|---|
| 18 |   virtual void  init(void);
 | 
|---|
| 19 |   virtual void  run(void);
 | 
|---|
| 20 | 
 | 
|---|
| 21 |   //! Print
 | 
|---|
| 22 |   void Print(::ostream & os);
 | 
|---|
| 23 |   inline void Print(void) {Print(cout);}
 | 
|---|
| 24 | 
 | 
|---|
| 25 | protected:
 | 
|---|
| 26 |   uint_8 flgBad;
 | 
|---|
| 27 |   r_8 VMin,VMax;
 | 
|---|
| 28 | };
 | 
|---|
| 29 | 
 | 
|---|
| 30 | //////////////////////////////////////////////////////
 | 
|---|
| 31 | //-- Pour rechercher les glitches
 | 
|---|
| 32 | //   toi BoloIn ---> |FlagGlitch| ---> toi BoloOut
 | 
|---|
| 33 | //////////////////////////////////////////////////////
 | 
|---|
| 34 | class FlagGlitch : public TOIProcessor {
 | 
|---|
| 35 | public:
 | 
|---|
| 36 |   FlagGlitch(uint_4 lg,uint_4 lm,r_8 nsg);
 | 
|---|
| 37 |   virtual ~FlagGlitch();
 | 
|---|
| 38 | 
 | 
|---|
| 39 |   virtual void  init(void);
 | 
|---|
| 40 |   virtual void  run(void);
 | 
|---|
| 41 | 
 | 
|---|
| 42 |   //! Ne pas traiter les sample deja flaggues par la valeur flag
 | 
|---|
| 43 |   inline void DoNotLookAt(uint_8 flag=FlgToiAll) {flgNotLookAt = flag;}
 | 
|---|
| 44 |   //! Flagguer les glitches avec la valeur flag
 | 
|---|
| 45 |   inline void SetFlag(uint_8 flag=FlgToiSpike) {flgGlitch = flag;}
 | 
|---|
| 46 |   //! Frequency to update SLinParBuff buffer
 | 
|---|
| 47 |   inline void SetBuffUpd(uint_4 bupd=1000) {BuffUpdate = bupd;}
 | 
|---|
| 48 |   //! Print
 | 
|---|
| 49 |   void Print(::ostream & os);
 | 
|---|
| 50 |   inline void Print(void) {Print(cout);}
 | 
|---|
| 51 |   //! Debugging print lp=ab
 | 
|---|
| 52 |   //    a>0 ntuple entre snb,sne
 | 
|---|
| 53 |   //    b>0 print general
 | 
|---|
| 54 |   //     >1 print debug entre snb,sne
 | 
|---|
| 55 |   inline void SetDebug(int_4 lp,int_4 snb,int_4 sne)
 | 
|---|
| 56 |               {mLP=(lp>=0)?lp:0; mLPsnb=snb; mLPsne=sne;}
 | 
|---|
| 57 | 
 | 
|---|
| 58 | protected:
 | 
|---|
| 59 |   int_4 mLP,mLPsnb,mLPsne;
 | 
|---|
| 60 |   uint_8 flgNotLookAt,flgGlitch;
 | 
|---|
| 61 |   r_8 NSCut;
 | 
|---|
| 62 |   uint_4 BuffUpdate;
 | 
|---|
| 63 |   uint_4 LGlitch,LSide;
 | 
|---|
| 64 | };
 | 
|---|
| 65 | 
 | 
|---|
| 66 | //////////////////////////////////////////////////////
 | 
|---|
| 67 | //-- Pour flagguer les samples autour de samples deja flaggues
 | 
|---|
| 68 | //   Permet aussi de flagguer les samples ayant de mauvaises valeurs.
 | 
|---|
| 69 | //   toi BoloIn ---> |FlagAroundFlag| ---> toi BoloOut
 | 
|---|
| 70 | //////////////////////////////////////////////////////
 | 
|---|
| 71 | class FlagAroundFlag : public TOIProcessor {
 | 
|---|
| 72 | public:
 | 
|---|
| 73 |   FlagAroundFlag(uint_4 lm,uint_8 flgs=FlgToiAll);
 | 
|---|
| 74 |   virtual ~FlagAroundFlag();
 | 
|---|
| 75 | 
 | 
|---|
| 76 |   virtual void  init(void);
 | 
|---|
| 77 |   virtual void  run(void);
 | 
|---|
| 78 | 
 | 
|---|
| 79 |   //! Flagguer les samples avec la valeur flag
 | 
|---|
| 80 |   inline void SetFlag(uint_8 flag=FlgToiAround) {flgAround = flag;}
 | 
|---|
| 81 |   //! Flagguer autour des samples ayant la valeur flag
 | 
|---|
| 82 |   inline void SetFlagAroundFlag(uint_8 flag=FlgToiAll) {flgSample = flag;}
 | 
|---|
| 83 |   //! Flagguer les samples hors limite
 | 
|---|
| 84 |   inline void SetLimits(r_8 vmin=1.,r_8 vmax=-1.,uint_8 flag=FlgToiOut)
 | 
|---|
| 85 |               {VMin=vmin; VMax=vmax; flgBad = flag;}
 | 
|---|
| 86 |   //! Print
 | 
|---|
| 87 |   void Print(::ostream & os);
 | 
|---|
| 88 |   inline void Print(void) {Print(cout);}
 | 
|---|
| 89 | 
 | 
|---|
| 90 | protected:
 | 
|---|
| 91 |   uint_8 flgSample,flgAround,flgBad;
 | 
|---|
| 92 |   uint_4 LSide;
 | 
|---|
| 93 |   r_8 VMin,VMax;
 | 
|---|
| 94 | };
 | 
|---|
| 95 | 
 | 
|---|
| 96 | #endif
 | 
|---|