CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Member Functions | Private Attributes
CSCTriggerElectronicsMappingFromFile Class Reference

#include <CSCTriggerElectronicsMappingFromFile.h>

Inheritance diagram for CSCTriggerElectronicsMappingFromFile:
CSCTriggerElectronicsMapping CSCTriggerMapping

Public Member Functions

 CSCTriggerElectronicsMappingFromFile (std::string filename)
 Constructor. More...
 
 CSCTriggerElectronicsMappingFromFile ()
 
virtual void fill (void)
 Fill mapping store. More...
 
virtual ~CSCTriggerElectronicsMappingFromFile ()
 Destructor. More...
 
- Public Member Functions inherited from CSCTriggerElectronicsMapping
 CSCTriggerElectronicsMapping ()
 Constructor. More...
 
virtual ~CSCTriggerElectronicsMapping ()
 Destructor. More...
 
- Public Member Functions inherited from CSCTriggerMapping
void addRecord (int rendcap, int rstation, int rsector, int rsubsector, int rcscid, int cendcap, int cstation, int csector, int csubsector, int ccscid)
 
int chamber (int endcap, int station, int sector, int subsector, int cscid) const
 
 CSCTriggerMapping ()
 Default constructor. More...
 
bool debugV (void) const
 
CSCDetId detId (int endcap, int station, int sector, int subsector, int cscid, int layer=0) const
 
const std::string & myName (void) const
 
void setDebugV (bool dbg)
 
virtual ~CSCTriggerMapping ()
 Destructor. More...
 

Private Attributes

std::string filename_
 

Additional Inherited Members

- Public Types inherited from CSCTriggerMapping
typedef struct
CSCTriggerMapping::CSCTriggerConnection 
Connection
 

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

CSCTriggerElectronicsMappingFromFile::CSCTriggerElectronicsMappingFromFile ( )
inline

Definition at line 18 of file CSCTriggerElectronicsMappingFromFile.h.

18 {}
CSCTriggerElectronicsMappingFromFile::~CSCTriggerElectronicsMappingFromFile ( )
virtual

Destructor.

Definition at line 9 of file CSCTriggerElectronicsMappingFromFile.cc.

9 {}

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

11  {
12  std::ifstream in( filename_.c_str() );
13  std::string line;
14  const std::string commentFlag = "#";
15  if ( !in ) {
16  std::cout << "CSCTriggerElectronicsMappingFromFile: ERROR! Failed to open file containing mapping, " <<
17  filename_ << std::endl ;
18  }
19  else
20  {
21  std::cout << "CSCTriggerElectronicsMappingFromFile: opened file containing mapping, " <<
22  filename_ << std::endl ;
23 
24  while ( getline(in, line) ) { // getline() from <string>
25  if ( debugV() ) std::cout << line << std::endl;
26  if ( line[0] != commentFlag[0] ) {
27  int i1, i2, i3, i6, i7, i8, i9, i10;
28  std::istringstream is( line );
29  is >> i1 >> i2 >> i3 >> i6 >> i7 >> i8 >> i9 >> i10;
30  if ( debugV() ) std::cout << i1 << " " << i2 << " " << i3 << " "
31  << i6 << " " << i7 << " " << i8 << " "
32  << i9 << " " << i10 << std::endl;
33  addRecord( i1, i2, i3, 0, 0, i6, i7, i8, i9 , i10);
34  }
35  }
36 
37  }
38 
39  return;
40 }
bool debugV(void) const
void addRecord(int rendcap, int rstation, int rsector, int rsubsector, int rcscid, int cendcap, int cstation, int csector, int csubsector, int ccscid)
tuple cout
Definition: gather_cfg.py:121

Member Data Documentation

std::string CSCTriggerElectronicsMappingFromFile::filename_
private

Definition at line 27 of file CSCTriggerElectronicsMappingFromFile.h.

Referenced by fill().