TrkRecoTrk Class Reference

#include <TrkRecoTrk.h>

List of all members.

Public Types

typedef std::unary_function<
TrkRecoTrk, bool
predicate_type

Public Member Functions

const TrkIdid () const
PdtPid::PidType defaultType () const
PdtPid::PidType whichFit (PdtPid::PidType hypo) const
int fitNumber (PdtPid::PidType hypo) const
double trackT0 () const
const BFieldbField () const
TrkErrCode addFit (PdtPid::PidType hypo, bool fit=true)
void resetT0 (double time)
const TrkFitfitResult () const
const TrkFitfitResult (PdtPid::PidType hypo) const
TrkHitListhits ()
const TrkHitListhits () const
TrkHitListhits (PdtPid::PidType hypo)
const TrkHitListhits (PdtPid::PidType hypo) const
TrkHotListhots ()
const TrkHotListhots () const
TrkHotListhots (PdtPid::PidType hypo)
const TrkHotListhots (PdtPid::PidType hypo) const
const TrkFitStatusstatus () const
const TrkFitStatusstatus (PdtPid::PidType hypo) const
TrkFitStatusstatus ()
TrkFitStatusstatus (PdtPid::PidType hypo)
bool attach (TrkExtInterface &, PdtPid::PidType hypo)
bool attach (TrkExtInterface &, PdtPid::PidType hypo) const
 TrkRecoTrk (const TrkRecoTrk &right)
virtual ~TrkRecoTrk ()
const TrkRecoTrkoperator= (const TrkRecoTrk &right)
bool operator== (const TrkRecoTrk &other) const
bool operator< (const TrkRecoTrk &other) const
virtual void print (std::ostream &) const
virtual void printAll (std::ostream &) const
void markForStore (PdtPid::PidType hypo, double fltlen, const char *listname="Default")
const std::set< TrkStoreHypo > & storageRequests (const char *listname="Default") const
void clearStorageRequests (const char *listname="Default")
void storageLists (std::set< std::string > &storage) const
const TrkReptestRep (PdtPid::PidType hypo) const

Protected Member Functions

TrkRepgetRep (PdtPid::PidType hypo)
const TrkRepgetRep (PdtPid::PidType hypo) const
void copyReps (const TrkRecoTrk &rhs)
void setRep (TrkRep *)
void repointHypo (PdtPid::PidType hypo, PdtPid::PidType fit)
void changeDefault (PdtPid::PidType newHypo)
std::pair< TrkRepIter, TrkRepIteruniqueReps () const
std::pair< TrkRepIter, TrkRepIterallReps () const
void setFitNumber (PdtPid::PidType hypo, int newNumber)
void updateReps ()
void addHypoTo (TrkRep *newRep, PdtPid::PidType hypo)
void setIdManager (TrkIdManager *idMan)
void setBField (const BField *field)
 TrkRecoTrk (PdtPid::PidType defaultPart, const TrkContext &, double t0)
 TrkRecoTrk (PdtPid::PidType defaultPart, long idnum, double t0)

Private Attributes

TrkRecoTrkImpl_impl
TrkId _id
std::vector< int > _fitNumber
std::map< std::string, std::set<
TrkStoreHypo > > 
_storage
PdtPid::PidType _defaultType
double _trackT0
const BField_bField

Friends

class TrkFitMaker
class TrkHitOnTrk
class TrkHitList
class KalMiniTrkK
class TrkKalMiniCompositeK


Detailed Description

Definition at line 71 of file TrkRecoTrk.h.


Member Typedef Documentation

typedef std::unary_function<TrkRecoTrk,bool> TrkRecoTrk::predicate_type

Definition at line 73 of file TrkRecoTrk.h.


Constructor & Destructor Documentation

TrkRecoTrk::TrkRecoTrk ( const TrkRecoTrk right  ) 

Definition at line 97 of file TrkRecoTrk.cxx.

References _defaultType, TrkRecoTrkImpl::_hitInterfaces, _impl, copyReps(), defaultType(), and genRecEmupikp::i.

