#include <DiskResidentEventList.h>
Definition at line 26 of file DiskResidentEventList.h.
◆ DiskResidentEventList() [1/7]
DiskResidentEventList::DiskResidentEventList |
( |
| ) |
|
◆ DiskResidentEventList() [2/7]
DiskResidentEventList::DiskResidentEventList |
( |
const std::string & |
fname, |
|
|
const std::string & |
opt = "UPDATE" |
|
) |
| |
Definition at line 79 of file DiskResidentEventList.cpp.
82 ,
_opt(boost::to_upper_copy(opt))
86 ,
_cName(
"DalitzEventList")
91 cout <<
"DiskResidentEventList created with file " << fname << endl;
93 if(dbThis)cout <<
" from file done, now init: " << endl;
95 if(dbThis)cout <<
" finished creation" << endl;
◆ DiskResidentEventList() [3/7]
DiskResidentEventList::DiskResidentEventList |
( |
const std::string & |
fname, |
|
|
int |
scales, |
|
|
const std::string & |
treeName, |
|
|
const std::string & |
opt = "UPDATE" |
|
) |
| |
Definition at line 58 of file DiskResidentEventList.cpp.
63 ,
_opt(boost::to_upper_copy(opt))
72 cout <<
"DiskResidentEventList created with file " << fname << endl;
74 if(dbThis)cout <<
" from file done, now init: " << endl;
76 if(dbThis)cout <<
" finished creation" << endl;
◆ DiskResidentEventList() [4/7]
◆ DiskResidentEventList() [5/7]
DiskResidentEventList::DiskResidentEventList |
( |
const DalitzEventPattern & |
pat, |
|
|
const std::string & |
fname, |
|
|
const std::string & |
opt = "RECREATE" |
|
) |
| |
◆ DiskResidentEventList() [6/7]
◆ DiskResidentEventList() [7/7]
DiskResidentEventList::DiskResidentEventList |
( |
const MINT::IMinimalEventList< DalitzEvent > & |
otherList, |
|
|
const std::string & |
newFname, |
|
|
const std::string & |
opt = "RECREATE" |
|
) |
| |
Definition at line 125 of file DiskResidentEventList.cpp.
130 ,
_opt(boost::to_upper_copy(opt))
135 ,
_cName(
"DalitzEventList")
139 cout <<
" copy with new filename : " << newFname << endl;
140 cout <<
" file pointer: " <<
_f << endl;
virtual bool Add(const DalitzEvent &evt)
◆ ~DiskResidentEventList()
DiskResidentEventList::~DiskResidentEventList |
( |
| ) |
|
|
virtual |
◆ Add() [1/5]
bool DiskResidentEventList::Add |
( |
const DalitzEvent & |
evt | ) |
|
|
virtual |
Implements MINT::IMinimalEventList< DalitzEvent >.
Definition at line 322 of file DiskResidentEventList.cpp.
327 vector<Double_t> array(arraySize);
331 cout <<
"ERROR in DiskResidentEventList::Add(const DalitzEvent& evt)" 332 <<
", call to DalitzEvent::fillNtupleVarArray" 333 <<
" returned failure for event:\n" << evt
338 _ntp->Fill(&(array[0]));
339 _f =
_ntp->GetCurrentFile();
bool makeNtp(const DalitzEvent &evt)
bool fillNtupleVarArray(std::vector< Double_t > &array) const
unsigned int ntupleVarArraySize() const
◆ Add() [2/5]
◆ Add() [3/5]
◆ Add() [4/5]
◆ Add() [5/5]
Definition at line 361 of file DiskResidentEventList.cpp.
362 if(0 == otherList.
size())
return false;
363 for(
unsigned int i=0; i < otherList.
size(); i++){
virtual bool Add(const DalitzEvent &evt)
virtual EVENT_TYPE getEvent(unsigned int i) const =0
virtual unsigned int size() const =0
◆ Close()
bool DiskResidentEventList::Close |
( |
| ) |
|
Definition at line 397 of file DiskResidentEventList.cpp.
402 cout <<
"DiskResidentEventList::Close() called" 403 <<
" for filename = " <<
_fname << endl;
405 if(0 ==
_f)
return false;
406 if(0 ==
_ntp)
return false;
409 if(!
_f->IsOpen())
return false ;
411 if(
_opt.size() != 0 &&
_opt !=
"OPEN" &&
_opt !=
"READ"){
413 if(dbThis && ! success){
414 cout <<
"DiskResidentEventList::Close() failure in saving when closing" 417 if(dbThis) cout <<
"saved file with success = " << success << endl;
423 cout <<
"_f " <<
_f <<
" _ntp " <<
_ntp << endl ;
424 cout <<
"_f->IsOpen() " <<
_f->IsOpen() << endl ;
425 cout <<
"mustcleanup " <<
_f->TestBit(kMustCleanup) << endl ;
426 cout <<
"_ntp->GetName() " <<
_ntp->GetName() << endl ;
427 cout <<
"getting current file" << endl;
429 _f =
_ntp->GetCurrentFile();
430 if(dbThis) cout <<
"_f = " <<
_f << endl;
432 if(dbThis) cout <<
"cd'ed to _f and now about to Write" << endl;
434 if(dbThis) cout <<
"written,now closing" <<endl;
436 if(dbThis) cout <<
"closed." << endl;
◆ cName()
std::string DiskResidentEventList::cName |
( |
| ) |
|
|
protected |
◆ empty()
bool DiskResidentEventList::empty |
( |
| ) |
const |
|
virtual |
◆ fromFile()
bool DiskResidentEventList::fromFile |
( |
| ) |
|
|
protected |
Definition at line 246 of file DiskResidentEventList.cpp.
248 if(dbThis) cout <<
"DiskResidentEventList::fromFile() called" << endl;
251 cout <<
"WARNING in DiskResidentEventList::fromFile():" 252 <<
" current file is zombie - making new one" << endl;
255 if(dbThis) cout <<
" opened file" << endl;
256 if(dbThis)
_f->ls(); cout <<
" that's in it" << endl;
259 cout <<
" cd'ed to file " << endl;
260 cout <<
" now calling " <<
"_f->Get(" <<
cName() <<
")" << endl;
263 if(dbThis) cout <<
" got ntuple : " <<
_ntp << endl;
268 cout <<
"Success in DiskResidentEventList::fromFile(): " 269 <<
" found ntuple: " <<
_ntp->ClassName() <<
", " <<
cName()
275 if(dbThis) cout <<
" now calling init" << endl;
277 if(dbThis) cout <<
"DiskResidentEventList::fromFile() returning 'true'"
◆ generateFname()
std::string DiskResidentEventList::generateFname |
( |
| ) |
|
|
static |
Definition at line 29 of file DiskResidentEventList.cpp.
30 string baseName =
"DiskResidentEventList";
31 string name = baseName;
37 checkFile.open( name.c_str(), ios::in );
38 exists = ! checkFile.fail();
bool exists(const string &fname)
std::string anythingToString(const T &anything)
◆ getEvent()
DalitzEvent DiskResidentEventList::getEvent |
( |
unsigned int |
i | ) |
const |
|
virtual |
Implements MINT::IMinimalEventList< DalitzEvent >.
Definition at line 447 of file DiskResidentEventList.cpp.
449 cout <<
"FATAL ERROR in DiskResidentEventList::operator()" 450 <<
" index i=" << i <<
" out of range " <<
size()
452 throw "index out of range";
455 cout <<
"FATAL ERROR in DiskResidentEventList::operator()" 456 <<
"there is no ntuple "
virtual unsigned int size() const
◆ histoSet()
Definition at line 463 of file DiskResidentEventList.cpp.
465 for(
unsigned int i=0; i< this->
size(); i++){
virtual unsigned int size() const
void addEvent(const IDalitzEvent &evt, double weight=1)
DalitzEvent getEvent(unsigned int i) const
◆ init()
bool DiskResidentEventList::init |
( |
| ) |
|
|
protected |
◆ makeNewFile()
bool DiskResidentEventList::makeNewFile |
( |
| ) |
|
|
protected |
◆ makeNtp()
bool DiskResidentEventList::makeNtp |
( |
const DalitzEvent & |
evt | ) |
|
|
protected |
Definition at line 301 of file DiskResidentEventList.cpp.
303 cout <<
"WARNING DiskResidentEventList::makeNtp - no file. " 304 <<
"That shouldn't happen. I'll have one made." << endl;
313 cout <<
"made new ntuple" << endl;
315 cout <<
"found old ntuple" << endl;
std::string makeNtupleVarnames() const
◆ makePlots()
bool DiskResidentEventList::makePlots |
( |
const std::string & |
filename | ) |
|
Definition at line 502 of file DiskResidentEventList.cpp.
DalitzHistoSet histoSet() const
bool save(const std::string &filename="DalitzHistos.root") const
◆ ntpName()
std::string DiskResidentEventList::ntpName |
( |
| ) |
|
|
protected |
◆ openFile()
bool DiskResidentEventList::openFile |
( |
| ) |
|
|
protected |
Definition at line 215 of file DiskResidentEventList.cpp.
218 cout <<
"Hello from DiskResidentEventList::openFile()" << endl;
219 cout <<
" calling: TFile(" 230 if(!
_f->IsWritable()) {
232 cout <<
"Warning in DiskResidentEventList: file " 233 <<
_fname <<
" not writable!" 237 cout <<
" got _f = " <<
_f << endl;
238 cout <<
" _f->ls() " << endl;
◆ operator()()
DalitzEvent DiskResidentEventList::operator() |
( |
unsigned int |
i | ) |
|
◆ reWeightedHistoSet()
Definition at line 480 of file DiskResidentEventList.cpp.
483 if(0 == w)
return hs;
484 for(
unsigned int i=0; i< this->
size(); i++){
virtual double RealVal(EVENT_TYPE &evt)=0
virtual unsigned int size() const
void addEvent(const IDalitzEvent &evt, double weight=1)
DalitzEvent getEvent(unsigned int i) const
◆ save()
bool DiskResidentEventList::save |
( |
| ) |
|
Definition at line 375 of file DiskResidentEventList.cpp.
377 if(0 ==
_ntp)
return false;
378 if(0 ==
_f)
return false;
381 cout <<
"DiskResidentEventList::save() called" 382 <<
" for filename = " <<
_fname << endl;
388 if(0 ==
_f || (!
_f->IsWritable()) || (!
_f->IsOpen())){
389 cout <<
"big problem with f in DiskResidentEventList::save()" << endl;
390 throw "Scheibenkartoffel";
393 if(dbThis)cout <<
" done the saving" << endl;
◆ size()
unsigned int DiskResidentEventList::size |
( |
| ) |
const |
|
virtual |
◆ weighedReWeightedHistoSet()
Definition at line 491 of file DiskResidentEventList.cpp.
494 if(0 == w)
return hs;
495 for(
unsigned int i=0; i< this->
size(); i++){
virtual double RealVal(EVENT_TYPE &evt)=0
virtual unsigned int size() const
void addEvent(const IDalitzEvent &evt, double weight=1)
DalitzEvent getEvent(unsigned int i) const
◆ weightedHistoSet()
Definition at line 471 of file DiskResidentEventList.cpp.
474 for(
unsigned int i=0; i< this->
size(); i++){
virtual unsigned int size() const
void addEvent(const IDalitzEvent &evt, double weight=1)
DalitzEvent getEvent(unsigned int i) const
◆ __maxBytes
int DiskResidentEventList::__maxBytes = 10000000 |
|
staticprotected |
◆ _cName
std::string DiskResidentEventList::_cName |
|
private |
◆ _f
TFile* DiskResidentEventList::_f |
|
protected |
◆ _fname
std::string DiskResidentEventList::_fname |
|
protected |
◆ _initialised
bool DiskResidentEventList::_initialised |
|
protected |
◆ _ntp
TNtupleD* DiskResidentEventList::_ntp |
|
protected |
◆ _ntpName
std::string DiskResidentEventList::_ntpName |
|
private |
◆ _opt
std::string DiskResidentEventList::_opt |
|
protected |
◆ _scaleData
double DiskResidentEventList::_scaleData |
|
protected |
The documentation for this class was generated from the following files: