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 
100  using namespace edm::es;
101 
102 
103  auto pL1GtParameters = std::make_shared<L1GtParameters>();
104 
105 
106  // set total Bx's in the event
107  pL1GtParameters->setGtTotalBxInEvent(m_totalBxInEvent);
108 
109  // set the active boards for L1 GT DAQ record
110  pL1GtParameters->setGtDaqActiveBoards(m_daqActiveBoards);
111 
112  // set the active boards for L1 GT EVM record
113  pL1GtParameters->setGtEvmActiveBoards(m_evmActiveBoards);
114 
115  // set the number of Bx per board for L1 GT DAQ record
116  pL1GtParameters->setGtDaqNrBxBoard(m_daqNrBxBoard);
117 
118  // set the number of Bx per board for L1 GT EVM record
119  pL1GtParameters->setGtEvmNrBxBoard(m_evmNrBxBoard);
120 
121  // set length of BST record (in bytes) for L1 GT EVM record
122  pL1GtParameters->setGtBstLengthBytes(m_bstLengthBytes);
123 
124  return pL1GtParameters ;
125 }
126 
T getParameter(std::string const &) const
std::shared_ptr< L1GtParameters > produceGtParameters(const L1GtParametersRcd &)
public methods
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
void setWhatProduced(T *iThis, const es::Label &iLabel=es::Label())
Definition: ESProducer.h:115
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
boost::uint16_t m_daqActiveBoards
active boards in the L1 DAQ record