BOSS 7.1.0
BESIII Offline Software System
Loading...
Searching...
No Matches
TrkHotListFull Class Reference

#include <TrkHotListFull.h>

+ Inheritance diagram for TrkHotListFull:

Public Member Functions

 TrkHotListFull ()
 
 TrkHotListFull (const TrkHotList &inHots, TrkBase::Functors::cloneHot func)
 
 TrkHotListFull (TrkHotList &inHots, TrkBase::Functors::setParent func)
 
TrkHotListclone (TrkBase::Functors::cloneHot func) const
 
virtual ~TrkHotListFull ()
 
virtual bool hitCapable () const
 
virtual int nActive (TrkEnums::TrkViewInfo view=TrkEnums::bothView) const
 
virtual int nMdc (TrkEnums::TrkViewInfo view=TrkEnums::bothView) const
 
virtual int nSvt (TrkEnums::TrkViewInfo view=TrkEnums::bothView) const
 
virtual int nHit (TrkEnums::TrkViewInfo view=TrkEnums::bothView) const
 
virtual TrkView svtView (int layer) const
 
virtual unsigned firstMdcLayer () const
 
virtual unsigned lastMdcLayer () const
 
virtual double startFoundRange () const
 
virtual double endFoundRange () const
 
virtual bool isActive (unsigned ihot) const
 
void append (TrkHitOnTrk *)
 
void remove (TrkHitOnTrk *)
 
TrkHitOnTrkfindHot (const TrkFundHit *) const
 
void updateHots ()
 
- Public Member Functions inherited from TrkHotList
 TrkHotList ()
 
virtual TrkHotListclone (TrkBase::Functors::cloneHot) const =0
 
virtual TrkHotListresetParent (TrkBase::Functors::setParent)
 
virtual ~TrkHotList ()
 
hot_iterator begin () const
 
hot_iterator end () const
 
nc_hot_iterator begin ()
 
nc_hot_iterator end ()
 
virtual bool hitCapable () const =0
 
virtual int nActive (TrkEnums::TrkViewInfo view=TrkEnums::bothView) const =0
 
virtual int nMdc (TrkEnums::TrkViewInfo view=TrkEnums::bothView) const =0
 
virtual int nSvt (TrkEnums::TrkViewInfo view=TrkEnums::bothView) const =0
 
virtual int nHit (TrkEnums::TrkViewInfo view=TrkEnums::bothView) const =0
 
virtual bool hasSvtView (TrkEnums::TrkViewInfo view, int layer) const
 
virtual TrkView svtView (int layer) const =0
 
virtual unsigned firstMdcLayer () const =0
 
virtual unsigned lastMdcLayer () const =0
 
virtual double startFoundRange () const =0
 
virtual double endFoundRange () const =0
 
virtual bool isActive (unsigned ihot) const =0
 
virtual void append (TrkHitOnTrk *)=0
 
virtual void remove (TrkHitOnTrk *)=0
 
virtual void updateHots ()=0
 
virtual TrkHitOnTrkfindHot (const TrkFundHit *) const =0
 
virtual void sort ()
 
void print (std::ostream &o) const
 
void printAll (std::ostream &o) const
 

Protected Member Functions

virtual const std::vector< TrkHitOnTrk * > & hotlist () const
 
virtual std::vector< TrkHitOnTrk * > & hotlist ()
 

Additional Inherited Members

- Public Types inherited from TrkHotList
typedef TrkHitOnTrkIter< TrkHotList::const_iterator_traits > hot_iterator
 
typedef TrkHitOnTrkIter< TrkHotList::iterator_traits > nc_hot_iterator
 
- Protected Types inherited from TrkHotList
typedef std::vector< TrkHitOnTrk * > hotlist_t
 

Detailed Description

Definition at line 29 of file TrkHotListFull.h.

Constructor & Destructor Documentation

◆ TrkHotListFull() [1/3]

TrkHotListFull::TrkHotListFull ( )

Definition at line 29 of file TrkHotListFull.cxx.

30{
31}

Referenced by clone().

◆ TrkHotListFull() [2/3]

TrkHotListFull::TrkHotListFull ( const TrkHotList inHots,
TrkBase::Functors::cloneHot  func 
)

Definition at line 34 of file TrkHotListFull.cxx.

35{
36 //TrkHotListFull::clone come here
37 _hotlist.reserve(dfltCapac());
38//Clones Hots, and makes each point at the new track.
39 for (TrkHotList::hot_iterator i = inHots.begin();i!=inHots.end();++i) {
40// i->printAll(std::cout);//yzhang debug
41 _hotlist.push_back(f(*i));
42 }
43}
TFile f("ana_bhabha660a_dqa_mcPat_zy_old.root")
hot_iterator end() const
Definition: TrkHotList.h:45
hot_iterator begin() const
Definition: TrkHotList.h:44

◆ TrkHotListFull() [3/3]

