CMS 3D CMS Logo

SiStripFedCablingBuilder.cc
Go to the documentation of this file.
13 #include <iostream>
14 #include <fstream>
15 #include <sstream>
16 
17 // -----------------------------------------------------------------------------
18 //
20  : printFecCabling_(pset.getUntrackedParameter<bool>("PrintFecCabling", false)),
21  printDetCabling_(pset.getUntrackedParameter<bool>("PrintDetCabling", false)),
22  printRegionCabling_(pset.getUntrackedParameter<bool>("PrintRegionCabling", false)) {
23  ;
24 }
25 
26 // -----------------------------------------------------------------------------
27 //
29  edm::LogInfo("SiStripFedCablingBuilder")
30  << "... creating dummy SiStripFedCabling Data for Run " << run.run() << "\n " << std::endl;
31 
32  edm::LogVerbatim("SiStripFedCablingBuilder") << "[SiStripFedCablingBuilder::" << __func__ << "]"
33  << " Retrieving FED cabling...";
35  setup.get<SiStripFedCablingRcd>().get(fed);
36 
37  edm::LogVerbatim("SiStripFedCablingBuilder") << "[SiStripFedCablingBuilder::" << __func__ << "]"
38  << " Retrieving FEC cabling...";
40  setup.get<SiStripFecCablingRcd>().get(fec);
41 
42  edm::LogVerbatim("SiStripFedCablingBuilder") << "[SiStripFedCablingBuilder::" << __func__ << "]"
43  << " Retrieving DET cabling...";
45  setup.get<SiStripDetCablingRcd>().get(det);
46 
47  edm::LogVerbatim("SiStripFedCablingBuilder") << "[SiStripFedCablingBuilder::" << __func__ << "]"
48  << " Retrieving REGION cabling...";
51 
52  if (!fed.isValid()) {
53  edm::LogError("SiStripFedCablingBuilder") << " Invalid handle to FED cabling object: ";
54  return;
55  }
56 
58  setup.get<TrackerTopologyRcd>().get(tTopo);
59  {
60  std::stringstream ss;
61  ss << "[SiStripFedCablingBuilder::" << __func__ << "]"
62  << " VERBOSE DEBUG" << std::endl;
63  fed->print(ss, tTopo.product());
64  ss << std::endl;
65  if (printFecCabling_ && fec.isValid()) {
66  fec->print(ss);
67  }
68  ss << std::endl;
69  if (printDetCabling_ && det.isValid()) {
70  det->print(ss);
71  }
72  ss << std::endl;
73  if (printRegionCabling_ && region.isValid()) {
74  region->print(ss);
75  }
76  ss << std::endl;
77  edm::LogVerbatim("SiStripFedCablingBuilder") << ss.str();
78  }
79 
80  {
81  std::stringstream ss;
82  ss << "[SiStripFedCablingBuilder::" << __func__ << "]"
83  << " TERSE DEBUG" << std::endl;
84  fed->terse(ss);
85  ss << std::endl;
86  edm::LogVerbatim("SiStripFedCablingBuilder") << ss.str();
87  }
88 
89  {
90  std::stringstream ss;
91  ss << "[SiStripFedCablingBuilder::" << __func__ << "]"
92  << " SUMMARY DEBUG" << std::endl;
93  fed->summary(ss, tTopo.product());
94  ss << std::endl;
95  edm::LogVerbatim("SiStripFedCablingBuilder") << ss.str();
96  }
97 
98  edm::LogVerbatim("SiStripFedCablingBuilder") << "[SiStripFedCablingBuilder::" << __func__ << "]"
99  << " Copying FED cabling...";
101 
102  //End now write sistripnoises data in DB
104 
105  if (mydbservice.isAvailable()) {
106  if (mydbservice->isNewTagRequest("SiStripFedCablingRcd")) {
107  mydbservice->createNewIOV<SiStripFedCabling>(
108  obj, mydbservice->beginOfTime(), mydbservice->endOfTime(), "SiStripFedCablingRcd");
109  } else {
110  mydbservice->appendSinceTime<SiStripFedCabling>(obj, mydbservice->currentTime(), "SiStripFedCablingRcd");
111  }
112  } else {
113  edm::LogError("SiStripFedCablingBuilder") << "Service is unavailable" << std::endl;
114  }
115 }
SiStripFedCabling::print
void print(std::stringstream &ss, const TrackerTopology *trackerTopo) const
LEFT FOR COMPATIBILITY. SHOULD BE REPLACED BY PRINTDEBUG.
Definition: SiStripFedCabling.h:93
edm::ESHandle::product
T const * product() const
Definition: ESHandle.h:86
SiStripFedCablingBuilder::printFecCabling_
bool printFecCabling_
Definition: SiStripFedCablingBuilder.h:20
electrons_cff.bool
bool
Definition: electrons_cff.py:372
funct::false
false
Definition: Factorize.h:34
cond::service::PoolDBOutputService::beginOfTime
cond::Time_t beginOfTime() const
Definition: PoolDBOutputService.cc:187
edm::Run
Definition: Run.h:45
SiStripFecCabling::print
void print(std::stringstream &) const
Definition: SiStripFecCabling.cc:334
edm::LogInfo
Definition: MessageLogger.h:254
SiStripFedCabling.h
cond::service::PoolDBOutputService::appendSinceTime
void appendSinceTime(const T *payloadObj, cond::Time_t sinceTime, const std::string &recordName)
Definition: PoolDBOutputService.h:135
SiStripFecCablingRcd.h
SiStripFedCabling
Contains cabling info at the device level, including DetId, APV pair numbers, hardware addresses,...
Definition: SiStripFedCabling.h:25
edm::Service::isAvailable
bool isAvailable() const
Definition: Service.h:40
singleTopDQM_cfi.setup
setup
Definition: singleTopDQM_cfi.py:37
contentValuesCheck.ss
ss
Definition: contentValuesCheck.py:33
SiStripFedCablingRcd
Definition: SiStripCondDataRecords.h:22
SiStripFedCablingBuilder::beginRun
void beginRun(const edm::Run &, const edm::EventSetup &) override
Definition: SiStripFedCablingBuilder.cc:28
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:110
Service.h
Run.h
edm::ESHandle< SiStripFedCabling >
SiStripDetCablingRcd
Definition: SiStripDependentRecords.h:19
SiStripFedCablingBuilder.h
SiStripFecCablingRcd
Definition: SiStripDependentRecords.h:15
getGTfromDQMFile.obj
obj
Definition: getGTfromDQMFile.py:32
edm::ParameterSet
Definition: ParameterSet.h:36
edm::LogError
Definition: MessageLogger.h:183
edm::Service< cond::service::PoolDBOutputService >
edm::LogVerbatim
Definition: MessageLogger.h:297
SiStripDetCabling::print
void print(std::stringstream &) const
Definition: SiStripDetCabling.cc:386
edm::EventSetup
Definition: EventSetup.h:57
SiStripRegionCablingRcd
Definition: SiStripDependentRecords.h:23
get
#define get
edm::ESHandleBase::isValid
bool isValid() const
Definition: ESHandle.h:44
SiStripRegionCabling.h
cond::service::PoolDBOutputService::endOfTime
cond::Time_t endOfTime() const
Definition: PoolDBOutputService.cc:185
SiStripFedCablingBuilder::SiStripFedCablingBuilder
SiStripFedCablingBuilder(const edm::ParameterSet &iConfig)
Definition: SiStripFedCablingBuilder.cc:19
writedatasetfile.run
run
Definition: writedatasetfile.py:27
SiStripRegionCablingRcd.h
SiStripFedCablingBuilder::printDetCabling_
bool printDetCabling_
Definition: SiStripFedCablingBuilder.h:21
SiStripFecCabling.h
HLT_2018_cff.region
region
Definition: HLT_2018_cff.py:81479
cond::service::PoolDBOutputService::isNewTagRequest
bool isNewTagRequest(const std::string &recordName)
Definition: PoolDBOutputService.cc:100
SiStripFedCablingRcd.h
SiStripFedCabling::summary
void summary(std::stringstream &ss, const TrackerTopology *trackerTopo) const
LEFT FOR COMPATIBILITY. SHOULD BE REPLACED BY PRINTSUMMARY.
Definition: SiStripFedCabling.h:101
SiStripFedCablingBuilder::printRegionCabling_
bool printRegionCabling_
Definition: SiStripFedCablingBuilder.h:22
SiStripFedCabling::terse
void terse(std::stringstream &) const
Definition: SiStripFedCabling.cc:249
SiStripDetCablingRcd.h
TrackerTopologyRcd
Definition: TrackerTopologyRcd.h:10
cond::service::PoolDBOutputService::currentTime
cond::Time_t currentTime() const
Definition: PoolDBOutputService.cc:189
muonDTDigis_cfi.pset
pset
Definition: muonDTDigis_cfi.py:27