85 |
|
|
86 |
/*! @brief Sets up the histogram |
/*! @brief Sets up the histogram |
87 |
* |
* |
88 |
* This routine effectively prepares the histogram, after the desired parameters has been set by #SetXAxis() and #SetYAxis(). |
* This routine effectively prepares the histogram, after the desired parameters has been set by #SetXAxis(). |
89 |
* |
* |
90 |
* @param events Pointer to PamLevel2 events (unused). |
* @param events Pointer to PamLevel2 events (unused). |
91 |
*/ |
*/ |
108 |
return _histo; |
return _histo; |
109 |
} |
} |
110 |
|
|
111 |
/*! Fills the ROOT and the vector histogram. */ |
/*! Fills the ROOT and the vector histogram. |
112 |
|
* |
113 |
|
* @param value The value of the X coordinate associated to the event. |
114 |
|
* @param weight The weight which will be applied to the event. |
115 |
|
*/ |
116 |
void Fill(double value, double weight = 1.); |
void Fill(double value, double weight = 1.); |
117 |
|
|
118 |
/*! @brief The number of events which fell below the lower histogram limit. */ |
/*! @brief The number of events which fell below the lower histogram limit. */ |
127 |
|
|
128 |
protected: |
protected: |
129 |
|
|
130 |
|
/*! @brief The vector containing the limits of the bins(from lower to higher). */ |
131 |
std::vector<float> _bins; |
std::vector<float> _bins; |
132 |
|
/*! @brief A vector containing the value of the histogram for each bin. */ |
133 |
vector<HistoType> _histo; |
vector<HistoType> _histo; |
134 |
|
/*! @brief The ROOT histogram. */ |
135 |
TH1 *_rootHisto; |
TH1 *_rootHisto; |
136 |
|
|
137 |
private: |
private: |
154 |
// No ROOT histogram for generic type; see template specializations in .cpp file. |
// No ROOT histogram for generic type; see template specializations in .cpp file. |
155 |
_rootHisto = NULL; |
_rootHisto = NULL; |
156 |
} |
} |
157 |
|
// Specializations for _CreateHistos(). See Histo1DAction.cpp |
158 |
|
template<> |
159 |
|
void Histo1DAction<Int_t>::_CreateHisto(); |
160 |
|
|
161 |
|
template<> |
162 |
|
void Histo1DAction<Float_t>::_CreateHisto(); |
163 |
|
|
164 |
|
template<> |
165 |
|
void Histo1DAction<Double_t>::_CreateHisto(); |
166 |
|
|
167 |
template<class HistoType> |
template<class HistoType> |
168 |
void Histo1DAction<HistoType>::_InitHistos() { |
void Histo1DAction<HistoType>::_InitHistos() { |
169 |
|
|
170 |
_CreateHisto(); |
_CreateHisto(); |
171 |
|
if (_bins.size() < 2) // SetXAxis not called by the main program, or wrongly filled (only 1 bin limit) |
172 |
|
SetXAxis("Default X", 10, 0., 1.); |
173 |
|
|
174 |
if (_rootHisto) { |
if (_rootHisto) { |
175 |
Double_t *auxArray = new Double_t[_bins.size()]; |
Double_t *auxArray = new Double_t[_bins.size()]; |
194 |
|
|
195 |
template<class HistoType> |
template<class HistoType> |
196 |
Histo1DAction<HistoType>::~Histo1DAction() { |
Histo1DAction<HistoType>::~Histo1DAction() { |
197 |
|
|
198 |
|
delete _rootHisto; |
199 |
|
_rootHisto = NULL; |
200 |
|
|
201 |
} |
} |
202 |
|
|
203 |
template<class HistoType> |
template<class HistoType> |