TrkHotListFull::TrkHotListFull ( TrkHotList inHots,
TrkBase::Functors::setParent  func 
)

Definition at line 46 of file TrkHotListFull.cxx.

47{
48 _hotlist.reserve(dfltCapac());
49// shallow copy the hots and remove from input hotList
50 for (TrkHotList::nc_hot_iterator i = inHots.begin();i!=inHots.end();++i) {
51 _hotlist.push_back(f(*i));
52 }
53 inHots.hotlist().clear();
54}

◆ ~TrkHotListFull()

TrkHotListFull::~TrkHotListFull ( )
virtual

Definition at line 63 of file TrkHotListFull.cxx.

64{
65// std::cout << " ~TrkHotListFull" << std::endl;//yzhang debug
66// turn the parents off before deleting hots. This avoids a cyclic delete error
67// when deleting a track
68// std::for_each(begin(),end(),setParent(0));
69 std::for_each(_hotlist.begin(),_hotlist.end(),bes::Collection::DeleteObject());
70}

Member Function Documentation

◆ append()

void TrkHotListFull::append ( TrkHitOnTrk newHot)
virtual

Implements TrkHotList.

Definition at line 87 of file TrkHotListFull.cxx.

88{
89 _hotlist.push_back(newHot);
90}

◆ clone()

TrkHotList * TrkHotListFull::clone ( TrkBase::Functors::cloneHot  func) const
virtual

Implements TrkHotList.

Definition at line 58 of file TrkHotListFull.cxx.

59{
60 return new TrkHotListFull(*this, f);
61}

◆ endFoundRange()

double TrkHotListFull::endFoundRange ( ) const
virtual

Implements TrkHotList.

Definition at line 182 of file TrkHotListFull.cxx.

183{
184 double maxFlt = -9999;
188 while (i-- != b) {
189 if (predicate(*i)) {
190 maxFlt = i->fltLen();
191 break;
192 }
193 }
194 return maxFlt;
195}
const double b
Definition: slope.cxx:9

◆ findHot()

TrkHitOnTrk * TrkHotListFull::findHot ( const TrkFundHit theHit) const
virtual

Implements TrkHotList.

Definition at line 105 of file TrkHotListFull.cxx.

106{
108 TrkHotList::hot_iterator i = std::find_if(begin(),end(),match);
109 return i==end()?0:const_cast<TrkHitOnTrk*>( i.get() ); // FIXME: return (non)const TrkHitOnTrk from (non)const
110}
pointer get() const

◆ firstMdcLayer()

unsigned TrkHotListFull::firstMdcLayer ( ) const
virtual

Implements TrkHotList.

Definition at line 212 of file TrkHotListFull.cxx.

213{
214 unsigned firstlay(50);
215 bool activeOnly(true);
217 for (TrkHotList::hot_iterator i = begin();i!=end();++i) {
218 if (mdc(*i)) firstlay = std::min(firstlay,i->layerNumber());
219 }
220 return firstlay<50?firstlay:0;
221}
std::string mdc
Definition: CalibModel.cxx:45

◆ hitCapable()

bool TrkHotListFull::hitCapable ( ) const
virtual

Implements TrkHotList.

Definition at line 138 of file TrkHotListFull.cxx.

139{
140 return true;
141}

◆ hotlist() [1/2]

std::vector< TrkHitOnTrk * > & TrkHotListFull::hotlist ( )
protectedvirtual

Implements TrkHotList.

Definition at line 242 of file TrkHotListFull.cxx.

243{
244 return _hotlist;
245}

◆ hotlist() [2/2]

const std::vector< TrkHitOnTrk * > & TrkHotListFull::hotlist ( ) const
protectedvirtual

Implements TrkHotList.

Definition at line 236 of file TrkHotListFull.cxx.

237{
238 return _hotlist;
239}

◆ isActive()

bool TrkHotListFull::isActive ( unsigned  ihot) const
virtual

Implements TrkHotList.

Definition at line 248 of file TrkHotListFull.cxx.

248 {
249 if(ihot<_hotlist.size())
250 return _hotlist[ihot]->isActive();
251 else
252 return false;
253}

◆ lastMdcLayer()

unsigned TrkHotListFull::lastMdcLayer ( ) const
virtual

Implements TrkHotList.

Definition at line 224 of file TrkHotListFull.cxx.

225{
226 unsigned lastlay(0);
227 bool activeOnly(true);
229 for (TrkHotList::hot_iterator i = begin();i!=end();++i) {
230 if (mdc(*i)) lastlay = std::max(lastlay,i->layerNumber());
231 }
232 return lastlay;
233}

◆ nActive()

int TrkHotListFull::nActive ( TrkEnums::TrkViewInfo  view = TrkEnums::bothView) const
virtual

Implements TrkHotList.

Definition at line 113 of file TrkHotListFull.cxx.