00097                                             :
00098   _impl(new TrkRecoTrkImpl),
00099   _id(rhs._id.idManager()),
00100   _fitNumber(PdtPid::nPidType,(int)0),
00101   _storage(rhs._storage),
00102   _trackT0( rhs._trackT0),
00103   _bField(rhs._bField)
00104 {
00105   _defaultType = rhs.defaultType();
00106   unsigned i=0;
00107   for (TrkRecoTrkImpl::hitListIter iface = _impl->_hitInterfaces.begin();
00108        iface!= _impl->_hitInterfaces.end(); ++iface) {
00109     iface->reset( new TrkHitList(this, (PdtPid::PidType)i++) );  //cast
00110   }
00111   copyReps(rhs);
00112 }

TrkRecoTrk::~TrkRecoTrk (  )  [virtual]

Definition at line 114 of file TrkRecoTrk.cxx.

References _impl.

00115 {
00116   delete _impl;
00117 }

TrkRecoTrk::TrkRecoTrk ( PdtPid::PidType  defaultPart,
const TrkContext ,
double  t0 
) [protected]

Definition at line 62 of file TrkRecoTrk.cxx.

References TrkRecoTrkImpl::_hitInterfaces, _impl, and genRecEmupikp::i.

00063                                   :
00064   _impl(new TrkRecoTrkImpl), 
00065   _id(ctext.getId()),
00066   _fitNumber(PdtPid::nPidType,(int)0),
00067   _defaultType(defaultPart),
00068   _trackT0(t0),
00069   _bField( ctext.bField() )
00070 {
00071   // No TrkRep is defined here; must be created in appropriate FitMaker.
00072   unsigned i=0;
00073   for (TrkRecoTrkImpl::hitListIter iface = _impl->_hitInterfaces.begin();
00074        iface!= _impl->_hitInterfaces.end(); ++iface) {
00075     iface->reset( new TrkHitList(this, (PdtPid::PidType)i++) );  //cast
00076   }
00077 }

TrkRecoTrk::TrkRecoTrk ( PdtPid::PidType  defaultPart,
long  idnum,
double  t0 
) [protected]

Definition at line 80 of file TrkRecoTrk.cxx.

References TrkRecoTrkImpl::_hitInterfaces, _impl, and genRecEmupikp::i.

00080                                                                      :
00081   _impl(new TrkRecoTrkImpl),
00082   _id(idnum,0),
00083   _fitNumber(PdtPid::nPidType,(int)0),
00084   _defaultType(defaultPart),
00085   _trackT0(t0),
00086   _bField(0)
00087 {
00088   // No TrkRep is defined here; must be created in appropriate FitMaker.
00089   unsigned i=0;
00090   for (TrkRecoTrkImpl::hitListIter iface = _impl->_hitInterfaces.begin();
00091        iface!= _impl->_hitInterfaces.end(); ++iface) {
00092     iface->reset( new TrkHitList(this, (PdtPid::PidType)i++) );  //cast
00093   }
00094 }


Member Function Documentation

TrkErrCode TrkRecoTrk::addFit ( PdtPid::PidType  hypo,
bool  fit = true 
)

Definition at line 220 of file TrkRecoTrk.cxx.

References _fitNumber, _impl, TrkRecoTrkImpl::_reps, defaultType(), TrkErrCode::fail, hits(), TrkErrCode::succeed, and whichFit().

00221 {
00222   // If there is no fit, create one.  If hypo points to a fit for a different
00223   //   particle type, create a fit of type hypo, and point at that.  Carry
00224   //   out the fit if needed.
00225   if (hits() == 0) {
00226     // Unfittable rep
00227     return TrkErrCode(TrkErrCode::fail, 11,
00228                       "TrkRecoTrk::addFit(): cannot add a fit to this track.");
00229   }
00230   if (whichFit(hypo) == hypo) {
00231     return TrkErrCode(TrkErrCode::succeed, 11,
00232                       "TrkRecoTrk::addFit(): requested fit already exists.");
00233   }
00234   _impl->_reps[hypo].reset( _impl->_reps[defaultType()]->cloneNewHypo(hypo) );
00235   TrkErrCode fitErr(TrkErrCode::succeed, 1);
00236   if (fit && !_impl->_reps[hypo]->fitCurrent()) {
00237     fitErr = _impl->_reps[hypo]->fit();
00238   }
00239   ++_fitNumber[hypo];
00240   return fitErr;
00241 }

