Logo ROOT  
Reference Guide
 
Loading...
Searching...
No Matches
SharedOffset.h
Go to the documentation of this file.
1/*
2 * Project: RooFit
3 * Authors:
4 * PB, Patrick Bos, Netherlands eScience Center, p.bos@esciencecenter.nl
5 *
6 * Copyright (c) 2024, CERN
7 *
8 * Redistribution and use in source and binary forms,
9 * with or without modification, are permitted according to the terms
10 * listed in LICENSE (http://roofit.sourceforge.net/license.txt)
11 */
12
13#ifndef ROOT_ROOFIT_TESTSTATISTICS_SHAREDOFFSET_H
14#define ROOT_ROOFIT_TESTSTATISTICS_SHAREDOFFSET_H
15
16#include <Math/Util.h>
17#include <vector>
18#include <memory> // shared_ptr
19
21public:
23 using OffsetVec = std::vector<ROOT::Math::KahanSum<double>>;
24
25 void clear();
26 void swap(const std::vector<std::size_t> &component_keys);
27
28 inline OffsetVec &offsets() { return *offsets_; };
29 inline OffsetVec &offsets_save() { return *offsets_save_; };
30
31private:
32 std::shared_ptr<OffsetVec> offsets_;
33 std::shared_ptr<OffsetVec> offsets_save_;
34};
35
36#endif // ROOT_ROOFIT_TESTSTATISTICS_SHAREDOFFSET_H
void swap(const std::vector< std::size_t > &component_keys)
When calculating an unbinned likelihood with square weights applied, a different offset is necessary.
std::vector< ROOT::Math::KahanSum< double > > OffsetVec
std::shared_ptr< OffsetVec > offsets_save_
OffsetVec & offsets_save()
OffsetVec & offsets()
std::shared_ptr< OffsetVec > offsets_