114{
115 int nAct = 0;
116 for (TrkHotList::hot_iterator i = begin();i!=end();++i) {
117 if (i->isActive())
118 if(view == TrkEnums::bothView || i->whatView() == view)++nAct;
119 }
120 return nAct;
121}
@ bothView
Definition: TrkEnums.h:22

◆ nHit()

int TrkHotListFull::nHit ( TrkEnums::TrkViewInfo  view = TrkEnums::bothView) const
virtual

Implements TrkHotList.

Definition at line 124 of file TrkHotListFull.cxx.

125{
126 if(view == TrkEnums::bothView)
127 return end()-begin();
128 else {
129 int nAct = 0;
130 for (TrkHotList::hot_iterator i = begin();i!=end();++i) {
131 if(i->whatView() == view)++nAct;
132 }
133 return nAct;
134 }
135}

◆ nMdc()

int TrkHotListFull::nMdc ( TrkEnums::TrkViewInfo  view = TrkEnums::bothView) const
virtual

Implements TrkHotList.

Definition at line 144 of file TrkHotListFull.cxx.

145{
146 bool activeOnly(true);
149// FIXME: W6U1 doesn't have std::count (at least, not in the config used by BaBar!)
150// FIXME: std::compose2 is an SGI extension...
151// return std::count(begin(),end(),std::compose2(std::logical_and<bool>(),mdc,v);
152 int n = 0;
153 for (TrkHotList::hot_iterator i = begin();i!=end();++i)
154 if(mdc(*i)&&v(*i)) ++n;
155 return n;
156}
const Int_t n
**********Class see also m_nmax DOUBLE PRECISION m_amel DOUBLE PRECISION m_x2 DOUBLE PRECISION m_alfinv DOUBLE PRECISION m_Xenph INTEGER m_KeyWtm INTEGER m_idyfs DOUBLE PRECISION m_zini DOUBLE PRECISION m_q2 DOUBLE PRECISION m_Wt_KF DOUBLE PRECISION m_WtCut INTEGER m_KFfin *COMMON c_KarLud $ !Input CMS energy[GeV] $ !CMS energy after beam spread beam strahlung[GeV] $ !Beam energy spread[GeV] $ !z boost due to beam spread $ !electron beam mass *ff pair spectrum $ !minimum v
Definition: KarLud.h:35

◆ nSvt()

int TrkHotListFull::nSvt ( TrkEnums::TrkViewInfo  view = TrkEnums::bothView) const
virtual

Implements TrkHotList.

Definition at line 159 of file TrkHotListFull.cxx.

160{
161 bool activeOnly(true);
164// FIXME: W6U1 doesn't have std::count (at least, not in the config used by BaBar!)
165// FIXME: std::compose2 is an SGI extension...
166// return std::count(begin(),end(),std::compose2(std::logical_and<bool>(),svt,v);
167 int n = 0;
168 for (TrkHotList::hot_iterator i = begin();i!=end();++i)
169 if (svt(*i)&&v(*i)) ++n;
170 return n;
171}

◆ remove()

void TrkHotListFull::remove ( TrkHitOnTrk deadHot)
virtual

Implements TrkHotList.

Definition at line 93 of file TrkHotListFull.cxx.

94{
95 typedef std::vector<TrkHitOnTrk*>::iterator iter_t;
96 iter_t i = std::find(_hotlist.begin(),_hotlist.end(),deadHot);
97 if (i!=_hotlist.end()) {
98 delete *i;
99 _hotlist.erase(i);
100 } else
101 std::cout<<"ErrMsg(error) "<< " you asked to remove a hit which I don't have! " << std::endl;
102}

◆ startFoundRange()

double TrkHotListFull::startFoundRange ( ) const
virtual

Implements TrkHotList.

Definition at line 174 of file TrkHotListFull.cxx.

175{
177 TrkHotList::hot_iterator i = std::find_if(begin(),end(),active);
178 return i == end() ? 9999 : i->fltLen();
179}

◆ svtView()

TrkView TrkHotListFull::svtView ( int  layer) const
virtual

Implements TrkHotList.

Definition at line 199 of file TrkHotListFull.cxx.

200{
201 TrkView retval;
202 bool activeOnly(true);
205 // FIXME: std::compose2 is an SGI extension...
206 for(TrkHotList::hot_iterator i=begin();i!=end();++i)
207 if (svt(*i)&&l(*i)) retval.addView(i->whatView());
208 return retval;
209}
void addView(TrkEnums::TrkViewInfo view)
Definition: TrkView.cxx:53

◆ updateHots()

void TrkHotListFull::updateHots ( )
virtual

Implements TrkHotList.

Definition at line 80 of file TrkHotListFull.cxx.

81{
82 std::for_each(begin(),end(),updateMeasurement(0,false));
83 sort();
84}
TrkErrCode updateMeasurement(TrkHitOnTrk &hot, const TrkDifTraj *traj=0, bool maintainAmbiguity=false) const
virtual void sort()
Definition: TrkHotList.cxx:71

The documentation for this class was generated from the following files: