ROOT
git-r3/HEAD
Reference Guide
Loading...
Searching...
No Matches
SharedOffset.cxx
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
#include "
RooFit/TestStatistics/SharedOffset.h
"
14
15
SharedOffset::SharedOffset
() :
offsets_
(std::make_shared<
OffsetVec
>()),
offsets_save_
(std::make_shared<
OffsetVec
>()) {}
16
17
void
SharedOffset::clear
()
18
{
19
offsets_
->clear();
20
offsets_save_
->clear();
21
}
22
23
/// When calculating an unbinned likelihood with square weights applied, a different offset
24
/// is necessary. Similar situations may ask for a separate offset as well. This function
25
/// switches between the two sets of offset values for the given component keys.
26
/// \note Currently we do not recalculate the offset value, so in practice swapped offsets
27
/// are zero.
28
void
SharedOffset::swap
(
const
std::vector<std::size_t> &component_keys)
29
{
30
for
(
auto
key : component_keys) {
31
std::swap((*
offsets_
)[key], (*
offsets_save_
)[key]);
32
}
33
}
SharedOffset.h
SharedOffset::SharedOffset
SharedOffset()
Definition
SharedOffset.cxx:15
SharedOffset::swap
void swap(const std::vector< std::size_t > &component_keys)
When calculating an unbinned likelihood with square weights applied, a different offset is necessary.
Definition
SharedOffset.cxx:28
SharedOffset::OffsetVec
std::vector< ROOT::Math::KahanSum< double > > OffsetVec
Definition
SharedOffset.h:23
SharedOffset::clear
void clear()
Definition
SharedOffset.cxx:17
SharedOffset::offsets_save_
std::shared_ptr< OffsetVec > offsets_save_
Definition
SharedOffset.h:33
SharedOffset::offsets_
std::shared_ptr< OffsetVec > offsets_
Definition
SharedOffset.h:32
roofit
roofitcore
src
TestStatistics
SharedOffset.cxx
ROOTgit-r3/HEAD - Reference Guide Generated on
(GVA Time) using Doxygen 1.16.1