ATLAS Offline Software
Loading...
Searching...
No Matches
LArSamples::Data Class Reference

#include <Data.h>

Inheritance diagram for LArSamples::Data:
Collaboration diagram for LArSamples::Data:

Public Member Functions

 Data (const DataContainer &container, const EventData &eventData, const History *history, int index)
 Constructor.
 Data (std::unique_ptr< const DataContainer > container, const EventData &eventData, const History *history, int index)
 Data (const Data &other, const EventData *eventData=0, const History *history=0, int index=-1)
virtual ~Data ()
 Destructor.
CaloGain::CaloGain gain () const
unsigned int nSamples () const
const short & sample (unsigned int i) const
float pedestalSubtractedSample (unsigned int i) const
std::vector< float > pedestalSubtractedSamples () const
const EventDataeventData () const
int run () const
int event () const
int lumiBlock () const
int bunchId () const
double energy () const
double ofcTime () const
double quality () const
double pedestal () const
double pedestalRMS () const
int status () const
double adcMax () const
double meV2ADC () const
double adc2MeV () const
bool febError (LArFebErrorSummary::LArFebErrorType error) const
bool isDisconnected () const
TString problems (bool sayNone=false) const
TString description (unsigned int verbosity=1) const
bool isValid () const
double footprint () const
short maxSample () const
short minSample () const
unsigned int nPoints () const
double time (unsigned int i) const
double value (unsigned int i) const
double covariance (unsigned int i, unsigned int j) const
unsigned int nCorrs () const
double noise () const
double adcMax_new () const
double covarianceMeV (unsigned int i, unsigned int j) const
const DataContainercontainer () const
const DataContainerdissolve ()
SimpleShapereferenceShape () const
SimpleShapetimeAlignedShape () const
const ScaledErrorDatascaledErrorData () const
const Historyhistory () const
short index () const
TVectorD deltas () const
TVectorD residuals () const
double delta (short sample) const
double residual (short sample) const
double residualOffset (short sample, bool scale=true) const
double resCorrN (ShapeErrorType shapeErrorType=BestShapeError) const
double xi (short sample, ShapeErrorType shapeErrorType=BestShapeError, CaloGain::CaloGain g=CaloGain::UNKNOWNGAIN, bool xip=false) const
double xiNorm (ShapeErrorType shapeErrorType=BestShapeError) const
double xip (short sample, ShapeErrorType shapeErrorType=BestShapeError, CaloGain::CaloGain g=CaloGain::UNKNOWNGAIN) const
double residualError (short sample1, short sample2=-1, bool scale=true) const
double chi2 () const
bool calcRefit (double &chi2, double &k, double &dT) const
bool calcAdjust (double &k, double &dT) const
bool isPassed (const TString &bitName) const
bool goodForShapeCorr () const
double upstreamEnergy () const
double _sample (const DataFuncArgs &args) const
double _pedestalSubstractedSample (const DataFuncArgs &args) const
double _energy (const DataFuncArgs &) const
double _ofcTime (const DataFuncArgs &) const
double _quality (const DataFuncArgs &) const
double _pedestal (const DataFuncArgs &) const
double _pedestalRMS (const DataFuncArgs &) const
double _adcMax (const DataFuncArgs &) const
double _adcMax_new (const DataFuncArgs &) const
double _noise (const DataFuncArgs &) const
double _maxValue (const DataFuncArgs &) const
double _minValue (const DataFuncArgs &) const
double _null (const DataFuncArgs &) const
int _run (const DataFuncArgs &) const
int _event (const DataFuncArgs &) const
int _lumiBlock (const DataFuncArgs &) const
int _bunchId (const DataFuncArgs &) const
int _index (const DataFuncArgs &) const
int _gain (const DataFuncArgs &) const
double _delta (const DataFuncArgs &args) const
double _residual (const DataFuncArgs &args) const
double _residualOffset (const DataFuncArgs &args) const
double _resCorrN (const DataFuncArgs &) const
double _xi (const DataFuncArgs &args) const
double _xiCell (const DataFuncArgs &args) const
double _xiRing (const DataFuncArgs &args) const
double _xiNormCell (const DataFuncArgs &) const
double _xiNormRing (const DataFuncArgs &) const
double _xip (const DataFuncArgs &args) const
double _residualError (const DataFuncArgs &args) const
double _normResidualOffset (const DataFuncArgs &args) const
double _normResidualError (const DataFuncArgs &args) const
double _ofcSigma (const DataFuncArgs &args) const
double _ofcGamma (const DataFuncArgs &args) const
int _iEta (const DataFuncArgs &args) const
int _iPhi (const DataFuncArgs &args) const
int _region (const DataFuncArgs &args) const
int _layer (const DataFuncArgs &args) const
int _calo (const DataFuncArgs &args) const
int _feedThrough (const DataFuncArgs &args) const
int _slot (const DataFuncArgs &args) const
int _channel (const DataFuncArgs &args) const
int _hash (const DataFuncArgs &args) const
int _ring (const DataFuncArgs &args) const
int _nData (const DataFuncArgs &args) const
int _maxPosition (const DataFuncArgs &) const
double _count (const DataFuncArgs &) const
double _chi2 (const DataFuncArgs &) const
double _chi2_noCorr (const DataFuncArgs &args) const
double _chi2_ringCorr (const DataFuncArgs &args) const
double _chi2_cellCorr (const DataFuncArgs &args) const
double _chi2_k (const DataFuncArgs &args) const
double _refitDeltaT (const DataFuncArgs &args) const
double _refitScale (const DataFuncArgs &args) const
double _refitChi2 (const DataFuncArgs &args) const
double _adjDeltaT (const DataFuncArgs &args) const
double _adjScale (const DataFuncArgs &args) const
double _x (const DataFuncArgs &args) const
double _y (const DataFuncArgs &args) const
double _z (const DataFuncArgs &args) const
double _rt (const DataFuncArgs &args) const
double _eta (const DataFuncArgs &args) const
double _phi (const DataFuncArgs &args) const
double _timeNoTOF (const DataFuncArgs &args) const
double _timeForSplash1 (const DataFuncArgs &args) const
double _timeForSplash2 (const DataFuncArgs &args) const
double _peakSignif (const DataFuncArgs &args) const
double _energySignif (const DataFuncArgs &args) const
int _goodForShapeCorr (const DataFuncArgs &) const
double _upstreamE (const DataFuncArgs &) const
double _upstreamERatio (const DataFuncArgs &args) const
double _chi2Anomaly (const DataFuncArgs &args) const
double timeClCorr () const
double timeECorr () const
double _timeECorr (const DataFuncArgs &args) const
double _pass (const DataFuncArgs &args) const
void setCallBacks (const History *history, unsigned int index) const
virtual double error (unsigned int i) const
TVectorD values (int lwb, int upb) const
int findTimeInterval (double time) const
int interpolate (double time, double &value, double &error) const
bool interpolate (const AbsShape &other, TVectorD &values, CovMatrix &errors, int lwb=-1, int upb=-1) const
int interpolateDiff (double time, double &diff) const
bool interpolateDiff (const AbsShape &other, TVectorD &diffs, int lwb=-1, int upb=-1) const
CovMatrix covarianceMatrix (int lwb=-1, int upb=-1, const CovMatrix &refErr=CovMatrix(), bool withCorrs=true) const
CovMatrix covarianceMatrix (unsigned int nPoints, bool withCorrs=true) const
CovMatrix invCovarianceMatrix (int lwb=-1, int upb=-1, const CovMatrix &refErr=CovMatrix(), bool withCorrs=true) const
CovMatrix invCovarianceMatrix (unsigned int nPoints, bool withCorrs=true) const
double maxValue (bool withErrors=false) const
double minValue (bool withErrors=false) const
int maxPosition () const
int minPosition () const
TGraphErrors * graph (bool timeInUnitOfSamples=false) const
SimpleShaperesample (unsigned int nPts) const

