CGEM BOSS 6.6.5.f
BESIII Offline Software System
Loading...
Searching...
No Matches
CgemVStripCalculator Class Reference

#include <Cgem2DStrip.h>

Public Member Functions

 CgemVStripCalculator (double r, double len, double wid, double ang, double xmin, double zmin, double pit)
 
void setDelta (double sd)
 
double getPointPhi (double *pos) const
 
bool isPointInSheet (double phi, double z) const
 
double getZFromVPhi (double v, double phi) const
 
int getStartPointFromV (double v, double &phi, double &z) const
 
int getEndPointFromV (double v, double &phi, double &z) const
 
double getStripLengthFromV (double v) const
 
int getPointNumberFromV (double v) const
 
int getNthPointFromV (double v, int i, double &phi, double &z) const
 
 CgemVStripCalculator (double r, double len, double wid, double ang, double xmin, double zmin, double pit)
 
void setDelta (double sd)
 
double getPointPhi (double *pos) const
 
bool isPointInSheet (double phi, double z) const
 
double getZFromVPhi (double v, double phi) const
 
int getStartPointFromV (double v, double &phi, double &z) const
 
int getEndPointFromV (double v, double &phi, double &z) const
 
double getStripLengthFromV (double v) const
 
int getPointNumberFromV (double v) const
 
int getNthPointFromV (double v, int i, double &phi, double &z) const
 

Static Public Attributes

static const int NORMAL = 0
 
static const int INVALID_VID = -1
 
static const int ADJUST_TO_END = 1
 
static const int ADJUST_TO_START = 2
 

Detailed Description

Constructor & Destructor Documentation

◆ CgemVStripCalculator() [1/2]

CgemVStripCalculator::CgemVStripCalculator ( double  r,
double  len,
double  wid,
double  ang,
double  xmin,
double  zmin,
double  pit 
)

Definition at line 404 of file Cgem2DStrip.cxx.

405 : m_RV(r), m_Length(len), m_Width(wid), m_Angle(ang), m_Xmin(xmin), m_Zmin(zmin), m_Pitch(pit)
406{
407 //New Geom
408 //Adjust angle to (-pi/2, pi/2)
409 while (m_Angle > TMath::Pi() / 2) m_Angle -= TMath::Pi();
410 while (m_Angle < -TMath::Pi() / 2) m_Angle += TMath::Pi();
411
412 //Change the value of "delta" to set the precision of V-strip drawing
413 delta = 30.0;
414
415 //Calculate VID offset
416 //vid_offset = getStartVID();
417}

◆ CgemVStripCalculator() [2/2]

CgemVStripCalculator::CgemVStripCalculator ( double  r,
double  len,
double  wid,
double  ang,
double  xmin,
double  zmin,
double  pit 
)

Member Function Documentation

◆ getEndPointFromV() [1/2]

int CgemVStripCalculator::getEndPointFromV ( double  v,
double &  phi,
double &  z 
) const

Definition at line 483 of file Cgem2DStrip.cxx.

484{
485 //int adjVID = VID + vid_offset;
486 //double x_temp = ((adjVID - 1) * m_Pitch + m_V1) / TMath::Cos(m_Angle);
487 double x_temp = v / TMath::Cos(m_Angle);
488 double z_temp;
489
490 //New Geom
491 if (m_Angle < 0)
492 {
493 if (x_temp < 0) return INVALID_VID;
494 z_temp = x_temp / TMath::Tan(-m_Angle);
495 if (z_temp <= m_Length)
496 {
497 phi = m_Xmin / m_RV;
498 z = z_temp + m_Zmin;
499 return NORMAL;
500 }
501 else if (x_temp - m_Length * TMath::Tan(-m_Angle) <= m_Width)
502 {
503 phi = (x_temp - m_Length * TMath::Tan(-m_Angle) + m_Xmin) / m_RV;
504 z = m_Length + m_Zmin;
505 return NORMAL;
506 }
507 }
508 else
509 {
510 if (x_temp < 0) return INVALID_VID;
511 z_temp = x_temp / TMath::Tan(m_Angle);
512 if (z_temp <= m_Length)
513 {
514 phi = m_Xmin / m_RV;
515 z = m_Zmin + m_Length - z_temp;
516 return NORMAL;
517 }
518 else if (x_temp - m_Length * TMath::Tan(m_Angle) <= m_Width)
519 {
520 phi = (x_temp - m_Length * TMath::Tan(m_Angle) + m_Xmin) / m_RV;
521 z = m_Zmin;
522 return NORMAL;
523 }
524 }
525
526 return INVALID_VID;
527}
**********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
Definition: KarLud.h:35

