CMS 3D CMS Logo

List of all members | Public Member Functions | Private Attributes
CSCReadoutMappingFromFile Class Reference

#include <CSCReadoutMappingFromFile.h>

Inheritance diagram for CSCReadoutMappingFromFile:
CSCReadoutMappingForSliceTest CSCReadoutMapping

Public Member Functions

 CSCReadoutMappingFromFile ()
 
 CSCReadoutMappingFromFile (const edm::ParameterSet &ps)
 Constructor. More...
 
void fill (const edm::ParameterSet &ps) override
 Fill mapping store. More...
 
 ~CSCReadoutMappingFromFile () override
 Destructor. More...
 
- Public Member Functions inherited from CSCReadoutMappingForSliceTest
 CSCReadoutMappingForSliceTest ()
 Constructor. More...
 
 ~CSCReadoutMappingForSliceTest () override
 Destructor. More...
 
- Public Member Functions inherited from CSCReadoutMapping
void addRecord (int endcap, int station, int ring, int chamber, int vmecrate, int dmb, int tmb, int tsector, int cscid, int ddu, int dcc)
 
int chamber (int endcap, int station, int vmecrate, int dmb, int tmb) const
 
int crate (const CSCDetId &) const
 returns vmecrate given CSCDetId More...
 
 CSCReadoutMapping ()
 Default constructor. More...
 
int dccId (const CSCDetId &) const
 returns DCC# given CSCDetId More...
 
int dduId (const CSCDetId &) const
 returns DDU# given CSCDetId More...
 
bool debugV (void) const
 
CSCDetId detId (int endcap, int station, int vmecrate, int dmb, int tmb, int cfeb, int layer=0) const
 
int dmbId (const CSCDetId &) const
 returns dmbId given CSCDetId More...
 
CSCLabel findHardwareId (const CSCDetId &) const
 returns hardware ids given chamber id More...
 
const std::string & myName (void) const
 
void setDebugV (bool dbg)
 
virtual ~CSCReadoutMapping ()
 Destructor. More...
 

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() [1/2]

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

Constructor.

Definition at line 8 of file CSCReadoutMappingFromFile.cc.

8 { fill(ps); }

References fill().

◆ CSCReadoutMappingFromFile() [2/2]

CSCReadoutMappingFromFile::CSCReadoutMappingFromFile ( )
inline

Definition at line 19 of file CSCReadoutMappingFromFile.h.

19 {}

◆ ~CSCReadoutMappingFromFile()

CSCReadoutMappingFromFile::~CSCReadoutMappingFromFile ( )
override

Destructor.

Definition at line 10 of file CSCReadoutMappingFromFile.cc.

10 {}

Member Function Documentation

◆ fill()

void CSCReadoutMappingFromFile::fill ( const edm::ParameterSet ps)
overridevirtual

Fill mapping store.

Implements CSCReadoutMapping.

Definition at line 12 of file CSCReadoutMappingFromFile.cc.

12  {
13  edm::FileInPath fp = ps.getParameter<edm::FileInPath>("theMappingFile");
14  theMappingFile = fp.fullPath();
15  std::ifstream in(theMappingFile.c_str());
17  const std::string commentFlag = "#";
18  if (!in) {
19  edm::LogError("CSC") << " Failed to open file " << theMappingFile << " containing mapping.";
20  } else {
21  edm::LogInfo("CSC") << " Opened file " << theMappingFile << " containing mapping.";
22 
23  while (getline(in, line)) { // getline() from <string>
24  // LogDebug("CSC") << line;
25  if (line[0] != commentFlag[0]) {
26  int i1, i2, i3, i4, i5, i6, i7, i8, i9, i10, i11;
27  std::istringstream is(line);
28  is >> i1 >> i2 >> i3 >> i4 >> i5 >> i6 >> i7 >> i8 >> i9 >> i10 >> i11;
29  // LogDebug("CSC") << i1 << " " << i2 << " " << i3 << " " << i4 << " " <<
30  // i5 << " " << i6 << " " << i7 << " " << i8 << " " << i9;
31  addRecord(i1, i2, i3, i4, i5, i6, i7, i8, i9, i10, i11);
32  }
33  }
34  }
35 
36  return;
37 }

References CSCReadoutMapping::addRecord(), personalPlayback::fp, edm::ParameterSet::getParameter(), testProducerWithPsetDescEmpty_cfi::i1, testProducerWithPsetDescEmpty_cfi::i2, testProducerWithPsetDescEmpty_cfi::i3, recoMuon::in, mps_splice::line, AlCaHLTBitMon_QueryRunRegistry::string, and theMappingFile.

Referenced by CSCReadoutMappingFromFile().

Member Data Documentation

◆ theMappingFile

std::string CSCReadoutMappingFromFile::theMappingFile
private

Definition at line 28 of file CSCReadoutMappingFromFile.h.

Referenced by fill().

testProducerWithPsetDescEmpty_cfi.i2
i2
Definition: testProducerWithPsetDescEmpty_cfi.py:46
testProducerWithPsetDescEmpty_cfi.i3
i3
Definition: testProducerWithPsetDescEmpty_cfi.py:47
testProducerWithPsetDescEmpty_cfi.i1
i1
Definition: testProducerWithPsetDescEmpty_cfi.py:45
edm::LogInfo
Definition: MessageLogger.h:254
personalPlayback.fp
fp
Definition: personalPlayback.py:523
edm::FileInPath
Definition: FileInPath.h:64
CSCReadoutMappingFromFile::theMappingFile
std::string theMappingFile
Definition: CSCReadoutMappingFromFile.h:28
AlCaHLTBitMon_QueryRunRegistry.string
string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
edm::LogError
Definition: MessageLogger.h:183
CSCReadoutMapping::addRecord
void addRecord(int endcap, int station, int ring, int chamber, int vmecrate, int dmb, int tmb, int tsector, int cscid, int ddu, int dcc)
Definition: CSCReadoutMapping.cc:47
recoMuon::in
Definition: RecoMuonEnumerators.h:6
edm::ParameterSet::getParameter
T getParameter(std::string const &) const
CSCReadoutMappingFromFile::fill
void fill(const edm::ParameterSet &ps) override
Fill mapping store.
Definition: CSCReadoutMappingFromFile.cc:12
mps_splice.line
line
Definition: mps_splice.py:76