00001 00002 // $Id: FiltSGateModule.h,v 1.7 2005/01/21 22:40:40 rhatcher Exp $ 00003 // 00004 // A filter module that looks in the DaqMonitor stream for 00005 // RawVtmTimeInfoBlocks, extracts the SGate time info and then 00006 // decides to accept/reject DaqSnarl records. 00007 // 00008 // rhatcher@fnal.gov, shanahan@fnal.gov 00010 #ifndef FILTSGATEMODULE_H 00011 #define FILTSGATEMODULE_H 00012 #include "JobControl/JobCModule.h" 00013 #include "Registry/Registry.h" 00014 #include "TCanvas.h" // ROOT include file for drawing canvases 00015 #include "TH1.h" // ROOT include file for 1d histograms 00016 #include "TNtuple.h" // ROOT include file for ntuple class 00017 00018 #include <vector> 00019 00020 class MomNavigator; // Forward declaration of this class 00021 class RawDigitDataBlock; // Forward declaration of this class 00022 class RawVtmTimeInfoBlock; // Forward declaration of this class 00023 00024 class FiltSGateModule : public JobCModule 00025 { 00026 public: 00027 FiltSGateModule(); // Class constructor 00028 00029 // JobCModule methods implemented by this module 00030 JobCResult Ana(const MomNavigator *mom); // Analysis method 00031 const Registry& DefaultConfig() const; // Default configuration 00032 void Config(const Registry& r); // Configure given registry 00033 void Report(); // Print help information 00034 void EndJob(); // End of job method 00035 00036 // Methods specific to the analysis this module does 00037 void ProcessVtmTimeInfoBlks(std::vector<const RawVtmTimeInfoBlock*>& vtmBlks); 00038 bool ProcessDigitDataBlks(std::vector<const RawDigitDataBlock*>& digitBlks, Int_t tfnum); 00039 Double_t near_tdc_sec(Int_t tdc); 00040 void DrawHistgrams(); 00041 00042 private: 00043 00044 Int_t fTicksPerSec; // RF clock (average) 00045 Int_t fQieErrorMask; // Skip digits with any of these error bits 00046 Int_t fPedSubAdcMin; // Minimum above pedestal subtracted ADC 00047 Int_t fCheckTimeFrame; // Check that the snarl TF is consistent 00048 Double_t fTminWindow; // tmin (usec) of SGate window 00049 Double_t fTmaxWindow; // tmax (usec) of SGate window 00050 Int_t fTriggerMaskAllow; // Always allow any snarl with any of these bits 00051 00052 Int_t fDrawHists; // Draw histograms? 0=no,-1=always,+N=every N TF 00053 bool fWriteHists; // Write histograms out? 00054 bool fKeepCanvas; // Delete canvas at module dtor? 00055 00056 TCanvas* fCanvas; // Canvas for displaying histograms 00057 TH1I fLastRFClockHist; // lastRFClock from VtmTimeInfo block 00058 TH1I fSpillTimeRFHist; // SpillTimeRF from VtmTimeInfo block 00059 TH1D fAdcVsTimeRFHist1; // Adcs vs. Tdc-TimeRF 00060 Double_t fHist1TScale; // Time scale factor for hist1 00061 TH1D fSnarlVsTimeRFHist;// Tdc-TimeRF one entry per snarl 00062 TH1D fAdcVsTimeRFHist2; // Adcs vs. Tdc-TimeRF 00063 Double_t fHist2TScale; // Time scale factor for hist2 00064 TNtuple fNtuple; // Ntuple of event summary data 00065 00066 Int_t fLatestRun; // Current record's Run 00067 Int_t fLatestSubRun; // Current record's SubRun 00068 Int_t fLatestSpillTimeTF; // TimeFrame value from VtmTimeInfo block(s) 00069 Int_t fLatestSpillTimeRF; // value from the VtmTimeInfo block(s) 00070 Int_t fLastRFClock; // Vtm LastTimeStamp (ie. tick/TF) 00071 Int_t fLastRFClockPrevTF; // same for previous TF 00072 Int_t fLatchedSpillTimeTF; // TimeFrame when SpillTimeRF was latched 00073 00074 }; 00075 #endif // FILTSGATEMODULE_H
1.3.9.1