Static Public Member Functions

static TString str (LArFebErrorSummary::LArFebErrorType error)
static TString gainStr (CaloGain::CaloGain gain)
static double timeShift ()
static void setTimeShift (double shift=0)

Private Attributes

std::unique_ptr< const DataContainerm_container
const EventDatam_eventData
const Historym_history
unsigned int m_index

Static Private Attributes

static std::atomic< double > m_timeShift {0}

Friends

class DataTweaker

Detailed Description

Definition at line 73 of file Data.h.

Constructor & Destructor Documentation

◆ Data() [1/3]

Data::Data ( const DataContainer & container,
const EventData & eventData,
const History * history,
int index )

Constructor.

Definition at line 32 of file Data.cxx.

33 : AbsShape(), m_container(std::make_unique<DataContainer>(container)), m_eventData(eventData),
35{
37}
const History * m_history
Definition Data.h:285
std::unique_ptr< const DataContainer > m_container
Definition Data.h:283
const History * history() const
Definition Data.h:167
unsigned int m_index
Definition Data.h:286
const EventData & eventData() const
Definition Data.h:97
const EventData & m_eventData
Definition Data.h:284
const DataContainer & container() const
Definition Data.h:158
short index() const
Definition Data.h:168

◆ Data() [2/3]

Data::Data ( std::unique_ptr< const DataContainer > container,
const EventData & eventData,
const History * history,
int index )

Definition at line 40 of file Data.cxx.

◆ Data() [3/3]

Data::Data ( const Data & other,
const EventData * eventData = 0,
const History * history = 0,
int index = -1 )

Definition at line 48 of file Data.cxx.

49 : AbsShape(), m_container(new DataContainer(other.container())),
50 m_eventData(eventData ? *eventData : other.eventData()),
51 m_history(history ? history : other.m_history), m_index(index >= 0 ? index : other.m_index)
52{
54}

◆ ~Data()

Data::~Data ( )
virtual

Destructor.

Definition at line 57 of file Data.cxx.

Member Function Documentation

◆ _adcMax()

double LArSamples::Data::_adcMax ( const DataFuncArgs & ) const
inline

Definition at line 198 of file Data.h.

198{ return adcMax(); }
double adcMax() const
Definition Data.h:126

◆ _adcMax_new()

double LArSamples::Data::_adcMax_new ( const DataFuncArgs & ) const
inline

Definition at line 199 of file Data.h.

199{ return adcMax_new(); }
double adcMax_new() const
Definition Data.cxx:76

◆ _adjDeltaT()

double Data::_adjDeltaT ( const DataFuncArgs & args) const

Definition at line 288 of file Data.cxx.

289{
290 double k, dT;
291 if (!calcAdjust(k, dT)) return -9999;
292 return dT;
293}
bool calcAdjust(double &k, double &dT) const
Definition Data.cxx:276

◆ _adjScale()

double Data::_adjScale ( const DataFuncArgs & args) const

Definition at line 296 of file Data.cxx.

297{
298 double k, dT;
299 if (!calcAdjust(k, dT)) return -1;
300 return k;
301}

◆ _bunchId()

int LArSamples::Data::_bunchId ( const DataFuncArgs & ) const
inline

Definition at line 208 of file Data.h.

208{ return bunchId(); }
int bunchId() const
Definition Data.cxx:30

◆ _calo()

int Data::_calo ( const DataFuncArgs & args) const

Definition at line 325 of file Data.cxx.

326{
327 if (!m_history) return 0;
328 return m_history->cellInfo()->calo();
329}

◆ _channel()

int Data::_channel ( const DataFuncArgs & args) const

Definition at line 353 of file Data.cxx.

354{
355 if (!m_history) return 0;
356 return m_history->cellInfo()->channel();
357}

◆ _chi2()

double LArSamples::Data::_chi2 ( const DataFuncArgs & ) const
inline

Definition at line 241 of file Data.h.

241{ return chi2(); }
double chi2() const
Definition Data.cxx:204

◆ _chi2_cellCorr()

double Data::_chi2_cellCorr ( const DataFuncArgs & args) const

Definition at line 225 of file Data.cxx.

226{
227 if (!m_history) return 0;
228 return m_history->chi2(m_index, -1, -1, DefaultChi2, CellShapeError);
229}
@ DefaultChi2
Definition Chi2Calc.h:24

◆ _chi2_k()

double Data::_chi2_k ( const DataFuncArgs & args) const

Definition at line 232 of file Data.cxx.

233{
234 if (!m_history) return 0;
235 return m_history->chi2_k(m_index, args.x1);
236}

◆ _chi2_noCorr()

double Data::_chi2_noCorr ( const DataFuncArgs & args) const

Definition at line 211 of file Data.cxx.

212{
213 if (!m_history) return 0;
214 return m_history->chi2(m_index, -1, -1, DefaultChi2, NoShapeError);
215}

◆ _chi2_ringCorr()

double Data::_chi2_ringCorr ( const DataFuncArgs & args) const

Definition at line 218 of file Data.cxx.

219{
220 if (!m_history) return 0;
221 return m_history->chi2(m_index, -1, -1, DefaultChi2, RingShapeError);
222}

◆ _chi2Anomaly()

double Data::_chi2Anomaly ( const DataFuncArgs & args) const

Definition at line 596 of file Data.cxx.

597{
598 if (!m_history) return -1;
599 return m_history->chi2Anomaly(args.x1);
600}

◆ _count()

double LArSamples::Data::_count ( const DataFuncArgs & ) const
inline

Definition at line 239 of file Data.h.

239{ return 1; }

◆ _delta()

double LArSamples::Data::_delta ( const DataFuncArgs & args) const
inline

Definition at line 211 of file Data.h.

211{ return delta(args.i1); }
double delta(short sample) const
Definition Data.cxx:430

◆ _energy()

double LArSamples::Data::_energy ( const DataFuncArgs & ) const
inline

Definition at line 193 of file Data.h.

193{ return energy(); }
double energy() const
Definition Data.h:110

◆ _energySignif()

double Data::_energySignif ( const DataFuncArgs & args) const

Definition at line 408 of file Data.cxx.

409{
410 return energy()/noise();
411}
double noise() const
Definition Data.cxx:71

◆ _eta()

double Data::_eta ( const DataFuncArgs & args) const

Definition at line 502 of file Data.cxx.

502{ return m_history->cellInfo()->eta(); }

◆ _event()

int LArSamples::Data::_event ( const DataFuncArgs & ) const
inline

Definition at line 206 of file Data.h.

206{ return event(); }
int event() const
Definition Data.cxx:28

◆ _feedThrough()

int Data::_feedThrough ( const DataFuncArgs & args) const

Definition at line 339 of file Data.cxx.

340{
341 if (!m_history) return 0;
342 return m_history->cellInfo()->feedThrough();
343}

◆ _gain()

int LArSamples::Data::_gain ( const DataFuncArgs & ) const
inline

Definition at line 210 of file Data.h.

210{ return gain(); }
CaloGain::CaloGain gain() const
Definition Data.h:87

◆ _goodForShapeCorr()

int LArSamples::Data::_goodForShapeCorr ( const DataFuncArgs & ) const
inline

Definition at line 262 of file Data.h.

262{ return (goodForShapeCorr() ? 1 : 0); }
bool goodForShapeCorr() const
Definition Data.cxx:536

◆ _hash()

int Data::_hash ( const DataFuncArgs & args) const

Definition at line 360 of file Data.cxx.

361{
362 if (!m_history) return 0;
363 return m_history->hash();
364}

◆ _iEta()

int Data::_iEta ( const DataFuncArgs & args) const

Definition at line 304 of file Data.cxx.

