CMS 3D CMS Logo

L1GtParametersTrivialProducer.cc
Go to the documentation of this file.
1 
15 // this class header
17 
18 // system include files
19 #include <memory>
20 
21 #include <boost/cstdint.hpp>
22 
23 
24 // user include files
25 // base class
27 
29 
32 
34 
35 // forward declarations
36 
37 // constructor(s)
39 {
40  // tell the framework what data is being produced
42 
43  // now do what ever other initialization is needed
44 
45  // total Bx's in the event
46 
47  m_totalBxInEvent = parSet.getParameter<int>("TotalBxInEvent");
48 
49  if (m_totalBxInEvent > 0) {
50  if ( (m_totalBxInEvent%2) == 0 ) {
52 
53  edm::LogInfo("L1GtParametersTrivialProducer")
54  << "\nWARNING: Number of bunch crossing in event rounded to: "
55  << m_totalBxInEvent << "\n The number must be an odd number!\n"
56  << std::endl;
57  }
58  } else {
59 
60  edm::LogInfo("L1GtParametersTrivialProducer")
61  << "\nWARNING: Number of bunch crossing in event must be a positive number!"
62  << "\n Requested value was: " << m_totalBxInEvent
63  << "\n Reset to 1 (L1Accept bunch only).\n"
64  << std::endl;
65 
66  m_totalBxInEvent = 1;
67 
68  }
69 
70  m_daqActiveBoards = static_cast<boost::uint16_t> (parSet.getParameter<unsigned int> (
71  "DaqActiveBoards"));
72 
73  m_evmActiveBoards = static_cast<boost::uint16_t> (parSet.getParameter<unsigned int> (
74  "EvmActiveBoards"));
75 
76  m_daqNrBxBoard = parSet.getParameter<std::vector<int> > ("DaqNrBxBoard");
77 
78  m_evmNrBxBoard = parSet.getParameter<std::vector<int> > ("EvmNrBxBoard");
79 
80  m_bstLengthBytes = parSet.getParameter<unsigned int> ("BstLengthBytes");
81 
82 }
83 
84 // destructor
86 {
87 
88  // empty
89 
90 }
91 
92 
93 // member functions
94 
95 // method called to produce the data
97  const L1GtParametersRcd& iRecord)
98 {
99  auto pL1GtParameters = std::make_unique<L1GtParameters>();
100 
101  // set total Bx's in the event
102  pL1GtParameters->setGtTotalBxInEvent(m_totalBxInEvent);
103 
104  // set the active boards for L1 GT DAQ record
105  pL1GtParameters->setGtDaqActiveBoards(m_daqActiveBoards);
106 
107  // set the active boards for L1 GT EVM record
108  pL1GtParameters->setGtEvmActiveBoards(m_evmActiveBoards);
109 
110  // set the number of Bx per board for L1 GT DAQ record
111  pL1GtParameters->setGtDaqNrBxBoard(m_daqNrBxBoard);
112 
113  // set the number of Bx per board for L1 GT EVM record
114  pL1GtParameters->setGtEvmNrBxBoard(m_evmNrBxBoard);
115 
116  // set length of BST record (in bytes) for L1 GT EVM record
117  pL1GtParameters->setGtBstLengthBytes(m_bstLengthBytes);
118 
119  return pL1GtParameters ;
120 }
T getParameter(std::string const &) const
auto setWhatProduced(T *iThis, const es::Label &iLabel={})
Definition: ESProducer.h:116
std::vector< int > m_daqNrBxBoard
number of Bx per board in the DAQ record
unsigned int m_bstLengthBytes
length of BST record (in bytes)
L1GtParametersTrivialProducer(const edm::ParameterSet &)
constructor
std::unique_ptr< L1GtParameters > produceGtParameters(const L1GtParametersRcd &)
public methods
std::vector< int > m_evmNrBxBoard
number of Bx per board in the EVM record
boost::uint16_t m_evmActiveBoards
active boards in the L1 EVM record
int m_totalBxInEvent
total Bx&#39;s in the event
~L1GtParametersTrivialProducer() override
destructor
boost::uint16_t m_daqActiveBoards
active boards in the L1 DAQ record