BOSS 7.1.0
BESIII Offline Software System
Loading...
Searching...
No Matches
TrkHotListEmpty.cxx
Go to the documentation of this file.
1//--------------------------------------------------------------------------
2// File and Version Information:
3// $Id: TrkHotListEmpty.cxx,v 1.1.1.1 2005/04/21 06:01:42 zhangy Exp $
4//
5// Description:
6//
7// Environment:
8// Software developed for the BaBar Detector at the SLAC B-Factory.
9//
10// Author(s): Steve Schaffner
11//
12//------------------------------------------------------------------------
13
14//#include "BaBar/BaBar.hh"
16#include "TrkBase/TrkHitOnTrk.h"
17#include <assert.h>
18#include <algorithm>
19
20TrkHotListEmpty::TrkHotListEmpty(int nact, int nsv, int ndc,
21 double sfr, double efr)
22{
23 _nPhi = nsv/2; _nZ = nsv-_nPhi;
24 _nAxial = ndc/3; _nStereo = ndc-_nAxial;
25 _stFndRng = sfr;
26 _endFndRng = efr;
27 _firstmdc = _lastmdc = 0;
28 for(unsigned isvt=0;isvt<5;isvt++)
29 _svtpat[isvt] = TrkView(TrkEnums::noView);
30}
31
33 unsigned nAxial, unsigned nStereo,
34 double sfr, double efr,
35 unsigned firstmdc,unsigned lastmdc,
36 TrkView svtpattern[5],
37 const std::vector<unsigned>& inactive) :
38 _nAxial(nAxial),_nStereo(nStereo),_nPhi(nPhi),_nZ(nZ),
39 _stFndRng(sfr),_endFndRng(efr),_firstmdc(firstmdc),_lastmdc(lastmdc),
40 _inactive(inactive)
41{
42 for(unsigned j=0;j<5;j++)
43 _svtpat[j] = svtpattern[j];
44}
45
47{
48 _nAxial = rhs._nAxial;
49 _nStereo = rhs._nStereo;
50 _nPhi = rhs._nPhi;
51 _nZ = rhs._nZ;
52 _stFndRng = rhs._stFndRng;
53 _endFndRng = rhs._endFndRng;
54 _firstmdc = rhs._firstmdc;
55 _lastmdc = rhs._lastmdc;
56 _inactive = rhs._inactive;
57 for (unsigned i=0;i<5;++i) _svtpat[i] = rhs._svtpat[i];
58
59}
60
61
64 if(this != &other){
65 _nPhi = other.nSvt(TrkEnums::xyView);
66 _nZ = other.nSvt(TrkEnums::zView);
67 _nAxial = other.nMdc(TrkEnums::xyView);
68 _nStereo = other.nMdc(TrkEnums::zView);
69 _stFndRng = other.startFoundRange();
70 _endFndRng = other.endFoundRange();
71 _firstmdc = other.firstMdcLayer();
72 _lastmdc = other.lastMdcLayer();
73 for(unsigned ilay=0;ilay<5;ilay++)
74 _svtpat[ilay] = other.svtView(ilay+1);// layer numbering starts at 1
75 unsigned nhits = other.nHit();
76 std::vector<unsigned> inactive;
77 for(unsigned ihit=0;ihit<nhits;ihit++)
78 if(!other.isActive(ihit))
79 inactive.push_back(ihit);
80 _inactive = inactive;
81 }
82 return *this;
83}
84
85
87{
88}
89
92{
93 return new TrkHotListEmpty(*this);
94}
95
97 _nAxial(other.nMdc(TrkEnums::xyView)),
98 _nStereo(other.nMdc(TrkEnums::zView)),
99 _nPhi(other.nSvt(TrkEnums::xyView)),
100 _nZ(other.nSvt(TrkEnums::zView)),
101 _stFndRng(other.startFoundRange()),
102 _endFndRng(other.endFoundRange()),
103 _firstmdc(other.firstMdcLayer()),
104 _lastmdc(other.lastMdcLayer())
105{
106 for(unsigned ilay=0;ilay<5;ilay++)
107 _svtpat[ilay] = other.svtView(ilay+1);// layer numbering starts at 1
108 unsigned nhit = other.nHit();
109 for(unsigned ihit=0;ihit<nhit;ihit++)
110 if(!isActive(ihit))
111 _inactive.push_back(ihit);
112}
113
114int
116{
117 return nSvt(view)+nMdc(view);
118}
119
120int
122{
123 switch (view) {
125 return _nPhi + _nZ;
126 case TrkEnums::xyView:
127 return _nPhi;
128 case TrkEnums::zView:
129 return _nZ;
130 default:
131 return -1;
132 }
133}
134
135int
137{
138 switch (view) {
139 case TrkEnums::zView:
140 return _nStereo;
141 case TrkEnums::xyView:
142 return _nAxial;
144 return _nStereo + _nAxial;
145 default:
146 return -1;
147 }
148}
149
150int
152{
153 unsigned nhit = nActive(view);
154 if(view == TrkEnums::bothView)
155 nhit += _inactive.size();
156 else
157 nhit += _inactive.size()/2;
158 return nhit;
159}
160
161double
163{
164 return _stFndRng;
165}
166
167double
169{
170 return _endFndRng;
171}
172
173
174const std::vector<TrkHitOnTrk*>&
176{
177 static const std::vector<TrkHitOnTrk*> dummy;
178 assert(dummy.empty());
179 return dummy;
180
181}
182
183std::vector<TrkHitOnTrk*>&
185{
186 static std::vector<TrkHitOnTrk*> dummy;
187 assert(dummy.empty());
188 return dummy;
189}
190
191void
193{
194}
195
196void
198{
199}
200
203{
204 return 0;
205}
206
207bool
209{
210 return false;
211}
212
213void
215{
216 return;
217}
218
221{
222 return (ilay>=1 && ilay<=5)?_svtpat[ilay-1]:TrkView(TrkEnums::noView);
223}
224
225unsigned
227{
228 return _firstmdc;
229}
230
231unsigned
233{
234 return _lastmdc;
235}
236
237bool
238TrkHotListEmpty::isActive(unsigned ihot) const {
239 std::vector<unsigned>::const_iterator ifound =
240 std::find(_inactive.begin(),_inactive.end(),ihot);
241 return ifound == _inactive.end();
242}
const int nPhi
const int nZ
TrkHotListEmpty(int nActive, int nSvt, int nMdc, double startFoundRange, double endFoundRange)
virtual TrkView svtView(int layer) const
virtual int nHit(TrkEnums::TrkViewInfo view=TrkEnums::bothView) const
virtual void updateHots()
virtual TrkHotList * clone(TrkBase::Functors::cloneHot) const
TrkHitOnTrk * findHot(const TrkFundHit *) const
virtual int nMdc(TrkEnums::TrkViewInfo view=TrkEnums::bothView) const
virtual ~TrkHotListEmpty()
virtual int nSvt(TrkEnums::TrkViewInfo view=TrkEnums::bothView) const
virtual bool isActive(unsigned ihot) const
virtual bool hitCapable() const
virtual unsigned lastMdcLayer() const
virtual int nActive(TrkEnums::TrkViewInfo view=TrkEnums::bothView) const
TrkHotListEmpty & operator=(const TrkHotList &)
virtual void append(TrkHitOnTrk *)
virtual unsigned firstMdcLayer() const
virtual double endFoundRange() const
virtual void remove(TrkHitOnTrk *)
virtual const std::vector< TrkHitOnTrk * > & hotlist() const
virtual double startFoundRange() const
TrkViewInfo
Definition: TrkEnums.h:22
@ xyView
Definition: TrkEnums.h:22
@ zView
Definition: TrkEnums.h:22
@ noView
Definition: TrkEnums.h:22
@ bothView
Definition: TrkEnums.h:22
int nhits