CMS 3D CMS Logo

Public Member Functions | Private Attributes

CSCTriggerMappingFromFile Class Reference

#include <CSCTriggerMappingFromFile.h>

Inheritance diagram for CSCTriggerMappingFromFile:
CSCTriggerSimpleMapping CSCTriggerMapping

List of all members.

Public Member Functions

 CSCTriggerMappingFromFile (std::string filename)
 Constructor.
 CSCTriggerMappingFromFile ()
virtual void fill (void)
 Fill mapping store.
virtual ~CSCTriggerMappingFromFile ()
 Destructor.

Private Attributes

std::string filename_

Detailed Description

Author:
Lindsey Gray A concrete CSCTriggerSimpleMapping to read mapping from Ascii file.

Definition at line 13 of file CSCTriggerMappingFromFile.h.


Constructor & Destructor Documentation

CSCTriggerMappingFromFile::CSCTriggerMappingFromFile ( std::string  filename) [explicit]

Constructor.

Definition at line 6 of file CSCTriggerMappingFromFile.cc.

References fill().

  : filename_( filename ) { fill(); }
CSCTriggerMappingFromFile::CSCTriggerMappingFromFile ( ) [inline]

Definition at line 18 of file CSCTriggerMappingFromFile.h.

{}
CSCTriggerMappingFromFile::~CSCTriggerMappingFromFile ( ) [virtual]

Destructor.

Definition at line 9 of file CSCTriggerMappingFromFile.cc.

{}

Member Function Documentation

void CSCTriggerMappingFromFile::fill ( void  ) [virtual]

Fill mapping store.

Implements CSCTriggerMapping.

Definition at line 11 of file CSCTriggerMappingFromFile.cc.

References CSCTriggerMapping::addRecord(), gather_cfg::cout, CSCTriggerMapping::debugV(), filename_, recoMuon::in, geometryCSVtoXML::line, and AlCaHLTBitMon_QueryRunRegistry::string.

Referenced by CSCTriggerMappingFromFile().

                                           {
  std::ifstream in( filename_.c_str() );
  std::string line;
  const std::string commentFlag = "#";
  if ( !in ) {
    std::cout << "CSCTriggerMappingFromFile: ERROR! Failed to open file containing mapping, " <<
      filename_ << std::endl ;
  }
  else
  {
    std::cout << "CSCTriggerMappingFromFile: opened file containing mapping, " << 
      filename_ << std::endl ;

    while ( getline(in, line) ) { // getline() from <string>
      if ( debugV() ) std::cout << line << std::endl;
      if ( line[0] != commentFlag[0] ) {
        int i1, i2, i3, i4, i5, i6, i7, i8, i9, i10;
        std::istringstream is( line );
        is >> i1 >> i2 >> i3 >> i4 >> i5 >> i6 >> i7 >> i8 >> i9 >> i10;
        if ( debugV() ) std::cout << i1 << " " << i2 << " " << i3 << " " << i4 << " " 
                                  << i5 << " " << i6 << " " << i7 << " " << i8 << " " 
                                  << i9 << " " << i10 << std::endl;
        addRecord( i1, i2, i3, i4, i5, i6, i7, i8, i9 , i10);
      }
    }

  }

  return;
}

Member Data Documentation

std::string CSCTriggerMappingFromFile::filename_ [private]

Definition at line 27 of file CSCTriggerMappingFromFile.h.

Referenced by fill().