Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Namespace Members | Class Members | File Members | Related Pages

FTSegment Class Reference

#include <FTSegment.h>

List of all members.

Public Member Functions

float attr_const (void) const
 returns the sin(dphi)/MOD(r_out-r_in)
float attr_const (void) const
 returns the sin(dphi)/MOD(r_out-r_in)
void connect_inner (const FTWire *)
 connect single hit
void connect_inner (const FTList< FTWire * > &, const FTList< FTWire * > &)
void connect_inner (const FTWire *)
 connect single hit
void connect_inner (const FTList< FTWire * > &, const FTList< FTWire * > &)
void connect_outer (const FTWire *)
 connect single hit
void connect_outer (const FTList< FTWire * > &, const FTList< FTWire * > &)
 connect short segments
void connect_outer (const FTWire *)
 connect single hit
void connect_outer (const FTList< FTWire * > &, const FTList< FTWire * > &)
 connect short segments
int examine (void)
 examine segment
int examine (void)
 examine segment
 FTSegment (FTSuperLayer *super, FTList< FTWire * > &hits)
 constructors
 FTSegment (FTSuperLayer *super, FTList< FTWire * > &hits)
 constructors
float incomingPhi (void) const
 returns phi of incoming position
float incomingPhi (void) const
 returns phi of incoming position
float incomingX (void) const
 returns x of incoming position
float incomingX (void) const
 returns x of incoming position
float incomingY (void) const
 returns y of incoming position
float incomingY (void) const
 returns y of incoming position
FTList< FTWire * > & innerBoundHits (void) const
 returns innerBoundHits
FTList< FTWire * > & innerBoundHits (void) const
 returns innerBoundHits
float kappa (void) const
 returns kappa(axial)
float kappa (void) const
 returns kappa(axial)
void linkStereoSegments (void)
 link stereo segments by tanLambda
void linkStereoSegments (void)
 link stereo segments by tanLambda
FTList< FTWire * > & outerBoundHits (void) const
 returns outerBoundHits
FTList< FTWire * > & outerBoundHits (void) const
 returns outerBoundHits
float outgoingPhi (void) const
 returns phi of outgoing position
float outgoingPhi (void) const
 returns phi of outgoing position
float outgoingX (void) const
 returns x of outgoing position
float outgoingX (void) const
 returns x of outgoing position
float outgoingY (void) const
 returns y of outgoing position
float outgoingY (void) const
 returns y of outgoing position
void printout (void)
void printout (void)
float r (void) const
 returns r from origin
float r (void) const
 returns r from origin
float s (void) const
 returns s for matched 2D track
float s (void) const
 returns s for matched 2D track
FTSuperLayersuperLayer (void) const
 returns super-layer
FTSuperLayersuperLayer (void) const
 returns super-layer
FTTracktrack (FTTrack *)
 set track
FTTracktrack (void) const
 returns track
FTTracktrack (FTTrack *)
 set track
FTTracktrack (void) const
 returns track
void update (void)
 update information for axial segment
void update (void)
 update information for axial segment
int update3D (const FTTrack *track)
 update information for stereo segment
int update3D (const FTTrack *track)
 update information for stereo segment
FTList< FTWire * > & wireHits (void) const
 returns wire-hit list
FTList< FTWire * > & wireHits (void) const
 returns wire-hit list
float z (void) const
 returns z for matched 2D track
float z (void) const
 returns z for matched 2D track
 ~FTSegment ()
 destructors
 ~FTSegment ()
 destructors

Static Public Attributes

MdcParameterparam
MdcParameterparam = MdcParameter::instance()

Private Attributes

float _incoming_x
float _incoming_y
FTList< FTWire * > & _innerBoundHits
FTList< FTWire * > & _innerBoundHits
FTList< FTWire * > & _outerBoundHits
FTList< FTWire * > & _outerBoundHits
float _outgoing_x
float _outgoing_y
float _r
FTList< float > * _sList
FTList< float > * _sList
FTSuperLayer_superLayer
FTSuperLayer_superLayer
FTList< FTWire * > & _wireHits
FTList< FTWire * > & _wireHits
float _kappa
FTTrack_track
FTTrack_track
FTList< FTTrack * > * _trackList
FTList< FTTrack * > * _trackList
FTList< float > * _zList
FTList< float > * _zList


Constructor & Destructor Documentation

FTSegment::FTSegment FTSuperLayer super,
FTList< FTWire * > &  hits
[inline]
 

constructors

