ATLAS Offline Software
Loading...
Searching...
No Matches
AANTTreeMap.h
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration
3*/
4
5#ifndef ANALYSISUTILS_AANTTREEMAP_H
6#define ANALYSISUTILS_AANTTREEMAP_H
7
8#include <map>
9#include <string>
10#include <mutex>
11
12#include "TTree.h"
14
16{
17public:
18 static void setTree (const std::string &stream, TTree *tree)
19 {
20 std::scoped_lock lock (s_mutex);
21 s_treeMap[stream] = tree;
22 }
23 static TTree * getTree (const std::string &stream)
24 {
25 std::scoped_lock lock (s_mutex);
26 return s_treeMap[stream];
27 }
28
29private:
31 static std::mutex s_mutex;
32 static std::map<std::string,TTree*> s_treeMap ATLAS_THREAD_SAFE;
33};
34
35#endif
Define macros for attributes used to control the static checker.
static std::mutex s_mutex
tree map
Definition AANTTreeMap.h:31
static void setTree(const std::string &stream, TTree *tree)
Definition AANTTreeMap.h:18
static TTree * getTree(const std::string &stream)
Definition AANTTreeMap.h:23
static std::map< std::string, TTree * > s_treeMap ATLAS_THREAD_SAFE
Definition AANTTreeMap.h:32
TChain * tree