ATLAS Offline Software
Loading...
Searching...
No Matches
CombinedShapeErrorGetter.cxx
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration
3*/
4
6
7#include "TMath.h"
8
9#include <iostream>
10using std::cout;
11using std::endl;
12
13using namespace LArSamples;
14
15
16ShapeErrorData* CombinedShapeErrorGetter::shapeErrorData(unsigned int hash, CaloGain::CaloGain gain, const Residual* /*toExclude*/) const
17{
18 TVectorD offsets(32);
19 CovMatrix errors(32);
20 ShapeErrorData* sed = nullptr;
21 for (const AbsShapeErrorGetter* getter : m_getters) {
22 const ShapeErrorData* other = getter->shapeErrorData(hash, gain);
23 if (!other) continue;
24 if (!sed)
25 sed = new ShapeErrorData(*other);
26 else {
27 ShapeErrorData* newSed = sed->add(*other);
28 delete sed;
29 sed = newSed;
30 if (!sed) return nullptr;
31 }
32 delete other;
33 }
34 return sed;
35}
std::vector< const AbsShapeErrorGetter * > m_getters
ShapeErrorData * shapeErrorData(unsigned int hash, CaloGain::CaloGain gain, const Residual *toExclude=0) const
ShapeErrorData * add(const ShapeErrorData &other) const