CMS 3D CMS Logo

CSCTriggerMappingFromFile Class Reference

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

#include <CondFormats/CSCObjects/interface/CSCTriggerMappingFromFile.h>

Inheritance diagram for CSCTriggerMappingFromFile:

CSCTriggerSimpleMapping CSCTriggerMapping

List of all members.

Public Member Functions

 CSCTriggerMappingFromFile ()
 CSCTriggerMappingFromFile (std::string filename)
 Constructor.
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().

00007   : filename_( filename ) { fill(); }

CSCTriggerMappingFromFile::CSCTriggerMappingFromFile (  )  [inline]

Definition at line 18 of file CSCTriggerMappingFromFile.h.

00018 {}

CSCTriggerMappingFromFile::~CSCTriggerMappingFromFile (  )  [virtual]

Destructor.

Definition at line 9 of file CSCTriggerMappingFromFile.cc.

00009 {}


Member Function Documentation

void CSCTriggerMappingFromFile::fill ( void   )  [virtual]

Fill mapping store.

Implements CSCTriggerMapping.

Definition at line 11 of file CSCTriggerMappingFromFile.cc.

References CSCTriggerMapping::addRecord(), GenMuonPlsPt100GeV_cfg::cout, CSCTriggerMapping::debugV(), lat::endl(), filename_, i1, i2, i3, i4, i5, i6, in, and parsecf::pyparsing::line().

Referenced by CSCTriggerMappingFromFile().

00011                                            {
00012   std::ifstream in( filename_.c_str() );
00013   std::string line;
00014   const std::string commentFlag = "#";
00015   if ( !in ) {
00016     std::cout << "CSCTriggerMappingFromFile: ERROR! Failed to open file containing mapping, " <<
00017       filename_ << std::endl ;
00018   }
00019   else
00020   {
00021     std::cout << "CSCTriggerMappingFromFile: opened file containing mapping, " << 
00022       filename_ << std::endl ;
00023 
00024     while ( getline(in, line) ) { // getline() from <string>
00025       if ( debugV() ) std::cout << line << std::endl;
00026       if ( line[0] != commentFlag[0] ) {
00027         int i1, i2, i3, i4, i5, i6, i7, i8, i9, i10;
00028         std::istringstream is( line );
00029         is >> i1 >> i2 >> i3 >> i4 >> i5 >> i6 >> i7 >> i8 >> i9 >> i10;
00030         if ( debugV() ) std::cout << i1 << " " << i2 << " " << i3 << " " << i4 << " " 
00031                                   << i5 << " " << i6 << " " << i7 << " " << i8 << " " 
00032                                   << i9 << " " << i10 << std::endl;
00033         addRecord( i1, i2, i3, i4, i5, i6, i7, i8, i9 , i10);
00034       }
00035     }
00036 
00037   }
00038 
00039   return;
00040 }


Member Data Documentation

std::string CSCTriggerMappingFromFile::filename_ [private]

Definition at line 27 of file CSCTriggerMappingFromFile.h.

Referenced by fill().


The documentation for this class was generated from the following files:
Generated on Tue Jun 9 18:17:31 2009 for CMSSW by  doxygen 1.5.4