BOSS 7.0.3
BESIII Offline Software System
Loading...
Searching...
No Matches
HoughPeak Class Reference

#include <HoughPeak.h>

Public Member Functions

 HoughPeak ()
 
 HoughPeak (const HoughPeak &other)
 
 ~HoughPeak ()
 
 HoughPeak (int itheta, int irho, double theta, double rho, vector< const HoughHit * > **mapHitList, bool is, int peakNum)
 
 HoughPeak (int height, int itheta, int irho, double theta, double rho, bool is, int peakNum, int charge)
 
vector< const HoughHit * > getHoughHitList () const
 
int peakHeight () const
 
int getPeakNum () const
 
int getThetaBin () const
 
int getRhoBin () const
 
double getTheta () const
 
double getRho () const
 
double getRho_reci () const
 
bool getisCandiTrack () const
 
void setisCandiTrack (bool is)
 
int getHitNum (int) const
 
int getHitNumA (int) const
 
int getHitNumS (int) const
 
void printAllHit () const
 
void print ()
 
HoughPeakoperator= (const HoughPeak &other)
 
int collectHits (const HoughHitList &)
 
 HoughPeak ()
 
 HoughPeak (const HoughPeak &other)
 
 ~HoughPeak ()
 
 HoughPeak (int itheta, int irho, double theta, double rho, vector< const HoughHit * > **mapHitList, bool is, int peakNum)
 
 HoughPeak (int height, int itheta, int irho, double theta, double rho, bool is, int peakNum, int charge)
 
vector< const HoughHit * > getHoughHitList () const
 
int peakHeight () const
 
int getPeakNum () const
 
int getThetaBin () const
 
int getRhoBin () const
 
double getTheta () const
 
double getRho () const
 
double getRho_reci () const
 
bool getisCandiTrack () const
 
void setisCandiTrack (bool is)
 
int getHitNum (int) const
 
int getHitNumA (int) const
 
int getHitNumS (int) const
 
void printAllHit () const
 
void print ()
 
HoughPeakoperator= (const HoughPeak &other)
 
int collectHits (const HoughHitList &)
 

Static Public Attributes

static double m_dcut1
 
static double m_dcut2
 

Detailed Description

Constructor & Destructor Documentation

◆ HoughPeak() [1/8]

HoughPeak::HoughPeak ( )

Definition at line 5 of file HoughPeak.cxx.

5 {
6}

◆ HoughPeak() [2/8]

HoughPeak::HoughPeak ( const HoughPeak other)

Definition at line 40 of file HoughPeak.cxx.

41{
42 if(_houghPeakHitList.size() != 0 ){
43 for(int i =0;i<_houghPeakHitList.size();i++){
44 _houghPeakHitList[i]=NULL;
45 }
46 _houghPeakHitList.clear();
47 }
48 _height=other._height;
49 _theta=other._theta;
50 _rho=other._rho;
51 _thetaBin=other._thetaBin;
52 _rhoBin=other._rhoBin;
53 _houghPeakHitList = other._houghPeakHitList;
54 _isCandiTrack=other._isCandiTrack;
55 _peakNum=other._peakNum;
56 _charge=other._charge;
57 //for(int i =0;i<other._houghPeakHitList.size();i++){
58 // const HoughHit* p_hit= new HoughHit( *(other._houghPeakHitList[i]));
59 // _houghPeakHitList.push_back(p_hit);
60 //}
61}
Index other(Index i, Index j)
Definition: EvtCyclic3.cc:118

◆ ~HoughPeak() [1/2]

HoughPeak::~HoughPeak ( )

Definition at line 7 of file HoughPeak.cxx.

7 {
8// cout<<" HoughPeak destruct" <<endl;
9 for(int i =0;i<_houghPeakHitList.size();i++){
10 // delete _houghPeakHitList[i];
11 _houghPeakHitList[i]=NULL;
12 }
13 _houghPeakHitList.clear();
14}

◆ HoughPeak() [3/8]

