CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
List of all members | Public Member Functions | Static Public Member Functions | Private Attributes | Static Private Attributes
ALIFileOut Class Reference

#include <ALIFileOut.h>

Inheritance diagram for ALIFileOut:

Public Member Functions

 ALIFileOut ()
 
 ALIFileOut (const ALIstring &name)
 
const ALIstringname ()
 
 ~ALIFileOut () override
 

Static Public Member Functions

static ALIFileOutgetInstance (const ALIstring &filename)
 

Private Attributes

ALIstring theName
 Name of file. More...
 

Static Private Attributes

static std::vector< ALIFileOut * > theInstances
 

Detailed Description

Definition at line 21 of file ALIFileOut.h.

Constructor & Destructor Documentation

ALIFileOut::ALIFileOut ( )
inline

Definition at line 23 of file ALIFileOut.h.

Referenced by getInstance().

23 {};
ALIFileOut::ALIFileOut ( const ALIstring name)
inline

Definition at line 24 of file ALIFileOut.h.

24 : std::ofstream(), theName(name){};
const ALIstring & name()
Definition: ALIFileOut.h:31
ALIstring theName
Name of file.
Definition: ALIFileOut.h:39
ALIFileOut::~ALIFileOut ( )
inlineoverride

Definition at line 25 of file ALIFileOut.h.

25 {};

Member Function Documentation

ALIFileOut & ALIFileOut::getInstance ( const ALIstring filename)
static

Definition at line 18 of file ALIFileOut.cc.

References ALIFileOut(), EcnaPython_AdcPeg12_S1_10_R170298_1_0_150_Dee0::cerr, beamvalidation::exit(), lut2db_cfg::filename, instance, and theInstances.

Referenced by Fit::dumpMatrices(), Fit::fitNextEvent(), Fit::getFitQuality(), Fit::PrintChi2(), and CocoaAnalyzer::runCocoa().

18  {
19  std::vector<ALIFileOut*>::const_iterator vfcite;
20  for (vfcite = theInstances.begin(); vfcite != theInstances.end(); ++vfcite) {
21  if ((*vfcite)->name() == filename) {
22  return *(*vfcite);
23  break;
24  }
25  }
26 
27  if (vfcite == theInstances.end()) {
29  instance->open(filename.c_str());
30  if (!instance) {
31  std::cerr << "!! cannot open output file " << filename << std::endl;
32  exit(0);
33  }
34  theInstances.push_back(instance);
35  return *instance;
36  }
37 
38  ALIFileOut* instance = new ALIFileOut(filename); // it will not reach here, only to avoid warning
39  return *instance;
40 }
static PFTauRenderPlugin instance
static std::vector< ALIFileOut * > theInstances
Definition: ALIFileOut.h:36
tuple filename
Definition: lut2db_cfg.py:20
const ALIstring& ALIFileOut::name ( )
inline

Member Data Documentation

std::vector< ALIFileOut * > ALIFileOut::theInstances
staticprivate

Definition at line 36 of file ALIFileOut.h.

Referenced by getInstance().

ALIstring ALIFileOut::theName
private

Name of file.

Definition at line 39 of file ALIFileOut.h.

Referenced by name().