00001 #ifndef TROOTCONVPROC_H 00002 #define TROOTCONVPROC_H 00003 00004 #include "TRocProc.h" 00005 #include "TRootConverterEvent.h" 00006 #include "TRootConverterParam.h" 00007 #include "TRocParam.h" 00008 #include "../RPC/TRPCParam.h" 00009 00010 // 2nd level events 00011 #include "TFiberHodEvent.h" 00012 #include "TBeamMonitorEvent.h" 00013 #include "../RPC/TRPCEvent.h" 00014 00015 // 1st level events 00016 #include "TMbsCrateEvent.h" 00017 #include "TTriglogEvent.h" 00018 #include "TEpicsEvent.h" 00019 #include "TCBMBeamtimeProc.h" 00020 00021 #include "TFile.h" 00022 #include "TTree.h" 00023 #include "TH3.h" 00024 00025 class TFiberHodEvent; 00026 class TRPCEvent; 00027 class TGetHitUnpacked; 00028 00029 class TGo4EventElement; 00030 class TGo4MbsSubEvent; 00031 00032 class TMbsCrateEvent; 00033 class TTriglogEvent; 00034 class TEpicsEvent; 00035 00036 class TRootConverterProc : public TCBMBeamtimeProc { 00037 public: 00038 00039 TRootConverterProc(const char* name = 0); 00040 virtual ~TRootConverterProc(); 00041 00042 00043 virtual void InitEvent(TGo4EventElement*); 00044 00045 /* this is the main processing function here*/ 00046 virtual void FinalizeEvent(); 00047 00048 protected: 00049 Bool_t FillHitsFromRoc( ); 00050 00051 protected: 00052 TRootConverterParam * fRootConvPar; 00053 00054 TRPCParam * fRpcPar; 00055 TRocParam* fRocPar; 00056 00058 TFiberHodEvent * fHodoInputEvent; 00059 00061 TRPCEvent * fRpcInputEvent; 00062 00064 TMbsCrateEvent * fCrateInputEvent; 00065 00067 TTriglogEvent * fTriglogInputEvent; 00068 00070 TEpicsEvent * fEpicsInputEvent; 00071 00072 TRootConverterEvent * fOutputEvent; 00073 00074 TBeamMonitorEvent* fBeamEvent; 00075 00076 // Options readout from setup file or assigned from #define 00077 UInt_t fNumRocs; 00078 00079 // General counters 00080 UInt_t uNbEvents; 00081 UInt_t uFirstEventIndex; 00082 UInt_t uPrevEventIndex; 00083 00084 // Tree outputs 00085 TString sOutputFilename; 00086 TDirectory* oldDir; 00087 TFile* fRootOut; 00088 TTree* cleanTree; 00089 TGet4HitUnpacked hitForTree; 00090 vector< UInt_t > *vuHitNumber; 00091 vector< vector< UInt_t > > *vuTime; 00092 vector< vector< UInt_t > > *vuEpochTime; 00093 vector< vector< Int_t > > *viTot; 00094 00095 // Hodoscope 00096 TFiberHodEvent::hit_t hitHodoscope; 00097 00098 // EPICS Slow control 00099 UInt_t uSlowControlUpdateTime; 00100 vector< Double_t > vdPositiveHvI; 00101 vector< Double_t > vdPositiveHvU; 00102 vector< Double_t > vdNegativeHvI; 00103 vector< Double_t > vdNegativeHvU; 00104 00105 // Beam spot evolution histogramming 00106 UInt_t uFirstMbsTime; 00107 UInt_t uSpillStartMbsTime; 00108 UInt_t uLastMbsTime; 00109 00110 UInt_t uFirstMbsTimeMs; 00111 UInt_t uSpillStartMbsTimeMs; 00112 00113 // Histograms 00114 00115 // A bit of control, can be disabled 00116 TH1* hNbClustersPerEventHodoscope; 00117 TH3* hHit2DvsSeconds; 00118 TH3* hHit2DvsSecondsInSpill; 00119 TH3* hHit2DvsMilliSecondsInSpill; 00120 TH2* hHitXvsMilliSecondsInSpill; 00121 TH2* hHitYvsMilliSecondsInSpill; 00122 // Control over a flying pointer, not disableable 00123 UInt_t uEpicsTimeOrigin; 00124 TH1* hTimeEpicsUpdates; 00125 00126 private: 00127 00128 ClassDef(TRootConverterProc,1) 00129 }; 00130 00131 #endif //TROOTCONVPROC_H 00132