SND@LHC Software
Loading...
Searching...
No Matches
ecalModule.h
Go to the documentation of this file.
1
8#ifndef ECALMODULE_H
9#define ECALMODULE_H
10
11#include "ecalCell.h"
12
13#include <vector>
14#include <list>
15
16class ecalModule : public ecalCell
17{
18
19public:
20 // Set mc==1 to construct ecalCellMC, not ecalCell
21 ecalModule(char type=1, Int_t cellnumber=-1, Float_t x1=0, Float_t y1=0, Float_t x2=0, Float_t y2=0, Int_t mc=0,Float_t energy=0);
22
23 ecalCell* Locate(Int_t x, Int_t y) const;
24
25 //Faster than Locate, but doesn't check boundaries
26 inline ecalCell* At(Int_t x, Int_t y) const {return fCells[y*GetType()+x];}
27 ecalCell* FindCell(Float_t x, Float_t y) const;
28 void AddEnergy(Float_t x, Float_t y, Float_t energy);
29 inline Float_t GetEnergy(Float_t x, Float_t y) const
30 {
31 ecalCell* tmp=FindCell(x,y);
32 if (tmp) return tmp->GetEnergy();
33 return -1;
34 }
35 void ResetModule();
36
37 inline Float_t GetDX() const {return fDx;}
38 inline Float_t GetDY() const {return fDy;}
39 std::vector<ecalCell*> GetCells() const {return fCells;}
40
41 //returns cells for which X1<x<X2
42 std::list<ecalCell*> GetCellsX(Float_t x) const;
43 //returns cells for which Y1<y<Y2
44 std::list<ecalCell*> GetCellsY(Float_t y) const;
45
46private:
48 Float_t fDx;
50 Float_t fDy;
52 std::vector<ecalCell*> fCells;
53
55};
56
58{
60 for(UInt_t i=0;i<fCells.size();i++) fCells[i]->ResetEnergyFast();
61}
62#endif
Char_t GetType() const
Definition ecalCell.h:26
void ResetEnergyFast()
Definition ecalCell.h:109
Float_t GetEnergy(Float_t x, Float_t y) const
Definition ecalModule.h:29
ecalCell * FindCell(Float_t x, Float_t y) const
void AddEnergy(Float_t x, Float_t y, Float_t energy)
void ResetModule()
Definition ecalModule.h:57
Float_t GetDX() const
Definition ecalModule.h:37
ecalCell * Locate(Int_t x, Int_t y) const
std::vector< ecalCell * > fCells
Definition ecalModule.h:52
ecalCell * At(Int_t x, Int_t y) const
Definition ecalModule.h:26
std::list< ecalCell * > GetCellsY(Float_t y) const
Float_t fDx
Definition ecalModule.h:48
std::list< ecalCell * > GetCellsX(Float_t x) const
ClassDef(ecalModule, 1)
Float_t GetDY() const
Definition ecalModule.h:38
std::vector< ecalCell * > GetCells() const
Definition ecalModule.h:39
Float_t fDy
Definition ecalModule.h:50