#ifndef __THIRA_H
#define __THIRA_H
#include <iostream>
#include <TROOT.h>
#include <TBranch.h>
#include <TCanvas.h>
#include <TClonesArray.h>
#include <TMath.h>
#include <TObjArray.h>
#include <TPolyMarker3D.h>
#include <TTree.h>
#include <TObject.h>
#include <TFolder.h>
#ifndef __ROOTDEFINE_H
#include "rootDefine.h"
#define __ROOTDEFINE_H
#endif
#ifndef __PACKETID_H
#include "packetID.h"
#define __PACKETID_H
#endif
#ifndef __THIRAASIC_H
#include "THiRAAsic.h"
#define __THIRAASIC_H
#endif
#ifndef __TTELE_H
#include "TTele.h"
#define __TTELE_H
#endif
#ifndef __TCRANGE_H
#include "TCrange.h"
#define __TCRANGE_H
#endif
#ifndef __TTARGET_H
#include "TTarget.h"
#define __TTARGET_H
#endif
class TTarget;
class TTele;
using namespace std;
using namespace TMath;
class THiRA : public TObject{
protected:
TString fName;
TString fTitle;
Int_t fAnalysisState;
TTarget *fTarget;
private:
TVector3 fPixVec;
Int_t fChipErr[THIRA_NMBS][THIRA_MB_SLOTS*2];
Int_t fChanErr[THIRA_NMBS][THIRA_MB_SLOTS][THIRA_SI_CHANNELS];
TCanvas *fHiRACanvas;
Int_t fTeleIndexMap[THIRA_NTELES];
private:
Char_t *chipMapFile;
Char_t *csiMapFile;
Char_t *csiMapPath;
Char_t *fReadoutShiftPath;
Short_t adcTeleMap[21][32];
Short_t CsIMap[21][32];
vector<Short_t> adcList;
public:
TCrange *fCRange;
TPolyMarker3D *fPixelView;
public:
Bool_t fAddRndm;
Bool_t fCorrectReadout;
UShort_t fNwords;
Short_t fRawMult;
Short_t fHits[THIRA_NMBS];
TClonesArray *fPixel;
static TClonesArray *fgPixel;
Double_t SiRawThresh;
Double_t CsIRawThresh;
Double_t fEulerPhi;
Double_t fEulerTheta;
Double_t fEulerPsi;
THiRAAsic asic;
TTele tele[THIRA_NTELES];
TList teleTList;
TTele *fTele[THIRA_NTELES];
TBranch *b_tele[THIRA_NTELES];
TBranch *b_fPixel;
TBranch *b_fNwords;
TBranch *b_fRawMult;
TBranch *b_fHits;
TFolder *f_HiRA;
TFolder *f_pixelMatrix;
TFolder *f_parameters;
TFolder *f_input;
TTree *fChain;
TTree *fClone;
Int_t fCurrent;
public:
THiRA(): fName(), fTitle() {}
~THiRA() {}
THiRA(const THiRA &);
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 Clear(Option_t *option="");
void ClearErr();
void Copy(TObject &hira) const;
virtual void Draw(Option_t* option="") { Draw(option,"","","all");}
virtual Long64_t Draw(const Char_t* varexp,
const Char_t* selection,
Option_t* option="",
Option_t* drawType="all");
const Char_t *GetChipMapFile() const {return chipMapFile;}
const Char_t *GetCsIMapFile() const {return csiMapFile;}
const Char_t *GetCsIMapPath() const {return csiMapPath;}
const Char_t *GetReadoutFile() const {return fReadoutShiftPath;}
Int_t GetCsIQuadIndex(Int_t xStrip, Int_t yStrip);
Int_t GetPadIndex(Int_t index);
TTarget *GetTarget(){return fTarget;}
Int_t GetTeleIndex(Int_t id);
TVector3 GetPixVec(THiRA *hira);
Bool_t InitClass();
void InitTree(TTree *tree);
void InitBranch(TTree *tree,Option_t *stage);
void ResetCalibBranches();
void SetAddRndm(Bool_t *AddRndm){fAddRndm=AddRndm;}
Bool_t SetChipMapFile(Char_t *filePath);
Bool_t SetCsIMapFile(Char_t *filePath);
Bool_t SetReadoutShiftPath(Char_t *filePath);
void SetEuler(Double_t phi,Double_t theta, Double_t psi){fEulerPhi =phi*DegToRad();
fEulerTheta=theta*DegToRad();
fEulerPsi =psi*DegToRad();}
void SetTarget(TTarget *target){fTarget = target;}
Int_t Calibrate(Option_t *prefix="",Option_t *path="",
Option_t *treeName="",
Option_t *option="RECREATE");
void Calculate();
void CreateFolders();
Bool_t Fill(Short_t energy, Short_t time,
Short_t teleNum, Short_t faceNum,
Short_t stripNum,Short_t cbSeq,
Short_t chSeq, UInt_t hitSeq);
Bool_t FillCsI(Short_t energy, Short_t teleNum,
Short_t csiNum);
Int_t GenPrime(Option_t *prefix="",Option_t *path="",
Option_t *treeName="",
Option_t *option="RECREATE");
Bool_t LoadAdcMap();
Bool_t LoadBadElements(Char_t *filePath);
Bool_t LoadCsICalibration(Char_t *filePath,Int_t nCal=0);
Bool_t LoadCsIVCalibration(Char_t *filePath);
Bool_t LoadCsISegVec(Char_t *filePath);
Bool_t LoadPixelMatrix(Char_t *filePath);
Bool_t LoadReadoutShifts(Char_t *filePath);
Bool_t LoadSiCalibration(Char_t *filePath);
void PrintBad(Option_t*);
virtual Bool_t Unpack(UShort_t *p);
Bool_t UnpackCsI(UShort_t *p);
UShort_t* UnpackCsIEnergy(UShort_t *p);
ClassDef(THiRA,15)
};
#endif
Last change: Sun Dec 21 12:38:47 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.