ATLAS Offline Software
TreeAccessor.h
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration
3 */
4 
10 #ifndef LArSamples_TreeAccessor_H
11 #define LArSamples_TreeAccessor_H
12 
13 #include "LArSamplesMon/Accessor.h"
15 #include "LArCafJobs/CellInfo.h"
16 #include "LArSamplesMon/History.h"
17 #include "TString.h"
18 #include "TTree.h"
19 #include "LArSamplesMon/Chi2Calc.h"
21 
22 class TFile;
23 
24 namespace LArSamples {
25 
26  class Data;
27  class FilterParams;
28  class DataTweaker;
29  class EventData;
30  class RunData;
31 
33 
34  public:
35 
37  TreeAccessor(TTree& cellTree, TTree& eventTree, TTree* runTree, TFile* file)
38  : PersistentAccessor(cellTree, eventTree, runTree, file) { }
39 
41 
42  static TreeAccessor* open(const TString& fileName);
43 
44  virtual ~TreeAccessor() { resetCache(); }
45 
46  static TreeAccessor* merge(const std::vector<const Accessor*>& accessors,const TString& fileName = "");
47  static TreeAccessor* merge(const std::vector<const Accessor*>& accessors,const TString& fileName,const TString& LBFile);
48  static TreeAccessor* filter(const Accessor& accessor,
49  const FilterParams& filterParams,
50  const TString& fileName, const DataTweaker& tweaker);
51 
52  static std::vector<TreeAccessor*> filter(const Accessor& accessor,
53  const FilterList& filterList, const DataTweaker& tweaker);
54 
55  friend class Interface;
56 
57  static TreeAccessor* makeTemplate(const Accessor& accessor, const TString& fileName);
58 
59  bool writeToFile(const TString& fileName) const;
60 
61  unsigned int historySize(unsigned int i) const { return PersistentAccessor::historySize(i); }
62 
63  unsigned int nEvents() const { return PersistentAccessor::nEvents(); }
64  const EventData* eventData(unsigned int i) const { return PersistentAccessor::eventData(i); }
65 
66  unsigned int nRuns() const { return PersistentAccessor::nRuns(); }
67  const RunData* runData(unsigned int i) const { return PersistentAccessor::runData(i); }
68 
69  void add(HistoryContainer* cont) { PersistentAccessor::add(cont); resetCache(); }
70 
71 
72  const History* getCellHistory(unsigned int i) const;
73  const CellInfo* getCellInfo(unsigned int i) const;
74 
75  };
76 }
77 
78 #endif
LArSamples::TreeAccessor::TreeAccessor
TreeAccessor(const TString &fileName)
Definition: TreeAccessor.h:40
Chi2Calc.h
LArSamples::FilterParams
Definition: FilterParams.h:50
LArSamples::TreeAccessor::historySize
unsigned int historySize(unsigned int i) const
Definition: TreeAccessor.h:61
ATLAS_NOT_THREAD_SAFE
#define ATLAS_NOT_THREAD_SAFE
getNoisyStrip() Find noisy strips from hitmaps and write out into xml/db formats
Definition: checker_macros.h:212
LArSamples::PersistentAccessor::runData
const RunData * runData(unsigned int i) const
Definition: PersistentAccessor.cxx:122
Data
@ Data
Definition: BaseObject.h:11
LArSamples::Accessor
A base class for accessing ntuple data.
Definition: LArCalorimeter/LArSamplesMon/LArSamplesMon/Accessor.h:24
LArSamples::History
Definition: History.h:40
LArSamples::PersistentAccessor
Definition: PersistentAccessor.h:24
LArSamples
Definition: AbsShape.h:24
LArSamples::PersistentAccessor::eventData
const EventData * eventData(unsigned int i) const
Definition: PersistentAccessor.cxx:113
covarianceTool.filter
filter
Definition: covarianceTool.py:514
LArSamples::PersistentAccessor::add
void add(HistoryContainer *cont)
Definition: PersistentAccessor.cxx:141
PersistentAccessor.h
LArSamples::RunData
Definition: RunData.h:21
LArSamples::TreeAccessor::~TreeAccessor
virtual ~TreeAccessor()
Definition: TreeAccessor.h:44
systematicsTool.writeToFile
def writeToFile(histDict, fOut)
Definition: systematicsTool.py:1035
FortranAlgorithmOptions.fileName
fileName
Definition: FortranAlgorithmOptions.py:13
LArSamples::PersistentAccessor::nEvents
unsigned int nEvents() const
Definition: PersistentAccessor.h:52
lumiFormat.i
int i
Definition: lumiFormat.py:85
LArSamples::PersistentAccessor::historySize
unsigned int historySize(unsigned int i) const
Definition: PersistentAccessor.cxx:106
file
TFile * file
Definition: tile_monitor.h:29
EventData
Definition: Trigger/TrigAccel/TrigCudaFitter/src/EventData.h:11
LArSamples::DataTweaker
Definition: DataTweaker.h:23
Accessor.h
LArSamples::TreeAccessor::nRuns
unsigned int nRuns() const
Definition: TreeAccessor.h:66
FilterList.h
LArSamples::TreeAccessor::eventData
const EventData * eventData(unsigned int i) const
Definition: TreeAccessor.h:64
LArSamples::FilterList
Definition: FilterList.h:21
LArSamples::PersistentAccessor::nRuns
unsigned int nRuns() const
Definition: PersistentAccessor.h:55
LArSamples::TreeAccessor::TreeAccessor
TreeAccessor(TTree &cellTree, TTree &eventTree, TTree *runTree, TFile *file)
Constructor
Definition: TreeAccessor.h:37
LArSamples::CellInfo
Definition: CellInfo.h:31
xAOD::JetAttributeAccessor::accessor
const AccessorWrapper< T > * accessor(xAOD::JetAttribute::AttributeID id)
Returns an attribute accessor corresponding to an AttributeID.
Definition: JetAccessorMap.h:26
Trk::open
@ open
Definition: BinningType.h:40
LArSamples::HistoryContainer
Definition: HistoryContainer.h:29
LArSamples::TreeAccessor::runData
const RunData * runData(unsigned int i) const
Definition: TreeAccessor.h:67
python.utility.LHE.merge
def merge(input_file_pattern, output_file)
Merge many input LHE files into a single output file.
Definition: LHE.py:29
LArSamples::Interface
Definition: Interface.h:36
xAODRootTest.accessors
dictionary accessors
Definition: xAODRootTest.py:73
History.h
LArSamples::TreeAccessor::add
void add(HistoryContainer *cont)
Definition: TreeAccessor.h:69
LArSamples::TreeAccessor
Definition: TreeAccessor.h:32
LArSamples::TreeAccessor::nEvents
unsigned int nEvents() const
Definition: TreeAccessor.h:63
LArSamples::EventData
Definition: LArCalorimeter/LArCafJobs/LArCafJobs/EventData.h:29
CellInfo.h