00001
00002 #ifndef EMC_2D_CRYSTAL_H
00003 #define EMC_2D_CRYSTAL_H
00004
00005 #include <vector>
00006 #include <TNamed.h>
00007 #include <TAttLine.h>
00008 #include <TAttFill.h>
00009 #include <TPaveLabel.h>
00010 #include <TPaveText.h>
00011 #include <TVector3.h>
00012
00013 #include "BesCircle2D.h"
00014 #include "BesPolygon2D.h"
00015 #include "BesMarker2D.h"
00016 #include "BesPaveText.h"
00017
00018 class Emc2DCrystal : public TNamed, public TAttLine, public TAttFill
00019 {
00020 public:
00021
00022 Emc2DCrystal();
00023 Emc2DCrystal(const char* name, const char* title, Int_t N, Double_t *P, Int_t part, Int_t theta);
00024 ~Emc2DCrystal();
00025
00026 virtual void SetStyle();
00027 virtual Int_t DistancetoPrimitive(Int_t px, Int_t py);
00028 virtual void ExecuteEvent(Int_t event, Int_t px, Int_t py);
00029
00030 virtual void SetHighlighted(bool status = true) { fHighlighted = status; }
00031 virtual void SetFired(bool status = true) { fFired = status; }
00032 virtual bool IsHighlighted() { return fHighlighted; }
00033 virtual bool IsFired() { return fFired; }
00034
00035 virtual void AddInfo(TString info) { fInfoCon.push_back(info); }
00036 virtual void CloseInfo();
00037 virtual void ClearInfo();
00038
00039 virtual void SetTime(Double_t time) { fTime = time; }
00040 virtual void SetCharge(Double_t charge) { fCharge = charge; }
00041 virtual Double_t GetTime() { return fTime; }
00042 virtual Double_t GetCharge() { return fCharge; }
00043 virtual void ResetTimeCharge() { fTime = 0.0; fCharge = 0.0; }
00044
00045 virtual void Draw(Option_t *option = "");
00046 virtual void Paint(Option_t *option = "");
00047 virtual char *GetObjectInfo(Int_t px, Int_t py) const;
00048
00049 virtual Int_t GetPart() { return fPart; }
00050 virtual Int_t GetTheta() { return fTheta; }
00051 virtual bool HasZRSection();
00052 Double_t GetAngle(Double_t x, Double_t y);
00053 Double_t Range360(Double_t input);
00054 virtual bool IsXYVisible();
00055 virtual bool IsSideVisible();
00056
00057 virtual void SetXYPoint(Double_t *p1, Double_t *p2, Double_t *newP, Double_t z);
00058 virtual void SetZRPoint(Double_t *p1, Double_t *p2, Double_t *newP, Double_t r);
00059 virtual void ProjectECToSide(Double_t *p1, Double_t *newP);
00060 private:
00061
00062 Int_t fPart;
00063 Int_t fTheta;
00064 BesPolygon2D *fCrystalXY;
00065 BesPolygon2D *fCrystalZR;
00066 BesPolygon2D *fCrystalSide;
00067 BesPolygon2D *fCrystalXYFired;
00068 BesPolygon2D *fCrystalZRFired;
00069 BesPolygon2D *fCrystalSideFired;
00070
00071 static const Int_t fChargeMax = 300;
00072 Double_t fTime, fCharge;
00073
00074 Double_t fZRSectionTolerance[3];
00075 Double_t fPhiMin, fPhiMax;
00076
00077
00078
00079
00080 static const Int_t ecXYPointZ = 1420;
00081 static const Int_t brZRPointR = 990;
00082 static const Int_t sideDeltaPhi = 21;
00083
00084 std::vector<TString> fInfoCon;
00085 BesPaveText *fTip;
00086 bool fHighlighted;
00087 bool fFired;
00088
00089
00090 Int_t lcCrystal;
00091 Int_t lwCrystal;
00092 Int_t fcCrystal;
00093 Int_t fsCrystal;
00094 Int_t fsCrystalTrans;
00095
00096 Int_t lcCrystalFired;
00097 Int_t lwCrystalFired;
00098 Int_t fcCrystalFired;
00099 Int_t fsCrystalFired;
00100
00101 Int_t lcCrystalHL;
00102 Int_t lwCrystalHL;
00103 Int_t fcCrystalHL;
00104 Int_t fsCrystalHL;
00105
00106 Int_t lcCrystalFiredHL;
00107 Int_t lwCrystalFiredHL;
00108 Int_t fcCrystalFiredHL;
00109 Int_t fsCrystalFiredHL;
00110
00111 ClassDef(Emc2DCrystal,1)
00112
00113 };
00114
00115 #endif