SND@LHC Software
Loading...
Searching...
No Matches
ecalLightMap.h
Go to the documentation of this file.
1#ifndef ECALLIGHTMAP_H
2#define ECALLIGHTMAP_H
3
4#include "TNamed.h"
5
6class ecalLightMap : public TNamed
7{
8public:
9 ecalLightMap() : TNamed(), fSSide(0.), fS(0), fSize(0), fData(NULL) {};
10 ecalLightMap(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 ~ecalLightMap() {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(ecalLightMap, 1)
43};
44
45#endif
virtual ~ecalLightMap()
ecalLightMap & operator=(const ecalLightMap &)
Int_t GetNum(Double_t x, Double_t y)
void Init(const char *filename)
Double_t Data(Double_t x, Double_t y)
Double_t fSSide
Double_t * fData
ecalLightMap(const ecalLightMap &)