16#include "TrkReco/THistogram.h"
17#include "TrkReco/TCircle.h"
20 _binSize = 2. *
M_PI / (float) _nBins;
21 _bins = (
unsigned *) malloc(_nBins *
sizeof(
unsigned));
22 _masks = (
bool *) malloc(_nBins *
sizeof(
bool));
24 for (
unsigned i = 0; i < _nBins; i++) {
34 for (
unsigned i = 0; i < _nBins; i++)
42 std::cout <<
"THistogram dump:#bins=" << _nBins << std::endl;
43 unsigned nLoops = _nBins / 15 + 1;
46 for (
unsigned i = 0; i < nLoops; i++) {
47 for (
unsigned j = 0; j < 15; j++) {
48 if (n0 == _nBins)
break;
52 std::cout << std::endl;
53 for (
unsigned j = 0; j < 15; j++) {
54 if (
n1 == _nBins)
break;
55 if (! _masks[
n1]) printf(
"%4d", _bins[
n1]);
56 else printf(
"-%3d", _bins[
n1]);
59 std::cout << std::endl;
62 if (msg.find(
"detail") != std::string::npos) {
63 for (
unsigned i = 0; i < _nBins; i++) {
64 std::cout <<
"bin " << i <<
" : ";
65 for (
unsigned j = 0; j < _links[i]->length(); j++) {
66 std::cout << (* _links[i])[j]->wire()->name() <<
",";
68 std::cout << std::endl;
78 unsigned nLinks = links.length();
79 double offset = _binSize / 4.;
80 for (
unsigned i = 0; i < nLinks; i++) {
83 unsigned pos = (unsigned) floor((p.x() + offset) / _binSize);
89 _links[pos]->append(l);
96 unsigned nLinks = links.length();
97 for (
unsigned i = 0; i < nLinks; i++) {
100 unsigned pos = (unsigned) floor(p.y() / _binSize);
106 _links[pos]->append(l);
113 unsigned nLinks = links.length();
114 double offset = _binSize / 4.;
115 for (
unsigned i = 0; i < nLinks; i++) {
118 float phi = atan2(p.y(), p.x()) +
M_PI;
120 unsigned pos = (unsigned) floor((phi + offset) / _binSize);
129 _links[pos]->append(l);
135 for (
unsigned i = 0; i < _nBins; i++) {
136 _links[i]->remove(links);
137 _bins[i] = _links[i]->length();
145 for (
int i = - (
int) width;
148 links.append(*
bin((
int) center + i));
156 for (
int i = start; i <= end; i++)
157 links.append(*
bin(i));
167 while (_bins[begin] > 0) begin++;
168 if (begin == _nBins)
return list;
172 while (loop < _nBins) {
174 unsigned id = (begin + loop) % _nBins;
179 if (_bins[
id]) ++size;
182 id = (begin + loop) % _nBins;
183 if (loop == _nBins)
break;
196 unsigned n = list.length();
197 if (
n == 0)
return list;
201 for (
unsigned i = 0; i <
n; i++) {
205 if (newClusters.length() == 0) {
210 list.append(newClusters);
212#ifdef TRKRECO_DEBUG_DETAIL
213 c->
dump(
"hits",
" ");
214 std::cout <<
" ... splitted as" << std::endl;
215 for (
unsigned j = 0; j < newClusters.length(); j++) {
216 std::cout <<
" " << j <<
" : ";
217 newClusters[j]->dump(
"hits");
221 list.remove(splitted);
222 HepAListDeleteAll(splitted);
234 while (_bins[begin] > 0)begin++;
235 if (begin == _nBins)
return list;
239 while (loop < _nBins) {
241 unsigned id = (begin + loop) % _nBins;
246 if (_bins[
id]) ++size;
249 id = (begin + loop) % _nBins;
250 if (loop == _nBins)
break;
268 unsigned n = list.length();
269 if (
n == 0)
return list;
273 for (
unsigned i = 0; i <
n; i++) {
276#ifdef TRKRECO_DEBUG_DETAIL
277 std::cout <<
" base segment : ";
282 if (newClusters.length() == 0) {
283#ifdef TRKRECO_DEBUG_DETAIL
284 std::cout <<
" ... Solving dual hits" << std::endl;
290 list.append(newClusters);
292#ifdef TRKRECO_DEBUG_DETAIL
293 c->
dump(
"hits",
" ");
294 std::cout <<
" ... splitted as" << std::endl;
295 for (
unsigned j = 0; j < newClusters.length(); j++) {
296 std::cout <<
" " << j <<
" : ";
297 newClusters[j]->dump(
"hits");
301 list.remove(splitted);
302 HepAListDeleteAll(splitted);
*******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
const AList< TMLink > & contents(void) const
returns an AList<TMLink> of all contents.
virtual ~THistogram()
Destructor.
THistogram(unsigned nBins)
Constructor.
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.
AList< TSegment0 > segments0(void) const
returns an AList<TSegment0> using clusters() function.
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 fillPhi(const AList< TMLink > &links)
fills with hits.
AList< TSegment > clusters(void) const
returns an AList<TSegment0> of clusters.
A class to relate TMDCWireHit and TTrack objects.
const HepPoint3D & position(void) const
returns position.
A class to relate TMDCWireHit and TTrack objects.
void dump(const std::string &message=std::string(""), const std::string &prefix=std::string("")) const
dumps debug information.
AList< TSegment0 > split(void) const
returns a list of sub TSegments in this cluster. If cluster type is 1, 2, or 7, no cluster is returne...
A class to relate TMDCWireHit and TTrack objects.
void dump(const std::string &message=std::string(""), const std::string &prefix=std::string("")) const
dumps debug information.
AList< TSegment > split(void) const
returns a list of sub TSegments in this cluster. If cluster type is 1, 2, or 7, no cluster is returne...
void append(TMLink &)
appends a TMLink.