CMS 3D CMS Logo

SiStripFedCablingReader.cc
Go to the documentation of this file.
12 #include <iostream>
13 #include <sstream>
14 
15 // -----------------------------------------------------------------------------
16 //
18  printFecCabling_( pset.getUntrackedParameter<bool>("PrintFecCabling",false) ),
19  printDetCabling_( pset.getUntrackedParameter<bool>("PrintDetCabling",false) ),
20  printRegionCabling_( pset.getUntrackedParameter<bool>("PrintRegionCabling",false) )
21 {;}
22 
23 // -----------------------------------------------------------------------------
24 //
26  const edm::EventSetup& setup ) {
27 
28  auto const fedRec = setup.tryToGet<SiStripFedCablingRcd>();
29  auto const fecRec = setup.tryToGet<SiStripFecCablingRcd>();
30  auto const detRec = setup.tryToGet<SiStripDetCablingRcd>();
31  auto const regRec = setup.tryToGet<SiStripRegionCablingRcd>();
32 
34  if(fedRec){
35  edm::LogVerbatim("SiStripFedCablingReader")
36  << "[SiStripFedCablingReader::" << __func__ << "]"
37  << " Retrieving FED cabling...";
38  fedRec->get( fed );
39  }
40 
42  if(fecRec){
43  edm::LogVerbatim("SiStripFedCablingReader")
44  << "[SiStripFedCablingReader::" << __func__ << "]"
45  << " Retrieving FEC cabling...";
46  fecRec->get( fec );
47  }
48 
50  if(detRec){
51  edm::LogVerbatim("SiStripFedCablingReader")
52  << "[SiStripFedCablingReader::" << __func__ << "]"
53  << " Retrieving DET cabling...";
54  detRec->get( det );
55  }
56 
58  if(regRec){
59  edm::LogVerbatim("SiStripFedCablingReader")
60  << "[SiStripFedCablingReader::" << __func__ << "]"
61  << " Retrieving REGION cabling...";
62  regRec->get( region );
63  }
64 
65  if ( !fed.isValid() ) {
66  edm::LogError("SiStripFedCablingReader")
67  << " Invalid handle to FED cabling object: ";
68  return;
69  }
70 
71  {
72  std::stringstream ss;
73  ss << "[SiStripFedCablingReader::" << __func__ << "]"
74  << " VERBOSE DEBUG" << std::endl;
75  if(fedRec) {
77  setup.get<TrackerTopologyRcd>().get(tTopo);
78  fed->print(ss, tTopo.product());
79  }
80  ss << std::endl;
81  if ( fecRec && printFecCabling_ && fec.isValid() ) { fec->print( ss ); }
82  ss << std::endl;
83  if ( detRec && printDetCabling_ && det.isValid() ) { det->print( ss ); }
84  ss << std::endl;
85  if ( regRec && printRegionCabling_ && region.isValid() ) { region->print( ss ); }
86  ss << std::endl;
87  edm::LogVerbatim("SiStripFedCablingReader") << ss.str();
88  }
89 
90  if(fedRec){
91  std::stringstream ss;
92  ss << "[SiStripFedCablingReader::" << __func__ << "]"
93  << " TERSE DEBUG" << std::endl;
94  fed->terse( ss );
95  ss << std::endl;
96  edm::LogVerbatim("SiStripFedCablingReader") << ss.str();
97  }
98 
99  if(fedRec){
100  std::stringstream ss;
101  ss << "[SiStripFedCablingReader::" << __func__ << "]"
102  << " SUMMARY DEBUG" << std::endl;
104  setup.get<TrackerTopologyRcd>().get(tTopo);
105  fed->summary(ss, tTopo.product());
106  ss << std::endl;
107  edm::LogVerbatim("SiStripFedCablingReader") << ss.str();
108  }
109 
110 }
void print(std::stringstream &) const
std::optional< T > tryToGet() const
Definition: EventSetup.h:87
def setup(process, global_tag, zero_tesla=False)
Definition: GeneralSetup.py:2
void print(std::stringstream &) const
SiStripFedCablingReader(const edm::ParameterSet &)
T get() const
Definition: EventSetup.h:68
bool isValid() const
Definition: ESHandle.h:45
T const * product() const
Definition: ESHandle.h:84
void beginRun(const edm::Run &, const edm::EventSetup &) override
void print(std::stringstream &) const
bool get(HolderT &iHolder) const
Definition: Run.h:44