ATLAS Offline Software
Loading...
Searching...
No Matches
History.h
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2026 CERN for the benefit of the ATLAS collaboration
3*/
4
9
10#ifndef LArSamples_History_H
11#define LArSamples_History_H
12
14#include "LArCafJobs/CellInfo.h"//member
15#include "LArSamplesMon/Chi2Calc.h" //for defaulted value
16#include "LArCafJobs/EventData.h"//implemented method
17#include "TVectorD.h" //typedef
18#include <vector>
19#include <memory>
20
21class TString;
22
23namespace LArSamples {
24
25 class Interface;
26 class Data;
27 class Averager;
28 class GraphShape;
30 class ShapeErrorData;
31 class ScaledErrorData;
32 class Residual;
33 class Residuals;
34 class HistoryContainer;
35
37
38 public:
39
42 const std::vector<const EventData*>& eventData, unsigned int hash,
44
45 History(const std::vector<const Data*>& data, const CellInfo& info, const std::vector<const EventData*>& eventData,
46 unsigned int hash, const AbsShapeErrorGetter* shapeErrorGetter = 0);
47
48 virtual ~History();
49
51
52 unsigned int nData() const { return m_data.size(); }
53 const Data* data(unsigned int i) const;
54 const Data* data_for_event(int event, int run = -1) const;
55 const Data* data_for_event(const EventData& eventData) const;
56
57 const CellInfo* cellInfo() const { return &m_cellInfo; }
58
59 const std::vector<const EventData*>& eventData() const { return m_eventData; }
60
61 bool sum(SimpleShape*& sum, SimpleShape*& reference) const;
62 bool allShape(GraphShape*& allData, SimpleShape*& allRef) const;
63 double allChi2(Chi2Params pars) const;
64
65 // helpers
66 double chi2(int i, int lwb = -1, int upb = -1, int chi2Params = DefaultChi2, ShapeErrorType shapeErrorType = BestShapeError, unsigned int* nDof = 0) const;
67 double chi2_k(int i, double k, int lwb = -1, int upb = -1, int chi2Params = DefaultChi2) const;
68 double maxChi2(int lwb = -1, int upb = -1, int chi2Params = DefaultChi2) const;
69
70 OFC* ofc(unsigned int i, int lwb = -1, int upb = -1, double time = Definitions::none, bool useCorrs = true) const;
71 History* refit(Chi2Params pars = DefaultChi2) const;
72 History* adjust() const;
73 std::unique_ptr<History> filter(const TString& cuts) const;
74
75 bool refVal(unsigned int i, unsigned int sample, double& val, double& err) const;
76 bool delta(unsigned int i, unsigned int sample, double& del) const;
77 TVectorD deltas(unsigned int i, int lwb = -1, int upb = -1, bool correct = true) const;
78 bool isValid() const;
79
80 TString description(unsigned int verbosity = 1) const;
81
82 SimpleShape* referenceShape(unsigned int k, double adcMax = -1, double time = Definitions::none,
83 bool samplesOnly = false) const;
84
85 SimpleShape* deltaShape(unsigned int k, int lwb = -1, int upb = -1) const;
86
87 unsigned int hash() const { return m_hash; }
90 const ShapeErrorData* shapeErrorData(CaloGain::CaloGain gain, ShapeErrorType shapeErrorType = BestShapeError, const Residual* res = 0) const;
91 const ScaledErrorData* scaledErrorData(unsigned int i, double adcMax = -1, double time = Definitions::none, ShapeErrorType shapeErrorType = BestShapeError) const;
92
93 bool residualOffset(unsigned int i, short sample, double& offset, double adcMax = -1, double time = Definitions::none) const;
94 bool residualError(unsigned int i, short sample1, short sample2, double& offset, double adcMax = -1, double time = Definitions::none) const;
95
96 bool drawWithReference(int i, const TString& atlasTitle = "") const;
97 bool drawSumWithReference() const;
98 bool drawAllWithReference(bool refit = false) const;
99 bool drawResiduals(int k = -1, bool errors = true, bool rescale = true) const;
100
101 Averager* calculatePedestal(int i) const;
102 Residual* residual(unsigned int k, bool correct = true, bool zeroTime = false) const;
103 Residuals* residuals(CaloGain::CaloGain gain = CaloGain::LARNGAIN, double absResTrunc = -1, bool correct = true, bool zeroTime = false) const;
104
105 double upstreamEnergy(unsigned int k) const;
106 double chi2Anomaly(double chi2Cut, unsigned int nDof = 3) const;
107
108 void setInterface(const Interface* interface) const { m_interface = interface; }
109
110 private:
111
112 std::vector<const Data*> m_data;
114 std::vector<const EventData*> m_eventData;
115 unsigned int m_hash;
117 mutable const Interface* m_interface = nullptr;
118 };
119}
120#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
std::pair< std::vector< unsigned int >, bool > res
#define ATLAS_NOT_THREAD_SAFE
getNoisyStrip() Find noisy strips from hitmaps and write out into xml/db formats
storage of the time histories of all the cells
Definition Averager.h:23
std::vector< const EventData * > m_eventData
Definition History.h:114
History(const HistoryContainer &container, const std::vector< const EventData * > &eventData, unsigned int hash, const AbsShapeErrorGetter *shapeErrorGetter=0)
Constructor.
CellInfo m_cellInfo
Definition History.h:113
const std::vector< const EventData * > & eventData() const
Definition History.h:59
const AbsShapeErrorGetter * shapeErrorGetter() const
Definition History.h:89
unsigned int m_hash
Definition History.h:115
const Interface * m_interface
Definition History.h:117
const CellInfo * cellInfo() const
Definition History.h:57
const AbsShapeErrorGetter * m_shapeErrorGetter
Definition History.h:116
std::vector< const Data * > m_data
Definition History.h:112
const Data * data(unsigned int i) const
Definition History.cxx:91
HistoryContainer * dissolve()
Definition History.cxx:79
void setShapeErrorGetter(const AbsShapeErrorGetter *err) const
Definition History.h:88
unsigned int nData() const
Definition History.h:52
unsigned int hash() const
Definition History.h:87
void setInterface(const Interface *interface) const
Definition History.h:108
double chi2(TH1 *h0, TH1 *h1)
std::string description
glabal timer - how long have I taken so far?
Definition hcg.cxx:91
@ LARNGAIN
Definition CaloGain.h:19
@ DefaultChi2
Definition Chi2Calc.h:24
int run(int argc, char *argv[])