#include <EdbIP.h>
|
| static float | BurnPix (TH2F *h, int ic, int ir, float thr, EdbClustP &cl) |
| |
| static int | BurnPix (unsigned char *img, int ic, int ir, int nc, unsigned char thr, EdbCluster &cl) |
| |
| static int | Clusterize (EdbFrame *f, unsigned char thr, EdbView &v) |
| |
| static int | Clusterize (TH2F *h, float thr, TTree *tree, float z, int ifr) |
| |
| static int | Clusterize2 (TH2F *h, float thr, TTree *tree, float z, int ifr) |
| |
| static int | Peak12 (TH2F *h, float thr) |
| |
| static int | Peak8 (TH2F *h, float thr) |
| |
◆ EdbIP()
Float_t eThr
Definition: EdbIP.h:91
EdbFIRF * eFIR
Definition: EdbIP.h:90
◆ BurnPix() [1/2]
| float EdbIP::BurnPix |
( |
TH2F * |
h, |
|
|
int |
ic, |
|
|
int |
ir, |
|
|
float |
thr, |
|
|
EdbClustP & |
cl |
|
) |
| |
|
static |
453 float pix=h->GetBinContent(ic,ir);
454 if( pix<thr )
return 0;
458 h->SetBinContent(ic,ir,0,-pix);
461 int xn[4] = { 1, -1, 0, 0 };
462 int yn[4] = { 0, 0, 1, -1 };
466 for(
int in=0; in<4; in++) {
469 pp = (float)( h->GetBinContent(i,j) );
470 if( pp < thr )
continue;
471 pix +=
BurnPix(h,i,j, thr, cl);
void AddPixel(float ic, float ir, float pix)
Definition: EdbIP.cxx:195
static float BurnPix(TH2F *h, int ic, int ir, float thr, EdbClustP &cl)
Definition: EdbIP.cxx:451
◆ BurnPix() [2/2]
| int EdbIP::BurnPix |
( |
unsigned char * |
img, |
|
|
int |
ic, |
|
|
int |
ir, |
|
|
int |
nc, |
|
|
unsigned char |
thr, |
|
|
EdbCluster & |
cl |
|
) |
| |
|
static |
601 int pix = buf[nc*ir+ic];
606 if(cl.
GetArea() >50000)
return pix;
608 int xn[4] = { 1, -1, 0, 0 };
609 int yn[4] = { 0, 0, 1, -1 };
613 for(
int in=0; in<4; in++) {
617 if( pp < thr )
continue;
618 pix +=
BurnPix(buf,i,j, nc, thr, cl);
void AddPixelSum(int x, int y, unsigned char pix)
Definition: EdbCluster.h:60
Float_t GetArea() const
Definition: EdbCluster.h:54
◆ Clusterize() [1/3]
568 float z = frame->GetZ();
569 int ifr = frame->GetID();
571 int nc = img->
Width();
573 printf(
"img: %d %d\n",nc,nr);
575 unsigned char *buf = (
unsigned char*)(img->
GetBuffer());
581 for(
int ir=2; ir<nr-3; ir++) {
582 for(
int ic=2; ic<nc-3; ic++) {
585 if( pix <= thr)
continue;
588 wcl =
BurnPix( buf, ic,ir, nc, thr, *cl);
593 printf(
"Clusterize2............ %15.8f\n",sw.CpuTime());
594 printf(
"ncl=%d\n",ncl);
Definition: EdbCluster.h:19
void Normalize()
Definition: EdbCluster.h:69
Definition: EdbImage.h:23
Int_t Height() const
Definition: EdbImage.h:60
char * GetBuffer() const
Definition: EdbImage.h:48
Int_t Width() const
Definition: EdbImage.h:59
EdbCluster * AddCluster(EdbCluster *c)
Definition: EdbView.h:225
◆ Clusterize() [2/3]
| int EdbIP::Clusterize |
( |
EdbFrame * |
frame, |
|
|
TTree * |
tree |
|
) |
| |
401 float z = frame->
GetZ();
402 int ifr = frame->
GetID();
TH2F * ApplyTo(EdbImage *img)
Definition: EdbIP.cxx:166
float GetZ() const
Definition: EdbFrame.h:42
int GetID() const
Definition: EdbFrame.h:41
EdbImage * GetImage() const
Definition: EdbFrame.h:45
int Clusterize(EdbFrame *frame, TTree *tree)
Definition: EdbIP.cxx:398
◆ Clusterize() [3/3]
| int EdbIP::Clusterize |
( |
TH2F * |
h, |
|
|
float |
thr, |
|
|
TTree * |
tree, |
|
|
float |
z, |
|
|
int |
ifr |
|
) |
| |
|
static |
413 int nc = h->GetNbinsX();
414 int nr = h->GetNbinsY();
418 printf(
"hist: %d %d\n",nc,nr);
420 tree->GetDirectory()->cd();
422 tree->SetBranchAddress(
"cl",&cl);
428 for(
int ic=2; ic<nc-3; ic++) {
429 for(
int ir=2; ir<nr-3; ir++) {
431 pix = (float)(h->GetBinContent(ic,ir));
432 if( pix <= thr)
continue;
435 wcl =
BurnPix( h, ic,ir, thr, *cl);
442 printf(
"Clusterize2............ %15.8f\n",sw.CpuTime());
void Reset()
Definition: EdbIP.cxx:245
void SetFrame(int f)
Definition: EdbCluster.h:47
virtual void SetZ(float z)
Definition: EdbCluster.h:83
◆ Clusterize2() [1/2]
| int EdbIP::Clusterize2 |
( |
EdbFrame * |
frame, |
|
|
TTree * |
tree |
|
) |
| |
480 float z = frame->
GetZ();
481 int ifr = frame->
GetID();
int Clusterize2(EdbFrame *frame, TTree *tree)
Definition: EdbIP.cxx:477
◆ Clusterize2() [2/2]
| int EdbIP::Clusterize2 |
( |
TH2F * |
h, |
|
|
float |
thr, |
|
|
TTree * |
tree, |
|
|
float |
z, |
|
|
int |
ifr |
|
) |
| |
|
static |
◆ CutBG()
365 int nc = h->GetNbinsX();
366 int nr = h->GetNbinsY();
369 for(ic=0; ic<nc; ic++) {
370 for(ir=0; ir<nr; ir++) {
371 pix = (float)(h->GetBinContent(ic,ir));
372 if(pix<=
eThr) h->SetBinContent(ic,ir,0);
373 else h->SetBinContent(ic,ir,pix-
eThr);
377 float binmax = h->GetMaximum();
378 printf(
"binmax = %f\n",binmax);
381 for(ic=0; ic<nc; ic++) {
382 for(ir=0; ir<nr; ir++) {
383 pix = (float)(h->GetBinContent(ic,ir));
385 buf[nc*ir+ic] = (
unsigned char)(255.*pix/binmax);
388 else buf[nc*ir+ic] =0;
◆ InitTree()
| TTree * EdbIP::InitTree |
( |
| ) |
|
349 TFile *
f =
new TFile(
"clusters.root",
"RECREATE");
351 TTree *tree =
new TTree(
"clust",
"clusters tree");
354 tree->Branch(
"cl",
"EdbClustP",&cl,32000,99);
FILE * f
Definition: RecDispMC.C:150
◆ Peak12()
| int EdbIP::Peak12 |
( |
TH2F * |
h, |
|
|
float |
thr |
|
) |
| |
|
static |
297 int xn[12] = { 1, -1, 0, 0, 1, 1, -1, -1, 2, 0, 0, -2 };
298 int yn[12] = { 0, 0, 1, -1, 1, -1, 1, -1, 0, 2, -2, 0 };
300 int nc = h->GetNbinsX();
301 int nr = h->GetNbinsY();
305 printf(
"hist: %d %d\n",nc,nr);
308 for(
int ic=2; ic<nc-3; ic++) {
309 for(
int ir=2; ir<nr-3; ir++) {
311 pix = h->GetBinContent(ic,ir);
313 if( pix < thr)
goto NEXTPIX;
317 for(in=0; in<4; in++) {
318 pp = h->GetBinContent( ic+xn[in], ir+yn[in] );
319 if( pix < pp )
goto NEXTPIX;
324 for(in=4; in<12; in++) {
325 pp = h->GetBinContent( ic+xn[in], ir+yn[in] );
326 if( pix < pp )
goto NEXTPIX;
331 if( s4 < s8+5 )
goto NEXTPIX;
332 if( pix < s4+5 )
goto NEXTPIX;
335 printf(
"peak12(%d,%d) = %f \t %f\t %f\n",ic,ir,pix, s4,s8);
336 h->SetBinContent(ic,ir,0,5000);
◆ Peak8()
| int EdbIP::Peak8 |
( |
TH2F * |
h, |
|
|
float |
thr |
|
) |
| |
|
static |
263 int xn[8] = { 1, -1, 0, 0, 1, 1, -1, -1 };
264 int yn[8] = { 0, 0, 1, -1, 1, -1, 1, -1 };
266 int nc = h->GetNbinsX();
267 int nr = h->GetNbinsY();
270 printf(
"hist: %d %d\n",nc,nr);
273 for(ic=2; ic<nc-3; ic++) {
274 for(ir=2; ir<nr-3; ir++) {
276 pix = (float)(h->GetBinContent(ic,ir));
277 if( pix < thr)
goto NEXTPIX;
279 for(in=0; in<8; in++) {
280 pp = (float)(h->GetBinContent( ic+xn[in], ir+yn[in] ));
281 if( pix <= pp )
goto NEXTPIX;
283 printf(
"peak8(%d,%d) = %f\n",ic,ir,pix);
◆ SetFIR()
◆ SetThr()
| void EdbIP::SetThr |
( |
Float_t |
thr | ) |
|
|
inline |
◆ eFIR
◆ eThr
The documentation for this class was generated from the following files: