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

#include <Interface.h>

Inheritance diagram for LArSamples::Interface:
Collaboration diagram for LArSamples::Interface:

Public Member Functions

 Interface (const Accessor &accessor)
 Constructor.
virtual ~Interface ()
unsigned int nEvents () const
unsigned int nRuns () const
const EventDataeventData (unsigned int i) const
const RunDatarunData (unsigned int i) const
unsigned int historySize (unsigned int i) const
unsigned int historySizeSC (unsigned int i) const
HistoryIterator begin (unsigned int pos=0, double eMin=-1, double adcMaxMin=-1) const
unsigned int end () const
unsigned int size () const
unsigned int nFilledChannels () const
void printFilledRanges (unsigned int skip=0) const
bool highEData (double eCut, TArrayI &hashes, TArrayI &indices) const
HistoryIterator findEtaPhi (CaloId calo, short layer, short iEta, short iPhi, short region=0) const
HistoryIterator findFebChannel (CaloId calo, short feb, short channel) const
HistoryIterator findFTSlotChannel (CaloId calo, short ft, short slot, short channel) const
bool neighbors (const CellInfo &cell, double dRCut, std::vector< unsigned int > &hashes) const
bool firstNeighbors (unsigned int hash, std::vector< unsigned int > &hashes, short layer=-2) const
bool data (const std::vector< unsigned int > &hashes, const EventData &event, std::vector< const Data * > &data) const
Interfacemerge (const Interface &other, const TString &fileName) const
Interfacemerge (const Interface &other, const TString &fileName, const TString &LBFile) const
Interfacefilter (const TString &sel, const TString &fileName, const TString &tweaks="") const
Interfacefilter (const FilterParams &filterParams, const DataTweaker &tweaker, const TString &fileName) const
InterfacemakeTemplate (const TString &fileName) const
Interfacerefit (const TString &newFileName, Chi2Params pars=DefaultChi2) const
const Accessoraccessor () const
bool isValid () const
TH1D * Draw (const TString &var, int nBins, double xMin, double xMax, const TString &sel="", const TString &opt="") const
TH2D * Draw (const TString &varList, int nBinsX, double xMin, double xMax, int nBinsY, double yMin, double yMax, const TString &sel="", const TString &opt="") const
TH2D * DrawPartition (PartitionId partition, const TString &var, const TString &sel="", const TString &opt="", CombinationType comb=TotalValue) const
TH2D * DrawEtaPhi (CaloId calo, short layer, const TString &var, const TString &sel="", const TString &opt="", CombinationType comb=TotalValue) const
bool Scan (const TString &vars, const TString &sel="", unsigned int verbosity=1) const
bool Scan (const TString &vars, CombinationType comb, const TString &sel="", const TString &ranges="", unsigned int verbosity=1) const
bool Show (unsigned int hash, unsigned int verbosity=1) const
bool Show (const TString &sel="", unsigned int verbosity=1) const
bool ShowEvents (const TString &sel="", unsigned int verbosity=1) const
bool ShowRuns (unsigned int verbosity=1) const
bool ShowStats (const TString &varList, const TString &sel="", bool withErrors=false) const
OccupancyMonitor occupancyMonitor () const
DigitMonitor digitMonitor () const
FitMonitor fitMonitor () const
bool dumpEventTuple (const TString &variables, const TString &fileName) const
void setShapeErrorGetter (const AbsShapeErrorGetter *err)
void setShapeError (double k)
void setShapeError (const TString &fileName)
const AbsShapeErrorGettershapeErrorGetter () const
bool writeToFile (const TString &fileName) const
const HistorycellHistory (unsigned int i) const
const HistorygetCellHistory (unsigned int i) const
const HistorygetSCHistory (unsigned int i) const
const CellInfogetCellInfo (unsigned int i) const
virtual const HistorynewCellHistory (unsigned int i) const
virtual const CellInfocellInfo (unsigned int i) const
virtual unsigned int nChannels () const
virtual unsigned int nChannelsSC () const
virtual void resetCache () const
const CellInfocellInfoCache (unsigned int i) const
const Historypass (unsigned int i, const FilterParams &f) const
const HistorycellCache () const
unsigned int cachePos () const
void resetCellInfoCache ()

Static Public Member Functions

static Interfaceopen (const TString &fileName)
static Interfaceopen (const std::vector< TString > &fileNames)
static InterfaceopenList (const TString &fileList)
static InterfaceopenWild (const TString &wcName)
static Interfacemerge (const std::vector< const Interface * > &interfaces, const TString &fileName)
static Interfacemerge (const std::vector< const Interface * > &interfaces, const TString &fileName, const TString &LBFile)
static Interfacemerge (const TString &listFileName, const TString &fileName)
static Interfacemerge (const TString &listFileName, const TString &fileName, const TString &LBFile)
static bool filterAndMerge (const TString &listFileName, const TString &outFile, const TString &filters, const TString &tweaks="")
static TString addSuffix (const TString &fileName, const TString &suffix)

Private Attributes

const Accessorm_accessor
const AbsShapeErrorGetterm_shapeErrorGetter
bool m_ownShapeErrorGetter
std::vector< std::vector< unsigned int > * > m_neighborCache
std::vector< unsigned int > m_neighborHistoryPos
std::vector< const History * > m_neighborHistories
unsigned int m_pos
const Historym_cellCache
std::vector< CellInfo * > m_cellInfoCache

Detailed Description

Definition at line 36 of file Interface.h.

Constructor & Destructor Documentation

◆ Interface()

LArSamples::Interface::Interface ( const Accessor & accessor)
inline

Constructor.

Definition at line 41 of file Interface.h.

virtual unsigned int nChannels() const
Definition AbsLArCells.h:34
const Accessor & accessor() const
Definition Interface.h:94
const AbsShapeErrorGetter * m_shapeErrorGetter
Definition Interface.h:137
std::vector< std::vector< unsigned int > * > m_neighborCache
Definition Interface.h:140
const Accessor * m_accessor
Definition Interface.h:136

◆ ~Interface()

Interface::~Interface ( )
virtual

Definition at line 63 of file Interface.cxx.

64{
66 delete m_accessor;
67
68 for (std::vector<unsigned int>* neighbors : m_neighborCache)
69 delete neighbors;
70}
bool neighbors(const CellInfo &cell, double dRCut, std::vector< unsigned int > &hashes) const

Member Function Documentation

◆ accessor()

const Accessor & LArSamples::Interface::accessor ( ) const
inline

Definition at line 94 of file Interface.h.

94{ return *m_accessor; }

◆ addSuffix()

TString Interface::addSuffix ( const TString & fileName,
const TString & suffix )
static

Definition at line 382 of file Interface.cxx.

383{
384 TString rootName = fileName;
385 if (fileName(fileName.Length() - 5, 5) == ".root") rootName = fileName(0, fileName.Length() - 5);
386
387 return rootName + "_" + suffix + ".root";
388}

◆ begin()

HistoryIterator Interface::begin ( unsigned int pos = 0,
double eMin = -1,
double adcMaxMin = -1 ) const

Definition at line 182 of file Interface.cxx.

183{
184 return HistoryIterator(*this, pos, eMin, adcMaxMin);
185}

◆ cachePos()

unsigned int LArSamples::AbsLArCells::cachePos ( ) const
inlineinherited

Definition at line 48 of file AbsLArCells.h.

48{ return m_pos; }

◆ cellCache()

const History * LArSamples::AbsLArCells::cellCache ( ) const
inlineinherited

Definition at line 47 of file AbsLArCells.h.

47{ return m_cellCache; }
const History * m_cellCache
Definition AbsLArCells.h:55

◆ cellHistory()

const History * Interface::cellHistory ( unsigned int i) const
virtual

Reimplemented from LArSamples::AbsLArCells.

Definition at line 125 of file Interface.cxx.

126{
127 const History* history = accessor().cellHistory(i);
128 if (history) {
130 history->setInterface(this);
131 }
132 return history;
133}
virtual const History * cellHistory(unsigned int i) const
void setShapeErrorGetter(const AbsShapeErrorGetter *err) const
Definition History.h:87
void setInterface(const Interface *interface) const
Definition History.h:107

◆ cellInfo()

const CellInfo * AbsLArCells::cellInfo ( unsigned int i) const
virtualinherited

Definition at line 71 of file AbsLArCells.cxx.

72{
73 const CellInfo* info = cellInfoCache(i);
74 if (info) return (info->isValid() ? new CellInfo(*info) : nullptr);
75 info = getCellInfo(i);
76 if (info) m_cellInfoCache[i] = new CellInfo(*info, false);
77 //m_cellInfoCache[i] = (info ? new CellInfo(*info, false) : new CellInfo());
78 return info;
79}
std::vector< CellInfo * > m_cellInfoCache
Definition AbsLArCells.h:56
virtual const CellInfo * getCellInfo(unsigned int i) const
const CellInfo * cellInfoCache(unsigned int i) const

◆ cellInfoCache()

const CellInfo * AbsLArCells::cellInfoCache ( unsigned int i) const
inherited

Definition at line 82 of file AbsLArCells.cxx.

83{
84 return m_cellInfoCache[i];
85}

◆ data()

bool Interface::data ( const std::vector< unsigned int > & hashes,
const EventData & event,
std::vector< const Data * > & data ) const

Definition at line 770 of file Interface.cxx.

771{
772 if (hashes != m_neighborHistoryPos) {
773 for (const History* history : m_neighborHistories)
774 delete history;
775 m_neighborHistories.clear();
776 m_neighborHistoryPos.clear();
777 for (std::vector<unsigned int>::const_iterator hash = hashes.begin(); hash != hashes.end(); ++hash) {
778 const History* history = AbsLArCells::newCellHistory(*hash);// bypasses history caching in order not to invalidate cell
779 m_neighborHistories.push_back(history);
780 m_neighborHistoryPos.push_back(*hash);
781 }
782 }
783
784 for (const History* history : m_neighborHistories) {
785 if (!history) continue;
786 const Data* dataForEvent = history->data_for_event(event);
787 if (dataForEvent) data.push_back(new Data(*dataForEvent));
788 }
789 return true;
790}
@ Data
Definition BaseObject.h:11
virtual const History * newCellHistory(unsigned int i) const
const Data * data_for_event(int event, int run=-1) const
Definition History.cxx:98
std::vector< unsigned int > m_neighborHistoryPos
Definition Interface.h:141
bool data(const std::vector< unsigned int > &hashes, const EventData &event, std::vector< const Data * > &data) const
std::vector< const History * > m_neighborHistories
Definition Interface.h:142

◆ digitMonitor()

DigitMonitor LArSamples::Interface::digitMonitor ( ) const
inline

Definition at line 115 of file Interface.h.

115{ return DigitMonitor(*this); }

◆ Draw() [1/2]

TH1D * Interface::Draw ( const TString & var,
int nBins,
double xMin,
double xMax,
const TString & sel = "",
const TString & opt = "" ) const

Definition at line 463 of file Interface.cxx.

464{
465 MonitorBase m(*this);
466 FilterParams f;
467 if (!f.set(sel)) return nullptr;
468
469 std::vector<TString> vars;
470 std::vector<DataFuncSet> funcs;
471 std::vector<DataFuncArgs> args;
472 if (!MonitorBase::parseVariables(var, vars, funcs, args) || funcs.size() != 1) {
473 cout << "Invalid variable specification " << var << endl;
474 return nullptr;
475 }
476
477 TString title = vars[0];
478 if (TString(sel) != "") title = title + ", " + sel;
479
480 TH1D* h = m.dist(funcs[0], args[0], vars[0], nBins, xMin, xMax,
481 title, vars[0], "digits", f);
482 if (!h) return nullptr;
483 h->Draw(opt);
484 return h;
485}
static bool parseVariables(TString varStr, std::vector< TString > &vars, std::vector< DataFuncSet > &funcs, std::vector< DataFuncArgs > &args)

◆ Draw() [2/2]

TH2D * Interface::Draw ( const TString & varList,
int nBinsX,
double xMin,
double xMax,
int nBinsY,
double yMin,
double yMax,
const TString & sel = "",
const TString & opt = "" ) const

Definition at line 488 of file Interface.cxx.

491{
492 MonitorBase m(*this);
493 FilterParams f;
494 if (!f.set(sel)) return nullptr;
495
496 std::vector<TString> vars;
497 std::vector<DataFuncSet> funcs;
498 std::vector<DataFuncArgs> args;
499 if (!MonitorBase::parseVariables(varList, vars, funcs, args) || funcs.size() != 2) {
500 cout << "Invalid variable specification " << varList << endl;
501 return nullptr;
502 }
503
504 TString title = vars[1] + " vs. " + vars[0];
505
506 if (TString(sel) != "") title = title + ", " + sel;
507 TH2D* h = m.dist(funcs[0], args[0], funcs[1], args[1], vars[0] + "_" + vars[1],
508 nBinsX, xMin, xMax, nBinsY, yMin, yMax,
509 title, vars[0], vars[1], f);
510 if (!h) return nullptr;
511 h->Draw(opt);
512 return h;
513}

◆ DrawEtaPhi()

TH2D * Interface::DrawEtaPhi ( CaloId calo,
short layer,
const TString & var,
const TString & sel = "",
const TString & opt = "",
CombinationType comb = TotalValue ) const

Definition at line 543 of file Interface.cxx.

