SND@LHC Software
Loading...
Searching...
No Matches
hcalLightMap.h
Go to the documentation of this file.
1#ifndef HCALLIGHTMAP_H
2#define HCALLIGHTMAP_H
3
4#include "TNamed.h"
5
6class hcalLightMap : public TNamed
7{
8public:
9 hcalLightMap() : TNamed(), fSSide(0.), fS(0), fSize(0), fData(NULL) {};
10 hcalLightMap(const char* fname, const char* title="Light collection efficiency map");
11 Double_t Data(Double_t x, Double_t y)
12 {Int_t n=GetNum(x,y); if (n<0) return n; return fData[n];}
13 Int_t GetNum(Double_t x, Double_t y)
14 {
15 Double_t lx=x+0.5; Double_t ly=y+0.5;
16 if (lx<0) lx=0; if (ly<0) ly=0;
17 if (lx>1) lx=1; if (ly>1) ly=1;
18 Int_t ix=(Int_t)(lx/fSSide);
19 Int_t iy=(Int_t)(ly/fSSide);
20 return iy*fS+ix;
21 }
22 virtual ~hcalLightMap() {delete fData;}
23private:
25 void Init(const char* filename);
27 void FillGaps();
29 void Normalize();
31 Double_t fSSide;
33 Int_t fS;
35 Int_t fSize;
37 Double_t* fData;
38
41
42 ClassDef(hcalLightMap, 1)
43};
44
45#endif
Int_t GetNum(Double_t x, Double_t y)
Double_t Data(Double_t x, Double_t y)
Double_t fSSide
hcalLightMap & operator=(const hcalLightMap &)
void Init(const char *filename)
hcalLightMap(const hcalLightMap &)
Double_t * fData
virtual ~hcalLightMap()