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, bool takeOwnership=false)
 Constructor.
 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

const DataContainer *const m_container
const EventData *const m_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 72 of file Data.h.

Constructor & Destructor Documentation

◆ Data() [1/2]

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

Constructor.

Definition at line 32 of file Data.cxx.

33 : AbsShape(), m_container(takeOwnership ? &container : new DataContainer(container)), m_eventData(&eventData),
35{
37}
const History * m_history
Definition Data.h:283
const History * history() const
Definition Data.h:165
unsigned int m_index
Definition Data.h:284
const EventData * eventData() const
Definition Data.h:95
const DataContainer *const m_container
Definition Data.h:281
const EventData *const m_eventData
Definition Data.h:282
const DataContainer & container() const
Definition Data.h:156
short index() const
Definition Data.h:166

◆ Data() [2/2]

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

Definition at line 40 of file Data.cxx.

41 : AbsShape(), m_container(new DataContainer(other.container())),
42 m_eventData(eventData ? eventData : other.eventData()),
43 m_history(history ? history : other.m_history), m_index(index >= 0 ? index : other.m_index)
44{
46}

◆ ~Data()

Data::~Data ( )
virtual

Destructor.

Definition at line 49 of file Data.cxx.

Member Function Documentation

◆ _adcMax()

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

Definition at line 196 of file Data.h.

196{ return adcMax(); }
double adcMax() const
Definition Data.h:124

◆ _adcMax_new()

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

Definition at line 197 of file Data.h.

197{ return adcMax_new(); }
double adcMax_new() const
Definition Data.cxx:69

◆ _adjDeltaT()

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

Definition at line 285 of file Data.cxx.

286{
287 double k, dT;
288 if (!calcAdjust(k, dT)) return -9999;
289 return dT;
290}
bool calcAdjust(double &k, double &dT) const
Definition Data.cxx:272

◆ _adjScale()

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

Definition at line 293 of file Data.cxx.

294{
295 double k, dT;
296 if (!calcAdjust(k, dT)) return -1;
297 return k;
298}

◆ _bunchId()

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

Definition at line 206 of file Data.h.

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

◆ _calo()

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

Definition at line 322 of file Data.cxx.

323{
324 if (!m_history) return 0;
325 return m_history->cellInfo()->calo();
326}

◆ _channel()

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

Definition at line 350 of file Data.cxx.

351{
352 if (!m_history) return 0;
353 return m_history->cellInfo()->channel();
354}

◆ _chi2()

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

Definition at line 239 of file Data.h.

239{ return chi2(); }
double chi2() const
Definition Data.cxx:197

◆ _chi2_cellCorr()

double Data::_chi2_cellCorr ( 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, CellShapeError);
222}
@ DefaultChi2
Definition Chi2Calc.h:24

◆ _chi2_k()

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

Definition at line 225 of file Data.cxx.

226{
227 if (!m_history) return 0;
228 return m_history->chi2_k(m_index, args.x1);
229}

◆ _chi2_noCorr()

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

Definition at line 204 of file Data.cxx.

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

◆ _chi2_ringCorr()

double Data::_chi2_ringCorr ( 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, RingShapeError);
215}

◆ _chi2Anomaly()

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

Definition at line 597 of file Data.cxx.

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

◆ _count()

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

Definition at line 237 of file Data.h.

237{ return 1; }

◆ _delta()

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

Definition at line 209 of file Data.h.

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

◆ _energy()

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

Definition at line 191 of file Data.h.

191{ return energy(); }
double energy() const
Definition Data.h:108

◆ _energySignif()

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

Definition at line 405 of file Data.cxx.

406{
407 return energy()/noise();
408}
double noise() const
Definition Data.cxx:64

◆ _eta()

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

Definition at line 501 of file Data.cxx.

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

◆ _event()

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

Definition at line 204 of file Data.h.

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

◆ _feedThrough()

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

Definition at line 336 of file Data.cxx.

337{
338 if (!m_history) return 0;
339 return m_history->cellInfo()->feedThrough();
340}

◆ _gain()

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

Definition at line 208 of file Data.h.

208{ return gain(); }
CaloGain::CaloGain gain() const
Definition Data.h:85

◆ _goodForShapeCorr()

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

Definition at line 260 of file Data.h.

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

◆ _hash()

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

Definition at line 357 of file Data.cxx.

358{
359 if (!m_history) return 0;
360 return m_history->hash();
361}

◆ _iEta()

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

Definition at line 301 of file Data.cxx.

302{
303 if (!m_history) return 0;
304 return m_history->cellInfo()->iEta();
305}

◆ _index()

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

Definition at line 207 of file Data.h.

207{ return m_index; }

◆ _iPhi()

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

Definition at line 308 of file Data.cxx.

309{
310 if (!m_history) return 0;
311 return m_history->cellInfo()->iPhi();
312}

◆ _layer()

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

Definition at line 329 of file Data.cxx.

330{
331 if (!m_history) return 0;
332 return m_history->cellInfo()->layer();
333}

◆ _lumiBlock()

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

Definition at line 205 of file Data.h.

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

◆ _maxPosition()

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

Definition at line 235 of file Data.h.

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

◆ _maxValue()

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

Definition at line 199 of file Data.h.

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

◆ _minValue()

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

Definition at line 200 of file Data.h.

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

◆ _nData()

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

Definition at line 371 of file Data.cxx.

372{
373 if (!m_history) return 0;
374 return m_history->nData();
375}

◆ _noise()

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

Definition at line 198 of file Data.h.

198{ return noise(); }

◆ _normResidualError()

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

Definition at line 221 of file Data.h.

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

◆ _normResidualOffset()

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

Definition at line 220 of file Data.h.

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

◆ _null()

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

Definition at line 202 of file Data.h.

202{ 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 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 delete ofc;
585 return result;
586}

◆ _ofcSigma()

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

Definition at line 565 of file Data.cxx.

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

◆ _ofcTime()

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

Definition at line 192 of file Data.h.

192{ return ofcTime(); }
double ofcTime() const
Definition Data.h:111

◆ _pass()

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

Definition at line 270 of file Data.h.

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

◆ _peakSignif()

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

Definition at line 399 of file Data.cxx.

400{
401 return maxValue()/pedestalRMS();
402}
double pedestalRMS() const
Definition Data.h:118

◆ _pedestal()

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

Definition at line 194 of file Data.h.

194{ return pedestal(); }
double pedestal() const
Definition Data.h:117

◆ _pedestalRMS()

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

Definition at line 195 of file Data.h.

195{ return pedestalRMS(); }

◆ _pedestalSubstractedSample()

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

Definition at line 190 of file Data.h.

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

◆ _phi()

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

Definition at line 502 of file Data.cxx.

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

◆ _quality()

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

Definition at line 193 of file Data.h.

193{ return quality(); }
double quality() const
Definition Data.h:114

◆ _refitChi2()

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

Definition at line 264 of file Data.cxx.

265{
266 double chi2, k, dT;
267 if (!calcRefit(chi2, k, dT)) return -1;
268 return chi2;
269}
bool calcRefit(double &chi2, double &k, double &dT) const
Definition Data.cxx:232

◆ _refitDeltaT()

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

Definition at line 248 of file Data.cxx.

249{
250 double chi2, k, dT;
251 if (!calcRefit(chi2, k, dT)) return -9999;
252 return dT;
253}

◆ _refitScale()

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

Definition at line 256 of file Data.cxx.

257{
258 double chi2, k, dT;
259 if (!calcRefit(chi2, k, dT)) return -1;
260 return k;
261}

◆ _region()

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

Definition at line 315 of file Data.cxx.

316{
317 if (!m_history) return 0;
318 return m_history->cellInfo()->region();
319}

◆ _resCorrN()

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

Definition at line 212 of file Data.h.

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

◆ _residual()

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

Definition at line 210 of file Data.h.

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

◆ _residualError()

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

Definition at line 219 of file Data.h.

219{ return residualError(args.i1); }

◆ _residualOffset()

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

Definition at line 211 of file Data.h.

211{ return residualOffset(args.i1); }

◆ _ring()

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

Definition at line 364 of file Data.cxx.

365{
366 if (!m_history) return 0;
367 return m_history->cellInfo()->globalPhiRing();
368}

◆ _rt()

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

Definition at line 500 of file Data.cxx.

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

◆ _run()

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

Definition at line 203 of file Data.h.

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

◆ _sample()

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

Definition at line 189 of file Data.h.

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

◆ _slot()

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

Definition at line 343 of file Data.cxx.

344{
345 if (!m_history) return 0;
346 return m_history->cellInfo()->slot();
347}