305{
306 if (!m_history) return 0;
307 return m_history->cellInfo()->iEta();
308}

◆ _index()

int LArSamples::Data::_index ( const DataFuncArgs & ) const
inline

Definition at line 209 of file Data.h.

209{ return m_index; }

◆ _iPhi()

int Data::_iPhi ( const DataFuncArgs & args) const

Definition at line 311 of file Data.cxx.

312{
313 if (!m_history) return 0;
314 return m_history->cellInfo()->iPhi();
315}

◆ _layer()

int Data::_layer ( const DataFuncArgs & args) const

Definition at line 332 of file Data.cxx.

333{
334 if (!m_history) return 0;
335 return m_history->cellInfo()->layer();
336}

◆ _lumiBlock()

int LArSamples::Data::_lumiBlock ( const DataFuncArgs & ) const
inline

Definition at line 207 of file Data.h.

207{ return lumiBlock(); }
int lumiBlock() const
Definition Data.cxx:29

◆ _maxPosition()

int LArSamples::Data::_maxPosition ( const DataFuncArgs & ) const
inline

Definition at line 237 of file Data.h.

237{ return maxPosition(); }
int maxPosition() const
Definition AbsShape.cxx:52

◆ _maxValue()

double LArSamples::Data::_maxValue ( const DataFuncArgs & ) const
inline

Definition at line 201 of file Data.h.

201{ return maxValue(); }
#define maxValue(current, test)

◆ _minValue()

double LArSamples::Data::_minValue ( const DataFuncArgs & ) const
inline

Definition at line 202 of file Data.h.

202{ return minValue(); }
#define minValue(current, test)

◆ _nData()

int Data::_nData ( const DataFuncArgs & args) const

Definition at line 374 of file Data.cxx.

375{
376 if (!m_history) return 0;
377 return m_history->nData();
378}

◆ _noise()

double LArSamples::Data::_noise ( const DataFuncArgs & ) const
inline

Definition at line 200 of file Data.h.

200{ return noise(); }

◆ _normResidualError()

double LArSamples::Data::_normResidualError ( const DataFuncArgs & args) const
inline

Definition at line 223 of file Data.h.

223{ return residualError(args.i1, -1, false); }
double residualError(short sample1, short sample2=-1, bool scale=true) const
Definition Data.cxx:490

◆ _normResidualOffset()

double LArSamples::Data::_normResidualOffset ( const DataFuncArgs & args) const
inline

Definition at line 222 of file Data.h.

222{ return residualOffset(args.i1, false); }
double residualOffset(short sample, bool scale=true) const
Definition Data.cxx:454

◆ _null()

double LArSamples::Data::_null ( const DataFuncArgs & ) const
inline

Definition at line 204 of file Data.h.

204{ return 0; }

◆ _ofcGamma()

double Data::_ofcGamma ( const DataFuncArgs & args) const

Definition at line 577 of file Data.cxx.

578{
579 double result = -9999;
580 if (!m_history) return result;
581 std::unique_ptr<OFC> ofc (m_history->ofc(m_index));
582 if (ofc->isInRange(args.i1) && ofc->isInRange(args.i2))
583 result = ofc->Gamma()(args.i1, args.i2);
584 return result;
585}

◆ _ofcSigma()

double Data::_ofcSigma ( const DataFuncArgs & args) const

Definition at line 566 of file Data.cxx.

567{
568 double result = -9999;
569 if (!m_history) return result;
570 std::unique_ptr<OFC> ofc (m_history->ofc(m_index));
571 if (ofc->isInRange(args.i1))
572 result = TMath::Sqrt(ofc->Gamma()(args.i1, args.i1));
573 return result;
574}

◆ _ofcTime()

double LArSamples::Data::_ofcTime ( const DataFuncArgs & ) const
inline

Definition at line 194 of file Data.h.

194{ return ofcTime(); }
double ofcTime() const
Definition Data.h:113

◆ _pass()

double LArSamples::Data::_pass ( const DataFuncArgs & args) const
inline

Definition at line 272 of file Data.h.

272{ return isPassed(args.str); }
bool isPassed(const TString &bitName) const
Definition Data.cxx:530

◆ _peakSignif()

double Data::_peakSignif ( const DataFuncArgs & args) const

Definition at line 402 of file Data.cxx.

403{
404 return maxValue()/pedestalRMS();
405}
double pedestalRMS() const
Definition Data.h:120

◆ _pedestal()

double LArSamples::Data::_pedestal ( const DataFuncArgs & ) const
inline

Definition at line 196 of file Data.h.

196{ return pedestal(); }
double pedestal() const
Definition Data.h:119

◆ _pedestalRMS()

double LArSamples::Data::_pedestalRMS ( const DataFuncArgs & ) const
inline

Definition at line 197 of file Data.h.

197{ return pedestalRMS(); }

◆ _pedestalSubstractedSample()

double LArSamples::Data::_pedestalSubstractedSample ( const DataFuncArgs & args) const
inline

Definition at line 192 of file Data.h.

192{ return pedestalSubtractedSample(args.i1); }
float pedestalSubtractedSample(unsigned int i) const
Definition Data.h:94

◆ _phi()

double Data::_phi ( const DataFuncArgs & args) const

Definition at line 503 of file Data.cxx.

503{ return m_history->cellInfo()->phi(); }

◆ _quality()

double LArSamples::Data::_quality ( const DataFuncArgs & ) const
inline

Definition at line 195 of file Data.h.

195{ return quality(); }
double quality() const
Definition Data.h:116

◆ _refitChi2()

double Data::_refitChi2 ( const DataFuncArgs & args) const

Definition at line 268 of file Data.cxx.

269{
270 double chi2, k, dT;
271 if (!calcRefit(chi2, k, dT)) return -1;
272 return chi2;
273}
bool calcRefit(double &chi2, double &k, double &dT) const
Definition Data.cxx:239

◆ _refitDeltaT()

double Data::_refitDeltaT ( const DataFuncArgs & args) const

Definition at line 252 of file Data.cxx.

253{
254 double chi2, k, dT;
255 if (!calcRefit(chi2, k, dT)) return -9999;
256 return dT;
257}

◆ _refitScale()

double Data::_refitScale ( const DataFuncArgs & args) const

Definition at line 260 of file Data.cxx.

261{
262 double chi2, k, dT;
263 if (!calcRefit(chi2, k, dT)) return -1;
264 return k;
265}

◆ _region()

int Data::_region ( const DataFuncArgs & args) const

Definition at line 318 of file Data.cxx.

319{
320 if (!m_history) return 0;
321 return m_history->cellInfo()->region();
322}

◆ _resCorrN()

double LArSamples::Data::_resCorrN ( const DataFuncArgs & ) const
inline

Definition at line 214 of file Data.h.

214{ return resCorrN(CellShapeError); }
double resCorrN(ShapeErrorType shapeErrorType=BestShapeError) const
Definition Data.cxx:446

◆ _residual()

double LArSamples::Data::_residual ( const DataFuncArgs & args) const
inline

Definition at line 212 of file Data.h.

212{ return residual(args.i1); }
double residual(short sample) const
Definition Data.cxx:438

◆ _residualError()

double LArSamples::Data::_residualError ( const DataFuncArgs & args) const
inline

Definition at line 221 of file Data.h.

221{ return residualError(args.i1); }

◆ _residualOffset()

double LArSamples::Data::_residualOffset ( const DataFuncArgs & args) const
inline

Definition at line 213 of file Data.h.

213{ return residualOffset(args.i1); }

◆ _ring()

int Data::_ring ( const DataFuncArgs & args) const

Definition at line 367 of file Data.cxx.

368{
369 if (!m_history) return 0;
370 return m_history->cellInfo()->globalPhiRing();
371}

◆ _rt()

double Data::_rt ( const DataFuncArgs & args) const

Definition at line 501 of file Data.cxx.

