CGEM BOSS 6.6.5.g
BESIII Offline Software System
Loading...
Searching...
No Matches
CgemGeoReadoutPlane Class Reference

#include <CgemGeoReadoutPlane.h>

Public Member Functions

 CgemGeoReadoutPlane (int iLayer, int iSheet, double rx, double rv, double phi_min, double dX_strip, double dV, double w, double zmin, double L, int NXStrip, int NVStrip, double Xpitch, double XstripWidth, double Vpitch, double VstripWidth, double stereoAngle, double midROfGap, double outROfGap)
 
 ~CgemGeoReadoutPlane ()
 
void print ()
 
int getLayerId ()
 
int getSheetId ()
 
double getRX ()
 
double getRV ()
 
double getPhimin ()
 
double getXmin ()
 
double getWidth ()
 
double getZmin ()
 
double getLength ()
 
double getXPitch ()
 
double getVPitch ()
 
double getStereoAngle ()
 
double getMidRAtGap ()
 
double getVmax ()
 
int getNXstrips () const
 
int getNVstrips () const
 
bool OnThePlane (double phi, double z) const
 
double getX (double phi) const
 
int getXStripID (double phi) const
 
int getXStripID (double x, double y) const
 
int getXStripID (G4ThreeVector pos) const
 
int getClosestXStripID (double phi, double &dist)
 
int getClosestVStripID (G4ThreeVector pos, double &dist) const
 
double getDist2ClosestXStripCenter (double phi, int &id)
 
double getDist2ClosestVStripCenter (G4ThreeVector pos, int &id)
 
void getStripID (G4ThreeVector pos, int &X_ID, int &V_ID) const
 
void getFiredStripID (G4ThreeVector pos1, G4ThreeVector pos2, vector< int > &vecXID, vector< int > &vecVID) const
 
double getVFromLocalXZ (double x, double zeta, bool checkRange=true) const
 
double getVFromPhiZ (double phi, double z, bool checkRange=true) const
 
double getVFromPhiZ_nearPhiMin (double phi, double z, bool checkRange=true) const
 
double getVInNextSheetFromV (double v, double phiminNext) const
 
int getVIDFromV (double V) const
 
int getVIDInNextSheetFromVID (int vID, double phimin_next) const
 
double getPhiMin_strip () const
 
double getCentralXFromXID (int X_ID) const
 
double getPhiFromXID (int X_ID) const
 
double getCentralVFromVID (int V_ID) const
 
double getVStripLength (int V_ID) const
 
double getZFromXV (double X, double V, int checkXRange=1, int checkVRange=1) const
 
double getZFromPhiV (double phi, double V, int checkXRange=1) const
 
double incidentAngleX (Hep3Vector momentum, double phi) const
 
double incidentAngleV (Hep3Vector momentum, double phi) const
 
double dAngleAcute (double phi1, double phi2) const
 

Detailed Description

Definition at line 14 of file CgemGeoReadoutPlane.h.

Constructor & Destructor Documentation

◆ CgemGeoReadoutPlane()

CgemGeoReadoutPlane::CgemGeoReadoutPlane ( int  iLayer,
int  iSheet,
double  rx,
double  rv,
double  phi_min,
double  dX_strip,
double  dV,
double  w,
double  zmin,
double  L,
int  NXStrip,
int  NVStrip,
double  Xpitch,
double  XstripWidth,
double  Vpitch,
double  VstripWidth,
double  stereoAngle,
double  midROfGap,
double  outROfGap 
)

Definition at line 6 of file CgemGeoReadoutPlane.cxx.

11 {
12
13 m_iLayer = iLayer;
14 m_iSheet = iSheet;
15
16 m_RX = rx;
17 m_RV = rv;
18 m_Rmid = 0.5*(rx+rv);
19
20 m_W = w;
21 m_Zmin = zmin;
22 m_Zmax = zmin+L;
23 m_L = L;
24
25 m_XPitch = Xpitch;
26 m_XstripWidth = XstripWidth;
27 m_VPitch = Vpitch;
28 m_VstripWidth = VstripWidth;
29 //m_XPitch = Xpitch*m_RX/m_Rmid; // scaling from plane to cylinder
30 //m_XstripWidth = XstripWidth*m_RX/m_Rmid; // scaling from plane to cylinder
31 //m_VPitch = Vpitch*m_RV/m_Rmid; // scaling from plane to cylinder
32 //m_VstripWidth = VstripWidth*m_RV/m_Rmid; // scaling from plane to cylinder
33 m_StereoAngle = stereoAngle / 180.*CLHEP::pi; //degree -> radian
34 m_k = stereoAngle/fabs(stereoAngle); // sign of the stereo angle
35 m_MidRGap = midROfGap;
36 m_OutRGap = outROfGap;
37 m_NXstrips = NXStrip;
38 m_NVstrips = NVStrip;
39
40 m_Phimin = phiMin;
41 while(m_Phimin<-M_PI) m_Phimin+=2*M_PI;
42 while(m_Phimin>M_PI) m_Phimin-=2*M_PI;
43 //m_Xmin = m_Phimin*rx;
44 m_Xmin = m_Phimin*m_Rmid;
45
46 //double dPhi_sensitive = NXStrip*m_XPitch/m_Rmid;
47 //m_Phimin_strip = dX_strip/m_Rmid+m_Phimin;
48 m_Phimin_strip = dX_strip/m_Rmid;
49 //while(m_Phimin_strip<0) m_Phimin_strip+=2*M_PI;
50 //while(m_Phimin_strip>2*M_PI) m_Phimin_strip-=2*M_PI;
51 m_Xmin_strip = m_Phimin_strip*m_Rmid;
52 m_Xmax_strip = m_Xmin_strip+NXStrip*m_XPitch;
53 m_Phimax_strip = m_Xmax_strip/m_Rmid;
54 //if(NXStrip*m_XPitch>2*M_PI*rx/) cout<<"CgemGeoReadoutPlane : "<<endl;
55
56 //m_Vmax = m_L*fabs(sin(m_StereoAngle))+m_W*m_RV/m_RX*cos(m_StereoAngle);
57 //m_Vmax = m_L*fabs(sin(m_StereoAngle))+m_W*cos(m_StereoAngle);
58 //m_NXstrips = floor(m_W / m_XPitch);
59 //m_NVstrips = floor(m_Vmax / m_VPitch);
60 //m_Vmin = 0.;
61
62 m_Vtot = NXStrip*m_XPitch*cos(m_StereoAngle)+m_L*fabs(sin(m_StereoAngle));
63 dV=(m_Vtot-NVStrip*m_VPitch)/2.0;// FIXME?
64 m_Vmin_strip = dV;
65 m_Vmax = m_Vmin_strip+NVStrip*m_VPitch;
66
67
68 cout<<" dX = "<<dX_strip<<endl;
69 print();
70}
double sin(const BesAngle a)
Definition: BesAngle.h:210
double cos(const BesAngle a)
Definition: BesAngle.h:213
#define M_PI
Definition: TConstant.h:4

