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 
62  {
63  std::stringstream ss;
64  ss << "[SiStripFedCablingBuilder::" << __func__ << "]"
65  << " VERBOSE DEBUG" << std::endl;
66  fed->print( ss );
67  ss << std::endl;
68  if ( printFecCabling_ && fec.isValid() ) { fec->print( ss ); }
69  ss << std::endl;
70  if ( printDetCabling_ && det.isValid() ) { det->print( ss ); }
71  ss << std::endl;
72  if ( printRegionCabling_ && region.isValid() ) { region->print( ss ); }
73  ss << std::endl;
74  edm::LogVerbatim("SiStripFedCablingBuilder") << ss.str();
75  }
76 
77  {
78  std::stringstream ss;
79  ss << "[SiStripFedCablingBuilder::" << __func__ << "]"
80  << " TERSE DEBUG" << std::endl;
81  fed->terse( ss );
82  ss << std::endl;
83  edm::LogVerbatim("SiStripFedCablingBuilder") << ss.str();
84  }
85 
86  {
87  std::stringstream ss;
88  ss << "[SiStripFedCablingBuilder::" << __func__ << "]"
89  << " SUMMARY DEBUG" << std::endl;
90  fed->summary( ss );
91  ss << std::endl;
92  edm::LogVerbatim("SiStripFedCablingBuilder") << ss.str();
93  }
94 
95  edm::LogVerbatim("SiStripFedCablingBuilder")
96  << "[SiStripFedCablingBuilder::" << __func__ << "]"
97  << " Copying FED cabling...";
98  SiStripFedCabling* obj = new SiStripFedCabling( *( fed.product() ) );
99 
100  //End now write sistripnoises data in DB
102 
103  if( mydbservice.isAvailable() ){
104  if ( mydbservice->isNewTagRequest("SiStripFedCablingRcd") ){
105  mydbservice->createNewIOV<SiStripFedCabling>(obj,mydbservice->beginOfTime(),mydbservice->endOfTime(),"SiStripFedCablingRcd");
106  } else {
107  mydbservice->appendSinceTime<SiStripFedCabling>(obj,mydbservice->currentTime(),"SiStripFedCablingRcd");
108  }
109  }else{
110  edm::LogError("SiStripFedCablingBuilder")<<"Service is unavailable"<<std::endl;
111  }
112 }
113 
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 appendSinceTime(T *payloadObj, cond::Time_t sinceTime, const std::string &recordName, bool withlogging=false)
bool isNewTagRequest(const std::string &recordName)
void print(std::stringstream &ss) const
LEFT FOR COMPATIBILITY. SHOULD BE REPLACED BY PRINTDEBUG.
void summary(std::stringstream &ss) const
LEFT FOR COMPATIBILITY. SHOULD BE REPLACED BY PRINTSUMMARY.
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)
const T & get() const
Definition: EventSetup.h:56
Contains cabling info at the device level, including DetId, APV pair numbers, hardware addresses...
void beginRun(const edm::Run &, const edm::EventSetup &)
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:42