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;
113 double x = phi * rUF;
116 coorStrip[0] =
x - 0.5 * size;
120 coorStrip[3] =
x + 0.5 * size;
124 coorStrip[6] = coorStrip[3];
126 coorStrip[7] = zmin + len;
128 coorStrip[9] = coorStrip[0];
130 coorStrip[10] = zmin + len;
135 shapename +=
" Unfolded";
136 shapetitle +=
" Unfolded";
160 else cout <<
"Cgem2DXStrip::CloseInfo, not initialized" << endl;
187#ifdef CGEM_X_STRIP_TEST_CONDITIONAL_DISPLAY
238 if (gPad) gPad->SetCursor(kPointer);
278 TString opt = option;
289#ifdef CGEM_X_STRIP_TEST_CONDITIONAL_DISPLAY
402 return TMath::ATan2(pos[1], pos[0]);
406 : m_RV(r), m_Length(len), m_Width(wid), m_Angle(ang), m_Xmin(xmin), m_Zmin(zmin), m_Pitch(pit)
410 while (m_Angle > TMath::Pi() / 2) m_Angle -= TMath::Pi();
411 while (m_Angle < -TMath::Pi() / 2) m_Angle += TMath::Pi();
422 if (z < m_Zmin || z > m_Zmin + m_Length)
return false;
423 if (phi * m_RV < m_Xmin || phi * m_RV > m_Xmin + m_Width)
return false;
440 double x_temp =
v / TMath::Cos(m_Angle);
447 if (x_temp <= m_Width)
449 phi = (x_temp + m_Xmin) / m_RV;
454 z_temp = (x_temp - m_Width) / TMath::Tan(-m_Angle);
455 if (z_temp <= m_Length)
457 phi = (m_Xmin + m_Width) / m_RV;
465 if (x_temp <= m_Width)
467 phi = (x_temp + m_Xmin) / m_RV;
468 z = m_Zmin + m_Length;
472 z_temp = (x_temp - m_Width) / TMath::Tan(m_Angle);
473 if (z_temp <= m_Length)
475 phi = (m_Xmin + m_Width) / m_RV;
476 z = m_Zmin + m_Length - z_temp;
488 double x_temp =
v / TMath::Cos(m_Angle);
495 z_temp = x_temp / TMath::Tan(-m_Angle);
496 if (z_temp <= m_Length)
502 else if (x_temp - m_Length * TMath::Tan(-m_Angle) <= m_Width)
504 phi = (x_temp - m_Length * TMath::Tan(-m_Angle) + m_Xmin) / m_RV;
505 z = m_Length + m_Zmin;
512 z_temp = x_temp / TMath::Tan(m_Angle);
513 if (z_temp <= m_Length)
516 z = m_Zmin + m_Length - z_temp;
519 else if (x_temp - m_Length * TMath::Tan(m_Angle) <= m_Width)
521 phi = (x_temp - m_Length * TMath::Tan(m_Angle) + m_Xmin) / m_RV;
534 double phi1 = 0, z1 = 0;
535 double phi2 = 0, z2 = 0;
539 len = sqrt(m_RV * m_RV * (
phi1 -
phi2) * (
phi1 -
phi2) + (z1 - z2) * (z1 - z2));
548 return static_cast<int>(striplen / delta + 2);
554 double sphi, sz, res_z, res_phi;
556 if (status !=
NORMAL)
return status;
564 res_z = sz + (i * delta) * TMath::Cos(m_Angle);
565 res_phi = sphi + (i * delta) * TMath::Sin(m_Angle) / m_RV;
569 res_z = sz - (i * delta) * TMath::Cos(m_Angle);
570 res_phi = sphi - (i * delta) * TMath::Sin(m_Angle) / m_RV;
582 if (status !=
NORMAL)
return status;
588 if (status !=
NORMAL)
return status;
601 double x_temp =
v / TMath::Cos(m_Angle);
602 double z_temp = (x_temp - phi * m_RV + m_Xmin) / TMath::Tan(m_Angle);
603 return m_Zmin + z_temp;
613 double r,
double len,
double wid,
double ang,
double xmin,
double zmin,
double pit,
614 Double_t size, Double_t thick, Int_t layer, Int_t sheet, Int_t strip,
624 double* pxy =
new double[6 * N];
625 double* pzr =
new double[6 * N];
626 double tphi = 0, tz = 0;
627 double vuf =
v / r * rUF;
628 TString shapename = name;
629 TString shapetitle = title;
633 for (
int i = 0; i < N; ++i)
636 double cosphi = TMath::Cos(tphi);
637 double sinphi = TMath::Sin(tphi);
638 double rplust = r + 0.5 * thick;
639 double rsubt = r - 0.5 * thick;
641 pxy[3 * i] = rsubt * cosphi;
642 pxy[3 * i + 1] = rsubt * sinphi;
644 pxy[6 * N - 3 * i - 3] = rplust * cosphi;
645 pxy[6 * N - 3 * i - 2] = rplust * sinphi;
646 pxy[6 * N - 3 * i - 1] = tz;
647 pzr[3 * i] = r * cosphi;
648 pzr[3 * i + 1] = r * sinphi;
649 pzr[3 * i + 2] = tz - 0.5 * size;
650 pzr[6 * N - 3 * i - 3] = r * cosphi;
651 pzr[6 * N - 3 * i - 2] = r * sinphi;
652 pzr[6 * N - 3 * i - 1] = tz + 0.5 * size;
659 Double_t coorStrip[12];
661 double size_cosang = 0.5 * size * TMath::Cos(-ang);
662 double size_sinang = 0.5 * size * TMath::Sin(-ang);
668 coorStrip[0] = tphi * rUF - size_cosang;
669 coorStrip[1] = tz - size_sinang;
672 coorStrip[3] = tphi * rUF + size_cosang;
673 coorStrip[4] = tz + size_sinang;
677 coorStrip[6] = tphi * rUF + size_cosang;
678 coorStrip[7] = tz + size_sinang;
681 coorStrip[9] = tphi * rUF - size_cosang;
682 coorStrip[10] = tz - size_sinang;
687 shapename +=
" Unfolded";
688 shapetitle +=
" Unfolded";
720 else cout <<
"Cgem2DVStrip::CloseInfo, not initialized" << endl;
744#ifdef CGEM_V_STRIP_TEST_CONDITIONAL_DISPLAY
784 if (gPad) gPad->SetCursor(kPointer);
824 TString opt = option;
835#ifdef CGEM_V_STRIP_TEST_CONDITIONAL_DISPLAY
R__EXTERN BesCursor * gBesCursor
#define CGEM_X_STRIP_DISPLAY_CONDITION
ClassImp(Cgem2DXStrip) ClassImp(Cgem2DVStrip) Cgem2DStripBase
#define CGEM_V_STRIP_DISPLAY_CONDITION
gr SetTitle("BbLum_000XXXX")
**********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)
virtual Int_t DistancetoPrimitive(Int_t px, Int_t py)
BesMarker2D * fXYHighlight
virtual void Draw(Option_t *option="")
virtual void Paint(Option_t *option="")
Double_t fFiredSizeFactor
static const int ADJUST_TO_END
double getStripLengthFromV(double v) const
double getPointPhi(double *pos) const
int getStartPointFromV(double v, double &phi, double &z) const
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_START
CgemVStripCalculator(double r, double len, double wid, double ang, double xmin, double zmin, double pit)
static const int INVALID_VID
int getEndPointFromV(double v, double &phi, double &z) const