501{ return m_history->cellInfo()->rt(); }

◆ _run()

int LArSamples::Data::_run ( const DataFuncArgs & ) const
inline

Definition at line 205 of file Data.h.

205{ return run(); }
int run() const
Definition Data.cxx:27

◆ _sample()

double LArSamples::Data::_sample ( const DataFuncArgs & args) const
inline

Definition at line 191 of file Data.h.

191{ return sample(args.i1); }
const short & sample(unsigned int i) const
Definition Data.h:93

◆ _slot()

int Data::_slot ( const DataFuncArgs & args) const

Definition at line 346 of file Data.cxx.

347{
348 if (!m_history) return 0;
349 return m_history->cellInfo()->slot();
350}

◆ _timeECorr()

double Data::_timeECorr ( const DataFuncArgs & args) const

Definition at line 641 of file Data.cxx.

642{
643 // Modify this to add Isabelle's correction
644 return ofcTime();
645}

◆ _timeForSplash1()

double Data::_timeForSplash1 ( const DataFuncArgs & args) const

Definition at line 388 of file Data.cxx.

389{
390 if (!m_history) return -9999;
391 return _timeNoTOF(args) + m_history->cellInfo()->position().z()/(TMath::C()*1E-6); // 10^-6 to convert to mm/ns
392}
double _timeNoTOF(const DataFuncArgs &args) const
Definition Data.cxx:381

◆ _timeForSplash2()

double Data::_timeForSplash2 ( const DataFuncArgs & args) const

Definition at line 395 of file Data.cxx.

396{
397 if (!m_history) return -9999;
398 return _timeNoTOF(args) - m_history->cellInfo()->position().z()/(TMath::C()*1E-6); // 10^-6 to convert to mm/ns
399}

◆ _timeNoTOF()

double Data::_timeNoTOF ( const DataFuncArgs & args) const

Definition at line 381 of file Data.cxx.

382{
383 if (!m_history) return -9999;
384 return ofcTime() + m_history->cellInfo()->position().Mag()/(TMath::C()*1E-6); // 10^-6 to convert to mm/ns
385}

◆ _upstreamE()

double LArSamples::Data::_upstreamE ( const DataFuncArgs & ) const
inline

Definition at line 263 of file Data.h.

263{ return upstreamEnergy(); }
double upstreamEnergy() const
Definition Data.cxx:560

◆ _upstreamERatio()

double Data::_upstreamERatio ( const DataFuncArgs & args) const

Definition at line 588 of file Data.cxx.

589{
590 double upe = upstreamEnergy();
591 if (upe < 0 || energy() == 0) return -1;
592 return upe/energy();
593}

◆ _x()

double Data::_x ( const DataFuncArgs & args) const

Definition at line 498 of file Data.cxx.

498{ return m_history->cellInfo()->position().X(); }

◆ _xi()

double LArSamples::Data::_xi ( const DataFuncArgs & args) const
inline

Definition at line 215 of file Data.h.

215{ return xi(args.i1); }
double xi(short sample, ShapeErrorType shapeErrorType=BestShapeError, CaloGain::CaloGain g=CaloGain::UNKNOWNGAIN, bool xip=false) const
Definition Data.cxx:462

◆ _xiCell()

double LArSamples::Data::_xiCell ( const DataFuncArgs & args) const
inline

Definition at line 216 of file Data.h.

@ UNKNOWNGAIN
Definition CaloGain.h:21

◆ _xiNormCell()

double LArSamples::Data::_xiNormCell ( const DataFuncArgs & ) const
inline

Definition at line 218 of file Data.h.

218{ return xiNorm(CellShapeError); }
double xiNorm(ShapeErrorType shapeErrorType=BestShapeError) const
Definition Data.cxx:474

◆ _xiNormRing()

double LArSamples::Data::_xiNormRing ( const DataFuncArgs & ) const
inline

Definition at line 219 of file Data.h.

219{ return xiNorm(RingShapeError); }

◆ _xip()

double LArSamples::Data::_xip ( const DataFuncArgs & args) const
inline

Definition at line 220 of file Data.h.

220{ return xip(args.i1); }
double xip(short sample, ShapeErrorType shapeErrorType=BestShapeError, CaloGain::CaloGain g=CaloGain::UNKNOWNGAIN) const
Definition Data.cxx:484

◆ _xiRing()

double LArSamples::Data::_xiRing ( const DataFuncArgs & args) const
inline

Definition at line 217 of file Data.h.

◆ _y()

double Data::_y ( const DataFuncArgs & args) const

Definition at line 499 of file Data.cxx.

499{ return m_history->cellInfo()->position().Y(); }

◆ _z()

double Data::_z ( const DataFuncArgs & args) const

Definition at line 500 of file Data.cxx.

500{ return m_history->cellInfo()->position().Z(); }

◆ adc2MeV()

double LArSamples::Data::adc2MeV ( ) const
inline

Definition at line 128 of file Data.h.

128{ return (adcMax() > 0 && energy() > 0 ? energy()/adcMax() : -1); }

◆ adcMax()

double LArSamples::Data::adcMax ( ) const
inline
Returns
OFC peak parameters

Definition at line 126 of file Data.h.

126{ return container().adcMax(); }

◆ adcMax_new()

double Data::adcMax_new ( ) const

Definition at line 76 of file Data.cxx.

77{
78 return ((energy()/noise())*pedestalRMS());
79
80}

◆ bunchId()

int Data::bunchId ( ) const

Definition at line 30 of file Data.cxx.

◆ calcAdjust()

bool Data::calcAdjust ( double & k,
double & dT ) const

Definition at line 276 of file Data.cxx.

277{
278 if (!m_history) return false;
279 std::unique_ptr<OFC> ofc (m_history->ofc(m_index));
280 if (!ofc) return false;
281
282 k = ofc->A(*this)/adcMax();
283 dT = ofc->time(*this);
284 return true;
285}

◆ calcRefit()

bool Data::calcRefit ( double & chi2,
double & k,
double & dT ) const

Definition at line 239 of file Data.cxx.

240{
241 ShapeFitter fitter;
242 std::unique_ptr<SimpleShape> reference (referenceShape());
243 if (!reference){
244 return false;
245 }
246 std::unique_ptr<const ScaledErrorData> sed (scaledErrorData());
247 bool result = fitter.fit(*this, *reference, k, dT, chi2, sed.get());
248 return result;
249}
SimpleShape * referenceShape() const
Definition Data.cxx:190
const ScaledErrorData * scaledErrorData() const
Definition Data.cxx:197
bool fit(const LArSamples::AbsShape &data, const AbsShape &reference, double &k, double &deltaT, double &chi2, const ScaledErrorData *sed=0) const
const ShapeFitter * fitter
const ScaledErrorData * sed

◆ chi2()

double Data::chi2 ( ) const

Definition at line 204 of file Data.cxx.

205{
206 if (!m_history) return 0;
207 return m_history->chi2(m_index);
208}

◆ container()

const DataContainer & LArSamples::Data::container ( ) const
inline

Definition at line 158 of file Data.h.

158{ return *m_container; }

◆ covariance()

double Data::covariance ( unsigned int i,
unsigned int j ) const
virtual

Implements LArSamples::AbsShape.

Definition at line 82 of file Data.cxx.

83{
84 if (i >= nSamples() || j >= nSamples()) return 0;
85 const std::vector<float>& corrs = m_container->corrs();
86 unsigned int index = TMath::Abs(int(i) - int(j)); // we use time-translation-invariant correlations...
87 if (index >= corrs.size()) return 0;
88 double corr = corrs[index];
89 return corr*pedestalRMS()*pedestalRMS()/(noise()*noise()); // hack to correct the noise per sample/ADC_max noise error
90}
unsigned int nSamples() const
Definition Data.h:90

◆ covarianceMatrix() [1/2]

