ATLAS Offline Software
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 
10 #ifndef LArSamples_Interface_H
11 #define LArSamples_Interface_H
12 
13 #include "LArSamplesMon/Accessor.h"
14 #include "LArCafJobs/CaloId.h"
15 #include "LArCafJobs/CellInfo.h"
16 #include "LArSamplesMon/History.h"
21 #include "LArSamplesMon/Chi2Calc.h"
22 #include "TString.h"
23 #include <vector>
24 
25 class IdentifierHash;
26 class TH1I;
27 class TFile;
28 
29 namespace LArSamples {
30 
31  class Data;
32  class FilterParams;
33  class DataTweaker;
34  class AbsShapeErrorGetter;
35 
37 
38  public:
39 
42  : m_accessor(&accessor), m_shapeErrorGetter(0), m_ownShapeErrorGetter(0), m_neighborCache(nChannels()) { }
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 
59  HistoryIterator begin(unsigned int pos = 0, double eMin = -1, double adcMaxMin = -1) const;
60  unsigned int end() const { return nChannels(); }
61 
62  unsigned int size() const;
63  unsigned int nFilledChannels() const;
64  void printFilledRanges(unsigned int skip = 0) const;
65 
66  bool highEData(double eCut, TArrayI& hashes, TArrayI& indices) const;
67 
68  HistoryIterator findEtaPhi(CaloId calo, short layer, short iEta, short iPhi, short region = 0) const;
69  HistoryIterator findFebChannel(CaloId calo, short feb, short channel) const;
70  HistoryIterator findFTSlotChannel(CaloId calo, short ft, short slot, short channel) const;
71 
72  bool neighbors(const CellInfo& cell, double dRCut, std::vector<unsigned int>& hashes) const;
73  bool firstNeighbors(unsigned int hash, std::vector<unsigned int>& hashes, short layer = -2) const;
74  bool data(const std::vector<unsigned int>& hashes,const EventData& event, std::vector<const Data*>& data) const;
75 
76  Interface* merge(const Interface& other, const TString& fileName) const;
77  Interface* merge(const Interface& other, const TString& fileName, const TString& LBFile) const;
78 #ifndef __GCCXML__
79  static Interface* merge(const std::vector<const Interface*>& interfaces, const TString& fileName);
80  static Interface* merge(const std::vector<const Interface*>& interfaces, const TString& fileName, const TString& LBFile);
81 #endif
82  static Interface* merge(const TString& listFileName, const TString& fileName);
83  static Interface* merge(const TString& listFileName, const TString& fileName, const TString& LBFile);
84  static bool filterAndMerge(const TString& listFileName, const TString& outFile, const TString& filters, const TString& tweaks = "");
85 
86  Interface* filter(const TString& sel, const TString& fileName, const TString& tweaks = "") const;
87  Interface* filter(const FilterParams& filterParams, const DataTweaker& tweaker, const TString& fileName) const;
88 
89  Interface* makeTemplate(const TString& fileName) const;
90 
91  Interface* refit(const TString& newFileName, Chi2Params pars = DefaultChi2) const;
92 
93  const Accessor& accessor() const { return *m_accessor; }
94  bool isValid() const;
95 
96  TH1D* Draw(const TString& var, int nBins, double xMin, double xMax, const TString& sel = "", const TString& opt = "") const;
97  TH2D* Draw(const TString& varList, int nBinsX, double xMin, double xMax, int nBinsY, double yMin, double yMax,
98  const TString& sel = "", const TString& opt = "") const;
99  TH2D* DrawPartition(PartitionId partition, const TString& var, const TString& sel = "", const TString& opt = "",
100  CombinationType comb = TotalValue) const;
101  TH2D* DrawEtaPhi(CaloId calo, short layer, const TString& var, const TString& sel = "", const TString& opt = "",
102  CombinationType comb = TotalValue) const;
103  bool Scan(const TString& vars, const TString& sel = "", unsigned int verbosity = 1) const;
104  bool Scan(const TString& vars, CombinationType comb, const TString& sel = "", const TString& ranges = "", unsigned int verbosity = 1) const;
105 
106  bool Show(unsigned int hash, unsigned int verbosity = 1) const;
107  bool Show(const TString& sel = "", unsigned int verbosity = 1) const;
108  bool ShowEvents(const TString& sel = "", unsigned int verbosity = 1) const;
109  bool ShowRuns(unsigned int verbosity = 1) const;
110 
111  bool ShowStats(const TString& varList, const TString& sel = "", bool withErrors = false) const;
112 
114  DigitMonitor digitMonitor() const { return DigitMonitor(*this); }
115  FitMonitor fitMonitor() const { return FitMonitor(*this); }
116 
117  bool dumpEventTuple(const TString& variables, const TString& fileName) const;
118 
119  void setShapeErrorGetter(const AbsShapeErrorGetter* err);
120  void setShapeError(double k);
121  void setShapeError(const TString& fileName);
122  const AbsShapeErrorGetter* shapeErrorGetter() const { return m_shapeErrorGetter; }
123 
124  bool writeToFile(const TString& fileName) const { return accessor().writeToFile(fileName); }
125 
126  static TString addSuffix(const TString& fileName, const TString& suffix);
127 
128  const History* cellHistory(unsigned int i) const;
129  const History* getCellHistory(unsigned int i) const;
130  const CellInfo* getCellInfo(unsigned int i) const;
131 
132  private:
133 
137 
138  mutable std::vector<std::vector<unsigned int>*> m_neighborCache;
139  mutable std::vector<unsigned int> m_neighborHistoryPos;
140  mutable std::vector<const History*> m_neighborHistories;
141  };
142 }
143 
144 #endif
python.root_lsr_rank.hashes
hashes
Definition: root_lsr_rank.py:34
make_hlt_rep.pars
pars
Definition: make_hlt_rep.py:90
CaloId.h
trigbs_pickEvents.ranges
ranges
Definition: trigbs_pickEvents.py:60
beamspotnt.var
var
Definition: bin/beamspotnt.py:1394
data
char data[hepevt_bytes_allocation_ATLAS]
Definition: HepEvt.cxx:11
RPDUtils::nChannels
unsigned constexpr int nChannels
Definition: RPDUtils.h:23
LArSamples::Interface::nRuns
unsigned int nRuns() const
Definition: Interface.h:52
Chi2Calc.h
PlotCalibFromCool.ft
ft
Definition: PlotCalibFromCool.py:329
hotSpotInTAG.suffix
string suffix
Definition: hotSpotInTAG.py:186
ReadCellNoiseFromCool.cell
cell
Definition: ReadCellNoiseFromCool.py:53
checkCoolLatestUpdate.variables
variables
Definition: checkCoolLatestUpdate.py:13
plotting.yearwise_efficiency.channel
channel
Definition: yearwise_efficiency.py:24
LArSamples::FilterParams
Definition: FilterParams.h:50
checkxAOD.fileNames
fileNames
Definition: Tools/PyUtils/bin/checkxAOD.py:74
make_coralServer_rep.opt
opt
Definition: make_coralServer_rep.py:19
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
HistoryIterator.h
Data
@ Data
Definition: BaseObject.h:11
LArSamples::CombinationType
CombinationType
Definition: LArCalorimeter/LArSamplesMon/LArSamplesMon/MonitorBase.h:27
Trk::indices
std::pair< long int, long int > indices
Definition: AlSymMatBase.h:24
LArSamples::Accessor
A base class for accessing ntuple data.
Definition: LArCalorimeter/LArSamplesMon/LArSamplesMon/Accessor.h:24
LArSamples::History
Definition: History.h:40
LArSamples::Interface::nEvents
unsigned int nEvents() const
Definition: Interface.h:51
LArSamples::Interface::Interface
Interface(const Accessor &accessor)
Constructor
Definition: Interface.h:41
PlotCalibFromCool.begin
begin
Definition: PlotCalibFromCool.py:94
CscCalibQuery.fileList
fileList
Definition: CscCalibQuery.py:330
DigitMonitor.h
LArSamples
Definition: AbsShape.h:24
LArSamples::Chi2Params
Chi2Params
Definition: Chi2Calc.h:24
LArSamples::Interface::m_ownShapeErrorGetter
bool m_ownShapeErrorGetter
Definition: Interface.h:136
isValid
bool isValid(const T &p)
Definition: AtlasPID.h:225
LArSamples::Interface::m_neighborCache
std::vector< std::vector< unsigned int > * > m_neighborCache
Definition: Interface.h:138
AbsShapeErrorGetter
Liquid Argon base class for shape information.
LArSamples::AbsShapeErrorGetter
Definition: AbsShapeErrorGetter.h:23
LArSamples::Interface::end
unsigned int end() const
Definition: Interface.h:60
covarianceTool.filter
filter
Definition: covarianceTool.py:514
python.setupRTTAlg.size
int size
Definition: setupRTTAlg.py:39
LArSamples::RunData
Definition: RunData.h:21
LArSamples::TotalValue
@ TotalValue
Definition: LArCalorimeter/LArSamplesMon/LArSamplesMon/MonitorBase.h:27
LArSamples::Interface::accessor
const Accessor & accessor() const
Definition: Interface.h:93
FortranAlgorithmOptions.fileName
fileName
Definition: FortranAlgorithmOptions.py:13
FitMonitor.h
event
POOL::TEvent event(POOL::TEvent::kClassAccess)
dqt_zlumi_pandas.err
err
Definition: dqt_zlumi_pandas.py:182
LArSamples::OccupancyMonitor
storage of the time histories of all the cells
Definition: OccupancyMonitor.h:21
OccupancyMonitor.h
LArSamples::Interface::m_neighborHistories
std::vector< const History * > m_neighborHistories
Definition: Interface.h:140
lumiFormat.i
int i
Definition: lumiFormat.py:85
LArSamples::Interface::digitMonitor
DigitMonitor digitMonitor() const
Definition: Interface.h:114
LArSamples::Interface::m_neighborHistoryPos
std::vector< unsigned int > m_neighborHistoryPos
Definition: Interface.h:139
TRT::Hit::layer
@ layer
Definition: HitInfo.h:79
sel
sel
Definition: SUSYToolsTester.cxx:97
LArSamples::Interface::eventData
const EventData * eventData(unsigned int i) const
Definition: Interface.h:54
LArSamples::HistoryIterator
storage of the time histories of all the cells
Definition: HistoryIterator.h:20
LArSamples::PartitionId
PartitionId
Definition: CaloId.h:29
LArSamples::DataTweaker
Definition: DataTweaker.h:23
LArSamples::Interface::m_shapeErrorGetter
const AbsShapeErrorGetter * m_shapeErrorGetter
Definition: Interface.h:135
Accessor.h
LArSamples::Interface::shapeErrorGetter
const AbsShapeErrorGetter * shapeErrorGetter() const
Definition: Interface.h:122
DQPostProcessTest.outFile
outFile
Comment Out Those You do not wish to run.
Definition: DQPostProcessTest.py:37
dumpTgcDigiJitter.nBins
list nBins
Definition: dumpTgcDigiJitter.py:29
LArSamples::Interface::fitMonitor
FitMonitor fitMonitor() const
Definition: Interface.h:115
LArSamples::DigitMonitor
storage of the time histories of all the cells
Definition: DigitMonitor.h:34
covarianceTool.verbosity
verbosity
Definition: covarianceTool.py:513
LArSamples::CellInfo
Definition: CellInfo.h:31
LArSamples::CaloId
CaloId
Definition: CaloId.h:21
xAOD::JetAttributeAccessor::accessor
const AccessorWrapper< T > * accessor(xAOD::JetAttribute::AttributeID id)
Returns an attribute accessor corresponding to an AttributeID.
Definition: JetAccessorMap.h:26
python.LumiBlobConversion.pos
pos
Definition: LumiBlobConversion.py:18
Trk::iPhi
@ iPhi
Definition: ParamDefs.h:47
Trk::open
@ open
Definition: BinningType.h:40
LArSamples::DefaultChi2
@ DefaultChi2
Definition: Chi2Calc.h:24
InDetDD::other
@ other
Definition: InDetDD_Defs.h:16
CaloCondBlobAlgs_fillNoiseFromASCII.hash
dictionary hash
Definition: CaloCondBlobAlgs_fillNoiseFromASCII.py:109
LArSamples::Interface::m_accessor
const Accessor * m_accessor
Definition: Interface.h:134
StateLessPT_NewConfig.partition
partition
Definition: StateLessPT_NewConfig.py:49
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::occupancyMonitor
OccupancyMonitor occupancyMonitor() const
Definition: Interface.h:113
beamspotnt.varList
list varList
Definition: bin/beamspotnt.py:1108
LArSamples::Interface
Definition: Interface.h:36
LArSamples::FitMonitor
storage of the time histories of all the cells
Definition: FitMonitor.h:19
LArSamples::Interface::historySize
unsigned int historySize(unsigned int i) const
Definition: Interface.h:57
History.h
skip
bool skip
Definition: TrigGlobEffCorrValidation.cxx:190
IdentifierHash
This is a "hash" representation of an Identifier. This encodes a 32 bit index which can be used to lo...
Definition: IdentifierHash.h:25
LArSamples::Interface::writeToFile
bool writeToFile(const TString &fileName) const
Definition: Interface.h:124
xAOD::iEta
setScale setgFexType iEta
Definition: gFexJetRoI_v1.cxx:74
LArSamples::EventData
Definition: LArCalorimeter/LArCafJobs/LArCafJobs/EventData.h:29
CellInfo.h
fitman.k
k
Definition: fitman.py:528
LArSamples::Interface::runData
const RunData * runData(unsigned int i) const
Definition: Interface.h:55