CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
L1GtPsbSetupTrivialProducer.cc
Go to the documentation of this file.
1 
17 // this class header
19 
20 // system include files
21 #include <memory>
22 #include "boost/shared_ptr.hpp"
23 
24 #include <vector>
25 
26 // user include files
28 
31 
33 
34 // forward declarations
35 
36 //
37 
38 
39 // constructor(s)
41  const edm::ParameterSet& parSet)
42 {
43  // tell the framework what data is being produced
45 
46  // now do what ever other initialization is needed
47 
48  // detailed input configuration for PSB
49  std::vector<edm::ParameterSet> psbSetup = parSet.getParameter<std::vector<
50  edm::ParameterSet> > ("PsbSetup");
51 
52  // reserve space for L1 GT boards
53  m_gtPsbSetup.reserve(psbSetup.size());
54 
55  std::vector<unsigned int> enableRecLvdsInt;
56  enableRecLvdsInt.reserve(L1GtPsbConfig::PsbNumberLvdsGroups);
57  std::vector<bool> enableRecLvds;
58  enableRecLvds.reserve(L1GtPsbConfig::PsbNumberLvdsGroups);
59 
60  std::vector<unsigned int> enableRecSerLinkInt;
61  enableRecSerLinkInt.reserve(L1GtPsbConfig::PsbSerLinkNumberChannels);
62  std::vector<bool> enableRecSerLink;
63  enableRecSerLink.reserve(L1GtPsbConfig::PsbSerLinkNumberChannels);
64 
65  for (std::vector<edm::ParameterSet>::const_iterator itPSet =
66  psbSetup.begin(); itPSet != psbSetup.end(); ++itPSet) {
67 
68  //
69  L1GtPsbConfig psbConfig(itPSet->getParameter<int> ("Slot"));
70 
71  psbConfig.setGtPsbCh0SendLvds(
72  itPSet->getParameter<bool> ("Ch0SendLvds"));
73  psbConfig.setGtPsbCh1SendLvds(
74  itPSet->getParameter<bool> ("Ch1SendLvds"));
75 
76  enableRecLvdsInt = itPSet->getParameter<std::vector<unsigned int> > (
77  "EnableRecLvds");
78 
79  for (std::vector<unsigned int>::const_iterator cIt =
80  enableRecLvdsInt.begin(); cIt != enableRecLvdsInt.end(); ++cIt) {
81  bool val = *cIt;
82  enableRecLvds.push_back(val);
83  }
84 
85  psbConfig.setGtPsbEnableRecLvds(enableRecLvds);
86  enableRecLvds.clear();
87 
88  enableRecSerLinkInt
89  = itPSet->getParameter<std::vector<unsigned int> > (
90  "EnableRecSerLink");
91 
92  for (std::vector<unsigned int>::const_iterator cIt =
93  enableRecSerLinkInt.begin(); cIt != enableRecSerLinkInt.end(); ++cIt) {
94  bool val = *cIt;
95  enableRecSerLink.push_back(val);
96  }
97 
98  psbConfig.setGtPsbEnableRecSerLink(enableRecSerLink);
99  enableRecSerLink.clear();
100 
101  // push the board in the vector
102  m_gtPsbSetup.push_back(psbConfig);
103 
104  }
105 
106 }
107 
108 // destructor
110 {
111 
112  // empty
113 
114 }
115 
116 // member functions
117 
118 // method called to produce the data
119 boost::shared_ptr<L1GtPsbSetup> L1GtPsbSetupTrivialProducer::producePsbSetup(
120  const L1GtPsbSetupRcd& iRecord)
121 {
122 
123  using namespace edm::es;
124 
125  boost::shared_ptr<L1GtPsbSetup> pL1GtPsbSetup = boost::shared_ptr<
126  L1GtPsbSetup>(new L1GtPsbSetup());
127 
128  pL1GtPsbSetup->setGtPsbSetup(m_gtPsbSetup);
129 
130  return pL1GtPsbSetup;
131 }
132 
T getParameter(std::string const &) const
void setGtPsbEnableRecLvds(const std::vector< bool > &)
void setGtPsbCh0SendLvds(const bool &)
static const int PsbSerLinkNumberChannels
number of channels per board
Definition: L1GtPsbConfig.h:65
void setGtPsbSetup(const std::vector< L1GtPsbConfig > &)
Definition: L1GtPsbSetup.cc:43
static const int PsbNumberLvdsGroups
number of LVDS groups per board
Definition: L1GtPsbConfig.h:62
void setWhatProduced(T *iThis, const es::Label &iLabel=es::Label())
Definition: ESProducer.h:115
void setGtPsbEnableRecSerLink(const std::vector< bool > &)
L1GtPsbSetupTrivialProducer(const edm::ParameterSet &)
constructor
std::vector< L1GtPsbConfig > m_gtPsbSetup
L1 GT PSB boards and their setup.
void setGtPsbCh1SendLvds(const bool &)
boost::shared_ptr< L1GtPsbSetup > producePsbSetup(const L1GtPsbSetupRcd &)
public methods