//#define RHDB
#ifndef _Analog
#define _Analog

//////////////////////////////////////////////////////////////////////////
//                                                                      //
// Meassure                                                             //
//                                                                      //
// Managing Measured WaveForms                                         //
//                                                                      //
//////////////////////////////////////////////////////////////////////////

#include "TObject.h"
#include "TH1.h"
#include "TMath.h"
#include "TArray.h"
#include "TProfile.h"
#include "TArrayI.h"
#include "TArrayF.h"
#include "TGraph.h"
#include <stdio.h>
#include <stdlib.h>
#include "TH1F.h"
#include "TH2F.h"
#include "TClonesArray.h"
#include "TPaveText.h"
#include "TText.h"

/*------------------------------------------------------------------------
 * Types
 *------------------------------------------------------------------------*/
typedef float CM[2];

class Region 
{
 public:
   int ifi,ila;       /* 1st and last channels of region               */
   Region(){};
   ~Region(){};
}; 

class CHannel {
 public:
   int   id;      /* id of the channel        */
   int   excl;    /* =1 for excluded channels */
   int   clus;    /* cluster no. it belongs   */
   float raw;     /* raw data                 */
   float pd,sd;   /* pedestal and noise       */
   float sn;      /* significance             */
   float signal;  /* signal corrected         */
   float pd0,sd0;

   CHannel(){};
   ~CHannel(){};
   void Print();
};
class CLUster 
{
 public:
   int  ns;       /* no. of strips in cluster */
   CHannel *fst,  /* Fisrt strip pf cluster   */
           *hig;  /* strip with highest pulse */
   float   sn;    /* s/n of cluster           */
   float   sig;   /* total signal in cluster  */
   float   eta;   /* eta                      */
   CLUster (){};
   ~CLUster (){};  
   void Print();
};

typedef CLUster *lCLUster;


class  Analog : public TObject {

private:

size_t lrecl;                     /* File record length     */
int   pfile;                      /* Pointer to data file   */
FILE *in;
char *ftit;                       /* .ini file  as argument */
double *avnoise;
void  prepare_file(FILE *,off_t,int);

 public:
 TH1F *his[200];
 TProfile *prof[10];
 TH2F *his2[5];
 CHannel *chan;
 TH1F *chis[10];

int   Nevt;
char  ffile[100];     /* File with data                                */
int   NNchan;         /* no. of channels                               */
int   nupdate;        /* pdestal update rate                           */
float COMhard,        /* hard cut un s/n for CMS & pedestal calc.      */
      COMthres,       /* Common mode threshold                         */
      CLUSthr[3];     /* Seed, neighbourgs and cluster cut             */
int   mxclust,        /* max. no. of clusters in the event             */
      mxstrip;        /* max. no. of strips per cluster                */
int   Nchan,          /* Number of channels per record in the file     */
      Nreg,           /* Number of regions to be analyzed separately   */
      Nexcl;          /* Number of channels excluded                   */
float ssign;          /* Expected sign of the signal                   */
Region *reg;
int    *excld;
int      skip;
int      sample;

  Analog(char *,int=128);
  ~Analog();
  //Analysis functions 
  void pedes(int,int=0,int=0);
  int GetEvent(void *, unsigned int, int=-1);
  void CommonMode(CM *);
  void ana(int=0,int=0,int=1);
  int Cluster(int ns, CHannel *, float, float, float,CLUster *, int *);
  void  Book_histograms(int); 
  void  Reset_histograms(int=0);
  void GetParams();
  //Parameters function
  void SetRegions(int,int *);
  void SetExclude(int,int *);
  void GetPedestals();
  void DrawEvent(int);
  inline void operator()(int x) { DrawEvent(x); };
  ClassDef(Analog,2) 
};


#endif


















ROOT page - Class index - Top of the page

This page has been automatically generated. If you have any comments or suggestions about the page layout send a mail to ROOT support, or contact the developers with any questions or problems regarding ROOT.