◆ _timeECorr()

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

Definition at line 642 of file Data.cxx.

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

◆ _timeForSplash1()

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

Definition at line 385 of file Data.cxx.

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

◆ _timeForSplash2()

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

Definition at line 392 of file Data.cxx.

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

◆ _timeNoTOF()

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

Definition at line 378 of file Data.cxx.

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

◆ _upstreamE()

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

Definition at line 261 of file Data.h.

261{ return upstreamEnergy(); }
double upstreamEnergy() const
Definition Data.cxx:559

◆ _upstreamERatio()

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

Definition at line 589 of file Data.cxx.

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

◆ _x()

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

Definition at line 497 of file Data.cxx.

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

◆ _xi()

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

Definition at line 213 of file Data.h.

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

◆ _xiCell()

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

Definition at line 214 of file Data.h.

@ UNKNOWNGAIN
Definition CaloGain.h:21

◆ _xiNormCell()

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

Definition at line 216 of file Data.h.

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

◆ _xiNormRing()

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

Definition at line 217 of file Data.h.

217{ return xiNorm(RingShapeError); }

◆ _xip()

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

Definition at line 218 of file Data.h.

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

◆ _xiRing()

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

Definition at line 215 of file Data.h.

◆ _y()

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

Definition at line 498 of file Data.cxx.

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

◆ _z()

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

Definition at line 499 of file Data.cxx.

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

◆ adc2MeV()

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

Definition at line 126 of file Data.h.

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

◆ adcMax()

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

Definition at line 124 of file Data.h.

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

◆ adcMax_new()

double Data::adcMax_new ( ) const

Definition at line 69 of file Data.cxx.

70{
71 return ((energy()/noise())*pedestalRMS());
72
73}

◆ 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 272 of file Data.cxx.

273{
274 if (!m_history) return false;
275 OFC* ofc = m_history->ofc(m_index);
276 if (!ofc) return false;
277
278 k = ofc->A(*this)/adcMax();
279 dT = ofc->time(*this);
280 delete ofc;
281 return true;
282}

◆ calcRefit()

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

Definition at line 232 of file Data.cxx.

233{
234 ShapeFitter fitter;
235 SimpleShape* reference = referenceShape();
236 const ScaledErrorData* sed = scaledErrorData();
237 if (!reference){
238 delete sed;
239 return false;
240 }
241 bool result = fitter.fit(*this, *reference, k, dT, chi2, sed);
242 delete sed;
243 delete reference;
244 return result;
245}
SimpleShape * referenceShape() const
Definition Data.cxx:183
const ScaledErrorData * scaledErrorData() const
Definition Data.cxx:190
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 197 of file Data.cxx.

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

◆ container()

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

Definition at line 156 of file Data.h.

156{ return *m_container; }

◆ covariance()

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

Implements LArSamples::AbsShape.

Definition at line 75 of file Data.cxx.

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

◆ 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

◆ 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 86 of file Data.cxx.

87{
88 double adc2mev = adc2MeV();
89 if (adc2mev < 0) return 0;
90 return covariance(i,j)*adc2mev*adc2mev; // we use time-translation-invariant correlations...
91 //return (i == j ? m_corrs[0] : 0); // temporary
92}
double adc2MeV() const
Definition Data.h:126
double covariance(unsigned int i, unsigned int j) const
Definition Data.cxx:75

◆ delta()

double Data::delta ( short sample) const

Definition at line 427 of file Data.cxx.

428{
429 double val = 0;
430 if (!m_history || !m_history->delta(m_index, sample, val)) return -9999;
431 return val;
432}

◆ deltas()

TVectorD Data::deltas ( ) const

Definition at line 411 of file Data.cxx.

412{
413 if (!m_history) return TVectorD();
414 return m_history->deltas(m_index);
415}

◆ description()

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

Definition at line 514 of file Data.cxx.

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

◆ dissolve()

const DataContainer * Data::dissolve ( )

Definition at line 56 of file Data.cxx.

57{
58 const DataContainer* container = new DataContainer(*m_container);
59 delete this;
60 return container;
61}

◆ energy()

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

Definition at line 108 of file Data.h.

108{ 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 95 of file Data.h.

95{ return m_eventData; }

◆ febError()

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

Definition at line 111 of file Data.cxx.

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

◆ 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 138 of file Data.h.

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

◆ gain()

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

Definition at line 85 of file Data.h.

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

◆ gainStr()

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

Definition at line 505 of file Data.cxx.

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

◆ goodForShapeCorr()

bool Data::goodForShapeCorr ( ) const

Definition at line 535 of file Data.cxx.

536{
537 if (adcMax() < 0) return false;
538
539 CaloId caloId = (m_history ? m_history->cellInfo()->calo() : UNKNOWN_CALO);
540 //short layer = (m_history ? m_history->cellInfo()->layer() : -1);
541
542 //if (Id::matchCalo(caloId, FCAL) && energy()/noise() < 250) return false;
543 if (Id::matchCalo(caloId, FCAL)) return false;
544 if (Id::matchCalo(caloId, HEC) && energy()/noise() < 20) return false;
545 if (Id::matchCalo(caloId, EMEC_INNER) && energy()/noise() < 250) return false;
546 if (Id::matchCalo(caloId, EMEC_OUTER) && energy()/noise() < 50) return false;
547 if (Id::matchCalo(caloId, EMB) && energy()/noise() < 30) return false;
548
549 if (Id::matchCalo(caloId, HEC)) {
550 if (TMath::Abs(ofcTime()) > 10) return false;
551 }
552 else {
553 if (TMath::Abs(ofcTime()) > 5) return false;
554 }
555
556 return true;
557}
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 165 of file Data.h.

165{ return m_history; }

◆ index()

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

Definition at line 166 of file Data.h.

166{ 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 106 of file Data.cxx.

107{
108 return ((status() >> 16) & 0x1) != 0;
109}

◆ isPassed()

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

Definition at line 529 of file Data.cxx.

530{
531 return (eventData() ? eventData()->isPassed(bitName) : false);
532}

◆ isValid()

bool Data::isValid ( ) const

Definition at line 154 of file Data.cxx.

155{
156 if (!m_container) return false;
157 if (!container().isValid()) return false;
158 return true;
159}
bool isValid() const
Definition Data.cxx:154

◆ 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 162 of file Data.cxx.

163{
164 int maxPos = maxPosition();
165 if (maxPos >= 0) return sample(maxPos);
166 return -1;
167}

◆ 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 125 of file Data.h.

125{ 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 169 of file Data.cxx.

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

◆ 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 149 of file Data.h.

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

◆ noise()

double Data::noise ( ) const

Definition at line 64 of file Data.cxx.

65{
66 return (m_container->corrs().empty() ? 0 : TMath::Sqrt(m_container->corrs()[0]));
67}

◆ nPoints()

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

Implements LArSamples::AbsShape.

Definition at line 144 of file Data.h.

144{ return nSamples(); }

◆ nSamples()

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

Definition at line 88 of file Data.h.

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

◆ ofcTime()

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

Definition at line 111 of file Data.h.

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

◆ pedestal()

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

Definition at line 117 of file Data.h.

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

◆ pedestalRMS()

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

Definition at line 118 of file Data.h.

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

◆ pedestalSubtractedSample()

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

Definition at line 92 of file Data.h.

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

◆ pedestalSubtractedSamples()

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

Definition at line 95 of file Data.cxx.

96{
97 std::vector<float> samples;
98
99 for (unsigned int i = 0; i < nSamples(); i++)
100 samples.push_back(pedestalSubtractedSample(i));
101
102 return samples;
103}

◆ problems()

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

Definition at line 135 of file Data.cxx.

136{
137 if (isDisconnected()) return "DISCONNECTED";
138
139/*
140 TString problems = "";
141 for (CaloBadChannel::CALOPROBLEM pb = CaloBadChannel::DEAD; pb < CaloBadChannel::NPB; pb = CaloBadChannel::CALOPROBLEM(pb + 1))
142 if (problem(pb)) {
143 if (problems != "") problems += " ";
144 problems += str(pb);
145 }
146*/
147
148 TString problems = "";
149 if (problems =="" && sayNone) problems = "None";
150 return problems;
151}
bool isDisconnected() const
Definition Data.cxx:106

◆ quality()

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

Definition at line 114 of file Data.h.

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

◆ referenceShape()

SimpleShape * Data::referenceShape ( ) const

Definition at line 183 of file Data.cxx.

184{
185 if (!m_history) return nullptr;
186 return m_history->referenceShape(m_index);
187}

◆ 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 443 of file Data.cxx.

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

◆ residual()

double Data::residual ( short sample) const

Definition at line 435 of file Data.cxx.

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

◆ residualError()

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

Definition at line 489 of file Data.cxx.

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

◆ residualOffset()

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

Definition at line 451 of file Data.cxx.

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

◆ residuals()

TVectorD Data::residuals ( ) const

Definition at line 418 of file Data.cxx.

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

◆ 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 91 of file Data.h.

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

◆ scaledErrorData()

const ScaledErrorData * Data::scaledErrorData ( ) const

Definition at line 190 of file Data.cxx.

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

◆ setCallBacks()

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

Definition at line 272 of file Data.h.

◆ setTimeShift()

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

Definition at line 276 of file Data.h.

276{ m_timeShift = shift; }

◆ status()

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

Definition at line 121 of file Data.h.

121{ return m_container->status(); }

◆ str()

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

Definition at line 116 of file Data.cxx.

117{
118 if (error == LArFebErrorSummary::Parity) return "Parity";
119 if (error == LArFebErrorSummary::BCID) return "BCID";
120 if (error == LArFebErrorSummary::SampleHeader) return "SampleHeader";
121 if (error == LArFebErrorSummary::EVTID) return "EVTID";
122 if (error == LArFebErrorSummary::ScacStatus) return "ScacStatus";
123 if (error == LArFebErrorSummary::ScaOutOfRange) return "ScaOutOfRange";
124 if (error == LArFebErrorSummary::GainMismatch) return "GainMismatch";
125 if (error == LArFebErrorSummary::TypeMismatch) return "TypeMismatch";
126 if (error == LArFebErrorSummary::NumOfSamples) return "NumOfSamples";
127 if (error == LArFebErrorSummary::EmptyDataBlock) return "EmptyDataBlock";
128 if (error == LArFebErrorSummary::DspBlockSize) return "DspBlockSize";
129 if (error == LArFebErrorSummary::CheckSum) return "CheckSum";
130 if (error == LArFebErrorSummary::MissingHeader) return "MissingHeader";
131 return "";
132}

◆ time()

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

Implements LArSamples::AbsShape.

Definition at line 145 of file Data.h.

◆ timeAlignedShape()

SimpleShape * Data::timeAlignedShape ( ) const

Definition at line 177 of file Data.cxx.

178{
179 return new SimpleShape(*this, 1, -ofcTime());
180}

◆ timeClCorr()

double Data::timeClCorr ( ) const

Definition at line 603 of file Data.cxx.

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

◆ timeECorr()

double Data::timeECorr ( ) const

Definition at line 629 of file Data.cxx.

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

◆ timeShift()

double LArSamples::Data::timeShift ( )
inlinestatic

Definition at line 275 of file Data.h.

275{ return m_timeShift; }

◆ upstreamEnergy()

double Data::upstreamEnergy ( ) const

Definition at line 559 of file Data.cxx.

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

◆ value()

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

Implements LArSamples::AbsShape.

Definition at line 146 of file Data.h.

146{ 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 459 of file Data.cxx.

460{
461 if (!m_history) return -999;
462 //njpb don't see the point of next line, commenting out
463 //if (g != CaloGain::UNKNOWNGAIN && type != RingShapeError) type = CellShapeError;
464 const ShapeErrorData* sed = m_history->shapeErrorData(g == CaloGain::UNKNOWNGAIN ? gain() : g, type);
465 if (!sed) return -999;
466 double val = (sed->isInRange(sample) ? (xip ? sed->xip()(sample) : sed->xi()(sample)) : -999);
467 delete sed;
468 return val;
469}
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 472 of file Data.cxx.

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

◆ xip()

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

Definition at line 483 of file Data.cxx.

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

◆ DataTweaker

friend class DataTweaker
friend

Definition at line 273 of file Data.h.

Member Data Documentation

◆ m_container

const DataContainer* const LArSamples::Data::m_container
private

Definition at line 281 of file Data.h.

◆ m_eventData

const EventData* const LArSamples::Data::m_eventData
private

Definition at line 282 of file Data.h.

◆ m_history

const History* LArSamples::Data::m_history
mutableprivate

Definition at line 283 of file Data.h.

◆ m_index

unsigned int LArSamples::Data::m_index
mutableprivate

Definition at line 284 of file Data.h.

◆ m_timeShift

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

Definition at line 285 of file Data.h.

285{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: