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...";
50  setup.get<SiStripRegionCablingRcd>().get(region);
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 }
void print(std::stringstream &) const
RunNumber_t run() const
Definition: RunBase.h:40
void terse(std::stringstream &) const
void beginRun(const edm::Run &, const edm::EventSetup &) override
void print(std::stringstream &ss, const TrackerTopology *trackerTopo) const
LEFT FOR COMPATIBILITY. SHOULD BE REPLACED BY PRINTDEBUG.
void appendSinceTime(T *payloadObj, cond::Time_t sinceTime, const std::string &recordName, bool withlogging=false)
bool isNewTagRequest(const std::string &recordName)
bool isAvailable() const
Definition: Service.h:40
void print(std::stringstream &) const
void createNewIOV(T *firstPayloadObj, cond::Time_t firstSinceTime, cond::Time_t firstTillTime, const std::string &recordName, bool withlogging=false)
Contains cabling info at the device level, including DetId, APV pair numbers, hardware addresses...
void summary(std::stringstream &ss, const TrackerTopology *trackerTopo) const
LEFT FOR COMPATIBILITY. SHOULD BE REPLACED BY PRINTSUMMARY.
T get() const
Definition: EventSetup.h:73
SiStripFedCablingBuilder(const edm::ParameterSet &iConfig)
bool isValid() const
Definition: ESHandle.h:44
T const * product() const
Definition: ESHandle.h:86
void print(std::stringstream &) const
Definition: Run.h:45