GTS/TFndGtsMon.h

00001 // @(#)fROOT/GTS:$Name:  $:$Id: TFndGtsMon.h,v 1.15 2007/09/05 09:44:53 Diego_Faso Exp $
00002 // Revision Author: Diego Faso <mailto:faso@to.infn.it>, 2005/06/24
00003 // Original Author: P. Cerello <mailto:cerello@to.infn.it>, 2001
00004 
00005 #ifndef FROOT_TFndGtsMon
00006 #define FROOT_TFndGtsMon
00007 
00009 //                                          //
00010 //               TFndGtsMon                 //
00011 //                                          //
00012 //  Consumer histograms and shared memories //          
00013 //  Don't create objects of this class if   //
00014 //  you use the TFndGtsMonFrame class,      //
00015 //  otherwise you would open twice the file //
00016 //                                          //
00018 
00019 #include "FROOT.h"
00020 
00021 #include "TFile.h"
00022 #ifdef _FND_ONL_USE_MAP_FILES_
00023 #include "TMapFile.h"
00024 #endif
00025 #include "TH1F.h"
00026 #include "TH2.h"
00027 
00028 #include "TObject.h"
00029 
00030 #include "TFndHdt.h"
00031 
00032 class TFndGtsMon : public TObject {
00033   
00034  protected:
00035   Int_t    shmflg;                     // Shared Memory flag
00036   TFile    *fout;
00037   TFile    *fgts;                      // Gts histogram file
00038 #if defined _FND_ONL_USE_MAP_FILES_
00039   TMapFile *fGtsMapFile;
00040 #elif defined _FND_ONL_USE_SHARED_FILES_
00041   TFile *fGtsMapFile;
00042 #endif
00043   // --- histograms 
00044   
00045   Bool_t fMustRecoverHistos; // true if a recovery must be performed after a break
00046 
00047   TString fSharedMemName;
00048   TString fSharedFileName;
00049 
00050   TH1F *fHMaluPattern; //-> TOFONE pattern (from MALUs)
00051   TH1F *fHMaluMult;    //-> TOFONE multiplicity (from MALUs)
00052   TH1F *fHPU_cont[K_N_GTS_P_UNITS]; //-> Pattern Units histograms
00053   TH1F *fHPU_mult[K_N_GTS_P_UNITS]; //-> Pattern Units histograms
00054   TH1F *fHTrigSel[K_N_GTS_SELECTORS]; //-> Pattern Units histograms
00055   
00056   // --- histograms from TOF will follow
00057   TH1F *fHTofinoLow_MT_Patt;  // TOFINO MT pattern (low thresholds)
00058   TH1F *fHTofinoHigh_MT_Patt; // TOFINO MT pattern (high thresholds)
00059 
00060   TH1F *fHTofinoLow_MT_Mult;  // TOFINO MT multiplicity (low thresholds)
00061   TH1F *fHTofinoHigh_MT_Mult; // TOFINO MT multiplicity (high thresholds)
00062 
00063   TH1F *fHTofone_MT_Patt;  // TOFONE MT pattern
00064   TH1F *fHTofone_MT_Mult;  // TOFONE MT pattern
00065 
00066   /*   TClonesArray *fHistoNames;     //! Container for histogram names   */
00067   /*   static TClonesArray *fgHisNam; */
00068 
00069 
00070  private:
00071   void Init(); // common initialization (used by all ctors)  
00072   void InitHistos(); // try to recover histograms from shared file (if still available...)
00073   void OpenSharedFiles(const TString &fmode); // will handle shared memories/files creation
00074 
00075  public:
00076 
00077   TFndGtsMon(const TString &fmode);          // Constructor
00078   TFndGtsMon(TString *filename);          // Constructor from ROOT filename
00079   TFndGtsMon();                           // Constructor for Consumer
00080   ~TFndGtsMon();                          // Destructor
00081   void Fill();                            // Fill Monitor histograms
00082   void Fill(TFndTrig *);                  // Fill Monitor histograms
00083   void Fill(const TClonesArray &TofHits); // Fill Monitor histograms (from TOF hits)
00084   void Update(Bool_t purge=kTRUE);
00085   void ResetHistos();
00086   void WriteToFile(TString filename=0,Bool_t IsShared = kFALSE);  // Write histograms to file
00087   void Add(TFndGtsMon *gtsmon); // merge histograms
00088   
00089   /*   TClonesArray *GetHistoNames() { return fHistoNames; } */
00090 
00091   ClassDef(TFndGtsMon,1)      // The GTS monitor
00092     };
00093 
00094 #endif // FROOT_TFndGtsMon
00095 
00096     

Generated on Tue Oct 16 15:40:46 2007 by  doxygen 1.5.2