CMS 3D CMS Logo

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.

References corrVsCorr::filename, and getInstance().

25 {};

Member Function Documentation

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

Definition at line 18 of file ALIFileOut.cc.

References ALIFileOut(), beam_dqm_sourceclient-live_cfg::cerr, beamvalidation::exit(), corrVsCorr::filename, instance, and theInstances.

Referenced by Fit::dumpMatrices(), Fit::fitNextEvent(), Fit::getFitQuality(), Fit::PrintChi2(), and ~ALIFileOut().

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
def exit(msg="")
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().