CMS 3D CMS Logo

Typedefs | Functions | Variables
SiStripDetInfoFileReader Namespace Reference

Typedefs

using DetInfo = SiStripDetInfo::DetInfo
 

Functions

SiStripDetInfo read (std::string filePath)
 

Variables

static constexpr char const *const kDefaultFile = "CalibTracker/SiStripCommon/data/SiStripDetInfo.dat"
 

Typedef Documentation

◆ DetInfo

Definition at line 8 of file SiStripDetInfoFileReader.h.

Function Documentation

◆ read()

SiStripDetInfo SiStripDetInfoFileReader::read ( std::string  filePath)

Read SiStrip detector info from a file

Definition at line 11 of file SiStripDetInfoFileReader.cc.

References dt4ml_dqm_sourceclient-live_cfg::filePath, makeListRunsInFiles::inputFile, eostools::move(), and Calorimetry_cff::thickness.

Referenced by SiStripPedestalsBuilder::analyze(), SiStripThresholdBuilder::analyze(), SiStripApvGainBuilder::analyze(), SiStripNoisesBuilder::analyze(), SiStripNoisesAndBadCompsChecker::analyze(), SiStripApvGainFromFileBuilder::analyze(), sistrip::badStripFromFedErr(), sistrip::badStripFromFedErrLegacyDQMFile(), SiStripQualityHotStripIdentifier::bookHistos(), SiStripDetVOffBuilder::BuildDetVOffObj(), SiStripPopConNoisesHandlerFromDQM::dqmEndJob(), SiStripPopConPedestalsHandlerFromDQM::dqmEndJob(), SiStripPopConBadComponentsHandlerFromDQM::dqmEndJob(), SiStripHitEfficiencyHarvester::dqmEndJob(), SiStripPI::fillBCArrays(), popcon::SiStripPopConHandlerUnitTestGain< T >::fillObject(), popcon::SiStripPopConHandlerUnitTest< T >::fillObject(), popcon::SiStripPopConHandlerUnitTestNoise< T >::fillObject(), SiStripPI::fillTotalComponents(), SiStripGainFromAsciiFile::getNewObject(), SiStripBadModuleByHandBuilder::getNewObject(), SiStripBadChannelBuilder::getNewObject(), SiStripBadChannelPatcher::getNewObject(), SiStripQualityHotStripIdentifier::getNewObject(), SiStripQualityHotStripIdentifierRoot::getNewObject(), SiStripNoisesFromDBMiscalibrator::getNewObject_withDefaults(), OverlapValidation::OverlapValidation(), SiStripGainSimESProducer::produce(), SiStripGainESProducer::produce(), SiStripQualityFakeESSource::produce(), SiStripQualityESProducer::produce(), SiStripApvGainFakeESSource::SiStripApvGainFakeESSource(), SiStripBadModuleConfigurableFakeESSource::SiStripBadModuleConfigurableFakeESSource(), SiStripBaseCondObjDQM::SiStripBaseCondObjDQM(), SiStripBaseDelayFakeESSource::SiStripBaseDelayFakeESSource(), SiStripCondVisualizer::SiStripCondVisualizer(), SiStripDB2Tree::SiStripDB2Tree(), SiStripFedCablingFakeESSource::SiStripFedCablingFakeESSource(), SiStripHitEffFromCalibTree::SiStripHitEffFromCalibTree(), SiStripHitResolFromCalibTree::SiStripHitResolFromCalibTree(), SiStripLatencyFakeESSource::SiStripLatencyFakeESSource(), SiStripNoisesFakeESSource::SiStripNoisesFakeESSource(), SiStripPedestalsFakeESSource::SiStripPedestalsFakeESSource(), and SiStripThresholdFakeESSource::SiStripThresholdFakeESSource().

11  {
12  edm::LogInfo("SiStripDetInfoFileReader") << "filePath " << filePath;
13 
14  std::map<uint32_t, DetInfo> detData_;
15  std::vector<uint32_t> detIds_;
16 
17  std::ifstream inputFile;
18  inputFile.open(filePath.c_str());
19 
20  if (inputFile.is_open()) {
21  for (;;) {
22  uint32_t detid;
23  double stripLength;
24  unsigned short numberOfAPVs;
25  float thickness;
26 
27  inputFile >> detid >> numberOfAPVs >> stripLength >> thickness;
28 
29  if (!(inputFile.eof() || inputFile.fail())) {
30  detIds_.push_back(detid);
31 
32  // inputFile >> numberOfAPVs;
33  // inputFile >> stripLength;
34 
35  // edm::LogInfo("SiStripDetInfoFileReader::SiStripDetInfoFileReader") << detid <<" " <<numberOfAPVs <<" " <<stripLength << " "<< thickness<< endl;
36 
37  if (detData_.find(detid) == detData_.end()) {
38  detData_[detid] = DetInfo(numberOfAPVs, stripLength, thickness);
39  } else {
40  edm::LogError("SiStripDetInfoFileReader::SiStripDetInfoFileReader")
41  << "DetId " << detid << " already found on file. Ignoring new data";
42 
43  detIds_.pop_back();
44  continue;
45  }
46  } else if (inputFile.eof()) {
47  edm::LogInfo("SiStripDetInfoFileReader::SiStripDetInfoFileReader - END of file reached");
48  break;
49 
50  } else if (inputFile.fail()) {
51  edm::LogError("SiStripDetInfoFileReader::SiStripDetInfoFileReader - ERROR while reading file");
52  break;
53  }
54  }
55  inputFile.close();
56  } else {
57  edm::LogError("SiStripDetInfoFileReader::SiStripDetInfoFileReader - Unable to open file");
58  return SiStripDetInfo();
59  }
60 
61  return SiStripDetInfo(std::move(detData_), std::move(detIds_));
62 }
SiStripDetInfo::DetInfo DetInfo
Log< level::Error, false > LogError
Log< level::Info, false > LogInfo
def move(src, dest)
Definition: eostools.py:511

Variable Documentation

◆ kDefaultFile

constexpr char const* const SiStripDetInfoFileReader::kDefaultFile = "CalibTracker/SiStripCommon/data/SiStripDetInfo.dat"
static