#ifndef PisteEtoileSeen #define PisteEtoileSeen #include "sstetoile.h" #include "transfelec.h" #include "formepulse.h" /* // D. Yvon, CE Saclay, DAPNIA/SPP, 08/99 // Analyse the Photodiode track to find star pulse. // Caracterise the time and amplitude of the star Pulse We analyse a set of 48 samples. The 32 first are considered as prepulse sample. On the prepulse: We compute baseline and substract it. Then compute slope due to pile up and substract it Then compute Vrms. Look for trigger If triggered : Look for maximum. Compute Full width half maximum Fit a paroabole on max of the pulse return max fitte and time of max fitte if analfine Iterate time fit on pulse area and compute amplitude and X2 Find best X2. Fit parabole arond the minimum of X2 to get the true minimum. Build SSTStar. That's it. When done push the track eigth samples forward and iterate analysis. */ class FormePulse; #define PEtoileDebug #define PhDiodTabLong (48) #define Prepulselong (32) #define Pousslong (8) // Parametrisation du Trigger #define SeuilGachette (6.) // On déclenche à SeuilGachette sigmas #define SSTLsbVal (10./4096.) // Parametrisation Analyse Fine #define TFExcursion (15.e-3) // Secondes: Excursion du fit autour de MaxIndex #define TPasTFit (1.5e-3) // Secondes: // Secondes: class PisteEtoile { public: PisteEtoile(short NoPhotDiod=0); PisteEtoile (PisteEtoile const & x); ~PisteEtoile(); PisteEtoile& operator = (PisteEtoile const & x); void fill(int* pData, int inDebutPiste=0, int nData=PhDiodTabLong); void push(int* pData, int nbdata=Pousslong); //"Pousse" les données dans PhDiodArray de nbdata bool traque() ; // Traque l'etoile. bool trig(); //Trig sur les donnees? Si Oui declenche une analyse complète void demasque(); // Met en Oeuvre un fit de forme pour determiner le temps et l'amplitude. bool isAlive() { return DiodVivante;} void kill() { DiodVivante=false;} void restore() { DiodVivante=true;} SSTEtoile DonneEtoile() {return LastEtoile;} //Retourne la dernière Etoile détectee inline int SSTLargEvtIndex(); inline int SSTLongIndexEvt(); static TransFuncElec Trapani; static FormePulse FPulse; protected: double PasTempsEch; //Secondes // Idendificateur, repères et gestion short NoPhDiod; long indexDebutPiste; // A actualiser dans push() et Fill() bool DiodVivante; // Si false, On ne fait rien // Stocke donnees brutes et traitees int* PhDiodArray; double* PhDiodPiste; // Derniere Etoile Vue SSTEtoile LastEtoile; // Variables d'analyse bool gachette; double Vrms; short MaxIndex; // Index de l'amplitude Max en analyse Trig() double TIndex; double AmplMax; double AmplRes; int widthHalfMax; int SSTnbPasFit; // double integ; // Variables Resultat d'analyse fine double AmplFin; double Tfin; double X2Min; bool SuccesAFine; // Utilitaires de calcul analyse fine double AmplNorm; // Normalisation d'amplitude sur FPulse dans l'ajustement iteratif double *pFitArray0; // Pointeur origine du tableau d'echantillon sur lequel sera calculé le fit double *pFitArray; // Pointeur courant du tableau d'echantillon double* Ampl; //Tableau des amplitudes calculées double* X2; //Tableau des X2 calculés }; #endif