CovMatrix AbsShape::covarianceMatrix ( int lwb = -1,
int upb = -1,
const CovMatrix & refErr = CovMatrix(),
bool withCorrs = true ) const
inherited

Definition at line 198 of file AbsShape.cxx.

201{
202 if (lwb < 0 || upb < 0) { lwb = 0; upb = nPoints() - 1; }
203 CovMatrix c(lwb, upb);
204 for (int i = lwb; i <= upb; i++) {
205 for (int j = lwb; j <= upb; j++) {
206 double cov = (withCorrs || i == j ? covariance(i, j) : 0);
207 if (refErr.GetNrows() > 0) cov += refErr(i, j);
208 c(i, j) = cov;
209 }
210 }
211 return c;
212}
virtual unsigned int nPoints() const =0
virtual double covariance(unsigned int i, unsigned int j) const =0
float j(const xAOD::IParticle &, const xAOD::TrackMeasurementValidation &hit, const Eigen::Matrix3d &jab_inv)

◆ covarianceMatrix() [2/2]

CovMatrix AbsShape::covarianceMatrix ( unsigned int nPoints,
bool withCorrs = true ) const
inherited

Definition at line 223 of file AbsShape.cxx.

225{
226 return covarianceMatrix(0, n - 1, CovMatrix(), withCorrs);
227}
CovMatrix covarianceMatrix(int lwb=-1, int upb=-1, const CovMatrix &refErr=CovMatrix(), bool withCorrs=true) const
Definition AbsShape.cxx:198

◆ covarianceMeV()

double Data::covarianceMeV ( unsigned int i,
unsigned int j ) const

Definition at line 93 of file Data.cxx.

94{
95 double adc2mev = adc2MeV();
96 if (adc2mev < 0) return 0;
97 return covariance(i,j)*adc2mev*adc2mev; // we use time-translation-invariant correlations...
98 //return (i == j ? m_corrs[0] : 0); // temporary
99}
double adc2MeV() const
Definition Data.h:128
double covariance(unsigned int i, unsigned int j) const
Definition Data.cxx:82

◆ delta()

double Data::delta ( short sample) const

Definition at line 430 of file Data.cxx.

431{
432 double val = 0;
433 if (!m_history || !m_history->delta(m_index, sample, val)) return -9999;
434 return val;
435}

◆ deltas()

TVectorD Data::deltas ( ) const

Definition at line 414 of file Data.cxx.

415{
416 if (!m_history) return TVectorD();
417 return m_history->deltas(m_index);
418}

◆ description()

TString Data::description ( unsigned int verbosity = 1) const

Definition at line 515 of file Data.cxx.

516{
517 TString desc = "";
518 desc += Form("%d samples, ", nSamples());
519 desc += "gain = " + gainStr(gain()) + ", ";
520 desc += Form("energy = %6.1f MeV, ", energy());
521 if (verbosity >= 2) desc += Form("ADCMax = %6.1f, ", adcMax());
522 desc += Form("time = %6.1f ns, ", ofcTime());
523 if (verbosity >= 2) desc += Form("chi^2/n = %6.1f, ", chi2());
524 desc += Form("run = %d, event = %d, ", run(), event());
525 desc += Form("problems = %s", problems(true).Data());
526 return desc;
527}
@ Data
Definition BaseObject.h:11
static TString gainStr(CaloGain::CaloGain gain)
Definition Data.cxx:506
TString problems(bool sayNone=false) const
Definition Data.cxx:142

◆ dissolve()

const DataContainer * Data::dissolve ( )

Definition at line 63 of file Data.cxx.

64{
65 const DataContainer* container = m_container.release();
66 delete this;
67 return container;
68}

◆ energy()

double LArSamples::Data::energy ( ) const
inline
Returns
energy

Definition at line 110 of file Data.h.

110{ return container().energy(); }

◆ error()

double AbsShape::error ( unsigned int i) const
virtualinherited

Reimplemented in LArSamples::ScaledShiftedShape.

Definition at line 24 of file AbsShape.cxx.

25{
26 return TMath::Sqrt(covariance(i, i));
27}

◆ event()

int Data::event ( ) const
Returns
event

Definition at line 28 of file Data.cxx.

◆ eventData()

const EventData & LArSamples::Data::eventData ( ) const
inline

Definition at line 97 of file Data.h.

97{ return m_eventData; }

◆ febError()

bool Data::febError ( LArFebErrorSummary::LArFebErrorType error) const

Definition at line 118 of file Data.cxx.

119{
120 return ((status() >> (error + 17)) & 0x1) != 0;
121}
virtual double error(unsigned int i) const
Definition AbsShape.cxx:24
int status() const
Definition Data.h:123

◆ findTimeInterval()

int AbsShape::findTimeInterval ( double time) const
inherited

Definition at line 71 of file AbsShape.cxx.

72{
73 if (t < time(0)) return -1;
74 if (t > time(nPoints() - 1)) return int(nPoints()) - 1;
75
76 for (unsigned int i = 0; i < nPoints() - 1; i++)
77 if (time(i) <= t && t < time(i+1)) return i;
78
79 return nPoints() - 1;
80}
virtual double time(unsigned int i) const =0

◆ footprint()

double LArSamples::Data::footprint ( ) const
inline

Definition at line 140 of file Data.h.

140{ return sizeof(*this) + nSamples()*sizeof(short); }

◆ gain()

CaloGain::CaloGain LArSamples::Data::gain ( ) const
inline
Returns
gain value

Definition at line 87 of file Data.h.

87{ return container().gain(); }
CaloGain::CaloGain gain() const

◆ gainStr()

TString Data::gainStr ( CaloGain::CaloGain gain)
static

Definition at line 506 of file Data.cxx.

507{
508 if (gain == CaloGain::LARHIGHGAIN) return "HIGH";
509 if (gain == CaloGain::LARMEDIUMGAIN) return "MEDIUM";
510 if (gain == CaloGain::LARLOWGAIN) return "LOW";
511 return "";
512}
@ LARMEDIUMGAIN
Definition CaloGain.h:18
@ LARLOWGAIN
Definition CaloGain.h:18
@ LARHIGHGAIN
Definition CaloGain.h:18

◆ goodForShapeCorr()

bool Data::goodForShapeCorr ( ) const

Definition at line 536 of file Data.cxx.

537{
538 if (adcMax() < 0) return false;
539
540 CaloId caloId = (m_history ? m_history->cellInfo()->calo() : UNKNOWN_CALO);
541 //short layer = (m_history ? m_history->cellInfo()->layer() : -1);
542
543 //if (Id::matchCalo(caloId, FCAL) && energy()/noise() < 250) return false;
544 if (Id::matchCalo(caloId, FCAL)) return false;
545 if (Id::matchCalo(caloId, HEC) && energy()/noise() < 20) return false;
546 if (Id::matchCalo(caloId, EMEC_INNER) && energy()/noise() < 250) return false;
547 if (Id::matchCalo(caloId, EMEC_OUTER) && energy()/noise() < 50) return false;
548 if (Id::matchCalo(caloId, EMB) && energy()/noise() < 30) return false;
549
550 if (Id::matchCalo(caloId, HEC)) {
551 if (TMath::Abs(ofcTime()) > 10) return false;
552 }
553 else {
554 if (TMath::Abs(ofcTime()) > 5) return false;
555 }
556
557 return true;
558}
static bool matchCalo(CaloId id, CaloId idSpec)
Definition CaloId.cxx:188
@ EMEC_INNER
Definition CaloId.h:25
@ UNKNOWN_CALO
Definition CaloId.h:23
@ EMEC_OUTER
Definition CaloId.h:25

◆ graph()

TGraphErrors * AbsShape::graph ( bool timeInUnitOfSamples = false) const
inherited

Definition at line 186 of file AbsShape.cxx.