HoughPeak::HoughPeak ( int  itheta,
int  irho,
double  theta,
double  rho,
vector< const HoughHit * > **  mapHitList,
bool  is,
int  peakNum 
)

◆ HoughPeak() [4/8]

HoughPeak::HoughPeak ( int  height,
int  itheta,
int  irho,
double  theta,
double  rho,
bool  is,
int  peakNum,
int  charge 
)

Definition at line 78 of file HoughPeak.cxx.

78 {
79 _height=height;
80 _thetaBin=itheta;
81 _rhoBin=irho;
82 _theta=theta;
83 _rho=rho;
84// _houghPeakHitList = mapHitList[itheta][irho];
85 _isCandiTrack =isCandiTrack;
86 _peakNum=peakNum;
87 _charge=charge;
88// collectHits(hitlist);
89}

◆ HoughPeak() [5/8]

HoughPeak::HoughPeak ( )

◆ HoughPeak() [6/8]

HoughPeak::HoughPeak ( const HoughPeak other)

◆ ~HoughPeak() [2/2]

HoughPeak::~HoughPeak ( )

◆ HoughPeak() [7/8]

HoughPeak::HoughPeak ( int  itheta,
int  irho,
double  theta,
double  rho,
vector< const HoughHit * > **  mapHitList,
bool  is,
int  peakNum 
)

◆ HoughPeak() [8/8]

HoughPeak::HoughPeak ( int  height,
int  itheta,
int  irho,
double  theta,
double  rho,
bool  is,
int  peakNum,
int  charge 
)

Member Function Documentation

◆ collectHits() [1/2]

int HoughPeak::collectHits ( const HoughHitList hitlist)

Definition at line 179 of file HoughPeak.cxx.

179 {
180 double cirr_track = fabs(1./(_rho));
181 double cirx_track = (1./_rho)*cos(_theta);
182 double ciry_track = (1./_rho)*sin(_theta);
183 std::vector<HoughHit>::const_iterator iter= hitlist.getList().begin();
184 for(; iter!= hitlist.getList().end(); iter++){
185 const HoughHit *hit = &(*iter);
186 int layer = hit->getLayerId();
187 if( hit->getSlayerType()!=0 ) continue;
188 double cirx_hit = hit->getMidX();
189 double ciry_hit = hit->getMidY();
190 double cirr_hit = hit->getDriftDist();
191 if( _charge == 1 && (cirx_track*ciry_hit - ciry_track*cirx_hit>=0) ) continue; // suppose charge -1 FIXME
192 if( _charge ==-1 && (cirx_track*ciry_hit - ciry_track*cirx_hit<=0) ) continue; // suppose charge -1 FIXME
193 double l1l2 = sqrt( (cirx_hit-cirx_track)*(cirx_hit-cirx_track)+(ciry_hit-ciry_track)*(ciry_hit-ciry_track) );
194 double deltaD ;
195 if( l1l2>cirr_track ) deltaD = l1l2-cirr_track-cirr_hit;
196 if( l1l2<=cirr_track ) deltaD = l1l2-cirr_track+cirr_hit;
197
198 //cal flight length
199
200 double theta_temp;
201 double l_temp;
202 if(cirx_track==0||cirx_hit-cirx_track==0){
203 theta_temp=0;
204 }
205 else{
206 theta_temp=M_PI-atan2(ciry_hit-ciry_track,cirx_hit-cirx_track)+atan2(ciry_track,cirx_track);
207 if(theta_temp>2*M_PI){
208 theta_temp=theta_temp-2*M_PI;
209 }
210 if(theta_temp<0){
211 theta_temp=theta_temp+2*M_PI;
212 }
213 }
214 //cout<<" charge "<<_charge <<" "<<theta_temp<<endl;
215 if(_charge==-1) {
216 l_temp=cirr_track*theta_temp;
217 }
218 if(_charge==1) {
219 theta_temp=2*M_PI-theta_temp;
220 l_temp=cirr_track*(theta_temp);
221 }
222 double pt = fabs( (1./_rho)/333.567 );
223 //if( fabs(deltaD)<0.2 && l_temp<=35 ) _houghPeakHitList.push_back(hit); //suppose 60MeV FIXME
224 //if( fabs(deltaD)<0.2 && l_temp>35 && l_temp<=45) _houghPeakHitList.push_back(hit);
225 /*
226 double d_cut1 = m_dcut1;
227 if( pt<0.06 && fabs(deltaD)<d_cut1 && l_temp<=35 ) _houghPeakHitList.push_back(hit);
228 if( 0.06<pt&&pt<0.07 && fabs(deltaD)<d_cut1 && l_temp<=35 ) _houghPeakHitList.push_back(hit);
229 if( 0.07<pt&&pt<0.08 && fabs(deltaD)<d_cut1 && l_temp<=43 ) _houghPeakHitList.push_back(hit);
230 if( 0.08<pt&&pt<0.09 && fabs(deltaD)<d_cut1 && l_temp<=43 ) _houghPeakHitList.push_back(hit);
231 if( 0.09<pt&&pt<0.10 && fabs(deltaD)<d_cut1 && l_temp<=41 ) _houghPeakHitList.push_back(hit);
232 if( 0.10<pt&&pt<0.11 && fabs(deltaD)<d_cut1 && l_temp<=41 ) _houghPeakHitList.push_back(hit);
233 if( 0.11<pt&&pt<0.12 && fabs(deltaD)<d_cut1 && l_temp<=41 ) _houghPeakHitList.push_back(hit);
234 if( pt>0.12 && fabs(deltaD)<d_cut1 ) _houghPeakHitList.push_back(hit);
235
236 double d_cut2 = m_dcut2;
237 if( pt<0.06 && fabs(deltaD)<d_cut2 && l_temp>35&&l_temp<45 ) _houghPeakHitList.push_back(hit);
238 if( 0.06<pt&&pt<0.07 && fabs(deltaD)<d_cut2 && l_temp>35&& l_temp<=45) _houghPeakHitList.push_back(hit);
239 if( 0.07<pt&&pt<0.08 && fabs(deltaD)<d_cut2 && l_temp>43&& l_temp<=50) _houghPeakHitList.push_back(hit);
240 if( 0.10<pt&&pt<0.11 && fabs(deltaD)<d_cut2 && l_temp>80&& l_temp<=105) _houghPeakHitList.push_back(hit);
241 if( 0.11<pt&&pt<0.12 && fabs(deltaD)<d_cut2 && l_temp>80&& l_temp<=105) _houghPeakHitList.push_back(hit);
242 */
243 if( pt<0.06 && fabs(deltaD)<0.1&& l_temp<=35 ) _houghPeakHitList.push_back(hit);
244 if( 0.06<pt&&pt<0.07 && fabs(deltaD)<0.1 && l_temp<=35 ) _houghPeakHitList.push_back(hit);
245 if( 0.07<pt&&pt<0.08 && fabs(deltaD)<0.1 && l_temp<=43 ) _houghPeakHitList.push_back(hit);
246 if( 0.08<pt&&pt<0.09 && fabs(deltaD)<0.1 && l_temp<=43 ) _houghPeakHitList.push_back(hit);
247 if( 0.09<pt&&pt<0.10 && fabs(deltaD)<0.1 && l_temp<=41 ) _houghPeakHitList.push_back(hit);
248 if( 0.10<pt&&pt<0.11 && fabs(deltaD)<0.1 && l_temp<=41 ) _houghPeakHitList.push_back(hit);
249 if( 0.11<pt&&pt<0.12 && fabs(deltaD)<0.1 && l_temp<=41 ) _houghPeakHitList.push_back(hit);
250
251 if( pt<0.06 && fabs(deltaD)<0.1&& l_temp>35&&l_temp<45 ) _houghPeakHitList.push_back(hit);
252 if( 0.06<pt&&pt<0.07 && fabs(deltaD)<0.1 && l_temp>35&& l_temp<=45) _houghPeakHitList.push_back(hit);
253 if( 0.07<pt&&pt<0.08 && fabs(deltaD)<0.1 && l_temp>43&& l_temp<=50) _houghPeakHitList.push_back(hit);
254 if( 0.08<pt&&pt<0.09 && fabs(deltaD)<0.1 && l_temp>43&& l_temp<=50) _houghPeakHitList.push_back(hit);
255// if( 0.09<pt&&pt<0.10 && fabs(deltaD)<0. && l_temp>41&& l_temp<=50) _houghPeakHitList.push_back(hit);
256// if( 0.10<pt&&pt<0.11 && fabs(deltaD)<0. && l_temp>80&& l_temp<=105) _houghPeakHitList.push_back(hit);
257// if( 0.11<pt&&pt<0.12 && fabs(deltaD)<0. && l_temp>80&& l_temp<=105) _houghPeakHitList.push_back(hit);
258 if( pt>0.12 && fabs(deltaD)<0.1) _houghPeakHitList.push_back(hit);
259 }
260 return _houghPeakHitList.size();
261
262}
EvtStreamInputIterator< typename Generator::result_type > iter(Generator gen, int N=0)
double sin(const BesAngle a)
double cos(const BesAngle a)
#define M_PI
Definition: TConstant.h:4
const std::vector< HoughHit > & getList() const