00138   : _wireHits(hits),
00139     _superLayer(*super),
00140     _innerBoundHits(*(new FTList<FTWire *>(3))),
00141     _outerBoundHits(*(new FTList<FTWire *>(3))),
00142     _sList(NULL),
00143     _zList(NULL),
00144     _track(NULL)
00145 {
00146 }

FTSegment::~FTSegment  )  [inline]
 

destructors

00150 {
00151   delete &_wireHits;
00152   delete &_innerBoundHits;
00153   delete &_outerBoundHits;
00154   if (_sList){
00155     delete _sList;
00156     delete _zList;
00157     delete _trackList;
00158   }
00159 }

FTSegment::FTSegment FTSuperLayer super,
FTList< FTWire * > &  hits
 

constructors

FTSegment::~FTSegment  ) 
 

destructors


Member Function Documentation

float FTSegment::attr_const void   )  const
 

returns the sin(dphi)/MOD(r_out-r_in)

float FTSegment::attr_const void   )  const [inline]
 

returns the sin(dphi)/MOD(r_out-r_in)

00290 {
00291   float x_len = _outgoing_x - _incoming_x;
00292   float y_len = _outgoing_y - _incoming_y;
00293   float phi_l = outgoingPhi() - incomingPhi();
00294   return sin(phi_l) / sqrt(x_len*x_len + y_len*y_len);
00295 }

void FTSegment::connect_inner const FTWire  ) 
 

connect single hit

void FTSegment::connect_inner const FTList< FTWire * > &  ,
const FTList< FTWire * > & 
 

void FTSegment::connect_inner const FTWire  )  [inline]
 

connect single hit

00193 {
00194   _wireHits.append((FTWire *)h);
00195   _innerBoundHits.clear();
00196   _innerBoundHits.append((FTWire *)h);
00197 }

void FTSegment::connect_inner const FTList< FTWire * > &  ,
const FTList< FTWire * > & 
[inline]
 

00175 {
00176   _wireHits.append(innerHits);
00177   _innerBoundHits.clear();
00178   _innerBoundHits.append(innerBound);
00179 }

void FTSegment::connect_outer const FTWire  ) 
 

connect single hit

void FTSegment::connect_outer const FTList< FTWire * > &  ,
const FTList< FTWire * > & 
 

connect short segments

void FTSegment::connect_outer const FTWire  )  [inline]
 

connect single hit

00184 {
00185   _wireHits.append((FTWire *)h);
00186   _outerBoundHits.clear();
00187   _outerBoundHits.append((FTWire *)h);
00188 }

void FTSegment::connect_outer const FTList< FTWire * > &  ,
const FTList< FTWire * > & 
[inline]
 

connect short segments

00165 {
00166   _wireHits.append(outerHits);
00167   _outerBoundHits.clear();
00168   _outerBoundHits.append(outerBound);
00169 }

int FTSegment::examine void   ) 
 

examine segment

int FTSegment::examine void   ) 
 

examine segment

00019                   {
00020   int stat = -1;
00021   FTList<FTWire *> wireHitsByLocalLayer[4] = {4,4,4,4};
00022 
00023   register FTWire ** hptr = _wireHits.firstPtr();
00024   FTWire ** const last = _wireHits.lastPtr();
00025   do{
00026     wireHitsByLocalLayer[(**hptr).layer().localLayerId()].append(*hptr);
00027   }while((hptr++)!=last);
00028   float length_phi = 0.;
00029   int innerBoundId = 0;
00030   int outerBoundId = 0;
00031   int AlreadyFound = 0;
00032   //int LocalLayerLength; 
00033   //int HalfLocalLayerLength;
00034   const int nLayer = _superLayer.nLayer();
00035   // to look for the innerBound and outBand of the hits
00036   for (int i = 0; i^nLayer; i++){
00037     int N_wireHits = wireHitsByLocalLayer[i].length();
00038     if(N_wireHits){
00039       float localPhi_max = 0.;
00040       float localPhi_min = 7.;
00041       for (int j = 0; j^N_wireHits; j++){
00042         float localPhi = wireHitsByLocalLayer[i][j]->phi();
00043         //LocalLayerLength = wireHitsByLocalLayer[i][j]->layer().NWire();
00044         //HalfLocalLayerLength = LocalLayerLength >> 1;     
00045         if (localPhi > localPhi_max) localPhi_max = localPhi;
00046         if (localPhi < localPhi_min) localPhi_min = localPhi;
00047       }
00048       float local_length_phi = localPhi_max - localPhi_min;
00049       if (local_length_phi > M_PI)
00050         local_length_phi = 2*M_PI - local_length_phi;
00051       if ( local_length_phi > length_phi ) length_phi = local_length_phi;
00052       outerBoundId = i;
00053       AlreadyFound = 1;
00054     } else if(!AlreadyFound){
00055       innerBoundId++;
00056     } else {
00057       break;
00058     }
00059   }
00060   //length_phi needed to decide more carefully 
00061   //  if (length_phi>0.09){
00062   //  cout<<length_phi<<" : "<<FTSuperLayer::_maxDphi[_superLayer.superLayerId()]*2*M_PI/180<<endl;
00063   if (length_phi>FTSuperLayer::_maxDphi[_superLayer.superLayerId()]*2*M_PI/180){ //by X.-R. Lu
00064     stat = 3;                   // to be divided
00065   }else{
00066     if (innerBoundId > 0){
00067       stat = 2;                 // outer short
00068     }else{
00069       if (outerBoundId < nLayer - 1){
00070         stat = 1;               // inner short
00071       }else{
00072         stat = 0;               // long simple
00073       }
00074     }
00075   }
00076   _innerBoundHits.append(wireHitsByLocalLayer[innerBoundId]);
00077   _outerBoundHits.append(wireHitsByLocalLayer[outerBoundId]);
00078   return stat;
00079 }

float FTSegment::incomingPhi void   )  const
 

returns phi of incoming position

float FTSegment::incomingPhi void   )  const [inline]
 

returns phi of incoming position

00258 {
00259   if (_innerBoundHits.length() ^ 1) {
00260     float phi_1st = _innerBoundHits[0]->phi();
00261     float phi_2nd = _innerBoundHits[1]->phi();
00262     float phi = 0.5 * (phi_1st + phi_2nd);
00263     if (fabs(phi_1st - phi_2nd) > M_PI) {
00264       return (phi>M_PI) ? (phi-M_PI) : (phi+M_PI);
00265     }
00266     return phi;
00267   }
00268   return _innerBoundHits[0]->phi();
00269 }

float FTSegment::incomingX void   )  const
 

returns x of incoming position

float FTSegment::incomingX void   )  const [inline]
 

returns x of incoming position

00244 {
00245   return _incoming_x;
00246 }

float FTSegment::incomingY void   )  const
 

returns y of incoming position

float FTSegment::incomingY void   )  const [inline]
 

returns y of incoming position

00251 {
00252   return _incoming_y;
00253 }

FTList<FTWire *>& FTSegment::innerBoundHits void   )  const
 

returns innerBoundHits

FTList< FTWire * > & FTSegment::innerBoundHits void   )  const [inline]
 

returns innerBoundHits

00216 {
00217   return _innerBoundHits;
00218 }

float FTSegment::kappa void   )  const
 

returns kappa(axial)

float FTSegment::kappa void   )  const [inline]
 

returns kappa(axial)

00307 {
00308   return _kappa;
00309 }

void FTSegment::linkStereoSegments void   ) 
 

link stereo segments by tanLambda

void FTSegment::linkStereoSegments void   ) 
 

link stereo segments by tanLambda

00166                                  {
00167   float min_D_z = 9999.;
00168   float S = 0.;
00169   float Z = 0.;
00170   FTTrack * selected = NULL;
00171   int m = _trackList->length();
00172   for (int j = 0; j^m; j++){
00173     FTTrack * t = (*_trackList)[j];
00174     float z_tmp = (*_zList)[j];
00175     float s_tmp = (*_sList)[j];
00176     float D_z = fabs(t->d_z(s_tmp,z_tmp));
00177     if (D_z < min_D_z){
00178       selected = t;
00179       min_D_z = D_z;
00180       S = s_tmp;
00181       Z = z_tmp;
00182     }
00183   }
00184   if (selected){
00185     selected->append_stereo(this,S,Z); 
00186     
00187   }
00188 }

FTList<FTWire *>& FTSegment::outerBoundHits void   )  const
 

returns outerBoundHits

FTList< FTWire * > & FTSegment::outerBoundHits void   )  const [inline]
 

returns outerBoundHits

00223 {
00224   return _outerBoundHits;
00225 }

float FTSegment::outgoingPhi void   )  const
 

returns phi of outgoing position

float FTSegment::outgoingPhi void   )  const [inline]
 

returns phi of outgoing position

00274 {
00275   if (_outerBoundHits.length() ^ 1) {
00276     float phi_1st = _outerBoundHits[0]->phi();
00277     float phi_2nd = _outerBoundHits[1]->phi();
00278     float phi = 0.5 * (phi_1st + phi_2nd);
00279     if (fabs(phi_1st - phi_2nd) > M_PI) {
00280       return (phi>M_PI) ? (phi-M_PI) : (phi+M_PI);
00281     }
00282     return phi;
00283   }
00284   return _outerBoundHits[0]->phi();
00285 }