void TrkRecoTrk::addHypoTo ( TrkRep newRep,
PdtPid::PidType  hypo 
) [protected]

Definition at line 430 of file TrkRecoTrk.cxx.

References _impl, and TrkRecoTrkImpl::_reps.

Referenced by TrkFitMaker::addHypoTo().

00431 {
00432   _impl->_reps[hypo].reset( newRep );
00433 }

std::pair< TrkRepIter, TrkRepIter > TrkRecoTrk::allReps (  )  const [protected]

Definition at line 511 of file TrkRecoTrk.cxx.

References _impl, TrkRecoTrkImpl::_reps, genRecEmupikp::i, and x.

00512 {
00513   typedef std::vector<TrkRep*> RPL;
00514   boost::shared_ptr<RPL> x( new RPL );
00515   //std::cout << " TrkRecoTrk::allReps" << std::endl;//yzhang debug
00516             
00517   for (TrkRecoTrkImpl::repConstIter i=_impl->_reps.begin();i!=_impl->_reps.end();++i) {
00518           x->push_back(i->get());
00519           /*
00520           i->get()->printType(std::cout);//yzhang debug
00521           i->get()->printAll(std::cout);//yzhang debug
00522           */
00523   }
00524   //std::cout << "------ " << std::endl;//yzhang debug
00525   return std::make_pair(TrkRepIter(x,0),TrkRepIter(x,x->size()));
00526 }

bool TrkRecoTrk::attach ( TrkExtInterface ,
PdtPid::PidType  hypo 
) const

Definition at line 358 of file TrkRecoTrk.cxx.

References TrkExtInterface::attach(), and getRep().

00359 {
00360   const TrkRep* rp = getRep(hypo);
00361   return rp!=0?interface.attach(rp):0;
00362 }

bool TrkRecoTrk::attach ( TrkExtInterface ,
PdtPid::PidType  hypo 
)

Definition at line 366 of file TrkRecoTrk.cxx.

References TrkExtInterface::attach(), and getRep().

00367 {
00368   TrkRep* rp = getRep(hypo);
00369   return rp!=0?interface.attach(rp):0;
00370 }

const BField& TrkRecoTrk::bField (  )  const [inline]

Definition at line 82 of file TrkRecoTrk.h.

References _bField.

Referenced by MdcSegInfoSterO::calcStereo(), TrkSimpleRep::charge(), MdcSegGrouper::combineSegs(), TrkSimpleRep::getAllCovs(), TrkSimpleRep::getAllWeights(), TrkSimpleRep::momentum(), TrkSimpleRep::momentumErr(), MdcTrackList::pickHits(), TrkSimpleRep::posmomCov(), TrkSimpleRep::pt(), and MdcTrack::storeTrack().

00082 {return *_bField;}

void TrkRecoTrk::changeDefault ( PdtPid::PidType  newHypo  )  [protected]

Definition at line 296 of file TrkRecoTrk.cxx.

References _defaultType, TrkHotList::begin(), defaultType(), TrkHotList::end(), getRep(), TrkRep::hotList(), PdtPid::null, TrkHitOnTrk::setUnusedHit(), TrkHitOnTrk::setUsedHit(), and whichFit().

00297 {
00298   if (newHypo == defaultType()) return;
00299   assert(whichFit(newHypo) != PdtPid::null);
00300 
00301   TrkHotList *oldList = getRep(defaultType())->hotList();
00302   std::for_each(oldList->begin(),
00303                 oldList->end(),
00304                 std::mem_fun_ref(&TrkHitOnTrk::setUnusedHit));
00305   assert(getRep(newHypo) != 0);
00306   TrkHotList *newList= getRep(newHypo)->hotList();
00307   std::for_each(newList->begin(),
00308                 newList->end(),
00309                 std::mem_fun_ref(&TrkHitOnTrk::setUsedHit));
00310   _defaultType = newHypo;
00311 }

void TrkRecoTrk::clearStorageRequests ( const char *  listname = "Default"  ) 

Definition at line 480 of file TrkRecoTrk.cxx.

References _storage, and deljobs::string.

00480                                                      {
00481   _storage[std::string(listname)].clear();
00482 }

