CGEM BOSS 6.6.5.h
BESIII Offline Software System
Loading...
Searching...
No Matches
THistogram.h
Go to the documentation of this file.
1//-----------------------------------------------------------------------------
2// $Id: THistogram.h,v 1.5 2010/03/31 09:58:59 liucy Exp $
3//-----------------------------------------------------------------------------
4// Filename : THistogram.h
5// Section : Tracking
6// Owner : Yoshi Iwasaki
7// Email : [email protected]
8//-----------------------------------------------------------------------------
9// Description : A class for a histogram used in tracking.
10// See http://bsunsrv1.kek.jp/~yiwasaki/tracking/
11//-----------------------------------------------------------------------------
12
13#ifndef THistogram_FLAG_
14#define THistogram_FLAG_
15
16#ifdef TRKRECO_DEBUG_DETAIL
17#ifndef TRKRECO_DEBUG
18#define TRKRECO_DEBUG
19#endif
20#endif
21
22#include <string>
23
24#define HEP_SHORT_NAMES
25#include "CLHEP/Alist/AList.h"
26
27#include "TrkReco/TMLink.h"
28#include "TrkReco/TSegment0.h"
29#include "TrkReco/TSegment.h"
30
31class TCircle;
32
33/// A class for a histogram used in tracking.
35
36 public:
37 /// Constructor.
38 THistogram(unsigned nBins);
39
40 /// Destructor
41 virtual ~THistogram();
42
43 public:// Selectors
44 /// dumps debug information.
45 void dump(const std::string & message = std::string(""),
46 const std::string & prefix = std::string("")) const;
47
48 /// returns a pointer to i'th AList<TMLink>.
49 const AList<TMLink> * const bin(unsigned i) const;
50
51 /// returns a pointer to i'th AList<TMLink>.
52 const AList<TMLink> * const bin(int i) const;
53
54 /// returns number in i'th bin.
55 unsigned nBin(unsigned i) const;
56
57 /// returns \# of bins.
58 unsigned nBins(void) const;
59
60 /// returns an AList of TMLinks within 'center' bin +- 'width' bin region.
61 AList<TMLink> contents(unsigned center, unsigned width) const;
62
63 /// returns an AList of TMLinks from 'start' bin to 'end' bin region.
64 AList<TMLink> contents(int start, int end) const;
65
66 /// returns an AList<TMLink> of all contents.
67 const AList<TMLink> & contents(void) const;
68
69 /// returns an AList<TSegment0> of clusters.
70 AList<TSegment0> clusters0(void) const;
71
72 /// returns an AList<TSegment0> of clusters.
73 AList<TSegment> clusters(void) const;
74
75 /// returns an AList<TSegment0> using clusters() function.
76 AList<TSegment0> segments0(void) const;
77
78 /// returns an AList<TSegment0> using clusters() function.
79 AList<TSegment> segments(void) const;
80
81 public:// Modifiers
82 /// fills with hits.
83 void fillX(const AList<TMLink> & links);
84
85 /// fills with hits.
86 void fillY(const AList<TMLink> & links);
87
88 /// fills with hits.
89 void fillPhi(const AList<TMLink> & links);
90
91 /// removes links.
92 void remove(const AList<TMLink> & links);
93
94 /// masks a bin. Masked bin will not be returned by ::findPeak.
95 void mask(unsigned binN);
96
97 /// remove masks.
98 void unmask(void);
99
100 private:
101 unsigned _nBins;
102 unsigned * _bins;
103 bool * _masks;
104 AList<TMLink> ** _links;
105 AList<TMLink> _all;
106 float _binSize;
107};
108
109//-----------------------------------------------------------------------------
110
111#ifdef THistogram_NO_INLINE
112#define inline
113#else
114#undef inline
115#define THistogram_INLINE_DEFINE_HERE
116#endif
117
118#ifdef THistogram_INLINE_DEFINE_HERE
119
120inline
121const AList<TMLink> * const
122THistogram::bin(unsigned i) const {
123 if (i < _nBins) return _links[i];
124 return 0;
125}
126
127inline
128const AList<TMLink> * const
129THistogram::bin(int i) const {
130 while (i < 0) i += _nBins;
131 return _links[i % _nBins];
132}
133
134inline
135unsigned
136THistogram::nBins(void) const {
137 return _nBins;
138}
139
140inline
141void
142THistogram::mask(unsigned a) {
143 _masks[a] = true;
144}
145
146inline
147void
149 for (unsigned i = 0; i < _nBins; i++) _masks[i] = false;
150}
151
152inline
153const AList<TMLink> &
155 return _all;
156}
157
158inline
159unsigned
160THistogram::nBin(unsigned i) const {
161 if (i < _nBins) return _bins[i];
162 return 0;
163}
164
165#endif
166
167#undef inline
168
169#endif /* THistogram_FLAG_ */
*******INTEGER m_nBinMax INTEGER m_NdiMax !No of bins in histogram for cell exploration division $ !Last vertex $ !Last active cell $ !Last cell in buffer $ !No of sampling when dividing cell $ !No of function total $ !Flag for random ceel for $ !Flag for type of for WtMax $ !Flag which decides whether vertices are included in the sampling $ entire domain is hyp !Maximum effective eevents per bin
Definition FoamA.h:85
A class to represent a circle in tracking.
Definition TCircle.h:42
A class for a histogram used in tracking.
Definition THistogram.h:34
const AList< TMLink > & contents(void) const
returns an AList<TMLink> of all contents.
Definition THistogram.h:154
virtual ~THistogram()
Destructor.
void mask(unsigned binN)
masks a bin. Masked bin will not be returned by ::findPeak.
Definition THistogram.h:142
THistogram(unsigned nBins)
Constructor.
unsigned nBins(void) const
returns # of bins.
Definition THistogram.h:136
AList< TSegment0 > clusters0(void) const
returns an AList<TSegment0> of clusters.
void fillX(const AList< TMLink > &links)
fills with hits.
void remove(const AList< TMLink > &links)
removes links.
AList< TSegment > segments(void) const
returns an AList<TSegment0> using clusters() function.
unsigned nBin(unsigned i) const
returns number in i'th bin.
Definition THistogram.h:160
AList< TSegment0 > segments0(void) const
returns an AList<TSegment0> using clusters() function.
const AList< TMLink > *const bin(unsigned i) const
returns a pointer to i'th AList<TMLink>.
Definition THistogram.h:122
void fillY(const AList< TMLink > &links)
fills with hits.
void dump(const std::string &message=std::string(""), const std::string &prefix=std::string("")) const
dumps debug information.
void unmask(void)
remove masks.
Definition THistogram.h:148
void fillPhi(const AList< TMLink > &links)
fills with hits.
AList< TSegment > clusters(void) const
returns an AList<TSegment0> of clusters.