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 //
28  const edm::EventSetup& setup ) {
29 
30  edm::LogInfo("SiStripFedCablingBuilder") << "... creating dummy SiStripFedCabling Data for Run " << run.run() << "\n " << std::endl;
31 
32  edm::LogVerbatim("SiStripFedCablingBuilder")
33  << "[SiStripFedCablingBuilder::" << __func__ << "]"
34  << " Retrieving FED cabling...";
36  setup.get<SiStripFedCablingRcd>().get( fed );
37 
38  edm::LogVerbatim("SiStripFedCablingBuilder")
39  << "[SiStripFedCablingBuilder::" << __func__ << "]"
40  << " Retrieving FEC cabling...";
42  setup.get<SiStripFecCablingRcd>().get( fec );
43 
44  edm::LogVerbatim("SiStripFedCablingBuilder")
45  << "[SiStripFedCablingBuilder::" << __func__ << "]"
46  << " Retrieving DET cabling...";
48  setup.get<SiStripDetCablingRcd>().get( det );
49 
50  edm::LogVerbatim("SiStripFedCablingBuilder")
51  << "[SiStripFedCablingBuilder::" << __func__ << "]"
52  << " Retrieving REGION cabling...";
54  setup.get<SiStripRegionCablingRcd>().get( region );
55 
56  if ( !fed.isValid() ) {
57  edm::LogError("SiStripFedCablingBuilder")
58  << " Invalid handle to FED cabling object: ";
59  return;
60  }
61 
63  setup.get<TrackerTopologyRcd>().get(tTopo);
64  {
65  std::stringstream ss;
66  ss << "[SiStripFedCablingBuilder::" << __func__ << "]"
67  << " VERBOSE DEBUG" << std::endl;
68  fed->print(ss, tTopo.product());
69  ss << std::endl;
70  if ( printFecCabling_ && fec.isValid() ) { fec->print( ss ); }
71  ss << std::endl;
72  if ( printDetCabling_ && det.isValid() ) { det->print( ss ); }
73  ss << std::endl;
74  if ( printRegionCabling_ && region.isValid() ) { region->print( ss ); }
75  ss << std::endl;
76  edm::LogVerbatim("SiStripFedCablingBuilder") << ss.str();
77  }
78 
79  {
80  std::stringstream ss;
81  ss << "[SiStripFedCablingBuilder::" << __func__ << "]"
82  << " TERSE DEBUG" << std::endl;
83  fed->terse( ss );
84  ss << std::endl;
85  edm::LogVerbatim("SiStripFedCablingBuilder") << ss.str();
86  }
87 
88  {
89  std::stringstream ss;
90  ss << "[SiStripFedCablingBuilder::" << __func__ << "]"
91  << " SUMMARY DEBUG" << std::endl;
92  fed->summary(ss, tTopo.product());
93  ss << std::endl;
94  edm::LogVerbatim("SiStripFedCablingBuilder") << ss.str();
95  }
96 
97  edm::LogVerbatim("SiStripFedCablingBuilder")
98  << "[SiStripFedCablingBuilder::" << __func__ << "]"
99  << " Copying FED cabling...";
100  SiStripFedCabling* obj = new SiStripFedCabling( *( fed.product() ) );
101 
102  //End now write sistripnoises data in DB
104 
105  if( mydbservice.isAvailable() ){
106  if ( mydbservice->isNewTagRequest("SiStripFedCablingRcd") ){
107  mydbservice->createNewIOV<SiStripFedCabling>(obj,mydbservice->beginOfTime(),mydbservice->endOfTime(),"SiStripFedCablingRcd");
108  } else {
109  mydbservice->appendSinceTime<SiStripFedCabling>(obj,mydbservice->currentTime(),"SiStripFedCablingRcd");
110  }
111  }else{
112  edm::LogError("SiStripFedCablingBuilder")<<"Service is unavailable"<<std::endl;
113  }
114 }
115 
void print(std::stringstream &) const
RunNumber_t run() const
Definition: RunBase.h:40
void terse(std::stringstream &) const
def setup(process, global_tag, zero_tesla=False)
Definition: GeneralSetup.py:1
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:46
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:63
SiStripFedCablingBuilder(const edm::ParameterSet &iConfig)
bool isValid() const
Definition: ESHandle.h:47
T const * product() const
Definition: ESHandle.h:86
void print(std::stringstream &) const
Definition: Run.h:44