546{
547 MonitorBase m(*this);
548 FilterParams f;
549 if (!f.set(sel)) return nullptr;
550
551 std::vector<TString> vars;
552 std::vector<DataFuncSet> funcs;
553 std::vector<DataFuncArgs> args;
554 if (!MonitorBase::parseVariables(var, vars, funcs, args) || funcs.size() != 1) {
555 cout << "Invalid variable specification " << var << endl;
556 return nullptr;
557 }
558 TString title = var;
559 title += Form(", %s, layer %d", Id::str(calo).Data(), layer);
560 if (TString(sel) != "") title = title + ", " + sel;
561
562 TH2D* h = m.etaPhiMap(funcs[0], args[0], var, calo, layer, title, comb, f);
563 if (!h) return nullptr;
564 h->Draw(opt);
565 return h;
566}
static TString str(CaloId id)
Definition CaloId.cxx:15

◆ DrawPartition()

TH2D * Interface::DrawPartition ( PartitionId partition,
const TString & var,
const TString & sel = "",
const TString & opt = "",
CombinationType comb = TotalValue ) const

Definition at line 516 of file Interface.cxx.

519{
520 MonitorBase m(*this);
521 FilterParams f;
522 if (!f.set(sel)) return nullptr;
523
524 std::vector<TString> vars;
525 std::vector<DataFuncSet> funcs;
526 std::vector<DataFuncArgs> args;
527 if (!MonitorBase::parseVariables(var, vars, funcs, args) || funcs.size() != 1) {
528 cout << "Invalid variable specification " << var << endl;
529 return nullptr;
530 }
531
532 TString title = var;
533 title = title + ", " + Id::str(partition);
534 if (TString(sel) != "") title = title + ", " + sel;
535
536 TH2D* h = m.partitionMap(funcs[0], args[0], var, partition, title, comb, f);
537 if (!h) return nullptr;
538 h->Draw(opt);
539 return h;
540}

◆ dumpEventTuple()

bool Interface::dumpEventTuple ( const TString & variables,
const TString & fileName ) const

Definition at line 793 of file Interface.cxx.

794{
795 std::vector<float*> floatVars;
796 std::vector<int*> intVars;
797 std::vector<std::vector<float>*> floatVects;
798 std::vector<std::vector<int>*> intVects;
799 std::map<TString, unsigned int> varIndex;
800
801 std::vector<TString> vars;
802 std::vector<DataFuncSet> funcs;
803 std::vector<DataFuncArgs> args;
804 if (!MonitorBase::parseVariables(variables, vars, funcs, args)) return false;
805
806 cout << "Making trees..." << endl;
807
808 TFile* flatFile = TFile::Open(fileName + "_tmpFlatFile.root", "RECREATE");
809 TTree* flatTree = new TTree("flatTree", "Flat tree");
810
811 TFile* eventFile = TFile::Open(fileName, "RECREATE");
812 TTree* eventTree = new TTree("eventTree", "Event tree");
813
814 for (unsigned int j = 0; j < vars.size(); j++) {
815 unsigned int index = 0;
816 if (funcs[j].isNull()) return false;
817 if (funcs[j].isInt()) {
818 int* varCont = new int(0);
819 std::vector<int>* vectCont = new std::vector<int>();
820 index = intVars.size();
821 intVars.push_back(varCont);
822 intVects.push_back(vectCont);
823 flatTree->Branch(vars[j], varCont);
824 eventTree->Branch(vars[j], vectCont);
825 }
826 else {
827 float* varCont = new float(0);
828 std::vector<float>* vectCont = new std::vector<float>();
829 index = floatVars.size();
830 floatVars.push_back(varCont);
831 floatVects.push_back(vectCont);
832 flatTree->Branch(vars[j], varCont);
833 eventTree->Branch(vars[j], vectCont);
834 }
835 varIndex[vars[j]] = index;
836 cout << vars[j] << " -> " << index << endl;
837 }
838 std::map< unsigned int, std::map< unsigned int, std::vector<long long> > > runEventIndices;
839 cout << "Making flat ntuple" << endl;
840 unsigned int count = 0;
841 for (HistoryIterator iter = begin(); iter.isValid(); iter.next()) {
842 const History* hist = iter.history();
843 count++;
844 if (count % 100 == 0) cout << "Processing entry " << count << " (hash = " << iter.pos() << "), size = " << hist->nData() << endl;
845 for (unsigned int k = 0; k < hist->nData(); k++) {
846 for (unsigned int j = 0; j < vars.size(); j++) {
847 if (funcs[j].isInt())
848 *intVars[varIndex[vars[j]]] = int(funcs[j].intVal(*hist->data(k), args[j]));
849 else
850 *floatVars[varIndex[vars[j]]] = funcs[j].doubleVal(*hist->data(k), args[j]);
851 }
852 runEventIndices[hist->data(k)->run()][hist->data(k)->event()].push_back(flatTree->GetEntries());
853 flatTree->Fill();
854 }
855 }
856
857 cout << "Making event tuple" << endl;
858 unsigned int runCount = 0;
859 for (const auto& run : runEventIndices) {
860 runCount++;
861 cout << "Processing run " << run.first << " (" << runCount << " of " << runEventIndices.size() << ")" << endl;
862 unsigned int eventCount = 0;
863 for (const auto& event : run.second) {
864 eventCount++;
865 if (eventCount % 1000 == 0)
866 cout << " processing event " << event.first << " (" << eventCount << " of " << run.second.size() << "), size = " << event.second.size() << endl;
867 for (unsigned int j = 0; j < intVects.size(); j++) intVects[j]->clear();
868 for (unsigned int j = 0; j < floatVects.size(); j++) floatVects[j]->clear();
869 for (long long index : event.second) {
870 flatTree->GetEntry(index);
871 for (unsigned int j = 0; j < vars.size(); j++) {
872 if (funcs[j].isInt())
873 intVects[varIndex[vars[j]]]->push_back(*intVars[varIndex[vars[j]]]);
874 else
875 floatVects[varIndex[vars[j]]]->push_back(*floatVars[varIndex[vars[j]]]);
876 }
877 }
878 eventTree->Fill();
879 }
880 }
881
882 cout << "Writing data..." << endl;
883 flatFile->cd();
884 flatTree->Write();
885 eventFile->cd();
886 eventTree->Write();
887
888 cout << "Cleaning up..." << endl;
889 delete eventTree;
890 delete eventFile;
891
892 delete flatTree;
893 delete flatFile;
894 for (unsigned int j = 0; j < intVects.size(); j++) delete intVects[j];
895 for (unsigned int j = 0; j < floatVects.size(); j++) delete floatVects[j];
896 for (unsigned int j = 0; j < intVars.size(); j++) delete intVars[j];
897 for (unsigned int j = 0; j < floatVars.size(); j++) delete floatVars[j];
898
899 cout << "Done!" << endl;
900 return true;
901}
HistoryIterator begin(unsigned int pos=0, double eMin=-1, double adcMaxMin=-1) const
int count(std::string s, const std::string &regx)
count how many occurances of a regx are in a string
Definition hcg.cxx:146
str index
Definition DeMoScan.py:362

◆ end()

unsigned int LArSamples::Interface::end ( ) const
inline

Definition at line 61 of file Interface.h.

61{ return nChannels(); }

◆ eventData()

const EventData * LArSamples::Interface::eventData ( unsigned int i) const
inlinevirtual

Implements LArSamples::Accessor.

Definition at line 54 of file Interface.h.

54{ return accessor().eventData(i); }
virtual const EventData * eventData(unsigned int i) const =0

◆ filter() [1/2]

Interface * Interface::filter ( const FilterParams & filterParams,
const DataTweaker & tweaker,
const TString & fileName ) const

Definition at line 391 of file Interface.cxx.

392{
393 TreeAccessor* newAcc = TreeAccessor::filter(accessor(), filterParams, fileName, tweaker);
394 return new Interface(*newAcc);
395}
Interface(const Accessor &accessor)
Constructor.
Definition Interface.h:41
static TreeAccessor * filter(const Accessor &accessor, const FilterParams &filterParams, const TString &fileName, const DataTweaker &tweaker)

◆ filter() [2/2]

Interface * Interface::filter ( const TString & sel,
const TString & fileName,
const TString & tweaks = "" ) const

Definition at line 363 of file Interface.cxx.

364{
365 FilterParams f;
366 if (!f.set(sel)) return nullptr;
367
368 DataTweaker tweak;
369 if (!tweak.set(tweaks)) return nullptr;
370
371 TString thisFN = fileName;
372 if (thisFN.Index(".root") < 0 && dynamic_cast<const TreeAccessor*>(&accessor())) {
373 auto pAccess = dynamic_cast<const TreeAccessor*>(&accessor());
374 if (not pAccess) return nullptr;
375 TString newFN = addSuffix(pAccess->fileName(), fileName);
376 if (newFN != "") thisFN = std::move(newFN);
377 }
378 return filter(f, tweak, thisFN);
379}
bool set(const TString &tweaks)
Interface * filter(const TString &sel, const TString &fileName, const TString &tweaks="") const
static TString addSuffix(const TString &fileName, const TString &suffix)

◆ filterAndMerge()

bool Interface::filterAndMerge ( const TString & listFileName,
const TString & outFile,
const TString & filters,
const TString & tweaks = "" )
static

Definition at line 293 of file Interface.cxx.

294{
295 FilterList filterList;
296
297 TObjArray* list = filters.Tokenize(",;");
298 if (list->GetEntries() == 0) {
299 cout << "No filtering specified, exiting.";
300 delete list;
301 return 0;
302 }
303
304 for (int k = 0; k < list->GetEntries(); k++) {
305 TObjString* tobs = (TObjString*)(list->At(k));
306 TObjArray* items = tobs->String().Tokenize(":");
307 if (items->GetEntries() != 2) {
308 cout << "Invalid filter entry " << tobs->String() << ", exiting." << endl;
309 delete list;
310 delete items;
311 return 0;
312 }
313 TString params = ((TObjString*)(items->At(0)))->String();
314 TString suffix = ((TObjString*)(items->At(1)))->String();
315 FilterParams f;
316 if (!f.set(params)) return 0;
317 cout << "---" << endl;
318 filterList.add(f, addSuffix(outFile, suffix));
319 delete items;
320 }
321 delete list;
322
323
324 DataTweaker tweak;
325 if (!tweak.set(tweaks)) return 0;
326
327 Interface* multi = openList(listFileName);
328 if (!multi) return 0;
329 const MultiTreeAccessor* mt = dynamic_cast<const MultiTreeAccessor*>(&multi->accessor());
330 if (!mt){
331 delete multi;
332 return 0;
333 }
334 std::vector<MultiTreeAccessor*> filtered_mts = mt->filterComponents(filterList, tweak);
335 if (filtered_mts.size() != filterList.size()){
336 delete multi;
337 return 0;
338 }
339 delete multi;
340 cout << "Component filtering done!" << endl;
341 // The following line should work, but doesn't... so the block of code below replaces it.
342 //Interface* filtered_multi = new Interface(*filtered_mt);
343 //
344 for (unsigned int f = 0; f < filtered_mts.size(); f++) {
345 std::vector<TString> files;
346 for (unsigned int i = 0; i < filtered_mts[f]->nAccessors(); i++) {
347 files.push_back(((const TreeAccessor*)&filtered_mts[f]->accessor(i))->fileName());
348 cout << "Added " << files.back() << endl;
349 }
350 delete filtered_mts[f];
351 Interface* filtered_multi = open(files);
352 //
353 std::vector<const Interface*> justOne;
354 justOne.push_back(filtered_multi);
355 Interface* interface = merge(justOne, filterList.fileName(f));
356 delete interface;
357 }
358
359 return true;
360}
void add(const FilterParams &params, const TString &fileName)
Definition FilterList.h:27
unsigned int size() const
Definition FilterList.h:29
static Interface * open(const TString &fileName)
Definition Interface.cxx:35
Interface * merge(const Interface &other, const TString &fileName) const
static Interface * openList(const TString &fileList)
Definition Interface.cxx:49
std::vector< MultiTreeAccessor * > filterComponents(const FilterList &filterList, const DataTweaker &tweaker) const
std::vector< std::string > files
file names and file pointers
Definition hcg.cxx:50
list(name, path='/')
Definition histSizes.py:38

◆ findEtaPhi()

HistoryIterator Interface::findEtaPhi ( CaloId calo,
short layer,
short iEta,
short iPhi,
short region = 0 ) const

Definition at line 415 of file Interface.cxx.

416{
417 for (unsigned int i = 0; i < nChannels(); i++) {
418 const CellInfo* info = cellInfo(i);
419 if (!info) continue;
420 if (!Id::matchCalo(info->calo(), calo)) continue;
421 if (info->layer() != layer) continue;
422 if (info->iEta() != iEta) continue;
423 if (info->iPhi() != iPhi) continue;
424 if (info->region() != region) continue;
425 return HistoryIterator(*this, i);
426 }
427
428 return HistoryIterator(*this, end());
429}
virtual const CellInfo * cellInfo(unsigned int i) const
static bool matchCalo(CaloId id, CaloId idSpec)
Definition CaloId.cxx:188
unsigned int end() const
Definition Interface.h:61

◆ findFebChannel()

HistoryIterator Interface::findFebChannel ( CaloId calo,
short feb,
short channel ) const

Definition at line 432 of file Interface.cxx.

433{
434 for (unsigned int i = 0; i < nChannels(); i++) {
435 const CellInfo* info = cellInfo(i);
436 if (!info) continue;
437 if (!Id::matchCalo(info->calo(), calo)) continue;
438 if (info->feb() != feb) continue;
439 if (info->channel() != channel) continue;
440 return HistoryIterator(*this, i);
441 }
442
443 return HistoryIterator(*this, end());
444}

◆ findFTSlotChannel()

HistoryIterator Interface::findFTSlotChannel ( CaloId calo,
short ft,
short slot,
short channel ) const

Definition at line 447 of file Interface.cxx.

448{
449 for (unsigned int i = 0; i < nChannels(); i++) {
450 const CellInfo* info = cellInfo(i);
451 if (!info) continue;
452 if (!Id::matchCalo(info->calo(), calo)) continue;
453 if (ft >= 0 && info->feedThrough() != ft) continue;
454 if (slot >= 0 && info->slot() != slot) continue;
455 if (channel >= 0 && info->channel() != channel) continue;
456 return HistoryIterator(*this, i);
457 }
458
459 return HistoryIterator(*this, end());
460}

◆ firstNeighbors()

bool Interface::firstNeighbors ( unsigned int hash,
std::vector< unsigned int > & hashes,
short layer = -2 ) const

Definition at line 746 of file Interface.cxx.

747{
748 const CellInfo* cell = cellInfo(hash);
749 if (!cell) return true;
750 if (!Id::matchCalo(cell->calo(), HEC)) return false; // for now!
751 if (layer < 0) return true;
752 std::vector<unsigned int> allHashes;
753 const std::vector<unsigned int>* cache = m_neighborCache[hash];
754 if (cache)
755 allHashes = *cache;
756 else {
757 if (!neighbors(*cell, 0.15, allHashes)) return false;
758 m_neighborCache[hash] = new std::vector<unsigned int>(allHashes);
759 }
760 for (unsigned int h : allHashes) {
761 const CellInfo* info = cellInfo(h);
762 if (!info) continue;
763 if (info->layer() == layer) hashes.push_back(h);
764 delete info;
765 }
766 return true;
767}

◆ fitMonitor()

FitMonitor LArSamples::Interface::fitMonitor ( ) const
inline

Definition at line 116 of file Interface.h.

116{ return FitMonitor(*this); }

◆ getCellHistory()

const History * Interface::getCellHistory ( unsigned int i) const
virtual

Implements LArSamples::AbsLArCells.

Definition at line 105 of file Interface.cxx.

106{
107 const History* history = accessor().getCellHistory(i);
108 if (history) {
110 history->setInterface(this);
111 }
112 return history;
113}
virtual const History * getCellHistory(unsigned int i) const =0

◆ getCellInfo()

const CellInfo * Interface::getCellInfo ( unsigned int i) const
virtual

Reimplemented from LArSamples::AbsLArCells.

Definition at line 136 of file Interface.cxx.

137{
138 return accessor().getCellInfo(i);
139}

◆ getSCHistory()

const History * Interface::getSCHistory ( unsigned int i) const
virtual

Implements LArSamples::AbsLArCells.

Definition at line 115 of file Interface.cxx.

116{
117 const History* history = accessor().getSCHistory(i);
118 if (history) {
119 history->setInterface(this);
120 }
121 return history;
122}
virtual const History * getSCHistory(unsigned int i) const =0

◆ highEData()

bool Interface::highEData ( double eCut,
TArrayI & hashes,
TArrayI & indices ) const

Definition at line 188 of file Interface.cxx.

189{
190 std::vector<unsigned int> hashV, indexV;
191 unsigned int nTot = 0;
192
193 for (unsigned int i = 0; i < nChannels(); i++) {
194 const History* history = cellHistory(i);
195 if (!history) continue;
196 for (unsigned int j = 0; j < history->nData(); j++) {
197 const Data& data = *history->data(j);
198 nTot++;
199 if (data.isDisconnected()) continue;
200 if (nTot % 10000 == 0) cout << nTot << endl;
201 if (data.energy() > eCut) {
202 cout << "E = " << data.energy() << " " << i << " " << j << endl;
203 hashV.push_back(i);
204 indexV.push_back(j);
205 }
206 }
207 }
208
209 hashes.Set(hashV.size());
210 indices.Set(indexV.size());
211
212 for (unsigned int i = 0; i < hashV.size(); i++) {
213 hashes[i] = hashV[i];
214 indices[i] = indexV[i];
215 }
216
217 cout << hashV.size() << "/" << nTot << endl;
218 return true;
219}
const Data * data(unsigned int i) const
Definition History.cxx:91
unsigned int nData() const
Definition History.h:51
const History * cellHistory(unsigned int i) const
std::pair< long int, long int > indices

◆ historySize()

unsigned int LArSamples::Interface::historySize ( unsigned int i) const
inlinevirtual

Implements LArSamples::Accessor.

Definition at line 57 of file Interface.h.

57{ return accessor().historySize(i); }
virtual unsigned int historySize(unsigned int i) const =0

◆ historySizeSC()

unsigned int LArSamples::Interface::historySizeSC ( unsigned int i) const
inlinevirtual

Implements LArSamples::Accessor.

Definition at line 58 of file Interface.h.

58{ return accessor().historySizeSC(i); }
virtual unsigned int historySizeSC(unsigned int i) const =0

◆ isValid()

bool Interface::isValid ( ) const

Definition at line 222 of file Interface.cxx.

223{
224 for (unsigned int i = 0; i < nChannels(); i++) {
225 const History* history = cellHistory(i);
226 if (!history) continue;
227 if (!history->isValid()) {
228 cout << "Invalid LArSamplesHistory at hash = " << i << endl;
229 return false;
230 }
231 }
232
233 return true;
234}
bool isValid() const
Definition History.cxx:152

◆ makeTemplate()

Interface * Interface::makeTemplate ( const TString & fileName) const

Definition at line 398 of file Interface.cxx.

399{
400 TreeAccessor* newAcc = TreeAccessor::makeTemplate(accessor(), fileName);
401 return new Interface(*newAcc);
402}
static TreeAccessor * makeTemplate(const Accessor &accessor, const TString &fileName)

◆ merge() [1/6]

Interface * Interface::merge ( const Interface & other,
const TString & fileName ) const

Definition at line 237 of file Interface.cxx.

238{
239 std::vector<const Interface*> interfaces;
240 interfaces.push_back(this);
241 interfaces.push_back(&other);
242 return merge(interfaces, fileName);
243}

◆ merge() [2/6]

Interface * Interface::merge ( const Interface & other,
const TString & fileName,
const TString & LBFile ) const

Definition at line 255 of file Interface.cxx.

256{
257 std::vector<const Interface*> interfaces;
258 interfaces.push_back(this);
259 interfaces.push_back(&other);
260 return merge(interfaces, fileName, LBFile);
261}

◆ merge() [3/6]

Interface * Interface::merge ( const std::vector< const Interface * > & interfaces,
const TString & fileName )
static

Definition at line 246 of file Interface.cxx.

247{
248 std::vector<const Accessor*> accessors;
249 for (unsigned int i = 0; i < interfaces.size(); i++)
250 accessors.push_back(&interfaces[i]->accessor());
251 TreeAccessor* newAccessor = TreeAccessor::merge(accessors, fileName);
252 return new Interface(*newAccessor);
253}
static TreeAccessor * merge(const std::vector< const Accessor * > &accessors, const TString &fileName="")

◆ merge() [4/6]

Interface * Interface::merge ( const std::vector< const Interface * > & interfaces,
const TString & fileName,
const TString & LBFile )
static

Definition at line 264 of file Interface.cxx.

265{
266 std::vector<const Accessor*> accessors;
267 for (unsigned int i = 0; i < interfaces.size(); i++)
268 accessors.push_back(&interfaces[i]->accessor());
269 TreeAccessor* newAccessor = TreeAccessor::merge(accessors, fileName, LBFile);
270 return new Interface(*newAccessor);
271}

◆ merge() [5/6]

Interface * Interface::merge ( const TString & listFileName,
const TString & fileName )
static

Definition at line 274 of file Interface.cxx.

275{
276 Interface* multi = openList(listFileName);
277 if (!multi) return nullptr;
278 std::vector<const Interface*> justOne;
279 justOne.push_back(multi);
280 return merge(justOne, fileName);
281}

◆ merge() [6/6]

Interface * Interface::merge ( const TString & listFileName,
const TString & fileName,
const TString & LBFile )
static

Definition at line 283 of file Interface.cxx.

284{
285 Interface* multi = openList(listFileName);
286 if (!multi) return nullptr;
287 std::vector<const Interface*> justOne;
288 justOne.push_back(multi);
289 return merge(justOne, fileName, LBFile);
290}

◆ nChannels()

virtual unsigned int LArSamples::AbsLArCells::nChannels ( ) const
inlinevirtualinherited

Reimplemented in LArSamples::MonitorBase.

Definition at line 34 of file AbsLArCells.h.

◆ nChannelsSC()

virtual unsigned int LArSamples::AbsLArCells::nChannelsSC ( ) const
inlinevirtualinherited

Definition at line 35 of file AbsLArCells.h.

◆ neighbors()

bool Interface::neighbors ( const CellInfo & cell,
double dRCut,
std::vector< unsigned int > & hashes ) const

Definition at line 732 of file Interface.cxx.

733{
734 for (unsigned int i = 0; i < nChannels(); i++) {
735 const CellInfo* otherCell = cellInfo(i);
736 if (!otherCell) continue;
737 if (cell.position().DeltaR(otherCell->position()) > dRCut) { delete otherCell; continue; }
738 //cout << "Adding hash = " << i << " " << otherCell->location(3) << endl;
739 hashes.push_back(i);
740 delete otherCell;
741 }
742 return true;
743}
TVector3 position() const
Definition CellInfo.cxx:204

◆ nEvents()

unsigned int LArSamples::Interface::nEvents ( ) const
inlinevirtual

Implements LArSamples::Accessor.

Definition at line 51 of file Interface.h.

51{ return accessor().nEvents(); }
virtual unsigned int nEvents() const =0

◆ newCellHistory()

const History * AbsLArCells::newCellHistory ( unsigned int i) const
virtualinherited

Definition at line 44 of file AbsLArCells.cxx.

45{
46 const History* history = getCellHistory(i);
47 if (!history) return nullptr;
48 if (!m_cellInfoCache[i]) {
49 const CellInfo* ci=history->cellInfo();
50 if (ci) {
51 m_cellInfoCache[i]=new CellInfo(*ci,false);
52 }
53 }
54 // m_cellInfoCache[i] = (history->cellInfo() ? new CellInfo(*history->cellInfo(), false) : new CellInfo());
55 return history;
56}
const CellInfo * cellInfo() const
Definition History.h:56

◆ nFilledChannels()

unsigned int Interface::nFilledChannels ( ) const

Definition at line 142 of file Interface.cxx.

143{
144 unsigned int n = 0;
145 for (unsigned int i = 0; i < nChannels(); i++)
146 n += (accessor().historySize(i) ? 1 : 0);
147 return n;
148}
unsigned int historySize(unsigned int i) const
Definition Interface.h:57

◆ nRuns()

unsigned int LArSamples::Interface::nRuns ( ) const
inlinevirtual

Implements LArSamples::Accessor.

Definition at line 52 of file Interface.h.

52{ return accessor().nRuns(); }
virtual unsigned int nRuns() const =0

◆ occupancyMonitor()

OccupancyMonitor LArSamples::Interface::occupancyMonitor ( ) const
inline

Definition at line 114 of file Interface.h.

114{ return OccupancyMonitor(*this); }

◆ open() [1/2]

Interface * Interface::open ( const std::vector< TString > & fileNames)
static

Definition at line 42 of file Interface.cxx.

43{
44 MultiTreeAccessor* accessor = MultiTreeAccessor::open(fileNames);
45 return (accessor ? new Interface(*accessor) : nullptr);
46}
static MultiTreeAccessor * open(const std::vector< TString > &files)

◆ open() [2/2]

Interface * Interface::open ( const TString & fileName)
static

Definition at line 35 of file Interface.cxx.

36{
37 TreeAccessor* accessor = TreeAccessor::open(fileName);
38 return (accessor ? new Interface(*accessor) : nullptr);
39}
static TreeAccessor * open(const TString &fileName)

◆ openList()

Interface * Interface::openList ( const TString & fileList)
static

Definition at line 49 of file Interface.cxx.

50{
51 MultiTreeAccessor* accessor = MultiTreeAccessor::openList(fileList);
52 return (accessor ? new Interface(*accessor) : nullptr);
53}
static MultiTreeAccessor * openList(const TString &fileList)

◆ openWild()

Interface * Interface::openWild ( const TString & wcName)
static

Definition at line 56 of file Interface.cxx.

57{
58 MultiTreeAccessor* accessor = MultiTreeAccessor::openWild(wcName);
59 return (accessor ? new Interface(*accessor) : nullptr);
60}
static MultiTreeAccessor * openWild(const TString &wcName)

◆ pass()

const History * AbsLArCells::pass ( unsigned int i,
const FilterParams & f ) const
inherited

Definition at line 99 of file AbsLArCells.cxx.

100{
101 //std::cout << "Called AbsLArCells with hash " << i << std::endl;
102 if (!f.passHash(i)) return nullptr;
103 const CellInfo* info = cellInfo(i);
104 if (!info) {
105 return nullptr;
106 }
107 //std::cout << "Called AbsLArCells::pass on a cell belonging to " << Id::str(info->calo()) << std::endl;
108 bool result = f.passCell(*info);
109 delete info;
110 return result ? cellHistory(i) : nullptr;
111}

◆ printFilledRanges()

void Interface::printFilledRanges ( unsigned int skip = 0) const

Definition at line 151 of file Interface.cxx.

152{
153 int i1 = 0, i2 = 0;
154 unsigned int nNull = 0;
155 unsigned int size = accessor().historySize(0);
156 bool ok = (size > 0);
157 bool inInterval = ok;
158
159 for (unsigned int i = 0; i < nChannels(); i++) {
161 if (inInterval && nNull == 0) i2 = i;
162 bool ok = (size > 0);
163 if (!ok && inInterval) {
164 nNull++;
165 if (nNull > skip) {
166 nNull = 0;
167 inInterval = false;
168 cout << i1 << "-" << i2 << endl;
169 }
170 }
171 if (ok) nNull = 0;
172 if (ok && !inInterval) {
173 inInterval = true;
174 i1 = i;
175 }
176 }
177
178 if (inInterval) cout << i1 << "-" << nChannels() << endl;
179}
unsigned int size() const
Definition Interface.cxx:96
bool inInterval(const cool::ValidityKey n, const cool::ValidityKey from, const cool::ValidityKey to)

◆ refit()

Interface * Interface::refit ( const TString & newFileName,
Chi2Params pars = DefaultChi2 ) const

Definition at line 405 of file Interface.cxx.

406{
407 FilterParams f;
408 DataTweaker tw;
409 tw.setRefit(true);
410 tw.setFitParams(pars);
411 return filter(f, tw, newFileName);
412}
void setRefit(bool refit=true)
Definition DataTweaker.h:39
void setFitParams(Chi2Params params)
Definition DataTweaker.h:40

◆ resetCache()

void AbsLArCells::resetCache ( ) const
virtualinherited

Definition at line 34 of file AbsLArCells.cxx.

35{
36 if (m_cellCache) {
37 delete m_cellCache;
38 m_cellCache = nullptr;
39 }
40 m_pos = nChannels() + 1;
41}

◆ resetCellInfoCache()

void AbsLArCells::resetCellInfoCache ( )
inherited

Definition at line 114 of file AbsLArCells.cxx.

115{
116 unsigned int i = 0;
117 for (std::vector<CellInfo*>::iterator cellInfo = m_cellInfoCache.begin();
118 cellInfo != m_cellInfoCache.end(); ++cellInfo, i++)
119 if (*cellInfo) {
120 delete *cellInfo;
121 *cellInfo = 0;
122 }
123}

◆ runData()

const RunData * LArSamples::Interface::runData ( unsigned int i) const
inlinevirtual

Implements LArSamples::Accessor.

Definition at line 55 of file Interface.h.

55{ return accessor().runData(i); }
virtual const RunData * runData(unsigned int i) const =0

◆ Scan() [1/2]

bool Interface::Scan ( const TString & vars,
CombinationType comb,
const TString & sel = "",
const TString & ranges = "",
unsigned int verbosity = 1 ) const

Definition at line 578 of file Interface.cxx.

579{
580 MonitorBase m(*this);
581 FilterParams f;
582 if (!f.set(sel)) return 0;
583 return m.dump(vars, comb, f, ranges, verbosity);
584}

◆ Scan() [2/2]

bool Interface::Scan ( const TString & vars,
const TString & sel = "",
unsigned int verbosity = 1 ) const

Definition at line 569 of file Interface.cxx.

570{
571 MonitorBase m(*this);
572 FilterParams f;
573 if (!f.set(sel)) return 0;
574 return m.dump(vars, f, verbosity);
575}

◆ setShapeError() [1/2]

void Interface::setShapeError ( const TString & fileName)

Definition at line 90 of file Interface.cxx.

91{
92 setShapeErrorGetter(new TreeShapeErrorGetter(fileName));
93}
void setShapeErrorGetter(const AbsShapeErrorGetter *err)
Definition Interface.cxx:73

◆ setShapeError() [2/2]

void Interface::setShapeError ( double k)

Definition at line 81 of file Interface.cxx.

82{
84 if (k == 0) { m_shapeErrorGetter = nullptr; m_ownShapeErrorGetter = false; return; }
85 m_shapeErrorGetter = new UniformShapeErrorGetter(k);
87}

◆ setShapeErrorGetter()

void Interface::setShapeErrorGetter ( const AbsShapeErrorGetter * err)

Definition at line 73 of file Interface.cxx.

◆ shapeErrorGetter()

const AbsShapeErrorGetter * LArSamples::Interface::shapeErrorGetter ( ) const
inline

Definition at line 123 of file Interface.h.

123{ return m_shapeErrorGetter; }

◆ Show() [1/2]

bool Interface::Show ( const TString & sel = "",
unsigned int verbosity = 1 ) const

Definition at line 595 of file Interface.cxx.

596{
597 FilterParams f;
598 if (!f.set(sel)) return false;
599 for (unsigned int i = 0; i < nChannels(); i++) {
600 const History* history = pass(i, f);
601 if (!history) continue;
602 History* filtered = history->filter(sel);
603 TString hDesc = filtered->description(verbosity);
604 delete filtered;
605 if (hDesc == "") continue;
606 cout << Form("Hash = %-5d : ", i) << hDesc
607 << "-----------------------------------------------------------------------------"
608 << endl;
609 }
610 return true;
611}
const History * pass(unsigned int i, const FilterParams &f) const
TString description(unsigned int verbosity=1) const
Definition History.cxx:574
History * filter(const TString &cuts) const
Definition History.cxx:282

◆ Show() [2/2]

bool Interface::Show ( unsigned int hash,
unsigned int verbosity = 1 ) const

Definition at line 587 of file Interface.cxx.

588{
589 const History* history = cellHistory(hash);
590 if (!history) return false;
591 cout << history->description(verbosity) << endl;
592 return true;
593}

◆ ShowEvents()

bool Interface::ShowEvents ( const TString & sel = "",
unsigned int verbosity = 1 ) const

Definition at line 614 of file Interface.cxx.

615{
616 FilterParams f;
617 if (!f.set(sel)) return false;
618 std::map< std::pair<unsigned int, unsigned int>, unsigned int > eventCells;
619 std::map< std::pair<unsigned int, unsigned int>, double > eventEnergy;
620
621 if (verbosity & 8) {
622 for (unsigned int i = 0; i < nChannels(); i++) {
623 if ((i+1) % 50000 == 0) cout << "Cell # " << i+1 << "/" << nChannels() << endl;
624 const History* history = pass(i, f);
625 if (!history) continue;
626 for (unsigned int j = 0; j < history->nData(); j++) {
627 std::pair<unsigned int, unsigned int> ev = std::make_pair(history->data(j)->run(), history->data(j)->event());
628 eventCells[ev]++;
629 eventEnergy[ev] += history->data(j)->energy();
630 }
631 }
632 }
633 for (unsigned int i = 0; i < nEvents(); i++) {
634 const EventData* evtData = eventData(i);
635 std::pair<unsigned int, unsigned int> id(evtData->run(), evtData->event());
636 TString printout = Form("%d : ", i) + evtData->description(verbosity);
637 if (verbosity & 8)
638 printout += Form(" : %6d LAr hits, %7.1f MeV", eventCells[id], eventEnergy[id]);
639 cout << printout << endl;
640 }
641
642 return true;
643}
double energy() const
Definition Data.h:108
int event() const
Definition Data.cxx:28
int run() const
Definition Data.cxx:27
TString description(unsigned int verbosity) const
const EventData * eventData(unsigned int i) const
Definition Interface.h:54
unsigned int nEvents() const
Definition Interface.h:51
int ev
Definition globals.cxx:25

◆ ShowRuns()

bool Interface::ShowRuns ( unsigned int verbosity = 1) const

Definition at line 646 of file Interface.cxx.

647{
648 std::map<unsigned int, unsigned int> events;
649
650 if (verbosity & 8) {
651 for (unsigned int i = 0; i < nEvents(); i++)
652 events[eventData(i)->run()]++;
653 }
654
655 for (unsigned int i = 0; i < nRuns(); i++) {
656 const RunData* rData = runData(i);
657 TString printout = rData->description(verbosity);
658 if (verbosity & 8)
659 printout += Form(" : %6d events", events[rData->run()]);
660 cout << printout << endl;
661 }
662
663 return true;
664}
unsigned int nRuns() const
Definition Interface.h:52
const RunData * runData(unsigned int i) const
Definition Interface.h:55
int run() const
Definition RunData.h:36
TString description(unsigned int verbosity) const
Definition RunData.cxx:56

◆ ShowStats()

bool Interface::ShowStats ( const TString & varList,
const TString & sel = "",
bool withErrors = false ) const

Definition at line 667 of file Interface.cxx.

668{
669 MonitorBase m(*this);
670 FilterParams f;
671 if (!f.set(sel)) return 0;
672
673 std::vector<TString> vars;
674 std::vector<DataFuncSet> funcs;
675 std::vector<DataFuncArgs> args;
676 if (!MonitorBase::parseVariables(varList, vars, funcs, args)) {
677 cout << "Invalid variable specification " << varList << endl;
678 return 0;
679 }
680
681 TVectorD mean(vars.size()), meanErr(vars.size());
682 TMatrixD covMatrix(vars.size(), vars.size()), covMatrixErr(vars.size(), vars.size());
683 if (!m.statParams(funcs, args, mean, meanErr, covMatrix, covMatrixErr, f)) return false;
684
685 if (!withErrors) {
686 cout << "---------------------------" << endl;
687 for (unsigned int i = 0; i < vars.size(); i++)
688 cout << Form("| %10s | %-9.4g |", vars[i].Data(), mean(i)) << endl;
689 cout << "---------------------------" << endl << endl;
690
691 cout << "| |";
692 for (unsigned int i = 0; i < vars.size(); i++) cout << " |";
693 cout << endl << "--------------";
694 for (unsigned int i = 0; i < vars.size(); i++) cout << "-------------";
695 cout << endl;
696 for (unsigned int i1 = 0; i1 < vars.size(); i1++) {
697 cout << Form("| %10s |", vars[i1].Data());
698 for (unsigned int i2 = 0; i2 < vars.size(); i2++)
699 cout << Form(" %-9.4g |", covMatrix(i1, i2));
700 cout << endl;
701 }
702 cout << "--------------";
703 for (unsigned int i = 0; i < vars.size(); i++) cout << "-------------";
704 cout << endl;
705 }
706 else {
707 cout << "---------------------------" << endl;
708 for (unsigned int i = 0; i < vars.size(); i++)
709 cout << Form("| %10s | %-9.4g +/- %-9.4g |", vars[i].Data(), mean(i), meanErr(i)) << endl;
710 cout << "---------------------------" << endl << endl;
711
712 cout << "| |";
713 for (unsigned int i = 0; i < vars.size(); i++) cout << " |";
714 cout << endl << "--------------";
715 for (unsigned int i = 0; i < vars.size(); i++) cout << "---------------------------";
716 cout << endl;
717 for (unsigned int i1 = 0; i1 < vars.size(); i1++) {
718 cout << Form("| %10s |", vars[i1].Data());
719 for (unsigned int i2 = 0; i2 < vars.size(); i2++)
720 cout << Form(" %-9.4g +/- %-9.4g |", covMatrix(i1, i2), covMatrixErr(i1, i2));
721 cout << endl;
722 }
723 cout << "--------------";
724 for (unsigned int i = 0; i < vars.size(); i++) cout << "---------------------------";
725 cout << endl;
726 }
727
728 return true;
729}
void mean(std::vector< double > &bins, std::vector< double > &values, const std::vector< std::string > &files, const std::string &histname, const std::string &tplotname, const std::string &label="")

◆ size()

unsigned int Interface::size ( ) const

Definition at line 96 of file Interface.cxx.

97{
98 unsigned int n = 0;
99 for (unsigned int i = 0; i < nChannels(); i++)
100 n += accessor().historySize(i);
101 return n;
102}

◆ writeToFile()

bool LArSamples::Interface::writeToFile ( const TString & fileName) const
inlinevirtual

Implements LArSamples::Accessor.

Definition at line 125 of file Interface.h.

125{ return accessor().writeToFile(fileName); }
virtual bool writeToFile(const TString &fileName) const =0

Member Data Documentation

◆ m_accessor

const Accessor* LArSamples::Interface::m_accessor
private

Definition at line 136 of file Interface.h.

◆ m_cellCache

const History* LArSamples::AbsLArCells::m_cellCache
mutableprivateinherited

Definition at line 55 of file AbsLArCells.h.

◆ m_cellInfoCache

std::vector<CellInfo*> LArSamples::AbsLArCells::m_cellInfoCache
mutableprivateinherited

Definition at line 56 of file AbsLArCells.h.

◆ m_neighborCache

std::vector<std::vector<unsigned int>*> LArSamples::Interface::m_neighborCache
mutableprivate

Definition at line 140 of file Interface.h.

◆ m_neighborHistories

std::vector<const History*> LArSamples::Interface::m_neighborHistories
mutableprivate

Definition at line 142 of file Interface.h.

◆ m_neighborHistoryPos

std::vector<unsigned int> LArSamples::Interface::m_neighborHistoryPos
mutableprivate

Definition at line 141 of file Interface.h.

◆ m_ownShapeErrorGetter

bool LArSamples::Interface::m_ownShapeErrorGetter
private

Definition at line 138 of file Interface.h.

◆ m_pos

unsigned int LArSamples::AbsLArCells::m_pos
mutableprivateinherited

Definition at line 54 of file AbsLArCells.h.

◆ m_shapeErrorGetter

const AbsShapeErrorGetter* LArSamples::Interface::m_shapeErrorGetter
private

Definition at line 137 of file Interface.h.


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