187{
188 TGraphErrors* graph = new TGraphErrors(nPoints());
189 double unit = (timeInUnitOfSamples ? Definitions::samplingInterval : 1);
190 for (unsigned int i = 0; i < nPoints(); i++) {
191 graph->SetPoint(i, time(i)/unit, value(i));
192 graph->SetPointError(i, 0, error(i));
193 }
194 return graph;
195}
const PlainObject unit() const
This is a plugin that makes Eigen look like CLHEP & defines some convenience methods.
virtual double value(unsigned int i) const =0
TGraphErrors * graph(bool timeInUnitOfSamples=false) const
Definition AbsShape.cxx:186

◆ history()

const History * LArSamples::Data::history ( ) const
inline

Definition at line 167 of file Data.h.

167{ return m_history; }

◆ index()

short LArSamples::Data::index ( ) const
inline

Definition at line 168 of file Data.h.

168{ return m_index; }

◆ interpolate() [1/2]

bool AbsShape::interpolate ( const AbsShape & other,
TVectorD & values,
CovMatrix & errors,
int lwb = -1,
int upb = -1 ) const
inherited

Definition at line 147 of file AbsShape.cxx.

148{
149 if (lwb < 0) lwb = 0;
150 if (upb < 0) upb = other.nPoints() - 1;
151 values.ResizeTo(lwb, upb);
152 errors.ResizeTo(lwb, upb, lwb, upb);
153 int actualLwb = -1, actualUpb = upb;
154 for (int i = lwb; i <= upb; i++) {
155 double val, err;
156 int stat = interpolate(other.time(i), val, err);
157 if (stat == 0 && actualLwb < 0) actualLwb = i;
158 if (stat == +1) { actualUpb = i - 1; break; }
159 values(i) = val;
160 errors(i, i) = err*err;
161 }
162 values.ResizeTo(actualLwb, actualUpb);
163 errors.ResizeTo(actualLwb, actualUpb, actualLwb, actualUpb);
164 return (actualLwb >= 0);
165}
TVectorD values(int lwb, int upb) const
Definition AbsShape.cxx:135
int interpolate(double time, double &value, double &error) const
Definition AbsShape.cxx:83

◆ interpolate() [2/2]

int AbsShape::interpolate ( double time,
double & value,
double & error ) const
inherited

Definition at line 83 of file AbsShape.cxx.

84{
85 if (nPoints() < 2) return -1;
86
87 int status = 0;
88 int i1 = findTimeInterval(t);
89
90 if (i1 < 0) {
91 status = -1;
92 i1 = 0;
93 }
94
95 if (i1 > int(nPoints()) - 2) {
96 status = 1;
97 i1 = nPoints() - 2;
98 }
99
100 double delta = (t - time(i1))/(time(i1+1) - time(i1));
101 val = value(i1) + delta*(value(i1 + 1) - value(i1));
102 err = error(i1) + delta*(error(i1 + 1) - error(i1));
103 //cout << t << " " << i1 << " " << time(i1) << " " << delta << " " << value(i1) << " " << value(i1+1) << " " << val << " " << status << endl;
104 return status;
105}
int findTimeInterval(double time) const
Definition AbsShape.cxx:71
status
Definition merge.py:16

◆ interpolateDiff() [1/2]

bool AbsShape::interpolateDiff ( const AbsShape & other,
TVectorD & diffs,
int lwb = -1,
int upb = -1 ) const
inherited

Definition at line 168 of file AbsShape.cxx.

169{
170 if (lwb < 0) lwb = 0;
171 if (upb < 0) upb = other.nPoints() - 1;
172 diffs.ResizeTo(lwb, upb);
173 int actualLwb = -1, actualUpb = upb;
174 for (int i = lwb; i <= upb; i++) {
175 double diff;
176 int stat = interpolateDiff(other.time(i), diff);
177 if (stat == 0 && actualLwb < 0) actualLwb = i;
178 if (stat == +1) { actualUpb = i - 1; break; }
179 diffs(i) = diff;
180 }
181 diffs.ResizeTo(actualLwb, actualUpb);
182 return (actualLwb >= 0);
183}
void diff(const Jet &rJet1, const Jet &rJet2, std::map< std::string, double > varDiff)
Difference between jets - Non-Class function required by trigger.
Definition Jet.cxx:631
int interpolateDiff(double time, double &diff) const
Definition AbsShape.cxx:108

◆ interpolateDiff() [2/2]

int AbsShape::interpolateDiff ( double time,
double & diff ) const
inherited

Definition at line 108 of file AbsShape.cxx.

109{
110 int status = 0;
111 int i1 = findTimeInterval(t);
112 if (i1 < 0) {
113 i1 = 0;
114 status = -1;
115 }
116 if (i1 > int(nPoints()) - 1) {
117 i1 = nPoints() - 1;
118 status = 1;
119 }
120 if (i1 > 1 && i1 < int(nPoints()) - 2)
121 diff = (value(i1 - 2) - 8*value(i1 - 1) + 8*value(i1 + 1) - value(i1 + 2))/(time(i1 + 2) - time(i1 - 2))/3;
122 else
123 if (i1 > 0)
124 if (i1 < int(nPoints()) - 1)
125 diff = (value(i1 + 1) - value(i1 - 1))/(time(i1 + 1) - time(i1 - 1));
126 else
127 diff = (value(i1) - value(i1 - 1))/(time(i1) - time(i1 - 1));
128 else
129 diff = (value(i1 + 1) - value(i1))/(time(i1 + 1) - time(i1));
130
131 return status;
132}

◆ invCovarianceMatrix() [1/2]

CovMatrix AbsShape::invCovarianceMatrix ( int lwb = -1,
int upb = -1,
const CovMatrix & refErr = CovMatrix(),
bool withCorrs = true ) const
inherited

Definition at line 215 of file AbsShape.cxx.

218{
219 return covarianceMatrix(lwb, upb, refErr, withCorrs).Invert();
220}

◆ invCovarianceMatrix() [2/2]

CovMatrix AbsShape::invCovarianceMatrix ( unsigned int nPoints,
bool withCorrs = true ) const
inherited

Definition at line 230 of file AbsShape.cxx.

232{
233 return covarianceMatrix(n, withCorrs).Invert();
234}

◆ isDisconnected()

bool Data::isDisconnected ( ) const

Definition at line 113 of file Data.cxx.

114{
115 return ((status() >> 16) & 0x1) != 0;
116}

◆ isPassed()

bool Data::isPassed ( const TString & bitName) const

Definition at line 530 of file Data.cxx.

531{
532 return eventData().isPassed(bitName);
533}
bool isPassed(const TString &bitName) const
Definition EventData.cxx:88

◆ isValid()

bool Data::isValid ( ) const

Definition at line 161 of file Data.cxx.

162{
163 if (!m_container) return false;
164 if (!container().isValid()) return false;
165 return true;
166}
bool isValid() const
Definition Data.cxx:161

◆ lumiBlock()

int Data::lumiBlock ( ) const
Returns
lumi block

Definition at line 29 of file Data.cxx.

◆ maxPosition()

int AbsShape::maxPosition ( ) const
inherited

Definition at line 52 of file AbsShape.cxx.

53{
54 int maxPosition = -1;
55 double maxValue = -1;
56 for (unsigned int i = 0; i < nPoints(); i++)
57 if (value(i) > maxValue) { maxPosition = i; maxValue = value(i); }
58 return maxPosition;
59}
double maxValue(bool withErrors=false) const
Definition AbsShape.cxx:30

◆ maxSample()

short Data::maxSample ( ) const

Definition at line 169 of file Data.cxx.

170{
171 int maxPos = maxPosition();
172 if (maxPos >= 0) return sample(maxPos);
173 return -1;
174}

◆ maxValue()

double AbsShape::maxValue ( bool withErrors = false) const
inherited
Returns
sample max parameters

Definition at line 30 of file AbsShape.cxx.

31{
32 double maxValue = -DBL_MAX;
33 for (unsigned int i = 0; i < nPoints(); i++) {
34 double val = value(i) + (withErrors ? error(i) : 0);
35 if (val > maxValue) maxValue = val;
36 }
37 return maxValue;
38}

◆ meV2ADC()

double LArSamples::Data::meV2ADC ( ) const
inline

Definition at line 127 of file Data.h.

127{ return (adcMax() > 0 && energy() > 0 ? adcMax()/energy() : -1); }

◆ minPosition()

int AbsShape::minPosition ( ) const
inherited

Definition at line 61 of file AbsShape.cxx.

62{
63 int minPosition = -1;
65 for (unsigned int i = 0; i < nPoints(); i++)
66 if (value(i) < minValue) { minPosition = i; minValue = value(i); }
67 return minPosition;
68}
int minPosition() const
Definition AbsShape.cxx:61
double minValue(bool withErrors=false) const
Definition AbsShape.cxx:41

◆ minSample()

short Data::minSample ( ) const

Definition at line 176 of file Data.cxx.

177{
178 int minPos = minPosition();
179 if (minPos >= 0) return sample(minPos);
180 return -1;
181}

◆ minValue()

double AbsShape::minValue ( bool withErrors = false) const
inherited

Definition at line 41 of file AbsShape.cxx.

42{
43 double minValue = DBL_MAX;
44 for (unsigned int i = 0; i < nPoints(); i++) {
45 double val = value(i) - (withErrors ? error(i) : 0);
46 if (val < minValue) minValue = val;
47 }
48 return minValue;
49}

◆ nCorrs()

unsigned int LArSamples::Data::nCorrs ( ) const
inline

Definition at line 151 of file Data.h.

151{ return container().corrs().size(); }
const std::vector< float > & corrs() const

◆ noise()

double Data::noise ( ) const

Definition at line 71 of file Data.cxx.

72{
73 return (m_container->corrs().empty() ? 0 : TMath::Sqrt(m_container->corrs()[0]));
74}

◆ nPoints()

unsigned int LArSamples::Data::nPoints ( ) const
inlinevirtual
Returns
data points

Implements LArSamples::AbsShape.

Definition at line 146 of file Data.h.

146{ return nSamples(); }

◆ nSamples()

unsigned int LArSamples::Data::nSamples ( ) const
inline
Returns
number of samples

Definition at line 90 of file Data.h.

90{ return container().nSamples(); }
unsigned int nSamples() const

◆ ofcTime()

double LArSamples::Data::ofcTime ( ) const
inline
Returns
time

Definition at line 113 of file Data.h.

113{ return container().ofcTime() + m_timeShift; }
static std::atomic< double > m_timeShift
Definition Data.h:287

◆ pedestal()

double LArSamples::Data::pedestal ( ) const
inline
Returns
pedestal

Definition at line 119 of file Data.h.

119{ return container().pedestal(); }

◆ pedestalRMS()

double LArSamples::Data::pedestalRMS ( ) const
inline

Definition at line 120 of file Data.h.

120{ return container().pedestalRMS(); }

◆ pedestalSubtractedSample()

float LArSamples::Data::pedestalSubtractedSample ( unsigned int i) const
inline

Definition at line 94 of file Data.h.

94{ return sample(i) - pedestal(); }

◆ pedestalSubtractedSamples()

std::vector< float > Data::pedestalSubtractedSamples ( ) const

Definition at line 102 of file Data.cxx.

103{
104 std::vector<float> samples;
105
106 for (unsigned int i = 0; i < nSamples(); i++)
107 samples.push_back(pedestalSubtractedSample(i));
108
109 return samples;
110}

◆ problems()

TString Data::problems ( bool sayNone = false) const

Definition at line 142 of file Data.cxx.

143{
144 if (isDisconnected()) return "DISCONNECTED";
145
146/*
147 TString problems = "";
148 for (CaloBadChannel::CALOPROBLEM pb = CaloBadChannel::DEAD; pb < CaloBadChannel::NPB; pb = CaloBadChannel::CALOPROBLEM(pb + 1))
149 if (problem(pb)) {
150 if (problems != "") problems += " ";
151 problems += str(pb);
152 }
153*/
154
155 TString problems = "";
156 if (problems =="" && sayNone) problems = "None";
157 return problems;
158}
bool isDisconnected() const
Definition Data.cxx:113

◆ quality()

double LArSamples::Data::quality ( ) const
inline
Returns
pedestal

Definition at line 116 of file Data.h.

116{ return container().quality(); }

◆ referenceShape()

SimpleShape * Data::referenceShape ( ) const

Definition at line 190 of file Data.cxx.

191{
192 if (!m_history) return nullptr;
193 return m_history->referenceShape(m_index);
194}

◆ resample()

SimpleShape * AbsShape::resample ( unsigned int nPts) const
inherited

Definition at line 237 of file AbsShape.cxx.

238{
239 std::vector<double> values, errors;
240 double t0 = time(0);
241 double t1 = time(nPoints() - 1);
242 double dT = (t1 - t0)/nPts;
243 double t = t0;
244 for (unsigned int i = 0; i < nPts; i++, t += dT) {
245 double val, err;
246 int inRange = interpolate(t, val, err);
247 if (inRange != 0) return nullptr;
248 values.push_back(val);
249 errors.push_back(err);
250 }
251
252 return new SimpleShape(values, errors, dT, t0);
253}
static Double_t t0
bool inRange(const double *boundaries, const double value, const double tolerance=0.02)
std::vector< ALFA_RawDataCollection_p1 > t1

◆ resCorrN()

double Data::resCorrN ( ShapeErrorType shapeErrorType = BestShapeError) const

Definition at line 446 of file Data.cxx.

447{
448 if (!m_history) return -999;
449 const ShapeErrorData* sed = m_history->shapeErrorData(gain(), type);
450 return (sed ? sed->n() : 0);
451}

◆ residual()

double Data::residual ( short sample) const

Definition at line 438 of file Data.cxx.

439{
440 double val = 0;
441 if (!m_history || adcMax() < 0 || !m_history->delta(m_index, sample, val)) return -9999;
442 return val/adcMax();
443}

◆ residualError()

double Data::residualError ( short sample1,
short sample2 = -1,
bool scale = true ) const

Definition at line 490 of file Data.cxx.

491{
492 double val = 0;
493 if (!m_history || !m_history->residualError(m_index, sample1, sample2, val, scale)) return -9999;
494 return val;
495}

◆ residualOffset()

double Data::residualOffset ( short sample,
bool scale = true ) const

Definition at line 454 of file Data.cxx.

455{
456 double val = 0;
457 if (!m_history || !m_history->residualOffset(m_index, sample, val, (scale ? -1 : 1))) return -9999;
458 return val;
459}

◆ residuals()

TVectorD Data::residuals ( ) const

Definition at line 421 of file Data.cxx.

422{
423 if (!m_history || adcMax() < 0) return TVectorD();
424 TVectorD resv = m_history->deltas(m_index);
425 for (int i = 0; i < resv.GetNrows(); i++) resv(i) /= adcMax();
426 return resv;
427}

◆ run()

int Data::run ( ) const
Returns
run

Definition at line 27 of file Data.cxx.

27{ return eventData().run(); }

◆ sample()

const short & LArSamples::Data::sample ( unsigned int i) const
inline
Returns
a sample value

Definition at line 93 of file Data.h.

93{ return container().sample(i); }
const short & sample(unsigned int i) const

◆ scaledErrorData()

const ScaledErrorData * Data::scaledErrorData ( ) const

Definition at line 197 of file Data.cxx.

198{
199 if (!m_history) return nullptr;
200 return m_history->scaledErrorData(m_index);
201}

