ATLAS Offline Software
Loading...
Searching...
No Matches
eflowLookupExp.cxx
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration
3*/
4
5/*
6 * eflowLookupExp.cxx
7 *
8 * Created on: 20.08.2013
9 * Author: tlodd
10 */
11
15
16
17const eflowLookupExp* eflowLookupExp::getInstance(int nExpBins /*= 50*/,
18 int nExpSubBins /*= 1000*/)
19{
21 if (!cached) {
22 cached.set (std::make_unique<eflowLookupExp>(nExpBins, nExpSubBins));
23 }
24
25 if ( (cached->m_nExpBins != nExpBins) || (cached->m_nExpSubBins != nExpSubBins) )
26 {
27 throw std::runtime_error("eflowLookupExp: Instance with different bin numbers than existing requested!");
28 }
29 return cached.get();
30}
Cached unique_ptr with atomic update.
Define macros for attributes used to control the static checker.
#define ATLAS_THREAD_SAFE
static const eflowLookupExp * getInstance(int nExpBins=50, int nExpSubBins=1000)
eflowLookupExp(int nExpBins, int nExpSubBins)
CachedUniquePtrT< const T > CachedUniquePtr