float FTSegment::outgoingX void   )  const
 

returns x of outgoing position

float FTSegment::outgoingX void   )  const [inline]
 

returns x of outgoing position

00230 {
00231   return _outgoing_x;
00232 }

float FTSegment::outgoingY void   )  const
 

returns y of outgoing position

float FTSegment::outgoingY void   )  const [inline]
 

returns y of outgoing position

00237 {
00238   return _outgoing_y;
00239 }

void FTSegment::printout void   ) 
 

printout of the wireHits info. added by X.-R. Lu

void FTSegment::printout void   ) 
 

printout of the wireHits info. added by X.-R. Lu

00192                        {
00193   
00194   IMessageSvc *msgSvc;
00195   Gaudi::svcLocator()->service("MessageSvc", msgSvc);
00196   
00197   MsgStream log(msgSvc, "FTSegment");
00198   log << MSG::DEBUG << "pintout of one segment:" << endreq;  
00199   int n=_wireHits.length();
00200   for(int i=0; i^n; i++){
00201     FTWire &h = *_wireHits[i];
00202      log << MSG::DEBUG << "hit: layer " << h.layer().layerId() << " phi "<< h.phi() << endreq;
00203   }
00204 }

float FTSegment::r void   )  const
 

returns r from origin

float FTSegment::r void   )  const [inline]
 

returns r from origin

00300 {
00301   return _r;
00302 }

float FTSegment::s void   )  const
 

returns s for matched 2D track

float FTSegment::s void   )  const [inline]
 

returns s for matched 2D track

00314 {
00315   return _sList->first();
00316 }

FTSuperLayer& FTSegment::superLayer void   )  const
 

returns super-layer

FTSuperLayer & FTSegment::superLayer void   )  const [inline]
 

returns super-layer

00202 {
00203   return _superLayer;
00204 }

FTTrack* FTSegment::track FTTrack  ) 
 

set track

FTTrack* FTSegment::track void   )  const
 

returns track

FTTrack * FTSegment::track FTTrack  )  [inline]
 

set track

00335 {
00336   return _track = src;
00337 }

FTTrack * FTSegment::track void   )  const [inline]
 

returns track

00328 {
00329   return _track;
00330 }

void FTSegment::update void   ) 
 

update information for axial segment

void FTSegment::update void   ) 
 

update information for axial segment

00082                      {
00083   //static const float alpha(333.564095);
00084   //float N_kappa;
00085   int n = _innerBoundHits.length();
00086   int m = _outerBoundHits.length();
00087 
00088   if (n^1) {
00089     _incoming_x = 0.5*(_innerBoundHits[0]->x()+_innerBoundHits[1]->x());
00090     _incoming_y = 0.5*(_innerBoundHits[0]->y()+_innerBoundHits[1]->y());
00091   } else {
00092     _incoming_x = _innerBoundHits[0]->x();
00093     _incoming_y = _innerBoundHits[0]->y();
00094   }
00095   if (m^1) {
00096     _outgoing_x = 0.5*(_outerBoundHits[0]->x()+_outerBoundHits[1]->x());
00097     _outgoing_y = 0.5*(_outerBoundHits[0]->y()+_outerBoundHits[1]->y());
00098   } else {
00099     _outgoing_x = _outerBoundHits[0]->x();
00100     _outgoing_y = _outerBoundHits[0]->y();
00101   }
00102   float in_r = _innerBoundHits.first()->layer().r();
00103   float out_r = _outerBoundHits.first()->layer().r();
00104   float sbX = _incoming_x - _outgoing_x;
00105   float sbY = _incoming_y - _outgoing_y;
00106   // kappa = -2. * alpha * ((Vin X Vout)_z / |Vin|*|Vout|) / |Vin-Vout|
00107   _kappa = 2.*(param->_alpha)*(_outgoing_x*_incoming_y - _outgoing_y*_incoming_x) /
00108     (in_r*out_r*sqrt(sbX*sbX+sbY*sbY));
00109   _r = 0.5*(in_r + out_r);
00110 }

int FTSegment::update3D const FTTrack track  ) 
 

update information for stereo segment

int FTSegment::update3D const FTTrack track  ) 
 

update information for stereo segment

00114                                         {
00115   IMessageSvc *msgSvc;
00116   Gaudi::svcLocator()->service("MessageSvc", msgSvc);
00117   
00118   MsgStream log(msgSvc, "FTFinder");
00119   
00120   /*if (_superLayer.superLayerId() > 
00121     track->axial_segments().first()->superLayer().superLayerId() + 4) return 0;*/
00122   if (!_sList){
00123     int n = _innerBoundHits.length();
00124     int m = _outerBoundHits.length();
00125 
00126     _incoming_x = (n^1) 
00127       ? 0.5*(_innerBoundHits[0]->x()+_innerBoundHits[1]->x()) 
00128       : _innerBoundHits[0]->x();
00129     _incoming_y = (n^1) 
00130       ? 0.5*(_innerBoundHits[0]->y()+_innerBoundHits[1]->y()) 
00131       : _innerBoundHits[0]->y();
00132     _outgoing_x = (m^1) 
00133       ? 0.5*(_outerBoundHits[0]->x()+_outerBoundHits[1]->x()) 
00134       : _outerBoundHits[0]->x();
00135     _outgoing_y = (m^1) 
00136       ? 0.5*(_outerBoundHits[0]->y()+_outerBoundHits[1]->y()) 
00137       : _outerBoundHits[0]->y();
00138     _sList = new FTList<float>(5);
00139     _zList = new FTList<float>(5);
00140     _trackList = new FTList<FTTrack *>(5);
00141   }
00142   const Lpav & la = track->lpav();
00143   double d;
00144   double inS;
00145   const FTLayer * bound = &_innerBoundHits.first()->layer();
00146   log<<MSG::DEBUG<<"started inS calculation with layer limit "<< (double)bound->limit()<<endreq;
00147   if (!(la.sd((double)bound->r(),(double)_incoming_x,
00148               (double)_incoming_y,(double)bound->limit(),  // multiplied with an factor due to bad rphi fit
00149               inS,d))) return 0;
00150   double inZ = bound->z(d);
00151   double outS; 
00152   bound = &_outerBoundHits.first()->layer();
00153   log<<MSG::DEBUG<<"started outS calculation with layer limit "<< (double)bound->limit()<<endreq;
00154   if (!(la.sd((double)bound->r(),(double)_outgoing_x,
00155               (double)_outgoing_y,(double)bound->limit(),  // multiplied with an factor due to bad rphi fit
00156               outS,d))) return 0;
00157   double outZ = bound->z(d);
00158   _sList->append(inS+outS);
00159   _zList->append(inZ+outZ);
00160   _trackList->append((FTTrack *)track);
00161   log<<MSG::DEBUG<<"-----> coupled! DONE! "<<endreq;
00162   return 1;
00163 }

FTList<FTWire *>& FTSegment::wireHits void   )  const
 

returns wire-hit list

FTList< FTWire * > & FTSegment::wireHits void   )  const [inline]
 

returns wire-hit list

00209 {
00210   return _wireHits;
00211 }

float FTSegment::z void   )  const
 

returns z for matched 2D track

float FTSegment::z void   )  const [inline]
 

returns z for matched 2D track

00321 {
00322   return _zList->first();
00323 }


Member Data Documentation

float FTSegment::_incoming_x [private]
 

float FTSegment::_incoming_y [private]
 

FTList<FTWire *>& FTSegment::_innerBoundHits [private]
 

FTList<FTWire *>& FTSegment::_innerBoundHits [private]
 

float FTSegment::_kappa [private]
 

FTList<FTWire *>& FTSegment::_outerBoundHits [private]
 

FTList<FTWire *>& FTSegment::_outerBoundHits [private]
 

float FTSegment::_outgoing_x [private]
 

float FTSegment::_outgoing_y [private]
 

float FTSegment::_r [private]
 

FTList<float>* FTSegment::_sList [private]
 

FTList<float>* FTSegment::_sList [private]
 

FTSuperLayer& FTSegment::_superLayer [private]
 

FTSuperLayer& FTSegment::_superLayer [private]
 

FTTrack* FTSegment::_track [private]
 

FTTrack* FTSegment::_track [private]
 

FTList<FTTrack *>* FTSegment::_trackList [private]
 

FTList<FTTrack *>* FTSegment::_trackList [private]
 

FTList<FTWire *>& FTSegment::_wireHits [private]
 

FTList<FTWire *>& FTSegment::_wireHits [private]
 

FTList<float>* FTSegment::_zList [private]
 

FTList<float>* FTSegment::_zList [private]
 

MdcParameter* FTSegment::param [static]
 

MdcParameter * FTSegment::param = MdcParameter::instance() [static]
 


The documentation for this class was generated from the following files:
Generated on Wed Feb 2 16:15:30 2011 for BOSS6.5.5 by  doxygen 1.3.9.1