Go to the documentation of this file.00001 #ifndef CALOWINDOW_H_
00002 #define CALOWINDOW_H_
00003
00004
00005
00006
00007
00008 #include <vector>
00009 #include <iostream>
00010 #include <map>
00011 namespace pftools {
00012
00017 class CaloRing {
00018 public:
00019
00024 CaloRing();
00025
00031 CaloRing(unsigned nPanes);
00032
00036 void reset();
00037
00043 double getEnergy(unsigned pane) const;
00044
00051 bool setEnergy(unsigned pane, double energy);
00052
00059 bool addEnergy(unsigned pane, double energy);
00060
00065 double totalE() const;
00066
00071 std::vector<double> getEnergies() const {
00072 return myPanes_;
00073 }
00074
00079 unsigned getNPanes() const {
00080 return panes_;
00081 }
00082
00083 void printEnergies(std::ostream& s, double range = 1.0);
00084
00085
00086 private:
00087 unsigned panes_;
00088 std::vector<double> myPanes_;
00089
00090 friend std::ostream& operator<<(std::ostream& s, const CaloRing& caloRing);
00091
00092 };
00093
00094 class CaloWindow {
00095 public:
00096
00097 CaloWindow();
00098
00104 CaloWindow(double eta, double phi, unsigned nRings, double deltaR, unsigned nPanes, double axis = 0.0);
00105
00106 void init(double eta, double phi, unsigned nRings, double deltaR, unsigned nPanes, double axis = 0.0);
00107
00114 bool addHit(double eta, double phi, double energy);
00115
00122 std::map<unsigned, CaloRing> getRingDepositions() const {
00123 return energies_;
00124 }
00125
00126 std::map<unsigned, double> getRingEnergySummations() const;
00127
00128
00129 virtual ~CaloWindow();
00130
00131 void reset();
00132
00133 void printEnergies(std::ostream& s, double range = 1.0);
00134
00140 std::vector<double> stream(double normalisation = 1.0) const;
00141
00142 private:
00143
00144 double baryEta_;
00145 double baryPhi_;
00146
00147 unsigned nRings_;
00148
00149 double deltaR_;
00150
00151 unsigned nPanes_;
00152
00153
00154 double axis_;
00155
00156
00157
00158
00159
00160 std::pair<unsigned, unsigned> relativePosition(double eta, double phi) const;
00161
00162
00163 std::map<unsigned, CaloRing> energies_;
00164
00165
00166 friend std::ostream& operator<<(std::ostream& s,
00167 const CaloWindow& caloWindow);
00168
00169 };
00170
00171 class TestCaloWindow {
00172 public:
00173 TestCaloWindow() {
00174 }
00175
00176 virtual ~TestCaloWindow() {
00177 }
00178
00179 void doTest();
00180 };
00181
00182
00183
00184 }
00185 #endif