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

#ifndef __TCSI_H
#define __TCSI_H

#include <iostream>
#include <bitset>

#include <TROOT.h>
#include <TChain.h>
#include <TFile.h>
#include <TObject.h>
#include <TVector3.h>

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

using namespace std;


class TCsI : public TObject {
 protected:
  TString     fName;                                   //! Object identifier
  TString     fTitle;                                  //! Object title

 public:
  bitset<THIRA_CSI_CHANNELS> fBadSegs;                 //! Problem segments that can be excluded.

  Bool_t      fAddRndm;                                //! Add random number to convert from short data types to double.
  Int_t       fPos[THIRA_CSI_CHANNELS];                //! Positon of each crystal. (0,1,2, or 3).
  TVector3    fSegVec[THIRA_CSI_CHANNELS];             //! Crystal segment positions.

  Short_t     ERaw[THIRA_CSI_CHANNELS];                // Energy deposited in a CsI crystal.
  Double_t    E[THIRA_CSI_CHANNELS];                   // Energy deposited in a CsI crystal.
  Double_t    E2[THIRA_CSI_CHANNELS];                  // Energy deposited in a CsI crystal (Secondary Calibration).
  Double_t    Emax;                                    // Maximum energy deopsited in the CsI for each telescope.
  Double_t    E2max;                                   // Maximum energy deopsited in the CsI for each telescope.
  Short_t     Emaxch;                                  // Channel number corresponding to the channel with the maximum energy.
  Short_t     E2maxch;                                 // Channel number corresponding to the channel with the maximum energy.
  Short_t     rawMult;                                 // Multiplicity of CsI for each telescope.

  TBranch    *b_ERaw;                                  //! Energy Branch.
  TBranch    *b_E;                                     //! Energy Branch.
  TBranch    *b_E2;                                    //! Energy Branch (Secondary Calibration).
  TBranch    *b_Emax;                                  //! Emax Branch.
  TBranch    *b_E2max;                                 //! Emax Branch.
  TBranch    *b_Emaxch;                                //! Emaxch Branch.
  TBranch    *b_E2maxch;                               //! Emaxch Branch.
  TBranch    *b_rawMult;                               //! Raw Multiplicity Branch.

  TTree        *fChain;                                //! Pointer to the analyzed TTree or TChain
  Int_t        fCurrent;                               //! Current Tree number in a TChain


 public:
  TCsI(): fName(), fTitle() {}
  ~TCsI() {}
  TCsI(const TCsI &);                // The copy constructor.


  const Char_t  *GetName() const { return fName; }
  const Char_t  *GetTitle() const { return fTitle; }
  void           SetName(const Char_t *name);
  void           SetNameTitle(const Char_t *name, const Char_t *title);
  void           SetTitle(const Char_t *title=""); 

  void         Calculate();                               // Calculate quantities.
  void         Calibrate();                               // Calibrate detector.
  void         Clear(Option_t *option="");                // Clear all members.
  void         Copy(TObject &CsI) const;                  // The copy method.
  Int_t        GetEntry(Long64_t entry=0,Int_t getall=0); // Get entry for all branches.
  void         InitClass(TString name);                   // Initialize the class.
  void         InitTree(TTree *tree);                     // Initialize the tree.
  Bool_t       IsBad(Int_t segment);                      // Check if the segment is marked as "bad".
  
  void         SetBad(Int_t segment, Int_t bitValue=1);   // Set bad segment.
  
  ClassDef(TCsI,4)     // HiRA CsI.
  
};

#endif


Last change: Sun Dec 21 12:38:45 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.