FEDRA emulsion software from the OPERA Collaboration
EdbCorrectionMap Class Reference

#include <EdbLayer.h>

Inheritance diagram for EdbCorrectionMap:
Collaboration diagram for EdbCorrectionMap:

Public Member Functions

void ApplyCorrections (EdbCorrectionMap &map)
 
void CorrectSeg (EdbSegP &s)
 
EdbSegCorr CorrLoc (float x, float y)
 
EdbSegCorr CorrLoc (int j)
 
 EdbCorrectionMap ()
 
 EdbCorrectionMap (const EdbCorrectionMap &map)
 
EdbLayerGetLayer (float x, float y)
 
EdbLayerGetLayer (int i)
 
void Init (EdbCell2 &c)
 
void Init (int nx, float minx, float maxx, int ny, float miny, float maxy)
 
int Ncp ()
 
void Print ()
 
void PrintDZ ()
 
virtual ~EdbCorrectionMap ()
 
- Public Member Functions inherited from EdbCell2
bool AddObject (float v[2], TObject *obj)
 
bool AddObject (float x, float y, TObject *obj)
 
bool AddObject (int ix, int iy, TObject *obj)
 
bool AddObject (int j, TObject *obj)
 
int AddObjectOverlap (float x, float y, float dx, float dy, TObject *obj)
 
int CellLim ()
 
void Copy (const EdbCell2 &cell)
 
void Delete ()
 
 EdbCell2 ()
 [eNcell] pointers to cells More...
 
 EdbCell2 (const EdbCell2 &cell)
 
TObject * GetObject (float x, float y, int ientr) const
 
TObject * GetObject (int ix, int iy, int ientr) const
 
TObject * GetObject (int j, int ientr) const
 
int InitCell (EdbCell2 &c)
 
int InitCell (int maxpercell, int n[2], float min[2], float max[2])
 
int InitCell (int nx, float minx, float maxx, int ny, float miny, float maxy, int maxpercell)
 
void InitEPC ()
 
void PrintStat ()
 
void Reset ()
 
int SelectObjects (float min[2], float max[2], TObjArray &arr)
 
int SelectObjects (int min[2], int max[2], TObjArray &arr)
 
int SelectObjects (TObjArray &arr)
 
int SelectObjectsC (float v[2], float r, TObjArray &arr)
 
int SelectObjectsC (float v[2], int ir[2], TObjArray &arr)
 
int SelectObjectsC (int iv[2], int ir[2], TObjArray &arr)
 
int SelectObjectsCJ (int j, int ir, TObjArray &arr)
 
void Set0 ()
 
 ~EdbCell2 ()
 
- Public Member Functions inherited from EdbH2
void AddBin (int jcell, int n)
 
int Bin (float x, float y) const
 
int Bin (int iv[2]) const
 
int Bin (int ix, int iy) const
 
int Bin (int j) const
 
void CleanCells ()
 
void Copy (const EdbH2 &h)
 
void Delete ()
 
int DiscardHighCells (int nmax)
 
TH2F * DrawH2 (const char *name="plot2d", const char *title="EdbH2plot2D")
 
TH1I * DrawSpectrum (const char *name="plot1d", const char *title="EdbH2 DrawSpectrum")
 
 EdbH2 ()
 
 EdbH2 (const EdbH2 &h)
 
 EdbH2 (int nx, float minx, float maxx, int ny, float miny, float maxy)
 
int Fill (float x, float y)
 
int Fill (float x, float y, int n)
 
int Fill (int j, int n=1)
 
int InitH2 (const EdbH2 &h)
 
int InitH2 (int n[2], float min[2], float max[2])
 
int InitH2 (int nx, float minx, float maxx, int ny, float miny, float maxy)
 
Long_t Integral ()
 
Long_t Integral (int iv[2], int ir[2])
 
int IX (float x) const
 
int IX (int jcell) const
 
int IY (float y) const
 
int IY (int jcell) const
 
int Jcell (float v[2]) const
 
int Jcell (float x, float y) const
 
int Jcell (int ix, int iy) const
 
