ATLAS Offline Software
Loading...
Searching...
No Matches
Interface.h
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration
3*/
4
9
10#ifndef LArSamples_Interface_H
11#define LArSamples_Interface_H
12
14#include "LArCafJobs/CaloId.h"
15#include "LArCafJobs/CellInfo.h"
22#include "TString.h"
23#include <vector>
24
25class IdentifierHash;
26class TH1I;
27class TFile;
28
29namespace LArSamples {
30
31 class Data;
32 class FilterParams;
33 class DataTweaker;
35
37
38 public:
39
43
44 static Interface* open(const TString& fileName);
45 static Interface* open(const std::vector<TString>& fileNames);
46 static Interface* openList(const TString& fileList);
47 static Interface* openWild(const TString& wcName);
48
49 virtual ~Interface();
50
51 unsigned int nEvents() const { return accessor().nEvents(); }
52 unsigned int nRuns() const { return accessor().nRuns(); }
53
54 const EventData* eventData(unsigned int i) const { return accessor().eventData(i); }
55 const RunData* runData(unsigned int i) const { return accessor().runData(i); }
56
57 unsigned int historySize(unsigned int i) const { return accessor().historySize(i); }
58 unsigned int historySizeSC(unsigned int i) const { return accessor().historySizeSC(i); }
59
60 HistoryIterator begin(unsigned int pos = 0, double eMin = -1, double adcMaxMin = -1) const;
61 unsigned int end() const { return nChannels(); }
62
63 unsigned int size() const;
64 unsigned int nFilledChannels() const;
65 void printFilledRanges(unsigned int skip = 0) const;
66
67 bool highEData(double eCut, TArrayI& hashes, TArrayI& indices) const;
68
69 HistoryIterator findEtaPhi(CaloId calo, short layer, short iEta, short iPhi, short region = 0) const;
70 HistoryIterator findFebChannel(CaloId calo, short feb, short channel) const;
71 HistoryIterator findFTSlotChannel(CaloId calo, short ft, short slot, short channel) const;
72
73 bool neighbors(const CellInfo& cell, double dRCut, std::vector<unsigned int>& hashes) const;
74 bool firstNeighbors(unsigned int hash, std::vector<unsigned int>& hashes, short layer = -2) const;
75 bool data(const std::vector<unsigned int>& hashes,const EventData& event, std::vector<const Data*>& data) const;
76
77 Interface* merge(const Interface& other, const TString& fileName) const;
78 Interface* merge(const Interface& other, const TString& fileName, const TString& LBFile) const;
79#ifndef __GCCXML__
80 static Interface* merge(const std::vector<const Interface*>& interfaces, const TString& fileName);
81 static Interface* merge(const std::vector<const Interface*>& interfaces, const TString& fileName, const TString& LBFile);
82#endif
83 static Interface* merge(const TString& listFileName, const TString& fileName);
84 static Interface* merge(const TString& listFileName, const TString& fileName, const TString& LBFile);
85 static bool filterAndMerge(const TString& listFileName, const TString& outFile, const TString& filters, const TString& tweaks = "");
86
87 Interface* filter(const TString& sel, const TString& fileName, const TString& tweaks = "") const;
88 Interface* filter(const FilterParams& filterParams, const DataTweaker& tweaker, const TString& fileName) const;
89
90 Interface* makeTemplate(const TString& fileName) const;
91
92 Interface* refit(const TString& newFileName, Chi2Params pars = DefaultChi2) const;
93
94 const Accessor& accessor() const { return *m_accessor; }
95 bool isValid() const;
96
97 TH1D* Draw(const TString& var, int nBins, double xMin, double xMax, const TString& sel = "", const TString& opt = "") const;
98 TH2D* Draw(const TString& varList, int nBinsX, double xMin, double xMax, int nBinsY, double yMin, double yMax,
99 const TString& sel = "", const TString& opt = "") const;
100 TH2D* DrawPartition(PartitionId partition, const TString& var, const TString& sel = "", const TString& opt = "",
101 CombinationType comb = TotalValue) const;
102 TH2D* DrawEtaPhi(CaloId calo, short layer, const TString& var, const TString& sel = "", const TString& opt = "",
103 CombinationType comb = TotalValue) const;
104 bool Scan(const TString& vars, const TString& sel = "", unsigned int verbosity = 1) const;
105 bool Scan(const TString& vars, CombinationType comb, const TString& sel = "", const TString& ranges = "", unsigned int verbosity = 1) const;
106
107 bool Show(unsigned int hash, unsigned int verbosity = 1) const;
108 bool Show(const TString& sel = "", unsigned int verbosity = 1) const;
109 bool ShowEvents(const TString& sel = "", unsigned int verbosity = 1) const;
110 bool ShowRuns(unsigned int verbosity = 1) const;
111
112 bool ShowStats(const TString& varList, const TString& sel = "", bool withErrors = false) const;
113
115 DigitMonitor digitMonitor() const { return DigitMonitor(*this); }
116 FitMonitor fitMonitor() const { return FitMonitor(*this); }
117
118 bool dumpEventTuple(const TString& variables, const TString& fileName) const;
119
120 void setShapeErrorGetter(const AbsShapeErrorGetter* err);
121 void setShapeError(double k);
122 void setShapeError(const TString& fileName);
124
125 bool writeToFile(const TString& fileName) const { return accessor().writeToFile(fileName); }
126
127 static TString addSuffix(const TString& fileName, const TString& suffix);
128
129 const History* cellHistory(unsigned int i) const;
130 const History* getCellHistory(unsigned int i) const;
131 const History* getSCHistory(unsigned int i) const;
132 const CellInfo* getCellInfo(unsigned int i) const;
133
134 private:
135
139
140 mutable std::vector<std::vector<unsigned int>*> m_neighborCache;
141 mutable std::vector<unsigned int> m_neighborHistoryPos;
142 mutable std::vector<const History*> m_neighborHistories;
143 };
144}
145
146#endif
bool isValid(const T &p)
Av: we implement here an ATLAS-sepcific convention: all particles which are 99xxxxx are fine.
Definition AtlasPID.h:878
char data[hepevt_bytes_allocation_ATLAS]
Definition HepEvt.cxx:11
#define ATLAS_NOT_THREAD_SAFE
getNoisyStrip() Find noisy strips from hitmaps and write out into xml/db formats
This is a "hash" representation of an Identifier.
virtual unsigned int nChannels() const
Definition AbsLArCells.h:34
storage of the time histories of all the cells
storage of the time histories of all the cells
Definition FitMonitor.h:19
storage of the time histories of all the cells
OccupancyMonitor occupancyMonitor() const
Definition Interface.h:114
const Accessor & accessor() const
Definition Interface.h:94
const AbsShapeErrorGetter * m_shapeErrorGetter
Definition Interface.h:137
const AbsShapeErrorGetter * shapeErrorGetter() const
Definition Interface.h:123
bool writeToFile(const TString &fileName) const
Definition Interface.h:125
FitMonitor fitMonitor() const
Definition Interface.h:116
unsigned int nRuns() const
Definition Interface.h:52
Interface(const Accessor &accessor)
Constructor.
Definition Interface.h:41
std::vector< unsigned int > m_neighborHistoryPos
Definition Interface.h:141
std::vector< std::vector< unsigned int > * > m_neighborCache
Definition Interface.h:140
unsigned int historySizeSC(unsigned int i) const
Definition Interface.h:58
DigitMonitor digitMonitor() const
Definition Interface.h:115
const Accessor * m_accessor
Definition Interface.h:136
const EventData * eventData(unsigned int i) const
Definition Interface.h:54
unsigned int end() const
Definition Interface.h:61
std::vector< const History * > m_neighborHistories
Definition Interface.h:142
unsigned int nEvents() const
Definition Interface.h:51
unsigned int historySize(unsigned int i) const
Definition Interface.h:57
const RunData * runData(unsigned int i) const
Definition Interface.h:55
storage of the time histories of all the cells
@ DefaultChi2
Definition Chi2Calc.h:24
Definition merge.py:1