YODA::Counter Class Reference A weighted counter. More...
Inheritance diagram for YODA::Counter:
Detailed DescriptionMember Typedef Documentation◆ FillType
◆ Ptr
Constructor & Destructor Documentation◆ Counter() [1/6]
Default constructor. Definition at line 38 of file Counter.h. ◆ Counter() [2/6]
Constructor accepting an explicit Dbn0D. Intended both for internal persistency and user use. Definition at line 45 of file Counter.h. ◆ Counter() [3/6]
◆ Counter() [4/6]
◆ Counter() [5/6]
◆ Counter() [6/6]
Member Function Documentation◆ clone()
Make a copy on the stack. Definition at line 97 of file Counter.h. 97 {
99 }
Counter(const std::string &path="", const std::string &title="") Default constructor. Definition Counter.h:38 ◆ dbn()
◆ deserializeContent()
Content deserialisation for MPI reduce operations. Implements YODA::AnalysisObject. Definition at line 340 of file Counter.h. 340 {
341 _dbn._deserializeContent(data);
342 }
◆ dim()
Total dimension of this data object. Implements YODA::AnalysisObject. Definition at line 135 of file Counter.h. 135{ return 1; }
◆ effNumEntries()
Get the effective number of fills. Implements YODA::Fillable. Definition at line 180 of file Counter.h. 180{ return _dbn.effNumEntries(); }
◆ err()
Get the uncertainty on the value
Definition at line 193 of file Counter.h. References sumW2(). Referenced by mkEstimate(), YODA::mkScatter(), mkScatter(), and relErr(). ◆ fill() [1/2]
◆ fill() [2/2]
Definition at line 152 of file Counter.h. 152 {
154 }
virtual int fill(double weight=1.0, double fraction=1.0) Fill histo by value and weight. Definition Counter.h:147 References fill(). ◆ fillDim()
Fill dimension of this data object. Implements YODA::Fillable. Definition at line 138 of file Counter.h. 138{ return 0; }
◆ lengthContent()
Length of serialized content vector for MPI reduce operations. Implements YODA::AnalysisObject. Definition at line 332 of file Counter.h. 332 {
333 return _dbn._lengthContent();
334 }
◆ mkEstimate()
Definition at line 297 of file Counter.h. 297 {
298 Estimate0D rtn;
301 }
303
306 }
307 return rtn;
308 }
std::vector< std::string > annotations() const Definition AnalysisObject.h:107 const std::string & annotation(const std::string &name) const Get an annotation by name (as a string) Definition AnalysisObject.h:122 References YODA::AnalysisObject::annotation(), YODA::AnalysisObject::annotations(), err(), numEntries(), YODA::AnalysisObject::path(), YODA::Estimate::set(), YODA::AnalysisObject::setAnnotation(), and val(). Referenced by mkInert(). ◆ mkInert()
Return an inert version of the analysis object (e.g. scatter, estimate) Reimplemented from YODA::AnalysisObject. Definition at line 322 of file Counter.h. 323 {
325 }
Estimate0D mkEstimate(const std::string &path="", const std::string &source="") const Definition Counter.h:297 References mkEstimate(), YODA::Estimate0D::newclone(), and YODA::AnalysisObject::path(). ◆ mkScatter()
Definition at line 310 of file Counter.h. References YODA::ScatterND< N >::addPoint(), YODA::AnalysisObject::annotation(), YODA::AnalysisObject::annotations(), err(), YODA::AnalysisObject::path(), YODA::AnalysisObject::setAnnotation(), and val(). ◆ newclone()
Make a copy on the heap, via 'new'. Implements YODA::AnalysisObject. ◆ numEntries()
Get the number of fills. Implements YODA::Fillable. Definition at line 177 of file Counter.h. 177{ return _dbn.numEntries(); }
Referenced by YODA::efficiency(), mkEstimate(), and YODA::WriterYODA1::writeCounter(). ◆ operator*=()
Scale by a double (syntactic sugar for Definition at line 279 of file Counter.h. 279 {
281 scaleW(s);
282 return *this;
283 }
void rmAnnotation(const std::string &name) Delete an annotation by name. Definition AnalysisObject.h:201 bool hasAnnotation(const std::string &name) const Check if an annotation is defined. Definition AnalysisObject.h:116 void scaleW(double scalefactor) Rescale as if all fill weights had been different by factor scalefactor. Definition Counter.h:165 References YODA::AnalysisObject::hasAnnotation(), YODA::AnalysisObject::rmAnnotation(), and scaleW(). ◆ operator++()
Increment as if by a fill of weight = 1
Definition at line 264 of file Counter.h. 264 {
266 *this += 1;
267 return *this;
268 }
References YODA::AnalysisObject::hasAnnotation(), and YODA::AnalysisObject::rmAnnotation(). ◆ operator+=() [1/2]Add another counter to this. Definition at line 237 of file Counter.h. 237 {
239 _dbn += toAdd._dbn;
240 return *this;
241 }
References YODA::AnalysisObject::hasAnnotation(), and YODA::AnalysisObject::rmAnnotation(). ◆ operator+=() [2/2]Definition at line 243 of file Counter.h. 243 {
245 _dbn += std::move(toAdd._dbn);
246 return *this;
247 }
References YODA::AnalysisObject::hasAnnotation(), and YODA::AnalysisObject::rmAnnotation(). ◆ operator--()
Increment as if by a fill of weight = -1
Definition at line 272 of file Counter.h. 272 {
274 *this -= 1;
275 return *this;
276 }
References YODA::AnalysisObject::hasAnnotation(), and YODA::AnalysisObject::rmAnnotation(). ◆ operator-=() [1/2]Subtract another counter from this. Definition at line 250 of file Counter.h. 250 {
252 _dbn -= toSubtract._dbn;
253 return *this;
254 }
References YODA::AnalysisObject::hasAnnotation(), and YODA::AnalysisObject::rmAnnotation(). ◆ operator-=() [2/2]Definition at line 256 of file Counter.h. 256 {
258 _dbn -= std::move(toSubtract._dbn);
259 return *this;
260 }
References YODA::AnalysisObject::hasAnnotation(), and YODA::AnalysisObject::rmAnnotation(). ◆ operator/=()
Inverse-scale by a double (syntactic sugar for Definition at line 286 of file Counter.h. References YODA::AnalysisObject::hasAnnotation(), YODA::AnalysisObject::rmAnnotation(), and scaleW(). ◆ operator=() [1/2]Assignment operator. Definition at line 79 of file Counter.h. 79 {
80 if (this != &c) {
81 AnalysisObject::operator = (c);
82 _dbn = c._dbn;
83 }
84 return *this;
85 }
virtual AnalysisObject & operator=(const AnalysisObject &ao) noexcept Default copy assignment operator. Definition AnalysisObject.h:61 References YODA::AnalysisObject::operator=(). ◆ operator=() [2/2]Move operator. Definition at line 88 of file Counter.h. 88 {
89 if (this != &c) {
90 AnalysisObject::operator = (c);
91 _dbn = std::move(c._dbn);
92 }
93 return *this;
94 }
References YODA::AnalysisObject::operator=(). ◆ relErr()
◆ reset()
Reset the histogram. Keep the binning but set all bin contents and related quantities to zero Implements YODA::AnalysisObject. Definition at line 159 of file Counter.h. 159 {
160 _dbn.reset();
161 }
◆ scaleW()
Rescale as if all fill weights had been different by factor scalefactor. Implements YODA::Fillable. Definition at line 165 of file Counter.h. 165 {
167 _dbn.scaleW(scalefactor);
168 }
void setAnnotation(const std::string &name, const T &value) Add or set an annotation by name (templated for remaining types) Definition AnalysisObject.h:169 References YODA::AnalysisObject::setAnnotation(). Referenced by operator*=(), and operator/=(). ◆ serializeContent()
Content serialisation for MPI reduce operations. Implements YODA::AnalysisObject. Definition at line 336 of file Counter.h. 336 {
337 return _dbn._serializeContent();
338 }
◆ setDbn() [1/2]
◆ setDbn() [2/2]
◆ sumW()
Get the sum of weights. Implements YODA::Fillable. Definition at line 183 of file Counter.h. 183{ return _dbn.sumW(); }
Referenced by YODA::efficiency(), relErr(), val(), and YODA::WriterYODA1::writeCounter(). ◆ sumW2()
Get the sum of squared weights. Implements YODA::Fillable. Definition at line 186 of file Counter.h. 186{ return _dbn.sumW2(); }
Referenced by YODA::efficiency(), err(), relErr(), and YODA::WriterYODA1::writeCounter(). ◆ val()
Get the value. Definition at line 189 of file Counter.h. References sumW(). Referenced by YODA::divide(), mkEstimate(), YODA::mkScatter(), and mkScatter(). The documentation for this class was generated from the following file:
Generated on Thu Feb 29 2024 12:47:15 for YODA - Yet more Objects for Data Analysis by 1.9.8 |