CGEM BOSS 6.6.5.i
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
 

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

Definition at line 119 of file Cgem2DStrip.h.

Constructor & Destructor Documentation

◆ CgemVStripCalculator()

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

Definition at line 405 of file Cgem2DStrip.cxx.

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

Member Function Documentation

◆ getEndPointFromV()

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

Definition at line 484 of file Cgem2DStrip.cxx.

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

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

◆ getNthPointFromV()

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

Definition at line 552 of file Cgem2DStrip.cxx.

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

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

◆ getPointNumberFromV()

int CgemVStripCalculator::getPointNumberFromV ( double v) const

Definition at line 544 of file Cgem2DStrip.cxx.

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

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

◆ getPointPhi()

double CgemVStripCalculator::getPointPhi ( double * pos) const

Definition at line 400 of file Cgem2DStrip.cxx.

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

◆ getStartPointFromV()

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

Definition at line 436 of file Cgem2DStrip.cxx.

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

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

◆ getStripLengthFromV()

double CgemVStripCalculator::getStripLengthFromV ( double v) const

Definition at line 531 of file Cgem2DStrip.cxx.

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

Referenced by getPointNumberFromV().

◆ getZFromVPhi()

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

Definition at line 599 of file Cgem2DStrip.cxx.

600{
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;
604}

Referenced by CgemROOTGeo::calcZFromLayerSheetVIDPhi().

◆ isPointInSheet()

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

Definition at line 420 of file Cgem2DStrip.cxx.

421{
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;
424 return true;
425}

Referenced by CgemROOTGeo::isPointInSheet().

◆ setDelta()

void CgemVStripCalculator::setDelta ( double sd)
inline

Definition at line 139 of file Cgem2DStrip.h.

139{ delta = sd; }

Member Data Documentation

◆ ADJUST_TO_END

const int CgemVStripCalculator::ADJUST_TO_END = 1
static

Definition at line 135 of file Cgem2DStrip.h.

Referenced by getNthPointFromV().

◆ ADJUST_TO_START

const int CgemVStripCalculator::ADJUST_TO_START = 2
static

Definition at line 136 of file Cgem2DStrip.h.

Referenced by getNthPointFromV().

◆ INVALID_VID

const int CgemVStripCalculator::INVALID_VID = -1
static

Definition at line 134 of file Cgem2DStrip.h.

Referenced by getEndPointFromV(), getPointNumberFromV(), and getStartPointFromV().

◆ NORMAL

const int CgemVStripCalculator::NORMAL = 0
static

Definition at line 133 of file Cgem2DStrip.h.

Referenced by getEndPointFromV(), getNthPointFromV(), and getStartPointFromV().


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