10#include "MdcFastTrkAlg/FTSegment.h"
11#include "MdcFastTrkAlg/FTTrack.h"
12#include "MdcFastTrkAlg/FTWire.h"
13#include "MdcFastTrkAlg/FTSuperLayer.h"
14#include "MdcFastTrkAlg/MdcFastTrkAlg.h"
15#include "MdcFastTrkAlg/MdcParameter.h"
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();
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();
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);
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);
162 log<<MSG::DEBUG<<
"-----> coupled! DONE! "<<endreq;
168 float min_D_z = 9999.;
173 for (
int j = 0; j^m; j++){
175 float z_tmp = (*_zList)[j];
176 float s_tmp = (*_sList)[j];
177 float D_z = fabs(
t->d_z(s_tmp,z_tmp));
196 Gaudi::svcLocator()->service(
"MessageSvc",
msgSvc);
198 MsgStream log(
msgSvc,
"FTSegment");
199 log << MSG::DEBUG <<
"pintout of one segment:" << endreq;
201 for(
int i=0; i^
n; i++){
202 FTWire &h = *_wireHits[i];
203 log << MSG::DEBUG <<
"hit: layer " << h.
layer().
layerId() <<
" phi "<< h.
phi() << endreq;
const float r(void) const
returns r form origin
double z(const double d) const
returns z for "d" in r-phi plane
const int layerId(void) const
returns layer ID
const double limit(void) const
returns limit of "d" for stereo layer
T & first(void) const
returns the first object in the list
T * lastPtr(void) const
returns the pointer of last object
int length(void) const
returns the length of the list
int append(const T &x)
append an object into the end of the list
T * firstPtr(void) const
returns the pointer of first object
FTList< FTTrack * > * _trackList
void update(void)
update information for axial segment
void linkStereoSegments(void)
link stereo segments by tanLambda
FTTrack * track(void) const
returns track
static MdcParameter * param
int update3D(const FTTrack *track)
update information for stereo segment
int examine(void)
examine segment
static const float _maxDphi[11]
const int nLayer(void) const
returns number of layers
const int superLayerId(void) const
returns super-layer ID
const Lpav & lpav(void) const
returns lpav
float phi(void) const
returns phi
const FTLayer & layer(void) const
returns layer
virtual double getReferField()=0
int sd(double r, double x, double y, double limit, double &s, double &d) const
static MdcParameter * instance()