6#include "BesVisLib/BesView.h"
7#include "BesVisLib/BesCursor.h"
8#include "BesVisLib/Cgem2DStrip.h"
22#define CGEM_X_STRIP_DISPLAY_CONDITION fLayer == 2 && fSheet == 1
23#define CGEM_V_STRIP_DISPLAY_CONDITION fLayer == 0 && fStrip >= 601 && fStrip <= 602
29 : fHighlighted(
false), fFired(
false), fLayer(layer), fSheet(sheet), fStrip(strip)
51 else return TObject::GetObjectInfo(px, py);
62 Double_t len, Double_t wid, Double_t phi, Double_t zmin, Double_t r,
63 Double_t size, Double_t thick, Int_t layer, Int_t sheet, Int_t strip,
67 double cosphi = TMath::Cos(phi);
68 double sinphi = TMath::Sin(phi);
69 double rplust = r + 0.5 * thick;
70 double rsubt = r - 0.5 * thick;
71 Double_t coorStrip[12];
74 coorStrip[0] = cosphi * rsubt - sinphi * 0.5 * size;
75 coorStrip[1] = sinphi * rsubt + cosphi * 0.5 * size;
77 coorStrip[3] = cosphi * rplust - sinphi * 0.5 * size;
78 coorStrip[4] = sinphi * rplust + cosphi * 0.5 * size;
80 coorStrip[6] = cosphi * rplust + sinphi * 0.5 * size;
81 coorStrip[7] = sinphi * rplust - cosphi * 0.5 * size;
83 coorStrip[9] = cosphi * rsubt + sinphi * 0.5 * size;
84 coorStrip[10] = sinphi * rsubt - cosphi * 0.5 * size;
85 coorStrip[11] = -zmin;
88 TString shapename = name;
89 TString shapetitle = title;
90 shapename +=
" Highlight";
91 shapetitle +=
" Highlight";
98 coorStrip[0] = coorStrip[3] = cosphi * r;
99 coorStrip[1] = coorStrip[4] = sinphi * r;
103 coorStrip[5] = zmin + len;
112 double x = phi * rUF;
115 coorStrip[0] =
x - 0.5 * size;
119 coorStrip[3] =
x + 0.5 * size;
123 coorStrip[6] = coorStrip[3];
125 coorStrip[7] = zmin + len;
127 coorStrip[9] = coorStrip[0];
129 coorStrip[10] = zmin + len;
134 shapename +=
" Unfolded";
135 shapetitle +=
" Unfolded";
159 else cout <<
"Cgem2DXStrip::CloseInfo, not initialized" << endl;
186#ifdef CGEM_X_STRIP_TEST_CONDITIONAL_DISPLAY
237 if (gPad) gPad->SetCursor(kPointer);
277 TString opt = option;
288#ifdef CGEM_X_STRIP_TEST_CONDITIONAL_DISPLAY
401 return TMath::ATan2(pos[1], pos[0]);
405 : m_RV(r), m_Length(len), m_Width(wid), m_Angle(ang), m_Xmin(xmin), m_Zmin(zmin), m_Pitch(pit)
409 while (m_Angle > TMath::Pi() / 2) m_Angle -= TMath::Pi();
410 while (m_Angle < -TMath::Pi() / 2) m_Angle += TMath::Pi();
421 if (z < m_Zmin || z > m_Zmin + m_Length)
return false;
422 if (phi * m_RV < m_Xmin || phi * m_RV > m_Xmin + m_Width)
return false;
439 double x_temp =
v / TMath::Cos(m_Angle);
446 if (x_temp <= m_Width)
448 phi = (x_temp + m_Xmin) / m_RV;
453 z_temp = (x_temp - m_Width) / TMath::Tan(-m_Angle);
454 if (z_temp <= m_Length)
456 phi = (m_Xmin + m_Width) / m_RV;
464 if (x_temp <= m_Width)
466 phi = (x_temp + m_Xmin) / m_RV;
467 z = m_Zmin + m_Length;
471 z_temp = (x_temp - m_Width) / TMath::Tan(m_Angle);
472 if (z_temp <= m_Length)
474 phi = (m_Xmin + m_Width) / m_RV;
475 z = m_Zmin + m_Length - z_temp;
487 double x_temp =
v / TMath::Cos(m_Angle);
494 z_temp = x_temp / TMath::Tan(-m_Angle);
495 if (z_temp <= m_Length)
501 else if (x_temp - m_Length * TMath::Tan(-m_Angle) <= m_Width)
503 phi = (x_temp - m_Length * TMath::Tan(-m_Angle) + m_Xmin) / m_RV;
504 z = m_Length + m_Zmin;
511 z_temp = x_temp / TMath::Tan(m_Angle);
512 if (z_temp <= m_Length)
515 z = m_Zmin + m_Length - z_temp;
518 else if (x_temp - m_Length * TMath::Tan(m_Angle) <= m_Width)
520 phi = (x_temp - m_Length * TMath::Tan(m_Angle) + m_Xmin) / m_RV;
533 double phi1 = 0, z1 = 0;
534 double phi2 = 0, z2 = 0;
538 len = sqrt(m_RV * m_RV * (
phi1 -
phi2) * (
phi1 -
phi2) + (z1 - z2) * (z1 - z2));
547 return static_cast<int>(striplen / delta + 2);
553 double sphi, sz, res_z, res_phi;
555 if (status !=
NORMAL)
return status;
563 res_z = sz + (i * delta) * TMath::Cos(m_Angle);
564 res_phi = sphi + (i * delta) * TMath::Sin(m_Angle) / m_RV;
568 res_z = sz - (i * delta) * TMath::Cos(m_Angle);
569 res_phi = sphi - (i * delta) * TMath::Sin(m_Angle) / m_RV;
581 if (status !=
NORMAL)
return status;
587 if (status !=
NORMAL)
return status;
600 double x_temp =
v / TMath::Cos(m_Angle);
601 double z_temp = (x_temp - phi * m_RV + m_Xmin) / TMath::Tan(m_Angle);
602 return m_Zmin + z_temp;
612 double r,
double len,
double wid,
double ang,
double xmin,
double zmin,
double pit,
613 Double_t size, Double_t thick, Int_t layer, Int_t sheet, Int_t strip,
623 double* pxy =
new double[6 * N];
624 double* pzr =
new double[6 * N];
625 double tphi = 0, tz = 0;
626 double vuf =
v / r * rUF;
627 TString shapename = name;
628 TString shapetitle = title;
632 for (
int i = 0; i < N; ++i)
635 double cosphi = TMath::Cos(tphi);
636 double sinphi = TMath::Sin(tphi);
637 double rplust = r + 0.5 * thick;
638 double rsubt = r - 0.5 * thick;
640 pxy[3 * i] = rsubt * cosphi;
641 pxy[3 * i + 1] = rsubt * sinphi;
643 pxy[6 * N - 3 * i - 3] = rplust * cosphi;
644 pxy[6 * N - 3 * i - 2] = rplust * sinphi;
645 pxy[6 * N - 3 * i - 1] = tz;
646 pzr[3 * i] = r * cosphi;
647 pzr[3 * i + 1] = r * sinphi;
648 pzr[3 * i + 2] = tz - 0.5 * size;
649 pzr[6 * N - 3 * i - 3] = r * cosphi;
650 pzr[6 * N - 3 * i - 2] = r * sinphi;
651 pzr[6 * N - 3 * i - 1] = tz + 0.5 * size;
658 Double_t coorStrip[12];
660 double size_cosang = 0.5 * size * TMath::Cos(-ang);
661 double size_sinang = 0.5 * size * TMath::Sin(-ang);
667 coorStrip[0] = tphi * rUF - size_cosang;
668 coorStrip[1] = tz - size_sinang;
671 coorStrip[3] = tphi * rUF + size_cosang;
672 coorStrip[4] = tz + size_sinang;
676 coorStrip[6] = tphi * rUF + size_cosang;
677 coorStrip[7] = tz + size_sinang;
680 coorStrip[9] = tphi * rUF - size_cosang;
681 coorStrip[10] = tz - size_sinang;
686 shapename +=
" Unfolded";
687 shapetitle +=
" Unfolded";
719 else cout <<
"Cgem2DVStrip::CloseInfo, not initialized" << endl;
743#ifdef CGEM_V_STRIP_TEST_CONDITIONAL_DISPLAY
783 if (gPad) gPad->SetCursor(kPointer);
823 TString opt = option;
834#ifdef CGEM_V_STRIP_TEST_CONDITIONAL_DISPLAY
#define CGEM_X_STRIP_DISPLAY_CONDITION
ClassImp(Cgem2DXStrip) ClassImp(Cgem2DVStrip) Cgem2DStripBase
#define CGEM_V_STRIP_DISPLAY_CONDITION
gr SetTitle("BbLum_000XXXX")
R__EXTERN BesCursor * gBesCursor
**********Class see also m_nmax DOUBLE PRECISION m_amel DOUBLE PRECISION m_x2 DOUBLE PRECISION m_alfinv DOUBLE PRECISION m_Xenph INTEGER m_KeyWtm INTEGER m_idyfs DOUBLE PRECISION m_zini DOUBLE PRECISION m_q2 DOUBLE PRECISION m_Wt_KF DOUBLE PRECISION m_WtCut INTEGER m_KFfin *COMMON c_KarLud $ !Input CMS energy[GeV] $ !CMS energy after beam spread beam strahlung[GeV] $ !Beam energy spread[GeV] $ !z boost due to beam spread $ !electron beam mass *ff pair spectrum $ !minimum v
***************************************************************************************Pseudo Class RRes *****************************************************************************************Parameters and physical constants **Maarten sept ************************************************************************DOUBLE PRECISION xsmu **************************************************************************PARTICLE DATA all others are from PDG *Only resonances with known widths into electron pairs are sept ************************************************************************C Declarations C
virtual void SetMarkerSizeMultiple(Int_t input)
virtual void Paint(Option_t *option="")
virtual void SetText(std::vector< TString > infoCon)
virtual void SetPos(Int_t px, Int_t py)
virtual void Paint(Option_t *option="")
virtual Int_t DistancetoPrimitive(Int_t px, Int_t py)
virtual void Stretch(Double_t sx, Double_t sy, Double_t sz, Double_t factor)
virtual void GetCenter(Double_t *Center) const
Bool_t GetVisCgemXStrips()
Bool_t GetVisCgemVStrips()
virtual void UpdateView(Bool_t resetview=kFALSE)
Bool_t GetVisCgemHitsFiredHL()
virtual char * GetObjectInfo(Int_t px, Int_t py) const
EBESViewType GetViewType()
virtual void ExecuteEvent(Int_t event, Int_t px, Int_t py)
virtual char * GetObjectInfo(Int_t px, Int_t py) const
Cgem2DStripBase(const char *name, const char *title, Int_t layer, Int_t sheet, Int_t strip)
virtual bool IsFired() const
virtual ~Cgem2DStripBase()
std::vector< TString > fInfoCon
virtual void SetHighlighted(bool status=true)
virtual bool IsHighlighted() const
virtual Int_t DistancetoPrimitive(Int_t px, Int_t py)
virtual void ExecuteEvent(Int_t event, Int_t px, Int_t py)
virtual void Draw(Option_t *option="")
Cgem2DVStrip(const char *name, const char *title, double v, double r, double len, double wid, double ang, double xmin, double zmin, double pit, Double_t size, Double_t thick, Int_t layer, Int_t sheet, Int_t strip, Double_t rUF)
virtual void Paint(Option_t *option="")
virtual void ExecuteEvent(Int_t event, Int_t px, Int_t py)
Cgem2DXStrip(const char *name, const char *title, Double_t len, Double_t wid, Double_t phi, Double_t zmin, Double_t r, Double_t size, Double_t thick, Int_t layer, Int_t sheet, Int_t strip, Double_t rUF)
BesMarker2D * fXYHighlight
virtual Int_t DistancetoPrimitive(Int_t px, Int_t py)
virtual void Draw(Option_t *option="")
virtual void Paint(Option_t *option="")
Double_t fFiredSizeFactor
static const int ADJUST_TO_START
double getStripLengthFromV(double v) const
double getPointPhi(double *pos) const
int getStartPointFromV(double v, double &phi, double &z) const
static const int INVALID_VID
int getPointNumberFromV(double v) const
int getNthPointFromV(double v, int i, double &phi, double &z) const
bool isPointInSheet(double phi, double z) const
double getZFromVPhi(double v, double phi) const
static const int ADJUST_TO_END
CgemVStripCalculator(double r, double len, double wid, double ang, double xmin, double zmin, double pit)
int getEndPointFromV(double v, double &phi, double &z) const