ATLAS Offline Software
Loading...
Searching...
No Matches
History.h
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2024 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
20class TString;
21
22namespace LArSamples {
23
24 class Interface;
25 class Data;
26 class Averager;
27 class GraphShape;
29 class ShapeErrorData;
30 class ScaledErrorData;
31 class Residual;
32 class Residuals;
33 class HistoryContainer;
34
36
37 public:
38
41 const std::vector<const EventData*>& eventData, unsigned int hash,
43
44 History(const std::vector<const Data*>& data, const CellInfo& info, const std::vector<const EventData*>& eventData,
45 unsigned int hash, const AbsShapeErrorGetter* shapeErrorGetter = 0);
46
47 virtual ~History();
48
50
51 unsigned int nData() const { return m_data.size(); }
52 const Data* data(unsigned int i) const;
53 const Data* data_for_event(int event, int run = -1) const;
54 const Data* data_for_event(const EventData& eventData) const;
55
56 const CellInfo* cellInfo() const { return &m_cellInfo; }
57
58 const std::vector<const EventData*>& eventData() const { return m_eventData; }
59
60 bool sum(SimpleShape*& sum, SimpleShape*& reference) const;
61 bool allShape(GraphShape*& allData, SimpleShape*& allRef) const;
62 double allChi2(Chi2Params pars) const;
63
64 // helpers
65 double chi2(int i, int lwb = -1, int upb = -1, int chi2Params = DefaultChi2, ShapeErrorType shapeErrorType = BestShapeError, unsigned int* nDof = 0) const;
66 double chi2_k(int i, double k, int lwb = -1, int upb = -1, int chi2Params = DefaultChi2) const;
67 double maxChi2(int lwb = -1, int upb = -1, int chi2Params = DefaultChi2) const;
68
69 OFC* ofc(unsigned int i, int lwb = -1, int upb = -1, double time = Definitions::none, bool useCorrs = true) const;
70 History* refit(Chi2Params pars = DefaultChi2) const;
71 History* adjust() const;
72 History* filter(const TString& cuts) const;
73
74 bool refVal(unsigned int i, unsigned int sample, double& val, double& err) const;
75 bool delta(unsigned int i, unsigned int sample, double& del) const;
76 TVectorD deltas(unsigned int i, int lwb = -1, int upb = -1, bool correct = true) const;
77 bool isValid() const;
78
79 TString description(unsigned int verbosity = 1) const;
80
81 SimpleShape* referenceShape(unsigned int k, double adcMax = -1, double time = Definitions::none,
82 bool samplesOnly = false) const;
83
84 SimpleShape* deltaShape(unsigned int k, int lwb = -1, int upb = -1) const;
85
86 unsigned int hash() const { return m_hash; }
89 const ShapeErrorData* shapeErrorData(CaloGain::CaloGain gain, ShapeErrorType shapeErrorType = BestShapeError, const Residual* res = 0) const;
90 const ScaledErrorData* scaledErrorData(unsigned int i, double adcMax = -1, double time = Definitions::none, ShapeErrorType shapeErrorType = BestShapeError) const;
91
92 bool residualOffset(unsigned int i, short sample, double& offset, double adcMax = -1, double time = Definitions::none) const;
93 bool residualError(unsigned int i, short sample1, short sample2, double& offset, double adcMax = -1, double time = Definitions::none) const;
94
95 bool drawWithReference(int i, const TString& atlasTitle = "") const;
96 bool drawSumWithReference() const;
97 bool drawAllWithReference(bool refit = false) const;
98 bool drawResiduals(int k = -1, bool errors = true, bool rescale = true) const;
99
100 Averager* calculatePedestal(int i) const;
101 Residual* residual(unsigned int k, bool correct = true, bool zeroTime = false) const;
102 Residuals* residuals(CaloGain::CaloGain gain = CaloGain::LARNGAIN, double absResTrunc = -1, bool correct = true, bool zeroTime = false) const;
103
104 double upstreamEnergy(unsigned int k) const;
105 double chi2Anomaly(double chi2Cut, unsigned int nDof = 3) const;
106
107 void setInterface(const Interface* interface) const { m_interface = interface; }
108
109 private:
110
111 std::vector<const Data*> m_data;
113 std::vector<const EventData*> m_eventData;
114 unsigned int m_hash;
116 mutable const Interface* m_interface = nullptr;
117 };
118}
119#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:113
History(const HistoryContainer &container, const std::vector< const EventData * > &eventData, unsigned int hash, const AbsShapeErrorGetter *shapeErrorGetter=0)
Constructor.
CellInfo m_cellInfo
Definition History.h:112
const std::vector< const EventData * > & eventData() const
Definition History.h:58
const AbsShapeErrorGetter * shapeErrorGetter() const
Definition History.h:88
unsigned int m_hash
Definition History.h:114
const Interface * m_interface
Definition History.h:116
const CellInfo * cellInfo() const
Definition History.h:56
const AbsShapeErrorGetter * m_shapeErrorGetter
Definition History.h:115
std::vector< const Data * > m_data
Definition History.h:111
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:87
unsigned int nData() const
Definition History.h:51
unsigned int hash() const
Definition History.h:86
void setInterface(const Interface *interface) const
Definition History.h:107
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
Definition run.py:1