◆ setCallBacks()

void LArSamples::Data::setCallBacks ( const History * history,
unsigned int index ) const
inline

Definition at line 274 of file Data.h.

◆ setTimeShift()

void LArSamples::Data::setTimeShift ( double shift = 0)
inlinestatic

Definition at line 278 of file Data.h.

278{ m_timeShift = shift; }

◆ status()

int LArSamples::Data::status ( ) const
inline
Returns
status

Definition at line 123 of file Data.h.

123{ return m_container->status(); }

◆ str()

TString Data::str ( LArFebErrorSummary::LArFebErrorType error)
static

Definition at line 123 of file Data.cxx.

124{
125 if (error == LArFebErrorSummary::Parity) return "Parity";
126 if (error == LArFebErrorSummary::BCID) return "BCID";
127 if (error == LArFebErrorSummary::SampleHeader) return "SampleHeader";
128 if (error == LArFebErrorSummary::EVTID) return "EVTID";
129 if (error == LArFebErrorSummary::ScacStatus) return "ScacStatus";
130 if (error == LArFebErrorSummary::ScaOutOfRange) return "ScaOutOfRange";
131 if (error == LArFebErrorSummary::GainMismatch) return "GainMismatch";
132 if (error == LArFebErrorSummary::TypeMismatch) return "TypeMismatch";
133 if (error == LArFebErrorSummary::NumOfSamples) return "NumOfSamples";
134 if (error == LArFebErrorSummary::EmptyDataBlock) return "EmptyDataBlock";
135 if (error == LArFebErrorSummary::DspBlockSize) return "DspBlockSize";
136 if (error == LArFebErrorSummary::CheckSum) return "CheckSum";
137 if (error == LArFebErrorSummary::MissingHeader) return "MissingHeader";
138 return "";
139}

◆ time()

double LArSamples::Data::time ( unsigned int i) const
inlinevirtual

Implements LArSamples::AbsShape.

Definition at line 147 of file Data.h.

◆ timeAlignedShape()

SimpleShape * Data::timeAlignedShape ( ) const

Definition at line 184 of file Data.cxx.

185{
186 return new SimpleShape(*this, 1, -ofcTime());
187}

◆ timeClCorr()

double Data::timeClCorr ( ) const

Definition at line 602 of file Data.cxx.

603{
604 if (!m_history) return -9999.;
605 Double_t timeClCorr=-99.;
606
607 if(run()==203636) timeClCorr = ofcTime() + 0.04;
608 else if(run()==203680) timeClCorr = ofcTime() + 0.109155;
609 else if(run()==203719) timeClCorr = ofcTime() + 0.141762;
610 else if(run()==203745) timeClCorr = ofcTime() - 0.107597;
611 else if(run()==203779) timeClCorr = ofcTime() - 0.0032581;
612 else if(run()==203876) timeClCorr = ofcTime() + 0.109328;
613 else if(run()==203934) timeClCorr = ofcTime() - 0.0404719;
614 else if(run()==204073) timeClCorr = ofcTime() - 0.0244807;
615 else if(run()==204153) timeClCorr = ofcTime() + 0.185949;
616 else if(run()==204158) timeClCorr = ofcTime() + 0.0383347;
617 else if(run()==204240) timeClCorr = ofcTime() + 0.0635586;
618 else if(run()==204265) timeClCorr = ofcTime() + 0.13898;
619 else if(run()==204416) timeClCorr = ofcTime() + 0.1074;
620 else if(run()==204564) timeClCorr = ofcTime() + 0.0369925;
621 else if(run()==210302) timeClCorr = ofcTime() - 0.2;
622 else if(run()==210308) timeClCorr = ofcTime() - 0.2;
623 else timeClCorr = ofcTime();
624
625 return timeClCorr;
626}
double timeClCorr() const
Definition Data.cxx:602

◆ timeECorr()

double Data::timeECorr ( ) const

Definition at line 628 of file Data.cxx.

629{
630 if (!m_history) return -9999.;
631 Double_t timeCorr=-99.;
632
633 // Int_t calo = m_history->cellInfo()->calo();
634 // Double_t p0, p1, p2, p3;
635
636 timeCorr=ofcTime();
637
638 return timeCorr;
639}

◆ timeShift()

double LArSamples::Data::timeShift ( )
inlinestatic

Definition at line 277 of file Data.h.

277{ return m_timeShift; }

◆ upstreamEnergy()

double Data::upstreamEnergy ( ) const

Definition at line 560 of file Data.cxx.

561{
562 if (!m_history) return -1;
563 return m_history->upstreamEnergy(m_index);
564}

◆ value()

double LArSamples::Data::value ( unsigned int i) const
inlinevirtual

Implements LArSamples::AbsShape.

Definition at line 148 of file Data.h.

148{ return pedestalSubtractedSample(i); }

◆ values()

TVectorD AbsShape::values ( int lwb,
int upb ) const
inherited

Definition at line 135 of file AbsShape.cxx.

136{
137 if (lwb < 0) lwb = 0;
138 if (upb < 0) upb = (int)nPoints() - 1;
139 if (upb >= (int)nPoints()) upb = (int)nPoints() - 1;
140 TVectorD vals(lwb, upb);
141 for (int i = lwb; i <= upb; i++)
142 vals(i) = value(i);
143 return vals;
144}

◆ xi()

double Data::xi ( short sample,
ShapeErrorType shapeErrorType = BestShapeError,
CaloGain::CaloGain g = CaloGain::UNKNOWNGAIN,
bool xip = false ) const

Definition at line 462 of file Data.cxx.

463{
464 if (!m_history) return -999;
465 //njpb don't see the point of next line, commenting out
466 //if (g != CaloGain::UNKNOWNGAIN && type != RingShapeError) type = CellShapeError;
467 std::unique_ptr<const ShapeErrorData> sed (m_history->shapeErrorData(g == CaloGain::UNKNOWNGAIN ? gain() : g, type));
468 if (!sed) return -999;
469 double val = (sed->isInRange(sample) ? (xip ? sed->xip()(sample) : sed->xi()(sample)) : -999);
470 return val;
471}
bool isInRange(int i) const
Definition IndexRange.h:27
const TVectorD & xi() const
const TVectorD & xip() const

◆ xiNorm()

double Data::xiNorm ( ShapeErrorType shapeErrorType = BestShapeError) const

Definition at line 474 of file Data.cxx.

475{
476 if (!m_history) return -1;
477 std::unique_ptr<const ShapeErrorData> sed (m_history->shapeErrorData(gain(), type));
478 if (!sed) return -1;
479 double val = TMath::Sqrt(sed->xi().Norm2Sqr());
480 return val;
481}

◆ xip()

double Data::xip ( short sample,
ShapeErrorType shapeErrorType = BestShapeError,
CaloGain::CaloGain g = CaloGain::UNKNOWNGAIN ) const

Definition at line 484 of file Data.cxx.

485{
486 return xi(sample, type, g, true);
487}

◆ DataTweaker

friend class DataTweaker
friend

Definition at line 275 of file Data.h.

Member Data Documentation

◆ m_container

std::unique_ptr<const DataContainer> LArSamples::Data::m_container
private

Definition at line 283 of file Data.h.

◆ m_eventData

const EventData& LArSamples::Data::m_eventData
private

Definition at line 284 of file Data.h.

◆ m_history

const History* LArSamples::Data::m_history
mutableprivate

Definition at line 285 of file Data.h.

◆ m_index

unsigned int LArSamples::Data::m_index
mutableprivate

Definition at line 286 of file Data.h.

◆ m_timeShift

std::atomic<double> LArSamples::Data::m_timeShift {0}
inlinestaticprivate

Definition at line 287 of file Data.h.

287{0}; // specify a global time shift between first sample time and reported ofc time

The documentation for this class was generated from the following files: