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 ()
std::unique_ptr< SimpleShapereferenceShape () const
std::unique_ptr< SimpleShapetimeAlignedShape () const
std::unique_ptr< 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 Member Functions

const CellInfocellInfo () const

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

279{
280 double k, dT;
281 if (!calcAdjust(k, dT)) return -9999;
282 return dT;
283}
bool calcAdjust(double &k, double &dT) const
Definition Data.cxx:266

◆ _adjScale()

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

Definition at line 286 of file Data.cxx.

287{
288 double k, dT;
289 if (!calcAdjust(k, dT)) return -1;
290 return k;
291}

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

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

◆ _channel()

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

Definition at line 343 of file Data.cxx.

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

◆ _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:194

◆ _chi2_cellCorr()

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

Definition at line 215 of file Data.cxx.

216{
217 if (!m_history) return 0;
218 return m_history->chi2(m_index, -1, -1, DefaultChi2, CellShapeError);
219}
@ DefaultChi2
Definition Chi2Calc.h:24

◆ _chi2_k()

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

Definition at line 222 of file Data.cxx.

223{
224 if (!m_history) return 0;
225 return m_history->chi2_k(m_index, args.x1);
226}

◆ _chi2_noCorr()

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

Definition at line 201 of file Data.cxx.

202{
203 if (!m_history) return 0;
204 return m_history->chi2(m_index, -1, -1, DefaultChi2, NoShapeError);
205}

◆ _chi2_ringCorr()

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

Definition at line 208 of file Data.cxx.

209{
210 if (!m_history) return 0;
211 return m_history->chi2(m_index, -1, -1, DefaultChi2, RingShapeError);
212}

◆ _chi2Anomaly()

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

Definition at line 604 of file Data.cxx.

605{
606 if (!m_history) return -1;
607 return m_history->chi2Anomaly(args.x1);
608}

◆ _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:420

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

399{
400 return energy()/noise();
401}
double noise() const
Definition Data.cxx:71

◆ _eta()

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

Definition at line 504 of file Data.cxx.

504 {
505 if (auto ci = cellInfo(); !ci)[[unlikely]] return 0.;
506 else return ci->eta();
507}
const CellInfo * cellInfo() const
Definition Data.h:281
#define unlikely(x)

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

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

◆ _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:544

◆ _hash()

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

Definition at line 350 of file Data.cxx.

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

◆ _iEta()

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

Definition at line 294 of file Data.cxx.

295{
296 if (!m_history) return 0;
297 return m_history->cellInfo()->iEta();
298}

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

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

◆ _layer()

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

Definition at line 322 of file Data.cxx.

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

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

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

◆ _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:480

◆ _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:444

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

586{
587 double result = -9999;
588 if (!m_history) return result;
589 std::unique_ptr<OFC> ofc = m_history->ofc(m_index);
590 if (ofc->isInRange(args.i1) && ofc->isInRange(args.i2))
591 result = ofc->Gamma()(args.i1, args.i2);
592 return result;
593}

◆ _ofcSigma()

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

Definition at line 574 of file Data.cxx.

575{
576 double result = -9999;
577 if (!m_history) return result;
578 std::unique_ptr<OFC> ofc = m_history->ofc(m_index);
579 if (ofc->isInRange(args.i1))
580 result = TMath::Sqrt(ofc->Gamma()(args.i1, args.i1));
581 return result;
582}

◆ _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:538

◆ _peakSignif()

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

Definition at line 392 of file Data.cxx.

393{
394 return maxValue()/pedestalRMS();
395}
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 508 of file Data.cxx.

508 {
509 if (auto ci = cellInfo(); !ci)[[unlikely]] return 0.;
510 else return ci->phi();
511}

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

259{
260 double chi2, k, dT;
261 if (!calcRefit(chi2, k, dT)) return -1;
262 return chi2;
263}
bool calcRefit(double &chi2, double &k, double &dT) const
Definition Data.cxx:229

◆ _refitDeltaT()

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

Definition at line 242 of file Data.cxx.

243{
244 double chi2, k, dT;
245 if (!calcRefit(chi2, k, dT)) return -9999;
246 return dT;
247}

◆ _refitScale()

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

Definition at line 250 of file Data.cxx.

251{
252 double chi2, k, dT;
253 if (!calcRefit(chi2, k, dT)) return -1;
254 return k;
255}

◆ _region()

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

Definition at line 308 of file Data.cxx.

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

◆ _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:436

◆ _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:428

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

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

◆ _rt()

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

Definition at line 500 of file Data.cxx.

500 {
501 if (auto ci = cellInfo(); !ci)[[unlikely]] return 0.;
502 else return ci->rt();
503}

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

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

◆ _timeECorr()

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

Definition at line 649 of file Data.cxx.

650{
651 // Modify this to add Isabelle's correction
652 return ofcTime();
653}

◆ _timeForSplash1()

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

Definition at line 378 of file Data.cxx.

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

◆ _timeForSplash2()

double Data::_timeForSplash2 ( 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}

◆ _timeNoTOF()

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

Definition at line 371 of file Data.cxx.

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

◆ _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:568

◆ _upstreamERatio()

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

Definition at line 596 of file Data.cxx.

597{
598 double upe = upstreamEnergy();
599 if (upe < 0 || energy() == 0) return -1;
600 return upe/energy();
601}

◆ _x()

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

Definition at line 488 of file Data.cxx.

488 {
489 if (auto ci = cellInfo(); !ci)[[unlikely]] return 0.;
490 else return ci->position().X();
491}

◆ _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:452

◆ _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:464

◆ _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:474

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

492 {
493 if (auto ci = cellInfo(); !ci)[[unlikely]] return 0.;
494 else return ci->position().Y();
495}

◆ _z()

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

Definition at line 496 of file Data.cxx.

496 {
497 if (auto ci = cellInfo(); !ci)[[unlikely]] return 0.;
498 else return ci->position().Z();
499}

◆ 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.

30{ return eventData().bunchId(); }
unsigned int bunchId() const
Definition EventData.h:50

◆ calcAdjust()

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

Definition at line 266 of file Data.cxx.

267{
268 if (!m_history) return false;
269 std::unique_ptr<OFC> ofc = m_history->ofc(m_index);
270 if (!ofc) return false;
271
272 k = ofc->A(*this)/adcMax();
273 dT = ofc->time(*this);
274 return true;
275}

◆ calcRefit()

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

Definition at line 229 of file Data.cxx.

230{
231 ShapeFitter fitter;
232 std::unique_ptr<SimpleShape> reference = referenceShape();
233 if (!reference){
234 return false;
235 }
236 std::unique_ptr<const ScaledErrorData> sed (scaledErrorData());
237 bool result = fitter.fit(*this, *reference, k, dT, chi2, sed.get());
238 return result;
239}
std::unique_ptr< SimpleShape > referenceShape() const
Definition Data.cxx:180
std::unique_ptr< const ScaledErrorData > scaledErrorData() const
Definition Data.cxx:187
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

◆ cellInfo()

const CellInfo * LArSamples::Data::cellInfo ( ) const
inlineprivate

Definition at line 281 of file Data.h.

281{return m_history?m_history->cellInfo():nullptr;}

◆ chi2()

double Data::chi2 ( ) const

Definition at line 194 of file Data.cxx.

195{
196 if (!m_history) return 0;
197 return m_history->chi2(m_index);
198}

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

421{
422 double val = 0;
423 if (!m_history || !m_history->delta(m_index, sample, val)) return -9999;
424 return val;
425}

◆ deltas()

TVectorD Data::deltas ( ) const

Definition at line 404 of file Data.cxx.

405{
406 if (!m_history) return TVectorD();
407 return m_history->deltas(m_index);
408}

◆ description()

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

Definition at line 523 of file Data.cxx.

524{
525 TString desc = "";
526 desc += Form("%d samples, ", nSamples());
527 desc += "gain = " + gainStr(gain()) + ", ";
528 desc += Form("energy = %6.1f MeV, ", energy());
529 if (verbosity >= 2) desc += Form("ADCMax = %6.1f, ", adcMax());
530 desc += Form("time = %6.1f ns, ", ofcTime());
531 if (verbosity >= 2) desc += Form("chi^2/n = %6.1f, ", chi2());
532 desc += Form("run = %d, event = %d, ", run(), event());
533 desc += Form("problems = %s", problems(true).Data());
534 return desc;
535}
@ Data
Definition BaseObject.h:11
static TString gainStr(CaloGain::CaloGain gain)
Definition Data.cxx:514
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.

28{ return eventData().event(); }
int event() const
Definition EventData.h:44

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

515{
516 if (gain == CaloGain::LARHIGHGAIN) return "HIGH";
517 if (gain == CaloGain::LARMEDIUMGAIN) return "MEDIUM";
518 if (gain == CaloGain::LARLOWGAIN) return "LOW";
519 return "";
520}
@ LARMEDIUMGAIN
Definition CaloGain.h:18
@ LARLOWGAIN
Definition CaloGain.h:18
@ LARHIGHGAIN
Definition CaloGain.h:18

◆ goodForShapeCorr()

bool Data::goodForShapeCorr ( ) const

Definition at line 544 of file Data.cxx.

545{
546 if (adcMax() < 0) return false;
547
548 CaloId caloId = (m_history ? m_history->cellInfo()->calo() : UNKNOWN_CALO);
549 //short layer = (m_history ? m_history->cellInfo()->layer() : -1);
550
551 //if (Id::matchCalo(caloId, FCAL) && energy()/noise() < 250) return false;
552 if (Id::matchCalo(caloId, FCAL)) return false;
553 if (Id::matchCalo(caloId, HEC) && energy()/noise() < 20) return false;
554 if (Id::matchCalo(caloId, EMEC_INNER) && energy()/noise() < 250) return false;
555 if (Id::matchCalo(caloId, EMEC_OUTER) && energy()/noise() < 50) return false;
556 if (Id::matchCalo(caloId, EMB) && energy()/noise() < 30) return false;
557
558 if (Id::matchCalo(caloId, HEC)) {
559 if (TMath::Abs(ofcTime()) > 10) return false;
560 }
561 else {
562 if (TMath::Abs(ofcTime()) > 5) return false;
563 }
564
565 return true;
566}
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 538 of file Data.cxx.

539{
540 return eventData().isPassed(bitName);
541}
bool isPassed(const TString &bitName) const
Definition EventData.cxx:88

◆ isValid()

bool Data::isValid ( ) const

Definition at line 151 of file Data.cxx.

152{
153 if (!m_container) return false;
154 if (!container().isValid()) return false;
155 return true;
156}
bool isValid() const
Definition Data.cxx:151

◆ lumiBlock()

int Data::lumiBlock ( ) const
Returns
lumi block

Definition at line 29 of file Data.cxx.

29{ return eventData().lumiBlock(); }
unsigned int lumiBlock() const
Definition EventData.h:47

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

160{
161 int maxPos = maxPosition();
162 if (maxPos >= 0) return sample(maxPos);
163 return -1;
164}

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

167{
168 int minPos = minPosition();
169 if (minPos >= 0) return sample(minPos);
170 return -1;
171}

◆ 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 TString problems{};
146 if (sayNone) problems = "None";
147 return problems;
148}
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()

std::unique_ptr< SimpleShape > Data::referenceShape ( ) const

Definition at line 180 of file Data.cxx.

181{
182 if (!m_history) return nullptr;
183 return m_history->referenceShape(m_index);
184}

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

437{
438 if (!m_history) return -999;
439 std::unique_ptr<const ShapeErrorData> sed = m_history->shapeErrorData(gain(), type);
440 return (sed ? sed->n() : 0);
441}

◆ residual()

double Data::residual ( short sample) const

Definition at line 428 of file Data.cxx.

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

◆ residualError()

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

Definition at line 480 of file Data.cxx.

481{
482 double val = 0;
483 if (!m_history || !m_history->residualError(m_index, sample1, sample2, val, scale)) return -9999;
484 return val;
485}

◆ residualOffset()

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

Definition at line 444 of file Data.cxx.

445{
446 double val = 0;
447 if (!m_history || !m_history->residualOffset(m_index, sample, val, (scale ? -1 : 1))) return -9999;
448 return val;
449}

◆ residuals()

TVectorD Data::residuals ( ) const

Definition at line 411 of file Data.cxx.

412{
413 if (!m_history || adcMax() < 0) return TVectorD();
414 TVectorD resv = m_history->deltas(m_index);
415 for (int i = 0; i < resv.GetNrows(); i++) resv(i) /= adcMax();
416 return resv;
417}

◆ 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()

std::unique_ptr< const ScaledErrorData > Data::scaledErrorData ( ) const

Definition at line 187 of file Data.cxx.

188{
189 if (!m_history) return nullptr;
190 return m_history->scaledErrorData(m_index);
191}

◆ 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; }
virtual void shift(size_t pos, ptrdiff_t offs) override
Shift the elements of the container.

◆ 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()

std::unique_ptr< SimpleShape > Data::timeAlignedShape ( ) const

Definition at line 174 of file Data.cxx.

175{
176 return std::make_unique<SimpleShape>(*this, 1, -ofcTime());
177}

◆ timeClCorr()

double Data::timeClCorr ( ) const

Definition at line 610 of file Data.cxx.

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

◆ timeECorr()

double Data::timeECorr ( ) const

Definition at line 636 of file Data.cxx.

637{
638 if (!m_history) return -9999.;
639 Double_t timeCorr=-99.;
640
641 // Int_t calo = m_history->cellInfo()->calo();
642 // Double_t p0, p1, p2, p3;
643
644 timeCorr=ofcTime();
645
646 return timeCorr;
647}

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

569{
570 if (!m_history) return -1;
571 return m_history->upstreamEnergy(m_index);
572}

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

453{
454 if (!m_history) return -999;
455 //njpb don't see the point of next line, commenting out
456 //if (g != CaloGain::UNKNOWNGAIN && type != RingShapeError) type = CellShapeError;
457 std::unique_ptr<const ShapeErrorData> sed = m_history->shapeErrorData(g == CaloGain::UNKNOWNGAIN ? gain() : g, type);
458 if (!sed) return -999;
459 double val = (sed->isInRange(sample) ? (xip ? sed->xip()(sample) : sed->xi()(sample)) : -999);
460 return val;
461}
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 464 of file Data.cxx.

465{
466 if (!m_history) return -1;
467 std::unique_ptr<const ShapeErrorData> sed = m_history->shapeErrorData(gain(), type);
468 if (!sed) return -1;
469 double val = TMath::Sqrt(sed->xi().Norm2Sqr());
470 return val;
471}

◆ xip()

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

Definition at line 474 of file Data.cxx.

475{
476 return xi(sample, type, g, true);
477}

◆ 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.

285{};

◆ m_index

unsigned int LArSamples::Data::m_index {}
mutableprivate

Definition at line 286 of file Data.h.

286{};

◆ 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: