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 346 of file Counter.h. 346 {
347 _dbn._deserializeContent(data);
348 }
◆ 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 338 of file Counter.h. 338 {
339 return _dbn._lengthContent();
340 }
◆ mkEstimate()
Definition at line 302 of file Counter.h. 302 {
303 Estimate0D rtn;
306 }
308
309 rtn.setVal(val());
311 rtn.setErr(err(), source);
312 }
313 return rtn;
314 }
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::AnalysisObject::setAnnotation(), YODA::Estimate::setErr(), YODA::Estimate::setVal(), 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 328 of file Counter.h. 329 {
331 }
Estimate0D mkEstimate(const std::string &path="", const std::string &source="") const Definition Counter.h:302 References mkEstimate(), YODA::Estimate0D::newclone(), and YODA::AnalysisObject::path(). ◆ mkScatter()
Definition at line 316 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(), set(), and YODA::WriterYODA1::writeCounter(). ◆ operator*=()
Scale by a double (syntactic sugar for Definition at line 284 of file Counter.h. 284 {
286 scaleW(s);
287 return *this;
288 }
void rmAnnotation(const std::string &name) Delete an annotation by name. Definition AnalysisObject.h:198 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 269 of file Counter.h. 269 {
271 *this += 1;
272 return *this;
273 }
References YODA::AnalysisObject::hasAnnotation(), and YODA::AnalysisObject::rmAnnotation(). ◆ operator+=() [1/2]Add another counter to this. Definition at line 242 of file Counter.h. 242 {
244 _dbn += toAdd._dbn;
245 return *this;
246 }
References YODA::AnalysisObject::hasAnnotation(), and YODA::AnalysisObject::rmAnnotation(). ◆ operator+=() [2/2]Definition at line 248 of file Counter.h. 248 {
250 _dbn += std::move(toAdd._dbn);
251 return *this;
252 }
References YODA::AnalysisObject::hasAnnotation(), and YODA::AnalysisObject::rmAnnotation(). ◆ operator--()
Increment as if by a fill of weight = -1
Definition at line 277 of file Counter.h. 277 {
279 *this -= 1;
280 return *this;
281 }
References YODA::AnalysisObject::hasAnnotation(), and YODA::AnalysisObject::rmAnnotation(). ◆ operator-=() [1/2]Subtract another counter from this. Definition at line 255 of file Counter.h. 255 {
257 _dbn -= toSubtract._dbn;
258 return *this;
259 }
References YODA::AnalysisObject::hasAnnotation(), and YODA::AnalysisObject::rmAnnotation(). ◆ operator-=() [2/2]Definition at line 261 of file Counter.h. 261 {
263 _dbn -= std::move(toSubtract._dbn);
264 return *this;
265 }
References YODA::AnalysisObject::hasAnnotation(), and YODA::AnalysisObject::rmAnnotation(). ◆ operator/=()
Inverse-scale by a double (syntactic sugar for Definition at line 291 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:166 References YODA::AnalysisObject::setAnnotation(). Referenced by operator*=(), and operator/=(). ◆ serializeContent()
Content serialisation for MPI reduce operations. Implements YODA::AnalysisObject. Definition at line 342 of file Counter.h. 342 {
343 return _dbn._serializeContent();
344 }
◆ set()
Set the internal distribution object: CAREFUL! Definition at line 225 of file Counter.h. References numEntries(), sumW(), and sumW2(). ◆ 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(), set(), 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(), set(), 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 Mon Oct 28 2024 13:47:24 for YODA - Yet more Objects for Data Analysis by 1.9.8 |