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() [1/2]

ALIFileOut::ALIFileOut ( )
inline

Definition at line 23 of file ALIFileOut.h.

23 {};

Referenced by getInstance().

◆ ALIFileOut() [2/2]

ALIFileOut::ALIFileOut ( const ALIstring name)
inline

Definition at line 24 of file ALIFileOut.h.

24 : std::ofstream(), theName(name){};

◆ ~ALIFileOut()

ALIFileOut::~ALIFileOut ( )
inlineoverride

Definition at line 25 of file ALIFileOut.h.

25 {};

Member Function Documentation

◆ getInstance()

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

Definition at line 18 of file ALIFileOut.cc.

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 }

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

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

◆ name()

const ALIstring& ALIFileOut::name ( )
inline

Member Data Documentation

◆ theInstances

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

Definition at line 36 of file ALIFileOut.h.

Referenced by getInstance().

◆ theName

ALIstring ALIFileOut::theName
private

Name of file.

Definition at line 39 of file ALIFileOut.h.

Referenced by name().

ALIFileOut::theName
ALIstring theName
Name of file.
Definition: ALIFileOut.h:39
ALIFileOut
Definition: ALIFileOut.h:21
ALIFileOut::ALIFileOut
ALIFileOut()
Definition: ALIFileOut.h:23
ALIFileOut::theInstances
static std::vector< ALIFileOut * > theInstances
Definition: ALIFileOut.h:36
corrVsCorr.filename
filename
Definition: corrVsCorr.py:123
instance
static PFTauRenderPlugin instance
Definition: PFTauRenderPlugin.cc:70
beamvalidation.exit
def exit(msg="")
Definition: beamvalidation.py:53
EcnaPython_AdcPeg12_S1_10_R170298_1_0_150_Dee0.cerr
cerr
Definition: EcnaPython_AdcPeg12_S1_10_R170298_1_0_150_Dee0.py:8
ALIFileOut::name
const ALIstring & name()
Definition: ALIFileOut.h:31