Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-18 10:10:26

0001 /*
0002  * Project: RooFit
0003  * Authors:
0004  *   PB, Patrick Bos, Netherlands eScience Center, p.bos@esciencecenter.nl
0005  *
0006  * Copyright (c) 2024, CERN
0007  *
0008  * Redistribution and use in source and binary forms,
0009  * with or without modification, are permitted according to the terms
0010  * listed in LICENSE (http://roofit.sourceforge.net/license.txt)
0011  */
0012 
0013 #ifndef ROOT_ROOFIT_TESTSTATISTICS_SHAREDOFFSET_H
0014 #define ROOT_ROOFIT_TESTSTATISTICS_SHAREDOFFSET_H
0015 
0016 #include <Math/Util.h>
0017 #include <vector>
0018 #include <memory> // shared_ptr
0019 
0020 class SharedOffset {
0021 public:
0022    SharedOffset();
0023    using OffsetVec = std::vector<ROOT::Math::KahanSum<double>>;
0024 
0025    void clear();
0026    void swap(const std::vector<std::size_t> &component_keys);
0027 
0028    inline OffsetVec &offsets() { return *offsets_; };
0029    inline OffsetVec &offsets_save() { return *offsets_save_; };
0030 
0031 private:
0032    std::shared_ptr<OffsetVec> offsets_;
0033    std::shared_ptr<OffsetVec> offsets_save_;
0034 };
0035 
0036 #endif // ROOT_ROOFIT_TESTSTATISTICS_SHAREDOFFSET_H