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