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 ()
 

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 22 of file ALIFileOut.h.

Constructor & Destructor Documentation

ALIFileOut::ALIFileOut ( )
inline

Definition at line 25 of file ALIFileOut.h.

Referenced by getInstance().

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

Definition at line 26 of file ALIFileOut.h.

26 : std::ofstream(), theName(name){};
const ALIstring & name()
Definition: ALIFileOut.h:33
ALIstring theName
Name of file.
Definition: ALIFileOut.h:41
ALIFileOut::~ALIFileOut ( )
inline

Definition at line 27 of file ALIFileOut.h.

References corrVsCorr::filename, and getInstance().

27 {};

Member Function Documentation

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

Definition at line 19 of file ALIFileOut.cc.

References ALIFileOut(), MessageLogger_cfi::cerr, cmsRelvalreport::exit, corrVsCorr::filename, instance, and theInstances.

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

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

Member Data Documentation

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

Definition at line 38 of file ALIFileOut.h.

Referenced by getInstance().

ALIstring ALIFileOut::theName
private

Name of file.

Definition at line 41 of file ALIFileOut.h.

Referenced by twikiExport.Constituent::__str__(), twikiExport.Material::__str__(), and name().