YODA::FillableStorage< FillDim, BinContentT, AxisT > Class Template Reference FillableStorage, introduces FillAdapterT on top of BinnedStorage base class. More...
Inheritance diagram for YODA::FillableStorage< FillDim, BinContentT, AxisT >:
Detailed Descriptiontemplate<size_t FillDim, typename BinContentT, typename... AxisT> class YODA::FillableStorage< FillDim, BinContentT, AxisT > FillableStorage, introduces FillAdapterT on top of BinnedStorage base class.
Definition at line 86 of file FillableStorage.h. Member Typedef Documentation◆ AdapterWrapperT
template<size_t FillDim, typename BinContentT , typename... AxisT>
Definition at line 97 of file FillableStorage.h. ◆ BaseT
template<size_t FillDim, typename BinContentT , typename... AxisT>
Convenience alias to be used in constructor. Definition at line 94 of file FillableStorage.h. ◆ BinningT
template<size_t FillDim, typename BinContentT , typename... AxisT>
Definition at line 95 of file FillableStorage.h. ◆ BinT
template<size_t FillDim, typename BinContentT , typename... AxisT>
Definition at line 96 of file FillableStorage.h. ◆ FillableT
template<size_t FillDim, typename BinContentT , typename... AxisT>
Definition at line 98 of file FillableStorage.h. ◆ FillAdapterT
template<size_t FillDim, typename BinContentT , typename... AxisT>
Adapter type (type of lambda used to access stored object). BinT is a stored object type; FillCoordsT is a coordinates init list (or tuple) type; Doubles are for weight and fraction correspondingly. Definition at line 115 of file FillableStorage.h. ◆ FillCoordsT
template<size_t FillDim, typename BinContentT , typename... AxisT>
Definition at line 99 of file FillableStorage.h. ◆ FillDimension
template<size_t FillDim, typename BinContentT , typename... AxisT>
Fill dimension. Definition at line 108 of file FillableStorage.h. ◆ FillType
template<size_t FillDim, typename BinContentT , typename... AxisT>
Type of the fill coordinates. Definition at line 105 of file FillableStorage.h. Constructor & Destructor Documentation◆ FillableStorage() [1/9]
template<size_t FillDim, typename BinContentT , typename... AxisT>
Nullary constructor for unique pointers etc. Definition at line 121 of file FillableStorage.h. 122 : BaseT(), _fillAdapter(adapter), _nancount(0), _nansumw(0.), _nansumw2(0.) { }
BinnedStorage< BinContentT, AxisT... > BaseT Convenience alias to be used in constructor. Definition FillableStorage.h:94 ◆ FillableStorage() [2/9]
template<size_t FillDim, typename BinContentT , typename... AxisT>
Constructs FillableStorage from Binning. Definition at line 125 of file FillableStorage.h. const BinningT & binning() const noexcept Returns dimension underlying binning object reference. Definition BinnedStorage.h:321 ◆ FillableStorage() [3/9]
template<size_t FillDim, typename BinContentT , typename... AxisT>
Constructs FillableStorage from Binning. Rvalue. Definition at line 129 of file FillableStorage.h. ◆ FillableStorage() [4/9]
template<size_t FillDim, typename BinContentT , typename... AxisT>
Constructs binning from an adapter and vectors of axes' edges. Definition at line 133 of file FillableStorage.h. 134 : BaseT(edges...), _fillAdapter(adapter), _nancount(0), _nansumw(0.), _nansumw2(0.) { }
◆ FillableStorage() [5/9]
template<size_t FillDim, typename BinContentT , typename... AxisT>
Constructs binning from an adapter and Rvalue vectors of axes' edges. Definition at line 137 of file FillableStorage.h. 138 : BaseT(std::move(edges)...), _fillAdapter(adapter), _nancount(0), _nansumw(0.), _nansumw2(0.) { }
◆ FillableStorage() [6/9]
template<size_t FillDim, typename BinContentT , typename... AxisT>
Constructs binning from an adapter and a sequence of axes. Definition at line 141 of file FillableStorage.h. 142 : BaseT(axes...), _fillAdapter(adapter), _nancount(0), _nansumw(0.), _nansumw2(0.) { }
◆ FillableStorage() [7/9]
template<size_t FillDim, typename BinContentT , typename... AxisT>
Constructs binning from an adapter and a sequence of Rvalue axes. Definition at line 145 of file FillableStorage.h. 146 : BaseT(std::move(axes)...), _fillAdapter(adapter), _nancount(0), _nansumw(0.), _nansumw2(0.) { }
◆ FillableStorage() [8/9]
template<size_t FillDim, typename BinContentT , typename... AxisT>
Copy constructor. Definition at line 149 of file FillableStorage.h. 150 : BaseT(other), _fillAdapter(other._fillAdapter),
151 _nancount(other._nancount), _nansumw(other._nansumw), _nansumw2(other._nansumw2) { }
◆ FillableStorage() [9/9]
template<size_t FillDim, typename BinContentT , typename... AxisT>
Move constructor. Definition at line 154 of file FillableStorage.h. 155 : BaseT(std::move(other)), _fillAdapter(std::move(other._fillAdapter)),
156 _nancount(std::move(other._nancount)), _nansumw(std::move(other._nansumw)),
157 _nansumw2(std::move(other._nansumw2)) { }
Member Function Documentation◆ fill() [1/2]
template<size_t FillDim, typename BinContentT , typename... AxisT>
Triggers fill adapter on the bin corresponding to coords. Definition at line 188 of file FillableStorage.h. 188 {
190 }
int fill(FillCoordsT &&coords, std::index_sequence< Is... >, const double weight=1.0, const double fraction=1.0) noexcept Triggers fill adapter on the bin corresponding to coords. Definition FillableStorage.h:169 References YODA::FillableStorage< FillDim, BinContentT, AxisT >::fill(). ◆ fill() [2/2]
template<size_t FillDim, typename BinContentT , typename... AxisT>
template<size_t... Is>
Triggers fill adapter on the bin corresponding to coords.
Definition at line 169 of file FillableStorage.h. 170 {
171
172 // make sure the user isn't trying to fill with NaN ...
173 // include all fill coordinates here
175 _nancount += 1;
176 _nansumw += weight*fraction;
177 _nansumw2 += sqr(weight*fraction);
178 return -1;
179 }
180 // select binned coordinates (possibly a subset of fill coordinates)
181 auto binCoords = std::tuple<AxisT...>(std::get<Is>(coords)...);
182 const size_t binIdx = FillableT::_binning.globalIndexAt(binCoords);
183 _fillAdapter(BaseT::bin(binIdx), std::move(coords), weight, fraction);
184 return int(binIdx);
185 }
bool containsNan(const std::tuple< Args... > &coords) Checks if a coordinate tuple has a nan. Definition Binning.h:30 References YODA::BinnedStorage< BinContentT, AxisT... >::bin(), YODA::containsNan(), and YODA::sqr(). Referenced by YODA::FillableStorage< FillDim, BinContentT, AxisT >::fill(). ◆ fillDim()
template<size_t FillDim, typename BinContentT , typename... AxisT>
Returns the dimension of the filling tuple. Definition at line 197 of file FillableStorage.h. 197{ return FillDim; }
◆ nanCount()
template<size_t FillDim, typename BinContentT , typename... AxisT>
Definition at line 199 of file FillableStorage.h. 199{ return _nancount; }
◆ nanSumW()
template<size_t FillDim, typename BinContentT , typename... AxisT>
Definition at line 201 of file FillableStorage.h. 201{ return _nansumw; }
◆ nanSumW2()
template<size_t FillDim, typename BinContentT , typename... AxisT>
Definition at line 203 of file FillableStorage.h. 203{ return _nansumw2; }
◆ operator+=()
template<size_t FillDim, typename BinContentT , typename... AxisT>
Add another BinnedStorage to this one. Definition at line 250 of file FillableStorage.h. 250 {
251 if (*this != other)
252 throw std::logic_error("YODA::BinnedStorage<" + std::to_string(sizeof...(AxisT)) +\
253 ">: Cannot add BinnedStorages with different binnings.");
254 size_t i = 0;
256 bin += other.bin(i++);
257 }
258
259 return *this;
260 }
BinsVecWrapper< BinsVecT > bins(const bool includeOverflows=false, const bool includeMaskedBins=false) noexcept Returns bins vector wrapper, which skips masked elements when iterated over. Definition BinnedStorage.h:298 FillableStorage< FillDim, BinContentT, AxisT... > FillableT Definition FillableStorage.h:98 References YODA::BinnedStorage< BinContentT, AxisT >::bin(), YODA::BinnedStorage< BinContentT, AxisT... >::bin(), and YODA::BinnedStorage< BinContentT, AxisT... >::bins(). ◆ operator-=()
template<size_t FillDim, typename BinContentT , typename... AxisT>
Subtract another BinnedStorage from this one. Definition at line 263 of file FillableStorage.h. 263 {
264 if (*this != other)
265 throw std::logic_error("YODA::FillableStorage<" + std::to_string(sizeof...(AxisT)) +\
266 ">: Cannot substract FillableStorages with different binnings.");
267
268 size_t i = 0;
270 bin -= other.bin(i++);
271 }
272
273 return *this;
274 }
References YODA::BinnedStorage< BinContentT, AxisT >::bin(), YODA::BinnedStorage< BinContentT, AxisT... >::bin(), and YODA::BinnedStorage< BinContentT, AxisT... >::bins(). ◆ operator=() [1/2]
template<size_t FillDim, typename BinContentT , typename... AxisT>
Copy assignment. Definition at line 226 of file FillableStorage.h. 226 {
227 if (this != &other) {
228 _fillAdapter = other._fillAdapter;
229 _nancount = other._nancount;
230 _nansumw = other._nansumw;
231 _nansumw2 = other._nansumw2;
232 BaseT::operator=(other);
233 }
234 return *this;
235 }
BinnedStorage & operator=(const BinnedStorage &other) noexcept Copy assignment. Definition BinnedStorage.h:481 References YODA::BinnedStorage< BinContentT, AxisT... >::operator=(). ◆ operator=() [2/2]
template<size_t FillDim, typename BinContentT , typename... AxisT>
Move assignment. Definition at line 238 of file FillableStorage.h. 238 {
239 if (this != &other) {
240 _fillAdapter = std::move(other._fillAdapter);
241 _nancount = std::move(other._nancount);
242 _nansumw = std::move(other._nansumw);
243 _nansumw2 = std::move(other._nansumw2);
244 BaseT::operator=(std::move(other));
245 }
246 return *this;
247 }
References YODA::BinnedStorage< BinContentT, AxisT... >::operator=(). ◆ reset()
template<size_t FillDim, typename BinContentT , typename... AxisT>
Reset the Fillable. Keep the binning but set all bin contents and related quantities to zero Definition at line 214 of file FillableStorage.h. 214 {
215 _nancount = 0;
216 _nansumw = _nansumw2 = 0.;
217 BaseT::clearBins();
218 }
References YODA::BinnedStorage< BinContentT, AxisT... >::clearBins(). ◆ setNanLog()
template<size_t FillDim, typename BinContentT , typename... AxisT>
Definition at line 205 of file FillableStorage.h. 205 {
206 _nancount = count;
207 _nansumw = sumw;
208 _nansumw2 = sumw2;
209 }
The documentation for this class was generated from the following file:
Generated on Mon Oct 28 2024 13:47:24 for YODA - Yet more Objects for Data Analysis by 1.9.8 |