◆ ~CgemGeoReadoutPlane()

CgemGeoReadoutPlane::~CgemGeoReadoutPlane ( )

Definition at line 73 of file CgemGeoReadoutPlane.cxx.

74{}

Member Function Documentation

◆ dAngleAcute()

double CgemGeoReadoutPlane::dAngleAcute ( double  phi1,
double  phi2 
) const

Definition at line 469 of file CgemGeoReadoutPlane.cxx.

470{
471 double dPhi = phi1-phi2;
472 while(dPhi<-CLHEP::pi) dPhi+=CLHEP::twopi;
473 while(dPhi> CLHEP::pi) dPhi-=CLHEP::twopi;
474 if(dPhi<-0.5*CLHEP::pi) dPhi+=CLHEP::pi;
475 else if(dPhi>0.5*CLHEP::pi) dPhi-=CLHEP::pi;
476 return dPhi;
477}
Double_t phi2
Double_t phi1

Referenced by incidentAngleV(), and incidentAngleX().

◆ getCentralVFromVID()

double CgemGeoReadoutPlane::getCentralVFromVID ( int  V_ID) const
inline

Definition at line 78 of file CgemGeoReadoutPlane.h.

79 {
80 //V_ID=V_ID-m_NVstrips*m_iSheet;
81 return (V_ID+0.5)*m_VPitch+m_Vmin_strip;
82 }

Referenced by getClosestVStripID(), getDist2ClosestVStripCenter(), getVIDInNextSheetFromVID(), getVStripLength(), CgemROOTGeo::InitGeometry(), and TestMapping::PositionCgemBoss().

◆ getCentralXFromXID()

double CgemGeoReadoutPlane::getCentralXFromXID ( int  X_ID) const
inline

Definition at line 73 of file CgemGeoReadoutPlane.h.

74 { //X_ID=X_ID-m_NXstrips*m_iSheet;
75 return (X_ID+0.5)*m_XPitch+m_Xmin_strip;
76 }// central X with m_Xmin as origin

Referenced by getClosestXStripID(), getDist2ClosestXStripCenter(), getPhiFromXID(), and TestMapping::PositionCgemBoss().

◆ getClosestVStripID()

int CgemGeoReadoutPlane::getClosestVStripID ( G4ThreeVector  pos,
double &  dist 
) const

Definition at line 193 of file CgemGeoReadoutPlane.cxx.

194{
195 double z = pos.z();
196 dist = -9999.;
197 int V_ID=-99;
198 if(z < m_Zmin){
199 V_ID = -3;
200 } else if(z > m_Zmin+m_L){
201 V_ID = -4;
202 } else {
203 double phi = pos.phi();
204 double v = getVFromPhiZ(phi, z);
205 //V_ID = floor((v-m_Vmin_strip) / m_VPitch);
206 V_ID = getVIDFromV(v);
207 int vid2 = V_ID;
208 if(V_ID==-1) vid2=0;
209 if(V_ID==-2) vid2=m_NVstrips-1;
210 if(v>=0.) dist = fabs(v-getCentralVFromVID(vid2))-0.5*m_VstripWidth;
211 }
212
213 return V_ID;
214}
**********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
double getVFromPhiZ(double phi, double z, bool checkRange=true) const
double getCentralVFromVID(int V_ID) const
int getVIDFromV(double V) const

Referenced by getStripID().

◆ getClosestXStripID()

int CgemGeoReadoutPlane::getClosestXStripID ( double  phi,
double &  dist 
)

Definition at line 126 of file CgemGeoReadoutPlane.cxx.

127{
128 //cout<<"getClosestXStripID: phi0="<<phi<<endl;
129 //cout<<"getClosestXStripID: phi="<<phi<<endl;
130 //cout<<"getXStripID: "<<xID<<endl;
131 int xID = getXStripID(phi);
132 int xID2 = xID;
133 if(xID2==-1) xID2=0;
134 if(xID2==-2) xID2=m_NXstrips-1;
135 double X = getX(phi);
136 dist = fabs(X-getCentralXFromXID(xID2))-0.5*m_XstripWidth;
137 //cout<<"getClosestXStripID: m_Xmin="<<m_Xmin<<", m_RX="<<m_RX<<", X="<<X
138 // <<", getCentralXFromXID(xID)="<<getCentralXFromXID(xID)
139 // <<", m_XstripWidth="<<m_XstripWidth<<endl;
140 return xID;
141}
double getCentralXFromXID(int X_ID) const
int getXStripID(double phi) const
double getX(double phi) const

◆ getDist2ClosestVStripCenter()

double CgemGeoReadoutPlane::getDist2ClosestVStripCenter ( G4ThreeVector  pos,
int &  id 
)

Definition at line 217 of file CgemGeoReadoutPlane.cxx.

217 {
218 double z = pos.z();
219 double dist=-9999.;
220 int V_ID=-99;
221 if(z < m_Zmin){
222 V_ID = -3;
223 } else if(z > m_Zmin+m_L){
224 V_ID = -4;
225 } else {
226 double phi = pos.phi();
227 double v = getVFromPhiZ(phi, z);
228 V_ID = getVIDFromV(v);
229 int vid2 = V_ID;
230 if(V_ID==-1) vid2=0;
231 if(V_ID==-2) vid2=m_NVstrips-1;
232 dist = v-getCentralVFromVID(vid2);
233 }
234 id=V_ID;
235
236 return dist;
237}

Referenced by InductionGar2::setMultiElectrons(), and InductionGar::setMultiElectrons().

◆ getDist2ClosestXStripCenter()

double CgemGeoReadoutPlane::getDist2ClosestXStripCenter ( double  phi,
int &  id 
)

Definition at line 143 of file CgemGeoReadoutPlane.cxx.

144{
145 //cout<<"getClosestXStripID: phi0="<<phi<<endl;
146 //phi = phi - m_Xmin/m_RX;
147 //while(phi<0) phi += CLHEP::twopi;
148 //while(phi>CLHEP::twopi) phi-=CLHEP::twopi;
149 //cout<<"getClosestXStripID: phi="<<phi<<endl;
150 //double X = m_RX * phi;// in X-zeta plane (X-V plane)
151 //if(X == m_W) X -= 0.001 * m_XPitch;
152 //int xID = floor((X-(m_Xmin_strip-m_Xmin))/m_XPitch);
153 //cout<<"getXStripID: "<<xID<<endl;
154 //if(xID==m_NXstrips) xID=m_NXstrips-1;
155 //if(xID<0) xID=0;
156 //if(xID>=m_NXstrips) xID=m_NXstrips-1;
157 double dist=-9999.;
158 int xID = getXStripID(phi);
159 id=xID;
160 int xID2 = xID;
161 if(xID2==-1) xID2=0;
162 if(xID2==-2) xID2=m_NXstrips-1;
163 if(xID2>=0&&xID2<m_NXstrips) {
164 double X = getX(phi);
165 dist = X-getCentralXFromXID(xID2);
166 //cout<<"getClosestXStripID: m_Xmin="<<m_Xmin<<", m_RX="<<m_RX<<", X="<<X
167 // <<", getCentralXFromXID(xID)="<<getCentralXFromXID(xID)
168 // <<", m_XstripWidth="<<m_XstripWidth<<endl;
169 }
170 return dist;
171}

Referenced by InductionGar2::setMultiElectrons(), and InductionGar::setMultiElectrons().

◆ getFiredStripID()

void CgemGeoReadoutPlane::getFiredStripID ( G4ThreeVector  pos1,
G4ThreeVector  pos2,
vector< int > &  vecXID,
vector< int > &  vecVID 
) const

Definition at line 290 of file CgemGeoReadoutPlane.cxx.

291 {
292 //cout << "get fired strip id" << endl;
293 bool printDebug = false;
294 double z[2];
295 z[0] = pos1.z();
296 z[1] = pos2.z();
297 if( (z[0]<m_Zmin && z[1]<m_Zmin) || (z[0]>(m_Zmin+m_L) && z[1]>(m_Zmin+m_L)) ) return;
298
299 double phi[2];
300 double phimin=-CLHEP::pi;
301 phi[0]=pos1.phi();
302 phi[1]=pos2.phi();
303 if(fabs(phi[1]-phi[0])>CLHEP::pi){
304 phimin=0.0;
305 for(int i=0; i<2; i++) if(phi[i]<0.0) phi[i]+=CLHEP::twopi;
306 }
307 if(phi[0]>phi[1]){
308 double tmp=phi[0];
309 phi[0]=phi[1];
310 phi[1]=tmp;
311 tmp=z[1];
312 z[1]=z[0];
313 z[0]=tmp;
314 }
315 if(printDebug) cout<<"phimin="<<phimin<<", phi[0,1]="<<phi[0]<<","<<phi[1]<<", z[0,1]="<<z[0]<<","<<z[1]<<endl;
316 for(int i=0; i<2; i++){
317 if(z[i]<m_Zmin){
318 double phiTmp=(phi[1]-phi[0])/(z[1]-z[0])*(m_Zmin-z[0])+phi[0];
319 phi[i]=phiTmp;
320 z[i]=m_Zmin;
321 }
322 if(z[i]>(m_Zmin+m_L)){
323 double phiTmp=(phi[1]-phi[0])/(z[1]-z[0])*(m_Zmin+m_L-z[0])+phi[0];
324 phi[i]=phiTmp;
325 z[i]=m_Zmin+m_L;
326 }
327 }
328 double phiActiveMin=m_Phimin+m_Phimin_strip+10e-10;// 2019-05-05 wangll, +10e-10 2019-10-30
329 double phiActiveMax=m_Phimin+m_Phimax_strip-10e-10;// 2019-05-05 wangll, -10e-10 2019-10-30
330 if(printDebug) cout<<"phimin="<<phimin<<", phiActiveMin="<<phiActiveMin<<", phiActiveMax="<<phiActiveMax<<", phi[0,1]="<<phi[0]<<","<<phi[1]<<", z[0,1]="<<z[0]<<","<<z[1]<<endl;
331 while(phiActiveMax>=CLHEP::twopi) phiActiveMax-=CLHEP::twopi;// [0,2pi]
332 while(phiActiveMin>=CLHEP::twopi) phiActiveMin-=CLHEP::twopi;// [0,2pi]
333 while(phiActiveMax<0 ) phiActiveMax+=CLHEP::twopi;// [0,2pi]
334 while(phiActiveMin<0 ) phiActiveMin+=CLHEP::twopi;// [0,2pi]
335 if(phimin==-CLHEP::pi)
336 {
337 /*if(phiActiveMin>CLHEP::pi||phiActiveMax>CLHEP::pi) {
338 phiActiveMin-=CLHEP::twopi;
339 phiActiveMax-=CLHEP::twopi;
340 }*/
341 while(phiActiveMin>CLHEP::pi) phiActiveMin-=CLHEP::twopi;
342 while(phiActiveMax>CLHEP::pi) phiActiveMax-=CLHEP::twopi;
343 }// [-pi,pi]
344 if(printDebug) cout<<"phimin="<<phimin<<", phiActiveMin="<<phiActiveMin<<", phiActiveMax="<<phiActiveMax<<", phi[0,1]="<<phi[0]<<","<<phi[1]<<", z[0,1]="<<z[0]<<","<<z[1]<<endl;
345
346 int iCase=-1;
347 if(phiActiveMin<=phi[0])
348 {
349 if(phiActiveMax<=phiActiveMin) iCase=1;
350 else if(phiActiveMax<=phi[0]) iCase=2;
351 else if(phiActiveMax<=phi[1]) iCase=3;
352 else iCase=4;
353 }
354 else if(phiActiveMin<=phi[1])
355 {
356 if(phiActiveMax<=phi[0]) iCase=5;
357 else if(phiActiveMax<=phiActiveMin) iCase=6;
358 else if(phiActiveMax<=phi[1]) iCase=7;
359 else iCase=8;
360 }
361 else
362 {
363 if(phiActiveMax<=phi[0]) iCase=9;
364 else if(phiActiveMax<=phi[1]) iCase=10;
365 else if(phiActiveMax<=phiActiveMin) iCase=11;
366 else iCase=12;
367 }
368 if(printDebug) cout<<"iCase = "<<iCase<<endl;
369
370 double zBoundary[2];
371 zBoundary[0]=z[0]+(z[1]-z[0])/(phi[1]-phi[0])*(phiActiveMin-phi[0]);
372 zBoundary[1]=z[0]+(z[1]-z[0])/(phi[1]-phi[0])*(phiActiveMax-phi[0]);
373 switch(iCase)
374 {
375 case 2:
376 case 9:
377 case 12:
378 return;// no cluster
379 case 1:
380 case 4:
381 case 6:
382 case 11:
383 break;// no change in points
384 case 3:
385 case 10:
386 phi[1]=phiActiveMax;
387 z[1]=zBoundary[1];
388 break;
389 case 5:
390 case 8:
391 phi[0]=phiActiveMin;
392 z[0]=zBoundary[0];
393 break;
394 case 7:
395 phi[0]=phiActiveMin;
396 phi[1]=phiActiveMax;
397 z[0]=zBoundary[0];
398 z[1]=zBoundary[1];
399 break;
400 default:
401 cout<<"Error in CgemGeoReadoutPlane::getFiredStripID: iCase = "<<iCase<<endl;
402 return;
403 }
404 if(printDebug) cout<<"phimin="<<phimin<<", phiActiveMin="<<phiActiveMin<<", phiActiveMax="<<phiActiveMax<<", phi[0,1]="<<phi[0]<<","<<phi[1]<<", z[0,1]="<<z[0]<<","<<z[1]<<endl;
405
406 G4ThreeVector pos_1,pos_2;
407 pos_1.setRhoPhiZ(m_Rmid,phi[0],z[0]);
408 pos_2.setRhoPhiZ(m_Rmid,phi[1],z[1]);
409 int XID_min(-9),XID_max(-9);
410 int VID_min(-9),VID_max(-9);
411 getStripID(pos_1,XID_min,VID_min);
412 getStripID(pos_2,XID_max,VID_max);
413 if( iCase!=6 && VID_max<VID_min ) {
414 int tmp=VID_max;
415 VID_max=VID_min;
416 VID_min=tmp;
417 }
418 if(printDebug) {
419 cout<<"on the sheet: phi "<<phi[0]<<" to "<<phi[1]<<", z "<<z[0]<<" to "<<z[1]<<endl;
420 cout<<" XID "<<XID_min<<" to "<<XID_max<<", VID "<<VID_min<<" to "<<VID_max<<endl;
421 }
422
423 if(iCase!=6)
424 {
425 for(int i=0; i<=abs(XID_min-XID_max);i++) vecXID.push_back(XID_min+i);
426 for(int i=0; i<=abs(VID_min-VID_max);i++) vecVID.push_back(VID_min+i);
427 }
428 else
429 {
430 pos_1.setRhoPhiZ(m_Rmid,phiActiveMax,zBoundary[1]);
431 pos_2.setRhoPhiZ(m_Rmid,phiActiveMin,zBoundary[0]);
432 int XID_1(-9),XID_2(-9);
433 int VID_1(-9),VID_2(-9);
434 getStripID(pos_1,XID_1,VID_1);
435 getStripID(pos_2,XID_2,VID_2);
436 for(int i=0; i<=abs(XID_min-XID_1);i++) vecXID.push_back(XID_min+i);
437 for(int i=0; i<=abs(XID_max-XID_2);i++) vecXID.push_back(XID_2+i);
438 int VID_0=min(VID_1,VID_min);
439 for(int i=0; i<=abs(VID_min-VID_1);i++) vecVID.push_back(VID_0+i);
440 VID_0=min(VID_2,VID_max);
441 for(int i=0; i<=abs(VID_max-VID_2);i++) vecVID.push_back(VID_0+i);
442 }
443}
double abs(const EvtComplex &c)
Definition: EvtComplex.hh:212
void getStripID(G4ThreeVector pos, int &X_ID, int &V_ID) const

Referenced by BesCgemDigitizer::Digitize_v2().

◆ getLayerId()

int CgemGeoReadoutPlane::getLayerId ( )
inline

◆ getLength()

double CgemGeoReadoutPlane::getLength ( )
inline

◆ getMidRAtGap()

double CgemGeoReadoutPlane::getMidRAtGap ( )
inline

◆ getNVstrips()

◆ getNXstrips()

◆ getPhiFromXID()

double CgemGeoReadoutPlane::getPhiFromXID ( int  X_ID) const

Definition at line 267 of file CgemGeoReadoutPlane.cxx.

267 { // from -pi to pi
268 double X=getCentralXFromXID(X_ID);// central X with m_Xmin as origin
269 double phi=(X+m_Xmin)/m_Rmid;
270 while(phi<-M_PI) phi+=CLHEP::twopi;
271 while(phi>M_PI) phi-=CLHEP::twopi;
272 return phi;
273}

Referenced by TestMapping::CheckFEBPositionCgemBoss(), CgemROOTGeo::InitGeometry(), and TestMapping::PositionCgemBoss().

◆ getPhimin()

double CgemGeoReadoutPlane::getPhimin ( )
inline

Definition at line 32 of file CgemGeoReadoutPlane.h.

32{return m_Phimin;};

◆ getPhiMin_strip()

double CgemGeoReadoutPlane::getPhiMin_strip ( ) const
inline

Definition at line 72 of file CgemGeoReadoutPlane.h.

72{return m_Phimin_strip+m_Phimin;}

◆ getRV()

◆ getRX()

◆ getSheetId()

int CgemGeoReadoutPlane::getSheetId ( )
inline

◆ getStereoAngle()

double CgemGeoReadoutPlane::getStereoAngle ( )
inline

◆ getStripID()

void CgemGeoReadoutPlane::getStripID ( G4ThreeVector  pos,
int &  X_ID,
int &  V_ID 
) const

Definition at line 240 of file CgemGeoReadoutPlane.cxx.

240 {
241 /*
242 double z = pos.z();
243 if(z < m_Zmin){
244 V_ID = -2;
245 } else if(z > m_Zmin+m_L){
246 V_ID = -1;
247 } else if(X_ID >= 0){
248 double x = pos.x();
249 double y = pos.y();
250 double phi = atan2(y,x);
251 phi = phi - m_Xmin/m_RX;
252 while(phi < 0) phi+=CLHEP::twopi;
253 while(phi > CLHEP::twopi) phi-=CLHEP::twopi;
254 double X = m_RX * phi;// in X-zeta plane (X-V plane) @ m_RX
255 double zeta = z - m_Zmin;
256 V_ID = floor((getVFromLocalXZ(X, zeta)-m_Vmin_strip) / m_VPitch);
257 } else{
258 V_ID = -3;
259 }
260 */
261
262 X_ID = getXStripID(pos);
263 double dist=-9999.;
264 V_ID = getClosestVStripID(pos, dist);
265}
int getClosestVStripID(G4ThreeVector pos, double &dist) const

Referenced by TestMapping::CheckCrossingCgemBoss(), getFiredStripID(), and InductionGTS::setMultiElectrons().

◆ getVFromLocalXZ()

double CgemGeoReadoutPlane::getVFromLocalXZ ( double  x,
double  zeta,
bool  checkRange = true 
) const
inline

Definition at line 163 of file CgemGeoReadoutPlane.h.

164{
165 double V = -9999.0;
166 if( (!checkRange) || (x>=0. && x<=m_NXstrips*m_XPitch && zeta>=0 && zeta<=m_L) )
167 {
168 //double X = x/m_RX*m_RV;// X at V plane
169 //if(m_StereoAngle>0) return zeta*sin(m_StereoAngle) + X*cos(m_StereoAngle);
170 //else return (zeta-m_L)*sin(m_StereoAngle)+X*cos(m_StereoAngle);
171 double z0=m_Zmax; if(m_k<0) z0=m_Zmin;
172 //return X*cos(m_StereoAngle)+((m_k-1.0)*m_L/2.0-zeta)*sin(m_StereoAngle);
173 V = x*cos(m_StereoAngle)+(z0-zeta-m_Zmin)*sin(m_StereoAngle);
174 }
175 return V;
176}
Double_t x[10]

Referenced by getVFromPhiZ(), and getVFromPhiZ_nearPhiMin().

◆ getVFromPhiZ()

double CgemGeoReadoutPlane::getVFromPhiZ ( double  phi,
double  z,
bool  checkRange = true 
) const
inline

Definition at line 178 of file CgemGeoReadoutPlane.h.

179{
180 double dPhi=phi-m_Phimin;
181 while(dPhi<0) dPhi+=CLHEP::twopi;
182 while(dPhi>=CLHEP::twopi) dPhi-=CLHEP::twopi;
183 double X=dPhi*m_Rmid;// X with m_Xmin as origin
184 double x=X-m_Xmin_strip;// x with m_Xmin_strip as origin
185 double zeta=z-m_Zmin;// local zeta [0,L]
186 return getVFromLocalXZ(x,zeta, checkRange);
187}
double getVFromLocalXZ(double x, double zeta, bool checkRange=true) const

Referenced by DotsHelixFitter::calculateNewHelix(), getClosestVStripID(), getDist2ClosestVStripCenter(), HoughHit::residual(), and CgemMidDriftPlane::xyzToPhiVIdealGeom().

◆ getVFromPhiZ_nearPhiMin()

double CgemGeoReadoutPlane::getVFromPhiZ_nearPhiMin ( double  phi,
double  z,
bool  checkRange = true 
) const
inline

Definition at line 189 of file CgemGeoReadoutPlane.h.

190{
191 double dPhi=phi-m_Phimin;
192 while(dPhi<-CLHEP::pi) dPhi+=CLHEP::twopi;
193 while(dPhi>=CLHEP::pi) dPhi-=CLHEP::twopi;
194 double X=dPhi*m_Rmid;// X with m_Xmin as origin
195 double x=X-m_Xmin_strip;// x with m_Xmin_strip as origin
196 double zeta=z-m_Zmin;// local zeta [0,L]
197 return getVFromLocalXZ(x,zeta, checkRange);
198}

Referenced by DotsHelixFitter::calculateNewHelix().

◆ getVIDFromV()

int CgemGeoReadoutPlane::getVIDFromV ( double  V) const
inline

Definition at line 220 of file CgemGeoReadoutPlane.h.

220 {
221 double Vid = floor((V-m_Vmin_strip)/m_VPitch);
222 if(Vid<0) Vid=-1;
223 if(Vid>=m_NVstrips) Vid=-2;
224 //Vid=Vid+m_NVstrips*m_iSheet;
225 return Vid;
226}

Referenced by getClosestVStripID(), getDist2ClosestVStripCenter(), and getVIDInNextSheetFromVID().

◆ getVIDInNextSheetFromVID()

int CgemGeoReadoutPlane::getVIDInNextSheetFromVID ( int  vID,
double  phimin_next 
) const
inline

Definition at line 200 of file CgemGeoReadoutPlane.h.

200 {
201 int vId_next = -1;
202 //vID=vID-m_NVstrips*m_iSheet;
203 if( (vID>=0) && (vID<m_NVstrips) ){
204 double v = getCentralVFromVID(vID);
205 double v2 = getVInNextSheetFromV(v, phimin_next);
206 //if(v2>=0.) return floor(v2/m_VPitch);
207 vId_next = getVIDFromV(v2);// assume the next sheet with the same configuration
208 //if(m_iLayer>0) { vId_next=vId_next+(1-2*m_iSheet)*m_NVstrips;// with assumption Nsheet=2 for layerID>0 FIXME}
209 }
210 return vId_next;
211}
double getVInNextSheetFromV(double v, double phiminNext) const

◆ getVInNextSheetFromV()

double CgemGeoReadoutPlane::getVInNextSheetFromV ( double  v,
double  phiminNext 
) const
inline

Definition at line 61 of file CgemGeoReadoutPlane.h.

61 {
62 double dPhi = phiminNext-m_Phimin;// assume the next m_Phimin_strip is the same
63 while(dPhi<=0) dPhi+=CLHEP::twopi;
64 while(dPhi>CLHEP::twopi) dPhi-=CLHEP::twopi;
65 //cout<<"getVInNextSheetFromV: dphi = "<<dPhi<<endl;
66 double dX = dPhi*m_Rmid;
67 return v-dX*cos(m_StereoAngle);
68 }

Referenced by getVIDInNextSheetFromVID().

◆ getVmax()

double CgemGeoReadoutPlane::getVmax ( )
inline

Definition at line 41 of file CgemGeoReadoutPlane.h.

41{return m_Vmax;};

Referenced by CgemROOTGeo::InitGeometry().

◆ getVPitch()

double CgemGeoReadoutPlane::getVPitch ( )
inline

◆ getVStripLength()

double CgemGeoReadoutPlane::getVStripLength ( int  V_ID) const
inline

Definition at line 83 of file CgemGeoReadoutPlane.h.

84 {
85 double vStripLegth(0.);
86 if(V_ID>=0&&V_ID<m_NVstrips)
87 {
88 double V=getCentralVFromVID(V_ID);
89 double Lz=V/fabs(sin(m_StereoAngle));
90 if(Lz<=m_L)
91 {
92 vStripLegth=Lz/cos(m_StereoAngle);
93 }
94 else if(V/cos(m_StereoAngle)<=m_NXstrips*m_XPitch)
95 {
96 vStripLegth=m_L/cos(m_StereoAngle);
97 }
98 else vStripLegth=(m_Vtot-V)/fabs(sin(m_StereoAngle)*cos(m_StereoAngle));
99 }
100 return vStripLegth;
101 }

Referenced by TestHit::execute(), TestTrack::execute(), and TestGeometry::initialize().

◆ getWidth()

double CgemGeoReadoutPlane::getWidth ( )
inline

Definition at line 34 of file CgemGeoReadoutPlane.h.

34{return m_W;};

Referenced by CgemROOTGeo::InitGeometry().

◆ getX()

double CgemGeoReadoutPlane::getX ( double  phi) const

Definition at line 91 of file CgemGeoReadoutPlane.cxx.

92{
93 double dPhi = phi - m_Phimin;
94 while(dPhi<0) dPhi += CLHEP::twopi;
95 while(dPhi>=CLHEP::twopi) dPhi -= CLHEP::twopi;
96 if(dPhi>m_Phimax_strip) {
97 double dphi_start = phi-(m_Phimin+m_Phimin_strip);
98 while(dphi_start> 0) dphi_start-=2.*M_PI;
99 while(dphi_start<=-2.*M_PI) dphi_start+=2.*M_PI;
100 //double dphi_end = phi-(m_Phimin+m_Phimax_strip);
101 //while(dphi_end< 0) dphi_end+=2.*M_PI;
102 //while(dphi_end>=2*M_PI) dphi_end-=2.*M_PI;
103 double dphi_end = dPhi-m_Phimax_strip;
104 if(dphi_start+dphi_end>0) dPhi=dphi_start+m_Phimin_strip;
105 }
106 double X = m_Rmid*dPhi;// in X-zeta plane (X-V plane)
107 return X;
108}

Referenced by getClosestXStripID(), getDist2ClosestXStripCenter(), and getXStripID().

◆ getXmin()

double CgemGeoReadoutPlane::getXmin ( )
inline

Definition at line 33 of file CgemGeoReadoutPlane.h.

33{return m_Xmin;};

Referenced by CgemROOTGeo::InitGeometry().

◆ getXPitch()

double CgemGeoReadoutPlane::getXPitch ( )
inline

◆ getXStripID() [1/3]

int CgemGeoReadoutPlane::getXStripID ( double  phi) const

Definition at line 111 of file CgemGeoReadoutPlane.cxx.

111 {
112 double X = getX(phi);
113 //cout<<"X="<<X<<", Xmin_strip="<<m_Xmin_strip<<endl;
114 X -= m_Xmin_strip;
115 //cout<<"X="<<X<<endl;
116 int xID = floor(X/m_XPitch);
117 //cout<<"getXStripID: "<<xID<<endl;
118 if(xID<0) xID=-1;
119 //if(xID>=m_NXstrips) xID=m_NXstrips-1;
120 if(xID>=m_NXstrips) xID=-2;
121 //if(xID>=0&&xID<m_NXstrips) return xID;
122 //else return -1;
123 return xID;
124}

Referenced by getClosestXStripID(), getDist2ClosestXStripCenter(), getStripID(), and getXStripID().

◆ getXStripID() [2/3]

int CgemGeoReadoutPlane::getXStripID ( double  x,
double  y 
) const

Definition at line 175 of file CgemGeoReadoutPlane.cxx.

175 {
176 if(x!=0||y!=0){
177 double phi=atan2(y,x);
178 return getXStripID(phi);
179 } else{
180 return -3;
181 }
182}

◆ getXStripID() [3/3]

int CgemGeoReadoutPlane::getXStripID ( G4ThreeVector  pos) const

Definition at line 185 of file CgemGeoReadoutPlane.cxx.

185 {
186 double x = pos.x();
187 double y = pos.y();
188 return getXStripID(x,y);
189}

◆ getZFromPhiV()

double CgemGeoReadoutPlane::getZFromPhiV ( double  phi,
double  V,
int  checkXRange = 1 
) const
inline

Definition at line 213 of file CgemGeoReadoutPlane.h.

213 {
214 phi = phi-m_Phimin;
215 while(phi<0) phi+=CLHEP::twopi;
216 while(phi>=CLHEP::twopi) phi-=CLHEP::twopi;
217 return getZFromXV(phi*m_Rmid, V, checkXRange);
218}
double getZFromXV(double X, double V, int checkXRange=1, int checkVRange=1) const

◆ getZFromXV()

double CgemGeoReadoutPlane::getZFromXV ( double  X,
double  V,
int  checkXRange = 1,
int  checkVRange = 1 
) const

Definition at line 275 of file CgemGeoReadoutPlane.cxx.

275 {
276 double localX = X-m_Xmin_strip;// with m_Xmin_strip as origin
277 double z = -9999.0;
278 if( (checkVRange==0||((V>=m_Vmin_strip)&&(V<m_Vmax))) && ((checkXRange==0)||((localX>=0.0)&&(localX<=m_Xmax_strip-m_Xmin_strip))) ){
279 //double localXOfVstrip = V / cos(m_StereoAngle);
280 //double zeta = (localXOfVstrip - localX) / tan(m_StereoAngle);
281 //if( m_StereoAngle < 0 ) zeta += m_L;
282 //if( (zeta>=0) && (zeta<=m_L) )
283 //z = zeta + m_Zmin;
284 double z0=m_Zmax; if(m_k<0) z0=m_Zmin;
285 z = localX/tan(m_StereoAngle) - V/sin(m_StereoAngle) + z0;
286 }
287 return z;
288}
double tan(const BesAngle a)
Definition: BesAngle.h:216

Referenced by getZFromPhiV().

◆ getZmin()

double CgemGeoReadoutPlane::getZmin ( )
inline

Definition at line 35 of file CgemGeoReadoutPlane.h.

35{return m_Zmin;};

Referenced by TestMapping::CheckCrossingCgemBoss(), and CgemROOTGeo::InitGeometry().

◆ incidentAngleV()

double CgemGeoReadoutPlane::incidentAngleV ( Hep3Vector  momentum,
double  phi 
) const

Definition at line 458 of file CgemGeoReadoutPlane.cxx.

459{
460 Hep3Vector zaxis(0,0,1);
461 momentum.rotate(zaxis, -phi);
462 Hep3Vector xaxis(1,0,0);
463 momentum.rotate(xaxis, m_StereoAngle);
464 double phiTrk = momentum.phi();
465 double dPhi = dAngleAcute(phiTrk,0);
466 return dPhi;
467}
**********INTEGER nmxhep !maximum number of particles DOUBLE PRECISION vhep INTEGER jdahep COMMON hepevt $ !serial number $ !number of particles $ !status code $ !particle ident KF $ !parent particles $ !childreen particles $ !four momentum
double dAngleAcute(double phi1, double phi2) const

◆ incidentAngleX()

double CgemGeoReadoutPlane::incidentAngleX ( Hep3Vector  momentum,
double  phi 
) const

Definition at line 445 of file CgemGeoReadoutPlane.cxx.

446{
447 double phiTrk = momentum.phi();
448 /*double dPhi = phiTrk-phi;
449 while(dPhi<-CLHEP::pi) dPhi+=CLHEP::twopi;
450 while(dPhi> CLHEP::pi) dPhi-=CLHEP::twopi;
451 if(dPhi<-0.5*CLHEP::pi) dPhi+=CLHEP::pi;
452 else if(dPhi>0.5*CLHEP::pi) dPhi-=CLHEP::pi;
453 */
454 double dPhi = dAngleAcute(phiTrk,phi);
455 return dPhi;
456}

◆ OnThePlane()

bool CgemGeoReadoutPlane::OnThePlane ( double  phi,
double  z 
) const
inline

Definition at line 154 of file CgemGeoReadoutPlane.h.

155{
156 double dPhi=phi-m_Phimin;// [0, 2pi) with m_Phimin as origin
157 while(dPhi<0) dPhi+=CLHEP::twopi;
158 while(dPhi>=2*M_PI) dPhi-=CLHEP::twopi;
159 if(dPhi>=m_Phimin_strip && dPhi<=m_Xmax_strip/m_Rmid && z>=m_Zmin && z<=m_Zmax) return true;
160 else return false;
161}

Referenced by InductionGar2::setMultiElectrons(), and InductionGar::setMultiElectrons().

◆ print()

void CgemGeoReadoutPlane::print ( )

Definition at line 76 of file CgemGeoReadoutPlane.cxx.

76 {
77 cout<<"construct one readout-plane with: "<<endl;
78 cout<<" iLayer "<<m_iLayer<<", iSheet "<<m_iSheet<<endl;
79 cout<<" Rx, Rv, Xmin, width = "<< m_RX<<", "<<m_RV<<", "<<m_Xmin<<", "<<m_W<<endl;
80 cout<<" Zmin, L = "<< m_Zmin <<", "<<m_L<<endl;
81 cout<<" XPitch, XstripWidth ="<<m_XPitch<<", "<<m_XstripWidth<<endl;
82 cout<<" sensitive X (Xmin as origin): "<<m_Xmin_strip<<" to "<<m_Xmax_strip<<endl;
83 cout<<" sensitive range in phi (phimin as origin): "<<m_Phimin_strip<<" to "<<m_Xmax_strip/m_Rmid<<endl;
84 //cout<<" VPitch, VstripWidth, StereoAngle, Vmax ="<<m_VPitch<<", "<<m_VstripWidth<<", "<<m_StereoAngle<<", "<<m_Vmax<<endl;
85 cout<<" VPitch, VstripWidth, StereoAngle, k ="<<m_VPitch<<", "<<m_VstripWidth<<", "<<m_StereoAngle<<", "<<m_k<<endl;
86 cout<<" Vtot, Vmin, Vmax = "<<m_Vtot<<", "<<m_Vmin_strip<<", "<<m_Vmax<<endl;
87 cout<<" N_Xstrips, N_Vstrips="<<m_NXstrips<<", "<<m_NVstrips<<endl;
88 cout<<" MidRGap="<<m_MidRGap<<", OutRGap="<<m_OutRGap<<endl;
89}

Referenced by CgemGeoReadoutPlane().


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