CMS 3D CMS Logo

Public Member Functions | Private Attributes

CSCTriggerElectronicsMappingFromFile Class Reference

#include <CSCTriggerElectronicsMappingFromFile.h>

Inheritance diagram for CSCTriggerElectronicsMappingFromFile:
CSCTriggerElectronicsMapping CSCTriggerMapping

List of all members.

Public Member Functions

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

Private Attributes

std::string filename_

Detailed Description

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

Definition at line 13 of file CSCTriggerElectronicsMappingFromFile.h.


Constructor & Destructor Documentation

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

Constructor.

Definition at line 6 of file CSCTriggerElectronicsMappingFromFile.cc.

References fill().

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

Definition at line 18 of file CSCTriggerElectronicsMappingFromFile.h.

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

Destructor.

Definition at line 9 of file CSCTriggerElectronicsMappingFromFile.cc.

{}

Member Function Documentation

void CSCTriggerElectronicsMappingFromFile::fill ( void  ) [virtual]

Fill mapping store.

Implements CSCTriggerMapping.

Definition at line 11 of file CSCTriggerElectronicsMappingFromFile.cc.

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

Referenced by CSCTriggerElectronicsMappingFromFile().

                                                      {
  std::ifstream in( filename_.c_str() );
  std::string line;
  const std::string commentFlag = "#";
  if ( !in ) {
    std::cout << "CSCTriggerElectronicsMappingFromFile: ERROR! Failed to open file containing mapping, " <<
      filename_ << std::endl ;
  }
  else
  {
    std::cout << "CSCTriggerElectronicsMappingFromFile: 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, i6, i7, i8, i9, i10;
        std::istringstream is( line );
        is >> i1 >> i2 >> i3 >> i6 >> i7 >> i8 >> i9 >> i10;
        if ( debugV() ) std::cout << i1 << " " << i2 << " " << i3 << " " 
                                  << i6 << " " << i7 << " " << i8 << " " 
                                  << i9 << " " << i10 << std::endl;
        addRecord( i1, i2, i3, 0, 0, i6, i7, i8, i9 , i10);
      }
    }

  }

  return;
}

Member Data Documentation

Definition at line 27 of file CSCTriggerElectronicsMappingFromFile.h.

Referenced by fill().