ATLAS Offline Software
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 
10 #ifndef LArSamples_History_H
11 #define LArSamples_History_H
12 
13 #include "LArCafJobs/Definitions.h"
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 
20 class TString;
21 
22 namespace LArSamples {
23 
24  class Interface;
25  class Data;
26  class Averager;
27  class GraphShape;
28  class AbsShapeErrorGetter;
29  class ShapeErrorData;
30  class ScaledErrorData;
31  class Residual;
32  class Residuals;
33  class HistoryContainer;
34 
36 
37  public:
38 
40  History(const HistoryContainer& container,
41  const std::vector<const EventData*>& eventData, unsigned int hash,
42  const AbsShapeErrorGetter* shapeErrorGetter = 0);
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 
49  HistoryContainer* dissolve();
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; }
87  void setShapeErrorGetter(const AbsShapeErrorGetter* err) const { m_shapeErrorGetter = err; }
88  const AbsShapeErrorGetter* shapeErrorGetter() const { return m_shapeErrorGetter; }
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
grepfile.info
info
Definition: grepfile.py:38
make_hlt_rep.pars
pars
Definition: make_hlt_rep.py:90
data
char data[hepevt_bytes_allocation_ATLAS]
Definition: HepEvt.cxx:11
LArSamples::History::m_eventData
std::vector< const EventData * > m_eventData
Definition: History.h:113
Chi2Calc.h
WriteBchToCool.adjust
adjust
Definition: WriteBchToCool.py:73
LArSamples::History::hash
unsigned int hash() const
Definition: History.h:86
LArSamples::History::m_shapeErrorGetter
const AbsShapeErrorGetter * m_shapeErrorGetter
Definition: History.h:115
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::History::cellInfo
const CellInfo * cellInfo() const
Definition: History.h:56
ClusterSeg::residual
@ residual
Definition: ClusterNtuple.h:20
Data
@ Data
Definition: BaseObject.h:11
m_data
std::vector< T > m_data
Definition: TrackTruthMatchingBaseAlg.cxx:660
LArSamples::History
Definition: History.h:35
LArSamples::History::m_data
std::vector< const Data * > m_data
Definition: History.h:111
CaloCondBlobAlgs_fillNoiseFromASCII.gain
gain
Definition: CaloCondBlobAlgs_fillNoiseFromASCII.py:110
Interface
LArSamples::SimpleShape
Definition: SimpleShape.h:25
LArSamples
Definition: AbsShape.h:24
ScaledErrorData
Liquid Argon class for standalone storage of cell shape information.
LArSamples::Chi2Params
Chi2Params
Definition: Chi2Calc.h:24
reference
Definition: hcg.cxx:437
LArSamples::Averager
storage of the time histories of all the cells
Definition: Averager.h:23
isValid
bool isValid(const T &p)
Av: we implement here an ATLAS-sepcific convention: all particles which are 99xxxxx are fine.
Definition: AtlasPID.h:620
yodamerge_tmp.rescale
rescale
Definition: yodamerge_tmp.py:198
CaloGain::LARNGAIN
@ LARNGAIN
Definition: CaloGain.h:19
AbsShapeErrorGetter
Liquid Argon base class for shape information.
LArSamples::AbsShapeErrorGetter
Definition: AbsShapeErrorGetter.h:23
LArSamples::ScaledErrorData
Definition: ScaledErrorData.h:17
covarianceTool.filter
filter
Definition: covarianceTool.py:514
LArSamples::History::setInterface
void setInterface(const Interface *interface) const
Definition: History.h:107
convertTimingResiduals.sum
sum
Definition: convertTimingResiduals.py:55
event
POOL::TEvent event(POOL::TEvent::kClassAccess)
FullCPAlgorithmsTest_eljob.sample
sample
Definition: FullCPAlgorithmsTest_eljob.py:113
dqt_zlumi_pandas.err
err
Definition: dqt_zlumi_pandas.py:182
lumiFormat.i
int i
Definition: lumiFormat.py:85
ShapeErrorData
Liquid Argon class for standalone storage of cell shape information.
LArSamples::Definitions::none
static const double none
Definition: LArCalorimeter/LArCafJobs/LArCafJobs/Definitions.h:17
Residual
Residual is a class that stores the residual, error, and type of residual.
LArSamples::History::setShapeErrorGetter
void setShapeErrorGetter(const AbsShapeErrorGetter *err) const
Definition: History.h:87
res
std::pair< std::vector< unsigned int >, bool > res
Definition: JetGroupProductTest.cxx:14
chi2
double chi2(TH1 *h0, TH1 *h1)
Definition: comparitor.cxx:523
plotBeamSpotVert.cuts
string cuts
Definition: plotBeamSpotVert.py:93
LArSamples::ShapeErrorType
ShapeErrorType
Definition: LArCalorimeter/LArCafJobs/LArCafJobs/Definitions.h:21
LArSamples::BestShapeError
@ BestShapeError
Definition: LArCalorimeter/LArCafJobs/LArCafJobs/Definitions.h:25
run
Definition: run.py:1
LArSamples::History::nData
unsigned int nData() const
Definition: History.h:51
EventData.h
LArSamples::Residual
storage of a pulse shape residual set
Definition: LArCalorimeter/LArSamplesMon/LArSamplesMon/Residual.h:29
LArSamples::History::History
History(const HistoryContainer &container, const std::vector< const EventData * > &eventData, unsigned int hash, const AbsShapeErrorGetter *shapeErrorGetter=0)
Constructor
LArSamples::OFC
Definition: OFC.h:27
LArSamples::Residuals
Definition: LArCalorimeter/LArSamplesMon/LArSamplesMon/Residual.h:72
mergePhysValFiles.errors
list errors
Definition: DataQuality/DataQualityUtils/scripts/mergePhysValFiles.py:43
LArSamples::Data
Definition: Data.h:72
covarianceTool.verbosity
verbosity
Definition: covarianceTool.py:513
LArSamples::CellInfo
Definition: CellInfo.h:31
CaloGain::CaloGain
CaloGain
Definition: CaloGain.h:11
LArSamples::History::m_cellInfo
CellInfo m_cellInfo
Definition: History.h:112
LArSamples::History::shapeErrorGetter
const AbsShapeErrorGetter * shapeErrorGetter() const
Definition: History.h:88
LArSamples::DefaultChi2
@ DefaultChi2
Definition: Chi2Calc.h:24
CaloCondBlobAlgs_fillNoiseFromASCII.hash
dictionary hash
Definition: CaloCondBlobAlgs_fillNoiseFromASCII.py:109
LArSamples::HistoryContainer
Definition: HistoryContainer.h:29
Pythia8_RapidityOrderMPI.val
val
Definition: Pythia8_RapidityOrderMPI.py:14
LArSamples::GraphShape
Definition: GraphShape.h:32
convertTimingResiduals.offset
offset
Definition: convertTimingResiduals.py:71
LArSamples::Interface
Definition: Interface.h:36
Definitions.h
LArSamples::History::m_hash
unsigned int m_hash
Definition: History.h:114
LArSamples::ShapeErrorData
Definition: ShapeErrorData.h:19
LArSamples::History::eventData
const std::vector< const EventData * > & eventData() const
Definition: History.h:58
ReadOfcFromCool.ofc
ofc
Definition: ReadOfcFromCool.py:110
LArSamples::EventData
Definition: LArCalorimeter/LArCafJobs/LArCafJobs/EventData.h:29
CellInfo.h
fitman.k
k
Definition: fitman.py:528
description
std::string description
glabal timer - how long have I taken so far?
Definition: hcg.cxx:88