◆ collectHits() [2/2]

int HoughPeak::collectHits ( const HoughHitList )

◆ getHitNum() [1/2]

int HoughPeak::getHitNum ( int  select) const

Definition at line 103 of file HoughPeak.cxx.

103 {
104 int size=_houghPeakHitList.size();
105 int n0,n1,n2,n3,n4,n5,n6;
106 n0=n1=n2=n3=n4=n5=n6=0;
107 for(int i=0;i<size;i++){
108 int cir= _houghPeakHitList[i]->getCirList();
109 int index = _houghPeakHitList[i]->digi()->getTrackIndex();
110 int style= _houghPeakHitList[i]->getStyle();
111 // cout<<"peak compare ("<<_houghPeakHitList[i]->getLayerId()<<" ," <<_houghPeakHitList[i]->getWireId()<<" )"<<endl;
112 n0++;
113 if( style == 1 ) n1++;
114 if( style == 2 ) n2++;
115 if( index < 0 ) n3++;
116 if( index >=0 && cir<=1 && style==0 ) n4++;
117 if( index <0 || cir>1 ) n5++;
118 if( index >=0 && cir==0 && style==0 ) n6++;
119 }
120 if( select == 0 ) return n0;
121 if( select == 1 ) return n1;
122 if( select == 2 ) return n2;
123 if( select == 3 ) return n3;
124 if( select == 4 ) return n4;
125 if( select == 5 ) return n5;
126 if( select == 6 ) return n6;
127}
int n2
Definition: SD0Tag.cxx:55
int n1
Definition: SD0Tag.cxx:54

◆ getHitNum() [2/2]

int HoughPeak::getHitNum ( int  ) const

◆ getHitNumA() [1/2]

int HoughPeak::getHitNumA ( int  select) const

Definition at line 128 of file HoughPeak.cxx.

128 {
129 int size=_houghPeakHitList.size();
130 int n0,n1,n2,n3,n4,n5,n6;
131 n0=n1=n2=n3=n4=n5=n6=0;
132 for(int i=0;i<size;i++){
133 int cir= _houghPeakHitList[i]->getCirList();
134 int index = _houghPeakHitList[i]->digi()->getTrackIndex();
135 int type = _houghPeakHitList[i]->getSlayerType();
136 int style= _houghPeakHitList[i]->getStyle();
137 if( type ==0 ) n0++;
138 if( type==0 && style == 1 ) n1++;
139 if( type==0 && style == 2 ) n2++;
140 if( type==0 && index < 0 ) n3++;
141 if( type==0 && index >=0 && cir<=1 && style==0) n4++;
142 if( type==0 && (index <0 || cir>1) ) n5++;
143 if( type==0 && index >=0 && cir==0 && style==0) n6++;
144 }
145 if( select == 0 ) return n0;
146 if( select == 1 ) return n1;
147 if( select == 2 ) return n2;
148 if( select == 3 ) return n3;
149 if( select == 4 ) return n4;
150 if( select == 5 ) return n5;
151 if( select == 6 ) return n6;
152}

