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

#ifndef __TTELE_H
#define __TTELE_H

#include <iostream>

#include <TROOT.h>
#include <TBranch.h>
#include <TTree.h>
#include <TObject.h>
#include <TRandom3.h>
#include <TVector3.h>

#ifndef   __ROOTDEFINE_H
#include "rootDefine.h"
#define   __ROOTDEFINE_H
#endif
#ifndef  __THIRAASIC_H
#include "THiRAAsic.h"
#define  __THIRAASIC_H
#endif
#ifndef   __TDELTA_H
#include "TDelta.h"
#define   __TDELTA_H
#endif
#ifndef   __TFRONT_H
#include "TFront.h"
#define   __TFRONT_H
#endif
#ifndef   __TBACK_H
#include "TBack.h"
#define   __TBACK_H
#endif
#ifndef   __TCSI_H
#include "TCsI.h"
#define   __TCSI_H
#endif
#ifndef   __THIRAPIXEL_H
#include "THiRAPixel.h"
#define   __THIRAPIXEL_H
#endif

class THiRA;
class TDelta;
class TFront;
class TBack;
class TCsI;
class THiRAPixel;

using namespace std;


//////////////////////////////////////////////////////////////////////////
//                                                                      //
// TTele                                                                //
//                                                                      //
// A TTele class derives from TNamed.  This Class provides the          //
// structure for a HiRA telescope.  Raw event data is filled into the   //
// class members.                                                       //
//                                                                      //
//////////////////////////////////////////////////////////////////////////

class TTele : public TObject {
 private:
  TRandom3  fRandom;                                           //! The class's random number generator.

 protected:
  TString   fName;                                             //! Object identifier
  TString   fTitle;                                            //! Object title

  Double_t  fThicknessDE;                                      //! Si thickness in microns.
  Double_t  fDeadLayerDE;                                      //! Si deadlayer in microns.
  Double_t  fThicknessE;                                       //! Si thickness in microns.
  Double_t  fDeadLayerE;                                       //! Si deadlayer in microns.
  static const Double_t  fCoverThickness    = 0.19;            //! 
  static const Double_t  fCsIMylarThickness = 0.19;            //!
  

 private:
  Int_t      teleNum;                                          //! Index number of telescope in array.
  Int_t      teleID;                                           //! ID number of this telescope.
  TString    name;                                             //!

 public:
  TTele      *fCon;                                            //!
  THiRA      *parent;                                          //! Parent class.

  Int_t      fHits;                                            //  Number of hits in the telescope.

  TDelta     DE;                                               //  Si dE member class.
  TFront     EF;                                               //  Si Ef member class.
  TBack      EB;                                               //  Si Eb member class.
  TCsI       CsI;                                              //  CsI member class.

  Double_t    DE_Eslope[THIRA_SI_CHANNELS];                    //! Slope for DE Calibration
  Double_t    EF_Eslope[THIRA_SI_CHANNELS];                    //! Slope for EF Calibration
  Double_t    EB_Eslope[THIRA_SI_CHANNELS];                    //! Slope for EB Calibration
  Double_t    CsI_Eslope[THIRA_CSI_CHANNELS];                  //! Slope for CsI Calibration
  Double_t    CsI_E2slope[THIRA_CSI_CHANNELS];                 //! Slope for CsI Calibration
  Double_t    DE_Tslope[THIRA_SI_CHANNELS];                    //! Slope for DE Calibration
  Double_t    EF_Tslope[THIRA_SI_CHANNELS];                    //! Slope for EF Calibration
  Double_t    EB_Tslope[THIRA_SI_CHANNELS];                    //! Slope for EB Calibration

  Double_t    DE_Eoffset[THIRA_SI_CHANNELS];                   //! Offset for DE Calibration
  Double_t    EF_Eoffset[THIRA_SI_CHANNELS];                   //! Offset for EF Calibration
  Double_t    EB_Eoffset[THIRA_SI_CHANNELS];                   //! Offset for EB Calibration
  Double_t    CsI_Eoffset[THIRA_CSI_CHANNELS];                 //! Offset for CsI Calibration
  Double_t    CsI_E2offset[THIRA_CSI_CHANNELS];                //! Offset for CsI Calibration
  Double_t    DE_Toffset[THIRA_SI_CHANNELS];                   //! Offset for DE Calibration
  Double_t    EF_Toffset[THIRA_SI_CHANNELS];                   //! Offset for EF Calibration
  Double_t    EB_Toffset[THIRA_SI_CHANNELS];                   //! Offset for EB Calibration

  Double_t    CsI_Vcoeff[THIRA_CSI_CHANNELS][5];               //! CsI Voltage Calibration terms [CsI][Order].

  Double_t    DE_Shift[THIRA_SI_CHANNELS][2][5];               //! Readout shift [CH][CB or MB][Order]
  Double_t    EF_Shift[THIRA_SI_CHANNELS][2][5];               //! Readout shift [CH][CB or MB][Order]
  Double_t    EB_Shift[THIRA_SI_CHANNELS][2][5];               //! Readout shift [CH][CB or MB][Order]

/*   Int_t       DE_badstrips[THIRA_SI_CHANNELS];                 //!  */
/*   Int_t       EF_badstrips[THIRA_SI_CHANNELS];                 //! */
/*   Int_t       EB_badstrips[THIRA_SI_CHANNELS];                 //! */
/*   Int_t       CsI_badsegments[THIRA_CSI_CHANNELS];             //! */

  TVector3   pixelMatrix[THIRA_SI_CHANNELS][THIRA_SI_CHANNELS];//! Pixel position matrix.

  TBranch    *b_fHits;                                         //!
  TBranch    *b_DE;                                            //! DE Branch.
  TBranch    *b_EF;                                            //! EF Branch.
  TBranch    *b_EB;                                            //! EB Branch.
  TBranch    *b_CsI;                                           //! CsI Branch.

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

 public:
  TTele(): fName(), fTitle() {fRandom.SetSeed(0);}
  ~TTele() {}
  TTele(const TTele &);                // 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=""); 

  Int_t          Calibrate(Long64_t entry);                      // Calibrate detector.
  void           Calculate();                                    // Calculate.
  void           Clear(Option_t *option="");                     // Clear all members.
  void           Copy(TObject &tele) const;                      // The copy method.
  Int_t          GetEntry(Long64_t entry=0,Int_t getall=0);      // Get entry for all branches.
  Int_t          GetTeleID(){return teleID;}                     // Get the telescope ID.
  const Double_t GetSiThickness(Char_t *type);                   //
  const Double_t GetSiDeadLayer(Char_t *type);                   //
  const Double_t GetSiCoverThickness(){return fCoverThickness;}  //
  const Double_t GetCsIMylarThickness(){return fCsIMylarThickness;}//
  void           InitChain(TTree *chain){fChain = chain;}        //
  void           InitClass(THiRA *top,TString iName, 
			   Int_t iNum, Int_t idNum);             // Initialzes the class.
  void           InitClone(TTree *clone){fClone = clone;}        //
  void           InitTree(TTree *tree);                          // Initialize the tree.

  void           SetBad(Int_t **strips);                         // Set bad strips for this telescope.
  void           SetBad(Int_t *segments);                        // Set bad segments for this telescope.

  void           SetSiThickness(Char_t *type,Double_t thickness);//
  void           SetSiDeadLayer(Char_t *type,Double_t deadLayer);//


  ClassDef(TTele,11)     // A HiRA telescope.
  
};

#endif

Last change: Sun Dec 21 12:39:00 2008
Last generated: 2008-12-21 12:39

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.