24 register FTWire ** hptr = _wireHits.firstPtr();
25 FTWire **
const last = _wireHits.lastPtr();
27 wireHitsByLocalLayer[(**hptr).layer().localLayerId()].
append(*hptr);
28 }
while((hptr++)!=last);
29 float length_phi = 0.;
35 const int nLayer = _superLayer.nLayer();
37 for (
int i = 0; i^nLayer; i++){
38 int N_wireHits = wireHitsByLocalLayer[i].
length();
40 float localPhi_max = 0.;
41 float localPhi_min = 7.;
42 for (
int j = 0; j^N_wireHits; j++){
43 float localPhi = wireHitsByLocalLayer[i][j]->phi();
46 if (localPhi > localPhi_max) localPhi_max = localPhi;
47 if (localPhi < localPhi_min) localPhi_min = localPhi;
49 float local_length_phi = localPhi_max - localPhi_min;
50 if (local_length_phi >
M_PI)
51 local_length_phi = 2*
M_PI - local_length_phi;
52 if ( local_length_phi > length_phi ) length_phi = local_length_phi;
55 }
else if(!AlreadyFound){
67 if (innerBoundId > 0){
70 if (outerBoundId < nLayer - 1){
77 _innerBoundHits.append(wireHitsByLocalLayer[innerBoundId]);
78 _outerBoundHits.append(wireHitsByLocalLayer[outerBoundId]);
86 int n = _innerBoundHits.length();
87 int m = _outerBoundHits.length();
90 _incoming_x = 0.5*(_innerBoundHits[0]->x()+_innerBoundHits[1]->x());
91 _incoming_y = 0.5*(_innerBoundHits[0]->y()+_innerBoundHits[1]->
y());
93 _incoming_x = _innerBoundHits[0]->x();
94 _incoming_y = _innerBoundHits[0]->y();
97 _outgoing_x = 0.5*(_outerBoundHits[0]->x()+_outerBoundHits[1]->x());
98 _outgoing_y = 0.5*(_outerBoundHits[0]->y()+_outerBoundHits[1]->
y());
100 _outgoing_x = _outerBoundHits[0]->x();
101 _outgoing_y = _outerBoundHits[0]->y();
103 float in_r = _innerBoundHits.first()->layer().r();
104 float out_r = _outerBoundHits.first()->layer().r();
105 float sbX = _incoming_x - _outgoing_x;
106 float sbY = _incoming_y - _outgoing_y;
108 _kappa = 2.*(-1. / 2.99792458 /m_pmgnIMF->getReferField())*(_outgoing_x*_incoming_y - _outgoing_y*_incoming_x) /
109 (in_r*out_r*sqrt(sbX*sbX+sbY*sbY));
110 _r = 0.5*(in_r + out_r);
117 Gaudi::svcLocator()->service(
"MessageSvc",
msgSvc);
119 MsgStream log(
msgSvc,
"FTFinder");
124 int n = _innerBoundHits.length();
125 int m = _outerBoundHits.length();
128 ? 0.5*(_innerBoundHits[0]->x()+_innerBoundHits[1]->x())
129 : _innerBoundHits[0]->x();
131 ? 0.5*(_innerBoundHits[0]->
y()+_innerBoundHits[1]->
y())
132 : _innerBoundHits[0]->y();
134 ? 0.5*(_outerBoundHits[0]->x()+_outerBoundHits[1]->x())
135 : _outerBoundHits[0]->x();
137 ? 0.5*(_outerBoundHits[0]->
y()+_outerBoundHits[1]->
y())
138 : _outerBoundHits[0]->y();
146 const FTLayer * bound = &_innerBoundHits.first()->layer();
147 log<<MSG::DEBUG<<
"started inS calculation with layer limit "<< (double)bound->
limit()<<endreq;
148 if (!(la.
sd((
double)bound->
r(),(
double)_incoming_x,
149 (
double)_incoming_y,(
double)bound->
limit(),
151 double inZ = bound->
z(d);
153 bound = &_outerBoundHits.first()->layer();
154 log<<MSG::DEBUG<<
"started outS calculation with layer limit "<< (double)bound->
limit()<<endreq;
155 if (!(la.
sd((
double)bound->
r(),(
double)_outgoing_x,
156 (
double)_outgoing_y,(
double)bound->
limit(),
158 double outZ = bound->
z(d);
159 _sList->append(inS+outS);
162 log<<MSG::DEBUG<<
"-----> coupled! DONE! "<<endreq;