int MaxBin ()
 
Float_t Mean ()
 
int Ncell () const
 
int NX () const
 
int NY () const
 
void PrintStat ()
 
EdbH1ProjectionX ()
 
EdbH1ProjectionY ()
 
void Set0 ()
 
void SetBin (int ix, int iy, int n)
 
void SetBin (int j, int n)
 
float X (int ix) const
 
float Xbin () const
 
float Xj (int j) const
 
float Xmax () const
 
float XmaxA (float level=0)
 
float Xmin () const
 
float XminA (float level=0)
 
float Y (int iy) const
 
float Ybin () const
 
float Yj (int j) const
 
float Ymax () const
 
float YmaxA (float level=0)
 
float Ymin () const
 
float YminA (float level=0)
 
 ~EdbH2 ()
 

Additional Inherited Members

- Protected Attributes inherited from EdbH2
Float_t eBin [2]
 
Float_t eMax [2]
 
Float_t eMin [2]
 
Int_t eN [2]
 
Int_t * eNC
 
Int_t eNcell
 

Constructor & Destructor Documentation

◆ EdbCorrectionMap() [1/2]

EdbCorrectionMap::EdbCorrectionMap ( )
inline
17 {}

◆ EdbCorrectionMap() [2/2]

EdbCorrectionMap::EdbCorrectionMap ( const EdbCorrectionMap map)
inline
18 : EdbCell2(map){}
EdbCell2()
[eNcell] pointers to cells
Definition: EdbCell2.cpp:604

◆ ~EdbCorrectionMap()

EdbCorrectionMap::~EdbCorrectionMap ( )
virtual
164 {
165 }

Member Function Documentation

◆ ApplyCorrections()

void EdbCorrectionMap::ApplyCorrections ( EdbCorrectionMap map)
207 {
208  if( !map.Ncell() ) return;
209  if( NX() != map.NX() ||
210  NY() != map.NY() ) {
211  Log(1,"EdbCorrectionMap::ApplyCorrections","Warning: incompatible maps: %dx%d vs %dx%d Reset map to new one!", NX(),NY(), map.NX(), map.NY() );
212  Init( map );
213  }
214  for(int i=0; i<Ncell(); i++) {
215  EdbLayer *loc = GetLayer(i);
216  EdbLayer *locD = map.GetLayer(i);
217  loc->ApplyCorrections( *locD );
218  }
219 }
bool Log(int level, const char *location, const char *fmt,...)
Definition: EdbLog.cxx:75
EdbLayer * GetLayer(float x, float y)
Definition: EdbLayer.h:24
void Init(EdbCell2 &c)
Definition: EdbLayer.cxx:168
int Ncell() const
Definition: EdbCell2.h:49
int NX() const
Definition: EdbCell2.h:50
int NY() const
Definition: EdbCell2.h:51
Definition: EdbLayer.h:40
void ApplyCorrections(EdbLayer &la)
Definition: EdbLayer.cxx:82

◆ CorrectSeg()

void EdbCorrectionMap::CorrectSeg ( EdbSegP s)
182 {
183  EdbLayer *loc = GetLayer(s.X(), s.Y());
184  if(loc) loc->CorrectSeg(s);
185 }
void CorrectSeg(EdbSegP &s)
Definition: EdbLayer.cxx:70
Float_t X() const
Definition: EdbSegP.h:170
Float_t Y() const
Definition: EdbSegP.h:171
EdbSegP * s
Definition: tlg2pattern.C:32

◆ CorrLoc() [1/2]

EdbSegCorr EdbCorrectionMap::CorrLoc ( float  x,
float  y 
)

286 {
287  EdbSegCorr corr;
288 //TODO
289  return corr;
290 }
Definition: EdbSegCorr.h:8

◆ CorrLoc() [2/2]

EdbSegCorr EdbCorrectionMap::CorrLoc ( int  j)

265 {
266  EdbSegP s;
267  float x0=Xj(j), y0=Yj(j);
268  s.Set(j, x0,y0, 0, 0, 0, 0);
269  EdbLayer *la = GetLayer(j);
270  la->CorrectSeg(s);
271  s.SetX( s.X() - x0 );
272  s.SetY( s.Y() - y0 );
273  s.SetZ(la->Zcorr());
274  EdbSegCorr corr;
275  corr.SetV( 0, s.X());
276  corr.SetV( 1, s.Y());
277  corr.SetV( 2, s.Z());
278  corr.SetV( 3, s.TX());
279  corr.SetV( 4, s.TY());
280  corr.SetV( 5, la->Shr());
281  return corr;
282 }
float Xj(int j) const
Definition: EdbCell2.h:62
float Yj(int j) const
Definition: EdbCell2.h:63
float Zcorr() const
Definition: EdbLayer.h:91
float Shr() const
Definition: EdbLayer.h:90
void SetV(int i, float x)
Definition: EdbSegCorr.h:21
Definition: EdbSegP.h:18
void SetY(Float_t y)
Definition: EdbSegP.h:175
Float_t TX() const
Definition: EdbSegP.h:172
void SetX(Float_t x)
Definition: EdbSegP.h:174
Float_t Z() const
Definition: EdbSegP.h:150
void SetZ(float z)
Definition: EdbSegP.h:122
Float_t TY() const
Definition: EdbSegP.h:173
void Set(int id, float x, float y, float tx, float ty, float w, int flag)
Definition: EdbSegP.h:86

◆ GetLayer() [1/2]

EdbLayer* EdbCorrectionMap::GetLayer ( float  x,
float  y 
)
inline
24 { return (EdbLayer *)(GetObject(x, y, 0)); }
TObject * GetObject(float x, float y, int ientr) const
Definition: EdbCell2.h:199

◆ GetLayer() [2/2]

EdbLayer* EdbCorrectionMap::GetLayer ( int  i)
inline
25 { return (EdbLayer *)(GetObject(i, 0)); }

◆ Init() [1/2]

void EdbCorrectionMap::Init ( EdbCell2 c)
169 {
170  Init(c.NX(),c.Xmin(),c.Xmax(),c.NY(),c.Ymin(),c.Ymax());
171 }
float Xmax() const
Definition: EdbCell2.h:65
float Ymin() const
Definition: EdbCell2.h:66
float Xmin() const
Definition: EdbCell2.h:64
float Ymax() const
Definition: EdbCell2.h:67

◆ Init() [2/2]

void EdbCorrectionMap::Init ( int  nx,
float  minx,
float  maxx,
int  ny,
float  miny,
float  maxy 
)
175 {
176  EdbCell2::InitCell( nx, minx, maxx, ny, miny, maxy, 1);
177  for(int i=0; i<Ncell(); i++) AddObject(i, new EdbLayer() );
178 }
int InitCell(EdbCell2 &c)
Definition: EdbCell2.h:170
bool AddObject(float v[2], TObject *obj)
Definition: EdbCell2.h:176
int nx
Definition: emthickness.cpp:60
int ny
Definition: emthickness.cpp:62

◆ Ncp()

int EdbCorrectionMap::Ncp ( )
240 {
241  int ncp=0;
242  for(int i=0; i<Ncell(); i++) {
243  EdbLayer *loc = GetLayer(i);
244  if(loc) ncp+=loc->Ncp();
245  }
246  return ncp;
247 }
int Ncp() const
Definition: EdbLayer.h:75

◆ Print()

void EdbCorrectionMap::Print ( )
196 {
197  int n=Ncell();
198  printf("EdbCorrectionMap with %d = %d x %d layers\n", n, NX(), NY() );
199  for(int i=0; i<n; i++) {
200  printf("%d dz=%7.2f\n",i,GetLayer(i)->Zcorr());
201  GetLayer(i)->Print();
202  }
203 }
void Print()
Definition: EdbLayer.cxx:150

◆ PrintDZ()

void EdbCorrectionMap::PrintDZ ( )
189 {
190  int n=Ncell();
191  for(int i=0; i<n; i++) printf("%d dz=%7.2f\n",i,GetLayer(i)->Zcorr());
192 }

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