CMS 3D CMS Logo

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 ()
 
 CSCTriggerElectronicsMappingFromFile (std::string filename)
 Constructor. More...
 
void fill (void) override
 Fill mapping store. More...
 
 ~CSCTriggerElectronicsMappingFromFile () override
 Destructor. More...
 
- Public Member Functions inherited from CSCTriggerElectronicsMapping
 CSCTriggerElectronicsMapping ()
 Constructor. More...
 
 ~CSCTriggerElectronicsMapping () override
 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() [1/2]

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

Constructor.

Definition at line 6 of file CSCTriggerElectronicsMappingFromFile.cc.

7  fill();
8 }

References fill().

◆ CSCTriggerElectronicsMappingFromFile() [2/2]

CSCTriggerElectronicsMappingFromFile::CSCTriggerElectronicsMappingFromFile ( )
inline

Definition at line 17 of file CSCTriggerElectronicsMappingFromFile.h.

17 {}

◆ ~CSCTriggerElectronicsMappingFromFile()

CSCTriggerElectronicsMappingFromFile::~CSCTriggerElectronicsMappingFromFile ( )
override

Destructor.

Definition at line 10 of file CSCTriggerElectronicsMappingFromFile.cc.

10 {}

Member Function Documentation

◆ fill()

void CSCTriggerElectronicsMappingFromFile::fill ( void  )
overridevirtual

Fill mapping store.

Implements CSCTriggerMapping.

Definition at line 12 of file CSCTriggerElectronicsMappingFromFile.cc.

12  {
13  std::ifstream in(filename_.c_str());
15  const std::string commentFlag = "#";
16  if (!in) {
17  std::cout << "CSCTriggerElectronicsMappingFromFile: ERROR! Failed to open file containing mapping, " << filename_
18  << std::endl;
19  } else {
20  std::cout << "CSCTriggerElectronicsMappingFromFile: opened file containing mapping, " << filename_ << std::endl;
21 
22  while (getline(in, line)) { // getline() from <string>
23  if (debugV())
24  std::cout << line << std::endl;
25  if (line[0] != commentFlag[0]) {
26  int i1, i2, i3, i6, i7, i8, i9, i10;
27  std::istringstream is(line);
28  is >> i1 >> i2 >> i3 >> i6 >> i7 >> i8 >> i9 >> i10;
29  if (debugV())
30  std::cout << i1 << " " << i2 << " " << i3 << " " << i6 << " " << i7 << " " << i8 << " " << i9 << " " << i10
31  << std::endl;
32  addRecord(i1, i2, i3, 0, 0, i6, i7, i8, i9, i10);
33  }
34  }
35  }
36 
37  return;
38 }

References CSCTriggerMapping::addRecord(), gather_cfg::cout, CSCTriggerMapping::debugV(), filename_, testProducerWithPsetDescEmpty_cfi::i1, testProducerWithPsetDescEmpty_cfi::i2, testProducerWithPsetDescEmpty_cfi::i3, recoMuon::in, mps_splice::line, and AlCaHLTBitMon_QueryRunRegistry::string.

Referenced by CSCTriggerElectronicsMappingFromFile().

Member Data Documentation

◆ filename_

std::string CSCTriggerElectronicsMappingFromFile::filename_
private

Definition at line 26 of file CSCTriggerElectronicsMappingFromFile.h.

Referenced by fill().

testProducerWithPsetDescEmpty_cfi.i2
i2
Definition: testProducerWithPsetDescEmpty_cfi.py:46
testProducerWithPsetDescEmpty_cfi.i3
i3
Definition: testProducerWithPsetDescEmpty_cfi.py:47
gather_cfg.cout
cout
Definition: gather_cfg.py:144
testProducerWithPsetDescEmpty_cfi.i1
i1
Definition: testProducerWithPsetDescEmpty_cfi.py:45
corrVsCorr.filename
filename
Definition: corrVsCorr.py:123
CSCTriggerMapping::addRecord
void addRecord(int rendcap, int rstation, int rsector, int rsubsector, int rcscid, int cendcap, int cstation, int csector, int csubsector, int ccscid)
Definition: CSCTriggerMapping.cc:31
AlCaHLTBitMon_QueryRunRegistry.string
string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
recoMuon::in
Definition: RecoMuonEnumerators.h:6
CSCTriggerElectronicsMappingFromFile::fill
void fill(void) override
Fill mapping store.
Definition: CSCTriggerElectronicsMappingFromFile.cc:12
CSCTriggerMapping::debugV
bool debugV(void) const
Definition: CSCTriggerMapping.h:121
CSCTriggerElectronicsMappingFromFile::filename_
std::string filename_
Definition: CSCTriggerElectronicsMappingFromFile.h:26
mps_splice.line
line
Definition: mps_splice.py:76