CMS 3D CMS Logo

CSCReadoutMappingFromFile Class Reference

Author:
Tim Cox A concrete CSCReadoutMappingForSliceTest to read mapping from Ascii file.
More...

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

Inheritance diagram for CSCReadoutMappingFromFile:

CSCReadoutMappingForSliceTest CSCReadoutMapping

List of all members.

Public Member Functions

 CSCReadoutMappingFromFile ()
 CSCReadoutMappingFromFile (const edm::ParameterSet &ps)
 Constructor.
virtual void fill (const edm::ParameterSet &ps)
 Fill mapping store.
virtual ~CSCReadoutMappingFromFile ()
 Destructor.

Private Attributes

std::string theMappingFile


Detailed Description

Author:
Tim Cox A concrete CSCReadoutMappingForSliceTest to read mapping from Ascii file.

Find file from FileInPath of ParameterSet passed from calling E_Producer.

Definition at line 15 of file CSCReadoutMappingFromFile.h.


Constructor & Destructor Documentation

CSCReadoutMappingFromFile::CSCReadoutMappingFromFile ( const edm::ParameterSet ps  )  [explicit]

Constructor.

Definition at line 8 of file CSCReadoutMappingFromFile.cc.

References fill().

00008                                                                                 {
00009   fill( ps ); 
00010 }

CSCReadoutMappingFromFile::CSCReadoutMappingFromFile (  )  [inline]

Definition at line 20 of file CSCReadoutMappingFromFile.h.

00020 {}

CSCReadoutMappingFromFile::~CSCReadoutMappingFromFile (  )  [virtual]

Destructor.

Definition at line 12 of file CSCReadoutMappingFromFile.cc.

00012 {}


Member Function Documentation

void CSCReadoutMappingFromFile::fill ( const edm::ParameterSet ps  )  [virtual]

Fill mapping store.

Implements CSCReadoutMapping.

Definition at line 14 of file CSCReadoutMappingFromFile.cc.

References CSCReadoutMapping::addRecord(), edm::FileInPath::fullPath(), edm::ParameterSet::getParameter(), i1, i2, i3, i4, i5, i6, in, parsecf::pyparsing::line(), and theMappingFile.

Referenced by CSCReadoutMappingFromFile().

00014                                                                 {
00015   edm::FileInPath fp = ps.getParameter<edm::FileInPath>("theMappingFile");
00016   theMappingFile = fp.fullPath();
00017   std::ifstream in( theMappingFile.c_str() );
00018   std::string line;
00019   const std::string commentFlag = "#";
00020   if ( !in ) {
00021     edm::LogError("CSC") << " Failed to open file " << theMappingFile << " containing mapping.";
00022   }
00023   else
00024   {
00025     edm::LogInfo("CSC") << " Opened file " << theMappingFile << " containing mapping.";
00026 
00027     while ( getline(in, line) ) { // getline() from <string>
00028       // LogDebug("CSC") << line;
00029       if ( line[0] != commentFlag[0] ) {
00030         int i1, i2, i3, i4, i5, i6, i7, i8, i9, i10, i11;
00031         std::istringstream is( line );
00032         is >> i1 >> i2 >> i3 >> i4 >> i5 >> i6 >> i7 >> i8 >> i9 >> i10 >> i11;
00033         // LogDebug("CSC") << i1 << " " << i2 << " " << i3 << " " << i4 << " " <<
00034         //        i5 << " " << i6 << " " << i7 << " " << i8 << " " << i9;
00035         addRecord( i1, i2, i3, i4, i5, i6, i7, i8, i9, i10, i11 );
00036       }
00037     }
00038 
00039   }
00040 
00041   return;
00042 }


Member Data Documentation

std::string CSCReadoutMappingFromFile::theMappingFile [private]

Definition at line 29 of file CSCReadoutMappingFromFile.h.

Referenced by fill().


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