26 int fan_number =
int((
p.phi() -
halfpi -
lwc()->m_ZeroFanPhi_ForDetNeaFan) /
lwc()->m_FanStepOnPhi);
29 printf(
"DistanceToTheNearestFan: initial FN %4d\n", fan_number);
36 if(
d0 < 0.) delta = -1;
42 }
while(
d0 *
d1 > 0.);
44 if(delta > 0) fan_number --;
46 int adj_fan_number = fan_number;
47 if(adj_fan_number <
lwc()->m_FirstFan) {
48 p.rotateZ((adj_fan_number -
lwc()->m_FirstFan) *
lwc()->m_FanStepOnPhi);
50 }
else if(adj_fan_number >=
lwc()->m_LastFan) {
51 p.rotateZ((adj_fan_number -
lwc()->m_LastFan + 1) *
lwc()->m_FanStepOnPhi);
56 out_fan_number = adj_fan_number;
72 CLHEP::Hep3Vector
p1 =
p;
74 int fan_number =
int((
p.phi() -
halfpi -
lwc()->m_ZeroFanPhi) /
lwc()->m_FanStepOnPhi);
83 if(
d0 < 0.) delta = -1;
89 }
while(
d0 *
d1 > 0.);
90 if(delta > 0) fan_number --;
91 if(!
lwc()->m_isElectrode) fan_number ++;
93 int adj_fan_number = fan_number;
94 if(adj_fan_number <
lwc()->m_FirstFan) adj_fan_number =
lwc()->
m_FirstFan - 1;
95 else if(adj_fan_number >
lwc()->m_LastFan) adj_fan_number =
lwc()->
m_LastFan;
101 printf(
"GetPhiGapAndSide: MFN %4d\n", adj_fan_number);
103 return std::pair<int, int>(adj_fan_number,
side);