00001 #ifndef TSCALERSPROC_H 00002 #define TSCALERSPROC_H 00003 00004 #include "TGsiAug12Analysis.h" 00005 #include "TCBMBeamtimeProc.h" 00006 #include "MBSUNPACK/TMbsCrateEvent.h" 00007 #include "TTriglogEvent.h" 00008 #include "TScalersEvent.h" 00009 #include "TScalersParam.h" 00010 00011 #include "TGo4Picture.h" 00012 #include "TH1.h" 00013 #include "TH2.h" 00014 #include "TProfile.h" 00015 00016 class TGo4EventElement; 00017 class TGo4MbsSubEvent; 00018 00019 class TScalersProc : public TCBMBeamtimeProc { 00020 // friend class TCBMBeamtimeProc; 00021 public: 00022 TScalersProc(const char* name = 0); 00023 virtual ~TScalersProc(); 00024 00025 virtual void InitEvent(TGo4EventElement*); 00026 00027 virtual void FinalizeEvent(); 00028 private: 00029 00030 00031 protected: 00032 TScalersParam * fPar; 00033 TMbsCrateEvent * fCrateInputEvent; 00034 TTriglogEvent* fTriglogInputEvent; 00035 00036 TScalersEvent * fOutputEvent; 00037 00038 /* Triglog */ 00039 TProfile* fScalerRate[NUM_SCALERS][N_SCALERS_CH]; 00040 00041 /* ScalOrMu */ 00042 TProfile* fScalOrMuRate[SCALORMU_NB_SCAL]; 00043 00044 /* Detectors */ 00045 TProfile* fDetectorsRate[SCALORMU_NB_SCAL]; 00046 00047 /* Both */ 00048 #if SCALORMU_NB_SCAL != 16 00049 TH1 * fReferenceClockComparison; 00050 TH1 * fTriglogRefClockEvolution; 00051 TH1 * fScalOrMuRefClockEvolution; 00052 #endif 00053 00054 private: 00055 Int_t iScalerBinNb; 00056 Double_t dScalerBinMax; 00057 00058 TH1* fTriggerPattern; 00059 00060 /* Reference */ 00061 UInt_t uInitialMbsTime; 00062 UInt_t uInitialMilliTime; 00063 UInt_t uLastMbsTime; 00064 UInt_t uLastMbsMilliTime; 00065 #if SCALORMU_NB_SCAL == 16 00066 // Oct 12 00067 UInt_t uInitialScalerRef; // Initial scaler value of the reference clock 00068 Double_t dInitialCycleSize; // Time from initial value of reference clock to first cycle 00069 UInt_t uScalerRefCycle; 00070 UInt_t uLastScalerRefAll; 00071 #else 00072 // Starting Nov 12 00073 UInt_t uInitialScalerRefTriglog; // Initial scaler value of the reference clock in Triglog Board 00074 Double_t dInitialCycleSizeTriglog; // Time from initial value of reference clock in Triglog to first cycle 00075 UInt_t uScalerRefCycleTriglog; // Current number of cycles of the reference clock in Triglog Board 00076 UInt_t uLastScalerRefAllTriglog; // Scaler value of reference clock in Triglog Board in last event 00077 UInt_t uInitialScalerRefScalOrMu; // Initial scaler value of the reference clock in ScalOrMu Board 00078 Double_t dInitialCycleSizeScalOrMu; // Time from initial value of reference clock in ScalOrMu to first cycle 00079 UInt_t uScalerRefCycleScalOrMu; // Current number of cycles of the reference clock in ScalOrMu Board 00080 UInt_t uLastScalerRefAllScalOrMu; // Scaler value of reference clock in ScalOrMu Board in last event 00081 #endif 00082 00083 /* Triglog */ 00084 UInt_t uLastScalerTriglog[NUM_SCALERS][N_SCALERS_CH]; // Last scaler value of each Triglog channel 00085 UInt_t uLastScalerRefTriglog[NUM_SCALERS][N_SCALERS_CH];// Last reference scaler value for each Triglog channel 00086 Double_t dDtIntegralTriglog[NUM_SCALERS][N_SCALERS_CH]; // Time since last bin filling in rate histogram 00087 ULong64_t ulScalerIntegral[NUM_SCALERS][N_SCALERS_CH]; // Integrated scaler value of each Triglog channel since last bin filling in rate histogram 00088 00089 /* ScalOrMu */ 00090 UInt_t uLastScalerScalOrMu[SCALORMU_NB_SCAL]; // Last scaler value of each ScalOrMu channel 00091 UInt_t uLastScalerRefScalOrMu[SCALORMU_NB_SCAL]; // Last reference scaler value for each ScalOrMu channel 00092 Double_t dDtIntegralScalOrMu[SCALORMU_NB_SCAL]; // Time since last bin filling in rate histogram 00093 ULong64_t ulScalerScalOrMuIntegral[SCALORMU_NB_SCAL];// Integrated scaler value for each ScalOrMu channel since last bin filling in rate histogram 00094 00095 ClassDef(TScalersProc,1) 00096 }; 00097 00098 #endif //TSCALERSPROC_H 00099