FEDRA emulsion software from the OPERA Collaboration
EdbCell1 Class Reference

#include <EdbCell1.h>

Inheritance diagram for EdbCell1:
Collaboration diagram for EdbCell1:

Public Member Functions

bool AddObject (float x, TObject *obj)
 
bool AddObject (int j, TObject *obj)
 
void Delete ()
 
 EdbCell1 ()
 pointers to cells [eNcell] More...
 
TObject * GetObject (int j, int ientr) const
 
int InitCell (int maxpercell, int n, float min, float max)
 
void PrintStat ()
 
void Reset ()
 
int SelectObjects (float min, float max, TObjArray &arr)
 
int SelectObjects (int min, int max, TObjArray &arr)
 
int SelectObjects (TObjArray &arr)
 
int SelectObjectsC (float v, int ir, TObjArray &arr)
 
int SelectObjectsC (int iv, int ir, TObjArray &arr)
 
 ~EdbCell1 ()
 
- Public Member Functions inherited from EdbH1
void AddBin (int jcell, int n)
 
int Bin (int ix) const
 
void CleanCells ()
 
void Copy (const EdbH1 &h)
 
void Delete ()
 
int DiscardHighCells (int nmax)
 
TH1F * DrawH1 (const char *name="EdbH1plot", const char *title="EdbH1plot1D")
 
TH1I * DrawSpectrum (const char *name="EdbH1spectrun")
 
 EdbH1 ()
 [eNcell] number of objects/cell More...
 
 EdbH1 (const EdbH1 &h)
 
 EdbH1 (int n, float min, float max)
 
int Fill (float x)
 
int Fill (float x, int n)
 
int InitH1 (const EdbH1 &h)
 
int InitH1 (int n, float min, float max)
 
Long_t Integral ()
 
Long_t Integral (int iv, int ir)
 
int IX (float x) const
 
int Jcell (float x) const
 
int Jcell (int ix) const
 
int MaxBin ()
 
Float_t Mean ()
 
int N () const
 
int Ncell () const
 
void Print ()
 
void PrintStat ()
 
void Set0 ()
 
void SetBin (int ix, int n)
 
float X (int i) const
 
float Xbin () const
 
float Xmax () const
 
float XmaxA (float level=0)
 
float Xmin () const
 
float XminA (float level=0)
 
 ~EdbH1 ()
 

Private Attributes

Int_t eCellLim
 
TObject *** epC
 pointers to objects [eNcell*eCellLim] More...
 
TObject ** epO
 

Additional Inherited Members

- Protected Attributes inherited from EdbH1
Float_t eBin
 
Float_t eMax
 
Float_t eMin
 
Int_t eN
 
Int_t * eNC
 
Int_t eNcell
 

Constructor & Destructor Documentation

◆ EdbCell1()

EdbCell1::EdbCell1 ( )

pointers to cells [eNcell]

476 {
477  eCellLim=0;
478  epO=0;
479  epC=0;
480 }
TObject ** epO
Definition: EdbCell1.h:122
Int_t eCellLim
Definition: EdbCell1.h:121
TObject *** epC
pointers to objects [eNcell*eCellLim]
Definition: EdbCell1.h:123

◆ ~EdbCell1()

EdbCell1::~EdbCell1 ( )
484 {
485  Delete();
486 }
void Delete()
Definition: EdbCell1.cpp:496

Member Function Documentation

◆ AddObject() [1/2]

bool EdbCell1::AddObject ( float  x,
TObject *  obj 
)
519 {
520  int j = Jcell(x);
521  return AddObject(j, obj);
522 }
bool AddObject(float x, TObject *obj)
Definition: EdbCell1.cpp:518
int Jcell(int ix) const
Definition: EdbCell1.h:51

◆ AddObject() [2/2]

bool EdbCell1::AddObject ( int  j,
TObject *  obj 
)
526 {
527  if(j>=eNcell) return 0;
528  if(j<0) return 0;
529  if(eNC[j]>=eCellLim) return 0;
530  if(!obj) return 0;
531  epC[j][eNC[j]] = obj;
532  eNC[j]++;
533  return 1;
534 }
Int_t eNcell
Definition: EdbCell1.h:26
Int_t * eNC
Definition: EdbCell1.h:27

◆ Delete()

void EdbCell1::Delete ( )
497 {
498  if(epC) { delete [] epC; epC = 0; }
499  if(epO) { delete [] epO; epO = 0; }
500 }

◆ GetObject()

TObject* EdbCell1::GetObject ( int  j,
int  ientr 
) const
inline
142  {
143  if(j>=0&&j<eNcell&&ientr>=0&&ientr<eCellLim) return epC[j][ientr];
144  else return 0;
145  }

◆ InitCell()

int EdbCell1::InitCell ( int  maxpercell,
int  n,
float  min,
float  max 
)
504 {
505  InitH1(n, min, max);
506  Log(3,"EdbCell1::InitCell","reserve space for maxpercell(%d) * eNcell(%d) = %d objects",
507  maxpercell, eNcell, maxpercell*eNcell);
508  eCellLim = maxpercell;
509  epO = new TObject*[eNcell*eCellLim]; //- pointers to objects
510  epC = new TObject**[eNcell]; //- pointers to cells
511  TObject **po = epO;
512  epC[0]=po;
513  for(int i=1; i<eNcell; i++) {po+=eCellLim; epC[i]=po;}
514  return eNcell;
515 }
bool Log(int level, const char *location, const char *fmt,...)
Definition: EdbLog.cxx:75
float min(TClonesArray *t)
Definition: bitview.cxx:275
int max
Definition: check_shower.C:41
int InitH1(const EdbH1 &h)
Definition: EdbCell1.h:38
TProfile * po
Definition: testChi2Ordering.C:29

◆ PrintStat()

void EdbCell1::PrintStat ( )
490 {
491  printf("EdbCell1 limit = %4d\n",eCellLim);
492  ((EdbH1*)this)->PrintStat();
493 }
Definition: EdbCell1.h:17

◆ Reset()

void EdbCell1::Reset ( )
inline
131 {CleanCells(); Delete();}
void CleanCells()
Definition: EdbCell1.cpp:84

◆ SelectObjects() [1/3]

int EdbCell1::SelectObjects ( float  min,
float  max,
TObjArray &  arr 
)
546 {
547  return SelectObjects( IX(min), IX(max), arr);
548 }
int SelectObjects(TObjArray &arr)
Definition: EdbCell1.cpp:565
int IX(float x) const
Definition: EdbCell1.h:50

◆ SelectObjects() [2/3]

int EdbCell1::SelectObjects ( int  min,
int  max,
TObjArray &  arr 
)
552 {
553  int nobj = 0;
554  int jcell = 0;
555  for(int ix = Max(0,min); ix<=Min(eN-1,max); ix++)
556  {
557  jcell = Jcell(ix);
558  if(eNC[jcell]<1) continue;
559  for(int k=0; k<eNC[jcell]; k++) { arr.Add( epC[jcell][k] ); nobj++; }
560  }
561  return nobj;
562 }
Int_t eN
Definition: EdbCell1.h:21

◆ SelectObjects() [3/3]

int EdbCell1::SelectObjects ( TObjArray &  arr)
566 {
567  // select all objects
568  int nobj = 0;
569  for(int i = 0; i<eNcell; i++)
570  {
571  if(eNC[i]<1) continue;
572  for(int k=0; k<eNC[i]; k++) { arr.Add( epC[i][k] ); nobj++; }
573  }
574  return nobj;
575 }

◆ SelectObjectsC() [1/2]

int EdbCell1::SelectObjectsC ( float  v,
int  ir,
TObjArray &  arr 
)
inline
140 { return SelectObjectsC( IX(v), ir, arr); }
int SelectObjectsC(int iv, int ir, TObjArray &arr)
Definition: EdbCell1.cpp:537

◆ SelectObjectsC() [2/2]

int EdbCell1::SelectObjectsC ( int  iv,
int  ir,
TObjArray &  arr 
)
538 {
539  int min = vcent-vdiff;
540  int max = vcent+vdiff;
541  return SelectObjects(min,max, arr);
542 }

Member Data Documentation

◆ eCellLim

Int_t EdbCell1::eCellLim
private

◆ epC

TObject*** EdbCell1::epC
private

pointers to objects [eNcell*eCellLim]

◆ epO

TObject** EdbCell1::epO
private

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