/home/bes3soft/bes3soft/Boss/7.0.2/dist/7.0.2/Reconstruction/MdcPatRec/TrkBase/TrkBase-00-01-12/src/TrkHotListEmpty.cxx

Go to the documentation of this file.
00001 //--------------------------------------------------------------------------
00002 // File and Version Information:
00003 //      $Id: TrkHotListEmpty.cxx,v 1.1.1.1 2005/04/21 06:01:42 zhangy Exp $
00004 //
00005 // Description:
00006 //     
00007 // Environment:
00008 //      Software developed for the BaBar Detector at the SLAC B-Factory.
00009 //
00010 // Author(s): Steve Schaffner
00011 //
00012 //------------------------------------------------------------------------
00013 
00014 //#include "BaBar/BaBar.hh"
00015 #include "TrkBase/TrkHotListEmpty.h"
00016 #include "TrkBase/TrkHitOnTrk.h"
00017 #include <assert.h>
00018 #include <algorithm>
00019 
00020 TrkHotListEmpty::TrkHotListEmpty(int nact, int nsv, int ndc,
00021                                  double sfr, double  efr)
00022 {
00023   _nPhi = nsv/2; _nZ = nsv-_nPhi;
00024   _nAxial = ndc/3; _nStereo = ndc-_nAxial;
00025   _stFndRng = sfr;
00026   _endFndRng = efr;
00027   _firstmdc = _lastmdc = 0;
00028   for(unsigned isvt=0;isvt<5;isvt++)
00029     _svtpat[isvt] = TrkView(TrkEnums::noView);
00030 }
00031 
00032 TrkHotListEmpty::TrkHotListEmpty(unsigned nPhi, unsigned nZ,
00033                                  unsigned nAxial, unsigned nStereo,
00034                                  double sfr, double efr,
00035                                  unsigned firstmdc,unsigned lastmdc, 
00036                                  TrkView svtpattern[5],
00037                                  const std::vector<unsigned>& inactive) :
00038   _nAxial(nAxial),_nStereo(nStereo),_nPhi(nPhi),_nZ(nZ),
00039   _stFndRng(sfr),_endFndRng(efr),_firstmdc(firstmdc),_lastmdc(lastmdc),
00040   _inactive(inactive)
00041 {
00042   for(unsigned j=0;j<5;j++)
00043     _svtpat[j] = svtpattern[j];
00044 }
00045 
00046 TrkHotListEmpty::TrkHotListEmpty(const TrkHotListEmpty& rhs)
00047 {
00048   _nAxial    = rhs._nAxial;
00049   _nStereo   = rhs._nStereo;
00050   _nPhi      = rhs._nPhi;
00051   _nZ        = rhs._nZ;
00052   _stFndRng  = rhs._stFndRng;
00053   _endFndRng = rhs._endFndRng;
00054   _firstmdc  = rhs._firstmdc;
00055   _lastmdc   = rhs._lastmdc;
00056   _inactive  = rhs._inactive;
00057   for (unsigned i=0;i<5;++i) _svtpat[i] = rhs._svtpat[i];
00058 
00059 }
00060 
00061 
00062 TrkHotListEmpty&
00063 TrkHotListEmpty::operator = (const TrkHotList& other) {
00064   if(this != &other){
00065     _nPhi = other.nSvt(TrkEnums::xyView);
00066     _nZ = other.nSvt(TrkEnums::zView);
00067     _nAxial = other.nMdc(TrkEnums::xyView);
00068     _nStereo = other.nMdc(TrkEnums::zView);
00069     _stFndRng = other.startFoundRange();
00070     _endFndRng = other.endFoundRange();
00071     _firstmdc = other.firstMdcLayer();
00072     _lastmdc = other.lastMdcLayer();
00073     for(unsigned ilay=0;ilay<5;ilay++)
00074       _svtpat[ilay] = other.svtView(ilay+1);// layer numbering starts at 1
00075     unsigned nhits = other.nHit();
00076     std::vector<unsigned> inactive;
00077     for(unsigned ihit=0;ihit<nhits;ihit++)
00078       if(!other.isActive(ihit))
00079         inactive.push_back(ihit);
00080     _inactive = inactive;
00081   }
00082   return *this;
00083 }
00084   
00085 
00086 TrkHotListEmpty::~TrkHotListEmpty()
00087 {
00088 }
00089 
00090 TrkHotList*
00091 TrkHotListEmpty::clone(TrkBase::Functors::cloneHot) const
00092 {
00093   return new TrkHotListEmpty(*this);
00094 }
00095 
00096 TrkHotListEmpty::TrkHotListEmpty(const TrkHotList& other) :
00097   _nAxial(other.nMdc(TrkEnums::xyView)),
00098   _nStereo(other.nMdc(TrkEnums::zView)),
00099   _nPhi(other.nSvt(TrkEnums::xyView)),
00100   _nZ(other.nSvt(TrkEnums::zView)),
00101   _stFndRng(other.startFoundRange()),
00102   _endFndRng(other.endFoundRange()),
00103   _firstmdc(other.firstMdcLayer()),
00104   _lastmdc(other.lastMdcLayer())
00105 {
00106   for(unsigned ilay=0;ilay<5;ilay++)
00107     _svtpat[ilay] = other.svtView(ilay+1);// layer numbering starts at 1
00108   unsigned nhit = other.nHit();
00109   for(unsigned ihit=0;ihit<nhit;ihit++)
00110     if(!isActive(ihit))
00111       _inactive.push_back(ihit);
00112 }
00113 
00114 int
00115 TrkHotListEmpty::nActive(TrkEnums::TrkViewInfo view) const
00116 {
00117   return nSvt(view)+nMdc(view);
00118 }
00119 
00120 int
00121 TrkHotListEmpty::nSvt(TrkEnums::TrkViewInfo view) const
00122 {
00123   switch (view) {
00124   case TrkEnums::bothView:
00125     return _nPhi  + _nZ;
00126   case TrkEnums::xyView:
00127     return _nPhi;
00128   case TrkEnums::zView:
00129     return _nZ;
00130   default:
00131     return -1;
00132   }
00133 }
00134 
00135 int
00136 TrkHotListEmpty::nMdc(TrkEnums::TrkViewInfo view) const
00137 {
00138   switch (view) {
00139   case TrkEnums::zView:
00140     return _nStereo;
00141   case TrkEnums::xyView:
00142     return _nAxial;
00143   case TrkEnums::bothView:
00144     return _nStereo + _nAxial;
00145   default:
00146     return -1;
00147   }
00148 }
00149 
00150 int
00151 TrkHotListEmpty::nHit(TrkEnums::TrkViewInfo view) const
00152 {
00153   unsigned nhit = nActive(view);
00154   if(view == TrkEnums::bothView)
00155     nhit += _inactive.size();
00156   else
00157     nhit += _inactive.size()/2;
00158   return nhit;
00159 }
00160 
00161 double
00162 TrkHotListEmpty::startFoundRange() const
00163 {
00164   return _stFndRng;
00165 }
00166 
00167 double
00168 TrkHotListEmpty::endFoundRange() const
00169 {
00170   return _endFndRng;
00171 }
00172 
00173 
00174 const std::vector<TrkHitOnTrk*>&
00175 TrkHotListEmpty::hotlist() const
00176 {
00177   static const std::vector<TrkHitOnTrk*> dummy;
00178   assert(dummy.empty());
00179   return dummy;
00180 
00181 }
00182 
00183 std::vector<TrkHitOnTrk*>&
00184 TrkHotListEmpty::hotlist()
00185 {
00186   static std::vector<TrkHitOnTrk*> dummy;
00187   assert(dummy.empty());
00188   return dummy;
00189 }
00190 
00191 void
00192 TrkHotListEmpty::append(TrkHitOnTrk* )
00193 {
00194 }
00195 
00196 void
00197 TrkHotListEmpty::remove(TrkHitOnTrk* )
00198 {
00199 }
00200 
00201 TrkHitOnTrk*
00202 TrkHotListEmpty::findHot(const TrkFundHit*) const
00203 {
00204   return 0;
00205 }
00206 
00207 bool
00208 TrkHotListEmpty::hitCapable() const
00209 {
00210   return false;
00211 }
00212 
00213 void
00214 TrkHotListEmpty::updateHots()
00215 {
00216   return;
00217 }
00218 
00219 TrkView
00220 TrkHotListEmpty::svtView(int ilay) const
00221 {
00222   return (ilay>=1 && ilay<=5)?_svtpat[ilay-1]:TrkView(TrkEnums::noView);
00223 }
00224 
00225 unsigned
00226 TrkHotListEmpty::firstMdcLayer() const
00227 {
00228   return _firstmdc;
00229 }
00230 
00231 unsigned
00232 TrkHotListEmpty::lastMdcLayer() const
00233 {
00234   return _lastmdc;
00235 }
00236 
00237 bool
00238 TrkHotListEmpty::isActive(unsigned ihot) const {
00239   std::vector<unsigned>::const_iterator ifound =
00240     std::find(_inactive.begin(),_inactive.end(),ihot);
00241   return ifound == _inactive.end();
00242 }

Generated on Tue Nov 29 23:13:40 2016 for BOSS_7.0.2 by  doxygen 1.4.7