CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
SiStripLatencyGenerator.cc
Go to the documentation of this file.
3 #include <boost/cstdint.hpp>
6 
7 #include "CLHEP/Random/RandFlat.h"
8 #include "CLHEP/Random/RandGauss.h"
9 
12 {
13  edm::LogInfo("SiStripLatencyGenerator") << "[SiStripLatencyGenerator::SiStripLatencyGenerator]";
14 }
15 
17 {
18  edm::LogInfo("SiStripLatencyGenerator") << "[SiStripLatencyGenerator::~SiStripLatencyGenerator]";
19 }
20 
22 {
24 
25  // Read the full list of detIds
28  const std::map<uint32_t, SiStripDetInfoFileReader::DetInfo > detInfos = reader.getAllData();
29  // Take the last detId. Since the map is sorted it will be the biggest value
30  if( !detInfos.empty() ) {
31  // Set the apv number as 6, the highest possible
32  edm::LogInfo("SiStripLatencyGenerator") << "detId = " << detInfos.rbegin()->first << " apv = " << 6
33  << " latency = " << _pset.getParameter<uint32_t>("latency")
34  << " mode = " << _pset.getParameter<uint32_t>("mode") << std::endl;
35  obj->put(detInfos.rbegin()->first, 6, _pset.getParameter<uint32_t>("latency"), _pset.getParameter<uint32_t>("mode") );
36 
37  // Call this method to collapse all consecutive detIdAndApvs with the same latency and mode to a single entry
38  obj->compress();
39  }
40  else {
41  edm::LogError("SiStripLatencyGenerator") << "Error: detInfo map is empty. Cannot get the last detId." << std::endl;
42  }
43  return obj;
44 }
T getParameter(std::string const &) const
bool put(const uint32_t detId, const uint16_t apv, const uint16_t latency, const uint16_t mode)
SiStripLatencyGenerator(const edm::ParameterSet &, const edm::ActivityRegistry &)
std::string fullPath() const
Definition: FileInPath.cc:171