◆ getHitNumA() [2/2]

int HoughPeak::getHitNumA ( int  ) const

◆ getHitNumS() [1/2]

int HoughPeak::getHitNumS ( int  select) const

Definition at line 153 of file HoughPeak.cxx.

153 {
154 int size=_houghPeakHitList.size();
155 int n0,n1,n2,n3,n4,n5,n6;
156 n0=n1=n2=n3=n4=n5=n6=0;
157 for(int i=0;i<size;i++){
158 int cir= _houghPeakHitList[i]->getCirList();
159 int index = _houghPeakHitList[i]->digi()->getTrackIndex();
160 int type = _houghPeakHitList[i]->getSlayerType();
161 int style= _houghPeakHitList[i]->getStyle();
162 if( type !=0 ) n0++;
163 if( type!=0 && style == 1 ) n1++;
164 if( type!=0 && style == 2 ) n2++;
165 if( type!=0 && index < 0 ) n3++;
166 if( type!=0 && index >=0 && cir<=1 && style==0) n4++;
167 if( type!=0 && (index <0 || cir>1) ) n5++;
168 if( type!=0 && index >=0 && cir==0 && style==0) n6++;
169 }
170 if( select == 0 ) return n0;
171 if( select == 1 ) return n1;
172 if( select == 2 ) return n2;
173 if( select == 3 ) return n3;
174 if( select == 4 ) return n4;
175 if( select == 5 ) return n5;
176 if( select == 6 ) return n6;
177}

◆ getHitNumS() [2/2]

int HoughPeak::getHitNumS ( int  ) const

◆ getHoughHitList() [1/2]

vector< const HoughHit * > HoughPeak::getHoughHitList ( ) const
inline

Definition at line 19 of file InstallArea/include/MdcHoughFinder/MdcHoughFinder/HoughPeak.h.

19{return _houghPeakHitList;}

◆ getHoughHitList() [2/2]

vector< const HoughHit * > HoughPeak::getHoughHitList ( ) const
inline

Definition at line 19 of file Reconstruction/MdcHoughFinder/MdcHoughFinder-00-00-12/MdcHoughFinder/HoughPeak.h.

19{return _houghPeakHitList;}

◆ getisCandiTrack() [1/2]

bool HoughPeak::getisCandiTrack ( ) const
inline

Definition at line 27 of file InstallArea/include/MdcHoughFinder/MdcHoughFinder/HoughPeak.h.

27{return _isCandiTrack;}

◆ getisCandiTrack() [2/2]

bool HoughPeak::getisCandiTrack ( ) const
inline

Definition at line 27 of file Reconstruction/MdcHoughFinder/MdcHoughFinder-00-00-12/MdcHoughFinder/HoughPeak.h.

27{return _isCandiTrack;}

◆ getPeakNum() [1/2]

int HoughPeak::getPeakNum ( ) const
inline

Definition at line 21 of file InstallArea/include/MdcHoughFinder/MdcHoughFinder/HoughPeak.h.

21{return _peakNum;}

◆ getPeakNum() [2/2]

int HoughPeak::getPeakNum ( ) const
inline

◆ getRho() [1/2]

double HoughPeak::getRho ( ) const
inline

◆ getRho() [2/2]

double HoughPeak::getRho ( ) const
inline

◆ getRho_reci() [1/2]

double HoughPeak::getRho_reci ( ) const
inline

Definition at line 26 of file InstallArea/include/MdcHoughFinder/MdcHoughFinder/HoughPeak.h.

26{return 1./_rho;}

◆ getRho_reci() [2/2]

double HoughPeak::getRho_reci ( ) const
inline

◆ getRhoBin() [1/2]

int HoughPeak::getRhoBin ( ) const
inline

Definition at line 23 of file InstallArea/include/MdcHoughFinder/MdcHoughFinder/HoughPeak.h.

23{return _rhoBin;}

◆ getRhoBin() [2/2]

int HoughPeak::getRhoBin ( ) const
inline

◆ getTheta() [1/2]

double HoughPeak::getTheta ( ) const
inline

◆ getTheta() [2/2]

double HoughPeak::getTheta ( ) const
inline

◆ getThetaBin() [1/2]

int HoughPeak::getThetaBin ( ) const
inline

Definition at line 22 of file InstallArea/include/MdcHoughFinder/MdcHoughFinder/HoughPeak.h.

22{return _thetaBin;}

◆ getThetaBin() [2/2]

int HoughPeak::getThetaBin ( ) const
inline

◆ operator=() [1/2]

HoughPeak & HoughPeak::operator= ( const HoughPeak other)

Definition at line 15 of file HoughPeak.cxx.

16{
17 if( this == &other ) return *this;
18 _height=other._height;
19 _theta=other._theta;
20 _rho=other._rho;
21 _thetaBin=other._thetaBin;
22 _rhoBin=other._rhoBin;
23 _isCandiTrack=other._isCandiTrack;
24 _peakNum=other._peakNum;
25 _charge=other._charge;
26 if(_houghPeakHitList.size() != 0 ){
27 for(int i =0;i<_houghPeakHitList.size();i++){
28 _houghPeakHitList[i]=NULL;
29 }
30 _houghPeakHitList.clear();
31 }
32 _houghPeakHitList = other._houghPeakHitList;
33 //for(int i =0;i<other._houghPeakHitList.size();i++){
34 // const HoughHit* p_hit= new HoughHit( *(other._houghPeakHitList[i]));
35 // _houghPeakHitList.push_back(p_hit);
36 //}
37 return *this;
38}

◆ operator=() [2/2]

HoughPeak & HoughPeak::operator= ( const HoughPeak other)

◆ peakHeight() [1/2]

int HoughPeak::peakHeight ( ) const
inline

Definition at line 20 of file InstallArea/include/MdcHoughFinder/MdcHoughFinder/HoughPeak.h.

20{return _height;}

Referenced by less_hits_in_peak().

◆ peakHeight() [2/2]

int HoughPeak::peakHeight ( ) const
inline

◆ print() [1/2]

void HoughPeak::print ( )

◆ print() [2/2]

void HoughPeak::print ( )

◆ printAllHit() [1/2]

void HoughPeak::printAllHit ( ) const

Definition at line 91 of file HoughPeak.cxx.

91 {
92 int size=_houghPeakHitList.size();
93 if( size ==0 ) return ;
94 cout<<"Print hitlist in HoughPeak " <<endl;
95 cout<<"at center ("<<_theta<<" ,"<<_rho<<"): "<<size<<endl;
96 for(int i=0;i<size;i++){
97 int layer= _houghPeakHitList[i]->getLayerId();
98 int wire = _houghPeakHitList[i]->getWireId();
99 std::cout<<"Peak ("<<layer<<","<<wire<<") "<< _houghPeakHitList[i]<<std::endl;
100 }
101}

◆ printAllHit() [2/2]

void HoughPeak::printAllHit ( ) const

◆ setisCandiTrack() [1/2]

void HoughPeak::setisCandiTrack ( bool  is)
inline

Definition at line 28 of file InstallArea/include/MdcHoughFinder/MdcHoughFinder/HoughPeak.h.

28{ _isCandiTrack=is;}

◆ setisCandiTrack() [2/2]

void HoughPeak::setisCandiTrack ( bool  is)
inline

Member Data Documentation

◆ m_dcut1

double HoughPeak::m_dcut1
static

◆ m_dcut2

double HoughPeak::m_dcut2
static

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