Referenced by Cgem2DVStrip::Cgem2DVStrip(), getNthPointFromV(), and getStripLengthFromV().

◆ getEndPointFromV() [2/2]

int CgemVStripCalculator::getEndPointFromV ( double  v,
double &  phi,
double &  z 
) const

◆ getNthPointFromV() [1/2]

int CgemVStripCalculator::getNthPointFromV ( double  v,
int  i,
double &  phi,
double &  z 
) const

Definition at line 551 of file Cgem2DStrip.cxx.

552{
553 double sphi, sz, res_z, res_phi;
554 int status = getStartPointFromV(v, sphi, sz);
555 if (status != NORMAL) return status;
556 int N = getPointNumberFromV(v) - 1;
557
558 if (i >= 0 && i < N)
559 {
560 //New Geom
561 if (m_Angle <= 0)
562 {
563 res_z = sz + (i * delta) * TMath::Cos(m_Angle);
564 res_phi = sphi + (i * delta) * TMath::Sin(m_Angle) / m_RV;
565 }
566 else
567 {
568 res_z = sz - (i * delta) * TMath::Cos(m_Angle);
569 res_phi = sphi - (i * delta) * TMath::Sin(m_Angle) / m_RV;
570 }
571 }
572 else
573 {
574 //New Geom
575 //if ( (m_Angle <= 0 && res_phi * m_RV < m_Xmin)
576 // || (m_Angle > 0 && res_phi * m_RV > m_Xmin + m_Width)
577 // || res_z > m_Length + m_Zmin )
578 if (i >= N)
579 {
580 status = getEndPointFromV(v, res_phi, res_z);
581 if (status != NORMAL) return status;
582 status = ADJUST_TO_END;
583 }
584 else
585 {
586 status = getStartPointFromV(v, res_phi, res_z);
587 if (status != NORMAL) return status;
588 status = ADJUST_TO_START;
589 }
590 }
591
592 phi = res_phi;
593 z = res_z;
594 return status;
595}
int getStartPointFromV(double v, double &phi, double &z) const
int getPointNumberFromV(double v) const
int getEndPointFromV(double v, double &phi, double &z) const

Referenced by Cgem2DVStrip::Cgem2DVStrip(), and CgemROOTGeo::Draw3DHits().

◆ getNthPointFromV() [2/2]

int CgemVStripCalculator::getNthPointFromV ( double  v,
int  i,
double &  phi,
double &  z 
) const

◆ getPointNumberFromV() [1/2]

int CgemVStripCalculator::getPointNumberFromV ( double  v) const

Definition at line 543 of file Cgem2DStrip.cxx.

544{
545 double striplen = getStripLengthFromV(v);
546 if (striplen < 0) return INVALID_VID;
547 return static_cast<int>(striplen / delta + 2);
548}
double getStripLengthFromV(double v) const

Referenced by Cgem2DVStrip::Cgem2DVStrip(), CgemROOTGeo::Draw3DHits(), and getNthPointFromV().

◆ getPointNumberFromV() [2/2]

int CgemVStripCalculator::getPointNumberFromV ( double  v) const

◆ getPointPhi() [1/2]

double CgemVStripCalculator::getPointPhi ( double *  pos) const

Definition at line 399 of file Cgem2DStrip.cxx.

400{
401 return TMath::ATan2(pos[1], pos[0]);
402}

◆ getPointPhi() [2/2]

double CgemVStripCalculator::getPointPhi ( double *  pos) const

◆ getStartPointFromV() [1/2]

int CgemVStripCalculator::getStartPointFromV ( double  v,
double &  phi,
double &  z 
) const

Definition at line 435 of file Cgem2DStrip.cxx.

436{
437 //int adjVID = VID + vid_offset;
438 //double x_temp = ((adjVID - 1) * m_Pitch + m_V1) / TMath::Cos(m_Angle);
439 double x_temp = v / TMath::Cos(m_Angle);
440 double z_temp;
441
442 //New Geom
443 if (m_Angle < 0)
444 {
445 if (x_temp < 0) return INVALID_VID;
446 if (x_temp <= m_Width)
447 {
448 phi = (x_temp + m_Xmin) / m_RV;
449 z = m_Zmin;
450 return NORMAL;
451 }
452
453 z_temp = (x_temp - m_Width) / TMath::Tan(-m_Angle);
454 if (z_temp <= m_Length)
455 {
456 phi = (m_Xmin + m_Width) / m_RV;
457 z = z_temp + m_Zmin;
458 return NORMAL;
459 }
460 }
461 else
462 {
463 if (x_temp < 0) return INVALID_VID;
464 if (x_temp <= m_Width)
465 {
466 phi = (x_temp + m_Xmin) / m_RV;
467 z = m_Zmin + m_Length;
468 return NORMAL;
469 }
470
471 z_temp = (x_temp - m_Width) / TMath::Tan(m_Angle);
472 if (z_temp <= m_Length)
473 {
474 phi = (m_Xmin + m_Width) / m_RV;
475 z = m_Zmin + m_Length - z_temp;
476 return NORMAL;
477 }
478 }
479 return INVALID_VID;
480}

Referenced by Cgem2DVStrip::Cgem2DVStrip(), getNthPointFromV(), and getStripLengthFromV().

◆ getStartPointFromV() [2/2]

int CgemVStripCalculator::getStartPointFromV ( double  v,
double &  phi,
double &  z 
) const

◆ getStripLengthFromV() [1/2]

double CgemVStripCalculator::getStripLengthFromV ( double  v) const

Definition at line 530 of file Cgem2DStrip.cxx.

531{
532 //New Geom
533 double phi1 = 0, z1 = 0;
534 double phi2 = 0, z2 = 0;
535 double len = 0;
537 getEndPointFromV(v, phi2, z2);
538 len = sqrt(m_RV * m_RV * (phi1 - phi2) * (phi1 - phi2) + (z1 - z2) * (z1 - z2));
539 return len;
540}
Double_t phi2
Double_t phi1

Referenced by getPointNumberFromV().

◆ getStripLengthFromV() [2/2]

double CgemVStripCalculator::getStripLengthFromV ( double  v) const

◆ getZFromVPhi() [1/2]

double CgemVStripCalculator::getZFromVPhi ( double  v,
double  phi 
) const

Definition at line 598 of file Cgem2DStrip.cxx.

599{
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;
603}

Referenced by CgemROOTGeo::calcZFromLayerSheetVIDPhi().

◆ getZFromVPhi() [2/2]

double CgemVStripCalculator::getZFromVPhi ( double  v,
double  phi 
) const

◆ isPointInSheet() [1/2]

bool CgemVStripCalculator::isPointInSheet ( double  phi,
double  z 
) const

Definition at line 419 of file Cgem2DStrip.cxx.

420{
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;
423 return true;
424}

Referenced by CgemROOTGeo::isPointInSheet().

◆ isPointInSheet() [2/2]

bool CgemVStripCalculator::isPointInSheet ( double  phi,
double  z 
) const

◆ setDelta() [1/2]

void CgemVStripCalculator::setDelta ( double  sd)
inline

Definition at line 139 of file EventDisplay/BesVisLib/BesVisLib-00-06-08/BesVisLib/Cgem2DStrip.h.

139{ delta = sd; }

◆ setDelta() [2/2]

void CgemVStripCalculator::setDelta ( double  sd)
inline

Definition at line 139 of file InstallArea/include/BesVisLib/BesVisLib/Cgem2DStrip.h.

139{ delta = sd; }

Member Data Documentation

◆ ADJUST_TO_END

static const int CgemVStripCalculator::ADJUST_TO_END = 1
static

◆ ADJUST_TO_START

static const int CgemVStripCalculator::ADJUST_TO_START = 2
static

◆ INVALID_VID

static const int CgemVStripCalculator::INVALID_VID = -1
static

◆ NORMAL

static const int CgemVStripCalculator::NORMAL = 0
static

The documentation for this class was generated from the following files: