Robert Michaels, rom@jlab.org, Jefferson
Lab Hall A, June 2003
// Constructors. // 'Bankgroup' is collection of scalers, "Left"(L-arm), "Right"(R-arm), "RCS" // "EvLeft" = event stream, Left HRS, "EvRight" = event stream, Right HRS. // THaScaler(); THaScaler( const char* Bankgroup ); virtual ~THaScaler(); // Init() is *REQUIRED* to be run once in the life of this object. // 'Time' is the Day-Month-Year to look up scaler map related to data taking. // European format of Time: '21-05-1999' --> 21st of May 1999. // 'Time' can also be "now" // Int_t Init( const char* Bankgroup ); // default time = "now" // Int_t Init( const char* Time, const char* Bankgroup ); Int_t Init( const char* date = "now" ); // default time = "now" Int_t Init( const TDatime& date ); // default time = current time // Various ways of loading data into this object, each load is for one // 'event' of data. Any CODA files are opened once, read sequentially Int_t LoadData(const THaEvData& evdata); // load from THaEvData (return if non-scaler evt) // from CODA file (assumed opened already) Int_t LoadDataCodaFile(THaCodaFile *codafile); // from CODA file 'filename' (we'll open it for you) Int_t LoadDataCodaFile(const char* filename); Int_t LoadDataCodaFile(TString filename); // Load data from scaler history file for run number Int_t LoadDataHistoryFile(int run_num); // default file "scaler_history.dat" Int_t LoadDataHistoryFile(const char* filename, int run_num); // Online 'server' may be Name or IP of VME cpu, or // 'server' may also be a mnemonic like "Left", "Right", "RCS", etc Int_t LoadDataOnline(); // server and port is known for 'Bankgroup' Int_t LoadDataOnline(const char* server, int port); virtual Int_t InitPlots(); // Initialize plots (xscaler style) virtual void Print( Option_t* opt="" ) const; // Prints data contents virtual void PrintSummary(); // Print out a summary of important scalers. const char* GetName() const { return bankgroup.c_str(); } const Int_t GetCrate() const { return crate; } std::vector < THaScalerBank* > GetScalerBanks() { return scalerbanks; } // Get scaler data from slot #slot and channel #chan (slot >= 0, chan >= 0) // Get counts by history, histor = 1 = previous event, 0 = present. Int_t GetScaler(Int_t bank, Int_t chan, Int_t histor=0); // Get accumulated COUNTS on detector and channel // detector = "s1", "s2", "gasC", "a1", "a2", "leadgl", "rcs1-3", "edtm" Int_t GetScaler(const char* detector, Int_t chan); // if no L/R distinction. // PMT = "left", "right", "LR" (LR means left.AND.right) Int_t GetScaler(const char* detector, const char* PMT, Int_t chan, Int_t histor=0); Int_t GetTrig(Int_t trigger); // counts for trig# 1,2,3,4,5,etc // Beam current, which= 'bcm_u1','bcm_d1','bcm_u3','bcm_d3','bcm_u10','bcm_d10' Int_t GetBcm(const char* which); Int_t GetPulser(const char* which); // which = 'clock', 'edt', 'edtat', 'strobe' // Accumulated COUNTS by helicity state (-1, 0, +1), 0 is non-helicity gated // Get counts by history, histor = 1 = previous event, 0 = present. Int_t GetTrig(Int_t helicity, Int_t trigger, Int_t histor=0); Int_t GetBcm(Int_t helicity, const char* which, Int_t histor=0); Int_t GetPulser(Int_t helicity, const char* which, Int_t histor=0); Int_t GetNormData(Int_t helicity, const char* which, Int_t histor=0); Int_t GetNormData(Int_t helicity, Int_t chan, Int_t histor=0); // RATES (Hz) since last update, similar usage to above. Double_t GetScalerRate(Int_t slot, Int_t chan); Double_t GetScalerRate(const char* plane, const char* PMT, Int_t chan); Double_t GetScalerRate(const char* plane, Int_t chan); Double_t GetTrigRate(Int_t trigger); Double_t GetTrigRate(Int_t helicity, Int_t trigger); Double_t GetBcmRate(const char* which); Double_t GetBcmRate(Int_t helicity, const char* which); Double_t GetPulserRate(const char* which); Double_t GetPulserRate(Int_t helicity, const char* which); Double_t GetNormRate(Int_t helicity, const char* which); Double_t GetNormRate(Int_t helicity, Int_t chan); Bool_t IsRenewed() const { return new_load; } // kTRUE if obj has new data