ATLAS Offline Software
Loading...
Searching...
No Matches
RootUtils.cxx
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2026 CERN for the benefit of the ATLAS collaboration
3*/
4
6
7//
8// includes
9//
10
12
13#include <TDirectory.h>
14#include <TEfficiency.h>
15#include <TH1.h>
16#include <TTree.h>
18
19//
20// method implementations
21//
22
23namespace RCU
24{
25 bool SetDirectory (TObject *object, TDirectory *directory)
26 {
27 RCU_ASSERT (object != 0);
28
29 TH1 *const hist = dynamic_cast<TH1*>(object);
30 if (hist)
31 {
32 hist->SetDirectory (directory);
33 return true;
34 }
35
36 TEfficiency *const efficiency = dynamic_cast<TEfficiency*>(object);
37 if (efficiency)
38 {
39 efficiency->SetDirectory (directory);
40 return true;
41 }
42
43 TTree *const tree = dynamic_cast<TTree*>(object);
44 if (tree)
45 {
46 tree->SetDirectory (directory);
47 return true;
48 }
49
50 return false;
51 }
52}
#define RCU_ASSERT(x)
Definition Assert.h:217
void efficiency(std::vector< double > &bins, std::vector< double > &values, const std::vector< std::string > &files, const std::string &histname, const std::string &tplotname, const std::string &label="")
This module defines a variety of assert style macros.
Definition Assert.cxx:23
bool SetDirectory(TObject *object, TDirectory *directory)
effects: set the directory this object is associated with returns: whether the object type actively k...
Definition RootUtils.cxx:25
TChain * tree