// Author: Andrew M. Rogers, NSCL 07/01/2006
//* Copyright (C) 2006-2008 Andrew M. Rogers

#ifndef __TSCALER_H
#define __TSCALER_H

#include <iostream>

#include <TROOT.h>
#include <TBranch.h>
#include <TClonesArray.h>
#include <TH1I.h>
#include <TTree.h>
#include <TObject.h>

#include "TScalerCh.h"

#ifndef  __ROOTDEFINE_H
#define  __ROOTDEFINE_H
#include "rootDefine.h"
#endif
#ifndef  __PACKETID_H
#define  __PACKETID_H
#include "packetID.h"
#endif

using namespace std;

class TScaler : public TNamed{
 protected:
  
 public:
  Long64_t      startTime;                     //  Interval start time in seconds.
  Long64_t      endTime;                       //  Interval end time in seconds.

  //  Int_t       nScalers;                    //
  TH1I          h_totals;                      //
  Long64_t      scaler[64];                    //! Array of scaler counts.
  TClonesArray *fScalers;                      //  Collection of hit telescope pixels. 
  static TClonesArray *fgScalers;              //  Collection of hit telescope pixels. 

  TBranch     *b_startTime;                    //! Start time branch.
  TBranch     *b_endTime;                      //! End time branch.
  TBranch     *b_fScalers;                     //! Scaler counts branch.
  TBranch     *b_h_totals;                     //! Histogram containing running scaler totals.

  TTree       *fChain;                         //! Pointer to the analyzed TTree or TChain
  TTree       *fEChain;                        //! Pointer to the analyzed Event Data TTree or TChain
  Int_t        fCurrent;                       //! Current Tree number in a TChain
  
 public:
  TScaler() {}
  //TScaler(const TString &name, const TString &title) : fName(name), fTitle(title) { }
  ~TScaler() {}
  
  void           Clear(Option_t *option="");                     // Clear and reset all class members to defaults.
  void           DumpMap();                                      // Dump the scaler mapping to stdout.
  Bool_t         DumpScalers(Option_t *fileName="NONE",          
			     Option_t *option="RECREATE");       // Dump the scaler value to stdout and an optional file.
  void           DrawTotals();                                   // Draw a histo of all scaler totals.
  void           InitBranch(TTree *tree);                        // Initialize the branch structure of the tree.
  Bool_t         InitClass();                                    // Initialize any default properties of the class.
  Int_t          InitTree(TTree *tree);                          // Initialize the tree.
  Bool_t         LoadScalerMap(Char_t *fileName);                // Load the scaler mapping file.
  UShort_t*      Unpack(UShort_t *p);                            // Unpack an Event.  
    
  ClassDef(TScaler,2); // Scaler Class.
  
};

#endif

Last change: Sun Dec 21 12:38:59 2008
Last generated: 2008-12-21 12:38

This page has been automatically generated. If you have any comments or suggestions about the page layout send a mail to ROOT support, or contact the developers with any questions or problems regarding ROOT.