Loading [MathJax]/jax/output/SVG/config.js
 |
ATLAS Offline Software
|
#include <History.h>
|
| History (const HistoryContainer &container, const std::vector< const EventData * > &eventData, unsigned int hash, const AbsShapeErrorGetter *shapeErrorGetter=0) |
| Constructor
More...
|
|
| History (const std::vector< const Data * > &data, const CellInfo &info, const std::vector< const EventData * > &eventData, unsigned int hash, const AbsShapeErrorGetter *shapeErrorGetter=0) |
|
virtual | ~History () |
|
HistoryContainer * | dissolve () |
|
unsigned int | nData () const |
|
const Data * | data (unsigned int i) const |
|
const Data * | data_for_event (int event, int run=-1) const |
|
const Data * | data_for_event (const EventData &eventData) const |
|
const CellInfo * | cellInfo () const |
|
const std::vector< const EventData * > & | eventData () const |
|
bool | sum (SimpleShape *&sum, SimpleShape *&reference) const |
|
bool | allShape (GraphShape *&allData, SimpleShape *&allRef) const |
|
double | allChi2 (Chi2Params pars) const |
|
double | chi2 (int i, int lwb=-1, int upb=-1, int chi2Params=DefaultChi2, ShapeErrorType shapeErrorType=BestShapeError, unsigned int *nDof=0) const |
|
double | chi2_k (int i, double k, int lwb=-1, int upb=-1, int chi2Params=DefaultChi2) const |
|
double | maxChi2 (int lwb=-1, int upb=-1, int chi2Params=DefaultChi2) const |
|
OFC * | ofc (unsigned int i, int lwb=-1, int upb=-1, double time=Definitions::none, bool useCorrs=true) const |
|
History * | refit (Chi2Params pars=DefaultChi2) const |
|
History * | adjust () const |
|
History * | filter (const TString &cuts) const |
|
bool | refVal (unsigned int i, unsigned int sample, double &val, double &err) const |
|
bool | delta (unsigned int i, unsigned int sample, double &del) const |
|
TVectorD | deltas (unsigned int i, int lwb=-1, int upb=-1, bool correct=true) const |
|
bool | isValid () const |
|
TString | description (unsigned int verbosity=1) const |
|
SimpleShape * | referenceShape (unsigned int k, double adcMax=-1, double time=Definitions::none, bool samplesOnly=false) const |
|
SimpleShape * | deltaShape (unsigned int k, int lwb=-1, int upb=-1) const |
|
unsigned int | hash () const |
|
void | setShapeErrorGetter (const AbsShapeErrorGetter *err) const |
|
const AbsShapeErrorGetter * | shapeErrorGetter () const |
|
const ShapeErrorData * | shapeErrorData (CaloGain::CaloGain gain, ShapeErrorType shapeErrorType=BestShapeError, const Residual *res=0) const |
|
const ScaledErrorData * | scaledErrorData (unsigned int i, double adcMax=-1, double time=Definitions::none, ShapeErrorType shapeErrorType=BestShapeError) const |
|
bool | residualOffset (unsigned int i, short sample, double &offset, double adcMax=-1, double time=Definitions::none) const |
|
bool | residualError (unsigned int i, short sample1, short sample2, double &offset, double adcMax=-1, double time=Definitions::none) const |
|
bool | drawWithReference (int i, const TString &atlasTitle="") const |
|
bool | drawSumWithReference () const |
|
bool | drawAllWithReference (bool refit=false) const |
|
bool | drawResiduals (int k=-1, bool errors=true, bool rescale=true) const |
|
Averager * | calculatePedestal (int i) const |
|
Residual * | residual (unsigned int k, bool correct=true, bool zeroTime=false) const |
|
Residuals * | residuals (CaloGain::CaloGain gain=CaloGain::LARNGAIN, double absResTrunc=-1, bool correct=true, bool zeroTime=false) const |
|
double | upstreamEnergy (unsigned int k) const |
|
double | chi2Anomaly (double chi2Cut, unsigned int nDof=3) const |
|
void | setInterface (const Interface *interface) const |
|
Definition at line 35 of file History.h.
◆ History() [1/2]
◆ History() [2/2]
◆ ~History()
◆ adjust()
History * History::adjust |
( |
| ) |
const |
Definition at line 259 of file History.cxx.
261 std::vector<const Data*> datas;
265 for (
unsigned int j = 0; j <
nData(); j++) {
268 for (
unsigned int k = 0;
k < datas.size();
k++)
delete datas[
k];
271 datas.push_back(newData);
◆ allChi2()
Definition at line 439 of file History.cxx.
445 if (!
allShape(allData, allRef))
return -1;
446 double chi2Value = c2c.chi2(*allData, *allRef);
◆ allShape()
Definition at line 413 of file History.cxx.
418 for (
unsigned int j = 0; j <
nData(); j++) {
419 if (
m_data[j]->isDisconnected())
continue;
420 if (
m_data[j]->adcMax() < 1)
continue;
423 allData->
add(*thisData);
426 else allData = thisData;
429 allRef->
add(*thisRef);
432 else allRef = thisRef;
◆ calculatePedestal()
Averager * History::calculatePedestal |
( |
int |
i | ) |
const |
Definition at line 584 of file History.cxx.
587 for (
unsigned int k = 0;
k <
nData();
k++) {
588 if (
i >= 0 &&
i != (
int)
k)
continue;
◆ cellInfo()
◆ chi2()
Definition at line 164 of file History.cxx.
169 if (
m_data[
i]->isDisconnected())
return -1;
173 if (nDof) *nDof = c2c.nDof();
◆ chi2_k()
double History::chi2_k |
( |
int |
i, |
|
|
double |
k, |
|
|
int |
lwb = -1 , |
|
|
int |
upb = -1 , |
|
|
int |
chi2Params = DefaultChi2 |
|
) |
| const |
Definition at line 180 of file History.cxx.
185 if (oldGetter) combGetter->
add(*oldGetter);
186 combGetter->
add(*uniGetter);
188 double chi2Value =
chi2(
i, lwb, upb, chi2Params);
◆ chi2Anomaly()
double History::chi2Anomaly |
( |
double |
chi2Cut, |
|
|
unsigned int |
nDof = 3 |
|
) |
| const |
Definition at line 658 of file History.cxx.
660 if (
nData() == 0 || chi2Cut <= 0)
return -1;
662 for (
unsigned int k = 0;
k <
nData();
k++)
if (
chi2(
k) > chi2Cut) nBadChi2++;
663 double effBad = nBadChi2/
nData();
664 double effRef = TMath::Prob(chi2Cut, nDof);
665 double dEff = sqrt(effRef*(1 - effRef))/sqrt(
nData());
666 if (dEff == 0) dEff = 1/sqrt(
nData());
667 return (effBad - effRef)/dEff;
◆ data()
const Data * History::data |
( |
unsigned int |
i | ) |
const |
◆ data_for_event() [1/2]
◆ data_for_event() [2/2]
const Data * History::data_for_event |
( |
int |
event, |
|
|
int |
run = -1 |
|
) |
| const |
◆ delta()
bool History::delta |
( |
unsigned int |
i, |
|
|
unsigned int |
sample, |
|
|
double & |
del |
|
) |
| const |
Definition at line 366 of file History.cxx.
368 if (
k >=
nData())
return 0;
370 if (
dv.GetNrows() == 0)
return false;
◆ deltas()
TVectorD History::deltas |
( |
unsigned int |
i, |
|
|
int |
lwb = -1 , |
|
|
int |
upb = -1 , |
|
|
bool |
correct = true |
|
) |
| const |
◆ deltaShape()
SimpleShape * History::deltaShape |
( |
unsigned int |
k, |
|
|
int |
lwb = -1 , |
|
|
int |
upb = -1 |
|
) |
| const |
Definition at line 556 of file History.cxx.
558 if (
k >=
nData())
return nullptr;
567 if (
dv.GetNrows() == 0)
return nullptr;
◆ description()
TString History::description |
( |
unsigned int |
verbosity = 1 | ) |
const |
◆ dissolve()
◆ drawAllWithReference()
bool History::drawAllWithReference |
( |
bool |
refit = false | ) |
const |
Definition at line 484 of file History.cxx.
487 cout <<
"No data" << endl;
493 if (!refitted_history)
return false;
495 delete refitted_history;
502 std::vector<const AbsShape*> shapes;
504 for (
unsigned int i = 0;
i <
nData();
i++) {
505 if (
m_data[
i]->adcMax() < 1)
continue;
509 for (
unsigned int k = 0;
k < shape->
nPoints();
k++)
514 shapes.push_back(shape);
518 return drawer.drawAndDelete(Form(
"%s (Normalized Shape, max at 1000)",
cellInfo()->location(2).
Data()), shapes, refShape, smpShape);
◆ drawResiduals()
bool History::drawResiduals |
( |
int |
k = -1 , |
|
|
bool |
errors = true , |
|
|
bool |
rescale = true |
|
) |
| const |
Definition at line 522 of file History.cxx.
524 std::vector<const AbsShape*> shapes;
525 for (
unsigned int i = 0;
i <
nData();
i++) {
526 if (
m_data[
i]->adcMax() < 1)
continue;
527 if (
k >= 0 &&
k != (
int)
i)
continue;
531 if (!shape)
continue;
537 shapes.push_back(shape);
540 TString
title = (
rescale ?
"Normalized " :
"") + TString(
"residuals for %s");
◆ drawSumWithReference()
bool History::drawSumWithReference |
( |
| ) |
const |
Definition at line 474 of file History.cxx.
477 if (!
sum(dataShape, refShape))
return false;
480 return drawer.drawAndDelete(
"", dataShape, refShape);
◆ drawWithReference()
bool History::drawWithReference |
( |
int |
i, |
|
|
const TString & |
atlasTitle = "" |
|
) |
| const |
Definition at line 453 of file History.cxx.
455 if ((
unsigned int)
k >=
nData())
return false;
459 if (!refShape || !smpShape)
return false;
462 if (atlasTitle !=
"") {
◆ eventData()
◆ filter()
Definition at line 282 of file History.cxx.
285 if (!
f.set(
cuts))
return nullptr;
287 std::vector<const Data*> datas;
289 for (
unsigned int j = 0; j <
nData(); j++) {
290 if (!
f.pass(
hash(), *
this, j))
continue;
291 datas.push_back(
new Data(*
data(j)));
◆ hash()
unsigned int LArSamples::History::hash |
( |
| ) |
const |
|
inline |
◆ isValid()
bool History::isValid |
( |
| ) |
const |
◆ maxChi2()
double History::maxChi2 |
( |
int |
lwb = -1 , |
|
|
int |
upb = -1 , |
|
|
int |
chi2Params = DefaultChi2 |
|
) |
| const |
Definition at line 196 of file History.cxx.
199 for (
unsigned int i = 0;
i <
nData();
i++) {
200 double chi2Value =
chi2(
i, lwb, upb, chi2Params);
◆ nData()
unsigned int LArSamples::History::nData |
( |
| ) |
const |
|
inline |
◆ ofc()
OFC * History::ofc |
( |
unsigned int |
i, |
|
|
int |
lwb = -1 , |
|
|
int |
upb = -1 , |
|
|
double |
time = Definitions::none , |
|
|
bool |
useCorrs = true |
|
) |
| const |
◆ referenceShape()
SimpleShape * History::referenceShape |
( |
unsigned int |
k, |
|
|
double |
adcMax = -1 , |
|
|
double |
time = Definitions::none , |
|
|
bool |
samplesOnly = false |
|
) |
| const |
◆ refit()
Definition at line 235 of file History.cxx.
237 std::vector<const Data*> datas;
242 for (
unsigned int j = 0; j <
nData(); j++) {
245 for (
unsigned int k = 0;
k < datas.size();
k++)
delete datas[
k];
248 datas.push_back(refitData);
◆ refVal()
bool History::refVal |
( |
unsigned int |
i, |
|
|
unsigned int |
sample, |
|
|
double & |
val, |
|
|
double & |
err |
|
) |
| const |
◆ residual()
Residual * History::residual |
( |
unsigned int |
k, |
|
|
bool |
correct = true , |
|
|
bool |
zeroTime = false |
|
) |
| const |
Definition at line 604 of file History.cxx.
606 if (
k >=
nData())
return nullptr;
607 TVectorD del =
deltas(
k, -1, -1, correct);
609 (zeroTime ? 0 :
data(
k)->ofcTime() ));
◆ residualError()
bool History::residualError |
( |
unsigned int |
i, |
|
|
short |
sample1, |
|
|
short |
sample2, |
|
|
double & |
offset, |
|
|
double |
adcMax = -1 , |
|
|
double |
time = Definitions::none |
|
) |
| const |
Definition at line 402 of file History.cxx.
405 if (!sea)
return false;
406 if (!sea->
isInRange(sample1) || !sea->
isInRange(sample2)) {
delete sea;
return false; }
◆ residualOffset()
bool History::residualOffset |
( |
unsigned int |
i, |
|
|
short |
sample, |
|
|
double & |
offset, |
|
|
double |
adcMax = -1 , |
|
|
double |
time = Definitions::none |
|
) |
| const |
Definition at line 391 of file History.cxx.
394 if (!sea)
return false;
◆ residuals()
Definition at line 613 of file History.cxx.
617 auto residuals = std::make_unique<Residuals>();
618 for (
unsigned int k = 0;
k <
nData();
k++) {
620 auto res = std::unique_ptr<Residual>(
residual(
k, correct, zeroTime));
621 if (!
res) { cout <<
"Error calculating residual for hash = " <<
m_hash <<
", index = " <<
k << endl;
return nullptr; }
623 cout <<
"Warning for hash = " <<
m_hash <<
", index = " <<
k <<
" : index interval changed from ["
628 for (
int i =
res->lwb(); i < res->upb();
i++) {
629 if (absResCut > 0 && TMath::Abs(
res->scaledDelta(
i)) > absResCut) {
◆ scaledErrorData()
◆ setInterface()
void LArSamples::History::setInterface |
( |
const Interface * |
interface | ) |
const |
|
inline |
◆ setShapeErrorGetter()
◆ shapeErrorData()
Definition at line 302 of file History.cxx.
315 if (!
sed)
return nullptr;
324 if (!
sed)
return nullptr;
331 if (!
sed)
return nullptr;
340 if (!
sed)
return nullptr;
◆ shapeErrorGetter()
◆ sum()
Definition at line 127 of file History.cxx.
130 if (
nData() == 0)
return false;
135 for (
unsigned int j = 0; j <
nData(); j++) {
136 if (
sum->nPoints() !=
m_data[j]->nSamples())
return false;
137 for (
unsigned int k = 0;
k <
m_data[j]->nSamples();
k++)
140 if (!thisRef) {
delete sum;
return false; }
◆ upstreamEnergy()
double History::upstreamEnergy |
( |
unsigned int |
k | ) |
const |
Definition at line 640 of file History.cxx.
644 std::vector<unsigned int> upstreamNeighbors;
646 if (upstreamNeighbors.empty())
return -1;
647 std::vector<const Data*> unData;
649 double upstreamE = 0;
◆ m_cellInfo
CellInfo LArSamples::History::m_cellInfo |
|
private |
◆ m_data
std::vector<const Data*> LArSamples::History::m_data |
|
private |
◆ m_eventData
◆ m_hash
unsigned int LArSamples::History::m_hash |
|
private |
◆ m_interface
◆ m_shapeErrorGetter
The documentation for this class was generated from the following files:
TString description(unsigned int verbosity=1) const
const Data * data_for_event(int event, int run=-1) const
std::vector< const EventData * > m_eventData
TVectorD deltas(const AbsShape &data, const AbsShape &reference, CovMatrix &errors, const ScaledErrorData *shapeError=0, int lwb=-1, int upb=-1, bool noDataError=false)
unsigned int hash() const
void setRefit(bool refit=true)
const ScaledErrorData * scaledErrorData(unsigned int i, double adcMax=-1, double time=Definitions::none, ShapeErrorType shapeErrorType=BestShapeError) const
const AbsShapeErrorGetter * m_shapeErrorGetter
const CellInfo * cellInfo() const
TMatrixTSym< double > CovMatrix
SimpleShape * referenceShape(unsigned int k, double adcMax=-1, double time=Definitions::none, bool samplesOnly=false) const
void setAdjust(bool adjust=true)
void setCallBacks(const History *history, unsigned int index) const
std::vector< const Data * > m_data
bool hasSameRange(int lw, int up) const
int run(int argc, char *argv[])
virtual ShapeErrorData * shapeErrorData(unsigned int hash, CaloGain::CaloGain gain, const Residual *toExclude=0) const =0
Residuals * residuals(CaloGain::CaloGain gain=CaloGain::LARNGAIN, double absResTrunc=-1, bool correct=true, bool zeroTime=false) const
const Interface * m_interface
unsigned int nPoints() const
storage of the time histories of all the cells
void add(const AbsShapeErrorGetter &getter)
bool add(const AbsShape &other)
SimpleShape * deltaShape(unsigned int k, int lwb=-1, int upb=-1) const
double maxChi2(int lwb=-1, int upb=-1, int chi2Params=DefaultChi2) const
bool add(unsigned int k, double value, double error)
const Data * data(unsigned int i) const
void set(unsigned int i, double value, double error=-1)
double value(unsigned int i) const
bool firstNeighbors(unsigned int hash, std::vector< unsigned int > &hashes, short layer=-2) const
bool isInRange(int i) const
Residual * residual(unsigned int k, bool correct=true, bool zeroTime=false) const
History * refit(Chi2Params pars=DefaultChi2) const
POOL::TEvent event(POOL::TEvent::kClassAccess)
bool allShape(GraphShape *&allData, SimpleShape *&allRef) const
void decrementInstanceCount() const
void setShapeErrorGetter(const AbsShapeErrorGetter *err) const
std::pair< std::vector< unsigned int >, bool > res
TString location(int verbose=1) const
InDet::SiSpacePointsSeedMakerEventData EventData
bool sum(SimpleShape *&sum, SimpleShape *&reference) const
unsigned int nData() const
double chi2(int i, int lwb=-1, int upb=-1, int chi2Params=DefaultChi2, ShapeErrorType shapeErrorType=BestShapeError, unsigned int *nDof=0) const
storage of a pulse shape residual set
History(const HistoryContainer &container, const std::vector< const EventData * > &eventData, unsigned int hash, const AbsShapeErrorGetter *shapeErrorGetter=0)
Constructor
void setFitParams(Chi2Params params)
unsigned int nPoints() const
Data * tweak(const Data &data, int evtIndex=-1) const
void incrementInstanceCount() const
const DataContainer * dissolve()
CaloGain::CaloGain gain() const
void setShapeErrorType(ShapeErrorType type)
const AbsShapeErrorGetter * shapeErrorGetter() const
bool drawAllWithReference(bool refit=false) const
const ShapeErrorData * shapeErrorData(CaloGain::CaloGain gain, ShapeErrorType shapeErrorType=BestShapeError, const Residual *res=0) const
def time(flags, cells_name, *args, **kw)
unsigned int size() const
bool add(const Residual &residual)
void add(const DataContainer *data)
append data (takes ownership)
void setError(unsigned int i, double error)
TVectorD deltas(unsigned int i, int lwb=-1, int upb=-1, bool correct=true) const
static bool isNone(double x)
bool data(const std::vector< unsigned int > &hashes, const EventData &event, std::vector< const Data * > &data) const
const std::vector< const EventData * > & eventData() const
const ScaledErrorData * sed
static const unsigned int samplingInterval
const CovMatrix errors(int first=-1, int last=-1) const
double value(unsigned int i) const
virtual ShapeErrorData * phiSymShapeErrorData(short ring, CaloGain::CaloGain gain, const Residual *toExclude=0) const =0
const TVectorD offsets(int first=-1, int last=-1) const
slightly more convenient legend class