void TrkRecoTrk::copyReps ( const TrkRecoTrk rhs  )  [protected]

Definition at line 314 of file TrkRecoTrk.cxx.

References _fitNumber, _impl, TrkRecoTrkImpl::_reps, eformat::write::copy(), genRecEmupikp::i, and ganga-rec::j.

Referenced by operator=(), and TrkRecoTrk().

00315 {
00316   TrkRecoTrkImpl::repIter lhs = _impl->_reps.begin();
00317   for (TrkRecoTrkImpl::repIter i=rhs._impl->_reps.begin();i!=rhs._impl->_reps.end();++i,++lhs) {
00318       TrkRecoTrkImpl::repIter j=std::find(rhs._impl->_reps.begin(),i,*i);
00319       if (j==i) { // first time this one is seen
00320           lhs->reset( (*i)->clone(this) );
00321           (*lhs)->setValid((*i)->fitValid());
00322           (*lhs)->setCurrent((*i)->fitCurrent());
00323       } else {
00324           *lhs = *(_impl->_reps.begin()+(j-rhs._impl->_reps.begin()));
00325       }
00326   }
00327   assert(_fitNumber.size()==rhs._fitNumber.size());
00328   std::copy(rhs._fitNumber.begin(),rhs._fitNumber.end(),_fitNumber.begin());
00329 }

PdtPid::PidType TrkRecoTrk::defaultType (  )  const [inline]

Definition at line 78 of file TrkRecoTrk.h.

References _defaultType.

Referenced by addFit(), TrkHelixMaker::addZValues(), TrkHitList::appendHit(), TrkHitList::appendHot(), changeDefault(), fitResult(), TrkTypeUtil::getHits(), TrkTypeUtil::getRep(), getRep(), hits(), hots(), operator=(), TrkTypeUtil::pidType(), repointHypo(), status(), and TrkRecoTrk().

00078 {return _defaultType;}

int TrkRecoTrk::fitNumber ( PdtPid::PidType  hypo  )  const

Definition at line 157 of file TrkRecoTrk.cxx.

References _fitNumber, PdtPid::null, and whichFit().

00158 {
00159   PdtPid::PidType used = whichFit(hypo);
00160   if (used == PdtPid::null) return -1;
00161   int index = used;
00162   return _fitNumber[index];
00163 }

const TrkFit * TrkRecoTrk::fitResult ( PdtPid::PidType  hypo  )  const

Definition at line 393 of file TrkRecoTrk.cxx.

References TrkFitStatus::fitValid(), and getRep().

00394 {
00395   const TrkRep* rp = getRep(hypo);
00396   return rp==0?0:(rp->fitValid()?rp:0);
00397 }

const TrkFit * TrkRecoTrk::fitResult (  )  const

Definition at line 387 of file TrkRecoTrk.cxx.

References defaultType().

Referenced by TrkHelixMaker::addZValues(), MdcTrackListBase::arbitrateHits(), MdcSegInfoSterO::calcStereo(), MdcSegGrouper::combineSegs(), MdcTrackList::createFromSegs(), MdcTrackList::dumpCircle(), MdcxCosmicSewer::execute(), MdcHoughFinder::execute(), HoughValidUpdate::execute(), MdcxTrackFinder::fillTrack(), MdcSegGrouperSt::fillWithSegs(), MdcTrackListCsmc::finish3d(), MdcTrackList::finishCircle(), MdcTrackList::finishHelix(), MdcTrackList::pickHits(), MdcTrack::projectToR(), MdcxTrackFinder::store(), MdcMergeDups::store(), and MdcTrack::storeTrack().

00388 {
00389   return fitResult(defaultType());
00390 }

const TrkRep * TrkRecoTrk::getRep ( PdtPid::PidType  hypo  )  const [protected]

Definition at line 287 of file TrkRecoTrk.cxx.

References _impl, TrkRecoTrkImpl::_reps, defaultType(), PdtPid::electron, and PdtPid::proton.

00288 {
00289   assert(hypo>=PdtPid::electron && hypo<= PdtPid::proton);
00290   const TrkRep* theRep = _impl->_reps[hypo].get();
00291   if(hypo == defaultType())assert(0 != theRep);
00292   return theRep;
00293 }

TrkRep * TrkRecoTrk::getRep ( PdtPid::PidType  hypo  )  [protected]

Definition at line 277 of file TrkRecoTrk.cxx.

References _impl, TrkRecoTrkImpl::_reps, defaultType(), PdtPid::electron, and PdtPid::proton.

Referenced by attach(), changeDefault(), fitResult(), hits(), hots(), markForStore(), repointHypo(), status(), testRep(), and TrkHitList::theRep().

00278 {
00279   assert(hypo>=PdtPid::electron && hypo<= PdtPid::proton);
00280   TrkRep* theRep = _impl->_reps[hypo].get();
00281 // insist the default rep exist
00282   if(hypo == defaultType())assert(0 != theRep);
00283   return theRep;
00284 }

const TrkHitList * TrkRecoTrk::hits ( PdtPid::PidType  hypo  )  const

Definition at line 380 of file TrkRecoTrk.cxx.

References TrkRecoTrkImpl::_hitInterfaces, _impl, and getRep().

00381 {
00382   const TrkRep* rp = getRep(hypo);
00383   return rp==0?0:_impl->_hitInterfaces[hypo].get();
00384 }

TrkHitList * TrkRecoTrk::hits ( PdtPid::PidType  hypo  ) 

Definition at line 373 of file TrkRecoTrk.cxx.

References TrkRecoTrkImpl::_hitInterfaces, _impl, and getRep().

00374 {
00375   const TrkRep* rp = getRep(hypo);
00376   return rp==0?0:_impl->_hitInterfaces[hypo].get();
00377 }

const TrkHitList* TrkRecoTrk::hits (  )  const [inline]

Definition at line 108 of file TrkRecoTrk.h.

References defaultType(), and hits().

00108 {return hits(defaultType());}

TrkHitList* TrkRecoTrk::hits (  )  [inline]

Definition at line 107 of file TrkRecoTrk.h.

References defaultType().

Referenced by addFit(), MdcTrackListBase::arbitrateHits(), MdcHoughFinder::digiToHots(), HoughValidUpdate::digiToHots(), MdcHoughFinder::digiToHots2(), HoughValidUpdate::digiToHots2(), MdcTrackList::dropMultiHotInLayer(), MdcTrackList::dumpAxCombine(), MdcTrackList::dumpCircle(), MdcTrackList::dumpHelix(), MdcTrackList::dumpStCombine(), MdcxCosmicSewer::execute(), MdcHoughFinder::execute(), HoughValidUpdate::execute(), MdcxTrackFinder::fillTrack(), MdcTrackListCsmc::finish3d(), MdcTrackList::finishCircle(), MdcTrackList::finishHelix(), TrkTypeUtil::getHits(), hits(), MdcxCosmicSewer::MdcxHitsToHots(), MdcTrackList::pickHits(), MdcTrack::storeTrack(), TrkOutAvgTimeCalculator::trackTime(), and MdcSegGrouper::transferHits().

00107 {return hits(defaultType());}

const TrkHotList * TrkRecoTrk::hots ( PdtPid::PidType  hypo  )  const

Definition at line 504 of file TrkRecoTrk.cxx.

References getRep(), and TrkRep::hotList().

00505 {
00506   const TrkRep* rp = getRep(hypo);
00507   return rp==0?0:rp->hotList();
00508 }

TrkHotList * TrkRecoTrk::hots ( PdtPid::PidType  hypo  ) 

Definition at line 497 of file TrkRecoTrk.cxx.

References getRep(), and TrkRep::hotList().

00498 {
00499   TrkRep* rp = getRep(hypo);
00500   return rp==0?0:rp->hotList();
00501 }

const TrkHotList* TrkRecoTrk::hots (  )  const [inline]

Definition at line 114 of file TrkRecoTrk.h.

References defaultType(), and hots().

00114 {return hots(defaultType());}

TrkHotList* TrkRecoTrk::hots (  )  [inline]

Definition at line 113 of file TrkRecoTrk.h.

References defaultType().

Referenced by HoughValidUpdate::execute(), MdcTrackList::finishCircle(), and hots().

00113 {return hots(defaultType());}

const TrkId & TrkRecoTrk::id (  )  const

