48{
49 std::vector<short> samples =
data.container().samples();
50 std::vector<float> corrs =
data.container().corrs();
51 float time =
data.container().ofcTime();
52 double k = 1, deltaT = 0;
53
55 for (
unsigned int i = 1;
i < corrs.size();
i++) corrs[i] = 0;
56
58 unsigned int maxIndex =
data.maxPosition();
59
61 if (i1 < 0) i1 = 0;
62
64 if (i2 > (
int)
data.nSamples()) i2 = (
int)
data.nSamples();
65 samples.clear();
66 for (
int i = i1;
i < i2;
i++) samples.push_back(
data.sample(i));
67 corrs.resize(i2 - i1);
69 }
70
72 std::vector<short> oldSamples = samples;
73 samples.clear();
74 for (std::map<unsigned int, bool>::const_iterator i =
m_samples.begin();
76 {
77 samples.push_back(oldSamples[
i->first]);
79 }
80 }
81
83 std::unique_ptr<SimpleShape>
reference =
data.referenceShape();
84 std::unique_ptr<const ScaledErrorData>
sed =
data.scaledErrorData();
87 if (!reference){
88 return nullptr;
89 }
91 if (!result) return nullptr;
92 }
93
95 if (!
data.history() ||
data.adcMax() == 0)
return nullptr;
96 std::unique_ptr<OFC>
ofc =
data.history()->ofc(
data.index());
97 if (!ofc) return nullptr;
100 }
101
102 if (evtIndex < 0) evtIndex =
data.container().eventIndex();
103
104 auto newContainer = std::make_unique<DataContainer>(
data.container().gain(), samples, corrs,
105 evtIndex,
106 data.container().energy(), time + deltaT,
data.container().quality(),
107 data.container().pedestal(),
data.container().pedestalRMS(),
108 data.container().status(), k*
data.container().adcMax());
109 return std::make_unique<Data>(std::move(newContainer),
data.eventData(),
data.history(),
data.index());
110}
char data[hepevt_bytes_allocation_ATLAS]
bool fit(const LArSamples::AbsShape &data, const AbsShape &reference, double &k, double &deltaT, double &chi2, const ScaledErrorData *sed=0) const
double chi2(TH1 *h0, TH1 *h1)
time(flags, cells_name, *args, **kw)
const ShapeFitter * fitter
const ScaledErrorData * sed