CMS 3D CMS Logo

SiStripFedCablingBuilder.cc
Go to the documentation of this file.
9 #include <iostream>
10 #include <fstream>
11 #include <sstream>
12 
13 // -----------------------------------------------------------------------------
14 //
16  : printFecCabling_(pset.getUntrackedParameter<bool>("PrintFecCabling", false)),
17  printDetCabling_(pset.getUntrackedParameter<bool>("PrintDetCabling", false)),
18  printRegionCabling_(pset.getUntrackedParameter<bool>("PrintRegionCabling", false)),
19  fedCablingToken_(esConsumes<edm::Transition::BeginRun>()),
20  fecCablingToken_(esConsumes<edm::Transition::BeginRun>()),
21  detCablingToken_(esConsumes<edm::Transition::BeginRun>()),
22  regionCablingToken_(esConsumes<edm::Transition::BeginRun>()),
23  tTopoToken_(esConsumes<edm::Transition::BeginRun>()) {}
24 
25 // -----------------------------------------------------------------------------
26 //
28  edm::LogInfo("SiStripFedCablingBuilder")
29  << "... creating dummy SiStripFedCabling Data for Run " << run.run() << "\n " << std::endl;
30 
31  edm::LogVerbatim("SiStripFedCablingBuilder") << "[SiStripFedCablingBuilder::" << __func__ << "]"
32  << " Retrieving FED cabling...";
33  auto fed = setup.getHandle(fedCablingToken_);
34 
35  edm::LogVerbatim("SiStripFedCablingBuilder") << "[SiStripFedCablingBuilder::" << __func__ << "]"
36  << " Retrieving FEC cabling...";
37  auto fec = setup.getHandle(fecCablingToken_);
38 
39  edm::LogVerbatim("SiStripFedCablingBuilder") << "[SiStripFedCablingBuilder::" << __func__ << "]"
40  << " Retrieving DET cabling...";
41  auto det = setup.getHandle(detCablingToken_);
42 
43  edm::LogVerbatim("SiStripFedCablingBuilder") << "[SiStripFedCablingBuilder::" << __func__ << "]"
44  << " Retrieving REGION cabling...";
45  auto region = setup.getHandle(regionCablingToken_);
46 
47  if (!fed.isValid()) {
48  edm::LogError("SiStripFedCablingBuilder") << " Invalid handle to FED cabling object: ";
49  return;
50  }
51 
52  const auto tTopo = &setup.getData(tTopoToken_);
53  {
54  std::stringstream ss;
55  ss << "[SiStripFedCablingBuilder::" << __func__ << "]"
56  << " VERBOSE DEBUG" << std::endl;
57  fed->print(ss, tTopo);
58  ss << std::endl;
59  if (printFecCabling_ && fec.isValid()) {
60  fec->print(ss);
61  }
62  ss << std::endl;
63  if (printDetCabling_ && det.isValid()) {
64  det->print(ss);
65  }
66  ss << std::endl;
67  if (printRegionCabling_ && region.isValid()) {
68  region->print(ss);
69  }
70  ss << std::endl;
71  edm::LogVerbatim("SiStripFedCablingBuilder") << ss.str();
72  }
73 
74  {
75  std::stringstream ss;
76  ss << "[SiStripFedCablingBuilder::" << __func__ << "]"
77  << " TERSE DEBUG" << std::endl;
78  fed->terse(ss);
79  ss << std::endl;
80  edm::LogVerbatim("SiStripFedCablingBuilder") << ss.str();
81  }
82 
83  {
84  std::stringstream ss;
85  ss << "[SiStripFedCablingBuilder::" << __func__ << "]"
86  << " SUMMARY DEBUG" << std::endl;
87  fed->summary(ss, tTopo);
88  ss << std::endl;
89  edm::LogVerbatim("SiStripFedCablingBuilder") << ss.str();
90  }
91 
92  edm::LogVerbatim("SiStripFedCablingBuilder") << "[SiStripFedCablingBuilder::" << __func__ << "]"
93  << " Copying FED cabling...";
94  SiStripFedCabling* obj = new SiStripFedCabling(*(fed.product()));
95 
96  //End now write sistripnoises data in DB
98 
99  if (mydbservice.isAvailable()) {
100  if (mydbservice->isNewTagRequest("SiStripFedCablingRcd")) {
101  mydbservice->createNewIOV<SiStripFedCabling>(
102  obj, mydbservice->beginOfTime(), mydbservice->endOfTime(), "SiStripFedCablingRcd");
103  } else {
104  mydbservice->appendSinceTime<SiStripFedCabling>(obj, mydbservice->currentTime(), "SiStripFedCablingRcd");
105  }
106  } else {
107  edm::LogError("SiStripFedCablingBuilder") << "Service is unavailable" << std::endl;
108  }
109 }
SiStripFedCablingBuilder::printFecCabling_
bool printFecCabling_
Definition: SiStripFedCablingBuilder.h:29
electrons_cff.bool
bool
Definition: electrons_cff.py:393
funct::false
false
Definition: Factorize.h:29
cond::service::PoolDBOutputService::beginOfTime
cond::Time_t beginOfTime() const
Definition: PoolDBOutputService.cc:215
edm::Run
Definition: Run.h:45
edm
HLT enums.
Definition: AlignableModifier.h:19
SiStripFedCablingBuilder::detCablingToken_
edm::ESGetToken< SiStripDetCabling, SiStripDetCablingRcd > detCablingToken_
Definition: SiStripFedCablingBuilder.h:34
SiStripFedCabling.h
cond::service::PoolDBOutputService::appendSinceTime
void appendSinceTime(const T *payloadObj, cond::Time_t sinceTime, const std::string &recordName)
Definition: PoolDBOutputService.h:141
edm::LogInfo
Log< level::Info, false > LogInfo
Definition: MessageLogger.h:125
SiStripFedCabling
Contains cabling info at the device level, including DetId, APV pair numbers, hardware addresses,...
Definition: SiStripFedCabling.h:25
SiStripFedCablingBuilder::fedCablingToken_
edm::ESGetToken< SiStripFedCabling, SiStripFedCablingRcd > fedCablingToken_
Definition: SiStripFedCablingBuilder.h:32
edm::Service::isAvailable
bool isAvailable() const
Definition: Service.h:40
singleTopDQM_cfi.setup
setup
Definition: singleTopDQM_cfi.py:37
SiStripFedCablingBuilder::regionCablingToken_
edm::ESGetToken< SiStripRegionCabling, SiStripRegionCablingRcd > regionCablingToken_
Definition: SiStripFedCablingBuilder.h:35
contentValuesCheck.ss
ss
Definition: contentValuesCheck.py:33
SiStripFedCablingBuilder::beginRun
void beginRun(const edm::Run &, const edm::EventSetup &) override
Definition: SiStripFedCablingBuilder.cc:27
SiStripDetCabling.h
PoolDBOutputService.h
cond::service::PoolDBOutputService::createNewIOV
void createNewIOV(const T *firstPayloadObj, cond::Time_t firstSinceTime, cond::Time_t, const std::string &recordName)
Definition: PoolDBOutputService.h:116
Service.h
Run.h
SiStripFedCablingBuilder.h
getGTfromDQMFile.obj
obj
Definition: getGTfromDQMFile.py:32
edm::ParameterSet
Definition: ParameterSet.h:47
edm::Transition
Transition
Definition: Transition.h:12
HLT_FULL_cff.region
region
Definition: HLT_FULL_cff.py:88272
edm::Service< cond::service::PoolDBOutputService >
edm::EventSetup
Definition: EventSetup.h:57
edm::LogError
Log< level::Error, false > LogError
Definition: MessageLogger.h:123
SiStripRegionCabling.h
cond::service::PoolDBOutputService::endOfTime
cond::Time_t endOfTime() const
Definition: PoolDBOutputService.cc:213
SiStripFedCablingBuilder::SiStripFedCablingBuilder
SiStripFedCablingBuilder(const edm::ParameterSet &iConfig)
Definition: SiStripFedCablingBuilder.cc:15
writedatasetfile.run
run
Definition: writedatasetfile.py:27
SiStripFedCablingBuilder::printDetCabling_
bool printDetCabling_
Definition: SiStripFedCablingBuilder.h:30
SiStripFecCabling.h
edm::LogVerbatim
Log< level::Info, true > LogVerbatim
Definition: MessageLogger.h:128
cond::service::PoolDBOutputService::isNewTagRequest
bool isNewTagRequest(const std::string &recordName)
Definition: PoolDBOutputService.cc:128
SiStripFedCablingBuilder::printRegionCabling_
bool printRegionCabling_
Definition: SiStripFedCablingBuilder.h:31
SiStripFedCablingBuilder::tTopoToken_
edm::ESGetToken< TrackerTopology, TrackerTopologyRcd > tTopoToken_
Definition: SiStripFedCablingBuilder.h:36
SiStripFedCablingBuilder::fecCablingToken_
edm::ESGetToken< SiStripFecCabling, SiStripFecCablingRcd > fecCablingToken_
Definition: SiStripFedCablingBuilder.h:33
cond::service::PoolDBOutputService::currentTime
cond::Time_t currentTime() const
Definition: PoolDBOutputService.cc:217
muonDTDigis_cfi.pset
pset
Definition: muonDTDigis_cfi.py:27