CMS 3D CMS Logo

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