Definition at line 134 of file TrkRecoTrk.cxx.

References _id.

Referenced by MdcTrackListBase::arbitrateHits().

00135 {
00136   return _id;
00137 }

void TrkRecoTrk::markForStore ( PdtPid::PidType  hypo,
double  fltlen,
const char *  listname = "Default" 
)

Definition at line 455 of file TrkRecoTrk.cxx.

References _storage, getRep(), deljobs::string, and whichFit().

00456                                                {
00457 // first, translate to the real hypo
00458   PdtPid::PidType realhypo = whichFit(hypo);
00459 // Then, make sure this hypo has a valid fit
00460   if(getRep(realhypo)!= 0 && getRep(realhypo)->fitValid())
00461 // add an entry in the toStore list (if it's unique)
00462     _storage[std::string(listname)].insert(TrkStoreHypo(realhypo,fltlen));
00463   else
00464 // It's an error to try to store invalid fits
00465     std::cout<<"ErrMsg(error) "<< "Invalid fits cannot be marked for storage" << std::endl;
00466 }

bool TrkRecoTrk::operator< ( const TrkRecoTrk other  )  const

Definition at line 267 of file TrkRecoTrk.cxx.

References _id, and EvtCyclic3::other().

00268 {
00269   return _id < other._id;
00270 }

const TrkRecoTrk & TrkRecoTrk::operator= ( const TrkRecoTrk right  ) 

Definition at line 120 of file TrkRecoTrk.cxx.

References _bField, _defaultType, _id, _storage, _trackT0, copyReps(), defaultType(), and TrkId::setNewValue().

00121 {
00122   if (&right == this) return *this;
00123   _trackT0 = right._trackT0;
00124   _defaultType = right.defaultType();
00125   copyReps(right);
00126   _bField = right._bField;
00127 //  AbsEvtObj::operator=(right);
00128   _id.setNewValue(right._id);
00129   _storage = right._storage;
00130   return *this;
00131 }

bool TrkRecoTrk::operator== ( const TrkRecoTrk other  )  const

Definition at line 261 of file TrkRecoTrk.cxx.

References _id, and EvtCyclic3::other().

00262 {
00263   return _id == other._id;
00264 }

virtual void TrkRecoTrk::print ( std::ostream  )  const [virtual]

Referenced by MdcxCosmicSewer::execute(), MdcHoughFinder::execute(), HoughValidUpdate::execute(), MdcTrackList::finishCircle(), and operator<<().

virtual void TrkRecoTrk::printAll ( std::ostream  )  const [virtual]

Referenced by MdcTrackListCsmc::createFromSegs(), MdcTrackList::dumpAxCombine(), MdcTrackList::dumpAxFill(), MdcTrackList::dumpCircle(), MdcTrackList::dumpHelix(), MdcTrackList::dumpStCombine(), HoughValidUpdate::execute(), and MdcTrackList::finishCircle().

void TrkRecoTrk::repointHypo ( PdtPid::PidType  hypo,
PdtPid::PidType  fit 
) [protected]

Definition at line 343 of file TrkRecoTrk.cxx.

References _impl, TrkRecoTrkImpl::_reps, defaultType(), and getRep().

00344 {
00345   // Do we have to do anything?
00346   if (fit == hypo || getRep(fit) == getRep(hypo)) return;
00347 
00348   if (hypo == defaultType()) {
00349     std::cout << "ErrMsg(error) "<<
00350       "TrkRecoTrk: can't make default hypothesis point at different fit"
00351                   << std::endl;
00352     return;
00353   }
00354   _impl->_reps[hypo] = _impl->_reps[fit];
00355 }

void TrkRecoTrk::resetT0 ( double  time  ) 

Definition at line 244 of file TrkRecoTrk.cxx.

References updateReps().

00245 {
00246   _trackT0 = t;
00247   updateReps();
00248 }

void TrkRecoTrk::setBField ( const BField field  )  [protected]

Definition at line 449 of file TrkRecoTrk.cxx.

References _bField.

Referenced by TrkFitMaker::setBField().

00450 {
00451   _bField = field;
00452 }

void TrkRecoTrk::setFitNumber ( PdtPid::PidType  hypo,
int  newNumber 
) [protected]

Definition at line 424 of file TrkRecoTrk.cxx.

References _fitNumber.

00425 {
00426   _fitNumber[hypo] = newNumber;
00427 }

void TrkRecoTrk::setIdManager ( TrkIdManager idMan  )  [protected]

Definition at line 436 of file TrkRecoTrk.cxx.

References _id, and TrkId::setIdManager().

Referenced by TrkFitMaker::setIdManager().

00437 {
00438   _id.setIdManager(idMan);
00439 }

void TrkRecoTrk::setRep ( TrkRep  )  [protected]

Definition at line 332 of file TrkRecoTrk.cxx.

References _fitNumber, _impl, TrkRecoTrkImpl::_reps, and fill().

Referenced by TrkFitMaker::setRep().

00333 {
00334   // Sets the default rep to be r, clears out other reps., and sets
00335   //  non-default rep ptrs to point at default.  Increments all fit numbers.
00336   std::fill(_impl->_reps.begin(),_impl->_reps.end(),boost::shared_ptr<TrkRep>(r));
00337   std::transform(_fitNumber.begin(),_fitNumber.end(),
00338                  _fitNumber.begin(),
00339                  std::bind2nd(std::plus<int>(),1));
00340 }

TrkFitStatus * TrkRecoTrk::status ( PdtPid::PidType  hypo  ) 

Definition at line 418 of file TrkRecoTrk.cxx.

References getRep().

00419 {
00420   return getRep(hypo);
00421 }

TrkFitStatus * TrkRecoTrk::status (  ) 

Definition at line 412 of file TrkRecoTrk.cxx.

References defaultType(), and status().

00413 {
00414   return status(defaultType());
00415 }

const TrkFitStatus * TrkRecoTrk::status ( PdtPid::PidType  hypo  )  const

Definition at line 406 of file TrkRecoTrk.cxx.

References getRep().

00407 {
00408   return getRep(hypo);
00409 }

const TrkFitStatus * TrkRecoTrk::status (  )  const

Definition at line 400 of file TrkRecoTrk.cxx.

References defaultType().

Referenced by MdcTrackList::finishCircle(), MdcTrackList::pickHits(), and status().

00401 {
00402   return status(defaultType());
00403 }

void TrkRecoTrk::storageLists ( std::set< std::string > &  storage  )  const

Definition at line 485 of file TrkRecoTrk.cxx.

References _storage.

00485                                                          {
00486   // clear the output set
00487   storage.clear();
00488   // iterate over all the storage requests
00489   std::map<std::string,std::set<TrkStoreHypo> >::const_iterator miter = _storage.begin();
00490   while(miter != _storage.end()){
00491     storage.insert(miter->first);
00492     miter++;
00493   }
00494 }

const std::set< TrkStoreHypo > & TrkRecoTrk::storageRequests ( const char *  listname = "Default"  )  const

Definition at line 469 of file TrkRecoTrk.cxx.

References _storage, and deljobs::string.

00469                                                       {
00470   static std::set<TrkStoreHypo> empty; // empty set to return if list doesn't exist
00471   std::map<std::string,std::set<TrkStoreHypo> >::const_iterator foundit =
00472     _storage.find(std::string(listname));
00473   if(foundit != _storage.end())
00474     return foundit->second;
00475   else
00476     return empty;
00477 }

const TrkRep* TrkRecoTrk::testRep ( PdtPid::PidType  hypo  )  const [inline]

Definition at line 219 of file TrkRecoTrk.h.

References getRep().

Referenced by TrkTypeUtil::getRep().

00219 { return getRep(hypo);}

double TrkRecoTrk::trackT0 (  )  const

Definition at line 140 of file TrkRecoTrk.cxx.

References _trackT0.

Referenced by MdcTrackList::pickHits(), MdcHitOnTrack::timeAbsolute(), TrkRep::trackT0(), and TrkOutAvgTimeCalculator::trackTime().

00141 {
00142   return _trackT0;
00143 }

std::pair< TrkRepIter, TrkRepIter > TrkRecoTrk::uniqueReps (  )  const [protected]

Definition at line 529 of file TrkRecoTrk.cxx.

References _impl, TrkRecoTrkImpl::_reps, genRecEmupikp::i, and x.

Referenced by TrkHitList::appendHit(), TrkHitList::appendHot(), TrkHitList::removeHit(), and updateReps().

00530 {
00531   typedef std::vector<TrkRep*> RPL;
00532   boost::shared_ptr<RPL> x( new RPL );
00533   for (TrkRecoTrkImpl::repConstIter i=_impl->_reps.begin();i!=_impl->_reps.end();++i) {
00534      if (std::find(x->begin(),x->end(),i->get())==x->end()) x->push_back(i->get());
00535       
00536   }
00537   return std::make_pair(TrkRepIter(x,0),TrkRepIter(x,x->size()));
00538 }

void TrkRecoTrk::updateReps (  )  [protected]

Definition at line 251 of file TrkRecoTrk.cxx.

References _fitNumber, uniqueReps(), TrkRep::updateHots(), and x.

Referenced by resetT0().

00252 {
00253   std::pair<TrkRepIter,TrkRepIter> x = uniqueReps();
00254   std::for_each(x.first,x.second,std::mem_fun_ref(&TrkRep::updateHots));
00255   std::transform(_fitNumber.begin(),_fitNumber.end(),
00256                  _fitNumber.begin(),
00257                  std::bind2nd(std::plus<int>(),1));
00258 }

PdtPid::PidType TrkRecoTrk::whichFit ( PdtPid::PidType  hypo  )  const

Definition at line 146 of file TrkRecoTrk.cxx.

References _impl, and TrkRecoTrkImpl::_reps.

Referenced by addFit(), changeDefault(), fitNumber(), and markForStore().

00147 {
00148   if (_impl->_reps[hypo].get() == 0) {
00149     return hypo;
00150   }
00151 //  return _repPtr[hypo]->fitValid() ? _repPtr[hypo]->particleType()
00152 //                                   : PdtPid::null;
00153   return _impl->_reps[hypo]->particleType();
00154 }


Friends And Related Function Documentation

friend class KalMiniTrkK [friend]

Definition at line 223 of file TrkRecoTrk.h.

friend class TrkFitMaker [friend]

Definition at line 220 of file TrkRecoTrk.h.

friend class TrkHitList [friend]

Definition at line 222 of file TrkRecoTrk.h.

friend class TrkHitOnTrk [friend]

Definition at line 221 of file TrkRecoTrk.h.

friend class TrkKalMiniCompositeK [friend]

Definition at line 224 of file TrkRecoTrk.h.


Member Data Documentation

const BField* TrkRecoTrk::_bField [private]

Definition at line 188 of file TrkRecoTrk.h.

Referenced by bField(), operator=(), and setBField().

PdtPid::PidType TrkRecoTrk::_defaultType [private]

Definition at line 186 of file TrkRecoTrk.h.

Referenced by changeDefault(), defaultType(), operator=(), and TrkRecoTrk().

std::vector<int> TrkRecoTrk::_fitNumber [private]

Definition at line 182 of file TrkRecoTrk.h.

Referenced by addFit(), copyReps(), TrkHitList::fit(), fitNumber(), setFitNumber(), setRep(), and updateReps().

TrkId TrkRecoTrk::_id [private]

Definition at line 181 of file TrkRecoTrk.h.

Referenced by id(), operator<(), operator=(), operator==(), and setIdManager().

TrkRecoTrkImpl* TrkRecoTrk::_impl [private]

Definition at line 171 of file TrkRecoTrk.h.

Referenced by addFit(), addHypoTo(), allReps(), copyReps(), getRep(), hits(), repointHypo(), setRep(), TrkRecoTrk(), uniqueReps(), whichFit(), and ~TrkRecoTrk().

std::map<std::string,std::set<TrkStoreHypo> > TrkRecoTrk::_storage [private]

Definition at line 185 of file TrkRecoTrk.h.

Referenced by clearStorageRequests(), markForStore(), operator=(), storageLists(), and storageRequests().

double TrkRecoTrk::_trackT0 [private]

Definition at line 187 of file TrkRecoTrk.h.

Referenced by operator=(), and trackT0().


Generated on Tue Nov 29 23:36:16 2016 for BOSS_7.0.2 by  doxygen 1.4.7